diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b4bcc85a..2a02982f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,40 +19,40 @@ jobs: runs-on: ubuntu-18.04 steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - - name: Create multimedia dir - run: sudo mkdir -p /opt/multimedia/patient_images && id - - - name: Grant read and write permissions to multimedia directory - run: sudo chmod a+rwx /opt/multimedia/patient_images - - - name: Run Unit tests with Maven - run: mvn -B clean test jacoco:report --file pom.xml --no-transfer-progress - - - name: Set Branch name Environment variable - env: - BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }} - run: echo "BRANCH_NAME=${BRANCH_NAME_OR_REF#refs/heads/}" >> $GITHUB_ENV - - - name: Set PR Number Environment variable - run: | - echo "PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")" >> $GITHUB_ENV - - - name: Upload coveralls report - env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }} - run: | - mvn -B coveralls:report --file pom.xml \ - --no-transfer-progress \ - -D repoToken="$COVERALLS_REPO_TOKEN" \ - -D serviceName=Github \ - -D branch="$BRANCH_NAME" \ - -D pullRequest="$PR_NUMBER" \ + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Create multimedia dir + run: sudo mkdir -p /opt/multimedia/patient_images && id + + - name: Grant read and write permissions to multimedia directory + run: sudo chmod a+rwx /opt/multimedia/patient_images + + - name: Run Unit tests with Maven + run: mvn -B clean test jacoco:report --file pom.xml --no-transfer-progress + + - name: Set Branch name Environment variable + env: + BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }} + run: echo "BRANCH_NAME=${BRANCH_NAME_OR_REF#refs/heads/}" >> $GITHUB_ENV + + - name: Set PR Number Environment variable + run: | + echo "PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")" >> $GITHUB_ENV + + - name: Upload coveralls report + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }} + run: | + mvn -B coveralls:report --file pom.xml \ + --no-transfer-progress \ + -D repoToken="$COVERALLS_REPO_TOKEN" \ + -D serviceName=Github \ + -D branch="$BRANCH_NAME" \ + -D pullRequest="$PR_NUMBER" \ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7260e1aa9..d1507dc72 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ on: tags: - v[0-9]+.[0-9]+.[0-9]+-SNAPSHOT - v[0-9]+.[0-9]+.[0-9]+-[0-9a-zA-Z]+-SNAPSHOT - - v[0-9]+.[0-9]+.[0-9]+-[0-9a-zA-Z]+-[0-9a-zA-Z]+-SNAPSHOT + - v[0-9]+.[0-9]+.[0-9]+-[0-9a-zA-Z]+-[0-9a-zA-Z]+-SNAPSHOT jobs: release: @@ -17,11 +17,11 @@ jobs: - name: Cancel previous workflow runs uses: styfle/cancel-workflow-action@0.9.1 with: - access_token: ${{ github.token }} + access_token: ${{ github.token }} - uses: actions/checkout@v2 with: - submodules: recursive + submodules: recursive - name: Set up JDK 11 uses: actions/setup-java@v1 @@ -34,7 +34,7 @@ jobs: SETTINGS_FILE: ${{ secrets.SETTINGS_XML }} - name: Generate & upload library snapshot artifact JAR (Java Archive) file - run: mvn clean deploy -Dmaven.test.skip=true --no-transfer-progress + run: mvn clean deploy -Dmaven.test.skip=true --no-transfer-progress - name: Github Release uses: softprops/action-gh-release@v1 diff --git a/README.md b/README.md index 3d59310c6..1fa02dfb9 100755 --- a/README.md +++ b/README.md @@ -8,32 +8,35 @@ Postgres, couchdb, lucene and scheduler domain objects, repositories and service ## Relevant Wiki Pages -* OpenSRP Server Refactor and Cleanup - * [Refactor and Cleanup](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/562659330/OpenSRP+Server+Refactor+and+Clean+up) - * [How to upload and use maven jar artifacts](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/564428801/How+to+upload+and+use+maven+jar+artifacts) - * [Managing Server Wide Properties](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/602570753/Managing+Server+Wide+Properties) - * [Server Web Build](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/616595457/Server+Web+Build) -* [OpenSRP Server Build](https://smartregister.atlassian.net/wiki/display/Documentation/OpenSRP+Server+Build) -* Deployment - * [Docker Setup](https://smartregister.atlassian.net/wiki/display/Documentation/Docker+Setup) - * [Docker Compose Setup](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/52690976/Docker+Compose+Setup) - * [Ansible Playbooks](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/540901377/Ansible+Playbooks) -* [Postgres Database Support](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/251068417/Postgres+Database+Support+as+Main+Datastore) -* [OpenSRP Load Testing](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/268075009/OpenSRP+Load+Testing) +* OpenSRP Server Refactor and Cleanup + * [Refactor and Cleanup](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/562659330/OpenSRP+Server+Refactor+and+Clean+up) + * [How to upload and use maven jar artifacts](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/564428801/How+to+upload+and+use+maven+jar+artifacts) + * [Managing Server Wide Properties](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/602570753/Managing+Server+Wide+Properties) + * [Server Web Build](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/616595457/Server+Web+Build) +* [OpenSRP Server Build](https://smartregister.atlassian.net/wiki/display/Documentation/OpenSRP+Server+Build) +* Deployment + * [Docker Setup](https://smartregister.atlassian.net/wiki/display/Documentation/Docker+Setup) + * [Docker Compose Setup](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/52690976/Docker+Compose+Setup) + * [Ansible Playbooks](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/540901377/Ansible+Playbooks) +* [Postgres Database Support](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/251068417/Postgres+Database+Support+as+Main+Datastore) +* [OpenSRP Load Testing](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/268075009/OpenSRP+Load+Testing) ## Running Integration Tests -We use [test-containers](https://github.com/testcontainers/testcontainers-java) to create ephemeral instances of the postgres database and rabbitmq server for the integration tests. This means that one does not have to set up any instance to run the integration tests on one's machine. +We use [test-containers](https://github.com/testcontainers/testcontainers-java) to create ephemeral instances of the +postgres database and rabbitmq server for the integration tests. This means that one does not have to set up any +instance to run the integration tests on one's machine. ### How it works When an integration test is run/executed: -* Test-Containers will pull a docker image and/or start a docker container needed. -* Test-Containers will then provide a dynamic port to connect to, from the hosts network. -* A single instance is created for all the tests. -* The docker container will be killed once all the tests have been executed. +* Test-Containers will pull a docker image and/or start a docker container needed. +* Test-Containers will then provide a dynamic port to connect to, from the hosts network. +* A single instance is created for all the tests. +* The docker container will be killed once all the tests have been executed. ## Publishing artifacts -For more on publishing this artifact see [Publishing via Tag](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/3013902337/How+to+set+up+Server+Library+artifact+CI+CD+on+Github#Publishing-via-TAG) +For more on publishing this artifact +see [Publishing via Tag](https://smartregister.atlassian.net/wiki/spaces/Documentation/pages/3013902337/How+to+set+up+Server+Library+artifact+CI+CD+on+Github#Publishing-via-TAG) diff --git a/pom.xml b/pom.xml index f60f8870c..9778ef33b 100644 --- a/pom.xml +++ b/pom.xml @@ -1,756 +1,757 @@ - - 4.0.0 - org.smartregister + + 4.0.0 + org.smartregister - opensrp-server-core - jar - 3.2.6-SNAPSHOT - opensrp-server-core - OpenSRP Server Core module - https://github.com/OpenSRP/opensrp-server-core + opensrp-server-core + jar + 3.2.6-SNAPSHOT + opensrp-server-core + OpenSRP Server Core module + https://github.com/OpenSRP/opensrp-server-core - - ${project.basedir} - 5.2.20.RELEASE - 2.2.13.RELEASE - 5.5.7 - 3.5.7 - 2.0.6 - 5.4.24.Final - always - UTF-8 - 1.5.1 + + ${project.basedir} + 5.2.20.RELEASE + 2.2.13.RELEASE + 5.5.7 + 3.5.7 + 2.0.6 + 5.4.24.Final + always + UTF-8 + 1.5.1 - 1.1.3-SNAPSHOT - 2.0.1-SNAPSHOT - 1.6.7-SNAPSHOT - 2.12.6 - 2.0.5 - 1.18.12 - 2.2.13.RELEASE - 3.8.0 - 2.2.22.RELEASE - 2.17.1 + 1.1.3-SNAPSHOT + 2.0.1-SNAPSHOT + 1.6.7-SNAPSHOT + 2.12.6 + 2.0.5 + 1.18.12 + 2.2.13.RELEASE + 3.8.0 + 2.2.22.RELEASE + 2.17.1 - + - - - nexus-snapshots - Nexus Snapshots Repository - https://oss.sonatype.org/content/repositories/snapshots - false - - - nexus-releases - https://oss.sonatype.org/service/local/staging/deploy/maven2 - - + + + nexus-snapshots + Nexus Snapshots Repository + https://oss.sonatype.org/content/repositories/snapshots + false + + + nexus-releases + https://oss.sonatype.org/service/local/staging/deploy/maven2 + + - - scm:git:git@github.com:OpenSRP/opensrp-server-core.git - scm:git:git@github.com:OpenSRP/opensrp-server-core.git - https://github.com/OpenSRP/opensrp-server-core - + + scm:git:git@github.com:OpenSRP/opensrp-server-core.git + scm:git:git@github.com:OpenSRP/opensrp-server-core.git + https://github.com/OpenSRP/opensrp-server-core + - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - repo - Open Smart Register Platform (OpenSRP) is Licensed under the Apache License, Version 2.0 - - + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + repo + Open Smart Register Platform (OpenSRP) is Licensed under the Apache License, Version 2.0 + + + - - - opensrp_developer - OpenSRP Developer - info@smartregister.org - https://groups.google.com/forum/#!forum/opensrp-dev - OpenSRP - http://smartregister.org - - developer - - Africa/Nairobi - - + + + opensrp_developer + OpenSRP Developer + info@smartregister.org + https://groups.google.com/forum/#!forum/opensrp-dev + OpenSRP + http://smartregister.org + + developer + + Africa/Nairobi + + - - - snapshots-repo - https://oss.sonatype.org/content/repositories/snapshots - - false - - - true - - - + + + snapshots-repo + https://oss.sonatype.org/content/repositories/snapshots + + false + + + true + + + - - - com.aliyun.oss - aliyun-sdk-oss - 3.14.0 - + + + com.aliyun.oss + aliyun-sdk-oss + 3.14.0 + - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson.version} - + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + - - - com.amazonaws - aws-java-sdk - 1.12.142 - - - org.springframework - spring-core - ${spring.version} - - - commons-logging - commons-logging - - - - - org.springframework - spring-test - ${spring.version} - test - - - commons-logging - commons-logging - - - - - org.springframework - spring-context - ${spring.version} - - - org.springframework - spring-aop - ${spring.version} - - - org.springframework - spring-aspects - ${spring.version} - - - org.springframework - spring-jdbc - ${spring.version} - - - org.springframework.security - spring-security-core - ${spring.security.version} - - - org.smartregister - opensrp-server-api - ${opensrp.api.version} - - - org.apache.commons - commons-lang3 - - - - - org.smartregister - opensrp-server-interface - ${opensrp.interface.version} - - - org.apache.commons - commons-lang3 - - - - - org.smartregister - opensrp-plan-evaluator - ${opensrp.plan.evaluator.version} - - - org.apache.poi - poi - 4.1.2 - - - ch.maxant - rules - 2.1.0 - - - org.apache.httpcomponents - httpclient - 4.5.13 - - - org.apache.commons - commons-dbcp2 - 2.9.0 - - - - org.springframework.data - spring-data-jpa - ${spring.data.version} - - - nl.jqno.equalsverifier - equalsverifier - 3.9 - test - - - com.openpojo - openpojo - 0.9.1 - - - - org.hibernate - hibernate-core - ${hibernate.version} - - - org.hibernate - hibernate-entitymanager - ${hibernate.version} - - - - org.springframework - spring-orm - ${spring.version} - - - - org.mybatis - mybatis - ${mybatis.version} - - - org.mybatis - mybatis-spring - ${mybatis.spring.version} - - - org.jacoco - org.jacoco.agent - 0.7.9 - test - runtime - - - - org.apache.tomcat - tomcat-jdbc - 9.0.56 - - - - - org.postgresql - postgresql - 42.2.25.jre7 - - - - org.json - json - 20190722 - - - javax.annotation - javax.annotation-api - 1.3.2 - - - - com.google.code.gson - gson - 2.8.9 - + + + com.amazonaws + aws-java-sdk + 1.12.142 + + + org.springframework + spring-core + ${spring.version} + + + commons-logging + commons-logging + + + + + org.springframework + spring-test + ${spring.version} + test + + + commons-logging + commons-logging + + + + + org.springframework + spring-context + ${spring.version} + + + org.springframework + spring-aop + ${spring.version} + + + org.springframework + spring-aspects + ${spring.version} + + + org.springframework + spring-jdbc + ${spring.version} + + + org.springframework.security + spring-security-core + ${spring.security.version} + + + org.smartregister + opensrp-server-api + ${opensrp.api.version} + + + org.apache.commons + commons-lang3 + + + + + org.smartregister + opensrp-server-interface + ${opensrp.interface.version} + + + org.apache.commons + commons-lang3 + + + + + org.smartregister + opensrp-plan-evaluator + ${opensrp.plan.evaluator.version} + + + org.apache.poi + poi + 4.1.2 + + + ch.maxant + rules + 2.1.0 + + + org.apache.httpcomponents + httpclient + 4.5.13 + + + org.apache.commons + commons-dbcp2 + 2.9.0 + + + + org.springframework.data + spring-data-jpa + ${spring.data.version} + + + nl.jqno.equalsverifier + equalsverifier + 3.9 + test + + + com.openpojo + openpojo + 0.9.1 + + + + org.hibernate + hibernate-core + ${hibernate.version} + + + org.hibernate + hibernate-entitymanager + ${hibernate.version} + + + + org.springframework + spring-orm + ${spring.version} + + + + org.mybatis + mybatis + ${mybatis.version} + + + org.mybatis + mybatis-spring + ${mybatis.spring.version} + + + org.jacoco + org.jacoco.agent + 0.7.9 + test + runtime + + + + org.apache.tomcat + tomcat-jdbc + 9.0.56 + + + + + org.postgresql + postgresql + 42.2.25.jre7 + + + + org.json + json + 20190722 + + + javax.annotation + javax.annotation-api + 1.3.2 + + + + com.google.code.gson + gson + 2.8.9 + - - org.projectlombok - lombok - ${lombok.version} - provided - - - - javax.validation - validation-api - 2.0.1.Final - - - org.hibernate.validator - hibernate-validator - 6.0.22.Final - - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - 2.10.2 - + + org.projectlombok + lombok + ${lombok.version} + provided + + + + javax.validation + validation-api + 2.0.1.Final + + + org.hibernate.validator + hibernate-validator + 6.0.22.Final + + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + 2.10.2 + - - - com.jayway.jsonpath - json-path - 2.4.0 - - - org.apache.logging.log4j - log4j-api - ${log4j.version} - - - org.apache.logging.log4j - log4j-core - ${log4j.version} - - - - org.mybatis - mybatis-migrations - 3.3.10 - + + + com.jayway.jsonpath + json-path + 2.4.0 + + + org.apache.logging.log4j + log4j-api + ${log4j.version} + + + org.apache.logging.log4j + log4j-core + ${log4j.version} + + + + org.mybatis + mybatis-migrations + 3.3.10 + - - org.springframework.data - spring-data-redis - ${spring.data.redis} - - - redis.clients - jedis - ${redis.jedis.version} - test - + + org.springframework.data + spring-data-redis + ${spring.data.redis} + + + redis.clients + jedis + ${redis.jedis.version} + test + - - - junit - junit - 4.13.2 - test - - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - - - org.powermock - powermock-module-junit4-rule - ${powermock.version} - test - - - org.powermock - powermock-api-mockito2 - ${powermock.version} - test - - - org.powermock - powermock-classloading-xstream - ${powermock.version} - test - - - org.mockito - mockito-core - 3.3.0 - test - - - org.hamcrest - hamcrest-core - 2.2 - test - - - org.testcontainers - testcontainers - 1.17.1 - test - - + + + junit + junit + 4.13.2 + test + + + org.powermock + powermock-module-junit4 + ${powermock.version} + test + + + org.powermock + powermock-module-junit4-rule + ${powermock.version} + test + + + org.powermock + powermock-api-mockito2 + ${powermock.version} + test + + + org.powermock + powermock-classloading-xstream + ${powermock.version} + test + + + org.mockito + mockito-core + 3.3.0 + test + + + org.hamcrest + hamcrest-core + 2.2 + test + + + org.testcontainers + testcontainers + 1.17.1 + test + + - - - - configs/assets/config - - - configs/assets/schedules - schedules - - - configs/build - true - - maven.properties - - - - src/main/java/org/opensrp/repository/postgres/mapper/xml - org/opensrp/repository/postgres/mapper/xml - - - src/main/java/org/opensrp/repository/postgres/mapper/custom/xml - org/opensrp/repository/postgres/mapper/custom/xml - - - configs/assets/migrations/environments - mybatis/environments - - - configs/assets/migrations/scripts - mybatis/scripts - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 11 - 11 - true - UTF-8 - - - org.projectlombok - lombok - ${lombok.version} - - - - - - org.apache.maven.plugins - maven-resources-plugin - 3.1.0 - - UTF-8 - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.2.0 - - - **/*.properties - - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadocs - - jar - - - none - - - - - - org.codehaus.mojo - properties-maven-plugin - 1.0.0 - - - initialize - - read-project-properties - - - - ${basedir}/configs/build/maven.properties - ${basedir}/configs/assets/config/opensrp.properties - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.2 - - true - - **/it/** - + + + + configs/assets/config + + + configs/assets/schedules + schedules + + + configs/build + true + + maven.properties + + + + src/main/java/org/opensrp/repository/postgres/mapper/xml + org/opensrp/repository/postgres/mapper/xml + + + src/main/java/org/opensrp/repository/postgres/mapper/custom/xml + org/opensrp/repository/postgres/mapper/custom/xml + + + configs/assets/migrations/environments + mybatis/environments + + + configs/assets/migrations/scripts + mybatis/scripts + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + 11 + true + UTF-8 + + + org.projectlombok + lombok + ${lombok.version} + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + UTF-8 + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + **/*.properties + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + none + + + + + + org.codehaus.mojo + properties-maven-plugin + 1.0.0 + + + initialize + + read-project-properties + + + + ${basedir}/configs/build/maven.properties + ${basedir}/configs/assets/config/opensrp.properties + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + true + + **/it/** + - - - - org.sonatype.plugins - nexus-staging-maven-plugin - ${nexus-staging-maven-plugin.version} - - - default-deploy - deploy - - deploy - - - - - nexus-snapshots - https://oss.sonatype.org/ - true - - - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - ${basedir}/target/coverage-reports/jacoco-unit.exec - ${basedir}/target/coverage-reports/jacoco-unit.exec - - org/opensrp/domain/postgres/* - org/opensrp/repository/postgres/mapper/* - - - - - jacoco-initialize - - prepare-agent - - - - jacoco-site - test - - report - - - - - - org.eluder.coveralls - coveralls-maven-plugin - 4.3.0 - - - javax.xml.bind - jaxb-api - 2.3.1 - - - - - + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus-staging-maven-plugin.version} + + + default-deploy + deploy + + deploy + + + + + nexus-snapshots + https://oss.sonatype.org/ + true + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/jacoco-unit.exec + + org/opensrp/domain/postgres/* + org/opensrp/repository/postgres/mapper/* + + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + + + + org.eluder.coveralls + coveralls-maven-plugin + 4.3.0 + + + javax.xml.bind + jaxb-api + 2.3.1 + + + + + - - - skip-integration-tests - - - - org.apache.maven.plugins - maven-failsafe-plugin - 2.9 - - - - integration-test - verify - - - -XX:MaxPermSize=1024M - - **/it/** - - true - - - - - - - - - integration-tests - - true - + + + skip-integration-tests + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.9 + + + + integration-test + verify + + + -XX:MaxPermSize=1024M + + **/it/** + + true + + + + + + + + + integration-tests + + true + - - - - - org.apache.maven.plugins - maven-failsafe-plugin - 2.9 - - - - integration-test - verify - - - -XX:MaxPermSize=1024M - - **/it/** - - true - - - - - - - - - - couchdb - - - opensrp.database.type - couchdb - - - - couchDb - - - - postgres - - true - - opensrp.database.type - postgres - - - - postgres - - - - release - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.5.1 - - - default-deploy - deploy - - deploy - - - - - nexus-releases - https://oss.sonatype.org/ - false - true - - - - - - - rabbitmq - - true - - opensrp.queuing.service - rabbitmq - - - - rabbitmq - - - - - org.springframework.amqp - spring-amqp - ${spring.ampqp.version} - + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.9 + + + + integration-test + verify + + + -XX:MaxPermSize=1024M + + **/it/** + + true + + + + + + + + + + couchdb + + + opensrp.database.type + couchdb + + + + couchDb + + + + postgres + + true + + opensrp.database.type + postgres + + + + postgres + + + + release + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.5.1 + + + default-deploy + deploy + + deploy + + + + + nexus-releases + https://oss.sonatype.org/ + false + true + + + + + + + rabbitmq + + true + + opensrp.queuing.service + rabbitmq + + + + rabbitmq + + + + + org.springframework.amqp + spring-amqp + ${spring.ampqp.version} + - - - org.springframework.amqp - spring-rabbit - ${spring.ampqp.version} - - - - + + + org.springframework.amqp + spring-rabbit + ${spring.ampqp.version} + + + + diff --git a/src/main/java/org/opensrp/config/RabbitMQConfig.java b/src/main/java/org/opensrp/config/RabbitMQConfig.java index 56a235614..adc2a16cf 100644 --- a/src/main/java/org/opensrp/config/RabbitMQConfig.java +++ b/src/main/java/org/opensrp/config/RabbitMQConfig.java @@ -31,118 +31,118 @@ @Configuration public class RabbitMQConfig { - @Value("${rabbitmq.queue}") - private String queueName; - - @Value("${rabbitmq.exchange}") - private String exchange; - - @Value("${rabbitmq.routingkey}") - private String routingkey; - - @Value("${rabbitmq.username}") - private String username; - - @Value("${rabbitmq.password}") - private String password; - - @Value("${rabbitmq.host}") - private String host; - - @Value("${rabbitmq.port}") - private int port; - - @Value("${rabbitmq.virtualhost}") - private String virtualHost; - - @Value("${rabbitmq.reply.timeout}") - private Integer replyTimeout; - - @Value("${rabbitmq.concurrent.consumers}") - private Integer concurrentConsumers; - - @Value("${rabbitmq.max.concurrent.consumers}") - private Integer maxConcurrentConsumers; - - @Bean - public Queue queue() { - return new Queue(queueName, false); - } - - @Bean - public DirectExchange exchange() { - return new DirectExchange(exchange); - } - - @Bean - public Binding binding(Queue queue, DirectExchange exchange) { - return BindingBuilder.bind(queue).to(exchange).with(routingkey); - } - - @Bean - public MessageConverter jsonMessageConverter() { - ObjectMapper objectMapper = new ObjectMapper(); - objectMapper.registerModule(new JodaModule()); - return new Jackson2JsonMessageConverter(objectMapper); - } - - @Bean - public ConnectionFactory connectionFactory() { - CachingConnectionFactory connectionFactory = new CachingConnectionFactory(); - connectionFactory.setVirtualHost(virtualHost); - connectionFactory.setHost(host); - connectionFactory.setPort(port); - connectionFactory.setUsername(username); - connectionFactory.setPassword(password); - return connectionFactory; - } - - @Bean - public AmqpTemplate rabbitTemplate(ConnectionFactory connectionFactory) { - final RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory); - rabbitTemplate.setDefaultReceiveQueue(queueName); - rabbitTemplate.setMessageConverter(jsonMessageConverter()); - rabbitTemplate.setReplyAddress(queue().getName()); - rabbitTemplate.setReplyTimeout(replyTimeout); - rabbitTemplate.setUseDirectReplyToContainer(false); - return rabbitTemplate; - } - - @Bean - public AmqpAdmin amqpAdmin() { - return new RabbitAdmin(connectionFactory()); - } - - @Bean - public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory() { - final SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory(); - factory.setConnectionFactory(connectionFactory()); - factory.setMessageConverter(jsonMessageConverter()); - factory.setConcurrentConsumers(concurrentConsumers); - factory.setMaxConcurrentConsumers(maxConcurrentConsumers); - factory.setErrorHandler(errorHandler()); - return factory; - } - - @Bean - public ErrorHandler errorHandler() { - return new ConditionalRejectingErrorHandler(new MyFatalExceptionStrategy()); - } - - public static class MyFatalExceptionStrategy extends ConditionalRejectingErrorHandler.DefaultExceptionStrategy { - - private final Logger logger = LogManager.getLogger(getClass()); - - @Override - public boolean isFatal(Throwable t) { - if (t instanceof ListenerExecutionFailedException) { - ListenerExecutionFailedException lefe = (ListenerExecutionFailedException) t; - logger.error("Failed to process inbound message from queue " - + lefe.getFailedMessage().getMessageProperties().getConsumerQueue() - + "; failed message: " + lefe.getFailedMessage(), t); - } - return super.isFatal(t); - } - - } + @Value("${rabbitmq.queue}") + private String queueName; + + @Value("${rabbitmq.exchange}") + private String exchange; + + @Value("${rabbitmq.routingkey}") + private String routingkey; + + @Value("${rabbitmq.username}") + private String username; + + @Value("${rabbitmq.password}") + private String password; + + @Value("${rabbitmq.host}") + private String host; + + @Value("${rabbitmq.port}") + private int port; + + @Value("${rabbitmq.virtualhost}") + private String virtualHost; + + @Value("${rabbitmq.reply.timeout}") + private Integer replyTimeout; + + @Value("${rabbitmq.concurrent.consumers}") + private Integer concurrentConsumers; + + @Value("${rabbitmq.max.concurrent.consumers}") + private Integer maxConcurrentConsumers; + + @Bean + public Queue queue() { + return new Queue(queueName, false); + } + + @Bean + public DirectExchange exchange() { + return new DirectExchange(exchange); + } + + @Bean + public Binding binding(Queue queue, DirectExchange exchange) { + return BindingBuilder.bind(queue).to(exchange).with(routingkey); + } + + @Bean + public MessageConverter jsonMessageConverter() { + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.registerModule(new JodaModule()); + return new Jackson2JsonMessageConverter(objectMapper); + } + + @Bean + public ConnectionFactory connectionFactory() { + CachingConnectionFactory connectionFactory = new CachingConnectionFactory(); + connectionFactory.setVirtualHost(virtualHost); + connectionFactory.setHost(host); + connectionFactory.setPort(port); + connectionFactory.setUsername(username); + connectionFactory.setPassword(password); + return connectionFactory; + } + + @Bean + public AmqpTemplate rabbitTemplate(ConnectionFactory connectionFactory) { + final RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory); + rabbitTemplate.setDefaultReceiveQueue(queueName); + rabbitTemplate.setMessageConverter(jsonMessageConverter()); + rabbitTemplate.setReplyAddress(queue().getName()); + rabbitTemplate.setReplyTimeout(replyTimeout); + rabbitTemplate.setUseDirectReplyToContainer(false); + return rabbitTemplate; + } + + @Bean + public AmqpAdmin amqpAdmin() { + return new RabbitAdmin(connectionFactory()); + } + + @Bean + public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory() { + final SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory(); + factory.setConnectionFactory(connectionFactory()); + factory.setMessageConverter(jsonMessageConverter()); + factory.setConcurrentConsumers(concurrentConsumers); + factory.setMaxConcurrentConsumers(maxConcurrentConsumers); + factory.setErrorHandler(errorHandler()); + return factory; + } + + @Bean + public ErrorHandler errorHandler() { + return new ConditionalRejectingErrorHandler(new MyFatalExceptionStrategy()); + } + + public static class MyFatalExceptionStrategy extends ConditionalRejectingErrorHandler.DefaultExceptionStrategy { + + private final Logger logger = LogManager.getLogger(getClass()); + + @Override + public boolean isFatal(Throwable t) { + if (t instanceof ListenerExecutionFailedException) { + ListenerExecutionFailedException lefe = (ListenerExecutionFailedException) t; + logger.error("Failed to process inbound message from queue " + + lefe.getFailedMessage().getMessageProperties().getConsumerQueue() + + "; failed message: " + lefe.getFailedMessage(), t); + } + return super.isFatal(t); + } + + } } diff --git a/src/main/java/org/opensrp/config/ThreadPoolExecutorConfig.java b/src/main/java/org/opensrp/config/ThreadPoolExecutorConfig.java index da685343d..83091569d 100644 --- a/src/main/java/org/opensrp/config/ThreadPoolExecutorConfig.java +++ b/src/main/java/org/opensrp/config/ThreadPoolExecutorConfig.java @@ -8,22 +8,22 @@ @Configuration public class ThreadPoolExecutorConfig { - @Value("#{opensrp['thread.pool.core.size'] ?: 5 }") - private int threadPoolCoreSize; + @Value("#{opensrp['thread.pool.core.size'] ?: 5 }") + private int threadPoolCoreSize; - @Value("#{opensrp['thread.pool.max.size'] ?: 10 }") - private int threadPoolMaxSize; + @Value("#{opensrp['thread.pool.max.size'] ?: 10 }") + private int threadPoolMaxSize; - @Value("#{opensrp['thread.pool.queue.capacity'] ?: 25 }") - private int threadPoolQueueCapacity; + @Value("#{opensrp['thread.pool.queue.capacity'] ?: 25 }") + private int threadPoolQueueCapacity; - @Bean - public ThreadPoolTaskExecutor taskExecutor() { - ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); - threadPoolTaskExecutor.setCorePoolSize(threadPoolCoreSize); - threadPoolTaskExecutor.setMaxPoolSize(threadPoolMaxSize); - threadPoolTaskExecutor.setQueueCapacity(threadPoolQueueCapacity); - return threadPoolTaskExecutor; - } + @Bean + public ThreadPoolTaskExecutor taskExecutor() { + ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); + threadPoolTaskExecutor.setCorePoolSize(threadPoolCoreSize); + threadPoolTaskExecutor.setMaxPoolSize(threadPoolMaxSize); + threadPoolTaskExecutor.setQueueCapacity(threadPoolQueueCapacity); + return threadPoolTaskExecutor; + } } diff --git a/src/main/java/org/opensrp/domain/AppStateToken.java b/src/main/java/org/opensrp/domain/AppStateToken.java index 921b5c7d3..e2dab01df 100644 --- a/src/main/java/org/opensrp/domain/AppStateToken.java +++ b/src/main/java/org/opensrp/domain/AppStateToken.java @@ -9,107 +9,107 @@ import org.smartregister.domain.BaseDataEntity; public class AppStateToken extends BaseDataEntity { - - @JsonProperty - private String name; - - @JsonProperty - private Object value; - - @JsonProperty - private long lastEditDate; - - @JsonProperty - private String description; - - protected AppStateToken() { - } - - public AppStateToken(String name, Object value, long lastEditDate) { - this.name = name; - this.value = value; - this.lastEditDate = lastEditDate; - } - - public AppStateToken(String name, Object value, long lastEditDate, String description) { - this.name = name; - this.value = value; - this.lastEditDate = lastEditDate; - this.description = description; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Object getValue() { - return value; - } - - public long longValue() { - return Long.parseLong(value.toString()); - } - - public int intValue() { - return Integer.parseInt(value.toString()); - } - - public float floatValue() { - return Float.parseFloat(value.toString()); - } - - public double doubleValue() { - return Double.parseDouble(value.toString()); - } - - public String stringValue() { - return value.toString(); - } - - public LocalDate datetimeValue() { - return LocalDate.parse(value.toString()); - } - - public boolean booleanValue() { - return Boolean.parseBoolean(value.toString()); - } - - public void setValue(Object value) { - this.value = value; - } - - public long getLastEditDate() { - return lastEditDate; - } - - public void setLastEditDate(long lastEditDate) { - this.lastEditDate = lastEditDate; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - @Override - public final boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); - } - - @Override - public final int hashCode() { - return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } + + @JsonProperty + private String name; + + @JsonProperty + private Object value; + + @JsonProperty + private long lastEditDate; + + @JsonProperty + private String description; + + protected AppStateToken() { + } + + public AppStateToken(String name, Object value, long lastEditDate) { + this.name = name; + this.value = value; + this.lastEditDate = lastEditDate; + } + + public AppStateToken(String name, Object value, long lastEditDate, String description) { + this.name = name; + this.value = value; + this.lastEditDate = lastEditDate; + this.description = description; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } + + public long longValue() { + return Long.parseLong(value.toString()); + } + + public int intValue() { + return Integer.parseInt(value.toString()); + } + + public float floatValue() { + return Float.parseFloat(value.toString()); + } + + public double doubleValue() { + return Double.parseDouble(value.toString()); + } + + public String stringValue() { + return value.toString(); + } + + public LocalDate datetimeValue() { + return LocalDate.parse(value.toString()); + } + + public boolean booleanValue() { + return Boolean.parseBoolean(value.toString()); + } + + public long getLastEditDate() { + return lastEditDate; + } + + public void setLastEditDate(long lastEditDate) { + this.lastEditDate = lastEditDate; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + @Override + public final boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); + } + + @Override + public final int hashCode() { + return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this); + } } diff --git a/src/main/java/org/opensrp/domain/AssignedLocations.java b/src/main/java/org/opensrp/domain/AssignedLocations.java index 5d54a6042..ed86b09d1 100644 --- a/src/main/java/org/opensrp/domain/AssignedLocations.java +++ b/src/main/java/org/opensrp/domain/AssignedLocations.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.domain; @@ -11,62 +11,62 @@ */ public class AssignedLocations implements Serializable { - private String organizationId; + private String organizationId; - private String jurisdictionId; + private String jurisdictionId; - private String planId; + private String planId; - private Date fromDate; + private Date fromDate; - private Date toDate; + private Date toDate; - public AssignedLocations(String jurisdictionId, String planId) { - setJurisdictionId(jurisdictionId); - setPlanId(planId); - } - - public AssignedLocations() {//Default constructor, needed by mybatis - } + public AssignedLocations(String jurisdictionId, String planId) { + setJurisdictionId(jurisdictionId); + setPlanId(planId); + } - public String getOrganizationId() { - return organizationId; - } + public AssignedLocations() {//Default constructor, needed by mybatis + } - public void setOrganizationId(String organizationId) { - this.organizationId = organizationId; - } + public String getOrganizationId() { + return organizationId; + } - public String getJurisdictionId() { - return jurisdictionId; - } + public void setOrganizationId(String organizationId) { + this.organizationId = organizationId; + } - public void setJurisdictionId(String jurisdictionId) { - this.jurisdictionId = jurisdictionId; - } + public String getJurisdictionId() { + return jurisdictionId; + } - public String getPlanId() { - return planId; - } + public void setJurisdictionId(String jurisdictionId) { + this.jurisdictionId = jurisdictionId; + } - public void setPlanId(String planId) { - this.planId = planId; - } + public String getPlanId() { + return planId; + } - public Date getFromDate() { - return fromDate; - } + public void setPlanId(String planId) { + this.planId = planId; + } - public void setFromDate(Date fromDate) { - this.fromDate = fromDate; - } + public Date getFromDate() { + return fromDate; + } - public Date getToDate() { - return toDate; - } + public void setFromDate(Date fromDate) { + this.fromDate = fromDate; + } - public void setToDate(Date toDate) { - this.toDate = toDate; - } + public Date getToDate() { + return toDate; + } + + public void setToDate(Date toDate) { + this.toDate = toDate; + } } diff --git a/src/main/java/org/opensrp/domain/CSVRowConfig.java b/src/main/java/org/opensrp/domain/CSVRowConfig.java index d7cc18bd8..1d4702a09 100644 --- a/src/main/java/org/opensrp/domain/CSVRowConfig.java +++ b/src/main/java/org/opensrp/domain/CSVRowConfig.java @@ -52,8 +52,8 @@ public void setRegex(String regex) { this.regex = regex; } - public boolean validate(String value){ - if(required && StringUtils.isBlank(value)) + public boolean validate(String value) { + if (required && StringUtils.isBlank(value)) return false; return StringUtils.isBlank(value) || StringUtils.isBlank(regex) || Pattern.matches(regex, value); diff --git a/src/main/java/org/opensrp/domain/Camp.java b/src/main/java/org/opensrp/domain/Camp.java index d9ea7f450..be92f3a95 100644 --- a/src/main/java/org/opensrp/domain/Camp.java +++ b/src/main/java/org/opensrp/domain/Camp.java @@ -6,98 +6,98 @@ import org.smartregister.domain.BaseDataEntity; public class Camp extends BaseDataEntity { - - /** - * - */ - private static final long serialVersionUID = 1L; - - @JsonProperty - private String providerName; - - @JsonProperty - private String date; - - @JsonProperty - private String campName; - - @JsonProperty - private String centerName; - - @JsonProperty - private boolean status; - - @JsonProperty - private long timestamp; - - @JsonProperty - private String created_by; - - @JsonProperty - private Date created_date; - - public String getProviderName() { - return providerName; - } - - public void setProviderName(String providerName) { - this.providerName = providerName; - } - - public String getDate() { - return date; - } - - public void setDate(String date) { - this.date = date; - } - - public String getCampName() { - return campName; - } - - public void setCampName(String campName) { - this.campName = campName; - } - - public boolean isStatus() { - return status; - } - - public void setStatus(boolean status) { - this.status = status; - } - - public long getTimestamp() { - return timestamp; - } - - public void setTimestamp(long timestamp) { - this.timestamp = timestamp; - } - - public String getCreatedBy() { - return created_by; - } - - public void setCreatedBy(String created_by) { - this.created_by = created_by; - } - - public Date getCreatedDate() { - return created_date; - } - - public void setCreatedDate(Date created_date) { - this.created_date = created_date; - } - - public String getCenterName() { - return centerName; - } - - public void setCenterName(String centerName) { - this.centerName = centerName; - } - + + /** + * + */ + private static final long serialVersionUID = 1L; + + @JsonProperty + private String providerName; + + @JsonProperty + private String date; + + @JsonProperty + private String campName; + + @JsonProperty + private String centerName; + + @JsonProperty + private boolean status; + + @JsonProperty + private long timestamp; + + @JsonProperty + private String created_by; + + @JsonProperty + private Date created_date; + + public String getProviderName() { + return providerName; + } + + public void setProviderName(String providerName) { + this.providerName = providerName; + } + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public String getCampName() { + return campName; + } + + public void setCampName(String campName) { + this.campName = campName; + } + + public boolean isStatus() { + return status; + } + + public void setStatus(boolean status) { + this.status = status; + } + + public long getTimestamp() { + return timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + } + + public String getCreatedBy() { + return created_by; + } + + public void setCreatedBy(String created_by) { + this.created_by = created_by; + } + + public Date getCreatedDate() { + return created_date; + } + + public void setCreatedDate(Date created_date) { + this.created_date = created_date; + } + + public String getCenterName() { + return centerName; + } + + public void setCenterName(String centerName) { + this.centerName = centerName; + } + } diff --git a/src/main/java/org/opensrp/domain/Campaign.java b/src/main/java/org/opensrp/domain/Campaign.java index 0b781c27d..077ce2f8b 100644 --- a/src/main/java/org/opensrp/domain/Campaign.java +++ b/src/main/java/org/opensrp/domain/Campaign.java @@ -6,94 +6,94 @@ public class Campaign { - private String identifier; + private String identifier; - private String title; + private String title; - private String description; + private String description; - private TaskStatus status; + private TaskStatus status; - private Period executionPeriod; + private Period executionPeriod; - private DateTime authoredOn; + private DateTime authoredOn; - private DateTime lastModified; + private DateTime lastModified; - private String owner; + private String owner; - private long serverVersion; + private long serverVersion; - public String getIdentifier() { - return identifier; - } + public String getIdentifier() { + return identifier; + } - public void setIdentifier(String identifier) { - this.identifier = identifier; - } + public void setIdentifier(String identifier) { + this.identifier = identifier; + } - public String getTitle() { - return title; - } + public String getTitle() { + return title; + } - public void setTitle(String title) { - this.title = title; - } + public void setTitle(String title) { + this.title = title; + } - public String getDescription() { - return description; - } + public String getDescription() { + return description; + } - public void setDescription(String description) { - this.description = description; - } + public void setDescription(String description) { + this.description = description; + } - public TaskStatus getStatus() { - return status; - } + public TaskStatus getStatus() { + return status; + } - public void setStatus(TaskStatus status) { - this.status = status; - } + public void setStatus(TaskStatus status) { + this.status = status; + } - public Period getExecutionPeriod() { - return executionPeriod; - } + public Period getExecutionPeriod() { + return executionPeriod; + } - public void setExecutionPeriod(Period executionPeriod) { - this.executionPeriod = executionPeriod; - } + public void setExecutionPeriod(Period executionPeriod) { + this.executionPeriod = executionPeriod; + } - public DateTime getAuthoredOn() { - return authoredOn; - } + public DateTime getAuthoredOn() { + return authoredOn; + } - public void setAuthoredOn(DateTime authoredOn) { - this.authoredOn = authoredOn; - } + public void setAuthoredOn(DateTime authoredOn) { + this.authoredOn = authoredOn; + } - public DateTime getLastModified() { - return lastModified; - } + public DateTime getLastModified() { + return lastModified; + } - public void setLastModified(DateTime lastModified) { - this.lastModified = lastModified; - } + public void setLastModified(DateTime lastModified) { + this.lastModified = lastModified; + } - public String getOwner() { - return owner; - } + public String getOwner() { + return owner; + } - public void setOwner(String owner) { - this.owner = owner; - } + public void setOwner(String owner) { + this.owner = owner; + } - public long getServerVersion() { - return serverVersion; - } + public long getServerVersion() { + return serverVersion; + } - public void setServerVersion(long serverVersion) { - this.serverVersion = serverVersion; - } + public void setServerVersion(long serverVersion) { + this.serverVersion = serverVersion; + } } diff --git a/src/main/java/org/opensrp/domain/ClientMigrationFile.java b/src/main/java/org/opensrp/domain/ClientMigrationFile.java index 72b46d3ef..224bc4858 100644 --- a/src/main/java/org/opensrp/domain/ClientMigrationFile.java +++ b/src/main/java/org/opensrp/domain/ClientMigrationFile.java @@ -10,34 +10,34 @@ @Setter @NoArgsConstructor public class ClientMigrationFile { - + private Long id; - + private String identifier; - + private String filename; - + private Boolean onObjectStorage; - + private String objectStoragePath; - + private String jurisdiction; - + private Integer version; - + private Integer manifestId; - + private String fileContents; - + private Date createdAt; } diff --git a/src/main/java/org/opensrp/domain/Code.java b/src/main/java/org/opensrp/domain/Code.java index 3d6b60ade..2c3957d48 100644 --- a/src/main/java/org/opensrp/domain/Code.java +++ b/src/main/java/org/opensrp/domain/Code.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.domain; @@ -10,35 +10,35 @@ */ public class Code implements Serializable { - private static final long serialVersionUID = 4580804190266539302L; + private static final long serialVersionUID = 4580804190266539302L; - private String system; + private String system; - private String code; + private String code; - private String display; + private String display; - public String getSystem() { - return system; - } + public String getSystem() { + return system; + } - public void setSystem(String system) { - this.system = system; - } + public void setSystem(String system) { + this.system = system; + } - public String getCode() { - return code; - } + public String getCode() { + return code; + } - public void setCode(String code) { - this.code = code; - } + public void setCode(String code) { + this.code = code; + } - public String getDisplay() { - return display; - } + public String getDisplay() { + return display; + } - public void setDisplay(String display) { - this.display = display; - } + public void setDisplay(String display) { + this.display = display; + } } \ No newline at end of file diff --git a/src/main/java/org/opensrp/domain/CodeSystem.java b/src/main/java/org/opensrp/domain/CodeSystem.java index 51b7af089..1958643b8 100644 --- a/src/main/java/org/opensrp/domain/CodeSystem.java +++ b/src/main/java/org/opensrp/domain/CodeSystem.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.domain; @@ -11,16 +11,16 @@ */ public class CodeSystem implements Serializable { - private static final long serialVersionUID = -2587903025581183298L; + private static final long serialVersionUID = -2587903025581183298L; - private List coding; + private List coding; - public List getCoding() { - return coding; - } + public List getCoding() { + return coding; + } - public void setCoding(List coding) { - this.coding = coding; - } + public void setCoding(List coding) { + this.coding = coding; + } } diff --git a/src/main/java/org/opensrp/domain/DHIS2Marker.java b/src/main/java/org/opensrp/domain/DHIS2Marker.java index 2936ec453..422f71169 100644 --- a/src/main/java/org/opensrp/domain/DHIS2Marker.java +++ b/src/main/java/org/opensrp/domain/DHIS2Marker.java @@ -10,48 +10,48 @@ @Service public class DHIS2Marker extends BaseDataEntity { - - private static final long serialVersionUID = 1L; - - @JsonProperty - private String name; - - @JsonProperty - private Long value; - - public DHIS2Marker() { - - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Long getValue() { - return value; - } - - public void setValue(Long value) { - this.value = value; - } - - @Override - public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); - } - - @Override - public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } - + + private static final long serialVersionUID = 1L; + + @JsonProperty + private String name; + + @JsonProperty + private Long value; + + public DHIS2Marker() { + + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getValue() { + return value; + } + + public void setValue(Long value) { + this.value = value; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this); + } + } diff --git a/src/main/java/org/opensrp/domain/ErrorTrace.java b/src/main/java/org/opensrp/domain/ErrorTrace.java index fcf4234af..df888ee51 100644 --- a/src/main/java/org/opensrp/domain/ErrorTrace.java +++ b/src/main/java/org/opensrp/domain/ErrorTrace.java @@ -14,163 +14,162 @@ * @author muhammad.ahmed@ihsinformatics.com Created on May 25, 2015 */ public class ErrorTrace extends BaseDataEntity { - - /* - * @JsonProperty private String id; - */ - @JsonProperty - private DateTime dateOccurred; - - @JsonProperty - private String errorType; - - @JsonProperty - private String occurredAt; - - @JsonProperty - private String stackTrace; - - @JsonProperty - private String status; // solved , unsolved , closed ,failed - // acknowledged, - - @JsonProperty - private String recordId; - - @JsonProperty - private Date dateClosed; - - @JsonProperty - private String documentType; - - @JsonProperty - private String retryUrl; - - // dateoccured , dateclosed , errortype =name, documenttype , submiturl - - public ErrorTrace() { - // TODO Auto-generated constructor stub - } - - /** - * - * - */ - public ErrorTrace(DateTime dateOccurred, String errorType, String occuredAt, String stackTrace, String status, - String documentType) { - this.dateOccurred = dateOccurred; - // this.id=id; - this.documentType = documentType; - this.errorType = errorType; - this.occurredAt = occuredAt; - this.stackTrace = stackTrace; - this.status = status; - - } - - public ErrorTrace(String recordId, DateTime date, String name, String occuredAt, String stackTrace, String status) { - this.dateOccurred = date; - this.recordId = recordId; - this.errorType = name; - this.occurredAt = occuredAt; - this.stackTrace = stackTrace; - this.status = status; - - } - - public DateTime getDateOccurred() { - return dateOccurred; - } - - public void setDateOccurred(DateTime dateOccurred) { - this.dateOccurred = dateOccurred; - } - - public String getErrorType() { - return errorType; - } - - public void setErrorType(String errorType) { - this.errorType = errorType; - } - - public Date getDateClosed() { - return dateClosed; - } - - public void setDateClosed(Date dateClosed) { - this.dateClosed = dateClosed; - } - - public String getDocumentType() { - return documentType; - } - - public void setDocumentType(String documentType) { - this.documentType = documentType; - } - - public String getRetryUrl() { - return retryUrl; - } - - public void setRetryUrl(String retryUrl) { - this.retryUrl = retryUrl; - } - - public String getRecordId() { - - return recordId; - } - - public void setRecordId(String recordId) { - this.recordId = recordId; - } - - public DateTime getDate() { - return dateOccurred; - } - - public void setDate(DateTime date) { - this.dateOccurred = date; - } - - public String getOccurredAt() { - return occurredAt; - } - - public void setOccurredAt(String occurredAt) { - this.occurredAt = occurredAt; - } - - public String getStackTrace() { - return stackTrace; - } - - public void setStackTrace(String stackTrace) { - this.stackTrace = stackTrace; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - @Override - public final boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); - } - - @Override - public final int hashCode() { - return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } + + /* + * @JsonProperty private String id; + */ + @JsonProperty + private DateTime dateOccurred; + + @JsonProperty + private String errorType; + + @JsonProperty + private String occurredAt; + + @JsonProperty + private String stackTrace; + + @JsonProperty + private String status; // solved , unsolved , closed ,failed + // acknowledged, + + @JsonProperty + private String recordId; + + @JsonProperty + private Date dateClosed; + + @JsonProperty + private String documentType; + + @JsonProperty + private String retryUrl; + + // dateoccured , dateclosed , errortype =name, documenttype , submiturl + + public ErrorTrace() { + // TODO Auto-generated constructor stub + } + + /** + * + */ + public ErrorTrace(DateTime dateOccurred, String errorType, String occuredAt, String stackTrace, String status, + String documentType) { + this.dateOccurred = dateOccurred; + // this.id=id; + this.documentType = documentType; + this.errorType = errorType; + this.occurredAt = occuredAt; + this.stackTrace = stackTrace; + this.status = status; + + } + + public ErrorTrace(String recordId, DateTime date, String name, String occuredAt, String stackTrace, String status) { + this.dateOccurred = date; + this.recordId = recordId; + this.errorType = name; + this.occurredAt = occuredAt; + this.stackTrace = stackTrace; + this.status = status; + + } + + public DateTime getDateOccurred() { + return dateOccurred; + } + + public void setDateOccurred(DateTime dateOccurred) { + this.dateOccurred = dateOccurred; + } + + public String getErrorType() { + return errorType; + } + + public void setErrorType(String errorType) { + this.errorType = errorType; + } + + public Date getDateClosed() { + return dateClosed; + } + + public void setDateClosed(Date dateClosed) { + this.dateClosed = dateClosed; + } + + public String getDocumentType() { + return documentType; + } + + public void setDocumentType(String documentType) { + this.documentType = documentType; + } + + public String getRetryUrl() { + return retryUrl; + } + + public void setRetryUrl(String retryUrl) { + this.retryUrl = retryUrl; + } + + public String getRecordId() { + + return recordId; + } + + public void setRecordId(String recordId) { + this.recordId = recordId; + } + + public DateTime getDate() { + return dateOccurred; + } + + public void setDate(DateTime date) { + this.dateOccurred = date; + } + + public String getOccurredAt() { + return occurredAt; + } + + public void setOccurredAt(String occurredAt) { + this.occurredAt = occurredAt; + } + + public String getStackTrace() { + return stackTrace; + } + + public void setStackTrace(String stackTrace) { + this.stackTrace = stackTrace; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + @Override + public final boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); + } + + @Override + public final int hashCode() { + return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this); + } } diff --git a/src/main/java/org/opensrp/domain/ErrorTraceForm.java b/src/main/java/org/opensrp/domain/ErrorTraceForm.java index 684d4d4e1..063d13ef6 100644 --- a/src/main/java/org/opensrp/domain/ErrorTraceForm.java +++ b/src/main/java/org/opensrp/domain/ErrorTraceForm.java @@ -1,4 +1,3 @@ - package org.opensrp.domain; import java.util.ArrayList; @@ -6,40 +5,40 @@ /** * @author muhammad.ahmed@ihsinformatics.com this is wrapper class .this class is mainly used for - * adding status Options to the code. developer can add other possible status for errorlog. + * adding status Options to the code. developer can add other possible status for errorlog. */ public class ErrorTraceForm { - - private ErrorTrace errorTrace; - - private List statusOptions = new ArrayList(); - - public ErrorTraceForm() { - if (null == statusOptions) { - - statusOptions = new ArrayList(); - } - statusOptions.add("solved"); - statusOptions.add("unsolved"); - statusOptions.add("failed"); - statusOptions.add("closed"); - statusOptions.add("acknowledged"); - } - - public ErrorTrace getErrorTrace() { - return errorTrace; - } - - public void setErrorTrace(ErrorTrace errorTrace) { - this.errorTrace = errorTrace; - } - - public List getStatusOptions() { - return statusOptions; - } - - public void setStatusOptions(List statusOptions) { - this.statusOptions = statusOptions; - } - + + private ErrorTrace errorTrace; + + private List statusOptions = new ArrayList(); + + public ErrorTraceForm() { + if (null == statusOptions) { + + statusOptions = new ArrayList(); + } + statusOptions.add("solved"); + statusOptions.add("unsolved"); + statusOptions.add("failed"); + statusOptions.add("closed"); + statusOptions.add("acknowledged"); + } + + public ErrorTrace getErrorTrace() { + return errorTrace; + } + + public void setErrorTrace(ErrorTrace errorTrace) { + this.errorTrace = errorTrace; + } + + public List getStatusOptions() { + return statusOptions; + } + + public void setStatusOptions(List statusOptions) { + this.statusOptions = statusOptions; + } + } diff --git a/src/main/java/org/opensrp/domain/Form.java b/src/main/java/org/opensrp/domain/Form.java index 0cdeed994..1f83d4ff6 100644 --- a/src/main/java/org/opensrp/domain/Form.java +++ b/src/main/java/org/opensrp/domain/Form.java @@ -8,55 +8,55 @@ @JsonSerialize @JsonInclude(JsonInclude.Include.NON_DEFAULT) public class Form { - - private String bind_type; - - private String default_bind_path; - - private List fields; - - private List sub_forms; - - public Form() { - } - - public Form(String bind_type, String default_bind_path, List fields, List sub_forms) { - this.bind_type = bind_type; - this.default_bind_path = default_bind_path; - this.fields = fields; - this.sub_forms = sub_forms; - } - - public String getBind_type() { - return bind_type; - } - - public void setBind_type(String bind_type) { - this.bind_type = bind_type; - } - - public String getDefault_bind_path() { - return default_bind_path; - } - - public void setDefault_bind_path(String default_bind_path) { - this.default_bind_path = default_bind_path; - } - - public List getFields() { - return fields; - } - - public void setFields(List fields) { - this.fields = fields; - } - - public List getSub_forms() { - return sub_forms; - } - - public void setSub_forms(List sub_forms) { - this.sub_forms = sub_forms; - } - + + private String bind_type; + + private String default_bind_path; + + private List fields; + + private List sub_forms; + + public Form() { + } + + public Form(String bind_type, String default_bind_path, List fields, List sub_forms) { + this.bind_type = bind_type; + this.default_bind_path = default_bind_path; + this.fields = fields; + this.sub_forms = sub_forms; + } + + public String getBind_type() { + return bind_type; + } + + public void setBind_type(String bind_type) { + this.bind_type = bind_type; + } + + public String getDefault_bind_path() { + return default_bind_path; + } + + public void setDefault_bind_path(String default_bind_path) { + this.default_bind_path = default_bind_path; + } + + public List getFields() { + return fields; + } + + public void setFields(List fields) { + this.fields = fields; + } + + public List getSub_forms() { + return sub_forms; + } + + public void setSub_forms(List sub_forms) { + this.sub_forms = sub_forms; + } + } diff --git a/src/main/java/org/opensrp/domain/FormDefinition.java b/src/main/java/org/opensrp/domain/FormDefinition.java index 0bc38f8d5..1e509dd59 100644 --- a/src/main/java/org/opensrp/domain/FormDefinition.java +++ b/src/main/java/org/opensrp/domain/FormDefinition.java @@ -7,25 +7,25 @@ @JsonSerialize @JsonInclude(JsonInclude.Include.NON_DEFAULT) public class FormDefinition { - - private String form_data_definition_version = "1"; - - private Form form; - - public String getForm_data_definition_version() { - return form_data_definition_version; - } - - public void setForm_data_definition_version(String form_data_definition_version) { - this.form_data_definition_version = form_data_definition_version; - } - - public Form getForm() { - return form; - } - - public void setForm(Form form) { - this.form = form; - } - + + private String form_data_definition_version = "1"; + + private Form form; + + public String getForm_data_definition_version() { + return form_data_definition_version; + } + + public void setForm_data_definition_version(String form_data_definition_version) { + this.form_data_definition_version = form_data_definition_version; + } + + public Form getForm() { + return form; + } + + public void setForm(Form form) { + this.form = form; + } + } diff --git a/src/main/java/org/opensrp/domain/FormField.java b/src/main/java/org/opensrp/domain/FormField.java index 9190cddda..5e89576c6 100644 --- a/src/main/java/org/opensrp/domain/FormField.java +++ b/src/main/java/org/opensrp/domain/FormField.java @@ -6,52 +6,52 @@ @JsonSerialize @JsonInclude(JsonInclude.Include.NON_DEFAULT) public class FormField { - - private String name; - - private String bind; - - private boolean shouldLoadValue; - - public FormField() { - } - - public FormField(String name, String bind) { - this.name = name; - - this.bind = bind; - } - - public String name() { - return name; - } - - public String bind() { - return bind; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getBind() { - return bind; - } - - public void setBind(String bind) { - this.bind = bind; - } - - public boolean isShouldLoadValue() { - return shouldLoadValue; - } - - public void setShouldLoadValue(boolean shouldLoadValue) { - this.shouldLoadValue = shouldLoadValue; - } - + + private String name; + + private String bind; + + private boolean shouldLoadValue; + + public FormField() { + } + + public FormField(String name, String bind) { + this.name = name; + + this.bind = bind; + } + + public String name() { + return name; + } + + public String bind() { + return bind; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getBind() { + return bind; + } + + public void setBind(String bind) { + this.bind = bind; + } + + public boolean isShouldLoadValue() { + return shouldLoadValue; + } + + public void setShouldLoadValue(boolean shouldLoadValue) { + this.shouldLoadValue = shouldLoadValue; + } + } diff --git a/src/main/java/org/opensrp/domain/Hia2Indicator.java b/src/main/java/org/opensrp/domain/Hia2Indicator.java index 158482fc0..80969302a 100644 --- a/src/main/java/org/opensrp/domain/Hia2Indicator.java +++ b/src/main/java/org/opensrp/domain/Hia2Indicator.java @@ -7,154 +7,154 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class Hia2Indicator { - - @JsonProperty - private String indicatorCode; - - @JsonProperty - private String label; - - @JsonProperty - private String dhisId; - - @JsonProperty - private String description; - - @JsonProperty - private String category; - - @JsonProperty - private String value; - - @JsonProperty - private String categoryOptionCombo; - - @JsonProperty - private String providerId; - - @JsonProperty - private String updatedAt; - - public Hia2Indicator() { - - } - - public Hia2Indicator(String indicatorCode, String label, String dhisId, String description, String category, String value, String categoryOptionCombo, String providerId, String updatedAt) { - this.indicatorCode = indicatorCode; - this.label = label; - this.dhisId = dhisId; - this.description = description; - this.category = category; - this.value = value; - this.categoryOptionCombo = categoryOptionCombo; - this.providerId = providerId; - this.updatedAt = updatedAt; - } - - public Hia2Indicator(String indicatorCode, String label, String dhisId, String description, String category, - String value, String providerId, String updatedAt) { - this.indicatorCode = indicatorCode; - this.label = label; - this.dhisId = dhisId; - this.description = description; - this.category = category; - this.value = value; - this.providerId = providerId; - this.updatedAt = updatedAt; - - } - - public Hia2Indicator(String indicatorCode, String dhisId, String value) { - this.indicatorCode = indicatorCode; - this.dhisId = dhisId; - this.value = value; - } - - public String getIndicatorCode() { - return indicatorCode; - } - - public void setIndicatorCode(String indicatorCode) { - this.indicatorCode = indicatorCode; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public String getDhisId() { - return dhisId; - } - - public void setDhisId(String dhisId) { - this.dhisId = dhisId; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getCategory() { - return category; - } - - public void setCategory(String category) { - this.category = category; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getProviderId() { - return providerId; - } - - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public String getCategoryOptionCombo() { - return categoryOptionCombo; - } - - public void setCategoryOptionCombo(String categoryOptionCombo) { - this.categoryOptionCombo = categoryOptionCombo; - } - - @Override - public final boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); - } - - @Override - public final int hashCode() { - return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } - + + @JsonProperty + private String indicatorCode; + + @JsonProperty + private String label; + + @JsonProperty + private String dhisId; + + @JsonProperty + private String description; + + @JsonProperty + private String category; + + @JsonProperty + private String value; + + @JsonProperty + private String categoryOptionCombo; + + @JsonProperty + private String providerId; + + @JsonProperty + private String updatedAt; + + public Hia2Indicator() { + + } + + public Hia2Indicator(String indicatorCode, String label, String dhisId, String description, String category, String value, String categoryOptionCombo, String providerId, String updatedAt) { + this.indicatorCode = indicatorCode; + this.label = label; + this.dhisId = dhisId; + this.description = description; + this.category = category; + this.value = value; + this.categoryOptionCombo = categoryOptionCombo; + this.providerId = providerId; + this.updatedAt = updatedAt; + } + + public Hia2Indicator(String indicatorCode, String label, String dhisId, String description, String category, + String value, String providerId, String updatedAt) { + this.indicatorCode = indicatorCode; + this.label = label; + this.dhisId = dhisId; + this.description = description; + this.category = category; + this.value = value; + this.providerId = providerId; + this.updatedAt = updatedAt; + + } + + public Hia2Indicator(String indicatorCode, String dhisId, String value) { + this.indicatorCode = indicatorCode; + this.dhisId = dhisId; + this.value = value; + } + + public String getIndicatorCode() { + return indicatorCode; + } + + public void setIndicatorCode(String indicatorCode) { + this.indicatorCode = indicatorCode; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getDhisId() { + return dhisId; + } + + public void setDhisId(String dhisId) { + this.dhisId = dhisId; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getProviderId() { + return providerId; + } + + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public String getCategoryOptionCombo() { + return categoryOptionCombo; + } + + public void setCategoryOptionCombo(String categoryOptionCombo) { + this.categoryOptionCombo = categoryOptionCombo; + } + + @Override + public final boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); + } + + @Override + public final int hashCode() { + return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this); + } + } diff --git a/src/main/java/org/opensrp/domain/IdVersionTuple.java b/src/main/java/org/opensrp/domain/IdVersionTuple.java index 8b4ce8466..ebc362ef4 100644 --- a/src/main/java/org/opensrp/domain/IdVersionTuple.java +++ b/src/main/java/org/opensrp/domain/IdVersionTuple.java @@ -4,28 +4,28 @@ public class IdVersionTuple { - public long id; + public long id; - public String version; + public String version; - public IdVersionTuple(long id, @NonNull String version) { - this.id = id; - this.version = version; - } + public IdVersionTuple(long id, @NonNull String version) { + this.id = id; + this.version = version; + } - public long getId() { - return id; - } + public long getId() { + return id; + } - public void setId(long id) { - this.id = id; - } + public void setId(long id) { + this.id = id; + } - public String getVersion() { - return version; - } + public String getVersion() { + return version; + } - public void setVersion(String version) { - this.version = version; - } + public void setVersion(String version) { + this.version = version; + } } diff --git a/src/main/java/org/opensrp/domain/IdentifierSource.java b/src/main/java/org/opensrp/domain/IdentifierSource.java index b5e44aa02..730d2ba55 100644 --- a/src/main/java/org/opensrp/domain/IdentifierSource.java +++ b/src/main/java/org/opensrp/domain/IdentifierSource.java @@ -18,40 +18,40 @@ @ToString public class IdentifierSource { - @JsonProperty - private Long id; + @JsonProperty + private Long id; - @JsonProperty - private String identifier; + @JsonProperty + private String identifier; - @JsonProperty - private String description; + @JsonProperty + private String description; - @JsonProperty - private IdentifierValidatorAlgorithm identifierValidatorAlgorithm; + @JsonProperty + private IdentifierValidatorAlgorithm identifierValidatorAlgorithm; - @JsonProperty - private String baseCharacterSet; + @JsonProperty + private String baseCharacterSet; - @JsonProperty - private String firstIdentifierBase; + @JsonProperty + private String firstIdentifierBase; - @JsonProperty - private String prefix; + @JsonProperty + private String prefix; - @JsonProperty - private String suffix; + @JsonProperty + private String suffix; - @JsonProperty - private Integer minLength; + @JsonProperty + private Integer minLength; - @JsonProperty - private Integer maxLength; + @JsonProperty + private Integer maxLength; - @JsonProperty - private String regexFormat; + @JsonProperty + private String regexFormat; - @JsonIgnore - private Long sequenceValue; + @JsonIgnore + private Long sequenceValue; } diff --git a/src/main/java/org/opensrp/domain/Location.java b/src/main/java/org/opensrp/domain/Location.java index 7da8aadc0..41849451b 100644 --- a/src/main/java/org/opensrp/domain/Location.java +++ b/src/main/java/org/opensrp/domain/Location.java @@ -15,267 +15,267 @@ public class Location extends BaseDataObject { - - @JsonProperty - private String locationId; - - @JsonProperty - private String name; - - @JsonProperty - private Address address; - - @JsonProperty - private Map identifiers; - - @JsonProperty - private Location parentLocation; - - @JsonProperty - private Set tags; - - @JsonProperty - private Map attributes; - - public Location() { - } - - public Location(String locationId, String name, Address address, Location parentLocation) { - this.locationId = locationId; - this.name = name; - this.address = address; - this.parentLocation = parentLocation; - } - - public Location(String locationId, String name, Address address, Map identifiers, - Location parentLocation, Set tags, Map attributes) { - this.locationId = locationId; - this.name = name; - this.address = address; - this.identifiers = identifiers; - this.parentLocation = parentLocation; - this.tags = tags; - this.attributes = attributes; - } - - public String getLocationId() { - return locationId; - } - - public void setLocationId(String locationId) { - this.locationId = locationId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Address getAddress() { - return address; - } - - public void setAddress(Address address) { - this.address = address; - } - - public Map getIdentifiers() { - return identifiers; - } - - public String getIdentifier(String identifierType) { - return identifiers.get(identifierType); - } - - /** - * WARNING: Overrides all existing identifiers - * - * @param identifiers - * @return - */ - public void setIdentifiers(Map identifiers) { - this.identifiers = identifiers; - } - - public void addIdentifier(String identifierType, String identifier) { - if (identifiers == null) { - identifiers = new HashMap<>(); - } - - identifiers.put(identifierType, identifier); - } - - public void removeIdentifier(String identifierType) { - identifiers.remove(identifierType); - } - - public Location getParentLocation() { - return parentLocation; - } - - public void setParentLocation(Location parentLocation) { - this.parentLocation = parentLocation; - } - - public Set getTags() { - return tags; - } - - public boolean hasTag(String tag) { - return tags.contains(tag); - } - - /** - * WARNING: Overrides all existing tags - * - * @param tags - * @return - */ - public void setTags(Set tags) { - this.tags = tags; - } - - public void addTag(String tag) { - if (tags == null) { - tags = new HashSet<>(); - } - - tags.add(tag); - } - - public boolean removeTag(String tag) { - return tags.remove(tag); - } - - public Map getAttributes() { - return attributes; - } - - public Object getAttribute(String name) { - return attributes.get(name); - } - - /** - * WARNING: Overrides all existing attributes - * - * @param attributes - * @return - */ - public void setAttributes(Map attributes) { - this.attributes = attributes; - } - - public void addAttribute(String name, Object value) { - if (attributes == null) { - attributes = new HashMap<>(); - } - - attributes.put(name, value); - } - - public void removeAttribute(String name) { - attributes.remove(name); - } - - public Location withLocationId(String locationId) { - this.locationId = locationId; - return this; - } - - public Location withName(String name) { - this.name = name; - return this; - } - - public Location withAddress(Address address) { - this.address = address; - return this; - } - - /** - * WARNING: Overrides all existing identifiers - * - * @param identifiers - * @return - * @return - */ - public Location withIdentifiers(Map identifiers) { - this.identifiers = identifiers; - return this; - } - - public Location withIdentifier(String identifierType, String identifier) { - if (identifiers == null) { - identifiers = new HashMap<>(); - } - - identifiers.put(identifierType, identifier); - return this; - } - - public Location withParentLocation(Location parentLocation) { - this.parentLocation = parentLocation; - return this; - } - - /** - * WARNING: Overrides all existing tags - * - * @param tags - * @return - * @return - */ - public Location withTags(Set tags) { - this.tags = tags; - return this; - } - - public Location withTag(String tag) { - if (tags == null) { - tags = new HashSet<>(); - } - - tags.add(tag); - return this; - } - - /** - * WARNING: Overrides all existing attributes - * - * @param attributes - * @return - * @return - */ - public Location withAttributes(Map attributes) { - this.attributes = attributes; - return this; - } - - public Location withAttribute(String name, Object value) { - if (attributes == null) { - attributes = new HashMap<>(); - } - - attributes.put(name, value); - return this; - } - - @Override - public final boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); - } - - @Override - public final int hashCode() { - return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } - + + @JsonProperty + private String locationId; + + @JsonProperty + private String name; + + @JsonProperty + private Address address; + + @JsonProperty + private Map identifiers; + + @JsonProperty + private Location parentLocation; + + @JsonProperty + private Set tags; + + @JsonProperty + private Map attributes; + + public Location() { + } + + public Location(String locationId, String name, Address address, Location parentLocation) { + this.locationId = locationId; + this.name = name; + this.address = address; + this.parentLocation = parentLocation; + } + + public Location(String locationId, String name, Address address, Map identifiers, + Location parentLocation, Set tags, Map attributes) { + this.locationId = locationId; + this.name = name; + this.address = address; + this.identifiers = identifiers; + this.parentLocation = parentLocation; + this.tags = tags; + this.attributes = attributes; + } + + public String getLocationId() { + return locationId; + } + + public void setLocationId(String locationId) { + this.locationId = locationId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Address getAddress() { + return address; + } + + public void setAddress(Address address) { + this.address = address; + } + + public Map getIdentifiers() { + return identifiers; + } + + /** + * WARNING: Overrides all existing identifiers + * + * @param identifiers + * @return + */ + public void setIdentifiers(Map identifiers) { + this.identifiers = identifiers; + } + + public String getIdentifier(String identifierType) { + return identifiers.get(identifierType); + } + + public void addIdentifier(String identifierType, String identifier) { + if (identifiers == null) { + identifiers = new HashMap<>(); + } + + identifiers.put(identifierType, identifier); + } + + public void removeIdentifier(String identifierType) { + identifiers.remove(identifierType); + } + + public Location getParentLocation() { + return parentLocation; + } + + public void setParentLocation(Location parentLocation) { + this.parentLocation = parentLocation; + } + + public Set getTags() { + return tags; + } + + /** + * WARNING: Overrides all existing tags + * + * @param tags + * @return + */ + public void setTags(Set tags) { + this.tags = tags; + } + + public boolean hasTag(String tag) { + return tags.contains(tag); + } + + public void addTag(String tag) { + if (tags == null) { + tags = new HashSet<>(); + } + + tags.add(tag); + } + + public boolean removeTag(String tag) { + return tags.remove(tag); + } + + public Map getAttributes() { + return attributes; + } + + /** + * WARNING: Overrides all existing attributes + * + * @param attributes + * @return + */ + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + public Object getAttribute(String name) { + return attributes.get(name); + } + + public void addAttribute(String name, Object value) { + if (attributes == null) { + attributes = new HashMap<>(); + } + + attributes.put(name, value); + } + + public void removeAttribute(String name) { + attributes.remove(name); + } + + public Location withLocationId(String locationId) { + this.locationId = locationId; + return this; + } + + public Location withName(String name) { + this.name = name; + return this; + } + + public Location withAddress(Address address) { + this.address = address; + return this; + } + + /** + * WARNING: Overrides all existing identifiers + * + * @param identifiers + * @return + * @return + */ + public Location withIdentifiers(Map identifiers) { + this.identifiers = identifiers; + return this; + } + + public Location withIdentifier(String identifierType, String identifier) { + if (identifiers == null) { + identifiers = new HashMap<>(); + } + + identifiers.put(identifierType, identifier); + return this; + } + + public Location withParentLocation(Location parentLocation) { + this.parentLocation = parentLocation; + return this; + } + + /** + * WARNING: Overrides all existing tags + * + * @param tags + * @return + * @return + */ + public Location withTags(Set tags) { + this.tags = tags; + return this; + } + + public Location withTag(String tag) { + if (tags == null) { + tags = new HashSet<>(); + } + + tags.add(tag); + return this; + } + + /** + * WARNING: Overrides all existing attributes + * + * @param attributes + * @return + * @return + */ + public Location withAttributes(Map attributes) { + this.attributes = attributes; + return this; + } + + public Location withAttribute(String name, Object value) { + if (attributes == null) { + attributes = new HashMap<>(); + } + + attributes.put(name, value); + return this; + } + + @Override + public final boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); + } + + @Override + public final int hashCode() { + return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this); + } + } diff --git a/src/main/java/org/opensrp/domain/LocationAndStock.java b/src/main/java/org/opensrp/domain/LocationAndStock.java index 0866d7515..ad893e9b1 100644 --- a/src/main/java/org/opensrp/domain/LocationAndStock.java +++ b/src/main/java/org/opensrp/domain/LocationAndStock.java @@ -15,6 +15,6 @@ @Setter public class LocationAndStock extends Location { - private List stocks; + private List stocks; } diff --git a/src/main/java/org/opensrp/domain/LocationDetail.java b/src/main/java/org/opensrp/domain/LocationDetail.java index b3f877224..a90c0f7f4 100644 --- a/src/main/java/org/opensrp/domain/LocationDetail.java +++ b/src/main/java/org/opensrp/domain/LocationDetail.java @@ -14,23 +14,23 @@ @Setter @Builder @AllArgsConstructor -@EqualsAndHashCode(of = { "identifier" }) +@EqualsAndHashCode(of = {"identifier"}) public class LocationDetail implements Serializable { - - private static final long serialVersionUID = 7360003982578282029L; - - private Long id; - - private String identifier; - - private String name; - - private String parentId; - - private boolean voided; - - private String tags; - - private Integer geographicLevel; - + + private static final long serialVersionUID = 7360003982578282029L; + + private Long id; + + private String identifier; + + private String name; + + private String parentId; + + private boolean voided; + + private String tags; + + private Integer geographicLevel; + } diff --git a/src/main/java/org/opensrp/domain/LocationTagMap.java b/src/main/java/org/opensrp/domain/LocationTagMap.java index a106b20f3..403fc757b 100644 --- a/src/main/java/org/opensrp/domain/LocationTagMap.java +++ b/src/main/java/org/opensrp/domain/LocationTagMap.java @@ -3,27 +3,27 @@ import java.io.Serializable; public class LocationTagMap implements Serializable { - - private static final long serialVersionUID = -8367551045898354954L; - - private Long locationId; - - private Long locationTagId; - - public Long getLocationId() { - return locationId; - } - - public void setLocationId(Long locationId) { - this.locationId = locationId; - } - - public Long getLocationTagId() { - return locationTagId; - } - - public void setLocationTagId(Long locationTagId) { - this.locationTagId = locationTagId; - } - + + private static final long serialVersionUID = -8367551045898354954L; + + private Long locationId; + + private Long locationTagId; + + public Long getLocationId() { + return locationId; + } + + public void setLocationId(Long locationId) { + this.locationId = locationId; + } + + public Long getLocationTagId() { + return locationTagId; + } + + public void setLocationTagId(Long locationTagId) { + this.locationTagId = locationTagId; + } + } diff --git a/src/main/java/org/opensrp/domain/Multimedia.java b/src/main/java/org/opensrp/domain/Multimedia.java index ced51822d..91e2234d1 100644 --- a/src/main/java/org/opensrp/domain/Multimedia.java +++ b/src/main/java/org/opensrp/domain/Multimedia.java @@ -10,160 +10,160 @@ import java.util.Date; public class Multimedia extends BaseDataEntity { - - @JsonProperty - private String caseId; - - @JsonProperty - private String providerId; - - @JsonProperty - private String contentType; - - @JsonProperty - private String filePath; - - @JsonProperty - private String fileCategory; - - @JsonProperty - private Date dateUploaded = new Date(); - - @JsonProperty - private String summary; - - @JsonProperty - private String originalFileName; - - public Multimedia() { - - } - - public Multimedia(String caseId, String providerId, String contentType, String filePath, String fileCategory) { - this.caseId = caseId; - this.providerId = providerId; - this.contentType = contentType; - this.filePath = filePath; - this.fileCategory = fileCategory; - } - - public Multimedia withCaseId(String caseId) { - this.caseId = caseId; - return this; - } - - public Multimedia withProviderId(String providerId) { - this.providerId = providerId; - return this; - } - - public Multimedia withContentType(String contentType) { - this.contentType = contentType; - return this; - } - - public Multimedia withFilePath(String filePath) { - this.filePath = filePath; - return this; - } - - public Multimedia withFileCategory(String fileCategory) { - this.fileCategory = fileCategory; - return this; - } - - public Multimedia withDateUploaded(Date dateUploaded) { - this.dateUploaded = dateUploaded; - return this; - } - - public Multimedia withSummary(String summary) { - this.summary = summary; - return this; - } - - public Multimedia withOriginalFileName(String originalFileName) { - this.originalFileName = originalFileName; - return this; - } - - public String getCaseId() { - return caseId; - } - - public String getProviderId() { - return providerId; - } - - public String getContentType() { - return contentType; - } - - public String getFilePath() { - return filePath; - } - - public String getFileCategory() { - return fileCategory; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - public void setContentType(String contentType) { - this.contentType = contentType; - } - - public void setFilePath(String filePath) { - this.filePath = filePath; - } - - public void setFileCategory(String fileCategory) { - this.fileCategory = fileCategory; - } - - public Date getDateUploaded() { - return dateUploaded; - } - - public void setDateUploaded(Date dateUploaded) { - this.dateUploaded = dateUploaded; - } - - public String getSummary() { - return summary; - } - - public void setSummary(String summary) { - this.summary = summary; - } - - public String getOriginalFileName() { - return originalFileName; - } - - public void setOriginalFileName(String originalFileName) { - this.originalFileName = originalFileName; - } - - @Override - public final boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); - } - - @Override - public final int hashCode() { - return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } - + + @JsonProperty + private String caseId; + + @JsonProperty + private String providerId; + + @JsonProperty + private String contentType; + + @JsonProperty + private String filePath; + + @JsonProperty + private String fileCategory; + + @JsonProperty + private Date dateUploaded = new Date(); + + @JsonProperty + private String summary; + + @JsonProperty + private String originalFileName; + + public Multimedia() { + + } + + public Multimedia(String caseId, String providerId, String contentType, String filePath, String fileCategory) { + this.caseId = caseId; + this.providerId = providerId; + this.contentType = contentType; + this.filePath = filePath; + this.fileCategory = fileCategory; + } + + public Multimedia withCaseId(String caseId) { + this.caseId = caseId; + return this; + } + + public Multimedia withProviderId(String providerId) { + this.providerId = providerId; + return this; + } + + public Multimedia withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + public Multimedia withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + public Multimedia withFileCategory(String fileCategory) { + this.fileCategory = fileCategory; + return this; + } + + public Multimedia withDateUploaded(Date dateUploaded) { + this.dateUploaded = dateUploaded; + return this; + } + + public Multimedia withSummary(String summary) { + this.summary = summary; + return this; + } + + public Multimedia withOriginalFileName(String originalFileName) { + this.originalFileName = originalFileName; + return this; + } + + public String getCaseId() { + return caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getProviderId() { + return providerId; + } + + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + public String getContentType() { + return contentType; + } + + public void setContentType(String contentType) { + this.contentType = contentType; + } + + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + this.filePath = filePath; + } + + public String getFileCategory() { + return fileCategory; + } + + public void setFileCategory(String fileCategory) { + this.fileCategory = fileCategory; + } + + public Date getDateUploaded() { + return dateUploaded; + } + + public void setDateUploaded(Date dateUploaded) { + this.dateUploaded = dateUploaded; + } + + public String getSummary() { + return summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + public String getOriginalFileName() { + return originalFileName; + } + + public void setOriginalFileName(String originalFileName) { + this.originalFileName = originalFileName; + } + + @Override + public final boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); + } + + @Override + public final int hashCode() { + return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this); + } + } diff --git a/src/main/java/org/opensrp/domain/Organization.java b/src/main/java/org/opensrp/domain/Organization.java index c50e88c54..a0c1d0998 100644 --- a/src/main/java/org/opensrp/domain/Organization.java +++ b/src/main/java/org/opensrp/domain/Organization.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.domain; @@ -13,114 +13,108 @@ */ public class Organization implements Serializable { - private static final long serialVersionUID = -9204925528493297488L; + private static final long serialVersionUID = -9204925528493297488L; + public CodeSystem type; + private Long id; + private String identifier; + private boolean active; + private String name; + private Long partOf; + private Set assignedLocations; - private Long id; + private DateTime dateCreated; - private String identifier; + private DateTime dateEdited; - private boolean active; + private long serverVersion; - private String name; + private Integer memberCount; - private Long partOf; + public Long getId() { + return id; + } - public CodeSystem type; + public void setId(Long id) { + this.id = id; + } - private Set assignedLocations; + public String getIdentifier() { + return identifier; + } - private DateTime dateCreated; + public void setIdentifier(String identifier) { + this.identifier = identifier; + } - private DateTime dateEdited; + public boolean isActive() { + return active; + } - private long serverVersion; - - private Integer memberCount; - public Long getId() { - return id; - } + public void setActive(boolean active) { + this.active = active; + } - public void setId(Long id) { - this.id = id; - } + public String getName() { + return name; + } - public String getIdentifier() { - return identifier; - } + public void setName(String name) { + this.name = name; + } - public void setIdentifier(String identifier) { - this.identifier = identifier; - } + public Long getPartOf() { + return partOf; + } - public boolean isActive() { - return active; - } + public void setPartOf(Long partOf) { + this.partOf = partOf; + } - public void setActive(boolean active) { - this.active = active; - } + public CodeSystem getType() { + return type; + } - public String getName() { - return name; - } + public void setType(CodeSystem type) { + this.type = type; + } - public void setName(String name) { - this.name = name; - } + public Set getAssignedLocations() { + return assignedLocations; + } - public Long getPartOf() { - return partOf; - } + public void setAssignedLocations(Set assignedLocations) { + this.assignedLocations = assignedLocations; + } - public void setPartOf(Long partOf) { - this.partOf = partOf; - } + public Integer getMemberCount() { + return memberCount; + } - public CodeSystem getType() { - return type; - } + public void setMemberCount(Integer memberCount) { + this.memberCount = memberCount; + } - public void setType(CodeSystem type) { - this.type = type; - } + public DateTime getDateCreated() { + return dateCreated; + } - public Set getAssignedLocations() { - return assignedLocations; - } + public void setDateCreated(DateTime dateCreated) { + this.dateCreated = dateCreated; + } - public void setAssignedLocations(Set assignedLocations) { - this.assignedLocations = assignedLocations; - } + public DateTime getDateEdited() { + return dateEdited; + } - public Integer getMemberCount() { - return memberCount; - } - - public void setMemberCount(Integer memberCount) { - this.memberCount = memberCount; - } + public void setDateEdited(DateTime dateEdited) { + this.dateEdited = dateEdited; + } - public DateTime getDateCreated() { - return dateCreated; - } + public long getServerVersion() { + return serverVersion; + } - public void setDateCreated(DateTime dateCreated) { - this.dateCreated = dateCreated; - } - - public DateTime getDateEdited() { - return dateEdited; - } - - public void setDateEdited(DateTime dateEdited) { - this.dateEdited = dateEdited; - } - - public long getServerVersion() { - return serverVersion; - } - - public void setServerVersion(long serverVersion) { - this.serverVersion = serverVersion; - } + public void setServerVersion(long serverVersion) { + this.serverVersion = serverVersion; + } } diff --git a/src/main/java/org/opensrp/domain/Provider.java b/src/main/java/org/opensrp/domain/Provider.java index 906af66a7..8c82f5e26 100644 --- a/src/main/java/org/opensrp/domain/Provider.java +++ b/src/main/java/org/opensrp/domain/Provider.java @@ -6,43 +6,43 @@ import org.smartregister.domain.BaseEntity; public class Provider extends BaseEntity { - - private String fullName; - - protected Provider() { - - } - - public Provider(String baseEntityId) { - super(baseEntityId); - } - - public Provider(String baseEntityId, String fullName) { - super(baseEntityId); - this.setFullName(fullName); - } - - @Override - public final boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); - } - - @Override - public final int hashCode() { - return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } - - public String getFullName() { - return fullName; - } - - public void setFullName(String fullName) { - this.fullName = fullName; - } - + + private String fullName; + + protected Provider() { + + } + + public Provider(String baseEntityId) { + super(baseEntityId); + } + + public Provider(String baseEntityId, String fullName) { + super(baseEntityId); + this.setFullName(fullName); + } + + @Override + public final boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); + } + + @Override + public final int hashCode() { + return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this); + } + + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + } diff --git a/src/main/java/org/opensrp/domain/RapidProContact.java b/src/main/java/org/opensrp/domain/RapidProContact.java index 0fcb74ae2..e11759fd7 100644 --- a/src/main/java/org/opensrp/domain/RapidProContact.java +++ b/src/main/java/org/opensrp/domain/RapidProContact.java @@ -4,229 +4,229 @@ import org.smartregister.domain.Client; public class RapidProContact implements Comparable { - - private String motherFirstName; - - private String motherSecondName; - - private String motherZeirID; - - private String motherTel; - - private String homeFacility; - - private String residentialArea; - - private String homeAddress; - - private String landMark; - - private String birthDate; - - private String dateJoined; - - private Long serverVersion; - - private String childName; - - private String zeirID; - - private String mvaccUuid; - - private String baseEntityId; - - private String c2dob; - - private String c2zeir; - - private String c2name; - - private String c3dob; - - private String c3zeir; - - private String c3name; - - private DateTime dateCreated; - - public String getMotherFirstName() { - return motherFirstName; - } - - public void setMotherFirstName(String motherFirstName) { - this.motherFirstName = motherFirstName; - } - - public String getMotherSecondName() { - return motherSecondName; - } - - public void setMotherSecondName(String motherSecondName) { - this.motherSecondName = motherSecondName; - } - - public String getMotherZeirID() { - return motherZeirID; - } - - public void setMotherZeirID(String motherZeirID) { - this.motherZeirID = motherZeirID; - } - - public String getMotherTel() { - return motherTel; - } - - public void setMotherTel(String motherTel) { - this.motherTel = motherTel; - } - - public String getHomeFacility() { - return homeFacility; - } - - public void setHomeFacility(String homeFacility) { - this.homeFacility = homeFacility; - } - - public String getResidentialArea() { - return residentialArea; - } - - public void setResidentialArea(String residentialArea) { - this.residentialArea = residentialArea; - } - - public String getHomeAddress() { - return homeAddress; - } - - public void setHomeAddress(String homeAddress) { - this.homeAddress = homeAddress; - } - - public String getLandMark() { - return landMark; - } - - public void setLandMark(String landMark) { - this.landMark = landMark; - } - - public String getBirthDate() { - return birthDate; - } - - public void setBirthDate(String birthDate) { - this.birthDate = birthDate; - } - - public String getDateJoined() { - return dateJoined; - } - - public void setDateJoined(String dateJoined) { - this.dateJoined = dateJoined; - } - - public Long getServerVersion() { - return serverVersion; - } - - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } - - public String getChildName() { - return childName; - } - - public void setChildName(String childName) { - this.childName = childName; - } - - public String getMvaccUuid() { - return mvaccUuid; - } - - public void setMvaccUuid(String mvaccUuid) { - this.mvaccUuid = mvaccUuid; - } - - public String getBaseEntityId() { - return baseEntityId; - } - - public void setBaseEntityId(String baseEntityId) { - this.baseEntityId = baseEntityId; - } - - public String getC2dob() { - return c2dob; - } - - public void setC2dob(String c2dob) { - this.c2dob = c2dob; - } - - public String getC2name() { - return c2name; - } - - public void setC2name(String c2name) { - this.c2name = c2name; - } - - public String getC3dob() { - return c3dob; - } - - public void setC3dob(String c3dob) { - this.c3dob = c3dob; - } - - public String getC3name() { - return c3name; - } - - public void setC3name(String c3name) { - this.c3name = c3name; - } - - public DateTime getDateCreated() { - return dateCreated; - } - - public void setDateCreated(DateTime dateCreated) { - this.dateCreated = dateCreated; - } - - public String getZeirID() { - return zeirID; - } - - public void setZeirID(String zeirID) { - this.zeirID = zeirID; - } - - public String getC2zeir() { - return c2zeir; - } - - public void setC2zeir(String c2zeir) { - this.c2zeir = c2zeir; - } - - public String getC3zeir() { - return c3zeir; - } - - public void setC3zeir(String c3zeir) { - this.c3zeir = c3zeir; - } - - @Override - public int compareTo(Client client) { - return getDateCreated().compareTo(client.getDateCreated()); - } + + private String motherFirstName; + + private String motherSecondName; + + private String motherZeirID; + + private String motherTel; + + private String homeFacility; + + private String residentialArea; + + private String homeAddress; + + private String landMark; + + private String birthDate; + + private String dateJoined; + + private Long serverVersion; + + private String childName; + + private String zeirID; + + private String mvaccUuid; + + private String baseEntityId; + + private String c2dob; + + private String c2zeir; + + private String c2name; + + private String c3dob; + + private String c3zeir; + + private String c3name; + + private DateTime dateCreated; + + public String getMotherFirstName() { + return motherFirstName; + } + + public void setMotherFirstName(String motherFirstName) { + this.motherFirstName = motherFirstName; + } + + public String getMotherSecondName() { + return motherSecondName; + } + + public void setMotherSecondName(String motherSecondName) { + this.motherSecondName = motherSecondName; + } + + public String getMotherZeirID() { + return motherZeirID; + } + + public void setMotherZeirID(String motherZeirID) { + this.motherZeirID = motherZeirID; + } + + public String getMotherTel() { + return motherTel; + } + + public void setMotherTel(String motherTel) { + this.motherTel = motherTel; + } + + public String getHomeFacility() { + return homeFacility; + } + + public void setHomeFacility(String homeFacility) { + this.homeFacility = homeFacility; + } + + public String getResidentialArea() { + return residentialArea; + } + + public void setResidentialArea(String residentialArea) { + this.residentialArea = residentialArea; + } + + public String getHomeAddress() { + return homeAddress; + } + + public void setHomeAddress(String homeAddress) { + this.homeAddress = homeAddress; + } + + public String getLandMark() { + return landMark; + } + + public void setLandMark(String landMark) { + this.landMark = landMark; + } + + public String getBirthDate() { + return birthDate; + } + + public void setBirthDate(String birthDate) { + this.birthDate = birthDate; + } + + public String getDateJoined() { + return dateJoined; + } + + public void setDateJoined(String dateJoined) { + this.dateJoined = dateJoined; + } + + public Long getServerVersion() { + return serverVersion; + } + + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } + + public String getChildName() { + return childName; + } + + public void setChildName(String childName) { + this.childName = childName; + } + + public String getMvaccUuid() { + return mvaccUuid; + } + + public void setMvaccUuid(String mvaccUuid) { + this.mvaccUuid = mvaccUuid; + } + + public String getBaseEntityId() { + return baseEntityId; + } + + public void setBaseEntityId(String baseEntityId) { + this.baseEntityId = baseEntityId; + } + + public String getC2dob() { + return c2dob; + } + + public void setC2dob(String c2dob) { + this.c2dob = c2dob; + } + + public String getC2name() { + return c2name; + } + + public void setC2name(String c2name) { + this.c2name = c2name; + } + + public String getC3dob() { + return c3dob; + } + + public void setC3dob(String c3dob) { + this.c3dob = c3dob; + } + + public String getC3name() { + return c3name; + } + + public void setC3name(String c3name) { + this.c3name = c3name; + } + + public DateTime getDateCreated() { + return dateCreated; + } + + public void setDateCreated(DateTime dateCreated) { + this.dateCreated = dateCreated; + } + + public String getZeirID() { + return zeirID; + } + + public void setZeirID(String zeirID) { + this.zeirID = zeirID; + } + + public String getC2zeir() { + return c2zeir; + } + + public void setC2zeir(String c2zeir) { + this.c2zeir = c2zeir; + } + + public String getC3zeir() { + return c3zeir; + } + + public void setC3zeir(String c3zeir) { + this.c3zeir = c3zeir; + } + + @Override + public int compareTo(Client client) { + return getDateCreated().compareTo(client.getDateCreated()); + } } diff --git a/src/main/java/org/opensrp/domain/Report.java b/src/main/java/org/opensrp/domain/Report.java index 2303446c3..eef8ba486 100644 --- a/src/main/java/org/opensrp/domain/Report.java +++ b/src/main/java/org/opensrp/domain/Report.java @@ -11,137 +11,137 @@ import org.smartregister.domain.BaseEntity; public class Report extends BaseEntity { - - @JsonProperty - private String locationId; - - @JsonProperty - private DateTime reportDate; - - @JsonProperty - private String reportType; - - @JsonProperty - private String formSubmissionId; - - @JsonProperty - private String providerId; - - @JsonProperty - private String status; - - @JsonProperty - private long version; - - @JsonProperty - private int duration; - - @JsonProperty - private List hia2Indicators; - - public Report() { - this.version = System.currentTimeMillis(); - } - - public Report(String baseEntityId, String locationId, DateTime reportDate, String reportType, String formSubmissionId, - String providerId, String status, long version, int duration, List hia2Indicators) { - super(baseEntityId); - this.locationId = locationId; - this.reportDate = reportDate; - this.reportType = reportType; - this.formSubmissionId = formSubmissionId; - this.providerId = providerId; - this.status = status; - this.version = version; - this.duration = duration; - this.hia2Indicators = hia2Indicators; - } - - public String getLocationId() { - return locationId; - } - - public void setLocationId(String locationId) { - this.locationId = locationId; - } - - public DateTime getReportDate() { - return reportDate; - } - - public void setReportDate(DateTime reportDate) { - this.reportDate = reportDate; - } - - public String getReportType() { - return reportType; - } - - public void setReportType(String reportType) { - this.reportType = reportType; - } - - public String getFormSubmissionId() { - return formSubmissionId; - } - - public void setFormSubmissionId(String formSubmissionId) { - this.formSubmissionId = formSubmissionId; - } - - public String getProviderId() { - return providerId; - } - - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public long getVersion() { - return version; - } - - public void setVersion(long version) { - this.version = version; - } - - public int getDuration() { - return duration; - } - - public void setDuration(int duration) { - this.duration = duration; - } - - public List getHia2Indicators() { - return hia2Indicators; - } - - public void setHia2Indicators(List hia2Indicators) { - this.hia2Indicators = hia2Indicators; - } - - @Override - public final boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); - } - - @Override - public final int hashCode() { - return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } - + + @JsonProperty + private String locationId; + + @JsonProperty + private DateTime reportDate; + + @JsonProperty + private String reportType; + + @JsonProperty + private String formSubmissionId; + + @JsonProperty + private String providerId; + + @JsonProperty + private String status; + + @JsonProperty + private long version; + + @JsonProperty + private int duration; + + @JsonProperty + private List hia2Indicators; + + public Report() { + this.version = System.currentTimeMillis(); + } + + public Report(String baseEntityId, String locationId, DateTime reportDate, String reportType, String formSubmissionId, + String providerId, String status, long version, int duration, List hia2Indicators) { + super(baseEntityId); + this.locationId = locationId; + this.reportDate = reportDate; + this.reportType = reportType; + this.formSubmissionId = formSubmissionId; + this.providerId = providerId; + this.status = status; + this.version = version; + this.duration = duration; + this.hia2Indicators = hia2Indicators; + } + + public String getLocationId() { + return locationId; + } + + public void setLocationId(String locationId) { + this.locationId = locationId; + } + + public DateTime getReportDate() { + return reportDate; + } + + public void setReportDate(DateTime reportDate) { + this.reportDate = reportDate; + } + + public String getReportType() { + return reportType; + } + + public void setReportType(String reportType) { + this.reportType = reportType; + } + + public String getFormSubmissionId() { + return formSubmissionId; + } + + public void setFormSubmissionId(String formSubmissionId) { + this.formSubmissionId = formSubmissionId; + } + + public String getProviderId() { + return providerId; + } + + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public long getVersion() { + return version; + } + + public void setVersion(long version) { + this.version = version; + } + + public int getDuration() { + return duration; + } + + public void setDuration(int duration) { + this.duration = duration; + } + + public List getHia2Indicators() { + return hia2Indicators; + } + + public void setHia2Indicators(List hia2Indicators) { + this.hia2Indicators = hia2Indicators; + } + + @Override + public final boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); + } + + @Override + public final int hashCode() { + return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this); + } + } diff --git a/src/main/java/org/opensrp/domain/Search.java b/src/main/java/org/opensrp/domain/Search.java index a5ed54bcb..0af5aa76e 100644 --- a/src/main/java/org/opensrp/domain/Search.java +++ b/src/main/java/org/opensrp/domain/Search.java @@ -18,238 +18,238 @@ import org.smartregister.domain.BaseEntity; public class Search extends BaseEntity { - - @JsonProperty - private String firstName; - - @JsonProperty - private String middleName; - - @JsonProperty - private String lastName; - - @JsonProperty - private DateTime birthdate; - - @JsonProperty - private Boolean birthdateApprox; - - @JsonProperty - private String gender; - - @JsonProperty - private Map> relationships; - - protected Search() { - - } - - public Search(String baseEntityId) { - super(baseEntityId); - } - - public Search(String baseEntityId, String firstName, String middleName, String lastName, DateTime birthdate, - Boolean birthdateApprox, String gender) { - super(baseEntityId); - this.firstName = firstName; - this.middleName = middleName; - this.lastName = lastName; - this.birthdate = birthdate; - this.birthdateApprox = birthdateApprox; - this.gender = gender; - } - - public Search(String baseEntityId, String firstName, String middleName, String lastName, DateTime birthdate, - Boolean birthdateApprox, String gender, String identifierType, String identifier) { - super(baseEntityId); - this.firstName = firstName; - this.middleName = middleName; - this.lastName = lastName; - this.birthdate = birthdate; - this.birthdateApprox = birthdateApprox; - this.gender = gender; - addIdentifier(identifierType, identifier); - } - - public Search(String baseEntityId, String firstName, String middleName, String lastName, DateTime birthdate, - Boolean birthdateApprox, String gender, List
addresses, Map identifiers, - Map attributes) { - super(baseEntityId); - this.firstName = firstName; - this.middleName = middleName; - this.lastName = lastName; - this.birthdate = birthdate; - this.birthdateApprox = birthdateApprox; - this.gender = gender; - setIdentifiers(identifiers); - setAddresses(addresses); - setAttributes(attributes); - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getMiddleName() { - return middleName; - } - - public void setMiddleName(String middleName) { - this.middleName = middleName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String fullName() { - String n = ""; - if (StringUtils.isNotBlank(firstName)) { - n += firstName; - } - if (StringUtils.isNotBlank(middleName)) { - n += " " + middleName; - } - if (StringUtils.isNotBlank(lastName)) { - n += " " + lastName; - } - return n.trim(); - } - - public DateTime getBirthdate() { - return birthdate; - } - - public void setBirthdate(DateTime birthdate) { - this.birthdate = birthdate; - } - - public Boolean getBirthdateApprox() { - return birthdateApprox; - } - - public void setBirthdateApprox(Boolean birthdateApprox) { - this.birthdateApprox = birthdateApprox; - } - - public String getGender() { - return gender; - } - - public void setGender(String gender) { - this.gender = gender; - } - - public Map> getRelationships() { - return relationships; - } - - public void setRelationships(Map> relationships) { - this.relationships = relationships; - } - - public Search withFirstName(String firstName) { - this.firstName = firstName; - return this; - } - - public Search withMiddleName(String middleName) { - this.middleName = middleName; - return this; - } - - public Search withLastName(String lastName) { - this.lastName = lastName; - return this; - } - - public Search withName(String firstName, String middleName, String lastName) { - this.firstName = firstName; - this.middleName = middleName; - this.lastName = lastName; - return this; - } - - public Search withBirthdate(DateTime birthdate, Boolean isApproximate) { - this.birthdate = birthdate; - this.birthdateApprox = isApproximate; - return this; - } - - public Search withGender(String gender) { - this.gender = gender; - return this; - } - - public Search withGender(Gender gender) { - this.gender = gender.name(); - return this; - } - - /** - * Overrides the existing data - */ - public Search withRelationships(Map> relationships) { - this.relationships = relationships; - return this; - } - - public List findRelatives(String relationshipType) { - if (relationships == null) { - relationships = new HashMap<>(); - } - - return relationships.get(relationshipType); - } - - public void addRelationship(String relationType, String relativeEntityId) { - if (relationships == null) { - relationships = new HashMap<>(); - } - - List relatives = findRelatives(relationType); - if (relatives == null) { - relatives = new ArrayList<>(); - } - relatives.add(relativeEntityId); - relationships.put(relationType, relatives); - } - - public List getRelationships(String relativeEntityId) { - List relations = new ArrayList(); - for (Entry> rl : relationships.entrySet()) { - List relativeEntityIdList = rl.getValue(); - for (String entityId : relativeEntityIdList) { - if (entityId.equalsIgnoreCase(relativeEntityId)) { - relations.add(rl.getKey()); - break; - } - } - } - return relations; - } - - @Override - public final boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); - } - - @Override - public final int hashCode() { - return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } - + + @JsonProperty + private String firstName; + + @JsonProperty + private String middleName; + + @JsonProperty + private String lastName; + + @JsonProperty + private DateTime birthdate; + + @JsonProperty + private Boolean birthdateApprox; + + @JsonProperty + private String gender; + + @JsonProperty + private Map> relationships; + + protected Search() { + + } + + public Search(String baseEntityId) { + super(baseEntityId); + } + + public Search(String baseEntityId, String firstName, String middleName, String lastName, DateTime birthdate, + Boolean birthdateApprox, String gender) { + super(baseEntityId); + this.firstName = firstName; + this.middleName = middleName; + this.lastName = lastName; + this.birthdate = birthdate; + this.birthdateApprox = birthdateApprox; + this.gender = gender; + } + + public Search(String baseEntityId, String firstName, String middleName, String lastName, DateTime birthdate, + Boolean birthdateApprox, String gender, String identifierType, String identifier) { + super(baseEntityId); + this.firstName = firstName; + this.middleName = middleName; + this.lastName = lastName; + this.birthdate = birthdate; + this.birthdateApprox = birthdateApprox; + this.gender = gender; + addIdentifier(identifierType, identifier); + } + + public Search(String baseEntityId, String firstName, String middleName, String lastName, DateTime birthdate, + Boolean birthdateApprox, String gender, List
addresses, Map identifiers, + Map attributes) { + super(baseEntityId); + this.firstName = firstName; + this.middleName = middleName; + this.lastName = lastName; + this.birthdate = birthdate; + this.birthdateApprox = birthdateApprox; + this.gender = gender; + setIdentifiers(identifiers); + setAddresses(addresses); + setAttributes(attributes); + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(String middleName) { + this.middleName = middleName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String fullName() { + String n = ""; + if (StringUtils.isNotBlank(firstName)) { + n += firstName; + } + if (StringUtils.isNotBlank(middleName)) { + n += " " + middleName; + } + if (StringUtils.isNotBlank(lastName)) { + n += " " + lastName; + } + return n.trim(); + } + + public DateTime getBirthdate() { + return birthdate; + } + + public void setBirthdate(DateTime birthdate) { + this.birthdate = birthdate; + } + + public Boolean getBirthdateApprox() { + return birthdateApprox; + } + + public void setBirthdateApprox(Boolean birthdateApprox) { + this.birthdateApprox = birthdateApprox; + } + + public String getGender() { + return gender; + } + + public void setGender(String gender) { + this.gender = gender; + } + + public Map> getRelationships() { + return relationships; + } + + public void setRelationships(Map> relationships) { + this.relationships = relationships; + } + + public Search withFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + public Search withMiddleName(String middleName) { + this.middleName = middleName; + return this; + } + + public Search withLastName(String lastName) { + this.lastName = lastName; + return this; + } + + public Search withName(String firstName, String middleName, String lastName) { + this.firstName = firstName; + this.middleName = middleName; + this.lastName = lastName; + return this; + } + + public Search withBirthdate(DateTime birthdate, Boolean isApproximate) { + this.birthdate = birthdate; + this.birthdateApprox = isApproximate; + return this; + } + + public Search withGender(String gender) { + this.gender = gender; + return this; + } + + public Search withGender(Gender gender) { + this.gender = gender.name(); + return this; + } + + /** + * Overrides the existing data + */ + public Search withRelationships(Map> relationships) { + this.relationships = relationships; + return this; + } + + public List findRelatives(String relationshipType) { + if (relationships == null) { + relationships = new HashMap<>(); + } + + return relationships.get(relationshipType); + } + + public void addRelationship(String relationType, String relativeEntityId) { + if (relationships == null) { + relationships = new HashMap<>(); + } + + List relatives = findRelatives(relationType); + if (relatives == null) { + relatives = new ArrayList<>(); + } + relatives.add(relativeEntityId); + relationships.put(relationType, relatives); + } + + public List getRelationships(String relativeEntityId) { + List relations = new ArrayList(); + for (Entry> rl : relationships.entrySet()) { + List relativeEntityIdList = rl.getValue(); + for (String entityId : relativeEntityIdList) { + if (entityId.equalsIgnoreCase(relativeEntityId)) { + relations.add(rl.getKey()); + break; + } + } + } + return relations; + } + + @Override + public final boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); + } + + @Override + public final int hashCode() { + return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this); + } + } diff --git a/src/main/java/org/opensrp/domain/StructureCount.java b/src/main/java/org/opensrp/domain/StructureCount.java index 620b15e1b..9bb10aea6 100644 --- a/src/main/java/org/opensrp/domain/StructureCount.java +++ b/src/main/java/org/opensrp/domain/StructureCount.java @@ -15,11 +15,9 @@ @AllArgsConstructor public class StructureCount implements Serializable { - private static final long serialVersionUID = -6553112674200592573L; + public static final String STRUCTURE_COUNT = "structureCount"; + private static final long serialVersionUID = -6553112674200592573L; + private String parentId; - public static final String STRUCTURE_COUNT = "structureCount"; - - private String parentId; - - private int count; + private int count; } diff --git a/src/main/java/org/opensrp/domain/StructureDetails.java b/src/main/java/org/opensrp/domain/StructureDetails.java index 5e2b2bcf7..a851f01c4 100644 --- a/src/main/java/org/opensrp/domain/StructureDetails.java +++ b/src/main/java/org/opensrp/domain/StructureDetails.java @@ -5,69 +5,69 @@ public class StructureDetails { - private String structureId; - - private String structureParentId; - - private String structureType; - - private String familyId; - - private Set familyMembers = new HashSet<>(); - - public StructureDetails(String structureId, String structureParentId, String structureType) { - super(); - this.structureId = structureId; - this.structureParentId = structureParentId; - this.structureType = structureType; - } - - public String getStructureId() { - return structureId; - } - - public void setStructureId(String structureId) { - this.structureId = structureId; - } - - public String getStructureParentId() { - return structureParentId; - } - - public void setStructureParentId(String structureParentId) { - this.structureParentId = structureParentId; - } - - public String getStructureType() { - return structureType; - } - - public void setStructureType(String structureType) { - this.structureType = structureType; - } - - public String getFamilyId() { - return familyId; - } - - public void setFamilyId(String familyId) { - this.familyId = familyId; - } - - public Set getFamilyMembers() { - return familyMembers; - } - - public void setFamilyMembers(Set familyMembers) { - this.familyMembers = familyMembers; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof StructureDetails)) - return false; - StructureDetails other = (StructureDetails) obj; - return structureId.equals(other.getStructureId()); - } + private String structureId; + + private String structureParentId; + + private String structureType; + + private String familyId; + + private Set familyMembers = new HashSet<>(); + + public StructureDetails(String structureId, String structureParentId, String structureType) { + super(); + this.structureId = structureId; + this.structureParentId = structureParentId; + this.structureType = structureType; + } + + public String getStructureId() { + return structureId; + } + + public void setStructureId(String structureId) { + this.structureId = structureId; + } + + public String getStructureParentId() { + return structureParentId; + } + + public void setStructureParentId(String structureParentId) { + this.structureParentId = structureParentId; + } + + public String getStructureType() { + return structureType; + } + + public void setStructureType(String structureType) { + this.structureType = structureType; + } + + public String getFamilyId() { + return familyId; + } + + public void setFamilyId(String familyId) { + this.familyId = familyId; + } + + public Set getFamilyMembers() { + return familyMembers; + } + + public void setFamilyMembers(Set familyMembers) { + this.familyMembers = familyMembers; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof StructureDetails)) + return false; + StructureDetails other = (StructureDetails) obj; + return structureId.equals(other.getStructureId()); + } } diff --git a/src/main/java/org/opensrp/domain/SubFormDefinition.java b/src/main/java/org/opensrp/domain/SubFormDefinition.java index 8a66217a3..0ea641594 100644 --- a/src/main/java/org/opensrp/domain/SubFormDefinition.java +++ b/src/main/java/org/opensrp/domain/SubFormDefinition.java @@ -3,62 +3,62 @@ import java.util.List; public class SubFormDefinition { - - private String name; - - private String bind_type; - - private String default_bind_path; - - private List fields; - - //private List> instances; - - public SubFormDefinition() { - // this.instances = new ArrayList<>(); - this.name = ""; - } - - public SubFormDefinition(String name, List fields) { - // this.instances = instances; - this.fields = fields; - this.name = name; - } - - public String name() { - return name; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getBind_type() { - return bind_type; - } - - public void setBind_type(String bind_type) { - this.bind_type = bind_type; - } - - public String getDefault_bind_path() { - return default_bind_path; - } - - public void setDefault_bind_path(String default_bind_path) { - this.default_bind_path = default_bind_path; - } - - public List getFields() { - return fields; - } - - public void setFields(List fields) { - this.fields = fields; - } - + + private String name; + + private String bind_type; + + private String default_bind_path; + + private List fields; + + //private List> instances; + + public SubFormDefinition() { + // this.instances = new ArrayList<>(); + this.name = ""; + } + + public SubFormDefinition(String name, List fields) { + // this.instances = instances; + this.fields = fields; + this.name = name; + } + + public String name() { + return name; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getBind_type() { + return bind_type; + } + + public void setBind_type(String bind_type) { + this.bind_type = bind_type; + } + + public String getDefault_bind_path() { + return default_bind_path; + } + + public void setDefault_bind_path(String default_bind_path) { + this.default_bind_path = default_bind_path; + } + + public List getFields() { + return fields; + } + + public void setFields(List fields) { + this.fields = fields; + } + } diff --git a/src/main/java/org/opensrp/domain/TaskUpdate.java b/src/main/java/org/opensrp/domain/TaskUpdate.java index 68004520d..893225d65 100644 --- a/src/main/java/org/opensrp/domain/TaskUpdate.java +++ b/src/main/java/org/opensrp/domain/TaskUpdate.java @@ -4,48 +4,48 @@ public class TaskUpdate { - @SerializedName("identifier") - private String identifier; + @SerializedName("identifier") + private String identifier; - @SerializedName("status") - private String status; + @SerializedName("status") + private String status; - @SerializedName("businessStatus") - private String businessStatus; + @SerializedName("businessStatus") + private String businessStatus; - @SerializedName("serverVersion") - private Long serverVersion; + @SerializedName("serverVersion") + private Long serverVersion; - public String getIdentifier() { - return identifier; - } + public String getIdentifier() { + return identifier; + } - public void setIdentifier(String identifier) { - this.identifier = identifier; - } + public void setIdentifier(String identifier) { + this.identifier = identifier; + } - public String getStatus() { - return status; - } + public String getStatus() { + return status; + } - public void setStatus(String status) { - this.status = status; - } + public void setStatus(String status) { + this.status = status; + } - public String getBusinessStatus() { - return businessStatus; - } + public String getBusinessStatus() { + return businessStatus; + } - public void setBusinessStatus(String businessStatus) { - this.businessStatus = businessStatus; - } + public void setBusinessStatus(String businessStatus) { + this.businessStatus = businessStatus; + } - public Long getServerVersion() { - return serverVersion; - } + public Long getServerVersion() { + return serverVersion; + } - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } } diff --git a/src/main/java/org/opensrp/domain/UniqueId.java b/src/main/java/org/opensrp/domain/UniqueId.java index 78a2582f7..3e5c62cbc 100644 --- a/src/main/java/org/opensrp/domain/UniqueId.java +++ b/src/main/java/org/opensrp/domain/UniqueId.java @@ -24,66 +24,66 @@ @AllArgsConstructor @ToString public class UniqueId { - - public static final String tbName = "unique_ids"; - - public static final String COL_OPENMRSID = "openmrs_id"; - - public static final String COL_STATUS = "status"; - - public static final String COL_USEDBY = "used_by"; - - public static final String COL_LOCATION = "location"; - - public static final String COL_CREATED_AT = "created_at"; - - public static final String COL_UPDATED_AT = "updated_at"; - - public static String STATUS_USED = "used"; - - public static String STATUS_NOT_USED = "not_used"; - - @Id - @GeneratedValue - @Column(name = "_id") - private Long id; - - @Column(name = COL_OPENMRSID) - private String openmrsId; - - @Column(name = COL_STATUS) - private String status; - - @Column(name = COL_USEDBY) - private String usedBy; - - @Column(name = COL_LOCATION) - private String location; - - @Column(name = COL_CREATED_AT, columnDefinition = "DATETIME") - @Temporal(TemporalType.TIMESTAMP) - private Date createdAt; - - @Column(name = COL_UPDATED_AT, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") - @Temporal(TemporalType.TIMESTAMP) - private Date updatedAt; - - private String identifier; - - private Long idSource; - - private boolean isReserved; - - public UniqueId(String openmrsId, String status, String usedBy, String location, Date createdAt, Date updatedAt, - String identifier, Long idSource, boolean isReserved) { - this.openmrsId = openmrsId; - this.status = status; - this.usedBy = usedBy; - this.location = location; - this.createdAt = createdAt; - this.updatedAt = updatedAt; - this.identifier = identifier; - this.idSource = idSource; - this.isReserved = isReserved; - } + + public static final String tbName = "unique_ids"; + + public static final String COL_OPENMRSID = "openmrs_id"; + + public static final String COL_STATUS = "status"; + + public static final String COL_USEDBY = "used_by"; + + public static final String COL_LOCATION = "location"; + + public static final String COL_CREATED_AT = "created_at"; + + public static final String COL_UPDATED_AT = "updated_at"; + + public static String STATUS_USED = "used"; + + public static String STATUS_NOT_USED = "not_used"; + + @Id + @GeneratedValue + @Column(name = "_id") + private Long id; + + @Column(name = COL_OPENMRSID) + private String openmrsId; + + @Column(name = COL_STATUS) + private String status; + + @Column(name = COL_USEDBY) + private String usedBy; + + @Column(name = COL_LOCATION) + private String location; + + @Column(name = COL_CREATED_AT, columnDefinition = "DATETIME") + @Temporal(TemporalType.TIMESTAMP) + private Date createdAt; + + @Column(name = COL_UPDATED_AT, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") + @Temporal(TemporalType.TIMESTAMP) + private Date updatedAt; + + private String identifier; + + private Long idSource; + + private boolean isReserved; + + public UniqueId(String openmrsId, String status, String usedBy, String location, Date createdAt, Date updatedAt, + String identifier, Long idSource, boolean isReserved) { + this.openmrsId = openmrsId; + this.status = status; + this.usedBy = usedBy; + this.location = location; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.identifier = identifier; + this.idSource = idSource; + this.isReserved = isReserved; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/Action.java b/src/main/java/org/opensrp/domain/postgres/Action.java index a71e50d65..86007a6a5 100644 --- a/src/main/java/org/opensrp/domain/postgres/Action.java +++ b/src/main/java/org/opensrp/domain/postgres/Action.java @@ -1,64 +1,64 @@ package org.opensrp.domain.postgres; public class Action { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.action.id - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.action.json - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - private Object json; - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.action.id - * - * @return the value of core.action.id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.action.id - * - * @param id the value for core.action.id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.action.json - * - * @return the value of core.action.json - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public Object getJson() { - return json; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.action.json - * - * @param json the value for core.action.json - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void setJson(Object json) { - this.json = json; - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.action.id + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.action.json + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + private Object json; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.action.id + * + * @return the value of core.action.id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.action.id + * + * @param id the value for core.action.id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.action.json + * + * @return the value of core.action.json + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public Object getJson() { + return json; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.action.json + * + * @param json the value for core.action.json + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void setJson(Object json) { + this.json = json; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ActionExample.java b/src/main/java/org/opensrp/domain/postgres/ActionExample.java index 0c32a4f72..c83e87d0d 100644 --- a/src/main/java/org/opensrp/domain/postgres/ActionExample.java +++ b/src/main/java/org/opensrp/domain/postgres/ActionExample.java @@ -4,456 +4,456 @@ import java.util.List; public class ActionExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public ActionExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - protected abstract static class GeneratedCriteria { - - protected List jsonCriteria; - - protected List allCriteria; - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - jsonCriteria = new ArrayList(); - } - - public List getJsonCriteria() { - return jsonCriteria; - } - - protected void addJsonCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.ActionTypeHandler")); - allCriteria = null; - } - - protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - jsonCriteria.add( - new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.ActionTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || jsonCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList(); - allCriteria.addAll(criteria); - allCriteria.addAll(jsonCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - allCriteria = null; - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andJsonIsNull() { - addCriterion("json is null"); - return (Criteria) this; - } - - public Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (Criteria) this; - } - - public Criteria andJsonEqualTo(Object value) { - addJsonCriterion("json =", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotEqualTo(Object value) { - addJsonCriterion("json <>", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThan(Object value) { - addJsonCriterion("json >", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThanOrEqualTo(Object value) { - addJsonCriterion("json >=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThan(Object value) { - addJsonCriterion("json <", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThanOrEqualTo(Object value) { - addJsonCriterion("json <=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonIn(List values) { - addJsonCriterion("json in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotIn(List values) { - addJsonCriterion("json not in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonBetween(Object value1, Object value2) { - addJsonCriterion("json between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotBetween(Object value1, Object value2) { - addJsonCriterion("json not between", value1, value2, "json"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.action - * - * @mbg.generated do_not_delete_during_merge Fri Mar 09 15:24:01 EAT 2018 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public ActionExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + protected abstract static class GeneratedCriteria { + + protected List jsonCriteria; + + protected List allCriteria; + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + jsonCriteria = new ArrayList(); + } + + public List getJsonCriteria() { + return jsonCriteria; + } + + protected void addJsonCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.ActionTypeHandler")); + allCriteria = null; + } + + protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + jsonCriteria.add( + new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.ActionTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || jsonCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList(); + allCriteria.addAll(criteria); + allCriteria.addAll(jsonCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andJsonIsNull() { + addCriterion("json is null"); + return (Criteria) this; + } + + public Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (Criteria) this; + } + + public Criteria andJsonEqualTo(Object value) { + addJsonCriterion("json =", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotEqualTo(Object value) { + addJsonCriterion("json <>", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThan(Object value) { + addJsonCriterion("json >", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThanOrEqualTo(Object value) { + addJsonCriterion("json >=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThan(Object value) { + addJsonCriterion("json <", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThanOrEqualTo(Object value) { + addJsonCriterion("json <=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonIn(List values) { + addJsonCriterion("json in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotIn(List values) { + addJsonCriterion("json not in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonBetween(Object value1, Object value2) { + addJsonCriterion("json between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotBetween(Object value1, Object value2) { + addJsonCriterion("json not between", value1, value2, "json"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.action + * + * @mbg.generated do_not_delete_during_merge Fri Mar 09 15:24:01 EAT 2018 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ActionMetadata.java b/src/main/java/org/opensrp/domain/postgres/ActionMetadata.java index 1b1cc3425..fa08d4b5f 100644 --- a/src/main/java/org/opensrp/domain/postgres/ActionMetadata.java +++ b/src/main/java/org/opensrp/domain/postgres/ActionMetadata.java @@ -1,274 +1,274 @@ package org.opensrp.domain.postgres; public class ActionMetadata { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.action_metadata.id - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.action_metadata.action_id - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - private Long actionId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.action_metadata.document_id - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - private String documentId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.action_metadata.base_entity_id - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - private String baseEntityId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.action_metadata.server_version - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - private Long serverVersion; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.action_metadata.provider_id - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - private String providerId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.action_metadata.location_id - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - private String locationId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.action_metadata.team - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - private String team; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.action_metadata.team_id - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - private String teamId; - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.action_metadata.id - * - * @return the value of core.action_metadata.id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.action_metadata.id - * - * @param id the value for core.action_metadata.id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.action_metadata.action_id - * - * @return the value of core.action_metadata.action_id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public Long getActionId() { - return actionId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.action_metadata.action_id - * - * @param actionId the value for core.action_metadata.action_id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void setActionId(Long actionId) { - this.actionId = actionId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.action_metadata.document_id - * - * @return the value of core.action_metadata.document_id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public String getDocumentId() { - return documentId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.action_metadata.document_id - * - * @param documentId the value for core.action_metadata.document_id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void setDocumentId(String documentId) { - this.documentId = documentId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.action_metadata.base_entity_id - * - * @return the value of core.action_metadata.base_entity_id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public String getBaseEntityId() { - return baseEntityId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.action_metadata.base_entity_id - * - * @param baseEntityId the value for core.action_metadata.base_entity_id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void setBaseEntityId(String baseEntityId) { - this.baseEntityId = baseEntityId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.action_metadata.server_version - * - * @return the value of core.action_metadata.server_version - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public Long getServerVersion() { - return serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.action_metadata.server_version - * - * @param serverVersion the value for core.action_metadata.server_version - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.action_metadata.provider_id - * - * @return the value of core.action_metadata.provider_id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public String getProviderId() { - return providerId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.action_metadata.provider_id - * - * @param providerId the value for core.action_metadata.provider_id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.action_metadata.location_id - * - * @return the value of core.action_metadata.location_id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public String getLocationId() { - return locationId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.action_metadata.location_id - * - * @param locationId the value for core.action_metadata.location_id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void setLocationId(String locationId) { - this.locationId = locationId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.action_metadata.team - * - * @return the value of core.action_metadata.team - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public String getTeam() { - return team; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.action_metadata.team - * - * @param team the value for core.action_metadata.team - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void setTeam(String team) { - this.team = team; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.action_metadata.team_id - * - * @return the value of core.action_metadata.team_id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public String getTeamId() { - return teamId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.action_metadata.team_id - * - * @param teamId the value for core.action_metadata.team_id - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void setTeamId(String teamId) { - this.teamId = teamId; - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.action_metadata.id + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.action_metadata.action_id + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + private Long actionId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.action_metadata.document_id + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + private String documentId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.action_metadata.base_entity_id + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + private String baseEntityId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.action_metadata.server_version + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + private Long serverVersion; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.action_metadata.provider_id + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + private String providerId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.action_metadata.location_id + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + private String locationId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.action_metadata.team + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + private String team; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.action_metadata.team_id + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + private String teamId; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.action_metadata.id + * + * @return the value of core.action_metadata.id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.action_metadata.id + * + * @param id the value for core.action_metadata.id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.action_metadata.action_id + * + * @return the value of core.action_metadata.action_id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public Long getActionId() { + return actionId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.action_metadata.action_id + * + * @param actionId the value for core.action_metadata.action_id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void setActionId(Long actionId) { + this.actionId = actionId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.action_metadata.document_id + * + * @return the value of core.action_metadata.document_id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public String getDocumentId() { + return documentId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.action_metadata.document_id + * + * @param documentId the value for core.action_metadata.document_id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void setDocumentId(String documentId) { + this.documentId = documentId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.action_metadata.base_entity_id + * + * @return the value of core.action_metadata.base_entity_id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public String getBaseEntityId() { + return baseEntityId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.action_metadata.base_entity_id + * + * @param baseEntityId the value for core.action_metadata.base_entity_id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void setBaseEntityId(String baseEntityId) { + this.baseEntityId = baseEntityId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.action_metadata.server_version + * + * @return the value of core.action_metadata.server_version + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public Long getServerVersion() { + return serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.action_metadata.server_version + * + * @param serverVersion the value for core.action_metadata.server_version + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.action_metadata.provider_id + * + * @return the value of core.action_metadata.provider_id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public String getProviderId() { + return providerId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.action_metadata.provider_id + * + * @param providerId the value for core.action_metadata.provider_id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.action_metadata.location_id + * + * @return the value of core.action_metadata.location_id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public String getLocationId() { + return locationId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.action_metadata.location_id + * + * @param locationId the value for core.action_metadata.location_id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void setLocationId(String locationId) { + this.locationId = locationId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.action_metadata.team + * + * @return the value of core.action_metadata.team + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public String getTeam() { + return team; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.action_metadata.team + * + * @param team the value for core.action_metadata.team + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void setTeam(String team) { + this.team = team; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.action_metadata.team_id + * + * @return the value of core.action_metadata.team_id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public String getTeamId() { + return teamId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.action_metadata.team_id + * + * @param teamId the value for core.action_metadata.team_id + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void setTeamId(String teamId) { + this.teamId = teamId; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ActionMetadataExample.java b/src/main/java/org/opensrp/domain/postgres/ActionMetadataExample.java index cb272dafc..d85868445 100644 --- a/src/main/java/org/opensrp/domain/postgres/ActionMetadataExample.java +++ b/src/main/java/org/opensrp/domain/postgres/ActionMetadataExample.java @@ -4,902 +4,902 @@ import java.util.List; public class ActionMetadataExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public ActionMetadataExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andActionIdIsNull() { - addCriterion("action_id is null"); - return (Criteria) this; - } - - public Criteria andActionIdIsNotNull() { - addCriterion("action_id is not null"); - return (Criteria) this; - } - - public Criteria andActionIdEqualTo(Long value) { - addCriterion("action_id =", value, "actionId"); - return (Criteria) this; - } - - public Criteria andActionIdNotEqualTo(Long value) { - addCriterion("action_id <>", value, "actionId"); - return (Criteria) this; - } - - public Criteria andActionIdGreaterThan(Long value) { - addCriterion("action_id >", value, "actionId"); - return (Criteria) this; - } - - public Criteria andActionIdGreaterThanOrEqualTo(Long value) { - addCriterion("action_id >=", value, "actionId"); - return (Criteria) this; - } - - public Criteria andActionIdLessThan(Long value) { - addCriterion("action_id <", value, "actionId"); - return (Criteria) this; - } - - public Criteria andActionIdLessThanOrEqualTo(Long value) { - addCriterion("action_id <=", value, "actionId"); - return (Criteria) this; - } - - public Criteria andActionIdIn(List values) { - addCriterion("action_id in", values, "actionId"); - return (Criteria) this; - } - - public Criteria andActionIdNotIn(List values) { - addCriterion("action_id not in", values, "actionId"); - return (Criteria) this; - } - - public Criteria andActionIdBetween(Long value1, Long value2) { - addCriterion("action_id between", value1, value2, "actionId"); - return (Criteria) this; - } - - public Criteria andActionIdNotBetween(Long value1, Long value2) { - addCriterion("action_id not between", value1, value2, "actionId"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNull() { - addCriterion("document_id is null"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNotNull() { - addCriterion("document_id is not null"); - return (Criteria) this; - } - - public Criteria andDocumentIdEqualTo(String value) { - addCriterion("document_id =", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotEqualTo(String value) { - addCriterion("document_id <>", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThan(String value) { - addCriterion("document_id >", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { - addCriterion("document_id >=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThan(String value) { - addCriterion("document_id <", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThanOrEqualTo(String value) { - addCriterion("document_id <=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLike(String value) { - addCriterion("document_id like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotLike(String value) { - addCriterion("document_id not like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdIn(List values) { - addCriterion("document_id in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotIn(List values) { - addCriterion("document_id not in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdBetween(String value1, String value2) { - addCriterion("document_id between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotBetween(String value1, String value2) { - addCriterion("document_id not between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdIsNull() { - addCriterion("base_entity_id is null"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdIsNotNull() { - addCriterion("base_entity_id is not null"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdEqualTo(String value) { - addCriterion("base_entity_id =", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotEqualTo(String value) { - addCriterion("base_entity_id <>", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdGreaterThan(String value) { - addCriterion("base_entity_id >", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdGreaterThanOrEqualTo(String value) { - addCriterion("base_entity_id >=", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdLessThan(String value) { - addCriterion("base_entity_id <", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdLessThanOrEqualTo(String value) { - addCriterion("base_entity_id <=", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdLike(String value) { - addCriterion("base_entity_id like", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotLike(String value) { - addCriterion("base_entity_id not like", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdIn(List values) { - addCriterion("base_entity_id in", values, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotIn(List values) { - addCriterion("base_entity_id not in", values, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdBetween(String value1, String value2) { - addCriterion("base_entity_id between", value1, value2, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotBetween(String value1, String value2) { - addCriterion("base_entity_id not between", value1, value2, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andProviderIdIsNull() { - addCriterion("provider_id is null"); - return (Criteria) this; - } - - public Criteria andProviderIdIsNotNull() { - addCriterion("provider_id is not null"); - return (Criteria) this; - } - - public Criteria andProviderIdEqualTo(String value) { - addCriterion("provider_id =", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotEqualTo(String value) { - addCriterion("provider_id <>", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdGreaterThan(String value) { - addCriterion("provider_id >", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdGreaterThanOrEqualTo(String value) { - addCriterion("provider_id >=", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdLessThan(String value) { - addCriterion("provider_id <", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdLessThanOrEqualTo(String value) { - addCriterion("provider_id <=", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdLike(String value) { - addCriterion("provider_id like", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotLike(String value) { - addCriterion("provider_id not like", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdIn(List values) { - addCriterion("provider_id in", values, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotIn(List values) { - addCriterion("provider_id not in", values, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdBetween(String value1, String value2) { - addCriterion("provider_id between", value1, value2, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotBetween(String value1, String value2) { - addCriterion("provider_id not between", value1, value2, "providerId"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNull() { - addCriterion("location_id is null"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNotNull() { - addCriterion("location_id is not null"); - return (Criteria) this; - } - - public Criteria andLocationIdEqualTo(String value) { - addCriterion("location_id =", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotEqualTo(String value) { - addCriterion("location_id <>", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThan(String value) { - addCriterion("location_id >", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThanOrEqualTo(String value) { - addCriterion("location_id >=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThan(String value) { - addCriterion("location_id <", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThanOrEqualTo(String value) { - addCriterion("location_id <=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLike(String value) { - addCriterion("location_id like", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotLike(String value) { - addCriterion("location_id not like", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdIn(List values) { - addCriterion("location_id in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotIn(List values) { - addCriterion("location_id not in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdBetween(String value1, String value2) { - addCriterion("location_id between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotBetween(String value1, String value2) { - addCriterion("location_id not between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andTeamIsNull() { - addCriterion("team is null"); - return (Criteria) this; - } - - public Criteria andTeamIsNotNull() { - addCriterion("team is not null"); - return (Criteria) this; - } - - public Criteria andTeamEqualTo(String value) { - addCriterion("team =", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotEqualTo(String value) { - addCriterion("team <>", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamGreaterThan(String value) { - addCriterion("team >", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamGreaterThanOrEqualTo(String value) { - addCriterion("team >=", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamLessThan(String value) { - addCriterion("team <", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamLessThanOrEqualTo(String value) { - addCriterion("team <=", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamLike(String value) { - addCriterion("team like", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotLike(String value) { - addCriterion("team not like", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamIn(List values) { - addCriterion("team in", values, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotIn(List values) { - addCriterion("team not in", values, "team"); - return (Criteria) this; - } - - public Criteria andTeamBetween(String value1, String value2) { - addCriterion("team between", value1, value2, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotBetween(String value1, String value2) { - addCriterion("team not between", value1, value2, "team"); - return (Criteria) this; - } - - public Criteria andTeamIdIsNull() { - addCriterion("team_id is null"); - return (Criteria) this; - } - - public Criteria andTeamIdIsNotNull() { - addCriterion("team_id is not null"); - return (Criteria) this; - } - - public Criteria andTeamIdEqualTo(String value) { - addCriterion("team_id =", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotEqualTo(String value) { - addCriterion("team_id <>", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdGreaterThan(String value) { - addCriterion("team_id >", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdGreaterThanOrEqualTo(String value) { - addCriterion("team_id >=", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdLessThan(String value) { - addCriterion("team_id <", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdLessThanOrEqualTo(String value) { - addCriterion("team_id <=", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdLike(String value) { - addCriterion("team_id like", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotLike(String value) { - addCriterion("team_id not like", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdIn(List values) { - addCriterion("team_id in", values, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotIn(List values) { - addCriterion("team_id not in", values, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdBetween(String value1, String value2) { - addCriterion("team_id between", value1, value2, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotBetween(String value1, String value2) { - addCriterion("team_id not between", value1, value2, "teamId"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.action_metadata - * - * @mbg.generated do_not_delete_during_merge Fri Mar 09 15:24:01 EAT 2018 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public ActionMetadataExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andActionIdIsNull() { + addCriterion("action_id is null"); + return (Criteria) this; + } + + public Criteria andActionIdIsNotNull() { + addCriterion("action_id is not null"); + return (Criteria) this; + } + + public Criteria andActionIdEqualTo(Long value) { + addCriterion("action_id =", value, "actionId"); + return (Criteria) this; + } + + public Criteria andActionIdNotEqualTo(Long value) { + addCriterion("action_id <>", value, "actionId"); + return (Criteria) this; + } + + public Criteria andActionIdGreaterThan(Long value) { + addCriterion("action_id >", value, "actionId"); + return (Criteria) this; + } + + public Criteria andActionIdGreaterThanOrEqualTo(Long value) { + addCriterion("action_id >=", value, "actionId"); + return (Criteria) this; + } + + public Criteria andActionIdLessThan(Long value) { + addCriterion("action_id <", value, "actionId"); + return (Criteria) this; + } + + public Criteria andActionIdLessThanOrEqualTo(Long value) { + addCriterion("action_id <=", value, "actionId"); + return (Criteria) this; + } + + public Criteria andActionIdIn(List values) { + addCriterion("action_id in", values, "actionId"); + return (Criteria) this; + } + + public Criteria andActionIdNotIn(List values) { + addCriterion("action_id not in", values, "actionId"); + return (Criteria) this; + } + + public Criteria andActionIdBetween(Long value1, Long value2) { + addCriterion("action_id between", value1, value2, "actionId"); + return (Criteria) this; + } + + public Criteria andActionIdNotBetween(Long value1, Long value2) { + addCriterion("action_id not between", value1, value2, "actionId"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNull() { + addCriterion("document_id is null"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNotNull() { + addCriterion("document_id is not null"); + return (Criteria) this; + } + + public Criteria andDocumentIdEqualTo(String value) { + addCriterion("document_id =", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotEqualTo(String value) { + addCriterion("document_id <>", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThan(String value) { + addCriterion("document_id >", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { + addCriterion("document_id >=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThan(String value) { + addCriterion("document_id <", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThanOrEqualTo(String value) { + addCriterion("document_id <=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLike(String value) { + addCriterion("document_id like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotLike(String value) { + addCriterion("document_id not like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdIn(List values) { + addCriterion("document_id in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotIn(List values) { + addCriterion("document_id not in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdBetween(String value1, String value2) { + addCriterion("document_id between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotBetween(String value1, String value2) { + addCriterion("document_id not between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdIsNull() { + addCriterion("base_entity_id is null"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdIsNotNull() { + addCriterion("base_entity_id is not null"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdEqualTo(String value) { + addCriterion("base_entity_id =", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotEqualTo(String value) { + addCriterion("base_entity_id <>", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdGreaterThan(String value) { + addCriterion("base_entity_id >", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdGreaterThanOrEqualTo(String value) { + addCriterion("base_entity_id >=", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdLessThan(String value) { + addCriterion("base_entity_id <", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdLessThanOrEqualTo(String value) { + addCriterion("base_entity_id <=", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdLike(String value) { + addCriterion("base_entity_id like", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotLike(String value) { + addCriterion("base_entity_id not like", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdIn(List values) { + addCriterion("base_entity_id in", values, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotIn(List values) { + addCriterion("base_entity_id not in", values, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdBetween(String value1, String value2) { + addCriterion("base_entity_id between", value1, value2, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotBetween(String value1, String value2) { + addCriterion("base_entity_id not between", value1, value2, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andProviderIdIsNull() { + addCriterion("provider_id is null"); + return (Criteria) this; + } + + public Criteria andProviderIdIsNotNull() { + addCriterion("provider_id is not null"); + return (Criteria) this; + } + + public Criteria andProviderIdEqualTo(String value) { + addCriterion("provider_id =", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotEqualTo(String value) { + addCriterion("provider_id <>", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdGreaterThan(String value) { + addCriterion("provider_id >", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdGreaterThanOrEqualTo(String value) { + addCriterion("provider_id >=", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdLessThan(String value) { + addCriterion("provider_id <", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdLessThanOrEqualTo(String value) { + addCriterion("provider_id <=", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdLike(String value) { + addCriterion("provider_id like", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotLike(String value) { + addCriterion("provider_id not like", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdIn(List values) { + addCriterion("provider_id in", values, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotIn(List values) { + addCriterion("provider_id not in", values, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdBetween(String value1, String value2) { + addCriterion("provider_id between", value1, value2, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotBetween(String value1, String value2) { + addCriterion("provider_id not between", value1, value2, "providerId"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNull() { + addCriterion("location_id is null"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNotNull() { + addCriterion("location_id is not null"); + return (Criteria) this; + } + + public Criteria andLocationIdEqualTo(String value) { + addCriterion("location_id =", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotEqualTo(String value) { + addCriterion("location_id <>", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThan(String value) { + addCriterion("location_id >", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThanOrEqualTo(String value) { + addCriterion("location_id >=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThan(String value) { + addCriterion("location_id <", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThanOrEqualTo(String value) { + addCriterion("location_id <=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLike(String value) { + addCriterion("location_id like", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotLike(String value) { + addCriterion("location_id not like", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdIn(List values) { + addCriterion("location_id in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotIn(List values) { + addCriterion("location_id not in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdBetween(String value1, String value2) { + addCriterion("location_id between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotBetween(String value1, String value2) { + addCriterion("location_id not between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andTeamIsNull() { + addCriterion("team is null"); + return (Criteria) this; + } + + public Criteria andTeamIsNotNull() { + addCriterion("team is not null"); + return (Criteria) this; + } + + public Criteria andTeamEqualTo(String value) { + addCriterion("team =", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotEqualTo(String value) { + addCriterion("team <>", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamGreaterThan(String value) { + addCriterion("team >", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamGreaterThanOrEqualTo(String value) { + addCriterion("team >=", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLessThan(String value) { + addCriterion("team <", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLessThanOrEqualTo(String value) { + addCriterion("team <=", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLike(String value) { + addCriterion("team like", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotLike(String value) { + addCriterion("team not like", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamIn(List values) { + addCriterion("team in", values, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotIn(List values) { + addCriterion("team not in", values, "team"); + return (Criteria) this; + } + + public Criteria andTeamBetween(String value1, String value2) { + addCriterion("team between", value1, value2, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotBetween(String value1, String value2) { + addCriterion("team not between", value1, value2, "team"); + return (Criteria) this; + } + + public Criteria andTeamIdIsNull() { + addCriterion("team_id is null"); + return (Criteria) this; + } + + public Criteria andTeamIdIsNotNull() { + addCriterion("team_id is not null"); + return (Criteria) this; + } + + public Criteria andTeamIdEqualTo(String value) { + addCriterion("team_id =", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotEqualTo(String value) { + addCriterion("team_id <>", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdGreaterThan(String value) { + addCriterion("team_id >", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdGreaterThanOrEqualTo(String value) { + addCriterion("team_id >=", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLessThan(String value) { + addCriterion("team_id <", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLessThanOrEqualTo(String value) { + addCriterion("team_id <=", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLike(String value) { + addCriterion("team_id like", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotLike(String value) { + addCriterion("team_id not like", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdIn(List values) { + addCriterion("team_id in", values, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotIn(List values) { + addCriterion("team_id not in", values, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdBetween(String value1, String value2) { + addCriterion("team_id between", value1, value2, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotBetween(String value1, String value2) { + addCriterion("team_id not between", value1, value2, "teamId"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.action_metadata + * + * @mbg.generated do_not_delete_during_merge Fri Mar 09 15:24:01 EAT 2018 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/Alert.java b/src/main/java/org/opensrp/domain/postgres/Alert.java index 4d0c1ab39..c6afe21ba 100644 --- a/src/main/java/org/opensrp/domain/postgres/Alert.java +++ b/src/main/java/org/opensrp/domain/postgres/Alert.java @@ -1,64 +1,64 @@ package org.opensrp.domain.postgres; public class Alert { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.alert.id - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.alert.json - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - private Object json; - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.alert.id - * - * @return the value of core.alert.id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.alert.id - * - * @param id the value for core.alert.id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.alert.json - * - * @return the value of core.alert.json - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public Object getJson() { - return json; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.alert.json - * - * @param json the value for core.alert.json - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setJson(Object json) { - this.json = json; - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.alert.id + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.alert.json + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + private Object json; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.alert.id + * + * @return the value of core.alert.id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.alert.id + * + * @param id the value for core.alert.id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.alert.json + * + * @return the value of core.alert.json + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public Object getJson() { + return json; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.alert.json + * + * @param json the value for core.alert.json + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setJson(Object json) { + this.json = json; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/AlertExample.java b/src/main/java/org/opensrp/domain/postgres/AlertExample.java index b40a5bf52..ee246ff30 100644 --- a/src/main/java/org/opensrp/domain/postgres/AlertExample.java +++ b/src/main/java/org/opensrp/domain/postgres/AlertExample.java @@ -4,456 +4,456 @@ import java.util.List; public class AlertExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public AlertExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - protected abstract static class GeneratedCriteria { - - protected List jsonCriteria; - - protected List allCriteria; - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - jsonCriteria = new ArrayList(); - } - - public List getJsonCriteria() { - return jsonCriteria; - } - - protected void addJsonCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.AlertTypeHandler")); - allCriteria = null; - } - - protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - jsonCriteria.add( - new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.AlertTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || jsonCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList(); - allCriteria.addAll(criteria); - allCriteria.addAll(jsonCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - allCriteria = null; - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andJsonIsNull() { - addCriterion("json is null"); - return (Criteria) this; - } - - public Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (Criteria) this; - } - - public Criteria andJsonEqualTo(Object value) { - addJsonCriterion("json =", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotEqualTo(Object value) { - addJsonCriterion("json <>", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThan(Object value) { - addJsonCriterion("json >", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThanOrEqualTo(Object value) { - addJsonCriterion("json >=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThan(Object value) { - addJsonCriterion("json <", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThanOrEqualTo(Object value) { - addJsonCriterion("json <=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonIn(List values) { - addJsonCriterion("json in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotIn(List values) { - addJsonCriterion("json not in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonBetween(Object value1, Object value2) { - addJsonCriterion("json between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotBetween(Object value1, Object value2) { - addJsonCriterion("json not between", value1, value2, "json"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.alert - * - * @mbg.generated do_not_delete_during_merge Fri Mar 09 15:24:01 EAT 2018 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public AlertExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + protected abstract static class GeneratedCriteria { + + protected List jsonCriteria; + + protected List allCriteria; + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + jsonCriteria = new ArrayList(); + } + + public List getJsonCriteria() { + return jsonCriteria; + } + + protected void addJsonCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.AlertTypeHandler")); + allCriteria = null; + } + + protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + jsonCriteria.add( + new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.AlertTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || jsonCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList(); + allCriteria.addAll(criteria); + allCriteria.addAll(jsonCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andJsonIsNull() { + addCriterion("json is null"); + return (Criteria) this; + } + + public Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (Criteria) this; + } + + public Criteria andJsonEqualTo(Object value) { + addJsonCriterion("json =", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotEqualTo(Object value) { + addJsonCriterion("json <>", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThan(Object value) { + addJsonCriterion("json >", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThanOrEqualTo(Object value) { + addJsonCriterion("json >=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThan(Object value) { + addJsonCriterion("json <", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThanOrEqualTo(Object value) { + addJsonCriterion("json <=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonIn(List values) { + addJsonCriterion("json in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotIn(List values) { + addJsonCriterion("json not in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonBetween(Object value1, Object value2) { + addJsonCriterion("json between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotBetween(Object value1, Object value2) { + addJsonCriterion("json not between", value1, value2, "json"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.alert + * + * @mbg.generated do_not_delete_during_merge Fri Mar 09 15:24:01 EAT 2018 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/AlertMetadata.java b/src/main/java/org/opensrp/domain/postgres/AlertMetadata.java index 33bb1bd7a..e86fc03f8 100644 --- a/src/main/java/org/opensrp/domain/postgres/AlertMetadata.java +++ b/src/main/java/org/opensrp/domain/postgres/AlertMetadata.java @@ -1,334 +1,334 @@ package org.opensrp.domain.postgres; public class AlertMetadata { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.alert_metadata.id - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.alert_metadata.alert_id - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - private Long alertId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.alert_metadata.document_id - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - private String documentId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.alert_metadata.base_entity_id - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - private String baseEntityId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.alert_metadata.server_version - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - private Long serverVersion; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.alert_metadata.provider_id - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - private String providerId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.alert_metadata.location_id - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - private String locationId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.alert_metadata.team - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - private String team; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.alert_metadata.team_id - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - private String teamId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.alert_metadata.is_active - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - private Boolean isActive; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.alert_metadata.trigger_name - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - private String triggerName; - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.alert_metadata.id - * - * @return the value of core.alert_metadata.id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.alert_metadata.id - * - * @param id the value for core.alert_metadata.id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.alert_metadata.alert_id - * - * @return the value of core.alert_metadata.alert_id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public Long getAlertId() { - return alertId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.alert_metadata.alert_id - * - * @param alertId the value for core.alert_metadata.alert_id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setAlertId(Long alertId) { - this.alertId = alertId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.alert_metadata.document_id - * - * @return the value of core.alert_metadata.document_id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public String getDocumentId() { - return documentId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.alert_metadata.document_id - * - * @param documentId the value for core.alert_metadata.document_id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setDocumentId(String documentId) { - this.documentId = documentId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.alert_metadata.base_entity_id - * - * @return the value of core.alert_metadata.base_entity_id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public String getBaseEntityId() { - return baseEntityId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.alert_metadata.base_entity_id - * - * @param baseEntityId the value for core.alert_metadata.base_entity_id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setBaseEntityId(String baseEntityId) { - this.baseEntityId = baseEntityId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.alert_metadata.server_version - * - * @return the value of core.alert_metadata.server_version - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public Long getServerVersion() { - return serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.alert_metadata.server_version - * - * @param serverVersion the value for core.alert_metadata.server_version - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.alert_metadata.provider_id - * - * @return the value of core.alert_metadata.provider_id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public String getProviderId() { - return providerId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.alert_metadata.provider_id - * - * @param providerId the value for core.alert_metadata.provider_id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.alert_metadata.location_id - * - * @return the value of core.alert_metadata.location_id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public String getLocationId() { - return locationId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.alert_metadata.location_id - * - * @param locationId the value for core.alert_metadata.location_id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setLocationId(String locationId) { - this.locationId = locationId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.alert_metadata.team - * - * @return the value of core.alert_metadata.team - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public String getTeam() { - return team; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.alert_metadata.team - * - * @param team the value for core.alert_metadata.team - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setTeam(String team) { - this.team = team; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.alert_metadata.team_id - * - * @return the value of core.alert_metadata.team_id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public String getTeamId() { - return teamId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.alert_metadata.team_id - * - * @param teamId the value for core.alert_metadata.team_id - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setTeamId(String teamId) { - this.teamId = teamId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.alert_metadata.is_active - * - * @return the value of core.alert_metadata.is_active - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public Boolean getIsActive() { - return isActive; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.alert_metadata.is_active - * - * @param isActive the value for core.alert_metadata.is_active - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setIsActive(Boolean isActive) { - this.isActive = isActive; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.alert_metadata.trigger_name - * - * @return the value of core.alert_metadata.trigger_name - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public String getTriggerName() { - return triggerName; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.alert_metadata.trigger_name - * - * @param triggerName the value for core.alert_metadata.trigger_name - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setTriggerName(String triggerName) { - this.triggerName = triggerName; - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.alert_metadata.id + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.alert_metadata.alert_id + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + private Long alertId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.alert_metadata.document_id + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + private String documentId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.alert_metadata.base_entity_id + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + private String baseEntityId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.alert_metadata.server_version + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + private Long serverVersion; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.alert_metadata.provider_id + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + private String providerId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.alert_metadata.location_id + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + private String locationId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.alert_metadata.team + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + private String team; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.alert_metadata.team_id + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + private String teamId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.alert_metadata.is_active + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + private Boolean isActive; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.alert_metadata.trigger_name + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + private String triggerName; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.alert_metadata.id + * + * @return the value of core.alert_metadata.id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.alert_metadata.id + * + * @param id the value for core.alert_metadata.id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.alert_metadata.alert_id + * + * @return the value of core.alert_metadata.alert_id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public Long getAlertId() { + return alertId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.alert_metadata.alert_id + * + * @param alertId the value for core.alert_metadata.alert_id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setAlertId(Long alertId) { + this.alertId = alertId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.alert_metadata.document_id + * + * @return the value of core.alert_metadata.document_id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public String getDocumentId() { + return documentId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.alert_metadata.document_id + * + * @param documentId the value for core.alert_metadata.document_id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setDocumentId(String documentId) { + this.documentId = documentId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.alert_metadata.base_entity_id + * + * @return the value of core.alert_metadata.base_entity_id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public String getBaseEntityId() { + return baseEntityId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.alert_metadata.base_entity_id + * + * @param baseEntityId the value for core.alert_metadata.base_entity_id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setBaseEntityId(String baseEntityId) { + this.baseEntityId = baseEntityId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.alert_metadata.server_version + * + * @return the value of core.alert_metadata.server_version + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public Long getServerVersion() { + return serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.alert_metadata.server_version + * + * @param serverVersion the value for core.alert_metadata.server_version + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.alert_metadata.provider_id + * + * @return the value of core.alert_metadata.provider_id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public String getProviderId() { + return providerId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.alert_metadata.provider_id + * + * @param providerId the value for core.alert_metadata.provider_id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.alert_metadata.location_id + * + * @return the value of core.alert_metadata.location_id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public String getLocationId() { + return locationId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.alert_metadata.location_id + * + * @param locationId the value for core.alert_metadata.location_id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setLocationId(String locationId) { + this.locationId = locationId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.alert_metadata.team + * + * @return the value of core.alert_metadata.team + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public String getTeam() { + return team; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.alert_metadata.team + * + * @param team the value for core.alert_metadata.team + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setTeam(String team) { + this.team = team; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.alert_metadata.team_id + * + * @return the value of core.alert_metadata.team_id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public String getTeamId() { + return teamId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.alert_metadata.team_id + * + * @param teamId the value for core.alert_metadata.team_id + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setTeamId(String teamId) { + this.teamId = teamId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.alert_metadata.is_active + * + * @return the value of core.alert_metadata.is_active + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public Boolean getIsActive() { + return isActive; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.alert_metadata.is_active + * + * @param isActive the value for core.alert_metadata.is_active + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.alert_metadata.trigger_name + * + * @return the value of core.alert_metadata.trigger_name + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public String getTriggerName() { + return triggerName; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.alert_metadata.trigger_name + * + * @param triggerName the value for core.alert_metadata.trigger_name + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setTriggerName(String triggerName) { + this.triggerName = triggerName; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/AlertMetadataExample.java b/src/main/java/org/opensrp/domain/postgres/AlertMetadataExample.java index 0f1245662..9cf32feb9 100644 --- a/src/main/java/org/opensrp/domain/postgres/AlertMetadataExample.java +++ b/src/main/java/org/opensrp/domain/postgres/AlertMetadataExample.java @@ -4,1032 +4,1032 @@ import java.util.List; public class AlertMetadataExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public AlertMetadataExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andAlertIdIsNull() { - addCriterion("alert_id is null"); - return (Criteria) this; - } - - public Criteria andAlertIdIsNotNull() { - addCriterion("alert_id is not null"); - return (Criteria) this; - } - - public Criteria andAlertIdEqualTo(Long value) { - addCriterion("alert_id =", value, "alertId"); - return (Criteria) this; - } - - public Criteria andAlertIdNotEqualTo(Long value) { - addCriterion("alert_id <>", value, "alertId"); - return (Criteria) this; - } - - public Criteria andAlertIdGreaterThan(Long value) { - addCriterion("alert_id >", value, "alertId"); - return (Criteria) this; - } - - public Criteria andAlertIdGreaterThanOrEqualTo(Long value) { - addCriterion("alert_id >=", value, "alertId"); - return (Criteria) this; - } - - public Criteria andAlertIdLessThan(Long value) { - addCriterion("alert_id <", value, "alertId"); - return (Criteria) this; - } - - public Criteria andAlertIdLessThanOrEqualTo(Long value) { - addCriterion("alert_id <=", value, "alertId"); - return (Criteria) this; - } - - public Criteria andAlertIdIn(List values) { - addCriterion("alert_id in", values, "alertId"); - return (Criteria) this; - } - - public Criteria andAlertIdNotIn(List values) { - addCriterion("alert_id not in", values, "alertId"); - return (Criteria) this; - } - - public Criteria andAlertIdBetween(Long value1, Long value2) { - addCriterion("alert_id between", value1, value2, "alertId"); - return (Criteria) this; - } - - public Criteria andAlertIdNotBetween(Long value1, Long value2) { - addCriterion("alert_id not between", value1, value2, "alertId"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNull() { - addCriterion("document_id is null"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNotNull() { - addCriterion("document_id is not null"); - return (Criteria) this; - } - - public Criteria andDocumentIdEqualTo(String value) { - addCriterion("document_id =", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotEqualTo(String value) { - addCriterion("document_id <>", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThan(String value) { - addCriterion("document_id >", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { - addCriterion("document_id >=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThan(String value) { - addCriterion("document_id <", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThanOrEqualTo(String value) { - addCriterion("document_id <=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLike(String value) { - addCriterion("document_id like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotLike(String value) { - addCriterion("document_id not like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdIn(List values) { - addCriterion("document_id in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotIn(List values) { - addCriterion("document_id not in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdBetween(String value1, String value2) { - addCriterion("document_id between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotBetween(String value1, String value2) { - addCriterion("document_id not between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdIsNull() { - addCriterion("base_entity_id is null"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdIsNotNull() { - addCriterion("base_entity_id is not null"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdEqualTo(String value) { - addCriterion("base_entity_id =", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotEqualTo(String value) { - addCriterion("base_entity_id <>", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdGreaterThan(String value) { - addCriterion("base_entity_id >", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdGreaterThanOrEqualTo(String value) { - addCriterion("base_entity_id >=", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdLessThan(String value) { - addCriterion("base_entity_id <", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdLessThanOrEqualTo(String value) { - addCriterion("base_entity_id <=", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdLike(String value) { - addCriterion("base_entity_id like", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotLike(String value) { - addCriterion("base_entity_id not like", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdIn(List values) { - addCriterion("base_entity_id in", values, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotIn(List values) { - addCriterion("base_entity_id not in", values, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdBetween(String value1, String value2) { - addCriterion("base_entity_id between", value1, value2, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotBetween(String value1, String value2) { - addCriterion("base_entity_id not between", value1, value2, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andProviderIdIsNull() { - addCriterion("provider_id is null"); - return (Criteria) this; - } - - public Criteria andProviderIdIsNotNull() { - addCriterion("provider_id is not null"); - return (Criteria) this; - } - - public Criteria andProviderIdEqualTo(String value) { - addCriterion("provider_id =", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotEqualTo(String value) { - addCriterion("provider_id <>", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdGreaterThan(String value) { - addCriterion("provider_id >", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdGreaterThanOrEqualTo(String value) { - addCriterion("provider_id >=", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdLessThan(String value) { - addCriterion("provider_id <", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdLessThanOrEqualTo(String value) { - addCriterion("provider_id <=", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdLike(String value) { - addCriterion("provider_id like", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotLike(String value) { - addCriterion("provider_id not like", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdIn(List values) { - addCriterion("provider_id in", values, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotIn(List values) { - addCriterion("provider_id not in", values, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdBetween(String value1, String value2) { - addCriterion("provider_id between", value1, value2, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotBetween(String value1, String value2) { - addCriterion("provider_id not between", value1, value2, "providerId"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNull() { - addCriterion("location_id is null"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNotNull() { - addCriterion("location_id is not null"); - return (Criteria) this; - } - - public Criteria andLocationIdEqualTo(String value) { - addCriterion("location_id =", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotEqualTo(String value) { - addCriterion("location_id <>", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThan(String value) { - addCriterion("location_id >", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThanOrEqualTo(String value) { - addCriterion("location_id >=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThan(String value) { - addCriterion("location_id <", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThanOrEqualTo(String value) { - addCriterion("location_id <=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLike(String value) { - addCriterion("location_id like", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotLike(String value) { - addCriterion("location_id not like", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdIn(List values) { - addCriterion("location_id in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotIn(List values) { - addCriterion("location_id not in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdBetween(String value1, String value2) { - addCriterion("location_id between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotBetween(String value1, String value2) { - addCriterion("location_id not between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andTeamIsNull() { - addCriterion("team is null"); - return (Criteria) this; - } - - public Criteria andTeamIsNotNull() { - addCriterion("team is not null"); - return (Criteria) this; - } - - public Criteria andTeamEqualTo(String value) { - addCriterion("team =", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotEqualTo(String value) { - addCriterion("team <>", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamGreaterThan(String value) { - addCriterion("team >", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamGreaterThanOrEqualTo(String value) { - addCriterion("team >=", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamLessThan(String value) { - addCriterion("team <", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamLessThanOrEqualTo(String value) { - addCriterion("team <=", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamLike(String value) { - addCriterion("team like", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotLike(String value) { - addCriterion("team not like", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamIn(List values) { - addCriterion("team in", values, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotIn(List values) { - addCriterion("team not in", values, "team"); - return (Criteria) this; - } - - public Criteria andTeamBetween(String value1, String value2) { - addCriterion("team between", value1, value2, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotBetween(String value1, String value2) { - addCriterion("team not between", value1, value2, "team"); - return (Criteria) this; - } - - public Criteria andTeamIdIsNull() { - addCriterion("team_id is null"); - return (Criteria) this; - } - - public Criteria andTeamIdIsNotNull() { - addCriterion("team_id is not null"); - return (Criteria) this; - } - - public Criteria andTeamIdEqualTo(String value) { - addCriterion("team_id =", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotEqualTo(String value) { - addCriterion("team_id <>", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdGreaterThan(String value) { - addCriterion("team_id >", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdGreaterThanOrEqualTo(String value) { - addCriterion("team_id >=", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdLessThan(String value) { - addCriterion("team_id <", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdLessThanOrEqualTo(String value) { - addCriterion("team_id <=", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdLike(String value) { - addCriterion("team_id like", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotLike(String value) { - addCriterion("team_id not like", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdIn(List values) { - addCriterion("team_id in", values, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotIn(List values) { - addCriterion("team_id not in", values, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdBetween(String value1, String value2) { - addCriterion("team_id between", value1, value2, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotBetween(String value1, String value2) { - addCriterion("team_id not between", value1, value2, "teamId"); - return (Criteria) this; - } - - public Criteria andIsActiveIsNull() { - addCriterion("is_active is null"); - return (Criteria) this; - } - - public Criteria andIsActiveIsNotNull() { - addCriterion("is_active is not null"); - return (Criteria) this; - } - - public Criteria andIsActiveEqualTo(Boolean value) { - addCriterion("is_active =", value, "isActive"); - return (Criteria) this; - } - - public Criteria andIsActiveNotEqualTo(Boolean value) { - addCriterion("is_active <>", value, "isActive"); - return (Criteria) this; - } - - public Criteria andIsActiveGreaterThan(Boolean value) { - addCriterion("is_active >", value, "isActive"); - return (Criteria) this; - } - - public Criteria andIsActiveGreaterThanOrEqualTo(Boolean value) { - addCriterion("is_active >=", value, "isActive"); - return (Criteria) this; - } - - public Criteria andIsActiveLessThan(Boolean value) { - addCriterion("is_active <", value, "isActive"); - return (Criteria) this; - } - - public Criteria andIsActiveLessThanOrEqualTo(Boolean value) { - addCriterion("is_active <=", value, "isActive"); - return (Criteria) this; - } - - public Criteria andIsActiveIn(List values) { - addCriterion("is_active in", values, "isActive"); - return (Criteria) this; - } - - public Criteria andIsActiveNotIn(List values) { - addCriterion("is_active not in", values, "isActive"); - return (Criteria) this; - } - - public Criteria andIsActiveBetween(Boolean value1, Boolean value2) { - addCriterion("is_active between", value1, value2, "isActive"); - return (Criteria) this; - } - - public Criteria andIsActiveNotBetween(Boolean value1, Boolean value2) { - addCriterion("is_active not between", value1, value2, "isActive"); - return (Criteria) this; - } - - public Criteria andTriggerNameIsNull() { - addCriterion("trigger_name is null"); - return (Criteria) this; - } - - public Criteria andTriggerNameIsNotNull() { - addCriterion("trigger_name is not null"); - return (Criteria) this; - } - - public Criteria andTriggerNameEqualTo(String value) { - addCriterion("trigger_name =", value, "triggerName"); - return (Criteria) this; - } - - public Criteria andTriggerNameNotEqualTo(String value) { - addCriterion("trigger_name <>", value, "triggerName"); - return (Criteria) this; - } - - public Criteria andTriggerNameGreaterThan(String value) { - addCriterion("trigger_name >", value, "triggerName"); - return (Criteria) this; - } - - public Criteria andTriggerNameGreaterThanOrEqualTo(String value) { - addCriterion("trigger_name >=", value, "triggerName"); - return (Criteria) this; - } - - public Criteria andTriggerNameLessThan(String value) { - addCriterion("trigger_name <", value, "triggerName"); - return (Criteria) this; - } - - public Criteria andTriggerNameLessThanOrEqualTo(String value) { - addCriterion("trigger_name <=", value, "triggerName"); - return (Criteria) this; - } - - public Criteria andTriggerNameLike(String value) { - addCriterion("trigger_name like", value, "triggerName"); - return (Criteria) this; - } - - public Criteria andTriggerNameNotLike(String value) { - addCriterion("trigger_name not like", value, "triggerName"); - return (Criteria) this; - } - - public Criteria andTriggerNameIn(List values) { - addCriterion("trigger_name in", values, "triggerName"); - return (Criteria) this; - } - - public Criteria andTriggerNameNotIn(List values) { - addCriterion("trigger_name not in", values, "triggerName"); - return (Criteria) this; - } - - public Criteria andTriggerNameBetween(String value1, String value2) { - addCriterion("trigger_name between", value1, value2, "triggerName"); - return (Criteria) this; - } - - public Criteria andTriggerNameNotBetween(String value1, String value2) { - addCriterion("trigger_name not between", value1, value2, "triggerName"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.alert_metadata - * - * @mbg.generated do_not_delete_during_merge Fri Mar 09 15:24:01 EAT 2018 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public AlertMetadataExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andAlertIdIsNull() { + addCriterion("alert_id is null"); + return (Criteria) this; + } + + public Criteria andAlertIdIsNotNull() { + addCriterion("alert_id is not null"); + return (Criteria) this; + } + + public Criteria andAlertIdEqualTo(Long value) { + addCriterion("alert_id =", value, "alertId"); + return (Criteria) this; + } + + public Criteria andAlertIdNotEqualTo(Long value) { + addCriterion("alert_id <>", value, "alertId"); + return (Criteria) this; + } + + public Criteria andAlertIdGreaterThan(Long value) { + addCriterion("alert_id >", value, "alertId"); + return (Criteria) this; + } + + public Criteria andAlertIdGreaterThanOrEqualTo(Long value) { + addCriterion("alert_id >=", value, "alertId"); + return (Criteria) this; + } + + public Criteria andAlertIdLessThan(Long value) { + addCriterion("alert_id <", value, "alertId"); + return (Criteria) this; + } + + public Criteria andAlertIdLessThanOrEqualTo(Long value) { + addCriterion("alert_id <=", value, "alertId"); + return (Criteria) this; + } + + public Criteria andAlertIdIn(List values) { + addCriterion("alert_id in", values, "alertId"); + return (Criteria) this; + } + + public Criteria andAlertIdNotIn(List values) { + addCriterion("alert_id not in", values, "alertId"); + return (Criteria) this; + } + + public Criteria andAlertIdBetween(Long value1, Long value2) { + addCriterion("alert_id between", value1, value2, "alertId"); + return (Criteria) this; + } + + public Criteria andAlertIdNotBetween(Long value1, Long value2) { + addCriterion("alert_id not between", value1, value2, "alertId"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNull() { + addCriterion("document_id is null"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNotNull() { + addCriterion("document_id is not null"); + return (Criteria) this; + } + + public Criteria andDocumentIdEqualTo(String value) { + addCriterion("document_id =", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotEqualTo(String value) { + addCriterion("document_id <>", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThan(String value) { + addCriterion("document_id >", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { + addCriterion("document_id >=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThan(String value) { + addCriterion("document_id <", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThanOrEqualTo(String value) { + addCriterion("document_id <=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLike(String value) { + addCriterion("document_id like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotLike(String value) { + addCriterion("document_id not like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdIn(List values) { + addCriterion("document_id in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotIn(List values) { + addCriterion("document_id not in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdBetween(String value1, String value2) { + addCriterion("document_id between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotBetween(String value1, String value2) { + addCriterion("document_id not between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdIsNull() { + addCriterion("base_entity_id is null"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdIsNotNull() { + addCriterion("base_entity_id is not null"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdEqualTo(String value) { + addCriterion("base_entity_id =", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotEqualTo(String value) { + addCriterion("base_entity_id <>", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdGreaterThan(String value) { + addCriterion("base_entity_id >", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdGreaterThanOrEqualTo(String value) { + addCriterion("base_entity_id >=", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdLessThan(String value) { + addCriterion("base_entity_id <", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdLessThanOrEqualTo(String value) { + addCriterion("base_entity_id <=", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdLike(String value) { + addCriterion("base_entity_id like", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotLike(String value) { + addCriterion("base_entity_id not like", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdIn(List values) { + addCriterion("base_entity_id in", values, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotIn(List values) { + addCriterion("base_entity_id not in", values, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdBetween(String value1, String value2) { + addCriterion("base_entity_id between", value1, value2, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotBetween(String value1, String value2) { + addCriterion("base_entity_id not between", value1, value2, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andProviderIdIsNull() { + addCriterion("provider_id is null"); + return (Criteria) this; + } + + public Criteria andProviderIdIsNotNull() { + addCriterion("provider_id is not null"); + return (Criteria) this; + } + + public Criteria andProviderIdEqualTo(String value) { + addCriterion("provider_id =", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotEqualTo(String value) { + addCriterion("provider_id <>", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdGreaterThan(String value) { + addCriterion("provider_id >", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdGreaterThanOrEqualTo(String value) { + addCriterion("provider_id >=", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdLessThan(String value) { + addCriterion("provider_id <", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdLessThanOrEqualTo(String value) { + addCriterion("provider_id <=", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdLike(String value) { + addCriterion("provider_id like", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotLike(String value) { + addCriterion("provider_id not like", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdIn(List values) { + addCriterion("provider_id in", values, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotIn(List values) { + addCriterion("provider_id not in", values, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdBetween(String value1, String value2) { + addCriterion("provider_id between", value1, value2, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotBetween(String value1, String value2) { + addCriterion("provider_id not between", value1, value2, "providerId"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNull() { + addCriterion("location_id is null"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNotNull() { + addCriterion("location_id is not null"); + return (Criteria) this; + } + + public Criteria andLocationIdEqualTo(String value) { + addCriterion("location_id =", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotEqualTo(String value) { + addCriterion("location_id <>", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThan(String value) { + addCriterion("location_id >", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThanOrEqualTo(String value) { + addCriterion("location_id >=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThan(String value) { + addCriterion("location_id <", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThanOrEqualTo(String value) { + addCriterion("location_id <=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLike(String value) { + addCriterion("location_id like", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotLike(String value) { + addCriterion("location_id not like", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdIn(List values) { + addCriterion("location_id in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotIn(List values) { + addCriterion("location_id not in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdBetween(String value1, String value2) { + addCriterion("location_id between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotBetween(String value1, String value2) { + addCriterion("location_id not between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andTeamIsNull() { + addCriterion("team is null"); + return (Criteria) this; + } + + public Criteria andTeamIsNotNull() { + addCriterion("team is not null"); + return (Criteria) this; + } + + public Criteria andTeamEqualTo(String value) { + addCriterion("team =", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotEqualTo(String value) { + addCriterion("team <>", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamGreaterThan(String value) { + addCriterion("team >", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamGreaterThanOrEqualTo(String value) { + addCriterion("team >=", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLessThan(String value) { + addCriterion("team <", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLessThanOrEqualTo(String value) { + addCriterion("team <=", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLike(String value) { + addCriterion("team like", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotLike(String value) { + addCriterion("team not like", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamIn(List values) { + addCriterion("team in", values, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotIn(List values) { + addCriterion("team not in", values, "team"); + return (Criteria) this; + } + + public Criteria andTeamBetween(String value1, String value2) { + addCriterion("team between", value1, value2, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotBetween(String value1, String value2) { + addCriterion("team not between", value1, value2, "team"); + return (Criteria) this; + } + + public Criteria andTeamIdIsNull() { + addCriterion("team_id is null"); + return (Criteria) this; + } + + public Criteria andTeamIdIsNotNull() { + addCriterion("team_id is not null"); + return (Criteria) this; + } + + public Criteria andTeamIdEqualTo(String value) { + addCriterion("team_id =", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotEqualTo(String value) { + addCriterion("team_id <>", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdGreaterThan(String value) { + addCriterion("team_id >", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdGreaterThanOrEqualTo(String value) { + addCriterion("team_id >=", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLessThan(String value) { + addCriterion("team_id <", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLessThanOrEqualTo(String value) { + addCriterion("team_id <=", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLike(String value) { + addCriterion("team_id like", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotLike(String value) { + addCriterion("team_id not like", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdIn(List values) { + addCriterion("team_id in", values, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotIn(List values) { + addCriterion("team_id not in", values, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdBetween(String value1, String value2) { + addCriterion("team_id between", value1, value2, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotBetween(String value1, String value2) { + addCriterion("team_id not between", value1, value2, "teamId"); + return (Criteria) this; + } + + public Criteria andIsActiveIsNull() { + addCriterion("is_active is null"); + return (Criteria) this; + } + + public Criteria andIsActiveIsNotNull() { + addCriterion("is_active is not null"); + return (Criteria) this; + } + + public Criteria andIsActiveEqualTo(Boolean value) { + addCriterion("is_active =", value, "isActive"); + return (Criteria) this; + } + + public Criteria andIsActiveNotEqualTo(Boolean value) { + addCriterion("is_active <>", value, "isActive"); + return (Criteria) this; + } + + public Criteria andIsActiveGreaterThan(Boolean value) { + addCriterion("is_active >", value, "isActive"); + return (Criteria) this; + } + + public Criteria andIsActiveGreaterThanOrEqualTo(Boolean value) { + addCriterion("is_active >=", value, "isActive"); + return (Criteria) this; + } + + public Criteria andIsActiveLessThan(Boolean value) { + addCriterion("is_active <", value, "isActive"); + return (Criteria) this; + } + + public Criteria andIsActiveLessThanOrEqualTo(Boolean value) { + addCriterion("is_active <=", value, "isActive"); + return (Criteria) this; + } + + public Criteria andIsActiveIn(List values) { + addCriterion("is_active in", values, "isActive"); + return (Criteria) this; + } + + public Criteria andIsActiveNotIn(List values) { + addCriterion("is_active not in", values, "isActive"); + return (Criteria) this; + } + + public Criteria andIsActiveBetween(Boolean value1, Boolean value2) { + addCriterion("is_active between", value1, value2, "isActive"); + return (Criteria) this; + } + + public Criteria andIsActiveNotBetween(Boolean value1, Boolean value2) { + addCriterion("is_active not between", value1, value2, "isActive"); + return (Criteria) this; + } + + public Criteria andTriggerNameIsNull() { + addCriterion("trigger_name is null"); + return (Criteria) this; + } + + public Criteria andTriggerNameIsNotNull() { + addCriterion("trigger_name is not null"); + return (Criteria) this; + } + + public Criteria andTriggerNameEqualTo(String value) { + addCriterion("trigger_name =", value, "triggerName"); + return (Criteria) this; + } + + public Criteria andTriggerNameNotEqualTo(String value) { + addCriterion("trigger_name <>", value, "triggerName"); + return (Criteria) this; + } + + public Criteria andTriggerNameGreaterThan(String value) { + addCriterion("trigger_name >", value, "triggerName"); + return (Criteria) this; + } + + public Criteria andTriggerNameGreaterThanOrEqualTo(String value) { + addCriterion("trigger_name >=", value, "triggerName"); + return (Criteria) this; + } + + public Criteria andTriggerNameLessThan(String value) { + addCriterion("trigger_name <", value, "triggerName"); + return (Criteria) this; + } + + public Criteria andTriggerNameLessThanOrEqualTo(String value) { + addCriterion("trigger_name <=", value, "triggerName"); + return (Criteria) this; + } + + public Criteria andTriggerNameLike(String value) { + addCriterion("trigger_name like", value, "triggerName"); + return (Criteria) this; + } + + public Criteria andTriggerNameNotLike(String value) { + addCriterion("trigger_name not like", value, "triggerName"); + return (Criteria) this; + } + + public Criteria andTriggerNameIn(List values) { + addCriterion("trigger_name in", values, "triggerName"); + return (Criteria) this; + } + + public Criteria andTriggerNameNotIn(List values) { + addCriterion("trigger_name not in", values, "triggerName"); + return (Criteria) this; + } + + public Criteria andTriggerNameBetween(String value1, String value2) { + addCriterion("trigger_name between", value1, value2, "triggerName"); + return (Criteria) this; + } + + public Criteria andTriggerNameNotBetween(String value1, String value2) { + addCriterion("trigger_name not between", value1, value2, "triggerName"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.alert_metadata + * + * @mbg.generated do_not_delete_during_merge Fri Mar 09 15:24:01 EAT 2018 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/AppStateToken.java b/src/main/java/org/opensrp/domain/postgres/AppStateToken.java index 0fd6fbbee..51813c5c8 100644 --- a/src/main/java/org/opensrp/domain/postgres/AppStateToken.java +++ b/src/main/java/org/opensrp/domain/postgres/AppStateToken.java @@ -1,154 +1,154 @@ package org.opensrp.domain.postgres; public class AppStateToken { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.app_state_token.id - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.app_state_token.name - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - private String name; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.app_state_token.description - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - private String description; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.app_state_token.value - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - private String value; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.app_state_token.last_edited_date - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - private Long lastEditedDate; - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.app_state_token.id - * - * @return the value of core.app_state_token.id - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.app_state_token.id - * - * @param id the value for core.app_state_token.id - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.app_state_token.name - * - * @return the value of core.app_state_token.name - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public String getName() { - return name; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.app_state_token.name - * - * @param name the value for core.app_state_token.name - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public void setName(String name) { - this.name = name; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.app_state_token.description - * - * @return the value of core.app_state_token.description - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public String getDescription() { - return description; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.app_state_token.description - * - * @param description the value for core.app_state_token.description - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public void setDescription(String description) { - this.description = description; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.app_state_token.value - * - * @return the value of core.app_state_token.value - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public String getValue() { - return value; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.app_state_token.value - * - * @param value the value for core.app_state_token.value - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public void setValue(String value) { - this.value = value; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.app_state_token.last_edited_date - * - * @return the value of core.app_state_token.last_edited_date - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public Long getLastEditedDate() { - return lastEditedDate; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.app_state_token.last_edited_date - * - * @param lastEditedDate the value for core.app_state_token.last_edited_date - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public void setLastEditedDate(Long lastEditedDate) { - this.lastEditedDate = lastEditedDate; - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.app_state_token.id + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.app_state_token.name + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + private String name; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.app_state_token.description + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + private String description; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.app_state_token.value + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + private String value; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.app_state_token.last_edited_date + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + private Long lastEditedDate; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.app_state_token.id + * + * @return the value of core.app_state_token.id + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.app_state_token.id + * + * @param id the value for core.app_state_token.id + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.app_state_token.name + * + * @return the value of core.app_state_token.name + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public String getName() { + return name; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.app_state_token.name + * + * @param name the value for core.app_state_token.name + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public void setName(String name) { + this.name = name; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.app_state_token.description + * + * @return the value of core.app_state_token.description + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public String getDescription() { + return description; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.app_state_token.description + * + * @param description the value for core.app_state_token.description + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.app_state_token.value + * + * @return the value of core.app_state_token.value + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public String getValue() { + return value; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.app_state_token.value + * + * @param value the value for core.app_state_token.value + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public void setValue(String value) { + this.value = value; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.app_state_token.last_edited_date + * + * @return the value of core.app_state_token.last_edited_date + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public Long getLastEditedDate() { + return lastEditedDate; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.app_state_token.last_edited_date + * + * @param lastEditedDate the value for core.app_state_token.last_edited_date + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public void setLastEditedDate(Long lastEditedDate) { + this.lastEditedDate = lastEditedDate; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/AppStateTokenExample.java b/src/main/java/org/opensrp/domain/postgres/AppStateTokenExample.java index a5383b1a3..42f22cb04 100644 --- a/src/main/java/org/opensrp/domain/postgres/AppStateTokenExample.java +++ b/src/main/java/org/opensrp/domain/postgres/AppStateTokenExample.java @@ -4,632 +4,632 @@ import java.util.List; public class AppStateTokenExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public AppStateTokenExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andNameIsNull() { - addCriterion("name is null"); - return (Criteria) this; - } - - public Criteria andNameIsNotNull() { - addCriterion("name is not null"); - return (Criteria) this; - } - - public Criteria andNameEqualTo(String value) { - addCriterion("name =", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotEqualTo(String value) { - addCriterion("name <>", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThan(String value) { - addCriterion("name >", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("name >=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThan(String value) { - addCriterion("name <", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("name <=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLike(String value) { - addCriterion("name like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotLike(String value) { - addCriterion("name not like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameIn(List values) { - addCriterion("name in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameNotIn(List values) { - addCriterion("name not in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameBetween(String value1, String value2) { - addCriterion("name between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("name not between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andDescriptionIsNull() { - addCriterion("description is null"); - return (Criteria) this; - } - - public Criteria andDescriptionIsNotNull() { - addCriterion("description is not null"); - return (Criteria) this; - } - - public Criteria andDescriptionEqualTo(String value) { - addCriterion("description =", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotEqualTo(String value) { - addCriterion("description <>", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionGreaterThan(String value) { - addCriterion("description >", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionGreaterThanOrEqualTo(String value) { - addCriterion("description >=", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLessThan(String value) { - addCriterion("description <", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLessThanOrEqualTo(String value) { - addCriterion("description <=", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLike(String value) { - addCriterion("description like", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotLike(String value) { - addCriterion("description not like", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionIn(List values) { - addCriterion("description in", values, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotIn(List values) { - addCriterion("description not in", values, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionBetween(String value1, String value2) { - addCriterion("description between", value1, value2, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotBetween(String value1, String value2) { - addCriterion("description not between", value1, value2, "description"); - return (Criteria) this; - } - - public Criteria andValueIsNull() { - addCriterion("value is null"); - return (Criteria) this; - } - - public Criteria andValueIsNotNull() { - addCriterion("value is not null"); - return (Criteria) this; - } - - public Criteria andValueEqualTo(String value) { - addCriterion("value =", value, "value"); - return (Criteria) this; - } - - public Criteria andValueNotEqualTo(String value) { - addCriterion("value <>", value, "value"); - return (Criteria) this; - } - - public Criteria andValueGreaterThan(String value) { - addCriterion("value >", value, "value"); - return (Criteria) this; - } - - public Criteria andValueGreaterThanOrEqualTo(String value) { - addCriterion("value >=", value, "value"); - return (Criteria) this; - } - - public Criteria andValueLessThan(String value) { - addCriterion("value <", value, "value"); - return (Criteria) this; - } - - public Criteria andValueLessThanOrEqualTo(String value) { - addCriterion("value <=", value, "value"); - return (Criteria) this; - } - - public Criteria andValueLike(String value) { - addCriterion("value like", value, "value"); - return (Criteria) this; - } - - public Criteria andValueNotLike(String value) { - addCriterion("value not like", value, "value"); - return (Criteria) this; - } - - public Criteria andValueIn(List values) { - addCriterion("value in", values, "value"); - return (Criteria) this; - } - - public Criteria andValueNotIn(List values) { - addCriterion("value not in", values, "value"); - return (Criteria) this; - } - - public Criteria andValueBetween(String value1, String value2) { - addCriterion("value between", value1, value2, "value"); - return (Criteria) this; - } - - public Criteria andValueNotBetween(String value1, String value2) { - addCriterion("value not between", value1, value2, "value"); - return (Criteria) this; - } - - public Criteria andLastEditedDateIsNull() { - addCriterion("last_edited_date is null"); - return (Criteria) this; - } - - public Criteria andLastEditedDateIsNotNull() { - addCriterion("last_edited_date is not null"); - return (Criteria) this; - } - - public Criteria andLastEditedDateEqualTo(Long value) { - addCriterion("last_edited_date =", value, "lastEditedDate"); - return (Criteria) this; - } - - public Criteria andLastEditedDateNotEqualTo(Long value) { - addCriterion("last_edited_date <>", value, "lastEditedDate"); - return (Criteria) this; - } - - public Criteria andLastEditedDateGreaterThan(Long value) { - addCriterion("last_edited_date >", value, "lastEditedDate"); - return (Criteria) this; - } - - public Criteria andLastEditedDateGreaterThanOrEqualTo(Long value) { - addCriterion("last_edited_date >=", value, "lastEditedDate"); - return (Criteria) this; - } - - public Criteria andLastEditedDateLessThan(Long value) { - addCriterion("last_edited_date <", value, "lastEditedDate"); - return (Criteria) this; - } - - public Criteria andLastEditedDateLessThanOrEqualTo(Long value) { - addCriterion("last_edited_date <=", value, "lastEditedDate"); - return (Criteria) this; - } - - public Criteria andLastEditedDateIn(List values) { - addCriterion("last_edited_date in", values, "lastEditedDate"); - return (Criteria) this; - } - - public Criteria andLastEditedDateNotIn(List values) { - addCriterion("last_edited_date not in", values, "lastEditedDate"); - return (Criteria) this; - } - - public Criteria andLastEditedDateBetween(Long value1, Long value2) { - addCriterion("last_edited_date between", value1, value2, "lastEditedDate"); - return (Criteria) this; - } - - public Criteria andLastEditedDateNotBetween(Long value1, Long value2) { - addCriterion("last_edited_date not between", value1, value2, "lastEditedDate"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.app_state_token - * - * @mbg.generated do_not_delete_during_merge Fri Mar 09 18:03:53 EAT 2018 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public AppStateTokenExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andValueIsNull() { + addCriterion("value is null"); + return (Criteria) this; + } + + public Criteria andValueIsNotNull() { + addCriterion("value is not null"); + return (Criteria) this; + } + + public Criteria andValueEqualTo(String value) { + addCriterion("value =", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotEqualTo(String value) { + addCriterion("value <>", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThan(String value) { + addCriterion("value >", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThanOrEqualTo(String value) { + addCriterion("value >=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThan(String value) { + addCriterion("value <", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThanOrEqualTo(String value) { + addCriterion("value <=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLike(String value) { + addCriterion("value like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotLike(String value) { + addCriterion("value not like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueIn(List values) { + addCriterion("value in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueNotIn(List values) { + addCriterion("value not in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueBetween(String value1, String value2) { + addCriterion("value between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andValueNotBetween(String value1, String value2) { + addCriterion("value not between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andLastEditedDateIsNull() { + addCriterion("last_edited_date is null"); + return (Criteria) this; + } + + public Criteria andLastEditedDateIsNotNull() { + addCriterion("last_edited_date is not null"); + return (Criteria) this; + } + + public Criteria andLastEditedDateEqualTo(Long value) { + addCriterion("last_edited_date =", value, "lastEditedDate"); + return (Criteria) this; + } + + public Criteria andLastEditedDateNotEqualTo(Long value) { + addCriterion("last_edited_date <>", value, "lastEditedDate"); + return (Criteria) this; + } + + public Criteria andLastEditedDateGreaterThan(Long value) { + addCriterion("last_edited_date >", value, "lastEditedDate"); + return (Criteria) this; + } + + public Criteria andLastEditedDateGreaterThanOrEqualTo(Long value) { + addCriterion("last_edited_date >=", value, "lastEditedDate"); + return (Criteria) this; + } + + public Criteria andLastEditedDateLessThan(Long value) { + addCriterion("last_edited_date <", value, "lastEditedDate"); + return (Criteria) this; + } + + public Criteria andLastEditedDateLessThanOrEqualTo(Long value) { + addCriterion("last_edited_date <=", value, "lastEditedDate"); + return (Criteria) this; + } + + public Criteria andLastEditedDateIn(List values) { + addCriterion("last_edited_date in", values, "lastEditedDate"); + return (Criteria) this; + } + + public Criteria andLastEditedDateNotIn(List values) { + addCriterion("last_edited_date not in", values, "lastEditedDate"); + return (Criteria) this; + } + + public Criteria andLastEditedDateBetween(Long value1, Long value2) { + addCriterion("last_edited_date between", value1, value2, "lastEditedDate"); + return (Criteria) this; + } + + public Criteria andLastEditedDateNotBetween(Long value1, Long value2) { + addCriterion("last_edited_date not between", value1, value2, "lastEditedDate"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.app_state_token + * + * @mbg.generated do_not_delete_during_merge Fri Mar 09 18:03:53 EAT 2018 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/Campaign.java b/src/main/java/org/opensrp/domain/postgres/Campaign.java index c79c7e05f..332c2d97d 100644 --- a/src/main/java/org/opensrp/domain/postgres/Campaign.java +++ b/src/main/java/org/opensrp/domain/postgres/Campaign.java @@ -2,50 +2,56 @@ public class Campaign { - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.campaign.id - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - private Long id; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.campaign.json - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - private Object json; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.campaign.id + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + private Long id; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.campaign.json + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + private Object json; - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.campaign.id - * @return the value of core.campaign.id - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public Long getId() { - return id; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.campaign.id + * + * @return the value of core.campaign.id + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public Long getId() { + return id; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.campaign.id - * @param id the value for core.campaign.id - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public void setId(Long id) { - this.id = id; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.campaign.id + * + * @param id the value for core.campaign.id + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public void setId(Long id) { + this.id = id; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.campaign.json - * @return the value of core.campaign.json - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public Object getJson() { - return json; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.campaign.json + * + * @return the value of core.campaign.json + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public Object getJson() { + return json; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.campaign.json - * @param json the value for core.campaign.json - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public void setJson(Object json) { - this.json = json; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.campaign.json + * + * @param json the value for core.campaign.json + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public void setJson(Object json) { + this.json = json; + } } \ No newline at end of file diff --git a/src/main/java/org/opensrp/domain/postgres/CampaignExample.java b/src/main/java/org/opensrp/domain/postgres/CampaignExample.java index 738d3e3f0..cb5551aa8 100644 --- a/src/main/java/org/opensrp/domain/postgres/CampaignExample.java +++ b/src/main/java/org/opensrp/domain/postgres/CampaignExample.java @@ -5,401 +5,417 @@ public class CampaignExample { /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - protected String orderByClause; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - protected boolean distinct; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public CampaignExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - protected abstract static class GeneratedCriteria { - protected List jsonCriteria; - protected List allCriteria; - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - jsonCriteria = new ArrayList(); - } - - public List getJsonCriteria() { - return jsonCriteria; - } - - protected void addJsonCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - jsonCriteria.add( - new Criterion(condition, value, "org.opensrp.repository.postgres.handler.CampaignTypeHandler")); - allCriteria = null; - } - - protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - jsonCriteria.add(new Criterion(condition, value1, value2, - "org.opensrp.repository.postgres.handler.CampaignTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || jsonCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList(); - allCriteria.addAll(criteria); - allCriteria.addAll(jsonCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - allCriteria = null; - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andJsonIsNull() { - addCriterion("json is null"); - return (Criteria) this; - } - - public Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (Criteria) this; - } - - public Criteria andJsonEqualTo(Object value) { - addJsonCriterion("json =", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotEqualTo(Object value) { - addJsonCriterion("json <>", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThan(Object value) { - addJsonCriterion("json >", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThanOrEqualTo(Object value) { - addJsonCriterion("json >=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThan(Object value) { - addJsonCriterion("json <", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThanOrEqualTo(Object value) { - addJsonCriterion("json <=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonIn(List values) { - addJsonCriterion("json in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotIn(List values) { - addJsonCriterion("json not in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonBetween(Object value1, Object value2) { - addJsonCriterion("json between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotBetween(Object value1, Object value2) { - addJsonCriterion("json not between", value1, value2, "json"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public static class Criterion { - private String condition; - private Object value; - private Object secondValue; - private boolean noValue; - private boolean singleValue; - private boolean betweenValue; - private boolean listValue; - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + protected String orderByClause; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + protected boolean distinct; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public CampaignExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + protected abstract static class GeneratedCriteria { + protected List jsonCriteria; + protected List allCriteria; + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + jsonCriteria = new ArrayList(); + } + + public List getJsonCriteria() { + return jsonCriteria; + } + + protected void addJsonCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + jsonCriteria.add( + new Criterion(condition, value, "org.opensrp.repository.postgres.handler.CampaignTypeHandler")); + allCriteria = null; + } + + protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + jsonCriteria.add(new Criterion(condition, value1, value2, + "org.opensrp.repository.postgres.handler.CampaignTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || jsonCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList(); + allCriteria.addAll(criteria); + allCriteria.addAll(jsonCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andJsonIsNull() { + addCriterion("json is null"); + return (Criteria) this; + } + + public Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (Criteria) this; + } + + public Criteria andJsonEqualTo(Object value) { + addJsonCriterion("json =", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotEqualTo(Object value) { + addJsonCriterion("json <>", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThan(Object value) { + addJsonCriterion("json >", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThanOrEqualTo(Object value) { + addJsonCriterion("json >=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThan(Object value) { + addJsonCriterion("json <", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThanOrEqualTo(Object value) { + addJsonCriterion("json <=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonIn(List values) { + addJsonCriterion("json in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotIn(List values) { + addJsonCriterion("json not in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonBetween(Object value1, Object value2) { + addJsonCriterion("json between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotBetween(Object value1, Object value2) { + addJsonCriterion("json not between", value1, value2, "json"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public static class Criterion { + private String condition; + private Object value; + private Object secondValue; + private boolean noValue; + private boolean singleValue; + private boolean betweenValue; + private boolean listValue; + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** * This class was generated by MyBatis Generator. * This class corresponds to the database table core.campaign * diff --git a/src/main/java/org/opensrp/domain/postgres/CampaignMetadata.java b/src/main/java/org/opensrp/domain/postgres/CampaignMetadata.java index 8c2fae001..d1cc41c93 100644 --- a/src/main/java/org/opensrp/domain/postgres/CampaignMetadata.java +++ b/src/main/java/org/opensrp/domain/postgres/CampaignMetadata.java @@ -2,96 +2,108 @@ public class CampaignMetadata { - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.campaign_metadata.id - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - private Long id; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.campaign_metadata.campaign_id - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - private Long campaignId; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.campaign_metadata.identifier - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - private String identifier; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.campaign_metadata.server_version - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - private Long serverVersion; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.campaign_metadata.id + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + private Long id; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.campaign_metadata.campaign_id + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + private Long campaignId; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.campaign_metadata.identifier + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + private String identifier; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.campaign_metadata.server_version + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + private Long serverVersion; - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.campaign_metadata.id - * @return the value of core.campaign_metadata.id - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public Long getId() { - return id; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.campaign_metadata.id + * + * @return the value of core.campaign_metadata.id + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public Long getId() { + return id; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.campaign_metadata.id - * @param id the value for core.campaign_metadata.id - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public void setId(Long id) { - this.id = id; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.campaign_metadata.id + * + * @param id the value for core.campaign_metadata.id + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public void setId(Long id) { + this.id = id; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.campaign_metadata.campaign_id - * @return the value of core.campaign_metadata.campaign_id - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public Long getCampaignId() { - return campaignId; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.campaign_metadata.campaign_id + * + * @return the value of core.campaign_metadata.campaign_id + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public Long getCampaignId() { + return campaignId; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.campaign_metadata.campaign_id - * @param campaignId the value for core.campaign_metadata.campaign_id - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public void setCampaignId(Long campaignId) { - this.campaignId = campaignId; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.campaign_metadata.campaign_id + * + * @param campaignId the value for core.campaign_metadata.campaign_id + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public void setCampaignId(Long campaignId) { + this.campaignId = campaignId; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.campaign_metadata.identifier - * @return the value of core.campaign_metadata.identifier - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public String getIdentifier() { - return identifier; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.campaign_metadata.identifier + * + * @return the value of core.campaign_metadata.identifier + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public String getIdentifier() { + return identifier; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.campaign_metadata.identifier - * @param identifier the value for core.campaign_metadata.identifier - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public void setIdentifier(String identifier) { - this.identifier = identifier; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.campaign_metadata.identifier + * + * @param identifier the value for core.campaign_metadata.identifier + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public void setIdentifier(String identifier) { + this.identifier = identifier; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.campaign_metadata.server_version - * @return the value of core.campaign_metadata.server_version - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public Long getServerVersion() { - return serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.campaign_metadata.server_version + * + * @return the value of core.campaign_metadata.server_version + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public Long getServerVersion() { + return serverVersion; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.campaign_metadata.server_version - * @param serverVersion the value for core.campaign_metadata.server_version - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.campaign_metadata.server_version + * + * @param serverVersion the value for core.campaign_metadata.server_version + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } } \ No newline at end of file diff --git a/src/main/java/org/opensrp/domain/postgres/CampaignMetadataExample.java b/src/main/java/org/opensrp/domain/postgres/CampaignMetadataExample.java index ecef716be..fec3244a9 100644 --- a/src/main/java/org/opensrp/domain/postgres/CampaignMetadataExample.java +++ b/src/main/java/org/opensrp/domain/postgres/CampaignMetadataExample.java @@ -5,498 +5,514 @@ public class CampaignMetadataExample { /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - protected String orderByClause; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - protected boolean distinct; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public CampaignMetadataExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andCampaignIdIsNull() { - addCriterion("campaign_id is null"); - return (Criteria) this; - } - - public Criteria andCampaignIdIsNotNull() { - addCriterion("campaign_id is not null"); - return (Criteria) this; - } - - public Criteria andCampaignIdEqualTo(Long value) { - addCriterion("campaign_id =", value, "campaignId"); - return (Criteria) this; - } - - public Criteria andCampaignIdNotEqualTo(Long value) { - addCriterion("campaign_id <>", value, "campaignId"); - return (Criteria) this; - } - - public Criteria andCampaignIdGreaterThan(Long value) { - addCriterion("campaign_id >", value, "campaignId"); - return (Criteria) this; - } - - public Criteria andCampaignIdGreaterThanOrEqualTo(Long value) { - addCriterion("campaign_id >=", value, "campaignId"); - return (Criteria) this; - } - - public Criteria andCampaignIdLessThan(Long value) { - addCriterion("campaign_id <", value, "campaignId"); - return (Criteria) this; - } - - public Criteria andCampaignIdLessThanOrEqualTo(Long value) { - addCriterion("campaign_id <=", value, "campaignId"); - return (Criteria) this; - } - - public Criteria andCampaignIdIn(List values) { - addCriterion("campaign_id in", values, "campaignId"); - return (Criteria) this; - } - - public Criteria andCampaignIdNotIn(List values) { - addCriterion("campaign_id not in", values, "campaignId"); - return (Criteria) this; - } - - public Criteria andCampaignIdBetween(Long value1, Long value2) { - addCriterion("campaign_id between", value1, value2, "campaignId"); - return (Criteria) this; - } - - public Criteria andCampaignIdNotBetween(Long value1, Long value2) { - addCriterion("campaign_id not between", value1, value2, "campaignId"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNull() { - addCriterion("identifier is null"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNotNull() { - addCriterion("identifier is not null"); - return (Criteria) this; - } - - public Criteria andIdentifierEqualTo(String value) { - addCriterion("identifier =", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotEqualTo(String value) { - addCriterion("identifier <>", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThan(String value) { - addCriterion("identifier >", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThanOrEqualTo(String value) { - addCriterion("identifier >=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThan(String value) { - addCriterion("identifier <", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThanOrEqualTo(String value) { - addCriterion("identifier <=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLike(String value) { - addCriterion("identifier like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotLike(String value) { - addCriterion("identifier not like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierIn(List values) { - addCriterion("identifier in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotIn(List values) { - addCriterion("identifier not in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierBetween(String value1, String value2) { - addCriterion("identifier between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotBetween(String value1, String value2) { - addCriterion("identifier not between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - public static class Criterion { - private String condition; - private Object value; - private Object secondValue; - private boolean noValue; - private boolean singleValue; - private boolean betweenValue; - private boolean listValue; - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + protected String orderByClause; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + protected boolean distinct; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public CampaignMetadataExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCampaignIdIsNull() { + addCriterion("campaign_id is null"); + return (Criteria) this; + } + + public Criteria andCampaignIdIsNotNull() { + addCriterion("campaign_id is not null"); + return (Criteria) this; + } + + public Criteria andCampaignIdEqualTo(Long value) { + addCriterion("campaign_id =", value, "campaignId"); + return (Criteria) this; + } + + public Criteria andCampaignIdNotEqualTo(Long value) { + addCriterion("campaign_id <>", value, "campaignId"); + return (Criteria) this; + } + + public Criteria andCampaignIdGreaterThan(Long value) { + addCriterion("campaign_id >", value, "campaignId"); + return (Criteria) this; + } + + public Criteria andCampaignIdGreaterThanOrEqualTo(Long value) { + addCriterion("campaign_id >=", value, "campaignId"); + return (Criteria) this; + } + + public Criteria andCampaignIdLessThan(Long value) { + addCriterion("campaign_id <", value, "campaignId"); + return (Criteria) this; + } + + public Criteria andCampaignIdLessThanOrEqualTo(Long value) { + addCriterion("campaign_id <=", value, "campaignId"); + return (Criteria) this; + } + + public Criteria andCampaignIdIn(List values) { + addCriterion("campaign_id in", values, "campaignId"); + return (Criteria) this; + } + + public Criteria andCampaignIdNotIn(List values) { + addCriterion("campaign_id not in", values, "campaignId"); + return (Criteria) this; + } + + public Criteria andCampaignIdBetween(Long value1, Long value2) { + addCriterion("campaign_id between", value1, value2, "campaignId"); + return (Criteria) this; + } + + public Criteria andCampaignIdNotBetween(Long value1, Long value2) { + addCriterion("campaign_id not between", value1, value2, "campaignId"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNull() { + addCriterion("identifier is null"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNotNull() { + addCriterion("identifier is not null"); + return (Criteria) this; + } + + public Criteria andIdentifierEqualTo(String value) { + addCriterion("identifier =", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotEqualTo(String value) { + addCriterion("identifier <>", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThan(String value) { + addCriterion("identifier >", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThanOrEqualTo(String value) { + addCriterion("identifier >=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThan(String value) { + addCriterion("identifier <", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThanOrEqualTo(String value) { + addCriterion("identifier <=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLike(String value) { + addCriterion("identifier like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotLike(String value) { + addCriterion("identifier not like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierIn(List values) { + addCriterion("identifier in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotIn(List values) { + addCriterion("identifier not in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierBetween(String value1, String value2) { + addCriterion("identifier between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotBetween(String value1, String value2) { + addCriterion("identifier not between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + public static class Criterion { + private String condition; + private Object value; + private Object secondValue; + private boolean noValue; + private boolean singleValue; + private boolean betweenValue; + private boolean listValue; + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** * This class was generated by MyBatis Generator. * This class corresponds to the database table core.campaign_metadata * diff --git a/src/main/java/org/opensrp/domain/postgres/Client.java b/src/main/java/org/opensrp/domain/postgres/Client.java index 2e2c6f5b0..b75206a31 100644 --- a/src/main/java/org/opensrp/domain/postgres/Client.java +++ b/src/main/java/org/opensrp/domain/postgres/Client.java @@ -4,96 +4,108 @@ public class Client { - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.client.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Long id; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.client.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Object json; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.client.date_deleted - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Date dateDeleted; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.client.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Long serverVersion; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.client.id + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Long id; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.client.json + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Object json; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.client.date_deleted + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Date dateDeleted; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.client.server_version + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Long serverVersion; - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.client.id - * @return the value of core.client.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Long getId() { - return id; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.client.id + * + * @return the value of core.client.id + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Long getId() { + return id; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.client.id - * @param id the value for core.client.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.client.id + * + * @param id the value for core.client.id + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setId(Long id) { + this.id = id; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.client.json - * @return the value of core.client.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Object getJson() { - return json; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.client.json + * + * @return the value of core.client.json + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Object getJson() { + return json; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.client.json - * @param json the value for core.client.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setJson(Object json) { - this.json = json; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.client.json + * + * @param json the value for core.client.json + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setJson(Object json) { + this.json = json; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.client.date_deleted - * @return the value of core.client.date_deleted - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Date getDateDeleted() { - return dateDeleted; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.client.date_deleted + * + * @return the value of core.client.date_deleted + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Date getDateDeleted() { + return dateDeleted; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.client.date_deleted - * @param dateDeleted the value for core.client.date_deleted - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setDateDeleted(Date dateDeleted) { - this.dateDeleted = dateDeleted; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.client.date_deleted + * + * @param dateDeleted the value for core.client.date_deleted + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setDateDeleted(Date dateDeleted) { + this.dateDeleted = dateDeleted; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.client.server_version - * @return the value of core.client.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Long getServerVersion() { - return serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.client.server_version + * + * @return the value of core.client.server_version + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Long getServerVersion() { + return serverVersion; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.client.server_version - * @param serverVersion the value for core.client.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.client.server_version + * + * @param serverVersion the value for core.client.server_version + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ClientExample.java b/src/main/java/org/opensrp/domain/postgres/ClientExample.java index d04d5c897..1e80d1b1c 100644 --- a/src/main/java/org/opensrp/domain/postgres/ClientExample.java +++ b/src/main/java/org/opensrp/domain/postgres/ClientExample.java @@ -5,542 +5,558 @@ import java.util.List; public class ClientExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected String orderByClause; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected boolean distinct; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public ClientExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List jsonCriteria; - - protected List allCriteria; - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - jsonCriteria = new ArrayList<>(); - } - - public List getJsonCriteria() { - return jsonCriteria; - } - - protected void addJsonCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.ClientTypeHandler")); - allCriteria = null; - } - - protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - jsonCriteria.add( - new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.ClientTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || jsonCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList<>(); - allCriteria.addAll(criteria); - allCriteria.addAll(jsonCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - allCriteria = null; - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andJsonIsNull() { - addCriterion("json is null"); - return (Criteria) this; - } - - public Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (Criteria) this; - } - - public Criteria andJsonEqualTo(Object value) { - addJsonCriterion("json =", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotEqualTo(Object value) { - addJsonCriterion("json <>", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThan(Object value) { - addJsonCriterion("json >", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThanOrEqualTo(Object value) { - addJsonCriterion("json >=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThan(Object value) { - addJsonCriterion("json <", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThanOrEqualTo(Object value) { - addJsonCriterion("json <=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonIn(List values) { - addJsonCriterion("json in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotIn(List values) { - addJsonCriterion("json not in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonBetween(Object value1, Object value2) { - addJsonCriterion("json between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotBetween(Object value1, Object value2) { - addJsonCriterion("json not between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNull() { - addCriterion("date_deleted is null"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNotNull() { - addCriterion("date_deleted is not null"); - return (Criteria) this; - } - - public Criteria andDateDeletedEqualTo(Date value) { - addCriterion("date_deleted =", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotEqualTo(Date value) { - addCriterion("date_deleted <>", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThan(Date value) { - addCriterion("date_deleted >", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { - addCriterion("date_deleted >=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThan(Date value) { - addCriterion("date_deleted <", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThanOrEqualTo(Date value) { - addCriterion("date_deleted <=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedIn(List values) { - addCriterion("date_deleted in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotIn(List values) { - addCriterion("date_deleted not in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedBetween(Date value1, Date value2) { - addCriterion("date_deleted between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotBetween(Date value1, Date value2) { - addCriterion("date_deleted not between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.client - * - * @mbg.generated do_not_delete_during_merge Wed Mar 07 18:26:22 EAT 2018 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected String orderByClause; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected boolean distinct; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public ClientExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List jsonCriteria; + + protected List allCriteria; + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + jsonCriteria = new ArrayList<>(); + } + + public List getJsonCriteria() { + return jsonCriteria; + } + + protected void addJsonCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.ClientTypeHandler")); + allCriteria = null; + } + + protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + jsonCriteria.add( + new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.ClientTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || jsonCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList<>(); + allCriteria.addAll(criteria); + allCriteria.addAll(jsonCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andJsonIsNull() { + addCriterion("json is null"); + return (Criteria) this; + } + + public Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (Criteria) this; + } + + public Criteria andJsonEqualTo(Object value) { + addJsonCriterion("json =", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotEqualTo(Object value) { + addJsonCriterion("json <>", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThan(Object value) { + addJsonCriterion("json >", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThanOrEqualTo(Object value) { + addJsonCriterion("json >=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThan(Object value) { + addJsonCriterion("json <", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThanOrEqualTo(Object value) { + addJsonCriterion("json <=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonIn(List values) { + addJsonCriterion("json in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotIn(List values) { + addJsonCriterion("json not in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonBetween(Object value1, Object value2) { + addJsonCriterion("json between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotBetween(Object value1, Object value2) { + addJsonCriterion("json not between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNull() { + addCriterion("date_deleted is null"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNotNull() { + addCriterion("date_deleted is not null"); + return (Criteria) this; + } + + public Criteria andDateDeletedEqualTo(Date value) { + addCriterion("date_deleted =", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotEqualTo(Date value) { + addCriterion("date_deleted <>", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThan(Date value) { + addCriterion("date_deleted >", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { + addCriterion("date_deleted >=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThan(Date value) { + addCriterion("date_deleted <", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThanOrEqualTo(Date value) { + addCriterion("date_deleted <=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedIn(List values) { + addCriterion("date_deleted in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotIn(List values) { + addCriterion("date_deleted not in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedBetween(Date value1, Date value2) { + addCriterion("date_deleted between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotBetween(Date value1, Date value2) { + addCriterion("date_deleted not between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.client + * + * @mbg.generated do_not_delete_during_merge Wed Mar 07 18:26:22 EAT 2018 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ClientForm.java b/src/main/java/org/opensrp/domain/postgres/ClientForm.java index 01487eb39..00943cbbc 100644 --- a/src/main/java/org/opensrp/domain/postgres/ClientForm.java +++ b/src/main/java/org/opensrp/domain/postgres/ClientForm.java @@ -4,93 +4,93 @@ public class ClientForm { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column core.client_form.id - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - private Long id; + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.client_form.id + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + private Long id; - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column core.client_form.json - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - private Object json; + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.client_form.json + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + private Object json; - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column core.client_form.created_at - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - private Date createdAt; + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.client_form.created_at + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + private Date createdAt; - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column core.client_form.id - * - * @return the value of core.client_form.id - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public Long getId() { - return id; - } + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.client_form.id + * + * @return the value of core.client_form.id + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public Long getId() { + return id; + } - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column core.client_form.id - * - * @param id the value for core.client_form.id - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.client_form.id + * + * @param id the value for core.client_form.id + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public void setId(Long id) { + this.id = id; + } - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column core.client_form.json - * - * @return the value of core.client_form.json - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public Object getJson() { - return json; - } + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.client_form.json + * + * @return the value of core.client_form.json + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public Object getJson() { + return json; + } - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column core.client_form.json - * - * @param json the value for core.client_form.json - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public void setJson(Object json) { - this.json = json; - } + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.client_form.json + * + * @param json the value for core.client_form.json + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public void setJson(Object json) { + this.json = json; + } - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column core.client_form.created_at - * - * @return the value of core.client_form.created_at - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public Date getCreatedAt() { - return createdAt; - } + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.client_form.created_at + * + * @return the value of core.client_form.created_at + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public Date getCreatedAt() { + return createdAt; + } - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column core.client_form.created_at - * - * @param createdAt the value for core.client_form.created_at - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.client_form.created_at + * + * @param createdAt the value for core.client_form.created_at + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ClientFormExample.java b/src/main/java/org/opensrp/domain/postgres/ClientFormExample.java index 11ecc7ded..2aa98009c 100644 --- a/src/main/java/org/opensrp/domain/postgres/ClientFormExample.java +++ b/src/main/java/org/opensrp/domain/postgres/ClientFormExample.java @@ -6,481 +6,481 @@ public class ClientFormExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public ClientFormExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andJsonIsNull() { - addCriterion("json is null"); - return (Criteria) this; - } - - public Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (Criteria) this; - } - - public Criteria andJsonEqualTo(Object value) { - addCriterion("json =", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotEqualTo(Object value) { - addCriterion("json <>", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThan(Object value) { - addCriterion("json >", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThanOrEqualTo(Object value) { - addCriterion("json >=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThan(Object value) { - addCriterion("json <", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThanOrEqualTo(Object value) { - addCriterion("json <=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonIn(List values) { - addCriterion("json in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotIn(List values) { - addCriterion("json not in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonBetween(Object value1, Object value2) { - addCriterion("json between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotBetween(Object value1, Object value2) { - addCriterion("json not between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andCreatedAtIsNull() { - addCriterion("created_at is null"); - return (Criteria) this; - } - - public Criteria andCreatedAtIsNotNull() { - addCriterion("created_at is not null"); - return (Criteria) this; - } - - public Criteria andCreatedAtEqualTo(Date value) { - addCriterion("created_at =", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtNotEqualTo(Date value) { - addCriterion("created_at <>", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtGreaterThan(Date value) { - addCriterion("created_at >", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { - addCriterion("created_at >=", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtLessThan(Date value) { - addCriterion("created_at <", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtLessThanOrEqualTo(Date value) { - addCriterion("created_at <=", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtIn(List values) { - addCriterion("created_at in", values, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtNotIn(List values) { - addCriterion("created_at not in", values, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtBetween(Date value1, Date value2) { - addCriterion("created_at between", value1, value2, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtNotBetween(Date value1, Date value2) { - addCriterion("created_at not between", value1, value2, "createdAt"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table core.client_form - * - * @mbg.generated do_not_delete_during_merge Fri Mar 20 12:11:34 EAT 2020 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public ClientFormExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andJsonIsNull() { + addCriterion("json is null"); + return (Criteria) this; + } + + public Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (Criteria) this; + } + + public Criteria andJsonEqualTo(Object value) { + addCriterion("json =", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotEqualTo(Object value) { + addCriterion("json <>", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThan(Object value) { + addCriterion("json >", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThanOrEqualTo(Object value) { + addCriterion("json >=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThan(Object value) { + addCriterion("json <", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThanOrEqualTo(Object value) { + addCriterion("json <=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonIn(List values) { + addCriterion("json in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotIn(List values) { + addCriterion("json not in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonBetween(Object value1, Object value2) { + addCriterion("json between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotBetween(Object value1, Object value2) { + addCriterion("json not between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Date value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Date value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Date value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Date value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Date value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Date value1, Date value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Date value1, Date value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table core.client_form + * + * @mbg.generated do_not_delete_during_merge Fri Mar 20 12:11:34 EAT 2020 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ClientFormMetadata.java b/src/main/java/org/opensrp/domain/postgres/ClientFormMetadata.java index 9e8cb4fe1..7c8e05872 100644 --- a/src/main/java/org/opensrp/domain/postgres/ClientFormMetadata.java +++ b/src/main/java/org/opensrp/domain/postgres/ClientFormMetadata.java @@ -4,311 +4,311 @@ public class ClientFormMetadata { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column core.client_form_metadata.id - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column core.client_form_metadata.identifier - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - private String identifier; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column core.client_form_metadata.jurisdiction - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - private String jurisdiction; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column core.client_form_metadata.version - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - private String version; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column core.client_form_metadata.label - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - private String label; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column core.client_form_metadata.module - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - private String module; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column core.client_form_metadata.created_at - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - private Date createdAt; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column core.client_form_metadata.is_draft - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - private Boolean isDraft; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column core.client_form_metadata.is_json_validator - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - private Boolean isJsonValidator; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column core.client_form_metadata.relation - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - private String relation; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column core.client_form_metadata.id - * - * @return the value of core.client_form_metadata.id - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column core.client_form_metadata.id - * - * @param id the value for core.client_form_metadata.id - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column core.client_form_metadata.identifier - * - * @return the value of core.client_form_metadata.identifier - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public String getIdentifier() { - return identifier; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column core.client_form_metadata.identifier - * - * @param identifier the value for core.client_form_metadata.identifier - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column core.client_form_metadata.jurisdiction - * - * @return the value of core.client_form_metadata.jurisdiction - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public String getJurisdiction() { - return jurisdiction; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column core.client_form_metadata.jurisdiction - * - * @param jurisdiction the value for core.client_form_metadata.jurisdiction - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public void setJurisdiction(String jurisdiction) { - this.jurisdiction = jurisdiction; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column core.client_form_metadata.version - * - * @return the value of core.client_form_metadata.version - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public String getVersion() { - return version; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column core.client_form_metadata.version - * - * @param version the value for core.client_form_metadata.version - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public void setVersion(String version) { - this.version = version; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column core.client_form_metadata.label - * - * @return the value of core.client_form_metadata.label - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public String getLabel() { - return label; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column core.client_form_metadata.label - * - * @param label the value for core.client_form_metadata.label - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public void setLabel(String label) { - this.label = label; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column core.client_form_metadata.module - * - * @return the value of core.client_form_metadata.module - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public String getModule() { - return module; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column core.client_form_metadata.module - * - * @param module the value for core.client_form_metadata.module - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public void setModule(String module) { - this.module = module; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column core.client_form_metadata.created_at - * - * @return the value of core.client_form_metadata.created_at - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public Date getCreatedAt() { - return createdAt; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column core.client_form_metadata.created_at - * - * @param createdAt the value for core.client_form_metadata.created_at - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column core.client_form_metadata.is_draft - * - * @return the value of core.client_form_metadata.is_draft - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public Boolean getIsDraft() { - return isDraft; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column core.client_form_metadata.is_draft - * - * @param isDraft the value for core.client_form_metadata.is_draft - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public void setIsDraft(Boolean isDraft) { - this.isDraft = isDraft; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column core.client_form_metadata.is_json_validator - * - * @return the value of core.client_form_metadata.is_json_validator - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column core.client_form_metadata.is_json_validator - * - * @param isJsonValidator the value for core.client_form_metadata.is_json_validator - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public void setIsJsonValidator(Boolean isJsonValidator) { - this.isJsonValidator = isJsonValidator; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column core.client_form_metadata.is_json_validator - * - * @return the value of core.client_form_metadata.is_json_validator - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public Boolean getIsJsonValidator() { - return isJsonValidator; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column core.client_form_metadata.relation - * - * @return the value of core.client_form_metadata.relation - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public String getRelation() { - return relation; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column core.client_form_metadata.relation - * - * @param relation the value for core.client_form_metadata.relation - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public void setRelation(String relation) { - this.relation = relation; - } + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.client_form_metadata.id + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.client_form_metadata.identifier + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + private String identifier; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.client_form_metadata.jurisdiction + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + private String jurisdiction; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.client_form_metadata.version + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + private String version; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.client_form_metadata.label + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + private String label; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.client_form_metadata.module + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + private String module; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.client_form_metadata.created_at + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + private Date createdAt; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.client_form_metadata.is_draft + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + private Boolean isDraft; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.client_form_metadata.is_json_validator + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + private Boolean isJsonValidator; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column core.client_form_metadata.relation + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + private String relation; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.client_form_metadata.id + * + * @return the value of core.client_form_metadata.id + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.client_form_metadata.id + * + * @param id the value for core.client_form_metadata.id + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.client_form_metadata.identifier + * + * @return the value of core.client_form_metadata.identifier + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public String getIdentifier() { + return identifier; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.client_form_metadata.identifier + * + * @param identifier the value for core.client_form_metadata.identifier + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.client_form_metadata.jurisdiction + * + * @return the value of core.client_form_metadata.jurisdiction + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public String getJurisdiction() { + return jurisdiction; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.client_form_metadata.jurisdiction + * + * @param jurisdiction the value for core.client_form_metadata.jurisdiction + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public void setJurisdiction(String jurisdiction) { + this.jurisdiction = jurisdiction; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.client_form_metadata.version + * + * @return the value of core.client_form_metadata.version + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public String getVersion() { + return version; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.client_form_metadata.version + * + * @param version the value for core.client_form_metadata.version + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public void setVersion(String version) { + this.version = version; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.client_form_metadata.label + * + * @return the value of core.client_form_metadata.label + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public String getLabel() { + return label; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.client_form_metadata.label + * + * @param label the value for core.client_form_metadata.label + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public void setLabel(String label) { + this.label = label; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.client_form_metadata.module + * + * @return the value of core.client_form_metadata.module + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public String getModule() { + return module; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.client_form_metadata.module + * + * @param module the value for core.client_form_metadata.module + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public void setModule(String module) { + this.module = module; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.client_form_metadata.created_at + * + * @return the value of core.client_form_metadata.created_at + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public Date getCreatedAt() { + return createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.client_form_metadata.created_at + * + * @param createdAt the value for core.client_form_metadata.created_at + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.client_form_metadata.is_draft + * + * @return the value of core.client_form_metadata.is_draft + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public Boolean getIsDraft() { + return isDraft; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.client_form_metadata.is_draft + * + * @param isDraft the value for core.client_form_metadata.is_draft + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public void setIsDraft(Boolean isDraft) { + this.isDraft = isDraft; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.client_form_metadata.is_json_validator + * + * @return the value of core.client_form_metadata.is_json_validator + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.client_form_metadata.is_json_validator + * + * @return the value of core.client_form_metadata.is_json_validator + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public Boolean getIsJsonValidator() { + return isJsonValidator; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.client_form_metadata.is_json_validator + * + * @param isJsonValidator the value for core.client_form_metadata.is_json_validator + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public void setIsJsonValidator(Boolean isJsonValidator) { + this.isJsonValidator = isJsonValidator; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column core.client_form_metadata.relation + * + * @return the value of core.client_form_metadata.relation + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public String getRelation() { + return relation; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column core.client_form_metadata.relation + * + * @param relation the value for core.client_form_metadata.relation + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public void setRelation(String relation) { + this.relation = relation; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ClientFormMetadataExample.java b/src/main/java/org/opensrp/domain/postgres/ClientFormMetadataExample.java index efee7047a..25a2711c0 100644 --- a/src/main/java/org/opensrp/domain/postgres/ClientFormMetadataExample.java +++ b/src/main/java/org/opensrp/domain/postgres/ClientFormMetadataExample.java @@ -6,961 +6,961 @@ public class ClientFormMetadataExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public ClientFormMetadataExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNull() { - addCriterion("identifier is null"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNotNull() { - addCriterion("identifier is not null"); - return (Criteria) this; - } - - public Criteria andIdentifierEqualTo(String value) { - addCriterion("identifier =", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotEqualTo(String value) { - addCriterion("identifier <>", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThan(String value) { - addCriterion("identifier >", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThanOrEqualTo(String value) { - addCriterion("identifier >=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThan(String value) { - addCriterion("identifier <", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThanOrEqualTo(String value) { - addCriterion("identifier <=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLike(String value) { - addCriterion("identifier like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotLike(String value) { - addCriterion("identifier not like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierIn(List values) { - addCriterion("identifier in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotIn(List values) { - addCriterion("identifier not in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierBetween(String value1, String value2) { - addCriterion("identifier between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotBetween(String value1, String value2) { - addCriterion("identifier not between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andJurisdictionIsNull() { - addCriterion("jurisdiction is null"); - return (Criteria) this; - } - - public Criteria andJurisdictionIsNotNull() { - addCriterion("jurisdiction is not null"); - return (Criteria) this; - } - - public Criteria andJurisdictionEqualTo(String value) { - addCriterion("jurisdiction =", value, "jurisdiction"); - return (Criteria) this; - } - - public Criteria andJurisdictionNotEqualTo(String value) { - addCriterion("jurisdiction <>", value, "jurisdiction"); - return (Criteria) this; - } - - public Criteria andJurisdictionGreaterThan(String value) { - addCriterion("jurisdiction >", value, "jurisdiction"); - return (Criteria) this; - } - - public Criteria andJurisdictionGreaterThanOrEqualTo(String value) { - addCriterion("jurisdiction >=", value, "jurisdiction"); - return (Criteria) this; - } - - public Criteria andJurisdictionLessThan(String value) { - addCriterion("jurisdiction <", value, "jurisdiction"); - return (Criteria) this; - } - - public Criteria andJurisdictionLessThanOrEqualTo(String value) { - addCriterion("jurisdiction <=", value, "jurisdiction"); - return (Criteria) this; - } - - public Criteria andJurisdictionLike(String value) { - addCriterion("jurisdiction like", value, "jurisdiction"); - return (Criteria) this; - } - - public Criteria andJurisdictionNotLike(String value) { - addCriterion("jurisdiction not like", value, "jurisdiction"); - return (Criteria) this; - } - - public Criteria andJurisdictionIn(List values) { - addCriterion("jurisdiction in", values, "jurisdiction"); - return (Criteria) this; - } - - public Criteria andJurisdictionNotIn(List values) { - addCriterion("jurisdiction not in", values, "jurisdiction"); - return (Criteria) this; - } - - public Criteria andJurisdictionBetween(String value1, String value2) { - addCriterion("jurisdiction between", value1, value2, "jurisdiction"); - return (Criteria) this; - } - - public Criteria andJurisdictionNotBetween(String value1, String value2) { - addCriterion("jurisdiction not between", value1, value2, "jurisdiction"); - return (Criteria) this; - } - - public Criteria andVersionIsNull() { - addCriterion("version is null"); - return (Criteria) this; - } - - public Criteria andVersionIsNotNull() { - addCriterion("version is not null"); - return (Criteria) this; - } - - public Criteria andVersionEqualTo(String value) { - addCriterion("version =", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotEqualTo(String value) { - addCriterion("version <>", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionGreaterThan(String value) { - addCriterion("version >", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionGreaterThanOrEqualTo(String value) { - addCriterion("version >=", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionLessThan(String value) { - addCriterion("version <", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionLessThanOrEqualTo(String value) { - addCriterion("version <=", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionLike(String value) { - addCriterion("version like", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotLike(String value) { - addCriterion("version not like", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionIn(List values) { - addCriterion("version in", values, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotIn(List values) { - addCriterion("version not in", values, "version"); - return (Criteria) this; - } - - public Criteria andVersionBetween(String value1, String value2) { - addCriterion("version between", value1, value2, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotBetween(String value1, String value2) { - addCriterion("version not between", value1, value2, "version"); - return (Criteria) this; - } - - public Criteria andLabelIsNull() { - addCriterion("label is null"); - return (Criteria) this; - } - - public Criteria andLabelIsNotNull() { - addCriterion("label is not null"); - return (Criteria) this; - } - - public Criteria andLabelEqualTo(String value) { - addCriterion("label =", value, "label"); - return (Criteria) this; - } - - public Criteria andLabelNotEqualTo(String value) { - addCriterion("label <>", value, "label"); - return (Criteria) this; - } - - public Criteria andLabelGreaterThan(String value) { - addCriterion("label >", value, "label"); - return (Criteria) this; - } - - public Criteria andLabelGreaterThanOrEqualTo(String value) { - addCriterion("label >=", value, "label"); - return (Criteria) this; - } - - public Criteria andLabelLessThan(String value) { - addCriterion("label <", value, "label"); - return (Criteria) this; - } - - public Criteria andLabelLessThanOrEqualTo(String value) { - addCriterion("label <=", value, "label"); - return (Criteria) this; - } - - public Criteria andLabelLike(String value) { - addCriterion("label like", value, "label"); - return (Criteria) this; - } - - public Criteria andLabelNotLike(String value) { - addCriterion("label not like", value, "label"); - return (Criteria) this; - } - - public Criteria andLabelIn(List values) { - addCriterion("label in", values, "label"); - return (Criteria) this; - } - - public Criteria andLabelNotIn(List values) { - addCriterion("label not in", values, "label"); - return (Criteria) this; - } - - public Criteria andLabelBetween(String value1, String value2) { - addCriterion("label between", value1, value2, "label"); - return (Criteria) this; - } - - public Criteria andLabelNotBetween(String value1, String value2) { - addCriterion("label not between", value1, value2, "label"); - return (Criteria) this; - } - - public Criteria andModuleIsNull() { - addCriterion("module is null"); - return (Criteria) this; - } - - public Criteria andModuleIsNotNull() { - addCriterion("module is not null"); - return (Criteria) this; - } - - public Criteria andModuleEqualTo(String value) { - addCriterion("module =", value, "module"); - return (Criteria) this; - } - - public Criteria andModuleNotEqualTo(String value) { - addCriterion("module <>", value, "module"); - return (Criteria) this; - } - - public Criteria andModuleGreaterThan(String value) { - addCriterion("module >", value, "module"); - return (Criteria) this; - } - - public Criteria andModuleGreaterThanOrEqualTo(String value) { - addCriterion("module >=", value, "module"); - return (Criteria) this; - } - - public Criteria andModuleLessThan(String value) { - addCriterion("module <", value, "module"); - return (Criteria) this; - } - - public Criteria andModuleLessThanOrEqualTo(String value) { - addCriterion("module <=", value, "module"); - return (Criteria) this; - } - - public Criteria andModuleLike(String value) { - addCriterion("module like", value, "module"); - return (Criteria) this; - } - - public Criteria andModuleNotLike(String value) { - addCriterion("module not like", value, "module"); - return (Criteria) this; - } - - public Criteria andModuleIn(List values) { - addCriterion("module in", values, "module"); - return (Criteria) this; - } - - public Criteria andModuleNotIn(List values) { - addCriterion("module not in", values, "module"); - return (Criteria) this; - } - - public Criteria andModuleBetween(String value1, String value2) { - addCriterion("module between", value1, value2, "module"); - return (Criteria) this; - } - - public Criteria andModuleNotBetween(String value1, String value2) { - addCriterion("module not between", value1, value2, "module"); - return (Criteria) this; - } - - public Criteria andCreatedAtIsNull() { - addCriterion("created_at is null"); - return (Criteria) this; - } - - public Criteria andCreatedAtIsNotNull() { - addCriterion("created_at is not null"); - return (Criteria) this; - } - - public Criteria andCreatedAtEqualTo(Date value) { - addCriterion("created_at =", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtNotEqualTo(Date value) { - addCriterion("created_at <>", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtGreaterThan(Date value) { - addCriterion("created_at >", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { - addCriterion("created_at >=", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtLessThan(Date value) { - addCriterion("created_at <", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtLessThanOrEqualTo(Date value) { - addCriterion("created_at <=", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtIn(List values) { - addCriterion("created_at in", values, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtNotIn(List values) { - addCriterion("created_at not in", values, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtBetween(Date value1, Date value2) { - addCriterion("created_at between", value1, value2, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtNotBetween(Date value1, Date value2) { - addCriterion("created_at not between", value1, value2, "createdAt"); - return (Criteria) this; - } - - public Criteria andIsDraftIsNull() { - addCriterion("is_draft is null"); - return (Criteria) this; - } - - public Criteria andIsDraftIsNotNull() { - addCriterion("is_draft is not null"); - return (Criteria) this; - } - - public Criteria andIsDraftEqualTo(Boolean value) { - addCriterion("is_draft =", value, "isDraft"); - return (Criteria) this; - } - - public Criteria andIsDraftNotEqualTo(Boolean value) { - addCriterion("is_draft <>", value, "isDraft"); - return (Criteria) this; - } - - public Criteria andIsDraftGreaterThan(Boolean value) { - addCriterion("is_draft >", value, "isDraft"); - return (Criteria) this; - } - - public Criteria andIsDraftGreaterThanOrEqualTo(Boolean value) { - addCriterion("is_draft >=", value, "isDraft"); - return (Criteria) this; - } - - public Criteria andIsDraftLessThan(Boolean value) { - addCriterion("is_draft <", value, "isDraft"); - return (Criteria) this; - } - - public Criteria andIsDraftLessThanOrEqualTo(Boolean value) { - addCriterion("is_draft <=", value, "isDraft"); - return (Criteria) this; - } - - public Criteria andIsDraftIn(List values) { - addCriterion("is_draft in", values, "isDraft"); - return (Criteria) this; - } - - public Criteria andIsDraftNotIn(List values) { - addCriterion("is_draft not in", values, "isDraft"); - return (Criteria) this; - } - - public Criteria andIsDraftBetween(Boolean value1, Boolean value2) { - addCriterion("is_draft between", value1, value2, "isDraft"); - return (Criteria) this; - } - - public Criteria andIsDraftNotBetween(Boolean value1, Boolean value2) { - addCriterion("is_draft not between", value1, value2, "isDraft"); - return (Criteria) this; - } - - public Criteria andIsJsonValidatorIsNull() { - addCriterion("is_json_validator is null"); - return (Criteria) this; - } - - public Criteria andIsJsonValidatorIsNotNull() { - addCriterion("is_json_validator is not null"); - return (Criteria) this; - } - - public Criteria andIsJsonValidatorEqualTo(Boolean value) { - addCriterion("is_json_validator =", value, "isJsonValidator"); - return (Criteria) this; - } - - public Criteria andIsJsonValidatorNotEqualTo(Boolean value) { - addCriterion("is_json_validator <>", value, "isJsonValidator"); - return (Criteria) this; - } - - public Criteria andIsJsonValidatorGreaterThan(Boolean value) { - addCriterion("is_json_validator >", value, "isJsonValidator"); - return (Criteria) this; - } - - public Criteria andIsJsonValidatorGreaterThanOrEqualTo(Boolean value) { - addCriterion("is_json_validator >=", value, "isJsonValidator"); - return (Criteria) this; - } - - public Criteria andIsJsonValidatorLessThan(Boolean value) { - addCriterion("is_json_validator <", value, "isJsonValidator"); - return (Criteria) this; - } - - public Criteria andIsJsonValidatorLessThanOrEqualTo(Boolean value) { - addCriterion("is_json_validator <=", value, "isJsonValidator"); - return (Criteria) this; - } - - public Criteria andIsJsonValidatorIn(List values) { - addCriterion("is_json_validator in", values, "isJsonValidator"); - return (Criteria) this; - } - - public Criteria andIsJsonValidatorNotIn(List values) { - addCriterion("is_json_validator not in", values, "isJsonValidator"); - return (Criteria) this; - } - - public Criteria andIsJsonValidatorBetween(Boolean value1, Boolean value2) { - addCriterion("is_json_validator between", value1, value2, "isJsonValidator"); - return (Criteria) this; - } - - public Criteria andIsJsonValidatorNotBetween(Boolean value1, Boolean value2) { - addCriterion("is_json_validator not between", value1, value2, "isJsonValidator"); - return (Criteria) this; - } - - public Criteria andRelationIsNull() { - addCriterion("relation is null"); - return (Criteria) this; - } - - public Criteria andRelationIsNotNull() { - addCriterion("relation is not null"); - return (Criteria) this; - } - - public Criteria andRelationEqualTo(String value) { - addCriterion("relation =", value, "relation"); - return (Criteria) this; - } - - public Criteria andRelationNotEqualTo(String value) { - addCriterion("relation <>", value, "relation"); - return (Criteria) this; - } - - public Criteria andRelationGreaterThan(String value) { - addCriterion("relation >", value, "relation"); - return (Criteria) this; - } - - public Criteria andRelationGreaterThanOrEqualTo(String value) { - addCriterion("relation >=", value, "relation"); - return (Criteria) this; - } - - public Criteria andRelationLessThan(String value) { - addCriterion("relation <", value, "relation"); - return (Criteria) this; - } - - public Criteria andRelationLessThanOrEqualTo(String value) { - addCriterion("relation <=", value, "relation"); - return (Criteria) this; - } - - public Criteria andRelationLike(String value) { - addCriterion("relation like", value, "relation"); - return (Criteria) this; - } - - public Criteria andRelationNotLike(String value) { - addCriterion("relation not like", value, "relation"); - return (Criteria) this; - } - - public Criteria andRelationIn(List values) { - addCriterion("relation in", values, "relation"); - return (Criteria) this; - } - - public Criteria andRelationNotIn(List values) { - addCriterion("relation not in", values, "relation"); - return (Criteria) this; - } - - public Criteria andRelationBetween(String value1, String value2) { - addCriterion("relation between", value1, value2, "relation"); - return (Criteria) this; - } - - public Criteria andRelationNotBetween(String value1, String value2) { - addCriterion("relation not between", value1, value2, "relation"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table core.client_form_metadata - * - * @mbg.generated do_not_delete_during_merge Mon Jun 15 11:22:33 EAT 2020 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public ClientFormMetadataExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNull() { + addCriterion("identifier is null"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNotNull() { + addCriterion("identifier is not null"); + return (Criteria) this; + } + + public Criteria andIdentifierEqualTo(String value) { + addCriterion("identifier =", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotEqualTo(String value) { + addCriterion("identifier <>", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThan(String value) { + addCriterion("identifier >", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThanOrEqualTo(String value) { + addCriterion("identifier >=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThan(String value) { + addCriterion("identifier <", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThanOrEqualTo(String value) { + addCriterion("identifier <=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLike(String value) { + addCriterion("identifier like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotLike(String value) { + addCriterion("identifier not like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierIn(List values) { + addCriterion("identifier in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotIn(List values) { + addCriterion("identifier not in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierBetween(String value1, String value2) { + addCriterion("identifier between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotBetween(String value1, String value2) { + addCriterion("identifier not between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andJurisdictionIsNull() { + addCriterion("jurisdiction is null"); + return (Criteria) this; + } + + public Criteria andJurisdictionIsNotNull() { + addCriterion("jurisdiction is not null"); + return (Criteria) this; + } + + public Criteria andJurisdictionEqualTo(String value) { + addCriterion("jurisdiction =", value, "jurisdiction"); + return (Criteria) this; + } + + public Criteria andJurisdictionNotEqualTo(String value) { + addCriterion("jurisdiction <>", value, "jurisdiction"); + return (Criteria) this; + } + + public Criteria andJurisdictionGreaterThan(String value) { + addCriterion("jurisdiction >", value, "jurisdiction"); + return (Criteria) this; + } + + public Criteria andJurisdictionGreaterThanOrEqualTo(String value) { + addCriterion("jurisdiction >=", value, "jurisdiction"); + return (Criteria) this; + } + + public Criteria andJurisdictionLessThan(String value) { + addCriterion("jurisdiction <", value, "jurisdiction"); + return (Criteria) this; + } + + public Criteria andJurisdictionLessThanOrEqualTo(String value) { + addCriterion("jurisdiction <=", value, "jurisdiction"); + return (Criteria) this; + } + + public Criteria andJurisdictionLike(String value) { + addCriterion("jurisdiction like", value, "jurisdiction"); + return (Criteria) this; + } + + public Criteria andJurisdictionNotLike(String value) { + addCriterion("jurisdiction not like", value, "jurisdiction"); + return (Criteria) this; + } + + public Criteria andJurisdictionIn(List values) { + addCriterion("jurisdiction in", values, "jurisdiction"); + return (Criteria) this; + } + + public Criteria andJurisdictionNotIn(List values) { + addCriterion("jurisdiction not in", values, "jurisdiction"); + return (Criteria) this; + } + + public Criteria andJurisdictionBetween(String value1, String value2) { + addCriterion("jurisdiction between", value1, value2, "jurisdiction"); + return (Criteria) this; + } + + public Criteria andJurisdictionNotBetween(String value1, String value2) { + addCriterion("jurisdiction not between", value1, value2, "jurisdiction"); + return (Criteria) this; + } + + public Criteria andVersionIsNull() { + addCriterion("version is null"); + return (Criteria) this; + } + + public Criteria andVersionIsNotNull() { + addCriterion("version is not null"); + return (Criteria) this; + } + + public Criteria andVersionEqualTo(String value) { + addCriterion("version =", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotEqualTo(String value) { + addCriterion("version <>", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionGreaterThan(String value) { + addCriterion("version >", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionGreaterThanOrEqualTo(String value) { + addCriterion("version >=", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionLessThan(String value) { + addCriterion("version <", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionLessThanOrEqualTo(String value) { + addCriterion("version <=", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionLike(String value) { + addCriterion("version like", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotLike(String value) { + addCriterion("version not like", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionIn(List values) { + addCriterion("version in", values, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotIn(List values) { + addCriterion("version not in", values, "version"); + return (Criteria) this; + } + + public Criteria andVersionBetween(String value1, String value2) { + addCriterion("version between", value1, value2, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotBetween(String value1, String value2) { + addCriterion("version not between", value1, value2, "version"); + return (Criteria) this; + } + + public Criteria andLabelIsNull() { + addCriterion("label is null"); + return (Criteria) this; + } + + public Criteria andLabelIsNotNull() { + addCriterion("label is not null"); + return (Criteria) this; + } + + public Criteria andLabelEqualTo(String value) { + addCriterion("label =", value, "label"); + return (Criteria) this; + } + + public Criteria andLabelNotEqualTo(String value) { + addCriterion("label <>", value, "label"); + return (Criteria) this; + } + + public Criteria andLabelGreaterThan(String value) { + addCriterion("label >", value, "label"); + return (Criteria) this; + } + + public Criteria andLabelGreaterThanOrEqualTo(String value) { + addCriterion("label >=", value, "label"); + return (Criteria) this; + } + + public Criteria andLabelLessThan(String value) { + addCriterion("label <", value, "label"); + return (Criteria) this; + } + + public Criteria andLabelLessThanOrEqualTo(String value) { + addCriterion("label <=", value, "label"); + return (Criteria) this; + } + + public Criteria andLabelLike(String value) { + addCriterion("label like", value, "label"); + return (Criteria) this; + } + + public Criteria andLabelNotLike(String value) { + addCriterion("label not like", value, "label"); + return (Criteria) this; + } + + public Criteria andLabelIn(List values) { + addCriterion("label in", values, "label"); + return (Criteria) this; + } + + public Criteria andLabelNotIn(List values) { + addCriterion("label not in", values, "label"); + return (Criteria) this; + } + + public Criteria andLabelBetween(String value1, String value2) { + addCriterion("label between", value1, value2, "label"); + return (Criteria) this; + } + + public Criteria andLabelNotBetween(String value1, String value2) { + addCriterion("label not between", value1, value2, "label"); + return (Criteria) this; + } + + public Criteria andModuleIsNull() { + addCriterion("module is null"); + return (Criteria) this; + } + + public Criteria andModuleIsNotNull() { + addCriterion("module is not null"); + return (Criteria) this; + } + + public Criteria andModuleEqualTo(String value) { + addCriterion("module =", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleNotEqualTo(String value) { + addCriterion("module <>", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleGreaterThan(String value) { + addCriterion("module >", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleGreaterThanOrEqualTo(String value) { + addCriterion("module >=", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleLessThan(String value) { + addCriterion("module <", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleLessThanOrEqualTo(String value) { + addCriterion("module <=", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleLike(String value) { + addCriterion("module like", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleNotLike(String value) { + addCriterion("module not like", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleIn(List values) { + addCriterion("module in", values, "module"); + return (Criteria) this; + } + + public Criteria andModuleNotIn(List values) { + addCriterion("module not in", values, "module"); + return (Criteria) this; + } + + public Criteria andModuleBetween(String value1, String value2) { + addCriterion("module between", value1, value2, "module"); + return (Criteria) this; + } + + public Criteria andModuleNotBetween(String value1, String value2) { + addCriterion("module not between", value1, value2, "module"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Date value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Date value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Date value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Date value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Date value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Date value1, Date value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Date value1, Date value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andIsDraftIsNull() { + addCriterion("is_draft is null"); + return (Criteria) this; + } + + public Criteria andIsDraftIsNotNull() { + addCriterion("is_draft is not null"); + return (Criteria) this; + } + + public Criteria andIsDraftEqualTo(Boolean value) { + addCriterion("is_draft =", value, "isDraft"); + return (Criteria) this; + } + + public Criteria andIsDraftNotEqualTo(Boolean value) { + addCriterion("is_draft <>", value, "isDraft"); + return (Criteria) this; + } + + public Criteria andIsDraftGreaterThan(Boolean value) { + addCriterion("is_draft >", value, "isDraft"); + return (Criteria) this; + } + + public Criteria andIsDraftGreaterThanOrEqualTo(Boolean value) { + addCriterion("is_draft >=", value, "isDraft"); + return (Criteria) this; + } + + public Criteria andIsDraftLessThan(Boolean value) { + addCriterion("is_draft <", value, "isDraft"); + return (Criteria) this; + } + + public Criteria andIsDraftLessThanOrEqualTo(Boolean value) { + addCriterion("is_draft <=", value, "isDraft"); + return (Criteria) this; + } + + public Criteria andIsDraftIn(List values) { + addCriterion("is_draft in", values, "isDraft"); + return (Criteria) this; + } + + public Criteria andIsDraftNotIn(List values) { + addCriterion("is_draft not in", values, "isDraft"); + return (Criteria) this; + } + + public Criteria andIsDraftBetween(Boolean value1, Boolean value2) { + addCriterion("is_draft between", value1, value2, "isDraft"); + return (Criteria) this; + } + + public Criteria andIsDraftNotBetween(Boolean value1, Boolean value2) { + addCriterion("is_draft not between", value1, value2, "isDraft"); + return (Criteria) this; + } + + public Criteria andIsJsonValidatorIsNull() { + addCriterion("is_json_validator is null"); + return (Criteria) this; + } + + public Criteria andIsJsonValidatorIsNotNull() { + addCriterion("is_json_validator is not null"); + return (Criteria) this; + } + + public Criteria andIsJsonValidatorEqualTo(Boolean value) { + addCriterion("is_json_validator =", value, "isJsonValidator"); + return (Criteria) this; + } + + public Criteria andIsJsonValidatorNotEqualTo(Boolean value) { + addCriterion("is_json_validator <>", value, "isJsonValidator"); + return (Criteria) this; + } + + public Criteria andIsJsonValidatorGreaterThan(Boolean value) { + addCriterion("is_json_validator >", value, "isJsonValidator"); + return (Criteria) this; + } + + public Criteria andIsJsonValidatorGreaterThanOrEqualTo(Boolean value) { + addCriterion("is_json_validator >=", value, "isJsonValidator"); + return (Criteria) this; + } + + public Criteria andIsJsonValidatorLessThan(Boolean value) { + addCriterion("is_json_validator <", value, "isJsonValidator"); + return (Criteria) this; + } + + public Criteria andIsJsonValidatorLessThanOrEqualTo(Boolean value) { + addCriterion("is_json_validator <=", value, "isJsonValidator"); + return (Criteria) this; + } + + public Criteria andIsJsonValidatorIn(List values) { + addCriterion("is_json_validator in", values, "isJsonValidator"); + return (Criteria) this; + } + + public Criteria andIsJsonValidatorNotIn(List values) { + addCriterion("is_json_validator not in", values, "isJsonValidator"); + return (Criteria) this; + } + + public Criteria andIsJsonValidatorBetween(Boolean value1, Boolean value2) { + addCriterion("is_json_validator between", value1, value2, "isJsonValidator"); + return (Criteria) this; + } + + public Criteria andIsJsonValidatorNotBetween(Boolean value1, Boolean value2) { + addCriterion("is_json_validator not between", value1, value2, "isJsonValidator"); + return (Criteria) this; + } + + public Criteria andRelationIsNull() { + addCriterion("relation is null"); + return (Criteria) this; + } + + public Criteria andRelationIsNotNull() { + addCriterion("relation is not null"); + return (Criteria) this; + } + + public Criteria andRelationEqualTo(String value) { + addCriterion("relation =", value, "relation"); + return (Criteria) this; + } + + public Criteria andRelationNotEqualTo(String value) { + addCriterion("relation <>", value, "relation"); + return (Criteria) this; + } + + public Criteria andRelationGreaterThan(String value) { + addCriterion("relation >", value, "relation"); + return (Criteria) this; + } + + public Criteria andRelationGreaterThanOrEqualTo(String value) { + addCriterion("relation >=", value, "relation"); + return (Criteria) this; + } + + public Criteria andRelationLessThan(String value) { + addCriterion("relation <", value, "relation"); + return (Criteria) this; + } + + public Criteria andRelationLessThanOrEqualTo(String value) { + addCriterion("relation <=", value, "relation"); + return (Criteria) this; + } + + public Criteria andRelationLike(String value) { + addCriterion("relation like", value, "relation"); + return (Criteria) this; + } + + public Criteria andRelationNotLike(String value) { + addCriterion("relation not like", value, "relation"); + return (Criteria) this; + } + + public Criteria andRelationIn(List values) { + addCriterion("relation in", values, "relation"); + return (Criteria) this; + } + + public Criteria andRelationNotIn(List values) { + addCriterion("relation not in", values, "relation"); + return (Criteria) this; + } + + public Criteria andRelationBetween(String value1, String value2) { + addCriterion("relation between", value1, value2, "relation"); + return (Criteria) this; + } + + public Criteria andRelationNotBetween(String value1, String value2) { + addCriterion("relation not between", value1, value2, "relation"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table core.client_form_metadata + * + * @mbg.generated do_not_delete_during_merge Mon Jun 15 11:22:33 EAT 2020 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ClientMetadata.java b/src/main/java/org/opensrp/domain/postgres/ClientMetadata.java index 0c89a10f9..897265536 100644 --- a/src/main/java/org/opensrp/domain/postgres/ClientMetadata.java +++ b/src/main/java/org/opensrp/domain/postgres/ClientMetadata.java @@ -3,544 +3,544 @@ import java.util.Date; public class ClientMetadata { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.client_id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Long clientId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.document_id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String documentId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.base_entity_id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String baseEntityId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.relational_id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String relationalId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.server_version - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Long serverVersion; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.openmrs_uuid - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String openmrsUuid; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.unique_id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String uniqueId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.first_name - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String firstName; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.middle_name - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String middleName; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.last_name - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String lastName; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.birth_date - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Date birthDate; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.date_deleted - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Date dateDeleted; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.residence - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String residence; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.location_id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String locationId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.client_type - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String clientType; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.date_created - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Date dateCreated; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.client_metadata.date_edited - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Date dateEdited; - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.id - * - * @return the value of core.client_metadata.id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.id - * - * @param id the value for core.client_metadata.id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.client_id - * - * @return the value of core.client_metadata.client_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Long getClientId() { - return clientId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.client_id - * - * @param clientId the value for core.client_metadata.client_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setClientId(Long clientId) { - this.clientId = clientId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.document_id - * - * @return the value of core.client_metadata.document_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getDocumentId() { - return documentId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.document_id - * - * @param documentId the value for core.client_metadata.document_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setDocumentId(String documentId) { - this.documentId = documentId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.base_entity_id - * - * @return the value of core.client_metadata.base_entity_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getBaseEntityId() { - return baseEntityId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.base_entity_id - * - * @param baseEntityId the value for core.client_metadata.base_entity_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setBaseEntityId(String baseEntityId) { - this.baseEntityId = baseEntityId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.relational_id - * - * @return the value of core.client_metadata.relational_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getRelationalId() { - return relationalId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.relational_id - * - * @param relationalId the value for core.client_metadata.relational_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setRelationalId(String relationalId) { - this.relationalId = relationalId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.server_version - * - * @return the value of core.client_metadata.server_version - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Long getServerVersion() { - return serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.server_version - * - * @param serverVersion the value for core.client_metadata.server_version - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.openmrs_uuid - * - * @return the value of core.client_metadata.openmrs_uuid - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getOpenmrsUuid() { - return openmrsUuid; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.openmrs_uuid - * - * @param openmrsUuid the value for core.client_metadata.openmrs_uuid - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setOpenmrsUuid(String openmrsUuid) { - this.openmrsUuid = openmrsUuid; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.unique_id - * - * @return the value of core.client_metadata.unique_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getUniqueId() { - return uniqueId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.unique_id - * - * @param uniqueId the value for core.client_metadata.unique_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setUniqueId(String uniqueId) { - this.uniqueId = uniqueId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.first_name - * - * @return the value of core.client_metadata.first_name - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getFirstName() { - return firstName; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.first_name - * - * @param firstName the value for core.client_metadata.first_name - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.middle_name - * - * @return the value of core.client_metadata.middle_name - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getMiddleName() { - return middleName; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.middle_name - * - * @param middleName the value for core.client_metadata.middle_name - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setMiddleName(String middleName) { - this.middleName = middleName; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.last_name - * - * @return the value of core.client_metadata.last_name - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getLastName() { - return lastName; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.last_name - * - * @param lastName the value for core.client_metadata.last_name - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.birth_date - * - * @return the value of core.client_metadata.birth_date - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Date getBirthDate() { - return birthDate; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.birth_date - * - * @param birthDate the value for core.client_metadata.birth_date - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setBirthDate(Date birthDate) { - this.birthDate = birthDate; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.date_deleted - * - * @return the value of core.client_metadata.date_deleted - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Date getDateDeleted() { - return dateDeleted; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.date_deleted - * - * @param dateDeleted the value for core.client_metadata.date_deleted - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setDateDeleted(Date dateDeleted) { - this.dateDeleted = dateDeleted; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.residence - * - * @return the value of core.client_metadata.residence - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getResidence() { - return residence; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.residence - * - * @param residence the value for core.client_metadata.residence - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setResidence(String residence) { - this.residence = residence; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.location_id - * - * @return the value of core.client_metadata.location_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getLocationId() { - return locationId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.location_id - * - * @param locationId the value for core.client_metadata.location_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setLocationId(String locationId) { - this.locationId = locationId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.client_type - * - * @return the value of core.client_metadata.client_type - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getClientType() { - return clientType; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.client_type - * - * @param clientType the value for core.client_metadata.client_type - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setClientType(String clientType) { - this.clientType = clientType; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.date_created - * - * @return the value of core.client_metadata.date_created - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Date getDateCreated() { - return dateCreated; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.date_created - * - * @param dateCreated the value for core.client_metadata.date_created - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setDateCreated(Date dateCreated) { - this.dateCreated = dateCreated; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.client_metadata.date_edited - * - * @return the value of core.client_metadata.date_edited - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Date getDateEdited() { - return dateEdited; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.client_metadata.date_edited - * - * @param dateEdited the value for core.client_metadata.date_edited - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setDateEdited(Date dateEdited) { - this.dateEdited = dateEdited; - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.client_id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Long clientId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.document_id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String documentId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.base_entity_id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String baseEntityId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.relational_id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String relationalId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.server_version + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Long serverVersion; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.openmrs_uuid + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String openmrsUuid; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.unique_id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String uniqueId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.first_name + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String firstName; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.middle_name + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String middleName; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.last_name + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String lastName; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.birth_date + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Date birthDate; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.date_deleted + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Date dateDeleted; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.residence + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String residence; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.location_id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String locationId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.client_type + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String clientType; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.date_created + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Date dateCreated; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.client_metadata.date_edited + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Date dateEdited; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.id + * + * @return the value of core.client_metadata.id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.id + * + * @param id the value for core.client_metadata.id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.client_id + * + * @return the value of core.client_metadata.client_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Long getClientId() { + return clientId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.client_id + * + * @param clientId the value for core.client_metadata.client_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setClientId(Long clientId) { + this.clientId = clientId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.document_id + * + * @return the value of core.client_metadata.document_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getDocumentId() { + return documentId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.document_id + * + * @param documentId the value for core.client_metadata.document_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setDocumentId(String documentId) { + this.documentId = documentId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.base_entity_id + * + * @return the value of core.client_metadata.base_entity_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getBaseEntityId() { + return baseEntityId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.base_entity_id + * + * @param baseEntityId the value for core.client_metadata.base_entity_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setBaseEntityId(String baseEntityId) { + this.baseEntityId = baseEntityId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.relational_id + * + * @return the value of core.client_metadata.relational_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getRelationalId() { + return relationalId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.relational_id + * + * @param relationalId the value for core.client_metadata.relational_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setRelationalId(String relationalId) { + this.relationalId = relationalId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.server_version + * + * @return the value of core.client_metadata.server_version + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Long getServerVersion() { + return serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.server_version + * + * @param serverVersion the value for core.client_metadata.server_version + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.openmrs_uuid + * + * @return the value of core.client_metadata.openmrs_uuid + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getOpenmrsUuid() { + return openmrsUuid; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.openmrs_uuid + * + * @param openmrsUuid the value for core.client_metadata.openmrs_uuid + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setOpenmrsUuid(String openmrsUuid) { + this.openmrsUuid = openmrsUuid; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.unique_id + * + * @return the value of core.client_metadata.unique_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getUniqueId() { + return uniqueId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.unique_id + * + * @param uniqueId the value for core.client_metadata.unique_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setUniqueId(String uniqueId) { + this.uniqueId = uniqueId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.first_name + * + * @return the value of core.client_metadata.first_name + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getFirstName() { + return firstName; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.first_name + * + * @param firstName the value for core.client_metadata.first_name + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.middle_name + * + * @return the value of core.client_metadata.middle_name + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getMiddleName() { + return middleName; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.middle_name + * + * @param middleName the value for core.client_metadata.middle_name + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setMiddleName(String middleName) { + this.middleName = middleName; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.last_name + * + * @return the value of core.client_metadata.last_name + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getLastName() { + return lastName; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.last_name + * + * @param lastName the value for core.client_metadata.last_name + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.birth_date + * + * @return the value of core.client_metadata.birth_date + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Date getBirthDate() { + return birthDate; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.birth_date + * + * @param birthDate the value for core.client_metadata.birth_date + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setBirthDate(Date birthDate) { + this.birthDate = birthDate; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.date_deleted + * + * @return the value of core.client_metadata.date_deleted + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Date getDateDeleted() { + return dateDeleted; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.date_deleted + * + * @param dateDeleted the value for core.client_metadata.date_deleted + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setDateDeleted(Date dateDeleted) { + this.dateDeleted = dateDeleted; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.residence + * + * @return the value of core.client_metadata.residence + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getResidence() { + return residence; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.residence + * + * @param residence the value for core.client_metadata.residence + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setResidence(String residence) { + this.residence = residence; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.location_id + * + * @return the value of core.client_metadata.location_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getLocationId() { + return locationId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.location_id + * + * @param locationId the value for core.client_metadata.location_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setLocationId(String locationId) { + this.locationId = locationId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.client_type + * + * @return the value of core.client_metadata.client_type + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getClientType() { + return clientType; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.client_type + * + * @param clientType the value for core.client_metadata.client_type + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setClientType(String clientType) { + this.clientType = clientType; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.date_created + * + * @return the value of core.client_metadata.date_created + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Date getDateCreated() { + return dateCreated; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.date_created + * + * @param dateCreated the value for core.client_metadata.date_created + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setDateCreated(Date dateCreated) { + this.dateCreated = dateCreated; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.client_metadata.date_edited + * + * @return the value of core.client_metadata.date_edited + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Date getDateEdited() { + return dateEdited; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.client_metadata.date_edited + * + * @param dateEdited the value for core.client_metadata.date_edited + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setDateEdited(Date dateEdited) { + this.dateEdited = dateEdited; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ClientMetadataExample.java b/src/main/java/org/opensrp/domain/postgres/ClientMetadataExample.java index 935c606e3..89cc96ad9 100644 --- a/src/main/java/org/opensrp/domain/postgres/ClientMetadataExample.java +++ b/src/main/java/org/opensrp/domain/postgres/ClientMetadataExample.java @@ -6,1518 +6,1518 @@ import java.util.List; public class ClientMetadataExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public ClientMetadataExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - protected void addCriterionForJDBCDate(String condition, Date value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - addCriterion(condition, new java.sql.Date(value.getTime()), property); - } - - protected void addCriterionForJDBCDate(String condition, List values, String property) { - if (values == null || values.size() == 0) { - throw new RuntimeException("Value list for " + property + " cannot be null or empty"); - } - List dateList = new ArrayList<>(); - Iterator iter = values.iterator(); - while (iter.hasNext()) { - dateList.add(new java.sql.Date(iter.next().getTime())); - } - addCriterion(condition, dateList, property); - } - - protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andClientIdIsNull() { - addCriterion("client_id is null"); - return (Criteria) this; - } - - public Criteria andClientIdIsNotNull() { - addCriterion("client_id is not null"); - return (Criteria) this; - } - - public Criteria andClientIdEqualTo(Long value) { - addCriterion("client_id =", value, "clientId"); - return (Criteria) this; - } - - public Criteria andClientIdNotEqualTo(Long value) { - addCriterion("client_id <>", value, "clientId"); - return (Criteria) this; - } - - public Criteria andClientIdGreaterThan(Long value) { - addCriterion("client_id >", value, "clientId"); - return (Criteria) this; - } - - public Criteria andClientIdGreaterThanOrEqualTo(Long value) { - addCriterion("client_id >=", value, "clientId"); - return (Criteria) this; - } - - public Criteria andClientIdLessThan(Long value) { - addCriterion("client_id <", value, "clientId"); - return (Criteria) this; - } - - public Criteria andClientIdLessThanOrEqualTo(Long value) { - addCriterion("client_id <=", value, "clientId"); - return (Criteria) this; - } - - public Criteria andClientIdIn(List values) { - addCriterion("client_id in", values, "clientId"); - return (Criteria) this; - } - - public Criteria andClientIdNotIn(List values) { - addCriterion("client_id not in", values, "clientId"); - return (Criteria) this; - } - - public Criteria andClientIdBetween(Long value1, Long value2) { - addCriterion("client_id between", value1, value2, "clientId"); - return (Criteria) this; - } - - public Criteria andClientIdNotBetween(Long value1, Long value2) { - addCriterion("client_id not between", value1, value2, "clientId"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNull() { - addCriterion("document_id is null"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNotNull() { - addCriterion("document_id is not null"); - return (Criteria) this; - } - - public Criteria andDocumentIdEqualTo(String value) { - addCriterion("document_id =", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotEqualTo(String value) { - addCriterion("document_id <>", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThan(String value) { - addCriterion("document_id >", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { - addCriterion("document_id >=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThan(String value) { - addCriterion("document_id <", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThanOrEqualTo(String value) { - addCriterion("document_id <=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLike(String value) { - addCriterion("document_id like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotLike(String value) { - addCriterion("document_id not like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdIn(List values) { - addCriterion("document_id in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotIn(List values) { - addCriterion("document_id not in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdBetween(String value1, String value2) { - addCriterion("document_id between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotBetween(String value1, String value2) { - addCriterion("document_id not between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdIsNull() { - addCriterion("base_entity_id is null"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdIsNotNull() { - addCriterion("base_entity_id is not null"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdEqualTo(String value) { - addCriterion("base_entity_id =", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotEqualTo(String value) { - addCriterion("base_entity_id <>", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdGreaterThan(String value) { - addCriterion("base_entity_id >", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdGreaterThanOrEqualTo(String value) { - addCriterion("base_entity_id >=", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdLessThan(String value) { - addCriterion("base_entity_id <", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdLessThanOrEqualTo(String value) { - addCriterion("base_entity_id <=", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdLike(String value) { - addCriterion("base_entity_id like", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotLike(String value) { - addCriterion("base_entity_id not like", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdIn(List values) { - addCriterion("base_entity_id in", values, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotIn(List values) { - addCriterion("base_entity_id not in", values, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdBetween(String value1, String value2) { - addCriterion("base_entity_id between", value1, value2, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotBetween(String value1, String value2) { - addCriterion("base_entity_id not between", value1, value2, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andRelationalIdIsNull() { - addCriterion("relational_id is null"); - return (Criteria) this; - } - - public Criteria andRelationalIdIsNotNull() { - addCriterion("relational_id is not null"); - return (Criteria) this; - } - - public Criteria andRelationalIdEqualTo(String value) { - addCriterion("relational_id =", value, "relationalId"); - return (Criteria) this; - } - - public Criteria andRelationalIdNotEqualTo(String value) { - addCriterion("relational_id <>", value, "relationalId"); - return (Criteria) this; - } - - public Criteria andRelationalIdGreaterThan(String value) { - addCriterion("relational_id >", value, "relationalId"); - return (Criteria) this; - } - - public Criteria andRelationalIdGreaterThanOrEqualTo(String value) { - addCriterion("relational_id >=", value, "relationalId"); - return (Criteria) this; - } - - public Criteria andRelationalIdLessThan(String value) { - addCriterion("relational_id <", value, "relationalId"); - return (Criteria) this; - } - - public Criteria andRelationalIdLessThanOrEqualTo(String value) { - addCriterion("relational_id <=", value, "relationalId"); - return (Criteria) this; - } - - public Criteria andRelationalIdLike(String value) { - addCriterion("relational_id like", value, "relationalId"); - return (Criteria) this; - } - - public Criteria andRelationalIdNotLike(String value) { - addCriterion("relational_id not like", value, "relationalId"); - return (Criteria) this; - } - - public Criteria andRelationalIdIn(List values) { - addCriterion("relational_id in", values, "relationalId"); - return (Criteria) this; - } - - public Criteria andRelationalIdNotIn(List values) { - addCriterion("relational_id not in", values, "relationalId"); - return (Criteria) this; - } - - public Criteria andRelationalIdBetween(String value1, String value2) { - addCriterion("relational_id between", value1, value2, "relationalId"); - return (Criteria) this; - } - - public Criteria andRelationalIdNotBetween(String value1, String value2) { - addCriterion("relational_id not between", value1, value2, "relationalId"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidIsNull() { - addCriterion("openmrs_uuid is null"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidIsNotNull() { - addCriterion("openmrs_uuid is not null"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidEqualTo(String value) { - addCriterion("openmrs_uuid =", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidNotEqualTo(String value) { - addCriterion("openmrs_uuid <>", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidGreaterThan(String value) { - addCriterion("openmrs_uuid >", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidGreaterThanOrEqualTo(String value) { - addCriterion("openmrs_uuid >=", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidLessThan(String value) { - addCriterion("openmrs_uuid <", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidLessThanOrEqualTo(String value) { - addCriterion("openmrs_uuid <=", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidLike(String value) { - addCriterion("openmrs_uuid like", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidNotLike(String value) { - addCriterion("openmrs_uuid not like", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidIn(List values) { - addCriterion("openmrs_uuid in", values, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidNotIn(List values) { - addCriterion("openmrs_uuid not in", values, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidBetween(String value1, String value2) { - addCriterion("openmrs_uuid between", value1, value2, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidNotBetween(String value1, String value2) { - addCriterion("openmrs_uuid not between", value1, value2, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andUniqueIdIsNull() { - addCriterion("unique_id is null"); - return (Criteria) this; - } - - public Criteria andUniqueIdIsNotNull() { - addCriterion("unique_id is not null"); - return (Criteria) this; - } - - public Criteria andUniqueIdEqualTo(String value) { - addCriterion("unique_id =", value, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdNotEqualTo(String value) { - addCriterion("unique_id <>", value, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdGreaterThan(String value) { - addCriterion("unique_id >", value, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdGreaterThanOrEqualTo(String value) { - addCriterion("unique_id >=", value, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdLessThan(String value) { - addCriterion("unique_id <", value, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdLessThanOrEqualTo(String value) { - addCriterion("unique_id <=", value, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdLike(String value) { - addCriterion("unique_id like", value, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdNotLike(String value) { - addCriterion("unique_id not like", value, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdIn(List values) { - addCriterion("unique_id in", values, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdNotIn(List values) { - addCriterion("unique_id not in", values, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdBetween(String value1, String value2) { - addCriterion("unique_id between", value1, value2, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdNotBetween(String value1, String value2) { - addCriterion("unique_id not between", value1, value2, "uniqueId"); - return (Criteria) this; - } - - public Criteria andFirstNameIsNull() { - addCriterion("first_name is null"); - return (Criteria) this; - } - - public Criteria andFirstNameIsNotNull() { - addCriterion("first_name is not null"); - return (Criteria) this; - } - - public Criteria andFirstNameEqualTo(String value) { - addCriterion("first_name =", value, "firstName"); - return (Criteria) this; - } - - public Criteria andFirstNameNotEqualTo(String value) { - addCriterion("first_name <>", value, "firstName"); - return (Criteria) this; - } - - public Criteria andFirstNameGreaterThan(String value) { - addCriterion("first_name >", value, "firstName"); - return (Criteria) this; - } - - public Criteria andFirstNameGreaterThanOrEqualTo(String value) { - addCriterion("first_name >=", value, "firstName"); - return (Criteria) this; - } - - public Criteria andFirstNameLessThan(String value) { - addCriterion("first_name <", value, "firstName"); - return (Criteria) this; - } - - public Criteria andFirstNameLessThanOrEqualTo(String value) { - addCriterion("first_name <=", value, "firstName"); - return (Criteria) this; - } - - public Criteria andFirstNameLike(String value) { - addCriterion("first_name like", value, "firstName"); - return (Criteria) this; - } - - public Criteria andFirstNameNotLike(String value) { - addCriterion("first_name not like", value, "firstName"); - return (Criteria) this; - } - - public Criteria andFirstNameIn(List values) { - addCriterion("first_name in", values, "firstName"); - return (Criteria) this; - } - - public Criteria andFirstNameNotIn(List values) { - addCriterion("first_name not in", values, "firstName"); - return (Criteria) this; - } - - public Criteria andFirstNameBetween(String value1, String value2) { - addCriterion("first_name between", value1, value2, "firstName"); - return (Criteria) this; - } - - public Criteria andFirstNameNotBetween(String value1, String value2) { - addCriterion("first_name not between", value1, value2, "firstName"); - return (Criteria) this; - } - - public Criteria andMiddleNameIsNull() { - addCriterion("middle_name is null"); - return (Criteria) this; - } - - public Criteria andMiddleNameIsNotNull() { - addCriterion("middle_name is not null"); - return (Criteria) this; - } - - public Criteria andMiddleNameEqualTo(String value) { - addCriterion("middle_name =", value, "middleName"); - return (Criteria) this; - } - - public Criteria andMiddleNameNotEqualTo(String value) { - addCriterion("middle_name <>", value, "middleName"); - return (Criteria) this; - } - - public Criteria andMiddleNameGreaterThan(String value) { - addCriterion("middle_name >", value, "middleName"); - return (Criteria) this; - } - - public Criteria andMiddleNameGreaterThanOrEqualTo(String value) { - addCriterion("middle_name >=", value, "middleName"); - return (Criteria) this; - } - - public Criteria andMiddleNameLessThan(String value) { - addCriterion("middle_name <", value, "middleName"); - return (Criteria) this; - } - - public Criteria andMiddleNameLessThanOrEqualTo(String value) { - addCriterion("middle_name <=", value, "middleName"); - return (Criteria) this; - } - - public Criteria andMiddleNameLike(String value) { - addCriterion("middle_name like", value, "middleName"); - return (Criteria) this; - } - - public Criteria andMiddleNameNotLike(String value) { - addCriterion("middle_name not like", value, "middleName"); - return (Criteria) this; - } - - public Criteria andMiddleNameIn(List values) { - addCriterion("middle_name in", values, "middleName"); - return (Criteria) this; - } - - public Criteria andMiddleNameNotIn(List values) { - addCriterion("middle_name not in", values, "middleName"); - return (Criteria) this; - } - - public Criteria andMiddleNameBetween(String value1, String value2) { - addCriterion("middle_name between", value1, value2, "middleName"); - return (Criteria) this; - } - - public Criteria andMiddleNameNotBetween(String value1, String value2) { - addCriterion("middle_name not between", value1, value2, "middleName"); - return (Criteria) this; - } - - public Criteria andLastNameIsNull() { - addCriterion("last_name is null"); - return (Criteria) this; - } - - public Criteria andLastNameIsNotNull() { - addCriterion("last_name is not null"); - return (Criteria) this; - } - - public Criteria andLastNameEqualTo(String value) { - addCriterion("last_name =", value, "lastName"); - return (Criteria) this; - } - - public Criteria andLastNameNotEqualTo(String value) { - addCriterion("last_name <>", value, "lastName"); - return (Criteria) this; - } - - public Criteria andLastNameGreaterThan(String value) { - addCriterion("last_name >", value, "lastName"); - return (Criteria) this; - } - - public Criteria andLastNameGreaterThanOrEqualTo(String value) { - addCriterion("last_name >=", value, "lastName"); - return (Criteria) this; - } - - public Criteria andLastNameLessThan(String value) { - addCriterion("last_name <", value, "lastName"); - return (Criteria) this; - } - - public Criteria andLastNameLessThanOrEqualTo(String value) { - addCriterion("last_name <=", value, "lastName"); - return (Criteria) this; - } - - public Criteria andLastNameLike(String value) { - addCriterion("last_name like", value, "lastName"); - return (Criteria) this; - } - - public Criteria andLastNameNotLike(String value) { - addCriterion("last_name not like", value, "lastName"); - return (Criteria) this; - } - - public Criteria andLastNameIn(List values) { - addCriterion("last_name in", values, "lastName"); - return (Criteria) this; - } - - public Criteria andLastNameNotIn(List values) { - addCriterion("last_name not in", values, "lastName"); - return (Criteria) this; - } - - public Criteria andLastNameBetween(String value1, String value2) { - addCriterion("last_name between", value1, value2, "lastName"); - return (Criteria) this; - } - - public Criteria andLastNameNotBetween(String value1, String value2) { - addCriterion("last_name not between", value1, value2, "lastName"); - return (Criteria) this; - } - - public Criteria andBirthDateIsNull() { - addCriterion("birth_date is null"); - return (Criteria) this; - } - - public Criteria andBirthDateIsNotNull() { - addCriterion("birth_date is not null"); - return (Criteria) this; - } - - public Criteria andBirthDateEqualTo(Date value) { - addCriterionForJDBCDate("birth_date =", value, "birthDate"); - return (Criteria) this; - } - - public Criteria andBirthDateNotEqualTo(Date value) { - addCriterionForJDBCDate("birth_date <>", value, "birthDate"); - return (Criteria) this; - } - - public Criteria andBirthDateGreaterThan(Date value) { - addCriterionForJDBCDate("birth_date >", value, "birthDate"); - return (Criteria) this; - } - - public Criteria andBirthDateGreaterThanOrEqualTo(Date value) { - addCriterionForJDBCDate("birth_date >=", value, "birthDate"); - return (Criteria) this; - } - - public Criteria andBirthDateLessThan(Date value) { - addCriterionForJDBCDate("birth_date <", value, "birthDate"); - return (Criteria) this; - } - - public Criteria andBirthDateLessThanOrEqualTo(Date value) { - addCriterionForJDBCDate("birth_date <=", value, "birthDate"); - return (Criteria) this; - } - - public Criteria andBirthDateIn(List values) { - addCriterionForJDBCDate("birth_date in", values, "birthDate"); - return (Criteria) this; - } - - public Criteria andBirthDateNotIn(List values) { - addCriterionForJDBCDate("birth_date not in", values, "birthDate"); - return (Criteria) this; - } - - public Criteria andBirthDateBetween(Date value1, Date value2) { - addCriterionForJDBCDate("birth_date between", value1, value2, "birthDate"); - return (Criteria) this; - } - - public Criteria andBirthDateNotBetween(Date value1, Date value2) { - addCriterionForJDBCDate("birth_date not between", value1, value2, "birthDate"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNull() { - addCriterion("date_deleted is null"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNotNull() { - addCriterion("date_deleted is not null"); - return (Criteria) this; - } - - public Criteria andDateDeletedEqualTo(Date value) { - addCriterion("date_deleted =", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotEqualTo(Date value) { - addCriterion("date_deleted <>", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThan(Date value) { - addCriterion("date_deleted >", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { - addCriterion("date_deleted >=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThan(Date value) { - addCriterion("date_deleted <", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThanOrEqualTo(Date value) { - addCriterion("date_deleted <=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedIn(List values) { - addCriterion("date_deleted in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotIn(List values) { - addCriterion("date_deleted not in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedBetween(Date value1, Date value2) { - addCriterion("date_deleted between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotBetween(Date value1, Date value2) { - addCriterion("date_deleted not between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andResidenceIsNull() { - addCriterion("residence is null"); - return (Criteria) this; - } - - public Criteria andResidenceIsNotNull() { - addCriterion("residence is not null"); - return (Criteria) this; - } - - public Criteria andResidenceEqualTo(String value) { - addCriterion("residence =", value, "residence"); - return (Criteria) this; - } - - public Criteria andResidenceNotEqualTo(String value) { - addCriterion("residence <>", value, "residence"); - return (Criteria) this; - } - - public Criteria andResidenceGreaterThan(String value) { - addCriterion("residence >", value, "residence"); - return (Criteria) this; - } - - public Criteria andResidenceGreaterThanOrEqualTo(String value) { - addCriterion("residence >=", value, "residence"); - return (Criteria) this; - } - - public Criteria andResidenceLessThan(String value) { - addCriterion("residence <", value, "residence"); - return (Criteria) this; - } - - public Criteria andResidenceLessThanOrEqualTo(String value) { - addCriterion("residence <=", value, "residence"); - return (Criteria) this; - } - - public Criteria andResidenceLike(String value) { - addCriterion("residence like", value, "residence"); - return (Criteria) this; - } - - public Criteria andResidenceNotLike(String value) { - addCriterion("residence not like", value, "residence"); - return (Criteria) this; - } - - public Criteria andResidenceIn(List values) { - addCriterion("residence in", values, "residence"); - return (Criteria) this; - } - - public Criteria andResidenceNotIn(List values) { - addCriterion("residence not in", values, "residence"); - return (Criteria) this; - } - - public Criteria andResidenceBetween(String value1, String value2) { - addCriterion("residence between", value1, value2, "residence"); - return (Criteria) this; - } - - public Criteria andResidenceNotBetween(String value1, String value2) { - addCriterion("residence not between", value1, value2, "residence"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNull() { - addCriterion("location_id is null"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNotNull() { - addCriterion("location_id is not null"); - return (Criteria) this; - } - - public Criteria andLocationIdEqualTo(String value) { - addCriterion("location_id =", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotEqualTo(String value) { - addCriterion("location_id <>", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThan(String value) { - addCriterion("location_id >", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThanOrEqualTo(String value) { - addCriterion("location_id >=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThan(String value) { - addCriterion("location_id <", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThanOrEqualTo(String value) { - addCriterion("location_id <=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLike(String value) { - addCriterion("location_id like", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotLike(String value) { - addCriterion("location_id not like", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdIn(List values) { - addCriterion("location_id in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotIn(List values) { - addCriterion("location_id not in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdBetween(String value1, String value2) { - addCriterion("location_id between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotBetween(String value1, String value2) { - addCriterion("location_id not between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andClientTypeIsNull() { - addCriterion("client_type is null"); - return (Criteria) this; - } - - public Criteria andClientTypeIsNotNull() { - addCriterion("client_type is not null"); - return (Criteria) this; - } - - public Criteria andClientTypeEqualTo(String value) { - addCriterion("client_type =", value, "clientType"); - return (Criteria) this; - } - - public Criteria andClientTypeNotEqualTo(String value) { - addCriterion("client_type <>", value, "clientType"); - return (Criteria) this; - } - - public Criteria andClientTypeGreaterThan(String value) { - addCriterion("client_type >", value, "clientType"); - return (Criteria) this; - } - - public Criteria andClientTypeGreaterThanOrEqualTo(String value) { - addCriterion("client_type >=", value, "clientType"); - return (Criteria) this; - } - - public Criteria andClientTypeLessThan(String value) { - addCriterion("client_type <", value, "clientType"); - return (Criteria) this; - } - - public Criteria andClientTypeLessThanOrEqualTo(String value) { - addCriterion("client_type <=", value, "clientType"); - return (Criteria) this; - } - - public Criteria andClientTypeLike(String value) { - addCriterion("client_type like", value, "clientType"); - return (Criteria) this; - } - - public Criteria andClientTypeNotLike(String value) { - addCriterion("client_type not like", value, "clientType"); - return (Criteria) this; - } - - public Criteria andClientTypeIn(List values) { - addCriterion("client_type in", values, "clientType"); - return (Criteria) this; - } - - public Criteria andClientTypeNotIn(List values) { - addCriterion("client_type not in", values, "clientType"); - return (Criteria) this; - } - - public Criteria andClientTypeBetween(String value1, String value2) { - addCriterion("client_type between", value1, value2, "clientType"); - return (Criteria) this; - } - - public Criteria andClientTypeNotBetween(String value1, String value2) { - addCriterion("client_type not between", value1, value2, "clientType"); - return (Criteria) this; - } - - public Criteria andDateCreatedIsNull() { - addCriterion("date_created is null"); - return (Criteria) this; - } - - public Criteria andDateCreatedIsNotNull() { - addCriterion("date_created is not null"); - return (Criteria) this; - } - - public Criteria andDateCreatedEqualTo(Date value) { - addCriterion("date_created =", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotEqualTo(Date value) { - addCriterion("date_created <>", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedGreaterThan(Date value) { - addCriterion("date_created >", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { - addCriterion("date_created >=", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedLessThan(Date value) { - addCriterion("date_created <", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedLessThanOrEqualTo(Date value) { - addCriterion("date_created <=", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedIn(List values) { - addCriterion("date_created in", values, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotIn(List values) { - addCriterion("date_created not in", values, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedBetween(Date value1, Date value2) { - addCriterion("date_created between", value1, value2, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotBetween(Date value1, Date value2) { - addCriterion("date_created not between", value1, value2, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNull() { - addCriterion("date_edited is null"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNotNull() { - addCriterion("date_edited is not null"); - return (Criteria) this; - } - - public Criteria andDateEditedEqualTo(Date value) { - addCriterion("date_edited =", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotEqualTo(Date value) { - addCriterion("date_edited <>", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThan(Date value) { - addCriterion("date_edited >", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { - addCriterion("date_edited >=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThan(Date value) { - addCriterion("date_edited <", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThanOrEqualTo(Date value) { - addCriterion("date_edited <=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedIn(List values) { - addCriterion("date_edited in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotIn(List values) { - addCriterion("date_edited not in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedBetween(Date value1, Date value2) { - addCriterion("date_edited between", value1, value2, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotBetween(Date value1, Date value2) { - addCriterion("date_edited not between", value1, value2, "dateEdited"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.client_metadata - * - * @mbg.generated do_not_delete_during_merge Wed Sep 30 15:22:34 EAT 2020 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public ClientMetadataExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + protected void addCriterionForJDBCDate(String condition, Date value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + addCriterion(condition, new java.sql.Date(value.getTime()), property); + } + + protected void addCriterionForJDBCDate(String condition, List values, String property) { + if (values == null || values.size() == 0) { + throw new RuntimeException("Value list for " + property + " cannot be null or empty"); + } + List dateList = new ArrayList<>(); + Iterator iter = values.iterator(); + while (iter.hasNext()) { + dateList.add(new java.sql.Date(iter.next().getTime())); + } + addCriterion(condition, dateList, property); + } + + protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andClientIdIsNull() { + addCriterion("client_id is null"); + return (Criteria) this; + } + + public Criteria andClientIdIsNotNull() { + addCriterion("client_id is not null"); + return (Criteria) this; + } + + public Criteria andClientIdEqualTo(Long value) { + addCriterion("client_id =", value, "clientId"); + return (Criteria) this; + } + + public Criteria andClientIdNotEqualTo(Long value) { + addCriterion("client_id <>", value, "clientId"); + return (Criteria) this; + } + + public Criteria andClientIdGreaterThan(Long value) { + addCriterion("client_id >", value, "clientId"); + return (Criteria) this; + } + + public Criteria andClientIdGreaterThanOrEqualTo(Long value) { + addCriterion("client_id >=", value, "clientId"); + return (Criteria) this; + } + + public Criteria andClientIdLessThan(Long value) { + addCriterion("client_id <", value, "clientId"); + return (Criteria) this; + } + + public Criteria andClientIdLessThanOrEqualTo(Long value) { + addCriterion("client_id <=", value, "clientId"); + return (Criteria) this; + } + + public Criteria andClientIdIn(List values) { + addCriterion("client_id in", values, "clientId"); + return (Criteria) this; + } + + public Criteria andClientIdNotIn(List values) { + addCriterion("client_id not in", values, "clientId"); + return (Criteria) this; + } + + public Criteria andClientIdBetween(Long value1, Long value2) { + addCriterion("client_id between", value1, value2, "clientId"); + return (Criteria) this; + } + + public Criteria andClientIdNotBetween(Long value1, Long value2) { + addCriterion("client_id not between", value1, value2, "clientId"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNull() { + addCriterion("document_id is null"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNotNull() { + addCriterion("document_id is not null"); + return (Criteria) this; + } + + public Criteria andDocumentIdEqualTo(String value) { + addCriterion("document_id =", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotEqualTo(String value) { + addCriterion("document_id <>", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThan(String value) { + addCriterion("document_id >", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { + addCriterion("document_id >=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThan(String value) { + addCriterion("document_id <", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThanOrEqualTo(String value) { + addCriterion("document_id <=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLike(String value) { + addCriterion("document_id like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotLike(String value) { + addCriterion("document_id not like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdIn(List values) { + addCriterion("document_id in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotIn(List values) { + addCriterion("document_id not in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdBetween(String value1, String value2) { + addCriterion("document_id between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotBetween(String value1, String value2) { + addCriterion("document_id not between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdIsNull() { + addCriterion("base_entity_id is null"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdIsNotNull() { + addCriterion("base_entity_id is not null"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdEqualTo(String value) { + addCriterion("base_entity_id =", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotEqualTo(String value) { + addCriterion("base_entity_id <>", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdGreaterThan(String value) { + addCriterion("base_entity_id >", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdGreaterThanOrEqualTo(String value) { + addCriterion("base_entity_id >=", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdLessThan(String value) { + addCriterion("base_entity_id <", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdLessThanOrEqualTo(String value) { + addCriterion("base_entity_id <=", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdLike(String value) { + addCriterion("base_entity_id like", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotLike(String value) { + addCriterion("base_entity_id not like", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdIn(List values) { + addCriterion("base_entity_id in", values, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotIn(List values) { + addCriterion("base_entity_id not in", values, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdBetween(String value1, String value2) { + addCriterion("base_entity_id between", value1, value2, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotBetween(String value1, String value2) { + addCriterion("base_entity_id not between", value1, value2, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andRelationalIdIsNull() { + addCriterion("relational_id is null"); + return (Criteria) this; + } + + public Criteria andRelationalIdIsNotNull() { + addCriterion("relational_id is not null"); + return (Criteria) this; + } + + public Criteria andRelationalIdEqualTo(String value) { + addCriterion("relational_id =", value, "relationalId"); + return (Criteria) this; + } + + public Criteria andRelationalIdNotEqualTo(String value) { + addCriterion("relational_id <>", value, "relationalId"); + return (Criteria) this; + } + + public Criteria andRelationalIdGreaterThan(String value) { + addCriterion("relational_id >", value, "relationalId"); + return (Criteria) this; + } + + public Criteria andRelationalIdGreaterThanOrEqualTo(String value) { + addCriterion("relational_id >=", value, "relationalId"); + return (Criteria) this; + } + + public Criteria andRelationalIdLessThan(String value) { + addCriterion("relational_id <", value, "relationalId"); + return (Criteria) this; + } + + public Criteria andRelationalIdLessThanOrEqualTo(String value) { + addCriterion("relational_id <=", value, "relationalId"); + return (Criteria) this; + } + + public Criteria andRelationalIdLike(String value) { + addCriterion("relational_id like", value, "relationalId"); + return (Criteria) this; + } + + public Criteria andRelationalIdNotLike(String value) { + addCriterion("relational_id not like", value, "relationalId"); + return (Criteria) this; + } + + public Criteria andRelationalIdIn(List values) { + addCriterion("relational_id in", values, "relationalId"); + return (Criteria) this; + } + + public Criteria andRelationalIdNotIn(List values) { + addCriterion("relational_id not in", values, "relationalId"); + return (Criteria) this; + } + + public Criteria andRelationalIdBetween(String value1, String value2) { + addCriterion("relational_id between", value1, value2, "relationalId"); + return (Criteria) this; + } + + public Criteria andRelationalIdNotBetween(String value1, String value2) { + addCriterion("relational_id not between", value1, value2, "relationalId"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidIsNull() { + addCriterion("openmrs_uuid is null"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidIsNotNull() { + addCriterion("openmrs_uuid is not null"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidEqualTo(String value) { + addCriterion("openmrs_uuid =", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidNotEqualTo(String value) { + addCriterion("openmrs_uuid <>", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidGreaterThan(String value) { + addCriterion("openmrs_uuid >", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidGreaterThanOrEqualTo(String value) { + addCriterion("openmrs_uuid >=", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidLessThan(String value) { + addCriterion("openmrs_uuid <", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidLessThanOrEqualTo(String value) { + addCriterion("openmrs_uuid <=", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidLike(String value) { + addCriterion("openmrs_uuid like", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidNotLike(String value) { + addCriterion("openmrs_uuid not like", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidIn(List values) { + addCriterion("openmrs_uuid in", values, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidNotIn(List values) { + addCriterion("openmrs_uuid not in", values, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidBetween(String value1, String value2) { + addCriterion("openmrs_uuid between", value1, value2, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidNotBetween(String value1, String value2) { + addCriterion("openmrs_uuid not between", value1, value2, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andUniqueIdIsNull() { + addCriterion("unique_id is null"); + return (Criteria) this; + } + + public Criteria andUniqueIdIsNotNull() { + addCriterion("unique_id is not null"); + return (Criteria) this; + } + + public Criteria andUniqueIdEqualTo(String value) { + addCriterion("unique_id =", value, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdNotEqualTo(String value) { + addCriterion("unique_id <>", value, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdGreaterThan(String value) { + addCriterion("unique_id >", value, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdGreaterThanOrEqualTo(String value) { + addCriterion("unique_id >=", value, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdLessThan(String value) { + addCriterion("unique_id <", value, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdLessThanOrEqualTo(String value) { + addCriterion("unique_id <=", value, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdLike(String value) { + addCriterion("unique_id like", value, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdNotLike(String value) { + addCriterion("unique_id not like", value, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdIn(List values) { + addCriterion("unique_id in", values, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdNotIn(List values) { + addCriterion("unique_id not in", values, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdBetween(String value1, String value2) { + addCriterion("unique_id between", value1, value2, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdNotBetween(String value1, String value2) { + addCriterion("unique_id not between", value1, value2, "uniqueId"); + return (Criteria) this; + } + + public Criteria andFirstNameIsNull() { + addCriterion("first_name is null"); + return (Criteria) this; + } + + public Criteria andFirstNameIsNotNull() { + addCriterion("first_name is not null"); + return (Criteria) this; + } + + public Criteria andFirstNameEqualTo(String value) { + addCriterion("first_name =", value, "firstName"); + return (Criteria) this; + } + + public Criteria andFirstNameNotEqualTo(String value) { + addCriterion("first_name <>", value, "firstName"); + return (Criteria) this; + } + + public Criteria andFirstNameGreaterThan(String value) { + addCriterion("first_name >", value, "firstName"); + return (Criteria) this; + } + + public Criteria andFirstNameGreaterThanOrEqualTo(String value) { + addCriterion("first_name >=", value, "firstName"); + return (Criteria) this; + } + + public Criteria andFirstNameLessThan(String value) { + addCriterion("first_name <", value, "firstName"); + return (Criteria) this; + } + + public Criteria andFirstNameLessThanOrEqualTo(String value) { + addCriterion("first_name <=", value, "firstName"); + return (Criteria) this; + } + + public Criteria andFirstNameLike(String value) { + addCriterion("first_name like", value, "firstName"); + return (Criteria) this; + } + + public Criteria andFirstNameNotLike(String value) { + addCriterion("first_name not like", value, "firstName"); + return (Criteria) this; + } + + public Criteria andFirstNameIn(List values) { + addCriterion("first_name in", values, "firstName"); + return (Criteria) this; + } + + public Criteria andFirstNameNotIn(List values) { + addCriterion("first_name not in", values, "firstName"); + return (Criteria) this; + } + + public Criteria andFirstNameBetween(String value1, String value2) { + addCriterion("first_name between", value1, value2, "firstName"); + return (Criteria) this; + } + + public Criteria andFirstNameNotBetween(String value1, String value2) { + addCriterion("first_name not between", value1, value2, "firstName"); + return (Criteria) this; + } + + public Criteria andMiddleNameIsNull() { + addCriterion("middle_name is null"); + return (Criteria) this; + } + + public Criteria andMiddleNameIsNotNull() { + addCriterion("middle_name is not null"); + return (Criteria) this; + } + + public Criteria andMiddleNameEqualTo(String value) { + addCriterion("middle_name =", value, "middleName"); + return (Criteria) this; + } + + public Criteria andMiddleNameNotEqualTo(String value) { + addCriterion("middle_name <>", value, "middleName"); + return (Criteria) this; + } + + public Criteria andMiddleNameGreaterThan(String value) { + addCriterion("middle_name >", value, "middleName"); + return (Criteria) this; + } + + public Criteria andMiddleNameGreaterThanOrEqualTo(String value) { + addCriterion("middle_name >=", value, "middleName"); + return (Criteria) this; + } + + public Criteria andMiddleNameLessThan(String value) { + addCriterion("middle_name <", value, "middleName"); + return (Criteria) this; + } + + public Criteria andMiddleNameLessThanOrEqualTo(String value) { + addCriterion("middle_name <=", value, "middleName"); + return (Criteria) this; + } + + public Criteria andMiddleNameLike(String value) { + addCriterion("middle_name like", value, "middleName"); + return (Criteria) this; + } + + public Criteria andMiddleNameNotLike(String value) { + addCriterion("middle_name not like", value, "middleName"); + return (Criteria) this; + } + + public Criteria andMiddleNameIn(List values) { + addCriterion("middle_name in", values, "middleName"); + return (Criteria) this; + } + + public Criteria andMiddleNameNotIn(List values) { + addCriterion("middle_name not in", values, "middleName"); + return (Criteria) this; + } + + public Criteria andMiddleNameBetween(String value1, String value2) { + addCriterion("middle_name between", value1, value2, "middleName"); + return (Criteria) this; + } + + public Criteria andMiddleNameNotBetween(String value1, String value2) { + addCriterion("middle_name not between", value1, value2, "middleName"); + return (Criteria) this; + } + + public Criteria andLastNameIsNull() { + addCriterion("last_name is null"); + return (Criteria) this; + } + + public Criteria andLastNameIsNotNull() { + addCriterion("last_name is not null"); + return (Criteria) this; + } + + public Criteria andLastNameEqualTo(String value) { + addCriterion("last_name =", value, "lastName"); + return (Criteria) this; + } + + public Criteria andLastNameNotEqualTo(String value) { + addCriterion("last_name <>", value, "lastName"); + return (Criteria) this; + } + + public Criteria andLastNameGreaterThan(String value) { + addCriterion("last_name >", value, "lastName"); + return (Criteria) this; + } + + public Criteria andLastNameGreaterThanOrEqualTo(String value) { + addCriterion("last_name >=", value, "lastName"); + return (Criteria) this; + } + + public Criteria andLastNameLessThan(String value) { + addCriterion("last_name <", value, "lastName"); + return (Criteria) this; + } + + public Criteria andLastNameLessThanOrEqualTo(String value) { + addCriterion("last_name <=", value, "lastName"); + return (Criteria) this; + } + + public Criteria andLastNameLike(String value) { + addCriterion("last_name like", value, "lastName"); + return (Criteria) this; + } + + public Criteria andLastNameNotLike(String value) { + addCriterion("last_name not like", value, "lastName"); + return (Criteria) this; + } + + public Criteria andLastNameIn(List values) { + addCriterion("last_name in", values, "lastName"); + return (Criteria) this; + } + + public Criteria andLastNameNotIn(List values) { + addCriterion("last_name not in", values, "lastName"); + return (Criteria) this; + } + + public Criteria andLastNameBetween(String value1, String value2) { + addCriterion("last_name between", value1, value2, "lastName"); + return (Criteria) this; + } + + public Criteria andLastNameNotBetween(String value1, String value2) { + addCriterion("last_name not between", value1, value2, "lastName"); + return (Criteria) this; + } + + public Criteria andBirthDateIsNull() { + addCriterion("birth_date is null"); + return (Criteria) this; + } + + public Criteria andBirthDateIsNotNull() { + addCriterion("birth_date is not null"); + return (Criteria) this; + } + + public Criteria andBirthDateEqualTo(Date value) { + addCriterionForJDBCDate("birth_date =", value, "birthDate"); + return (Criteria) this; + } + + public Criteria andBirthDateNotEqualTo(Date value) { + addCriterionForJDBCDate("birth_date <>", value, "birthDate"); + return (Criteria) this; + } + + public Criteria andBirthDateGreaterThan(Date value) { + addCriterionForJDBCDate("birth_date >", value, "birthDate"); + return (Criteria) this; + } + + public Criteria andBirthDateGreaterThanOrEqualTo(Date value) { + addCriterionForJDBCDate("birth_date >=", value, "birthDate"); + return (Criteria) this; + } + + public Criteria andBirthDateLessThan(Date value) { + addCriterionForJDBCDate("birth_date <", value, "birthDate"); + return (Criteria) this; + } + + public Criteria andBirthDateLessThanOrEqualTo(Date value) { + addCriterionForJDBCDate("birth_date <=", value, "birthDate"); + return (Criteria) this; + } + + public Criteria andBirthDateIn(List values) { + addCriterionForJDBCDate("birth_date in", values, "birthDate"); + return (Criteria) this; + } + + public Criteria andBirthDateNotIn(List values) { + addCriterionForJDBCDate("birth_date not in", values, "birthDate"); + return (Criteria) this; + } + + public Criteria andBirthDateBetween(Date value1, Date value2) { + addCriterionForJDBCDate("birth_date between", value1, value2, "birthDate"); + return (Criteria) this; + } + + public Criteria andBirthDateNotBetween(Date value1, Date value2) { + addCriterionForJDBCDate("birth_date not between", value1, value2, "birthDate"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNull() { + addCriterion("date_deleted is null"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNotNull() { + addCriterion("date_deleted is not null"); + return (Criteria) this; + } + + public Criteria andDateDeletedEqualTo(Date value) { + addCriterion("date_deleted =", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotEqualTo(Date value) { + addCriterion("date_deleted <>", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThan(Date value) { + addCriterion("date_deleted >", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { + addCriterion("date_deleted >=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThan(Date value) { + addCriterion("date_deleted <", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThanOrEqualTo(Date value) { + addCriterion("date_deleted <=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedIn(List values) { + addCriterion("date_deleted in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotIn(List values) { + addCriterion("date_deleted not in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedBetween(Date value1, Date value2) { + addCriterion("date_deleted between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotBetween(Date value1, Date value2) { + addCriterion("date_deleted not between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andResidenceIsNull() { + addCriterion("residence is null"); + return (Criteria) this; + } + + public Criteria andResidenceIsNotNull() { + addCriterion("residence is not null"); + return (Criteria) this; + } + + public Criteria andResidenceEqualTo(String value) { + addCriterion("residence =", value, "residence"); + return (Criteria) this; + } + + public Criteria andResidenceNotEqualTo(String value) { + addCriterion("residence <>", value, "residence"); + return (Criteria) this; + } + + public Criteria andResidenceGreaterThan(String value) { + addCriterion("residence >", value, "residence"); + return (Criteria) this; + } + + public Criteria andResidenceGreaterThanOrEqualTo(String value) { + addCriterion("residence >=", value, "residence"); + return (Criteria) this; + } + + public Criteria andResidenceLessThan(String value) { + addCriterion("residence <", value, "residence"); + return (Criteria) this; + } + + public Criteria andResidenceLessThanOrEqualTo(String value) { + addCriterion("residence <=", value, "residence"); + return (Criteria) this; + } + + public Criteria andResidenceLike(String value) { + addCriterion("residence like", value, "residence"); + return (Criteria) this; + } + + public Criteria andResidenceNotLike(String value) { + addCriterion("residence not like", value, "residence"); + return (Criteria) this; + } + + public Criteria andResidenceIn(List values) { + addCriterion("residence in", values, "residence"); + return (Criteria) this; + } + + public Criteria andResidenceNotIn(List values) { + addCriterion("residence not in", values, "residence"); + return (Criteria) this; + } + + public Criteria andResidenceBetween(String value1, String value2) { + addCriterion("residence between", value1, value2, "residence"); + return (Criteria) this; + } + + public Criteria andResidenceNotBetween(String value1, String value2) { + addCriterion("residence not between", value1, value2, "residence"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNull() { + addCriterion("location_id is null"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNotNull() { + addCriterion("location_id is not null"); + return (Criteria) this; + } + + public Criteria andLocationIdEqualTo(String value) { + addCriterion("location_id =", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotEqualTo(String value) { + addCriterion("location_id <>", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThan(String value) { + addCriterion("location_id >", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThanOrEqualTo(String value) { + addCriterion("location_id >=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThan(String value) { + addCriterion("location_id <", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThanOrEqualTo(String value) { + addCriterion("location_id <=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLike(String value) { + addCriterion("location_id like", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotLike(String value) { + addCriterion("location_id not like", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdIn(List values) { + addCriterion("location_id in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotIn(List values) { + addCriterion("location_id not in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdBetween(String value1, String value2) { + addCriterion("location_id between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotBetween(String value1, String value2) { + addCriterion("location_id not between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andClientTypeIsNull() { + addCriterion("client_type is null"); + return (Criteria) this; + } + + public Criteria andClientTypeIsNotNull() { + addCriterion("client_type is not null"); + return (Criteria) this; + } + + public Criteria andClientTypeEqualTo(String value) { + addCriterion("client_type =", value, "clientType"); + return (Criteria) this; + } + + public Criteria andClientTypeNotEqualTo(String value) { + addCriterion("client_type <>", value, "clientType"); + return (Criteria) this; + } + + public Criteria andClientTypeGreaterThan(String value) { + addCriterion("client_type >", value, "clientType"); + return (Criteria) this; + } + + public Criteria andClientTypeGreaterThanOrEqualTo(String value) { + addCriterion("client_type >=", value, "clientType"); + return (Criteria) this; + } + + public Criteria andClientTypeLessThan(String value) { + addCriterion("client_type <", value, "clientType"); + return (Criteria) this; + } + + public Criteria andClientTypeLessThanOrEqualTo(String value) { + addCriterion("client_type <=", value, "clientType"); + return (Criteria) this; + } + + public Criteria andClientTypeLike(String value) { + addCriterion("client_type like", value, "clientType"); + return (Criteria) this; + } + + public Criteria andClientTypeNotLike(String value) { + addCriterion("client_type not like", value, "clientType"); + return (Criteria) this; + } + + public Criteria andClientTypeIn(List values) { + addCriterion("client_type in", values, "clientType"); + return (Criteria) this; + } + + public Criteria andClientTypeNotIn(List values) { + addCriterion("client_type not in", values, "clientType"); + return (Criteria) this; + } + + public Criteria andClientTypeBetween(String value1, String value2) { + addCriterion("client_type between", value1, value2, "clientType"); + return (Criteria) this; + } + + public Criteria andClientTypeNotBetween(String value1, String value2) { + addCriterion("client_type not between", value1, value2, "clientType"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNull() { + addCriterion("date_created is null"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNotNull() { + addCriterion("date_created is not null"); + return (Criteria) this; + } + + public Criteria andDateCreatedEqualTo(Date value) { + addCriterion("date_created =", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotEqualTo(Date value) { + addCriterion("date_created <>", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThan(Date value) { + addCriterion("date_created >", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { + addCriterion("date_created >=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThan(Date value) { + addCriterion("date_created <", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThanOrEqualTo(Date value) { + addCriterion("date_created <=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedIn(List values) { + addCriterion("date_created in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotIn(List values) { + addCriterion("date_created not in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedBetween(Date value1, Date value2) { + addCriterion("date_created between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotBetween(Date value1, Date value2) { + addCriterion("date_created not between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNull() { + addCriterion("date_edited is null"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNotNull() { + addCriterion("date_edited is not null"); + return (Criteria) this; + } + + public Criteria andDateEditedEqualTo(Date value) { + addCriterion("date_edited =", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotEqualTo(Date value) { + addCriterion("date_edited <>", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThan(Date value) { + addCriterion("date_edited >", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { + addCriterion("date_edited >=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThan(Date value) { + addCriterion("date_edited <", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThanOrEqualTo(Date value) { + addCriterion("date_edited <=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedIn(List values) { + addCriterion("date_edited in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotIn(List values) { + addCriterion("date_edited not in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedBetween(Date value1, Date value2) { + addCriterion("date_edited between", value1, value2, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotBetween(Date value1, Date value2) { + addCriterion("date_edited not between", value1, value2, "dateEdited"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.client_metadata + * + * @mbg.generated do_not_delete_during_merge Wed Sep 30 15:22:34 EAT 2020 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ClientMigrationFile.java b/src/main/java/org/opensrp/domain/postgres/ClientMigrationFile.java index ed29f94c1..ee982d0d0 100644 --- a/src/main/java/org/opensrp/domain/postgres/ClientMigrationFile.java +++ b/src/main/java/org/opensrp/domain/postgres/ClientMigrationFile.java @@ -4,7 +4,6 @@ public class ClientMigrationFile { /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.client_migration_file.id * @@ -13,7 +12,6 @@ public class ClientMigrationFile { private Long id; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.client_migration_file.identifier * @@ -22,7 +20,6 @@ public class ClientMigrationFile { private String identifier; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.client_migration_file.filename * @@ -31,7 +28,6 @@ public class ClientMigrationFile { private String filename; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.client_migration_file.on_object_storage * @@ -40,7 +36,6 @@ public class ClientMigrationFile { private Boolean onObjectStorage; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.client_migration_file.object_storage_path * @@ -49,7 +44,6 @@ public class ClientMigrationFile { private String objectStoragePath; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.client_migration_file.jurisdiction * @@ -58,7 +52,6 @@ public class ClientMigrationFile { private String jurisdiction; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.client_migration_file.version * @@ -67,7 +60,6 @@ public class ClientMigrationFile { private Integer version; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.client_migration_file.manifest_id * @@ -76,7 +68,6 @@ public class ClientMigrationFile { private Integer manifestId; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.client_migration_file.file_contents * @@ -85,7 +76,6 @@ public class ClientMigrationFile { private String fileContents; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.client_migration_file.created_at * @@ -98,7 +88,6 @@ public class ClientMigrationFile { * This method returns the value of the database column core.client_migration_file.id * * @return the value of core.client_migration_file.id - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public Long getId() { @@ -110,7 +99,6 @@ public Long getId() { * This method sets the value of the database column core.client_migration_file.id * * @param id the value for core.client_migration_file.id - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public void setId(Long id) { @@ -122,7 +110,6 @@ public void setId(Long id) { * This method returns the value of the database column core.client_migration_file.identifier * * @return the value of core.client_migration_file.identifier - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public String getIdentifier() { @@ -134,7 +121,6 @@ public String getIdentifier() { * This method sets the value of the database column core.client_migration_file.identifier * * @param identifier the value for core.client_migration_file.identifier - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public void setIdentifier(String identifier) { @@ -146,7 +132,6 @@ public void setIdentifier(String identifier) { * This method returns the value of the database column core.client_migration_file.filename * * @return the value of core.client_migration_file.filename - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public String getFilename() { @@ -158,7 +143,6 @@ public String getFilename() { * This method sets the value of the database column core.client_migration_file.filename * * @param filename the value for core.client_migration_file.filename - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public void setFilename(String filename) { @@ -170,7 +154,6 @@ public void setFilename(String filename) { * This method returns the value of the database column core.client_migration_file.on_object_storage * * @return the value of core.client_migration_file.on_object_storage - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public Boolean getOnObjectStorage() { @@ -182,7 +165,6 @@ public Boolean getOnObjectStorage() { * This method sets the value of the database column core.client_migration_file.on_object_storage * * @param onObjectStorage the value for core.client_migration_file.on_object_storage - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public void setOnObjectStorage(Boolean onObjectStorage) { @@ -194,7 +176,6 @@ public void setOnObjectStorage(Boolean onObjectStorage) { * This method returns the value of the database column core.client_migration_file.object_storage_path * * @return the value of core.client_migration_file.object_storage_path - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public String getObjectStoragePath() { @@ -206,7 +187,6 @@ public String getObjectStoragePath() { * This method sets the value of the database column core.client_migration_file.object_storage_path * * @param objectStoragePath the value for core.client_migration_file.object_storage_path - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public void setObjectStoragePath(String objectStoragePath) { @@ -218,7 +198,6 @@ public void setObjectStoragePath(String objectStoragePath) { * This method returns the value of the database column core.client_migration_file.jurisdiction * * @return the value of core.client_migration_file.jurisdiction - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public String getJurisdiction() { @@ -230,7 +209,6 @@ public String getJurisdiction() { * This method sets the value of the database column core.client_migration_file.jurisdiction * * @param jurisdiction the value for core.client_migration_file.jurisdiction - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public void setJurisdiction(String jurisdiction) { @@ -242,7 +220,6 @@ public void setJurisdiction(String jurisdiction) { * This method returns the value of the database column core.client_migration_file.version * * @return the value of core.client_migration_file.version - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public Integer getVersion() { @@ -254,7 +231,6 @@ public Integer getVersion() { * This method sets the value of the database column core.client_migration_file.version * * @param version the value for core.client_migration_file.version - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public void setVersion(Integer version) { @@ -266,7 +242,6 @@ public void setVersion(Integer version) { * This method returns the value of the database column core.client_migration_file.manifest_id * * @return the value of core.client_migration_file.manifest_id - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public Integer getManifestId() { @@ -278,7 +253,6 @@ public Integer getManifestId() { * This method sets the value of the database column core.client_migration_file.manifest_id * * @param manifestId the value for core.client_migration_file.manifest_id - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public void setManifestId(Integer manifestId) { @@ -290,7 +264,6 @@ public void setManifestId(Integer manifestId) { * This method returns the value of the database column core.client_migration_file.file_contents * * @return the value of core.client_migration_file.file_contents - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public String getFileContents() { @@ -302,7 +275,6 @@ public String getFileContents() { * This method sets the value of the database column core.client_migration_file.file_contents * * @param fileContents the value for core.client_migration_file.file_contents - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public void setFileContents(String fileContents) { @@ -314,7 +286,6 @@ public void setFileContents(String fileContents) { * This method returns the value of the database column core.client_migration_file.created_at * * @return the value of core.client_migration_file.created_at - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public Date getCreatedAt() { @@ -326,7 +297,6 @@ public Date getCreatedAt() { * This method sets the value of the database column core.client_migration_file.created_at * * @param createdAt the value for core.client_migration_file.created_at - * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ public void setCreatedAt(Date createdAt) { diff --git a/src/main/java/org/opensrp/domain/postgres/ClientMigrationFileExample.java b/src/main/java/org/opensrp/domain/postgres/ClientMigrationFileExample.java index 47f68718a..ef1198929 100644 --- a/src/main/java/org/opensrp/domain/postgres/ClientMigrationFileExample.java +++ b/src/main/java/org/opensrp/domain/postgres/ClientMigrationFileExample.java @@ -45,8 +45,8 @@ public ClientMigrationFileExample() { * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; + public String getOrderByClause() { + return orderByClause; } /** @@ -55,8 +55,8 @@ public void setOrderByClause(String orderByClause) { * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ - public String getOrderByClause() { - return orderByClause; + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; } /** @@ -65,8 +65,8 @@ public String getOrderByClause() { * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; + public boolean isDistinct() { + return distinct; } /** @@ -75,8 +75,8 @@ public void setDistinct(boolean distinct) { * * @mbg.generated Mon Feb 08 12:11:26 EAT 2021 */ - public boolean isDistinct() { - return distinct; + public void setDistinct(boolean distinct) { + this.distinct = distinct; } /** @@ -882,38 +882,6 @@ public static class Criterion { private String typeHandler; - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - protected Criterion(String condition) { super(); this.condition = condition; @@ -949,5 +917,37 @@ protected Criterion(String condition, Object value, Object secondValue, String t protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } } } diff --git a/src/main/java/org/opensrp/domain/postgres/CustomClient.java b/src/main/java/org/opensrp/domain/postgres/CustomClient.java index 66bb4023e..a6fa5fac6 100644 --- a/src/main/java/org/opensrp/domain/postgres/CustomClient.java +++ b/src/main/java/org/opensrp/domain/postgres/CustomClient.java @@ -3,15 +3,15 @@ import java.util.Map; public class CustomClient extends Client { - - private Map dynamicProperties; - - public Map getDynamicProperties() { - return dynamicProperties; - } - - public void setDynamicProperties(Map dynamicProperties) { - this.dynamicProperties = dynamicProperties; - } - + + private Map dynamicProperties; + + public Map getDynamicProperties() { + return dynamicProperties; + } + + public void setDynamicProperties(Map dynamicProperties) { + this.dynamicProperties = dynamicProperties; + } + } diff --git a/src/main/java/org/opensrp/domain/postgres/DateRange.java b/src/main/java/org/opensrp/domain/postgres/DateRange.java index 3a54f7fce..bdbd7439d 100644 --- a/src/main/java/org/opensrp/domain/postgres/DateRange.java +++ b/src/main/java/org/opensrp/domain/postgres/DateRange.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.domain.postgres; @@ -14,8 +14,8 @@ @Data @AllArgsConstructor public class DateRange { - - private Date fromdate; - - private Date toDate; + + private Date fromdate; + + private Date toDate; } diff --git a/src/main/java/org/opensrp/domain/postgres/ErrorTrace.java b/src/main/java/org/opensrp/domain/postgres/ErrorTrace.java index 0715f3cdf..070bdf65a 100644 --- a/src/main/java/org/opensrp/domain/postgres/ErrorTrace.java +++ b/src/main/java/org/opensrp/domain/postgres/ErrorTrace.java @@ -3,334 +3,334 @@ import java.util.Date; public class ErrorTrace { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * error.error_trace.id - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * error.error_trace.document_id - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - private String documentId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * error.error_trace.date_occurred - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - private Date dateOccurred; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * error.error_trace.error_type - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - private String errorType; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * error.error_trace.occurred_at - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - private String occurredAt; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * error.error_trace.stack_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - private String stackTrace; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * error.error_trace.status - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - private String status; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * error.error_trace.record_id - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - private String recordId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * error.error_trace.date_closed - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - private Date dateClosed; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * error.error_trace.document_type - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - private String documentType; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * error.error_trace.retry_url - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - private String retryUrl; - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column error.error_trace.id - * - * @return the value of error.error_trace.id - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column error.error_trace.id - * - * @param id the value for error.error_trace.id - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column error.error_trace.document_id - * - * @return the value of error.error_trace.document_id - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public String getDocumentId() { - return documentId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column error.error_trace.document_id - * - * @param documentId the value for error.error_trace.document_id - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public void setDocumentId(String documentId) { - this.documentId = documentId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column error.error_trace.date_occurred - * - * @return the value of error.error_trace.date_occurred - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public Date getDateOccurred() { - return dateOccurred; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column error.error_trace.date_occurred - * - * @param dateOccurred the value for error.error_trace.date_occurred - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public void setDateOccurred(Date dateOccurred) { - this.dateOccurred = dateOccurred; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column error.error_trace.error_type - * - * @return the value of error.error_trace.error_type - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public String getErrorType() { - return errorType; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column error.error_trace.error_type - * - * @param errorType the value for error.error_trace.error_type - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public void setErrorType(String errorType) { - this.errorType = errorType; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column error.error_trace.occurred_at - * - * @return the value of error.error_trace.occurred_at - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public String getOccurredAt() { - return occurredAt; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column error.error_trace.occurred_at - * - * @param occurredAt the value for error.error_trace.occurred_at - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public void setOccurredAt(String occurredAt) { - this.occurredAt = occurredAt; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column error.error_trace.stack_trace - * - * @return the value of error.error_trace.stack_trace - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public String getStackTrace() { - return stackTrace; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column error.error_trace.stack_trace - * - * @param stackTrace the value for error.error_trace.stack_trace - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public void setStackTrace(String stackTrace) { - this.stackTrace = stackTrace; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column error.error_trace.status - * - * @return the value of error.error_trace.status - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public String getStatus() { - return status; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column error.error_trace.status - * - * @param status the value for error.error_trace.status - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public void setStatus(String status) { - this.status = status; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column error.error_trace.record_id - * - * @return the value of error.error_trace.record_id - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public String getRecordId() { - return recordId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column error.error_trace.record_id - * - * @param recordId the value for error.error_trace.record_id - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public void setRecordId(String recordId) { - this.recordId = recordId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column error.error_trace.date_closed - * - * @return the value of error.error_trace.date_closed - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public Date getDateClosed() { - return dateClosed; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column error.error_trace.date_closed - * - * @param dateClosed the value for error.error_trace.date_closed - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public void setDateClosed(Date dateClosed) { - this.dateClosed = dateClosed; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column error.error_trace.document_type - * - * @return the value of error.error_trace.document_type - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public String getDocumentType() { - return documentType; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column error.error_trace.document_type - * - * @param documentType the value for error.error_trace.document_type - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public void setDocumentType(String documentType) { - this.documentType = documentType; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column error.error_trace.retry_url - * - * @return the value of error.error_trace.retry_url - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public String getRetryUrl() { - return retryUrl; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column error.error_trace.retry_url - * - * @param retryUrl the value for error.error_trace.retry_url - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public void setRetryUrl(String retryUrl) { - this.retryUrl = retryUrl; - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * error.error_trace.id + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * error.error_trace.document_id + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + private String documentId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * error.error_trace.date_occurred + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + private Date dateOccurred; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * error.error_trace.error_type + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + private String errorType; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * error.error_trace.occurred_at + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + private String occurredAt; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * error.error_trace.stack_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + private String stackTrace; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * error.error_trace.status + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + private String status; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * error.error_trace.record_id + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + private String recordId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * error.error_trace.date_closed + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + private Date dateClosed; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * error.error_trace.document_type + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + private String documentType; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * error.error_trace.retry_url + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + private String retryUrl; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column error.error_trace.id + * + * @return the value of error.error_trace.id + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column error.error_trace.id + * + * @param id the value for error.error_trace.id + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column error.error_trace.document_id + * + * @return the value of error.error_trace.document_id + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public String getDocumentId() { + return documentId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column error.error_trace.document_id + * + * @param documentId the value for error.error_trace.document_id + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public void setDocumentId(String documentId) { + this.documentId = documentId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column error.error_trace.date_occurred + * + * @return the value of error.error_trace.date_occurred + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public Date getDateOccurred() { + return dateOccurred; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column error.error_trace.date_occurred + * + * @param dateOccurred the value for error.error_trace.date_occurred + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public void setDateOccurred(Date dateOccurred) { + this.dateOccurred = dateOccurred; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column error.error_trace.error_type + * + * @return the value of error.error_trace.error_type + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public String getErrorType() { + return errorType; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column error.error_trace.error_type + * + * @param errorType the value for error.error_trace.error_type + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public void setErrorType(String errorType) { + this.errorType = errorType; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column error.error_trace.occurred_at + * + * @return the value of error.error_trace.occurred_at + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public String getOccurredAt() { + return occurredAt; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column error.error_trace.occurred_at + * + * @param occurredAt the value for error.error_trace.occurred_at + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public void setOccurredAt(String occurredAt) { + this.occurredAt = occurredAt; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column error.error_trace.stack_trace + * + * @return the value of error.error_trace.stack_trace + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public String getStackTrace() { + return stackTrace; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column error.error_trace.stack_trace + * + * @param stackTrace the value for error.error_trace.stack_trace + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public void setStackTrace(String stackTrace) { + this.stackTrace = stackTrace; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column error.error_trace.status + * + * @return the value of error.error_trace.status + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public String getStatus() { + return status; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column error.error_trace.status + * + * @param status the value for error.error_trace.status + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public void setStatus(String status) { + this.status = status; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column error.error_trace.record_id + * + * @return the value of error.error_trace.record_id + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public String getRecordId() { + return recordId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column error.error_trace.record_id + * + * @param recordId the value for error.error_trace.record_id + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public void setRecordId(String recordId) { + this.recordId = recordId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column error.error_trace.date_closed + * + * @return the value of error.error_trace.date_closed + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public Date getDateClosed() { + return dateClosed; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column error.error_trace.date_closed + * + * @param dateClosed the value for error.error_trace.date_closed + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public void setDateClosed(Date dateClosed) { + this.dateClosed = dateClosed; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column error.error_trace.document_type + * + * @return the value of error.error_trace.document_type + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public String getDocumentType() { + return documentType; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column error.error_trace.document_type + * + * @param documentType the value for error.error_trace.document_type + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public void setDocumentType(String documentType) { + this.documentType = documentType; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column error.error_trace.retry_url + * + * @return the value of error.error_trace.retry_url + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public String getRetryUrl() { + return retryUrl; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column error.error_trace.retry_url + * + * @param retryUrl the value for error.error_trace.retry_url + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public void setRetryUrl(String retryUrl) { + this.retryUrl = retryUrl; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ErrorTraceExample.java b/src/main/java/org/opensrp/domain/postgres/ErrorTraceExample.java index 940641f12..f1e9aa01b 100644 --- a/src/main/java/org/opensrp/domain/postgres/ErrorTraceExample.java +++ b/src/main/java/org/opensrp/domain/postgres/ErrorTraceExample.java @@ -5,1042 +5,1042 @@ import java.util.List; public class ErrorTraceExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public ErrorTraceExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNull() { - addCriterion("document_id is null"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNotNull() { - addCriterion("document_id is not null"); - return (Criteria) this; - } - - public Criteria andDocumentIdEqualTo(String value) { - addCriterion("document_id =", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotEqualTo(String value) { - addCriterion("document_id <>", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThan(String value) { - addCriterion("document_id >", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { - addCriterion("document_id >=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThan(String value) { - addCriterion("document_id <", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThanOrEqualTo(String value) { - addCriterion("document_id <=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLike(String value) { - addCriterion("document_id like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotLike(String value) { - addCriterion("document_id not like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdIn(List values) { - addCriterion("document_id in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotIn(List values) { - addCriterion("document_id not in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdBetween(String value1, String value2) { - addCriterion("document_id between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotBetween(String value1, String value2) { - addCriterion("document_id not between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andDateOccurredIsNull() { - addCriterion("date_occurred is null"); - return (Criteria) this; - } - - public Criteria andDateOccurredIsNotNull() { - addCriterion("date_occurred is not null"); - return (Criteria) this; - } - - public Criteria andDateOccurredEqualTo(Date value) { - addCriterion("date_occurred =", value, "dateOccurred"); - return (Criteria) this; - } - - public Criteria andDateOccurredNotEqualTo(Date value) { - addCriterion("date_occurred <>", value, "dateOccurred"); - return (Criteria) this; - } - - public Criteria andDateOccurredGreaterThan(Date value) { - addCriterion("date_occurred >", value, "dateOccurred"); - return (Criteria) this; - } - - public Criteria andDateOccurredGreaterThanOrEqualTo(Date value) { - addCriterion("date_occurred >=", value, "dateOccurred"); - return (Criteria) this; - } - - public Criteria andDateOccurredLessThan(Date value) { - addCriterion("date_occurred <", value, "dateOccurred"); - return (Criteria) this; - } - - public Criteria andDateOccurredLessThanOrEqualTo(Date value) { - addCriterion("date_occurred <=", value, "dateOccurred"); - return (Criteria) this; - } - - public Criteria andDateOccurredIn(List values) { - addCriterion("date_occurred in", values, "dateOccurred"); - return (Criteria) this; - } - - public Criteria andDateOccurredNotIn(List values) { - addCriterion("date_occurred not in", values, "dateOccurred"); - return (Criteria) this; - } - - public Criteria andDateOccurredBetween(Date value1, Date value2) { - addCriterion("date_occurred between", value1, value2, "dateOccurred"); - return (Criteria) this; - } - - public Criteria andDateOccurredNotBetween(Date value1, Date value2) { - addCriterion("date_occurred not between", value1, value2, "dateOccurred"); - return (Criteria) this; - } - - public Criteria andErrorTypeIsNull() { - addCriterion("error_type is null"); - return (Criteria) this; - } - - public Criteria andErrorTypeIsNotNull() { - addCriterion("error_type is not null"); - return (Criteria) this; - } - - public Criteria andErrorTypeEqualTo(String value) { - addCriterion("error_type =", value, "errorType"); - return (Criteria) this; - } - - public Criteria andErrorTypeNotEqualTo(String value) { - addCriterion("error_type <>", value, "errorType"); - return (Criteria) this; - } - - public Criteria andErrorTypeGreaterThan(String value) { - addCriterion("error_type >", value, "errorType"); - return (Criteria) this; - } - - public Criteria andErrorTypeGreaterThanOrEqualTo(String value) { - addCriterion("error_type >=", value, "errorType"); - return (Criteria) this; - } - - public Criteria andErrorTypeLessThan(String value) { - addCriterion("error_type <", value, "errorType"); - return (Criteria) this; - } - - public Criteria andErrorTypeLessThanOrEqualTo(String value) { - addCriterion("error_type <=", value, "errorType"); - return (Criteria) this; - } - - public Criteria andErrorTypeLike(String value) { - addCriterion("error_type like", value, "errorType"); - return (Criteria) this; - } - - public Criteria andErrorTypeNotLike(String value) { - addCriterion("error_type not like", value, "errorType"); - return (Criteria) this; - } - - public Criteria andErrorTypeIn(List values) { - addCriterion("error_type in", values, "errorType"); - return (Criteria) this; - } - - public Criteria andErrorTypeNotIn(List values) { - addCriterion("error_type not in", values, "errorType"); - return (Criteria) this; - } - - public Criteria andErrorTypeBetween(String value1, String value2) { - addCriterion("error_type between", value1, value2, "errorType"); - return (Criteria) this; - } - - public Criteria andErrorTypeNotBetween(String value1, String value2) { - addCriterion("error_type not between", value1, value2, "errorType"); - return (Criteria) this; - } - - public Criteria andOccurredAtIsNull() { - addCriterion("occurred_at is null"); - return (Criteria) this; - } - - public Criteria andOccurredAtIsNotNull() { - addCriterion("occurred_at is not null"); - return (Criteria) this; - } - - public Criteria andOccurredAtEqualTo(String value) { - addCriterion("occurred_at =", value, "occurredAt"); - return (Criteria) this; - } - - public Criteria andOccurredAtNotEqualTo(String value) { - addCriterion("occurred_at <>", value, "occurredAt"); - return (Criteria) this; - } - - public Criteria andOccurredAtGreaterThan(String value) { - addCriterion("occurred_at >", value, "occurredAt"); - return (Criteria) this; - } - - public Criteria andOccurredAtGreaterThanOrEqualTo(String value) { - addCriterion("occurred_at >=", value, "occurredAt"); - return (Criteria) this; - } - - public Criteria andOccurredAtLessThan(String value) { - addCriterion("occurred_at <", value, "occurredAt"); - return (Criteria) this; - } - - public Criteria andOccurredAtLessThanOrEqualTo(String value) { - addCriterion("occurred_at <=", value, "occurredAt"); - return (Criteria) this; - } - - public Criteria andOccurredAtLike(String value) { - addCriterion("occurred_at like", value, "occurredAt"); - return (Criteria) this; - } - - public Criteria andOccurredAtNotLike(String value) { - addCriterion("occurred_at not like", value, "occurredAt"); - return (Criteria) this; - } - - public Criteria andOccurredAtIn(List values) { - addCriterion("occurred_at in", values, "occurredAt"); - return (Criteria) this; - } - - public Criteria andOccurredAtNotIn(List values) { - addCriterion("occurred_at not in", values, "occurredAt"); - return (Criteria) this; - } - - public Criteria andOccurredAtBetween(String value1, String value2) { - addCriterion("occurred_at between", value1, value2, "occurredAt"); - return (Criteria) this; - } - - public Criteria andOccurredAtNotBetween(String value1, String value2) { - addCriterion("occurred_at not between", value1, value2, "occurredAt"); - return (Criteria) this; - } - - public Criteria andStackTraceIsNull() { - addCriterion("stack_trace is null"); - return (Criteria) this; - } - - public Criteria andStackTraceIsNotNull() { - addCriterion("stack_trace is not null"); - return (Criteria) this; - } - - public Criteria andStackTraceEqualTo(String value) { - addCriterion("stack_trace =", value, "stackTrace"); - return (Criteria) this; - } - - public Criteria andStackTraceNotEqualTo(String value) { - addCriterion("stack_trace <>", value, "stackTrace"); - return (Criteria) this; - } - - public Criteria andStackTraceGreaterThan(String value) { - addCriterion("stack_trace >", value, "stackTrace"); - return (Criteria) this; - } - - public Criteria andStackTraceGreaterThanOrEqualTo(String value) { - addCriterion("stack_trace >=", value, "stackTrace"); - return (Criteria) this; - } - - public Criteria andStackTraceLessThan(String value) { - addCriterion("stack_trace <", value, "stackTrace"); - return (Criteria) this; - } - - public Criteria andStackTraceLessThanOrEqualTo(String value) { - addCriterion("stack_trace <=", value, "stackTrace"); - return (Criteria) this; - } - - public Criteria andStackTraceLike(String value) { - addCriterion("stack_trace like", value, "stackTrace"); - return (Criteria) this; - } - - public Criteria andStackTraceNotLike(String value) { - addCriterion("stack_trace not like", value, "stackTrace"); - return (Criteria) this; - } - - public Criteria andStackTraceIn(List values) { - addCriterion("stack_trace in", values, "stackTrace"); - return (Criteria) this; - } - - public Criteria andStackTraceNotIn(List values) { - addCriterion("stack_trace not in", values, "stackTrace"); - return (Criteria) this; - } - - public Criteria andStackTraceBetween(String value1, String value2) { - addCriterion("stack_trace between", value1, value2, "stackTrace"); - return (Criteria) this; - } - - public Criteria andStackTraceNotBetween(String value1, String value2) { - addCriterion("stack_trace not between", value1, value2, "stackTrace"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("status is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(String value) { - addCriterion("status =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(String value) { - addCriterion("status <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(String value) { - addCriterion("status >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(String value) { - addCriterion("status >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(String value) { - addCriterion("status <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(String value) { - addCriterion("status <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLike(String value) { - addCriterion("status like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotLike(String value) { - addCriterion("status not like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(String value1, String value2) { - addCriterion("status between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(String value1, String value2) { - addCriterion("status not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andRecordIdIsNull() { - addCriterion("record_id is null"); - return (Criteria) this; - } - - public Criteria andRecordIdIsNotNull() { - addCriterion("record_id is not null"); - return (Criteria) this; - } - - public Criteria andRecordIdEqualTo(String value) { - addCriterion("record_id =", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdNotEqualTo(String value) { - addCriterion("record_id <>", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdGreaterThan(String value) { - addCriterion("record_id >", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdGreaterThanOrEqualTo(String value) { - addCriterion("record_id >=", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdLessThan(String value) { - addCriterion("record_id <", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdLessThanOrEqualTo(String value) { - addCriterion("record_id <=", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdLike(String value) { - addCriterion("record_id like", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdNotLike(String value) { - addCriterion("record_id not like", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdIn(List values) { - addCriterion("record_id in", values, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdNotIn(List values) { - addCriterion("record_id not in", values, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdBetween(String value1, String value2) { - addCriterion("record_id between", value1, value2, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdNotBetween(String value1, String value2) { - addCriterion("record_id not between", value1, value2, "recordId"); - return (Criteria) this; - } - - public Criteria andDateClosedIsNull() { - addCriterion("date_closed is null"); - return (Criteria) this; - } - - public Criteria andDateClosedIsNotNull() { - addCriterion("date_closed is not null"); - return (Criteria) this; - } - - public Criteria andDateClosedEqualTo(Date value) { - addCriterion("date_closed =", value, "dateClosed"); - return (Criteria) this; - } - - public Criteria andDateClosedNotEqualTo(Date value) { - addCriterion("date_closed <>", value, "dateClosed"); - return (Criteria) this; - } - - public Criteria andDateClosedGreaterThan(Date value) { - addCriterion("date_closed >", value, "dateClosed"); - return (Criteria) this; - } - - public Criteria andDateClosedGreaterThanOrEqualTo(Date value) { - addCriterion("date_closed >=", value, "dateClosed"); - return (Criteria) this; - } - - public Criteria andDateClosedLessThan(Date value) { - addCriterion("date_closed <", value, "dateClosed"); - return (Criteria) this; - } - - public Criteria andDateClosedLessThanOrEqualTo(Date value) { - addCriterion("date_closed <=", value, "dateClosed"); - return (Criteria) this; - } - - public Criteria andDateClosedIn(List values) { - addCriterion("date_closed in", values, "dateClosed"); - return (Criteria) this; - } - - public Criteria andDateClosedNotIn(List values) { - addCriterion("date_closed not in", values, "dateClosed"); - return (Criteria) this; - } - - public Criteria andDateClosedBetween(Date value1, Date value2) { - addCriterion("date_closed between", value1, value2, "dateClosed"); - return (Criteria) this; - } - - public Criteria andDateClosedNotBetween(Date value1, Date value2) { - addCriterion("date_closed not between", value1, value2, "dateClosed"); - return (Criteria) this; - } - - public Criteria andDocumentTypeIsNull() { - addCriterion("document_type is null"); - return (Criteria) this; - } - - public Criteria andDocumentTypeIsNotNull() { - addCriterion("document_type is not null"); - return (Criteria) this; - } - - public Criteria andDocumentTypeEqualTo(String value) { - addCriterion("document_type =", value, "documentType"); - return (Criteria) this; - } - - public Criteria andDocumentTypeNotEqualTo(String value) { - addCriterion("document_type <>", value, "documentType"); - return (Criteria) this; - } - - public Criteria andDocumentTypeGreaterThan(String value) { - addCriterion("document_type >", value, "documentType"); - return (Criteria) this; - } - - public Criteria andDocumentTypeGreaterThanOrEqualTo(String value) { - addCriterion("document_type >=", value, "documentType"); - return (Criteria) this; - } - - public Criteria andDocumentTypeLessThan(String value) { - addCriterion("document_type <", value, "documentType"); - return (Criteria) this; - } - - public Criteria andDocumentTypeLessThanOrEqualTo(String value) { - addCriterion("document_type <=", value, "documentType"); - return (Criteria) this; - } - - public Criteria andDocumentTypeLike(String value) { - addCriterion("document_type like", value, "documentType"); - return (Criteria) this; - } - - public Criteria andDocumentTypeNotLike(String value) { - addCriterion("document_type not like", value, "documentType"); - return (Criteria) this; - } - - public Criteria andDocumentTypeIn(List values) { - addCriterion("document_type in", values, "documentType"); - return (Criteria) this; - } - - public Criteria andDocumentTypeNotIn(List values) { - addCriterion("document_type not in", values, "documentType"); - return (Criteria) this; - } - - public Criteria andDocumentTypeBetween(String value1, String value2) { - addCriterion("document_type between", value1, value2, "documentType"); - return (Criteria) this; - } - - public Criteria andDocumentTypeNotBetween(String value1, String value2) { - addCriterion("document_type not between", value1, value2, "documentType"); - return (Criteria) this; - } - - public Criteria andRetryUrlIsNull() { - addCriterion("retry_url is null"); - return (Criteria) this; - } - - public Criteria andRetryUrlIsNotNull() { - addCriterion("retry_url is not null"); - return (Criteria) this; - } - - public Criteria andRetryUrlEqualTo(String value) { - addCriterion("retry_url =", value, "retryUrl"); - return (Criteria) this; - } - - public Criteria andRetryUrlNotEqualTo(String value) { - addCriterion("retry_url <>", value, "retryUrl"); - return (Criteria) this; - } - - public Criteria andRetryUrlGreaterThan(String value) { - addCriterion("retry_url >", value, "retryUrl"); - return (Criteria) this; - } - - public Criteria andRetryUrlGreaterThanOrEqualTo(String value) { - addCriterion("retry_url >=", value, "retryUrl"); - return (Criteria) this; - } - - public Criteria andRetryUrlLessThan(String value) { - addCriterion("retry_url <", value, "retryUrl"); - return (Criteria) this; - } - - public Criteria andRetryUrlLessThanOrEqualTo(String value) { - addCriterion("retry_url <=", value, "retryUrl"); - return (Criteria) this; - } - - public Criteria andRetryUrlLike(String value) { - addCriterion("retry_url like", value, "retryUrl"); - return (Criteria) this; - } - - public Criteria andRetryUrlNotLike(String value) { - addCriterion("retry_url not like", value, "retryUrl"); - return (Criteria) this; - } - - public Criteria andRetryUrlIn(List values) { - addCriterion("retry_url in", values, "retryUrl"); - return (Criteria) this; - } - - public Criteria andRetryUrlNotIn(List values) { - addCriterion("retry_url not in", values, "retryUrl"); - return (Criteria) this; - } - - public Criteria andRetryUrlBetween(String value1, String value2) { - addCriterion("retry_url between", value1, value2, "retryUrl"); - return (Criteria) this; - } - - public Criteria andRetryUrlNotBetween(String value1, String value2) { - addCriterion("retry_url not between", value1, value2, "retryUrl"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * error.error_trace - * - * @mbg.generated do_not_delete_during_merge Fri Mar 09 18:05:46 EAT 2018 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public ErrorTraceExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNull() { + addCriterion("document_id is null"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNotNull() { + addCriterion("document_id is not null"); + return (Criteria) this; + } + + public Criteria andDocumentIdEqualTo(String value) { + addCriterion("document_id =", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotEqualTo(String value) { + addCriterion("document_id <>", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThan(String value) { + addCriterion("document_id >", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { + addCriterion("document_id >=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThan(String value) { + addCriterion("document_id <", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThanOrEqualTo(String value) { + addCriterion("document_id <=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLike(String value) { + addCriterion("document_id like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotLike(String value) { + addCriterion("document_id not like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdIn(List values) { + addCriterion("document_id in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotIn(List values) { + addCriterion("document_id not in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdBetween(String value1, String value2) { + addCriterion("document_id between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotBetween(String value1, String value2) { + addCriterion("document_id not between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andDateOccurredIsNull() { + addCriterion("date_occurred is null"); + return (Criteria) this; + } + + public Criteria andDateOccurredIsNotNull() { + addCriterion("date_occurred is not null"); + return (Criteria) this; + } + + public Criteria andDateOccurredEqualTo(Date value) { + addCriterion("date_occurred =", value, "dateOccurred"); + return (Criteria) this; + } + + public Criteria andDateOccurredNotEqualTo(Date value) { + addCriterion("date_occurred <>", value, "dateOccurred"); + return (Criteria) this; + } + + public Criteria andDateOccurredGreaterThan(Date value) { + addCriterion("date_occurred >", value, "dateOccurred"); + return (Criteria) this; + } + + public Criteria andDateOccurredGreaterThanOrEqualTo(Date value) { + addCriterion("date_occurred >=", value, "dateOccurred"); + return (Criteria) this; + } + + public Criteria andDateOccurredLessThan(Date value) { + addCriterion("date_occurred <", value, "dateOccurred"); + return (Criteria) this; + } + + public Criteria andDateOccurredLessThanOrEqualTo(Date value) { + addCriterion("date_occurred <=", value, "dateOccurred"); + return (Criteria) this; + } + + public Criteria andDateOccurredIn(List values) { + addCriterion("date_occurred in", values, "dateOccurred"); + return (Criteria) this; + } + + public Criteria andDateOccurredNotIn(List values) { + addCriterion("date_occurred not in", values, "dateOccurred"); + return (Criteria) this; + } + + public Criteria andDateOccurredBetween(Date value1, Date value2) { + addCriterion("date_occurred between", value1, value2, "dateOccurred"); + return (Criteria) this; + } + + public Criteria andDateOccurredNotBetween(Date value1, Date value2) { + addCriterion("date_occurred not between", value1, value2, "dateOccurred"); + return (Criteria) this; + } + + public Criteria andErrorTypeIsNull() { + addCriterion("error_type is null"); + return (Criteria) this; + } + + public Criteria andErrorTypeIsNotNull() { + addCriterion("error_type is not null"); + return (Criteria) this; + } + + public Criteria andErrorTypeEqualTo(String value) { + addCriterion("error_type =", value, "errorType"); + return (Criteria) this; + } + + public Criteria andErrorTypeNotEqualTo(String value) { + addCriterion("error_type <>", value, "errorType"); + return (Criteria) this; + } + + public Criteria andErrorTypeGreaterThan(String value) { + addCriterion("error_type >", value, "errorType"); + return (Criteria) this; + } + + public Criteria andErrorTypeGreaterThanOrEqualTo(String value) { + addCriterion("error_type >=", value, "errorType"); + return (Criteria) this; + } + + public Criteria andErrorTypeLessThan(String value) { + addCriterion("error_type <", value, "errorType"); + return (Criteria) this; + } + + public Criteria andErrorTypeLessThanOrEqualTo(String value) { + addCriterion("error_type <=", value, "errorType"); + return (Criteria) this; + } + + public Criteria andErrorTypeLike(String value) { + addCriterion("error_type like", value, "errorType"); + return (Criteria) this; + } + + public Criteria andErrorTypeNotLike(String value) { + addCriterion("error_type not like", value, "errorType"); + return (Criteria) this; + } + + public Criteria andErrorTypeIn(List values) { + addCriterion("error_type in", values, "errorType"); + return (Criteria) this; + } + + public Criteria andErrorTypeNotIn(List values) { + addCriterion("error_type not in", values, "errorType"); + return (Criteria) this; + } + + public Criteria andErrorTypeBetween(String value1, String value2) { + addCriterion("error_type between", value1, value2, "errorType"); + return (Criteria) this; + } + + public Criteria andErrorTypeNotBetween(String value1, String value2) { + addCriterion("error_type not between", value1, value2, "errorType"); + return (Criteria) this; + } + + public Criteria andOccurredAtIsNull() { + addCriterion("occurred_at is null"); + return (Criteria) this; + } + + public Criteria andOccurredAtIsNotNull() { + addCriterion("occurred_at is not null"); + return (Criteria) this; + } + + public Criteria andOccurredAtEqualTo(String value) { + addCriterion("occurred_at =", value, "occurredAt"); + return (Criteria) this; + } + + public Criteria andOccurredAtNotEqualTo(String value) { + addCriterion("occurred_at <>", value, "occurredAt"); + return (Criteria) this; + } + + public Criteria andOccurredAtGreaterThan(String value) { + addCriterion("occurred_at >", value, "occurredAt"); + return (Criteria) this; + } + + public Criteria andOccurredAtGreaterThanOrEqualTo(String value) { + addCriterion("occurred_at >=", value, "occurredAt"); + return (Criteria) this; + } + + public Criteria andOccurredAtLessThan(String value) { + addCriterion("occurred_at <", value, "occurredAt"); + return (Criteria) this; + } + + public Criteria andOccurredAtLessThanOrEqualTo(String value) { + addCriterion("occurred_at <=", value, "occurredAt"); + return (Criteria) this; + } + + public Criteria andOccurredAtLike(String value) { + addCriterion("occurred_at like", value, "occurredAt"); + return (Criteria) this; + } + + public Criteria andOccurredAtNotLike(String value) { + addCriterion("occurred_at not like", value, "occurredAt"); + return (Criteria) this; + } + + public Criteria andOccurredAtIn(List values) { + addCriterion("occurred_at in", values, "occurredAt"); + return (Criteria) this; + } + + public Criteria andOccurredAtNotIn(List values) { + addCriterion("occurred_at not in", values, "occurredAt"); + return (Criteria) this; + } + + public Criteria andOccurredAtBetween(String value1, String value2) { + addCriterion("occurred_at between", value1, value2, "occurredAt"); + return (Criteria) this; + } + + public Criteria andOccurredAtNotBetween(String value1, String value2) { + addCriterion("occurred_at not between", value1, value2, "occurredAt"); + return (Criteria) this; + } + + public Criteria andStackTraceIsNull() { + addCriterion("stack_trace is null"); + return (Criteria) this; + } + + public Criteria andStackTraceIsNotNull() { + addCriterion("stack_trace is not null"); + return (Criteria) this; + } + + public Criteria andStackTraceEqualTo(String value) { + addCriterion("stack_trace =", value, "stackTrace"); + return (Criteria) this; + } + + public Criteria andStackTraceNotEqualTo(String value) { + addCriterion("stack_trace <>", value, "stackTrace"); + return (Criteria) this; + } + + public Criteria andStackTraceGreaterThan(String value) { + addCriterion("stack_trace >", value, "stackTrace"); + return (Criteria) this; + } + + public Criteria andStackTraceGreaterThanOrEqualTo(String value) { + addCriterion("stack_trace >=", value, "stackTrace"); + return (Criteria) this; + } + + public Criteria andStackTraceLessThan(String value) { + addCriterion("stack_trace <", value, "stackTrace"); + return (Criteria) this; + } + + public Criteria andStackTraceLessThanOrEqualTo(String value) { + addCriterion("stack_trace <=", value, "stackTrace"); + return (Criteria) this; + } + + public Criteria andStackTraceLike(String value) { + addCriterion("stack_trace like", value, "stackTrace"); + return (Criteria) this; + } + + public Criteria andStackTraceNotLike(String value) { + addCriterion("stack_trace not like", value, "stackTrace"); + return (Criteria) this; + } + + public Criteria andStackTraceIn(List values) { + addCriterion("stack_trace in", values, "stackTrace"); + return (Criteria) this; + } + + public Criteria andStackTraceNotIn(List values) { + addCriterion("stack_trace not in", values, "stackTrace"); + return (Criteria) this; + } + + public Criteria andStackTraceBetween(String value1, String value2) { + addCriterion("stack_trace between", value1, value2, "stackTrace"); + return (Criteria) this; + } + + public Criteria andStackTraceNotBetween(String value1, String value2) { + addCriterion("stack_trace not between", value1, value2, "stackTrace"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(String value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(String value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(String value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(String value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLike(String value) { + addCriterion("status like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotLike(String value) { + addCriterion("status not like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andRecordIdIsNull() { + addCriterion("record_id is null"); + return (Criteria) this; + } + + public Criteria andRecordIdIsNotNull() { + addCriterion("record_id is not null"); + return (Criteria) this; + } + + public Criteria andRecordIdEqualTo(String value) { + addCriterion("record_id =", value, "recordId"); + return (Criteria) this; + } + + public Criteria andRecordIdNotEqualTo(String value) { + addCriterion("record_id <>", value, "recordId"); + return (Criteria) this; + } + + public Criteria andRecordIdGreaterThan(String value) { + addCriterion("record_id >", value, "recordId"); + return (Criteria) this; + } + + public Criteria andRecordIdGreaterThanOrEqualTo(String value) { + addCriterion("record_id >=", value, "recordId"); + return (Criteria) this; + } + + public Criteria andRecordIdLessThan(String value) { + addCriterion("record_id <", value, "recordId"); + return (Criteria) this; + } + + public Criteria andRecordIdLessThanOrEqualTo(String value) { + addCriterion("record_id <=", value, "recordId"); + return (Criteria) this; + } + + public Criteria andRecordIdLike(String value) { + addCriterion("record_id like", value, "recordId"); + return (Criteria) this; + } + + public Criteria andRecordIdNotLike(String value) { + addCriterion("record_id not like", value, "recordId"); + return (Criteria) this; + } + + public Criteria andRecordIdIn(List values) { + addCriterion("record_id in", values, "recordId"); + return (Criteria) this; + } + + public Criteria andRecordIdNotIn(List values) { + addCriterion("record_id not in", values, "recordId"); + return (Criteria) this; + } + + public Criteria andRecordIdBetween(String value1, String value2) { + addCriterion("record_id between", value1, value2, "recordId"); + return (Criteria) this; + } + + public Criteria andRecordIdNotBetween(String value1, String value2) { + addCriterion("record_id not between", value1, value2, "recordId"); + return (Criteria) this; + } + + public Criteria andDateClosedIsNull() { + addCriterion("date_closed is null"); + return (Criteria) this; + } + + public Criteria andDateClosedIsNotNull() { + addCriterion("date_closed is not null"); + return (Criteria) this; + } + + public Criteria andDateClosedEqualTo(Date value) { + addCriterion("date_closed =", value, "dateClosed"); + return (Criteria) this; + } + + public Criteria andDateClosedNotEqualTo(Date value) { + addCriterion("date_closed <>", value, "dateClosed"); + return (Criteria) this; + } + + public Criteria andDateClosedGreaterThan(Date value) { + addCriterion("date_closed >", value, "dateClosed"); + return (Criteria) this; + } + + public Criteria andDateClosedGreaterThanOrEqualTo(Date value) { + addCriterion("date_closed >=", value, "dateClosed"); + return (Criteria) this; + } + + public Criteria andDateClosedLessThan(Date value) { + addCriterion("date_closed <", value, "dateClosed"); + return (Criteria) this; + } + + public Criteria andDateClosedLessThanOrEqualTo(Date value) { + addCriterion("date_closed <=", value, "dateClosed"); + return (Criteria) this; + } + + public Criteria andDateClosedIn(List values) { + addCriterion("date_closed in", values, "dateClosed"); + return (Criteria) this; + } + + public Criteria andDateClosedNotIn(List values) { + addCriterion("date_closed not in", values, "dateClosed"); + return (Criteria) this; + } + + public Criteria andDateClosedBetween(Date value1, Date value2) { + addCriterion("date_closed between", value1, value2, "dateClosed"); + return (Criteria) this; + } + + public Criteria andDateClosedNotBetween(Date value1, Date value2) { + addCriterion("date_closed not between", value1, value2, "dateClosed"); + return (Criteria) this; + } + + public Criteria andDocumentTypeIsNull() { + addCriterion("document_type is null"); + return (Criteria) this; + } + + public Criteria andDocumentTypeIsNotNull() { + addCriterion("document_type is not null"); + return (Criteria) this; + } + + public Criteria andDocumentTypeEqualTo(String value) { + addCriterion("document_type =", value, "documentType"); + return (Criteria) this; + } + + public Criteria andDocumentTypeNotEqualTo(String value) { + addCriterion("document_type <>", value, "documentType"); + return (Criteria) this; + } + + public Criteria andDocumentTypeGreaterThan(String value) { + addCriterion("document_type >", value, "documentType"); + return (Criteria) this; + } + + public Criteria andDocumentTypeGreaterThanOrEqualTo(String value) { + addCriterion("document_type >=", value, "documentType"); + return (Criteria) this; + } + + public Criteria andDocumentTypeLessThan(String value) { + addCriterion("document_type <", value, "documentType"); + return (Criteria) this; + } + + public Criteria andDocumentTypeLessThanOrEqualTo(String value) { + addCriterion("document_type <=", value, "documentType"); + return (Criteria) this; + } + + public Criteria andDocumentTypeLike(String value) { + addCriterion("document_type like", value, "documentType"); + return (Criteria) this; + } + + public Criteria andDocumentTypeNotLike(String value) { + addCriterion("document_type not like", value, "documentType"); + return (Criteria) this; + } + + public Criteria andDocumentTypeIn(List values) { + addCriterion("document_type in", values, "documentType"); + return (Criteria) this; + } + + public Criteria andDocumentTypeNotIn(List values) { + addCriterion("document_type not in", values, "documentType"); + return (Criteria) this; + } + + public Criteria andDocumentTypeBetween(String value1, String value2) { + addCriterion("document_type between", value1, value2, "documentType"); + return (Criteria) this; + } + + public Criteria andDocumentTypeNotBetween(String value1, String value2) { + addCriterion("document_type not between", value1, value2, "documentType"); + return (Criteria) this; + } + + public Criteria andRetryUrlIsNull() { + addCriterion("retry_url is null"); + return (Criteria) this; + } + + public Criteria andRetryUrlIsNotNull() { + addCriterion("retry_url is not null"); + return (Criteria) this; + } + + public Criteria andRetryUrlEqualTo(String value) { + addCriterion("retry_url =", value, "retryUrl"); + return (Criteria) this; + } + + public Criteria andRetryUrlNotEqualTo(String value) { + addCriterion("retry_url <>", value, "retryUrl"); + return (Criteria) this; + } + + public Criteria andRetryUrlGreaterThan(String value) { + addCriterion("retry_url >", value, "retryUrl"); + return (Criteria) this; + } + + public Criteria andRetryUrlGreaterThanOrEqualTo(String value) { + addCriterion("retry_url >=", value, "retryUrl"); + return (Criteria) this; + } + + public Criteria andRetryUrlLessThan(String value) { + addCriterion("retry_url <", value, "retryUrl"); + return (Criteria) this; + } + + public Criteria andRetryUrlLessThanOrEqualTo(String value) { + addCriterion("retry_url <=", value, "retryUrl"); + return (Criteria) this; + } + + public Criteria andRetryUrlLike(String value) { + addCriterion("retry_url like", value, "retryUrl"); + return (Criteria) this; + } + + public Criteria andRetryUrlNotLike(String value) { + addCriterion("retry_url not like", value, "retryUrl"); + return (Criteria) this; + } + + public Criteria andRetryUrlIn(List values) { + addCriterion("retry_url in", values, "retryUrl"); + return (Criteria) this; + } + + public Criteria andRetryUrlNotIn(List values) { + addCriterion("retry_url not in", values, "retryUrl"); + return (Criteria) this; + } + + public Criteria andRetryUrlBetween(String value1, String value2) { + addCriterion("retry_url between", value1, value2, "retryUrl"); + return (Criteria) this; + } + + public Criteria andRetryUrlNotBetween(String value1, String value2) { + addCriterion("retry_url not between", value1, value2, "retryUrl"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * error.error_trace + * + * @mbg.generated do_not_delete_during_merge Fri Mar 09 18:05:46 EAT 2018 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/Event.java b/src/main/java/org/opensrp/domain/postgres/Event.java index ecacf4f76..a557dd6dd 100644 --- a/src/main/java/org/opensrp/domain/postgres/Event.java +++ b/src/main/java/org/opensrp/domain/postgres/Event.java @@ -4,96 +4,108 @@ public class Event { - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.event.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Long id; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.event.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Object json; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.event.date_deleted - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Date dateDeleted; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.event.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Long serverVersion; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.event.id + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Long id; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.event.json + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Object json; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.event.date_deleted + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Date dateDeleted; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.event.server_version + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Long serverVersion; - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.event.id - * @return the value of core.event.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Long getId() { - return id; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.event.id + * + * @return the value of core.event.id + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Long getId() { + return id; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.event.id - * @param id the value for core.event.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.event.id + * + * @param id the value for core.event.id + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setId(Long id) { + this.id = id; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.event.json - * @return the value of core.event.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Object getJson() { - return json; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.event.json + * + * @return the value of core.event.json + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Object getJson() { + return json; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.event.json - * @param json the value for core.event.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setJson(Object json) { - this.json = json; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.event.json + * + * @param json the value for core.event.json + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setJson(Object json) { + this.json = json; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.event.date_deleted - * @return the value of core.event.date_deleted - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Date getDateDeleted() { - return dateDeleted; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.event.date_deleted + * + * @return the value of core.event.date_deleted + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Date getDateDeleted() { + return dateDeleted; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.event.date_deleted - * @param dateDeleted the value for core.event.date_deleted - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setDateDeleted(Date dateDeleted) { - this.dateDeleted = dateDeleted; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.event.date_deleted + * + * @param dateDeleted the value for core.event.date_deleted + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setDateDeleted(Date dateDeleted) { + this.dateDeleted = dateDeleted; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.event.server_version - * @return the value of core.event.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Long getServerVersion() { - return serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.event.server_version + * + * @return the value of core.event.server_version + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Long getServerVersion() { + return serverVersion; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.event.server_version - * @param serverVersion the value for core.event.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.event.server_version + * + * @param serverVersion the value for core.event.server_version + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/EventExample.java b/src/main/java/org/opensrp/domain/postgres/EventExample.java index edb4aafdb..c187350fb 100644 --- a/src/main/java/org/opensrp/domain/postgres/EventExample.java +++ b/src/main/java/org/opensrp/domain/postgres/EventExample.java @@ -5,542 +5,558 @@ import java.util.List; public class EventExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected String orderByClause; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected boolean distinct; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public EventExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List jsonCriteria; - - protected List allCriteria; - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - jsonCriteria = new ArrayList<>(); - } - - public List getJsonCriteria() { - return jsonCriteria; - } - - protected void addJsonCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.EventTypeHandler")); - allCriteria = null; - } - - protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - jsonCriteria.add( - new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.EventTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || jsonCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList<>(); - allCriteria.addAll(criteria); - allCriteria.addAll(jsonCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - allCriteria = null; - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andJsonIsNull() { - addCriterion("json is null"); - return (Criteria) this; - } - - public Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (Criteria) this; - } - - public Criteria andJsonEqualTo(Object value) { - addJsonCriterion("json =", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotEqualTo(Object value) { - addJsonCriterion("json <>", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThan(Object value) { - addJsonCriterion("json >", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThanOrEqualTo(Object value) { - addJsonCriterion("json >=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThan(Object value) { - addJsonCriterion("json <", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThanOrEqualTo(Object value) { - addJsonCriterion("json <=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonIn(List values) { - addJsonCriterion("json in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotIn(List values) { - addJsonCriterion("json not in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonBetween(Object value1, Object value2) { - addJsonCriterion("json between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotBetween(Object value1, Object value2) { - addJsonCriterion("json not between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNull() { - addCriterion("date_deleted is null"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNotNull() { - addCriterion("date_deleted is not null"); - return (Criteria) this; - } - - public Criteria andDateDeletedEqualTo(Date value) { - addCriterion("date_deleted =", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotEqualTo(Date value) { - addCriterion("date_deleted <>", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThan(Date value) { - addCriterion("date_deleted >", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { - addCriterion("date_deleted >=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThan(Date value) { - addCriterion("date_deleted <", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThanOrEqualTo(Date value) { - addCriterion("date_deleted <=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedIn(List values) { - addCriterion("date_deleted in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotIn(List values) { - addCriterion("date_deleted not in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedBetween(Date value1, Date value2) { - addCriterion("date_deleted between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotBetween(Date value1, Date value2) { - addCriterion("date_deleted not between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.event - * - * @mbg.generated do_not_delete_during_merge Wed Mar 07 18:26:22 EAT 2018 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected String orderByClause; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected boolean distinct; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public EventExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List jsonCriteria; + + protected List allCriteria; + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + jsonCriteria = new ArrayList<>(); + } + + public List getJsonCriteria() { + return jsonCriteria; + } + + protected void addJsonCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.EventTypeHandler")); + allCriteria = null; + } + + protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + jsonCriteria.add( + new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.EventTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || jsonCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList<>(); + allCriteria.addAll(criteria); + allCriteria.addAll(jsonCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andJsonIsNull() { + addCriterion("json is null"); + return (Criteria) this; + } + + public Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (Criteria) this; + } + + public Criteria andJsonEqualTo(Object value) { + addJsonCriterion("json =", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotEqualTo(Object value) { + addJsonCriterion("json <>", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThan(Object value) { + addJsonCriterion("json >", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThanOrEqualTo(Object value) { + addJsonCriterion("json >=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThan(Object value) { + addJsonCriterion("json <", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThanOrEqualTo(Object value) { + addJsonCriterion("json <=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonIn(List values) { + addJsonCriterion("json in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotIn(List values) { + addJsonCriterion("json not in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonBetween(Object value1, Object value2) { + addJsonCriterion("json between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotBetween(Object value1, Object value2) { + addJsonCriterion("json not between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNull() { + addCriterion("date_deleted is null"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNotNull() { + addCriterion("date_deleted is not null"); + return (Criteria) this; + } + + public Criteria andDateDeletedEqualTo(Date value) { + addCriterion("date_deleted =", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotEqualTo(Date value) { + addCriterion("date_deleted <>", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThan(Date value) { + addCriterion("date_deleted >", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { + addCriterion("date_deleted >=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThan(Date value) { + addCriterion("date_deleted <", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThanOrEqualTo(Date value) { + addCriterion("date_deleted <=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedIn(List values) { + addCriterion("date_deleted in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotIn(List values) { + addCriterion("date_deleted not in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedBetween(Date value1, Date value2) { + addCriterion("date_deleted between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotBetween(Date value1, Date value2) { + addCriterion("date_deleted not between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.event + * + * @mbg.generated do_not_delete_during_merge Wed Mar 07 18:26:22 EAT 2018 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/EventMetadata.java b/src/main/java/org/opensrp/domain/postgres/EventMetadata.java index aa9298795..2254726ff 100644 --- a/src/main/java/org/opensrp/domain/postgres/EventMetadata.java +++ b/src/main/java/org/opensrp/domain/postgres/EventMetadata.java @@ -3,544 +3,544 @@ import java.util.Date; public class EventMetadata { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.id - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.event_id - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private Long eventId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.document_id - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private String documentId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.base_entity_id - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private String baseEntityId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.form_submission_id - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private String formSubmissionId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.server_version - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private Long serverVersion; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.openmrs_uuid - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private String openmrsUuid; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.event_type - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private String eventType; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.event_date - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private Date eventDate; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.entity_type - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private String entityType; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.provider_id - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private String providerId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.location_id - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private String locationId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.team - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private String team; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.team_id - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private String teamId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.date_created - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private Date dateCreated; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.date_edited - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private Date dateEdited; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.date_deleted - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - private Date dateDeleted; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.event_metadata.plan_identifier - * - * @mbg.generated Mon Jun 29 17:29:36 PKT 2020 - */ - private String planIdentifier; - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.id - * - * @return the value of core.event_metadata.id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.id - * - * @param id the value for core.event_metadata.id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.event_id - * - * @return the value of core.event_metadata.event_id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public Long getEventId() { - return eventId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.event_id - * - * @param eventId the value for core.event_metadata.event_id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setEventId(Long eventId) { - this.eventId = eventId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.document_id - * - * @return the value of core.event_metadata.document_id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public String getDocumentId() { - return documentId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.document_id - * - * @param documentId the value for core.event_metadata.document_id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setDocumentId(String documentId) { - this.documentId = documentId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.base_entity_id - * - * @return the value of core.event_metadata.base_entity_id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public String getBaseEntityId() { - return baseEntityId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.base_entity_id - * - * @param baseEntityId the value for core.event_metadata.base_entity_id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setBaseEntityId(String baseEntityId) { - this.baseEntityId = baseEntityId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.form_submission_id - * - * @return the value of core.event_metadata.form_submission_id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public String getFormSubmissionId() { - return formSubmissionId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.form_submission_id - * - * @param formSubmissionId the value for core.event_metadata.form_submission_id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setFormSubmissionId(String formSubmissionId) { - this.formSubmissionId = formSubmissionId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.server_version - * - * @return the value of core.event_metadata.server_version - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public Long getServerVersion() { - return serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.server_version - * - * @param serverVersion the value for core.event_metadata.server_version - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.openmrs_uuid - * - * @return the value of core.event_metadata.openmrs_uuid - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public String getOpenmrsUuid() { - return openmrsUuid; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.openmrs_uuid - * - * @param openmrsUuid the value for core.event_metadata.openmrs_uuid - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setOpenmrsUuid(String openmrsUuid) { - this.openmrsUuid = openmrsUuid; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.event_type - * - * @return the value of core.event_metadata.event_type - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public String getEventType() { - return eventType; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.event_type - * - * @param eventType the value for core.event_metadata.event_type - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setEventType(String eventType) { - this.eventType = eventType; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.event_date - * - * @return the value of core.event_metadata.event_date - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public Date getEventDate() { - return eventDate; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.event_date - * - * @param eventDate the value for core.event_metadata.event_date - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setEventDate(Date eventDate) { - this.eventDate = eventDate; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.entity_type - * - * @return the value of core.event_metadata.entity_type - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public String getEntityType() { - return entityType; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.entity_type - * - * @param entityType the value for core.event_metadata.entity_type - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setEntityType(String entityType) { - this.entityType = entityType; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.provider_id - * - * @return the value of core.event_metadata.provider_id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public String getProviderId() { - return providerId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.provider_id - * - * @param providerId the value for core.event_metadata.provider_id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.location_id - * - * @return the value of core.event_metadata.location_id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public String getLocationId() { - return locationId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.location_id - * - * @param locationId the value for core.event_metadata.location_id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setLocationId(String locationId) { - this.locationId = locationId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.team - * - * @return the value of core.event_metadata.team - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public String getTeam() { - return team; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.team - * - * @param team the value for core.event_metadata.team - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setTeam(String team) { - this.team = team; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.team_id - * - * @return the value of core.event_metadata.team_id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public String getTeamId() { - return teamId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.team_id - * - * @param teamId the value for core.event_metadata.team_id - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setTeamId(String teamId) { - this.teamId = teamId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.date_created - * - * @return the value of core.event_metadata.date_created - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public Date getDateCreated() { - return dateCreated; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.date_created - * - * @param dateCreated the value for core.event_metadata.date_created - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setDateCreated(Date dateCreated) { - this.dateCreated = dateCreated; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.date_edited - * - * @return the value of core.event_metadata.date_edited - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public Date getDateEdited() { - return dateEdited; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.date_edited - * - * @param dateEdited the value for core.event_metadata.date_edited - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setDateEdited(Date dateEdited) { - this.dateEdited = dateEdited; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.date_deleted - * - * @return the value of core.event_metadata.date_deleted - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public Date getDateDeleted() { - return dateDeleted; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.date_deleted - * - * @param dateDeleted the value for core.event_metadata.date_deleted - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setDateDeleted(Date dateDeleted) { - this.dateDeleted = dateDeleted; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.event_metadata.plan_identifier - * - * @return the value of core.event_metadata.plan_identifier - * @mbg.generated Mon Jun 29 17:29:36 PKT 2020 - */ - public String getPlanIdentifier() { - return planIdentifier; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.event_metadata.plan_identifier - * - * @param planIdentifier the value for core.event_metadata.plan_identifier - * @mbg.generated Mon Jun 29 17:29:36 PKT 2020 - */ - public void setPlanIdentifier(String planIdentifier) { - this.planIdentifier = planIdentifier; - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.id + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.event_id + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private Long eventId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.document_id + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private String documentId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.base_entity_id + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private String baseEntityId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.form_submission_id + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private String formSubmissionId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.server_version + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private Long serverVersion; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.openmrs_uuid + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private String openmrsUuid; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.event_type + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private String eventType; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.event_date + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private Date eventDate; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.entity_type + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private String entityType; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.provider_id + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private String providerId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.location_id + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private String locationId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.team + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private String team; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.team_id + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private String teamId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.date_created + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private Date dateCreated; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.date_edited + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private Date dateEdited; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.date_deleted + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + private Date dateDeleted; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.event_metadata.plan_identifier + * + * @mbg.generated Mon Jun 29 17:29:36 PKT 2020 + */ + private String planIdentifier; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.id + * + * @return the value of core.event_metadata.id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.id + * + * @param id the value for core.event_metadata.id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.event_id + * + * @return the value of core.event_metadata.event_id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public Long getEventId() { + return eventId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.event_id + * + * @param eventId the value for core.event_metadata.event_id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setEventId(Long eventId) { + this.eventId = eventId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.document_id + * + * @return the value of core.event_metadata.document_id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public String getDocumentId() { + return documentId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.document_id + * + * @param documentId the value for core.event_metadata.document_id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setDocumentId(String documentId) { + this.documentId = documentId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.base_entity_id + * + * @return the value of core.event_metadata.base_entity_id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public String getBaseEntityId() { + return baseEntityId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.base_entity_id + * + * @param baseEntityId the value for core.event_metadata.base_entity_id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setBaseEntityId(String baseEntityId) { + this.baseEntityId = baseEntityId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.form_submission_id + * + * @return the value of core.event_metadata.form_submission_id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public String getFormSubmissionId() { + return formSubmissionId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.form_submission_id + * + * @param formSubmissionId the value for core.event_metadata.form_submission_id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setFormSubmissionId(String formSubmissionId) { + this.formSubmissionId = formSubmissionId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.server_version + * + * @return the value of core.event_metadata.server_version + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public Long getServerVersion() { + return serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.server_version + * + * @param serverVersion the value for core.event_metadata.server_version + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.openmrs_uuid + * + * @return the value of core.event_metadata.openmrs_uuid + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public String getOpenmrsUuid() { + return openmrsUuid; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.openmrs_uuid + * + * @param openmrsUuid the value for core.event_metadata.openmrs_uuid + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setOpenmrsUuid(String openmrsUuid) { + this.openmrsUuid = openmrsUuid; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.event_type + * + * @return the value of core.event_metadata.event_type + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public String getEventType() { + return eventType; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.event_type + * + * @param eventType the value for core.event_metadata.event_type + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setEventType(String eventType) { + this.eventType = eventType; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.event_date + * + * @return the value of core.event_metadata.event_date + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public Date getEventDate() { + return eventDate; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.event_date + * + * @param eventDate the value for core.event_metadata.event_date + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setEventDate(Date eventDate) { + this.eventDate = eventDate; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.entity_type + * + * @return the value of core.event_metadata.entity_type + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public String getEntityType() { + return entityType; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.entity_type + * + * @param entityType the value for core.event_metadata.entity_type + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setEntityType(String entityType) { + this.entityType = entityType; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.provider_id + * + * @return the value of core.event_metadata.provider_id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public String getProviderId() { + return providerId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.provider_id + * + * @param providerId the value for core.event_metadata.provider_id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.location_id + * + * @return the value of core.event_metadata.location_id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public String getLocationId() { + return locationId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.location_id + * + * @param locationId the value for core.event_metadata.location_id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setLocationId(String locationId) { + this.locationId = locationId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.team + * + * @return the value of core.event_metadata.team + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public String getTeam() { + return team; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.team + * + * @param team the value for core.event_metadata.team + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setTeam(String team) { + this.team = team; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.team_id + * + * @return the value of core.event_metadata.team_id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public String getTeamId() { + return teamId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.team_id + * + * @param teamId the value for core.event_metadata.team_id + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setTeamId(String teamId) { + this.teamId = teamId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.date_created + * + * @return the value of core.event_metadata.date_created + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public Date getDateCreated() { + return dateCreated; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.date_created + * + * @param dateCreated the value for core.event_metadata.date_created + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setDateCreated(Date dateCreated) { + this.dateCreated = dateCreated; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.date_edited + * + * @return the value of core.event_metadata.date_edited + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public Date getDateEdited() { + return dateEdited; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.date_edited + * + * @param dateEdited the value for core.event_metadata.date_edited + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setDateEdited(Date dateEdited) { + this.dateEdited = dateEdited; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.date_deleted + * + * @return the value of core.event_metadata.date_deleted + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public Date getDateDeleted() { + return dateDeleted; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.date_deleted + * + * @param dateDeleted the value for core.event_metadata.date_deleted + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setDateDeleted(Date dateDeleted) { + this.dateDeleted = dateDeleted; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.event_metadata.plan_identifier + * + * @return the value of core.event_metadata.plan_identifier + * @mbg.generated Mon Jun 29 17:29:36 PKT 2020 + */ + public String getPlanIdentifier() { + return planIdentifier; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.event_metadata.plan_identifier + * + * @param planIdentifier the value for core.event_metadata.plan_identifier + * @mbg.generated Mon Jun 29 17:29:36 PKT 2020 + */ + public void setPlanIdentifier(String planIdentifier) { + this.planIdentifier = planIdentifier; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/EventMetadataExample.java b/src/main/java/org/opensrp/domain/postgres/EventMetadataExample.java index b5cd7b46c..2407a601a 100644 --- a/src/main/java/org/opensrp/domain/postgres/EventMetadataExample.java +++ b/src/main/java/org/opensrp/domain/postgres/EventMetadataExample.java @@ -5,1492 +5,1492 @@ import java.util.List; public class EventMetadataExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public EventMetadataExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andEventIdIsNull() { - addCriterion("event_id is null"); - return (Criteria) this; - } - - public Criteria andEventIdIsNotNull() { - addCriterion("event_id is not null"); - return (Criteria) this; - } - - public Criteria andEventIdEqualTo(Long value) { - addCriterion("event_id =", value, "eventId"); - return (Criteria) this; - } - - public Criteria andEventIdNotEqualTo(Long value) { - addCriterion("event_id <>", value, "eventId"); - return (Criteria) this; - } - - public Criteria andEventIdGreaterThan(Long value) { - addCriterion("event_id >", value, "eventId"); - return (Criteria) this; - } - - public Criteria andEventIdGreaterThanOrEqualTo(Long value) { - addCriterion("event_id >=", value, "eventId"); - return (Criteria) this; - } - - public Criteria andEventIdLessThan(Long value) { - addCriterion("event_id <", value, "eventId"); - return (Criteria) this; - } - - public Criteria andEventIdLessThanOrEqualTo(Long value) { - addCriterion("event_id <=", value, "eventId"); - return (Criteria) this; - } - - public Criteria andEventIdIn(List values) { - addCriterion("event_id in", values, "eventId"); - return (Criteria) this; - } - - public Criteria andEventIdNotIn(List values) { - addCriterion("event_id not in", values, "eventId"); - return (Criteria) this; - } - - public Criteria andEventIdBetween(Long value1, Long value2) { - addCriterion("event_id between", value1, value2, "eventId"); - return (Criteria) this; - } - - public Criteria andEventIdNotBetween(Long value1, Long value2) { - addCriterion("event_id not between", value1, value2, "eventId"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNull() { - addCriterion("document_id is null"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNotNull() { - addCriterion("document_id is not null"); - return (Criteria) this; - } - - public Criteria andDocumentIdEqualTo(String value) { - addCriterion("document_id =", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotEqualTo(String value) { - addCriterion("document_id <>", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThan(String value) { - addCriterion("document_id >", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { - addCriterion("document_id >=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThan(String value) { - addCriterion("document_id <", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThanOrEqualTo(String value) { - addCriterion("document_id <=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLike(String value) { - addCriterion("document_id like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotLike(String value) { - addCriterion("document_id not like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdIn(List values) { - addCriterion("document_id in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotIn(List values) { - addCriterion("document_id not in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdBetween(String value1, String value2) { - addCriterion("document_id between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotBetween(String value1, String value2) { - addCriterion("document_id not between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdIsNull() { - addCriterion("base_entity_id is null"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdIsNotNull() { - addCriterion("base_entity_id is not null"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdEqualTo(String value) { - addCriterion("base_entity_id =", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotEqualTo(String value) { - addCriterion("base_entity_id <>", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdGreaterThan(String value) { - addCriterion("base_entity_id >", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdGreaterThanOrEqualTo(String value) { - addCriterion("base_entity_id >=", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdLessThan(String value) { - addCriterion("base_entity_id <", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdLessThanOrEqualTo(String value) { - addCriterion("base_entity_id <=", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdLike(String value) { - addCriterion("base_entity_id like", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotLike(String value) { - addCriterion("base_entity_id not like", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdIn(List values) { - addCriterion("base_entity_id in", values, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotIn(List values) { - addCriterion("base_entity_id not in", values, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdBetween(String value1, String value2) { - addCriterion("base_entity_id between", value1, value2, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotBetween(String value1, String value2) { - addCriterion("base_entity_id not between", value1, value2, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdIsNull() { - addCriterion("form_submission_id is null"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdIsNotNull() { - addCriterion("form_submission_id is not null"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdEqualTo(String value) { - addCriterion("form_submission_id =", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdNotEqualTo(String value) { - addCriterion("form_submission_id <>", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdGreaterThan(String value) { - addCriterion("form_submission_id >", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdGreaterThanOrEqualTo(String value) { - addCriterion("form_submission_id >=", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdLessThan(String value) { - addCriterion("form_submission_id <", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdLessThanOrEqualTo(String value) { - addCriterion("form_submission_id <=", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdLike(String value) { - addCriterion("form_submission_id like", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdNotLike(String value) { - addCriterion("form_submission_id not like", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdIn(List values) { - addCriterion("form_submission_id in", values, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdNotIn(List values) { - addCriterion("form_submission_id not in", values, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdBetween(String value1, String value2) { - addCriterion("form_submission_id between", value1, value2, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdNotBetween(String value1, String value2) { - addCriterion("form_submission_id not between", value1, value2, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidIsNull() { - addCriterion("openmrs_uuid is null"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidIsNotNull() { - addCriterion("openmrs_uuid is not null"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidEqualTo(String value) { - addCriterion("openmrs_uuid =", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidNotEqualTo(String value) { - addCriterion("openmrs_uuid <>", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidGreaterThan(String value) { - addCriterion("openmrs_uuid >", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidGreaterThanOrEqualTo(String value) { - addCriterion("openmrs_uuid >=", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidLessThan(String value) { - addCriterion("openmrs_uuid <", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidLessThanOrEqualTo(String value) { - addCriterion("openmrs_uuid <=", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidLike(String value) { - addCriterion("openmrs_uuid like", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidNotLike(String value) { - addCriterion("openmrs_uuid not like", value, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidIn(List values) { - addCriterion("openmrs_uuid in", values, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidNotIn(List values) { - addCriterion("openmrs_uuid not in", values, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidBetween(String value1, String value2) { - addCriterion("openmrs_uuid between", value1, value2, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andOpenmrsUuidNotBetween(String value1, String value2) { - addCriterion("openmrs_uuid not between", value1, value2, "openmrsUuid"); - return (Criteria) this; - } - - public Criteria andEventTypeIsNull() { - addCriterion("event_type is null"); - return (Criteria) this; - } - - public Criteria andEventTypeIsNotNull() { - addCriterion("event_type is not null"); - return (Criteria) this; - } - - public Criteria andEventTypeEqualTo(String value) { - addCriterion("event_type =", value, "eventType"); - return (Criteria) this; - } - - public Criteria andEventTypeNotEqualTo(String value) { - addCriterion("event_type <>", value, "eventType"); - return (Criteria) this; - } - - public Criteria andEventTypeGreaterThan(String value) { - addCriterion("event_type >", value, "eventType"); - return (Criteria) this; - } - - public Criteria andEventTypeGreaterThanOrEqualTo(String value) { - addCriterion("event_type >=", value, "eventType"); - return (Criteria) this; - } - - public Criteria andEventTypeLessThan(String value) { - addCriterion("event_type <", value, "eventType"); - return (Criteria) this; - } - - public Criteria andEventTypeLessThanOrEqualTo(String value) { - addCriterion("event_type <=", value, "eventType"); - return (Criteria) this; - } - - public Criteria andEventTypeLike(String value) { - addCriterion("event_type like", value, "eventType"); - return (Criteria) this; - } - - public Criteria andEventTypeNotLike(String value) { - addCriterion("event_type not like", value, "eventType"); - return (Criteria) this; - } - - public Criteria andEventTypeIn(List values) { - addCriterion("event_type in", values, "eventType"); - return (Criteria) this; - } - - public Criteria andEventTypeNotIn(List values) { - addCriterion("event_type not in", values, "eventType"); - return (Criteria) this; - } - - public Criteria andEventTypeBetween(String value1, String value2) { - addCriterion("event_type between", value1, value2, "eventType"); - return (Criteria) this; - } - - public Criteria andEventTypeNotBetween(String value1, String value2) { - addCriterion("event_type not between", value1, value2, "eventType"); - return (Criteria) this; - } - - public Criteria andEventDateIsNull() { - addCriterion("event_date is null"); - return (Criteria) this; - } - - public Criteria andEventDateIsNotNull() { - addCriterion("event_date is not null"); - return (Criteria) this; - } - - public Criteria andEventDateEqualTo(Date value) { - addCriterion("event_date =", value, "eventDate"); - return (Criteria) this; - } - - public Criteria andEventDateNotEqualTo(Date value) { - addCriterion("event_date <>", value, "eventDate"); - return (Criteria) this; - } - - public Criteria andEventDateGreaterThan(Date value) { - addCriterion("event_date >", value, "eventDate"); - return (Criteria) this; - } - - public Criteria andEventDateGreaterThanOrEqualTo(Date value) { - addCriterion("event_date >=", value, "eventDate"); - return (Criteria) this; - } - - public Criteria andEventDateLessThan(Date value) { - addCriterion("event_date <", value, "eventDate"); - return (Criteria) this; - } - - public Criteria andEventDateLessThanOrEqualTo(Date value) { - addCriterion("event_date <=", value, "eventDate"); - return (Criteria) this; - } - - public Criteria andEventDateIn(List values) { - addCriterion("event_date in", values, "eventDate"); - return (Criteria) this; - } - - public Criteria andEventDateNotIn(List values) { - addCriterion("event_date not in", values, "eventDate"); - return (Criteria) this; - } - - public Criteria andEventDateBetween(Date value1, Date value2) { - addCriterion("event_date between", value1, value2, "eventDate"); - return (Criteria) this; - } - - public Criteria andEventDateNotBetween(Date value1, Date value2) { - addCriterion("event_date not between", value1, value2, "eventDate"); - return (Criteria) this; - } - - public Criteria andEntityTypeIsNull() { - addCriterion("entity_type is null"); - return (Criteria) this; - } - - public Criteria andEntityTypeIsNotNull() { - addCriterion("entity_type is not null"); - return (Criteria) this; - } - - public Criteria andEntityTypeEqualTo(String value) { - addCriterion("entity_type =", value, "entityType"); - return (Criteria) this; - } - - public Criteria andEntityTypeNotEqualTo(String value) { - addCriterion("entity_type <>", value, "entityType"); - return (Criteria) this; - } - - public Criteria andEntityTypeGreaterThan(String value) { - addCriterion("entity_type >", value, "entityType"); - return (Criteria) this; - } - - public Criteria andEntityTypeGreaterThanOrEqualTo(String value) { - addCriterion("entity_type >=", value, "entityType"); - return (Criteria) this; - } - - public Criteria andEntityTypeLessThan(String value) { - addCriterion("entity_type <", value, "entityType"); - return (Criteria) this; - } - - public Criteria andEntityTypeLessThanOrEqualTo(String value) { - addCriterion("entity_type <=", value, "entityType"); - return (Criteria) this; - } - - public Criteria andEntityTypeLike(String value) { - addCriterion("entity_type like", value, "entityType"); - return (Criteria) this; - } - - public Criteria andEntityTypeNotLike(String value) { - addCriterion("entity_type not like", value, "entityType"); - return (Criteria) this; - } - - public Criteria andEntityTypeIn(List values) { - addCriterion("entity_type in", values, "entityType"); - return (Criteria) this; - } - - public Criteria andEntityTypeNotIn(List values) { - addCriterion("entity_type not in", values, "entityType"); - return (Criteria) this; - } - - public Criteria andEntityTypeBetween(String value1, String value2) { - addCriterion("entity_type between", value1, value2, "entityType"); - return (Criteria) this; - } - - public Criteria andEntityTypeNotBetween(String value1, String value2) { - addCriterion("entity_type not between", value1, value2, "entityType"); - return (Criteria) this; - } - - public Criteria andProviderIdIsNull() { - addCriterion("provider_id is null"); - return (Criteria) this; - } - - public Criteria andProviderIdIsNotNull() { - addCriterion("provider_id is not null"); - return (Criteria) this; - } - - public Criteria andProviderIdEqualTo(String value) { - addCriterion("provider_id =", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotEqualTo(String value) { - addCriterion("provider_id <>", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdGreaterThan(String value) { - addCriterion("provider_id >", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdGreaterThanOrEqualTo(String value) { - addCriterion("provider_id >=", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdLessThan(String value) { - addCriterion("provider_id <", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdLessThanOrEqualTo(String value) { - addCriterion("provider_id <=", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdLike(String value) { - addCriterion("provider_id like", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotLike(String value) { - addCriterion("provider_id not like", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdIn(List values) { - addCriterion("provider_id in", values, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotIn(List values) { - addCriterion("provider_id not in", values, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdBetween(String value1, String value2) { - addCriterion("provider_id between", value1, value2, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotBetween(String value1, String value2) { - addCriterion("provider_id not between", value1, value2, "providerId"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNull() { - addCriterion("location_id is null"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNotNull() { - addCriterion("location_id is not null"); - return (Criteria) this; - } - - public Criteria andLocationIdEqualTo(String value) { - addCriterion("location_id =", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotEqualTo(String value) { - addCriterion("location_id <>", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThan(String value) { - addCriterion("location_id >", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThanOrEqualTo(String value) { - addCriterion("location_id >=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThan(String value) { - addCriterion("location_id <", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThanOrEqualTo(String value) { - addCriterion("location_id <=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLike(String value) { - addCriterion("location_id like", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotLike(String value) { - addCriterion("location_id not like", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdIn(List values) { - addCriterion("location_id in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotIn(List values) { - addCriterion("location_id not in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdBetween(String value1, String value2) { - addCriterion("location_id between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotBetween(String value1, String value2) { - addCriterion("location_id not between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andTeamIsNull() { - addCriterion("team is null"); - return (Criteria) this; - } - - public Criteria andTeamIsNotNull() { - addCriterion("team is not null"); - return (Criteria) this; - } - - public Criteria andTeamEqualTo(String value) { - addCriterion("team =", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotEqualTo(String value) { - addCriterion("team <>", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamGreaterThan(String value) { - addCriterion("team >", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamGreaterThanOrEqualTo(String value) { - addCriterion("team >=", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamLessThan(String value) { - addCriterion("team <", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamLessThanOrEqualTo(String value) { - addCriterion("team <=", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamLike(String value) { - addCriterion("team like", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotLike(String value) { - addCriterion("team not like", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamIn(List values) { - addCriterion("team in", values, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotIn(List values) { - addCriterion("team not in", values, "team"); - return (Criteria) this; - } - - public Criteria andTeamBetween(String value1, String value2) { - addCriterion("team between", value1, value2, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotBetween(String value1, String value2) { - addCriterion("team not between", value1, value2, "team"); - return (Criteria) this; - } - - public Criteria andTeamIdIsNull() { - addCriterion("team_id is null"); - return (Criteria) this; - } - - public Criteria andTeamIdIsNotNull() { - addCriterion("team_id is not null"); - return (Criteria) this; - } - - public Criteria andTeamIdEqualTo(String value) { - addCriterion("team_id =", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotEqualTo(String value) { - addCriterion("team_id <>", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdGreaterThan(String value) { - addCriterion("team_id >", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdGreaterThanOrEqualTo(String value) { - addCriterion("team_id >=", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdLessThan(String value) { - addCriterion("team_id <", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdLessThanOrEqualTo(String value) { - addCriterion("team_id <=", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdLike(String value) { - addCriterion("team_id like", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotLike(String value) { - addCriterion("team_id not like", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdIn(List values) { - addCriterion("team_id in", values, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotIn(List values) { - addCriterion("team_id not in", values, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdBetween(String value1, String value2) { - addCriterion("team_id between", value1, value2, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotBetween(String value1, String value2) { - addCriterion("team_id not between", value1, value2, "teamId"); - return (Criteria) this; - } - - public Criteria andDateCreatedIsNull() { - addCriterion("date_created is null"); - return (Criteria) this; - } - - public Criteria andDateCreatedIsNotNull() { - addCriterion("date_created is not null"); - return (Criteria) this; - } - - public Criteria andDateCreatedEqualTo(Date value) { - addCriterion("date_created =", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotEqualTo(Date value) { - addCriterion("date_created <>", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedGreaterThan(Date value) { - addCriterion("date_created >", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { - addCriterion("date_created >=", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedLessThan(Date value) { - addCriterion("date_created <", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedLessThanOrEqualTo(Date value) { - addCriterion("date_created <=", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedIn(List values) { - addCriterion("date_created in", values, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotIn(List values) { - addCriterion("date_created not in", values, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedBetween(Date value1, Date value2) { - addCriterion("date_created between", value1, value2, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotBetween(Date value1, Date value2) { - addCriterion("date_created not between", value1, value2, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNull() { - addCriterion("date_edited is null"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNotNull() { - addCriterion("date_edited is not null"); - return (Criteria) this; - } - - public Criteria andDateEditedEqualTo(Date value) { - addCriterion("date_edited =", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotEqualTo(Date value) { - addCriterion("date_edited <>", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThan(Date value) { - addCriterion("date_edited >", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { - addCriterion("date_edited >=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThan(Date value) { - addCriterion("date_edited <", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThanOrEqualTo(Date value) { - addCriterion("date_edited <=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedIn(List values) { - addCriterion("date_edited in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotIn(List values) { - addCriterion("date_edited not in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedBetween(Date value1, Date value2) { - addCriterion("date_edited between", value1, value2, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotBetween(Date value1, Date value2) { - addCriterion("date_edited not between", value1, value2, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNull() { - addCriterion("date_deleted is null"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNotNull() { - addCriterion("date_deleted is not null"); - return (Criteria) this; - } - - public Criteria andDateDeletedEqualTo(Date value) { - addCriterion("date_deleted =", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotEqualTo(Date value) { - addCriterion("date_deleted <>", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThan(Date value) { - addCriterion("date_deleted >", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { - addCriterion("date_deleted >=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThan(Date value) { - addCriterion("date_deleted <", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThanOrEqualTo(Date value) { - addCriterion("date_deleted <=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedIn(List values) { - addCriterion("date_deleted in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotIn(List values) { - addCriterion("date_deleted not in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedBetween(Date value1, Date value2) { - addCriterion("date_deleted between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotBetween(Date value1, Date value2) { - addCriterion("date_deleted not between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andPlanIdentifierIsNull() { - addCriterion("plan_identifier is null"); - return (Criteria) this; - } - - public Criteria andPlanIdentifierIsNotNull() { - addCriterion("plan_identifier is not null"); - return (Criteria) this; - } - - public Criteria andPlanIdentifierEqualTo(String value) { - addCriterion("plan_identifier =", value, "planIdentifier"); - return (Criteria) this; - } - - public Criteria andPlanIdentifierNotEqualTo(String value) { - addCriterion("plan_identifier <>", value, "planIdentifier"); - return (Criteria) this; - } - - public Criteria andPlanIdentifierGreaterThan(String value) { - addCriterion("plan_identifier >", value, "planIdentifier"); - return (Criteria) this; - } - - public Criteria andPlanIdentifierGreaterThanOrEqualTo(String value) { - addCriterion("plan_identifier >=", value, "planIdentifier"); - return (Criteria) this; - } - - public Criteria andPlanIdentifierLessThan(String value) { - addCriterion("plan_identifier <", value, "planIdentifier"); - return (Criteria) this; - } - - public Criteria andPlanIdentifierLessThanOrEqualTo(String value) { - addCriterion("plan_identifier <=", value, "planIdentifier"); - return (Criteria) this; - } - - public Criteria andPlanIdentifierLike(String value) { - addCriterion("plan_identifier like", value, "planIdentifier"); - return (Criteria) this; - } - - public Criteria andPlanIdentifierNotLike(String value) { - addCriterion("plan_identifier not like", value, "planIdentifier"); - return (Criteria) this; - } - - public Criteria andPlanIdentifierIn(List values) { - addCriterion("plan_identifier in", values, "planIdentifier"); - return (Criteria) this; - } - - public Criteria andPlanIdentifierNotIn(List values) { - addCriterion("plan_identifier not in", values, "planIdentifier"); - return (Criteria) this; - } - - public Criteria andPlanIdentifierBetween(String value1, String value2) { - addCriterion("plan_identifier between", value1, value2, "planIdentifier"); - return (Criteria) this; - } - - public Criteria andPlanIdentifierNotBetween(String value1, String value2) { - addCriterion("plan_identifier not between", value1, value2, "planIdentifier"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.event_metadata - * - * @mbg.generated do_not_delete_during_merge Wed Mar 07 18:26:22 EAT 2018 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public EventMetadataExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andEventIdIsNull() { + addCriterion("event_id is null"); + return (Criteria) this; + } + + public Criteria andEventIdIsNotNull() { + addCriterion("event_id is not null"); + return (Criteria) this; + } + + public Criteria andEventIdEqualTo(Long value) { + addCriterion("event_id =", value, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdNotEqualTo(Long value) { + addCriterion("event_id <>", value, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdGreaterThan(Long value) { + addCriterion("event_id >", value, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdGreaterThanOrEqualTo(Long value) { + addCriterion("event_id >=", value, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdLessThan(Long value) { + addCriterion("event_id <", value, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdLessThanOrEqualTo(Long value) { + addCriterion("event_id <=", value, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdIn(List values) { + addCriterion("event_id in", values, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdNotIn(List values) { + addCriterion("event_id not in", values, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdBetween(Long value1, Long value2) { + addCriterion("event_id between", value1, value2, "eventId"); + return (Criteria) this; + } + + public Criteria andEventIdNotBetween(Long value1, Long value2) { + addCriterion("event_id not between", value1, value2, "eventId"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNull() { + addCriterion("document_id is null"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNotNull() { + addCriterion("document_id is not null"); + return (Criteria) this; + } + + public Criteria andDocumentIdEqualTo(String value) { + addCriterion("document_id =", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotEqualTo(String value) { + addCriterion("document_id <>", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThan(String value) { + addCriterion("document_id >", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { + addCriterion("document_id >=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThan(String value) { + addCriterion("document_id <", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThanOrEqualTo(String value) { + addCriterion("document_id <=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLike(String value) { + addCriterion("document_id like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotLike(String value) { + addCriterion("document_id not like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdIn(List values) { + addCriterion("document_id in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotIn(List values) { + addCriterion("document_id not in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdBetween(String value1, String value2) { + addCriterion("document_id between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotBetween(String value1, String value2) { + addCriterion("document_id not between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdIsNull() { + addCriterion("base_entity_id is null"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdIsNotNull() { + addCriterion("base_entity_id is not null"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdEqualTo(String value) { + addCriterion("base_entity_id =", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotEqualTo(String value) { + addCriterion("base_entity_id <>", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdGreaterThan(String value) { + addCriterion("base_entity_id >", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdGreaterThanOrEqualTo(String value) { + addCriterion("base_entity_id >=", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdLessThan(String value) { + addCriterion("base_entity_id <", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdLessThanOrEqualTo(String value) { + addCriterion("base_entity_id <=", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdLike(String value) { + addCriterion("base_entity_id like", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotLike(String value) { + addCriterion("base_entity_id not like", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdIn(List values) { + addCriterion("base_entity_id in", values, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotIn(List values) { + addCriterion("base_entity_id not in", values, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdBetween(String value1, String value2) { + addCriterion("base_entity_id between", value1, value2, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotBetween(String value1, String value2) { + addCriterion("base_entity_id not between", value1, value2, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdIsNull() { + addCriterion("form_submission_id is null"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdIsNotNull() { + addCriterion("form_submission_id is not null"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdEqualTo(String value) { + addCriterion("form_submission_id =", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdNotEqualTo(String value) { + addCriterion("form_submission_id <>", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdGreaterThan(String value) { + addCriterion("form_submission_id >", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdGreaterThanOrEqualTo(String value) { + addCriterion("form_submission_id >=", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdLessThan(String value) { + addCriterion("form_submission_id <", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdLessThanOrEqualTo(String value) { + addCriterion("form_submission_id <=", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdLike(String value) { + addCriterion("form_submission_id like", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdNotLike(String value) { + addCriterion("form_submission_id not like", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdIn(List values) { + addCriterion("form_submission_id in", values, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdNotIn(List values) { + addCriterion("form_submission_id not in", values, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdBetween(String value1, String value2) { + addCriterion("form_submission_id between", value1, value2, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdNotBetween(String value1, String value2) { + addCriterion("form_submission_id not between", value1, value2, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidIsNull() { + addCriterion("openmrs_uuid is null"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidIsNotNull() { + addCriterion("openmrs_uuid is not null"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidEqualTo(String value) { + addCriterion("openmrs_uuid =", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidNotEqualTo(String value) { + addCriterion("openmrs_uuid <>", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidGreaterThan(String value) { + addCriterion("openmrs_uuid >", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidGreaterThanOrEqualTo(String value) { + addCriterion("openmrs_uuid >=", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidLessThan(String value) { + addCriterion("openmrs_uuid <", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidLessThanOrEqualTo(String value) { + addCriterion("openmrs_uuid <=", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidLike(String value) { + addCriterion("openmrs_uuid like", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidNotLike(String value) { + addCriterion("openmrs_uuid not like", value, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidIn(List values) { + addCriterion("openmrs_uuid in", values, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidNotIn(List values) { + addCriterion("openmrs_uuid not in", values, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidBetween(String value1, String value2) { + addCriterion("openmrs_uuid between", value1, value2, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andOpenmrsUuidNotBetween(String value1, String value2) { + addCriterion("openmrs_uuid not between", value1, value2, "openmrsUuid"); + return (Criteria) this; + } + + public Criteria andEventTypeIsNull() { + addCriterion("event_type is null"); + return (Criteria) this; + } + + public Criteria andEventTypeIsNotNull() { + addCriterion("event_type is not null"); + return (Criteria) this; + } + + public Criteria andEventTypeEqualTo(String value) { + addCriterion("event_type =", value, "eventType"); + return (Criteria) this; + } + + public Criteria andEventTypeNotEqualTo(String value) { + addCriterion("event_type <>", value, "eventType"); + return (Criteria) this; + } + + public Criteria andEventTypeGreaterThan(String value) { + addCriterion("event_type >", value, "eventType"); + return (Criteria) this; + } + + public Criteria andEventTypeGreaterThanOrEqualTo(String value) { + addCriterion("event_type >=", value, "eventType"); + return (Criteria) this; + } + + public Criteria andEventTypeLessThan(String value) { + addCriterion("event_type <", value, "eventType"); + return (Criteria) this; + } + + public Criteria andEventTypeLessThanOrEqualTo(String value) { + addCriterion("event_type <=", value, "eventType"); + return (Criteria) this; + } + + public Criteria andEventTypeLike(String value) { + addCriterion("event_type like", value, "eventType"); + return (Criteria) this; + } + + public Criteria andEventTypeNotLike(String value) { + addCriterion("event_type not like", value, "eventType"); + return (Criteria) this; + } + + public Criteria andEventTypeIn(List values) { + addCriterion("event_type in", values, "eventType"); + return (Criteria) this; + } + + public Criteria andEventTypeNotIn(List values) { + addCriterion("event_type not in", values, "eventType"); + return (Criteria) this; + } + + public Criteria andEventTypeBetween(String value1, String value2) { + addCriterion("event_type between", value1, value2, "eventType"); + return (Criteria) this; + } + + public Criteria andEventTypeNotBetween(String value1, String value2) { + addCriterion("event_type not between", value1, value2, "eventType"); + return (Criteria) this; + } + + public Criteria andEventDateIsNull() { + addCriterion("event_date is null"); + return (Criteria) this; + } + + public Criteria andEventDateIsNotNull() { + addCriterion("event_date is not null"); + return (Criteria) this; + } + + public Criteria andEventDateEqualTo(Date value) { + addCriterion("event_date =", value, "eventDate"); + return (Criteria) this; + } + + public Criteria andEventDateNotEqualTo(Date value) { + addCriterion("event_date <>", value, "eventDate"); + return (Criteria) this; + } + + public Criteria andEventDateGreaterThan(Date value) { + addCriterion("event_date >", value, "eventDate"); + return (Criteria) this; + } + + public Criteria andEventDateGreaterThanOrEqualTo(Date value) { + addCriterion("event_date >=", value, "eventDate"); + return (Criteria) this; + } + + public Criteria andEventDateLessThan(Date value) { + addCriterion("event_date <", value, "eventDate"); + return (Criteria) this; + } + + public Criteria andEventDateLessThanOrEqualTo(Date value) { + addCriterion("event_date <=", value, "eventDate"); + return (Criteria) this; + } + + public Criteria andEventDateIn(List values) { + addCriterion("event_date in", values, "eventDate"); + return (Criteria) this; + } + + public Criteria andEventDateNotIn(List values) { + addCriterion("event_date not in", values, "eventDate"); + return (Criteria) this; + } + + public Criteria andEventDateBetween(Date value1, Date value2) { + addCriterion("event_date between", value1, value2, "eventDate"); + return (Criteria) this; + } + + public Criteria andEventDateNotBetween(Date value1, Date value2) { + addCriterion("event_date not between", value1, value2, "eventDate"); + return (Criteria) this; + } + + public Criteria andEntityTypeIsNull() { + addCriterion("entity_type is null"); + return (Criteria) this; + } + + public Criteria andEntityTypeIsNotNull() { + addCriterion("entity_type is not null"); + return (Criteria) this; + } + + public Criteria andEntityTypeEqualTo(String value) { + addCriterion("entity_type =", value, "entityType"); + return (Criteria) this; + } + + public Criteria andEntityTypeNotEqualTo(String value) { + addCriterion("entity_type <>", value, "entityType"); + return (Criteria) this; + } + + public Criteria andEntityTypeGreaterThan(String value) { + addCriterion("entity_type >", value, "entityType"); + return (Criteria) this; + } + + public Criteria andEntityTypeGreaterThanOrEqualTo(String value) { + addCriterion("entity_type >=", value, "entityType"); + return (Criteria) this; + } + + public Criteria andEntityTypeLessThan(String value) { + addCriterion("entity_type <", value, "entityType"); + return (Criteria) this; + } + + public Criteria andEntityTypeLessThanOrEqualTo(String value) { + addCriterion("entity_type <=", value, "entityType"); + return (Criteria) this; + } + + public Criteria andEntityTypeLike(String value) { + addCriterion("entity_type like", value, "entityType"); + return (Criteria) this; + } + + public Criteria andEntityTypeNotLike(String value) { + addCriterion("entity_type not like", value, "entityType"); + return (Criteria) this; + } + + public Criteria andEntityTypeIn(List values) { + addCriterion("entity_type in", values, "entityType"); + return (Criteria) this; + } + + public Criteria andEntityTypeNotIn(List values) { + addCriterion("entity_type not in", values, "entityType"); + return (Criteria) this; + } + + public Criteria andEntityTypeBetween(String value1, String value2) { + addCriterion("entity_type between", value1, value2, "entityType"); + return (Criteria) this; + } + + public Criteria andEntityTypeNotBetween(String value1, String value2) { + addCriterion("entity_type not between", value1, value2, "entityType"); + return (Criteria) this; + } + + public Criteria andProviderIdIsNull() { + addCriterion("provider_id is null"); + return (Criteria) this; + } + + public Criteria andProviderIdIsNotNull() { + addCriterion("provider_id is not null"); + return (Criteria) this; + } + + public Criteria andProviderIdEqualTo(String value) { + addCriterion("provider_id =", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotEqualTo(String value) { + addCriterion("provider_id <>", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdGreaterThan(String value) { + addCriterion("provider_id >", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdGreaterThanOrEqualTo(String value) { + addCriterion("provider_id >=", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdLessThan(String value) { + addCriterion("provider_id <", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdLessThanOrEqualTo(String value) { + addCriterion("provider_id <=", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdLike(String value) { + addCriterion("provider_id like", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotLike(String value) { + addCriterion("provider_id not like", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdIn(List values) { + addCriterion("provider_id in", values, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotIn(List values) { + addCriterion("provider_id not in", values, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdBetween(String value1, String value2) { + addCriterion("provider_id between", value1, value2, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotBetween(String value1, String value2) { + addCriterion("provider_id not between", value1, value2, "providerId"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNull() { + addCriterion("location_id is null"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNotNull() { + addCriterion("location_id is not null"); + return (Criteria) this; + } + + public Criteria andLocationIdEqualTo(String value) { + addCriterion("location_id =", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotEqualTo(String value) { + addCriterion("location_id <>", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThan(String value) { + addCriterion("location_id >", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThanOrEqualTo(String value) { + addCriterion("location_id >=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThan(String value) { + addCriterion("location_id <", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThanOrEqualTo(String value) { + addCriterion("location_id <=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLike(String value) { + addCriterion("location_id like", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotLike(String value) { + addCriterion("location_id not like", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdIn(List values) { + addCriterion("location_id in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotIn(List values) { + addCriterion("location_id not in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdBetween(String value1, String value2) { + addCriterion("location_id between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotBetween(String value1, String value2) { + addCriterion("location_id not between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andTeamIsNull() { + addCriterion("team is null"); + return (Criteria) this; + } + + public Criteria andTeamIsNotNull() { + addCriterion("team is not null"); + return (Criteria) this; + } + + public Criteria andTeamEqualTo(String value) { + addCriterion("team =", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotEqualTo(String value) { + addCriterion("team <>", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamGreaterThan(String value) { + addCriterion("team >", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamGreaterThanOrEqualTo(String value) { + addCriterion("team >=", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLessThan(String value) { + addCriterion("team <", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLessThanOrEqualTo(String value) { + addCriterion("team <=", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLike(String value) { + addCriterion("team like", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotLike(String value) { + addCriterion("team not like", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamIn(List values) { + addCriterion("team in", values, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotIn(List values) { + addCriterion("team not in", values, "team"); + return (Criteria) this; + } + + public Criteria andTeamBetween(String value1, String value2) { + addCriterion("team between", value1, value2, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotBetween(String value1, String value2) { + addCriterion("team not between", value1, value2, "team"); + return (Criteria) this; + } + + public Criteria andTeamIdIsNull() { + addCriterion("team_id is null"); + return (Criteria) this; + } + + public Criteria andTeamIdIsNotNull() { + addCriterion("team_id is not null"); + return (Criteria) this; + } + + public Criteria andTeamIdEqualTo(String value) { + addCriterion("team_id =", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotEqualTo(String value) { + addCriterion("team_id <>", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdGreaterThan(String value) { + addCriterion("team_id >", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdGreaterThanOrEqualTo(String value) { + addCriterion("team_id >=", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLessThan(String value) { + addCriterion("team_id <", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLessThanOrEqualTo(String value) { + addCriterion("team_id <=", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLike(String value) { + addCriterion("team_id like", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotLike(String value) { + addCriterion("team_id not like", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdIn(List values) { + addCriterion("team_id in", values, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotIn(List values) { + addCriterion("team_id not in", values, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdBetween(String value1, String value2) { + addCriterion("team_id between", value1, value2, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotBetween(String value1, String value2) { + addCriterion("team_id not between", value1, value2, "teamId"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNull() { + addCriterion("date_created is null"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNotNull() { + addCriterion("date_created is not null"); + return (Criteria) this; + } + + public Criteria andDateCreatedEqualTo(Date value) { + addCriterion("date_created =", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotEqualTo(Date value) { + addCriterion("date_created <>", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThan(Date value) { + addCriterion("date_created >", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { + addCriterion("date_created >=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThan(Date value) { + addCriterion("date_created <", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThanOrEqualTo(Date value) { + addCriterion("date_created <=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedIn(List values) { + addCriterion("date_created in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotIn(List values) { + addCriterion("date_created not in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedBetween(Date value1, Date value2) { + addCriterion("date_created between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotBetween(Date value1, Date value2) { + addCriterion("date_created not between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNull() { + addCriterion("date_edited is null"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNotNull() { + addCriterion("date_edited is not null"); + return (Criteria) this; + } + + public Criteria andDateEditedEqualTo(Date value) { + addCriterion("date_edited =", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotEqualTo(Date value) { + addCriterion("date_edited <>", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThan(Date value) { + addCriterion("date_edited >", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { + addCriterion("date_edited >=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThan(Date value) { + addCriterion("date_edited <", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThanOrEqualTo(Date value) { + addCriterion("date_edited <=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedIn(List values) { + addCriterion("date_edited in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotIn(List values) { + addCriterion("date_edited not in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedBetween(Date value1, Date value2) { + addCriterion("date_edited between", value1, value2, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotBetween(Date value1, Date value2) { + addCriterion("date_edited not between", value1, value2, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNull() { + addCriterion("date_deleted is null"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNotNull() { + addCriterion("date_deleted is not null"); + return (Criteria) this; + } + + public Criteria andDateDeletedEqualTo(Date value) { + addCriterion("date_deleted =", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotEqualTo(Date value) { + addCriterion("date_deleted <>", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThan(Date value) { + addCriterion("date_deleted >", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { + addCriterion("date_deleted >=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThan(Date value) { + addCriterion("date_deleted <", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThanOrEqualTo(Date value) { + addCriterion("date_deleted <=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedIn(List values) { + addCriterion("date_deleted in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotIn(List values) { + addCriterion("date_deleted not in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedBetween(Date value1, Date value2) { + addCriterion("date_deleted between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotBetween(Date value1, Date value2) { + addCriterion("date_deleted not between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andPlanIdentifierIsNull() { + addCriterion("plan_identifier is null"); + return (Criteria) this; + } + + public Criteria andPlanIdentifierIsNotNull() { + addCriterion("plan_identifier is not null"); + return (Criteria) this; + } + + public Criteria andPlanIdentifierEqualTo(String value) { + addCriterion("plan_identifier =", value, "planIdentifier"); + return (Criteria) this; + } + + public Criteria andPlanIdentifierNotEqualTo(String value) { + addCriterion("plan_identifier <>", value, "planIdentifier"); + return (Criteria) this; + } + + public Criteria andPlanIdentifierGreaterThan(String value) { + addCriterion("plan_identifier >", value, "planIdentifier"); + return (Criteria) this; + } + + public Criteria andPlanIdentifierGreaterThanOrEqualTo(String value) { + addCriterion("plan_identifier >=", value, "planIdentifier"); + return (Criteria) this; + } + + public Criteria andPlanIdentifierLessThan(String value) { + addCriterion("plan_identifier <", value, "planIdentifier"); + return (Criteria) this; + } + + public Criteria andPlanIdentifierLessThanOrEqualTo(String value) { + addCriterion("plan_identifier <=", value, "planIdentifier"); + return (Criteria) this; + } + + public Criteria andPlanIdentifierLike(String value) { + addCriterion("plan_identifier like", value, "planIdentifier"); + return (Criteria) this; + } + + public Criteria andPlanIdentifierNotLike(String value) { + addCriterion("plan_identifier not like", value, "planIdentifier"); + return (Criteria) this; + } + + public Criteria andPlanIdentifierIn(List values) { + addCriterion("plan_identifier in", values, "planIdentifier"); + return (Criteria) this; + } + + public Criteria andPlanIdentifierNotIn(List values) { + addCriterion("plan_identifier not in", values, "planIdentifier"); + return (Criteria) this; + } + + public Criteria andPlanIdentifierBetween(String value1, String value2) { + addCriterion("plan_identifier between", value1, value2, "planIdentifier"); + return (Criteria) this; + } + + public Criteria andPlanIdentifierNotBetween(String value1, String value2) { + addCriterion("plan_identifier not between", value1, value2, "planIdentifier"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.event_metadata + * + * @mbg.generated do_not_delete_during_merge Wed Mar 07 18:26:22 EAT 2018 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/HouseholdClient.java b/src/main/java/org/opensrp/domain/postgres/HouseholdClient.java index 91642fea2..225646f97 100644 --- a/src/main/java/org/opensrp/domain/postgres/HouseholdClient.java +++ b/src/main/java/org/opensrp/domain/postgres/HouseholdClient.java @@ -1,55 +1,55 @@ package org.opensrp.domain.postgres; public class HouseholdClient { - - private int memebrCount; - - private String providerId; - - private String householdHead; - - private String relationalId; - - private int totalCount; - - public int getTotalCount() { - return totalCount; - } - - public void setTotalCount(int totalCount) { - this.totalCount = totalCount; - } - - public int getMemebrCount() { - return memebrCount; - } - - public void setMemebrCount(int memebrCount) { - this.memebrCount = memebrCount; - } - - public String getProviderId() { - return providerId; - } - - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - public String getHouseholdHead() { - return householdHead; - } - - public void setHouseholdHead(String householdHead) { - this.householdHead = householdHead; - } - - public String getRelationalId() { - return relationalId; - } - - public void setRelationalId(String relationalId) { - this.relationalId = relationalId; - } - + + private int memebrCount; + + private String providerId; + + private String householdHead; + + private String relationalId; + + private int totalCount; + + public int getTotalCount() { + return totalCount; + } + + public void setTotalCount(int totalCount) { + this.totalCount = totalCount; + } + + public int getMemebrCount() { + return memebrCount; + } + + public void setMemebrCount(int memebrCount) { + this.memebrCount = memebrCount; + } + + public String getProviderId() { + return providerId; + } + + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + public String getHouseholdHead() { + return householdHead; + } + + public void setHouseholdHead(String householdHead) { + this.householdHead = householdHead; + } + + public String getRelationalId() { + return relationalId; + } + + public void setRelationalId(String relationalId) { + this.relationalId = relationalId; + } + } diff --git a/src/main/java/org/opensrp/domain/postgres/IdentifierSource.java b/src/main/java/org/opensrp/domain/postgres/IdentifierSource.java index 6e045eea5..6a4dc2065 100644 --- a/src/main/java/org/opensrp/domain/postgres/IdentifierSource.java +++ b/src/main/java/org/opensrp/domain/postgres/IdentifierSource.java @@ -2,367 +2,345 @@ public class IdentifierSource { - /** - * + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.identifier_source.id * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - private Long id; - /** - * + */ + private Long id; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.identifier_source.identifier * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - private String identifier; - /** - * + */ + private String identifier; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.identifier_source.description * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - private String description; - /** - * + */ + private String description; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.identifier_source.identifier_validator_algorithm * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - private String identifierValidatorAlgorithm; - /** - * + */ + private String identifierValidatorAlgorithm; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.identifier_source.base_character_set * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - private String baseCharacterSet; - /** - * + */ + private String baseCharacterSet; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.identifier_source.first_identifier_base * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - private String firstIdentifierBase; - /** - * + */ + private String firstIdentifierBase; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.identifier_source.prefix * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - private String prefix; - /** - * + */ + private String prefix; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.identifier_source.suffix * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - private String suffix; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.identifier_source.min_length - * @mbg.generated Wed May 20 16:35:12 PKT 2020 - */ - private Integer minLength; - /** - * + */ + private String suffix; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.identifier_source.min_length + * + * @mbg.generated Wed May 20 16:35:12 PKT 2020 + */ + private Integer minLength; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.identifier_source.max_length * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - private Integer maxLength; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.identifier_source.regex_format - * @mbg.generated Fri May 29 12:36:10 PKT 2020 - */ - private String regexFormat; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.identifier_source.sequence_value - * @mbg.generated Tue Sep 29 13:52:35 PKT 2020 - */ - private Long sequenceValue; + */ + private Integer maxLength; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.identifier_source.regex_format + * + * @mbg.generated Fri May 29 12:36:10 PKT 2020 + */ + private String regexFormat; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.identifier_source.sequence_value + * + * @mbg.generated Tue Sep 29 13:52:35 PKT 2020 + */ + private Long sequenceValue; - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.identifier_source.id * - * @return the value of core.identifier_source.id - * + * @return the value of core.identifier_source.id * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public Long getId() { - return id; - } + */ + public Long getId() { + return id; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.identifier_source.id * - * @param id the value for core.identifier_source.id - * + * @param id the value for core.identifier_source.id * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public void setId(Long id) { - this.id = id; - } + */ + public void setId(Long id) { + this.id = id; + } - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.identifier_source.identifier * - * @return the value of core.identifier_source.identifier - * + * @return the value of core.identifier_source.identifier * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public String getIdentifier() { - return identifier; - } + */ + public String getIdentifier() { + return identifier; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.identifier_source.identifier * - * @param identifier the value for core.identifier_source.identifier - * + * @param identifier the value for core.identifier_source.identifier * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public void setIdentifier(String identifier) { - this.identifier = identifier; - } + */ + public void setIdentifier(String identifier) { + this.identifier = identifier; + } - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.identifier_source.description * - * @return the value of core.identifier_source.description - * + * @return the value of core.identifier_source.description * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public String getDescription() { - return description; - } + */ + public String getDescription() { + return description; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.identifier_source.description * - * @param description the value for core.identifier_source.description - * + * @param description the value for core.identifier_source.description * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public void setDescription(String description) { - this.description = description; - } + */ + public void setDescription(String description) { + this.description = description; + } - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.identifier_source.identifier_validator_algorithm * - * @return the value of core.identifier_source.identifier_validator_algorithm - * + * @return the value of core.identifier_source.identifier_validator_algorithm * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public String getIdentifierValidatorAlgorithm() { - return identifierValidatorAlgorithm; - } + */ + public String getIdentifierValidatorAlgorithm() { + return identifierValidatorAlgorithm; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.identifier_source.identifier_validator_algorithm * - * @param identifierValidatorAlgorithm the value for core.identifier_source.identifier_validator_algorithm - * + * @param identifierValidatorAlgorithm the value for core.identifier_source.identifier_validator_algorithm * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public void setIdentifierValidatorAlgorithm(String identifierValidatorAlgorithm) { - this.identifierValidatorAlgorithm = identifierValidatorAlgorithm; - } + */ + public void setIdentifierValidatorAlgorithm(String identifierValidatorAlgorithm) { + this.identifierValidatorAlgorithm = identifierValidatorAlgorithm; + } - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.identifier_source.base_character_set * - * @return the value of core.identifier_source.base_character_set - * + * @return the value of core.identifier_source.base_character_set * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public String getBaseCharacterSet() { - return baseCharacterSet; - } + */ + public String getBaseCharacterSet() { + return baseCharacterSet; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.identifier_source.base_character_set * - * @param baseCharacterSet the value for core.identifier_source.base_character_set - * + * @param baseCharacterSet the value for core.identifier_source.base_character_set * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public void setBaseCharacterSet(String baseCharacterSet) { - this.baseCharacterSet = baseCharacterSet; - } + */ + public void setBaseCharacterSet(String baseCharacterSet) { + this.baseCharacterSet = baseCharacterSet; + } - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.identifier_source.first_identifier_base * - * @return the value of core.identifier_source.first_identifier_base - * + * @return the value of core.identifier_source.first_identifier_base * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public String getFirstIdentifierBase() { - return firstIdentifierBase; - } + */ + public String getFirstIdentifierBase() { + return firstIdentifierBase; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.identifier_source.first_identifier_base * - * @param firstIdentifierBase the value for core.identifier_source.first_identifier_base - * + * @param firstIdentifierBase the value for core.identifier_source.first_identifier_base * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public void setFirstIdentifierBase(String firstIdentifierBase) { - this.firstIdentifierBase = firstIdentifierBase; - } + */ + public void setFirstIdentifierBase(String firstIdentifierBase) { + this.firstIdentifierBase = firstIdentifierBase; + } - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.identifier_source.prefix * - * @return the value of core.identifier_source.prefix - * + * @return the value of core.identifier_source.prefix * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public String getPrefix() { - return prefix; - } + */ + public String getPrefix() { + return prefix; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.identifier_source.prefix * - * @param prefix the value for core.identifier_source.prefix - * + * @param prefix the value for core.identifier_source.prefix * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public void setPrefix(String prefix) { - this.prefix = prefix; - } + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.identifier_source.suffix * - * @return the value of core.identifier_source.suffix - * + * @return the value of core.identifier_source.suffix * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public String getSuffix() { - return suffix; - } + */ + public String getSuffix() { + return suffix; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.identifier_source.suffix * - * @param suffix the value for core.identifier_source.suffix - * + * @param suffix the value for core.identifier_source.suffix * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public void setSuffix(String suffix) { - this.suffix = suffix; - } + */ + public void setSuffix(String suffix) { + this.suffix = suffix; + } - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.identifier_source.min_length * - * @return the value of core.identifier_source.min_length - * + * @return the value of core.identifier_source.min_length * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public Integer getMinLength() { - return minLength; - } + */ + public Integer getMinLength() { + return minLength; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.identifier_source.min_length * - * @param minLength the value for core.identifier_source.min_length - * + * @param minLength the value for core.identifier_source.min_length * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public void setMinLength(Integer minLength) { - this.minLength = minLength; - } + */ + public void setMinLength(Integer minLength) { + this.minLength = minLength; + } - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.identifier_source.max_length * - * @return the value of core.identifier_source.max_length - * + * @return the value of core.identifier_source.max_length * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public Integer getMaxLength() { - return maxLength; - } + */ + public Integer getMaxLength() { + return maxLength; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.identifier_source.max_length * - * @param maxLength the value for core.identifier_source.max_length - * + * @param maxLength the value for core.identifier_source.max_length * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public void setMaxLength(Integer maxLength) { - this.maxLength = maxLength; - } + */ + public void setMaxLength(Integer maxLength) { + this.maxLength = maxLength; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.identifier_source.regex_format - * @return the value of core.identifier_source.regex_format - * @mbg.generated Fri May 29 12:36:10 PKT 2020 - */ - public String getRegexFormat() { - return regexFormat; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.identifier_source.regex_format + * + * @return the value of core.identifier_source.regex_format + * @mbg.generated Fri May 29 12:36:10 PKT 2020 + */ + public String getRegexFormat() { + return regexFormat; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.identifier_source.regex_format - * @param regexFormat the value for core.identifier_source.regex_format - * @mbg.generated Fri May 29 12:36:10 PKT 2020 - */ - public void setRegexFormat(String regexFormat) { - this.regexFormat = regexFormat; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.identifier_source.regex_format + * + * @param regexFormat the value for core.identifier_source.regex_format + * @mbg.generated Fri May 29 12:36:10 PKT 2020 + */ + public void setRegexFormat(String regexFormat) { + this.regexFormat = regexFormat; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.identifier_source.sequence_value - * @return the value of core.identifier_source.sequence_value - * @mbg.generated Tue Sep 29 13:52:35 PKT 2020 - */ - public Long getSequenceValue() { - return sequenceValue; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.identifier_source.sequence_value + * + * @return the value of core.identifier_source.sequence_value + * @mbg.generated Tue Sep 29 13:52:35 PKT 2020 + */ + public Long getSequenceValue() { + return sequenceValue; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.identifier_source.sequence_value - * @param sequenceValue the value for core.identifier_source.sequence_value - * @mbg.generated Tue Sep 29 13:52:35 PKT 2020 - */ - public void setSequenceValue(Long sequenceValue) { - this.sequenceValue = sequenceValue; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.identifier_source.sequence_value + * + * @param sequenceValue the value for core.identifier_source.sequence_value + * @mbg.generated Tue Sep 29 13:52:35 PKT 2020 + */ + public void setSequenceValue(Long sequenceValue) { + this.sequenceValue = sequenceValue; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/IdentifierSourceExample.java b/src/main/java/org/opensrp/domain/postgres/IdentifierSourceExample.java index 94d771ce4..f3220c140 100644 --- a/src/main/java/org/opensrp/domain/postgres/IdentifierSourceExample.java +++ b/src/main/java/org/opensrp/domain/postgres/IdentifierSourceExample.java @@ -9,1074 +9,1075 @@ public class IdentifierSourceExample { * This field corresponds to the database table core.identifier_source * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - protected String orderByClause; - /** + */ + protected String orderByClause; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database table core.identifier_source * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - protected boolean distinct; - /** + */ + protected boolean distinct; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database table core.identifier_source * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - protected List oredCriteria; + */ + protected List oredCriteria; - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.identifier_source * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public IdentifierSourceExample() { - oredCriteria = new ArrayList<>(); - } + */ + public IdentifierSourceExample() { + oredCriteria = new ArrayList<>(); + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.identifier_source * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } + */ + public String getOrderByClause() { + return orderByClause; + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.identifier_source * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.identifier_source * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } + */ + public boolean isDistinct() { + return distinct; + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.identifier_source * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public boolean isDistinct() { - return distinct; - } + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.identifier_source * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } + */ + public List getOredCriteria() { + return oredCriteria; + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.identifier_source * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.identifier_source * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.identifier_source * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.identifier_source * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.identifier_source * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** * This class was generated by MyBatis Generator. * This class corresponds to the database table core.identifier_source * * @mbg.generated Fri May 08 15:20:02 PKT 2020 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNull() { - addCriterion("identifier is null"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNotNull() { - addCriterion("identifier is not null"); - return (Criteria) this; - } - - public Criteria andIdentifierEqualTo(String value) { - addCriterion("identifier =", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotEqualTo(String value) { - addCriterion("identifier <>", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThan(String value) { - addCriterion("identifier >", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThanOrEqualTo(String value) { - addCriterion("identifier >=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThan(String value) { - addCriterion("identifier <", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThanOrEqualTo(String value) { - addCriterion("identifier <=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLike(String value) { - addCriterion("identifier like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotLike(String value) { - addCriterion("identifier not like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierIn(List values) { - addCriterion("identifier in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotIn(List values) { - addCriterion("identifier not in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierBetween(String value1, String value2) { - addCriterion("identifier between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotBetween(String value1, String value2) { - addCriterion("identifier not between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andDescriptionIsNull() { - addCriterion("description is null"); - return (Criteria) this; - } - - public Criteria andDescriptionIsNotNull() { - addCriterion("description is not null"); - return (Criteria) this; - } - - public Criteria andDescriptionEqualTo(String value) { - addCriterion("description =", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotEqualTo(String value) { - addCriterion("description <>", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionGreaterThan(String value) { - addCriterion("description >", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionGreaterThanOrEqualTo(String value) { - addCriterion("description >=", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLessThan(String value) { - addCriterion("description <", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLessThanOrEqualTo(String value) { - addCriterion("description <=", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLike(String value) { - addCriterion("description like", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotLike(String value) { - addCriterion("description not like", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionIn(List values) { - addCriterion("description in", values, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotIn(List values) { - addCriterion("description not in", values, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionBetween(String value1, String value2) { - addCriterion("description between", value1, value2, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotBetween(String value1, String value2) { - addCriterion("description not between", value1, value2, "description"); - return (Criteria) this; - } - - public Criteria andIdentifierValidatorAlgorithmIsNull() { - addCriterion("identifier_validator_algorithm is null"); - return (Criteria) this; - } - - public Criteria andIdentifierValidatorAlgorithmIsNotNull() { - addCriterion("identifier_validator_algorithm is not null"); - return (Criteria) this; - } - - public Criteria andIdentifierValidatorAlgorithmEqualTo(String value) { - addCriterion("identifier_validator_algorithm =", value, "identifierValidatorAlgorithm"); - return (Criteria) this; - } - - public Criteria andIdentifierValidatorAlgorithmNotEqualTo(String value) { - addCriterion("identifier_validator_algorithm <>", value, "identifierValidatorAlgorithm"); - return (Criteria) this; - } - - public Criteria andIdentifierValidatorAlgorithmGreaterThan(String value) { - addCriterion("identifier_validator_algorithm >", value, "identifierValidatorAlgorithm"); - return (Criteria) this; - } - - public Criteria andIdentifierValidatorAlgorithmGreaterThanOrEqualTo(String value) { - addCriterion("identifier_validator_algorithm >=", value, "identifierValidatorAlgorithm"); - return (Criteria) this; - } - - public Criteria andIdentifierValidatorAlgorithmLessThan(String value) { - addCriterion("identifier_validator_algorithm <", value, "identifierValidatorAlgorithm"); - return (Criteria) this; - } - - public Criteria andIdentifierValidatorAlgorithmLessThanOrEqualTo(String value) { - addCriterion("identifier_validator_algorithm <=", value, "identifierValidatorAlgorithm"); - return (Criteria) this; - } - - public Criteria andIdentifierValidatorAlgorithmLike(String value) { - addCriterion("identifier_validator_algorithm like", value, "identifierValidatorAlgorithm"); - return (Criteria) this; - } - - public Criteria andIdentifierValidatorAlgorithmNotLike(String value) { - addCriterion("identifier_validator_algorithm not like", value, "identifierValidatorAlgorithm"); - return (Criteria) this; - } - - public Criteria andIdentifierValidatorAlgorithmIn(List values) { - addCriterion("identifier_validator_algorithm in", values, "identifierValidatorAlgorithm"); - return (Criteria) this; - } - - public Criteria andIdentifierValidatorAlgorithmNotIn(List values) { - addCriterion("identifier_validator_algorithm not in", values, "identifierValidatorAlgorithm"); - return (Criteria) this; - } - - public Criteria andIdentifierValidatorAlgorithmBetween(String value1, String value2) { - addCriterion("identifier_validator_algorithm between", value1, value2, "identifierValidatorAlgorithm"); - return (Criteria) this; - } - - public Criteria andIdentifierValidatorAlgorithmNotBetween(String value1, String value2) { - addCriterion("identifier_validator_algorithm not between", value1, value2, "identifierValidatorAlgorithm"); - return (Criteria) this; - } - - public Criteria andBaseCharacterSetIsNull() { - addCriterion("base_character_set is null"); - return (Criteria) this; - } - - public Criteria andBaseCharacterSetIsNotNull() { - addCriterion("base_character_set is not null"); - return (Criteria) this; - } - - public Criteria andBaseCharacterSetEqualTo(String value) { - addCriterion("base_character_set =", value, "baseCharacterSet"); - return (Criteria) this; - } - - public Criteria andBaseCharacterSetNotEqualTo(String value) { - addCriterion("base_character_set <>", value, "baseCharacterSet"); - return (Criteria) this; - } - - public Criteria andBaseCharacterSetGreaterThan(String value) { - addCriterion("base_character_set >", value, "baseCharacterSet"); - return (Criteria) this; - } - - public Criteria andBaseCharacterSetGreaterThanOrEqualTo(String value) { - addCriterion("base_character_set >=", value, "baseCharacterSet"); - return (Criteria) this; - } - - public Criteria andBaseCharacterSetLessThan(String value) { - addCriterion("base_character_set <", value, "baseCharacterSet"); - return (Criteria) this; - } - - public Criteria andBaseCharacterSetLessThanOrEqualTo(String value) { - addCriterion("base_character_set <=", value, "baseCharacterSet"); - return (Criteria) this; - } - - public Criteria andBaseCharacterSetLike(String value) { - addCriterion("base_character_set like", value, "baseCharacterSet"); - return (Criteria) this; - } - - public Criteria andBaseCharacterSetNotLike(String value) { - addCriterion("base_character_set not like", value, "baseCharacterSet"); - return (Criteria) this; - } - - public Criteria andBaseCharacterSetIn(List values) { - addCriterion("base_character_set in", values, "baseCharacterSet"); - return (Criteria) this; - } - - public Criteria andBaseCharacterSetNotIn(List values) { - addCriterion("base_character_set not in", values, "baseCharacterSet"); - return (Criteria) this; - } - - public Criteria andBaseCharacterSetBetween(String value1, String value2) { - addCriterion("base_character_set between", value1, value2, "baseCharacterSet"); - return (Criteria) this; - } - - public Criteria andBaseCharacterSetNotBetween(String value1, String value2) { - addCriterion("base_character_set not between", value1, value2, "baseCharacterSet"); - return (Criteria) this; - } - - public Criteria andFirstIdentifierBaseIsNull() { - addCriterion("first_identifier_base is null"); - return (Criteria) this; - } - - public Criteria andFirstIdentifierBaseIsNotNull() { - addCriterion("first_identifier_base is not null"); - return (Criteria) this; - } - - public Criteria andFirstIdentifierBaseEqualTo(String value) { - addCriterion("first_identifier_base =", value, "firstIdentifierBase"); - return (Criteria) this; - } - - public Criteria andFirstIdentifierBaseNotEqualTo(String value) { - addCriterion("first_identifier_base <>", value, "firstIdentifierBase"); - return (Criteria) this; - } - - public Criteria andFirstIdentifierBaseGreaterThan(String value) { - addCriterion("first_identifier_base >", value, "firstIdentifierBase"); - return (Criteria) this; - } - - public Criteria andFirstIdentifierBaseGreaterThanOrEqualTo(String value) { - addCriterion("first_identifier_base >=", value, "firstIdentifierBase"); - return (Criteria) this; - } - - public Criteria andFirstIdentifierBaseLessThan(String value) { - addCriterion("first_identifier_base <", value, "firstIdentifierBase"); - return (Criteria) this; - } - - public Criteria andFirstIdentifierBaseLessThanOrEqualTo(String value) { - addCriterion("first_identifier_base <=", value, "firstIdentifierBase"); - return (Criteria) this; - } - - public Criteria andFirstIdentifierBaseLike(String value) { - addCriterion("first_identifier_base like", value, "firstIdentifierBase"); - return (Criteria) this; - } - - public Criteria andFirstIdentifierBaseNotLike(String value) { - addCriterion("first_identifier_base not like", value, "firstIdentifierBase"); - return (Criteria) this; - } - - public Criteria andFirstIdentifierBaseIn(List values) { - addCriterion("first_identifier_base in", values, "firstIdentifierBase"); - return (Criteria) this; - } - - public Criteria andFirstIdentifierBaseNotIn(List values) { - addCriterion("first_identifier_base not in", values, "firstIdentifierBase"); - return (Criteria) this; - } - - public Criteria andFirstIdentifierBaseBetween(String value1, String value2) { - addCriterion("first_identifier_base between", value1, value2, "firstIdentifierBase"); - return (Criteria) this; - } - - public Criteria andFirstIdentifierBaseNotBetween(String value1, String value2) { - addCriterion("first_identifier_base not between", value1, value2, "firstIdentifierBase"); - return (Criteria) this; - } - - public Criteria andPrefixIsNull() { - addCriterion("prefix is null"); - return (Criteria) this; - } - - public Criteria andPrefixIsNotNull() { - addCriterion("prefix is not null"); - return (Criteria) this; - } - - public Criteria andPrefixEqualTo(String value) { - addCriterion("prefix =", value, "prefix"); - return (Criteria) this; - } - - public Criteria andPrefixNotEqualTo(String value) { - addCriterion("prefix <>", value, "prefix"); - return (Criteria) this; - } - - public Criteria andPrefixGreaterThan(String value) { - addCriterion("prefix >", value, "prefix"); - return (Criteria) this; - } - - public Criteria andPrefixGreaterThanOrEqualTo(String value) { - addCriterion("prefix >=", value, "prefix"); - return (Criteria) this; - } - - public Criteria andPrefixLessThan(String value) { - addCriterion("prefix <", value, "prefix"); - return (Criteria) this; - } - - public Criteria andPrefixLessThanOrEqualTo(String value) { - addCriterion("prefix <=", value, "prefix"); - return (Criteria) this; - } - - public Criteria andPrefixLike(String value) { - addCriterion("prefix like", value, "prefix"); - return (Criteria) this; - } - - public Criteria andPrefixNotLike(String value) { - addCriterion("prefix not like", value, "prefix"); - return (Criteria) this; - } - - public Criteria andPrefixIn(List values) { - addCriterion("prefix in", values, "prefix"); - return (Criteria) this; - } - - public Criteria andPrefixNotIn(List values) { - addCriterion("prefix not in", values, "prefix"); - return (Criteria) this; - } - - public Criteria andPrefixBetween(String value1, String value2) { - addCriterion("prefix between", value1, value2, "prefix"); - return (Criteria) this; - } - - public Criteria andPrefixNotBetween(String value1, String value2) { - addCriterion("prefix not between", value1, value2, "prefix"); - return (Criteria) this; - } - - public Criteria andSuffixIsNull() { - addCriterion("suffix is null"); - return (Criteria) this; - } - - public Criteria andSuffixIsNotNull() { - addCriterion("suffix is not null"); - return (Criteria) this; - } - - public Criteria andSuffixEqualTo(String value) { - addCriterion("suffix =", value, "suffix"); - return (Criteria) this; - } - - public Criteria andSuffixNotEqualTo(String value) { - addCriterion("suffix <>", value, "suffix"); - return (Criteria) this; - } - - public Criteria andSuffixGreaterThan(String value) { - addCriterion("suffix >", value, "suffix"); - return (Criteria) this; - } - - public Criteria andSuffixGreaterThanOrEqualTo(String value) { - addCriterion("suffix >=", value, "suffix"); - return (Criteria) this; - } - - public Criteria andSuffixLessThan(String value) { - addCriterion("suffix <", value, "suffix"); - return (Criteria) this; - } - - public Criteria andSuffixLessThanOrEqualTo(String value) { - addCriterion("suffix <=", value, "suffix"); - return (Criteria) this; - } - - public Criteria andSuffixLike(String value) { - addCriterion("suffix like", value, "suffix"); - return (Criteria) this; - } - - public Criteria andSuffixNotLike(String value) { - addCriterion("suffix not like", value, "suffix"); - return (Criteria) this; - } - - public Criteria andSuffixIn(List values) { - addCriterion("suffix in", values, "suffix"); - return (Criteria) this; - } - - public Criteria andSuffixNotIn(List values) { - addCriterion("suffix not in", values, "suffix"); - return (Criteria) this; - } - - public Criteria andSuffixBetween(String value1, String value2) { - addCriterion("suffix between", value1, value2, "suffix"); - return (Criteria) this; - } - - public Criteria andSuffixNotBetween(String value1, String value2) { - addCriterion("suffix not between", value1, value2, "suffix"); - return (Criteria) this; - } - - public Criteria andMinLengthIsNull() { - addCriterion("min_length is null"); - return (Criteria) this; - } - - public Criteria andMinLengthIsNotNull() { - addCriterion("min_length is not null"); - return (Criteria) this; - } - - public Criteria andMinLengthEqualTo(Integer value) { - addCriterion("min_length =", value, "minLength"); - return (Criteria) this; - } - - public Criteria andMinLengthNotEqualTo(Integer value) { - addCriterion("min_length <>", value, "minLength"); - return (Criteria) this; - } - - public Criteria andMinLengthGreaterThan(Integer value) { - addCriterion("min_length >", value, "minLength"); - return (Criteria) this; - } - - public Criteria andMinLengthGreaterThanOrEqualTo(Integer value) { - addCriterion("min_length >=", value, "minLength"); - return (Criteria) this; - } - - public Criteria andMinLengthLessThan(Integer value) { - addCriterion("min_length <", value, "minLength"); - return (Criteria) this; - } - - public Criteria andMinLengthLessThanOrEqualTo(Integer value) { - addCriterion("min_length <=", value, "minLength"); - return (Criteria) this; - } - - public Criteria andMinLengthIn(List values) { - addCriterion("min_length in", values, "minLength"); - return (Criteria) this; - } - - public Criteria andMinLengthNotIn(List values) { - addCriterion("min_length not in", values, "minLength"); - return (Criteria) this; - } - - public Criteria andMinLengthBetween(Integer value1, Integer value2) { - addCriterion("min_length between", value1, value2, "minLength"); - return (Criteria) this; - } - - public Criteria andMinLengthNotBetween(Integer value1, Integer value2) { - addCriterion("min_length not between", value1, value2, "minLength"); - return (Criteria) this; - } - - public Criteria andMaxLengthIsNull() { - addCriterion("max_length is null"); - return (Criteria) this; - } - - public Criteria andMaxLengthIsNotNull() { - addCriterion("max_length is not null"); - return (Criteria) this; - } - - public Criteria andMaxLengthEqualTo(Integer value) { - addCriterion("max_length =", value, "maxLength"); - return (Criteria) this; - } - - public Criteria andMaxLengthNotEqualTo(Integer value) { - addCriterion("max_length <>", value, "maxLength"); - return (Criteria) this; - } - - public Criteria andMaxLengthGreaterThan(Integer value) { - addCriterion("max_length >", value, "maxLength"); - return (Criteria) this; - } - - public Criteria andMaxLengthGreaterThanOrEqualTo(Integer value) { - addCriterion("max_length >=", value, "maxLength"); - return (Criteria) this; - } - - public Criteria andMaxLengthLessThan(Integer value) { - addCriterion("max_length <", value, "maxLength"); - return (Criteria) this; - } - - public Criteria andMaxLengthLessThanOrEqualTo(Integer value) { - addCriterion("max_length <=", value, "maxLength"); - return (Criteria) this; - } - - public Criteria andMaxLengthIn(List values) { - addCriterion("max_length in", values, "maxLength"); - return (Criteria) this; - } - - public Criteria andMaxLengthNotIn(List values) { - addCriterion("max_length not in", values, "maxLength"); - return (Criteria) this; - } - - public Criteria andMaxLengthBetween(Integer value1, Integer value2) { - addCriterion("max_length between", value1, value2, "maxLength"); - return (Criteria) this; - } - - public Criteria andMaxLengthNotBetween(Integer value1, Integer value2) { - addCriterion("max_length not between", value1, value2, "maxLength"); - return (Criteria) this; - } - - public Criteria andRegexFormatIsNull() { - addCriterion("regex_format is null"); - return (Criteria) this; - } - - public Criteria andRegexFormatIsNotNull() { - addCriterion("regex_format is not null"); - return (Criteria) this; - } - - public Criteria andRegexFormatEqualTo(String value) { - addCriterion("regex_format =", value, "regexFormat"); - return (Criteria) this; - } - - public Criteria andRegexFormatNotEqualTo(String value) { - addCriterion("regex_format <>", value, "regexFormat"); - return (Criteria) this; - } - - public Criteria andRegexFormatGreaterThan(String value) { - addCriterion("regex_format >", value, "regexFormat"); - return (Criteria) this; - } - - public Criteria andRegexFormatGreaterThanOrEqualTo(String value) { - addCriterion("regex_format >=", value, "regexFormat"); - return (Criteria) this; - } - - public Criteria andRegexFormatLessThan(String value) { - addCriterion("regex_format <", value, "regexFormat"); - return (Criteria) this; - } - - public Criteria andRegexFormatLessThanOrEqualTo(String value) { - addCriterion("regex_format <=", value, "regexFormat"); - return (Criteria) this; - } - - public Criteria andRegexFormatLike(String value) { - addCriterion("regex_format like", value, "regexFormat"); - return (Criteria) this; - } - - public Criteria andRegexFormatNotLike(String value) { - addCriterion("regex_format not like", value, "regexFormat"); - return (Criteria) this; - } - - public Criteria andRegexFormatIn(List values) { - addCriterion("regex_format in", values, "regexFormat"); - return (Criteria) this; - } - - public Criteria andRegexFormatNotIn(List values) { - addCriterion("regex_format not in", values, "regexFormat"); - return (Criteria) this; - } - - public Criteria andRegexFormatBetween(String value1, String value2) { - addCriterion("regex_format between", value1, value2, "regexFormat"); - return (Criteria) this; - } - - public Criteria andRegexFormatNotBetween(String value1, String value2) { - addCriterion("regex_format not between", value1, value2, "regexFormat"); - return (Criteria) this; - } - - public Criteria andSequenceValueIsNull() { - addCriterion("sequence_value is null"); - return (Criteria) this; - } - - public Criteria andSequenceValueIsNotNull() { - addCriterion("sequence_value is not null"); - return (Criteria) this; - } - - public Criteria andSequenceValueEqualTo(Long value) { - addCriterion("sequence_value =", value, "sequenceValue"); - return (Criteria) this; - } - - public Criteria andSequenceValueNotEqualTo(Long value) { - addCriterion("sequence_value <>", value, "sequenceValue"); - return (Criteria) this; - } - - public Criteria andSequenceValueGreaterThan(Long value) { - addCriterion("sequence_value >", value, "sequenceValue"); - return (Criteria) this; - } - - public Criteria andSequenceValueGreaterThanOrEqualTo(Long value) { - addCriterion("sequence_value >=", value, "sequenceValue"); - return (Criteria) this; - } - - public Criteria andSequenceValueLessThan(Long value) { - addCriterion("sequence_value <", value, "sequenceValue"); - return (Criteria) this; - } - - public Criteria andSequenceValueLessThanOrEqualTo(Long value) { - addCriterion("sequence_value <=", value, "sequenceValue"); - return (Criteria) this; - } - - public Criteria andSequenceValueIn(List values) { - addCriterion("sequence_value in", values, "sequenceValue"); - return (Criteria) this; - } - - public Criteria andSequenceValueNotIn(List values) { - addCriterion("sequence_value not in", values, "sequenceValue"); - return (Criteria) this; - } - - public Criteria andSequenceValueBetween(Long value1, Long value2) { - addCriterion("sequence_value between", value1, value2, "sequenceValue"); - return (Criteria) this; - } - - public Criteria andSequenceValueNotBetween(Long value1, Long value2) { - addCriterion("sequence_value not between", value1, value2, "sequenceValue"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.identifier_source - * @mbg.generated Wed May 20 16:35:12 PKT 2020 - */ - public static class Criterion { - private String condition; - private Object value; - private Object secondValue; - private boolean noValue; - private boolean singleValue; - private boolean betweenValue; - private boolean listValue; - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNull() { + addCriterion("identifier is null"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNotNull() { + addCriterion("identifier is not null"); + return (Criteria) this; + } + + public Criteria andIdentifierEqualTo(String value) { + addCriterion("identifier =", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotEqualTo(String value) { + addCriterion("identifier <>", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThan(String value) { + addCriterion("identifier >", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThanOrEqualTo(String value) { + addCriterion("identifier >=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThan(String value) { + addCriterion("identifier <", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThanOrEqualTo(String value) { + addCriterion("identifier <=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLike(String value) { + addCriterion("identifier like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotLike(String value) { + addCriterion("identifier not like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierIn(List values) { + addCriterion("identifier in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotIn(List values) { + addCriterion("identifier not in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierBetween(String value1, String value2) { + addCriterion("identifier between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotBetween(String value1, String value2) { + addCriterion("identifier not between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andIdentifierValidatorAlgorithmIsNull() { + addCriterion("identifier_validator_algorithm is null"); + return (Criteria) this; + } + + public Criteria andIdentifierValidatorAlgorithmIsNotNull() { + addCriterion("identifier_validator_algorithm is not null"); + return (Criteria) this; + } + + public Criteria andIdentifierValidatorAlgorithmEqualTo(String value) { + addCriterion("identifier_validator_algorithm =", value, "identifierValidatorAlgorithm"); + return (Criteria) this; + } + + public Criteria andIdentifierValidatorAlgorithmNotEqualTo(String value) { + addCriterion("identifier_validator_algorithm <>", value, "identifierValidatorAlgorithm"); + return (Criteria) this; + } + + public Criteria andIdentifierValidatorAlgorithmGreaterThan(String value) { + addCriterion("identifier_validator_algorithm >", value, "identifierValidatorAlgorithm"); + return (Criteria) this; + } + + public Criteria andIdentifierValidatorAlgorithmGreaterThanOrEqualTo(String value) { + addCriterion("identifier_validator_algorithm >=", value, "identifierValidatorAlgorithm"); + return (Criteria) this; + } + + public Criteria andIdentifierValidatorAlgorithmLessThan(String value) { + addCriterion("identifier_validator_algorithm <", value, "identifierValidatorAlgorithm"); + return (Criteria) this; + } + + public Criteria andIdentifierValidatorAlgorithmLessThanOrEqualTo(String value) { + addCriterion("identifier_validator_algorithm <=", value, "identifierValidatorAlgorithm"); + return (Criteria) this; + } + + public Criteria andIdentifierValidatorAlgorithmLike(String value) { + addCriterion("identifier_validator_algorithm like", value, "identifierValidatorAlgorithm"); + return (Criteria) this; + } + + public Criteria andIdentifierValidatorAlgorithmNotLike(String value) { + addCriterion("identifier_validator_algorithm not like", value, "identifierValidatorAlgorithm"); + return (Criteria) this; + } + + public Criteria andIdentifierValidatorAlgorithmIn(List values) { + addCriterion("identifier_validator_algorithm in", values, "identifierValidatorAlgorithm"); + return (Criteria) this; + } + + public Criteria andIdentifierValidatorAlgorithmNotIn(List values) { + addCriterion("identifier_validator_algorithm not in", values, "identifierValidatorAlgorithm"); + return (Criteria) this; + } + + public Criteria andIdentifierValidatorAlgorithmBetween(String value1, String value2) { + addCriterion("identifier_validator_algorithm between", value1, value2, "identifierValidatorAlgorithm"); + return (Criteria) this; + } + + public Criteria andIdentifierValidatorAlgorithmNotBetween(String value1, String value2) { + addCriterion("identifier_validator_algorithm not between", value1, value2, "identifierValidatorAlgorithm"); + return (Criteria) this; + } + + public Criteria andBaseCharacterSetIsNull() { + addCriterion("base_character_set is null"); + return (Criteria) this; + } + + public Criteria andBaseCharacterSetIsNotNull() { + addCriterion("base_character_set is not null"); + return (Criteria) this; + } + + public Criteria andBaseCharacterSetEqualTo(String value) { + addCriterion("base_character_set =", value, "baseCharacterSet"); + return (Criteria) this; + } + + public Criteria andBaseCharacterSetNotEqualTo(String value) { + addCriterion("base_character_set <>", value, "baseCharacterSet"); + return (Criteria) this; + } + + public Criteria andBaseCharacterSetGreaterThan(String value) { + addCriterion("base_character_set >", value, "baseCharacterSet"); + return (Criteria) this; + } + + public Criteria andBaseCharacterSetGreaterThanOrEqualTo(String value) { + addCriterion("base_character_set >=", value, "baseCharacterSet"); + return (Criteria) this; + } + + public Criteria andBaseCharacterSetLessThan(String value) { + addCriterion("base_character_set <", value, "baseCharacterSet"); + return (Criteria) this; + } + + public Criteria andBaseCharacterSetLessThanOrEqualTo(String value) { + addCriterion("base_character_set <=", value, "baseCharacterSet"); + return (Criteria) this; + } + + public Criteria andBaseCharacterSetLike(String value) { + addCriterion("base_character_set like", value, "baseCharacterSet"); + return (Criteria) this; + } + + public Criteria andBaseCharacterSetNotLike(String value) { + addCriterion("base_character_set not like", value, "baseCharacterSet"); + return (Criteria) this; + } + + public Criteria andBaseCharacterSetIn(List values) { + addCriterion("base_character_set in", values, "baseCharacterSet"); + return (Criteria) this; + } + + public Criteria andBaseCharacterSetNotIn(List values) { + addCriterion("base_character_set not in", values, "baseCharacterSet"); + return (Criteria) this; + } + + public Criteria andBaseCharacterSetBetween(String value1, String value2) { + addCriterion("base_character_set between", value1, value2, "baseCharacterSet"); + return (Criteria) this; + } + + public Criteria andBaseCharacterSetNotBetween(String value1, String value2) { + addCriterion("base_character_set not between", value1, value2, "baseCharacterSet"); + return (Criteria) this; + } + + public Criteria andFirstIdentifierBaseIsNull() { + addCriterion("first_identifier_base is null"); + return (Criteria) this; + } + + public Criteria andFirstIdentifierBaseIsNotNull() { + addCriterion("first_identifier_base is not null"); + return (Criteria) this; + } + + public Criteria andFirstIdentifierBaseEqualTo(String value) { + addCriterion("first_identifier_base =", value, "firstIdentifierBase"); + return (Criteria) this; + } + + public Criteria andFirstIdentifierBaseNotEqualTo(String value) { + addCriterion("first_identifier_base <>", value, "firstIdentifierBase"); + return (Criteria) this; + } + + public Criteria andFirstIdentifierBaseGreaterThan(String value) { + addCriterion("first_identifier_base >", value, "firstIdentifierBase"); + return (Criteria) this; + } + + public Criteria andFirstIdentifierBaseGreaterThanOrEqualTo(String value) { + addCriterion("first_identifier_base >=", value, "firstIdentifierBase"); + return (Criteria) this; + } + + public Criteria andFirstIdentifierBaseLessThan(String value) { + addCriterion("first_identifier_base <", value, "firstIdentifierBase"); + return (Criteria) this; + } + + public Criteria andFirstIdentifierBaseLessThanOrEqualTo(String value) { + addCriterion("first_identifier_base <=", value, "firstIdentifierBase"); + return (Criteria) this; + } + + public Criteria andFirstIdentifierBaseLike(String value) { + addCriterion("first_identifier_base like", value, "firstIdentifierBase"); + return (Criteria) this; + } + + public Criteria andFirstIdentifierBaseNotLike(String value) { + addCriterion("first_identifier_base not like", value, "firstIdentifierBase"); + return (Criteria) this; + } + + public Criteria andFirstIdentifierBaseIn(List values) { + addCriterion("first_identifier_base in", values, "firstIdentifierBase"); + return (Criteria) this; + } + + public Criteria andFirstIdentifierBaseNotIn(List values) { + addCriterion("first_identifier_base not in", values, "firstIdentifierBase"); + return (Criteria) this; + } + + public Criteria andFirstIdentifierBaseBetween(String value1, String value2) { + addCriterion("first_identifier_base between", value1, value2, "firstIdentifierBase"); + return (Criteria) this; + } + + public Criteria andFirstIdentifierBaseNotBetween(String value1, String value2) { + addCriterion("first_identifier_base not between", value1, value2, "firstIdentifierBase"); + return (Criteria) this; + } + + public Criteria andPrefixIsNull() { + addCriterion("prefix is null"); + return (Criteria) this; + } + + public Criteria andPrefixIsNotNull() { + addCriterion("prefix is not null"); + return (Criteria) this; + } + + public Criteria andPrefixEqualTo(String value) { + addCriterion("prefix =", value, "prefix"); + return (Criteria) this; + } + + public Criteria andPrefixNotEqualTo(String value) { + addCriterion("prefix <>", value, "prefix"); + return (Criteria) this; + } + + public Criteria andPrefixGreaterThan(String value) { + addCriterion("prefix >", value, "prefix"); + return (Criteria) this; + } + + public Criteria andPrefixGreaterThanOrEqualTo(String value) { + addCriterion("prefix >=", value, "prefix"); + return (Criteria) this; + } + + public Criteria andPrefixLessThan(String value) { + addCriterion("prefix <", value, "prefix"); + return (Criteria) this; + } + + public Criteria andPrefixLessThanOrEqualTo(String value) { + addCriterion("prefix <=", value, "prefix"); + return (Criteria) this; + } + + public Criteria andPrefixLike(String value) { + addCriterion("prefix like", value, "prefix"); + return (Criteria) this; + } + + public Criteria andPrefixNotLike(String value) { + addCriterion("prefix not like", value, "prefix"); + return (Criteria) this; + } + + public Criteria andPrefixIn(List values) { + addCriterion("prefix in", values, "prefix"); + return (Criteria) this; + } + + public Criteria andPrefixNotIn(List values) { + addCriterion("prefix not in", values, "prefix"); + return (Criteria) this; + } + + public Criteria andPrefixBetween(String value1, String value2) { + addCriterion("prefix between", value1, value2, "prefix"); + return (Criteria) this; + } + + public Criteria andPrefixNotBetween(String value1, String value2) { + addCriterion("prefix not between", value1, value2, "prefix"); + return (Criteria) this; + } + + public Criteria andSuffixIsNull() { + addCriterion("suffix is null"); + return (Criteria) this; + } + + public Criteria andSuffixIsNotNull() { + addCriterion("suffix is not null"); + return (Criteria) this; + } + + public Criteria andSuffixEqualTo(String value) { + addCriterion("suffix =", value, "suffix"); + return (Criteria) this; + } + + public Criteria andSuffixNotEqualTo(String value) { + addCriterion("suffix <>", value, "suffix"); + return (Criteria) this; + } + + public Criteria andSuffixGreaterThan(String value) { + addCriterion("suffix >", value, "suffix"); + return (Criteria) this; + } + + public Criteria andSuffixGreaterThanOrEqualTo(String value) { + addCriterion("suffix >=", value, "suffix"); + return (Criteria) this; + } + + public Criteria andSuffixLessThan(String value) { + addCriterion("suffix <", value, "suffix"); + return (Criteria) this; + } + + public Criteria andSuffixLessThanOrEqualTo(String value) { + addCriterion("suffix <=", value, "suffix"); + return (Criteria) this; + } + + public Criteria andSuffixLike(String value) { + addCriterion("suffix like", value, "suffix"); + return (Criteria) this; + } + + public Criteria andSuffixNotLike(String value) { + addCriterion("suffix not like", value, "suffix"); + return (Criteria) this; + } + + public Criteria andSuffixIn(List values) { + addCriterion("suffix in", values, "suffix"); + return (Criteria) this; + } + + public Criteria andSuffixNotIn(List values) { + addCriterion("suffix not in", values, "suffix"); + return (Criteria) this; + } + + public Criteria andSuffixBetween(String value1, String value2) { + addCriterion("suffix between", value1, value2, "suffix"); + return (Criteria) this; + } + + public Criteria andSuffixNotBetween(String value1, String value2) { + addCriterion("suffix not between", value1, value2, "suffix"); + return (Criteria) this; + } + + public Criteria andMinLengthIsNull() { + addCriterion("min_length is null"); + return (Criteria) this; + } + + public Criteria andMinLengthIsNotNull() { + addCriterion("min_length is not null"); + return (Criteria) this; + } + + public Criteria andMinLengthEqualTo(Integer value) { + addCriterion("min_length =", value, "minLength"); + return (Criteria) this; + } + + public Criteria andMinLengthNotEqualTo(Integer value) { + addCriterion("min_length <>", value, "minLength"); + return (Criteria) this; + } + + public Criteria andMinLengthGreaterThan(Integer value) { + addCriterion("min_length >", value, "minLength"); + return (Criteria) this; + } + + public Criteria andMinLengthGreaterThanOrEqualTo(Integer value) { + addCriterion("min_length >=", value, "minLength"); + return (Criteria) this; + } + + public Criteria andMinLengthLessThan(Integer value) { + addCriterion("min_length <", value, "minLength"); + return (Criteria) this; + } + + public Criteria andMinLengthLessThanOrEqualTo(Integer value) { + addCriterion("min_length <=", value, "minLength"); + return (Criteria) this; + } + + public Criteria andMinLengthIn(List values) { + addCriterion("min_length in", values, "minLength"); + return (Criteria) this; + } + + public Criteria andMinLengthNotIn(List values) { + addCriterion("min_length not in", values, "minLength"); + return (Criteria) this; + } + + public Criteria andMinLengthBetween(Integer value1, Integer value2) { + addCriterion("min_length between", value1, value2, "minLength"); + return (Criteria) this; + } + + public Criteria andMinLengthNotBetween(Integer value1, Integer value2) { + addCriterion("min_length not between", value1, value2, "minLength"); + return (Criteria) this; + } + + public Criteria andMaxLengthIsNull() { + addCriterion("max_length is null"); + return (Criteria) this; + } + + public Criteria andMaxLengthIsNotNull() { + addCriterion("max_length is not null"); + return (Criteria) this; + } + + public Criteria andMaxLengthEqualTo(Integer value) { + addCriterion("max_length =", value, "maxLength"); + return (Criteria) this; + } + + public Criteria andMaxLengthNotEqualTo(Integer value) { + addCriterion("max_length <>", value, "maxLength"); + return (Criteria) this; + } + + public Criteria andMaxLengthGreaterThan(Integer value) { + addCriterion("max_length >", value, "maxLength"); + return (Criteria) this; + } + + public Criteria andMaxLengthGreaterThanOrEqualTo(Integer value) { + addCriterion("max_length >=", value, "maxLength"); + return (Criteria) this; + } + + public Criteria andMaxLengthLessThan(Integer value) { + addCriterion("max_length <", value, "maxLength"); + return (Criteria) this; + } + + public Criteria andMaxLengthLessThanOrEqualTo(Integer value) { + addCriterion("max_length <=", value, "maxLength"); + return (Criteria) this; + } + + public Criteria andMaxLengthIn(List values) { + addCriterion("max_length in", values, "maxLength"); + return (Criteria) this; + } + + public Criteria andMaxLengthNotIn(List values) { + addCriterion("max_length not in", values, "maxLength"); + return (Criteria) this; + } + + public Criteria andMaxLengthBetween(Integer value1, Integer value2) { + addCriterion("max_length between", value1, value2, "maxLength"); + return (Criteria) this; + } + + public Criteria andMaxLengthNotBetween(Integer value1, Integer value2) { + addCriterion("max_length not between", value1, value2, "maxLength"); + return (Criteria) this; + } + + public Criteria andRegexFormatIsNull() { + addCriterion("regex_format is null"); + return (Criteria) this; + } + + public Criteria andRegexFormatIsNotNull() { + addCriterion("regex_format is not null"); + return (Criteria) this; + } + + public Criteria andRegexFormatEqualTo(String value) { + addCriterion("regex_format =", value, "regexFormat"); + return (Criteria) this; + } + + public Criteria andRegexFormatNotEqualTo(String value) { + addCriterion("regex_format <>", value, "regexFormat"); + return (Criteria) this; + } + + public Criteria andRegexFormatGreaterThan(String value) { + addCriterion("regex_format >", value, "regexFormat"); + return (Criteria) this; + } + + public Criteria andRegexFormatGreaterThanOrEqualTo(String value) { + addCriterion("regex_format >=", value, "regexFormat"); + return (Criteria) this; + } + + public Criteria andRegexFormatLessThan(String value) { + addCriterion("regex_format <", value, "regexFormat"); + return (Criteria) this; + } + + public Criteria andRegexFormatLessThanOrEqualTo(String value) { + addCriterion("regex_format <=", value, "regexFormat"); + return (Criteria) this; + } + + public Criteria andRegexFormatLike(String value) { + addCriterion("regex_format like", value, "regexFormat"); + return (Criteria) this; + } + + public Criteria andRegexFormatNotLike(String value) { + addCriterion("regex_format not like", value, "regexFormat"); + return (Criteria) this; + } + + public Criteria andRegexFormatIn(List values) { + addCriterion("regex_format in", values, "regexFormat"); + return (Criteria) this; + } + + public Criteria andRegexFormatNotIn(List values) { + addCriterion("regex_format not in", values, "regexFormat"); + return (Criteria) this; + } + + public Criteria andRegexFormatBetween(String value1, String value2) { + addCriterion("regex_format between", value1, value2, "regexFormat"); + return (Criteria) this; + } + + public Criteria andRegexFormatNotBetween(String value1, String value2) { + addCriterion("regex_format not between", value1, value2, "regexFormat"); + return (Criteria) this; + } + + public Criteria andSequenceValueIsNull() { + addCriterion("sequence_value is null"); + return (Criteria) this; + } + + public Criteria andSequenceValueIsNotNull() { + addCriterion("sequence_value is not null"); + return (Criteria) this; + } + + public Criteria andSequenceValueEqualTo(Long value) { + addCriterion("sequence_value =", value, "sequenceValue"); + return (Criteria) this; + } + + public Criteria andSequenceValueNotEqualTo(Long value) { + addCriterion("sequence_value <>", value, "sequenceValue"); + return (Criteria) this; + } + + public Criteria andSequenceValueGreaterThan(Long value) { + addCriterion("sequence_value >", value, "sequenceValue"); + return (Criteria) this; + } + + public Criteria andSequenceValueGreaterThanOrEqualTo(Long value) { + addCriterion("sequence_value >=", value, "sequenceValue"); + return (Criteria) this; + } + + public Criteria andSequenceValueLessThan(Long value) { + addCriterion("sequence_value <", value, "sequenceValue"); + return (Criteria) this; + } + + public Criteria andSequenceValueLessThanOrEqualTo(Long value) { + addCriterion("sequence_value <=", value, "sequenceValue"); + return (Criteria) this; + } + + public Criteria andSequenceValueIn(List values) { + addCriterion("sequence_value in", values, "sequenceValue"); + return (Criteria) this; + } + + public Criteria andSequenceValueNotIn(List values) { + addCriterion("sequence_value not in", values, "sequenceValue"); + return (Criteria) this; + } + + public Criteria andSequenceValueBetween(Long value1, Long value2) { + addCriterion("sequence_value between", value1, value2, "sequenceValue"); + return (Criteria) this; + } + + public Criteria andSequenceValueNotBetween(Long value1, Long value2) { + addCriterion("sequence_value not between", value1, value2, "sequenceValue"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.identifier_source + * + * @mbg.generated Wed May 20 16:35:12 PKT 2020 + */ + public static class Criterion { + private String condition; + private Object value; + private Object secondValue; + private boolean noValue; + private boolean singleValue; + private boolean betweenValue; + private boolean listValue; + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** * This class was generated by MyBatis Generator. * This class corresponds to the database table core.identifier_source * diff --git a/src/main/java/org/opensrp/domain/postgres/Location.java b/src/main/java/org/opensrp/domain/postgres/Location.java index 69f24323a..779d5f857 100644 --- a/src/main/java/org/opensrp/domain/postgres/Location.java +++ b/src/main/java/org/opensrp/domain/postgres/Location.java @@ -2,73 +2,82 @@ public class Location { - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.location.id - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - private Long id; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.location.json - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - private Object json; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.location.server_version - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - private Long serverVersion; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.location.id + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + private Long id; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.location.json + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + private Object json; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.location.server_version + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + private Long serverVersion; - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.location.id - * @return the value of core.location.id - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public Long getId() { - return id; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.location.id + * + * @return the value of core.location.id + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public Long getId() { + return id; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.location.id - * @param id the value for core.location.id - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.location.id + * + * @param id the value for core.location.id + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public void setId(Long id) { + this.id = id; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.location.json - * @return the value of core.location.json - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public Object getJson() { - return json; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.location.json + * + * @return the value of core.location.json + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public Object getJson() { + return json; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.location.json - * @param json the value for core.location.json - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public void setJson(Object json) { - this.json = json; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.location.json + * + * @param json the value for core.location.json + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public void setJson(Object json) { + this.json = json; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.location.server_version - * @return the value of core.location.server_version - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public Long getServerVersion() { - return serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.location.server_version + * + * @return the value of core.location.server_version + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public Long getServerVersion() { + return serverVersion; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.location.server_version - * @param serverVersion the value for core.location.server_version - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.location.server_version + * + * @param serverVersion the value for core.location.server_version + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } } \ No newline at end of file diff --git a/src/main/java/org/opensrp/domain/postgres/LocationExample.java b/src/main/java/org/opensrp/domain/postgres/LocationExample.java index 4681c884d..477935d0f 100644 --- a/src/main/java/org/opensrp/domain/postgres/LocationExample.java +++ b/src/main/java/org/opensrp/domain/postgres/LocationExample.java @@ -5,471 +5,487 @@ public class LocationExample { /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - protected String orderByClause; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - protected boolean distinct; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public LocationExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List jsonCriteria; - - protected List allCriteria; - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - jsonCriteria = new ArrayList<>(); - } - - public List getJsonCriteria() { - return jsonCriteria; - } - - protected void addJsonCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.LocationTypeHandler")); - allCriteria = null; - } - - protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - jsonCriteria.add( - new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.LocationTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || jsonCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList<>(); - allCriteria.addAll(criteria); - allCriteria.addAll(jsonCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - allCriteria = null; - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andJsonIsNull() { - addCriterion("json is null"); - return (Criteria) this; - } - - public Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (Criteria) this; - } - - public Criteria andJsonEqualTo(Object value) { - addJsonCriterion("json =", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotEqualTo(Object value) { - addJsonCriterion("json <>", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThan(Object value) { - addJsonCriterion("json >", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThanOrEqualTo(Object value) { - addJsonCriterion("json >=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThan(Object value) { - addJsonCriterion("json <", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThanOrEqualTo(Object value) { - addJsonCriterion("json <=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonIn(List values) { - addJsonCriterion("json in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotIn(List values) { - addJsonCriterion("json not in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonBetween(Object value1, Object value2) { - addJsonCriterion("json between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotBetween(Object value1, Object value2) { - addJsonCriterion("json not between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + protected String orderByClause; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + protected boolean distinct; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public LocationExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List jsonCriteria; + + protected List allCriteria; + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + jsonCriteria = new ArrayList<>(); + } + + public List getJsonCriteria() { + return jsonCriteria; + } + + protected void addJsonCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.LocationTypeHandler")); + allCriteria = null; + } + + protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + jsonCriteria.add( + new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.LocationTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || jsonCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList<>(); + allCriteria.addAll(criteria); + allCriteria.addAll(jsonCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andJsonIsNull() { + addCriterion("json is null"); + return (Criteria) this; + } + + public Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (Criteria) this; + } + + public Criteria andJsonEqualTo(Object value) { + addJsonCriterion("json =", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotEqualTo(Object value) { + addJsonCriterion("json <>", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThan(Object value) { + addJsonCriterion("json >", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThanOrEqualTo(Object value) { + addJsonCriterion("json >=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThan(Object value) { + addJsonCriterion("json <", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThanOrEqualTo(Object value) { + addJsonCriterion("json <=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonIn(List values) { + addJsonCriterion("json in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotIn(List values) { + addJsonCriterion("json not in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonBetween(Object value1, Object value2) { + addJsonCriterion("json between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotBetween(Object value1, Object value2) { + addJsonCriterion("json not between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** * This class was generated by MyBatis Generator. * This class corresponds to the database table core.location * diff --git a/src/main/java/org/opensrp/domain/postgres/LocationMetadata.java b/src/main/java/org/opensrp/domain/postgres/LocationMetadata.java index 6d459e04d..724ec3392 100644 --- a/src/main/java/org/opensrp/domain/postgres/LocationMetadata.java +++ b/src/main/java/org/opensrp/domain/postgres/LocationMetadata.java @@ -3,364 +3,364 @@ import java.util.Date; public class LocationMetadata { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.location_metadata.id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.location_metadata.location_id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Long locationId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.location_metadata.geojson_id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String geojsonId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.location_metadata.type - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String type; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.location_metadata.parent_id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String parentId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.location_metadata.uuid - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String uuid; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.location_metadata.status - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String status; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.location_metadata.server_version - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Long serverVersion; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.location_metadata.name - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String name; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.location_metadata.version - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Integer version; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.location_metadata.date_created - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Date dateCreated; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.location_metadata.date_edited - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Date dateEdited; - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.location_metadata.id - * - * @return the value of core.location_metadata.id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.location_metadata.id - * - * @param id the value for core.location_metadata.id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.location_metadata.location_id - * - * @return the value of core.location_metadata.location_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Long getLocationId() { - return locationId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.location_metadata.location_id - * - * @param locationId the value for core.location_metadata.location_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setLocationId(Long locationId) { - this.locationId = locationId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.location_metadata.geojson_id - * - * @return the value of core.location_metadata.geojson_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getGeojsonId() { - return geojsonId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.location_metadata.geojson_id - * - * @param geojsonId the value for core.location_metadata.geojson_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setGeojsonId(String geojsonId) { - this.geojsonId = geojsonId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.location_metadata.type - * - * @return the value of core.location_metadata.type - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getType() { - return type; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.location_metadata.type - * - * @param type the value for core.location_metadata.type - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setType(String type) { - this.type = type; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.location_metadata.parent_id - * - * @return the value of core.location_metadata.parent_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getParentId() { - return parentId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.location_metadata.parent_id - * - * @param parentId the value for core.location_metadata.parent_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setParentId(String parentId) { - this.parentId = parentId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.location_metadata.uuid - * - * @return the value of core.location_metadata.uuid - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getUuid() { - return uuid; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.location_metadata.uuid - * - * @param uuid the value for core.location_metadata.uuid - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setUuid(String uuid) { - this.uuid = uuid; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.location_metadata.status - * - * @return the value of core.location_metadata.status - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getStatus() { - return status; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.location_metadata.status - * - * @param status the value for core.location_metadata.status - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setStatus(String status) { - this.status = status; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.location_metadata.server_version - * - * @return the value of core.location_metadata.server_version - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Long getServerVersion() { - return serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.location_metadata.server_version - * - * @param serverVersion the value for core.location_metadata.server_version - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.location_metadata.name - * - * @return the value of core.location_metadata.name - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getName() { - return name; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.location_metadata.name - * - * @param name the value for core.location_metadata.name - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setName(String name) { - this.name = name; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.location_metadata.version - * - * @return the value of core.location_metadata.version - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Integer getVersion() { - return version; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.location_metadata.version - * - * @param version the value for core.location_metadata.version - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setVersion(Integer version) { - this.version = version; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.location_metadata.date_created - * - * @return the value of core.location_metadata.date_created - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Date getDateCreated() { - return dateCreated; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.location_metadata.date_created - * - * @param dateCreated the value for core.location_metadata.date_created - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setDateCreated(Date dateCreated) { - this.dateCreated = dateCreated; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.location_metadata.date_edited - * - * @return the value of core.location_metadata.date_edited - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Date getDateEdited() { - return dateEdited; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.location_metadata.date_edited - * - * @param dateEdited the value for core.location_metadata.date_edited - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setDateEdited(Date dateEdited) { - this.dateEdited = dateEdited; - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.location_metadata.id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.location_metadata.location_id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Long locationId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.location_metadata.geojson_id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String geojsonId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.location_metadata.type + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String type; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.location_metadata.parent_id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String parentId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.location_metadata.uuid + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String uuid; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.location_metadata.status + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String status; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.location_metadata.server_version + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Long serverVersion; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.location_metadata.name + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String name; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.location_metadata.version + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Integer version; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.location_metadata.date_created + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Date dateCreated; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.location_metadata.date_edited + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Date dateEdited; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.location_metadata.id + * + * @return the value of core.location_metadata.id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.location_metadata.id + * + * @param id the value for core.location_metadata.id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.location_metadata.location_id + * + * @return the value of core.location_metadata.location_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Long getLocationId() { + return locationId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.location_metadata.location_id + * + * @param locationId the value for core.location_metadata.location_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setLocationId(Long locationId) { + this.locationId = locationId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.location_metadata.geojson_id + * + * @return the value of core.location_metadata.geojson_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getGeojsonId() { + return geojsonId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.location_metadata.geojson_id + * + * @param geojsonId the value for core.location_metadata.geojson_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setGeojsonId(String geojsonId) { + this.geojsonId = geojsonId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.location_metadata.type + * + * @return the value of core.location_metadata.type + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getType() { + return type; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.location_metadata.type + * + * @param type the value for core.location_metadata.type + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setType(String type) { + this.type = type; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.location_metadata.parent_id + * + * @return the value of core.location_metadata.parent_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getParentId() { + return parentId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.location_metadata.parent_id + * + * @param parentId the value for core.location_metadata.parent_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setParentId(String parentId) { + this.parentId = parentId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.location_metadata.uuid + * + * @return the value of core.location_metadata.uuid + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getUuid() { + return uuid; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.location_metadata.uuid + * + * @param uuid the value for core.location_metadata.uuid + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setUuid(String uuid) { + this.uuid = uuid; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.location_metadata.status + * + * @return the value of core.location_metadata.status + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getStatus() { + return status; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.location_metadata.status + * + * @param status the value for core.location_metadata.status + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setStatus(String status) { + this.status = status; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.location_metadata.server_version + * + * @return the value of core.location_metadata.server_version + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Long getServerVersion() { + return serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.location_metadata.server_version + * + * @param serverVersion the value for core.location_metadata.server_version + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.location_metadata.name + * + * @return the value of core.location_metadata.name + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getName() { + return name; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.location_metadata.name + * + * @param name the value for core.location_metadata.name + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setName(String name) { + this.name = name; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.location_metadata.version + * + * @return the value of core.location_metadata.version + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Integer getVersion() { + return version; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.location_metadata.version + * + * @param version the value for core.location_metadata.version + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setVersion(Integer version) { + this.version = version; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.location_metadata.date_created + * + * @return the value of core.location_metadata.date_created + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Date getDateCreated() { + return dateCreated; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.location_metadata.date_created + * + * @param dateCreated the value for core.location_metadata.date_created + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setDateCreated(Date dateCreated) { + this.dateCreated = dateCreated; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.location_metadata.date_edited + * + * @return the value of core.location_metadata.date_edited + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Date getDateEdited() { + return dateEdited; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.location_metadata.date_edited + * + * @param dateEdited the value for core.location_metadata.date_edited + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setDateEdited(Date dateEdited) { + this.dateEdited = dateEdited; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/LocationMetadataExample.java b/src/main/java/org/opensrp/domain/postgres/LocationMetadataExample.java index a239d71e7..0a905f415 100644 --- a/src/main/java/org/opensrp/domain/postgres/LocationMetadataExample.java +++ b/src/main/java/org/opensrp/domain/postgres/LocationMetadataExample.java @@ -5,1082 +5,1082 @@ import java.util.List; public class LocationMetadataExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public LocationMetadataExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNull() { - addCriterion("location_id is null"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNotNull() { - addCriterion("location_id is not null"); - return (Criteria) this; - } - - public Criteria andLocationIdEqualTo(Long value) { - addCriterion("location_id =", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotEqualTo(Long value) { - addCriterion("location_id <>", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThan(Long value) { - addCriterion("location_id >", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThanOrEqualTo(Long value) { - addCriterion("location_id >=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThan(Long value) { - addCriterion("location_id <", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThanOrEqualTo(Long value) { - addCriterion("location_id <=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdIn(List values) { - addCriterion("location_id in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotIn(List values) { - addCriterion("location_id not in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdBetween(Long value1, Long value2) { - addCriterion("location_id between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotBetween(Long value1, Long value2) { - addCriterion("location_id not between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdIsNull() { - addCriterion("geojson_id is null"); - return (Criteria) this; - } - - public Criteria andGeojsonIdIsNotNull() { - addCriterion("geojson_id is not null"); - return (Criteria) this; - } - - public Criteria andGeojsonIdEqualTo(String value) { - addCriterion("geojson_id =", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdNotEqualTo(String value) { - addCriterion("geojson_id <>", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdGreaterThan(String value) { - addCriterion("geojson_id >", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdGreaterThanOrEqualTo(String value) { - addCriterion("geojson_id >=", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdLessThan(String value) { - addCriterion("geojson_id <", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdLessThanOrEqualTo(String value) { - addCriterion("geojson_id <=", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdLike(String value) { - addCriterion("geojson_id like", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdNotLike(String value) { - addCriterion("geojson_id not like", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdIn(List values) { - addCriterion("geojson_id in", values, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdNotIn(List values) { - addCriterion("geojson_id not in", values, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdBetween(String value1, String value2) { - addCriterion("geojson_id between", value1, value2, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdNotBetween(String value1, String value2) { - addCriterion("geojson_id not between", value1, value2, "geojsonId"); - return (Criteria) this; - } - - public Criteria andTypeIsNull() { - addCriterion("type is null"); - return (Criteria) this; - } - - public Criteria andTypeIsNotNull() { - addCriterion("type is not null"); - return (Criteria) this; - } - - public Criteria andTypeEqualTo(String value) { - addCriterion("type =", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotEqualTo(String value) { - addCriterion("type <>", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThan(String value) { - addCriterion("type >", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThanOrEqualTo(String value) { - addCriterion("type >=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThan(String value) { - addCriterion("type <", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThanOrEqualTo(String value) { - addCriterion("type <=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLike(String value) { - addCriterion("type like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotLike(String value) { - addCriterion("type not like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeIn(List values) { - addCriterion("type in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotIn(List values) { - addCriterion("type not in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeBetween(String value1, String value2) { - addCriterion("type between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotBetween(String value1, String value2) { - addCriterion("type not between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andParentIdIsNull() { - addCriterion("parent_id is null"); - return (Criteria) this; - } - - public Criteria andParentIdIsNotNull() { - addCriterion("parent_id is not null"); - return (Criteria) this; - } - - public Criteria andParentIdEqualTo(String value) { - addCriterion("parent_id =", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdNotEqualTo(String value) { - addCriterion("parent_id <>", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdGreaterThan(String value) { - addCriterion("parent_id >", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdGreaterThanOrEqualTo(String value) { - addCriterion("parent_id >=", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdLessThan(String value) { - addCriterion("parent_id <", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdLessThanOrEqualTo(String value) { - addCriterion("parent_id <=", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdLike(String value) { - addCriterion("parent_id like", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdNotLike(String value) { - addCriterion("parent_id not like", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdIn(List values) { - addCriterion("parent_id in", values, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdNotIn(List values) { - addCriterion("parent_id not in", values, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdBetween(String value1, String value2) { - addCriterion("parent_id between", value1, value2, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdNotBetween(String value1, String value2) { - addCriterion("parent_id not between", value1, value2, "parentId"); - return (Criteria) this; - } - - public Criteria andUuidIsNull() { - addCriterion("uuid is null"); - return (Criteria) this; - } - - public Criteria andUuidIsNotNull() { - addCriterion("uuid is not null"); - return (Criteria) this; - } - - public Criteria andUuidEqualTo(String value) { - addCriterion("uuid =", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidNotEqualTo(String value) { - addCriterion("uuid <>", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidGreaterThan(String value) { - addCriterion("uuid >", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidGreaterThanOrEqualTo(String value) { - addCriterion("uuid >=", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidLessThan(String value) { - addCriterion("uuid <", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidLessThanOrEqualTo(String value) { - addCriterion("uuid <=", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidLike(String value) { - addCriterion("uuid like", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidNotLike(String value) { - addCriterion("uuid not like", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidIn(List values) { - addCriterion("uuid in", values, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidNotIn(List values) { - addCriterion("uuid not in", values, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidBetween(String value1, String value2) { - addCriterion("uuid between", value1, value2, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidNotBetween(String value1, String value2) { - addCriterion("uuid not between", value1, value2, "uuid"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("status is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(String value) { - addCriterion("status =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(String value) { - addCriterion("status <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(String value) { - addCriterion("status >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(String value) { - addCriterion("status >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(String value) { - addCriterion("status <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(String value) { - addCriterion("status <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLike(String value) { - addCriterion("status like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotLike(String value) { - addCriterion("status not like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(String value1, String value2) { - addCriterion("status between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(String value1, String value2) { - addCriterion("status not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andNameIsNull() { - addCriterion("name is null"); - return (Criteria) this; - } - - public Criteria andNameIsNotNull() { - addCriterion("name is not null"); - return (Criteria) this; - } - - public Criteria andNameEqualTo(String value) { - addCriterion("name =", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotEqualTo(String value) { - addCriterion("name <>", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThan(String value) { - addCriterion("name >", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("name >=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThan(String value) { - addCriterion("name <", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("name <=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLike(String value) { - addCriterion("name like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotLike(String value) { - addCriterion("name not like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameIn(List values) { - addCriterion("name in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameNotIn(List values) { - addCriterion("name not in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameBetween(String value1, String value2) { - addCriterion("name between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("name not between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andVersionIsNull() { - addCriterion("version is null"); - return (Criteria) this; - } - - public Criteria andVersionIsNotNull() { - addCriterion("version is not null"); - return (Criteria) this; - } - - public Criteria andVersionEqualTo(Integer value) { - addCriterion("version =", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotEqualTo(Integer value) { - addCriterion("version <>", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionGreaterThan(Integer value) { - addCriterion("version >", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionGreaterThanOrEqualTo(Integer value) { - addCriterion("version >=", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionLessThan(Integer value) { - addCriterion("version <", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionLessThanOrEqualTo(Integer value) { - addCriterion("version <=", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionIn(List values) { - addCriterion("version in", values, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotIn(List values) { - addCriterion("version not in", values, "version"); - return (Criteria) this; - } - - public Criteria andVersionBetween(Integer value1, Integer value2) { - addCriterion("version between", value1, value2, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotBetween(Integer value1, Integer value2) { - addCriterion("version not between", value1, value2, "version"); - return (Criteria) this; - } - - public Criteria andDateCreatedIsNull() { - addCriterion("date_created is null"); - return (Criteria) this; - } - - public Criteria andDateCreatedIsNotNull() { - addCriterion("date_created is not null"); - return (Criteria) this; - } - - public Criteria andDateCreatedEqualTo(Date value) { - addCriterion("date_created =", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotEqualTo(Date value) { - addCriterion("date_created <>", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedGreaterThan(Date value) { - addCriterion("date_created >", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { - addCriterion("date_created >=", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedLessThan(Date value) { - addCriterion("date_created <", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedLessThanOrEqualTo(Date value) { - addCriterion("date_created <=", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedIn(List values) { - addCriterion("date_created in", values, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotIn(List values) { - addCriterion("date_created not in", values, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedBetween(Date value1, Date value2) { - addCriterion("date_created between", value1, value2, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotBetween(Date value1, Date value2) { - addCriterion("date_created not between", value1, value2, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNull() { - addCriterion("date_edited is null"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNotNull() { - addCriterion("date_edited is not null"); - return (Criteria) this; - } - - public Criteria andDateEditedEqualTo(Date value) { - addCriterion("date_edited =", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotEqualTo(Date value) { - addCriterion("date_edited <>", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThan(Date value) { - addCriterion("date_edited >", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { - addCriterion("date_edited >=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThan(Date value) { - addCriterion("date_edited <", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThanOrEqualTo(Date value) { - addCriterion("date_edited <=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedIn(List values) { - addCriterion("date_edited in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotIn(List values) { - addCriterion("date_edited not in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedBetween(Date value1, Date value2) { - addCriterion("date_edited between", value1, value2, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotBetween(Date value1, Date value2) { - addCriterion("date_edited not between", value1, value2, "dateEdited"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.location_metadata - * - * @mbg.generated do_not_delete_during_merge Wed Sep 30 15:22:34 EAT 2020 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public LocationMetadataExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNull() { + addCriterion("location_id is null"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNotNull() { + addCriterion("location_id is not null"); + return (Criteria) this; + } + + public Criteria andLocationIdEqualTo(Long value) { + addCriterion("location_id =", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotEqualTo(Long value) { + addCriterion("location_id <>", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThan(Long value) { + addCriterion("location_id >", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThanOrEqualTo(Long value) { + addCriterion("location_id >=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThan(Long value) { + addCriterion("location_id <", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThanOrEqualTo(Long value) { + addCriterion("location_id <=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdIn(List values) { + addCriterion("location_id in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotIn(List values) { + addCriterion("location_id not in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdBetween(Long value1, Long value2) { + addCriterion("location_id between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotBetween(Long value1, Long value2) { + addCriterion("location_id not between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdIsNull() { + addCriterion("geojson_id is null"); + return (Criteria) this; + } + + public Criteria andGeojsonIdIsNotNull() { + addCriterion("geojson_id is not null"); + return (Criteria) this; + } + + public Criteria andGeojsonIdEqualTo(String value) { + addCriterion("geojson_id =", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdNotEqualTo(String value) { + addCriterion("geojson_id <>", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdGreaterThan(String value) { + addCriterion("geojson_id >", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdGreaterThanOrEqualTo(String value) { + addCriterion("geojson_id >=", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdLessThan(String value) { + addCriterion("geojson_id <", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdLessThanOrEqualTo(String value) { + addCriterion("geojson_id <=", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdLike(String value) { + addCriterion("geojson_id like", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdNotLike(String value) { + addCriterion("geojson_id not like", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdIn(List values) { + addCriterion("geojson_id in", values, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdNotIn(List values) { + addCriterion("geojson_id not in", values, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdBetween(String value1, String value2) { + addCriterion("geojson_id between", value1, value2, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdNotBetween(String value1, String value2) { + addCriterion("geojson_id not between", value1, value2, "geojsonId"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andParentIdIsNull() { + addCriterion("parent_id is null"); + return (Criteria) this; + } + + public Criteria andParentIdIsNotNull() { + addCriterion("parent_id is not null"); + return (Criteria) this; + } + + public Criteria andParentIdEqualTo(String value) { + addCriterion("parent_id =", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotEqualTo(String value) { + addCriterion("parent_id <>", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThan(String value) { + addCriterion("parent_id >", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThanOrEqualTo(String value) { + addCriterion("parent_id >=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThan(String value) { + addCriterion("parent_id <", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThanOrEqualTo(String value) { + addCriterion("parent_id <=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLike(String value) { + addCriterion("parent_id like", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotLike(String value) { + addCriterion("parent_id not like", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdIn(List values) { + addCriterion("parent_id in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotIn(List values) { + addCriterion("parent_id not in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdBetween(String value1, String value2) { + addCriterion("parent_id between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotBetween(String value1, String value2) { + addCriterion("parent_id not between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andUuidIsNull() { + addCriterion("uuid is null"); + return (Criteria) this; + } + + public Criteria andUuidIsNotNull() { + addCriterion("uuid is not null"); + return (Criteria) this; + } + + public Criteria andUuidEqualTo(String value) { + addCriterion("uuid =", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidNotEqualTo(String value) { + addCriterion("uuid <>", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidGreaterThan(String value) { + addCriterion("uuid >", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidGreaterThanOrEqualTo(String value) { + addCriterion("uuid >=", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidLessThan(String value) { + addCriterion("uuid <", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidLessThanOrEqualTo(String value) { + addCriterion("uuid <=", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidLike(String value) { + addCriterion("uuid like", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidNotLike(String value) { + addCriterion("uuid not like", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidIn(List values) { + addCriterion("uuid in", values, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidNotIn(List values) { + addCriterion("uuid not in", values, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidBetween(String value1, String value2) { + addCriterion("uuid between", value1, value2, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidNotBetween(String value1, String value2) { + addCriterion("uuid not between", value1, value2, "uuid"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(String value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(String value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(String value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(String value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLike(String value) { + addCriterion("status like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotLike(String value) { + addCriterion("status not like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andVersionIsNull() { + addCriterion("version is null"); + return (Criteria) this; + } + + public Criteria andVersionIsNotNull() { + addCriterion("version is not null"); + return (Criteria) this; + } + + public Criteria andVersionEqualTo(Integer value) { + addCriterion("version =", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotEqualTo(Integer value) { + addCriterion("version <>", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionGreaterThan(Integer value) { + addCriterion("version >", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionGreaterThanOrEqualTo(Integer value) { + addCriterion("version >=", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionLessThan(Integer value) { + addCriterion("version <", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionLessThanOrEqualTo(Integer value) { + addCriterion("version <=", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionIn(List values) { + addCriterion("version in", values, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotIn(List values) { + addCriterion("version not in", values, "version"); + return (Criteria) this; + } + + public Criteria andVersionBetween(Integer value1, Integer value2) { + addCriterion("version between", value1, value2, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotBetween(Integer value1, Integer value2) { + addCriterion("version not between", value1, value2, "version"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNull() { + addCriterion("date_created is null"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNotNull() { + addCriterion("date_created is not null"); + return (Criteria) this; + } + + public Criteria andDateCreatedEqualTo(Date value) { + addCriterion("date_created =", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotEqualTo(Date value) { + addCriterion("date_created <>", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThan(Date value) { + addCriterion("date_created >", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { + addCriterion("date_created >=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThan(Date value) { + addCriterion("date_created <", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThanOrEqualTo(Date value) { + addCriterion("date_created <=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedIn(List values) { + addCriterion("date_created in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotIn(List values) { + addCriterion("date_created not in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedBetween(Date value1, Date value2) { + addCriterion("date_created between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotBetween(Date value1, Date value2) { + addCriterion("date_created not between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNull() { + addCriterion("date_edited is null"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNotNull() { + addCriterion("date_edited is not null"); + return (Criteria) this; + } + + public Criteria andDateEditedEqualTo(Date value) { + addCriterion("date_edited =", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotEqualTo(Date value) { + addCriterion("date_edited <>", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThan(Date value) { + addCriterion("date_edited >", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { + addCriterion("date_edited >=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThan(Date value) { + addCriterion("date_edited <", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThanOrEqualTo(Date value) { + addCriterion("date_edited <=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedIn(List values) { + addCriterion("date_edited in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotIn(List values) { + addCriterion("date_edited not in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedBetween(Date value1, Date value2) { + addCriterion("date_edited between", value1, value2, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotBetween(Date value1, Date value2) { + addCriterion("date_edited not between", value1, value2, "dateEdited"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.location_metadata + * + * @mbg.generated do_not_delete_during_merge Wed Sep 30 15:22:34 EAT 2020 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/LocationTag.java b/src/main/java/org/opensrp/domain/postgres/LocationTag.java index 8e1b347cf..4937bebce 100644 --- a/src/main/java/org/opensrp/domain/postgres/LocationTag.java +++ b/src/main/java/org/opensrp/domain/postgres/LocationTag.java @@ -2,96 +2,108 @@ public class LocationTag { - /** + /** * This field was generated by MyBatis Generator. This field corresponds to the database column core.location_tag.id - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ private Long id; - /** + /** * This field was generated by MyBatis Generator. This field corresponds to the database column core.location_tag.name - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ private String name; - /** + /** * This field was generated by MyBatis Generator. This field corresponds to the database column core.location_tag.description - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ private String description; - /** + /** * This field was generated by MyBatis Generator. This field corresponds to the database column core.location_tag.active - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ private Boolean active; - /** + /** * This method was generated by MyBatis Generator. This method returns the value of the database column core.location_tag.id - * @return the value of core.location_tag.id - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @return the value of core.location_tag.id + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ public Long getId() { - return id; + return id; } - /** + /** * This method was generated by MyBatis Generator. This method sets the value of the database column core.location_tag.id - * @param id the value for core.location_tag.id - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @param id the value for core.location_tag.id + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ public void setId(Long id) { - this.id = id; + this.id = id; } - /** + /** * This method was generated by MyBatis Generator. This method returns the value of the database column core.location_tag.name - * @return the value of core.location_tag.name - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @return the value of core.location_tag.name + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ public String getName() { - return name; + return name; } - /** + /** * This method was generated by MyBatis Generator. This method sets the value of the database column core.location_tag.name - * @param name the value for core.location_tag.name - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @param name the value for core.location_tag.name + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ public void setName(String name) { - this.name = name; + this.name = name; } - /** + /** * This method was generated by MyBatis Generator. This method returns the value of the database column core.location_tag.description - * @return the value of core.location_tag.description - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @return the value of core.location_tag.description + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ public String getDescription() { - return description; + return description; } - /** + /** * This method was generated by MyBatis Generator. This method sets the value of the database column core.location_tag.description - * @param description the value for core.location_tag.description - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @param description the value for core.location_tag.description + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ public void setDescription(String description) { - this.description = description; + this.description = description; } - /** + /** * This method was generated by MyBatis Generator. This method returns the value of the database column core.location_tag.active - * @return the value of core.location_tag.active - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @return the value of core.location_tag.active + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ public Boolean getActive() { - return active; + return active; } - /** + /** * This method was generated by MyBatis Generator. This method sets the value of the database column core.location_tag.active - * @param active the value for core.location_tag.active - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @param active the value for core.location_tag.active + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ public void setActive(Boolean active) { - this.active = active; + this.active = active; } } \ No newline at end of file diff --git a/src/main/java/org/opensrp/domain/postgres/LocationTagExample.java b/src/main/java/org/opensrp/domain/postgres/LocationTagExample.java index cc04b0fe3..efd84f84c 100644 --- a/src/main/java/org/opensrp/domain/postgres/LocationTagExample.java +++ b/src/main/java/org/opensrp/domain/postgres/LocationTagExample.java @@ -4,562 +4,562 @@ import java.util.List; public class LocationTagExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - public LocationTagExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andNameIsNull() { - addCriterion("name is null"); - return (Criteria) this; - } - - public Criteria andNameIsNotNull() { - addCriterion("name is not null"); - return (Criteria) this; - } - - public Criteria andNameEqualTo(String value) { - addCriterion("name =", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotEqualTo(String value) { - addCriterion("name <>", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThan(String value) { - addCriterion("name >", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("name >=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThan(String value) { - addCriterion("name <", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("name <=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLike(String value) { - addCriterion("name like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotLike(String value) { - addCriterion("name not like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameIn(List values) { - addCriterion("name in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameNotIn(List values) { - addCriterion("name not in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameBetween(String value1, String value2) { - addCriterion("name between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("name not between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andDescriptionIsNull() { - addCriterion("description is null"); - return (Criteria) this; - } - - public Criteria andDescriptionIsNotNull() { - addCriterion("description is not null"); - return (Criteria) this; - } - - public Criteria andDescriptionEqualTo(String value) { - addCriterion("description =", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotEqualTo(String value) { - addCriterion("description <>", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionGreaterThan(String value) { - addCriterion("description >", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionGreaterThanOrEqualTo(String value) { - addCriterion("description >=", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLessThan(String value) { - addCriterion("description <", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLessThanOrEqualTo(String value) { - addCriterion("description <=", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLike(String value) { - addCriterion("description like", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotLike(String value) { - addCriterion("description not like", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionIn(List values) { - addCriterion("description in", values, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotIn(List values) { - addCriterion("description not in", values, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionBetween(String value1, String value2) { - addCriterion("description between", value1, value2, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotBetween(String value1, String value2) { - addCriterion("description not between", value1, value2, "description"); - return (Criteria) this; - } - - public Criteria andActiveIsNull() { - addCriterion("active is null"); - return (Criteria) this; - } - - public Criteria andActiveIsNotNull() { - addCriterion("active is not null"); - return (Criteria) this; - } - - public Criteria andActiveEqualTo(Boolean value) { - addCriterion("active =", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveNotEqualTo(Boolean value) { - addCriterion("active <>", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveGreaterThan(Boolean value) { - addCriterion("active >", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveGreaterThanOrEqualTo(Boolean value) { - addCriterion("active >=", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveLessThan(Boolean value) { - addCriterion("active <", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveLessThanOrEqualTo(Boolean value) { - addCriterion("active <=", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveIn(List values) { - addCriterion("active in", values, "active"); - return (Criteria) this; - } - - public Criteria andActiveNotIn(List values) { - addCriterion("active not in", values, "active"); - return (Criteria) this; - } - - public Criteria andActiveBetween(Boolean value1, Boolean value2) { - addCriterion("active between", value1, value2, "active"); - return (Criteria) this; - } - - public Criteria andActiveNotBetween(Boolean value1, Boolean value2) { - addCriterion("active not between", value1, value2, "active"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.location_tag - * - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.location_tag - * - * @mbggenerated do_not_delete_during_merge Sun Mar 08 16:30:00 BDT 2020 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + public LocationTagExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andActiveIsNull() { + addCriterion("active is null"); + return (Criteria) this; + } + + public Criteria andActiveIsNotNull() { + addCriterion("active is not null"); + return (Criteria) this; + } + + public Criteria andActiveEqualTo(Boolean value) { + addCriterion("active =", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveNotEqualTo(Boolean value) { + addCriterion("active <>", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveGreaterThan(Boolean value) { + addCriterion("active >", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveGreaterThanOrEqualTo(Boolean value) { + addCriterion("active >=", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveLessThan(Boolean value) { + addCriterion("active <", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveLessThanOrEqualTo(Boolean value) { + addCriterion("active <=", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveIn(List values) { + addCriterion("active in", values, "active"); + return (Criteria) this; + } + + public Criteria andActiveNotIn(List values) { + addCriterion("active not in", values, "active"); + return (Criteria) this; + } + + public Criteria andActiveBetween(Boolean value1, Boolean value2) { + addCriterion("active between", value1, value2, "active"); + return (Criteria) this; + } + + public Criteria andActiveNotBetween(Boolean value1, Boolean value2) { + addCriterion("active not between", value1, value2, "active"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.location_tag + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.location_tag + * + * @mbggenerated do_not_delete_during_merge Sun Mar 08 16:30:00 BDT 2020 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/LocationTagMap.java b/src/main/java/org/opensrp/domain/postgres/LocationTagMap.java index 8aa352617..d89f52e40 100644 --- a/src/main/java/org/opensrp/domain/postgres/LocationTagMap.java +++ b/src/main/java/org/opensrp/domain/postgres/LocationTagMap.java @@ -2,7 +2,6 @@ public class LocationTagMap { /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.location_tag_map.location_id * @@ -11,7 +10,6 @@ public class LocationTagMap { private Long locationId; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.location_tag_map.location_tag_id * @@ -24,7 +22,6 @@ public class LocationTagMap { * This method returns the value of the database column core.location_tag_map.location_id * * @return the value of core.location_tag_map.location_id - * * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 */ public Long getLocationId() { @@ -36,7 +33,6 @@ public Long getLocationId() { * This method sets the value of the database column core.location_tag_map.location_id * * @param locationId the value for core.location_tag_map.location_id - * * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 */ public void setLocationId(Long locationId) { @@ -48,7 +44,6 @@ public void setLocationId(Long locationId) { * This method returns the value of the database column core.location_tag_map.location_tag_id * * @return the value of core.location_tag_map.location_tag_id - * * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 */ public Long getLocationTagId() { @@ -60,7 +55,6 @@ public Long getLocationTagId() { * This method sets the value of the database column core.location_tag_map.location_tag_id * * @param locationTagId the value for core.location_tag_map.location_tag_id - * * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 */ public void setLocationTagId(Long locationTagId) { diff --git a/src/main/java/org/opensrp/domain/postgres/LocationTagMapExample.java b/src/main/java/org/opensrp/domain/postgres/LocationTagMapExample.java index 8a99928f1..9bedb8818 100644 --- a/src/main/java/org/opensrp/domain/postgres/LocationTagMapExample.java +++ b/src/main/java/org/opensrp/domain/postgres/LocationTagMapExample.java @@ -4,422 +4,422 @@ import java.util.List; public class LocationTagMapExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - public LocationTagMapExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andLocationIdIsNull() { - addCriterion("location_id is null"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNotNull() { - addCriterion("location_id is not null"); - return (Criteria) this; - } - - public Criteria andLocationIdEqualTo(Long value) { - addCriterion("location_id =", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotEqualTo(Long value) { - addCriterion("location_id <>", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThan(Long value) { - addCriterion("location_id >", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThanOrEqualTo(Long value) { - addCriterion("location_id >=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThan(Long value) { - addCriterion("location_id <", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThanOrEqualTo(Long value) { - addCriterion("location_id <=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdIn(List values) { - addCriterion("location_id in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotIn(List values) { - addCriterion("location_id not in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdBetween(Long value1, Long value2) { - addCriterion("location_id between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotBetween(Long value1, Long value2) { - addCriterion("location_id not between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationTagIdIsNull() { - addCriterion("location_tag_id is null"); - return (Criteria) this; - } - - public Criteria andLocationTagIdIsNotNull() { - addCriterion("location_tag_id is not null"); - return (Criteria) this; - } - - public Criteria andLocationTagIdEqualTo(Long value) { - addCriterion("location_tag_id =", value, "locationTagId"); - return (Criteria) this; - } - - public Criteria andLocationTagIdNotEqualTo(Long value) { - addCriterion("location_tag_id <>", value, "locationTagId"); - return (Criteria) this; - } - - public Criteria andLocationTagIdGreaterThan(Long value) { - addCriterion("location_tag_id >", value, "locationTagId"); - return (Criteria) this; - } - - public Criteria andLocationTagIdGreaterThanOrEqualTo(Long value) { - addCriterion("location_tag_id >=", value, "locationTagId"); - return (Criteria) this; - } - - public Criteria andLocationTagIdLessThan(Long value) { - addCriterion("location_tag_id <", value, "locationTagId"); - return (Criteria) this; - } - - public Criteria andLocationTagIdLessThanOrEqualTo(Long value) { - addCriterion("location_tag_id <=", value, "locationTagId"); - return (Criteria) this; - } - - public Criteria andLocationTagIdIn(List values) { - addCriterion("location_tag_id in", values, "locationTagId"); - return (Criteria) this; - } - - public Criteria andLocationTagIdNotIn(List values) { - addCriterion("location_tag_id not in", values, "locationTagId"); - return (Criteria) this; - } - - public Criteria andLocationTagIdBetween(Long value1, Long value2) { - addCriterion("location_tag_id between", value1, value2, "locationTagId"); - return (Criteria) this; - } - - public Criteria andLocationTagIdNotBetween(Long value1, Long value2) { - addCriterion("location_tag_id not between", value1, value2, "locationTagId"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.location_tag_map - * - * @mbggenerated do_not_delete_during_merge Sun Mar 22 10:04:15 BDT 2020 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.location_tag_map - * - * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + public LocationTagMapExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andLocationIdIsNull() { + addCriterion("location_id is null"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNotNull() { + addCriterion("location_id is not null"); + return (Criteria) this; + } + + public Criteria andLocationIdEqualTo(Long value) { + addCriterion("location_id =", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotEqualTo(Long value) { + addCriterion("location_id <>", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThan(Long value) { + addCriterion("location_id >", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThanOrEqualTo(Long value) { + addCriterion("location_id >=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThan(Long value) { + addCriterion("location_id <", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThanOrEqualTo(Long value) { + addCriterion("location_id <=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdIn(List values) { + addCriterion("location_id in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotIn(List values) { + addCriterion("location_id not in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdBetween(Long value1, Long value2) { + addCriterion("location_id between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotBetween(Long value1, Long value2) { + addCriterion("location_id not between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationTagIdIsNull() { + addCriterion("location_tag_id is null"); + return (Criteria) this; + } + + public Criteria andLocationTagIdIsNotNull() { + addCriterion("location_tag_id is not null"); + return (Criteria) this; + } + + public Criteria andLocationTagIdEqualTo(Long value) { + addCriterion("location_tag_id =", value, "locationTagId"); + return (Criteria) this; + } + + public Criteria andLocationTagIdNotEqualTo(Long value) { + addCriterion("location_tag_id <>", value, "locationTagId"); + return (Criteria) this; + } + + public Criteria andLocationTagIdGreaterThan(Long value) { + addCriterion("location_tag_id >", value, "locationTagId"); + return (Criteria) this; + } + + public Criteria andLocationTagIdGreaterThanOrEqualTo(Long value) { + addCriterion("location_tag_id >=", value, "locationTagId"); + return (Criteria) this; + } + + public Criteria andLocationTagIdLessThan(Long value) { + addCriterion("location_tag_id <", value, "locationTagId"); + return (Criteria) this; + } + + public Criteria andLocationTagIdLessThanOrEqualTo(Long value) { + addCriterion("location_tag_id <=", value, "locationTagId"); + return (Criteria) this; + } + + public Criteria andLocationTagIdIn(List values) { + addCriterion("location_tag_id in", values, "locationTagId"); + return (Criteria) this; + } + + public Criteria andLocationTagIdNotIn(List values) { + addCriterion("location_tag_id not in", values, "locationTagId"); + return (Criteria) this; + } + + public Criteria andLocationTagIdBetween(Long value1, Long value2) { + addCriterion("location_tag_id between", value1, value2, "locationTagId"); + return (Criteria) this; + } + + public Criteria andLocationTagIdNotBetween(Long value1, Long value2) { + addCriterion("location_tag_id not between", value1, value2, "locationTagId"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.location_tag_map + * + * @mbggenerated do_not_delete_during_merge Sun Mar 22 10:04:15 BDT 2020 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.location_tag_map + * + * @mbggenerated Sun Mar 22 10:04:15 BDT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/Manifest.java b/src/main/java/org/opensrp/domain/postgres/Manifest.java index 1e796a403..f33cfdd37 100644 --- a/src/main/java/org/opensrp/domain/postgres/Manifest.java +++ b/src/main/java/org/opensrp/domain/postgres/Manifest.java @@ -4,7 +4,6 @@ public class Manifest { /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.manifest.id * @@ -13,7 +12,6 @@ public class Manifest { private Long id; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.manifest.json * @@ -22,7 +20,6 @@ public class Manifest { private Object json; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.manifest.app_version * @@ -31,7 +28,6 @@ public class Manifest { private String appVersion; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.manifest.app_id * @@ -40,7 +36,6 @@ public class Manifest { private String appId; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.manifest.created_at * @@ -49,7 +44,6 @@ public class Manifest { private Date createdAt; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.manifest.updated_at * @@ -62,7 +56,6 @@ public class Manifest { * This method returns the value of the database column core.manifest.id * * @return the value of core.manifest.id - * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ public Long getId() { @@ -74,7 +67,6 @@ public Long getId() { * This method sets the value of the database column core.manifest.id * * @param id the value for core.manifest.id - * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ public void setId(Long id) { @@ -86,7 +78,6 @@ public void setId(Long id) { * This method returns the value of the database column core.manifest.json * * @return the value of core.manifest.json - * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ public Object getJson() { @@ -98,7 +89,6 @@ public Object getJson() { * This method sets the value of the database column core.manifest.json * * @param json the value for core.manifest.json - * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ public void setJson(Object json) { @@ -110,7 +100,6 @@ public void setJson(Object json) { * This method returns the value of the database column core.manifest.app_version * * @return the value of core.manifest.app_version - * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ public String getAppVersion() { @@ -122,7 +111,6 @@ public String getAppVersion() { * This method sets the value of the database column core.manifest.app_version * * @param appVersion the value for core.manifest.app_version - * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ public void setAppVersion(String appVersion) { @@ -134,7 +122,6 @@ public void setAppVersion(String appVersion) { * This method returns the value of the database column core.manifest.app_id * * @return the value of core.manifest.app_id - * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ public String getAppId() { @@ -146,7 +133,6 @@ public String getAppId() { * This method sets the value of the database column core.manifest.app_id * * @param appId the value for core.manifest.app_id - * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ public void setAppId(String appId) { @@ -158,7 +144,6 @@ public void setAppId(String appId) { * This method returns the value of the database column core.manifest.created_at * * @return the value of core.manifest.created_at - * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ public Date getCreatedAt() { @@ -170,7 +155,6 @@ public Date getCreatedAt() { * This method sets the value of the database column core.manifest.created_at * * @param createdAt the value for core.manifest.created_at - * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ public void setCreatedAt(Date createdAt) { @@ -182,7 +166,6 @@ public void setCreatedAt(Date createdAt) { * This method returns the value of the database column core.manifest.updated_at * * @return the value of core.manifest.updated_at - * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ public Date getUpdatedAt() { @@ -194,7 +177,6 @@ public Date getUpdatedAt() { * This method sets the value of the database column core.manifest.updated_at * * @param updatedAt the value for core.manifest.updated_at - * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ public void setUpdatedAt(Date updatedAt) { diff --git a/src/main/java/org/opensrp/domain/postgres/ManifestExample.java b/src/main/java/org/opensrp/domain/postgres/ManifestExample.java index b25b37402..eac91da27 100644 --- a/src/main/java/org/opensrp/domain/postgres/ManifestExample.java +++ b/src/main/java/org/opensrp/domain/postgres/ManifestExample.java @@ -45,8 +45,8 @@ public ManifestExample() { * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; + public String getOrderByClause() { + return orderByClause; } /** @@ -55,8 +55,8 @@ public void setOrderByClause(String orderByClause) { * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ - public String getOrderByClause() { - return orderByClause; + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; } /** @@ -65,8 +65,8 @@ public String getOrderByClause() { * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; + public boolean isDistinct() { + return distinct; } /** @@ -75,8 +75,8 @@ public void setDistinct(boolean distinct) { * * @mbg.generated Wed Apr 01 18:37:24 EAT 2020 */ - public boolean isDistinct() { - return distinct; + public void setDistinct(boolean distinct) { + this.distinct = distinct; } /** @@ -189,7 +189,7 @@ protected void addJsonCriterion(String condition, Object value1, Object value2, public boolean isValid() { return criteria.size() > 0 - || jsonCriteria.size() > 0; + || jsonCriteria.size() > 0; } public List getAllCriteria() { @@ -646,38 +646,6 @@ public static class Criterion { private String typeHandler; - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - protected Criterion(String condition) { super(); this.condition = condition; @@ -713,5 +681,37 @@ protected Criterion(String condition, Object value, Object secondValue, String t protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } } } diff --git a/src/main/java/org/opensrp/domain/postgres/MultiMedia.java b/src/main/java/org/opensrp/domain/postgres/MultiMedia.java index 40c2c607c..5bcda432d 100644 --- a/src/main/java/org/opensrp/domain/postgres/MultiMedia.java +++ b/src/main/java/org/opensrp/domain/postgres/MultiMedia.java @@ -4,7 +4,6 @@ public class MultiMedia { /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.multi_media.id * @@ -13,7 +12,6 @@ public class MultiMedia { private Long id; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.multi_media.document_id * @@ -22,7 +20,6 @@ public class MultiMedia { private String documentId; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.multi_media.case_id * @@ -31,7 +28,6 @@ public class MultiMedia { private String caseId; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.multi_media.provider_id * @@ -40,7 +36,6 @@ public class MultiMedia { private String providerId; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.multi_media.content_type * @@ -49,7 +44,6 @@ public class MultiMedia { private String contentType; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.multi_media.file_path * @@ -58,7 +52,6 @@ public class MultiMedia { private String filePath; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.multi_media.file_category * @@ -67,7 +60,6 @@ public class MultiMedia { private String fileCategory; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.multi_media.date_uploaded * @@ -76,7 +68,6 @@ public class MultiMedia { private Date dateUploaded; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.multi_media.summary * @@ -85,7 +76,6 @@ public class MultiMedia { private String summary; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.multi_media.original_file_name * @@ -98,7 +88,6 @@ public class MultiMedia { * This method returns the value of the database column core.multi_media.id * * @return the value of core.multi_media.id - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public Long getId() { @@ -110,7 +99,6 @@ public Long getId() { * This method sets the value of the database column core.multi_media.id * * @param id the value for core.multi_media.id - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public void setId(Long id) { @@ -122,7 +110,6 @@ public void setId(Long id) { * This method returns the value of the database column core.multi_media.document_id * * @return the value of core.multi_media.document_id - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public String getDocumentId() { @@ -134,7 +121,6 @@ public String getDocumentId() { * This method sets the value of the database column core.multi_media.document_id * * @param documentId the value for core.multi_media.document_id - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public void setDocumentId(String documentId) { @@ -146,7 +132,6 @@ public void setDocumentId(String documentId) { * This method returns the value of the database column core.multi_media.case_id * * @return the value of core.multi_media.case_id - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public String getCaseId() { @@ -158,7 +143,6 @@ public String getCaseId() { * This method sets the value of the database column core.multi_media.case_id * * @param caseId the value for core.multi_media.case_id - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public void setCaseId(String caseId) { @@ -170,7 +154,6 @@ public void setCaseId(String caseId) { * This method returns the value of the database column core.multi_media.provider_id * * @return the value of core.multi_media.provider_id - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public String getProviderId() { @@ -182,7 +165,6 @@ public String getProviderId() { * This method sets the value of the database column core.multi_media.provider_id * * @param providerId the value for core.multi_media.provider_id - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public void setProviderId(String providerId) { @@ -194,7 +176,6 @@ public void setProviderId(String providerId) { * This method returns the value of the database column core.multi_media.content_type * * @return the value of core.multi_media.content_type - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public String getContentType() { @@ -206,7 +187,6 @@ public String getContentType() { * This method sets the value of the database column core.multi_media.content_type * * @param contentType the value for core.multi_media.content_type - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public void setContentType(String contentType) { @@ -218,7 +198,6 @@ public void setContentType(String contentType) { * This method returns the value of the database column core.multi_media.file_path * * @return the value of core.multi_media.file_path - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public String getFilePath() { @@ -230,7 +209,6 @@ public String getFilePath() { * This method sets the value of the database column core.multi_media.file_path * * @param filePath the value for core.multi_media.file_path - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public void setFilePath(String filePath) { @@ -242,7 +220,6 @@ public void setFilePath(String filePath) { * This method returns the value of the database column core.multi_media.file_category * * @return the value of core.multi_media.file_category - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public String getFileCategory() { @@ -254,7 +231,6 @@ public String getFileCategory() { * This method sets the value of the database column core.multi_media.file_category * * @param fileCategory the value for core.multi_media.file_category - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public void setFileCategory(String fileCategory) { @@ -266,7 +242,6 @@ public void setFileCategory(String fileCategory) { * This method returns the value of the database column core.multi_media.date_uploaded * * @return the value of core.multi_media.date_uploaded - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public Date getDateUploaded() { @@ -278,7 +253,6 @@ public Date getDateUploaded() { * This method sets the value of the database column core.multi_media.date_uploaded * * @param dateUploaded the value for core.multi_media.date_uploaded - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public void setDateUploaded(Date dateUploaded) { @@ -290,7 +264,6 @@ public void setDateUploaded(Date dateUploaded) { * This method returns the value of the database column core.multi_media.summary * * @return the value of core.multi_media.summary - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public String getSummary() { @@ -302,7 +275,6 @@ public String getSummary() { * This method sets the value of the database column core.multi_media.summary * * @param summary the value for core.multi_media.summary - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public void setSummary(String summary) { @@ -314,7 +286,6 @@ public void setSummary(String summary) { * This method returns the value of the database column core.multi_media.original_file_name * * @return the value of core.multi_media.original_file_name - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public String getOriginalFileName() { @@ -326,7 +297,6 @@ public String getOriginalFileName() { * This method sets the value of the database column core.multi_media.original_file_name * * @param originalFileName the value for core.multi_media.original_file_name - * * @mbg.generated Mon May 18 06:23:33 EAT 2020 */ public void setOriginalFileName(String originalFileName) { diff --git a/src/main/java/org/opensrp/domain/postgres/MultiMediaExample.java b/src/main/java/org/opensrp/domain/postgres/MultiMediaExample.java index ef02697f7..7dae9e812 100644 --- a/src/main/java/org/opensrp/domain/postgres/MultiMediaExample.java +++ b/src/main/java/org/opensrp/domain/postgres/MultiMediaExample.java @@ -45,8 +45,8 @@ public MultiMediaExample() { * * @mbg.generated Mon May 18 06:32:48 EAT 2020 */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; + public String getOrderByClause() { + return orderByClause; } /** @@ -55,8 +55,8 @@ public void setOrderByClause(String orderByClause) { * * @mbg.generated Mon May 18 06:32:48 EAT 2020 */ - public String getOrderByClause() { - return orderByClause; + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; } /** @@ -65,8 +65,8 @@ public String getOrderByClause() { * * @mbg.generated Mon May 18 06:32:48 EAT 2020 */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; + public boolean isDistinct() { + return distinct; } /** @@ -75,8 +75,8 @@ public void setDistinct(boolean distinct) { * * @mbg.generated Mon May 18 06:32:48 EAT 2020 */ - public boolean isDistinct() { - return distinct; + public void setDistinct(boolean distinct) { + this.distinct = distinct; } /** @@ -912,38 +912,6 @@ public static class Criterion { private String typeHandler; - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - protected Criterion(String condition) { super(); this.condition = condition; @@ -979,5 +947,37 @@ protected Criterion(String condition, Object value, Object secondValue, String t protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } } } \ No newline at end of file diff --git a/src/main/java/org/opensrp/domain/postgres/Organization.java b/src/main/java/org/opensrp/domain/postgres/Organization.java index 3c46da2a3..528ef655b 100644 --- a/src/main/java/org/opensrp/domain/postgres/Organization.java +++ b/src/main/java/org/opensrp/domain/postgres/Organization.java @@ -4,303 +4,303 @@ public class Organization { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.organization.id - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.organization.identifier - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private String identifier; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.organization.active - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private Boolean active; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.organization.name - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private String name; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.organization.type - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private Object type; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.organization.date_deleted - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private Date dateDeleted; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.organization.parent_id - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private Long parentId; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.organization.date_created - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private Date dateCreated; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.organization.date_edited - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private Date dateEdited; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.organization.server_version - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private Long serverVersion; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.organization.id - * - * @return the value of team.organization.id - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.organization.id - * - * @param id the value for team.organization.id - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.organization.identifier - * - * @return the value of team.organization.identifier - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public String getIdentifier() { - return identifier; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.organization.identifier - * - * @param identifier the value for team.organization.identifier - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.organization.active - * - * @return the value of team.organization.active - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Boolean getActive() { - return active; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.organization.active - * - * @param active the value for team.organization.active - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setActive(Boolean active) { - this.active = active; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.organization.name - * - * @return the value of team.organization.name - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public String getName() { - return name; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.organization.name - * - * @param name the value for team.organization.name - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setName(String name) { - this.name = name; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.organization.type - * - * @return the value of team.organization.type - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Object getType() { - return type; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.organization.type - * - * @param type the value for team.organization.type - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setType(Object type) { - this.type = type; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.organization.date_deleted - * - * @return the value of team.organization.date_deleted - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Date getDateDeleted() { - return dateDeleted; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.organization.date_deleted - * - * @param dateDeleted the value for team.organization.date_deleted - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setDateDeleted(Date dateDeleted) { - this.dateDeleted = dateDeleted; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.organization.parent_id - * - * @return the value of team.organization.parent_id - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Long getParentId() { - return parentId; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.organization.parent_id - * - * @param parentId the value for team.organization.parent_id - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setParentId(Long parentId) { - this.parentId = parentId; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.organization.date_created - * - * @return the value of team.organization.date_created - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Date getDateCreated() { - return dateCreated; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.organization.date_created - * - * @param dateCreated the value for team.organization.date_created - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setDateCreated(Date dateCreated) { - this.dateCreated = dateCreated; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.organization.date_edited - * - * @return the value of team.organization.date_edited - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Date getDateEdited() { - return dateEdited; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.organization.date_edited - * - * @param dateEdited the value for team.organization.date_edited - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setDateEdited(Date dateEdited) { - this.dateEdited = dateEdited; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.organization.server_version - * - * @return the value of team.organization.server_version - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Long getServerVersion() { - return serverVersion; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.organization.server_version - * - * @param serverVersion the value for team.organization.server_version - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.organization.id + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.organization.identifier + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private String identifier; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.organization.active + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private Boolean active; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.organization.name + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private String name; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.organization.type + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private Object type; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.organization.date_deleted + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private Date dateDeleted; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.organization.parent_id + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private Long parentId; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.organization.date_created + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private Date dateCreated; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.organization.date_edited + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private Date dateEdited; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.organization.server_version + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private Long serverVersion; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.organization.id + * + * @return the value of team.organization.id + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.organization.id + * + * @param id the value for team.organization.id + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.organization.identifier + * + * @return the value of team.organization.identifier + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public String getIdentifier() { + return identifier; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.organization.identifier + * + * @param identifier the value for team.organization.identifier + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.organization.active + * + * @return the value of team.organization.active + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Boolean getActive() { + return active; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.organization.active + * + * @param active the value for team.organization.active + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setActive(Boolean active) { + this.active = active; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.organization.name + * + * @return the value of team.organization.name + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public String getName() { + return name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.organization.name + * + * @param name the value for team.organization.name + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setName(String name) { + this.name = name; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.organization.type + * + * @return the value of team.organization.type + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Object getType() { + return type; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.organization.type + * + * @param type the value for team.organization.type + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setType(Object type) { + this.type = type; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.organization.date_deleted + * + * @return the value of team.organization.date_deleted + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Date getDateDeleted() { + return dateDeleted; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.organization.date_deleted + * + * @param dateDeleted the value for team.organization.date_deleted + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setDateDeleted(Date dateDeleted) { + this.dateDeleted = dateDeleted; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.organization.parent_id + * + * @return the value of team.organization.parent_id + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Long getParentId() { + return parentId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.organization.parent_id + * + * @param parentId the value for team.organization.parent_id + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.organization.date_created + * + * @return the value of team.organization.date_created + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Date getDateCreated() { + return dateCreated; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.organization.date_created + * + * @param dateCreated the value for team.organization.date_created + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setDateCreated(Date dateCreated) { + this.dateCreated = dateCreated; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.organization.date_edited + * + * @return the value of team.organization.date_edited + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Date getDateEdited() { + return dateEdited; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.organization.date_edited + * + * @param dateEdited the value for team.organization.date_edited + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setDateEdited(Date dateEdited) { + this.dateEdited = dateEdited; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.organization.server_version + * + * @return the value of team.organization.server_version + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Long getServerVersion() { + return serverVersion; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.organization.server_version + * + * @param serverVersion the value for team.organization.server_version + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/OrganizationExample.java b/src/main/java/org/opensrp/domain/postgres/OrganizationExample.java index 59495b5bd..c093d1f1c 100644 --- a/src/main/java/org/opensrp/domain/postgres/OrganizationExample.java +++ b/src/main/java/org/opensrp/domain/postgres/OrganizationExample.java @@ -6,953 +6,953 @@ public class OrganizationExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public OrganizationExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - protected abstract static class GeneratedCriteria { - protected List typeCriteria; - protected List allCriteria; - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - typeCriteria = new ArrayList(); - } - - public List getTypeCriteria() { - return typeCriteria; - } - - protected void addTypeCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - typeCriteria.add( - new Criterion(condition, value, "org.opensrp.repository.postgres.handler.CodeSystemTypeHandler")); - allCriteria = null; - } - - protected void addTypeCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - typeCriteria.add(new Criterion(condition, value1, value2, - "org.opensrp.repository.postgres.handler.CodeSystemTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || typeCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList(); - allCriteria.addAll(criteria); - allCriteria.addAll(typeCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - allCriteria = null; - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNull() { - addCriterion("identifier is null"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNotNull() { - addCriterion("identifier is not null"); - return (Criteria) this; - } - - public Criteria andIdentifierEqualTo(String value) { - addCriterion("identifier =", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotEqualTo(String value) { - addCriterion("identifier <>", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThan(String value) { - addCriterion("identifier >", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThanOrEqualTo(String value) { - addCriterion("identifier >=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThan(String value) { - addCriterion("identifier <", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThanOrEqualTo(String value) { - addCriterion("identifier <=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLike(String value) { - addCriterion("identifier like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotLike(String value) { - addCriterion("identifier not like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierIn(List values) { - addCriterion("identifier in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotIn(List values) { - addCriterion("identifier not in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierBetween(String value1, String value2) { - addCriterion("identifier between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotBetween(String value1, String value2) { - addCriterion("identifier not between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andActiveIsNull() { - addCriterion("active is null"); - return (Criteria) this; - } - - public Criteria andActiveIsNotNull() { - addCriterion("active is not null"); - return (Criteria) this; - } - - public Criteria andActiveEqualTo(Boolean value) { - addCriterion("active =", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveNotEqualTo(Boolean value) { - addCriterion("active <>", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveGreaterThan(Boolean value) { - addCriterion("active >", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveGreaterThanOrEqualTo(Boolean value) { - addCriterion("active >=", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveLessThan(Boolean value) { - addCriterion("active <", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveLessThanOrEqualTo(Boolean value) { - addCriterion("active <=", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveIn(List values) { - addCriterion("active in", values, "active"); - return (Criteria) this; - } - - public Criteria andActiveNotIn(List values) { - addCriterion("active not in", values, "active"); - return (Criteria) this; - } - - public Criteria andActiveBetween(Boolean value1, Boolean value2) { - addCriterion("active between", value1, value2, "active"); - return (Criteria) this; - } - - public Criteria andActiveNotBetween(Boolean value1, Boolean value2) { - addCriterion("active not between", value1, value2, "active"); - return (Criteria) this; - } - - public Criteria andNameIsNull() { - addCriterion("name is null"); - return (Criteria) this; - } - - public Criteria andNameIsNotNull() { - addCriterion("name is not null"); - return (Criteria) this; - } - - public Criteria andNameEqualTo(String value) { - addCriterion("name =", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotEqualTo(String value) { - addCriterion("name <>", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThan(String value) { - addCriterion("name >", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("name >=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThan(String value) { - addCriterion("name <", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("name <=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLike(String value) { - addCriterion("name like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotLike(String value) { - addCriterion("name not like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameIn(List values) { - addCriterion("name in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameNotIn(List values) { - addCriterion("name not in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameBetween(String value1, String value2) { - addCriterion("name between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("name not between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andTypeIsNull() { - addCriterion("type is null"); - return (Criteria) this; - } - - public Criteria andTypeIsNotNull() { - addCriterion("type is not null"); - return (Criteria) this; - } - - public Criteria andTypeEqualTo(Object value) { - addTypeCriterion("type =", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotEqualTo(Object value) { - addTypeCriterion("type <>", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThan(Object value) { - addTypeCriterion("type >", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThanOrEqualTo(Object value) { - addTypeCriterion("type >=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThan(Object value) { - addTypeCriterion("type <", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThanOrEqualTo(Object value) { - addTypeCriterion("type <=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeIn(List values) { - addTypeCriterion("type in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotIn(List values) { - addTypeCriterion("type not in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeBetween(Object value1, Object value2) { - addTypeCriterion("type between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotBetween(Object value1, Object value2) { - addTypeCriterion("type not between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNull() { - addCriterion("date_deleted is null"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNotNull() { - addCriterion("date_deleted is not null"); - return (Criteria) this; - } - - public Criteria andDateDeletedEqualTo(Date value) { - addCriterion("date_deleted =", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotEqualTo(Date value) { - addCriterion("date_deleted <>", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThan(Date value) { - addCriterion("date_deleted >", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { - addCriterion("date_deleted >=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThan(Date value) { - addCriterion("date_deleted <", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThanOrEqualTo(Date value) { - addCriterion("date_deleted <=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedIn(List values) { - addCriterion("date_deleted in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotIn(List values) { - addCriterion("date_deleted not in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedBetween(Date value1, Date value2) { - addCriterion("date_deleted between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotBetween(Date value1, Date value2) { - addCriterion("date_deleted not between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andParentIdIsNull() { - addCriterion("parent_id is null"); - return (Criteria) this; - } - - public Criteria andParentIdIsNotNull() { - addCriterion("parent_id is not null"); - return (Criteria) this; - } - - public Criteria andParentIdEqualTo(Long value) { - addCriterion("parent_id =", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdNotEqualTo(Long value) { - addCriterion("parent_id <>", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdGreaterThan(Long value) { - addCriterion("parent_id >", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdGreaterThanOrEqualTo(Long value) { - addCriterion("parent_id >=", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdLessThan(Long value) { - addCriterion("parent_id <", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdLessThanOrEqualTo(Long value) { - addCriterion("parent_id <=", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdIn(List values) { - addCriterion("parent_id in", values, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdNotIn(List values) { - addCriterion("parent_id not in", values, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdBetween(Long value1, Long value2) { - addCriterion("parent_id between", value1, value2, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdNotBetween(Long value1, Long value2) { - addCriterion("parent_id not between", value1, value2, "parentId"); - return (Criteria) this; - } - - public Criteria andDateCreatedIsNull() { - addCriterion("date_created is null"); - return (Criteria) this; - } - - public Criteria andDateCreatedIsNotNull() { - addCriterion("date_created is not null"); - return (Criteria) this; - } - - public Criteria andDateCreatedEqualTo(Date value) { - addCriterion("date_created =", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotEqualTo(Date value) { - addCriterion("date_created <>", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedGreaterThan(Date value) { - addCriterion("date_created >", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { - addCriterion("date_created >=", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedLessThan(Date value) { - addCriterion("date_created <", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedLessThanOrEqualTo(Date value) { - addCriterion("date_created <=", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedIn(List values) { - addCriterion("date_created in", values, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotIn(List values) { - addCriterion("date_created not in", values, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedBetween(Date value1, Date value2) { - addCriterion("date_created between", value1, value2, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotBetween(Date value1, Date value2) { - addCriterion("date_created not between", value1, value2, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNull() { - addCriterion("date_edited is null"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNotNull() { - addCriterion("date_edited is not null"); - return (Criteria) this; - } - - public Criteria andDateEditedEqualTo(Date value) { - addCriterion("date_edited =", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotEqualTo(Date value) { - addCriterion("date_edited <>", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThan(Date value) { - addCriterion("date_edited >", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { - addCriterion("date_edited >=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThan(Date value) { - addCriterion("date_edited <", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThanOrEqualTo(Date value) { - addCriterion("date_edited <=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedIn(List values) { - addCriterion("date_edited in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotIn(List values) { - addCriterion("date_edited not in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedBetween(Date value1, Date value2) { - addCriterion("date_edited between", value1, value2, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotBetween(Date value1, Date value2) { - addCriterion("date_edited not between", value1, value2, "dateEdited"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table team.organization - * - * @mbg.generated do_not_delete_during_merge Mon Dec 06 14:53:20 EAT 2021 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public OrganizationExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + protected abstract static class GeneratedCriteria { + protected List typeCriteria; + protected List allCriteria; + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + typeCriteria = new ArrayList(); + } + + public List getTypeCriteria() { + return typeCriteria; + } + + protected void addTypeCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + typeCriteria.add( + new Criterion(condition, value, "org.opensrp.repository.postgres.handler.CodeSystemTypeHandler")); + allCriteria = null; + } + + protected void addTypeCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + typeCriteria.add(new Criterion(condition, value1, value2, + "org.opensrp.repository.postgres.handler.CodeSystemTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || typeCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList(); + allCriteria.addAll(criteria); + allCriteria.addAll(typeCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNull() { + addCriterion("identifier is null"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNotNull() { + addCriterion("identifier is not null"); + return (Criteria) this; + } + + public Criteria andIdentifierEqualTo(String value) { + addCriterion("identifier =", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotEqualTo(String value) { + addCriterion("identifier <>", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThan(String value) { + addCriterion("identifier >", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThanOrEqualTo(String value) { + addCriterion("identifier >=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThan(String value) { + addCriterion("identifier <", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThanOrEqualTo(String value) { + addCriterion("identifier <=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLike(String value) { + addCriterion("identifier like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotLike(String value) { + addCriterion("identifier not like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierIn(List values) { + addCriterion("identifier in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotIn(List values) { + addCriterion("identifier not in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierBetween(String value1, String value2) { + addCriterion("identifier between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotBetween(String value1, String value2) { + addCriterion("identifier not between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andActiveIsNull() { + addCriterion("active is null"); + return (Criteria) this; + } + + public Criteria andActiveIsNotNull() { + addCriterion("active is not null"); + return (Criteria) this; + } + + public Criteria andActiveEqualTo(Boolean value) { + addCriterion("active =", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveNotEqualTo(Boolean value) { + addCriterion("active <>", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveGreaterThan(Boolean value) { + addCriterion("active >", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveGreaterThanOrEqualTo(Boolean value) { + addCriterion("active >=", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveLessThan(Boolean value) { + addCriterion("active <", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveLessThanOrEqualTo(Boolean value) { + addCriterion("active <=", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveIn(List values) { + addCriterion("active in", values, "active"); + return (Criteria) this; + } + + public Criteria andActiveNotIn(List values) { + addCriterion("active not in", values, "active"); + return (Criteria) this; + } + + public Criteria andActiveBetween(Boolean value1, Boolean value2) { + addCriterion("active between", value1, value2, "active"); + return (Criteria) this; + } + + public Criteria andActiveNotBetween(Boolean value1, Boolean value2) { + addCriterion("active not between", value1, value2, "active"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Object value) { + addTypeCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Object value) { + addTypeCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Object value) { + addTypeCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Object value) { + addTypeCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Object value) { + addTypeCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Object value) { + addTypeCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addTypeCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addTypeCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Object value1, Object value2) { + addTypeCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Object value1, Object value2) { + addTypeCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNull() { + addCriterion("date_deleted is null"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNotNull() { + addCriterion("date_deleted is not null"); + return (Criteria) this; + } + + public Criteria andDateDeletedEqualTo(Date value) { + addCriterion("date_deleted =", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotEqualTo(Date value) { + addCriterion("date_deleted <>", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThan(Date value) { + addCriterion("date_deleted >", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { + addCriterion("date_deleted >=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThan(Date value) { + addCriterion("date_deleted <", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThanOrEqualTo(Date value) { + addCriterion("date_deleted <=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedIn(List values) { + addCriterion("date_deleted in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotIn(List values) { + addCriterion("date_deleted not in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedBetween(Date value1, Date value2) { + addCriterion("date_deleted between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotBetween(Date value1, Date value2) { + addCriterion("date_deleted not between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andParentIdIsNull() { + addCriterion("parent_id is null"); + return (Criteria) this; + } + + public Criteria andParentIdIsNotNull() { + addCriterion("parent_id is not null"); + return (Criteria) this; + } + + public Criteria andParentIdEqualTo(Long value) { + addCriterion("parent_id =", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotEqualTo(Long value) { + addCriterion("parent_id <>", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThan(Long value) { + addCriterion("parent_id >", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThanOrEqualTo(Long value) { + addCriterion("parent_id >=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThan(Long value) { + addCriterion("parent_id <", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThanOrEqualTo(Long value) { + addCriterion("parent_id <=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdIn(List values) { + addCriterion("parent_id in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotIn(List values) { + addCriterion("parent_id not in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdBetween(Long value1, Long value2) { + addCriterion("parent_id between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotBetween(Long value1, Long value2) { + addCriterion("parent_id not between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNull() { + addCriterion("date_created is null"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNotNull() { + addCriterion("date_created is not null"); + return (Criteria) this; + } + + public Criteria andDateCreatedEqualTo(Date value) { + addCriterion("date_created =", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotEqualTo(Date value) { + addCriterion("date_created <>", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThan(Date value) { + addCriterion("date_created >", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { + addCriterion("date_created >=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThan(Date value) { + addCriterion("date_created <", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThanOrEqualTo(Date value) { + addCriterion("date_created <=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedIn(List values) { + addCriterion("date_created in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotIn(List values) { + addCriterion("date_created not in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedBetween(Date value1, Date value2) { + addCriterion("date_created between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotBetween(Date value1, Date value2) { + addCriterion("date_created not between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNull() { + addCriterion("date_edited is null"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNotNull() { + addCriterion("date_edited is not null"); + return (Criteria) this; + } + + public Criteria andDateEditedEqualTo(Date value) { + addCriterion("date_edited =", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotEqualTo(Date value) { + addCriterion("date_edited <>", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThan(Date value) { + addCriterion("date_edited >", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { + addCriterion("date_edited >=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThan(Date value) { + addCriterion("date_edited <", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThanOrEqualTo(Date value) { + addCriterion("date_edited <=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedIn(List values) { + addCriterion("date_edited in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotIn(List values) { + addCriterion("date_edited not in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedBetween(Date value1, Date value2) { + addCriterion("date_edited between", value1, value2, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotBetween(Date value1, Date value2) { + addCriterion("date_edited not between", value1, value2, "dateEdited"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table team.organization + * + * @mbg.generated do_not_delete_during_merge Mon Dec 06 14:53:20 EAT 2021 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/OrganizationLocation.java b/src/main/java/org/opensrp/domain/postgres/OrganizationLocation.java index 71f2e535c..7bf62890e 100644 --- a/src/main/java/org/opensrp/domain/postgres/OrganizationLocation.java +++ b/src/main/java/org/opensrp/domain/postgres/OrganizationLocation.java @@ -3,214 +3,214 @@ import java.util.Date; public class OrganizationLocation { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * team.organization_location.id - * - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * team.organization_location.organization_id - * - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - private Long organizationId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * team.organization_location.location_id - * - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - private Long locationId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * team.organization_location.plan_id - * - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - private Long planId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * team.organization_location.from_date - * - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - private Date fromDate; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * team.organization_location.to_date - * - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - private Date toDate; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * team.organization_location.duration - * - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - private Object duration; - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column team.organization_location.id - * - * @return the value of team.organization_location.id - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * team.organization_location.id - * - * @param id the value for team.organization_location.id - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column team.organization_location.organization_id - * - * @return the value of team.organization_location.organization_id - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public Long getOrganizationId() { - return organizationId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * team.organization_location.organization_id - * - * @param organizationId the value for team.organization_location.organization_id - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public void setOrganizationId(Long organizationId) { - this.organizationId = organizationId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column team.organization_location.location_id - * - * @return the value of team.organization_location.location_id - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public Long getLocationId() { - return locationId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * team.organization_location.location_id - * - * @param locationId the value for team.organization_location.location_id - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public void setLocationId(Long locationId) { - this.locationId = locationId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column team.organization_location.plan_id - * - * @return the value of team.organization_location.plan_id - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public Long getPlanId() { - return planId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * team.organization_location.plan_id - * - * @param planId the value for team.organization_location.plan_id - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public void setPlanId(Long planId) { - this.planId = planId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column team.organization_location.from_date - * - * @return the value of team.organization_location.from_date - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public Date getFromDate() { - return fromDate; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * team.organization_location.from_date - * - * @param fromDate the value for team.organization_location.from_date - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public void setFromDate(Date fromDate) { - this.fromDate = fromDate; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column team.organization_location.to_date - * - * @return the value of team.organization_location.to_date - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public Date getToDate() { - return toDate; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * team.organization_location.to_date - * - * @param toDate the value for team.organization_location.to_date - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public void setToDate(Date toDate) { - this.toDate = toDate; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column team.organization_location.duration - * - * @return the value of team.organization_location.duration - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public Object getDuration() { - return duration; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * team.organization_location.duration - * - * @param duration the value for team.organization_location.duration - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public void setDuration(Object duration) { - this.duration = duration; - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * team.organization_location.id + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * team.organization_location.organization_id + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + private Long organizationId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * team.organization_location.location_id + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + private Long locationId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * team.organization_location.plan_id + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + private Long planId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * team.organization_location.from_date + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + private Date fromDate; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * team.organization_location.to_date + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + private Date toDate; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * team.organization_location.duration + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + private Object duration; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column team.organization_location.id + * + * @return the value of team.organization_location.id + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * team.organization_location.id + * + * @param id the value for team.organization_location.id + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column team.organization_location.organization_id + * + * @return the value of team.organization_location.organization_id + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public Long getOrganizationId() { + return organizationId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * team.organization_location.organization_id + * + * @param organizationId the value for team.organization_location.organization_id + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public void setOrganizationId(Long organizationId) { + this.organizationId = organizationId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column team.organization_location.location_id + * + * @return the value of team.organization_location.location_id + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public Long getLocationId() { + return locationId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * team.organization_location.location_id + * + * @param locationId the value for team.organization_location.location_id + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public void setLocationId(Long locationId) { + this.locationId = locationId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column team.organization_location.plan_id + * + * @return the value of team.organization_location.plan_id + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public Long getPlanId() { + return planId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * team.organization_location.plan_id + * + * @param planId the value for team.organization_location.plan_id + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public void setPlanId(Long planId) { + this.planId = planId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column team.organization_location.from_date + * + * @return the value of team.organization_location.from_date + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public Date getFromDate() { + return fromDate; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * team.organization_location.from_date + * + * @param fromDate the value for team.organization_location.from_date + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public void setFromDate(Date fromDate) { + this.fromDate = fromDate; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column team.organization_location.to_date + * + * @return the value of team.organization_location.to_date + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public Date getToDate() { + return toDate; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * team.organization_location.to_date + * + * @param toDate the value for team.organization_location.to_date + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public void setToDate(Date toDate) { + this.toDate = toDate; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column team.organization_location.duration + * + * @return the value of team.organization_location.duration + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public Object getDuration() { + return duration; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * team.organization_location.duration + * + * @param duration the value for team.organization_location.duration + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public void setDuration(Object duration) { + this.duration = duration; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/OrganizationLocationExample.java b/src/main/java/org/opensrp/domain/postgres/OrganizationLocationExample.java index 110a090d8..eed3e62b3 100644 --- a/src/main/java/org/opensrp/domain/postgres/OrganizationLocationExample.java +++ b/src/main/java/org/opensrp/domain/postgres/OrganizationLocationExample.java @@ -7,738 +7,754 @@ public class OrganizationLocationExample { /** - * This field was generated by MyBatis Generator. This field corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - protected String orderByClause; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - protected boolean distinct; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public OrganizationLocationExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List durationCriteria; - - protected List allCriteria; - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - durationCriteria = new ArrayList<>(); - } - - public List getDurationCriteria() { - return durationCriteria; - } - - protected void addDurationCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - durationCriteria - .add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.DateRangeTypeHandler")); - allCriteria = null; - } - - protected void addDurationCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - durationCriteria.add( - new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.DateRangeTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || durationCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList<>(); - allCriteria.addAll(criteria); - allCriteria.addAll(durationCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - allCriteria = null; - } - - protected void addCriterionForJDBCDate(String condition, Date value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - addCriterion(condition, new java.sql.Date(value.getTime()), property); - } - - protected void addCriterionForJDBCDate(String condition, List values, String property) { - if (values == null || values.size() == 0) { - throw new IllegalArgumentException("Value list for " + property + " cannot be null or empty"); - } - List dateList = new ArrayList<>(); - Iterator iter = values.iterator(); - while (iter.hasNext()) { - dateList.add(new java.sql.Date(iter.next().getTime())); - } - addCriterion(condition, dateList, property); - } - - protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andOrganizationIdIsNull() { - addCriterion("organization_id is null"); - return (Criteria) this; - } - - public Criteria andOrganizationIdIsNotNull() { - addCriterion("organization_id is not null"); - return (Criteria) this; - } - - public Criteria andOrganizationIdEqualTo(Long value) { - addCriterion("organization_id =", value, "organizationId"); - return (Criteria) this; - } - - public Criteria andOrganizationIdNotEqualTo(Long value) { - addCriterion("organization_id <>", value, "organizationId"); - return (Criteria) this; - } - - public Criteria andOrganizationIdGreaterThan(Long value) { - addCriterion("organization_id >", value, "organizationId"); - return (Criteria) this; - } - - public Criteria andOrganizationIdGreaterThanOrEqualTo(Long value) { - addCriterion("organization_id >=", value, "organizationId"); - return (Criteria) this; - } - - public Criteria andOrganizationIdLessThan(Long value) { - addCriterion("organization_id <", value, "organizationId"); - return (Criteria) this; - } - - public Criteria andOrganizationIdLessThanOrEqualTo(Long value) { - addCriterion("organization_id <=", value, "organizationId"); - return (Criteria) this; - } - - public Criteria andOrganizationIdIn(List values) { - addCriterion("organization_id in", values, "organizationId"); - return (Criteria) this; - } - - public Criteria andOrganizationIdNotIn(List values) { - addCriterion("organization_id not in", values, "organizationId"); - return (Criteria) this; - } - - public Criteria andOrganizationIdBetween(Long value1, Long value2) { - addCriterion("organization_id between", value1, value2, "organizationId"); - return (Criteria) this; - } - - public Criteria andOrganizationIdNotBetween(Long value1, Long value2) { - addCriterion("organization_id not between", value1, value2, "organizationId"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNull() { - addCriterion("location_id is null"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNotNull() { - addCriterion("location_id is not null"); - return (Criteria) this; - } - - public Criteria andLocationIdEqualTo(Long value) { - addCriterion("location_id =", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotEqualTo(Long value) { - addCriterion("location_id <>", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThan(Long value) { - addCriterion("location_id >", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThanOrEqualTo(Long value) { - addCriterion("location_id >=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThan(Long value) { - addCriterion("location_id <", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThanOrEqualTo(Long value) { - addCriterion("location_id <=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdIn(List values) { - addCriterion("location_id in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotIn(List values) { - addCriterion("location_id not in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdBetween(Long value1, Long value2) { - addCriterion("location_id between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotBetween(Long value1, Long value2) { - addCriterion("location_id not between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andPlanIdIsNull() { - addCriterion("plan_id is null"); - return (Criteria) this; - } - - public Criteria andPlanIdIsNotNull() { - addCriterion("plan_id is not null"); - return (Criteria) this; - } - - public Criteria andPlanIdEqualTo(Long value) { - addCriterion("plan_id =", value, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdNotEqualTo(Long value) { - addCriterion("plan_id <>", value, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdGreaterThan(Long value) { - addCriterion("plan_id >", value, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdGreaterThanOrEqualTo(Long value) { - addCriterion("plan_id >=", value, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdLessThan(Long value) { - addCriterion("plan_id <", value, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdLessThanOrEqualTo(Long value) { - addCriterion("plan_id <=", value, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdIn(List values) { - addCriterion("plan_id in", values, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdNotIn(List values) { - addCriterion("plan_id not in", values, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdBetween(Long value1, Long value2) { - addCriterion("plan_id between", value1, value2, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdNotBetween(Long value1, Long value2) { - addCriterion("plan_id not between", value1, value2, "planId"); - return (Criteria) this; - } - - public Criteria andFromDateIsNull() { - addCriterion("from_date is null"); - return (Criteria) this; - } - - public Criteria andFromDateIsNotNull() { - addCriterion("from_date is not null"); - return (Criteria) this; - } - - public Criteria andFromDateEqualTo(Date value) { - addCriterionForJDBCDate("from_date =", value, "fromDate"); - return (Criteria) this; - } - - public Criteria andFromDateNotEqualTo(Date value) { - addCriterionForJDBCDate("from_date <>", value, "fromDate"); - return (Criteria) this; - } - - public Criteria andFromDateGreaterThan(Date value) { - addCriterionForJDBCDate("from_date >", value, "fromDate"); - return (Criteria) this; - } - - public Criteria andFromDateGreaterThanOrEqualTo(Date value) { - addCriterionForJDBCDate("from_date >=", value, "fromDate"); - return (Criteria) this; - } - - public Criteria andFromDateLessThan(Date value) { - addCriterionForJDBCDate("from_date <", value, "fromDate"); - return (Criteria) this; - } - - public Criteria andFromDateLessThanOrEqualTo(Date value) { - addCriterionForJDBCDate("from_date <=", value, "fromDate"); - return (Criteria) this; - } - - public Criteria andFromDateIn(List values) { - addCriterionForJDBCDate("from_date in", values, "fromDate"); - return (Criteria) this; - } - - public Criteria andFromDateNotIn(List values) { - addCriterionForJDBCDate("from_date not in", values, "fromDate"); - return (Criteria) this; - } - - public Criteria andFromDateBetween(Date value1, Date value2) { - addCriterionForJDBCDate("from_date between", value1, value2, "fromDate"); - return (Criteria) this; - } - - public Criteria andFromDateNotBetween(Date value1, Date value2) { - addCriterionForJDBCDate("from_date not between", value1, value2, "fromDate"); - return (Criteria) this; - } - - public Criteria andToDateIsNull() { - addCriterion("to_date is null"); - return (Criteria) this; - } - - public Criteria andToDateIsNotNull() { - addCriterion("to_date is not null"); - return (Criteria) this; - } - - public Criteria andToDateEqualTo(Date value) { - addCriterionForJDBCDate("to_date =", value, "toDate"); - return (Criteria) this; - } - - public Criteria andToDateNotEqualTo(Date value) { - addCriterionForJDBCDate("to_date <>", value, "toDate"); - return (Criteria) this; - } - - public Criteria andToDateGreaterThan(Date value) { - addCriterionForJDBCDate("to_date >", value, "toDate"); - return (Criteria) this; - } - - public Criteria andToDateGreaterThanOrEqualTo(Date value) { - addCriterionForJDBCDate("to_date >=", value, "toDate"); - return (Criteria) this; - } - - public Criteria andToDateLessThan(Date value) { - addCriterionForJDBCDate("to_date <", value, "toDate"); - return (Criteria) this; - } - - public Criteria andToDateLessThanOrEqualTo(Date value) { - addCriterionForJDBCDate("to_date <=", value, "toDate"); - return (Criteria) this; - } - - public Criteria andToDateIn(List values) { - addCriterionForJDBCDate("to_date in", values, "toDate"); - return (Criteria) this; - } - - public Criteria andToDateNotIn(List values) { - addCriterionForJDBCDate("to_date not in", values, "toDate"); - return (Criteria) this; - } - - public Criteria andToDateBetween(Date value1, Date value2) { - addCriterionForJDBCDate("to_date between", value1, value2, "toDate"); - return (Criteria) this; - } - - public Criteria andToDateNotBetween(Date value1, Date value2) { - addCriterionForJDBCDate("to_date not between", value1, value2, "toDate"); - return (Criteria) this; - } - - public Criteria andDurationIsNull() { - addCriterion("duration is null"); - return (Criteria) this; - } - - public Criteria andDurationIsNotNull() { - addCriterion("duration is not null"); - return (Criteria) this; - } - - public Criteria andDurationEqualTo(Object value) { - addDurationCriterion("duration =", value, "duration"); - return (Criteria) this; - } - - public Criteria andDurationNotEqualTo(Object value) { - addDurationCriterion("duration <>", value, "duration"); - return (Criteria) this; - } - - public Criteria andDurationGreaterThan(Object value) { - addDurationCriterion("duration >", value, "duration"); - return (Criteria) this; - } - - public Criteria andDurationGreaterThanOrEqualTo(Object value) { - addDurationCriterion("duration >=", value, "duration"); - return (Criteria) this; - } - - public Criteria andDurationLessThan(Object value) { - addDurationCriterion("duration <", value, "duration"); - return (Criteria) this; - } - - public Criteria andDurationLessThanOrEqualTo(Object value) { - addDurationCriterion("duration <=", value, "duration"); - return (Criteria) this; - } - - public Criteria andDurationIn(List values) { - addDurationCriterion("duration in", values, "duration"); - return (Criteria) this; - } - - public Criteria andDurationNotIn(List values) { - addDurationCriterion("duration not in", values, "duration"); - return (Criteria) this; - } - - public Criteria andDurationBetween(Object value1, Object value2) { - addDurationCriterion("duration between", value1, value2, "duration"); - return (Criteria) this; - } - - public Criteria andDurationNotBetween(Object value1, Object value2) { - addDurationCriterion("duration not between", value1, value2, "duration"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** + * This field was generated by MyBatis Generator. This field corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + protected String orderByClause; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + protected boolean distinct; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public OrganizationLocationExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List durationCriteria; + + protected List allCriteria; + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + durationCriteria = new ArrayList<>(); + } + + public List getDurationCriteria() { + return durationCriteria; + } + + protected void addDurationCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + durationCriteria + .add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.DateRangeTypeHandler")); + allCriteria = null; + } + + protected void addDurationCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + durationCriteria.add( + new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.DateRangeTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || durationCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList<>(); + allCriteria.addAll(criteria); + allCriteria.addAll(durationCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + protected void addCriterionForJDBCDate(String condition, Date value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + addCriterion(condition, new java.sql.Date(value.getTime()), property); + } + + protected void addCriterionForJDBCDate(String condition, List values, String property) { + if (values == null || values.size() == 0) { + throw new IllegalArgumentException("Value list for " + property + " cannot be null or empty"); + } + List dateList = new ArrayList<>(); + Iterator iter = values.iterator(); + while (iter.hasNext()) { + dateList.add(new java.sql.Date(iter.next().getTime())); + } + addCriterion(condition, dateList, property); + } + + protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andOrganizationIdIsNull() { + addCriterion("organization_id is null"); + return (Criteria) this; + } + + public Criteria andOrganizationIdIsNotNull() { + addCriterion("organization_id is not null"); + return (Criteria) this; + } + + public Criteria andOrganizationIdEqualTo(Long value) { + addCriterion("organization_id =", value, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdNotEqualTo(Long value) { + addCriterion("organization_id <>", value, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdGreaterThan(Long value) { + addCriterion("organization_id >", value, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdGreaterThanOrEqualTo(Long value) { + addCriterion("organization_id >=", value, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdLessThan(Long value) { + addCriterion("organization_id <", value, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdLessThanOrEqualTo(Long value) { + addCriterion("organization_id <=", value, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdIn(List values) { + addCriterion("organization_id in", values, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdNotIn(List values) { + addCriterion("organization_id not in", values, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdBetween(Long value1, Long value2) { + addCriterion("organization_id between", value1, value2, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdNotBetween(Long value1, Long value2) { + addCriterion("organization_id not between", value1, value2, "organizationId"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNull() { + addCriterion("location_id is null"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNotNull() { + addCriterion("location_id is not null"); + return (Criteria) this; + } + + public Criteria andLocationIdEqualTo(Long value) { + addCriterion("location_id =", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotEqualTo(Long value) { + addCriterion("location_id <>", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThan(Long value) { + addCriterion("location_id >", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThanOrEqualTo(Long value) { + addCriterion("location_id >=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThan(Long value) { + addCriterion("location_id <", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThanOrEqualTo(Long value) { + addCriterion("location_id <=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdIn(List values) { + addCriterion("location_id in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotIn(List values) { + addCriterion("location_id not in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdBetween(Long value1, Long value2) { + addCriterion("location_id between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotBetween(Long value1, Long value2) { + addCriterion("location_id not between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andPlanIdIsNull() { + addCriterion("plan_id is null"); + return (Criteria) this; + } + + public Criteria andPlanIdIsNotNull() { + addCriterion("plan_id is not null"); + return (Criteria) this; + } + + public Criteria andPlanIdEqualTo(Long value) { + addCriterion("plan_id =", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdNotEqualTo(Long value) { + addCriterion("plan_id <>", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdGreaterThan(Long value) { + addCriterion("plan_id >", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdGreaterThanOrEqualTo(Long value) { + addCriterion("plan_id >=", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdLessThan(Long value) { + addCriterion("plan_id <", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdLessThanOrEqualTo(Long value) { + addCriterion("plan_id <=", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdIn(List values) { + addCriterion("plan_id in", values, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdNotIn(List values) { + addCriterion("plan_id not in", values, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdBetween(Long value1, Long value2) { + addCriterion("plan_id between", value1, value2, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdNotBetween(Long value1, Long value2) { + addCriterion("plan_id not between", value1, value2, "planId"); + return (Criteria) this; + } + + public Criteria andFromDateIsNull() { + addCriterion("from_date is null"); + return (Criteria) this; + } + + public Criteria andFromDateIsNotNull() { + addCriterion("from_date is not null"); + return (Criteria) this; + } + + public Criteria andFromDateEqualTo(Date value) { + addCriterionForJDBCDate("from_date =", value, "fromDate"); + return (Criteria) this; + } + + public Criteria andFromDateNotEqualTo(Date value) { + addCriterionForJDBCDate("from_date <>", value, "fromDate"); + return (Criteria) this; + } + + public Criteria andFromDateGreaterThan(Date value) { + addCriterionForJDBCDate("from_date >", value, "fromDate"); + return (Criteria) this; + } + + public Criteria andFromDateGreaterThanOrEqualTo(Date value) { + addCriterionForJDBCDate("from_date >=", value, "fromDate"); + return (Criteria) this; + } + + public Criteria andFromDateLessThan(Date value) { + addCriterionForJDBCDate("from_date <", value, "fromDate"); + return (Criteria) this; + } + + public Criteria andFromDateLessThanOrEqualTo(Date value) { + addCriterionForJDBCDate("from_date <=", value, "fromDate"); + return (Criteria) this; + } + + public Criteria andFromDateIn(List values) { + addCriterionForJDBCDate("from_date in", values, "fromDate"); + return (Criteria) this; + } + + public Criteria andFromDateNotIn(List values) { + addCriterionForJDBCDate("from_date not in", values, "fromDate"); + return (Criteria) this; + } + + public Criteria andFromDateBetween(Date value1, Date value2) { + addCriterionForJDBCDate("from_date between", value1, value2, "fromDate"); + return (Criteria) this; + } + + public Criteria andFromDateNotBetween(Date value1, Date value2) { + addCriterionForJDBCDate("from_date not between", value1, value2, "fromDate"); + return (Criteria) this; + } + + public Criteria andToDateIsNull() { + addCriterion("to_date is null"); + return (Criteria) this; + } + + public Criteria andToDateIsNotNull() { + addCriterion("to_date is not null"); + return (Criteria) this; + } + + public Criteria andToDateEqualTo(Date value) { + addCriterionForJDBCDate("to_date =", value, "toDate"); + return (Criteria) this; + } + + public Criteria andToDateNotEqualTo(Date value) { + addCriterionForJDBCDate("to_date <>", value, "toDate"); + return (Criteria) this; + } + + public Criteria andToDateGreaterThan(Date value) { + addCriterionForJDBCDate("to_date >", value, "toDate"); + return (Criteria) this; + } + + public Criteria andToDateGreaterThanOrEqualTo(Date value) { + addCriterionForJDBCDate("to_date >=", value, "toDate"); + return (Criteria) this; + } + + public Criteria andToDateLessThan(Date value) { + addCriterionForJDBCDate("to_date <", value, "toDate"); + return (Criteria) this; + } + + public Criteria andToDateLessThanOrEqualTo(Date value) { + addCriterionForJDBCDate("to_date <=", value, "toDate"); + return (Criteria) this; + } + + public Criteria andToDateIn(List values) { + addCriterionForJDBCDate("to_date in", values, "toDate"); + return (Criteria) this; + } + + public Criteria andToDateNotIn(List values) { + addCriterionForJDBCDate("to_date not in", values, "toDate"); + return (Criteria) this; + } + + public Criteria andToDateBetween(Date value1, Date value2) { + addCriterionForJDBCDate("to_date between", value1, value2, "toDate"); + return (Criteria) this; + } + + public Criteria andToDateNotBetween(Date value1, Date value2) { + addCriterionForJDBCDate("to_date not between", value1, value2, "toDate"); + return (Criteria) this; + } + + public Criteria andDurationIsNull() { + addCriterion("duration is null"); + return (Criteria) this; + } + + public Criteria andDurationIsNotNull() { + addCriterion("duration is not null"); + return (Criteria) this; + } + + public Criteria andDurationEqualTo(Object value) { + addDurationCriterion("duration =", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationNotEqualTo(Object value) { + addDurationCriterion("duration <>", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationGreaterThan(Object value) { + addDurationCriterion("duration >", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationGreaterThanOrEqualTo(Object value) { + addDurationCriterion("duration >=", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationLessThan(Object value) { + addDurationCriterion("duration <", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationLessThanOrEqualTo(Object value) { + addDurationCriterion("duration <=", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationIn(List values) { + addDurationCriterion("duration in", values, "duration"); + return (Criteria) this; + } + + public Criteria andDurationNotIn(List values) { + addDurationCriterion("duration not in", values, "duration"); + return (Criteria) this; + } + + public Criteria andDurationBetween(Object value1, Object value2) { + addDurationCriterion("duration between", value1, value2, "duration"); + return (Criteria) this; + } + + public Criteria andDurationNotBetween(Object value1, Object value2) { + addDurationCriterion("duration not between", value1, value2, "duration"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** * This class was generated by MyBatis Generator. * This class corresponds to the database table team.organization_location * diff --git a/src/main/java/org/opensrp/domain/postgres/PgStockAndProductDetails.java b/src/main/java/org/opensrp/domain/postgres/PgStockAndProductDetails.java index d23646d5e..8d84061bd 100644 --- a/src/main/java/org/opensrp/domain/postgres/PgStockAndProductDetails.java +++ b/src/main/java/org/opensrp/domain/postgres/PgStockAndProductDetails.java @@ -11,6 +11,6 @@ @NoArgsConstructor public class PgStockAndProductDetails { - private Stock stock; - private ProductCatalogue productCatalogue; + private Stock stock; + private ProductCatalogue productCatalogue; } diff --git a/src/main/java/org/opensrp/domain/postgres/Plan.java b/src/main/java/org/opensrp/domain/postgres/Plan.java index 11fff1bfd..5ebde53fd 100644 --- a/src/main/java/org/opensrp/domain/postgres/Plan.java +++ b/src/main/java/org/opensrp/domain/postgres/Plan.java @@ -3,244 +3,244 @@ import java.util.Date; public class Plan { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.plan.id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.plan.identifier - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String identifier; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.plan.json - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Object json; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.plan.date_deleted - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Date dateDeleted; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.plan.server_version - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Long serverVersion; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.plan.experimental - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Boolean experimental; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.plan.date_created - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Date dateCreated; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.plan.date_edited - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Date dateEdited; - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.plan.id - * - * @return the value of core.plan.id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.plan.id - * - * @param id the value for core.plan.id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.plan.identifier - * - * @return the value of core.plan.identifier - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getIdentifier() { - return identifier; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.plan.identifier - * - * @param identifier the value for core.plan.identifier - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.plan.json - * - * @return the value of core.plan.json - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Object getJson() { - return json; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.plan.json - * - * @param json the value for core.plan.json - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setJson(Object json) { - this.json = json; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.plan.date_deleted - * - * @return the value of core.plan.date_deleted - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Date getDateDeleted() { - return dateDeleted; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.plan.date_deleted - * - * @param dateDeleted the value for core.plan.date_deleted - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setDateDeleted(Date dateDeleted) { - this.dateDeleted = dateDeleted; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.plan.server_version - * - * @return the value of core.plan.server_version - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Long getServerVersion() { - return serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.plan.server_version - * - * @param serverVersion the value for core.plan.server_version - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.plan.experimental - * - * @return the value of core.plan.experimental - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Boolean getExperimental() { - return experimental; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.plan.experimental - * - * @param experimental the value for core.plan.experimental - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setExperimental(Boolean experimental) { - this.experimental = experimental; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.plan.date_created - * - * @return the value of core.plan.date_created - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Date getDateCreated() { - return dateCreated; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.plan.date_created - * - * @param dateCreated the value for core.plan.date_created - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setDateCreated(Date dateCreated) { - this.dateCreated = dateCreated; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.plan.date_edited - * - * @return the value of core.plan.date_edited - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Date getDateEdited() { - return dateEdited; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.plan.date_edited - * - * @param dateEdited the value for core.plan.date_edited - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setDateEdited(Date dateEdited) { - this.dateEdited = dateEdited; - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.plan.id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.plan.identifier + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String identifier; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.plan.json + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Object json; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.plan.date_deleted + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Date dateDeleted; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.plan.server_version + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Long serverVersion; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.plan.experimental + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Boolean experimental; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.plan.date_created + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Date dateCreated; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.plan.date_edited + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Date dateEdited; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.plan.id + * + * @return the value of core.plan.id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.plan.id + * + * @param id the value for core.plan.id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.plan.identifier + * + * @return the value of core.plan.identifier + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getIdentifier() { + return identifier; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.plan.identifier + * + * @param identifier the value for core.plan.identifier + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.plan.json + * + * @return the value of core.plan.json + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Object getJson() { + return json; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.plan.json + * + * @param json the value for core.plan.json + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setJson(Object json) { + this.json = json; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.plan.date_deleted + * + * @return the value of core.plan.date_deleted + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Date getDateDeleted() { + return dateDeleted; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.plan.date_deleted + * + * @param dateDeleted the value for core.plan.date_deleted + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setDateDeleted(Date dateDeleted) { + this.dateDeleted = dateDeleted; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.plan.server_version + * + * @return the value of core.plan.server_version + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Long getServerVersion() { + return serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.plan.server_version + * + * @param serverVersion the value for core.plan.server_version + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.plan.experimental + * + * @return the value of core.plan.experimental + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Boolean getExperimental() { + return experimental; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.plan.experimental + * + * @param experimental the value for core.plan.experimental + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setExperimental(Boolean experimental) { + this.experimental = experimental; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.plan.date_created + * + * @return the value of core.plan.date_created + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Date getDateCreated() { + return dateCreated; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.plan.date_created + * + * @param dateCreated the value for core.plan.date_created + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setDateCreated(Date dateCreated) { + this.dateCreated = dateCreated; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.plan.date_edited + * + * @return the value of core.plan.date_edited + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Date getDateEdited() { + return dateEdited; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.plan.date_edited + * + * @param dateEdited the value for core.plan.date_edited + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setDateEdited(Date dateEdited) { + this.dateEdited = dateEdited; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/PlanExample.java b/src/main/java/org/opensrp/domain/postgres/PlanExample.java index d23129181..970ef6196 100644 --- a/src/main/java/org/opensrp/domain/postgres/PlanExample.java +++ b/src/main/java/org/opensrp/domain/postgres/PlanExample.java @@ -5,823 +5,823 @@ import java.util.List; public class PlanExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public PlanExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List jsonCriteria; - - protected List allCriteria; - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - jsonCriteria = new ArrayList<>(); - } - - public List getJsonCriteria() { - return jsonCriteria; - } - - protected void addJsonCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.PlanTypeHandler")); - allCriteria = null; - } - - protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - jsonCriteria.add( - new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.PlanTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || jsonCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList<>(); - allCriteria.addAll(criteria); - allCriteria.addAll(jsonCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNull() { - addCriterion("identifier is null"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNotNull() { - addCriterion("identifier is not null"); - return (Criteria) this; - } - - public Criteria andIdentifierEqualTo(String value) { - addCriterion("identifier =", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotEqualTo(String value) { - addCriterion("identifier <>", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThan(String value) { - addCriterion("identifier >", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThanOrEqualTo(String value) { - addCriterion("identifier >=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThan(String value) { - addCriterion("identifier <", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThanOrEqualTo(String value) { - addCriterion("identifier <=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLike(String value) { - addCriterion("identifier like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotLike(String value) { - addCriterion("identifier not like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierIn(List values) { - addCriterion("identifier in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotIn(List values) { - addCriterion("identifier not in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierBetween(String value1, String value2) { - addCriterion("identifier between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotBetween(String value1, String value2) { - addCriterion("identifier not between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andJsonIsNull() { - addCriterion("json is null"); - return (Criteria) this; - } - - public Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (Criteria) this; - } - - public Criteria andJsonEqualTo(Object value) { - addCriterion("json =", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotEqualTo(Object value) { - addCriterion("json <>", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThan(Object value) { - addCriterion("json >", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThanOrEqualTo(Object value) { - addCriterion("json >=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThan(Object value) { - addCriterion("json <", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThanOrEqualTo(Object value) { - addCriterion("json <=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonIn(List values) { - addCriterion("json in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotIn(List values) { - addCriterion("json not in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonBetween(Object value1, Object value2) { - addCriterion("json between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotBetween(Object value1, Object value2) { - addCriterion("json not between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNull() { - addCriterion("date_deleted is null"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNotNull() { - addCriterion("date_deleted is not null"); - return (Criteria) this; - } - - public Criteria andDateDeletedEqualTo(Date value) { - addCriterion("date_deleted =", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotEqualTo(Date value) { - addCriterion("date_deleted <>", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThan(Date value) { - addCriterion("date_deleted >", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { - addCriterion("date_deleted >=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThan(Date value) { - addCriterion("date_deleted <", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThanOrEqualTo(Date value) { - addCriterion("date_deleted <=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedIn(List values) { - addCriterion("date_deleted in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotIn(List values) { - addCriterion("date_deleted not in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedBetween(Date value1, Date value2) { - addCriterion("date_deleted between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotBetween(Date value1, Date value2) { - addCriterion("date_deleted not between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andExperimentalIsNull() { - addCriterion("experimental is null"); - return (Criteria) this; - } - - public Criteria andExperimentalIsNotNull() { - addCriterion("experimental is not null"); - return (Criteria) this; - } - - public Criteria andExperimentalEqualTo(Boolean value) { - addCriterion("experimental =", value, "experimental"); - return (Criteria) this; - } - - public Criteria andExperimentalNotEqualTo(Boolean value) { - addCriterion("experimental <>", value, "experimental"); - return (Criteria) this; - } - - public Criteria andExperimentalGreaterThan(Boolean value) { - addCriterion("experimental >", value, "experimental"); - return (Criteria) this; - } - - public Criteria andExperimentalGreaterThanOrEqualTo(Boolean value) { - addCriterion("experimental >=", value, "experimental"); - return (Criteria) this; - } - - public Criteria andExperimentalLessThan(Boolean value) { - addCriterion("experimental <", value, "experimental"); - return (Criteria) this; - } - - public Criteria andExperimentalLessThanOrEqualTo(Boolean value) { - addCriterion("experimental <=", value, "experimental"); - return (Criteria) this; - } - - public Criteria andExperimentalIn(List values) { - addCriterion("experimental in", values, "experimental"); - return (Criteria) this; - } - - public Criteria andExperimentalNotIn(List values) { - addCriterion("experimental not in", values, "experimental"); - return (Criteria) this; - } - - public Criteria andExperimentalBetween(Boolean value1, Boolean value2) { - addCriterion("experimental between", value1, value2, "experimental"); - return (Criteria) this; - } - - public Criteria andExperimentalNotBetween(Boolean value1, Boolean value2) { - addCriterion("experimental not between", value1, value2, "experimental"); - return (Criteria) this; - } - - public Criteria andDateCreatedIsNull() { - addCriterion("date_created is null"); - return (Criteria) this; - } - - public Criteria andDateCreatedIsNotNull() { - addCriterion("date_created is not null"); - return (Criteria) this; - } - - public Criteria andDateCreatedEqualTo(Date value) { - addCriterion("date_created =", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotEqualTo(Date value) { - addCriterion("date_created <>", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedGreaterThan(Date value) { - addCriterion("date_created >", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { - addCriterion("date_created >=", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedLessThan(Date value) { - addCriterion("date_created <", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedLessThanOrEqualTo(Date value) { - addCriterion("date_created <=", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedIn(List values) { - addCriterion("date_created in", values, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotIn(List values) { - addCriterion("date_created not in", values, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedBetween(Date value1, Date value2) { - addCriterion("date_created between", value1, value2, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotBetween(Date value1, Date value2) { - addCriterion("date_created not between", value1, value2, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNull() { - addCriterion("date_edited is null"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNotNull() { - addCriterion("date_edited is not null"); - return (Criteria) this; - } - - public Criteria andDateEditedEqualTo(Date value) { - addCriterion("date_edited =", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotEqualTo(Date value) { - addCriterion("date_edited <>", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThan(Date value) { - addCriterion("date_edited >", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { - addCriterion("date_edited >=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThan(Date value) { - addCriterion("date_edited <", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThanOrEqualTo(Date value) { - addCriterion("date_edited <=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedIn(List values) { - addCriterion("date_edited in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotIn(List values) { - addCriterion("date_edited not in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedBetween(Date value1, Date value2) { - addCriterion("date_edited between", value1, value2, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotBetween(Date value1, Date value2) { - addCriterion("date_edited not between", value1, value2, "dateEdited"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.plan - * - * @mbg.generated do_not_delete_during_merge Wed Sep 30 15:22:34 EAT 2020 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public PlanExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List jsonCriteria; + + protected List allCriteria; + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + jsonCriteria = new ArrayList<>(); + } + + public List getJsonCriteria() { + return jsonCriteria; + } + + protected void addJsonCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.PlanTypeHandler")); + allCriteria = null; + } + + protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + jsonCriteria.add( + new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.PlanTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || jsonCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList<>(); + allCriteria.addAll(criteria); + allCriteria.addAll(jsonCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNull() { + addCriterion("identifier is null"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNotNull() { + addCriterion("identifier is not null"); + return (Criteria) this; + } + + public Criteria andIdentifierEqualTo(String value) { + addCriterion("identifier =", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotEqualTo(String value) { + addCriterion("identifier <>", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThan(String value) { + addCriterion("identifier >", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThanOrEqualTo(String value) { + addCriterion("identifier >=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThan(String value) { + addCriterion("identifier <", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThanOrEqualTo(String value) { + addCriterion("identifier <=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLike(String value) { + addCriterion("identifier like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotLike(String value) { + addCriterion("identifier not like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierIn(List values) { + addCriterion("identifier in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotIn(List values) { + addCriterion("identifier not in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierBetween(String value1, String value2) { + addCriterion("identifier between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotBetween(String value1, String value2) { + addCriterion("identifier not between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andJsonIsNull() { + addCriterion("json is null"); + return (Criteria) this; + } + + public Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (Criteria) this; + } + + public Criteria andJsonEqualTo(Object value) { + addCriterion("json =", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotEqualTo(Object value) { + addCriterion("json <>", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThan(Object value) { + addCriterion("json >", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThanOrEqualTo(Object value) { + addCriterion("json >=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThan(Object value) { + addCriterion("json <", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThanOrEqualTo(Object value) { + addCriterion("json <=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonIn(List values) { + addCriterion("json in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotIn(List values) { + addCriterion("json not in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonBetween(Object value1, Object value2) { + addCriterion("json between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotBetween(Object value1, Object value2) { + addCriterion("json not between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNull() { + addCriterion("date_deleted is null"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNotNull() { + addCriterion("date_deleted is not null"); + return (Criteria) this; + } + + public Criteria andDateDeletedEqualTo(Date value) { + addCriterion("date_deleted =", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotEqualTo(Date value) { + addCriterion("date_deleted <>", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThan(Date value) { + addCriterion("date_deleted >", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { + addCriterion("date_deleted >=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThan(Date value) { + addCriterion("date_deleted <", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThanOrEqualTo(Date value) { + addCriterion("date_deleted <=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedIn(List values) { + addCriterion("date_deleted in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotIn(List values) { + addCriterion("date_deleted not in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedBetween(Date value1, Date value2) { + addCriterion("date_deleted between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotBetween(Date value1, Date value2) { + addCriterion("date_deleted not between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andExperimentalIsNull() { + addCriterion("experimental is null"); + return (Criteria) this; + } + + public Criteria andExperimentalIsNotNull() { + addCriterion("experimental is not null"); + return (Criteria) this; + } + + public Criteria andExperimentalEqualTo(Boolean value) { + addCriterion("experimental =", value, "experimental"); + return (Criteria) this; + } + + public Criteria andExperimentalNotEqualTo(Boolean value) { + addCriterion("experimental <>", value, "experimental"); + return (Criteria) this; + } + + public Criteria andExperimentalGreaterThan(Boolean value) { + addCriterion("experimental >", value, "experimental"); + return (Criteria) this; + } + + public Criteria andExperimentalGreaterThanOrEqualTo(Boolean value) { + addCriterion("experimental >=", value, "experimental"); + return (Criteria) this; + } + + public Criteria andExperimentalLessThan(Boolean value) { + addCriterion("experimental <", value, "experimental"); + return (Criteria) this; + } + + public Criteria andExperimentalLessThanOrEqualTo(Boolean value) { + addCriterion("experimental <=", value, "experimental"); + return (Criteria) this; + } + + public Criteria andExperimentalIn(List values) { + addCriterion("experimental in", values, "experimental"); + return (Criteria) this; + } + + public Criteria andExperimentalNotIn(List values) { + addCriterion("experimental not in", values, "experimental"); + return (Criteria) this; + } + + public Criteria andExperimentalBetween(Boolean value1, Boolean value2) { + addCriterion("experimental between", value1, value2, "experimental"); + return (Criteria) this; + } + + public Criteria andExperimentalNotBetween(Boolean value1, Boolean value2) { + addCriterion("experimental not between", value1, value2, "experimental"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNull() { + addCriterion("date_created is null"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNotNull() { + addCriterion("date_created is not null"); + return (Criteria) this; + } + + public Criteria andDateCreatedEqualTo(Date value) { + addCriterion("date_created =", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotEqualTo(Date value) { + addCriterion("date_created <>", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThan(Date value) { + addCriterion("date_created >", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { + addCriterion("date_created >=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThan(Date value) { + addCriterion("date_created <", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThanOrEqualTo(Date value) { + addCriterion("date_created <=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedIn(List values) { + addCriterion("date_created in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotIn(List values) { + addCriterion("date_created not in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedBetween(Date value1, Date value2) { + addCriterion("date_created between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotBetween(Date value1, Date value2) { + addCriterion("date_created not between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNull() { + addCriterion("date_edited is null"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNotNull() { + addCriterion("date_edited is not null"); + return (Criteria) this; + } + + public Criteria andDateEditedEqualTo(Date value) { + addCriterion("date_edited =", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotEqualTo(Date value) { + addCriterion("date_edited <>", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThan(Date value) { + addCriterion("date_edited >", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { + addCriterion("date_edited >=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThan(Date value) { + addCriterion("date_edited <", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThanOrEqualTo(Date value) { + addCriterion("date_edited <=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedIn(List values) { + addCriterion("date_edited in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotIn(List values) { + addCriterion("date_edited not in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedBetween(Date value1, Date value2) { + addCriterion("date_edited between", value1, value2, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotBetween(Date value1, Date value2) { + addCriterion("date_edited not between", value1, value2, "dateEdited"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.plan + * + * @mbg.generated do_not_delete_during_merge Wed Sep 30 15:22:34 EAT 2020 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/PlanMetadata.java b/src/main/java/org/opensrp/domain/postgres/PlanMetadata.java index 70999aa60..1750d0b82 100644 --- a/src/main/java/org/opensrp/domain/postgres/PlanMetadata.java +++ b/src/main/java/org/opensrp/domain/postgres/PlanMetadata.java @@ -1,95 +1,95 @@ package org.opensrp.domain.postgres; public class PlanMetadata { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.plan_metadata.operational_area_id - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - private String operationalAreaId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.plan_metadata.identifier - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - private String identifier; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.plan_metadata.plan_id - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - private Long planId; - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.plan_metadata.operational_area_id - * - * @return the value of core.plan_metadata.operational_area_id - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public String getOperationalAreaId() { - return operationalAreaId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.plan_metadata.operational_area_id - * - * @param operationalAreaId the value for core.plan_metadata.operational_area_id - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public void setOperationalAreaId(String operationalAreaId) { - this.operationalAreaId = operationalAreaId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.plan_metadata.identifier - * - * @return the value of core.plan_metadata.identifier - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public String getIdentifier() { - return identifier; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.plan_metadata.identifier - * - * @param identifier the value for core.plan_metadata.identifier - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.plan_metadata.plan_id - * - * @return the value of core.plan_metadata.plan_id - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public Long getPlanId() { - return planId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.plan_metadata.plan_id - * - * @param planId the value for core.plan_metadata.plan_id - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public void setPlanId(Long planId) { - this.planId = planId; - } - + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.plan_metadata.operational_area_id + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + private String operationalAreaId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.plan_metadata.identifier + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + private String identifier; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.plan_metadata.plan_id + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + private Long planId; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.plan_metadata.operational_area_id + * + * @return the value of core.plan_metadata.operational_area_id + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public String getOperationalAreaId() { + return operationalAreaId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.plan_metadata.operational_area_id + * + * @param operationalAreaId the value for core.plan_metadata.operational_area_id + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public void setOperationalAreaId(String operationalAreaId) { + this.operationalAreaId = operationalAreaId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.plan_metadata.identifier + * + * @return the value of core.plan_metadata.identifier + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public String getIdentifier() { + return identifier; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.plan_metadata.identifier + * + * @param identifier the value for core.plan_metadata.identifier + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.plan_metadata.plan_id + * + * @return the value of core.plan_metadata.plan_id + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public Long getPlanId() { + return planId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.plan_metadata.plan_id + * + * @param planId the value for core.plan_metadata.plan_id + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public void setPlanId(Long planId) { + this.planId = planId; + } + } diff --git a/src/main/java/org/opensrp/domain/postgres/PlanMetadataExample.java b/src/main/java/org/opensrp/domain/postgres/PlanMetadataExample.java index b086912ef..701624981 100644 --- a/src/main/java/org/opensrp/domain/postgres/PlanMetadataExample.java +++ b/src/main/java/org/opensrp/domain/postgres/PlanMetadataExample.java @@ -4,502 +4,502 @@ import java.util.List; public class PlanMetadataExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public PlanMetadataExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andOperationalAreaIdIsNull() { - addCriterion("operational_area_id is null"); - return (Criteria) this; - } - - public Criteria andOperationalAreaIdIsNotNull() { - addCriterion("operational_area_id is not null"); - return (Criteria) this; - } - - public Criteria andOperationalAreaIdEqualTo(String value) { - addCriterion("operational_area_id =", value, "operationalAreaId"); - return (Criteria) this; - } - - public Criteria andOperationalAreaIdNotEqualTo(String value) { - addCriterion("operational_area_id <>", value, "operationalAreaId"); - return (Criteria) this; - } - - public Criteria andOperationalAreaIdGreaterThan(String value) { - addCriterion("operational_area_id >", value, "operationalAreaId"); - return (Criteria) this; - } - - public Criteria andOperationalAreaIdGreaterThanOrEqualTo(String value) { - addCriterion("operational_area_id >=", value, "operationalAreaId"); - return (Criteria) this; - } - - public Criteria andOperationalAreaIdLessThan(String value) { - addCriterion("operational_area_id <", value, "operationalAreaId"); - return (Criteria) this; - } - - public Criteria andOperationalAreaIdLessThanOrEqualTo(String value) { - addCriterion("operational_area_id <=", value, "operationalAreaId"); - return (Criteria) this; - } - - public Criteria andOperationalAreaIdLike(String value) { - addCriterion("operational_area_id like", value, "operationalAreaId"); - return (Criteria) this; - } - - public Criteria andOperationalAreaIdNotLike(String value) { - addCriterion("operational_area_id not like", value, "operationalAreaId"); - return (Criteria) this; - } - - public Criteria andOperationalAreaIdIn(List values) { - addCriterion("operational_area_id in", values, "operationalAreaId"); - return (Criteria) this; - } - - public Criteria andOperationalAreaIdNotIn(List values) { - addCriterion("operational_area_id not in", values, "operationalAreaId"); - return (Criteria) this; - } - - public Criteria andOperationalAreaIdBetween(String value1, String value2) { - addCriterion("operational_area_id between", value1, value2, "operationalAreaId"); - return (Criteria) this; - } - - public Criteria andOperationalAreaIdNotBetween(String value1, String value2) { - addCriterion("operational_area_id not between", value1, value2, "operationalAreaId"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNull() { - addCriterion("identifier is null"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNotNull() { - addCriterion("identifier is not null"); - return (Criteria) this; - } - - public Criteria andIdentifierEqualTo(String value) { - addCriterion("identifier =", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotEqualTo(String value) { - addCriterion("identifier <>", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThan(String value) { - addCriterion("identifier >", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThanOrEqualTo(String value) { - addCriterion("identifier >=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThan(String value) { - addCriterion("identifier <", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThanOrEqualTo(String value) { - addCriterion("identifier <=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLike(String value) { - addCriterion("identifier like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotLike(String value) { - addCriterion("identifier not like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierIn(List values) { - addCriterion("identifier in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotIn(List values) { - addCriterion("identifier not in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierBetween(String value1, String value2) { - addCriterion("identifier between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotBetween(String value1, String value2) { - addCriterion("identifier not between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andPlanIdIsNull() { - addCriterion("plan_id is null"); - return (Criteria) this; - } - - public Criteria andPlanIdIsNotNull() { - addCriterion("plan_id is not null"); - return (Criteria) this; - } - - public Criteria andPlanIdEqualTo(Long value) { - addCriterion("plan_id =", value, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdNotEqualTo(Long value) { - addCriterion("plan_id <>", value, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdGreaterThan(Long value) { - addCriterion("plan_id >", value, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdGreaterThanOrEqualTo(Long value) { - addCriterion("plan_id >=", value, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdLessThan(Long value) { - addCriterion("plan_id <", value, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdLessThanOrEqualTo(Long value) { - addCriterion("plan_id <=", value, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdIn(List values) { - addCriterion("plan_id in", values, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdNotIn(List values) { - addCriterion("plan_id not in", values, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdBetween(Long value1, Long value2) { - addCriterion("plan_id between", value1, value2, "planId"); - return (Criteria) this; - } - - public Criteria andPlanIdNotBetween(Long value1, Long value2) { - addCriterion("plan_id not between", value1, value2, "planId"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.plan_metadata - * - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.plan_metadata - * - * @mbg.generated do_not_delete_during_merge Fri May 10 11:11:46 EAT 2019 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public PlanMetadataExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andOperationalAreaIdIsNull() { + addCriterion("operational_area_id is null"); + return (Criteria) this; + } + + public Criteria andOperationalAreaIdIsNotNull() { + addCriterion("operational_area_id is not null"); + return (Criteria) this; + } + + public Criteria andOperationalAreaIdEqualTo(String value) { + addCriterion("operational_area_id =", value, "operationalAreaId"); + return (Criteria) this; + } + + public Criteria andOperationalAreaIdNotEqualTo(String value) { + addCriterion("operational_area_id <>", value, "operationalAreaId"); + return (Criteria) this; + } + + public Criteria andOperationalAreaIdGreaterThan(String value) { + addCriterion("operational_area_id >", value, "operationalAreaId"); + return (Criteria) this; + } + + public Criteria andOperationalAreaIdGreaterThanOrEqualTo(String value) { + addCriterion("operational_area_id >=", value, "operationalAreaId"); + return (Criteria) this; + } + + public Criteria andOperationalAreaIdLessThan(String value) { + addCriterion("operational_area_id <", value, "operationalAreaId"); + return (Criteria) this; + } + + public Criteria andOperationalAreaIdLessThanOrEqualTo(String value) { + addCriterion("operational_area_id <=", value, "operationalAreaId"); + return (Criteria) this; + } + + public Criteria andOperationalAreaIdLike(String value) { + addCriterion("operational_area_id like", value, "operationalAreaId"); + return (Criteria) this; + } + + public Criteria andOperationalAreaIdNotLike(String value) { + addCriterion("operational_area_id not like", value, "operationalAreaId"); + return (Criteria) this; + } + + public Criteria andOperationalAreaIdIn(List values) { + addCriterion("operational_area_id in", values, "operationalAreaId"); + return (Criteria) this; + } + + public Criteria andOperationalAreaIdNotIn(List values) { + addCriterion("operational_area_id not in", values, "operationalAreaId"); + return (Criteria) this; + } + + public Criteria andOperationalAreaIdBetween(String value1, String value2) { + addCriterion("operational_area_id between", value1, value2, "operationalAreaId"); + return (Criteria) this; + } + + public Criteria andOperationalAreaIdNotBetween(String value1, String value2) { + addCriterion("operational_area_id not between", value1, value2, "operationalAreaId"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNull() { + addCriterion("identifier is null"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNotNull() { + addCriterion("identifier is not null"); + return (Criteria) this; + } + + public Criteria andIdentifierEqualTo(String value) { + addCriterion("identifier =", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotEqualTo(String value) { + addCriterion("identifier <>", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThan(String value) { + addCriterion("identifier >", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThanOrEqualTo(String value) { + addCriterion("identifier >=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThan(String value) { + addCriterion("identifier <", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThanOrEqualTo(String value) { + addCriterion("identifier <=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLike(String value) { + addCriterion("identifier like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotLike(String value) { + addCriterion("identifier not like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierIn(List values) { + addCriterion("identifier in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotIn(List values) { + addCriterion("identifier not in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierBetween(String value1, String value2) { + addCriterion("identifier between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotBetween(String value1, String value2) { + addCriterion("identifier not between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andPlanIdIsNull() { + addCriterion("plan_id is null"); + return (Criteria) this; + } + + public Criteria andPlanIdIsNotNull() { + addCriterion("plan_id is not null"); + return (Criteria) this; + } + + public Criteria andPlanIdEqualTo(Long value) { + addCriterion("plan_id =", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdNotEqualTo(Long value) { + addCriterion("plan_id <>", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdGreaterThan(Long value) { + addCriterion("plan_id >", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdGreaterThanOrEqualTo(Long value) { + addCriterion("plan_id >=", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdLessThan(Long value) { + addCriterion("plan_id <", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdLessThanOrEqualTo(Long value) { + addCriterion("plan_id <=", value, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdIn(List values) { + addCriterion("plan_id in", values, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdNotIn(List values) { + addCriterion("plan_id not in", values, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdBetween(Long value1, Long value2) { + addCriterion("plan_id between", value1, value2, "planId"); + return (Criteria) this; + } + + public Criteria andPlanIdNotBetween(Long value1, Long value2) { + addCriterion("plan_id not between", value1, value2, "planId"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.plan_metadata + * + * @mbg.generated do_not_delete_during_merge Fri May 10 11:11:46 EAT 2019 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/Practitioner.java b/src/main/java/org/opensrp/domain/postgres/Practitioner.java index b6bd130f9..b1788738b 100644 --- a/src/main/java/org/opensrp/domain/postgres/Practitioner.java +++ b/src/main/java/org/opensrp/domain/postgres/Practitioner.java @@ -4,303 +4,303 @@ public class Practitioner { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.practitioner.id - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.practitioner.identifier - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private String identifier; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.practitioner.active - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private Boolean active; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.practitioner.name - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private String name; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.practitioner.user_id - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private String userId; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.practitioner.username - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private String username; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.practitioner.date_deleted - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private Date dateDeleted; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.practitioner.date_created - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private Date dateCreated; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.practitioner.date_edited - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private Date dateEdited; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column team.practitioner.server_version - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - private Long serverVersion; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.practitioner.id - * - * @return the value of team.practitioner.id - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.practitioner.id - * - * @param id the value for team.practitioner.id - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.practitioner.identifier - * - * @return the value of team.practitioner.identifier - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public String getIdentifier() { - return identifier; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.practitioner.identifier - * - * @param identifier the value for team.practitioner.identifier - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.practitioner.active - * - * @return the value of team.practitioner.active - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Boolean getActive() { - return active; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.practitioner.active - * - * @param active the value for team.practitioner.active - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setActive(Boolean active) { - this.active = active; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.practitioner.name - * - * @return the value of team.practitioner.name - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public String getName() { - return name; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.practitioner.name - * - * @param name the value for team.practitioner.name - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setName(String name) { - this.name = name; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.practitioner.user_id - * - * @return the value of team.practitioner.user_id - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public String getUserId() { - return userId; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.practitioner.user_id - * - * @param userId the value for team.practitioner.user_id - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setUserId(String userId) { - this.userId = userId; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.practitioner.username - * - * @return the value of team.practitioner.username - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public String getUsername() { - return username; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.practitioner.username - * - * @param username the value for team.practitioner.username - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.practitioner.date_deleted - * - * @return the value of team.practitioner.date_deleted - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Date getDateDeleted() { - return dateDeleted; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.practitioner.date_deleted - * - * @param dateDeleted the value for team.practitioner.date_deleted - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setDateDeleted(Date dateDeleted) { - this.dateDeleted = dateDeleted; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.practitioner.date_created - * - * @return the value of team.practitioner.date_created - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Date getDateCreated() { - return dateCreated; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.practitioner.date_created - * - * @param dateCreated the value for team.practitioner.date_created - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setDateCreated(Date dateCreated) { - this.dateCreated = dateCreated; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.practitioner.date_edited - * - * @return the value of team.practitioner.date_edited - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Date getDateEdited() { - return dateEdited; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.practitioner.date_edited - * - * @param dateEdited the value for team.practitioner.date_edited - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setDateEdited(Date dateEdited) { - this.dateEdited = dateEdited; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column team.practitioner.server_version - * - * @return the value of team.practitioner.server_version - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Long getServerVersion() { - return serverVersion; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column team.practitioner.server_version - * - * @param serverVersion the value for team.practitioner.server_version - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.practitioner.id + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.practitioner.identifier + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private String identifier; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.practitioner.active + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private Boolean active; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.practitioner.name + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private String name; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.practitioner.user_id + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private String userId; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.practitioner.username + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private String username; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.practitioner.date_deleted + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private Date dateDeleted; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.practitioner.date_created + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private Date dateCreated; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.practitioner.date_edited + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private Date dateEdited; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column team.practitioner.server_version + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + private Long serverVersion; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.practitioner.id + * + * @return the value of team.practitioner.id + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.practitioner.id + * + * @param id the value for team.practitioner.id + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.practitioner.identifier + * + * @return the value of team.practitioner.identifier + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public String getIdentifier() { + return identifier; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.practitioner.identifier + * + * @param identifier the value for team.practitioner.identifier + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.practitioner.active + * + * @return the value of team.practitioner.active + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Boolean getActive() { + return active; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.practitioner.active + * + * @param active the value for team.practitioner.active + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setActive(Boolean active) { + this.active = active; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.practitioner.name + * + * @return the value of team.practitioner.name + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public String getName() { + return name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.practitioner.name + * + * @param name the value for team.practitioner.name + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setName(String name) { + this.name = name; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.practitioner.user_id + * + * @return the value of team.practitioner.user_id + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public String getUserId() { + return userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.practitioner.user_id + * + * @param userId the value for team.practitioner.user_id + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setUserId(String userId) { + this.userId = userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.practitioner.username + * + * @return the value of team.practitioner.username + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public String getUsername() { + return username; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.practitioner.username + * + * @param username the value for team.practitioner.username + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setUsername(String username) { + this.username = username; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.practitioner.date_deleted + * + * @return the value of team.practitioner.date_deleted + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Date getDateDeleted() { + return dateDeleted; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.practitioner.date_deleted + * + * @param dateDeleted the value for team.practitioner.date_deleted + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setDateDeleted(Date dateDeleted) { + this.dateDeleted = dateDeleted; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.practitioner.date_created + * + * @return the value of team.practitioner.date_created + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Date getDateCreated() { + return dateCreated; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.practitioner.date_created + * + * @param dateCreated the value for team.practitioner.date_created + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setDateCreated(Date dateCreated) { + this.dateCreated = dateCreated; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.practitioner.date_edited + * + * @return the value of team.practitioner.date_edited + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Date getDateEdited() { + return dateEdited; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.practitioner.date_edited + * + * @param dateEdited the value for team.practitioner.date_edited + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setDateEdited(Date dateEdited) { + this.dateEdited = dateEdited; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column team.practitioner.server_version + * + * @return the value of team.practitioner.server_version + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Long getServerVersion() { + return serverVersion; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column team.practitioner.server_version + * + * @param serverVersion the value for team.practitioner.server_version + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/PractitionerExample.java b/src/main/java/org/opensrp/domain/postgres/PractitionerExample.java index 8144e9163..e860099f5 100644 --- a/src/main/java/org/opensrp/domain/postgres/PractitionerExample.java +++ b/src/main/java/org/opensrp/domain/postgres/PractitionerExample.java @@ -6,941 +6,941 @@ public class PractitionerExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public PractitionerExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNull() { - addCriterion("identifier is null"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNotNull() { - addCriterion("identifier is not null"); - return (Criteria) this; - } - - public Criteria andIdentifierEqualTo(String value) { - addCriterion("identifier =", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotEqualTo(String value) { - addCriterion("identifier <>", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThan(String value) { - addCriterion("identifier >", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThanOrEqualTo(String value) { - addCriterion("identifier >=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThan(String value) { - addCriterion("identifier <", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThanOrEqualTo(String value) { - addCriterion("identifier <=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLike(String value) { - addCriterion("identifier like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotLike(String value) { - addCriterion("identifier not like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierIn(List values) { - addCriterion("identifier in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotIn(List values) { - addCriterion("identifier not in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierBetween(String value1, String value2) { - addCriterion("identifier between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotBetween(String value1, String value2) { - addCriterion("identifier not between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andActiveIsNull() { - addCriterion("active is null"); - return (Criteria) this; - } - - public Criteria andActiveIsNotNull() { - addCriterion("active is not null"); - return (Criteria) this; - } - - public Criteria andActiveEqualTo(Boolean value) { - addCriterion("active =", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveNotEqualTo(Boolean value) { - addCriterion("active <>", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveGreaterThan(Boolean value) { - addCriterion("active >", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveGreaterThanOrEqualTo(Boolean value) { - addCriterion("active >=", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveLessThan(Boolean value) { - addCriterion("active <", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveLessThanOrEqualTo(Boolean value) { - addCriterion("active <=", value, "active"); - return (Criteria) this; - } - - public Criteria andActiveIn(List values) { - addCriterion("active in", values, "active"); - return (Criteria) this; - } - - public Criteria andActiveNotIn(List values) { - addCriterion("active not in", values, "active"); - return (Criteria) this; - } - - public Criteria andActiveBetween(Boolean value1, Boolean value2) { - addCriterion("active between", value1, value2, "active"); - return (Criteria) this; - } - - public Criteria andActiveNotBetween(Boolean value1, Boolean value2) { - addCriterion("active not between", value1, value2, "active"); - return (Criteria) this; - } - - public Criteria andNameIsNull() { - addCriterion("name is null"); - return (Criteria) this; - } - - public Criteria andNameIsNotNull() { - addCriterion("name is not null"); - return (Criteria) this; - } - - public Criteria andNameEqualTo(String value) { - addCriterion("name =", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotEqualTo(String value) { - addCriterion("name <>", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThan(String value) { - addCriterion("name >", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("name >=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThan(String value) { - addCriterion("name <", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("name <=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLike(String value) { - addCriterion("name like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotLike(String value) { - addCriterion("name not like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameIn(List values) { - addCriterion("name in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameNotIn(List values) { - addCriterion("name not in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameBetween(String value1, String value2) { - addCriterion("name between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("name not between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andUserIdIsNull() { - addCriterion("user_id is null"); - return (Criteria) this; - } - - public Criteria andUserIdIsNotNull() { - addCriterion("user_id is not null"); - return (Criteria) this; - } - - public Criteria andUserIdEqualTo(String value) { - addCriterion("user_id =", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdNotEqualTo(String value) { - addCriterion("user_id <>", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdGreaterThan(String value) { - addCriterion("user_id >", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdGreaterThanOrEqualTo(String value) { - addCriterion("user_id >=", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdLessThan(String value) { - addCriterion("user_id <", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdLessThanOrEqualTo(String value) { - addCriterion("user_id <=", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdLike(String value) { - addCriterion("user_id like", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdNotLike(String value) { - addCriterion("user_id not like", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdIn(List values) { - addCriterion("user_id in", values, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdNotIn(List values) { - addCriterion("user_id not in", values, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdBetween(String value1, String value2) { - addCriterion("user_id between", value1, value2, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdNotBetween(String value1, String value2) { - addCriterion("user_id not between", value1, value2, "userId"); - return (Criteria) this; - } - - public Criteria andUsernameIsNull() { - addCriterion("username is null"); - return (Criteria) this; - } - - public Criteria andUsernameIsNotNull() { - addCriterion("username is not null"); - return (Criteria) this; - } - - public Criteria andUsernameEqualTo(String value) { - addCriterion("username =", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotEqualTo(String value) { - addCriterion("username <>", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameGreaterThan(String value) { - addCriterion("username >", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameGreaterThanOrEqualTo(String value) { - addCriterion("username >=", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameLessThan(String value) { - addCriterion("username <", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameLessThanOrEqualTo(String value) { - addCriterion("username <=", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameLike(String value) { - addCriterion("username like", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotLike(String value) { - addCriterion("username not like", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameIn(List values) { - addCriterion("username in", values, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotIn(List values) { - addCriterion("username not in", values, "username"); - return (Criteria) this; - } - - public Criteria andUsernameBetween(String value1, String value2) { - addCriterion("username between", value1, value2, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotBetween(String value1, String value2) { - addCriterion("username not between", value1, value2, "username"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNull() { - addCriterion("date_deleted is null"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNotNull() { - addCriterion("date_deleted is not null"); - return (Criteria) this; - } - - public Criteria andDateDeletedEqualTo(Date value) { - addCriterion("date_deleted =", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotEqualTo(Date value) { - addCriterion("date_deleted <>", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThan(Date value) { - addCriterion("date_deleted >", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { - addCriterion("date_deleted >=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThan(Date value) { - addCriterion("date_deleted <", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThanOrEqualTo(Date value) { - addCriterion("date_deleted <=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedIn(List values) { - addCriterion("date_deleted in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotIn(List values) { - addCriterion("date_deleted not in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedBetween(Date value1, Date value2) { - addCriterion("date_deleted between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotBetween(Date value1, Date value2) { - addCriterion("date_deleted not between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateCreatedIsNull() { - addCriterion("date_created is null"); - return (Criteria) this; - } - - public Criteria andDateCreatedIsNotNull() { - addCriterion("date_created is not null"); - return (Criteria) this; - } - - public Criteria andDateCreatedEqualTo(Date value) { - addCriterion("date_created =", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotEqualTo(Date value) { - addCriterion("date_created <>", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedGreaterThan(Date value) { - addCriterion("date_created >", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { - addCriterion("date_created >=", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedLessThan(Date value) { - addCriterion("date_created <", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedLessThanOrEqualTo(Date value) { - addCriterion("date_created <=", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedIn(List values) { - addCriterion("date_created in", values, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotIn(List values) { - addCriterion("date_created not in", values, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedBetween(Date value1, Date value2) { - addCriterion("date_created between", value1, value2, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotBetween(Date value1, Date value2) { - addCriterion("date_created not between", value1, value2, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNull() { - addCriterion("date_edited is null"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNotNull() { - addCriterion("date_edited is not null"); - return (Criteria) this; - } - - public Criteria andDateEditedEqualTo(Date value) { - addCriterion("date_edited =", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotEqualTo(Date value) { - addCriterion("date_edited <>", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThan(Date value) { - addCriterion("date_edited >", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { - addCriterion("date_edited >=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThan(Date value) { - addCriterion("date_edited <", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThanOrEqualTo(Date value) { - addCriterion("date_edited <=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedIn(List values) { - addCriterion("date_edited in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotIn(List values) { - addCriterion("date_edited not in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedBetween(Date value1, Date value2) { - addCriterion("date_edited between", value1, value2, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotBetween(Date value1, Date value2) { - addCriterion("date_edited not between", value1, value2, "dateEdited"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table team.practitioner - * - * @mbg.generated do_not_delete_during_merge Mon Dec 06 14:53:20 EAT 2021 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table team.practitioner - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public PractitionerExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNull() { + addCriterion("identifier is null"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNotNull() { + addCriterion("identifier is not null"); + return (Criteria) this; + } + + public Criteria andIdentifierEqualTo(String value) { + addCriterion("identifier =", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotEqualTo(String value) { + addCriterion("identifier <>", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThan(String value) { + addCriterion("identifier >", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThanOrEqualTo(String value) { + addCriterion("identifier >=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThan(String value) { + addCriterion("identifier <", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThanOrEqualTo(String value) { + addCriterion("identifier <=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLike(String value) { + addCriterion("identifier like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotLike(String value) { + addCriterion("identifier not like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierIn(List values) { + addCriterion("identifier in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotIn(List values) { + addCriterion("identifier not in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierBetween(String value1, String value2) { + addCriterion("identifier between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotBetween(String value1, String value2) { + addCriterion("identifier not between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andActiveIsNull() { + addCriterion("active is null"); + return (Criteria) this; + } + + public Criteria andActiveIsNotNull() { + addCriterion("active is not null"); + return (Criteria) this; + } + + public Criteria andActiveEqualTo(Boolean value) { + addCriterion("active =", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveNotEqualTo(Boolean value) { + addCriterion("active <>", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveGreaterThan(Boolean value) { + addCriterion("active >", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveGreaterThanOrEqualTo(Boolean value) { + addCriterion("active >=", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveLessThan(Boolean value) { + addCriterion("active <", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveLessThanOrEqualTo(Boolean value) { + addCriterion("active <=", value, "active"); + return (Criteria) this; + } + + public Criteria andActiveIn(List values) { + addCriterion("active in", values, "active"); + return (Criteria) this; + } + + public Criteria andActiveNotIn(List values) { + addCriterion("active not in", values, "active"); + return (Criteria) this; + } + + public Criteria andActiveBetween(Boolean value1, Boolean value2) { + addCriterion("active between", value1, value2, "active"); + return (Criteria) this; + } + + public Criteria andActiveNotBetween(Boolean value1, Boolean value2) { + addCriterion("active not between", value1, value2, "active"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(String value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(String value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(String value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(String value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(String value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(String value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLike(String value) { + addCriterion("user_id like", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotLike(String value) { + addCriterion("user_id not like", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(String value1, String value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(String value1, String value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUsernameIsNull() { + addCriterion("username is null"); + return (Criteria) this; + } + + public Criteria andUsernameIsNotNull() { + addCriterion("username is not null"); + return (Criteria) this; + } + + public Criteria andUsernameEqualTo(String value) { + addCriterion("username =", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotEqualTo(String value) { + addCriterion("username <>", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThan(String value) { + addCriterion("username >", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThanOrEqualTo(String value) { + addCriterion("username >=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThan(String value) { + addCriterion("username <", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThanOrEqualTo(String value) { + addCriterion("username <=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLike(String value) { + addCriterion("username like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotLike(String value) { + addCriterion("username not like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameIn(List values) { + addCriterion("username in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotIn(List values) { + addCriterion("username not in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameBetween(String value1, String value2) { + addCriterion("username between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotBetween(String value1, String value2) { + addCriterion("username not between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNull() { + addCriterion("date_deleted is null"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNotNull() { + addCriterion("date_deleted is not null"); + return (Criteria) this; + } + + public Criteria andDateDeletedEqualTo(Date value) { + addCriterion("date_deleted =", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotEqualTo(Date value) { + addCriterion("date_deleted <>", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThan(Date value) { + addCriterion("date_deleted >", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { + addCriterion("date_deleted >=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThan(Date value) { + addCriterion("date_deleted <", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThanOrEqualTo(Date value) { + addCriterion("date_deleted <=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedIn(List values) { + addCriterion("date_deleted in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotIn(List values) { + addCriterion("date_deleted not in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedBetween(Date value1, Date value2) { + addCriterion("date_deleted between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotBetween(Date value1, Date value2) { + addCriterion("date_deleted not between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNull() { + addCriterion("date_created is null"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNotNull() { + addCriterion("date_created is not null"); + return (Criteria) this; + } + + public Criteria andDateCreatedEqualTo(Date value) { + addCriterion("date_created =", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotEqualTo(Date value) { + addCriterion("date_created <>", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThan(Date value) { + addCriterion("date_created >", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { + addCriterion("date_created >=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThan(Date value) { + addCriterion("date_created <", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThanOrEqualTo(Date value) { + addCriterion("date_created <=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedIn(List values) { + addCriterion("date_created in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotIn(List values) { + addCriterion("date_created not in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedBetween(Date value1, Date value2) { + addCriterion("date_created between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotBetween(Date value1, Date value2) { + addCriterion("date_created not between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNull() { + addCriterion("date_edited is null"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNotNull() { + addCriterion("date_edited is not null"); + return (Criteria) this; + } + + public Criteria andDateEditedEqualTo(Date value) { + addCriterion("date_edited =", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotEqualTo(Date value) { + addCriterion("date_edited <>", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThan(Date value) { + addCriterion("date_edited >", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { + addCriterion("date_edited >=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThan(Date value) { + addCriterion("date_edited <", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThanOrEqualTo(Date value) { + addCriterion("date_edited <=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedIn(List values) { + addCriterion("date_edited in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotIn(List values) { + addCriterion("date_edited not in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedBetween(Date value1, Date value2) { + addCriterion("date_edited between", value1, value2, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotBetween(Date value1, Date value2) { + addCriterion("date_edited not between", value1, value2, "dateEdited"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table team.practitioner + * + * @mbg.generated do_not_delete_during_merge Mon Dec 06 14:53:20 EAT 2021 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table team.practitioner + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/PractitionerRole.java b/src/main/java/org/opensrp/domain/postgres/PractitionerRole.java index b77ff9b1e..0feb6ee14 100644 --- a/src/main/java/org/opensrp/domain/postgres/PractitionerRole.java +++ b/src/main/java/org/opensrp/domain/postgres/PractitionerRole.java @@ -2,7 +2,6 @@ public class PractitionerRole { /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column team.practitioner_role.id * @@ -11,7 +10,6 @@ public class PractitionerRole { private Long id; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column team.practitioner_role.identifier * @@ -20,7 +18,6 @@ public class PractitionerRole { private String identifier; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column team.practitioner_role.active * @@ -29,7 +26,6 @@ public class PractitionerRole { private Boolean active; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column team.practitioner_role.organization_id * @@ -38,7 +34,6 @@ public class PractitionerRole { private Long organizationId; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column team.practitioner_role.practitioner_id * @@ -47,7 +42,6 @@ public class PractitionerRole { private Long practitionerId; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column team.practitioner_role.code * @@ -60,7 +54,6 @@ public class PractitionerRole { * This method returns the value of the database column team.practitioner_role.id * * @return the value of team.practitioner_role.id - * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ public Long getId() { @@ -72,7 +65,6 @@ public Long getId() { * This method sets the value of the database column team.practitioner_role.id * * @param id the value for team.practitioner_role.id - * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ public void setId(Long id) { @@ -84,7 +76,6 @@ public void setId(Long id) { * This method returns the value of the database column team.practitioner_role.identifier * * @return the value of team.practitioner_role.identifier - * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ public String getIdentifier() { @@ -96,7 +87,6 @@ public String getIdentifier() { * This method sets the value of the database column team.practitioner_role.identifier * * @param identifier the value for team.practitioner_role.identifier - * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ public void setIdentifier(String identifier) { @@ -108,7 +98,6 @@ public void setIdentifier(String identifier) { * This method returns the value of the database column team.practitioner_role.active * * @return the value of team.practitioner_role.active - * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ public Boolean getActive() { @@ -120,7 +109,6 @@ public Boolean getActive() { * This method sets the value of the database column team.practitioner_role.active * * @param active the value for team.practitioner_role.active - * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ public void setActive(Boolean active) { @@ -132,7 +120,6 @@ public void setActive(Boolean active) { * This method returns the value of the database column team.practitioner_role.organization_id * * @return the value of team.practitioner_role.organization_id - * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ public Long getOrganizationId() { @@ -144,7 +131,6 @@ public Long getOrganizationId() { * This method sets the value of the database column team.practitioner_role.organization_id * * @param organizationId the value for team.practitioner_role.organization_id - * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ public void setOrganizationId(Long organizationId) { @@ -156,7 +142,6 @@ public void setOrganizationId(Long organizationId) { * This method returns the value of the database column team.practitioner_role.practitioner_id * * @return the value of team.practitioner_role.practitioner_id - * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ public Long getPractitionerId() { @@ -168,7 +153,6 @@ public Long getPractitionerId() { * This method sets the value of the database column team.practitioner_role.practitioner_id * * @param practitionerId the value for team.practitioner_role.practitioner_id - * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ public void setPractitionerId(Long practitionerId) { @@ -180,7 +164,6 @@ public void setPractitionerId(Long practitionerId) { * This method returns the value of the database column team.practitioner_role.code * * @return the value of team.practitioner_role.code - * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ public String getCode() { @@ -192,7 +175,6 @@ public String getCode() { * This method sets the value of the database column team.practitioner_role.code * * @param code the value for team.practitioner_role.code - * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ public void setCode(String code) { diff --git a/src/main/java/org/opensrp/domain/postgres/PractitionerRoleExample.java b/src/main/java/org/opensrp/domain/postgres/PractitionerRoleExample.java index 62c99a839..34be3cef7 100644 --- a/src/main/java/org/opensrp/domain/postgres/PractitionerRoleExample.java +++ b/src/main/java/org/opensrp/domain/postgres/PractitionerRoleExample.java @@ -44,8 +44,8 @@ public PractitionerRoleExample() { * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; + public String getOrderByClause() { + return orderByClause; } /** @@ -54,8 +54,8 @@ public void setOrderByClause(String orderByClause) { * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ - public String getOrderByClause() { - return orderByClause; + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; } /** @@ -64,8 +64,8 @@ public String getOrderByClause() { * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; + public boolean isDistinct() { + return distinct; } /** @@ -74,8 +74,8 @@ public void setDistinct(boolean distinct) { * * @mbg.generated Fri Aug 30 16:08:23 EAT 2019 */ - public boolean isDistinct() { - return distinct; + public void setDistinct(boolean distinct) { + this.distinct = distinct; } /** @@ -611,38 +611,6 @@ public static class Criterion { private String typeHandler; - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - protected Criterion(String condition) { super(); this.condition = condition; @@ -678,5 +646,37 @@ protected Criterion(String condition, Object value, Object secondValue, String t protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } } } \ No newline at end of file diff --git a/src/main/java/org/opensrp/domain/postgres/ProductCatalogue.java b/src/main/java/org/opensrp/domain/postgres/ProductCatalogue.java index 219b7f9ca..5d32403ba 100644 --- a/src/main/java/org/opensrp/domain/postgres/ProductCatalogue.java +++ b/src/main/java/org/opensrp/domain/postgres/ProductCatalogue.java @@ -2,96 +2,108 @@ public class ProductCatalogue { - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.product_catalogue.unique_id - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - private Long uniqueId; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.product_catalogue.product_name - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - private String productName; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.product_catalogue.json - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - private Object json; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.product_catalogue.server_version - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - private Long serverVersion; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.product_catalogue.unique_id + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + private Long uniqueId; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.product_catalogue.product_name + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + private String productName; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.product_catalogue.json + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + private Object json; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.product_catalogue.server_version + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + private Long serverVersion; - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.product_catalogue.unique_id - * @return the value of core.product_catalogue.unique_id - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public Long getUniqueId() { - return uniqueId; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.product_catalogue.unique_id + * + * @return the value of core.product_catalogue.unique_id + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public Long getUniqueId() { + return uniqueId; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.product_catalogue.unique_id - * @param uniqueId the value for core.product_catalogue.unique_id - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public void setUniqueId(Long uniqueId) { - this.uniqueId = uniqueId; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.product_catalogue.unique_id + * + * @param uniqueId the value for core.product_catalogue.unique_id + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public void setUniqueId(Long uniqueId) { + this.uniqueId = uniqueId; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.product_catalogue.product_name - * @return the value of core.product_catalogue.product_name - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public String getProductName() { - return productName; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.product_catalogue.product_name + * + * @return the value of core.product_catalogue.product_name + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public String getProductName() { + return productName; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.product_catalogue.product_name - * @param productName the value for core.product_catalogue.product_name - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public void setProductName(String productName) { - this.productName = productName; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.product_catalogue.product_name + * + * @param productName the value for core.product_catalogue.product_name + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public void setProductName(String productName) { + this.productName = productName; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.product_catalogue.json - * @return the value of core.product_catalogue.json - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public Object getJson() { - return json; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.product_catalogue.json + * + * @return the value of core.product_catalogue.json + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public Object getJson() { + return json; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.product_catalogue.json - * @param json the value for core.product_catalogue.json - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public void setJson(Object json) { - this.json = json; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.product_catalogue.json + * + * @param json the value for core.product_catalogue.json + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public void setJson(Object json) { + this.json = json; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.product_catalogue.server_version - * @return the value of core.product_catalogue.server_version - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public Long getServerVersion() { - return serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.product_catalogue.server_version + * + * @return the value of core.product_catalogue.server_version + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public Long getServerVersion() { + return serverVersion; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.product_catalogue.server_version - * @param serverVersion the value for core.product_catalogue.server_version - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.product_catalogue.server_version + * + * @param serverVersion the value for core.product_catalogue.server_version + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ProductCatalogueExample.java b/src/main/java/org/opensrp/domain/postgres/ProductCatalogueExample.java index 16a957671..e40e15da0 100644 --- a/src/main/java/org/opensrp/domain/postgres/ProductCatalogueExample.java +++ b/src/main/java/org/opensrp/domain/postgres/ProductCatalogueExample.java @@ -5,531 +5,547 @@ public class ProductCatalogueExample { /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - protected String orderByClause; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - protected boolean distinct; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public ProductCatalogueExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - protected abstract static class GeneratedCriteria { - protected List jsonCriteria; - protected List allCriteria; - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - jsonCriteria = new ArrayList<>(); - } - - public List getJsonCriteria() { - return jsonCriteria; - } - - protected void addJsonCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - jsonCriteria.add(new Criterion(condition, value, - "org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler")); - allCriteria = null; - } - - protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - jsonCriteria.add(new Criterion(condition, value1, value2, - "org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || jsonCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList<>(); - allCriteria.addAll(criteria); - allCriteria.addAll(jsonCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - allCriteria = null; - } - - public Criteria andUniqueIdIsNull() { - addCriterion("unique_id is null"); - return (Criteria) this; - } - - public Criteria andUniqueIdIsNotNull() { - addCriterion("unique_id is not null"); - return (Criteria) this; - } - - public Criteria andUniqueIdEqualTo(Long value) { - addCriterion("unique_id =", value, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdNotEqualTo(Long value) { - addCriterion("unique_id <>", value, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdGreaterThan(Long value) { - addCriterion("unique_id >", value, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdGreaterThanOrEqualTo(Long value) { - addCriterion("unique_id >=", value, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdLessThan(Long value) { - addCriterion("unique_id <", value, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdLessThanOrEqualTo(Long value) { - addCriterion("unique_id <=", value, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdIn(List values) { - addCriterion("unique_id in", values, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdNotIn(List values) { - addCriterion("unique_id not in", values, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdBetween(Long value1, Long value2) { - addCriterion("unique_id between", value1, value2, "uniqueId"); - return (Criteria) this; - } - - public Criteria andUniqueIdNotBetween(Long value1, Long value2) { - addCriterion("unique_id not between", value1, value2, "uniqueId"); - return (Criteria) this; - } - - public Criteria andProductNameIsNull() { - addCriterion("product_name is null"); - return (Criteria) this; - } - - public Criteria andProductNameIsNotNull() { - addCriterion("product_name is not null"); - return (Criteria) this; - } - - public Criteria andProductNameEqualTo(String value) { - addCriterion("product_name =", value, "productName"); - return (Criteria) this; - } - - public Criteria andProductNameNotEqualTo(String value) { - addCriterion("product_name <>", value, "productName"); - return (Criteria) this; - } - - public Criteria andProductNameGreaterThan(String value) { - addCriterion("product_name >", value, "productName"); - return (Criteria) this; - } - - public Criteria andProductNameGreaterThanOrEqualTo(String value) { - addCriterion("product_name >=", value, "productName"); - return (Criteria) this; - } - - public Criteria andProductNameLessThan(String value) { - addCriterion("product_name <", value, "productName"); - return (Criteria) this; - } - - public Criteria andProductNameLessThanOrEqualTo(String value) { - addCriterion("product_name <=", value, "productName"); - return (Criteria) this; - } - - public Criteria andProductNameLike(String value) { - addCriterion("product_name like", value, "productName"); - return (Criteria) this; - } - - public Criteria andProductNameNotLike(String value) { - addCriterion("product_name not like", value, "productName"); - return (Criteria) this; - } - - public Criteria andProductNameIn(List values) { - addCriterion("product_name in", values, "productName"); - return (Criteria) this; - } - - public Criteria andProductNameNotIn(List values) { - addCriterion("product_name not in", values, "productName"); - return (Criteria) this; - } - - public Criteria andProductNameBetween(String value1, String value2) { - addCriterion("product_name between", value1, value2, "productName"); - return (Criteria) this; - } - - public Criteria andProductNameNotBetween(String value1, String value2) { - addCriterion("product_name not between", value1, value2, "productName"); - return (Criteria) this; - } - - public Criteria andJsonIsNull() { - addCriterion("json is null"); - return (Criteria) this; - } - - public Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (Criteria) this; - } - - public Criteria andJsonEqualTo(Object value) { - addJsonCriterion("json =", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotEqualTo(Object value) { - addJsonCriterion("json <>", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThan(Object value) { - addJsonCriterion("json >", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThanOrEqualTo(Object value) { - addJsonCriterion("json >=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThan(Object value) { - addJsonCriterion("json <", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThanOrEqualTo(Object value) { - addJsonCriterion("json <=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonIn(List values) { - addJsonCriterion("json in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotIn(List values) { - addJsonCriterion("json not in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonBetween(Object value1, Object value2) { - addJsonCriterion("json between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotBetween(Object value1, Object value2) { - addJsonCriterion("json not between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - public static class Criterion { - private String condition; - private Object value; - private Object secondValue; - private boolean noValue; - private boolean singleValue; - private boolean betweenValue; - private boolean listValue; - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + protected String orderByClause; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + protected boolean distinct; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public ProductCatalogueExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + protected abstract static class GeneratedCriteria { + protected List jsonCriteria; + protected List allCriteria; + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + jsonCriteria = new ArrayList<>(); + } + + public List getJsonCriteria() { + return jsonCriteria; + } + + protected void addJsonCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + jsonCriteria.add(new Criterion(condition, value, + "org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler")); + allCriteria = null; + } + + protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + jsonCriteria.add(new Criterion(condition, value1, value2, + "org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || jsonCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList<>(); + allCriteria.addAll(criteria); + allCriteria.addAll(jsonCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + public Criteria andUniqueIdIsNull() { + addCriterion("unique_id is null"); + return (Criteria) this; + } + + public Criteria andUniqueIdIsNotNull() { + addCriterion("unique_id is not null"); + return (Criteria) this; + } + + public Criteria andUniqueIdEqualTo(Long value) { + addCriterion("unique_id =", value, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdNotEqualTo(Long value) { + addCriterion("unique_id <>", value, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdGreaterThan(Long value) { + addCriterion("unique_id >", value, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdGreaterThanOrEqualTo(Long value) { + addCriterion("unique_id >=", value, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdLessThan(Long value) { + addCriterion("unique_id <", value, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdLessThanOrEqualTo(Long value) { + addCriterion("unique_id <=", value, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdIn(List values) { + addCriterion("unique_id in", values, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdNotIn(List values) { + addCriterion("unique_id not in", values, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdBetween(Long value1, Long value2) { + addCriterion("unique_id between", value1, value2, "uniqueId"); + return (Criteria) this; + } + + public Criteria andUniqueIdNotBetween(Long value1, Long value2) { + addCriterion("unique_id not between", value1, value2, "uniqueId"); + return (Criteria) this; + } + + public Criteria andProductNameIsNull() { + addCriterion("product_name is null"); + return (Criteria) this; + } + + public Criteria andProductNameIsNotNull() { + addCriterion("product_name is not null"); + return (Criteria) this; + } + + public Criteria andProductNameEqualTo(String value) { + addCriterion("product_name =", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameNotEqualTo(String value) { + addCriterion("product_name <>", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameGreaterThan(String value) { + addCriterion("product_name >", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameGreaterThanOrEqualTo(String value) { + addCriterion("product_name >=", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameLessThan(String value) { + addCriterion("product_name <", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameLessThanOrEqualTo(String value) { + addCriterion("product_name <=", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameLike(String value) { + addCriterion("product_name like", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameNotLike(String value) { + addCriterion("product_name not like", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameIn(List values) { + addCriterion("product_name in", values, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameNotIn(List values) { + addCriterion("product_name not in", values, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameBetween(String value1, String value2) { + addCriterion("product_name between", value1, value2, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameNotBetween(String value1, String value2) { + addCriterion("product_name not between", value1, value2, "productName"); + return (Criteria) this; + } + + public Criteria andJsonIsNull() { + addCriterion("json is null"); + return (Criteria) this; + } + + public Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (Criteria) this; + } + + public Criteria andJsonEqualTo(Object value) { + addJsonCriterion("json =", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotEqualTo(Object value) { + addJsonCriterion("json <>", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThan(Object value) { + addJsonCriterion("json >", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThanOrEqualTo(Object value) { + addJsonCriterion("json >=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThan(Object value) { + addJsonCriterion("json <", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThanOrEqualTo(Object value) { + addJsonCriterion("json <=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonIn(List values) { + addJsonCriterion("json in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotIn(List values) { + addJsonCriterion("json not in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonBetween(Object value1, Object value2) { + addJsonCriterion("json between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotBetween(Object value1, Object value2) { + addJsonCriterion("json not between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + public static class Criterion { + private String condition; + private Object value; + private Object secondValue; + private boolean noValue; + private boolean singleValue; + private boolean betweenValue; + private boolean listValue; + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** * This class was generated by MyBatis Generator. * This class corresponds to the database table core.product_catalogue * diff --git a/src/main/java/org/opensrp/domain/postgres/Report.java b/src/main/java/org/opensrp/domain/postgres/Report.java index 9124d8de7..d9ff03245 100644 --- a/src/main/java/org/opensrp/domain/postgres/Report.java +++ b/src/main/java/org/opensrp/domain/postgres/Report.java @@ -2,73 +2,82 @@ public class Report { - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.report.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Long id; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.report.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Object json; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.report.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Long serverVersion; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.report.id + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Long id; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.report.json + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Object json; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.report.server_version + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Long serverVersion; - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.report.id - * @return the value of core.report.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Long getId() { - return id; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.report.id + * + * @return the value of core.report.id + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Long getId() { + return id; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.report.id - * @param id the value for core.report.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.report.id + * + * @param id the value for core.report.id + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setId(Long id) { + this.id = id; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.report.json - * @return the value of core.report.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Object getJson() { - return json; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.report.json + * + * @return the value of core.report.json + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Object getJson() { + return json; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.report.json - * @param json the value for core.report.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setJson(Object json) { - this.json = json; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.report.json + * + * @param json the value for core.report.json + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setJson(Object json) { + this.json = json; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.report.server_version - * @return the value of core.report.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Long getServerVersion() { - return serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.report.server_version + * + * @return the value of core.report.server_version + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Long getServerVersion() { + return serverVersion; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.report.server_version - * @param serverVersion the value for core.report.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.report.server_version + * + * @param serverVersion the value for core.report.server_version + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ReportExample.java b/src/main/java/org/opensrp/domain/postgres/ReportExample.java index caab538d3..688acaf66 100644 --- a/src/main/java/org/opensrp/domain/postgres/ReportExample.java +++ b/src/main/java/org/opensrp/domain/postgres/ReportExample.java @@ -4,482 +4,498 @@ import java.util.List; public class ReportExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected String orderByClause; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected boolean distinct; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public ReportExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List jsonCriteria; - - protected List allCriteria; - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - jsonCriteria = new ArrayList<>(); - } - - public List getJsonCriteria() { - return jsonCriteria; - } - - protected void addJsonCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.ReportTypeHandler")); - allCriteria = null; - } - - protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - jsonCriteria.add( - new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.ReportTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || jsonCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList<>(); - allCriteria.addAll(criteria); - allCriteria.addAll(jsonCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - allCriteria = null; - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andJsonIsNull() { - addCriterion("json is null"); - return (Criteria) this; - } - - public Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (Criteria) this; - } - - public Criteria andJsonEqualTo(Object value) { - addJsonCriterion("json =", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotEqualTo(Object value) { - addJsonCriterion("json <>", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThan(Object value) { - addJsonCriterion("json >", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThanOrEqualTo(Object value) { - addJsonCriterion("json >=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThan(Object value) { - addJsonCriterion("json <", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThanOrEqualTo(Object value) { - addJsonCriterion("json <=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonIn(List values) { - addJsonCriterion("json in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotIn(List values) { - addJsonCriterion("json not in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonBetween(Object value1, Object value2) { - addJsonCriterion("json between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotBetween(Object value1, Object value2) { - addJsonCriterion("json not between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.report - * - * @mbg.generated do_not_delete_during_merge Wed Mar 07 18:26:22 EAT 2018 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected String orderByClause; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected boolean distinct; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public ReportExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List jsonCriteria; + + protected List allCriteria; + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + jsonCriteria = new ArrayList<>(); + } + + public List getJsonCriteria() { + return jsonCriteria; + } + + protected void addJsonCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.ReportTypeHandler")); + allCriteria = null; + } + + protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + jsonCriteria.add( + new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.ReportTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || jsonCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList<>(); + allCriteria.addAll(criteria); + allCriteria.addAll(jsonCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andJsonIsNull() { + addCriterion("json is null"); + return (Criteria) this; + } + + public Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (Criteria) this; + } + + public Criteria andJsonEqualTo(Object value) { + addJsonCriterion("json =", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotEqualTo(Object value) { + addJsonCriterion("json <>", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThan(Object value) { + addJsonCriterion("json >", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThanOrEqualTo(Object value) { + addJsonCriterion("json >=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThan(Object value) { + addJsonCriterion("json <", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThanOrEqualTo(Object value) { + addJsonCriterion("json <=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonIn(List values) { + addJsonCriterion("json in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotIn(List values) { + addJsonCriterion("json not in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonBetween(Object value1, Object value2) { + addJsonCriterion("json between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotBetween(Object value1, Object value2) { + addJsonCriterion("json not between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.report + * + * @mbg.generated do_not_delete_during_merge Wed Mar 07 18:26:22 EAT 2018 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ReportMetadata.java b/src/main/java/org/opensrp/domain/postgres/ReportMetadata.java index 871fb8b67..0572309d1 100644 --- a/src/main/java/org/opensrp/domain/postgres/ReportMetadata.java +++ b/src/main/java/org/opensrp/domain/postgres/ReportMetadata.java @@ -3,394 +3,394 @@ import java.util.Date; public class ReportMetadata { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.report_metadata.id - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.report_metadata.report_id - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - private Long reportId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.report_metadata.document_id - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - private String documentId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.report_metadata.form_submission_id - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - private String formSubmissionId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.report_metadata.base_entity_id - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - private String baseEntityId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.report_metadata.server_version - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - private Long serverVersion; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.report_metadata.report_type - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - private String reportType; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.report_metadata.report_date - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - private Date reportDate; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.report_metadata.provider_id - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - private String providerId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.report_metadata.location_id - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - private String locationId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.report_metadata.team - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - private String team; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.report_metadata.team_id - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - private String teamId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.report_metadata.date_edited - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - private Date dateEdited; - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.report_metadata.id - * - * @return the value of core.report_metadata.id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.report_metadata.id - * - * @param id the value for core.report_metadata.id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.report_metadata.report_id - * - * @return the value of core.report_metadata.report_id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public Long getReportId() { - return reportId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.report_metadata.report_id - * - * @param reportId the value for core.report_metadata.report_id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void setReportId(Long reportId) { - this.reportId = reportId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.report_metadata.document_id - * - * @return the value of core.report_metadata.document_id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public String getDocumentId() { - return documentId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.report_metadata.document_id - * - * @param documentId the value for core.report_metadata.document_id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void setDocumentId(String documentId) { - this.documentId = documentId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.report_metadata.form_submission_id - * - * @return the value of core.report_metadata.form_submission_id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public String getFormSubmissionId() { - return formSubmissionId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.report_metadata.form_submission_id - * - * @param formSubmissionId the value for core.report_metadata.form_submission_id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void setFormSubmissionId(String formSubmissionId) { - this.formSubmissionId = formSubmissionId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.report_metadata.base_entity_id - * - * @return the value of core.report_metadata.base_entity_id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public String getBaseEntityId() { - return baseEntityId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.report_metadata.base_entity_id - * - * @param baseEntityId the value for core.report_metadata.base_entity_id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void setBaseEntityId(String baseEntityId) { - this.baseEntityId = baseEntityId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.report_metadata.server_version - * - * @return the value of core.report_metadata.server_version - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public Long getServerVersion() { - return serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.report_metadata.server_version - * - * @param serverVersion the value for core.report_metadata.server_version - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.report_metadata.report_type - * - * @return the value of core.report_metadata.report_type - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public String getReportType() { - return reportType; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.report_metadata.report_type - * - * @param reportType the value for core.report_metadata.report_type - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.report_metadata.report_date - * - * @return the value of core.report_metadata.report_date - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public Date getReportDate() { - return reportDate; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.report_metadata.report_date - * - * @param reportDate the value for core.report_metadata.report_date - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void setReportDate(Date reportDate) { - this.reportDate = reportDate; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.report_metadata.provider_id - * - * @return the value of core.report_metadata.provider_id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public String getProviderId() { - return providerId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.report_metadata.provider_id - * - * @param providerId the value for core.report_metadata.provider_id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.report_metadata.location_id - * - * @return the value of core.report_metadata.location_id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public String getLocationId() { - return locationId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.report_metadata.location_id - * - * @param locationId the value for core.report_metadata.location_id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void setLocationId(String locationId) { - this.locationId = locationId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.report_metadata.team - * - * @return the value of core.report_metadata.team - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public String getTeam() { - return team; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.report_metadata.team - * - * @param team the value for core.report_metadata.team - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void setTeam(String team) { - this.team = team; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.report_metadata.team_id - * - * @return the value of core.report_metadata.team_id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public String getTeamId() { - return teamId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.report_metadata.team_id - * - * @param teamId the value for core.report_metadata.team_id - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void setTeamId(String teamId) { - this.teamId = teamId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.report_metadata.date_edited - * - * @return the value of core.report_metadata.date_edited - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public Date getDateEdited() { - return dateEdited; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.report_metadata.date_edited - * - * @param dateEdited the value for core.report_metadata.date_edited - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void setDateEdited(Date dateEdited) { - this.dateEdited = dateEdited; - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.report_metadata.id + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.report_metadata.report_id + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + private Long reportId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.report_metadata.document_id + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + private String documentId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.report_metadata.form_submission_id + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + private String formSubmissionId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.report_metadata.base_entity_id + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + private String baseEntityId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.report_metadata.server_version + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + private Long serverVersion; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.report_metadata.report_type + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + private String reportType; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.report_metadata.report_date + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + private Date reportDate; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.report_metadata.provider_id + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + private String providerId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.report_metadata.location_id + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + private String locationId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.report_metadata.team + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + private String team; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.report_metadata.team_id + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + private String teamId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.report_metadata.date_edited + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + private Date dateEdited; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.report_metadata.id + * + * @return the value of core.report_metadata.id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.report_metadata.id + * + * @param id the value for core.report_metadata.id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.report_metadata.report_id + * + * @return the value of core.report_metadata.report_id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public Long getReportId() { + return reportId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.report_metadata.report_id + * + * @param reportId the value for core.report_metadata.report_id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.report_metadata.document_id + * + * @return the value of core.report_metadata.document_id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public String getDocumentId() { + return documentId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.report_metadata.document_id + * + * @param documentId the value for core.report_metadata.document_id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void setDocumentId(String documentId) { + this.documentId = documentId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.report_metadata.form_submission_id + * + * @return the value of core.report_metadata.form_submission_id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public String getFormSubmissionId() { + return formSubmissionId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.report_metadata.form_submission_id + * + * @param formSubmissionId the value for core.report_metadata.form_submission_id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void setFormSubmissionId(String formSubmissionId) { + this.formSubmissionId = formSubmissionId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.report_metadata.base_entity_id + * + * @return the value of core.report_metadata.base_entity_id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public String getBaseEntityId() { + return baseEntityId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.report_metadata.base_entity_id + * + * @param baseEntityId the value for core.report_metadata.base_entity_id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void setBaseEntityId(String baseEntityId) { + this.baseEntityId = baseEntityId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.report_metadata.server_version + * + * @return the value of core.report_metadata.server_version + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public Long getServerVersion() { + return serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.report_metadata.server_version + * + * @param serverVersion the value for core.report_metadata.server_version + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.report_metadata.report_type + * + * @return the value of core.report_metadata.report_type + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public String getReportType() { + return reportType; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.report_metadata.report_type + * + * @param reportType the value for core.report_metadata.report_type + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void setReportType(String reportType) { + this.reportType = reportType; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.report_metadata.report_date + * + * @return the value of core.report_metadata.report_date + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public Date getReportDate() { + return reportDate; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.report_metadata.report_date + * + * @param reportDate the value for core.report_metadata.report_date + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void setReportDate(Date reportDate) { + this.reportDate = reportDate; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.report_metadata.provider_id + * + * @return the value of core.report_metadata.provider_id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public String getProviderId() { + return providerId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.report_metadata.provider_id + * + * @param providerId the value for core.report_metadata.provider_id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.report_metadata.location_id + * + * @return the value of core.report_metadata.location_id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public String getLocationId() { + return locationId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.report_metadata.location_id + * + * @param locationId the value for core.report_metadata.location_id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void setLocationId(String locationId) { + this.locationId = locationId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.report_metadata.team + * + * @return the value of core.report_metadata.team + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public String getTeam() { + return team; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.report_metadata.team + * + * @param team the value for core.report_metadata.team + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void setTeam(String team) { + this.team = team; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.report_metadata.team_id + * + * @return the value of core.report_metadata.team_id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public String getTeamId() { + return teamId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.report_metadata.team_id + * + * @param teamId the value for core.report_metadata.team_id + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void setTeamId(String teamId) { + this.teamId = teamId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.report_metadata.date_edited + * + * @return the value of core.report_metadata.date_edited + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public Date getDateEdited() { + return dateEdited; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.report_metadata.date_edited + * + * @param dateEdited the value for core.report_metadata.date_edited + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void setDateEdited(Date dateEdited) { + this.dateEdited = dateEdited; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ReportMetadataExample.java b/src/main/java/org/opensrp/domain/postgres/ReportMetadataExample.java index eec06f296..999c29487 100644 --- a/src/main/java/org/opensrp/domain/postgres/ReportMetadataExample.java +++ b/src/main/java/org/opensrp/domain/postgres/ReportMetadataExample.java @@ -6,1188 +6,1188 @@ import java.util.List; public class ReportMetadataExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public ReportMetadataExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - protected void addCriterionForJDBCDate(String condition, Date value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - addCriterion(condition, new java.sql.Date(value.getTime()), property); - } - - protected void addCriterionForJDBCDate(String condition, List values, String property) { - if (values == null || values.size() == 0) { - throw new RuntimeException("Value list for " + property + " cannot be null or empty"); - } - List dateList = new ArrayList(); - Iterator iter = values.iterator(); - while (iter.hasNext()) { - dateList.add(new java.sql.Date(iter.next().getTime())); - } - addCriterion(condition, dateList, property); - } - - protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andReportIdIsNull() { - addCriterion("report_id is null"); - return (Criteria) this; - } - - public Criteria andReportIdIsNotNull() { - addCriterion("report_id is not null"); - return (Criteria) this; - } - - public Criteria andReportIdEqualTo(Long value) { - addCriterion("report_id =", value, "reportId"); - return (Criteria) this; - } - - public Criteria andReportIdNotEqualTo(Long value) { - addCriterion("report_id <>", value, "reportId"); - return (Criteria) this; - } - - public Criteria andReportIdGreaterThan(Long value) { - addCriterion("report_id >", value, "reportId"); - return (Criteria) this; - } - - public Criteria andReportIdGreaterThanOrEqualTo(Long value) { - addCriterion("report_id >=", value, "reportId"); - return (Criteria) this; - } - - public Criteria andReportIdLessThan(Long value) { - addCriterion("report_id <", value, "reportId"); - return (Criteria) this; - } - - public Criteria andReportIdLessThanOrEqualTo(Long value) { - addCriterion("report_id <=", value, "reportId"); - return (Criteria) this; - } - - public Criteria andReportIdIn(List values) { - addCriterion("report_id in", values, "reportId"); - return (Criteria) this; - } - - public Criteria andReportIdNotIn(List values) { - addCriterion("report_id not in", values, "reportId"); - return (Criteria) this; - } - - public Criteria andReportIdBetween(Long value1, Long value2) { - addCriterion("report_id between", value1, value2, "reportId"); - return (Criteria) this; - } - - public Criteria andReportIdNotBetween(Long value1, Long value2) { - addCriterion("report_id not between", value1, value2, "reportId"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNull() { - addCriterion("document_id is null"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNotNull() { - addCriterion("document_id is not null"); - return (Criteria) this; - } - - public Criteria andDocumentIdEqualTo(String value) { - addCriterion("document_id =", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotEqualTo(String value) { - addCriterion("document_id <>", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThan(String value) { - addCriterion("document_id >", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { - addCriterion("document_id >=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThan(String value) { - addCriterion("document_id <", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThanOrEqualTo(String value) { - addCriterion("document_id <=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLike(String value) { - addCriterion("document_id like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotLike(String value) { - addCriterion("document_id not like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdIn(List values) { - addCriterion("document_id in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotIn(List values) { - addCriterion("document_id not in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdBetween(String value1, String value2) { - addCriterion("document_id between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotBetween(String value1, String value2) { - addCriterion("document_id not between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdIsNull() { - addCriterion("form_submission_id is null"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdIsNotNull() { - addCriterion("form_submission_id is not null"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdEqualTo(String value) { - addCriterion("form_submission_id =", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdNotEqualTo(String value) { - addCriterion("form_submission_id <>", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdGreaterThan(String value) { - addCriterion("form_submission_id >", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdGreaterThanOrEqualTo(String value) { - addCriterion("form_submission_id >=", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdLessThan(String value) { - addCriterion("form_submission_id <", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdLessThanOrEqualTo(String value) { - addCriterion("form_submission_id <=", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdLike(String value) { - addCriterion("form_submission_id like", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdNotLike(String value) { - addCriterion("form_submission_id not like", value, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdIn(List values) { - addCriterion("form_submission_id in", values, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdNotIn(List values) { - addCriterion("form_submission_id not in", values, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdBetween(String value1, String value2) { - addCriterion("form_submission_id between", value1, value2, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andFormSubmissionIdNotBetween(String value1, String value2) { - addCriterion("form_submission_id not between", value1, value2, "formSubmissionId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdIsNull() { - addCriterion("base_entity_id is null"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdIsNotNull() { - addCriterion("base_entity_id is not null"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdEqualTo(String value) { - addCriterion("base_entity_id =", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotEqualTo(String value) { - addCriterion("base_entity_id <>", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdGreaterThan(String value) { - addCriterion("base_entity_id >", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdGreaterThanOrEqualTo(String value) { - addCriterion("base_entity_id >=", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdLessThan(String value) { - addCriterion("base_entity_id <", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdLessThanOrEqualTo(String value) { - addCriterion("base_entity_id <=", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdLike(String value) { - addCriterion("base_entity_id like", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotLike(String value) { - addCriterion("base_entity_id not like", value, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdIn(List values) { - addCriterion("base_entity_id in", values, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotIn(List values) { - addCriterion("base_entity_id not in", values, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdBetween(String value1, String value2) { - addCriterion("base_entity_id between", value1, value2, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andBaseEntityIdNotBetween(String value1, String value2) { - addCriterion("base_entity_id not between", value1, value2, "baseEntityId"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andReportTypeIsNull() { - addCriterion("report_type is null"); - return (Criteria) this; - } - - public Criteria andReportTypeIsNotNull() { - addCriterion("report_type is not null"); - return (Criteria) this; - } - - public Criteria andReportTypeEqualTo(String value) { - addCriterion("report_type =", value, "reportType"); - return (Criteria) this; - } - - public Criteria andReportTypeNotEqualTo(String value) { - addCriterion("report_type <>", value, "reportType"); - return (Criteria) this; - } - - public Criteria andReportTypeGreaterThan(String value) { - addCriterion("report_type >", value, "reportType"); - return (Criteria) this; - } - - public Criteria andReportTypeGreaterThanOrEqualTo(String value) { - addCriterion("report_type >=", value, "reportType"); - return (Criteria) this; - } - - public Criteria andReportTypeLessThan(String value) { - addCriterion("report_type <", value, "reportType"); - return (Criteria) this; - } - - public Criteria andReportTypeLessThanOrEqualTo(String value) { - addCriterion("report_type <=", value, "reportType"); - return (Criteria) this; - } - - public Criteria andReportTypeLike(String value) { - addCriterion("report_type like", value, "reportType"); - return (Criteria) this; - } - - public Criteria andReportTypeNotLike(String value) { - addCriterion("report_type not like", value, "reportType"); - return (Criteria) this; - } - - public Criteria andReportTypeIn(List values) { - addCriterion("report_type in", values, "reportType"); - return (Criteria) this; - } - - public Criteria andReportTypeNotIn(List values) { - addCriterion("report_type not in", values, "reportType"); - return (Criteria) this; - } - - public Criteria andReportTypeBetween(String value1, String value2) { - addCriterion("report_type between", value1, value2, "reportType"); - return (Criteria) this; - } - - public Criteria andReportTypeNotBetween(String value1, String value2) { - addCriterion("report_type not between", value1, value2, "reportType"); - return (Criteria) this; - } - - public Criteria andReportDateIsNull() { - addCriterion("report_date is null"); - return (Criteria) this; - } - - public Criteria andReportDateIsNotNull() { - addCriterion("report_date is not null"); - return (Criteria) this; - } - - public Criteria andReportDateEqualTo(Date value) { - addCriterionForJDBCDate("report_date =", value, "reportDate"); - return (Criteria) this; - } - - public Criteria andReportDateNotEqualTo(Date value) { - addCriterionForJDBCDate("report_date <>", value, "reportDate"); - return (Criteria) this; - } - - public Criteria andReportDateGreaterThan(Date value) { - addCriterionForJDBCDate("report_date >", value, "reportDate"); - return (Criteria) this; - } - - public Criteria andReportDateGreaterThanOrEqualTo(Date value) { - addCriterionForJDBCDate("report_date >=", value, "reportDate"); - return (Criteria) this; - } - - public Criteria andReportDateLessThan(Date value) { - addCriterionForJDBCDate("report_date <", value, "reportDate"); - return (Criteria) this; - } - - public Criteria andReportDateLessThanOrEqualTo(Date value) { - addCriterionForJDBCDate("report_date <=", value, "reportDate"); - return (Criteria) this; - } - - public Criteria andReportDateIn(List values) { - addCriterionForJDBCDate("report_date in", values, "reportDate"); - return (Criteria) this; - } - - public Criteria andReportDateNotIn(List values) { - addCriterionForJDBCDate("report_date not in", values, "reportDate"); - return (Criteria) this; - } - - public Criteria andReportDateBetween(Date value1, Date value2) { - addCriterionForJDBCDate("report_date between", value1, value2, "reportDate"); - return (Criteria) this; - } - - public Criteria andReportDateNotBetween(Date value1, Date value2) { - addCriterionForJDBCDate("report_date not between", value1, value2, "reportDate"); - return (Criteria) this; - } - - public Criteria andProviderIdIsNull() { - addCriterion("provider_id is null"); - return (Criteria) this; - } - - public Criteria andProviderIdIsNotNull() { - addCriterion("provider_id is not null"); - return (Criteria) this; - } - - public Criteria andProviderIdEqualTo(String value) { - addCriterion("provider_id =", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotEqualTo(String value) { - addCriterion("provider_id <>", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdGreaterThan(String value) { - addCriterion("provider_id >", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdGreaterThanOrEqualTo(String value) { - addCriterion("provider_id >=", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdLessThan(String value) { - addCriterion("provider_id <", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdLessThanOrEqualTo(String value) { - addCriterion("provider_id <=", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdLike(String value) { - addCriterion("provider_id like", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotLike(String value) { - addCriterion("provider_id not like", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdIn(List values) { - addCriterion("provider_id in", values, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotIn(List values) { - addCriterion("provider_id not in", values, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdBetween(String value1, String value2) { - addCriterion("provider_id between", value1, value2, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotBetween(String value1, String value2) { - addCriterion("provider_id not between", value1, value2, "providerId"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNull() { - addCriterion("location_id is null"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNotNull() { - addCriterion("location_id is not null"); - return (Criteria) this; - } - - public Criteria andLocationIdEqualTo(String value) { - addCriterion("location_id =", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotEqualTo(String value) { - addCriterion("location_id <>", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThan(String value) { - addCriterion("location_id >", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThanOrEqualTo(String value) { - addCriterion("location_id >=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThan(String value) { - addCriterion("location_id <", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThanOrEqualTo(String value) { - addCriterion("location_id <=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLike(String value) { - addCriterion("location_id like", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotLike(String value) { - addCriterion("location_id not like", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdIn(List values) { - addCriterion("location_id in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotIn(List values) { - addCriterion("location_id not in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdBetween(String value1, String value2) { - addCriterion("location_id between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotBetween(String value1, String value2) { - addCriterion("location_id not between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andTeamIsNull() { - addCriterion("team is null"); - return (Criteria) this; - } - - public Criteria andTeamIsNotNull() { - addCriterion("team is not null"); - return (Criteria) this; - } - - public Criteria andTeamEqualTo(String value) { - addCriterion("team =", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotEqualTo(String value) { - addCriterion("team <>", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamGreaterThan(String value) { - addCriterion("team >", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamGreaterThanOrEqualTo(String value) { - addCriterion("team >=", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamLessThan(String value) { - addCriterion("team <", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamLessThanOrEqualTo(String value) { - addCriterion("team <=", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamLike(String value) { - addCriterion("team like", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotLike(String value) { - addCriterion("team not like", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamIn(List values) { - addCriterion("team in", values, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotIn(List values) { - addCriterion("team not in", values, "team"); - return (Criteria) this; - } - - public Criteria andTeamBetween(String value1, String value2) { - addCriterion("team between", value1, value2, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotBetween(String value1, String value2) { - addCriterion("team not between", value1, value2, "team"); - return (Criteria) this; - } - - public Criteria andTeamIdIsNull() { - addCriterion("team_id is null"); - return (Criteria) this; - } - - public Criteria andTeamIdIsNotNull() { - addCriterion("team_id is not null"); - return (Criteria) this; - } - - public Criteria andTeamIdEqualTo(String value) { - addCriterion("team_id =", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotEqualTo(String value) { - addCriterion("team_id <>", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdGreaterThan(String value) { - addCriterion("team_id >", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdGreaterThanOrEqualTo(String value) { - addCriterion("team_id >=", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdLessThan(String value) { - addCriterion("team_id <", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdLessThanOrEqualTo(String value) { - addCriterion("team_id <=", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdLike(String value) { - addCriterion("team_id like", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotLike(String value) { - addCriterion("team_id not like", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdIn(List values) { - addCriterion("team_id in", values, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotIn(List values) { - addCriterion("team_id not in", values, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdBetween(String value1, String value2) { - addCriterion("team_id between", value1, value2, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotBetween(String value1, String value2) { - addCriterion("team_id not between", value1, value2, "teamId"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNull() { - addCriterion("date_edited is null"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNotNull() { - addCriterion("date_edited is not null"); - return (Criteria) this; - } - - public Criteria andDateEditedEqualTo(Date value) { - addCriterionForJDBCDate("date_edited =", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotEqualTo(Date value) { - addCriterionForJDBCDate("date_edited <>", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThan(Date value) { - addCriterionForJDBCDate("date_edited >", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { - addCriterionForJDBCDate("date_edited >=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThan(Date value) { - addCriterionForJDBCDate("date_edited <", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThanOrEqualTo(Date value) { - addCriterionForJDBCDate("date_edited <=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedIn(List values) { - addCriterionForJDBCDate("date_edited in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotIn(List values) { - addCriterionForJDBCDate("date_edited not in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedBetween(Date value1, Date value2) { - addCriterionForJDBCDate("date_edited between", value1, value2, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotBetween(Date value1, Date value2) { - addCriterionForJDBCDate("date_edited not between", value1, value2, "dateEdited"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.report_metadata - * - * @mbg.generated do_not_delete_during_merge Wed Mar 07 18:26:22 EAT 2018 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public ReportMetadataExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + protected void addCriterionForJDBCDate(String condition, Date value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + addCriterion(condition, new java.sql.Date(value.getTime()), property); + } + + protected void addCriterionForJDBCDate(String condition, List values, String property) { + if (values == null || values.size() == 0) { + throw new RuntimeException("Value list for " + property + " cannot be null or empty"); + } + List dateList = new ArrayList(); + Iterator iter = values.iterator(); + while (iter.hasNext()) { + dateList.add(new java.sql.Date(iter.next().getTime())); + } + addCriterion(condition, dateList, property); + } + + protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andReportIdIsNull() { + addCriterion("report_id is null"); + return (Criteria) this; + } + + public Criteria andReportIdIsNotNull() { + addCriterion("report_id is not null"); + return (Criteria) this; + } + + public Criteria andReportIdEqualTo(Long value) { + addCriterion("report_id =", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotEqualTo(Long value) { + addCriterion("report_id <>", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThan(Long value) { + addCriterion("report_id >", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThanOrEqualTo(Long value) { + addCriterion("report_id >=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThan(Long value) { + addCriterion("report_id <", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThanOrEqualTo(Long value) { + addCriterion("report_id <=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdIn(List values) { + addCriterion("report_id in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotIn(List values) { + addCriterion("report_id not in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdBetween(Long value1, Long value2) { + addCriterion("report_id between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotBetween(Long value1, Long value2) { + addCriterion("report_id not between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNull() { + addCriterion("document_id is null"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNotNull() { + addCriterion("document_id is not null"); + return (Criteria) this; + } + + public Criteria andDocumentIdEqualTo(String value) { + addCriterion("document_id =", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotEqualTo(String value) { + addCriterion("document_id <>", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThan(String value) { + addCriterion("document_id >", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { + addCriterion("document_id >=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThan(String value) { + addCriterion("document_id <", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThanOrEqualTo(String value) { + addCriterion("document_id <=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLike(String value) { + addCriterion("document_id like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotLike(String value) { + addCriterion("document_id not like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdIn(List values) { + addCriterion("document_id in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotIn(List values) { + addCriterion("document_id not in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdBetween(String value1, String value2) { + addCriterion("document_id between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotBetween(String value1, String value2) { + addCriterion("document_id not between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdIsNull() { + addCriterion("form_submission_id is null"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdIsNotNull() { + addCriterion("form_submission_id is not null"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdEqualTo(String value) { + addCriterion("form_submission_id =", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdNotEqualTo(String value) { + addCriterion("form_submission_id <>", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdGreaterThan(String value) { + addCriterion("form_submission_id >", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdGreaterThanOrEqualTo(String value) { + addCriterion("form_submission_id >=", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdLessThan(String value) { + addCriterion("form_submission_id <", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdLessThanOrEqualTo(String value) { + addCriterion("form_submission_id <=", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdLike(String value) { + addCriterion("form_submission_id like", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdNotLike(String value) { + addCriterion("form_submission_id not like", value, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdIn(List values) { + addCriterion("form_submission_id in", values, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdNotIn(List values) { + addCriterion("form_submission_id not in", values, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdBetween(String value1, String value2) { + addCriterion("form_submission_id between", value1, value2, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andFormSubmissionIdNotBetween(String value1, String value2) { + addCriterion("form_submission_id not between", value1, value2, "formSubmissionId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdIsNull() { + addCriterion("base_entity_id is null"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdIsNotNull() { + addCriterion("base_entity_id is not null"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdEqualTo(String value) { + addCriterion("base_entity_id =", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotEqualTo(String value) { + addCriterion("base_entity_id <>", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdGreaterThan(String value) { + addCriterion("base_entity_id >", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdGreaterThanOrEqualTo(String value) { + addCriterion("base_entity_id >=", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdLessThan(String value) { + addCriterion("base_entity_id <", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdLessThanOrEqualTo(String value) { + addCriterion("base_entity_id <=", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdLike(String value) { + addCriterion("base_entity_id like", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotLike(String value) { + addCriterion("base_entity_id not like", value, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdIn(List values) { + addCriterion("base_entity_id in", values, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotIn(List values) { + addCriterion("base_entity_id not in", values, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdBetween(String value1, String value2) { + addCriterion("base_entity_id between", value1, value2, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andBaseEntityIdNotBetween(String value1, String value2) { + addCriterion("base_entity_id not between", value1, value2, "baseEntityId"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andReportTypeIsNull() { + addCriterion("report_type is null"); + return (Criteria) this; + } + + public Criteria andReportTypeIsNotNull() { + addCriterion("report_type is not null"); + return (Criteria) this; + } + + public Criteria andReportTypeEqualTo(String value) { + addCriterion("report_type =", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeNotEqualTo(String value) { + addCriterion("report_type <>", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeGreaterThan(String value) { + addCriterion("report_type >", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeGreaterThanOrEqualTo(String value) { + addCriterion("report_type >=", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeLessThan(String value) { + addCriterion("report_type <", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeLessThanOrEqualTo(String value) { + addCriterion("report_type <=", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeLike(String value) { + addCriterion("report_type like", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeNotLike(String value) { + addCriterion("report_type not like", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeIn(List values) { + addCriterion("report_type in", values, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeNotIn(List values) { + addCriterion("report_type not in", values, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeBetween(String value1, String value2) { + addCriterion("report_type between", value1, value2, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeNotBetween(String value1, String value2) { + addCriterion("report_type not between", value1, value2, "reportType"); + return (Criteria) this; + } + + public Criteria andReportDateIsNull() { + addCriterion("report_date is null"); + return (Criteria) this; + } + + public Criteria andReportDateIsNotNull() { + addCriterion("report_date is not null"); + return (Criteria) this; + } + + public Criteria andReportDateEqualTo(Date value) { + addCriterionForJDBCDate("report_date =", value, "reportDate"); + return (Criteria) this; + } + + public Criteria andReportDateNotEqualTo(Date value) { + addCriterionForJDBCDate("report_date <>", value, "reportDate"); + return (Criteria) this; + } + + public Criteria andReportDateGreaterThan(Date value) { + addCriterionForJDBCDate("report_date >", value, "reportDate"); + return (Criteria) this; + } + + public Criteria andReportDateGreaterThanOrEqualTo(Date value) { + addCriterionForJDBCDate("report_date >=", value, "reportDate"); + return (Criteria) this; + } + + public Criteria andReportDateLessThan(Date value) { + addCriterionForJDBCDate("report_date <", value, "reportDate"); + return (Criteria) this; + } + + public Criteria andReportDateLessThanOrEqualTo(Date value) { + addCriterionForJDBCDate("report_date <=", value, "reportDate"); + return (Criteria) this; + } + + public Criteria andReportDateIn(List values) { + addCriterionForJDBCDate("report_date in", values, "reportDate"); + return (Criteria) this; + } + + public Criteria andReportDateNotIn(List values) { + addCriterionForJDBCDate("report_date not in", values, "reportDate"); + return (Criteria) this; + } + + public Criteria andReportDateBetween(Date value1, Date value2) { + addCriterionForJDBCDate("report_date between", value1, value2, "reportDate"); + return (Criteria) this; + } + + public Criteria andReportDateNotBetween(Date value1, Date value2) { + addCriterionForJDBCDate("report_date not between", value1, value2, "reportDate"); + return (Criteria) this; + } + + public Criteria andProviderIdIsNull() { + addCriterion("provider_id is null"); + return (Criteria) this; + } + + public Criteria andProviderIdIsNotNull() { + addCriterion("provider_id is not null"); + return (Criteria) this; + } + + public Criteria andProviderIdEqualTo(String value) { + addCriterion("provider_id =", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotEqualTo(String value) { + addCriterion("provider_id <>", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdGreaterThan(String value) { + addCriterion("provider_id >", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdGreaterThanOrEqualTo(String value) { + addCriterion("provider_id >=", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdLessThan(String value) { + addCriterion("provider_id <", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdLessThanOrEqualTo(String value) { + addCriterion("provider_id <=", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdLike(String value) { + addCriterion("provider_id like", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotLike(String value) { + addCriterion("provider_id not like", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdIn(List values) { + addCriterion("provider_id in", values, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotIn(List values) { + addCriterion("provider_id not in", values, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdBetween(String value1, String value2) { + addCriterion("provider_id between", value1, value2, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotBetween(String value1, String value2) { + addCriterion("provider_id not between", value1, value2, "providerId"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNull() { + addCriterion("location_id is null"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNotNull() { + addCriterion("location_id is not null"); + return (Criteria) this; + } + + public Criteria andLocationIdEqualTo(String value) { + addCriterion("location_id =", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotEqualTo(String value) { + addCriterion("location_id <>", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThan(String value) { + addCriterion("location_id >", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThanOrEqualTo(String value) { + addCriterion("location_id >=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThan(String value) { + addCriterion("location_id <", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThanOrEqualTo(String value) { + addCriterion("location_id <=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLike(String value) { + addCriterion("location_id like", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotLike(String value) { + addCriterion("location_id not like", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdIn(List values) { + addCriterion("location_id in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotIn(List values) { + addCriterion("location_id not in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdBetween(String value1, String value2) { + addCriterion("location_id between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotBetween(String value1, String value2) { + addCriterion("location_id not between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andTeamIsNull() { + addCriterion("team is null"); + return (Criteria) this; + } + + public Criteria andTeamIsNotNull() { + addCriterion("team is not null"); + return (Criteria) this; + } + + public Criteria andTeamEqualTo(String value) { + addCriterion("team =", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotEqualTo(String value) { + addCriterion("team <>", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamGreaterThan(String value) { + addCriterion("team >", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamGreaterThanOrEqualTo(String value) { + addCriterion("team >=", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLessThan(String value) { + addCriterion("team <", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLessThanOrEqualTo(String value) { + addCriterion("team <=", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLike(String value) { + addCriterion("team like", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotLike(String value) { + addCriterion("team not like", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamIn(List values) { + addCriterion("team in", values, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotIn(List values) { + addCriterion("team not in", values, "team"); + return (Criteria) this; + } + + public Criteria andTeamBetween(String value1, String value2) { + addCriterion("team between", value1, value2, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotBetween(String value1, String value2) { + addCriterion("team not between", value1, value2, "team"); + return (Criteria) this; + } + + public Criteria andTeamIdIsNull() { + addCriterion("team_id is null"); + return (Criteria) this; + } + + public Criteria andTeamIdIsNotNull() { + addCriterion("team_id is not null"); + return (Criteria) this; + } + + public Criteria andTeamIdEqualTo(String value) { + addCriterion("team_id =", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotEqualTo(String value) { + addCriterion("team_id <>", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdGreaterThan(String value) { + addCriterion("team_id >", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdGreaterThanOrEqualTo(String value) { + addCriterion("team_id >=", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLessThan(String value) { + addCriterion("team_id <", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLessThanOrEqualTo(String value) { + addCriterion("team_id <=", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLike(String value) { + addCriterion("team_id like", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotLike(String value) { + addCriterion("team_id not like", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdIn(List values) { + addCriterion("team_id in", values, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotIn(List values) { + addCriterion("team_id not in", values, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdBetween(String value1, String value2) { + addCriterion("team_id between", value1, value2, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotBetween(String value1, String value2) { + addCriterion("team_id not between", value1, value2, "teamId"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNull() { + addCriterion("date_edited is null"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNotNull() { + addCriterion("date_edited is not null"); + return (Criteria) this; + } + + public Criteria andDateEditedEqualTo(Date value) { + addCriterionForJDBCDate("date_edited =", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotEqualTo(Date value) { + addCriterionForJDBCDate("date_edited <>", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThan(Date value) { + addCriterionForJDBCDate("date_edited >", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { + addCriterionForJDBCDate("date_edited >=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThan(Date value) { + addCriterionForJDBCDate("date_edited <", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThanOrEqualTo(Date value) { + addCriterionForJDBCDate("date_edited <=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedIn(List values) { + addCriterionForJDBCDate("date_edited in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotIn(List values) { + addCriterionForJDBCDate("date_edited not in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedBetween(Date value1, Date value2) { + addCriterionForJDBCDate("date_edited between", value1, value2, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotBetween(Date value1, Date value2) { + addCriterionForJDBCDate("date_edited not between", value1, value2, "dateEdited"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.report_metadata + * + * @mbg.generated do_not_delete_during_merge Wed Mar 07 18:26:22 EAT 2018 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/Settings.java b/src/main/java/org/opensrp/domain/postgres/Settings.java index e9c2cb4ec..dcf515fc9 100644 --- a/src/main/java/org/opensrp/domain/postgres/Settings.java +++ b/src/main/java/org/opensrp/domain/postgres/Settings.java @@ -2,73 +2,82 @@ public class Settings { - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.settings.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Long id; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.settings.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Object json; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.settings.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Long serverVersion; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.settings.id + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Long id; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.settings.json + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Object json; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.settings.server_version + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Long serverVersion; - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.settings.id - * @return the value of core.settings.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Long getId() { - return id; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.settings.id + * + * @return the value of core.settings.id + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Long getId() { + return id; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.settings.id - * @param id the value for core.settings.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.settings.id + * + * @param id the value for core.settings.id + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setId(Long id) { + this.id = id; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.settings.json - * @return the value of core.settings.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Object getJson() { - return json; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.settings.json + * + * @return the value of core.settings.json + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Object getJson() { + return json; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.settings.json - * @param json the value for core.settings.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setJson(Object json) { - this.json = json; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.settings.json + * + * @param json the value for core.settings.json + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setJson(Object json) { + this.json = json; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.settings.server_version - * @return the value of core.settings.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Long getServerVersion() { - return serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.settings.server_version + * + * @return the value of core.settings.server_version + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Long getServerVersion() { + return serverVersion; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.settings.server_version - * @param serverVersion the value for core.settings.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.settings.server_version + * + * @param serverVersion the value for core.settings.server_version + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } } \ No newline at end of file diff --git a/src/main/java/org/opensrp/domain/postgres/SettingsAndSettingsMetadataJoined.java b/src/main/java/org/opensrp/domain/postgres/SettingsAndSettingsMetadataJoined.java index f1f10cb89..531f68084 100644 --- a/src/main/java/org/opensrp/domain/postgres/SettingsAndSettingsMetadataJoined.java +++ b/src/main/java/org/opensrp/domain/postgres/SettingsAndSettingsMetadataJoined.java @@ -4,22 +4,22 @@ * Created by Vincent Karuri on 24/04/2020 */ public class SettingsAndSettingsMetadataJoined { - private Settings settings; - private SettingsMetadata settingsMetadata; + private Settings settings; + private SettingsMetadata settingsMetadata; - public Settings getSettings() { - return settings; - } - - public void setSettings(Settings settings) { - this.settings = settings; - } - - public SettingsMetadata getSettingsMetadata() { - return settingsMetadata; - } - - public void setSettingsMetadata(SettingsMetadata settingsMetadata) { - this.settingsMetadata = settingsMetadata; - } + public Settings getSettings() { + return settings; + } + + public void setSettings(Settings settings) { + this.settings = settings; + } + + public SettingsMetadata getSettingsMetadata() { + return settingsMetadata; + } + + public void setSettingsMetadata(SettingsMetadata settingsMetadata) { + this.settingsMetadata = settingsMetadata; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/SettingsExample.java b/src/main/java/org/opensrp/domain/postgres/SettingsExample.java index 84cc838fb..487bd8d97 100644 --- a/src/main/java/org/opensrp/domain/postgres/SettingsExample.java +++ b/src/main/java/org/opensrp/domain/postgres/SettingsExample.java @@ -5,471 +5,487 @@ public class SettingsExample { /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected String orderByClause; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected boolean distinct; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public SettingsExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List jsonCriteria; - - protected List allCriteria; - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - jsonCriteria = new ArrayList<>(); - } - - public List getJsonCriteria() { - return jsonCriteria; - } - - protected void addJsonCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.SettingTypeHandler")); - allCriteria = null; - } - - protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - jsonCriteria.add( - new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.SettingTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || jsonCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList<>(); - allCriteria.addAll(criteria); - allCriteria.addAll(jsonCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - allCriteria = null; - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andJsonIsNull() { - addCriterion("json is null"); - return (Criteria) this; - } - - public Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (Criteria) this; - } - - public Criteria andJsonEqualTo(Object value) { - addJsonCriterion("json =", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotEqualTo(Object value) { - addJsonCriterion("json <>", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThan(Object value) { - addJsonCriterion("json >", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThanOrEqualTo(Object value) { - addJsonCriterion("json >=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThan(Object value) { - addJsonCriterion("json <", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThanOrEqualTo(Object value) { - addJsonCriterion("json <=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonIn(List values) { - addJsonCriterion("json in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotIn(List values) { - addJsonCriterion("json not in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonBetween(Object value1, Object value2) { - addJsonCriterion("json between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotBetween(Object value1, Object value2) { - addJsonCriterion("json not between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected String orderByClause; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected boolean distinct; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public SettingsExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List jsonCriteria; + + protected List allCriteria; + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + jsonCriteria = new ArrayList<>(); + } + + public List getJsonCriteria() { + return jsonCriteria; + } + + protected void addJsonCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.SettingTypeHandler")); + allCriteria = null; + } + + protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + jsonCriteria.add( + new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.SettingTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || jsonCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList<>(); + allCriteria.addAll(criteria); + allCriteria.addAll(jsonCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andJsonIsNull() { + addCriterion("json is null"); + return (Criteria) this; + } + + public Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (Criteria) this; + } + + public Criteria andJsonEqualTo(Object value) { + addJsonCriterion("json =", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotEqualTo(Object value) { + addJsonCriterion("json <>", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThan(Object value) { + addJsonCriterion("json >", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThanOrEqualTo(Object value) { + addJsonCriterion("json >=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThan(Object value) { + addJsonCriterion("json <", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThanOrEqualTo(Object value) { + addJsonCriterion("json <=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonIn(List values) { + addJsonCriterion("json in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotIn(List values) { + addJsonCriterion("json not in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonBetween(Object value1, Object value2) { + addJsonCriterion("json between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotBetween(Object value1, Object value2) { + addJsonCriterion("json not between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** * This class was generated by MyBatis Generator. * This class corresponds to the database table core.settings * diff --git a/src/main/java/org/opensrp/domain/postgres/SettingsMetadata.java b/src/main/java/org/opensrp/domain/postgres/SettingsMetadata.java index 3f4e7b6a9..698053ae4 100644 --- a/src/main/java/org/opensrp/domain/postgres/SettingsMetadata.java +++ b/src/main/java/org/opensrp/domain/postgres/SettingsMetadata.java @@ -2,7 +2,6 @@ public class SettingsMetadata { /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.id * @@ -11,7 +10,6 @@ public class SettingsMetadata { private Long id; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.settings_id * @@ -20,7 +18,6 @@ public class SettingsMetadata { private Long settingsId; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.document_id * @@ -29,7 +26,6 @@ public class SettingsMetadata { private String documentId; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.identifier * @@ -38,7 +34,6 @@ public class SettingsMetadata { private String identifier; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.server_version * @@ -47,7 +42,6 @@ public class SettingsMetadata { private Long serverVersion; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.team * @@ -56,7 +50,6 @@ public class SettingsMetadata { private String team; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.team_id * @@ -65,7 +58,6 @@ public class SettingsMetadata { private String teamId; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.provider_id * @@ -74,7 +66,6 @@ public class SettingsMetadata { private String providerId; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.location_id * @@ -83,7 +74,6 @@ public class SettingsMetadata { private String locationId; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.uuid * @@ -92,7 +82,6 @@ public class SettingsMetadata { private String uuid; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.json * @@ -101,7 +90,6 @@ public class SettingsMetadata { private Object json; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.setting_type * @@ -110,7 +98,6 @@ public class SettingsMetadata { private String settingType; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.setting_value * @@ -119,7 +106,6 @@ public class SettingsMetadata { private String settingValue; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.setting_key * @@ -128,7 +114,6 @@ public class SettingsMetadata { private String settingKey; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.setting_description * @@ -137,7 +122,6 @@ public class SettingsMetadata { private String settingDescription; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.setting_label * @@ -146,7 +130,6 @@ public class SettingsMetadata { private String settingLabel; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.settings_metadata.inherited_from * @@ -154,18 +137,18 @@ public class SettingsMetadata { */ private String inheritedFrom; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.settings_metadata.metadata_version - * @mbg.generated Fri May 21 17:49:57 PKT 2021 - */ - private Long metadataVersion; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.settings_metadata.metadata_version + * + * @mbg.generated Fri May 21 17:49:57 PKT 2021 + */ + private Long metadataVersion; /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.settings_metadata.id * * @return the value of core.settings_metadata.id - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public Long getId() { @@ -177,7 +160,6 @@ public Long getId() { * This method sets the value of the database column core.settings_metadata.id * * @param id the value for core.settings_metadata.id - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setId(Long id) { @@ -189,7 +171,6 @@ public void setId(Long id) { * This method returns the value of the database column core.settings_metadata.settings_id * * @return the value of core.settings_metadata.settings_id - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public Long getSettingsId() { @@ -201,7 +182,6 @@ public Long getSettingsId() { * This method sets the value of the database column core.settings_metadata.settings_id * * @param settingsId the value for core.settings_metadata.settings_id - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setSettingsId(Long settingsId) { @@ -213,7 +193,6 @@ public void setSettingsId(Long settingsId) { * This method returns the value of the database column core.settings_metadata.document_id * * @return the value of core.settings_metadata.document_id - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public String getDocumentId() { @@ -225,7 +204,6 @@ public String getDocumentId() { * This method sets the value of the database column core.settings_metadata.document_id * * @param documentId the value for core.settings_metadata.document_id - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setDocumentId(String documentId) { @@ -237,7 +215,6 @@ public void setDocumentId(String documentId) { * This method returns the value of the database column core.settings_metadata.identifier * * @return the value of core.settings_metadata.identifier - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public String getIdentifier() { @@ -249,7 +226,6 @@ public String getIdentifier() { * This method sets the value of the database column core.settings_metadata.identifier * * @param identifier the value for core.settings_metadata.identifier - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setIdentifier(String identifier) { @@ -261,7 +237,6 @@ public void setIdentifier(String identifier) { * This method returns the value of the database column core.settings_metadata.server_version * * @return the value of core.settings_metadata.server_version - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public Long getServerVersion() { @@ -273,7 +248,6 @@ public Long getServerVersion() { * This method sets the value of the database column core.settings_metadata.server_version * * @param serverVersion the value for core.settings_metadata.server_version - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setServerVersion(Long serverVersion) { @@ -285,7 +259,6 @@ public void setServerVersion(Long serverVersion) { * This method returns the value of the database column core.settings_metadata.team * * @return the value of core.settings_metadata.team - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public String getTeam() { @@ -297,7 +270,6 @@ public String getTeam() { * This method sets the value of the database column core.settings_metadata.team * * @param team the value for core.settings_metadata.team - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setTeam(String team) { @@ -309,7 +281,6 @@ public void setTeam(String team) { * This method returns the value of the database column core.settings_metadata.team_id * * @return the value of core.settings_metadata.team_id - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public String getTeamId() { @@ -321,7 +292,6 @@ public String getTeamId() { * This method sets the value of the database column core.settings_metadata.team_id * * @param teamId the value for core.settings_metadata.team_id - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setTeamId(String teamId) { @@ -333,7 +303,6 @@ public void setTeamId(String teamId) { * This method returns the value of the database column core.settings_metadata.provider_id * * @return the value of core.settings_metadata.provider_id - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public String getProviderId() { @@ -345,7 +314,6 @@ public String getProviderId() { * This method sets the value of the database column core.settings_metadata.provider_id * * @param providerId the value for core.settings_metadata.provider_id - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setProviderId(String providerId) { @@ -357,7 +325,6 @@ public void setProviderId(String providerId) { * This method returns the value of the database column core.settings_metadata.location_id * * @return the value of core.settings_metadata.location_id - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public String getLocationId() { @@ -369,7 +336,6 @@ public String getLocationId() { * This method sets the value of the database column core.settings_metadata.location_id * * @param locationId the value for core.settings_metadata.location_id - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setLocationId(String locationId) { @@ -381,7 +347,6 @@ public void setLocationId(String locationId) { * This method returns the value of the database column core.settings_metadata.uuid * * @return the value of core.settings_metadata.uuid - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public String getUuid() { @@ -393,7 +358,6 @@ public String getUuid() { * This method sets the value of the database column core.settings_metadata.uuid * * @param uuid the value for core.settings_metadata.uuid - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setUuid(String uuid) { @@ -405,7 +369,6 @@ public void setUuid(String uuid) { * This method returns the value of the database column core.settings_metadata.json * * @return the value of core.settings_metadata.json - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public Object getJson() { @@ -417,7 +380,6 @@ public Object getJson() { * This method sets the value of the database column core.settings_metadata.json * * @param json the value for core.settings_metadata.json - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setJson(Object json) { @@ -429,7 +391,6 @@ public void setJson(Object json) { * This method returns the value of the database column core.settings_metadata.setting_type * * @return the value of core.settings_metadata.setting_type - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public String getSettingType() { @@ -441,7 +402,6 @@ public String getSettingType() { * This method sets the value of the database column core.settings_metadata.setting_type * * @param settingType the value for core.settings_metadata.setting_type - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setSettingType(String settingType) { @@ -453,7 +413,6 @@ public void setSettingType(String settingType) { * This method returns the value of the database column core.settings_metadata.setting_value * * @return the value of core.settings_metadata.setting_value - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public String getSettingValue() { @@ -465,7 +424,6 @@ public String getSettingValue() { * This method sets the value of the database column core.settings_metadata.setting_value * * @param settingValue the value for core.settings_metadata.setting_value - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setSettingValue(String settingValue) { @@ -477,7 +435,6 @@ public void setSettingValue(String settingValue) { * This method returns the value of the database column core.settings_metadata.setting_key * * @return the value of core.settings_metadata.setting_key - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public String getSettingKey() { @@ -489,7 +446,6 @@ public String getSettingKey() { * This method sets the value of the database column core.settings_metadata.setting_key * * @param settingKey the value for core.settings_metadata.setting_key - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setSettingKey(String settingKey) { @@ -501,7 +457,6 @@ public void setSettingKey(String settingKey) { * This method returns the value of the database column core.settings_metadata.setting_description * * @return the value of core.settings_metadata.setting_description - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public String getSettingDescription() { @@ -513,7 +468,6 @@ public String getSettingDescription() { * This method sets the value of the database column core.settings_metadata.setting_description * * @param settingDescription the value for core.settings_metadata.setting_description - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setSettingDescription(String settingDescription) { @@ -522,26 +476,24 @@ public void setSettingDescription(String settingDescription) { /** * This method was generated by MyBatis Generator. - * This method sets the value of the database column core.settings_metadata.setting_label - * - * @param settingLabel the value for core.settings_metadata.setting_label + * This method returns the value of the database column core.settings_metadata.setting_label * + * @return the value of core.settings_metadata.setting_label * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ - public void setSettingLabel(String settingLabel) { - this.settingLabel = settingLabel; + public String getSettingLabel() { + return settingLabel; } /** * This method was generated by MyBatis Generator. - * This method returns the value of the database column core.settings_metadata.setting_label - * - * @return the value of core.settings_metadata.setting_label + * This method sets the value of the database column core.settings_metadata.setting_label * + * @param settingLabel the value for core.settings_metadata.setting_label * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ - public String getSettingLabel() { - return settingLabel; + public void setSettingLabel(String settingLabel) { + this.settingLabel = settingLabel; } /** @@ -549,7 +501,6 @@ public String getSettingLabel() { * This method returns the value of the database column core.settings_metadata.inherited_from * * @return the value of core.settings_metadata.inherited_from - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public String getInheritedFrom() { @@ -561,28 +512,29 @@ public String getInheritedFrom() { * This method sets the value of the database column core.settings_metadata.inherited_from * * @param inheritedFrom the value for core.settings_metadata.inherited_from - * * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 */ public void setInheritedFrom(String inheritedFrom) { this.inheritedFrom = inheritedFrom; } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.settings_metadata.metadata_version - * @return the value of core.settings_metadata.metadata_version - * @mbg.generated Fri May 21 17:49:57 PKT 2021 - */ - public Long getMetadataVersion() { - return metadataVersion; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.settings_metadata.metadata_version - * @param metadataVersion the value for core.settings_metadata.metadata_version - * @mbg.generated Fri May 21 17:49:57 PKT 2021 - */ - public void setMetadataVersion(Long metadataVersion) { - this.metadataVersion = metadataVersion; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.settings_metadata.metadata_version + * + * @return the value of core.settings_metadata.metadata_version + * @mbg.generated Fri May 21 17:49:57 PKT 2021 + */ + public Long getMetadataVersion() { + return metadataVersion; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.settings_metadata.metadata_version + * + * @param metadataVersion the value for core.settings_metadata.metadata_version + * @mbg.generated Fri May 21 17:49:57 PKT 2021 + */ + public void setMetadataVersion(Long metadataVersion) { + this.metadataVersion = metadataVersion; + } } \ No newline at end of file diff --git a/src/main/java/org/opensrp/domain/postgres/SettingsMetadataExample.java b/src/main/java/org/opensrp/domain/postgres/SettingsMetadataExample.java index 541fa24b2..d86e08914 100644 --- a/src/main/java/org/opensrp/domain/postgres/SettingsMetadataExample.java +++ b/src/main/java/org/opensrp/domain/postgres/SettingsMetadataExample.java @@ -5,239 +5,239 @@ public class SettingsMetadataExample extends SettingsMetadataExampleGeneratedCriteria { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - public SettingsMetadataExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + public SettingsMetadataExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/SettingsMetadataExampleGeneratedCriteria.java b/src/main/java/org/opensrp/domain/postgres/SettingsMetadataExampleGeneratedCriteria.java index ed29efc0e..591b1803d 100644 --- a/src/main/java/org/opensrp/domain/postgres/SettingsMetadataExampleGeneratedCriteria.java +++ b/src/main/java/org/opensrp/domain/postgres/SettingsMetadataExampleGeneratedCriteria.java @@ -5,1293 +5,1290 @@ public class SettingsMetadataExampleGeneratedCriteria { - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table core.settings_metadata - * - * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - try { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - catch (IllegalArgumentException e) { - e.printStackTrace(); - } - } - criteria.add(new SettingsMetadataExample.Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - try { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - catch (IllegalArgumentException e) { - e.printStackTrace(); - } - } - criteria.add(new SettingsMetadataExample.Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - try { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - catch (IllegalArgumentException e) { - e.printStackTrace(); - } - } - criteria.add(new SettingsMetadataExample.Criterion(condition, value1, value2)); - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdIsNull() { - addCriterion("id is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdIsNull() { - addCriterion("settings_id is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdIsNotNull() { - addCriterion("settings_id is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdEqualTo(Long value) { - addCriterion("settings_id =", value, "settingsId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdNotEqualTo(Long value) { - addCriterion("settings_id <>", value, "settingsId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdGreaterThan(Long value) { - addCriterion("settings_id >", value, "settingsId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdGreaterThanOrEqualTo(Long value) { - addCriterion("settings_id >=", value, "settingsId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdLessThan(Long value) { - addCriterion("settings_id <", value, "settingsId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdLessThanOrEqualTo(Long value) { - addCriterion("settings_id <=", value, "settingsId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdIn(List values) { - addCriterion("settings_id in", values, "settingsId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdNotIn(List values) { - addCriterion("settings_id not in", values, "settingsId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdBetween(Long value1, Long value2) { - addCriterion("settings_id between", value1, value2, "settingsId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdNotBetween(Long value1, Long value2) { - addCriterion("settings_id not between", value1, value2, "settingsId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdIsNull() { - addCriterion("document_id is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdIsNotNull() { - addCriterion("document_id is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdEqualTo(String value) { - addCriterion("document_id =", value, "documentId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdNotEqualTo(String value) { - addCriterion("document_id <>", value, "documentId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdGreaterThan(String value) { - addCriterion("document_id >", value, "documentId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdGreaterThanOrEqualTo(String value) { - addCriterion("document_id >=", value, "documentId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdLessThan(String value) { - addCriterion("document_id <", value, "documentId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdLessThanOrEqualTo(String value) { - addCriterion("document_id <=", value, "documentId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdLike(String value) { - addCriterion("document_id like", value, "documentId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdNotLike(String value) { - addCriterion("document_id not like", value, "documentId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdIn(List values) { - addCriterion("document_id in", values, "documentId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdNotIn(List values) { - addCriterion("document_id not in", values, "documentId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdBetween(String value1, String value2) { - addCriterion("document_id between", value1, value2, "documentId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdNotBetween(String value1, String value2) { - addCriterion("document_id not between", value1, value2, "documentId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierIsNull() { - addCriterion("identifier is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierIsNotNull() { - addCriterion("identifier is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierEqualTo(String value) { - addCriterion("identifier =", value, "identifier"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierNotEqualTo(String value) { - addCriterion("identifier <>", value, "identifier"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierGreaterThan(String value) { - addCriterion("identifier >", value, "identifier"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierGreaterThanOrEqualTo(String value) { - addCriterion("identifier >=", value, "identifier"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierLessThan(String value) { - addCriterion("identifier <", value, "identifier"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierLessThanOrEqualTo(String value) { - addCriterion("identifier <=", value, "identifier"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierLike(String value) { - addCriterion("identifier like", value, "identifier"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierNotLike(String value) { - addCriterion("identifier not like", value, "identifier"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierIn(List values) { - addCriterion("identifier in", values, "identifier"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierNotIn(List values) { - addCriterion("identifier not in", values, "identifier"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierBetween(String value1, String value2) { - addCriterion("identifier between", value1, value2, "identifier"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierNotBetween(String value1, String value2) { - addCriterion("identifier not between", value1, value2, "identifier"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIsNull() { - addCriterion("team is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIsNotNull() { - addCriterion("team is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamEqualTo(String value) { - addCriterion("team =", value, "team"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamNotEqualTo(String value) { - addCriterion("team <>", value, "team"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamGreaterThan(String value) { - addCriterion("team >", value, "team"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamGreaterThanOrEqualTo(String value) { - addCriterion("team >=", value, "team"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamLessThan(String value) { - addCriterion("team <", value, "team"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamLessThanOrEqualTo(String value) { - addCriterion("team <=", value, "team"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamLike(String value) { - addCriterion("team like", value, "team"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamNotLike(String value) { - addCriterion("team not like", value, "team"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIn(List values) { - addCriterion("team in", values, "team"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamNotIn(List values) { - addCriterion("team not in", values, "team"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamBetween(String value1, String value2) { - addCriterion("team between", value1, value2, "team"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamNotBetween(String value1, String value2) { - addCriterion("team not between", value1, value2, "team"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdIsNull() { - addCriterion("team_id is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdIsNotNull() { - addCriterion("team_id is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdEqualTo(String value) { - addCriterion("team_id =", value, "teamId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdNotEqualTo(String value) { - addCriterion("team_id <>", value, "teamId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdGreaterThan(String value) { - addCriterion("team_id >", value, "teamId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdGreaterThanOrEqualTo(String value) { - addCriterion("team_id >=", value, "teamId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdLessThan(String value) { - addCriterion("team_id <", value, "teamId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdLessThanOrEqualTo(String value) { - addCriterion("team_id <=", value, "teamId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdLike(String value) { - addCriterion("team_id like", value, "teamId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdNotLike(String value) { - addCriterion("team_id not like", value, "teamId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdIn(List values) { - addCriterion("team_id in", values, "teamId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdNotIn(List values) { - addCriterion("team_id not in", values, "teamId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdBetween(String value1, String value2) { - addCriterion("team_id between", value1, value2, "teamId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdNotBetween(String value1, String value2) { - addCriterion("team_id not between", value1, value2, "teamId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdIsNull() { - addCriterion("provider_id is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdIsNotNull() { - addCriterion("provider_id is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdEqualTo(String value) { - addCriterion("provider_id =", value, "providerId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdNotEqualTo(String value) { - addCriterion("provider_id <>", value, "providerId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdGreaterThan(String value) { - addCriterion("provider_id >", value, "providerId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdGreaterThanOrEqualTo(String value) { - addCriterion("provider_id >=", value, "providerId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdLessThan(String value) { - addCriterion("provider_id <", value, "providerId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdLessThanOrEqualTo(String value) { - addCriterion("provider_id <=", value, "providerId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdLike(String value) { - addCriterion("provider_id like", value, "providerId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdNotLike(String value) { - addCriterion("provider_id not like", value, "providerId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdIn(List values) { - addCriterion("provider_id in", values, "providerId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdNotIn(List values) { - addCriterion("provider_id not in", values, "providerId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdBetween(String value1, String value2) { - addCriterion("provider_id between", value1, value2, "providerId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdNotBetween(String value1, String value2) { - addCriterion("provider_id not between", value1, value2, "providerId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdIsNull() { - addCriterion("location_id is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdIsNotNull() { - addCriterion("location_id is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdEqualTo(String value) { - addCriterion("location_id =", value, "locationId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdNotEqualTo(String value) { - addCriterion("location_id <>", value, "locationId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdGreaterThan(String value) { - addCriterion("location_id >", value, "locationId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdGreaterThanOrEqualTo(String value) { - addCriterion("location_id >=", value, "locationId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdLessThan(String value) { - addCriterion("location_id <", value, "locationId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdLessThanOrEqualTo(String value) { - addCriterion("location_id <=", value, "locationId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdLike(String value) { - addCriterion("location_id like", value, "locationId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdNotLike(String value) { - addCriterion("location_id not like", value, "locationId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdIn(List values) { - addCriterion("location_id in", values, "locationId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdNotIn(List values) { - addCriterion("location_id not in", values, "locationId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdBetween(String value1, String value2) { - addCriterion("location_id between", value1, value2, "locationId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdNotBetween(String value1, String value2) { - addCriterion("location_id not between", value1, value2, "locationId"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidIsNull() { - addCriterion("uuid is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidIsNotNull() { - addCriterion("uuid is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidEqualTo(String value) { - addCriterion("uuid =", value, "uuid"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidNotEqualTo(String value) { - addCriterion("uuid <>", value, "uuid"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidGreaterThan(String value) { - addCriterion("uuid >", value, "uuid"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidGreaterThanOrEqualTo(String value) { - addCriterion("uuid >=", value, "uuid"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidLessThan(String value) { - addCriterion("uuid <", value, "uuid"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidLessThanOrEqualTo(String value) { - addCriterion("uuid <=", value, "uuid"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidLike(String value) { - addCriterion("uuid like", value, "uuid"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidNotLike(String value) { - addCriterion("uuid not like", value, "uuid"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidIn(List values) { - addCriterion("uuid in", values, "uuid"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidNotIn(List values) { - addCriterion("uuid not in", values, "uuid"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidBetween(String value1, String value2) { - addCriterion("uuid between", value1, value2, "uuid"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidNotBetween(String value1, String value2) { - addCriterion("uuid not between", value1, value2, "uuid"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonIsNull() { - addCriterion("json is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonEqualTo(Object value) { - addCriterion("json =", value, "json"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonNotEqualTo(Object value) { - addCriterion("json <>", value, "json"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonGreaterThan(Object value) { - addCriterion("json >", value, "json"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonGreaterThanOrEqualTo(Object value) { - addCriterion("json >=", value, "json"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonLessThan(Object value) { - addCriterion("json <", value, "json"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonLessThanOrEqualTo(Object value) { - addCriterion("json <=", value, "json"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonIn(List values) { - addCriterion("json in", values, "json"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonNotIn(List values) { - addCriterion("json not in", values, "json"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonBetween(Object value1, Object value2) { - addCriterion("json between", value1, value2, "json"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonNotBetween(Object value1, Object value2) { - addCriterion("json not between", value1, value2, "json"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeIsNull() { - addCriterion("setting_type is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeIsNotNull() { - addCriterion("setting_type is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeEqualTo(String value) { - addCriterion("setting_type =", value, "settingType"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeNotEqualTo(String value) { - addCriterion("setting_type <>", value, "settingType"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeGreaterThan(String value) { - addCriterion("setting_type >", value, "settingType"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeGreaterThanOrEqualTo(String value) { - addCriterion("setting_type >=", value, "settingType"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeLessThan(String value) { - addCriterion("setting_type <", value, "settingType"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeLessThanOrEqualTo(String value) { - addCriterion("setting_type <=", value, "settingType"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeLike(String value) { - addCriterion("setting_type like", value, "settingType"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeNotLike(String value) { - addCriterion("setting_type not like", value, "settingType"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeIn(List values) { - addCriterion("setting_type in", values, "settingType"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeNotIn(List values) { - addCriterion("setting_type not in", values, "settingType"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeBetween(String value1, String value2) { - addCriterion("setting_type between", value1, value2, "settingType"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeNotBetween(String value1, String value2) { - addCriterion("setting_type not between", value1, value2, "settingType"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueIsNull() { - addCriterion("setting_value is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueIsNotNull() { - addCriterion("setting_value is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueEqualTo(String value) { - addCriterion("setting_value =", value, "settingValue"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueNotEqualTo(String value) { - addCriterion("setting_value <>", value, "settingValue"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueGreaterThan(String value) { - addCriterion("setting_value >", value, "settingValue"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueGreaterThanOrEqualTo(String value) { - addCriterion("setting_value >=", value, "settingValue"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueLessThan(String value) { - addCriterion("setting_value <", value, "settingValue"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueLessThanOrEqualTo(String value) { - addCriterion("setting_value <=", value, "settingValue"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueLike(String value) { - addCriterion("setting_value like", value, "settingValue"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueNotLike(String value) { - addCriterion("setting_value not like", value, "settingValue"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueIn(List values) { - addCriterion("setting_value in", values, "settingValue"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueNotIn(List values) { - addCriterion("setting_value not in", values, "settingValue"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueBetween(String value1, String value2) { - addCriterion("setting_value between", value1, value2, "settingValue"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueNotBetween(String value1, String value2) { - addCriterion("setting_value not between", value1, value2, "settingValue"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyIsNull() { - addCriterion("setting_key is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyIsNotNull() { - addCriterion("setting_key is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyEqualTo(String value) { - addCriterion("setting_key =", value, "settingKey"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyNotEqualTo(String value) { - addCriterion("setting_key <>", value, "settingKey"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyGreaterThan(String value) { - addCriterion("setting_key >", value, "settingKey"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyGreaterThanOrEqualTo(String value) { - addCriterion("setting_key >=", value, "settingKey"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyLessThan(String value) { - addCriterion("setting_key <", value, "settingKey"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyLessThanOrEqualTo(String value) { - addCriterion("setting_key <=", value, "settingKey"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyLike(String value) { - addCriterion("setting_key like", value, "settingKey"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyNotLike(String value) { - addCriterion("setting_key not like", value, "settingKey"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyIn(List values) { - addCriterion("setting_key in", values, "settingKey"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyNotIn(List values) { - addCriterion("setting_key not in", values, "settingKey"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyBetween(String value1, String value2) { - addCriterion("setting_key between", value1, value2, "settingKey"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyNotBetween(String value1, String value2) { - addCriterion("setting_key not between", value1, value2, "settingKey"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionIsNull() { - addCriterion("setting_description is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionIsNotNull() { - addCriterion("setting_description is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionEqualTo(String value) { - addCriterion("setting_description =", value, "settingDescription"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionNotEqualTo(String value) { - addCriterion("setting_description <>", value, "settingDescription"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionGreaterThan(String value) { - addCriterion("setting_description >", value, "settingDescription"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionGreaterThanOrEqualTo(String value) { - addCriterion("setting_description >=", value, "settingDescription"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionLessThan(String value) { - addCriterion("setting_description <", value, "settingDescription"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionLessThanOrEqualTo(String value) { - addCriterion("setting_description <=", value, "settingDescription"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionLike(String value) { - addCriterion("setting_description like", value, "settingDescription"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionNotLike(String value) { - addCriterion("setting_description not like", value, "settingDescription"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionIn(List values) { - addCriterion("setting_description in", values, "settingDescription"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionNotIn(List values) { - addCriterion("setting_description not in", values, "settingDescription"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionBetween(String value1, String value2) { - addCriterion("setting_description between", value1, value2, "settingDescription"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionNotBetween(String value1, - String value2) { - addCriterion("setting_description not between", value1, value2, "settingDescription"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelIsNull() { - addCriterion("setting_label is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelIsNotNull() { - addCriterion("setting_label is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelEqualTo(String value) { - addCriterion("setting_label =", value, "settingLabel"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelNotEqualTo(String value) { - addCriterion("setting_label <>", value, "settingLabel"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelGreaterThan(String value) { - addCriterion("setting_label >", value, "settingLabel"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelGreaterThanOrEqualTo(String value) { - addCriterion("setting_label >=", value, "settingLabel"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelLessThan(String value) { - addCriterion("setting_label <", value, "settingLabel"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelLessThanOrEqualTo(String value) { - addCriterion("setting_label <=", value, "settingLabel"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelLike(String value) { - addCriterion("setting_label like", value, "settingLabel"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelNotLike(String value) { - addCriterion("setting_label not like", value, "settingLabel"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelIn(List values) { - addCriterion("setting_label in", values, "settingLabel"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelNotIn(List values) { - addCriterion("setting_label not in", values, "settingLabel"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelBetween(String value1, String value2) { - addCriterion("setting_label between", value1, value2, "settingLabel"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelNotBetween(String value1, String value2) { - addCriterion("setting_label not between", value1, value2, "settingLabel"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromIsNull() { - addCriterion("inherited_from is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromIsNotNull() { - addCriterion("inherited_from is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromEqualTo(String value) { - addCriterion("inherited_from =", value, "inheritedFrom"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromNotEqualTo(String value) { - addCriterion("inherited_from <>", value, "inheritedFrom"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromGreaterThan(String value) { - addCriterion("inherited_from >", value, "inheritedFrom"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromGreaterThanOrEqualTo(String value) { - addCriterion("inherited_from >=", value, "inheritedFrom"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromLessThan(String value) { - addCriterion("inherited_from <", value, "inheritedFrom"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromLessThanOrEqualTo(String value) { - addCriterion("inherited_from <=", value, "inheritedFrom"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromLike(String value) { - addCriterion("inherited_from like", value, "inheritedFrom"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromNotLike(String value) { - addCriterion("inherited_from not like", value, "inheritedFrom"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromIn(List values) { - addCriterion("inherited_from in", values, "inheritedFrom"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromNotIn(List values) { - addCriterion("inherited_from not in", values, "inheritedFrom"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromBetween(String value1, String value2) { - addCriterion("inherited_from between", value1, value2, "inheritedFrom"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromNotBetween(String value1, String value2) { - addCriterion("inherited_from not between", value1, value2, "inheritedFrom"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionIsNull() { - addCriterion("metadata_version is null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionIsNotNull() { - addCriterion("metadata_version is not null"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionEqualTo(Long value) { - addCriterion("metadata_version =", value, "metadataVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionNotEqualTo(Long value) { - addCriterion("metadata_version <>", value, "metadataVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionGreaterThan(Long value) { - addCriterion("metadata_version >", value, "metadataVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionGreaterThanOrEqualTo(Long value) { - addCriterion("metadata_version >=", value, "metadataVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionLessThan(Long value) { - addCriterion("metadata_version <", value, "metadataVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionLessThanOrEqualTo(Long value) { - addCriterion("metadata_version <=", value, "metadataVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionIn(List values) { - addCriterion("metadata_version in", values, "metadataVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionNotIn(List values) { - addCriterion("metadata_version not in", values, "metadataVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionBetween(Long value1, Long value2) { - addCriterion("metadata_version between", value1, value2, "metadataVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionNotBetween(Long value1, Long value2) { - addCriterion("metadata_version not between", value1, value2, "metadataVersion"); - return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; - } - - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table core.settings_metadata - * - * @mbg.generated do_not_delete_during_merge Fri Apr 24 10:25:50 EAT 2020 - */ - public static class Criteria extends SettingsMetadataExampleGeneratedCriteria.GeneratedCriteria { - - protected Criteria() { - super(); - } - } + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table core.settings_metadata + * + * @mbg.generated Fri Apr 24 10:25:50 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + try { + throw new IllegalArgumentException("Value for condition cannot be null"); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } + } + criteria.add(new SettingsMetadataExample.Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + try { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } + } + criteria.add(new SettingsMetadataExample.Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + try { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } + } + criteria.add(new SettingsMetadataExample.Criterion(condition, value1, value2)); + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdIsNull() { + addCriterion("id is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdIsNull() { + addCriterion("settings_id is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdIsNotNull() { + addCriterion("settings_id is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdEqualTo(Long value) { + addCriterion("settings_id =", value, "settingsId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdNotEqualTo(Long value) { + addCriterion("settings_id <>", value, "settingsId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdGreaterThan(Long value) { + addCriterion("settings_id >", value, "settingsId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdGreaterThanOrEqualTo(Long value) { + addCriterion("settings_id >=", value, "settingsId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdLessThan(Long value) { + addCriterion("settings_id <", value, "settingsId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdLessThanOrEqualTo(Long value) { + addCriterion("settings_id <=", value, "settingsId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdIn(List values) { + addCriterion("settings_id in", values, "settingsId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdNotIn(List values) { + addCriterion("settings_id not in", values, "settingsId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdBetween(Long value1, Long value2) { + addCriterion("settings_id between", value1, value2, "settingsId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingsIdNotBetween(Long value1, Long value2) { + addCriterion("settings_id not between", value1, value2, "settingsId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdIsNull() { + addCriterion("document_id is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdIsNotNull() { + addCriterion("document_id is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdEqualTo(String value) { + addCriterion("document_id =", value, "documentId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdNotEqualTo(String value) { + addCriterion("document_id <>", value, "documentId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdGreaterThan(String value) { + addCriterion("document_id >", value, "documentId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdGreaterThanOrEqualTo(String value) { + addCriterion("document_id >=", value, "documentId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdLessThan(String value) { + addCriterion("document_id <", value, "documentId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdLessThanOrEqualTo(String value) { + addCriterion("document_id <=", value, "documentId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdLike(String value) { + addCriterion("document_id like", value, "documentId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdNotLike(String value) { + addCriterion("document_id not like", value, "documentId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdIn(List values) { + addCriterion("document_id in", values, "documentId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdNotIn(List values) { + addCriterion("document_id not in", values, "documentId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdBetween(String value1, String value2) { + addCriterion("document_id between", value1, value2, "documentId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andDocumentIdNotBetween(String value1, String value2) { + addCriterion("document_id not between", value1, value2, "documentId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierIsNull() { + addCriterion("identifier is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierIsNotNull() { + addCriterion("identifier is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierEqualTo(String value) { + addCriterion("identifier =", value, "identifier"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierNotEqualTo(String value) { + addCriterion("identifier <>", value, "identifier"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierGreaterThan(String value) { + addCriterion("identifier >", value, "identifier"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierGreaterThanOrEqualTo(String value) { + addCriterion("identifier >=", value, "identifier"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierLessThan(String value) { + addCriterion("identifier <", value, "identifier"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierLessThanOrEqualTo(String value) { + addCriterion("identifier <=", value, "identifier"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierLike(String value) { + addCriterion("identifier like", value, "identifier"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierNotLike(String value) { + addCriterion("identifier not like", value, "identifier"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierIn(List values) { + addCriterion("identifier in", values, "identifier"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierNotIn(List values) { + addCriterion("identifier not in", values, "identifier"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierBetween(String value1, String value2) { + addCriterion("identifier between", value1, value2, "identifier"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andIdentifierNotBetween(String value1, String value2) { + addCriterion("identifier not between", value1, value2, "identifier"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIsNull() { + addCriterion("team is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIsNotNull() { + addCriterion("team is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamEqualTo(String value) { + addCriterion("team =", value, "team"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamNotEqualTo(String value) { + addCriterion("team <>", value, "team"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamGreaterThan(String value) { + addCriterion("team >", value, "team"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamGreaterThanOrEqualTo(String value) { + addCriterion("team >=", value, "team"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamLessThan(String value) { + addCriterion("team <", value, "team"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamLessThanOrEqualTo(String value) { + addCriterion("team <=", value, "team"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamLike(String value) { + addCriterion("team like", value, "team"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamNotLike(String value) { + addCriterion("team not like", value, "team"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIn(List values) { + addCriterion("team in", values, "team"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamNotIn(List values) { + addCriterion("team not in", values, "team"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamBetween(String value1, String value2) { + addCriterion("team between", value1, value2, "team"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamNotBetween(String value1, String value2) { + addCriterion("team not between", value1, value2, "team"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdIsNull() { + addCriterion("team_id is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdIsNotNull() { + addCriterion("team_id is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdEqualTo(String value) { + addCriterion("team_id =", value, "teamId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdNotEqualTo(String value) { + addCriterion("team_id <>", value, "teamId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdGreaterThan(String value) { + addCriterion("team_id >", value, "teamId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdGreaterThanOrEqualTo(String value) { + addCriterion("team_id >=", value, "teamId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdLessThan(String value) { + addCriterion("team_id <", value, "teamId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdLessThanOrEqualTo(String value) { + addCriterion("team_id <=", value, "teamId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdLike(String value) { + addCriterion("team_id like", value, "teamId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdNotLike(String value) { + addCriterion("team_id not like", value, "teamId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdIn(List values) { + addCriterion("team_id in", values, "teamId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdNotIn(List values) { + addCriterion("team_id not in", values, "teamId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdBetween(String value1, String value2) { + addCriterion("team_id between", value1, value2, "teamId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andTeamIdNotBetween(String value1, String value2) { + addCriterion("team_id not between", value1, value2, "teamId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdIsNull() { + addCriterion("provider_id is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdIsNotNull() { + addCriterion("provider_id is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdEqualTo(String value) { + addCriterion("provider_id =", value, "providerId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdNotEqualTo(String value) { + addCriterion("provider_id <>", value, "providerId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdGreaterThan(String value) { + addCriterion("provider_id >", value, "providerId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdGreaterThanOrEqualTo(String value) { + addCriterion("provider_id >=", value, "providerId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdLessThan(String value) { + addCriterion("provider_id <", value, "providerId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdLessThanOrEqualTo(String value) { + addCriterion("provider_id <=", value, "providerId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdLike(String value) { + addCriterion("provider_id like", value, "providerId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdNotLike(String value) { + addCriterion("provider_id not like", value, "providerId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdIn(List values) { + addCriterion("provider_id in", values, "providerId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdNotIn(List values) { + addCriterion("provider_id not in", values, "providerId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdBetween(String value1, String value2) { + addCriterion("provider_id between", value1, value2, "providerId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andProviderIdNotBetween(String value1, String value2) { + addCriterion("provider_id not between", value1, value2, "providerId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdIsNull() { + addCriterion("location_id is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdIsNotNull() { + addCriterion("location_id is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdEqualTo(String value) { + addCriterion("location_id =", value, "locationId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdNotEqualTo(String value) { + addCriterion("location_id <>", value, "locationId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdGreaterThan(String value) { + addCriterion("location_id >", value, "locationId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdGreaterThanOrEqualTo(String value) { + addCriterion("location_id >=", value, "locationId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdLessThan(String value) { + addCriterion("location_id <", value, "locationId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdLessThanOrEqualTo(String value) { + addCriterion("location_id <=", value, "locationId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdLike(String value) { + addCriterion("location_id like", value, "locationId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdNotLike(String value) { + addCriterion("location_id not like", value, "locationId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdIn(List values) { + addCriterion("location_id in", values, "locationId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdNotIn(List values) { + addCriterion("location_id not in", values, "locationId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdBetween(String value1, String value2) { + addCriterion("location_id between", value1, value2, "locationId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andLocationIdNotBetween(String value1, String value2) { + addCriterion("location_id not between", value1, value2, "locationId"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidIsNull() { + addCriterion("uuid is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidIsNotNull() { + addCriterion("uuid is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidEqualTo(String value) { + addCriterion("uuid =", value, "uuid"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidNotEqualTo(String value) { + addCriterion("uuid <>", value, "uuid"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidGreaterThan(String value) { + addCriterion("uuid >", value, "uuid"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidGreaterThanOrEqualTo(String value) { + addCriterion("uuid >=", value, "uuid"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidLessThan(String value) { + addCriterion("uuid <", value, "uuid"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidLessThanOrEqualTo(String value) { + addCriterion("uuid <=", value, "uuid"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidLike(String value) { + addCriterion("uuid like", value, "uuid"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidNotLike(String value) { + addCriterion("uuid not like", value, "uuid"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidIn(List values) { + addCriterion("uuid in", values, "uuid"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidNotIn(List values) { + addCriterion("uuid not in", values, "uuid"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidBetween(String value1, String value2) { + addCriterion("uuid between", value1, value2, "uuid"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andUuidNotBetween(String value1, String value2) { + addCriterion("uuid not between", value1, value2, "uuid"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonIsNull() { + addCriterion("json is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonEqualTo(Object value) { + addCriterion("json =", value, "json"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonNotEqualTo(Object value) { + addCriterion("json <>", value, "json"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonGreaterThan(Object value) { + addCriterion("json >", value, "json"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonGreaterThanOrEqualTo(Object value) { + addCriterion("json >=", value, "json"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonLessThan(Object value) { + addCriterion("json <", value, "json"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonLessThanOrEqualTo(Object value) { + addCriterion("json <=", value, "json"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonIn(List values) { + addCriterion("json in", values, "json"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonNotIn(List values) { + addCriterion("json not in", values, "json"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonBetween(Object value1, Object value2) { + addCriterion("json between", value1, value2, "json"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andJsonNotBetween(Object value1, Object value2) { + addCriterion("json not between", value1, value2, "json"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeIsNull() { + addCriterion("setting_type is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeIsNotNull() { + addCriterion("setting_type is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeEqualTo(String value) { + addCriterion("setting_type =", value, "settingType"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeNotEqualTo(String value) { + addCriterion("setting_type <>", value, "settingType"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeGreaterThan(String value) { + addCriterion("setting_type >", value, "settingType"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeGreaterThanOrEqualTo(String value) { + addCriterion("setting_type >=", value, "settingType"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeLessThan(String value) { + addCriterion("setting_type <", value, "settingType"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeLessThanOrEqualTo(String value) { + addCriterion("setting_type <=", value, "settingType"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeLike(String value) { + addCriterion("setting_type like", value, "settingType"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeNotLike(String value) { + addCriterion("setting_type not like", value, "settingType"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeIn(List values) { + addCriterion("setting_type in", values, "settingType"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeNotIn(List values) { + addCriterion("setting_type not in", values, "settingType"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeBetween(String value1, String value2) { + addCriterion("setting_type between", value1, value2, "settingType"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingTypeNotBetween(String value1, String value2) { + addCriterion("setting_type not between", value1, value2, "settingType"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueIsNull() { + addCriterion("setting_value is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueIsNotNull() { + addCriterion("setting_value is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueEqualTo(String value) { + addCriterion("setting_value =", value, "settingValue"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueNotEqualTo(String value) { + addCriterion("setting_value <>", value, "settingValue"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueGreaterThan(String value) { + addCriterion("setting_value >", value, "settingValue"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueGreaterThanOrEqualTo(String value) { + addCriterion("setting_value >=", value, "settingValue"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueLessThan(String value) { + addCriterion("setting_value <", value, "settingValue"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueLessThanOrEqualTo(String value) { + addCriterion("setting_value <=", value, "settingValue"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueLike(String value) { + addCriterion("setting_value like", value, "settingValue"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueNotLike(String value) { + addCriterion("setting_value not like", value, "settingValue"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueIn(List values) { + addCriterion("setting_value in", values, "settingValue"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueNotIn(List values) { + addCriterion("setting_value not in", values, "settingValue"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueBetween(String value1, String value2) { + addCriterion("setting_value between", value1, value2, "settingValue"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingValueNotBetween(String value1, String value2) { + addCriterion("setting_value not between", value1, value2, "settingValue"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyIsNull() { + addCriterion("setting_key is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyIsNotNull() { + addCriterion("setting_key is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyEqualTo(String value) { + addCriterion("setting_key =", value, "settingKey"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyNotEqualTo(String value) { + addCriterion("setting_key <>", value, "settingKey"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyGreaterThan(String value) { + addCriterion("setting_key >", value, "settingKey"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyGreaterThanOrEqualTo(String value) { + addCriterion("setting_key >=", value, "settingKey"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyLessThan(String value) { + addCriterion("setting_key <", value, "settingKey"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyLessThanOrEqualTo(String value) { + addCriterion("setting_key <=", value, "settingKey"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyLike(String value) { + addCriterion("setting_key like", value, "settingKey"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyNotLike(String value) { + addCriterion("setting_key not like", value, "settingKey"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyIn(List values) { + addCriterion("setting_key in", values, "settingKey"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyNotIn(List values) { + addCriterion("setting_key not in", values, "settingKey"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyBetween(String value1, String value2) { + addCriterion("setting_key between", value1, value2, "settingKey"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingKeyNotBetween(String value1, String value2) { + addCriterion("setting_key not between", value1, value2, "settingKey"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionIsNull() { + addCriterion("setting_description is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionIsNotNull() { + addCriterion("setting_description is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionEqualTo(String value) { + addCriterion("setting_description =", value, "settingDescription"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionNotEqualTo(String value) { + addCriterion("setting_description <>", value, "settingDescription"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionGreaterThan(String value) { + addCriterion("setting_description >", value, "settingDescription"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("setting_description >=", value, "settingDescription"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionLessThan(String value) { + addCriterion("setting_description <", value, "settingDescription"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionLessThanOrEqualTo(String value) { + addCriterion("setting_description <=", value, "settingDescription"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionLike(String value) { + addCriterion("setting_description like", value, "settingDescription"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionNotLike(String value) { + addCriterion("setting_description not like", value, "settingDescription"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionIn(List values) { + addCriterion("setting_description in", values, "settingDescription"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionNotIn(List values) { + addCriterion("setting_description not in", values, "settingDescription"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionBetween(String value1, String value2) { + addCriterion("setting_description between", value1, value2, "settingDescription"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andSettingDescriptionNotBetween(String value1, + String value2) { + addCriterion("setting_description not between", value1, value2, "settingDescription"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelIsNull() { + addCriterion("setting_label is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelIsNotNull() { + addCriterion("setting_label is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelEqualTo(String value) { + addCriterion("setting_label =", value, "settingLabel"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelNotEqualTo(String value) { + addCriterion("setting_label <>", value, "settingLabel"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelGreaterThan(String value) { + addCriterion("setting_label >", value, "settingLabel"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelGreaterThanOrEqualTo(String value) { + addCriterion("setting_label >=", value, "settingLabel"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelLessThan(String value) { + addCriterion("setting_label <", value, "settingLabel"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelLessThanOrEqualTo(String value) { + addCriterion("setting_label <=", value, "settingLabel"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelLike(String value) { + addCriterion("setting_label like", value, "settingLabel"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelNotLike(String value) { + addCriterion("setting_label not like", value, "settingLabel"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelIn(List values) { + addCriterion("setting_label in", values, "settingLabel"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelNotIn(List values) { + addCriterion("setting_label not in", values, "settingLabel"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelBetween(String value1, String value2) { + addCriterion("setting_label between", value1, value2, "settingLabel"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andsettingLabelNotBetween(String value1, String value2) { + addCriterion("setting_label not between", value1, value2, "settingLabel"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromIsNull() { + addCriterion("inherited_from is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromIsNotNull() { + addCriterion("inherited_from is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromEqualTo(String value) { + addCriterion("inherited_from =", value, "inheritedFrom"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromNotEqualTo(String value) { + addCriterion("inherited_from <>", value, "inheritedFrom"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromGreaterThan(String value) { + addCriterion("inherited_from >", value, "inheritedFrom"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromGreaterThanOrEqualTo(String value) { + addCriterion("inherited_from >=", value, "inheritedFrom"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromLessThan(String value) { + addCriterion("inherited_from <", value, "inheritedFrom"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromLessThanOrEqualTo(String value) { + addCriterion("inherited_from <=", value, "inheritedFrom"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromLike(String value) { + addCriterion("inherited_from like", value, "inheritedFrom"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromNotLike(String value) { + addCriterion("inherited_from not like", value, "inheritedFrom"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromIn(List values) { + addCriterion("inherited_from in", values, "inheritedFrom"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromNotIn(List values) { + addCriterion("inherited_from not in", values, "inheritedFrom"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromBetween(String value1, String value2) { + addCriterion("inherited_from between", value1, value2, "inheritedFrom"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andInheritedFromNotBetween(String value1, String value2) { + addCriterion("inherited_from not between", value1, value2, "inheritedFrom"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionIsNull() { + addCriterion("metadata_version is null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionIsNotNull() { + addCriterion("metadata_version is not null"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionEqualTo(Long value) { + addCriterion("metadata_version =", value, "metadataVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionNotEqualTo(Long value) { + addCriterion("metadata_version <>", value, "metadataVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionGreaterThan(Long value) { + addCriterion("metadata_version >", value, "metadataVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionGreaterThanOrEqualTo(Long value) { + addCriterion("metadata_version >=", value, "metadataVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionLessThan(Long value) { + addCriterion("metadata_version <", value, "metadataVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionLessThanOrEqualTo(Long value) { + addCriterion("metadata_version <=", value, "metadataVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionIn(List values) { + addCriterion("metadata_version in", values, "metadataVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionNotIn(List values) { + addCriterion("metadata_version not in", values, "metadataVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionBetween(Long value1, Long value2) { + addCriterion("metadata_version between", value1, value2, "metadataVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + public SettingsMetadataExampleGeneratedCriteria.Criteria andMetadataVersionNotBetween(Long value1, Long value2) { + addCriterion("metadata_version not between", value1, value2, "metadataVersion"); + return (SettingsMetadataExampleGeneratedCriteria.Criteria) this; + } + + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table core.settings_metadata + * + * @mbg.generated do_not_delete_during_merge Fri Apr 24 10:25:50 EAT 2020 + */ + public static class Criteria extends SettingsMetadataExampleGeneratedCriteria.GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/Stock.java b/src/main/java/org/opensrp/domain/postgres/Stock.java index cb3ab691e..9354e9725 100644 --- a/src/main/java/org/opensrp/domain/postgres/Stock.java +++ b/src/main/java/org/opensrp/domain/postgres/Stock.java @@ -4,96 +4,108 @@ public class Stock { - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.stock.id - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - private Long id; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.stock.json - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - private Object json; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.stock.date_deleted - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - private Date dateDeleted; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.stock.server_version - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - private Long serverVersion; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.stock.id + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + private Long id; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.stock.json + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + private Object json; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.stock.date_deleted + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + private Date dateDeleted; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.stock.server_version + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + private Long serverVersion; - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.stock.id - * @return the value of core.stock.id - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public Long getId() { - return id; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.stock.id + * + * @return the value of core.stock.id + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public Long getId() { + return id; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.stock.id - * @param id the value for core.stock.id - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public void setId(Long id) { - this.id = id; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.stock.id + * + * @param id the value for core.stock.id + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public void setId(Long id) { + this.id = id; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.stock.json - * @return the value of core.stock.json - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public Object getJson() { - return json; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.stock.json + * + * @return the value of core.stock.json + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public Object getJson() { + return json; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.stock.json - * @param json the value for core.stock.json - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public void setJson(Object json) { - this.json = json; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.stock.json + * + * @param json the value for core.stock.json + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public void setJson(Object json) { + this.json = json; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.stock.date_deleted - * @return the value of core.stock.date_deleted - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public Date getDateDeleted() { - return dateDeleted; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.stock.date_deleted + * + * @return the value of core.stock.date_deleted + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public Date getDateDeleted() { + return dateDeleted; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.stock.date_deleted - * @param dateDeleted the value for core.stock.date_deleted - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public void setDateDeleted(Date dateDeleted) { - this.dateDeleted = dateDeleted; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.stock.date_deleted + * + * @param dateDeleted the value for core.stock.date_deleted + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public void setDateDeleted(Date dateDeleted) { + this.dateDeleted = dateDeleted; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.stock.server_version - * @return the value of core.stock.server_version - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public Long getServerVersion() { - return serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.stock.server_version + * + * @return the value of core.stock.server_version + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public Long getServerVersion() { + return serverVersion; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.stock.server_version - * @param serverVersion the value for core.stock.server_version - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.stock.server_version + * + * @param serverVersion the value for core.stock.server_version + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/StockExample.java b/src/main/java/org/opensrp/domain/postgres/StockExample.java index c4617098f..c9e6695ba 100644 --- a/src/main/java/org/opensrp/domain/postgres/StockExample.java +++ b/src/main/java/org/opensrp/domain/postgres/StockExample.java @@ -5,542 +5,558 @@ import java.util.Date; public class StockExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - protected String orderByClause; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - protected boolean distinct; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public StockExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - protected abstract static class GeneratedCriteria { - - protected List jsonCriteria; - - protected List allCriteria; - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - jsonCriteria = new ArrayList<>(); - } - - public List getJsonCriteria() { - return jsonCriteria; - } - - protected void addJsonCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.StockTypeHandler")); - allCriteria = null; - } - - protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - jsonCriteria.add( - new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.StockTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || jsonCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList<>(); - allCriteria.addAll(criteria); - allCriteria.addAll(jsonCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - allCriteria = null; - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andJsonIsNull() { - addCriterion("json is null"); - return (Criteria) this; - } - - public Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (Criteria) this; - } - - public Criteria andJsonEqualTo(Object value) { - addJsonCriterion("json =", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotEqualTo(Object value) { - addJsonCriterion("json <>", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThan(Object value) { - addJsonCriterion("json >", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThanOrEqualTo(Object value) { - addJsonCriterion("json >=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThan(Object value) { - addJsonCriterion("json <", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThanOrEqualTo(Object value) { - addJsonCriterion("json <=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonIn(List values) { - addJsonCriterion("json in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotIn(List values) { - addJsonCriterion("json not in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonBetween(Object value1, Object value2) { - addJsonCriterion("json between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotBetween(Object value1, Object value2) { - addJsonCriterion("json not between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNull() { - addCriterion("date_deleted is null"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNotNull() { - addCriterion("date_deleted is not null"); - return (Criteria) this; - } - - public Criteria andDateDeletedEqualTo(Date value) { - addCriterion("date_deleted =", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotEqualTo(Date value) { - addCriterion("date_deleted <>", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThan(Date value) { - addCriterion("date_deleted >", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { - addCriterion("date_deleted >=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThan(Date value) { - addCriterion("date_deleted <", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThanOrEqualTo(Date value) { - addCriterion("date_deleted <=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedIn(List values) { - addCriterion("date_deleted in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotIn(List values) { - addCriterion("date_deleted not in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedBetween(Date value1, Date value2) { - addCriterion("date_deleted between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotBetween(Date value1, Date value2) { - addCriterion("date_deleted not between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.stock - * - * @mbg.generated do_not_delete_during_merge Wed Mar 07 18:26:22 EAT 2018 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + protected String orderByClause; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + protected boolean distinct; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public StockExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + protected abstract static class GeneratedCriteria { + + protected List jsonCriteria; + + protected List allCriteria; + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + jsonCriteria = new ArrayList<>(); + } + + public List getJsonCriteria() { + return jsonCriteria; + } + + protected void addJsonCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.StockTypeHandler")); + allCriteria = null; + } + + protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + jsonCriteria.add( + new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.StockTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || jsonCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList<>(); + allCriteria.addAll(criteria); + allCriteria.addAll(jsonCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andJsonIsNull() { + addCriterion("json is null"); + return (Criteria) this; + } + + public Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (Criteria) this; + } + + public Criteria andJsonEqualTo(Object value) { + addJsonCriterion("json =", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotEqualTo(Object value) { + addJsonCriterion("json <>", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThan(Object value) { + addJsonCriterion("json >", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThanOrEqualTo(Object value) { + addJsonCriterion("json >=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThan(Object value) { + addJsonCriterion("json <", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThanOrEqualTo(Object value) { + addJsonCriterion("json <=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonIn(List values) { + addJsonCriterion("json in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotIn(List values) { + addJsonCriterion("json not in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonBetween(Object value1, Object value2) { + addJsonCriterion("json between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotBetween(Object value1, Object value2) { + addJsonCriterion("json not between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNull() { + addCriterion("date_deleted is null"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNotNull() { + addCriterion("date_deleted is not null"); + return (Criteria) this; + } + + public Criteria andDateDeletedEqualTo(Date value) { + addCriterion("date_deleted =", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotEqualTo(Date value) { + addCriterion("date_deleted <>", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThan(Date value) { + addCriterion("date_deleted >", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { + addCriterion("date_deleted >=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThan(Date value) { + addCriterion("date_deleted <", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThanOrEqualTo(Date value) { + addCriterion("date_deleted <=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedIn(List values) { + addCriterion("date_deleted in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotIn(List values) { + addCriterion("date_deleted not in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedBetween(Date value1, Date value2) { + addCriterion("date_deleted between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotBetween(Date value1, Date value2) { + addCriterion("date_deleted not between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.stock + * + * @mbg.generated do_not_delete_during_merge Wed Mar 07 18:26:22 EAT 2018 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/StockMetadata.java b/src/main/java/org/opensrp/domain/postgres/StockMetadata.java index f7bdd8650..1cce2ec4f 100644 --- a/src/main/java/org/opensrp/domain/postgres/StockMetadata.java +++ b/src/main/java/org/opensrp/domain/postgres/StockMetadata.java @@ -3,267 +3,270 @@ import java.util.Date; public class StockMetadata { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.stock_metadata.id - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.stock_metadata.stock_id - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - private Long stockId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.stock_metadata.document_id - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - private String documentId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.stock_metadata.server_version - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - private Long serverVersion; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.stock_metadata.provider_id - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - private String providerId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.stock_metadata.location_id - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - private String locationId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.stock_metadata.team - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - private String team; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.stock_metadata.team_id - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - private String teamId; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.stock_metadata.date_deleted - * @mbg.generated Wed Oct 07 14:13:33 PKT 2020 - */ - private Date dateDeleted; - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.stock_metadata.id - * - * @return the value of core.stock_metadata.id - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.stock_metadata.id - * - * @param id the value for core.stock_metadata.id - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.stock_metadata.stock_id - * - * @return the value of core.stock_metadata.stock_id - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public Long getStockId() { - return stockId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.stock_metadata.stock_id - * - * @param stockId the value for core.stock_metadata.stock_id - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public void setStockId(Long stockId) { - this.stockId = stockId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.stock_metadata.document_id - * - * @return the value of core.stock_metadata.document_id - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public String getDocumentId() { - return documentId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.stock_metadata.document_id - * - * @param documentId the value for core.stock_metadata.document_id - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public void setDocumentId(String documentId) { - this.documentId = documentId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.stock_metadata.server_version - * - * @return the value of core.stock_metadata.server_version - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public Long getServerVersion() { - return serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.stock_metadata.server_version - * - * @param serverVersion the value for core.stock_metadata.server_version - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.stock_metadata.provider_id - * - * @return the value of core.stock_metadata.provider_id - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public String getProviderId() { - return providerId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.stock_metadata.provider_id - * - * @param providerId the value for core.stock_metadata.provider_id - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.stock_metadata.location_id - * - * @return the value of core.stock_metadata.location_id - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public String getLocationId() { - return locationId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.stock_metadata.location_id - * - * @param locationId the value for core.stock_metadata.location_id - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public void setLocationId(String locationId) { - this.locationId = locationId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.stock_metadata.team - * - * @return the value of core.stock_metadata.team - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public String getTeam() { - return team; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.stock_metadata.team - * - * @param team the value for core.stock_metadata.team - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public void setTeam(String team) { - this.team = team; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.stock_metadata.team_id - * - * @return the value of core.stock_metadata.team_id - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public String getTeamId() { - return teamId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.stock_metadata.team_id - * - * @param teamId the value for core.stock_metadata.team_id - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public void setTeamId(String teamId) { - this.teamId = teamId; - } + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.stock_metadata.id + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + private Long id; - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.stock_metadata.date_deleted - * @return the value of core.stock_metadata.date_deleted - * @mbg.generated Wed Oct 07 14:13:33 PKT 2020 - */ - public Date getDateDeleted() { - return dateDeleted; - } + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.stock_metadata.stock_id + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + private Long stockId; - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.stock_metadata.date_deleted - * @param dateDeleted the value for core.stock_metadata.date_deleted - * @mbg.generated Wed Oct 07 14:13:33 PKT 2020 - */ - public void setDateDeleted(Date dateDeleted) { - this.dateDeleted = dateDeleted; - } + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.stock_metadata.document_id + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + private String documentId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.stock_metadata.server_version + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + private Long serverVersion; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.stock_metadata.provider_id + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + private String providerId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.stock_metadata.location_id + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + private String locationId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.stock_metadata.team + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + private String team; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.stock_metadata.team_id + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + private String teamId; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.stock_metadata.date_deleted + * + * @mbg.generated Wed Oct 07 14:13:33 PKT 2020 + */ + private Date dateDeleted; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.stock_metadata.id + * + * @return the value of core.stock_metadata.id + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.stock_metadata.id + * + * @param id the value for core.stock_metadata.id + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.stock_metadata.stock_id + * + * @return the value of core.stock_metadata.stock_id + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public Long getStockId() { + return stockId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.stock_metadata.stock_id + * + * @param stockId the value for core.stock_metadata.stock_id + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public void setStockId(Long stockId) { + this.stockId = stockId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.stock_metadata.document_id + * + * @return the value of core.stock_metadata.document_id + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public String getDocumentId() { + return documentId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.stock_metadata.document_id + * + * @param documentId the value for core.stock_metadata.document_id + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public void setDocumentId(String documentId) { + this.documentId = documentId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.stock_metadata.server_version + * + * @return the value of core.stock_metadata.server_version + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public Long getServerVersion() { + return serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.stock_metadata.server_version + * + * @param serverVersion the value for core.stock_metadata.server_version + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.stock_metadata.provider_id + * + * @return the value of core.stock_metadata.provider_id + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public String getProviderId() { + return providerId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.stock_metadata.provider_id + * + * @param providerId the value for core.stock_metadata.provider_id + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.stock_metadata.location_id + * + * @return the value of core.stock_metadata.location_id + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public String getLocationId() { + return locationId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.stock_metadata.location_id + * + * @param locationId the value for core.stock_metadata.location_id + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public void setLocationId(String locationId) { + this.locationId = locationId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.stock_metadata.team + * + * @return the value of core.stock_metadata.team + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public String getTeam() { + return team; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.stock_metadata.team + * + * @param team the value for core.stock_metadata.team + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public void setTeam(String team) { + this.team = team; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.stock_metadata.team_id + * + * @return the value of core.stock_metadata.team_id + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public String getTeamId() { + return teamId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.stock_metadata.team_id + * + * @param teamId the value for core.stock_metadata.team_id + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public void setTeamId(String teamId) { + this.teamId = teamId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.stock_metadata.date_deleted + * + * @return the value of core.stock_metadata.date_deleted + * @mbg.generated Wed Oct 07 14:13:33 PKT 2020 + */ + public Date getDateDeleted() { + return dateDeleted; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.stock_metadata.date_deleted + * + * @param dateDeleted the value for core.stock_metadata.date_deleted + * @mbg.generated Wed Oct 07 14:13:33 PKT 2020 + */ + public void setDateDeleted(Date dateDeleted) { + this.dateDeleted = dateDeleted; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/StockMetadataExample.java b/src/main/java/org/opensrp/domain/postgres/StockMetadataExample.java index 7a6b0cb4a..5fb3a9bda 100644 --- a/src/main/java/org/opensrp/domain/postgres/StockMetadataExample.java +++ b/src/main/java/org/opensrp/domain/postgres/StockMetadataExample.java @@ -5,892 +5,892 @@ import java.util.Date; public class StockMetadataExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public StockMetadataExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andStockIdIsNull() { - addCriterion("stock_id is null"); - return (Criteria) this; - } - - public Criteria andStockIdIsNotNull() { - addCriterion("stock_id is not null"); - return (Criteria) this; - } - - public Criteria andStockIdEqualTo(Long value) { - addCriterion("stock_id =", value, "stockId"); - return (Criteria) this; - } - - public Criteria andStockIdNotEqualTo(Long value) { - addCriterion("stock_id <>", value, "stockId"); - return (Criteria) this; - } - - public Criteria andStockIdGreaterThan(Long value) { - addCriterion("stock_id >", value, "stockId"); - return (Criteria) this; - } - - public Criteria andStockIdGreaterThanOrEqualTo(Long value) { - addCriterion("stock_id >=", value, "stockId"); - return (Criteria) this; - } - - public Criteria andStockIdLessThan(Long value) { - addCriterion("stock_id <", value, "stockId"); - return (Criteria) this; - } - - public Criteria andStockIdLessThanOrEqualTo(Long value) { - addCriterion("stock_id <=", value, "stockId"); - return (Criteria) this; - } - - public Criteria andStockIdIn(List values) { - addCriterion("stock_id in", values, "stockId"); - return (Criteria) this; - } - - public Criteria andStockIdNotIn(List values) { - addCriterion("stock_id not in", values, "stockId"); - return (Criteria) this; - } - - public Criteria andStockIdBetween(Long value1, Long value2) { - addCriterion("stock_id between", value1, value2, "stockId"); - return (Criteria) this; - } - - public Criteria andStockIdNotBetween(Long value1, Long value2) { - addCriterion("stock_id not between", value1, value2, "stockId"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNull() { - addCriterion("document_id is null"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNotNull() { - addCriterion("document_id is not null"); - return (Criteria) this; - } - - public Criteria andDocumentIdEqualTo(String value) { - addCriterion("document_id =", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotEqualTo(String value) { - addCriterion("document_id <>", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThan(String value) { - addCriterion("document_id >", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { - addCriterion("document_id >=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThan(String value) { - addCriterion("document_id <", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThanOrEqualTo(String value) { - addCriterion("document_id <=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLike(String value) { - addCriterion("document_id like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotLike(String value) { - addCriterion("document_id not like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdIn(List values) { - addCriterion("document_id in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotIn(List values) { - addCriterion("document_id not in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdBetween(String value1, String value2) { - addCriterion("document_id between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotBetween(String value1, String value2) { - addCriterion("document_id not between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andProviderIdIsNull() { - addCriterion("provider_id is null"); - return (Criteria) this; - } - - public Criteria andProviderIdIsNotNull() { - addCriterion("provider_id is not null"); - return (Criteria) this; - } - - public Criteria andProviderIdEqualTo(String value) { - addCriterion("provider_id =", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotEqualTo(String value) { - addCriterion("provider_id <>", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdGreaterThan(String value) { - addCriterion("provider_id >", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdGreaterThanOrEqualTo(String value) { - addCriterion("provider_id >=", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdLessThan(String value) { - addCriterion("provider_id <", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdLessThanOrEqualTo(String value) { - addCriterion("provider_id <=", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdLike(String value) { - addCriterion("provider_id like", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotLike(String value) { - addCriterion("provider_id not like", value, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdIn(List values) { - addCriterion("provider_id in", values, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotIn(List values) { - addCriterion("provider_id not in", values, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdBetween(String value1, String value2) { - addCriterion("provider_id between", value1, value2, "providerId"); - return (Criteria) this; - } - - public Criteria andProviderIdNotBetween(String value1, String value2) { - addCriterion("provider_id not between", value1, value2, "providerId"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNull() { - addCriterion("location_id is null"); - return (Criteria) this; - } - - public Criteria andLocationIdIsNotNull() { - addCriterion("location_id is not null"); - return (Criteria) this; - } - - public Criteria andLocationIdEqualTo(String value) { - addCriterion("location_id =", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotEqualTo(String value) { - addCriterion("location_id <>", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThan(String value) { - addCriterion("location_id >", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdGreaterThanOrEqualTo(String value) { - addCriterion("location_id >=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThan(String value) { - addCriterion("location_id <", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLessThanOrEqualTo(String value) { - addCriterion("location_id <=", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdLike(String value) { - addCriterion("location_id like", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotLike(String value) { - addCriterion("location_id not like", value, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdIn(List values) { - addCriterion("location_id in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotIn(List values) { - addCriterion("location_id not in", values, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdBetween(String value1, String value2) { - addCriterion("location_id between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andLocationIdNotBetween(String value1, String value2) { - addCriterion("location_id not between", value1, value2, "locationId"); - return (Criteria) this; - } - - public Criteria andTeamIsNull() { - addCriterion("team is null"); - return (Criteria) this; - } - - public Criteria andTeamIsNotNull() { - addCriterion("team is not null"); - return (Criteria) this; - } - - public Criteria andTeamEqualTo(String value) { - addCriterion("team =", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotEqualTo(String value) { - addCriterion("team <>", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamGreaterThan(String value) { - addCriterion("team >", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamGreaterThanOrEqualTo(String value) { - addCriterion("team >=", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamLessThan(String value) { - addCriterion("team <", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamLessThanOrEqualTo(String value) { - addCriterion("team <=", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamLike(String value) { - addCriterion("team like", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotLike(String value) { - addCriterion("team not like", value, "team"); - return (Criteria) this; - } - - public Criteria andTeamIn(List values) { - addCriterion("team in", values, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotIn(List values) { - addCriterion("team not in", values, "team"); - return (Criteria) this; - } - - public Criteria andTeamBetween(String value1, String value2) { - addCriterion("team between", value1, value2, "team"); - return (Criteria) this; - } - - public Criteria andTeamNotBetween(String value1, String value2) { - addCriterion("team not between", value1, value2, "team"); - return (Criteria) this; - } - - public Criteria andTeamIdIsNull() { - addCriterion("team_id is null"); - return (Criteria) this; - } - - public Criteria andTeamIdIsNotNull() { - addCriterion("team_id is not null"); - return (Criteria) this; - } - - public Criteria andTeamIdEqualTo(String value) { - addCriterion("team_id =", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotEqualTo(String value) { - addCriterion("team_id <>", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdGreaterThan(String value) { - addCriterion("team_id >", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdGreaterThanOrEqualTo(String value) { - addCriterion("team_id >=", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdLessThan(String value) { - addCriterion("team_id <", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdLessThanOrEqualTo(String value) { - addCriterion("team_id <=", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdLike(String value) { - addCriterion("team_id like", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotLike(String value) { - addCriterion("team_id not like", value, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdIn(List values) { - addCriterion("team_id in", values, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotIn(List values) { - addCriterion("team_id not in", values, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdBetween(String value1, String value2) { - addCriterion("team_id between", value1, value2, "teamId"); - return (Criteria) this; - } - - public Criteria andTeamIdNotBetween(String value1, String value2) { - addCriterion("team_id not between", value1, value2, "teamId"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNull() { - addCriterion("date_deleted is null"); - return (Criteria) this; - } - - public Criteria andDateDeletedIsNotNull() { - addCriterion("date_deleted is not null"); - return (Criteria) this; - } - - public Criteria andDateDeletedEqualTo(Date value) { - addCriterion("date_deleted =", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotEqualTo(Date value) { - addCriterion("date_deleted <>", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThan(Date value) { - addCriterion("date_deleted >", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { - addCriterion("date_deleted >=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThan(Date value) { - addCriterion("date_deleted <", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedLessThanOrEqualTo(Date value) { - addCriterion("date_deleted <=", value, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedIn(List values) { - addCriterion("date_deleted in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotIn(List values) { - addCriterion("date_deleted not in", values, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedBetween(Date value1, Date value2) { - addCriterion("date_deleted between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - - public Criteria andDateDeletedNotBetween(Date value1, Date value2) { - addCriterion("date_deleted not between", value1, value2, "dateDeleted"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.stock_metadata - * - * @mbg.generated do_not_delete_during_merge Wed Mar 07 18:26:22 EAT 2018 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public StockMetadataExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andStockIdIsNull() { + addCriterion("stock_id is null"); + return (Criteria) this; + } + + public Criteria andStockIdIsNotNull() { + addCriterion("stock_id is not null"); + return (Criteria) this; + } + + public Criteria andStockIdEqualTo(Long value) { + addCriterion("stock_id =", value, "stockId"); + return (Criteria) this; + } + + public Criteria andStockIdNotEqualTo(Long value) { + addCriterion("stock_id <>", value, "stockId"); + return (Criteria) this; + } + + public Criteria andStockIdGreaterThan(Long value) { + addCriterion("stock_id >", value, "stockId"); + return (Criteria) this; + } + + public Criteria andStockIdGreaterThanOrEqualTo(Long value) { + addCriterion("stock_id >=", value, "stockId"); + return (Criteria) this; + } + + public Criteria andStockIdLessThan(Long value) { + addCriterion("stock_id <", value, "stockId"); + return (Criteria) this; + } + + public Criteria andStockIdLessThanOrEqualTo(Long value) { + addCriterion("stock_id <=", value, "stockId"); + return (Criteria) this; + } + + public Criteria andStockIdIn(List values) { + addCriterion("stock_id in", values, "stockId"); + return (Criteria) this; + } + + public Criteria andStockIdNotIn(List values) { + addCriterion("stock_id not in", values, "stockId"); + return (Criteria) this; + } + + public Criteria andStockIdBetween(Long value1, Long value2) { + addCriterion("stock_id between", value1, value2, "stockId"); + return (Criteria) this; + } + + public Criteria andStockIdNotBetween(Long value1, Long value2) { + addCriterion("stock_id not between", value1, value2, "stockId"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNull() { + addCriterion("document_id is null"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNotNull() { + addCriterion("document_id is not null"); + return (Criteria) this; + } + + public Criteria andDocumentIdEqualTo(String value) { + addCriterion("document_id =", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotEqualTo(String value) { + addCriterion("document_id <>", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThan(String value) { + addCriterion("document_id >", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { + addCriterion("document_id >=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThan(String value) { + addCriterion("document_id <", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThanOrEqualTo(String value) { + addCriterion("document_id <=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLike(String value) { + addCriterion("document_id like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotLike(String value) { + addCriterion("document_id not like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdIn(List values) { + addCriterion("document_id in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotIn(List values) { + addCriterion("document_id not in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdBetween(String value1, String value2) { + addCriterion("document_id between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotBetween(String value1, String value2) { + addCriterion("document_id not between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andProviderIdIsNull() { + addCriterion("provider_id is null"); + return (Criteria) this; + } + + public Criteria andProviderIdIsNotNull() { + addCriterion("provider_id is not null"); + return (Criteria) this; + } + + public Criteria andProviderIdEqualTo(String value) { + addCriterion("provider_id =", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotEqualTo(String value) { + addCriterion("provider_id <>", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdGreaterThan(String value) { + addCriterion("provider_id >", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdGreaterThanOrEqualTo(String value) { + addCriterion("provider_id >=", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdLessThan(String value) { + addCriterion("provider_id <", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdLessThanOrEqualTo(String value) { + addCriterion("provider_id <=", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdLike(String value) { + addCriterion("provider_id like", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotLike(String value) { + addCriterion("provider_id not like", value, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdIn(List values) { + addCriterion("provider_id in", values, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotIn(List values) { + addCriterion("provider_id not in", values, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdBetween(String value1, String value2) { + addCriterion("provider_id between", value1, value2, "providerId"); + return (Criteria) this; + } + + public Criteria andProviderIdNotBetween(String value1, String value2) { + addCriterion("provider_id not between", value1, value2, "providerId"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNull() { + addCriterion("location_id is null"); + return (Criteria) this; + } + + public Criteria andLocationIdIsNotNull() { + addCriterion("location_id is not null"); + return (Criteria) this; + } + + public Criteria andLocationIdEqualTo(String value) { + addCriterion("location_id =", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotEqualTo(String value) { + addCriterion("location_id <>", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThan(String value) { + addCriterion("location_id >", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdGreaterThanOrEqualTo(String value) { + addCriterion("location_id >=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThan(String value) { + addCriterion("location_id <", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLessThanOrEqualTo(String value) { + addCriterion("location_id <=", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdLike(String value) { + addCriterion("location_id like", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotLike(String value) { + addCriterion("location_id not like", value, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdIn(List values) { + addCriterion("location_id in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotIn(List values) { + addCriterion("location_id not in", values, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdBetween(String value1, String value2) { + addCriterion("location_id between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andLocationIdNotBetween(String value1, String value2) { + addCriterion("location_id not between", value1, value2, "locationId"); + return (Criteria) this; + } + + public Criteria andTeamIsNull() { + addCriterion("team is null"); + return (Criteria) this; + } + + public Criteria andTeamIsNotNull() { + addCriterion("team is not null"); + return (Criteria) this; + } + + public Criteria andTeamEqualTo(String value) { + addCriterion("team =", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotEqualTo(String value) { + addCriterion("team <>", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamGreaterThan(String value) { + addCriterion("team >", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamGreaterThanOrEqualTo(String value) { + addCriterion("team >=", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLessThan(String value) { + addCriterion("team <", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLessThanOrEqualTo(String value) { + addCriterion("team <=", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLike(String value) { + addCriterion("team like", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotLike(String value) { + addCriterion("team not like", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamIn(List values) { + addCriterion("team in", values, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotIn(List values) { + addCriterion("team not in", values, "team"); + return (Criteria) this; + } + + public Criteria andTeamBetween(String value1, String value2) { + addCriterion("team between", value1, value2, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotBetween(String value1, String value2) { + addCriterion("team not between", value1, value2, "team"); + return (Criteria) this; + } + + public Criteria andTeamIdIsNull() { + addCriterion("team_id is null"); + return (Criteria) this; + } + + public Criteria andTeamIdIsNotNull() { + addCriterion("team_id is not null"); + return (Criteria) this; + } + + public Criteria andTeamIdEqualTo(String value) { + addCriterion("team_id =", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotEqualTo(String value) { + addCriterion("team_id <>", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdGreaterThan(String value) { + addCriterion("team_id >", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdGreaterThanOrEqualTo(String value) { + addCriterion("team_id >=", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLessThan(String value) { + addCriterion("team_id <", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLessThanOrEqualTo(String value) { + addCriterion("team_id <=", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLike(String value) { + addCriterion("team_id like", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotLike(String value) { + addCriterion("team_id not like", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdIn(List values) { + addCriterion("team_id in", values, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotIn(List values) { + addCriterion("team_id not in", values, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdBetween(String value1, String value2) { + addCriterion("team_id between", value1, value2, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotBetween(String value1, String value2) { + addCriterion("team_id not between", value1, value2, "teamId"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNull() { + addCriterion("date_deleted is null"); + return (Criteria) this; + } + + public Criteria andDateDeletedIsNotNull() { + addCriterion("date_deleted is not null"); + return (Criteria) this; + } + + public Criteria andDateDeletedEqualTo(Date value) { + addCriterion("date_deleted =", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotEqualTo(Date value) { + addCriterion("date_deleted <>", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThan(Date value) { + addCriterion("date_deleted >", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedGreaterThanOrEqualTo(Date value) { + addCriterion("date_deleted >=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThan(Date value) { + addCriterion("date_deleted <", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedLessThanOrEqualTo(Date value) { + addCriterion("date_deleted <=", value, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedIn(List values) { + addCriterion("date_deleted in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotIn(List values) { + addCriterion("date_deleted not in", values, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedBetween(Date value1, Date value2) { + addCriterion("date_deleted between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + + public Criteria andDateDeletedNotBetween(Date value1, Date value2) { + addCriterion("date_deleted not between", value1, value2, "dateDeleted"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.stock_metadata + * + * @mbg.generated do_not_delete_during_merge Wed Mar 07 18:26:22 EAT 2018 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/Structure.java b/src/main/java/org/opensrp/domain/postgres/Structure.java index cf679c8b2..21ba30f7e 100644 --- a/src/main/java/org/opensrp/domain/postgres/Structure.java +++ b/src/main/java/org/opensrp/domain/postgres/Structure.java @@ -2,73 +2,82 @@ public class Structure { - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.structure.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Long id; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.structure.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Object json; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.structure.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Long serverVersion; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.structure.id + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Long id; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.structure.json + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Object json; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.structure.server_version + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Long serverVersion; - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.structure.id - * @return the value of core.structure.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Long getId() { - return id; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.structure.id + * + * @return the value of core.structure.id + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Long getId() { + return id; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.structure.id - * @param id the value for core.structure.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.structure.id + * + * @param id the value for core.structure.id + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setId(Long id) { + this.id = id; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.structure.json - * @return the value of core.structure.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Object getJson() { - return json; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.structure.json + * + * @return the value of core.structure.json + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Object getJson() { + return json; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.structure.json - * @param json the value for core.structure.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setJson(Object json) { - this.json = json; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.structure.json + * + * @param json the value for core.structure.json + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setJson(Object json) { + this.json = json; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.structure.server_version - * @return the value of core.structure.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Long getServerVersion() { - return serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.structure.server_version + * + * @return the value of core.structure.server_version + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Long getServerVersion() { + return serverVersion; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.structure.server_version - * @param serverVersion the value for core.structure.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.structure.server_version + * + * @param serverVersion the value for core.structure.server_version + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } } \ No newline at end of file diff --git a/src/main/java/org/opensrp/domain/postgres/StructureExample.java b/src/main/java/org/opensrp/domain/postgres/StructureExample.java index 0da125dd0..1f46b4a9d 100644 --- a/src/main/java/org/opensrp/domain/postgres/StructureExample.java +++ b/src/main/java/org/opensrp/domain/postgres/StructureExample.java @@ -5,471 +5,487 @@ public class StructureExample { /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected String orderByClause; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected boolean distinct; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public StructureExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List jsonCriteria; - - protected List allCriteria; - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - jsonCriteria = new ArrayList<>(); - } - - public List getJsonCriteria() { - return jsonCriteria; - } - - protected void addJsonCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.LocationTypeHandler")); - allCriteria = null; - } - - protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - jsonCriteria.add( - new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.LocationTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || jsonCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList<>(); - allCriteria.addAll(criteria); - allCriteria.addAll(jsonCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - allCriteria = null; - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andJsonIsNull() { - addCriterion("json is null"); - return (Criteria) this; - } - - public Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (Criteria) this; - } - - public Criteria andJsonEqualTo(Object value) { - addJsonCriterion("json =", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotEqualTo(Object value) { - addJsonCriterion("json <>", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThan(Object value) { - addJsonCriterion("json >", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThanOrEqualTo(Object value) { - addJsonCriterion("json >=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThan(Object value) { - addJsonCriterion("json <", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThanOrEqualTo(Object value) { - addJsonCriterion("json <=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonIn(List values) { - addJsonCriterion("json in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotIn(List values) { - addJsonCriterion("json not in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonBetween(Object value1, Object value2) { - addJsonCriterion("json between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotBetween(Object value1, Object value2) { - addJsonCriterion("json not between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected String orderByClause; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected boolean distinct; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public StructureExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List jsonCriteria; + + protected List allCriteria; + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + jsonCriteria = new ArrayList<>(); + } + + public List getJsonCriteria() { + return jsonCriteria; + } + + protected void addJsonCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.LocationTypeHandler")); + allCriteria = null; + } + + protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + jsonCriteria.add( + new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.LocationTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || jsonCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList<>(); + allCriteria.addAll(criteria); + allCriteria.addAll(jsonCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andJsonIsNull() { + addCriterion("json is null"); + return (Criteria) this; + } + + public Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (Criteria) this; + } + + public Criteria andJsonEqualTo(Object value) { + addJsonCriterion("json =", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotEqualTo(Object value) { + addJsonCriterion("json <>", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThan(Object value) { + addJsonCriterion("json >", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThanOrEqualTo(Object value) { + addJsonCriterion("json >=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThan(Object value) { + addJsonCriterion("json <", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThanOrEqualTo(Object value) { + addJsonCriterion("json <=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonIn(List values) { + addJsonCriterion("json in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotIn(List values) { + addJsonCriterion("json not in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonBetween(Object value1, Object value2) { + addJsonCriterion("json between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotBetween(Object value1, Object value2) { + addJsonCriterion("json not between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** * This class was generated by MyBatis Generator. * This class corresponds to the database table core.structure * diff --git a/src/main/java/org/opensrp/domain/postgres/StructureFamilyDetails.java b/src/main/java/org/opensrp/domain/postgres/StructureFamilyDetails.java index 29eb7d66c..ddf1eca3e 100644 --- a/src/main/java/org/opensrp/domain/postgres/StructureFamilyDetails.java +++ b/src/main/java/org/opensrp/domain/postgres/StructureFamilyDetails.java @@ -2,64 +2,64 @@ public class StructureFamilyDetails { - private String id; + private String id; - private String parentId; + private String parentId; - private String type; + private String type; - private String baseEntityId; + private String baseEntityId; - private String relationalId; + private String relationalId; - private String lastName; + private String lastName; - public String getId() { - return id; - } + public String getId() { + return id; + } - public void setId(String id) { - this.id = id; - } + public void setId(String id) { + this.id = id; + } - public String getParentId() { - return parentId; - } + public String getParentId() { + return parentId; + } - public void setParentId(String parentId) { - this.parentId = parentId; - } + public void setParentId(String parentId) { + this.parentId = parentId; + } - public String getType() { - return type; - } + public String getType() { + return type; + } - public void setType(String type) { - this.type = type; - } + public void setType(String type) { + this.type = type; + } - public String getBaseEntityId() { - return baseEntityId; - } + public String getBaseEntityId() { + return baseEntityId; + } - public void setBaseEntityId(String baseEntityId) { - this.baseEntityId = baseEntityId; - } + public void setBaseEntityId(String baseEntityId) { + this.baseEntityId = baseEntityId; + } - public String getRelationalId() { - return relationalId; - } + public String getRelationalId() { + return relationalId; + } - public void setRelationalId(String relationalId) { - this.relationalId = relationalId; - } + public void setRelationalId(String relationalId) { + this.relationalId = relationalId; + } - public String getLastName() { - return lastName; - } + public String getLastName() { + return lastName; + } - public void setLastName(String lastName) { - this.lastName = lastName; - } + public void setLastName(String lastName) { + this.lastName = lastName; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/StructureMetadata.java b/src/main/java/org/opensrp/domain/postgres/StructureMetadata.java index 4b7a7e230..768039b23 100644 --- a/src/main/java/org/opensrp/domain/postgres/StructureMetadata.java +++ b/src/main/java/org/opensrp/domain/postgres/StructureMetadata.java @@ -3,334 +3,334 @@ import java.util.Date; public class StructureMetadata { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.structure_metadata.id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.structure_metadata.structure_id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Long structureId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.structure_metadata.geojson_id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String geojsonId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.structure_metadata.type - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String type; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.structure_metadata.parent_id - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String parentId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.structure_metadata.uuid - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String uuid; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.structure_metadata.status - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String status; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.structure_metadata.server_version - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Long serverVersion; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.structure_metadata.name - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private String name; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.structure_metadata.date_created - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Date dateCreated; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.structure_metadata.date_edited - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - private Date dateEdited; - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.structure_metadata.id - * - * @return the value of core.structure_metadata.id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.structure_metadata.id - * - * @param id the value for core.structure_metadata.id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.structure_metadata.structure_id - * - * @return the value of core.structure_metadata.structure_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Long getStructureId() { - return structureId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.structure_metadata.structure_id - * - * @param structureId the value for core.structure_metadata.structure_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setStructureId(Long structureId) { - this.structureId = structureId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.structure_metadata.geojson_id - * - * @return the value of core.structure_metadata.geojson_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getGeojsonId() { - return geojsonId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.structure_metadata.geojson_id - * - * @param geojsonId the value for core.structure_metadata.geojson_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setGeojsonId(String geojsonId) { - this.geojsonId = geojsonId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.structure_metadata.type - * - * @return the value of core.structure_metadata.type - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getType() { - return type; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.structure_metadata.type - * - * @param type the value for core.structure_metadata.type - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setType(String type) { - this.type = type; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.structure_metadata.parent_id - * - * @return the value of core.structure_metadata.parent_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getParentId() { - return parentId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.structure_metadata.parent_id - * - * @param parentId the value for core.structure_metadata.parent_id - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setParentId(String parentId) { - this.parentId = parentId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.structure_metadata.uuid - * - * @return the value of core.structure_metadata.uuid - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getUuid() { - return uuid; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.structure_metadata.uuid - * - * @param uuid the value for core.structure_metadata.uuid - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setUuid(String uuid) { - this.uuid = uuid; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.structure_metadata.status - * - * @return the value of core.structure_metadata.status - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getStatus() { - return status; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.structure_metadata.status - * - * @param status the value for core.structure_metadata.status - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setStatus(String status) { - this.status = status; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.structure_metadata.server_version - * - * @return the value of core.structure_metadata.server_version - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Long getServerVersion() { - return serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.structure_metadata.server_version - * - * @param serverVersion the value for core.structure_metadata.server_version - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.structure_metadata.name - * - * @return the value of core.structure_metadata.name - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getName() { - return name; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.structure_metadata.name - * - * @param name the value for core.structure_metadata.name - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setName(String name) { - this.name = name; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.structure_metadata.date_created - * - * @return the value of core.structure_metadata.date_created - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Date getDateCreated() { - return dateCreated; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.structure_metadata.date_created - * - * @param dateCreated the value for core.structure_metadata.date_created - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setDateCreated(Date dateCreated) { - this.dateCreated = dateCreated; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.structure_metadata.date_edited - * - * @return the value of core.structure_metadata.date_edited - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Date getDateEdited() { - return dateEdited; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column - * core.structure_metadata.date_edited - * - * @param dateEdited the value for core.structure_metadata.date_edited - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setDateEdited(Date dateEdited) { - this.dateEdited = dateEdited; - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.structure_metadata.id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.structure_metadata.structure_id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Long structureId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.structure_metadata.geojson_id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String geojsonId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.structure_metadata.type + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String type; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.structure_metadata.parent_id + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String parentId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.structure_metadata.uuid + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String uuid; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.structure_metadata.status + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String status; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.structure_metadata.server_version + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Long serverVersion; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.structure_metadata.name + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private String name; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.structure_metadata.date_created + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Date dateCreated; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.structure_metadata.date_edited + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + private Date dateEdited; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.structure_metadata.id + * + * @return the value of core.structure_metadata.id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.structure_metadata.id + * + * @param id the value for core.structure_metadata.id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.structure_metadata.structure_id + * + * @return the value of core.structure_metadata.structure_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Long getStructureId() { + return structureId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.structure_metadata.structure_id + * + * @param structureId the value for core.structure_metadata.structure_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setStructureId(Long structureId) { + this.structureId = structureId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.structure_metadata.geojson_id + * + * @return the value of core.structure_metadata.geojson_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getGeojsonId() { + return geojsonId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.structure_metadata.geojson_id + * + * @param geojsonId the value for core.structure_metadata.geojson_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setGeojsonId(String geojsonId) { + this.geojsonId = geojsonId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.structure_metadata.type + * + * @return the value of core.structure_metadata.type + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getType() { + return type; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.structure_metadata.type + * + * @param type the value for core.structure_metadata.type + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setType(String type) { + this.type = type; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.structure_metadata.parent_id + * + * @return the value of core.structure_metadata.parent_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getParentId() { + return parentId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.structure_metadata.parent_id + * + * @param parentId the value for core.structure_metadata.parent_id + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setParentId(String parentId) { + this.parentId = parentId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.structure_metadata.uuid + * + * @return the value of core.structure_metadata.uuid + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getUuid() { + return uuid; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.structure_metadata.uuid + * + * @param uuid the value for core.structure_metadata.uuid + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setUuid(String uuid) { + this.uuid = uuid; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.structure_metadata.status + * + * @return the value of core.structure_metadata.status + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getStatus() { + return status; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.structure_metadata.status + * + * @param status the value for core.structure_metadata.status + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setStatus(String status) { + this.status = status; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.structure_metadata.server_version + * + * @return the value of core.structure_metadata.server_version + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Long getServerVersion() { + return serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.structure_metadata.server_version + * + * @param serverVersion the value for core.structure_metadata.server_version + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.structure_metadata.name + * + * @return the value of core.structure_metadata.name + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getName() { + return name; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.structure_metadata.name + * + * @param name the value for core.structure_metadata.name + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setName(String name) { + this.name = name; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.structure_metadata.date_created + * + * @return the value of core.structure_metadata.date_created + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Date getDateCreated() { + return dateCreated; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.structure_metadata.date_created + * + * @param dateCreated the value for core.structure_metadata.date_created + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setDateCreated(Date dateCreated) { + this.dateCreated = dateCreated; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.structure_metadata.date_edited + * + * @return the value of core.structure_metadata.date_edited + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Date getDateEdited() { + return dateEdited; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column + * core.structure_metadata.date_edited + * + * @param dateEdited the value for core.structure_metadata.date_edited + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setDateEdited(Date dateEdited) { + this.dateEdited = dateEdited; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/StructureMetadataExample.java b/src/main/java/org/opensrp/domain/postgres/StructureMetadataExample.java index f79aaa744..d9226f915 100644 --- a/src/main/java/org/opensrp/domain/postgres/StructureMetadataExample.java +++ b/src/main/java/org/opensrp/domain/postgres/StructureMetadataExample.java @@ -5,1022 +5,1022 @@ import java.util.List; public class StructureMetadataExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public StructureMetadataExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andStructureIdIsNull() { - addCriterion("structure_id is null"); - return (Criteria) this; - } - - public Criteria andStructureIdIsNotNull() { - addCriterion("structure_id is not null"); - return (Criteria) this; - } - - public Criteria andStructureIdEqualTo(Long value) { - addCriterion("structure_id =", value, "structureId"); - return (Criteria) this; - } - - public Criteria andStructureIdNotEqualTo(Long value) { - addCriterion("structure_id <>", value, "structureId"); - return (Criteria) this; - } - - public Criteria andStructureIdGreaterThan(Long value) { - addCriterion("structure_id >", value, "structureId"); - return (Criteria) this; - } - - public Criteria andStructureIdGreaterThanOrEqualTo(Long value) { - addCriterion("structure_id >=", value, "structureId"); - return (Criteria) this; - } - - public Criteria andStructureIdLessThan(Long value) { - addCriterion("structure_id <", value, "structureId"); - return (Criteria) this; - } - - public Criteria andStructureIdLessThanOrEqualTo(Long value) { - addCriterion("structure_id <=", value, "structureId"); - return (Criteria) this; - } - - public Criteria andStructureIdIn(List values) { - addCriterion("structure_id in", values, "structureId"); - return (Criteria) this; - } - - public Criteria andStructureIdNotIn(List values) { - addCriterion("structure_id not in", values, "structureId"); - return (Criteria) this; - } - - public Criteria andStructureIdBetween(Long value1, Long value2) { - addCriterion("structure_id between", value1, value2, "structureId"); - return (Criteria) this; - } - - public Criteria andStructureIdNotBetween(Long value1, Long value2) { - addCriterion("structure_id not between", value1, value2, "structureId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdIsNull() { - addCriterion("geojson_id is null"); - return (Criteria) this; - } - - public Criteria andGeojsonIdIsNotNull() { - addCriterion("geojson_id is not null"); - return (Criteria) this; - } - - public Criteria andGeojsonIdEqualTo(String value) { - addCriterion("geojson_id =", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdNotEqualTo(String value) { - addCriterion("geojson_id <>", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdGreaterThan(String value) { - addCriterion("geojson_id >", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdGreaterThanOrEqualTo(String value) { - addCriterion("geojson_id >=", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdLessThan(String value) { - addCriterion("geojson_id <", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdLessThanOrEqualTo(String value) { - addCriterion("geojson_id <=", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdLike(String value) { - addCriterion("geojson_id like", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdNotLike(String value) { - addCriterion("geojson_id not like", value, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdIn(List values) { - addCriterion("geojson_id in", values, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdNotIn(List values) { - addCriterion("geojson_id not in", values, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdBetween(String value1, String value2) { - addCriterion("geojson_id between", value1, value2, "geojsonId"); - return (Criteria) this; - } - - public Criteria andGeojsonIdNotBetween(String value1, String value2) { - addCriterion("geojson_id not between", value1, value2, "geojsonId"); - return (Criteria) this; - } - - public Criteria andTypeIsNull() { - addCriterion("type is null"); - return (Criteria) this; - } - - public Criteria andTypeIsNotNull() { - addCriterion("type is not null"); - return (Criteria) this; - } - - public Criteria andTypeEqualTo(String value) { - addCriterion("type =", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotEqualTo(String value) { - addCriterion("type <>", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThan(String value) { - addCriterion("type >", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThanOrEqualTo(String value) { - addCriterion("type >=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThan(String value) { - addCriterion("type <", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThanOrEqualTo(String value) { - addCriterion("type <=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLike(String value) { - addCriterion("type like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotLike(String value) { - addCriterion("type not like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeIn(List values) { - addCriterion("type in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotIn(List values) { - addCriterion("type not in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeBetween(String value1, String value2) { - addCriterion("type between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotBetween(String value1, String value2) { - addCriterion("type not between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andParentIdIsNull() { - addCriterion("parent_id is null"); - return (Criteria) this; - } - - public Criteria andParentIdIsNotNull() { - addCriterion("parent_id is not null"); - return (Criteria) this; - } - - public Criteria andParentIdEqualTo(String value) { - addCriterion("parent_id =", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdNotEqualTo(String value) { - addCriterion("parent_id <>", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdGreaterThan(String value) { - addCriterion("parent_id >", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdGreaterThanOrEqualTo(String value) { - addCriterion("parent_id >=", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdLessThan(String value) { - addCriterion("parent_id <", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdLessThanOrEqualTo(String value) { - addCriterion("parent_id <=", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdLike(String value) { - addCriterion("parent_id like", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdNotLike(String value) { - addCriterion("parent_id not like", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdIn(List values) { - addCriterion("parent_id in", values, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdNotIn(List values) { - addCriterion("parent_id not in", values, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdBetween(String value1, String value2) { - addCriterion("parent_id between", value1, value2, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdNotBetween(String value1, String value2) { - addCriterion("parent_id not between", value1, value2, "parentId"); - return (Criteria) this; - } - - public Criteria andUuidIsNull() { - addCriterion("uuid is null"); - return (Criteria) this; - } - - public Criteria andUuidIsNotNull() { - addCriterion("uuid is not null"); - return (Criteria) this; - } - - public Criteria andUuidEqualTo(String value) { - addCriterion("uuid =", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidNotEqualTo(String value) { - addCriterion("uuid <>", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidGreaterThan(String value) { - addCriterion("uuid >", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidGreaterThanOrEqualTo(String value) { - addCriterion("uuid >=", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidLessThan(String value) { - addCriterion("uuid <", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidLessThanOrEqualTo(String value) { - addCriterion("uuid <=", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidLike(String value) { - addCriterion("uuid like", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidNotLike(String value) { - addCriterion("uuid not like", value, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidIn(List values) { - addCriterion("uuid in", values, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidNotIn(List values) { - addCriterion("uuid not in", values, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidBetween(String value1, String value2) { - addCriterion("uuid between", value1, value2, "uuid"); - return (Criteria) this; - } - - public Criteria andUuidNotBetween(String value1, String value2) { - addCriterion("uuid not between", value1, value2, "uuid"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("status is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(String value) { - addCriterion("status =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(String value) { - addCriterion("status <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(String value) { - addCriterion("status >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(String value) { - addCriterion("status >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(String value) { - addCriterion("status <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(String value) { - addCriterion("status <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLike(String value) { - addCriterion("status like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotLike(String value) { - addCriterion("status not like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(String value1, String value2) { - addCriterion("status between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(String value1, String value2) { - addCriterion("status not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andNameIsNull() { - addCriterion("name is null"); - return (Criteria) this; - } - - public Criteria andNameIsNotNull() { - addCriterion("name is not null"); - return (Criteria) this; - } - - public Criteria andNameEqualTo(String value) { - addCriterion("name =", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotEqualTo(String value) { - addCriterion("name <>", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThan(String value) { - addCriterion("name >", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("name >=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThan(String value) { - addCriterion("name <", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("name <=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLike(String value) { - addCriterion("name like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotLike(String value) { - addCriterion("name not like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameIn(List values) { - addCriterion("name in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameNotIn(List values) { - addCriterion("name not in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameBetween(String value1, String value2) { - addCriterion("name between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("name not between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andDateCreatedIsNull() { - addCriterion("date_created is null"); - return (Criteria) this; - } - - public Criteria andDateCreatedIsNotNull() { - addCriterion("date_created is not null"); - return (Criteria) this; - } - - public Criteria andDateCreatedEqualTo(Date value) { - addCriterion("date_created =", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotEqualTo(Date value) { - addCriterion("date_created <>", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedGreaterThan(Date value) { - addCriterion("date_created >", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { - addCriterion("date_created >=", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedLessThan(Date value) { - addCriterion("date_created <", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedLessThanOrEqualTo(Date value) { - addCriterion("date_created <=", value, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedIn(List values) { - addCriterion("date_created in", values, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotIn(List values) { - addCriterion("date_created not in", values, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedBetween(Date value1, Date value2) { - addCriterion("date_created between", value1, value2, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateCreatedNotBetween(Date value1, Date value2) { - addCriterion("date_created not between", value1, value2, "dateCreated"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNull() { - addCriterion("date_edited is null"); - return (Criteria) this; - } - - public Criteria andDateEditedIsNotNull() { - addCriterion("date_edited is not null"); - return (Criteria) this; - } - - public Criteria andDateEditedEqualTo(Date value) { - addCriterion("date_edited =", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotEqualTo(Date value) { - addCriterion("date_edited <>", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThan(Date value) { - addCriterion("date_edited >", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { - addCriterion("date_edited >=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThan(Date value) { - addCriterion("date_edited <", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedLessThanOrEqualTo(Date value) { - addCriterion("date_edited <=", value, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedIn(List values) { - addCriterion("date_edited in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotIn(List values) { - addCriterion("date_edited not in", values, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedBetween(Date value1, Date value2) { - addCriterion("date_edited between", value1, value2, "dateEdited"); - return (Criteria) this; - } - - public Criteria andDateEditedNotBetween(Date value1, Date value2) { - addCriterion("date_edited not between", value1, value2, "dateEdited"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.structure_metadata - * - * @mbg.generated do_not_delete_during_merge Wed Sep 30 15:22:34 EAT 2020 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public StructureMetadataExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andStructureIdIsNull() { + addCriterion("structure_id is null"); + return (Criteria) this; + } + + public Criteria andStructureIdIsNotNull() { + addCriterion("structure_id is not null"); + return (Criteria) this; + } + + public Criteria andStructureIdEqualTo(Long value) { + addCriterion("structure_id =", value, "structureId"); + return (Criteria) this; + } + + public Criteria andStructureIdNotEqualTo(Long value) { + addCriterion("structure_id <>", value, "structureId"); + return (Criteria) this; + } + + public Criteria andStructureIdGreaterThan(Long value) { + addCriterion("structure_id >", value, "structureId"); + return (Criteria) this; + } + + public Criteria andStructureIdGreaterThanOrEqualTo(Long value) { + addCriterion("structure_id >=", value, "structureId"); + return (Criteria) this; + } + + public Criteria andStructureIdLessThan(Long value) { + addCriterion("structure_id <", value, "structureId"); + return (Criteria) this; + } + + public Criteria andStructureIdLessThanOrEqualTo(Long value) { + addCriterion("structure_id <=", value, "structureId"); + return (Criteria) this; + } + + public Criteria andStructureIdIn(List values) { + addCriterion("structure_id in", values, "structureId"); + return (Criteria) this; + } + + public Criteria andStructureIdNotIn(List values) { + addCriterion("structure_id not in", values, "structureId"); + return (Criteria) this; + } + + public Criteria andStructureIdBetween(Long value1, Long value2) { + addCriterion("structure_id between", value1, value2, "structureId"); + return (Criteria) this; + } + + public Criteria andStructureIdNotBetween(Long value1, Long value2) { + addCriterion("structure_id not between", value1, value2, "structureId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdIsNull() { + addCriterion("geojson_id is null"); + return (Criteria) this; + } + + public Criteria andGeojsonIdIsNotNull() { + addCriterion("geojson_id is not null"); + return (Criteria) this; + } + + public Criteria andGeojsonIdEqualTo(String value) { + addCriterion("geojson_id =", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdNotEqualTo(String value) { + addCriterion("geojson_id <>", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdGreaterThan(String value) { + addCriterion("geojson_id >", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdGreaterThanOrEqualTo(String value) { + addCriterion("geojson_id >=", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdLessThan(String value) { + addCriterion("geojson_id <", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdLessThanOrEqualTo(String value) { + addCriterion("geojson_id <=", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdLike(String value) { + addCriterion("geojson_id like", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdNotLike(String value) { + addCriterion("geojson_id not like", value, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdIn(List values) { + addCriterion("geojson_id in", values, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdNotIn(List values) { + addCriterion("geojson_id not in", values, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdBetween(String value1, String value2) { + addCriterion("geojson_id between", value1, value2, "geojsonId"); + return (Criteria) this; + } + + public Criteria andGeojsonIdNotBetween(String value1, String value2) { + addCriterion("geojson_id not between", value1, value2, "geojsonId"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andParentIdIsNull() { + addCriterion("parent_id is null"); + return (Criteria) this; + } + + public Criteria andParentIdIsNotNull() { + addCriterion("parent_id is not null"); + return (Criteria) this; + } + + public Criteria andParentIdEqualTo(String value) { + addCriterion("parent_id =", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotEqualTo(String value) { + addCriterion("parent_id <>", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThan(String value) { + addCriterion("parent_id >", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThanOrEqualTo(String value) { + addCriterion("parent_id >=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThan(String value) { + addCriterion("parent_id <", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThanOrEqualTo(String value) { + addCriterion("parent_id <=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLike(String value) { + addCriterion("parent_id like", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotLike(String value) { + addCriterion("parent_id not like", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdIn(List values) { + addCriterion("parent_id in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotIn(List values) { + addCriterion("parent_id not in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdBetween(String value1, String value2) { + addCriterion("parent_id between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotBetween(String value1, String value2) { + addCriterion("parent_id not between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andUuidIsNull() { + addCriterion("uuid is null"); + return (Criteria) this; + } + + public Criteria andUuidIsNotNull() { + addCriterion("uuid is not null"); + return (Criteria) this; + } + + public Criteria andUuidEqualTo(String value) { + addCriterion("uuid =", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidNotEqualTo(String value) { + addCriterion("uuid <>", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidGreaterThan(String value) { + addCriterion("uuid >", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidGreaterThanOrEqualTo(String value) { + addCriterion("uuid >=", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidLessThan(String value) { + addCriterion("uuid <", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidLessThanOrEqualTo(String value) { + addCriterion("uuid <=", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidLike(String value) { + addCriterion("uuid like", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidNotLike(String value) { + addCriterion("uuid not like", value, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidIn(List values) { + addCriterion("uuid in", values, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidNotIn(List values) { + addCriterion("uuid not in", values, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidBetween(String value1, String value2) { + addCriterion("uuid between", value1, value2, "uuid"); + return (Criteria) this; + } + + public Criteria andUuidNotBetween(String value1, String value2) { + addCriterion("uuid not between", value1, value2, "uuid"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(String value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(String value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(String value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(String value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLike(String value) { + addCriterion("status like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotLike(String value) { + addCriterion("status not like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNull() { + addCriterion("date_created is null"); + return (Criteria) this; + } + + public Criteria andDateCreatedIsNotNull() { + addCriterion("date_created is not null"); + return (Criteria) this; + } + + public Criteria andDateCreatedEqualTo(Date value) { + addCriterion("date_created =", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotEqualTo(Date value) { + addCriterion("date_created <>", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThan(Date value) { + addCriterion("date_created >", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { + addCriterion("date_created >=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThan(Date value) { + addCriterion("date_created <", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedLessThanOrEqualTo(Date value) { + addCriterion("date_created <=", value, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedIn(List values) { + addCriterion("date_created in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotIn(List values) { + addCriterion("date_created not in", values, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedBetween(Date value1, Date value2) { + addCriterion("date_created between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateCreatedNotBetween(Date value1, Date value2) { + addCriterion("date_created not between", value1, value2, "dateCreated"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNull() { + addCriterion("date_edited is null"); + return (Criteria) this; + } + + public Criteria andDateEditedIsNotNull() { + addCriterion("date_edited is not null"); + return (Criteria) this; + } + + public Criteria andDateEditedEqualTo(Date value) { + addCriterion("date_edited =", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotEqualTo(Date value) { + addCriterion("date_edited <>", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThan(Date value) { + addCriterion("date_edited >", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedGreaterThanOrEqualTo(Date value) { + addCriterion("date_edited >=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThan(Date value) { + addCriterion("date_edited <", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedLessThanOrEqualTo(Date value) { + addCriterion("date_edited <=", value, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedIn(List values) { + addCriterion("date_edited in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotIn(List values) { + addCriterion("date_edited not in", values, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedBetween(Date value1, Date value2) { + addCriterion("date_edited between", value1, value2, "dateEdited"); + return (Criteria) this; + } + + public Criteria andDateEditedNotBetween(Date value1, Date value2) { + addCriterion("date_edited not between", value1, value2, "dateEdited"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.structure_metadata + * + * @mbg.generated do_not_delete_during_merge Wed Sep 30 15:22:34 EAT 2020 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/Task.java b/src/main/java/org/opensrp/domain/postgres/Task.java index 97a41ee59..c7d86ecd9 100644 --- a/src/main/java/org/opensrp/domain/postgres/Task.java +++ b/src/main/java/org/opensrp/domain/postgres/Task.java @@ -2,73 +2,82 @@ public class Task { - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.task.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Long id; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.task.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Object json; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.task.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Long serverVersion; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.task.id + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Long id; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.task.json + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Object json; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.task.server_version + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Long serverVersion; - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.task.id - * @return the value of core.task.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Long getId() { - return id; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.task.id + * + * @return the value of core.task.id + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Long getId() { + return id; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.task.id - * @param id the value for core.task.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.task.id + * + * @param id the value for core.task.id + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setId(Long id) { + this.id = id; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.task.json - * @return the value of core.task.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Object getJson() { - return json; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.task.json + * + * @return the value of core.task.json + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Object getJson() { + return json; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.task.json - * @param json the value for core.task.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setJson(Object json) { - this.json = json; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.task.json + * + * @param json the value for core.task.json + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setJson(Object json) { + this.json = json; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.task.server_version - * @return the value of core.task.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Long getServerVersion() { - return serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.task.server_version + * + * @return the value of core.task.server_version + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Long getServerVersion() { + return serverVersion; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.task.server_version - * @param serverVersion the value for core.task.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.task.server_version + * + * @param serverVersion the value for core.task.server_version + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } } \ No newline at end of file diff --git a/src/main/java/org/opensrp/domain/postgres/TaskExample.java b/src/main/java/org/opensrp/domain/postgres/TaskExample.java index 117f6d8f9..7dcb548c5 100644 --- a/src/main/java/org/opensrp/domain/postgres/TaskExample.java +++ b/src/main/java/org/opensrp/domain/postgres/TaskExample.java @@ -5,471 +5,487 @@ public class TaskExample { /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected String orderByClause; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected boolean distinct; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public TaskExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List jsonCriteria; - - protected List allCriteria; - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - jsonCriteria = new ArrayList<>(); - } - - public List getJsonCriteria() { - return jsonCriteria; - } - - protected void addJsonCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.TaskTypeHandler")); - allCriteria = null; - } - - protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - jsonCriteria.add( - new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.TaskTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || jsonCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList<>(); - allCriteria.addAll(criteria); - allCriteria.addAll(jsonCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - allCriteria = null; - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andJsonIsNull() { - addCriterion("json is null"); - return (Criteria) this; - } - - public Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (Criteria) this; - } - - public Criteria andJsonEqualTo(Object value) { - addJsonCriterion("json =", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotEqualTo(Object value) { - addJsonCriterion("json <>", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThan(Object value) { - addJsonCriterion("json >", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThanOrEqualTo(Object value) { - addJsonCriterion("json >=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThan(Object value) { - addJsonCriterion("json <", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThanOrEqualTo(Object value) { - addJsonCriterion("json <=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonIn(List values) { - addJsonCriterion("json in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotIn(List values) { - addJsonCriterion("json not in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonBetween(Object value1, Object value2) { - addJsonCriterion("json between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotBetween(Object value1, Object value2) { - addJsonCriterion("json not between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected String orderByClause; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected boolean distinct; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public TaskExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List jsonCriteria; + + protected List allCriteria; + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + jsonCriteria = new ArrayList<>(); + } + + public List getJsonCriteria() { + return jsonCriteria; + } + + protected void addJsonCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + jsonCriteria.add(new Criterion(condition, value, "org.opensrp.repository.postgres.handler.TaskTypeHandler")); + allCriteria = null; + } + + protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + jsonCriteria.add( + new Criterion(condition, value1, value2, "org.opensrp.repository.postgres.handler.TaskTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || jsonCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList<>(); + allCriteria.addAll(criteria); + allCriteria.addAll(jsonCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andJsonIsNull() { + addCriterion("json is null"); + return (Criteria) this; + } + + public Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (Criteria) this; + } + + public Criteria andJsonEqualTo(Object value) { + addJsonCriterion("json =", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotEqualTo(Object value) { + addJsonCriterion("json <>", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThan(Object value) { + addJsonCriterion("json >", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThanOrEqualTo(Object value) { + addJsonCriterion("json >=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThan(Object value) { + addJsonCriterion("json <", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThanOrEqualTo(Object value) { + addJsonCriterion("json <=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonIn(List values) { + addJsonCriterion("json in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotIn(List values) { + addJsonCriterion("json not in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonBetween(Object value1, Object value2) { + addJsonCriterion("json between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotBetween(Object value1, Object value2) { + addJsonCriterion("json not between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** * This class was generated by MyBatis Generator. * This class corresponds to the database table core.task * diff --git a/src/main/java/org/opensrp/domain/postgres/TaskMetadata.java b/src/main/java/org/opensrp/domain/postgres/TaskMetadata.java index f9d7f0eb3..647ae2198 100644 --- a/src/main/java/org/opensrp/domain/postgres/TaskMetadata.java +++ b/src/main/java/org/opensrp/domain/postgres/TaskMetadata.java @@ -4,7 +4,6 @@ public class TaskMetadata { /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.task_metadata.id * @@ -13,7 +12,6 @@ public class TaskMetadata { private Long id; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.task_metadata.task_id * @@ -22,7 +20,6 @@ public class TaskMetadata { private Long taskId; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.task_metadata.identifier * @@ -31,7 +28,6 @@ public class TaskMetadata { private String identifier; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.task_metadata.plan_identifier * @@ -40,7 +36,6 @@ public class TaskMetadata { private String planIdentifier; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.task_metadata.group_identifier * @@ -49,7 +44,6 @@ public class TaskMetadata { private String groupIdentifier; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.task_metadata.for_entity * @@ -58,7 +52,6 @@ public class TaskMetadata { private String forEntity; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.task_metadata.server_version * @@ -67,7 +60,6 @@ public class TaskMetadata { private Long serverVersion; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.task_metadata.owner * @@ -76,7 +68,6 @@ public class TaskMetadata { private String owner; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.task_metadata.code * @@ -85,7 +76,6 @@ public class TaskMetadata { private String code; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.task_metadata.date_created * @@ -94,7 +84,6 @@ public class TaskMetadata { private Date dateCreated; /** - * * This field was generated by MyBatis Generator. * This field corresponds to the database column core.task_metadata.date_edited * @@ -107,7 +96,6 @@ public class TaskMetadata { * This method returns the value of the database column core.task_metadata.id * * @return the value of core.task_metadata.id - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public Long getId() { @@ -119,7 +107,6 @@ public Long getId() { * This method sets the value of the database column core.task_metadata.id * * @param id the value for core.task_metadata.id - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public void setId(Long id) { @@ -131,7 +118,6 @@ public void setId(Long id) { * This method returns the value of the database column core.task_metadata.task_id * * @return the value of core.task_metadata.task_id - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public Long getTaskId() { @@ -143,7 +129,6 @@ public Long getTaskId() { * This method sets the value of the database column core.task_metadata.task_id * * @param taskId the value for core.task_metadata.task_id - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public void setTaskId(Long taskId) { @@ -155,7 +140,6 @@ public void setTaskId(Long taskId) { * This method returns the value of the database column core.task_metadata.identifier * * @return the value of core.task_metadata.identifier - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public String getIdentifier() { @@ -167,7 +151,6 @@ public String getIdentifier() { * This method sets the value of the database column core.task_metadata.identifier * * @param identifier the value for core.task_metadata.identifier - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public void setIdentifier(String identifier) { @@ -179,7 +162,6 @@ public void setIdentifier(String identifier) { * This method returns the value of the database column core.task_metadata.plan_identifier * * @return the value of core.task_metadata.plan_identifier - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public String getPlanIdentifier() { @@ -191,7 +173,6 @@ public String getPlanIdentifier() { * This method sets the value of the database column core.task_metadata.plan_identifier * * @param planIdentifier the value for core.task_metadata.plan_identifier - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public void setPlanIdentifier(String planIdentifier) { @@ -203,7 +184,6 @@ public void setPlanIdentifier(String planIdentifier) { * This method returns the value of the database column core.task_metadata.group_identifier * * @return the value of core.task_metadata.group_identifier - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public String getGroupIdentifier() { @@ -215,7 +195,6 @@ public String getGroupIdentifier() { * This method sets the value of the database column core.task_metadata.group_identifier * * @param groupIdentifier the value for core.task_metadata.group_identifier - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public void setGroupIdentifier(String groupIdentifier) { @@ -227,7 +206,6 @@ public void setGroupIdentifier(String groupIdentifier) { * This method returns the value of the database column core.task_metadata.for_entity * * @return the value of core.task_metadata.for_entity - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public String getForEntity() { @@ -239,7 +217,6 @@ public String getForEntity() { * This method sets the value of the database column core.task_metadata.for_entity * * @param forEntity the value for core.task_metadata.for_entity - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public void setForEntity(String forEntity) { @@ -251,7 +228,6 @@ public void setForEntity(String forEntity) { * This method returns the value of the database column core.task_metadata.server_version * * @return the value of core.task_metadata.server_version - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public Long getServerVersion() { @@ -263,7 +239,6 @@ public Long getServerVersion() { * This method sets the value of the database column core.task_metadata.server_version * * @param serverVersion the value for core.task_metadata.server_version - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public void setServerVersion(Long serverVersion) { @@ -275,7 +250,6 @@ public void setServerVersion(Long serverVersion) { * This method returns the value of the database column core.task_metadata.owner * * @return the value of core.task_metadata.owner - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public String getOwner() { @@ -287,7 +261,6 @@ public String getOwner() { * This method sets the value of the database column core.task_metadata.owner * * @param owner the value for core.task_metadata.owner - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public void setOwner(String owner) { @@ -299,7 +272,6 @@ public void setOwner(String owner) { * This method returns the value of the database column core.task_metadata.code * * @return the value of core.task_metadata.code - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public String getCode() { @@ -311,7 +283,6 @@ public String getCode() { * This method sets the value of the database column core.task_metadata.code * * @param code the value for core.task_metadata.code - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public void setCode(String code) { @@ -323,7 +294,6 @@ public void setCode(String code) { * This method returns the value of the database column core.task_metadata.date_created * * @return the value of core.task_metadata.date_created - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public Date getDateCreated() { @@ -335,7 +305,6 @@ public Date getDateCreated() { * This method sets the value of the database column core.task_metadata.date_created * * @param dateCreated the value for core.task_metadata.date_created - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public void setDateCreated(Date dateCreated) { @@ -347,7 +316,6 @@ public void setDateCreated(Date dateCreated) { * This method returns the value of the database column core.task_metadata.date_edited * * @return the value of core.task_metadata.date_edited - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public Date getDateEdited() { @@ -359,7 +327,6 @@ public Date getDateEdited() { * This method sets the value of the database column core.task_metadata.date_edited * * @param dateEdited the value for core.task_metadata.date_edited - * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ public void setDateEdited(Date dateEdited) { diff --git a/src/main/java/org/opensrp/domain/postgres/TaskMetadataExample.java b/src/main/java/org/opensrp/domain/postgres/TaskMetadataExample.java index 54e6f99e5..2b82a74b9 100644 --- a/src/main/java/org/opensrp/domain/postgres/TaskMetadataExample.java +++ b/src/main/java/org/opensrp/domain/postgres/TaskMetadataExample.java @@ -45,8 +45,8 @@ public TaskMetadataExample() { * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; + public String getOrderByClause() { + return orderByClause; } /** @@ -55,8 +55,8 @@ public void setOrderByClause(String orderByClause) { * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ - public String getOrderByClause() { - return orderByClause; + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; } /** @@ -65,8 +65,8 @@ public String getOrderByClause() { * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; + public boolean isDistinct() { + return distinct; } /** @@ -75,8 +75,8 @@ public void setDistinct(boolean distinct) { * * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 */ - public boolean isDistinct() { - return distinct; + public void setDistinct(boolean distinct) { + this.distinct = distinct; } /** @@ -951,38 +951,6 @@ public static class Criterion { private String typeHandler; - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - protected Criterion(String condition) { super(); this.condition = condition; @@ -1018,5 +986,37 @@ protected Criterion(String condition, Object value, Object secondValue, String t protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } } } diff --git a/src/main/java/org/opensrp/domain/postgres/UniqueId.java b/src/main/java/org/opensrp/domain/postgres/UniqueId.java index 95b8d9d57..9e4cc7962 100644 --- a/src/main/java/org/opensrp/domain/postgres/UniqueId.java +++ b/src/main/java/org/opensrp/domain/postgres/UniqueId.java @@ -4,297 +4,285 @@ public class UniqueId { - /** - * + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.unique_id.id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - private Long id; - /** - * + */ + private Long id; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.unique_id.location * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - private String location; - /** - * + */ + private String location; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.unique_id.openmrs_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - private String openmrsId; - /** - * + */ + private String openmrsId; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.unique_id.status * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - private String status; - /** - * + */ + private String status; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.unique_id.used_by * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - private String usedBy; - /** - * + */ + private String usedBy; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.unique_id.updated_at * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - private Date updatedAt; - /** - * + */ + private Date updatedAt; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column core.unique_id.created_at * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - private Date createdAt; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.unique_id.identifier - * @mbg.generated Thu May 21 11:32:28 PKT 2020 - */ - private String identifier; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.unique_id.id_source - * @mbg.generated Thu May 21 11:32:28 PKT 2020 - */ - private Long idSource; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.unique_id.is_reserved - * @mbg.generated Thu May 21 11:32:28 PKT 2020 - */ - private Boolean isReserved; + */ + private Date createdAt; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.unique_id.identifier + * + * @mbg.generated Thu May 21 11:32:28 PKT 2020 + */ + private String identifier; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.unique_id.id_source + * + * @mbg.generated Thu May 21 11:32:28 PKT 2020 + */ + private Long idSource; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.unique_id.is_reserved + * + * @mbg.generated Thu May 21 11:32:28 PKT 2020 + */ + private Boolean isReserved; - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.unique_id.id * - * @return the value of core.unique_id.id - * + * @return the value of core.unique_id.id * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public Long getId() { - return id; - } + */ + public Long getId() { + return id; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.unique_id.id * - * @param id the value for core.unique_id.id - * + * @param id the value for core.unique_id.id * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } + */ + public void setId(Long id) { + this.id = id; + } - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.unique_id.location * - * @return the value of core.unique_id.location - * + * @return the value of core.unique_id.location * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public String getLocation() { - return location; - } + */ + public String getLocation() { + return location; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.unique_id.location * - * @param location the value for core.unique_id.location - * + * @param location the value for core.unique_id.location * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public void setLocation(String location) { - this.location = location; - } + */ + public void setLocation(String location) { + this.location = location; + } - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.unique_id.openmrs_id * - * @return the value of core.unique_id.openmrs_id - * + * @return the value of core.unique_id.openmrs_id * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public String getOpenmrsId() { - return openmrsId; - } + */ + public String getOpenmrsId() { + return openmrsId; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.unique_id.openmrs_id * - * @param openmrsId the value for core.unique_id.openmrs_id - * + * @param openmrsId the value for core.unique_id.openmrs_id * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public void setOpenmrsId(String openmrsId) { - this.openmrsId = openmrsId; - } + */ + public void setOpenmrsId(String openmrsId) { + this.openmrsId = openmrsId; + } - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.unique_id.status * - * @return the value of core.unique_id.status - * + * @return the value of core.unique_id.status * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public String getStatus() { - return status; - } + */ + public String getStatus() { + return status; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.unique_id.status * - * @param status the value for core.unique_id.status - * + * @param status the value for core.unique_id.status * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public void setStatus(String status) { - this.status = status; - } + */ + public void setStatus(String status) { + this.status = status; + } - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.unique_id.used_by * - * @return the value of core.unique_id.used_by - * + * @return the value of core.unique_id.used_by * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public String getUsedBy() { - return usedBy; - } + */ + public String getUsedBy() { + return usedBy; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.unique_id.used_by * - * @param usedBy the value for core.unique_id.used_by - * + * @param usedBy the value for core.unique_id.used_by * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public void setUsedBy(String usedBy) { - this.usedBy = usedBy; - } + */ + public void setUsedBy(String usedBy) { + this.usedBy = usedBy; + } - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.unique_id.updated_at * - * @return the value of core.unique_id.updated_at - * + * @return the value of core.unique_id.updated_at * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public Date getUpdatedAt() { - return updatedAt; - } + */ + public Date getUpdatedAt() { + return updatedAt; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.unique_id.updated_at * - * @param updatedAt the value for core.unique_id.updated_at - * + * @param updatedAt the value for core.unique_id.updated_at * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public void setUpdatedAt(Date updatedAt) { - this.updatedAt = updatedAt; - } + */ + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } - /** + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column core.unique_id.created_at * - * @return the value of core.unique_id.created_at - * + * @return the value of core.unique_id.created_at * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public Date getCreatedAt() { - return createdAt; - } + */ + public Date getCreatedAt() { + return createdAt; + } - /** + /** * This method was generated by MyBatis Generator. * This method sets the value of the database column core.unique_id.created_at * - * @param createdAt the value for core.unique_id.created_at - * + * @param createdAt the value for core.unique_id.created_at * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } + */ + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.unique_id.identifier - * @return the value of core.unique_id.identifier - * @mbg.generated Thu May 21 11:32:28 PKT 2020 - */ - public String getIdentifier() { - return identifier; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.unique_id.identifier + * + * @return the value of core.unique_id.identifier + * @mbg.generated Thu May 21 11:32:28 PKT 2020 + */ + public String getIdentifier() { + return identifier; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.unique_id.identifier - * @param identifier the value for core.unique_id.identifier - * @mbg.generated Thu May 21 11:32:28 PKT 2020 - */ - public void setIdentifier(String identifier) { - this.identifier = identifier; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.unique_id.identifier + * + * @param identifier the value for core.unique_id.identifier + * @mbg.generated Thu May 21 11:32:28 PKT 2020 + */ + public void setIdentifier(String identifier) { + this.identifier = identifier; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.unique_id.id_source - * @return the value of core.unique_id.id_source - * @mbg.generated Thu May 21 11:32:28 PKT 2020 - */ - public Long getIdSource() { - return idSource; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.unique_id.id_source + * + * @return the value of core.unique_id.id_source + * @mbg.generated Thu May 21 11:32:28 PKT 2020 + */ + public Long getIdSource() { + return idSource; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.unique_id.id_source - * @param idSource the value for core.unique_id.id_source - * @mbg.generated Thu May 21 11:32:28 PKT 2020 - */ - public void setIdSource(Long idSource) { - this.idSource = idSource; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.unique_id.id_source + * + * @param idSource the value for core.unique_id.id_source + * @mbg.generated Thu May 21 11:32:28 PKT 2020 + */ + public void setIdSource(Long idSource) { + this.idSource = idSource; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.unique_id.is_reserved - * @return the value of core.unique_id.is_reserved - * @mbg.generated Thu May 21 11:32:28 PKT 2020 - */ - public Boolean getIsReserved() { - return isReserved; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.unique_id.is_reserved + * + * @return the value of core.unique_id.is_reserved + * @mbg.generated Thu May 21 11:32:28 PKT 2020 + */ + public Boolean getIsReserved() { + return isReserved; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.unique_id.is_reserved - * @param isReserved the value for core.unique_id.is_reserved - * @mbg.generated Thu May 21 11:32:28 PKT 2020 - */ - public void setIsReserved(Boolean isReserved) { - this.isReserved = isReserved; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.unique_id.is_reserved + * + * @param isReserved the value for core.unique_id.is_reserved + * @mbg.generated Thu May 21 11:32:28 PKT 2020 + */ + public void setIsReserved(Boolean isReserved) { + this.isReserved = isReserved; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/UniqueIdExample.java b/src/main/java/org/opensrp/domain/postgres/UniqueIdExample.java index 666a6cf60..c4ac90d44 100644 --- a/src/main/java/org/opensrp/domain/postgres/UniqueIdExample.java +++ b/src/main/java/org/opensrp/domain/postgres/UniqueIdExample.java @@ -10,926 +10,926 @@ public class UniqueIdExample { * This field corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - protected String orderByClause; - /** + */ + protected String orderByClause; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - protected boolean distinct; - /** + */ + protected boolean distinct; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - protected List oredCriteria; + */ + protected List oredCriteria; - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public UniqueIdExample() { + */ + public UniqueIdExample() { oredCriteria = new ArrayList(); - } + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } + */ + public String getOrderByClause() { + return orderByClause; + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } + */ + public boolean isDistinct() { + return distinct; + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } + */ + public List getOredCriteria() { + return oredCriteria; + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** * This class was generated by MyBatis Generator. * This class corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new IllegalArgumentException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new IllegalArgumentException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new IllegalArgumentException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andLocationIsNull() { - addCriterion("location is null"); - return (Criteria) this; - } - - public Criteria andLocationIsNotNull() { - addCriterion("location is not null"); - return (Criteria) this; - } - - public Criteria andLocationEqualTo(String value) { - addCriterion("location =", value, "location"); - return (Criteria) this; - } - - public Criteria andLocationNotEqualTo(String value) { - addCriterion("location <>", value, "location"); - return (Criteria) this; - } - - public Criteria andLocationGreaterThan(String value) { - addCriterion("location >", value, "location"); - return (Criteria) this; - } - - public Criteria andLocationGreaterThanOrEqualTo(String value) { - addCriterion("location >=", value, "location"); - return (Criteria) this; - } - - public Criteria andLocationLessThan(String value) { - addCriterion("location <", value, "location"); - return (Criteria) this; - } - - public Criteria andLocationLessThanOrEqualTo(String value) { - addCriterion("location <=", value, "location"); - return (Criteria) this; - } - - public Criteria andLocationLike(String value) { - addCriterion("location like", value, "location"); - return (Criteria) this; - } - - public Criteria andLocationNotLike(String value) { - addCriterion("location not like", value, "location"); - return (Criteria) this; - } - - public Criteria andLocationIn(List values) { - addCriterion("location in", values, "location"); - return (Criteria) this; - } - - public Criteria andLocationNotIn(List values) { - addCriterion("location not in", values, "location"); - return (Criteria) this; - } - - public Criteria andLocationBetween(String value1, String value2) { - addCriterion("location between", value1, value2, "location"); - return (Criteria) this; - } - - public Criteria andLocationNotBetween(String value1, String value2) { - addCriterion("location not between", value1, value2, "location"); - return (Criteria) this; - } - - public Criteria andOpenmrsIdIsNull() { - addCriterion("openmrs_id is null"); - return (Criteria) this; - } - - public Criteria andOpenmrsIdIsNotNull() { - addCriterion("openmrs_id is not null"); - return (Criteria) this; - } - - public Criteria andOpenmrsIdEqualTo(String value) { - addCriterion("openmrs_id =", value, "openmrsId"); - return (Criteria) this; - } - - public Criteria andOpenmrsIdNotEqualTo(String value) { - addCriterion("openmrs_id <>", value, "openmrsId"); - return (Criteria) this; - } - - public Criteria andOpenmrsIdGreaterThan(String value) { - addCriterion("openmrs_id >", value, "openmrsId"); - return (Criteria) this; - } - - public Criteria andOpenmrsIdGreaterThanOrEqualTo(String value) { - addCriterion("openmrs_id >=", value, "openmrsId"); - return (Criteria) this; - } - - public Criteria andOpenmrsIdLessThan(String value) { - addCriterion("openmrs_id <", value, "openmrsId"); - return (Criteria) this; - } - - public Criteria andOpenmrsIdLessThanOrEqualTo(String value) { - addCriterion("openmrs_id <=", value, "openmrsId"); - return (Criteria) this; - } - - public Criteria andOpenmrsIdLike(String value) { - addCriterion("openmrs_id like", value, "openmrsId"); - return (Criteria) this; - } - - public Criteria andOpenmrsIdNotLike(String value) { - addCriterion("openmrs_id not like", value, "openmrsId"); - return (Criteria) this; - } - - public Criteria andOpenmrsIdIn(List values) { - addCriterion("openmrs_id in", values, "openmrsId"); - return (Criteria) this; - } - - public Criteria andOpenmrsIdNotIn(List values) { - addCriterion("openmrs_id not in", values, "openmrsId"); - return (Criteria) this; - } - - public Criteria andOpenmrsIdBetween(String value1, String value2) { - addCriterion("openmrs_id between", value1, value2, "openmrsId"); - return (Criteria) this; - } - - public Criteria andOpenmrsIdNotBetween(String value1, String value2) { - addCriterion("openmrs_id not between", value1, value2, "openmrsId"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("status is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(String value) { - addCriterion("status =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(String value) { - addCriterion("status <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(String value) { - addCriterion("status >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(String value) { - addCriterion("status >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(String value) { - addCriterion("status <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(String value) { - addCriterion("status <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLike(String value) { - addCriterion("status like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotLike(String value) { - addCriterion("status not like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(String value1, String value2) { - addCriterion("status between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(String value1, String value2) { - addCriterion("status not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andUsedByIsNull() { - addCriterion("used_by is null"); - return (Criteria) this; - } - - public Criteria andUsedByIsNotNull() { - addCriterion("used_by is not null"); - return (Criteria) this; - } - - public Criteria andUsedByEqualTo(String value) { - addCriterion("used_by =", value, "usedBy"); - return (Criteria) this; - } - - public Criteria andUsedByNotEqualTo(String value) { - addCriterion("used_by <>", value, "usedBy"); - return (Criteria) this; - } - - public Criteria andUsedByGreaterThan(String value) { - addCriterion("used_by >", value, "usedBy"); - return (Criteria) this; - } - - public Criteria andUsedByGreaterThanOrEqualTo(String value) { - addCriterion("used_by >=", value, "usedBy"); - return (Criteria) this; - } - - public Criteria andUsedByLessThan(String value) { - addCriterion("used_by <", value, "usedBy"); - return (Criteria) this; - } - - public Criteria andUsedByLessThanOrEqualTo(String value) { - addCriterion("used_by <=", value, "usedBy"); - return (Criteria) this; - } - - public Criteria andUsedByLike(String value) { - addCriterion("used_by like", value, "usedBy"); - return (Criteria) this; - } - - public Criteria andUsedByNotLike(String value) { - addCriterion("used_by not like", value, "usedBy"); - return (Criteria) this; - } - - public Criteria andUsedByIn(List values) { - addCriterion("used_by in", values, "usedBy"); - return (Criteria) this; - } - - public Criteria andUsedByNotIn(List values) { - addCriterion("used_by not in", values, "usedBy"); - return (Criteria) this; - } - - public Criteria andUsedByBetween(String value1, String value2) { - addCriterion("used_by between", value1, value2, "usedBy"); - return (Criteria) this; - } - - public Criteria andUsedByNotBetween(String value1, String value2) { - addCriterion("used_by not between", value1, value2, "usedBy"); - return (Criteria) this; - } - - public Criteria andUpdatedAtIsNull() { - addCriterion("updated_at is null"); - return (Criteria) this; - } - - public Criteria andUpdatedAtIsNotNull() { - addCriterion("updated_at is not null"); - return (Criteria) this; - } - - public Criteria andUpdatedAtEqualTo(Date value) { - addCriterion("updated_at =", value, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtNotEqualTo(Date value) { - addCriterion("updated_at <>", value, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtGreaterThan(Date value) { - addCriterion("updated_at >", value, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { - addCriterion("updated_at >=", value, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtLessThan(Date value) { - addCriterion("updated_at <", value, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { - addCriterion("updated_at <=", value, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtIn(List values) { - addCriterion("updated_at in", values, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtNotIn(List values) { - addCriterion("updated_at not in", values, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtBetween(Date value1, Date value2) { - addCriterion("updated_at between", value1, value2, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { - addCriterion("updated_at not between", value1, value2, "updatedAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtIsNull() { - addCriterion("created_at is null"); - return (Criteria) this; - } - - public Criteria andCreatedAtIsNotNull() { - addCriterion("created_at is not null"); - return (Criteria) this; - } - - public Criteria andCreatedAtEqualTo(Date value) { - addCriterion("created_at =", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtNotEqualTo(Date value) { - addCriterion("created_at <>", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtGreaterThan(Date value) { - addCriterion("created_at >", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { - addCriterion("created_at >=", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtLessThan(Date value) { - addCriterion("created_at <", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtLessThanOrEqualTo(Date value) { - addCriterion("created_at <=", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtIn(List values) { - addCriterion("created_at in", values, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtNotIn(List values) { - addCriterion("created_at not in", values, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtBetween(Date value1, Date value2) { - addCriterion("created_at between", value1, value2, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtNotBetween(Date value1, Date value2) { - addCriterion("created_at not between", value1, value2, "createdAt"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNull() { - addCriterion("identifier is null"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNotNull() { - addCriterion("identifier is not null"); - return (Criteria) this; - } - - public Criteria andIdentifierEqualTo(String value) { - addCriterion("identifier =", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotEqualTo(String value) { - addCriterion("identifier <>", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThan(String value) { - addCriterion("identifier >", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThanOrEqualTo(String value) { - addCriterion("identifier >=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThan(String value) { - addCriterion("identifier <", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThanOrEqualTo(String value) { - addCriterion("identifier <=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLike(String value) { - addCriterion("identifier like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotLike(String value) { - addCriterion("identifier not like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierIn(List values) { - addCriterion("identifier in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotIn(List values) { - addCriterion("identifier not in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierBetween(String value1, String value2) { - addCriterion("identifier between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotBetween(String value1, String value2) { - addCriterion("identifier not between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andIdSourceIsNull() { - addCriterion("id_source is null"); - return (Criteria) this; - } - - public Criteria andIdSourceIsNotNull() { - addCriterion("id_source is not null"); - return (Criteria) this; - } - - public Criteria andIdSourceEqualTo(Long value) { - addCriterion("id_source =", value, "idSource"); - return (Criteria) this; - } - - public Criteria andIdSourceNotEqualTo(Long value) { - addCriterion("id_source <>", value, "idSource"); - return (Criteria) this; - } - - public Criteria andIdSourceGreaterThan(Long value) { - addCriterion("id_source >", value, "idSource"); - return (Criteria) this; - } - - public Criteria andIdSourceGreaterThanOrEqualTo(Long value) { - addCriterion("id_source >=", value, "idSource"); - return (Criteria) this; - } - - public Criteria andIdSourceLessThan(Long value) { - addCriterion("id_source <", value, "idSource"); - return (Criteria) this; - } - - public Criteria andIdSourceLessThanOrEqualTo(Long value) { - addCriterion("id_source <=", value, "idSource"); - return (Criteria) this; - } - - public Criteria andIdSourceIn(List values) { - addCriterion("id_source in", values, "idSource"); - return (Criteria) this; - } - - public Criteria andIdSourceNotIn(List values) { - addCriterion("id_source not in", values, "idSource"); - return (Criteria) this; - } - - public Criteria andIdSourceBetween(Long value1, Long value2) { - addCriterion("id_source between", value1, value2, "idSource"); - return (Criteria) this; - } - - public Criteria andIdSourceNotBetween(Long value1, Long value2) { - addCriterion("id_source not between", value1, value2, "idSource"); - return (Criteria) this; - } - - public Criteria andIsReservedIsNull() { - addCriterion("is_reserved is null"); - return (Criteria) this; - } - - public Criteria andIsReservedIsNotNull() { - addCriterion("is_reserved is not null"); - return (Criteria) this; - } - - public Criteria andIsReservedEqualTo(Boolean value) { - addCriterion("is_reserved =", value, "isReserved"); - return (Criteria) this; - } - - public Criteria andIsReservedNotEqualTo(Boolean value) { - addCriterion("is_reserved <>", value, "isReserved"); - return (Criteria) this; - } - - public Criteria andIsReservedGreaterThan(Boolean value) { - addCriterion("is_reserved >", value, "isReserved"); - return (Criteria) this; - } - - public Criteria andIsReservedGreaterThanOrEqualTo(Boolean value) { - addCriterion("is_reserved >=", value, "isReserved"); - return (Criteria) this; - } - - public Criteria andIsReservedLessThan(Boolean value) { - addCriterion("is_reserved <", value, "isReserved"); - return (Criteria) this; - } - - public Criteria andIsReservedLessThanOrEqualTo(Boolean value) { - addCriterion("is_reserved <=", value, "isReserved"); - return (Criteria) this; - } - - public Criteria andIsReservedIn(List values) { - addCriterion("is_reserved in", values, "isReserved"); - return (Criteria) this; - } - - public Criteria andIsReservedNotIn(List values) { - addCriterion("is_reserved not in", values, "isReserved"); - return (Criteria) this; - } - - public Criteria andIsReservedBetween(Boolean value1, Boolean value2) { - addCriterion("is_reserved between", value1, value2, "isReserved"); - return (Criteria) this; - } - - public Criteria andIsReservedNotBetween(Boolean value1, Boolean value2) { - addCriterion("is_reserved not between", value1, value2, "isReserved"); - return (Criteria) this; - } - } - - /** + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new IllegalArgumentException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new IllegalArgumentException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new IllegalArgumentException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andLocationIsNull() { + addCriterion("location is null"); + return (Criteria) this; + } + + public Criteria andLocationIsNotNull() { + addCriterion("location is not null"); + return (Criteria) this; + } + + public Criteria andLocationEqualTo(String value) { + addCriterion("location =", value, "location"); + return (Criteria) this; + } + + public Criteria andLocationNotEqualTo(String value) { + addCriterion("location <>", value, "location"); + return (Criteria) this; + } + + public Criteria andLocationGreaterThan(String value) { + addCriterion("location >", value, "location"); + return (Criteria) this; + } + + public Criteria andLocationGreaterThanOrEqualTo(String value) { + addCriterion("location >=", value, "location"); + return (Criteria) this; + } + + public Criteria andLocationLessThan(String value) { + addCriterion("location <", value, "location"); + return (Criteria) this; + } + + public Criteria andLocationLessThanOrEqualTo(String value) { + addCriterion("location <=", value, "location"); + return (Criteria) this; + } + + public Criteria andLocationLike(String value) { + addCriterion("location like", value, "location"); + return (Criteria) this; + } + + public Criteria andLocationNotLike(String value) { + addCriterion("location not like", value, "location"); + return (Criteria) this; + } + + public Criteria andLocationIn(List values) { + addCriterion("location in", values, "location"); + return (Criteria) this; + } + + public Criteria andLocationNotIn(List values) { + addCriterion("location not in", values, "location"); + return (Criteria) this; + } + + public Criteria andLocationBetween(String value1, String value2) { + addCriterion("location between", value1, value2, "location"); + return (Criteria) this; + } + + public Criteria andLocationNotBetween(String value1, String value2) { + addCriterion("location not between", value1, value2, "location"); + return (Criteria) this; + } + + public Criteria andOpenmrsIdIsNull() { + addCriterion("openmrs_id is null"); + return (Criteria) this; + } + + public Criteria andOpenmrsIdIsNotNull() { + addCriterion("openmrs_id is not null"); + return (Criteria) this; + } + + public Criteria andOpenmrsIdEqualTo(String value) { + addCriterion("openmrs_id =", value, "openmrsId"); + return (Criteria) this; + } + + public Criteria andOpenmrsIdNotEqualTo(String value) { + addCriterion("openmrs_id <>", value, "openmrsId"); + return (Criteria) this; + } + + public Criteria andOpenmrsIdGreaterThan(String value) { + addCriterion("openmrs_id >", value, "openmrsId"); + return (Criteria) this; + } + + public Criteria andOpenmrsIdGreaterThanOrEqualTo(String value) { + addCriterion("openmrs_id >=", value, "openmrsId"); + return (Criteria) this; + } + + public Criteria andOpenmrsIdLessThan(String value) { + addCriterion("openmrs_id <", value, "openmrsId"); + return (Criteria) this; + } + + public Criteria andOpenmrsIdLessThanOrEqualTo(String value) { + addCriterion("openmrs_id <=", value, "openmrsId"); + return (Criteria) this; + } + + public Criteria andOpenmrsIdLike(String value) { + addCriterion("openmrs_id like", value, "openmrsId"); + return (Criteria) this; + } + + public Criteria andOpenmrsIdNotLike(String value) { + addCriterion("openmrs_id not like", value, "openmrsId"); + return (Criteria) this; + } + + public Criteria andOpenmrsIdIn(List values) { + addCriterion("openmrs_id in", values, "openmrsId"); + return (Criteria) this; + } + + public Criteria andOpenmrsIdNotIn(List values) { + addCriterion("openmrs_id not in", values, "openmrsId"); + return (Criteria) this; + } + + public Criteria andOpenmrsIdBetween(String value1, String value2) { + addCriterion("openmrs_id between", value1, value2, "openmrsId"); + return (Criteria) this; + } + + public Criteria andOpenmrsIdNotBetween(String value1, String value2) { + addCriterion("openmrs_id not between", value1, value2, "openmrsId"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(String value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(String value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(String value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(String value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLike(String value) { + addCriterion("status like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotLike(String value) { + addCriterion("status not like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andUsedByIsNull() { + addCriterion("used_by is null"); + return (Criteria) this; + } + + public Criteria andUsedByIsNotNull() { + addCriterion("used_by is not null"); + return (Criteria) this; + } + + public Criteria andUsedByEqualTo(String value) { + addCriterion("used_by =", value, "usedBy"); + return (Criteria) this; + } + + public Criteria andUsedByNotEqualTo(String value) { + addCriterion("used_by <>", value, "usedBy"); + return (Criteria) this; + } + + public Criteria andUsedByGreaterThan(String value) { + addCriterion("used_by >", value, "usedBy"); + return (Criteria) this; + } + + public Criteria andUsedByGreaterThanOrEqualTo(String value) { + addCriterion("used_by >=", value, "usedBy"); + return (Criteria) this; + } + + public Criteria andUsedByLessThan(String value) { + addCriterion("used_by <", value, "usedBy"); + return (Criteria) this; + } + + public Criteria andUsedByLessThanOrEqualTo(String value) { + addCriterion("used_by <=", value, "usedBy"); + return (Criteria) this; + } + + public Criteria andUsedByLike(String value) { + addCriterion("used_by like", value, "usedBy"); + return (Criteria) this; + } + + public Criteria andUsedByNotLike(String value) { + addCriterion("used_by not like", value, "usedBy"); + return (Criteria) this; + } + + public Criteria andUsedByIn(List values) { + addCriterion("used_by in", values, "usedBy"); + return (Criteria) this; + } + + public Criteria andUsedByNotIn(List values) { + addCriterion("used_by not in", values, "usedBy"); + return (Criteria) this; + } + + public Criteria andUsedByBetween(String value1, String value2) { + addCriterion("used_by between", value1, value2, "usedBy"); + return (Criteria) this; + } + + public Criteria andUsedByNotBetween(String value1, String value2) { + addCriterion("used_by not between", value1, value2, "usedBy"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNull() { + addCriterion("updated_at is null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNotNull() { + addCriterion("updated_at is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtEqualTo(Date value) { + addCriterion("updated_at =", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotEqualTo(Date value) { + addCriterion("updated_at <>", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThan(Date value) { + addCriterion("updated_at >", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("updated_at >=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThan(Date value) { + addCriterion("updated_at <", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { + addCriterion("updated_at <=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIn(List values) { + addCriterion("updated_at in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotIn(List values) { + addCriterion("updated_at not in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtBetween(Date value1, Date value2) { + addCriterion("updated_at between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { + addCriterion("updated_at not between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Date value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Date value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Date value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Date value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Date value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Date value1, Date value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Date value1, Date value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNull() { + addCriterion("identifier is null"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNotNull() { + addCriterion("identifier is not null"); + return (Criteria) this; + } + + public Criteria andIdentifierEqualTo(String value) { + addCriterion("identifier =", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotEqualTo(String value) { + addCriterion("identifier <>", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThan(String value) { + addCriterion("identifier >", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThanOrEqualTo(String value) { + addCriterion("identifier >=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThan(String value) { + addCriterion("identifier <", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThanOrEqualTo(String value) { + addCriterion("identifier <=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLike(String value) { + addCriterion("identifier like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotLike(String value) { + addCriterion("identifier not like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierIn(List values) { + addCriterion("identifier in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotIn(List values) { + addCriterion("identifier not in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierBetween(String value1, String value2) { + addCriterion("identifier between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotBetween(String value1, String value2) { + addCriterion("identifier not between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andIdSourceIsNull() { + addCriterion("id_source is null"); + return (Criteria) this; + } + + public Criteria andIdSourceIsNotNull() { + addCriterion("id_source is not null"); + return (Criteria) this; + } + + public Criteria andIdSourceEqualTo(Long value) { + addCriterion("id_source =", value, "idSource"); + return (Criteria) this; + } + + public Criteria andIdSourceNotEqualTo(Long value) { + addCriterion("id_source <>", value, "idSource"); + return (Criteria) this; + } + + public Criteria andIdSourceGreaterThan(Long value) { + addCriterion("id_source >", value, "idSource"); + return (Criteria) this; + } + + public Criteria andIdSourceGreaterThanOrEqualTo(Long value) { + addCriterion("id_source >=", value, "idSource"); + return (Criteria) this; + } + + public Criteria andIdSourceLessThan(Long value) { + addCriterion("id_source <", value, "idSource"); + return (Criteria) this; + } + + public Criteria andIdSourceLessThanOrEqualTo(Long value) { + addCriterion("id_source <=", value, "idSource"); + return (Criteria) this; + } + + public Criteria andIdSourceIn(List values) { + addCriterion("id_source in", values, "idSource"); + return (Criteria) this; + } + + public Criteria andIdSourceNotIn(List values) { + addCriterion("id_source not in", values, "idSource"); + return (Criteria) this; + } + + public Criteria andIdSourceBetween(Long value1, Long value2) { + addCriterion("id_source between", value1, value2, "idSource"); + return (Criteria) this; + } + + public Criteria andIdSourceNotBetween(Long value1, Long value2) { + addCriterion("id_source not between", value1, value2, "idSource"); + return (Criteria) this; + } + + public Criteria andIsReservedIsNull() { + addCriterion("is_reserved is null"); + return (Criteria) this; + } + + public Criteria andIsReservedIsNotNull() { + addCriterion("is_reserved is not null"); + return (Criteria) this; + } + + public Criteria andIsReservedEqualTo(Boolean value) { + addCriterion("is_reserved =", value, "isReserved"); + return (Criteria) this; + } + + public Criteria andIsReservedNotEqualTo(Boolean value) { + addCriterion("is_reserved <>", value, "isReserved"); + return (Criteria) this; + } + + public Criteria andIsReservedGreaterThan(Boolean value) { + addCriterion("is_reserved >", value, "isReserved"); + return (Criteria) this; + } + + public Criteria andIsReservedGreaterThanOrEqualTo(Boolean value) { + addCriterion("is_reserved >=", value, "isReserved"); + return (Criteria) this; + } + + public Criteria andIsReservedLessThan(Boolean value) { + addCriterion("is_reserved <", value, "isReserved"); + return (Criteria) this; + } + + public Criteria andIsReservedLessThanOrEqualTo(Boolean value) { + addCriterion("is_reserved <=", value, "isReserved"); + return (Criteria) this; + } + + public Criteria andIsReservedIn(List values) { + addCriterion("is_reserved in", values, "isReserved"); + return (Criteria) this; + } + + public Criteria andIsReservedNotIn(List values) { + addCriterion("is_reserved not in", values, "isReserved"); + return (Criteria) this; + } + + public Criteria andIsReservedBetween(Boolean value1, Boolean value2) { + addCriterion("is_reserved between", value1, value2, "isReserved"); + return (Criteria) this; + } + + public Criteria andIsReservedNotBetween(Boolean value1, Boolean value2) { + addCriterion("is_reserved not between", value1, value2, "isReserved"); + return (Criteria) this; + } + } + + /** * This class was generated by MyBatis Generator. * This class corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - public static class Criterion { - private String condition; - private Object value; - private Object secondValue; - private boolean noValue; - private boolean singleValue; - private boolean betweenValue; - private boolean listValue; - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** + */ + public static class Criterion { + private String condition; + private Object value; + private Object secondValue; + private boolean noValue; + private boolean singleValue; + private boolean betweenValue; + private boolean listValue; + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** * This class was generated by MyBatis Generator. * This class corresponds to the database table core.unique_id * diff --git a/src/main/java/org/opensrp/domain/postgres/ViewConfiguration.java b/src/main/java/org/opensrp/domain/postgres/ViewConfiguration.java index d7cceeebe..40607d06e 100644 --- a/src/main/java/org/opensrp/domain/postgres/ViewConfiguration.java +++ b/src/main/java/org/opensrp/domain/postgres/ViewConfiguration.java @@ -2,73 +2,82 @@ public class ViewConfiguration { - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.view_configuration.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Long id; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.view_configuration.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Object json; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column core.view_configuration.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - private Long serverVersion; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.view_configuration.id + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Long id; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.view_configuration.json + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Object json; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column core.view_configuration.server_version + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + private Long serverVersion; - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.view_configuration.id - * @return the value of core.view_configuration.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Long getId() { - return id; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.view_configuration.id + * + * @return the value of core.view_configuration.id + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Long getId() { + return id; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.view_configuration.id - * @param id the value for core.view_configuration.id - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setId(Long id) { - this.id = id; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.view_configuration.id + * + * @param id the value for core.view_configuration.id + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setId(Long id) { + this.id = id; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.view_configuration.json - * @return the value of core.view_configuration.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Object getJson() { - return json; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.view_configuration.json + * + * @return the value of core.view_configuration.json + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Object getJson() { + return json; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.view_configuration.json - * @param json the value for core.view_configuration.json - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setJson(Object json) { - this.json = json; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.view_configuration.json + * + * @param json the value for core.view_configuration.json + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setJson(Object json) { + this.json = json; + } - /** - * This method was generated by MyBatis Generator. This method returns the value of the database column core.view_configuration.server_version - * @return the value of core.view_configuration.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Long getServerVersion() { - return serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column core.view_configuration.server_version + * + * @return the value of core.view_configuration.server_version + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Long getServerVersion() { + return serverVersion; + } - /** - * This method was generated by MyBatis Generator. This method sets the value of the database column core.view_configuration.server_version - * @param serverVersion the value for core.view_configuration.server_version - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column core.view_configuration.server_version + * + * @param serverVersion the value for core.view_configuration.server_version + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ViewConfigurationExample.java b/src/main/java/org/opensrp/domain/postgres/ViewConfigurationExample.java index efea1d52f..02be4b7c6 100644 --- a/src/main/java/org/opensrp/domain/postgres/ViewConfigurationExample.java +++ b/src/main/java/org/opensrp/domain/postgres/ViewConfigurationExample.java @@ -4,483 +4,499 @@ import java.util.List; public class ViewConfigurationExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected String orderByClause; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected boolean distinct; - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public ViewConfigurationExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - protected abstract static class GeneratedCriteria { - - protected List jsonCriteria; - - protected List allCriteria; - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - jsonCriteria = new ArrayList<>(); - } - - public List getJsonCriteria() { - return jsonCriteria; - } - - protected void addJsonCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - jsonCriteria.add( - new Criterion(condition, value, "org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler")); - allCriteria = null; - } - - protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - jsonCriteria.add(new Criterion(condition, value1, value2, - "org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler")); - allCriteria = null; - } - - public boolean isValid() { - return criteria.size() > 0 || jsonCriteria.size() > 0; - } - - public List getAllCriteria() { - if (allCriteria == null) { - allCriteria = new ArrayList<>(); - allCriteria.addAll(criteria); - allCriteria.addAll(jsonCriteria); - } - return allCriteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - allCriteria = null; - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - allCriteria = null; - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andJsonIsNull() { - addCriterion("json is null"); - return (Criteria) this; - } - - public Criteria andJsonIsNotNull() { - addCriterion("json is not null"); - return (Criteria) this; - } - - public Criteria andJsonEqualTo(Object value) { - addJsonCriterion("json =", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotEqualTo(Object value) { - addJsonCriterion("json <>", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThan(Object value) { - addJsonCriterion("json >", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonGreaterThanOrEqualTo(Object value) { - addJsonCriterion("json >=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThan(Object value) { - addJsonCriterion("json <", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonLessThanOrEqualTo(Object value) { - addJsonCriterion("json <=", value, "json"); - return (Criteria) this; - } - - public Criteria andJsonIn(List values) { - addJsonCriterion("json in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotIn(List values) { - addJsonCriterion("json not in", values, "json"); - return (Criteria) this; - } - - public Criteria andJsonBetween(Object value1, Object value2) { - addJsonCriterion("json between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andJsonNotBetween(Object value1, Object value2) { - addJsonCriterion("json not between", value1, value2, "json"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.view_configuration - * - * @mbg.generated do_not_delete_during_merge Mon Apr 23 10:00:13 EAT 2018 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected String orderByClause; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected boolean distinct; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public ViewConfigurationExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + protected abstract static class GeneratedCriteria { + + protected List jsonCriteria; + + protected List allCriteria; + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + jsonCriteria = new ArrayList<>(); + } + + public List getJsonCriteria() { + return jsonCriteria; + } + + protected void addJsonCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + jsonCriteria.add( + new Criterion(condition, value, "org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler")); + allCriteria = null; + } + + protected void addJsonCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + jsonCriteria.add(new Criterion(condition, value1, value2, + "org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler")); + allCriteria = null; + } + + public boolean isValid() { + return criteria.size() > 0 || jsonCriteria.size() > 0; + } + + public List getAllCriteria() { + if (allCriteria == null) { + allCriteria = new ArrayList<>(); + allCriteria.addAll(criteria); + allCriteria.addAll(jsonCriteria); + } + return allCriteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + allCriteria = null; + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + allCriteria = null; + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andJsonIsNull() { + addCriterion("json is null"); + return (Criteria) this; + } + + public Criteria andJsonIsNotNull() { + addCriterion("json is not null"); + return (Criteria) this; + } + + public Criteria andJsonEqualTo(Object value) { + addJsonCriterion("json =", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotEqualTo(Object value) { + addJsonCriterion("json <>", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThan(Object value) { + addJsonCriterion("json >", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonGreaterThanOrEqualTo(Object value) { + addJsonCriterion("json >=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThan(Object value) { + addJsonCriterion("json <", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonLessThanOrEqualTo(Object value) { + addJsonCriterion("json <=", value, "json"); + return (Criteria) this; + } + + public Criteria andJsonIn(List values) { + addJsonCriterion("json in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotIn(List values) { + addJsonCriterion("json not in", values, "json"); + return (Criteria) this; + } + + public Criteria andJsonBetween(Object value1, Object value2) { + addJsonCriterion("json between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andJsonNotBetween(Object value1, Object value2) { + addJsonCriterion("json not between", value1, value2, "json"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.view_configuration + * + * @mbg.generated do_not_delete_during_merge Mon Apr 23 10:00:13 EAT 2018 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ViewConfigurationMetadata.java b/src/main/java/org/opensrp/domain/postgres/ViewConfigurationMetadata.java index 8c39221d0..7652a925d 100644 --- a/src/main/java/org/opensrp/domain/postgres/ViewConfigurationMetadata.java +++ b/src/main/java/org/opensrp/domain/postgres/ViewConfigurationMetadata.java @@ -1,155 +1,155 @@ package org.opensrp.domain.postgres; public class ViewConfigurationMetadata { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.view_configuration_metadata.id - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.view_configuration_metadata.view_configuration_id - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - private Long viewConfigurationId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.view_configuration_metadata.document_id - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - private String documentId; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.view_configuration_metadata.identifier - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - private String identifier; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database column - * core.view_configuration_metadata.server_version - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - private Long serverVersion; - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.view_configuration_metadata.id - * - * @return the value of core.view_configuration_metadata.id - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.view_configuration_metadata.id - * - * @param id the value for core.view_configuration_metadata.id - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.view_configuration_metadata.view_configuration_id - * - * @return the value of core.view_configuration_metadata.view_configuration_id - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public Long getViewConfigurationId() { - return viewConfigurationId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.view_configuration_metadata.view_configuration_id - * - * @param viewConfigurationId the value for - * core.view_configuration_metadata.view_configuration_id - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public void setViewConfigurationId(Long viewConfigurationId) { - this.viewConfigurationId = viewConfigurationId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.view_configuration_metadata.document_id - * - * @return the value of core.view_configuration_metadata.document_id - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public String getDocumentId() { - return documentId; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.view_configuration_metadata.document_id - * - * @param documentId the value for core.view_configuration_metadata.document_id - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public void setDocumentId(String documentId) { - this.documentId = documentId; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.view_configuration_metadata.identifier - * - * @return the value of core.view_configuration_metadata.identifier - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public String getIdentifier() { - return identifier; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.view_configuration_metadata.identifier - * - * @param identifier the value for core.view_configuration_metadata.identifier - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - /** - * This method was generated by MyBatis Generator. This method returns the value of the database - * column core.view_configuration_metadata.server_version - * - * @return the value of core.view_configuration_metadata.server_version - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public Long getServerVersion() { - return serverVersion; - } - - /** - * This method was generated by MyBatis Generator. This method sets the value of the database - * column core.view_configuration_metadata.server_version - * - * @param serverVersion the value for core.view_configuration_metadata.server_version - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.view_configuration_metadata.id + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.view_configuration_metadata.view_configuration_id + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + private Long viewConfigurationId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.view_configuration_metadata.document_id + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + private String documentId; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.view_configuration_metadata.identifier + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + private String identifier; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column + * core.view_configuration_metadata.server_version + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + private Long serverVersion; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.view_configuration_metadata.id + * + * @return the value of core.view_configuration_metadata.id + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.view_configuration_metadata.id + * + * @param id the value for core.view_configuration_metadata.id + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.view_configuration_metadata.view_configuration_id + * + * @return the value of core.view_configuration_metadata.view_configuration_id + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public Long getViewConfigurationId() { + return viewConfigurationId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.view_configuration_metadata.view_configuration_id + * + * @param viewConfigurationId the value for + * core.view_configuration_metadata.view_configuration_id + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public void setViewConfigurationId(Long viewConfigurationId) { + this.viewConfigurationId = viewConfigurationId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.view_configuration_metadata.document_id + * + * @return the value of core.view_configuration_metadata.document_id + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public String getDocumentId() { + return documentId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.view_configuration_metadata.document_id + * + * @param documentId the value for core.view_configuration_metadata.document_id + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public void setDocumentId(String documentId) { + this.documentId = documentId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.view_configuration_metadata.identifier + * + * @return the value of core.view_configuration_metadata.identifier + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public String getIdentifier() { + return identifier; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.view_configuration_metadata.identifier + * + * @param identifier the value for core.view_configuration_metadata.identifier + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database + * column core.view_configuration_metadata.server_version + * + * @return the value of core.view_configuration_metadata.server_version + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public Long getServerVersion() { + return serverVersion; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database + * column core.view_configuration_metadata.server_version + * + * @param serverVersion the value for core.view_configuration_metadata.server_version + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } } diff --git a/src/main/java/org/opensrp/domain/postgres/ViewConfigurationMetadataExample.java b/src/main/java/org/opensrp/domain/postgres/ViewConfigurationMetadataExample.java index 3af9fcd27..269099e0c 100644 --- a/src/main/java/org/opensrp/domain/postgres/ViewConfigurationMetadataExample.java +++ b/src/main/java/org/opensrp/domain/postgres/ViewConfigurationMetadataExample.java @@ -4,622 +4,622 @@ import java.util.List; public class ViewConfigurationMetadataExample { - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. This field corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public ViewConfigurationMetadataExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andViewConfigurationIdIsNull() { - addCriterion("view_configuration_id is null"); - return (Criteria) this; - } - - public Criteria andViewConfigurationIdIsNotNull() { - addCriterion("view_configuration_id is not null"); - return (Criteria) this; - } - - public Criteria andViewConfigurationIdEqualTo(Long value) { - addCriterion("view_configuration_id =", value, "viewConfigurationId"); - return (Criteria) this; - } - - public Criteria andViewConfigurationIdNotEqualTo(Long value) { - addCriterion("view_configuration_id <>", value, "viewConfigurationId"); - return (Criteria) this; - } - - public Criteria andViewConfigurationIdGreaterThan(Long value) { - addCriterion("view_configuration_id >", value, "viewConfigurationId"); - return (Criteria) this; - } - - public Criteria andViewConfigurationIdGreaterThanOrEqualTo(Long value) { - addCriterion("view_configuration_id >=", value, "viewConfigurationId"); - return (Criteria) this; - } - - public Criteria andViewConfigurationIdLessThan(Long value) { - addCriterion("view_configuration_id <", value, "viewConfigurationId"); - return (Criteria) this; - } - - public Criteria andViewConfigurationIdLessThanOrEqualTo(Long value) { - addCriterion("view_configuration_id <=", value, "viewConfigurationId"); - return (Criteria) this; - } - - public Criteria andViewConfigurationIdIn(List values) { - addCriterion("view_configuration_id in", values, "viewConfigurationId"); - return (Criteria) this; - } - - public Criteria andViewConfigurationIdNotIn(List values) { - addCriterion("view_configuration_id not in", values, "viewConfigurationId"); - return (Criteria) this; - } - - public Criteria andViewConfigurationIdBetween(Long value1, Long value2) { - addCriterion("view_configuration_id between", value1, value2, "viewConfigurationId"); - return (Criteria) this; - } - - public Criteria andViewConfigurationIdNotBetween(Long value1, Long value2) { - addCriterion("view_configuration_id not between", value1, value2, "viewConfigurationId"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNull() { - addCriterion("document_id is null"); - return (Criteria) this; - } - - public Criteria andDocumentIdIsNotNull() { - addCriterion("document_id is not null"); - return (Criteria) this; - } - - public Criteria andDocumentIdEqualTo(String value) { - addCriterion("document_id =", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotEqualTo(String value) { - addCriterion("document_id <>", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThan(String value) { - addCriterion("document_id >", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { - addCriterion("document_id >=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThan(String value) { - addCriterion("document_id <", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLessThanOrEqualTo(String value) { - addCriterion("document_id <=", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdLike(String value) { - addCriterion("document_id like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotLike(String value) { - addCriterion("document_id not like", value, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdIn(List values) { - addCriterion("document_id in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotIn(List values) { - addCriterion("document_id not in", values, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdBetween(String value1, String value2) { - addCriterion("document_id between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andDocumentIdNotBetween(String value1, String value2) { - addCriterion("document_id not between", value1, value2, "documentId"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNull() { - addCriterion("identifier is null"); - return (Criteria) this; - } - - public Criteria andIdentifierIsNotNull() { - addCriterion("identifier is not null"); - return (Criteria) this; - } - - public Criteria andIdentifierEqualTo(String value) { - addCriterion("identifier =", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotEqualTo(String value) { - addCriterion("identifier <>", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThan(String value) { - addCriterion("identifier >", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierGreaterThanOrEqualTo(String value) { - addCriterion("identifier >=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThan(String value) { - addCriterion("identifier <", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLessThanOrEqualTo(String value) { - addCriterion("identifier <=", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierLike(String value) { - addCriterion("identifier like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotLike(String value) { - addCriterion("identifier not like", value, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierIn(List values) { - addCriterion("identifier in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotIn(List values) { - addCriterion("identifier not in", values, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierBetween(String value1, String value2) { - addCriterion("identifier between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andIdentifierNotBetween(String value1, String value2) { - addCriterion("identifier not between", value1, value2, "identifier"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNull() { - addCriterion("server_version is null"); - return (Criteria) this; - } - - public Criteria andServerVersionIsNotNull() { - addCriterion("server_version is not null"); - return (Criteria) this; - } - - public Criteria andServerVersionEqualTo(Long value) { - addCriterion("server_version =", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotEqualTo(Long value) { - addCriterion("server_version <>", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThan(Long value) { - addCriterion("server_version >", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { - addCriterion("server_version >=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThan(Long value) { - addCriterion("server_version <", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionLessThanOrEqualTo(Long value) { - addCriterion("server_version <=", value, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionIn(List values) { - addCriterion("server_version in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotIn(List values) { - addCriterion("server_version not in", values, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionBetween(Long value1, Long value2) { - addCriterion("server_version between", value1, value2, "serverVersion"); - return (Criteria) this; - } - - public Criteria andServerVersionNotBetween(Long value1, Long value2) { - addCriterion("server_version not between", value1, value2, "serverVersion"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated do_not_delete_during_merge Mon Apr 23 10:29:52 EAT 2018 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. This class corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public ViewConfigurationMetadataExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andViewConfigurationIdIsNull() { + addCriterion("view_configuration_id is null"); + return (Criteria) this; + } + + public Criteria andViewConfigurationIdIsNotNull() { + addCriterion("view_configuration_id is not null"); + return (Criteria) this; + } + + public Criteria andViewConfigurationIdEqualTo(Long value) { + addCriterion("view_configuration_id =", value, "viewConfigurationId"); + return (Criteria) this; + } + + public Criteria andViewConfigurationIdNotEqualTo(Long value) { + addCriterion("view_configuration_id <>", value, "viewConfigurationId"); + return (Criteria) this; + } + + public Criteria andViewConfigurationIdGreaterThan(Long value) { + addCriterion("view_configuration_id >", value, "viewConfigurationId"); + return (Criteria) this; + } + + public Criteria andViewConfigurationIdGreaterThanOrEqualTo(Long value) { + addCriterion("view_configuration_id >=", value, "viewConfigurationId"); + return (Criteria) this; + } + + public Criteria andViewConfigurationIdLessThan(Long value) { + addCriterion("view_configuration_id <", value, "viewConfigurationId"); + return (Criteria) this; + } + + public Criteria andViewConfigurationIdLessThanOrEqualTo(Long value) { + addCriterion("view_configuration_id <=", value, "viewConfigurationId"); + return (Criteria) this; + } + + public Criteria andViewConfigurationIdIn(List values) { + addCriterion("view_configuration_id in", values, "viewConfigurationId"); + return (Criteria) this; + } + + public Criteria andViewConfigurationIdNotIn(List values) { + addCriterion("view_configuration_id not in", values, "viewConfigurationId"); + return (Criteria) this; + } + + public Criteria andViewConfigurationIdBetween(Long value1, Long value2) { + addCriterion("view_configuration_id between", value1, value2, "viewConfigurationId"); + return (Criteria) this; + } + + public Criteria andViewConfigurationIdNotBetween(Long value1, Long value2) { + addCriterion("view_configuration_id not between", value1, value2, "viewConfigurationId"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNull() { + addCriterion("document_id is null"); + return (Criteria) this; + } + + public Criteria andDocumentIdIsNotNull() { + addCriterion("document_id is not null"); + return (Criteria) this; + } + + public Criteria andDocumentIdEqualTo(String value) { + addCriterion("document_id =", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotEqualTo(String value) { + addCriterion("document_id <>", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThan(String value) { + addCriterion("document_id >", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdGreaterThanOrEqualTo(String value) { + addCriterion("document_id >=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThan(String value) { + addCriterion("document_id <", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLessThanOrEqualTo(String value) { + addCriterion("document_id <=", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdLike(String value) { + addCriterion("document_id like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotLike(String value) { + addCriterion("document_id not like", value, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdIn(List values) { + addCriterion("document_id in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotIn(List values) { + addCriterion("document_id not in", values, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdBetween(String value1, String value2) { + addCriterion("document_id between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andDocumentIdNotBetween(String value1, String value2) { + addCriterion("document_id not between", value1, value2, "documentId"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNull() { + addCriterion("identifier is null"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNotNull() { + addCriterion("identifier is not null"); + return (Criteria) this; + } + + public Criteria andIdentifierEqualTo(String value) { + addCriterion("identifier =", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotEqualTo(String value) { + addCriterion("identifier <>", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThan(String value) { + addCriterion("identifier >", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThanOrEqualTo(String value) { + addCriterion("identifier >=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThan(String value) { + addCriterion("identifier <", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThanOrEqualTo(String value) { + addCriterion("identifier <=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLike(String value) { + addCriterion("identifier like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotLike(String value) { + addCriterion("identifier not like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierIn(List values) { + addCriterion("identifier in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotIn(List values) { + addCriterion("identifier not in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierBetween(String value1, String value2) { + addCriterion("identifier between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotBetween(String value1, String value2) { + addCriterion("identifier not between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNull() { + addCriterion("server_version is null"); + return (Criteria) this; + } + + public Criteria andServerVersionIsNotNull() { + addCriterion("server_version is not null"); + return (Criteria) this; + } + + public Criteria andServerVersionEqualTo(Long value) { + addCriterion("server_version =", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotEqualTo(Long value) { + addCriterion("server_version <>", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThan(Long value) { + addCriterion("server_version >", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionGreaterThanOrEqualTo(Long value) { + addCriterion("server_version >=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThan(Long value) { + addCriterion("server_version <", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionLessThanOrEqualTo(Long value) { + addCriterion("server_version <=", value, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionIn(List values) { + addCriterion("server_version in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotIn(List values) { + addCriterion("server_version not in", values, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionBetween(Long value1, Long value2) { + addCriterion("server_version between", value1, value2, "serverVersion"); + return (Criteria) this; + } + + public Criteria andServerVersionNotBetween(Long value1, Long value2) { + addCriterion("server_version not between", value1, value2, "serverVersion"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated do_not_delete_during_merge Mon Apr 23 10:29:52 EAT 2018 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + } } diff --git a/src/main/java/org/opensrp/domain/setting/Setting.java b/src/main/java/org/opensrp/domain/setting/Setting.java index 46d715ad8..a556502a4 100644 --- a/src/main/java/org/opensrp/domain/setting/Setting.java +++ b/src/main/java/org/opensrp/domain/setting/Setting.java @@ -7,113 +7,113 @@ public class Setting extends SettingSearchBean { - @JsonProperty - private String key; + @JsonProperty + private String key; - @JsonProperty - private String value; + @JsonProperty + private String value; - @JsonProperty - private JSONArray values; + @JsonProperty + private JSONArray values; - @JsonProperty - private String label; + @JsonProperty + private String label; - @JsonProperty - private String description; + @JsonProperty + private String description; - @JsonProperty - private String inheritedFrom; + @JsonProperty + private String inheritedFrom; - @JsonProperty - private String uuid; + @JsonProperty + private String uuid; - @JsonProperty - private String settingsId; + @JsonProperty + private String settingsId; - @JsonProperty - private String settingIdentifier; + @JsonProperty + private String settingIdentifier; - @JsonProperty() - private String settingMetadataId; + @JsonProperty() + private String settingMetadataId; - public String getKey() { - return key; - } + public String getKey() { + return key; + } - public void setKey(String key) { - this.key = key; - } + public void setKey(String key) { + this.key = key; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - public void setValue(String value) { - this.value = value; - } + public void setValue(String value) { + this.value = value; + } - public String getLabel() { - return label; - } + public String getLabel() { + return label; + } - public void setLabel(String label) { - this.label = label; - } + public void setLabel(String label) { + this.label = label; + } - public String getDescription() { - return description; - } + public String getDescription() { + return description; + } - public JSONArray getValues() { - return values; - } + public void setDescription(String description) { + this.description = description; + } - public void setValues(JSONArray values) { - this.values = values; - } + public JSONArray getValues() { + return values; + } - public void setDescription(String description) { - this.description = description; - } + public void setValues(JSONArray values) { + this.values = values; + } - public String getInheritedFrom() { - return inheritedFrom; - } + public String getInheritedFrom() { + return inheritedFrom; + } - public void setInheritedFrom(String inheritedFrom) { - this.inheritedFrom = inheritedFrom; - } + public void setInheritedFrom(String inheritedFrom) { + this.inheritedFrom = inheritedFrom; + } - public String getUuid() { - return uuid; - } + public String getUuid() { + return uuid; + } - public void setUuid(String uuid) { - this.uuid = uuid; - } + public void setUuid(String uuid) { + this.uuid = uuid; + } - public String getSettingsId() { - return settingsId; - } + public String getSettingsId() { + return settingsId; + } - public void setSettingsId(String settingsId) { - this.settingsId = settingsId; - } + public void setSettingsId(String settingsId) { + this.settingsId = settingsId; + } - public String getSettingIdentifier() { - return settingIdentifier; - } + public String getSettingIdentifier() { + return settingIdentifier; + } - public void setSettingIdentifier(String settingIdentifier) { - this.settingIdentifier = settingIdentifier; - } + public void setSettingIdentifier(String settingIdentifier) { + this.settingIdentifier = settingIdentifier; + } - public String getSettingMetadataId() { - return settingMetadataId; - } + public String getSettingMetadataId() { + return settingMetadataId; + } - public void setSettingMetadataId(String settingMetadataId) { - this.settingMetadataId = settingMetadataId; - } + public void setSettingMetadataId(String settingMetadataId) { + this.settingMetadataId = settingMetadataId; + } } diff --git a/src/main/java/org/opensrp/domain/setting/SettingConfiguration.java b/src/main/java/org/opensrp/domain/setting/SettingConfiguration.java index b77852f40..5291a429d 100644 --- a/src/main/java/org/opensrp/domain/setting/SettingConfiguration.java +++ b/src/main/java/org/opensrp/domain/setting/SettingConfiguration.java @@ -8,27 +8,27 @@ public class SettingConfiguration extends SettingSearchBean { - private static final long serialVersionUID = 1890883609898207738L; + private static final long serialVersionUID = 1890883609898207738L; - @JsonProperty - private List settings; + @JsonProperty + private List settings; - @JsonProperty - private String configurationIdentifier; + @JsonProperty + private String configurationIdentifier; - public List getSettings() { - return settings; - } + public List getSettings() { + return settings; + } - public void setSettings(List settings) { - this.settings = settings; - } + public void setSettings(List settings) { + this.settings = settings; + } - public String getConfigurationIdentifier() { - return configurationIdentifier; - } + public String getConfigurationIdentifier() { + return configurationIdentifier; + } - public void setConfigurationIdentifier(String configurationIdentifier) { - this.configurationIdentifier = configurationIdentifier; - } + public void setConfigurationIdentifier(String configurationIdentifier) { + this.configurationIdentifier = configurationIdentifier; + } } diff --git a/src/main/java/org/opensrp/domain/viewconfiguration/BaseConfiguration.java b/src/main/java/org/opensrp/domain/viewconfiguration/BaseConfiguration.java index f48d11d05..2130bc836 100644 --- a/src/main/java/org/opensrp/domain/viewconfiguration/BaseConfiguration.java +++ b/src/main/java/org/opensrp/domain/viewconfiguration/BaseConfiguration.java @@ -7,31 +7,31 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; @JsonTypeInfo(use = Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ @Type(value = LoginConfiguration.class, name = "Login"), +@JsonSubTypes({@Type(value = LoginConfiguration.class, name = "Login"), @Type(value = MainConfiguration.class, name = "Main"), - @Type(value = RegisterConfiguration.class, name = "Register") }) + @Type(value = RegisterConfiguration.class, name = "Register")}) public abstract class BaseConfiguration { - - @JsonProperty - private String language; - - @JsonProperty - private String applicationName; - - public String getLanguage() { - return language; - } - - public void setLanguage(String language) { - this.language = language; - } - - public String getApplicationName() { - return applicationName; - } - - public void setApplicationName(String applicationName) { - this.applicationName = applicationName; - } - + + @JsonProperty + private String language; + + @JsonProperty + private String applicationName; + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } + + public String getApplicationName() { + return applicationName; + } + + public void setApplicationName(String applicationName) { + this.applicationName = applicationName; + } + } diff --git a/src/main/java/org/opensrp/domain/viewconfiguration/LoginConfiguration.java b/src/main/java/org/opensrp/domain/viewconfiguration/LoginConfiguration.java index 1ae613370..3a292d131 100644 --- a/src/main/java/org/opensrp/domain/viewconfiguration/LoginConfiguration.java +++ b/src/main/java/org/opensrp/domain/viewconfiguration/LoginConfiguration.java @@ -3,74 +3,74 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class LoginConfiguration extends BaseConfiguration { - - @JsonProperty - private boolean showPasswordCheckbox; - - @JsonProperty - private String logoUrl; - - @JsonProperty - private Background background; - - public boolean getShowPasswordCheckbox() { - return showPasswordCheckbox; - } - - public void setShowPasswordCheckbox(boolean showPasswordCheckbox) { - this.showPasswordCheckbox = showPasswordCheckbox; - } - - public String getLogoUrl() { - return logoUrl; - } - - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } - - public Background getBackground() { - return background; - } - - public void setBackground(Background background) { - this.background = background; - } - - static class Background { - - @JsonProperty - private String orientation; - - @JsonProperty - private String startColor; - - @JsonProperty - private String endColor; - - public String getOrientation() { - return orientation; - } - - public void setOrientation(String orientation) { - this.orientation = orientation; - } - - public String getStartColor() { - return startColor; - } - - public void setStartColor(String startColor) { - this.startColor = startColor; - } - - public String getEndColor() { - return endColor; - } - - public void setEndColor(String endColor) { - this.endColor = endColor; - } - - } + + @JsonProperty + private boolean showPasswordCheckbox; + + @JsonProperty + private String logoUrl; + + @JsonProperty + private Background background; + + public boolean getShowPasswordCheckbox() { + return showPasswordCheckbox; + } + + public void setShowPasswordCheckbox(boolean showPasswordCheckbox) { + this.showPasswordCheckbox = showPasswordCheckbox; + } + + public String getLogoUrl() { + return logoUrl; + } + + public void setLogoUrl(String logoUrl) { + this.logoUrl = logoUrl; + } + + public Background getBackground() { + return background; + } + + public void setBackground(Background background) { + this.background = background; + } + + static class Background { + + @JsonProperty + private String orientation; + + @JsonProperty + private String startColor; + + @JsonProperty + private String endColor; + + public String getOrientation() { + return orientation; + } + + public void setOrientation(String orientation) { + this.orientation = orientation; + } + + public String getStartColor() { + return startColor; + } + + public void setStartColor(String startColor) { + this.startColor = startColor; + } + + public String getEndColor() { + return endColor; + } + + public void setEndColor(String endColor) { + this.endColor = endColor; + } + + } } diff --git a/src/main/java/org/opensrp/domain/viewconfiguration/MainConfiguration.java b/src/main/java/org/opensrp/domain/viewconfiguration/MainConfiguration.java index 8736e5e55..ad242a035 100644 --- a/src/main/java/org/opensrp/domain/viewconfiguration/MainConfiguration.java +++ b/src/main/java/org/opensrp/domain/viewconfiguration/MainConfiguration.java @@ -3,16 +3,16 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class MainConfiguration extends BaseConfiguration { - - @JsonProperty - private boolean enableJsonViews; - - public boolean getEnableJsonViews() { - return enableJsonViews; - } - - public void setEnableJsonViews(boolean enableJsonViews) { - this.enableJsonViews = enableJsonViews; - } - + + @JsonProperty + private boolean enableJsonViews; + + public boolean getEnableJsonViews() { + return enableJsonViews; + } + + public void setEnableJsonViews(boolean enableJsonViews) { + this.enableJsonViews = enableJsonViews; + } + } diff --git a/src/main/java/org/opensrp/domain/viewconfiguration/RegisterConfiguration.java b/src/main/java/org/opensrp/domain/viewconfiguration/RegisterConfiguration.java index 6c4dfdef3..aa2a32549 100644 --- a/src/main/java/org/opensrp/domain/viewconfiguration/RegisterConfiguration.java +++ b/src/main/java/org/opensrp/domain/viewconfiguration/RegisterConfiguration.java @@ -3,55 +3,55 @@ import java.util.List; public class RegisterConfiguration extends BaseConfiguration { - - private boolean enableAdvancedSearch; - - private boolean enableSortList; - - private boolean enableFilterList; - - private String searchBarText; - - private List searchableFields; - - public boolean isEnableAdvancedSearch() { - return enableAdvancedSearch; - } - - public void setEnableAdvancedSearch(boolean enableAdvancedSearch) { - this.enableAdvancedSearch = enableAdvancedSearch; - } - - public boolean isEnableSortList() { - return enableSortList; - } - - public void setEnableSortList(boolean enableSortList) { - this.enableSortList = enableSortList; - } - - public boolean isEnableFilterList() { - return enableFilterList; - } - - public void setEnableFilterList(boolean enableFilterList) { - this.enableFilterList = enableFilterList; - } - - public String getSearchBarText() { - return searchBarText; - } - - public void setSearchBarText(String searchBarText) { - this.searchBarText = searchBarText; - } - - public List getSearchableFields() { - return searchableFields; - } - - public void setSearchableFields(List searchableFields) { - this.searchableFields = searchableFields; - } - + + private boolean enableAdvancedSearch; + + private boolean enableSortList; + + private boolean enableFilterList; + + private String searchBarText; + + private List searchableFields; + + public boolean isEnableAdvancedSearch() { + return enableAdvancedSearch; + } + + public void setEnableAdvancedSearch(boolean enableAdvancedSearch) { + this.enableAdvancedSearch = enableAdvancedSearch; + } + + public boolean isEnableSortList() { + return enableSortList; + } + + public void setEnableSortList(boolean enableSortList) { + this.enableSortList = enableSortList; + } + + public boolean isEnableFilterList() { + return enableFilterList; + } + + public void setEnableFilterList(boolean enableFilterList) { + this.enableFilterList = enableFilterList; + } + + public String getSearchBarText() { + return searchBarText; + } + + public void setSearchBarText(String searchBarText) { + this.searchBarText = searchBarText; + } + + public List getSearchableFields() { + return searchableFields; + } + + public void setSearchableFields(List searchableFields) { + this.searchableFields = searchableFields; + } + } diff --git a/src/main/java/org/opensrp/domain/viewconfiguration/View.java b/src/main/java/org/opensrp/domain/viewconfiguration/View.java index 42ea9d0c1..d35a9dd29 100644 --- a/src/main/java/org/opensrp/domain/viewconfiguration/View.java +++ b/src/main/java/org/opensrp/domain/viewconfiguration/View.java @@ -6,108 +6,108 @@ * @author SGithengi */ public class View { - - @JsonProperty - private String identifier; - - @JsonProperty - private String type; - - @JsonProperty - private String orientation; - - @JsonProperty - private String label; - - @JsonProperty - private boolean visible; - - @JsonProperty - private Residence residence; - - public String getIdentifier() { - return identifier; - } - - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getOrientation() { - return orientation; - } - - public void setOrientation(String orientation) { - this.orientation = orientation; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public boolean isVisible() { - return visible; - } - - public void setVisible(boolean visible) { - this.visible = visible; - } - - public Residence getResidence() { - return residence; - } - - public void setResidence(Residence residence) { - this.residence = residence; - } - - static class Residence { - - @JsonProperty - private String parent; - - @JsonProperty - private int position; - - @JsonProperty(value = "layout_weight") - private String layoutWeight; - - public String getParent() { - return parent; - } - - public void setParent(String parent) { - this.parent = parent; - } - - public int getPosition() { - return position; - } - - public void setPosition(int position) { - this.position = position; - } - - public String getLayoutWeight() { - return layoutWeight; - } - - public void setLayoutWeight(String layoutWeight) { - this.layoutWeight = layoutWeight; - } - - } - + + @JsonProperty + private String identifier; + + @JsonProperty + private String type; + + @JsonProperty + private String orientation; + + @JsonProperty + private String label; + + @JsonProperty + private boolean visible; + + @JsonProperty + private Residence residence; + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getOrientation() { + return orientation; + } + + public void setOrientation(String orientation) { + this.orientation = orientation; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public boolean isVisible() { + return visible; + } + + public void setVisible(boolean visible) { + this.visible = visible; + } + + public Residence getResidence() { + return residence; + } + + public void setResidence(Residence residence) { + this.residence = residence; + } + + static class Residence { + + @JsonProperty + private String parent; + + @JsonProperty + private int position; + + @JsonProperty(value = "layout_weight") + private String layoutWeight; + + public String getParent() { + return parent; + } + + public void setParent(String parent) { + this.parent = parent; + } + + public int getPosition() { + return position; + } + + public void setPosition(int position) { + this.position = position; + } + + public String getLayoutWeight() { + return layoutWeight; + } + + public void setLayoutWeight(String layoutWeight) { + this.layoutWeight = layoutWeight; + } + + } + } diff --git a/src/main/java/org/opensrp/domain/viewconfiguration/ViewConfiguration.java b/src/main/java/org/opensrp/domain/viewconfiguration/ViewConfiguration.java index 56782a705..59f7807ce 100644 --- a/src/main/java/org/opensrp/domain/viewconfiguration/ViewConfiguration.java +++ b/src/main/java/org/opensrp/domain/viewconfiguration/ViewConfiguration.java @@ -10,73 +10,73 @@ * @author SGithengi */ public class ViewConfiguration extends BaseDataObject { - - private static final long serialVersionUID = 1890883609898207737L; - - @JsonProperty - private String type; - - @JsonProperty - private String identifier; - - @JsonProperty - private BaseConfiguration metadata; - - @JsonProperty - private List views; - - @JsonProperty - private Map labels; - - @JsonProperty - private Object jsonView; - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIdentifier() { - return identifier; - } - - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - public BaseConfiguration getMetadata() { - return metadata; - } - - public void setMetadata(BaseConfiguration metadata) { - this.metadata = metadata; - } - - public List getViews() { - return views; - } - - public void setViews(List views) { - this.views = views; - } - - public Map getLabels() { - return labels; - } - - public void setLabels(Map labels) { - this.labels = labels; - } - - public Object getJsonView() { - return jsonView; - } - - public void setJsonView(Object jsonView) { - this.jsonView = jsonView; - } - + + private static final long serialVersionUID = 1890883609898207737L; + + @JsonProperty + private String type; + + @JsonProperty + private String identifier; + + @JsonProperty + private BaseConfiguration metadata; + + @JsonProperty + private List views; + + @JsonProperty + private Map labels; + + @JsonProperty + private Object jsonView; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public BaseConfiguration getMetadata() { + return metadata; + } + + public void setMetadata(BaseConfiguration metadata) { + this.metadata = metadata; + } + + public List getViews() { + return views; + } + + public void setViews(List views) { + this.views = views; + } + + public Map getLabels() { + return labels; + } + + public void setLabels(Map labels) { + this.labels = labels; + } + + public Object getJsonView() { + return jsonView; + } + + public void setJsonView(Object jsonView) { + this.jsonView = jsonView; + } + } diff --git a/src/main/java/org/opensrp/dto/CsvBulkImportDataSummary.java b/src/main/java/org/opensrp/dto/CsvBulkImportDataSummary.java index 8f1f167c8..fb4075731 100644 --- a/src/main/java/org/opensrp/dto/CsvBulkImportDataSummary.java +++ b/src/main/java/org/opensrp/dto/CsvBulkImportDataSummary.java @@ -13,10 +13,10 @@ @AllArgsConstructor public class CsvBulkImportDataSummary { - private Integer numberOfCsvRows; + private Integer numberOfCsvRows; - private Integer numberOfRowsProcessed; + private Integer numberOfRowsProcessed; - private List failedRecordSummaryList; + private List failedRecordSummaryList; } diff --git a/src/main/java/org/opensrp/dto/ExportEventDataSummary.java b/src/main/java/org/opensrp/dto/ExportEventDataSummary.java index 53e9d1150..d8173b422 100644 --- a/src/main/java/org/opensrp/dto/ExportEventDataSummary.java +++ b/src/main/java/org/opensrp/dto/ExportEventDataSummary.java @@ -13,7 +13,7 @@ @AllArgsConstructor public class ExportEventDataSummary { - private List> rowsData; + private List> rowsData; - private String missionName; + private String missionName; } diff --git a/src/main/java/org/opensrp/dto/ExportFlagProblemEventImageMetadata.java b/src/main/java/org/opensrp/dto/ExportFlagProblemEventImageMetadata.java index 873d96fc4..ad75a241e 100644 --- a/src/main/java/org/opensrp/dto/ExportFlagProblemEventImageMetadata.java +++ b/src/main/java/org/opensrp/dto/ExportFlagProblemEventImageMetadata.java @@ -11,7 +11,7 @@ @AllArgsConstructor public class ExportFlagProblemEventImageMetadata { - private String stockId; - private String servicePointName; - private String productName; + private String stockId; + private String servicePointName; + private String productName; } diff --git a/src/main/java/org/opensrp/dto/ExportImagesSummary.java b/src/main/java/org/opensrp/dto/ExportImagesSummary.java index 1dbac114b..5f8f886c1 100644 --- a/src/main/java/org/opensrp/dto/ExportImagesSummary.java +++ b/src/main/java/org/opensrp/dto/ExportImagesSummary.java @@ -14,6 +14,6 @@ @AllArgsConstructor public class ExportImagesSummary { - private List exportFlagProblemEventImageMetadataList; - private Set servicePoints; + private List exportFlagProblemEventImageMetadataList; + private Set servicePoints; } diff --git a/src/main/java/org/opensrp/dto/FailedRecordSummary.java b/src/main/java/org/opensrp/dto/FailedRecordSummary.java index ecaa5a7d4..06dda3863 100644 --- a/src/main/java/org/opensrp/dto/FailedRecordSummary.java +++ b/src/main/java/org/opensrp/dto/FailedRecordSummary.java @@ -13,6 +13,6 @@ @AllArgsConstructor public class FailedRecordSummary { - private Integer rowNumber; - private List reasonOfFailure; + private Integer rowNumber; + private List reasonOfFailure; } diff --git a/src/main/java/org/opensrp/exception/DatabaseException.java b/src/main/java/org/opensrp/exception/DatabaseException.java index 863b7a4dd..a04b2664e 100644 --- a/src/main/java/org/opensrp/exception/DatabaseException.java +++ b/src/main/java/org/opensrp/exception/DatabaseException.java @@ -2,7 +2,7 @@ public class DatabaseException extends RuntimeException { - public DatabaseException(String message) { - super(message); - } + public DatabaseException(String message) { + super(message); + } } diff --git a/src/main/java/org/opensrp/exception/UnallowedIdentifierException.java b/src/main/java/org/opensrp/exception/UnallowedIdentifierException.java index dc7031bd1..da7880541 100644 --- a/src/main/java/org/opensrp/exception/UnallowedIdentifierException.java +++ b/src/main/java/org/opensrp/exception/UnallowedIdentifierException.java @@ -2,18 +2,18 @@ public class UnallowedIdentifierException extends RuntimeException { - public UnallowedIdentifierException() { - } + public UnallowedIdentifierException() { + } - public UnallowedIdentifierException(String message) { - super(message); - } + public UnallowedIdentifierException(String message) { + super(message); + } - public UnallowedIdentifierException(String message, Throwable cause) { - super(message, cause); - } + public UnallowedIdentifierException(String message, Throwable cause) { + super(message, cause); + } - public UnallowedIdentifierException(Throwable cause) { - super(cause); - } + public UnallowedIdentifierException(Throwable cause) { + super(cause); + } } diff --git a/src/main/java/org/opensrp/generator/LuhnIdentifierValidator.java b/src/main/java/org/opensrp/generator/LuhnIdentifierValidator.java index ee2fc725e..02675f4f9 100644 --- a/src/main/java/org/opensrp/generator/LuhnIdentifierValidator.java +++ b/src/main/java/org/opensrp/generator/LuhnIdentifierValidator.java @@ -5,90 +5,90 @@ public class LuhnIdentifierValidator { - public int getCheckDigit(String undecoratedIdentifier) { - // remove leading or trailing whitespace, convert to uppercase - String trimmedUppercaseUndecoratedIdentifier = undecoratedIdentifier.trim().toUpperCase(); - - // this will privatebe a running total - int sum = 0; - - // loop through digits from right to left - for (int i = 0; i < trimmedUppercaseUndecoratedIdentifier.length(); i++) { - - // set ch to "current" character to be processed - char ch = trimmedUppercaseUndecoratedIdentifier.charAt(trimmedUppercaseUndecoratedIdentifier.length() - i - 1); - - // our "digit" is calculated using ASCII value - 48 - int digit = (int) ch - 48; - - // weight will be the current digit's contribution to - // the running total - int weight; - if (i % 2 == 0) { - - // for alternating digits starting with the rightmost, we - // use our formula this is the same as multiplying x 2 and - // adding digits together for values 0 to 9. Using the - // following formula allows us to gracefully calculate a - // weight for non-numeric "digits" as well (from their - // ASCII value - 48). - weight = (2 * digit) - (digit / 5) * 9; - - } else { - - // even-positioned digits just contribute their ascii - // value minus 48 - weight = digit; - - } - - // keep a running total of weights - sum += weight; - - } - - // avoid sum less than 10 (if characters below "0" allowed, - // this could happen) - sum = Math.abs(sum) + 10; - - // check digit is amount needed to reach next number - // divisible by ten - return (10 - (sum % 10)) % 10; - } - - public String getValidIdentifier(String undecoratedIdentifier, IdentifierSource identifierSource) - throws UnallowedIdentifierException { - - checkAllowedIdentifier(undecoratedIdentifier, identifierSource); - - int checkDigit = getCheckDigit(undecoratedIdentifier); - - return undecoratedIdentifier + "-" + checkDigit; - } - - protected void checkAllowedIdentifier(String undecoratedIdentifier, IdentifierSource identifierSource) - throws UnallowedIdentifierException { - if (undecoratedIdentifier == null) { - throw new UnallowedIdentifierException("Identifier can not be null."); - } - if (undecoratedIdentifier.length() == 0) { - throw new UnallowedIdentifierException("Identifier must contain at least one character."); - } - if (undecoratedIdentifier.contains(" ")) { - throw new UnallowedIdentifierException("Identifier may not contain white space."); - } - for (int i = 0; i < undecoratedIdentifier.length(); i++) { - if (getAllowedCharacters(identifierSource).indexOf(undecoratedIdentifier.charAt(i)) == -1) { - throw new UnallowedIdentifierException("\"" + undecoratedIdentifier.charAt(i) - + "\" is an invalid character."); - } - } - } - - public String getAllowedCharacters(IdentifierSource identifierSource) { - String prefix = identifierSource.getPrefix()!=null ? identifierSource.getPrefix() : ""; - String suffix = identifierSource.getSuffix()!=null ? identifierSource.getSuffix() : ""; - String baseCharacterSet = identifierSource.getBaseCharacterSet()!=null ? identifierSource.getBaseCharacterSet() : ""; - return prefix + baseCharacterSet + suffix; - } + public int getCheckDigit(String undecoratedIdentifier) { + // remove leading or trailing whitespace, convert to uppercase + String trimmedUppercaseUndecoratedIdentifier = undecoratedIdentifier.trim().toUpperCase(); + + // this will privatebe a running total + int sum = 0; + + // loop through digits from right to left + for (int i = 0; i < trimmedUppercaseUndecoratedIdentifier.length(); i++) { + + // set ch to "current" character to be processed + char ch = trimmedUppercaseUndecoratedIdentifier.charAt(trimmedUppercaseUndecoratedIdentifier.length() - i - 1); + + // our "digit" is calculated using ASCII value - 48 + int digit = (int) ch - 48; + + // weight will be the current digit's contribution to + // the running total + int weight; + if (i % 2 == 0) { + + // for alternating digits starting with the rightmost, we + // use our formula this is the same as multiplying x 2 and + // adding digits together for values 0 to 9. Using the + // following formula allows us to gracefully calculate a + // weight for non-numeric "digits" as well (from their + // ASCII value - 48). + weight = (2 * digit) - (digit / 5) * 9; + + } else { + + // even-positioned digits just contribute their ascii + // value minus 48 + weight = digit; + + } + + // keep a running total of weights + sum += weight; + + } + + // avoid sum less than 10 (if characters below "0" allowed, + // this could happen) + sum = Math.abs(sum) + 10; + + // check digit is amount needed to reach next number + // divisible by ten + return (10 - (sum % 10)) % 10; + } + + public String getValidIdentifier(String undecoratedIdentifier, IdentifierSource identifierSource) + throws UnallowedIdentifierException { + + checkAllowedIdentifier(undecoratedIdentifier, identifierSource); + + int checkDigit = getCheckDigit(undecoratedIdentifier); + + return undecoratedIdentifier + "-" + checkDigit; + } + + protected void checkAllowedIdentifier(String undecoratedIdentifier, IdentifierSource identifierSource) + throws UnallowedIdentifierException { + if (undecoratedIdentifier == null) { + throw new UnallowedIdentifierException("Identifier can not be null."); + } + if (undecoratedIdentifier.length() == 0) { + throw new UnallowedIdentifierException("Identifier must contain at least one character."); + } + if (undecoratedIdentifier.contains(" ")) { + throw new UnallowedIdentifierException("Identifier may not contain white space."); + } + for (int i = 0; i < undecoratedIdentifier.length(); i++) { + if (getAllowedCharacters(identifierSource).indexOf(undecoratedIdentifier.charAt(i)) == -1) { + throw new UnallowedIdentifierException("\"" + undecoratedIdentifier.charAt(i) + + "\" is an invalid character."); + } + } + } + + public String getAllowedCharacters(IdentifierSource identifierSource) { + String prefix = identifierSource.getPrefix() != null ? identifierSource.getPrefix() : ""; + String suffix = identifierSource.getSuffix() != null ? identifierSource.getSuffix() : ""; + String baseCharacterSet = identifierSource.getBaseCharacterSet() != null ? identifierSource.getBaseCharacterSet() : ""; + return prefix + baseCharacterSet + suffix; + } } diff --git a/src/main/java/org/opensrp/generator/UniqueIdGeneratorProcessor.java b/src/main/java/org/opensrp/generator/UniqueIdGeneratorProcessor.java index 8efa4572f..efe6b2b98 100644 --- a/src/main/java/org/opensrp/generator/UniqueIdGeneratorProcessor.java +++ b/src/main/java/org/opensrp/generator/UniqueIdGeneratorProcessor.java @@ -17,117 +17,117 @@ @Component public class UniqueIdGeneratorProcessor { - private static Logger logger = LogManager.getLogger(UniqueIdGeneratorProcessor.class.toString()); - - @Autowired - private UniqueIdRepository uniqueIdRepository; - - @Autowired - private IdentifierSourceService identifierSourceService; - - public UniqueIdGeneratorProcessor(UniqueIdRepository uniqueIdRepository, IdentifierSourceService identifierSourceService) { - this.uniqueIdRepository = uniqueIdRepository; - this.identifierSourceService = identifierSourceService; - } - - public synchronized List getIdentifiers(IdentifierSource identifierSource, int batchSize, String usedBy) { - - UniqueId lastUniqueId = uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(identifierSource.getId()); - - Long sequenceValue = identifierSource.getSequenceValue(); - - if (sequenceValue == null || sequenceValue < 0) { - if (identifierSource.getFirstIdentifierBase() != null) { - sequenceValue = IdGeneratorUtil.convertFromBase(identifierSource.getFirstIdentifierBase(), - identifierSource.getBaseCharacterSet().toCharArray()); - } else { - sequenceValue = 1L; - } - } - - Set reservedIdentifiers = uniqueIdRepository.findReservedIdentifiers(); - - List identifiers = new ArrayList(); - int numbersToGenerate = batchSize; - String identifier = ""; - LuhnIdentifierValidator luhnIdentifierValidator = new LuhnIdentifierValidator(); - String prefix = identifierSource.getPrefix() != null ? identifierSource.getPrefix() : ""; - String suffix = identifierSource.getSuffix() != null ? identifierSource.getSuffix() : ""; - String firstIdentifierBase = identifierSource.getFirstIdentifierBase()!= null ? identifierSource.getFirstIdentifierBase() : ""; - - if (identifierSource.getFirstIdentifierBase() != null && lastUniqueId==null) { - numbersToGenerate = batchSize - 1; - identifiers.add(luhnIdentifierValidator - .getValidIdentifier(prefix + firstIdentifierBase + suffix, identifierSource)); - } - - String previousId = ""; - - for (int i = 0; i < numbersToGenerate; ) { - identifier = getIdentifierForSeed(sequenceValue, identifierSource); - logger.info("Identifier from processor is " + identifier); - if(identifier == null) { - break; - } - if (!reservedIdentifiers.contains(identifier)) { - if (identifierSource.getIdentifierValidatorAlgorithm() - .equals(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM)) { - identifier = luhnIdentifierValidator.getValidIdentifier(identifier, identifierSource); - } - if (!identifier.equals(previousId)) { - identifiers.add(identifier); - previousId = identifier; - } - i++; - } - sequenceValue++; - } - - identifierSourceService.saveSequenceValue(identifierSource, sequenceValue); - saveIds(identifiers, null, "not_used", new Date(), usedBy, new Date(), identifierSource.getId()); - - return identifiers; - } - - public String getIdentifierForSeed(long seed, IdentifierSource identifierSource) { - // Convert the next sequence integer into a String with the appropriate Base characters - int seqLength = - identifierSource.getFirstIdentifierBase() == null ? 1 : identifierSource.getFirstIdentifierBase().length(); - - if(seqLength == 1) { - seqLength = identifierSource.getMinLength(); - } - - String identifier = IdGeneratorUtil - .convertToBase(seed, identifierSource.getBaseCharacterSet().toCharArray(), seqLength, - identifierSource.getMinLength()); - - if (((identifierSource.getMinLength() != null && identifierSource.getMinLength() > 0) - || (identifierSource.getMaxLength() != null && identifierSource.getMaxLength() > 0)) - && ((identifier.length() < identifierSource.getMinLength()) || (identifier.length() > identifierSource - .getMaxLength()))) { - return null; - } - - identifier = identifierSource.getPrefix() == null ? identifier : identifierSource.getPrefix() + identifier; - identifier = (identifierSource.getSuffix() == null ? identifier : identifier + identifierSource.getSuffix()); - - - if (identifierSource.getRegexFormat() != null && StringUtils.isNotEmpty(identifierSource.getRegexFormat())) { - return identifier.matches(identifierSource.getRegexFormat()) ? - identifier : - getIdentifierForSeed(seed + 1, identifierSource); - } - return identifier; - } - - private void saveIds(List ids, String location, String status, Date updatedAt, String usedBy, - Date createdAt, Long idSource) { - for (int i = 0; i < ids.size(); i++) { - UniqueId uniqueId = new UniqueId("", status, usedBy, location, createdAt, updatedAt, ids.get(i), idSource, - Boolean.FALSE); - uniqueIdRepository.add(uniqueId); - } - } + private static Logger logger = LogManager.getLogger(UniqueIdGeneratorProcessor.class.toString()); + + @Autowired + private UniqueIdRepository uniqueIdRepository; + + @Autowired + private IdentifierSourceService identifierSourceService; + + public UniqueIdGeneratorProcessor(UniqueIdRepository uniqueIdRepository, IdentifierSourceService identifierSourceService) { + this.uniqueIdRepository = uniqueIdRepository; + this.identifierSourceService = identifierSourceService; + } + + public synchronized List getIdentifiers(IdentifierSource identifierSource, int batchSize, String usedBy) { + + UniqueId lastUniqueId = uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(identifierSource.getId()); + + Long sequenceValue = identifierSource.getSequenceValue(); + + if (sequenceValue == null || sequenceValue < 0) { + if (identifierSource.getFirstIdentifierBase() != null) { + sequenceValue = IdGeneratorUtil.convertFromBase(identifierSource.getFirstIdentifierBase(), + identifierSource.getBaseCharacterSet().toCharArray()); + } else { + sequenceValue = 1L; + } + } + + Set reservedIdentifiers = uniqueIdRepository.findReservedIdentifiers(); + + List identifiers = new ArrayList(); + int numbersToGenerate = batchSize; + String identifier = ""; + LuhnIdentifierValidator luhnIdentifierValidator = new LuhnIdentifierValidator(); + String prefix = identifierSource.getPrefix() != null ? identifierSource.getPrefix() : ""; + String suffix = identifierSource.getSuffix() != null ? identifierSource.getSuffix() : ""; + String firstIdentifierBase = identifierSource.getFirstIdentifierBase() != null ? identifierSource.getFirstIdentifierBase() : ""; + + if (identifierSource.getFirstIdentifierBase() != null && lastUniqueId == null) { + numbersToGenerate = batchSize - 1; + identifiers.add(luhnIdentifierValidator + .getValidIdentifier(prefix + firstIdentifierBase + suffix, identifierSource)); + } + + String previousId = ""; + + for (int i = 0; i < numbersToGenerate; ) { + identifier = getIdentifierForSeed(sequenceValue, identifierSource); + logger.info("Identifier from processor is " + identifier); + if (identifier == null) { + break; + } + if (!reservedIdentifiers.contains(identifier)) { + if (identifierSource.getIdentifierValidatorAlgorithm() + .equals(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM)) { + identifier = luhnIdentifierValidator.getValidIdentifier(identifier, identifierSource); + } + if (!identifier.equals(previousId)) { + identifiers.add(identifier); + previousId = identifier; + } + i++; + } + sequenceValue++; + } + + identifierSourceService.saveSequenceValue(identifierSource, sequenceValue); + saveIds(identifiers, null, "not_used", new Date(), usedBy, new Date(), identifierSource.getId()); + + return identifiers; + } + + public String getIdentifierForSeed(long seed, IdentifierSource identifierSource) { + // Convert the next sequence integer into a String with the appropriate Base characters + int seqLength = + identifierSource.getFirstIdentifierBase() == null ? 1 : identifierSource.getFirstIdentifierBase().length(); + + if (seqLength == 1) { + seqLength = identifierSource.getMinLength(); + } + + String identifier = IdGeneratorUtil + .convertToBase(seed, identifierSource.getBaseCharacterSet().toCharArray(), seqLength, + identifierSource.getMinLength()); + + if (((identifierSource.getMinLength() != null && identifierSource.getMinLength() > 0) + || (identifierSource.getMaxLength() != null && identifierSource.getMaxLength() > 0)) + && ((identifier.length() < identifierSource.getMinLength()) || (identifier.length() > identifierSource + .getMaxLength()))) { + return null; + } + + identifier = identifierSource.getPrefix() == null ? identifier : identifierSource.getPrefix() + identifier; + identifier = (identifierSource.getSuffix() == null ? identifier : identifier + identifierSource.getSuffix()); + + + if (identifierSource.getRegexFormat() != null && StringUtils.isNotEmpty(identifierSource.getRegexFormat())) { + return identifier.matches(identifierSource.getRegexFormat()) ? + identifier : + getIdentifierForSeed(seed + 1, identifierSource); + } + return identifier; + } + + private void saveIds(List ids, String location, String status, Date updatedAt, String usedBy, + Date createdAt, Long idSource) { + for (int i = 0; i < ids.size(); i++) { + UniqueId uniqueId = new UniqueId("", status, usedBy, location, createdAt, updatedAt, ids.get(i), idSource, + Boolean.FALSE); + uniqueIdRepository.add(uniqueId); + } + } } diff --git a/src/main/java/org/opensrp/migrations/MybatisMigration.java b/src/main/java/org/opensrp/migrations/MybatisMigration.java index 905bba676..f21e4c248 100644 --- a/src/main/java/org/opensrp/migrations/MybatisMigration.java +++ b/src/main/java/org/opensrp/migrations/MybatisMigration.java @@ -25,48 +25,44 @@ @Component public class MybatisMigration { - private static Logger logger = LogManager.getLogger(MybatisMigration.class.getName()); + private static final String CONFIG_FILE = "mybatis/environments/deployment.properties"; + private static final String SCRIPTS_FOLDER = "mybatis/scripts"; + private static Logger logger = LogManager.getLogger(MybatisMigration.class.getName()); + @Autowired + private DataSource dataSource; - @Autowired - private DataSource dataSource; + @PostConstruct + public void initializeMybatisMigration() { + logger.info("Running migrations."); + Resource resource = new ClassPathResource(CONFIG_FILE); + try { + Properties props = PropertiesLoaderUtils.loadProperties(resource); + Gson gson = new GsonBuilder() + .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) + .create(); - private static final String CONFIG_FILE = "mybatis/environments/deployment.properties"; + JSONObject dbOperationOptionObject = new JSONObject(gson.toJson(new DatabaseOperationOption())); + for (String key : dbOperationOptionObject.keySet()) { + if (props.containsKey(key)) { + dbOperationOptionObject.put(key, props.getProperty(key)); + } + } - private static final String SCRIPTS_FOLDER = "mybatis/scripts"; + DatabaseOperationOption databaseOperationOption = gson.fromJson(dbOperationOptionObject.toString(), DatabaseOperationOption.class); - @PostConstruct - public void initializeMybatisMigration() { - logger.info("Running migrations."); - Resource resource = new ClassPathResource(CONFIG_FILE); - try { - Properties props = PropertiesLoaderUtils.loadProperties(resource); - Gson gson = new GsonBuilder() - .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) - .create(); + runMigrationOperation(props, databaseOperationOption); - JSONObject dbOperationOptionObject = new JSONObject(gson.toJson(new DatabaseOperationOption())); - for(String key : dbOperationOptionObject.keySet()){ - if(props.containsKey(key)){ - dbOperationOptionObject.put(key, props.getProperty(key)); - } - } + logger.info("Migration done."); + } catch (IOException e) { + logger.error(e); + } + } - DatabaseOperationOption databaseOperationOption = gson.fromJson(dbOperationOptionObject.toString(), DatabaseOperationOption.class); - - runMigrationOperation(props, databaseOperationOption); - - logger.info("Migration done."); - } - catch (IOException e) { - logger.error(e); - } - } - - protected void runMigrationOperation(Properties props, DatabaseOperationOption databaseOperationOption) throws IOException { - new UpOperation().operate( - new DataSourceConnectionProvider(dataSource), - new FileMigrationLoader(new ClassPathResource(SCRIPTS_FOLDER).getFile(), StandardCharsets.UTF_8.toString(), - props), databaseOperationOption, System.out); - } + protected void runMigrationOperation(Properties props, DatabaseOperationOption databaseOperationOption) throws IOException { + new UpOperation().operate( + new DataSourceConnectionProvider(dataSource), + new FileMigrationLoader(new ClassPathResource(SCRIPTS_FOLDER).getFile(), StandardCharsets.UTF_8.toString(), + props), databaseOperationOption, System.out); + } } diff --git a/src/main/java/org/opensrp/queue/PlanEvaluatorMessage.java b/src/main/java/org/opensrp/queue/PlanEvaluatorMessage.java index 72c2e89f1..1f0104466 100644 --- a/src/main/java/org/opensrp/queue/PlanEvaluatorMessage.java +++ b/src/main/java/org/opensrp/queue/PlanEvaluatorMessage.java @@ -16,23 +16,23 @@ @AllArgsConstructor public class PlanEvaluatorMessage implements Serializable { - private static final long serialVersionUID = -1138446817700416884L; + private static final long serialVersionUID = -1138446817700416884L; - @JsonProperty - private String planIdentifier; + @JsonProperty + private String planIdentifier; - @JsonProperty - private TriggerType triggerType; + @JsonProperty + private TriggerType triggerType; - @JsonProperty - private Jurisdiction jurisdiction; - - @JsonProperty - private String username; + @JsonProperty + private Jurisdiction jurisdiction; - @Override - public String toString() { - String result = "PlanIdentifier : " + getPlanIdentifier() + ", TriggerType : " + getTriggerType() + ", Jurisdiction Code : " + getJurisdiction(); - return result; - } + @JsonProperty + private String username; + + @Override + public String toString() { + String result = "PlanIdentifier : " + getPlanIdentifier() + ", TriggerType : " + getTriggerType() + ", Jurisdiction Code : " + getJurisdiction(); + return result; + } } diff --git a/src/main/java/org/opensrp/queue/QueueHelper.java b/src/main/java/org/opensrp/queue/QueueHelper.java index 70a0567dd..2907658a7 100644 --- a/src/main/java/org/opensrp/queue/QueueHelper.java +++ b/src/main/java/org/opensrp/queue/QueueHelper.java @@ -12,28 +12,28 @@ @Component public class QueueHelper implements QueuingHelper { - - @Autowired - private MessageSender messageSender; - - @Override - public void addToQueue(String planIdentifier, TriggerType triggerType, String locationId, String username) { - Jurisdiction jurisdiction = new Jurisdiction(locationId); - PlanEvaluatorMessage planEvaluatorMessage = new PlanEvaluatorMessage(planIdentifier, triggerType, jurisdiction, - username); - messageSender.send(planEvaluatorMessage); - } - - @Override - public void addToQueue(String resource, QuestionnaireResponse questionnaireResponse, Action action, - String planIdentifier, String jurisdictionCode, TriggerType triggerType, String username) { - ResourceEvaluatorMessage resourceEvaluatorMessage = new ResourceEvaluatorMessage(resource, questionnaireResponse, - action, planIdentifier, jurisdictionCode, triggerType, username); - messageSender.send(resourceEvaluatorMessage); - } - - public void setRabbitMQSender(MessageSender messageSender) { - this.messageSender = messageSender; - } - + + @Autowired + private MessageSender messageSender; + + @Override + public void addToQueue(String planIdentifier, TriggerType triggerType, String locationId, String username) { + Jurisdiction jurisdiction = new Jurisdiction(locationId); + PlanEvaluatorMessage planEvaluatorMessage = new PlanEvaluatorMessage(planIdentifier, triggerType, jurisdiction, + username); + messageSender.send(planEvaluatorMessage); + } + + @Override + public void addToQueue(String resource, QuestionnaireResponse questionnaireResponse, Action action, + String planIdentifier, String jurisdictionCode, TriggerType triggerType, String username) { + ResourceEvaluatorMessage resourceEvaluatorMessage = new ResourceEvaluatorMessage(resource, questionnaireResponse, + action, planIdentifier, jurisdictionCode, triggerType, username); + messageSender.send(resourceEvaluatorMessage); + } + + public void setRabbitMQSender(MessageSender messageSender) { + this.messageSender = messageSender; + } + } diff --git a/src/main/java/org/opensrp/queue/RabbitMQReceiver.java b/src/main/java/org/opensrp/queue/RabbitMQReceiver.java index 83b6a2357..30065c920 100644 --- a/src/main/java/org/opensrp/queue/RabbitMQReceiver.java +++ b/src/main/java/org/opensrp/queue/RabbitMQReceiver.java @@ -28,73 +28,67 @@ @RabbitListener(queues = "rabbitmq.task.queue", id = "listener") public class RabbitMQReceiver { - private PlanEvaluator planEvaluator; + private static Logger logger = LogManager.getLogger(RabbitMQReceiver.class.toString()); + private PlanEvaluator planEvaluator; + @Autowired + private PlanService planService; + @Autowired + private QueueHelper queueHelper; + //import task generator to guarantee PathEvaluatorLibrary is instantiated first + @SuppressWarnings("unused") + @Autowired + private TaskGenerator taskGenerator; + private FHIRParser fhirParser; - @Autowired - private PlanService planService; - - @Autowired - private QueueHelper queueHelper; - - //import task generator to guarantee PathEvaluatorLibrary is instantiated first - @SuppressWarnings("unused") - @Autowired - private TaskGenerator taskGenerator; + @PostConstruct + public void init() { + fhirParser = FHIRParser.parser(Format.JSON); + } - private FHIRParser fhirParser; + @RabbitHandler + public void receiver(PlanEvaluatorMessage planEvaluatorMessage) { + logger.info("PlanEvaluatorMessage listener invoked - Consuming Message with Plan Definition Identifier : " + planEvaluatorMessage.getPlanIdentifier()); + initializePathEvaluator(planEvaluatorMessage.getUsername()); - private static Logger logger = LogManager.getLogger(RabbitMQReceiver.class.toString()); + if (planEvaluatorMessage != null && planEvaluator != null) { + PlanDefinition planDefinition = planService.getPlan(planEvaluatorMessage.getPlanIdentifier()); + if (planDefinition != null && planDefinition.getActions() != null && planEvaluatorMessage.getJurisdiction() != null) { + planEvaluator.evaluatePlan(planDefinition, + planEvaluatorMessage.getTriggerType(), + planEvaluatorMessage.getJurisdiction(), null); + } + } + } - @PostConstruct - public void init() { - fhirParser = FHIRParser.parser(Format.JSON); - } + @RabbitHandler + public void receiver(ResourceEvaluatorMessage resourceEvaluatorMessage) { + logger.info("ResourceEvaluatorMessage invoked - Consuming Message"); + if (resourceEvaluatorMessage != null) { + InputStream stream = resourceEvaluatorMessage.getResource() != null ? new ByteArrayInputStream( + resourceEvaluatorMessage.getResource().getBytes(StandardCharsets.UTF_8)) : null; + try { + if (stream != null) { + Resource resource = fhirParser.parse(stream); + logger.info("Resource id is : " + resource.getId()); + initializePathEvaluator(resourceEvaluatorMessage.getUsername()); + if (resource != null && resourceEvaluatorMessage != null + && resourceEvaluatorMessage.getAction() != null + && resourceEvaluatorMessage.getAction().getCondition() != null + && planEvaluator != null) { + planEvaluator.evaluateResource(resource, resourceEvaluatorMessage.getQuestionnaireResponse(), + resourceEvaluatorMessage.getAction(), resourceEvaluatorMessage.getPlanIdentifier(), + resourceEvaluatorMessage.getJurisdictionCode(), resourceEvaluatorMessage.getTriggerType()); + } + } + } catch (FHIRParserException e) { + logger.error("FHIRParserException occurred " + e.getMessage()); + } + } + } - @RabbitHandler - public void receiver(PlanEvaluatorMessage planEvaluatorMessage) { - logger.info("PlanEvaluatorMessage listener invoked - Consuming Message with Plan Definition Identifier : " + planEvaluatorMessage.getPlanIdentifier()); - initializePathEvaluator(planEvaluatorMessage.getUsername()); - - if (planEvaluatorMessage != null && planEvaluator != null) { - PlanDefinition planDefinition = planService.getPlan(planEvaluatorMessage.getPlanIdentifier()); - if (planDefinition != null && planDefinition.getActions() != null && planEvaluatorMessage.getJurisdiction() != null) { - planEvaluator.evaluatePlan(planDefinition, - planEvaluatorMessage.getTriggerType(), - planEvaluatorMessage.getJurisdiction(), null); - } - } - } - - @RabbitHandler - public void receiver(ResourceEvaluatorMessage resourceEvaluatorMessage) { - logger.info("ResourceEvaluatorMessage invoked - Consuming Message"); - if (resourceEvaluatorMessage != null) { - InputStream stream = resourceEvaluatorMessage.getResource() != null ? new ByteArrayInputStream( - resourceEvaluatorMessage.getResource().getBytes(StandardCharsets.UTF_8)) : null; - try { - if (stream != null) { - Resource resource = fhirParser.parse(stream); - logger.info("Resource id is : " + resource.getId()); - initializePathEvaluator(resourceEvaluatorMessage.getUsername()); - if (resource != null && resourceEvaluatorMessage != null - && resourceEvaluatorMessage.getAction() != null - && resourceEvaluatorMessage.getAction().getCondition() != null - && planEvaluator != null) { - planEvaluator.evaluateResource(resource, resourceEvaluatorMessage.getQuestionnaireResponse(), - resourceEvaluatorMessage.getAction(), resourceEvaluatorMessage.getPlanIdentifier(), - resourceEvaluatorMessage.getJurisdictionCode(), resourceEvaluatorMessage.getTriggerType()); - } - } - } - catch (FHIRParserException e) { - logger.error("FHIRParserException occurred " + e.getMessage()); - } - } - } - - private void initializePathEvaluator(String username) { - if(planEvaluator == null) - planEvaluator = new PlanEvaluator(username, queueHelper); - } + private void initializePathEvaluator(String username) { + if (planEvaluator == null) + planEvaluator = new PlanEvaluator(username, queueHelper); + } } diff --git a/src/main/java/org/opensrp/queue/ResourceEvaluatorMessage.java b/src/main/java/org/opensrp/queue/ResourceEvaluatorMessage.java index 3aeb104e6..a179ed81b 100644 --- a/src/main/java/org/opensrp/queue/ResourceEvaluatorMessage.java +++ b/src/main/java/org/opensrp/queue/ResourceEvaluatorMessage.java @@ -17,33 +17,33 @@ @AllArgsConstructor public class ResourceEvaluatorMessage implements Serializable { - private static final long serialVersionUID = -1607322794388098644L; + private static final long serialVersionUID = -1607322794388098644L; - @JsonProperty - private String resource; + @JsonProperty + private String resource; - @JsonProperty - private QuestionnaireResponse questionnaireResponse; + @JsonProperty + private QuestionnaireResponse questionnaireResponse; - @JsonProperty - private Action action; + @JsonProperty + private Action action; - @JsonProperty - private String planIdentifier; + @JsonProperty + private String planIdentifier; - @JsonProperty - private String jurisdictionCode; + @JsonProperty + private String jurisdictionCode; - @JsonProperty - private TriggerType triggerType; - - @JsonProperty - private String username; + @JsonProperty + private TriggerType triggerType; - @Override - public String toString() { - String result = "Action Identifier is : " + getAction() != null ? getAction().getIdentifier() : "null" + "PlanIdentifier : " + getPlanIdentifier() + ", Jurisdiction Code : " + getJurisdictionCode() + ", TriggerType : " + getTriggerType(); - return result; - } + @JsonProperty + private String username; + + @Override + public String toString() { + String result = "Action Identifier is : " + getAction() != null ? getAction().getIdentifier() : "null" + "PlanIdentifier : " + getPlanIdentifier() + ", Jurisdiction Code : " + getJurisdictionCode() + ", TriggerType : " + getTriggerType(); + return result; + } } diff --git a/src/main/java/org/opensrp/queue/sender/InternalSenderImpl.java b/src/main/java/org/opensrp/queue/sender/InternalSenderImpl.java index 252ea1dc9..10fedf756 100644 --- a/src/main/java/org/opensrp/queue/sender/InternalSenderImpl.java +++ b/src/main/java/org/opensrp/queue/sender/InternalSenderImpl.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.queue.sender; @@ -31,41 +31,40 @@ @Profile("!rabbitmq") @Component public class InternalSenderImpl implements MessageSender { - - private static Logger logger = LogManager.getLogger(InternalSenderImpl.class.toString()); - - @Autowired - private PlanService planservice; - - @Autowired - @Lazy - private QueueHelper queueHelper; - - @Override - public void send(PlanEvaluatorMessage planMessage) { - PlanEvaluator planEvaluator = new PlanEvaluator(planMessage.getUsername(),queueHelper); - planEvaluator.evaluatePlan(planservice.getPlan(planMessage.getPlanIdentifier()), planMessage.getTriggerType(), - planMessage.getJurisdiction(), null); - - } - - @Override - public void send(ResourceEvaluatorMessage resourceMessage) { - InputStream stream = new ByteArrayInputStream(resourceMessage.getResource().getBytes(StandardCharsets.UTF_8)); - PlanEvaluator planEvaluator = new PlanEvaluator(resourceMessage.getUsername(),queueHelper); - try { - Resource domainResource = FHIRParser.parser(Format.JSON).parse(stream); - if (domainResource != null && resourceMessage != null && resourceMessage.getAction() != null) { - planEvaluator.evaluateResource(domainResource, resourceMessage.getQuestionnaireResponse(), - resourceMessage.getAction(), resourceMessage.getPlanIdentifier(), resourceMessage.getJurisdictionCode(), - resourceMessage.getTriggerType()); - } - } - catch (FHIRParserException e) { - logger.error("FHIRParserException occurred " + e.getMessage()); - } - - } - + private static Logger logger = LogManager.getLogger(InternalSenderImpl.class.toString()); + + @Autowired + private PlanService planservice; + + @Autowired + @Lazy + private QueueHelper queueHelper; + + + @Override + public void send(PlanEvaluatorMessage planMessage) { + PlanEvaluator planEvaluator = new PlanEvaluator(planMessage.getUsername(), queueHelper); + planEvaluator.evaluatePlan(planservice.getPlan(planMessage.getPlanIdentifier()), planMessage.getTriggerType(), + planMessage.getJurisdiction(), null); + + } + + @Override + public void send(ResourceEvaluatorMessage resourceMessage) { + InputStream stream = new ByteArrayInputStream(resourceMessage.getResource().getBytes(StandardCharsets.UTF_8)); + PlanEvaluator planEvaluator = new PlanEvaluator(resourceMessage.getUsername(), queueHelper); + try { + Resource domainResource = FHIRParser.parser(Format.JSON).parse(stream); + if (domainResource != null && resourceMessage != null && resourceMessage.getAction() != null) { + planEvaluator.evaluateResource(domainResource, resourceMessage.getQuestionnaireResponse(), + resourceMessage.getAction(), resourceMessage.getPlanIdentifier(), resourceMessage.getJurisdictionCode(), + resourceMessage.getTriggerType()); + } + } catch (FHIRParserException e) { + logger.error("FHIRParserException occurred " + e.getMessage()); + } + + } + } diff --git a/src/main/java/org/opensrp/queue/sender/MessageSender.java b/src/main/java/org/opensrp/queue/sender/MessageSender.java index b5fab41de..2d5615da8 100644 --- a/src/main/java/org/opensrp/queue/sender/MessageSender.java +++ b/src/main/java/org/opensrp/queue/sender/MessageSender.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.queue.sender; @@ -10,18 +10,18 @@ * @author Samuel Githengi created on 08/28/20 */ public interface MessageSender { - - /** - * Sends plan message to queue system for evaluation - * - * @param planEvaluatorMessage - */ - void send(PlanEvaluatorMessage planEvaluatorMessage); - - /** - * Sends resource message to queue system for evaluation - * - * @param resourceEvaluatorMessage - */ - void send(ResourceEvaluatorMessage resourceEvaluatorMessage); + + /** + * Sends plan message to queue system for evaluation + * + * @param planEvaluatorMessage + */ + void send(PlanEvaluatorMessage planEvaluatorMessage); + + /** + * Sends resource message to queue system for evaluation + * + * @param resourceEvaluatorMessage + */ + void send(ResourceEvaluatorMessage resourceEvaluatorMessage); } diff --git a/src/main/java/org/opensrp/queue/sender/RabbitMQSenderImpl.java b/src/main/java/org/opensrp/queue/sender/RabbitMQSenderImpl.java index dad1df078..9978c125f 100644 --- a/src/main/java/org/opensrp/queue/sender/RabbitMQSenderImpl.java +++ b/src/main/java/org/opensrp/queue/sender/RabbitMQSenderImpl.java @@ -12,37 +12,35 @@ @Profile("rabbitmq") @Component -public class RabbitMQSenderImpl implements MessageSender{ - - @Autowired - private AmqpTemplate rabbitTemplate; - - @Autowired - private Queue queue; - - private static Logger logger = LogManager.getLogger(RabbitMQSenderImpl.class.toString()); - - public RabbitMQSenderImpl(AmqpTemplate rabbitTemplate) { - this.rabbitTemplate = rabbitTemplate; - } - - @Override - public void send(PlanEvaluatorMessage planEvaluatorMessage) { - rabbitTemplate.convertAndSend(queue.getName(), planEvaluatorMessage); - logger.info("Send Message : " + planEvaluatorMessage.toString()); - } - - @Override - public void send(ResourceEvaluatorMessage resourceEvaluatorMessage) { - rabbitTemplate.convertAndSend(queue.getName(), resourceEvaluatorMessage); - logger.info("Send Message : " + resourceEvaluatorMessage.toString()); - } - - public void setRabbitTemplate(AmqpTemplate rabbitTemplate) { - this.rabbitTemplate = rabbitTemplate; - } - - public void setQueue(Queue queue) { - this.queue = queue; - } +public class RabbitMQSenderImpl implements MessageSender { + + private static Logger logger = LogManager.getLogger(RabbitMQSenderImpl.class.toString()); + @Autowired + private AmqpTemplate rabbitTemplate; + @Autowired + private Queue queue; + + public RabbitMQSenderImpl(AmqpTemplate rabbitTemplate) { + this.rabbitTemplate = rabbitTemplate; + } + + @Override + public void send(PlanEvaluatorMessage planEvaluatorMessage) { + rabbitTemplate.convertAndSend(queue.getName(), planEvaluatorMessage); + logger.info("Send Message : " + planEvaluatorMessage.toString()); + } + + @Override + public void send(ResourceEvaluatorMessage resourceEvaluatorMessage) { + rabbitTemplate.convertAndSend(queue.getName(), resourceEvaluatorMessage); + logger.info("Send Message : " + resourceEvaluatorMessage.toString()); + } + + public void setRabbitTemplate(AmqpTemplate rabbitTemplate) { + this.rabbitTemplate = rabbitTemplate; + } + + public void setQueue(Queue queue) { + this.queue = queue; + } } diff --git a/src/main/java/org/opensrp/repository/AppStateTokensRepository.java b/src/main/java/org/opensrp/repository/AppStateTokensRepository.java index 1ada1926e..6ca94f01b 100644 --- a/src/main/java/org/opensrp/repository/AppStateTokensRepository.java +++ b/src/main/java/org/opensrp/repository/AppStateTokensRepository.java @@ -5,11 +5,11 @@ import org.opensrp.domain.AppStateToken; public interface AppStateTokensRepository extends BaseRepository { - - List findByName(String name); - - void update(AppStateToken entity); - - void add(AppStateToken entity); - + + List findByName(String name); + + void update(AppStateToken entity); + + void add(AppStateToken entity); + } diff --git a/src/main/java/org/opensrp/repository/BaseRepository.java b/src/main/java/org/opensrp/repository/BaseRepository.java index f063e6990..1a9dcf61b 100644 --- a/src/main/java/org/opensrp/repository/BaseRepository.java +++ b/src/main/java/org/opensrp/repository/BaseRepository.java @@ -3,36 +3,41 @@ import java.util.List; public interface BaseRepository { - - /** - * Get the object using identifier - * @param id identifier - * @return entity - */ - T get(String id); - - /** - * Add entity to the database - * @param entity to add - */ - void add(T entity); - - /** - * Update entity - * @param entity to update - */ - void update(T entity); - - /** - * Get's all entities on the database. By default 1000 entities will be returned - * @return - */ - List getAll(); - - /** - * Remove an object, can be actual deletion or setting a date deleted for events, clients, Plans, Organization, Practitioner - * @param entity - */ - void safeRemove(T entity); - + + /** + * Get the object using identifier + * + * @param id identifier + * @return entity + */ + T get(String id); + + /** + * Add entity to the database + * + * @param entity to add + */ + void add(T entity); + + /** + * Update entity + * + * @param entity to update + */ + void update(T entity); + + /** + * Get's all entities on the database. By default 1000 entities will be returned + * + * @return + */ + List getAll(); + + /** + * Remove an object, can be actual deletion or setting a date deleted for events, clients, Plans, Organization, Practitioner + * + * @param entity + */ + void safeRemove(T entity); + } diff --git a/src/main/java/org/opensrp/repository/CampaignRepository.java b/src/main/java/org/opensrp/repository/CampaignRepository.java index d21e9c811..824f6467e 100644 --- a/src/main/java/org/opensrp/repository/CampaignRepository.java +++ b/src/main/java/org/opensrp/repository/CampaignRepository.java @@ -4,9 +4,10 @@ import org.opensrp.domain.Campaign; -public interface CampaignRepository extends BaseRepository{ - - public List getCampaignsByServerVersion(long serverVersion); - public List getCampaignsByIdentifiers(String identifiers); +public interface CampaignRepository extends BaseRepository { + + public List getCampaignsByServerVersion(long serverVersion); + + public List getCampaignsByIdentifiers(String identifiers); } diff --git a/src/main/java/org/opensrp/repository/ClientFormRepository.java b/src/main/java/org/opensrp/repository/ClientFormRepository.java index 5283dc755..c2c715c18 100644 --- a/src/main/java/org/opensrp/repository/ClientFormRepository.java +++ b/src/main/java/org/opensrp/repository/ClientFormRepository.java @@ -11,38 +11,38 @@ public interface ClientFormRepository extends BaseRepository { - ClientForm get(long id); + ClientForm get(long id); - int countClientFormByFormIdentifier(@NonNull String formIdentifier); + int countClientFormByFormIdentifier(@NonNull String formIdentifier); - int countClientFormByFormIdentifier(@NonNull String formIdentifier, boolean isJsonValidator); + int countClientFormByFormIdentifier(@NonNull String formIdentifier, boolean isJsonValidator); - ClientFormMetadata getClientFormMetadata(@NonNull String formVersion, @NonNull String formIdentifier); + ClientFormMetadata getClientFormMetadata(@NonNull String formVersion, @NonNull String formIdentifier); - ClientFormMetadata getClientFormMetadata(@NonNull String formVersion, @NonNull String formIdentifier, boolean isJsonValidator); + ClientFormMetadata getClientFormMetadata(@NonNull String formVersion, @NonNull String formIdentifier, boolean isJsonValidator); - List getAvailableClientFormVersions(@NonNull String formIdentifier); + List getAvailableClientFormVersions(@NonNull String formIdentifier); - List getAvailableClientFormVersions(@NonNull String formIdentifier, boolean isJsonValidator); + List getAvailableClientFormVersions(@NonNull String formIdentifier, boolean isJsonValidator); - ClientFormMetadata getFormMetadata(long id); + ClientFormMetadata getFormMetadata(long id); - ClientFormService.CompleteClientForm create(@NonNull ClientForm clientForm, - @NonNull ClientFormMetadata clientFormMetadata); + ClientFormService.CompleteClientForm create(@NonNull ClientForm clientForm, + @NonNull ClientFormMetadata clientFormMetadata); - ClientFormService.CompleteClientForm create(@NonNull ClientFormService.CompleteClientForm completeClientForm); + ClientFormService.CompleteClientForm create(@NonNull ClientFormService.CompleteClientForm completeClientForm); - @Nullable - List getAllDraftsClientFormMetadata(boolean isDraft); + @Nullable + List getAllDraftsClientFormMetadata(boolean isDraft); - @Nullable - List getAllJsonWidgetValidatorClientFormMetadata(boolean isJsonValidator); + @Nullable + List getAllJsonWidgetValidatorClientFormMetadata(boolean isJsonValidator); - void updateClientMetadataIsDraftByVersion(boolean isDraft, String formVersion); + void updateClientMetadataIsDraftByVersion(boolean isDraft, String formVersion); - @Nullable - List getAllClientFormMetadata(); + @Nullable + List getAllClientFormMetadata(); - @Nullable - ClientForm getMostRecentFormValidator(@NonNull String formIdentifier); + @Nullable + ClientForm getMostRecentFormValidator(@NonNull String formIdentifier); } diff --git a/src/main/java/org/opensrp/repository/ClientsRepository.java b/src/main/java/org/opensrp/repository/ClientsRepository.java index 6a2eb69a9..7e79e903e 100644 --- a/src/main/java/org/opensrp/repository/ClientsRepository.java +++ b/src/main/java/org/opensrp/repository/ClientsRepository.java @@ -13,117 +13,121 @@ import org.smartregister.pathevaluator.dao.ClientDao; public interface ClientsRepository extends BaseRepository, ClientDao { - - Client findByBaseEntityId(String baseEntityId); - - Client findById(String id); - - List findAllClients(); - - List findAllByIdentifier(String identifier); - - List findAllByIdentifier(String identifierType, String identifier); - - List findAllByAttribute(String attributeType, String attribute); - - List findAllByAttributes(String attributeType, List attributes); - - List findAllByMatchingName(String nameMatches); - - /** - * Find a client based on the relationship id and between a range of date created dates e.g - * given mother's id get children born at a given time - * - * @param relationalId - * @param dateFrom - * @param dateTo - * @return - */ - List findByRelationshipIdAndDateCreated(String relationalId, String dateFrom, String dateTo); - - List findByRelationshipId(String relationshipType, String entityId); - - List findByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); - - List findByDynamicQuery(String query); - - List findByCriteria(ClientSearchBean searchBean); - - List findByCriteria(AddressSearchBean addressSearchBean, DateTime lastEditFrom, DateTime lastEditTo); - - List findByRelationShip(String relationIndentier); - - List findByEmptyServerVersion(); - - /** - * This method searches for all clients ordered by serverVersion ascending - * and return size determined by limit is available or default fetch size - * @param serverVersion server version for last client that was fetched - * @param limit number of records to fetch - * @return - */ - List findByServerVersion(long serverVersion, Integer limit); - - Long countAll(long serverVersion); - - List findByFieldValue(String field, List ids); - - List notInOpenMRSByServerVersion(long serverVersion, Calendar calendar); - - List selectMemberCountHouseholdHeadProviderByClients(String field, List ids, String clientType); - - HouseholdClient findTotalCountHouseholdByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); - - List findMembersByRelationshipId(String relationshipId); - - List findAllClientsByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); - - HouseholdClient findCountAllClientsByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); - - List findHouseholdByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); - - List findANCByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); - - int findCountANCByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); - - List findChildByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); - - int findCountChildByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); - - /**Updates a client - * @param entity the client to be updated - * @param allowArchived a flag that allows update of archived clients - */ - void update(Client entity, boolean allowArchived); - - /** - * This method searches for client ids paginated by server version - * - * @param serverVersion server version for last client that was fetched - * @param limit upper limit on number of client ids to fetch - * @param isArchived whether to return archived events - * @return a list of client ids and last server version - */ - Pair, Long> findAllIds(long serverVersion, int limit, boolean isArchived); - - /** - * overloads {@link #findAllIds(long, int, boolean)} by adding date/time filters - * @param serverVersion - * @param limit - * @param fromDate - * @param toDate - * @return - */ - Pair, Long> findAllIds(long serverVersion, int limit, boolean isArchived, Date fromDate, Date toDate); - - List findByClientTypeAndLocationId(String clientType, String locationId); - - List findByLocationIdExclusiveOfType(String locationId, String clientType); - - /** - * @param clients - * @return - */ - List convert(List clients); - + + Client findByBaseEntityId(String baseEntityId); + + Client findById(String id); + + List findAllClients(); + + List findAllByIdentifier(String identifier); + + List findAllByIdentifier(String identifierType, String identifier); + + List findAllByAttribute(String attributeType, String attribute); + + List findAllByAttributes(String attributeType, List attributes); + + List findAllByMatchingName(String nameMatches); + + /** + * Find a client based on the relationship id and between a range of date created dates e.g + * given mother's id get children born at a given time + * + * @param relationalId + * @param dateFrom + * @param dateTo + * @return + */ + List findByRelationshipIdAndDateCreated(String relationalId, String dateFrom, String dateTo); + + List findByRelationshipId(String relationshipType, String entityId); + + List findByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); + + List findByDynamicQuery(String query); + + List findByCriteria(ClientSearchBean searchBean); + + List findByCriteria(AddressSearchBean addressSearchBean, DateTime lastEditFrom, DateTime lastEditTo); + + List findByRelationShip(String relationIndentier); + + List findByEmptyServerVersion(); + + /** + * This method searches for all clients ordered by serverVersion ascending + * and return size determined by limit is available or default fetch size + * + * @param serverVersion server version for last client that was fetched + * @param limit number of records to fetch + * @return + */ + List findByServerVersion(long serverVersion, Integer limit); + + Long countAll(long serverVersion); + + List findByFieldValue(String field, List ids); + + List notInOpenMRSByServerVersion(long serverVersion, Calendar calendar); + + List selectMemberCountHouseholdHeadProviderByClients(String field, List ids, String clientType); + + HouseholdClient findTotalCountHouseholdByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); + + List findMembersByRelationshipId(String relationshipId); + + List findAllClientsByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); + + HouseholdClient findCountAllClientsByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); + + List findHouseholdByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); + + List findANCByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); + + int findCountANCByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); + + List findChildByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); + + int findCountChildByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean); + + /** + * Updates a client + * + * @param entity the client to be updated + * @param allowArchived a flag that allows update of archived clients + */ + void update(Client entity, boolean allowArchived); + + /** + * This method searches for client ids paginated by server version + * + * @param serverVersion server version for last client that was fetched + * @param limit upper limit on number of client ids to fetch + * @param isArchived whether to return archived events + * @return a list of client ids and last server version + */ + Pair, Long> findAllIds(long serverVersion, int limit, boolean isArchived); + + /** + * overloads {@link #findAllIds(long, int, boolean)} by adding date/time filters + * + * @param serverVersion + * @param limit + * @param fromDate + * @param toDate + * @return + */ + Pair, Long> findAllIds(long serverVersion, int limit, boolean isArchived, Date fromDate, Date toDate); + + List findByClientTypeAndLocationId(String clientType, String locationId); + + List findByLocationIdExclusiveOfType(String locationId, String clientType); + + /** + * @param clients + * @return + */ + List convert(List clients); + } diff --git a/src/main/java/org/opensrp/repository/ErrorTraceRepository.java b/src/main/java/org/opensrp/repository/ErrorTraceRepository.java index 4df8fc09b..215cea05a 100644 --- a/src/main/java/org/opensrp/repository/ErrorTraceRepository.java +++ b/src/main/java/org/opensrp/repository/ErrorTraceRepository.java @@ -5,15 +5,15 @@ import org.opensrp.domain.ErrorTrace; public interface ErrorTraceRepository extends BaseRepository { - - ErrorTrace findById(String _id); - - boolean exists(String id); - - List findAllErrors() ; - - List findAllUnSolvedErrors() ; - - List findAllSolvedErrors(); - + + ErrorTrace findById(String _id); + + boolean exists(String id); + + List findAllErrors(); + + List findAllUnSolvedErrors(); + + List findAllSolvedErrors(); + } diff --git a/src/main/java/org/opensrp/repository/EventsRepository.java b/src/main/java/org/opensrp/repository/EventsRepository.java index 077ca14e3..b8c35cf58 100644 --- a/src/main/java/org/opensrp/repository/EventsRepository.java +++ b/src/main/java/org/opensrp/repository/EventsRepository.java @@ -10,90 +10,95 @@ import org.opensrp.search.EventSearchBean; public interface EventsRepository extends BaseRepository, EventDao { - - List findAllByIdentifier(String identifier); - - List findAllByIdentifier(String identifierType, String identifier); - - Event findById(String id); - - Event findByFormSubmissionId(String formSubmissionId, boolean includeArchived); - - List findByBaseEntityId(String baseEntityId); - - Event findByBaseEntityAndFormSubmissionId(String baseEntityId, String formSubmissionId); - - List findByBaseEntityAndType(String baseEntityId, String eventType); - - List findEvents(EventSearchBean eventSearchBean); - - List findEventsByDynamicQuery(String query); - - List findByServerVersion(long serverVersion); - - List notInOpenMRSByServerVersion(long serverVersion, Calendar calendar); - - List notInOpenMRSByServerVersionAndType(String type, long serverVersion, Calendar calendar); - - List findByClientAndConceptAndDate(String baseEntityId, String concept, String conceptValue, String dateFrom, - String dateTo); - - List findByBaseEntityIdAndConceptParentCode(String baseEntityId, String concept, String parentCode); - - List findByConceptAndValue(String concept, String conceptValue); - - List findByEmptyServerVersion(); - - List findEvents(EventSearchBean eventSearchBean, String sortBy, String sortOrder, int limit); - - List findEventByEventTypeBetweenTwoDates(String eventType); - - List findByProvider(String provider); - - /** - * This method searches for event ids filtered by eventType, - * the date they were deleted and server version - * - * @param eventType used to filter the event ids - * @param isDeleted whether to return deleted event ids - * @param serverVersion - * @param limit upper limit on number of tasks ids to fetch - * @return a list of event ids and last server version - */ - Pair, Long> findIdsByEventType(String eventType, boolean isDeleted, Long serverVersion, int limit); - - /** - * overloads {@link #findIdsByEventType(String, boolean, Long, int)} by adding date/time filters - * @param serverVersion - * @param limit - * @param fromDate - * @param toDate - * @return - */ - Pair, Long> findIdsByEventType(String eventType, boolean isDeleted, - Long serverVersion, int limit, - Date fromDate, Date toDate); - - /**Updates an event - * @param entity the event to be updated - * @param allowArchived a flag that allows update of archived events - */ - void update(Event entity, boolean allowArchived); - - /** - * This method is used to return a count of events based on the provided parameters - * @param eventSearchBean object containing params to search by - * @return returns a count of events matching the passed parameters - */ - Long countEvents(EventSearchBean eventSearchBean); - - /** - * Gets events baseEntityIds in a location - * @param locationId location id - * @return baseEntityIds in a location - */ - List findBaseEntityIdsByLocation(String locationId); - - List getEventData(String planIdentifier, String eventType, Date fromDate, Date toDate); - + + List findAllByIdentifier(String identifier); + + List findAllByIdentifier(String identifierType, String identifier); + + Event findById(String id); + + Event findByFormSubmissionId(String formSubmissionId, boolean includeArchived); + + List findByBaseEntityId(String baseEntityId); + + Event findByBaseEntityAndFormSubmissionId(String baseEntityId, String formSubmissionId); + + List findByBaseEntityAndType(String baseEntityId, String eventType); + + List findEvents(EventSearchBean eventSearchBean); + + List findEventsByDynamicQuery(String query); + + List findByServerVersion(long serverVersion); + + List notInOpenMRSByServerVersion(long serverVersion, Calendar calendar); + + List notInOpenMRSByServerVersionAndType(String type, long serverVersion, Calendar calendar); + + List findByClientAndConceptAndDate(String baseEntityId, String concept, String conceptValue, String dateFrom, + String dateTo); + + List findByBaseEntityIdAndConceptParentCode(String baseEntityId, String concept, String parentCode); + + List findByConceptAndValue(String concept, String conceptValue); + + List findByEmptyServerVersion(); + + List findEvents(EventSearchBean eventSearchBean, String sortBy, String sortOrder, int limit); + + List findEventByEventTypeBetweenTwoDates(String eventType); + + List findByProvider(String provider); + + /** + * This method searches for event ids filtered by eventType, + * the date they were deleted and server version + * + * @param eventType used to filter the event ids + * @param isDeleted whether to return deleted event ids + * @param serverVersion + * @param limit upper limit on number of tasks ids to fetch + * @return a list of event ids and last server version + */ + Pair, Long> findIdsByEventType(String eventType, boolean isDeleted, Long serverVersion, int limit); + + /** + * overloads {@link #findIdsByEventType(String, boolean, Long, int)} by adding date/time filters + * + * @param serverVersion + * @param limit + * @param fromDate + * @param toDate + * @return + */ + Pair, Long> findIdsByEventType(String eventType, boolean isDeleted, + Long serverVersion, int limit, + Date fromDate, Date toDate); + + /** + * Updates an event + * + * @param entity the event to be updated + * @param allowArchived a flag that allows update of archived events + */ + void update(Event entity, boolean allowArchived); + + /** + * This method is used to return a count of events based on the provided parameters + * + * @param eventSearchBean object containing params to search by + * @return returns a count of events matching the passed parameters + */ + Long countEvents(EventSearchBean eventSearchBean); + + /** + * Gets events baseEntityIds in a location + * + * @param locationId location id + * @return baseEntityIds in a location + */ + List findBaseEntityIdsByLocation(String locationId); + + List getEventData(String planIdentifier, String eventType, Date fromDate, Date toDate); + } diff --git a/src/main/java/org/opensrp/repository/IdentifierSourceRepository.java b/src/main/java/org/opensrp/repository/IdentifierSourceRepository.java index e169e9803..bfc7c27d6 100644 --- a/src/main/java/org/opensrp/repository/IdentifierSourceRepository.java +++ b/src/main/java/org/opensrp/repository/IdentifierSourceRepository.java @@ -4,11 +4,11 @@ public interface IdentifierSourceRepository extends BaseRepository { - - IdentifierSource findByIdentifier(String identifier); - void update(IdentifierSource identifierSource); + IdentifierSource findByIdentifier(String identifier); - void updateIdSourceWithSequenceValue(IdentifierSource identifierSource, Long sequenceValue); + void update(IdentifierSource identifierSource); + + void updateIdSourceWithSequenceValue(IdentifierSource identifierSource, Long sequenceValue); } diff --git a/src/main/java/org/opensrp/repository/LocationRepository.java b/src/main/java/org/opensrp/repository/LocationRepository.java index 190326deb..f7234744b 100644 --- a/src/main/java/org/opensrp/repository/LocationRepository.java +++ b/src/main/java/org/opensrp/repository/LocationRepository.java @@ -17,273 +17,294 @@ public interface LocationRepository extends BaseRepository, LocationDao { - PhysicalLocation getStructure(String id, boolean returnGeometry); - - PhysicalLocation get(String id, boolean returnGeometry, boolean includeInactive); - - List findLocationsByServerVersion(long serverVersion); - - List findLocationsByNames(String locationNames, long serverVersion); - - List findStructuresByParentAndServerVersion(String parentId, long serverVersion); - - List findByEmptyServerVersion(); - - List findStructuresByEmptyServerVersion(); - - List getAllStructures(); - - Collection findStructureAndFamilyDetails(double latitude, double longitude, double radius); - - /** - * This methods searches for jurisdictions using the parentId and location properties - * It returns the Geometry optionally if @param returnGeometry is set to true. - * @param returnGeometry boolean which controls if geometry is returned - * @param parentId string the parent id of the jurisdiction being searched. If empty search for ROOT location. - * @param properties map of location properties to filter with, each entry in map has property name and value - * @return jurisdictions matching the params - */ - List findLocationsByProperties(boolean returnGeometry, String parentId, - Map properties); - - /** - * This methods searches for structures using the parentId and location properties - * It returns the Geometry optionally if @param returnGeometry is set to true. - * @param returnGeometry boolean which controls if geometry is returned - * @param parentId string the parent id of the structure being searched - * @param properties map of location properties to filter with, each entry in map has property name and value - * @return structures matching the params - */ - List findStructuresByProperties(boolean returnGeometry, String parentId, - Map properties); - - /** - * This methods searches for structures using the parentId and location properties - * It returns the Geometry optionally if @param returnGeometry is set to true. - * @param returnGeometry boolean which controls if geometry is returned - * @param parentId string the parent id of the structure being searched - * @param properties map of location properties to filter with, each entry in map has property name and value - * @param limit upper limit on number of structures to fetch - * @return structures matching the params - */ - List findStructuresByProperties(boolean returnGeometry, String parentId, - Map properties, int limit); - - /** - * This methods searches for locations using a list of provided location ids. - * It returns the Geometry optionally if @param returnGeometry is set to true. - * @param returnGeometry boolean which controls if geometry is returned - * @param ids list of location ids - * @param serverVersion server version if not null filter - * @return jurisdictions whose ids match the provided params - */ - List findLocationsByIds(boolean returnGeometry, List ids, Long serverVersion); - - /** - * This methods searches for a location and it's children using the provided location id - * It returns the Geometry optionally if @param returnGeometry is set to true. - * @param returnGeometry boolean which controls if geometry is returned - * @param id location id - * @param pageSize number of records to be returned - * @return location together with it's children whose id matches the provided param - */ - List findLocationByIdWithChildren(boolean returnGeometry, String id, int pageSize); + PhysicalLocation getStructure(String id, boolean returnGeometry); + + PhysicalLocation get(String id, boolean returnGeometry, boolean includeInactive); + + List findLocationsByServerVersion(long serverVersion); + + List findLocationsByNames(String locationNames, long serverVersion); + + List findStructuresByParentAndServerVersion(String parentId, long serverVersion); + + List findByEmptyServerVersion(); + + List findStructuresByEmptyServerVersion(); + + List getAllStructures(); + + Collection findStructureAndFamilyDetails(double latitude, double longitude, double radius); + + /** + * This methods searches for jurisdictions using the parentId and location properties + * It returns the Geometry optionally if @param returnGeometry is set to true. + * + * @param returnGeometry boolean which controls if geometry is returned + * @param parentId string the parent id of the jurisdiction being searched. If empty search for ROOT location. + * @param properties map of location properties to filter with, each entry in map has property name and value + * @return jurisdictions matching the params + */ + List findLocationsByProperties(boolean returnGeometry, String parentId, + Map properties); /** - * This methods searches for locations using a list of provided location ids.It returns location whose is in the list or whose parent is in list - * It returns the Geometry optionally if @param returnGeometry is set to true. - * @param returnGeometry boolean which controls if geometry is returned - * @param ids list of location ids - * @return jurisdictions whose ids match the provided params - */ - List findLocationsByIdsOrParentIds(boolean returnGeometry, List ids); + * This methods searches for structures using the parentId and location properties + * It returns the Geometry optionally if @param returnGeometry is set to true. + * + * @param returnGeometry boolean which controls if geometry is returned + * @param parentId string the parent id of the structure being searched + * @param properties map of location properties to filter with, each entry in map has property name and value + * @return structures matching the params + */ + List findStructuresByProperties(boolean returnGeometry, String parentId, + Map properties); + + /** + * This methods searches for structures using the parentId and location properties + * It returns the Geometry optionally if @param returnGeometry is set to true. + * + * @param returnGeometry boolean which controls if geometry is returned + * @param parentId string the parent id of the structure being searched + * @param properties map of location properties to filter with, each entry in map has property name and value + * @param limit upper limit on number of structures to fetch + * @return structures matching the params + */ + List findStructuresByProperties(boolean returnGeometry, String parentId, + Map properties, int limit); + + /** + * This methods searches for locations using a list of provided location ids. + * It returns the Geometry optionally if @param returnGeometry is set to true. + * + * @param returnGeometry boolean which controls if geometry is returned + * @param ids list of location ids + * @param serverVersion server version if not null filter + * @return jurisdictions whose ids match the provided params + */ + List findLocationsByIds(boolean returnGeometry, List ids, Long serverVersion); + + /** + * This methods searches for a location and it's children using the provided location id + * It returns the Geometry optionally if @param returnGeometry is set to true. + * + * @param returnGeometry boolean which controls if geometry is returned + * @param id location id + * @param pageSize number of records to be returned + * @return location together with it's children whose id matches the provided param + */ + List findLocationByIdWithChildren(boolean returnGeometry, String id, int pageSize); + + /** + * This methods searches for locations using a list of provided location ids.It returns location whose is in the list or whose parent is in list + * It returns the Geometry optionally if @param returnGeometry is set to true. + * + * @param returnGeometry boolean which controls if geometry is returned + * @param ids list of location ids + * @return jurisdictions whose ids match the provided params + */ + List findLocationsByIdsOrParentIds(boolean returnGeometry, List ids); /** * This method fetches all structure Ids - * - * @param serverVersion - * @param limit upper limit on number of structure ids to fetch + * + * @param serverVersion + * @param limit upper limit on number of structure ids to fetch * @return a list of structure Ids and last server version */ - Pair, Long> findAllStructureIds(Long serverVersion, int limit); - - /** - * overloads {@link #findAllStructureIds(Long, int)} by adding date/time filters - * @param serverVersion - * @param limit - * @param fromDate - * @param toDate - * @return - */ - Pair, Long> findAllStructureIds(Long serverVersion, int limit, Date fromDate, Date toDate); - - /** - * This method searches for location identifier and name using a plan identifier. - * - * @param planIdentifier identifier of the plan - * @return list of location details i.e. identifier and name - */ - Set findLocationDetailsByPlanId(String planIdentifier); - - /** - * This method searches for jurisdictions ordered by serverVersion ascending - * - * @param returnGeometry boolean which controls if geometry is returned - * @param serverVersion - * @param limit upper limit on number of jurisdictions to fetch - * @return list of jurisdictions - */ - List findAllLocations(boolean returnGeometry, Long serverVersion, int limit, boolean includeInactive); - - /** - * counts all locations - * @param serverVersion - * @return - */ - Long countAllLocations(Long serverVersion); - - /** - * This method searches for structures ordered by serverVersion ascending - * - * @param returnGeometry boolean which controls if geometry is returned - * @param serverVersion - * @param limit upper limit on number of structures to fetch - * @return list of structures - */ - List findAllStructures(boolean returnGeometry, Long serverVersion, int limit, Integer pageNumber, String orderByType, String orderByFieldName); - - /** - * count all structures - * @param serverVersion - * @return - */ - Long countAllStructures(Long serverVersion); - - /** - * This method fetches all location Ids - * - * @param serverVersion - * @param limit upper limit on number of location ids to fetch - * @return a list of location Ids - */ - Pair, Long> findAllLocationIds(Long serverVersion, int limit); - - /** - * overloads {@link #findAllLocationIds(Long, int)} by adding date/time filters - * @param serverVersion - * @param limit - * @param fromDate - * @param toDate - * @return - */ - Pair, Long> findAllLocationIds(Long serverVersion, int limit, Date fromDate, Date toDate); - - List searchLocations(LocationSearchBean locationSearchBean); - - int countSearchLocations(LocationSearchBean locationSearchBean); - - /** - * Gets the parent locations inclusive of the location of the identifiers. - * This returns the details of ancestors including locations the identifiers - * @param identifiers the identifiers of locations to get the parent locations - * @return the parent locations inclusive of the location of the identifiers - */ - Set findParentLocationsInclusive(Set identifiers); - - /** - * Gets the parent locations inclusive of the location of the identifiers. - * This returns the details of ancestors including locations the identifiers - * @param identifiers the identifiers of locations to get the parent locations - * @param returnTags Whether or not to return location tags - * @return the parent locations inclusive of the location of the identifiers - */ - Set findParentLocationsInclusive(Set identifiers, boolean returnTags); - - - /** - * This method is used to return a location based on the provided parameters - * @param identifier identifier of the location - * @param status status of the location - * @return returns a location matching the passed parameters - */ - PhysicalLocation findLocationByIdentifierAndStatus(String identifier, List status, boolean returnGeometry); - - /** - * Gets the location primary key - * @param identifier of of the location - * @param isJurisdiction whether the to search for jurisdiction or structure - * @return the numerical primary key of a jurisdiction - */ - public Long retrievePrimaryKey(String identifier, boolean isJurisdiction); - - - PhysicalLocation get(String id, boolean returnGeometry, int version); - - /** - * This method is used to return a count of structure based on the provided parameters - * @param parentId a string of comma separated ids for the parent locations - * @param serverVersion - * @return returns a count of structures matching the passed parameters - */ - Long countStructuresByParentAndServerVersion(String parentId, long serverVersion); - - /** - * This method is used to return a count of locations based on the provided parameters - * @param serverVersion - * @return returns a count of locations matching the passed parameters - */ - Long countLocationsByServerVersion(long serverVersion); - - /** - * This method is used to return a count of locations based on the provided parameters - * @param locationNames A string of comma separated location names - * @param serverVersion - * @return returns a count of locations matching the passed parameters - */ - Long countLocationsByNames(String locationNames, long serverVersion); - - /** - * Get location with all of its descendants. - * - * @param locationId location id of the root location - * @return chi - */ - Set findLocationWithDescendants(String locationId, boolean returnTags); - - /** - * This method returns a map containing a location identifier and a count of associated structures - * @param locationIds - * @return - */ - List findStructureCountsForLocation(Set locationIds); - - /** - * This methods searches for a location and it's children using the provided location ids - * It returns the Geometry optionally if @param returnGeometry is set to true. - * @param returnGeometry boolean which controls if geometry is returned - * @param identifiers location ids - * @param pageSize number of records to be returned - * @return location together with it's children whose id matches the provided param - */ - List findLocationByIdsWithChildren(boolean returnGeometry, Set identifiers, int pageSize); - - - /** - * Gets the count of locations based on locationIds and server version - * @param locationIds the list of locationIds to filter with - * @param serverVersion the server version to filter with - * @return number of records - */ - long countLocationsByIds(List locationIds, long serverVersion); - - /** - * Gets the structures with the stocks attached to them - * @param jurisdictionId location Id - * @param properties Structure properties - * @param returnGeometry boolean that returns geometry data if true - * @param limit number of records to be returned, use -1 to return all the records - * @return List of Structures alongside its stocks - */ - List findLocationAndStocksByJurisdiction(String jurisdictionId, Map properties, - boolean returnGeometry, int limit); + Pair, Long> findAllStructureIds(Long serverVersion, int limit); + + /** + * overloads {@link #findAllStructureIds(Long, int)} by adding date/time filters + * + * @param serverVersion + * @param limit + * @param fromDate + * @param toDate + * @return + */ + Pair, Long> findAllStructureIds(Long serverVersion, int limit, Date fromDate, Date toDate); + + /** + * This method searches for location identifier and name using a plan identifier. + * + * @param planIdentifier identifier of the plan + * @return list of location details i.e. identifier and name + */ + Set findLocationDetailsByPlanId(String planIdentifier); + + /** + * This method searches for jurisdictions ordered by serverVersion ascending + * + * @param returnGeometry boolean which controls if geometry is returned + * @param serverVersion + * @param limit upper limit on number of jurisdictions to fetch + * @return list of jurisdictions + */ + List findAllLocations(boolean returnGeometry, Long serverVersion, int limit, boolean includeInactive); + + /** + * counts all locations + * + * @param serverVersion + * @return + */ + Long countAllLocations(Long serverVersion); + + /** + * This method searches for structures ordered by serverVersion ascending + * + * @param returnGeometry boolean which controls if geometry is returned + * @param serverVersion + * @param limit upper limit on number of structures to fetch + * @return list of structures + */ + List findAllStructures(boolean returnGeometry, Long serverVersion, int limit, Integer pageNumber, String orderByType, String orderByFieldName); + + /** + * count all structures + * + * @param serverVersion + * @return + */ + Long countAllStructures(Long serverVersion); + + /** + * This method fetches all location Ids + * + * @param serverVersion + * @param limit upper limit on number of location ids to fetch + * @return a list of location Ids + */ + Pair, Long> findAllLocationIds(Long serverVersion, int limit); + + /** + * overloads {@link #findAllLocationIds(Long, int)} by adding date/time filters + * + * @param serverVersion + * @param limit + * @param fromDate + * @param toDate + * @return + */ + Pair, Long> findAllLocationIds(Long serverVersion, int limit, Date fromDate, Date toDate); + + List searchLocations(LocationSearchBean locationSearchBean); + + int countSearchLocations(LocationSearchBean locationSearchBean); + + /** + * Gets the parent locations inclusive of the location of the identifiers. + * This returns the details of ancestors including locations the identifiers + * + * @param identifiers the identifiers of locations to get the parent locations + * @return the parent locations inclusive of the location of the identifiers + */ + Set findParentLocationsInclusive(Set identifiers); + + /** + * Gets the parent locations inclusive of the location of the identifiers. + * This returns the details of ancestors including locations the identifiers + * + * @param identifiers the identifiers of locations to get the parent locations + * @param returnTags Whether or not to return location tags + * @return the parent locations inclusive of the location of the identifiers + */ + Set findParentLocationsInclusive(Set identifiers, boolean returnTags); + + + /** + * This method is used to return a location based on the provided parameters + * + * @param identifier identifier of the location + * @param status status of the location + * @return returns a location matching the passed parameters + */ + PhysicalLocation findLocationByIdentifierAndStatus(String identifier, List status, boolean returnGeometry); + + /** + * Gets the location primary key + * + * @param identifier of of the location + * @param isJurisdiction whether the to search for jurisdiction or structure + * @return the numerical primary key of a jurisdiction + */ + public Long retrievePrimaryKey(String identifier, boolean isJurisdiction); + + + PhysicalLocation get(String id, boolean returnGeometry, int version); + + /** + * This method is used to return a count of structure based on the provided parameters + * + * @param parentId a string of comma separated ids for the parent locations + * @param serverVersion + * @return returns a count of structures matching the passed parameters + */ + Long countStructuresByParentAndServerVersion(String parentId, long serverVersion); + + /** + * This method is used to return a count of locations based on the provided parameters + * + * @param serverVersion + * @return returns a count of locations matching the passed parameters + */ + Long countLocationsByServerVersion(long serverVersion); + + /** + * This method is used to return a count of locations based on the provided parameters + * + * @param locationNames A string of comma separated location names + * @param serverVersion + * @return returns a count of locations matching the passed parameters + */ + Long countLocationsByNames(String locationNames, long serverVersion); + + /** + * Get location with all of its descendants. + * + * @param locationId location id of the root location + * @return chi + */ + Set findLocationWithDescendants(String locationId, boolean returnTags); + + /** + * This method returns a map containing a location identifier and a count of associated structures + * + * @param locationIds + * @return + */ + List findStructureCountsForLocation(Set locationIds); + + /** + * This methods searches for a location and it's children using the provided location ids + * It returns the Geometry optionally if @param returnGeometry is set to true. + * + * @param returnGeometry boolean which controls if geometry is returned + * @param identifiers location ids + * @param pageSize number of records to be returned + * @return location together with it's children whose id matches the provided param + */ + List findLocationByIdsWithChildren(boolean returnGeometry, Set identifiers, int pageSize); + + + /** + * Gets the count of locations based on locationIds and server version + * + * @param locationIds the list of locationIds to filter with + * @param serverVersion the server version to filter with + * @return number of records + */ + long countLocationsByIds(List locationIds, long serverVersion); + + /** + * Gets the structures with the stocks attached to them + * + * @param jurisdictionId location Id + * @param properties Structure properties + * @param returnGeometry boolean that returns geometry data if true + * @param limit number of records to be returned, use -1 to return all the records + * @return List of Structures alongside its stocks + */ + List findLocationAndStocksByJurisdiction(String jurisdictionId, Map properties, + boolean returnGeometry, int limit); } diff --git a/src/main/java/org/opensrp/repository/LocationTagRepository.java b/src/main/java/org/opensrp/repository/LocationTagRepository.java index b39252335..ccf08a6be 100644 --- a/src/main/java/org/opensrp/repository/LocationTagRepository.java +++ b/src/main/java/org/opensrp/repository/LocationTagRepository.java @@ -6,23 +6,23 @@ import org.opensrp.domain.postgres.LocationTagExample; public interface LocationTagRepository extends BaseRepository { - - LocationTag getLocationTagByPrimaryKey(Long id); - - void safeRemove(Long id); - - org.opensrp.domain.postgres.LocationTag getLocationTagByName(String name); - - org.opensrp.domain.postgres.LocationTag getLocationTagByNameAndNotEqualId(String name, Long id); - - List findByLocationTagExample(LocationTagExample locationTagExample, int offset, int limit); - - int addLocationTagMap(org.opensrp.domain.LocationTagMap locationTagMap); - - void deleteLocationTagMapByLocationIdAndLocationTagId(Long locationId, Long locationTagId); - - void deleteLocationTagMapByLocationId(Long locationId); - - List getLocationTagMapByExample(Long locationid, Long locationtagId); - + + LocationTag getLocationTagByPrimaryKey(Long id); + + void safeRemove(Long id); + + org.opensrp.domain.postgres.LocationTag getLocationTagByName(String name); + + org.opensrp.domain.postgres.LocationTag getLocationTagByNameAndNotEqualId(String name, Long id); + + List findByLocationTagExample(LocationTagExample locationTagExample, int offset, int limit); + + int addLocationTagMap(org.opensrp.domain.LocationTagMap locationTagMap); + + void deleteLocationTagMapByLocationIdAndLocationTagId(Long locationId, Long locationTagId); + + void deleteLocationTagMapByLocationId(Long locationId); + + List getLocationTagMapByExample(Long locationid, Long locationtagId); + } diff --git a/src/main/java/org/opensrp/repository/MultimediaRepository.java b/src/main/java/org/opensrp/repository/MultimediaRepository.java index 72f31f4f4..a5294953e 100644 --- a/src/main/java/org/opensrp/repository/MultimediaRepository.java +++ b/src/main/java/org/opensrp/repository/MultimediaRepository.java @@ -6,31 +6,30 @@ import org.springframework.lang.NonNull; public interface MultimediaRepository extends BaseRepository { - - Multimedia findByCaseId(String entityId); - - List all(String providerId); - /** - * Returns a {@link List} of {@link Multimedia} objects that match the given parameters - * - * @param entityId The baseEntityId of the client who owns the multimedia file(s) - * @param contentType The contentType of the multimedia file(s) to be fetched - * @param fileCategory The file category of the multimedia file(s) - * - * @return A {@link List} of {@link Multimedia} objects - */ - List get(@NonNull String entityId, @NonNull String contentType, @NonNull String fileCategory); + Multimedia findByCaseId(String entityId); - /*** - * Returns a {@link List} of {@link Multimedia} objects created by the provider and match content type and paginated by - * given parameters - * - * @param providerID - * @param fileCategory - * @param offset - * @param count - * @return - */ - List getByProviderID(@NonNull String providerID, @NonNull String fileCategory, int offset, int count); + List all(String providerId); + + /** + * Returns a {@link List} of {@link Multimedia} objects that match the given parameters + * + * @param entityId The baseEntityId of the client who owns the multimedia file(s) + * @param contentType The contentType of the multimedia file(s) to be fetched + * @param fileCategory The file category of the multimedia file(s) + * @return A {@link List} of {@link Multimedia} objects + */ + List get(@NonNull String entityId, @NonNull String contentType, @NonNull String fileCategory); + + /*** + * Returns a {@link List} of {@link Multimedia} objects created by the provider and match content type and paginated by + * given parameters + * + * @param providerID + * @param fileCategory + * @param offset + * @param count + * @return + */ + List getByProviderID(@NonNull String providerID, @NonNull String fileCategory, int offset, int count); } diff --git a/src/main/java/org/opensrp/repository/OrganizationRepository.java b/src/main/java/org/opensrp/repository/OrganizationRepository.java index b461c6bef..40fe7e72e 100755 --- a/src/main/java/org/opensrp/repository/OrganizationRepository.java +++ b/src/main/java/org/opensrp/repository/OrganizationRepository.java @@ -13,75 +13,74 @@ */ public interface OrganizationRepository extends BaseRepository { - /** - * Returns all organizations that encompass the given location - * Organizations can be fetched by child locations - * - * @return - */ - List selectOrganizationsEncompassLocations(String location_id, Date activeDate); - - /** - * Assign jurisdiction and or plan to a organization - * - * @param organizationId the organization identifier - * @param planIdentifier - * @param jurisdictionIdentifier - * @param jurisdiction id of jurisdiction being assigned - * @param planId id of the plan being assigned - * @param fromDate with effect from - * @param toDate with effect to - */ - void assignLocationAndPlan(Long organizationId, String jurisdictionIdentifier, Long jurisdictionId, - String planIdentifier, Long planId, Date fromDate, Date toDate); - - /** - * Gets the plans and jurisdictions that an organization is assigned to an - * organization - * - * @param organizationId Id of organization - * @param returnFutureAssignments flag to control if future assignments are returned - * @return assigned plans and locations - */ - List findAssignedLocations(AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean); - - /** - * Gets the plans and jurisdictions that an organization is assigned to a list - * organizations - * - * @param organizationIds - * @param returnFutureAssignments flag to control if future assignments are returned - * @return assigned plans and locations - */ - List findAssignedLocations(List organizationIds,boolean returnFutureAssignments); - - /** - * @param id - * @return - */ - Organization getByPrimaryKey(Long id); - - /** - * Gets the plans and jurisdictions using filtered by plan identifier - * - * @param planId the Plan Id - * - * @return list of assigned locations and plans - */ - @Deprecated - List findAssignedLocationsByPlanId(AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean); - - List findSearchOrganizations(OrganizationSearchBean organizationSearchBean); - - int findOrganizationCount(OrganizationSearchBean organizationSearchBean); - - Organization findOrganizationByName(String name); - - List getAllOrganizations(OrganizationSearchBean organizationSearchBean); - - void unassignLocationAndPlan(Long planId); - - long countAllOrganizations(); - - List getOrganizationsByIds(List organizationIds); + /** + * Returns all organizations that encompass the given location + * Organizations can be fetched by child locations + * + * @return + */ + List selectOrganizationsEncompassLocations(String location_id, Date activeDate); + + /** + * Assign jurisdiction and or plan to a organization + * + * @param organizationId the organization identifier + * @param planIdentifier + * @param jurisdictionIdentifier + * @param jurisdiction id of jurisdiction being assigned + * @param planId id of the plan being assigned + * @param fromDate with effect from + * @param toDate with effect to + */ + void assignLocationAndPlan(Long organizationId, String jurisdictionIdentifier, Long jurisdictionId, + String planIdentifier, Long planId, Date fromDate, Date toDate); + + /** + * Gets the plans and jurisdictions that an organization is assigned to an + * organization + * + * @param organizationId Id of organization + * @param returnFutureAssignments flag to control if future assignments are returned + * @return assigned plans and locations + */ + List findAssignedLocations(AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean); + + /** + * Gets the plans and jurisdictions that an organization is assigned to a list + * organizations + * + * @param organizationIds + * @param returnFutureAssignments flag to control if future assignments are returned + * @return assigned plans and locations + */ + List findAssignedLocations(List organizationIds, boolean returnFutureAssignments); + + /** + * @param id + * @return + */ + Organization getByPrimaryKey(Long id); + + /** + * Gets the plans and jurisdictions using filtered by plan identifier + * + * @param planId the Plan Id + * @return list of assigned locations and plans + */ + @Deprecated + List findAssignedLocationsByPlanId(AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean); + + List findSearchOrganizations(OrganizationSearchBean organizationSearchBean); + + int findOrganizationCount(OrganizationSearchBean organizationSearchBean); + + Organization findOrganizationByName(String name); + + List getAllOrganizations(OrganizationSearchBean organizationSearchBean); + + void unassignLocationAndPlan(Long planId); + + long countAllOrganizations(); + + List getOrganizationsByIds(List organizationIds); } diff --git a/src/main/java/org/opensrp/repository/PlanRepository.java b/src/main/java/org/opensrp/repository/PlanRepository.java index 097807a28..4f294507a 100644 --- a/src/main/java/org/opensrp/repository/PlanRepository.java +++ b/src/main/java/org/opensrp/repository/PlanRepository.java @@ -20,71 +20,79 @@ public interface PlanRepository extends BaseRepository, PlanDao * plan identifiers and returns a subset of fields determined by the list of provided fields * If no plan identifier(s) are provided the method returns all available plans * If no fields are provided the method returns all the available fields - * @param ids list of plan identifiers + * + * @param ids list of plan identifiers * @param fields list of fields to return * @return plan definitions whose identifiers match the provided params */ List getPlansByIdsReturnOptionalFields(List ids, List fields, boolean experimental); - - + + /** - * Gets the plan primary key + * Gets the plan primary key + * * @param identifier of of the plan * @return the numerical primary key of a plan */ public Long retrievePrimaryKey(String identifier); - - /** Gets the plans using the plan identifiers and whose server version is greater than or equal to server version - * @param planIdentifiers the plan identifiers - * @param serverVersion - * @return plans with the identifiers and server version greater than or equal to server version param - */ - List getPlansByIdentifiersAndServerVersion(List planIdentifiers, Long serverVersion, boolean experimental); - /** - * This method searches for plans ordered by serverVersion ascending - * - * @param serverVersion - * @param limit upper limit on number of plans to fetch - * @return list of plan identifiers - */ - List getAllPlans(Long serverVersion, int limit, boolean experimental); + /** + * Gets the plans using the plan identifiers and whose server version is greater than or equal to server version + * + * @param planIdentifiers the plan identifiers + * @param serverVersion + * @return plans with the identifiers and server version greater than or equal to server version param + */ + List getPlansByIdentifiersAndServerVersion(List planIdentifiers, Long serverVersion, boolean experimental); - /** - * counts all plans - * @param serverVersion - * @param experimental - * @return - */ - Long countAllPlans(Long serverVersion, boolean experimental); + /** + * This method searches for plans ordered by serverVersion ascending + * + * @param serverVersion + * @param limit upper limit on number of plans to fetch + * @return list of plan identifiers + */ + List getAllPlans(Long serverVersion, int limit, boolean experimental); - /** - * This method fetches all plan Ids - * - * @param serverVersion - * @param limit upper limit on number of plans to fetch - * @param isDeleted whether to return deleted plan ids - * @return a list of plan Ids and the last server version - */ - Pair, Long> findAllIds(Long serverVersion, int limit, boolean isDeleted); + /** + * counts all plans + * + * @param serverVersion + * @param experimental + * @return + */ + Long countAllPlans(Long serverVersion, boolean experimental); - /** - * overloads {@link #findAllIds(Long, int, boolean)} by adding date/time filters - * @param serverVersion - * @param limit - * @param isDeleted - * @param fromDate - * @param toDate - * @return - */ - Pair, Long> findAllIds(Long serverVersion, int limit, boolean isDeleted, Date fromDate, Date toDate); + /** + * This method fetches all plan Ids + * + * @param serverVersion + * @param limit upper limit on number of plans to fetch + * @param isDeleted whether to return deleted plan ids + * @return a list of plan Ids and the last server version + */ + Pair, Long> findAllIds(Long serverVersion, int limit, boolean isDeleted); - /** Gets the plans using the plan identifiers and whose server version is greater than or equal to server version - * @param planIdentifiers the plan identifiers - * @param serverVersion - * @return plans with the identifiers and server version greater than or equal to server version param - */ - Long countPlansByIdentifiersAndServerVersion(List planIdentifiers, Long serverVersion); + /** + * overloads {@link #findAllIds(Long, int, boolean)} by adding date/time filters + * + * @param serverVersion + * @param limit + * @param isDeleted + * @param fromDate + * @param toDate + * @return + */ + Pair, Long> findAllIds(Long serverVersion, int limit, boolean isDeleted, Date fromDate, Date toDate); + + /** + * Gets the plans using the plan identifiers and whose server version is greater than or equal to server version + * + * @param planIdentifiers the plan identifiers + * @param serverVersion + * @return plans with the identifiers and server version greater than or equal to server version param + */ + Long countPlansByIdentifiersAndServerVersion(List planIdentifiers, Long serverVersion); - List getAllPlans(PlanSearchBean planSearchBean); + List getAllPlans(PlanSearchBean planSearchBean); } diff --git a/src/main/java/org/opensrp/repository/PractitionerRepository.java b/src/main/java/org/opensrp/repository/PractitionerRepository.java index 71665e51d..cc30820fe 100755 --- a/src/main/java/org/opensrp/repository/PractitionerRepository.java +++ b/src/main/java/org/opensrp/repository/PractitionerRepository.java @@ -9,29 +9,31 @@ public interface PractitionerRepository extends BaseRepository { org.opensrp.domain.postgres.Practitioner getPractitioner(String id); - /** - * @param userId - * @return - */ - Practitioner getPractitionerByUserId(String userId); + /** + * @param userId + * @return + */ + Practitioner getPractitionerByUserId(String userId); - Practitioner getByPrimaryKey(Long id); + Practitioner getByPrimaryKey(Long id); - List getPractitionersByOrgId(Long orgId); + List getPractitionersByOrgId(Long orgId); - void safeRemove(String identifier); + void safeRemove(String identifier); - /** Get the practitioner using username - * @param username to get - * @return practitioner - */ - Practitioner getPractitionerByUsername(String username); + /** + * Get the practitioner using username + * + * @param username to get + * @return practitioner + */ + Practitioner getPractitionerByUsername(String username); - List getAllPractitioners(PractitionerSearchBean practitionerSearchBean); + List getAllPractitioners(PractitionerSearchBean practitionerSearchBean); - List getAllPractitionersByIdentifiers(List practitionerIdentifiers); + List getAllPractitionersByIdentifiers(List practitionerIdentifiers); - long countAllPractitioners(); + long countAllPractitioners(); - Practitioner getPractitionerByIdentifier(String practitionerIdentifier); + Practitioner getPractitionerByIdentifier(String practitionerIdentifier); } diff --git a/src/main/java/org/opensrp/repository/PractitionerRoleRepository.java b/src/main/java/org/opensrp/repository/PractitionerRoleRepository.java index dbdca4a68..07224e188 100755 --- a/src/main/java/org/opensrp/repository/PractitionerRoleRepository.java +++ b/src/main/java/org/opensrp/repository/PractitionerRoleRepository.java @@ -7,9 +7,9 @@ public interface PractitionerRoleRepository extends BaseRepository { - List getRolesForPractitioner(String practitionerIdentifier); + List getRolesForPractitioner(String practitionerIdentifier); - List getPgRolesForPractitioner(String practitionerIdentifier); + List getPgRolesForPractitioner(String practitionerIdentifier); org.opensrp.domain.postgres.PractitionerRole getPractitionerRole(String id); @@ -19,12 +19,12 @@ public interface PractitionerRoleRepository extends BaseRepository getAllPractitionerRoles(PractitionerRoleSearchBean practitionerRoleSearchBean); - List getPractitionerRolesByOrgIdAndCode(Long organizationId, String code); + List getPractitionerRolesByOrgIdAndCode(Long organizationId, String code); - long countAllPractitionerRoles(); + long countAllPractitionerRoles(); } diff --git a/src/main/java/org/opensrp/repository/ProductCatalogueRepository.java b/src/main/java/org/opensrp/repository/ProductCatalogueRepository.java index eeb215d24..884cef140 100644 --- a/src/main/java/org/opensrp/repository/ProductCatalogueRepository.java +++ b/src/main/java/org/opensrp/repository/ProductCatalogueRepository.java @@ -7,17 +7,17 @@ public interface ProductCatalogueRepository extends BaseRepository { - ProductCatalogue getById(Long uniqueId, String baseUrl); + ProductCatalogue getById(Long uniqueId, String baseUrl); - @Deprecated(since = "2.11.4-SNAPSHOT", forRemoval = true) - List getProductCataloguesBySearchBean(ProductCatalogueSearchBean productCatalogueSearchBean, String baseUrl); + @Deprecated(since = "2.11.4-SNAPSHOT", forRemoval = true) + List getProductCataloguesBySearchBean(ProductCatalogueSearchBean productCatalogueSearchBean, String baseUrl); - List getProductCataloguesBySearchBean(ProductCatalogueSearchBean productCatalogueSearchBean, int limit, String baseUrl); + List getProductCataloguesBySearchBean(ProductCatalogueSearchBean productCatalogueSearchBean, int limit, String baseUrl); - void safeRemove(Long id); + void safeRemove(Long id); - ProductCatalogue getProductCatalogueByName(String productName); + ProductCatalogue getProductCatalogueByName(String productName); - List getAll(String baseUrl); + List getAll(String baseUrl); } diff --git a/src/main/java/org/opensrp/repository/ReportsRepository.java b/src/main/java/org/opensrp/repository/ReportsRepository.java index af0ee496b..8f3a28a28 100644 --- a/src/main/java/org/opensrp/repository/ReportsRepository.java +++ b/src/main/java/org/opensrp/repository/ReportsRepository.java @@ -6,26 +6,26 @@ import org.opensrp.domain.Report; public interface ReportsRepository extends BaseRepository { - - Report findById(String id); - - List findByBaseEntityId(String baseEntityId); - - List findAllByIdentifier(String identifier); - - List findByBaseEntityAndType(String baseEntityId, String reportType); - - List findByEmptyServerVersion(); - - List findByServerVersion(long serverVersion); - - List findByBaseEntityAndFormSubmissionId(String baseEntityId, String formSubmissionId); - - List findReports(String team, String providerId, String locationId, String baseEntityId, Long serverVersion, - String sortBy, String sortOrder, int limit); - - List findReports(String baseEntityId, DateTime from, DateTime to, String reportType, String providerId, - String locationId, DateTime lastEditFrom, DateTime lastEditTo); - - List findReportsByDynamicQuery(String query); + + Report findById(String id); + + List findByBaseEntityId(String baseEntityId); + + List findAllByIdentifier(String identifier); + + List findByBaseEntityAndType(String baseEntityId, String reportType); + + List findByEmptyServerVersion(); + + List findByServerVersion(long serverVersion); + + List findByBaseEntityAndFormSubmissionId(String baseEntityId, String formSubmissionId); + + List findReports(String team, String providerId, String locationId, String baseEntityId, Long serverVersion, + String sortBy, String sortOrder, int limit); + + List findReports(String baseEntityId, DateTime from, DateTime to, String reportType, String providerId, + String locationId, DateTime lastEditFrom, DateTime lastEditTo); + + List findReportsByDynamicQuery(String query); } diff --git a/src/main/java/org/opensrp/repository/SearchRepository.java b/src/main/java/org/opensrp/repository/SearchRepository.java index a8d11612b..aef08c894 100644 --- a/src/main/java/org/opensrp/repository/SearchRepository.java +++ b/src/main/java/org/opensrp/repository/SearchRepository.java @@ -6,7 +6,7 @@ import org.opensrp.search.ClientSearchBean; public interface SearchRepository { - - List findByCriteria(ClientSearchBean clientSearchBean, String firstName, String middleName, String lastName, - Integer limit); + + List findByCriteria(ClientSearchBean clientSearchBean, String firstName, String middleName, String lastName, + Integer limit); } diff --git a/src/main/java/org/opensrp/repository/SettingRepository.java b/src/main/java/org/opensrp/repository/SettingRepository.java index 7294a96a8..c752369c9 100644 --- a/src/main/java/org/opensrp/repository/SettingRepository.java +++ b/src/main/java/org/opensrp/repository/SettingRepository.java @@ -14,26 +14,26 @@ public interface SettingRepository extends BaseRepository { - List findAllSettings(); - - List findSettings(SettingSearchBean settingQueryBean, - Map> treeNodeHashMap ); - - List findByEmptyServerVersion(); - - SettingsMetadata getSettingMetadataByDocumentId(String documentId); + List findAllSettings(); - SettingConfiguration findSetting(SettingSearchBean settingQueryBean,Map> treeNodeHashMap ); + List findSettings(SettingSearchBean settingQueryBean, + Map> treeNodeHashMap); - List getAllSettingMetadataByDocumentId(String documentId); - - Settings getSettingById(Long id); + List findByEmptyServerVersion(); - String addOrUpdate(Setting entity); - - void delete(Long settingId); + SettingsMetadata getSettingMetadataByDocumentId(String documentId); - String addSettings(SettingConfiguration entity); + SettingConfiguration findSetting(SettingSearchBean settingQueryBean, Map> treeNodeHashMap); - List findSettingsAndSettingsMetadataByIdentifier(String identifier); + List getAllSettingMetadataByDocumentId(String documentId); + + Settings getSettingById(Long id); + + String addOrUpdate(Setting entity); + + void delete(Long settingId); + + String addSettings(SettingConfiguration entity); + + List findSettingsAndSettingsMetadataByIdentifier(String identifier); } diff --git a/src/main/java/org/opensrp/repository/StocksRepository.java b/src/main/java/org/opensrp/repository/StocksRepository.java index a648e9e47..53d15754d 100755 --- a/src/main/java/org/opensrp/repository/StocksRepository.java +++ b/src/main/java/org/opensrp/repository/StocksRepository.java @@ -8,29 +8,29 @@ import org.smartregister.pathevaluator.dao.StockDao; public interface StocksRepository extends BaseRepository, StockDao { - - List findAllByProviderid(String providerid); - - public List findAllByIdentifier(String vaccine_type, String vaccine_type_id); - - public Stock findById(String id); - - public List findStocks(StockSearchBean searchBean, String sortBy, String sortOrder, int offset, int limit); - - public List findStocks(StockSearchBean searchBean); - - public List findAllStocks(Long serverVersion, Integer limit); - public Stock findByIdentifierAndServicePointId(String identifier, String locationId); + List findAllByProviderid(String providerid); - Stock getById(Long id); + public List findAllByIdentifier(String vaccine_type, String vaccine_type_id); - void delete(Long stockId); + public Stock findById(String id); - public List findStocksByLocationId(StockSearchBean stockSearchBean); + public List findStocks(StockSearchBean searchBean, String sortBy, String sortOrder, int offset, int limit); - public List getInventoryWithProductDetails(List locations); + public List findStocks(StockSearchBean searchBean); - public List getInventoryWithProductDetailsByStockId(String stockId); + public List findAllStocks(Long serverVersion, Integer limit); + + public Stock findByIdentifierAndServicePointId(String identifier, String locationId); + + Stock getById(Long id); + + void delete(Long stockId); + + public List findStocksByLocationId(StockSearchBean stockSearchBean); + + public List getInventoryWithProductDetails(List locations); + + public List getInventoryWithProductDetailsByStockId(String stockId); } diff --git a/src/main/java/org/opensrp/repository/TaskRepository.java b/src/main/java/org/opensrp/repository/TaskRepository.java index 063586114..5af40ff5b 100644 --- a/src/main/java/org/opensrp/repository/TaskRepository.java +++ b/src/main/java/org/opensrp/repository/TaskRepository.java @@ -10,91 +10,98 @@ public interface TaskRepository extends BaseRepository, TaskDao { - /** - * Gets task for a plan and jurisdiction whose server version is >= that serverVersion - * @param plan the plan identifier - * @param group the jurisdiction identifier - * @param serverVersion the server version to filter with - * @return tasks matching the criteria - */ - List getTasksByPlanAndGroup(String plan, String group, long serverVersion); - - - /** - * Gets task for a plan and jurisdiction whose server version is >= that serverVersion - * @param plan the plan identifier - * @param group the jurisdiction identifier - * @param serverVersion the server version to filter with - * @param returnPk flag that controls if rowId will be returned - * @return tasks matching the criteria - */ - List getTasksByPlanAndGroup(String plan, String group, long serverVersion,boolean returnPk); - - List findByEmptyServerVersion(); - - /** - * This method fetches all task Ids - * - * @param serverVersion - * @param limit upper limit on number of tasks ids to fetch - * @return a list of task ids and last server version - */ - Pair, Long> findAllIds(Long serverVersion, int limit); - - /** - * overloads {@link #findAllIds(Long, int)} by adding date/time filters - * @param serverVersion - * @param limit - * @param fromDate - * @param toDate - * @return - */ - Pair, Long> findAllIds(Long serverVersion, int limit, Date fromDate, Date toDate); - - /** - * This method searches for tasks ordered by serverVersion ascending - * - * @param serverVersion - * @param limit upper limit on number of tasks to fetch - * @return list of plan identifiers - */ - List getAllTasks(Long serverVersion, int limit); - - /** - * Count all tasks - * @param serverVersion - * @return - */ - Long countAllTasks(Long serverVersion); - - /** - * This method is used to return a list of tasks based on the provided parameters - * @param plan plan identifier for the task - * @param owner the username of the person who initiated the task - * @return returns a list of tasks matching the passed parameters - */ - List getTasksByPlanAndOwner(String plan, String owner, long serverVersion); - - /** - * This method returns a count of tasks belonging to a particular owner - * @param plan plan identifier for the task - * @param group the team who initiated the task - * @param serverVersion Version of the server - * @return count of tasks created by the provider username (owner) - */ - Long countTasksByPlanAndGroup(String plan, String group, long serverVersion); - - /** - * This method returns a count of tasks belonging to a particular owner - * @param plan plan identifier for the task - * @param owner the username of the person who initiated the task - * @param serverVersion Version of the server - * @return count of tasks created by the provider username (owner) - */ - Long countTasksByPlanAndOwner(String plan, String owner, long serverVersion); - - List getTasksBySearchBean(TaskSearchBean taskSearchBean); - - int getTaskCount(TaskSearchBean searchBean); + /** + * Gets task for a plan and jurisdiction whose server version is >= that serverVersion + * + * @param plan the plan identifier + * @param group the jurisdiction identifier + * @param serverVersion the server version to filter with + * @return tasks matching the criteria + */ + List getTasksByPlanAndGroup(String plan, String group, long serverVersion); + + + /** + * Gets task for a plan and jurisdiction whose server version is >= that serverVersion + * + * @param plan the plan identifier + * @param group the jurisdiction identifier + * @param serverVersion the server version to filter with + * @param returnPk flag that controls if rowId will be returned + * @return tasks matching the criteria + */ + List getTasksByPlanAndGroup(String plan, String group, long serverVersion, boolean returnPk); + + List findByEmptyServerVersion(); + + /** + * This method fetches all task Ids + * + * @param serverVersion + * @param limit upper limit on number of tasks ids to fetch + * @return a list of task ids and last server version + */ + Pair, Long> findAllIds(Long serverVersion, int limit); + + /** + * overloads {@link #findAllIds(Long, int)} by adding date/time filters + * + * @param serverVersion + * @param limit + * @param fromDate + * @param toDate + * @return + */ + Pair, Long> findAllIds(Long serverVersion, int limit, Date fromDate, Date toDate); + + /** + * This method searches for tasks ordered by serverVersion ascending + * + * @param serverVersion + * @param limit upper limit on number of tasks to fetch + * @return list of plan identifiers + */ + List getAllTasks(Long serverVersion, int limit); + + /** + * Count all tasks + * + * @param serverVersion + * @return + */ + Long countAllTasks(Long serverVersion); + + /** + * This method is used to return a list of tasks based on the provided parameters + * + * @param plan plan identifier for the task + * @param owner the username of the person who initiated the task + * @return returns a list of tasks matching the passed parameters + */ + List getTasksByPlanAndOwner(String plan, String owner, long serverVersion); + + /** + * This method returns a count of tasks belonging to a particular owner + * + * @param plan plan identifier for the task + * @param group the team who initiated the task + * @param serverVersion Version of the server + * @return count of tasks created by the provider username (owner) + */ + Long countTasksByPlanAndGroup(String plan, String group, long serverVersion); + + /** + * This method returns a count of tasks belonging to a particular owner + * + * @param plan plan identifier for the task + * @param owner the username of the person who initiated the task + * @param serverVersion Version of the server + * @return count of tasks created by the provider username (owner) + */ + Long countTasksByPlanAndOwner(String plan, String owner, long serverVersion); + + List getTasksBySearchBean(TaskSearchBean taskSearchBean); + + int getTaskCount(TaskSearchBean searchBean); } diff --git a/src/main/java/org/opensrp/repository/UniqueIdRepository.java b/src/main/java/org/opensrp/repository/UniqueIdRepository.java index f55bd2668..8d350ceae 100644 --- a/src/main/java/org/opensrp/repository/UniqueIdRepository.java +++ b/src/main/java/org/opensrp/repository/UniqueIdRepository.java @@ -20,9 +20,8 @@ public interface UniqueIdRepository extends BaseRepository { boolean checkIfClientExists(String usedBy, String location); UniqueId findByIdentifierSourceOrderByIdDesc(Long identifierSource); - + Set findReservedIdentifiers(); - - + } diff --git a/src/main/java/org/opensrp/repository/ViewConfigurationRepository.java b/src/main/java/org/opensrp/repository/ViewConfigurationRepository.java index 7dcd9e2f7..7e8f30b37 100644 --- a/src/main/java/org/opensrp/repository/ViewConfigurationRepository.java +++ b/src/main/java/org/opensrp/repository/ViewConfigurationRepository.java @@ -5,10 +5,10 @@ import org.opensrp.domain.viewconfiguration.ViewConfiguration; public interface ViewConfigurationRepository extends BaseRepository { - - List findAllViewConfigurations(); - - List findViewConfigurationsByVersion(Long lastSyncedServerVersion); - - List findByEmptyServerVersion(); + + List findAllViewConfigurations(); + + List findViewConfigurationsByVersion(Long lastSyncedServerVersion); + + List findByEmptyServerVersion(); } diff --git a/src/main/java/org/opensrp/repository/postgres/ActionRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/ActionRepositoryImpl.java index da660c840..7095f474b 100644 --- a/src/main/java/org/opensrp/repository/postgres/ActionRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/ActionRepositoryImpl.java @@ -20,320 +20,322 @@ @Repository("actionsRepositoryPostgres") public class ActionRepositoryImpl extends BaseRepositoryImpl implements ActionsRepository { - - @Autowired - private CustomActionMapper actionMapper; - - @Autowired - private CustomActionMetadataMapper actionMetadataMapper; - - @Override - public Action get(String id) { - if (StringUtils.isBlank(id)) { - return null; - } - org.opensrp.domain.postgres.Action pgAction = actionMetadataMapper.selectByDocumentId(id); - - return convert(pgAction); - } - - @Override - public void add(Action entity) { - if (entity == null || entity.baseEntityId() == null) { - return; - } - - if (retrievePrimaryKey(entity) != null) { //Event already added - return; - } - - if (entity.getId() == null || entity.getId().isEmpty()) - entity.setId(UUID.randomUUID().toString()); - - setRevision(entity); - - org.opensrp.domain.postgres.Action pgAction = convert(entity, null); - if (pgAction == null) { - return; - } - - int rowsAffected = actionMapper.insertSelectiveAndSetId(pgAction); - if (rowsAffected < 1 || pgAction.getId() == null) { - return; - } - - ActionMetadata actionMetadata = createMetadata(entity, pgAction.getId()); - if (actionMetadata != null) { - actionMetadataMapper.insertSelective(actionMetadata); - } - - } - - @Override - public void update(Action entity) { - if (entity == null || entity.baseEntityId() == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { // Action not added - return; - } - - setRevision(entity); - org.opensrp.domain.postgres.Action pgAction = convert(entity, id); - if (pgAction == null) { - return; - } - - ActionMetadata actionMetadata = createMetadata(entity, id); - if (actionMetadata == null) { - return; - } - - int rowsAffected = actionMapper.updateByPrimaryKey(pgAction); - if (rowsAffected < 1) { - return; - } - - ActionMetadataExample actionMetadataExample = new ActionMetadataExample(); - actionMetadataExample.createCriteria().andActionIdEqualTo(id); - actionMetadata.setId(actionMetadataMapper.selectByExample(actionMetadataExample).get(0).getId()); - actionMetadataMapper.updateByPrimaryKey(actionMetadata); - - } - - @Override - public List getAll() { - List actions = actionMetadataMapper.selectMany(new ActionMetadataExample(), 0, - DEFAULT_FETCH_SIZE); - return convert(actions); - } - - @Override - public void safeRemove(Action entity) { - if (entity == null || entity.baseEntityId() == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { - return; - } - - ActionMetadataExample actionMetadataExample = new ActionMetadataExample(); - actionMetadataExample.createCriteria().andActionIdEqualTo(id); - int rowsAffected = actionMetadataMapper.deleteByExample(actionMetadataExample); - if (rowsAffected < 1) { - return; - } - - actionMapper.deleteByPrimaryKey(id); - - } - - @Override - public List findByProviderIdAndTimeStamp(String providerId, long timeStamp) { - ActionMetadataExample example = new ActionMetadataExample(); - example.createCriteria().andProviderIdEqualTo(providerId).andServerVersionGreaterThanOrEqualTo(timeStamp + 1); - return convert(actionMetadataMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findAlertByANMIdEntityIdScheduleName(String providerId, String baseEntityId, String scheduleName) { - ActionMetadataExample example = new ActionMetadataExample(); - example.createCriteria().andProviderIdEqualTo(providerId).andBaseEntityIdEqualTo(baseEntityId); - return convert(actionMetadataMapper.selectManyBySchedule(example, scheduleName, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findByCaseIdScheduleAndTimeStamp(String baseEntityId, String schedule, DateTime start, - DateTime end) { - if (start == null || end == null) - throw new IllegalArgumentException("start and/or end date is null"); - ActionMetadataExample example = new ActionMetadataExample(); - example.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andServerVersionBetween(start.getMillis(), - end.getMillis() + 1); - return convert(actionMetadataMapper.selectManyBySchedule(example, schedule, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findByCaseIdAndTimeStamp(String baseEntityId, long timeStamp) { - ActionMetadataExample example = new ActionMetadataExample(); - example.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andServerVersionGreaterThanOrEqualTo(timeStamp); - return convert(actionMetadataMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public void deleteAllByTarget(String target) { - List idsToDelete = actionMapper.selectIdsByTarget(target); - if(idsToDelete.isEmpty()) - return; - ActionMetadataExample metadataExample = new ActionMetadataExample(); - metadataExample.createCriteria().andActionIdIn(idsToDelete); - actionMetadataMapper.deleteByExample(metadataExample); - ActionExample example = new ActionExample(); - example.createCriteria().andIdIn(idsToDelete); - actionMapper.deleteByExample(example); - - } - - @Override - public void markAllAsInActiveFor(String baseEntityId) { - ActionMetadataExample metadataExample = new ActionMetadataExample(); - metadataExample.createCriteria().andBaseEntityIdEqualTo(baseEntityId); - List actions = convert(actionMetadataMapper.selectMany(metadataExample, 0, DEFAULT_FETCH_SIZE)); - for (Action action : actions) { - action.markAsInActive(); - update(action); - } - } - - @Override - public void addOrUpdateAlert(Action alertAction) { - if (alertAction == null || alertAction.baseEntityId() == null) { - return; - } - - Long id = retrievePrimaryKey(alertAction); - if (id == null) { - add(alertAction); - } else - update(alertAction); - - } - - @Override - public void markAlertAsInactiveFor(String providerId, String baseEntityId, String scheduleName) { - ActionMetadataExample metadataExample = new ActionMetadataExample(); - metadataExample.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andProviderIdEqualTo(providerId); - Long actionsSize = actionMetadataMapper.countByExample(metadataExample); - List actions = convert(actionMetadataMapper.selectManyBySchedule(metadataExample, scheduleName, 0,actionsSize.intValue())); - for (Action action : actions) { - action.markAsInActive(); - update(action); - } - - } - - @Override - public List findByCriteria(String team, String providerId, long timeStamp, String sortBy, String sortOrder, - int limit) { - ActionMetadataExample metadataExample = new ActionMetadataExample(); - Criteria criteria = metadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(timeStamp); - - if (team != null && !team.isEmpty()) { - String[] idsArray = org.apache.commons.lang.StringUtils.split(team, ","); - List ids = new ArrayList(Arrays.asList(idsArray)); - //include providerId records also - if (providerId != null && !ids.contains(providerId)) { - ids.add(providerId); - } - criteria.andProviderIdIn(ids); - } else if (StringUtils.isNotEmpty(providerId)) { - criteria.andProviderIdEqualTo(providerId); - } - metadataExample.setOrderByClause(getOrderByClause(sortBy, sortOrder)); - - if (!criteria.isValid()) { - throw new IllegalArgumentException("Atleast one search filter must be specified"); - } else - return convert(actionMetadataMapper.selectMany(metadataExample, 0, limit)); - } - - @Override - public List findAllActionNotExpired() { - return convert(actionMapper.selectNotExpired(0, DEFAULT_FETCH_SIZE)); - } - - //private methods - private Action convert(org.opensrp.domain.postgres.Action action) { - if (action == null || action.getJson() == null || !(action.getJson() instanceof Action)) { - return null; - } - return (Action) action.getJson(); - } - - private org.opensrp.domain.postgres.Action convert(Action entity, Long primaryKey) { - if (entity == null) { - return null; - } - - org.opensrp.domain.postgres.Action pgAction = new org.opensrp.domain.postgres.Action(); - pgAction.setId(primaryKey); - pgAction.setJson(entity); - - return pgAction; - } - - private List convert(List actions) { - if (actions == null || actions.isEmpty()) { - return new ArrayList<>(); - } - - List convertedActions = new ArrayList<>(); - for (org.opensrp.domain.postgres.Action action : actions) { - Action convertedAction = convert(action); - if (convertedAction != null) { - convertedActions.add(convertedAction); - } - } - - return convertedActions; - } - - protected Long retrievePrimaryKey(Action entity) { - if (entity == null || entity.getId() == null) { - return null; - } - String documentId = entity.getId(); - - ActionMetadataExample actionMetadataExample = new ActionMetadataExample(); - actionMetadataExample.createCriteria().andDocumentIdEqualTo(documentId); - - org.opensrp.domain.postgres.Action pgAction = actionMetadataMapper.selectByDocumentId(documentId); - if (pgAction == null) { - return null; - } - return pgAction.getId(); - } - - private ActionMetadata createMetadata(Action entity, Long primaryKey) { - ActionMetadata actionMetadata = new ActionMetadata(); - actionMetadata.setActionId(primaryKey); - actionMetadata.setDocumentId(entity.getId()); - actionMetadata.setBaseEntityId(entity.baseEntityId()); - actionMetadata.setServerVersion(entity.getTimeStamp()); - actionMetadata.setProviderId(entity.providerId()); - - //TODO implement review if in future to support Location, Team and TeamId - return actionMetadata; - } - - @Override - protected Object getUniqueField(Action t) { - if (t == null) { - return null; - } - return t.getId(); - } - - /** - * Method should be used only during Unit testing - * Deletes all existing records - */ - protected void removeAll() { - actionMetadataMapper.deleteByExample(new ActionMetadataExample()); - actionMapper.deleteByExample(new ActionExample()); - - } - - /**Checks is an action exist matching the id - * @param id to search for - * @return true action existing matching the id, otherwise false - */ - public boolean contains(String id) { - return get(id) != null; - } - + + @Autowired + private CustomActionMapper actionMapper; + + @Autowired + private CustomActionMetadataMapper actionMetadataMapper; + + @Override + public Action get(String id) { + if (StringUtils.isBlank(id)) { + return null; + } + org.opensrp.domain.postgres.Action pgAction = actionMetadataMapper.selectByDocumentId(id); + + return convert(pgAction); + } + + @Override + public void add(Action entity) { + if (entity == null || entity.baseEntityId() == null) { + return; + } + + if (retrievePrimaryKey(entity) != null) { //Event already added + return; + } + + if (entity.getId() == null || entity.getId().isEmpty()) + entity.setId(UUID.randomUUID().toString()); + + setRevision(entity); + + org.opensrp.domain.postgres.Action pgAction = convert(entity, null); + if (pgAction == null) { + return; + } + + int rowsAffected = actionMapper.insertSelectiveAndSetId(pgAction); + if (rowsAffected < 1 || pgAction.getId() == null) { + return; + } + + ActionMetadata actionMetadata = createMetadata(entity, pgAction.getId()); + if (actionMetadata != null) { + actionMetadataMapper.insertSelective(actionMetadata); + } + + } + + @Override + public void update(Action entity) { + if (entity == null || entity.baseEntityId() == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { // Action not added + return; + } + + setRevision(entity); + org.opensrp.domain.postgres.Action pgAction = convert(entity, id); + if (pgAction == null) { + return; + } + + ActionMetadata actionMetadata = createMetadata(entity, id); + if (actionMetadata == null) { + return; + } + + int rowsAffected = actionMapper.updateByPrimaryKey(pgAction); + if (rowsAffected < 1) { + return; + } + + ActionMetadataExample actionMetadataExample = new ActionMetadataExample(); + actionMetadataExample.createCriteria().andActionIdEqualTo(id); + actionMetadata.setId(actionMetadataMapper.selectByExample(actionMetadataExample).get(0).getId()); + actionMetadataMapper.updateByPrimaryKey(actionMetadata); + + } + + @Override + public List getAll() { + List actions = actionMetadataMapper.selectMany(new ActionMetadataExample(), 0, + DEFAULT_FETCH_SIZE); + return convert(actions); + } + + @Override + public void safeRemove(Action entity) { + if (entity == null || entity.baseEntityId() == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { + return; + } + + ActionMetadataExample actionMetadataExample = new ActionMetadataExample(); + actionMetadataExample.createCriteria().andActionIdEqualTo(id); + int rowsAffected = actionMetadataMapper.deleteByExample(actionMetadataExample); + if (rowsAffected < 1) { + return; + } + + actionMapper.deleteByPrimaryKey(id); + + } + + @Override + public List findByProviderIdAndTimeStamp(String providerId, long timeStamp) { + ActionMetadataExample example = new ActionMetadataExample(); + example.createCriteria().andProviderIdEqualTo(providerId).andServerVersionGreaterThanOrEqualTo(timeStamp + 1); + return convert(actionMetadataMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findAlertByANMIdEntityIdScheduleName(String providerId, String baseEntityId, String scheduleName) { + ActionMetadataExample example = new ActionMetadataExample(); + example.createCriteria().andProviderIdEqualTo(providerId).andBaseEntityIdEqualTo(baseEntityId); + return convert(actionMetadataMapper.selectManyBySchedule(example, scheduleName, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findByCaseIdScheduleAndTimeStamp(String baseEntityId, String schedule, DateTime start, + DateTime end) { + if (start == null || end == null) + throw new IllegalArgumentException("start and/or end date is null"); + ActionMetadataExample example = new ActionMetadataExample(); + example.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andServerVersionBetween(start.getMillis(), + end.getMillis() + 1); + return convert(actionMetadataMapper.selectManyBySchedule(example, schedule, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findByCaseIdAndTimeStamp(String baseEntityId, long timeStamp) { + ActionMetadataExample example = new ActionMetadataExample(); + example.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andServerVersionGreaterThanOrEqualTo(timeStamp); + return convert(actionMetadataMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public void deleteAllByTarget(String target) { + List idsToDelete = actionMapper.selectIdsByTarget(target); + if (idsToDelete.isEmpty()) + return; + ActionMetadataExample metadataExample = new ActionMetadataExample(); + metadataExample.createCriteria().andActionIdIn(idsToDelete); + actionMetadataMapper.deleteByExample(metadataExample); + ActionExample example = new ActionExample(); + example.createCriteria().andIdIn(idsToDelete); + actionMapper.deleteByExample(example); + + } + + @Override + public void markAllAsInActiveFor(String baseEntityId) { + ActionMetadataExample metadataExample = new ActionMetadataExample(); + metadataExample.createCriteria().andBaseEntityIdEqualTo(baseEntityId); + List actions = convert(actionMetadataMapper.selectMany(metadataExample, 0, DEFAULT_FETCH_SIZE)); + for (Action action : actions) { + action.markAsInActive(); + update(action); + } + } + + @Override + public void addOrUpdateAlert(Action alertAction) { + if (alertAction == null || alertAction.baseEntityId() == null) { + return; + } + + Long id = retrievePrimaryKey(alertAction); + if (id == null) { + add(alertAction); + } else + update(alertAction); + + } + + @Override + public void markAlertAsInactiveFor(String providerId, String baseEntityId, String scheduleName) { + ActionMetadataExample metadataExample = new ActionMetadataExample(); + metadataExample.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andProviderIdEqualTo(providerId); + Long actionsSize = actionMetadataMapper.countByExample(metadataExample); + List actions = convert(actionMetadataMapper.selectManyBySchedule(metadataExample, scheduleName, 0, actionsSize.intValue())); + for (Action action : actions) { + action.markAsInActive(); + update(action); + } + + } + + @Override + public List findByCriteria(String team, String providerId, long timeStamp, String sortBy, String sortOrder, + int limit) { + ActionMetadataExample metadataExample = new ActionMetadataExample(); + Criteria criteria = metadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(timeStamp); + + if (team != null && !team.isEmpty()) { + String[] idsArray = org.apache.commons.lang.StringUtils.split(team, ","); + List ids = new ArrayList(Arrays.asList(idsArray)); + //include providerId records also + if (providerId != null && !ids.contains(providerId)) { + ids.add(providerId); + } + criteria.andProviderIdIn(ids); + } else if (StringUtils.isNotEmpty(providerId)) { + criteria.andProviderIdEqualTo(providerId); + } + metadataExample.setOrderByClause(getOrderByClause(sortBy, sortOrder)); + + if (!criteria.isValid()) { + throw new IllegalArgumentException("Atleast one search filter must be specified"); + } else + return convert(actionMetadataMapper.selectMany(metadataExample, 0, limit)); + } + + @Override + public List findAllActionNotExpired() { + return convert(actionMapper.selectNotExpired(0, DEFAULT_FETCH_SIZE)); + } + + //private methods + private Action convert(org.opensrp.domain.postgres.Action action) { + if (action == null || action.getJson() == null || !(action.getJson() instanceof Action)) { + return null; + } + return (Action) action.getJson(); + } + + private org.opensrp.domain.postgres.Action convert(Action entity, Long primaryKey) { + if (entity == null) { + return null; + } + + org.opensrp.domain.postgres.Action pgAction = new org.opensrp.domain.postgres.Action(); + pgAction.setId(primaryKey); + pgAction.setJson(entity); + + return pgAction; + } + + private List convert(List actions) { + if (actions == null || actions.isEmpty()) { + return new ArrayList<>(); + } + + List convertedActions = new ArrayList<>(); + for (org.opensrp.domain.postgres.Action action : actions) { + Action convertedAction = convert(action); + if (convertedAction != null) { + convertedActions.add(convertedAction); + } + } + + return convertedActions; + } + + protected Long retrievePrimaryKey(Action entity) { + if (entity == null || entity.getId() == null) { + return null; + } + String documentId = entity.getId(); + + ActionMetadataExample actionMetadataExample = new ActionMetadataExample(); + actionMetadataExample.createCriteria().andDocumentIdEqualTo(documentId); + + org.opensrp.domain.postgres.Action pgAction = actionMetadataMapper.selectByDocumentId(documentId); + if (pgAction == null) { + return null; + } + return pgAction.getId(); + } + + private ActionMetadata createMetadata(Action entity, Long primaryKey) { + ActionMetadata actionMetadata = new ActionMetadata(); + actionMetadata.setActionId(primaryKey); + actionMetadata.setDocumentId(entity.getId()); + actionMetadata.setBaseEntityId(entity.baseEntityId()); + actionMetadata.setServerVersion(entity.getTimeStamp()); + actionMetadata.setProviderId(entity.providerId()); + + //TODO implement review if in future to support Location, Team and TeamId + return actionMetadata; + } + + @Override + protected Object getUniqueField(Action t) { + if (t == null) { + return null; + } + return t.getId(); + } + + /** + * Method should be used only during Unit testing + * Deletes all existing records + */ + protected void removeAll() { + actionMetadataMapper.deleteByExample(new ActionMetadataExample()); + actionMapper.deleteByExample(new ActionExample()); + + } + + /** + * Checks is an action exist matching the id + * + * @param id to search for + * @return true action existing matching the id, otherwise false + */ + public boolean contains(String id) { + return get(id) != null; + } + } diff --git a/src/main/java/org/opensrp/repository/postgres/AlertsRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/AlertsRepositoryImpl.java index c09345e87..f96d55074 100644 --- a/src/main/java/org/opensrp/repository/postgres/AlertsRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/AlertsRepositoryImpl.java @@ -21,319 +21,319 @@ @Repository("alertsRepositoryPostgres") public class AlertsRepositoryImpl extends BaseRepositoryImpl implements AlertsRepository { - - @Autowired - private CustomAlertMapper alertMapper; - - @Autowired - private CustomAlertMetadataMapper alertMetadataMapper; - - @Override - public Alert get(String id) { - if (StringUtils.isBlank(id)) { - return null; - } - org.opensrp.domain.postgres.Alert pgAlert = alertMetadataMapper.selectByDocumentId(id); - - return convert(pgAlert); - } - - @Override - public void add(Alert entity) { - - if (entity == null || entity.entityId() == null) { - return; - } - - if (retrievePrimaryKey(entity) != null) { //Event already added - return; - } - - if (entity.getId() == null || entity.getId().isEmpty()) - entity.setId(UUID.randomUUID().toString()); - - setRevision(entity); - org.opensrp.domain.postgres.Alert pgAlert = convert(entity, null); - if (pgAlert == null) { - return; - } - - int rowsAffected = alertMapper.insertSelectiveAndSetId(pgAlert); - if (rowsAffected < 1 || pgAlert.getId() == null) { - return; - } - - AlertMetadata eventMetadata = createMetadata(entity, pgAlert.getId()); - if (eventMetadata != null) { - alertMetadataMapper.insertSelective(eventMetadata); - } - - } - - @Override - public void update(Alert entity) { - if (entity == null || entity.entityId() == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { // Alert not added - return; - } - - setRevision(entity); - org.opensrp.domain.postgres.Alert pgAlert = convert(entity, id); - if (pgAlert == null) { - return; - } - - AlertMetadata alertMetadata = createMetadata(entity, id); - if (alertMetadata == null) { - return; - } - - int rowsAffected = alertMapper.updateByPrimaryKey(pgAlert); - if (rowsAffected < 1) { - return; - } - - AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); - alertMetadataExample.createCriteria().andAlertIdEqualTo(id); - alertMetadata.setId(alertMetadataMapper.selectByExample(alertMetadataExample).get(0).getId()); - alertMetadataMapper.updateByPrimaryKey(alertMetadata); - - } - - @Override - public List getAll() { - List actions = alertMetadataMapper.selectMany(new AlertMetadataExample(), 0, - DEFAULT_FETCH_SIZE); - return convert(actions); - } - - @Override - public void safeRemove(Alert entity) { - if (entity == null || entity.entityId() == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { - return; - } - - AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); - alertMetadataExample.createCriteria().andAlertIdEqualTo(id); - int rowsAffected = alertMetadataMapper.deleteByExample(alertMetadataExample); - if (rowsAffected < 1) { - return; - } - - alertMapper.deleteByPrimaryKey(id); - - } - - @Override - public List findByProviderAndTimestamp(String provider, long timeStamp) { - AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); - alertMetadataExample.createCriteria().andProviderIdEqualTo(provider) - .andServerVersionGreaterThanOrEqualTo(timeStamp + 1); - return convert(alertMetadataMapper.selectMany(alertMetadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findActiveByProviderAndTimestamp(String provider, long timeStamp) { - AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); - alertMetadataExample.createCriteria().andProviderIdEqualTo(provider) - .andServerVersionGreaterThanOrEqualTo(timeStamp + 1).andIsActiveEqualTo(true); - return convert(alertMetadataMapper.selectMany(alertMetadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findAlertByProviderEntityIdTriggerName(String provider, String entityId, String triggerName) { - AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); - alertMetadataExample.createCriteria().andProviderIdEqualTo(provider).andBaseEntityIdEqualTo(entityId) - .andTriggerNameEqualTo(triggerName); - return convert(alertMetadataMapper.selectMany(alertMetadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findActiveAlertByProviderEntityIdTriggerName(String provider, String entityId, String triggerName) { - AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); - alertMetadataExample.createCriteria().andProviderIdEqualTo(provider).andBaseEntityIdEqualTo(entityId) - .andTriggerNameEqualTo(triggerName).andIsActiveEqualTo(true); - return convert(alertMetadataMapper.selectMany(alertMetadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findActiveAlertByEntityIdTriggerName(String entityId, String triggerName) { - AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); - alertMetadataExample.createCriteria().andBaseEntityIdEqualTo(entityId).andTriggerNameEqualTo(triggerName) - .andIsActiveEqualTo(true); - return convert(alertMetadataMapper.selectMany(alertMetadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findActiveAlertByEntityId(String entityId) { - AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); - alertMetadataExample.createCriteria().andBaseEntityIdEqualTo(entityId).andIsActiveEqualTo(true); - return convert(alertMetadataMapper.selectMany(alertMetadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findByEntityIdTriggerAndTimeStamp(String entityId, String trigger, DateTime start, DateTime end) { - AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); - alertMetadataExample.createCriteria().andBaseEntityIdEqualTo(entityId).andTriggerNameEqualTo(trigger) - .andServerVersionBetween(start.getMillis() + 1, end.getMillis()); - return convert(alertMetadataMapper.selectMany(alertMetadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public void markAllAsClosedFor(String entityId, String reasonForClose) { - List alerts = findActiveAlertByEntityId(entityId); - for (Alert alert : alerts) { - alert.markAlertAsClosed(reasonForClose); - update(alert); - } - } - - @Override - public void markAlertAsClosedFor(String providerId, String entityId, String triggerName, String reasonForClose) { - List alerts = findActiveAlertByProviderEntityIdTriggerName(providerId, entityId, triggerName); - for (Alert alert : alerts) { - alert.markAlertAsClosed(reasonForClose); - update(alert); - } - } - - @Override - public void markAlertAsCompleteFor(String providerId, String entityId, String triggerName, String completionDate) { - List alerts = findActiveAlertByProviderEntityIdTriggerName(providerId, entityId, triggerName); - for (Alert alert : alerts) { - alert.markAlertAsComplete(completionDate); - update(alert); - } - - } - - @Override - public void markAlertAsCompleteFor(String entityId, String triggerName, String completionDate) { - List alerts = findActiveAlertByEntityIdTriggerName(entityId, triggerName); - for (Alert alert : alerts) { - alert.markAlertAsComplete(completionDate); - update(alert); - } - } - - @Override - public void addOrUpdateScheduleNotificationAlert(String beneficiaryType, String entityId, String providerId, - String triggerName, String triggerCode, AlertStatus alertStatus, DateTime startDate, DateTime expiryDate) { - List existingAlerts = findActiveAlertByProviderEntityIdTriggerName(providerId, entityId, triggerName); - if (existingAlerts.isEmpty()) { - add(new Alert(providerId, entityId, beneficiaryType, AlertType.notification, TriggerType.schedule, triggerName, - triggerCode, startDate, expiryDate, alertStatus, null)); - } else { - Alert al = existingAlerts.get(0); - // if visit code is same then update otherwise add another record - if (StringUtils.isNotBlank(al.triggerCode()) && StringUtils.isNotBlank(triggerCode) - && al.triggerCode().equalsIgnoreCase(triggerCode)) { - al.setAlertStatus(alertStatus.name()); - al.setStartDate(startDate.toString()); - al.setExpiryDate(expiryDate.toString()); - al.details().put(alertStatus.name() + ":start", startDate.toString()); - al.details().put(alertStatus.name() + ":end", expiryDate.toString()); - - update(al); - } else { - add(new Alert(providerId, entityId, beneficiaryType, AlertType.notification, TriggerType.schedule, - triggerName, triggerCode, startDate, expiryDate, alertStatus, null)); - } - } - - } - - @Override - protected Long retrievePrimaryKey(Alert alert) { - if (alert == null || alert.getId() == null) { - return null; - } - String documentId = alert.getId(); - - AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); - alertMetadataExample.createCriteria().andDocumentIdEqualTo(documentId); - - org.opensrp.domain.postgres.Alert pgAlert = alertMetadataMapper.selectByDocumentId(documentId); - if (pgAlert == null) { - return null; - } - return pgAlert.getId(); - } - - @Override - protected Object getUniqueField(Alert alert) { - if (alert == null) { - return null; - } - return alert.getId(); - } - - //private methods - private Alert convert(org.opensrp.domain.postgres.Alert pgAlert) { - if (pgAlert == null || pgAlert.getJson() == null || !(pgAlert.getJson() instanceof Alert)) { - return null; - } - return (Alert) pgAlert.getJson(); - } - - private org.opensrp.domain.postgres.Alert convert(Alert entity, Long primaryKey) { - if (entity == null) { - return null; - } - - org.opensrp.domain.postgres.Alert pgAlert = new org.opensrp.domain.postgres.Alert(); - pgAlert.setId(primaryKey); - pgAlert.setJson(entity); - - return pgAlert; - } - - private List convert(List alerts) { - if (alerts == null || alerts.isEmpty()) { - return new ArrayList<>(); - } - - List convertedAlerts = new ArrayList<>(); - for (org.opensrp.domain.postgres.Alert alert : alerts) { - Alert convertedAlert = convert(alert); - if (convertedAlert != null) { - convertedAlerts.add(convertedAlert); - } - } - - return convertedAlerts; - } - - private AlertMetadata createMetadata(Alert entity, Long id) { - AlertMetadata metadata = new AlertMetadata(); - metadata.setAlertId(id); - metadata.setDocumentId(entity.getId()); - metadata.setBaseEntityId(entity.entityId()); - metadata.setProviderId(entity.providerId()); - metadata.setServerVersion(entity.timestamp()); - metadata.setIsActive(entity.getIsActive()); - metadata.setTriggerName(entity.triggerName()); - return metadata; - } - - - /** - * Method should be used only during Unit testing - * Deletes all existing records - */ - protected void removeAll() { - alertMetadataMapper.deleteByExample(new AlertMetadataExample()); - alertMapper.deleteByExample(new AlertExample()); - - } - + + @Autowired + private CustomAlertMapper alertMapper; + + @Autowired + private CustomAlertMetadataMapper alertMetadataMapper; + + @Override + public Alert get(String id) { + if (StringUtils.isBlank(id)) { + return null; + } + org.opensrp.domain.postgres.Alert pgAlert = alertMetadataMapper.selectByDocumentId(id); + + return convert(pgAlert); + } + + @Override + public void add(Alert entity) { + + if (entity == null || entity.entityId() == null) { + return; + } + + if (retrievePrimaryKey(entity) != null) { //Event already added + return; + } + + if (entity.getId() == null || entity.getId().isEmpty()) + entity.setId(UUID.randomUUID().toString()); + + setRevision(entity); + org.opensrp.domain.postgres.Alert pgAlert = convert(entity, null); + if (pgAlert == null) { + return; + } + + int rowsAffected = alertMapper.insertSelectiveAndSetId(pgAlert); + if (rowsAffected < 1 || pgAlert.getId() == null) { + return; + } + + AlertMetadata eventMetadata = createMetadata(entity, pgAlert.getId()); + if (eventMetadata != null) { + alertMetadataMapper.insertSelective(eventMetadata); + } + + } + + @Override + public void update(Alert entity) { + if (entity == null || entity.entityId() == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { // Alert not added + return; + } + + setRevision(entity); + org.opensrp.domain.postgres.Alert pgAlert = convert(entity, id); + if (pgAlert == null) { + return; + } + + AlertMetadata alertMetadata = createMetadata(entity, id); + if (alertMetadata == null) { + return; + } + + int rowsAffected = alertMapper.updateByPrimaryKey(pgAlert); + if (rowsAffected < 1) { + return; + } + + AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); + alertMetadataExample.createCriteria().andAlertIdEqualTo(id); + alertMetadata.setId(alertMetadataMapper.selectByExample(alertMetadataExample).get(0).getId()); + alertMetadataMapper.updateByPrimaryKey(alertMetadata); + + } + + @Override + public List getAll() { + List actions = alertMetadataMapper.selectMany(new AlertMetadataExample(), 0, + DEFAULT_FETCH_SIZE); + return convert(actions); + } + + @Override + public void safeRemove(Alert entity) { + if (entity == null || entity.entityId() == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { + return; + } + + AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); + alertMetadataExample.createCriteria().andAlertIdEqualTo(id); + int rowsAffected = alertMetadataMapper.deleteByExample(alertMetadataExample); + if (rowsAffected < 1) { + return; + } + + alertMapper.deleteByPrimaryKey(id); + + } + + @Override + public List findByProviderAndTimestamp(String provider, long timeStamp) { + AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); + alertMetadataExample.createCriteria().andProviderIdEqualTo(provider) + .andServerVersionGreaterThanOrEqualTo(timeStamp + 1); + return convert(alertMetadataMapper.selectMany(alertMetadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findActiveByProviderAndTimestamp(String provider, long timeStamp) { + AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); + alertMetadataExample.createCriteria().andProviderIdEqualTo(provider) + .andServerVersionGreaterThanOrEqualTo(timeStamp + 1).andIsActiveEqualTo(true); + return convert(alertMetadataMapper.selectMany(alertMetadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findAlertByProviderEntityIdTriggerName(String provider, String entityId, String triggerName) { + AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); + alertMetadataExample.createCriteria().andProviderIdEqualTo(provider).andBaseEntityIdEqualTo(entityId) + .andTriggerNameEqualTo(triggerName); + return convert(alertMetadataMapper.selectMany(alertMetadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findActiveAlertByProviderEntityIdTriggerName(String provider, String entityId, String triggerName) { + AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); + alertMetadataExample.createCriteria().andProviderIdEqualTo(provider).andBaseEntityIdEqualTo(entityId) + .andTriggerNameEqualTo(triggerName).andIsActiveEqualTo(true); + return convert(alertMetadataMapper.selectMany(alertMetadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findActiveAlertByEntityIdTriggerName(String entityId, String triggerName) { + AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); + alertMetadataExample.createCriteria().andBaseEntityIdEqualTo(entityId).andTriggerNameEqualTo(triggerName) + .andIsActiveEqualTo(true); + return convert(alertMetadataMapper.selectMany(alertMetadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findActiveAlertByEntityId(String entityId) { + AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); + alertMetadataExample.createCriteria().andBaseEntityIdEqualTo(entityId).andIsActiveEqualTo(true); + return convert(alertMetadataMapper.selectMany(alertMetadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findByEntityIdTriggerAndTimeStamp(String entityId, String trigger, DateTime start, DateTime end) { + AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); + alertMetadataExample.createCriteria().andBaseEntityIdEqualTo(entityId).andTriggerNameEqualTo(trigger) + .andServerVersionBetween(start.getMillis() + 1, end.getMillis()); + return convert(alertMetadataMapper.selectMany(alertMetadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public void markAllAsClosedFor(String entityId, String reasonForClose) { + List alerts = findActiveAlertByEntityId(entityId); + for (Alert alert : alerts) { + alert.markAlertAsClosed(reasonForClose); + update(alert); + } + } + + @Override + public void markAlertAsClosedFor(String providerId, String entityId, String triggerName, String reasonForClose) { + List alerts = findActiveAlertByProviderEntityIdTriggerName(providerId, entityId, triggerName); + for (Alert alert : alerts) { + alert.markAlertAsClosed(reasonForClose); + update(alert); + } + } + + @Override + public void markAlertAsCompleteFor(String providerId, String entityId, String triggerName, String completionDate) { + List alerts = findActiveAlertByProviderEntityIdTriggerName(providerId, entityId, triggerName); + for (Alert alert : alerts) { + alert.markAlertAsComplete(completionDate); + update(alert); + } + + } + + @Override + public void markAlertAsCompleteFor(String entityId, String triggerName, String completionDate) { + List alerts = findActiveAlertByEntityIdTriggerName(entityId, triggerName); + for (Alert alert : alerts) { + alert.markAlertAsComplete(completionDate); + update(alert); + } + } + + @Override + public void addOrUpdateScheduleNotificationAlert(String beneficiaryType, String entityId, String providerId, + String triggerName, String triggerCode, AlertStatus alertStatus, DateTime startDate, DateTime expiryDate) { + List existingAlerts = findActiveAlertByProviderEntityIdTriggerName(providerId, entityId, triggerName); + if (existingAlerts.isEmpty()) { + add(new Alert(providerId, entityId, beneficiaryType, AlertType.notification, TriggerType.schedule, triggerName, + triggerCode, startDate, expiryDate, alertStatus, null)); + } else { + Alert al = existingAlerts.get(0); + // if visit code is same then update otherwise add another record + if (StringUtils.isNotBlank(al.triggerCode()) && StringUtils.isNotBlank(triggerCode) + && al.triggerCode().equalsIgnoreCase(triggerCode)) { + al.setAlertStatus(alertStatus.name()); + al.setStartDate(startDate.toString()); + al.setExpiryDate(expiryDate.toString()); + al.details().put(alertStatus.name() + ":start", startDate.toString()); + al.details().put(alertStatus.name() + ":end", expiryDate.toString()); + + update(al); + } else { + add(new Alert(providerId, entityId, beneficiaryType, AlertType.notification, TriggerType.schedule, + triggerName, triggerCode, startDate, expiryDate, alertStatus, null)); + } + } + + } + + @Override + protected Long retrievePrimaryKey(Alert alert) { + if (alert == null || alert.getId() == null) { + return null; + } + String documentId = alert.getId(); + + AlertMetadataExample alertMetadataExample = new AlertMetadataExample(); + alertMetadataExample.createCriteria().andDocumentIdEqualTo(documentId); + + org.opensrp.domain.postgres.Alert pgAlert = alertMetadataMapper.selectByDocumentId(documentId); + if (pgAlert == null) { + return null; + } + return pgAlert.getId(); + } + + @Override + protected Object getUniqueField(Alert alert) { + if (alert == null) { + return null; + } + return alert.getId(); + } + + //private methods + private Alert convert(org.opensrp.domain.postgres.Alert pgAlert) { + if (pgAlert == null || pgAlert.getJson() == null || !(pgAlert.getJson() instanceof Alert)) { + return null; + } + return (Alert) pgAlert.getJson(); + } + + private org.opensrp.domain.postgres.Alert convert(Alert entity, Long primaryKey) { + if (entity == null) { + return null; + } + + org.opensrp.domain.postgres.Alert pgAlert = new org.opensrp.domain.postgres.Alert(); + pgAlert.setId(primaryKey); + pgAlert.setJson(entity); + + return pgAlert; + } + + private List convert(List alerts) { + if (alerts == null || alerts.isEmpty()) { + return new ArrayList<>(); + } + + List convertedAlerts = new ArrayList<>(); + for (org.opensrp.domain.postgres.Alert alert : alerts) { + Alert convertedAlert = convert(alert); + if (convertedAlert != null) { + convertedAlerts.add(convertedAlert); + } + } + + return convertedAlerts; + } + + private AlertMetadata createMetadata(Alert entity, Long id) { + AlertMetadata metadata = new AlertMetadata(); + metadata.setAlertId(id); + metadata.setDocumentId(entity.getId()); + metadata.setBaseEntityId(entity.entityId()); + metadata.setProviderId(entity.providerId()); + metadata.setServerVersion(entity.timestamp()); + metadata.setIsActive(entity.getIsActive()); + metadata.setTriggerName(entity.triggerName()); + return metadata; + } + + + /** + * Method should be used only during Unit testing + * Deletes all existing records + */ + protected void removeAll() { + alertMetadataMapper.deleteByExample(new AlertMetadataExample()); + alertMapper.deleteByExample(new AlertExample()); + + } + } diff --git a/src/main/java/org/opensrp/repository/postgres/AppStateTokensRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/AppStateTokensRepositoryImpl.java index f85920cb2..2b18288d9 100644 --- a/src/main/java/org/opensrp/repository/postgres/AppStateTokensRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/AppStateTokensRepositoryImpl.java @@ -13,92 +13,92 @@ @Repository("appStateTokensRepositoryPostgres") public class AppStateTokensRepositoryImpl implements AppStateTokensRepository { - - @Autowired - private AppStateTokenMapper mapper; - - @Override - public AppStateToken get(String id) { - if (StringUtils.isBlank(id)) { - return null; - } - org.opensrp.domain.postgres.AppStateToken token = mapper.selectByPrimaryKey(Long.valueOf(id)); - return getDomainEntity(token); - } - - @Override - public List getAll() { - List tokens = mapper.selectByExample(new AppStateTokenExample()); - List appStateTokens = new ArrayList(); - for (org.opensrp.domain.postgres.AppStateToken token : tokens) { - appStateTokens.add(getDomainEntity(token)); - } - return appStateTokens; - } - - @Override - public void safeRemove(AppStateToken entity) { - AppStateTokenExample example = new AppStateTokenExample(); - example.createCriteria().andNameEqualTo(entity.getName()); - mapper.deleteByExample(example); - } - - @Override - public List findByName(String name) { - AppStateTokenExample example = new AppStateTokenExample(); - example.createCriteria().andNameEqualTo(name); - List tokens = mapper.selectByExample(example); - List appStateTokens = new ArrayList(); - for (org.opensrp.domain.postgres.AppStateToken token : tokens) { - appStateTokens.add(getDomainEntity(token)); - } - return appStateTokens; - } - - @Override - public void update(AppStateToken entity) { - AppStateTokenExample example = new AppStateTokenExample(); - example.createCriteria().andNameEqualTo(entity.getName()); - List tokens = mapper.selectByExample(example); - if (tokens != null && !tokens.isEmpty()) { - org.opensrp.domain.postgres.AppStateToken token = tokens.get(0); - mapper.updateByPrimaryKey(getPostgresEntity(token, entity)); - } - } - - @Override - public void add(AppStateToken entity) { - mapper.insertSelective(getPostgresEntity(entity)); - } - - private AppStateToken getDomainEntity(org.opensrp.domain.postgres.AppStateToken token) { - return token == null ? null - : new AppStateToken(token.getName(), token.getValue(), token.getLastEditedDate(), token.getDescription()); - } - - private org.opensrp.domain.postgres.AppStateToken getPostgresEntity(AppStateToken entity) { - return getPostgresEntity(new org.opensrp.domain.postgres.AppStateToken(), entity); - } - - private org.opensrp.domain.postgres.AppStateToken getPostgresEntity(org.opensrp.domain.postgres.AppStateToken token, - AppStateToken entity) { - if (entity == null) - return null; - token.setDescription(entity.getDescription()); - token.setName(entity.getName()); - token.setLastEditedDate(entity.getLastEditDate()); - token.setValue(entity.getValue().toString()); - return token; - } - - /** - * Method should be used only during Unit testing - * Deletes all existing records - */ - public void removeAll() { - mapper.deleteByExample(new AppStateTokenExample()); - - } - - + + @Autowired + private AppStateTokenMapper mapper; + + @Override + public AppStateToken get(String id) { + if (StringUtils.isBlank(id)) { + return null; + } + org.opensrp.domain.postgres.AppStateToken token = mapper.selectByPrimaryKey(Long.valueOf(id)); + return getDomainEntity(token); + } + + @Override + public List getAll() { + List tokens = mapper.selectByExample(new AppStateTokenExample()); + List appStateTokens = new ArrayList(); + for (org.opensrp.domain.postgres.AppStateToken token : tokens) { + appStateTokens.add(getDomainEntity(token)); + } + return appStateTokens; + } + + @Override + public void safeRemove(AppStateToken entity) { + AppStateTokenExample example = new AppStateTokenExample(); + example.createCriteria().andNameEqualTo(entity.getName()); + mapper.deleteByExample(example); + } + + @Override + public List findByName(String name) { + AppStateTokenExample example = new AppStateTokenExample(); + example.createCriteria().andNameEqualTo(name); + List tokens = mapper.selectByExample(example); + List appStateTokens = new ArrayList(); + for (org.opensrp.domain.postgres.AppStateToken token : tokens) { + appStateTokens.add(getDomainEntity(token)); + } + return appStateTokens; + } + + @Override + public void update(AppStateToken entity) { + AppStateTokenExample example = new AppStateTokenExample(); + example.createCriteria().andNameEqualTo(entity.getName()); + List tokens = mapper.selectByExample(example); + if (tokens != null && !tokens.isEmpty()) { + org.opensrp.domain.postgres.AppStateToken token = tokens.get(0); + mapper.updateByPrimaryKey(getPostgresEntity(token, entity)); + } + } + + @Override + public void add(AppStateToken entity) { + mapper.insertSelective(getPostgresEntity(entity)); + } + + private AppStateToken getDomainEntity(org.opensrp.domain.postgres.AppStateToken token) { + return token == null ? null + : new AppStateToken(token.getName(), token.getValue(), token.getLastEditedDate(), token.getDescription()); + } + + private org.opensrp.domain.postgres.AppStateToken getPostgresEntity(AppStateToken entity) { + return getPostgresEntity(new org.opensrp.domain.postgres.AppStateToken(), entity); + } + + private org.opensrp.domain.postgres.AppStateToken getPostgresEntity(org.opensrp.domain.postgres.AppStateToken token, + AppStateToken entity) { + if (entity == null) + return null; + token.setDescription(entity.getDescription()); + token.setName(entity.getName()); + token.setLastEditedDate(entity.getLastEditDate()); + token.setValue(entity.getValue().toString()); + return token; + } + + /** + * Method should be used only during Unit testing + * Deletes all existing records + */ + public void removeAll() { + mapper.deleteByExample(new AppStateTokenExample()); + + } + + } diff --git a/src/main/java/org/opensrp/repository/postgres/BaseRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/BaseRepositoryImpl.java index 2e63028ac..007fd0826 100644 --- a/src/main/java/org/opensrp/repository/postgres/BaseRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/BaseRepositoryImpl.java @@ -6,43 +6,43 @@ import org.smartregister.domain.BaseDataEntity; public abstract class BaseRepositoryImpl { - - public static int DEFAULT_FETCH_SIZE = 1000; - - public static int FETCH_SIZE_LIMIT = 5000; - - public static String REVISION_PREFIX = "v"; - - public static String SERVER_VERSION = "server_version"; - - public static String VERSION = "version"; - - public static String ASCENDING = "asc"; - - public static String DESCENDING = "desc"; - - protected static Logger logger = LogManager.getLogger(BaseRepositoryImpl.class.toString()); - - protected abstract Object retrievePrimaryKey(T t); - - protected abstract Object getUniqueField(T t); - - protected String getOrderByClause(String sortBy, String sortOrder) { - String orderByClause = sortBy == null || sortBy == BaseEntity.SERVER_VERSIOIN ? SERVER_VERSION : sortBy; - orderByClause += " " + ((sortOrder == null || !sortOrder.toLowerCase().matches("(asc)|(desc)")) ? "asc" : sortOrder); - return orderByClause; - } - - protected void setRevision(BaseDataEntity entity) { - if (entity.isNew()) - entity.setRevision(REVISION_PREFIX + 1); - else if (entity.getRevision().startsWith(REVISION_PREFIX)) - entity.setRevision( - REVISION_PREFIX + (Integer.parseInt(entity.getRevision().substring(REVISION_PREFIX.length())) + 1)); - else { - String[] revision = entity.getRevision().split("-"); - entity.setRevision((Integer.parseInt(revision[0]) + 1) + "-" + revision[1]); - } - } - + + public static int DEFAULT_FETCH_SIZE = 1000; + + public static int FETCH_SIZE_LIMIT = 5000; + + public static String REVISION_PREFIX = "v"; + + public static String SERVER_VERSION = "server_version"; + + public static String VERSION = "version"; + + public static String ASCENDING = "asc"; + + public static String DESCENDING = "desc"; + + protected static Logger logger = LogManager.getLogger(BaseRepositoryImpl.class.toString()); + + protected abstract Object retrievePrimaryKey(T t); + + protected abstract Object getUniqueField(T t); + + protected String getOrderByClause(String sortBy, String sortOrder) { + String orderByClause = sortBy == null || sortBy == BaseEntity.SERVER_VERSIOIN ? SERVER_VERSION : sortBy; + orderByClause += " " + ((sortOrder == null || !sortOrder.toLowerCase().matches("(asc)|(desc)")) ? "asc" : sortOrder); + return orderByClause; + } + + protected void setRevision(BaseDataEntity entity) { + if (entity.isNew()) + entity.setRevision(REVISION_PREFIX + 1); + else if (entity.getRevision().startsWith(REVISION_PREFIX)) + entity.setRevision( + REVISION_PREFIX + (Integer.parseInt(entity.getRevision().substring(REVISION_PREFIX.length())) + 1)); + else { + String[] revision = entity.getRevision().split("-"); + entity.setRevision((Integer.parseInt(revision[0]) + 1) + "-" + revision[1]); + } + } + } diff --git a/src/main/java/org/opensrp/repository/postgres/CampaignRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/CampaignRepositoryImpl.java index d99c3ad44..08d96e512 100644 --- a/src/main/java/org/opensrp/repository/postgres/CampaignRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/CampaignRepositoryImpl.java @@ -18,195 +18,195 @@ @Repository public class CampaignRepositoryImpl extends BaseRepositoryImpl implements CampaignRepository { - @Autowired - private CustomCampaignMapper campaignMapper; - - @Autowired - private CustomCampaignMetadataMapper campaignMetadataMapper; - - @Override - public Campaign get(String id) { - if (StringUtils.isBlank(id)) { - return null; - } - - org.opensrp.domain.postgres.Campaign pgCampaign = campaignMetadataMapper.selectByIdentifier(id); - if (pgCampaign == null) { - return null; - } - return convert(pgCampaign); - } - - @Override - @Transactional - public void add(Campaign entity) { - if (getUniqueField(entity) == null) { - return; - } - - if (retrievePrimaryKey(entity) != null) { // Campaign already added - return; - } - - org.opensrp.domain.postgres.Campaign pgCampaign = convert(entity, null); - if (pgCampaign == null) { - return; - } - - int rowsAffected = campaignMapper.insertSelectiveAndSetId(pgCampaign); - if (rowsAffected < 1 || pgCampaign.getId() == null) { - return; - } - - CampaignMetadata campaignMetadata = createMetadata(entity, pgCampaign.getId()); - - campaignMetadataMapper.insertSelective(campaignMetadata); - - } - - @Override - @Transactional - public void update(Campaign entity) { - if (getUniqueField(entity) == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { // Campaign does not exist - return; - } - - org.opensrp.domain.postgres.Campaign pgCampaign = convert(entity, id); - if (pgCampaign == null) { - return; - } - CampaignMetadata campaignMetadata = createMetadata(entity, pgCampaign.getId()); - - int rowsAffected = campaignMapper.updateByPrimaryKey(pgCampaign); - if (rowsAffected < 1) { - return; - } - - CampaignMetadataExample campaignMetadataExample = new CampaignMetadataExample(); - campaignMetadataExample.createCriteria().andCampaignIdEqualTo(id); - campaignMetadata.setId(campaignMetadataMapper.selectByExample(campaignMetadataExample).get(0).getId()); - campaignMetadataMapper.updateByPrimaryKey(campaignMetadata); - - } - - @Override - public List getAll() { - List campaigns = campaignMetadataMapper - .selectMany(new CampaignMetadataExample(), 0, DEFAULT_FETCH_SIZE); - return convert(campaigns); - } - - @Override - public List getCampaignsByServerVersion(long serverVersion) { - CampaignMetadataExample campaignMetadataExample = new CampaignMetadataExample(); - campaignMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); - List campaigns = campaignMetadataMapper - .selectMany(campaignMetadataExample, 0, DEFAULT_FETCH_SIZE); - return convert(campaigns); - } - - @Override - public List getCampaignsByIdentifiers(String identifiers) { - CampaignMetadataExample campaignMetadataExample = new CampaignMetadataExample(); - campaignMetadataExample.createCriteria().andIdentifierIn(Arrays.asList(org.apache.commons.lang.StringUtils.split(identifiers,","))); - List campaigns = campaignMetadataMapper - .selectMany(campaignMetadataExample, 0, DEFAULT_FETCH_SIZE); - return convert(campaigns); - } - - @Override - @Transactional - public void safeRemove(Campaign entity) { - if (entity == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { - return; - } - - CampaignMetadataExample campaignMetadataExample = new CampaignMetadataExample(); - campaignMetadataExample.createCriteria().andCampaignIdEqualTo(id); - int rowsAffected = campaignMetadataMapper.deleteByExample(campaignMetadataExample); - if (rowsAffected < 1) { - return; - } - - campaignMapper.deleteByPrimaryKey(id); - - } - - @Override - protected Long retrievePrimaryKey(Campaign campaign) { - Object uniqueId = getUniqueField(campaign); - if (uniqueId == null) { - return null; - } - - String identifier = uniqueId.toString(); - - org.opensrp.domain.postgres.Campaign pgCampaign = campaignMetadataMapper.selectByIdentifier(identifier); - if (pgCampaign == null) { - return null; - } - return pgCampaign.getId(); - } - - @Override - protected Object getUniqueField(Campaign campaign) { - if (campaign == null) { - return null; - } - return campaign.getIdentifier(); - } - - private Campaign convert(org.opensrp.domain.postgres.Campaign pgCampaign) { - if (pgCampaign == null || pgCampaign.getJson() == null || !(pgCampaign.getJson() instanceof Campaign)) { - return null; - } - return (Campaign) pgCampaign.getJson(); - } - - private org.opensrp.domain.postgres.Campaign convert(Campaign campaign, Long primaryKey) { - if (campaign == null) { - return null; - } - - org.opensrp.domain.postgres.Campaign pgCampaign = new org.opensrp.domain.postgres.Campaign(); - pgCampaign.setId(primaryKey); - pgCampaign.setJson(campaign); - - return pgCampaign; - } - - private List convert(List campaigns) { - if (campaigns == null || campaigns.isEmpty()) { - return new ArrayList<>(); - } - - List convertedCampaigns = new ArrayList<>(); - for (org.opensrp.domain.postgres.Campaign campaign : campaigns) { - Campaign convertedCampaign = convert(campaign); - if (convertedCampaign != null) { - convertedCampaigns.add(convertedCampaign); - } - } - - return convertedCampaigns; - } - - private CampaignMetadata createMetadata(Campaign entity, Long id) { - CampaignMetadata campaignMetadata = new CampaignMetadata(); - campaignMetadata.setCampaignId(id); - campaignMetadata.setIdentifier(entity.getIdentifier()); - campaignMetadata.setServerVersion(entity.getServerVersion()); - return campaignMetadata; - } + @Autowired + private CustomCampaignMapper campaignMapper; + + @Autowired + private CustomCampaignMetadataMapper campaignMetadataMapper; + + @Override + public Campaign get(String id) { + if (StringUtils.isBlank(id)) { + return null; + } + + org.opensrp.domain.postgres.Campaign pgCampaign = campaignMetadataMapper.selectByIdentifier(id); + if (pgCampaign == null) { + return null; + } + return convert(pgCampaign); + } + + @Override + @Transactional + public void add(Campaign entity) { + if (getUniqueField(entity) == null) { + return; + } + + if (retrievePrimaryKey(entity) != null) { // Campaign already added + return; + } + + org.opensrp.domain.postgres.Campaign pgCampaign = convert(entity, null); + if (pgCampaign == null) { + return; + } + + int rowsAffected = campaignMapper.insertSelectiveAndSetId(pgCampaign); + if (rowsAffected < 1 || pgCampaign.getId() == null) { + return; + } + + CampaignMetadata campaignMetadata = createMetadata(entity, pgCampaign.getId()); + + campaignMetadataMapper.insertSelective(campaignMetadata); + + } + + @Override + @Transactional + public void update(Campaign entity) { + if (getUniqueField(entity) == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { // Campaign does not exist + return; + } + + org.opensrp.domain.postgres.Campaign pgCampaign = convert(entity, id); + if (pgCampaign == null) { + return; + } + CampaignMetadata campaignMetadata = createMetadata(entity, pgCampaign.getId()); + + int rowsAffected = campaignMapper.updateByPrimaryKey(pgCampaign); + if (rowsAffected < 1) { + return; + } + + CampaignMetadataExample campaignMetadataExample = new CampaignMetadataExample(); + campaignMetadataExample.createCriteria().andCampaignIdEqualTo(id); + campaignMetadata.setId(campaignMetadataMapper.selectByExample(campaignMetadataExample).get(0).getId()); + campaignMetadataMapper.updateByPrimaryKey(campaignMetadata); + + } + + @Override + public List getAll() { + List campaigns = campaignMetadataMapper + .selectMany(new CampaignMetadataExample(), 0, DEFAULT_FETCH_SIZE); + return convert(campaigns); + } + + @Override + public List getCampaignsByServerVersion(long serverVersion) { + CampaignMetadataExample campaignMetadataExample = new CampaignMetadataExample(); + campaignMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); + List campaigns = campaignMetadataMapper + .selectMany(campaignMetadataExample, 0, DEFAULT_FETCH_SIZE); + return convert(campaigns); + } + + @Override + public List getCampaignsByIdentifiers(String identifiers) { + CampaignMetadataExample campaignMetadataExample = new CampaignMetadataExample(); + campaignMetadataExample.createCriteria().andIdentifierIn(Arrays.asList(org.apache.commons.lang.StringUtils.split(identifiers, ","))); + List campaigns = campaignMetadataMapper + .selectMany(campaignMetadataExample, 0, DEFAULT_FETCH_SIZE); + return convert(campaigns); + } + + @Override + @Transactional + public void safeRemove(Campaign entity) { + if (entity == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { + return; + } + + CampaignMetadataExample campaignMetadataExample = new CampaignMetadataExample(); + campaignMetadataExample.createCriteria().andCampaignIdEqualTo(id); + int rowsAffected = campaignMetadataMapper.deleteByExample(campaignMetadataExample); + if (rowsAffected < 1) { + return; + } + + campaignMapper.deleteByPrimaryKey(id); + + } + + @Override + protected Long retrievePrimaryKey(Campaign campaign) { + Object uniqueId = getUniqueField(campaign); + if (uniqueId == null) { + return null; + } + + String identifier = uniqueId.toString(); + + org.opensrp.domain.postgres.Campaign pgCampaign = campaignMetadataMapper.selectByIdentifier(identifier); + if (pgCampaign == null) { + return null; + } + return pgCampaign.getId(); + } + + @Override + protected Object getUniqueField(Campaign campaign) { + if (campaign == null) { + return null; + } + return campaign.getIdentifier(); + } + + private Campaign convert(org.opensrp.domain.postgres.Campaign pgCampaign) { + if (pgCampaign == null || pgCampaign.getJson() == null || !(pgCampaign.getJson() instanceof Campaign)) { + return null; + } + return (Campaign) pgCampaign.getJson(); + } + + private org.opensrp.domain.postgres.Campaign convert(Campaign campaign, Long primaryKey) { + if (campaign == null) { + return null; + } + + org.opensrp.domain.postgres.Campaign pgCampaign = new org.opensrp.domain.postgres.Campaign(); + pgCampaign.setId(primaryKey); + pgCampaign.setJson(campaign); + + return pgCampaign; + } + + private List convert(List campaigns) { + if (campaigns == null || campaigns.isEmpty()) { + return new ArrayList<>(); + } + + List convertedCampaigns = new ArrayList<>(); + for (org.opensrp.domain.postgres.Campaign campaign : campaigns) { + Campaign convertedCampaign = convert(campaign); + if (convertedCampaign != null) { + convertedCampaigns.add(convertedCampaign); + } + } + + return convertedCampaigns; + } + + private CampaignMetadata createMetadata(Campaign entity, Long id) { + CampaignMetadata campaignMetadata = new CampaignMetadata(); + campaignMetadata.setCampaignId(id); + campaignMetadata.setIdentifier(entity.getIdentifier()); + campaignMetadata.setServerVersion(entity.getServerVersion()); + return campaignMetadata; + } } diff --git a/src/main/java/org/opensrp/repository/postgres/ClientFormRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/ClientFormRepositoryImpl.java index 2c33dfade..51825d34d 100644 --- a/src/main/java/org/opensrp/repository/postgres/ClientFormRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/ClientFormRepositoryImpl.java @@ -19,171 +19,170 @@ @Repository public class ClientFormRepositoryImpl extends BaseRepositoryImpl implements ClientFormRepository { - @Autowired - private CustomClientFormMapper clientFormMapper; - - @Autowired - private CustomClientFormMetadataMapper clientFormMetadataMapper; - - @Override - public ClientForm get(long id) { - return clientFormMapper.selectClientFormById(id); - } - - @Override - public int countClientFormByFormIdentifier(String formIdentifier) { - return countClientFormByFormIdentifier(formIdentifier, false); - } - - @Override - public int countClientFormByFormIdentifier(@NonNull String formIdentifier, boolean isJsonValidator) { - return clientFormMetadataMapper.countClientFormMetadataByFormIdentifier(formIdentifier, isJsonValidator); - } - - @Override - public ClientFormMetadata getClientFormMetadata(String formVersion, String formIdentifier) { - return getClientFormMetadata(formVersion, formIdentifier, false); - } - - @Override - public ClientFormMetadata getClientFormMetadata(@NonNull String formVersion, @NonNull String formIdentifier, boolean isJsonValidator) { - return clientFormMetadataMapper.selectClientFormMetadataByFormVersionAndIdentifier(formVersion, formIdentifier, isJsonValidator); - } - - @Override - public List getAvailableClientFormVersions(String formIdentifier) { - return getAvailableClientFormVersions(formIdentifier, false); - } - - @Override - public List getAvailableClientFormVersions(@NonNull String formIdentifier, boolean isJsonValidator) { - return clientFormMetadataMapper.getAvailableClientFormVersions(formIdentifier, isJsonValidator); - } - - @Override - public ClientFormMetadata getFormMetadata(long id) { - return clientFormMetadataMapper.selectByPrimaryKey(id); - } - - @Nullable - @Transactional - @Override - public ClientFormService.CompleteClientForm create(@NonNull ClientForm clientForm, - @NonNull ClientFormMetadata clientFormMetadata) { - Long clientFormId = clientForm.getId(); - Long clientFormMetadataId = clientFormMetadata.getId(); - if ((clientFormId != null && clientFormId != 0) || (clientFormMetadataId != null && clientFormMetadataId != 0)) { - throw new IllegalArgumentException("ClientForm & ClientFormMetadata Id must be NULL or 0"); - } - - clientFormMapper.insertClientForm(clientForm); - clientFormMetadata.setId(clientForm.getId()); - int resultClientFormMetadataId = clientFormMetadataMapper.insertClientFormMetadata(clientFormMetadata); - logger.info("Generated id for Client Form Metadata is " + resultClientFormMetadataId); - - return new ClientFormService.CompleteClientForm(clientForm, clientFormMetadata); - } - - @Nullable - @Override - public ClientFormService.CompleteClientForm create(@NonNull ClientFormService.CompleteClientForm completeClientForm) { - if (completeClientForm.clientForm == null || completeClientForm.clientFormMetadata == null) { - return null; - } - - return create(completeClientForm.clientForm, completeClientForm.clientFormMetadata); - } - - @Nullable - @Override - public List getAllDraftsClientFormMetadata(boolean isDraft) { - return clientFormMetadataMapper.getDraftClientFormMetadata(isDraft); - } - - @Nullable - @Override - public List getAllJsonWidgetValidatorClientFormMetadata(boolean isJsonValidator) { - return clientFormMetadataMapper.getJsonWidgetValidatorClientFormMetadata(isJsonValidator); - } - - @Override - public List getAllClientFormMetadata() { - return clientFormMetadataMapper.getAllClientFormMetadata(); - } - - @Nullable - @Override - public ClientForm getMostRecentFormValidator(@NonNull String formIdentifier) { - return clientFormMapper.getMostRecentFormValidator(formIdentifier); - } - - @Nullable - @Override - public ClientForm get(String id) { - if (TextUtils.isEmpty(id)) { - return null; - } - - long clientFormId; - try { - clientFormId = Long.parseLong(id); - } - catch (NumberFormatException ex) { - logger.error("Could not retrieve long ClientForm.id from string", ex); - return null; - } - - return clientFormMapper.selectClientFormById(clientFormId); - } - - @Override - public void add(@Nullable ClientForm entity) { - throw new UnsupportedOperationException( - "This operation is unsupported and will lead to integrity issues with ClientFormMetadata"); - } - - @Override - public void update(@Nullable ClientForm entity) { - if (entity == null || entity.getId() == null || entity.getId() == 0) { - return; - } - - clientFormMapper.updateByPrimaryKeySelective(entity); - } - - public void updateClientMetadataIsDraftByVersion(boolean isDraft, String formVersion) { - if (TextUtils.isBlank(formVersion)) { - return; - } - clientFormMetadataMapper.updateClientMetadataIsDraftByVersion(isDraft, formVersion); - } - - @Override - public List getAll() { - return clientFormMapper.getAll(0, DEFAULT_FETCH_SIZE); - } - - @Transactional - @Override - public void safeRemove(@Nullable ClientForm entity) { - if (entity == null || entity.getId() == null || entity.getId() == 0L) { - return; - } - - clientFormMetadataMapper.deleteByPrimaryKey(entity.getId()); - clientFormMapper.deleteByPrimaryKey(entity.getId()); - } - - @Nullable - @Override - protected Object retrievePrimaryKey(@Nullable ClientForm clientForm) { - return clientForm != null ? clientForm.getId() : null; - } - - @Nullable - @Override - protected Object getUniqueField(@Nullable ClientForm clientForm) { - return clientForm != null ? clientForm.getId() : null; - } - + @Autowired + private CustomClientFormMapper clientFormMapper; + + @Autowired + private CustomClientFormMetadataMapper clientFormMetadataMapper; + + @Override + public ClientForm get(long id) { + return clientFormMapper.selectClientFormById(id); + } + + @Override + public int countClientFormByFormIdentifier(String formIdentifier) { + return countClientFormByFormIdentifier(formIdentifier, false); + } + + @Override + public int countClientFormByFormIdentifier(@NonNull String formIdentifier, boolean isJsonValidator) { + return clientFormMetadataMapper.countClientFormMetadataByFormIdentifier(formIdentifier, isJsonValidator); + } + + @Override + public ClientFormMetadata getClientFormMetadata(String formVersion, String formIdentifier) { + return getClientFormMetadata(formVersion, formIdentifier, false); + } + + @Override + public ClientFormMetadata getClientFormMetadata(@NonNull String formVersion, @NonNull String formIdentifier, boolean isJsonValidator) { + return clientFormMetadataMapper.selectClientFormMetadataByFormVersionAndIdentifier(formVersion, formIdentifier, isJsonValidator); + } + + @Override + public List getAvailableClientFormVersions(String formIdentifier) { + return getAvailableClientFormVersions(formIdentifier, false); + } + + @Override + public List getAvailableClientFormVersions(@NonNull String formIdentifier, boolean isJsonValidator) { + return clientFormMetadataMapper.getAvailableClientFormVersions(formIdentifier, isJsonValidator); + } + + @Override + public ClientFormMetadata getFormMetadata(long id) { + return clientFormMetadataMapper.selectByPrimaryKey(id); + } + + @Nullable + @Transactional + @Override + public ClientFormService.CompleteClientForm create(@NonNull ClientForm clientForm, + @NonNull ClientFormMetadata clientFormMetadata) { + Long clientFormId = clientForm.getId(); + Long clientFormMetadataId = clientFormMetadata.getId(); + if ((clientFormId != null && clientFormId != 0) || (clientFormMetadataId != null && clientFormMetadataId != 0)) { + throw new IllegalArgumentException("ClientForm & ClientFormMetadata Id must be NULL or 0"); + } + + clientFormMapper.insertClientForm(clientForm); + clientFormMetadata.setId(clientForm.getId()); + int resultClientFormMetadataId = clientFormMetadataMapper.insertClientFormMetadata(clientFormMetadata); + logger.info("Generated id for Client Form Metadata is " + resultClientFormMetadataId); + + return new ClientFormService.CompleteClientForm(clientForm, clientFormMetadata); + } + + @Nullable + @Override + public ClientFormService.CompleteClientForm create(@NonNull ClientFormService.CompleteClientForm completeClientForm) { + if (completeClientForm.clientForm == null || completeClientForm.clientFormMetadata == null) { + return null; + } + + return create(completeClientForm.clientForm, completeClientForm.clientFormMetadata); + } + + @Nullable + @Override + public List getAllDraftsClientFormMetadata(boolean isDraft) { + return clientFormMetadataMapper.getDraftClientFormMetadata(isDraft); + } + + @Nullable + @Override + public List getAllJsonWidgetValidatorClientFormMetadata(boolean isJsonValidator) { + return clientFormMetadataMapper.getJsonWidgetValidatorClientFormMetadata(isJsonValidator); + } + + @Override + public List getAllClientFormMetadata() { + return clientFormMetadataMapper.getAllClientFormMetadata(); + } + + @Nullable + @Override + public ClientForm getMostRecentFormValidator(@NonNull String formIdentifier) { + return clientFormMapper.getMostRecentFormValidator(formIdentifier); + } + + @Nullable + @Override + public ClientForm get(String id) { + if (TextUtils.isEmpty(id)) { + return null; + } + + long clientFormId; + try { + clientFormId = Long.parseLong(id); + } catch (NumberFormatException ex) { + logger.error("Could not retrieve long ClientForm.id from string", ex); + return null; + } + + return clientFormMapper.selectClientFormById(clientFormId); + } + + @Override + public void add(@Nullable ClientForm entity) { + throw new UnsupportedOperationException( + "This operation is unsupported and will lead to integrity issues with ClientFormMetadata"); + } + + @Override + public void update(@Nullable ClientForm entity) { + if (entity == null || entity.getId() == null || entity.getId() == 0) { + return; + } + + clientFormMapper.updateByPrimaryKeySelective(entity); + } + + public void updateClientMetadataIsDraftByVersion(boolean isDraft, String formVersion) { + if (TextUtils.isBlank(formVersion)) { + return; + } + clientFormMetadataMapper.updateClientMetadataIsDraftByVersion(isDraft, formVersion); + } + + @Override + public List getAll() { + return clientFormMapper.getAll(0, DEFAULT_FETCH_SIZE); + } + + @Transactional + @Override + public void safeRemove(@Nullable ClientForm entity) { + if (entity == null || entity.getId() == null || entity.getId() == 0L) { + return; + } + + clientFormMetadataMapper.deleteByPrimaryKey(entity.getId()); + clientFormMapper.deleteByPrimaryKey(entity.getId()); + } + + @Nullable + @Override + protected Object retrievePrimaryKey(@Nullable ClientForm clientForm) { + return clientForm != null ? clientForm.getId() : null; + } + + @Nullable + @Override + protected Object getUniqueField(@Nullable ClientForm clientForm) { + return clientForm != null ? clientForm.getId() : null; + } + } diff --git a/src/main/java/org/opensrp/repository/postgres/ClientMigrationFileRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/ClientMigrationFileRepositoryImpl.java index 933d3c1ef..7c1145f1f 100644 --- a/src/main/java/org/opensrp/repository/postgres/ClientMigrationFileRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/ClientMigrationFileRepositoryImpl.java @@ -25,7 +25,7 @@ public ClientMigrationFile get(String id) { return null; } - int idInt = 0 ; + int idInt = 0; try { idInt = Integer.parseInt(id); @@ -115,7 +115,7 @@ public List getClientMigrationFileByVersion(int version) { ArrayList convertedMigrationFiles = new ArrayList<>(); List psqlMigrationFiles = clientMigrationFileMapper.selectByVersion(version); - for (org.opensrp.domain.postgres.ClientMigrationFile psqlMigrationFile: psqlMigrationFiles) { + for (org.opensrp.domain.postgres.ClientMigrationFile psqlMigrationFile : psqlMigrationFiles) { ClientMigrationFile migrationFile = convert(psqlMigrationFile); if (migrationFile != null) { @@ -136,7 +136,7 @@ public List getClientMigrationFileByManifestId(int manifest ArrayList convertedMigrationFiles = new ArrayList<>(); List psqlMigrationFiles = clientMigrationFileMapper.selectByManifestId(manifestId); - for (org.opensrp.domain.postgres.ClientMigrationFile psqlMigrationFile: psqlMigrationFiles) { + for (org.opensrp.domain.postgres.ClientMigrationFile psqlMigrationFile : psqlMigrationFiles) { ClientMigrationFile migrationFile = convert(psqlMigrationFile); if (migrationFile != null) { @@ -175,7 +175,7 @@ public List getAll(int limit) { ArrayList convertedMigrationFiles = new ArrayList<>(); List psqlMigrationFiles = clientMigrationFileMapper.getAll(0, limit); - for (org.opensrp.domain.postgres.ClientMigrationFile psqlMigrationFile: psqlMigrationFiles) { + for (org.opensrp.domain.postgres.ClientMigrationFile psqlMigrationFile : psqlMigrationFiles) { ClientMigrationFile migrationFile = convert(psqlMigrationFile); if (migrationFile != null) { diff --git a/src/main/java/org/opensrp/repository/postgres/ClientsRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/ClientsRepositoryImpl.java index 1e96998e5..a93bf7368 100644 --- a/src/main/java/org/opensrp/repository/postgres/ClientsRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/ClientsRepositoryImpl.java @@ -40,732 +40,729 @@ @Repository("clientsRepositoryPostgres") public class ClientsRepositoryImpl extends BaseRepositoryImpl implements ClientsRepository { - - private static Logger logger = LogManager.getLogger(ClientsRepository.class.toString()); - - public static String RESIDENCE = "residence"; - - @Autowired - private CustomClientMetadataMapper clientMetadataMapper; - - @Autowired - private CustomClientMapper clientMapper; - - @Autowired - private EventsRepository eventsRepository; - - @Override - public Client get(String id) { - if (StringUtils.isBlank(id)) { - return null; - } - - org.opensrp.domain.postgres.Client pgClient = clientMetadataMapper.selectByDocumentId(id); - if (pgClient == null) { - return null; - } - return convert(pgClient); - } - - @Override - @Transactional - public void add(Client entity) { - if (entity == null || entity.getBaseEntityId() == null) { - return; - } - - if (retrievePrimaryKey(entity) != null) { // Client already added - return; - } - - if (entity.getId() == null || entity.getId().isEmpty()) - entity.setId(UUID.randomUUID().toString()); - - setRevision(entity); - - org.opensrp.domain.postgres.Client pgClient = convert(entity, null); - if (pgClient == null) { - throw new IllegalStateException(); - } - - int rowsAffected = clientMapper.insertSelectiveAndSetId(pgClient); - if (rowsAffected < 1 || pgClient.getId() == null) { - throw new IllegalStateException(); - } - - updateServerVersion(pgClient, entity); - - ClientMetadata clientMetadata = createMetadata(entity, pgClient.getId()); - if (clientMetadata != null) { - clientMetadataMapper.insertSelective(clientMetadata); - } - } - - private void updateServerVersion(org.opensrp.domain.postgres.Client pgClient, Client entity) { - long serverVersion = clientMapper.selectServerVersionByPrimaryKey(pgClient.getId()); - entity.setServerVersion(serverVersion); - pgClient.setJson(entity); - pgClient.setServerVersion(null); - int rowsAffected = clientMapper.updateByPrimaryKeySelective(pgClient); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - } - - @Override - public void update(Client entity) { - update(entity, false); - } - - @Transactional - @Override - public void update(Client entity, boolean allowArchived) { - if (entity == null || entity.getBaseEntityId() == null) { - return; - } - - Long id = retrievePrimaryKey(entity, allowArchived); - if (id == null) { // Client not added - throw new IllegalStateException(); - } - - setRevision(entity); - - org.opensrp.domain.postgres.Client pgClient = convert(entity, id); - if (pgClient == null) { - throw new IllegalStateException(); - } - - int rowsAffected = clientMapper.updateByPrimaryKeyAndGenerateServerVersion(pgClient); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - - updateServerVersion(pgClient, entity); - - ClientMetadata clientMetadata = createMetadata(entity, id); - if (clientMetadata == null) { - throw new IllegalStateException(); - } - - ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); - Criteria criteria = clientMetadataExample.createCriteria(); - criteria.andClientIdEqualTo(id); - if (!allowArchived) { - criteria.andDateDeletedIsNull(); - } - ClientMetadata metadata = clientMetadataMapper.selectByExample(clientMetadataExample).get(0); - clientMetadata.setId(metadata.getId()); - clientMetadata.setDateCreated(metadata.getDateCreated()); - clientMetadataMapper.updateByPrimaryKey(clientMetadata); - } - - @Override - public List getAll() { - ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); - clientMetadataExample.createCriteria().andDateDeletedIsNull(); - List clients = clientMetadataMapper.selectMany(clientMetadataExample, 0, - DEFAULT_FETCH_SIZE); - return convert(clients); - } - - @Override - public void safeRemove(Client entity) { - if (entity == null || entity.getBaseEntityId() == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { - return; - } - - Date dateDeleted = entity.getDateVoided() == null ? new Date() : entity.getDateVoided().toDate(); - ClientMetadata clientMetadata = new ClientMetadata(); - clientMetadata.setDateDeleted(dateDeleted); - - ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); - clientMetadataExample.createCriteria().andClientIdEqualTo(id).andDateDeletedIsNull(); - - int rowsAffected = clientMetadataMapper.updateByExampleSelective(clientMetadata, clientMetadataExample); - if (rowsAffected < 1) { - return; - } - - org.opensrp.domain.postgres.Client pgClient = new org.opensrp.domain.postgres.Client(); - pgClient.setId(id); - pgClient.setDateDeleted(dateDeleted); - clientMapper.updateByPrimaryKeySelective(pgClient); - } - - @Override - public Client findByBaseEntityId(String baseEntityId) { - if (StringUtils.isBlank(baseEntityId)) { - return null; - } - ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); - clientMetadataExample.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andDateDeletedIsNull(); - org.opensrp.domain.postgres.Client pgClient = clientMetadataMapper.selectOne(clientMetadataExample); - return convert(pgClient); - } - - @Override - public Client findById(String id) { - if (StringUtils.isBlank(id)) { - return null; - } - ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); - clientMetadataExample.createCriteria().andDocumentIdEqualTo(id).andDateDeletedIsNull(); - org.opensrp.domain.postgres.Client pgClient = clientMetadataMapper.selectOne(clientMetadataExample); - return convert(pgClient); - } - - @Override - public List findAllClients() { - return getAll(); - } - - @Override - public List findAllByIdentifier(String identifier) { - List clients = clientMapper.selectByIdentifier(identifier); - return convert(clients); - } - - @Override - public List findAllByIdentifier(String identifierType, String identifier) { - List clients = clientMapper.selectByIdentifierOfType(identifierType, identifier); - return convert(clients); - } - - @Override - public List findAllByAttribute(String attributeType, String attribute) { - List clients = clientMapper.selectByAttributeOfType(attributeType, attribute); - return convert(clients); - } - - @Override - public List findAllByAttributes(String attributeType, List attributes) { - List clients = clientMapper.selectByAttributesOfType(attributeType, attributes); - return convert(clients); - } - - @Override - public List findAllByMatchingName(String nameMatches) { - List clients = clientMetadataMapper.selectByName(nameMatches, 0, - DEFAULT_FETCH_SIZE); - return convert(clients); - } - - @Override - public List findByRelationshipIdAndDateCreated(String relationalId, String dateFrom, String dateTo) { - List clients = clientMapper.selectByRelationshipIdAndDateCreated(relationalId, - new DateTime(dateFrom).toDate(), new DateTime(dateTo).toDate()); - return convert(clients); - } - - public List findByRelationshipId(String relationshipType, String entityId) { - List clients = clientMapper.selectByRelationshipIdOfType(relationshipType, - entityId); - return convert(clients); - } - - @Override - public List findByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { - - int pageSize = searchBean.getPageSize(); - if (pageSize == 0) { - pageSize = DEFAULT_FETCH_SIZE; - } - - int offset = searchBean.getPageNumber() * pageSize; - return convert(clientMetadataMapper.selectBySearchBean(searchBean, addressSearchBean, offset, pageSize)); - } - - @Override - public List findByDynamicQuery(String query) { - throw new IllegalArgumentException("Method not supported"); - } - - @Override - public List findByCriteria(ClientSearchBean searchBean) { - return findByCriteria(searchBean, new AddressSearchBean()); - } - - @Override - public List findByCriteria(AddressSearchBean addressSearchBean, DateTime lastEditFrom, DateTime lastEditTo) { - ClientSearchBean clientSearchBean = new ClientSearchBean(); - clientSearchBean.setLastEditFrom(lastEditFrom); - clientSearchBean.setLastEditTo(lastEditTo); - return findByCriteria(clientSearchBean, addressSearchBean); - } - - @Override - public List findByRelationShip(String relationIndentier) { - List clients = clientMapper.selectByRelationShip(relationIndentier); - return convert(clients); - } - - @Override - public List findByEmptyServerVersion() { - ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); - clientMetadataExample.createCriteria().andServerVersionIsNull(); - clientMetadataExample.or(clientMetadataExample.createCriteria().andServerVersionEqualTo(0l)); - clientMetadataExample.setOrderByClause("client_id ASC"); - List clients = clientMetadataMapper.selectMany(clientMetadataExample, 0, - DEFAULT_FETCH_SIZE); - return convert(clients); - } - - /** - * {@inheritDoc} - */ - @Override - public List findByServerVersion(long serverVersion, Integer limit) { - ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); - clientMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion).andDateDeletedIsNull(); - clientMetadataExample.setOrderByClause(this.getOrderByClause(SERVER_VERSION, ASCENDING)); - Integer pageLimit = limit == null ? DEFAULT_FETCH_SIZE : limit; - List clients = clientMetadataMapper.selectMany(clientMetadataExample, 0, - pageLimit); - return convert(clients); - } - - /** - * {@inheritDoc} - */ - @Override - public Long countAll(long serverVersion) { - ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); - clientMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion).andDateDeletedIsNull(); - return clientMetadataMapper.countMany(clientMetadataExample); - } - - @Override - public List findByFieldValue(String field, List ids) { - if (field.equals(BASE_ENTITY_ID) && ids != null && !ids.isEmpty()) { - ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); - clientMetadataExample.createCriteria().andBaseEntityIdIn(ids).andDateDeletedIsNull(); - List clients = clientMetadataMapper.selectMany(clientMetadataExample, 0, - DEFAULT_FETCH_SIZE); - return convert(clients); - } - return new ArrayList<>(); - } - - @Override - public List notInOpenMRSByServerVersion(long serverVersion, Calendar calendar) { - long serverStartKey = serverVersion + 1; - long serverEndKey = calendar.getTimeInMillis(); - if (serverStartKey < serverEndKey) { - ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); - clientMetadataExample.createCriteria().andOpenmrsUuidIsNull() - .andServerVersionBetween(serverStartKey, serverEndKey).andDateDeletedIsNull(); - - List clients = clientMetadataMapper.selectMany(clientMetadataExample, 0, - DEFAULT_FETCH_SIZE); - return convert(clients); - } - return new ArrayList<>(); - } - - // Private Methods - @Override - public List convert(List clients) { - if (clients == null || clients.isEmpty()) { - return new ArrayList<>(); - } - - List convertedClients = new ArrayList<>(); - for (org.opensrp.domain.postgres.Client client : clients) { - Client convertedClient = convert(client); - if (convertedClient != null) { - convertedClients.add(convertedClient); - } - } - - return convertedClients; - } - - private Client convert(org.opensrp.domain.postgres.Client client) { - if (client == null || client.getJson() == null || !(client.getJson() instanceof Client)) { - return null; - } - return (Client) client.getJson(); - } - - private org.opensrp.domain.postgres.Client convert(Client client, Long primaryKey) { - if (client == null) { - return null; - } - - org.opensrp.domain.postgres.Client pgClient = new org.opensrp.domain.postgres.Client(); - pgClient.setId(primaryKey); - pgClient.setJson(client); - - return pgClient; - } - - private ClientMetadata createMetadata(Client client, Long clientId) { - try { - ClientMetadata clientMetadata = new ClientMetadata(); - clientMetadata.setDocumentId(client.getId()); - clientMetadata.setBaseEntityId(client.getBaseEntityId()); - if (client.getBirthdate() != null) { - clientMetadata.setBirthDate(client.getBirthdate().toDate()); - } - clientMetadata.setClientId(clientId); - clientMetadata.setFirstName(client.getFirstName()); - clientMetadata.setMiddleName(client.getMiddleName()); - clientMetadata.setLastName(client.getLastName()); - - if(clientId != null){ - clientMetadata.setDateEdited(new Date()); - } - - String relationalId = null; - Map> relationShips = client.getRelationships(); - if (relationShips != null && !relationShips.isEmpty()) { - for (Map.Entry> maEntry : relationShips.entrySet()) { - List values = maEntry.getValue(); - if (values != null && !values.isEmpty()) { - relationalId = values.get(0); - break; - } - } - } - clientMetadata.setRelationalId(relationalId); - - String uniqueId = null; - String openmrsUUID = null; - Map identifiers = client.getIdentifiers(); - if (identifiers != null && !identifiers.isEmpty()) { - for (Map.Entry entry : identifiers.entrySet()) { - String value = entry.getValue(); - if (StringUtils.isNotBlank(value)) { - if (AllConstants.Client.OPENMRS_UUID_IDENTIFIER_TYPE.equalsIgnoreCase(entry.getKey())) { - openmrsUUID = value; - } else { - uniqueId = value; - } - } - } - } - - clientMetadata.setUniqueId(uniqueId); - clientMetadata.setOpenmrsUuid(openmrsUUID); - clientMetadata.setServerVersion(client.getServerVersion()); - if (client.getDateVoided() != null) - clientMetadata.setDateDeleted(client.getDateVoided().toDate()); - Object residence = client.getAttribute(RESIDENCE); - if (residence != null) - clientMetadata.setResidence(residence.toString()); - clientMetadata.setLocationId(client.getLocationId()); - clientMetadata.setClientType(client.getClientType()); - return clientMetadata; - } - catch (Exception e) { - logger.error(e.getMessage(), e); - return null; - } - } - - @Override - protected Long retrievePrimaryKey(Client entity) { - return retrievePrimaryKey(entity, false); - } - - /** - * @param entity - * @param allowArchived - * @return - */ - private Long retrievePrimaryKey(Client entity, boolean allowArchived) { - Object uniqueId = getUniqueField(entity); - if (uniqueId == null) { - return null; - } - - String baseEntityId = uniqueId.toString(); - - ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); - Criteria criteria = clientMetadataExample.createCriteria(); - criteria.andBaseEntityIdEqualTo(baseEntityId); - if (!allowArchived) { - criteria.andDateDeletedIsNull(); - } - - org.opensrp.domain.postgres.Client pgClient = clientMetadataMapper.selectOne(clientMetadataExample); - if (pgClient == null) { - return null; - } - return pgClient.getId(); - } - - @Override - protected Object getUniqueField(Client t) { - if (t == null) { - return null; - } - return t.getBaseEntityId(); - } - - @Override - public List selectMemberCountHouseholdHeadProviderByClients(String field, List ids, - String clientType) { - ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); - clientMetadataExample.createCriteria().andRelationalIdIn(ids); - return clientMetadataMapper.selectMemberCountHouseholdHeadProviderByClients(clientMetadataExample, clientType); - } - - @Override - public HouseholdClient findTotalCountHouseholdByCriteria(ClientSearchBean searchBean, - AddressSearchBean addressSearchBean) { - - return clientMetadataMapper.selectHouseholdCountBySearchBean(searchBean, addressSearchBean); - } - - @Override - public List findMembersByRelationshipId(String baseEntityId) { - - List members = new ArrayList(); - if (!StringUtils.isBlank(baseEntityId)) { - members = clientMetadataMapper.selectMembersByRelationshipId(baseEntityId); - } - return customClientConvert(members); - } - - @Override - public List findAllClientsByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { - int pageSize = searchBean.getPageSize(); - if (pageSize == 0) { - pageSize = DEFAULT_FETCH_SIZE; - } - - int offset = searchBean.getPageNumber() * pageSize; - - List clients = clientMetadataMapper.selectAllClientsBySearchBean(searchBean, addressSearchBean, offset, - pageSize); - return customClientConvert(clients); - } - - private Client customClientConvert(CustomClient customClient) { - - if (customClient == null || customClient.getJson() == null || !(customClient.getJson() instanceof Client)) { - return null; - } - - Client cl = (Client) customClient.getJson(); - cl.addAttribute("dynamicProperties", customClient.getDynamicProperties()); - return cl; - } - - protected List customClientConvert(List clients) { - if (clients == null || clients.isEmpty()) { - return new ArrayList<>(); - } - - List convertedClients = new ArrayList<>(); - for (CustomClient client : clients) { - Client convertedClient = customClientConvert(client); - if (convertedClient != null) { - convertedClients.add(convertedClient); - } - } - - return convertedClients; - } - - @Override - public HouseholdClient findCountAllClientsByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { - - return clientMetadataMapper.selectCountAllClientsBySearchBean(searchBean, addressSearchBean); - } - - @Override - public List findHouseholdByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { - Map pageSizeAndOffset = getPageSizeAndOffset(searchBean); - return customClientConvert(clientMetadataMapper.selectHouseholdBySearchBean(searchBean, addressSearchBean, - pageSizeAndOffset.get("offset"), pageSizeAndOffset.get("pageSize"))); - } - - @Override - public List findANCByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { - Map pageSizeAndOffset = getPageSizeAndOffset(searchBean); - List clients = clientMetadataMapper.selectANCBySearchBean(searchBean, addressSearchBean, - pageSizeAndOffset.get("offset"), pageSizeAndOffset.get("pageSize")); - return customClientConvert(clients); - } - - @Override - public int findCountANCByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { - return clientMetadataMapper.selectCountANCBySearchBean(searchBean, addressSearchBean); - } - - @Override - public List findChildByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { - Map pageSizeAndOffset = getPageSizeAndOffset(searchBean); - List clients = clientMetadataMapper.selectChildBySearchBean(searchBean, addressSearchBean, - pageSizeAndOffset.get("offset"), pageSizeAndOffset.get("pageSize")); - return customClientConvert(clients); - } - - @Override - public int findCountChildByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { - return clientMetadataMapper.selectCountChildBySearchBean(searchBean, addressSearchBean); - } - - private Map getPageSizeAndOffset(ClientSearchBean searchBean) { - Map pageSizeAndOffset = new HashMap<>(); - int pageSize = searchBean.getPageSize(); - if (pageSize == 0) { - pageSize = DEFAULT_FETCH_SIZE; - } - - int offset = searchBean.getPageNumber() * pageSize; - pageSizeAndOffset.put("pageSize", pageSize); - pageSizeAndOffset.put("offset", offset); - return pageSizeAndOffset; - - } - - /** - * Method should be used only during Unit testing Deletes all existing records - */ - public void removeAll() { - clientMetadataMapper.deleteByExample(new ClientMetadataExample()); - clientMapper.deleteByExample(new ClientExample()); - - } - - /** - * {@inheritDoc} - */ - @Override - public Pair, Long> findAllIds(long serverVersion, int limit, boolean isArchived) { - Long lastServerVersion = null; - ClientMetadataExample example = new ClientMetadataExample(); - Criteria criteria = example.createCriteria(); - criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); - - if (isArchived) { - criteria.andDateDeletedIsNotNull(); - } else { - criteria.andDateDeletedIsNull(); - } - - return getClientListLongPair(limit, lastServerVersion, example); - } - - @Override - public Pair, Long> findAllIds(long serverVersion, int limit, boolean isArchived, Date fromDate, - Date toDate) { - if (toDate == null && fromDate == null) { - return findAllIds(serverVersion, limit, isArchived); - } else { - Long lastServerVersion = null; - ClientMetadataExample example = new ClientMetadataExample(); - Criteria criteria = example.createCriteria(); - criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); - if (isArchived) { - criteria.andDateDeletedIsNotNull(); - } else { - criteria.andDateDeletedIsNull(); - } - - if (toDate != null && fromDate != null) { - criteria.andDateCreatedBetween(fromDate, toDate); - } else if (fromDate != null) { - criteria.andDateCreatedGreaterThanOrEqualTo(fromDate); - } else { - criteria.andDateCreatedLessThanOrEqualTo(toDate); - } - - return getClientListLongPair(limit, lastServerVersion, example); - } - } - - private Pair, Long> getClientListLongPair(int limit, Long lastServerVersion, - ClientMetadataExample example) { - Long serverVersion = lastServerVersion; - ClientMetadataExample clientMetadataExample = example; - int fetchLimit = limit > 0 ? limit : DEFAULT_FETCH_SIZE; - - List clientIdentifiers = clientMetadataMapper.selectManyIds(clientMetadataExample, 0, fetchLimit); - - if (clientIdentifiers != null && !clientIdentifiers.isEmpty()) { - clientMetadataExample = new ClientMetadataExample(); - clientMetadataExample.createCriteria().andDocumentIdEqualTo(clientIdentifiers.get(clientIdentifiers.size() - 1)); - List clientMetaDataList = clientMetadataMapper.selectByExample(clientMetadataExample); - - serverVersion = clientMetaDataList != null && !clientMetaDataList.isEmpty() - ? clientMetaDataList.get(0).getServerVersion() - : 0; - } - return Pair.of(clientIdentifiers, serverVersion); - } - - @Override - public List findClientById(String id) { - Client client = get(id); - return client == null ? Collections.emptyList() : convertToFHIR(Collections.singletonList(client)); - } - - @Override - public List findFamilyByJurisdiction(String jurisdiction) { - - List baseEntityIds = eventsRepository.findBaseEntityIdsByLocation(jurisdiction); - ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); - if (baseEntityIds.isEmpty()) - return Collections.emptyList(); - clientMetadataExample.createCriteria().andBaseEntityIdIn(baseEntityIds).andDateDeletedIsNull() - .andLastNameEqualTo("Family"); - return convertToFHIR(convert(clientMetadataMapper.selectMany(clientMetadataExample, 0, 20000))); - } - - @Override - public List findFamilyByResidence(String structureId) { - ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); - clientMetadataExample.createCriteria().andResidenceEqualTo(structureId).andDateDeletedIsNull() - .andLastNameEqualTo("Family"); - return convertToFHIR(convert(clientMetadataMapper.selectMany(clientMetadataExample, 0, DEFAULT_FETCH_SIZE))); - } - - @Override - public List findFamilyMemberyByJurisdiction(String jurisdiction) { - List clients = findByLocationIdExclusiveOfType(jurisdiction, "Family"); - return convertToFHIR(clients); - } - - @Override - public List findFamilyMemberByResidence(String structureId) { - ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); - clientMetadataExample.createCriteria().andResidenceEqualTo(structureId).andDateDeletedIsNull() - .andClientTypeNotEqualTo("Family"); - return convertToFHIR(convert(clientMetadataMapper.selectMany(clientMetadataExample, 0, DEFAULT_FETCH_SIZE))); - } - - @Override - public List findClientByRelationship(String relationship, String id) { - return convertToFHIR(findByRelationshipId(relationship, id)); - } - - @Override - public List findByClientTypeAndLocationId(String clientType, String locationId) { - List clients = clientMetadataMapper.selectByLocationIdOfType(clientType, - locationId); - return convert(clients); - } - - @Override - public List findByLocationIdExclusiveOfType(String locationId, String clientType) { - List clients = clientMetadataMapper.selectByLocationIdAndNotOfType(locationId, - clientType); - return convert(clients); - } - - private List convertToFHIR(List clients) { - return clients.stream().map(client -> ClientConverter.convertClientToPatientResource(client)) - .collect(Collectors.toList()); - } - + + public static String RESIDENCE = "residence"; + private static Logger logger = LogManager.getLogger(ClientsRepository.class.toString()); + @Autowired + private CustomClientMetadataMapper clientMetadataMapper; + + @Autowired + private CustomClientMapper clientMapper; + + @Autowired + private EventsRepository eventsRepository; + + @Override + public Client get(String id) { + if (StringUtils.isBlank(id)) { + return null; + } + + org.opensrp.domain.postgres.Client pgClient = clientMetadataMapper.selectByDocumentId(id); + if (pgClient == null) { + return null; + } + return convert(pgClient); + } + + @Override + @Transactional + public void add(Client entity) { + if (entity == null || entity.getBaseEntityId() == null) { + return; + } + + if (retrievePrimaryKey(entity) != null) { // Client already added + return; + } + + if (entity.getId() == null || entity.getId().isEmpty()) + entity.setId(UUID.randomUUID().toString()); + + setRevision(entity); + + org.opensrp.domain.postgres.Client pgClient = convert(entity, null); + if (pgClient == null) { + throw new IllegalStateException(); + } + + int rowsAffected = clientMapper.insertSelectiveAndSetId(pgClient); + if (rowsAffected < 1 || pgClient.getId() == null) { + throw new IllegalStateException(); + } + + updateServerVersion(pgClient, entity); + + ClientMetadata clientMetadata = createMetadata(entity, pgClient.getId()); + if (clientMetadata != null) { + clientMetadataMapper.insertSelective(clientMetadata); + } + } + + private void updateServerVersion(org.opensrp.domain.postgres.Client pgClient, Client entity) { + long serverVersion = clientMapper.selectServerVersionByPrimaryKey(pgClient.getId()); + entity.setServerVersion(serverVersion); + pgClient.setJson(entity); + pgClient.setServerVersion(null); + int rowsAffected = clientMapper.updateByPrimaryKeySelective(pgClient); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + } + + @Override + public void update(Client entity) { + update(entity, false); + } + + @Transactional + @Override + public void update(Client entity, boolean allowArchived) { + if (entity == null || entity.getBaseEntityId() == null) { + return; + } + + Long id = retrievePrimaryKey(entity, allowArchived); + if (id == null) { // Client not added + throw new IllegalStateException(); + } + + setRevision(entity); + + org.opensrp.domain.postgres.Client pgClient = convert(entity, id); + if (pgClient == null) { + throw new IllegalStateException(); + } + + int rowsAffected = clientMapper.updateByPrimaryKeyAndGenerateServerVersion(pgClient); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + + updateServerVersion(pgClient, entity); + + ClientMetadata clientMetadata = createMetadata(entity, id); + if (clientMetadata == null) { + throw new IllegalStateException(); + } + + ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); + Criteria criteria = clientMetadataExample.createCriteria(); + criteria.andClientIdEqualTo(id); + if (!allowArchived) { + criteria.andDateDeletedIsNull(); + } + ClientMetadata metadata = clientMetadataMapper.selectByExample(clientMetadataExample).get(0); + clientMetadata.setId(metadata.getId()); + clientMetadata.setDateCreated(metadata.getDateCreated()); + clientMetadataMapper.updateByPrimaryKey(clientMetadata); + } + + @Override + public List getAll() { + ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); + clientMetadataExample.createCriteria().andDateDeletedIsNull(); + List clients = clientMetadataMapper.selectMany(clientMetadataExample, 0, + DEFAULT_FETCH_SIZE); + return convert(clients); + } + + @Override + public void safeRemove(Client entity) { + if (entity == null || entity.getBaseEntityId() == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { + return; + } + + Date dateDeleted = entity.getDateVoided() == null ? new Date() : entity.getDateVoided().toDate(); + ClientMetadata clientMetadata = new ClientMetadata(); + clientMetadata.setDateDeleted(dateDeleted); + + ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); + clientMetadataExample.createCriteria().andClientIdEqualTo(id).andDateDeletedIsNull(); + + int rowsAffected = clientMetadataMapper.updateByExampleSelective(clientMetadata, clientMetadataExample); + if (rowsAffected < 1) { + return; + } + + org.opensrp.domain.postgres.Client pgClient = new org.opensrp.domain.postgres.Client(); + pgClient.setId(id); + pgClient.setDateDeleted(dateDeleted); + clientMapper.updateByPrimaryKeySelective(pgClient); + } + + @Override + public Client findByBaseEntityId(String baseEntityId) { + if (StringUtils.isBlank(baseEntityId)) { + return null; + } + ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); + clientMetadataExample.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andDateDeletedIsNull(); + org.opensrp.domain.postgres.Client pgClient = clientMetadataMapper.selectOne(clientMetadataExample); + return convert(pgClient); + } + + @Override + public Client findById(String id) { + if (StringUtils.isBlank(id)) { + return null; + } + ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); + clientMetadataExample.createCriteria().andDocumentIdEqualTo(id).andDateDeletedIsNull(); + org.opensrp.domain.postgres.Client pgClient = clientMetadataMapper.selectOne(clientMetadataExample); + return convert(pgClient); + } + + @Override + public List findAllClients() { + return getAll(); + } + + @Override + public List findAllByIdentifier(String identifier) { + List clients = clientMapper.selectByIdentifier(identifier); + return convert(clients); + } + + @Override + public List findAllByIdentifier(String identifierType, String identifier) { + List clients = clientMapper.selectByIdentifierOfType(identifierType, identifier); + return convert(clients); + } + + @Override + public List findAllByAttribute(String attributeType, String attribute) { + List clients = clientMapper.selectByAttributeOfType(attributeType, attribute); + return convert(clients); + } + + @Override + public List findAllByAttributes(String attributeType, List attributes) { + List clients = clientMapper.selectByAttributesOfType(attributeType, attributes); + return convert(clients); + } + + @Override + public List findAllByMatchingName(String nameMatches) { + List clients = clientMetadataMapper.selectByName(nameMatches, 0, + DEFAULT_FETCH_SIZE); + return convert(clients); + } + + @Override + public List findByRelationshipIdAndDateCreated(String relationalId, String dateFrom, String dateTo) { + List clients = clientMapper.selectByRelationshipIdAndDateCreated(relationalId, + new DateTime(dateFrom).toDate(), new DateTime(dateTo).toDate()); + return convert(clients); + } + + public List findByRelationshipId(String relationshipType, String entityId) { + List clients = clientMapper.selectByRelationshipIdOfType(relationshipType, + entityId); + return convert(clients); + } + + @Override + public List findByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { + + int pageSize = searchBean.getPageSize(); + if (pageSize == 0) { + pageSize = DEFAULT_FETCH_SIZE; + } + + int offset = searchBean.getPageNumber() * pageSize; + return convert(clientMetadataMapper.selectBySearchBean(searchBean, addressSearchBean, offset, pageSize)); + } + + @Override + public List findByDynamicQuery(String query) { + throw new IllegalArgumentException("Method not supported"); + } + + @Override + public List findByCriteria(ClientSearchBean searchBean) { + return findByCriteria(searchBean, new AddressSearchBean()); + } + + @Override + public List findByCriteria(AddressSearchBean addressSearchBean, DateTime lastEditFrom, DateTime lastEditTo) { + ClientSearchBean clientSearchBean = new ClientSearchBean(); + clientSearchBean.setLastEditFrom(lastEditFrom); + clientSearchBean.setLastEditTo(lastEditTo); + return findByCriteria(clientSearchBean, addressSearchBean); + } + + @Override + public List findByRelationShip(String relationIndentier) { + List clients = clientMapper.selectByRelationShip(relationIndentier); + return convert(clients); + } + + @Override + public List findByEmptyServerVersion() { + ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); + clientMetadataExample.createCriteria().andServerVersionIsNull(); + clientMetadataExample.or(clientMetadataExample.createCriteria().andServerVersionEqualTo(0l)); + clientMetadataExample.setOrderByClause("client_id ASC"); + List clients = clientMetadataMapper.selectMany(clientMetadataExample, 0, + DEFAULT_FETCH_SIZE); + return convert(clients); + } + + /** + * {@inheritDoc} + */ + @Override + public List findByServerVersion(long serverVersion, Integer limit) { + ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); + clientMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion).andDateDeletedIsNull(); + clientMetadataExample.setOrderByClause(this.getOrderByClause(SERVER_VERSION, ASCENDING)); + Integer pageLimit = limit == null ? DEFAULT_FETCH_SIZE : limit; + List clients = clientMetadataMapper.selectMany(clientMetadataExample, 0, + pageLimit); + return convert(clients); + } + + /** + * {@inheritDoc} + */ + @Override + public Long countAll(long serverVersion) { + ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); + clientMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion).andDateDeletedIsNull(); + return clientMetadataMapper.countMany(clientMetadataExample); + } + + @Override + public List findByFieldValue(String field, List ids) { + if (field.equals(BASE_ENTITY_ID) && ids != null && !ids.isEmpty()) { + ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); + clientMetadataExample.createCriteria().andBaseEntityIdIn(ids).andDateDeletedIsNull(); + List clients = clientMetadataMapper.selectMany(clientMetadataExample, 0, + DEFAULT_FETCH_SIZE); + return convert(clients); + } + return new ArrayList<>(); + } + + @Override + public List notInOpenMRSByServerVersion(long serverVersion, Calendar calendar) { + long serverStartKey = serverVersion + 1; + long serverEndKey = calendar.getTimeInMillis(); + if (serverStartKey < serverEndKey) { + ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); + clientMetadataExample.createCriteria().andOpenmrsUuidIsNull() + .andServerVersionBetween(serverStartKey, serverEndKey).andDateDeletedIsNull(); + + List clients = clientMetadataMapper.selectMany(clientMetadataExample, 0, + DEFAULT_FETCH_SIZE); + return convert(clients); + } + return new ArrayList<>(); + } + + // Private Methods + @Override + public List convert(List clients) { + if (clients == null || clients.isEmpty()) { + return new ArrayList<>(); + } + + List convertedClients = new ArrayList<>(); + for (org.opensrp.domain.postgres.Client client : clients) { + Client convertedClient = convert(client); + if (convertedClient != null) { + convertedClients.add(convertedClient); + } + } + + return convertedClients; + } + + private Client convert(org.opensrp.domain.postgres.Client client) { + if (client == null || client.getJson() == null || !(client.getJson() instanceof Client)) { + return null; + } + return (Client) client.getJson(); + } + + private org.opensrp.domain.postgres.Client convert(Client client, Long primaryKey) { + if (client == null) { + return null; + } + + org.opensrp.domain.postgres.Client pgClient = new org.opensrp.domain.postgres.Client(); + pgClient.setId(primaryKey); + pgClient.setJson(client); + + return pgClient; + } + + private ClientMetadata createMetadata(Client client, Long clientId) { + try { + ClientMetadata clientMetadata = new ClientMetadata(); + clientMetadata.setDocumentId(client.getId()); + clientMetadata.setBaseEntityId(client.getBaseEntityId()); + if (client.getBirthdate() != null) { + clientMetadata.setBirthDate(client.getBirthdate().toDate()); + } + clientMetadata.setClientId(clientId); + clientMetadata.setFirstName(client.getFirstName()); + clientMetadata.setMiddleName(client.getMiddleName()); + clientMetadata.setLastName(client.getLastName()); + + if (clientId != null) { + clientMetadata.setDateEdited(new Date()); + } + + String relationalId = null; + Map> relationShips = client.getRelationships(); + if (relationShips != null && !relationShips.isEmpty()) { + for (Map.Entry> maEntry : relationShips.entrySet()) { + List values = maEntry.getValue(); + if (values != null && !values.isEmpty()) { + relationalId = values.get(0); + break; + } + } + } + clientMetadata.setRelationalId(relationalId); + + String uniqueId = null; + String openmrsUUID = null; + Map identifiers = client.getIdentifiers(); + if (identifiers != null && !identifiers.isEmpty()) { + for (Map.Entry entry : identifiers.entrySet()) { + String value = entry.getValue(); + if (StringUtils.isNotBlank(value)) { + if (AllConstants.Client.OPENMRS_UUID_IDENTIFIER_TYPE.equalsIgnoreCase(entry.getKey())) { + openmrsUUID = value; + } else { + uniqueId = value; + } + } + } + } + + clientMetadata.setUniqueId(uniqueId); + clientMetadata.setOpenmrsUuid(openmrsUUID); + clientMetadata.setServerVersion(client.getServerVersion()); + if (client.getDateVoided() != null) + clientMetadata.setDateDeleted(client.getDateVoided().toDate()); + Object residence = client.getAttribute(RESIDENCE); + if (residence != null) + clientMetadata.setResidence(residence.toString()); + clientMetadata.setLocationId(client.getLocationId()); + clientMetadata.setClientType(client.getClientType()); + return clientMetadata; + } catch (Exception e) { + logger.error(e.getMessage(), e); + return null; + } + } + + @Override + protected Long retrievePrimaryKey(Client entity) { + return retrievePrimaryKey(entity, false); + } + + /** + * @param entity + * @param allowArchived + * @return + */ + private Long retrievePrimaryKey(Client entity, boolean allowArchived) { + Object uniqueId = getUniqueField(entity); + if (uniqueId == null) { + return null; + } + + String baseEntityId = uniqueId.toString(); + + ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); + Criteria criteria = clientMetadataExample.createCriteria(); + criteria.andBaseEntityIdEqualTo(baseEntityId); + if (!allowArchived) { + criteria.andDateDeletedIsNull(); + } + + org.opensrp.domain.postgres.Client pgClient = clientMetadataMapper.selectOne(clientMetadataExample); + if (pgClient == null) { + return null; + } + return pgClient.getId(); + } + + @Override + protected Object getUniqueField(Client t) { + if (t == null) { + return null; + } + return t.getBaseEntityId(); + } + + @Override + public List selectMemberCountHouseholdHeadProviderByClients(String field, List ids, + String clientType) { + ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); + clientMetadataExample.createCriteria().andRelationalIdIn(ids); + return clientMetadataMapper.selectMemberCountHouseholdHeadProviderByClients(clientMetadataExample, clientType); + } + + @Override + public HouseholdClient findTotalCountHouseholdByCriteria(ClientSearchBean searchBean, + AddressSearchBean addressSearchBean) { + + return clientMetadataMapper.selectHouseholdCountBySearchBean(searchBean, addressSearchBean); + } + + @Override + public List findMembersByRelationshipId(String baseEntityId) { + + List members = new ArrayList(); + if (!StringUtils.isBlank(baseEntityId)) { + members = clientMetadataMapper.selectMembersByRelationshipId(baseEntityId); + } + return customClientConvert(members); + } + + @Override + public List findAllClientsByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { + int pageSize = searchBean.getPageSize(); + if (pageSize == 0) { + pageSize = DEFAULT_FETCH_SIZE; + } + + int offset = searchBean.getPageNumber() * pageSize; + + List clients = clientMetadataMapper.selectAllClientsBySearchBean(searchBean, addressSearchBean, offset, + pageSize); + return customClientConvert(clients); + } + + private Client customClientConvert(CustomClient customClient) { + + if (customClient == null || customClient.getJson() == null || !(customClient.getJson() instanceof Client)) { + return null; + } + + Client cl = (Client) customClient.getJson(); + cl.addAttribute("dynamicProperties", customClient.getDynamicProperties()); + return cl; + } + + protected List customClientConvert(List clients) { + if (clients == null || clients.isEmpty()) { + return new ArrayList<>(); + } + + List convertedClients = new ArrayList<>(); + for (CustomClient client : clients) { + Client convertedClient = customClientConvert(client); + if (convertedClient != null) { + convertedClients.add(convertedClient); + } + } + + return convertedClients; + } + + @Override + public HouseholdClient findCountAllClientsByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { + + return clientMetadataMapper.selectCountAllClientsBySearchBean(searchBean, addressSearchBean); + } + + @Override + public List findHouseholdByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { + Map pageSizeAndOffset = getPageSizeAndOffset(searchBean); + return customClientConvert(clientMetadataMapper.selectHouseholdBySearchBean(searchBean, addressSearchBean, + pageSizeAndOffset.get("offset"), pageSizeAndOffset.get("pageSize"))); + } + + @Override + public List findANCByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { + Map pageSizeAndOffset = getPageSizeAndOffset(searchBean); + List clients = clientMetadataMapper.selectANCBySearchBean(searchBean, addressSearchBean, + pageSizeAndOffset.get("offset"), pageSizeAndOffset.get("pageSize")); + return customClientConvert(clients); + } + + @Override + public int findCountANCByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { + return clientMetadataMapper.selectCountANCBySearchBean(searchBean, addressSearchBean); + } + + @Override + public List findChildByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { + Map pageSizeAndOffset = getPageSizeAndOffset(searchBean); + List clients = clientMetadataMapper.selectChildBySearchBean(searchBean, addressSearchBean, + pageSizeAndOffset.get("offset"), pageSizeAndOffset.get("pageSize")); + return customClientConvert(clients); + } + + @Override + public int findCountChildByCriteria(ClientSearchBean searchBean, AddressSearchBean addressSearchBean) { + return clientMetadataMapper.selectCountChildBySearchBean(searchBean, addressSearchBean); + } + + private Map getPageSizeAndOffset(ClientSearchBean searchBean) { + Map pageSizeAndOffset = new HashMap<>(); + int pageSize = searchBean.getPageSize(); + if (pageSize == 0) { + pageSize = DEFAULT_FETCH_SIZE; + } + + int offset = searchBean.getPageNumber() * pageSize; + pageSizeAndOffset.put("pageSize", pageSize); + pageSizeAndOffset.put("offset", offset); + return pageSizeAndOffset; + + } + + /** + * Method should be used only during Unit testing Deletes all existing records + */ + public void removeAll() { + clientMetadataMapper.deleteByExample(new ClientMetadataExample()); + clientMapper.deleteByExample(new ClientExample()); + + } + + /** + * {@inheritDoc} + */ + @Override + public Pair, Long> findAllIds(long serverVersion, int limit, boolean isArchived) { + Long lastServerVersion = null; + ClientMetadataExample example = new ClientMetadataExample(); + Criteria criteria = example.createCriteria(); + criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); + + if (isArchived) { + criteria.andDateDeletedIsNotNull(); + } else { + criteria.andDateDeletedIsNull(); + } + + return getClientListLongPair(limit, lastServerVersion, example); + } + + @Override + public Pair, Long> findAllIds(long serverVersion, int limit, boolean isArchived, Date fromDate, + Date toDate) { + if (toDate == null && fromDate == null) { + return findAllIds(serverVersion, limit, isArchived); + } else { + Long lastServerVersion = null; + ClientMetadataExample example = new ClientMetadataExample(); + Criteria criteria = example.createCriteria(); + criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); + if (isArchived) { + criteria.andDateDeletedIsNotNull(); + } else { + criteria.andDateDeletedIsNull(); + } + + if (toDate != null && fromDate != null) { + criteria.andDateCreatedBetween(fromDate, toDate); + } else if (fromDate != null) { + criteria.andDateCreatedGreaterThanOrEqualTo(fromDate); + } else { + criteria.andDateCreatedLessThanOrEqualTo(toDate); + } + + return getClientListLongPair(limit, lastServerVersion, example); + } + } + + private Pair, Long> getClientListLongPair(int limit, Long lastServerVersion, + ClientMetadataExample example) { + Long serverVersion = lastServerVersion; + ClientMetadataExample clientMetadataExample = example; + int fetchLimit = limit > 0 ? limit : DEFAULT_FETCH_SIZE; + + List clientIdentifiers = clientMetadataMapper.selectManyIds(clientMetadataExample, 0, fetchLimit); + + if (clientIdentifiers != null && !clientIdentifiers.isEmpty()) { + clientMetadataExample = new ClientMetadataExample(); + clientMetadataExample.createCriteria().andDocumentIdEqualTo(clientIdentifiers.get(clientIdentifiers.size() - 1)); + List clientMetaDataList = clientMetadataMapper.selectByExample(clientMetadataExample); + + serverVersion = clientMetaDataList != null && !clientMetaDataList.isEmpty() + ? clientMetaDataList.get(0).getServerVersion() + : 0; + } + return Pair.of(clientIdentifiers, serverVersion); + } + + @Override + public List findClientById(String id) { + Client client = get(id); + return client == null ? Collections.emptyList() : convertToFHIR(Collections.singletonList(client)); + } + + @Override + public List findFamilyByJurisdiction(String jurisdiction) { + + List baseEntityIds = eventsRepository.findBaseEntityIdsByLocation(jurisdiction); + ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); + if (baseEntityIds.isEmpty()) + return Collections.emptyList(); + clientMetadataExample.createCriteria().andBaseEntityIdIn(baseEntityIds).andDateDeletedIsNull() + .andLastNameEqualTo("Family"); + return convertToFHIR(convert(clientMetadataMapper.selectMany(clientMetadataExample, 0, 20000))); + } + + @Override + public List findFamilyByResidence(String structureId) { + ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); + clientMetadataExample.createCriteria().andResidenceEqualTo(structureId).andDateDeletedIsNull() + .andLastNameEqualTo("Family"); + return convertToFHIR(convert(clientMetadataMapper.selectMany(clientMetadataExample, 0, DEFAULT_FETCH_SIZE))); + } + + @Override + public List findFamilyMemberyByJurisdiction(String jurisdiction) { + List clients = findByLocationIdExclusiveOfType(jurisdiction, "Family"); + return convertToFHIR(clients); + } + + @Override + public List findFamilyMemberByResidence(String structureId) { + ClientMetadataExample clientMetadataExample = new ClientMetadataExample(); + clientMetadataExample.createCriteria().andResidenceEqualTo(structureId).andDateDeletedIsNull() + .andClientTypeNotEqualTo("Family"); + return convertToFHIR(convert(clientMetadataMapper.selectMany(clientMetadataExample, 0, DEFAULT_FETCH_SIZE))); + } + + @Override + public List findClientByRelationship(String relationship, String id) { + return convertToFHIR(findByRelationshipId(relationship, id)); + } + + @Override + public List findByClientTypeAndLocationId(String clientType, String locationId) { + List clients = clientMetadataMapper.selectByLocationIdOfType(clientType, + locationId); + return convert(clients); + } + + @Override + public List findByLocationIdExclusiveOfType(String locationId, String clientType) { + List clients = clientMetadataMapper.selectByLocationIdAndNotOfType(locationId, + clientType); + return convert(clients); + } + + private List convertToFHIR(List clients) { + return clients.stream().map(client -> ClientConverter.convertClientToPatientResource(client)) + .collect(Collectors.toList()); + } + } diff --git a/src/main/java/org/opensrp/repository/postgres/ErrorTraceRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/ErrorTraceRepositoryImpl.java index fdad264da..1e4c6309b 100644 --- a/src/main/java/org/opensrp/repository/postgres/ErrorTraceRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/ErrorTraceRepositoryImpl.java @@ -14,189 +14,189 @@ @Repository("errorRepositoryPostgres") public class ErrorTraceRepositoryImpl extends BaseRepositoryImpl implements ErrorTraceRepository { - - public final static String SOLVED = "solved"; - - public final static String UNSOLVED = "unsolved"; - - @Autowired - private CustomErrorTraceMapper errorTraceMapper; - - @Override - public ErrorTrace get(String id) { - ErrorTraceExample example = new ErrorTraceExample(); - example.createCriteria().andDocumentIdEqualTo(id); - List errors = errorTraceMapper.selectByExample(example); - if (!errors.isEmpty()) - return convert(errors.get(0)); - else - return null; - } - - @Override - public void add(ErrorTrace entity) { - if (entity == null || entity.getStackTrace() == null) { - return; - } - - if (retrievePrimaryKey(entity) != null) { //ErrorTrace already added - return; - } - - if (entity.getId() == null || entity.getId().isEmpty()) - entity.setId(UUID.randomUUID().toString()); - setRevision(entity); - - org.opensrp.domain.postgres.ErrorTrace pgErrorTrace = convert(entity, null); - if (pgErrorTrace == null) { - return; - } - - errorTraceMapper.insertSelective(pgErrorTrace); - - } - - @Override - public void update(ErrorTrace entity) { - if (getUniqueField(entity) == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - - if (id == null) { //ErrorTrace doesn't not exist - return; - } - setRevision(entity); - - org.opensrp.domain.postgres.ErrorTrace pgErrorTrace = convert(entity, id); - errorTraceMapper.updateByPrimaryKey(pgErrorTrace); - } - - @Override - public List getAll() { - return convert(errorTraceMapper.selectMany(new ErrorTraceExample(), 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public void safeRemove(ErrorTrace entity) { - if (getUniqueField(entity) == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { - return; - } - - errorTraceMapper.deleteByPrimaryKey(id); - - } - - @Override - public ErrorTrace findById(String _id) { - return get(_id); - } - - @Override - public boolean exists(String id) { - return get(id) != null; - } - - @Override - public List findAllErrors() { - return getAll(); - } - - @Override - public List findAllUnSolvedErrors() { - ErrorTraceExample example = new ErrorTraceExample(); - example.createCriteria().andStatusEqualTo(UNSOLVED); - example.or(example.createCriteria().andStatusIsNull()); - example.or(example.createCriteria().andStatusEqualTo("")); - return convert(errorTraceMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findAllSolvedErrors() { - ErrorTraceExample example = new ErrorTraceExample(); - example.createCriteria().andStatusEqualTo(SOLVED); - return convert(errorTraceMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - protected Long retrievePrimaryKey(ErrorTrace errorTrace) { - if (getUniqueField(errorTrace) == null) { - return null; - } - String documentId = errorTrace.getId(); - - ErrorTraceExample example = new ErrorTraceExample(); - example.createCriteria().andDocumentIdEqualTo(documentId); - List errors = errorTraceMapper.selectByExample(example); - return errors.isEmpty() ? null : errors.get(0).getId(); - } - - @Override - protected Object getUniqueField(ErrorTrace errorTrace) { - return errorTrace == null || errorTrace.getId() == null ? null : errorTrace.getId(); - } - - //private Methods - private ErrorTrace convert(org.opensrp.domain.postgres.ErrorTrace pgEntity) { - ErrorTrace entity = new ErrorTrace(); - entity.setId(pgEntity.getDocumentId()); - if (pgEntity.getDateOccurred() != null) - entity.setDateOccurred(new DateTime(pgEntity.getDateOccurred())); - entity.setErrorType(pgEntity.getErrorType()); - entity.setOccurredAt(pgEntity.getOccurredAt()); - entity.setStackTrace(pgEntity.getStackTrace()); - entity.setStatus(pgEntity.getStatus()); - entity.setDateClosed(pgEntity.getDateClosed()); - entity.setDocumentType(pgEntity.getDocumentType()); - entity.setRecordId(pgEntity.getRecordId()); - entity.setRetryUrl(pgEntity.getRetryUrl()); - return entity; - } - - private org.opensrp.domain.postgres.ErrorTrace convert(ErrorTrace entity, Long id) { - org.opensrp.domain.postgres.ErrorTrace pgEntity = new org.opensrp.domain.postgres.ErrorTrace(); - pgEntity.setId(id); - pgEntity.setDocumentId(entity.getId()); - if (entity.getDateOccurred() != null) - pgEntity.setDateOccurred(entity.getDateOccurred().toDate()); - pgEntity.setErrorType(entity.getErrorType()); - pgEntity.setOccurredAt(entity.getOccurredAt()); - pgEntity.setStackTrace(entity.getStackTrace()); - pgEntity.setStatus(entity.getStatus()); - pgEntity.setDateClosed(entity.getDateClosed()); - pgEntity.setDocumentType(entity.getDocumentType()); - pgEntity.setRecordId(entity.getRecordId()); - pgEntity.setRetryUrl(entity.getRetryUrl()); - return pgEntity; - } - - private List convert(List pgErrors) { - if (pgErrors == null || pgErrors.isEmpty()) { - return new ArrayList<>(); - } - List errorTraces = new ArrayList<>(); - for (org.opensrp.domain.postgres.ErrorTrace pgError : pgErrors) { - ErrorTrace error = convert(pgError); - if (error != null) { - errorTraces.add(error); - } - } - - return errorTraces; - } - - /** - * Method should be used only during Unit testing - * Deletes all existing records - */ - public void removeAll() { - errorTraceMapper.deleteByExample(new ErrorTraceExample()); - } + + public final static String SOLVED = "solved"; + + public final static String UNSOLVED = "unsolved"; + + @Autowired + private CustomErrorTraceMapper errorTraceMapper; + + @Override + public ErrorTrace get(String id) { + ErrorTraceExample example = new ErrorTraceExample(); + example.createCriteria().andDocumentIdEqualTo(id); + List errors = errorTraceMapper.selectByExample(example); + if (!errors.isEmpty()) + return convert(errors.get(0)); + else + return null; + } + + @Override + public void add(ErrorTrace entity) { + if (entity == null || entity.getStackTrace() == null) { + return; + } + + if (retrievePrimaryKey(entity) != null) { //ErrorTrace already added + return; + } + + if (entity.getId() == null || entity.getId().isEmpty()) + entity.setId(UUID.randomUUID().toString()); + setRevision(entity); + + org.opensrp.domain.postgres.ErrorTrace pgErrorTrace = convert(entity, null); + if (pgErrorTrace == null) { + return; + } + + errorTraceMapper.insertSelective(pgErrorTrace); + + } + + @Override + public void update(ErrorTrace entity) { + if (getUniqueField(entity) == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + + if (id == null) { //ErrorTrace doesn't not exist + return; + } + setRevision(entity); + + org.opensrp.domain.postgres.ErrorTrace pgErrorTrace = convert(entity, id); + errorTraceMapper.updateByPrimaryKey(pgErrorTrace); + } + + @Override + public List getAll() { + return convert(errorTraceMapper.selectMany(new ErrorTraceExample(), 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public void safeRemove(ErrorTrace entity) { + if (getUniqueField(entity) == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { + return; + } + + errorTraceMapper.deleteByPrimaryKey(id); + + } + + @Override + public ErrorTrace findById(String _id) { + return get(_id); + } + + @Override + public boolean exists(String id) { + return get(id) != null; + } + + @Override + public List findAllErrors() { + return getAll(); + } + + @Override + public List findAllUnSolvedErrors() { + ErrorTraceExample example = new ErrorTraceExample(); + example.createCriteria().andStatusEqualTo(UNSOLVED); + example.or(example.createCriteria().andStatusIsNull()); + example.or(example.createCriteria().andStatusEqualTo("")); + return convert(errorTraceMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findAllSolvedErrors() { + ErrorTraceExample example = new ErrorTraceExample(); + example.createCriteria().andStatusEqualTo(SOLVED); + return convert(errorTraceMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + protected Long retrievePrimaryKey(ErrorTrace errorTrace) { + if (getUniqueField(errorTrace) == null) { + return null; + } + String documentId = errorTrace.getId(); + + ErrorTraceExample example = new ErrorTraceExample(); + example.createCriteria().andDocumentIdEqualTo(documentId); + List errors = errorTraceMapper.selectByExample(example); + return errors.isEmpty() ? null : errors.get(0).getId(); + } + + @Override + protected Object getUniqueField(ErrorTrace errorTrace) { + return errorTrace == null || errorTrace.getId() == null ? null : errorTrace.getId(); + } + + //private Methods + private ErrorTrace convert(org.opensrp.domain.postgres.ErrorTrace pgEntity) { + ErrorTrace entity = new ErrorTrace(); + entity.setId(pgEntity.getDocumentId()); + if (pgEntity.getDateOccurred() != null) + entity.setDateOccurred(new DateTime(pgEntity.getDateOccurred())); + entity.setErrorType(pgEntity.getErrorType()); + entity.setOccurredAt(pgEntity.getOccurredAt()); + entity.setStackTrace(pgEntity.getStackTrace()); + entity.setStatus(pgEntity.getStatus()); + entity.setDateClosed(pgEntity.getDateClosed()); + entity.setDocumentType(pgEntity.getDocumentType()); + entity.setRecordId(pgEntity.getRecordId()); + entity.setRetryUrl(pgEntity.getRetryUrl()); + return entity; + } + + private org.opensrp.domain.postgres.ErrorTrace convert(ErrorTrace entity, Long id) { + org.opensrp.domain.postgres.ErrorTrace pgEntity = new org.opensrp.domain.postgres.ErrorTrace(); + pgEntity.setId(id); + pgEntity.setDocumentId(entity.getId()); + if (entity.getDateOccurred() != null) + pgEntity.setDateOccurred(entity.getDateOccurred().toDate()); + pgEntity.setErrorType(entity.getErrorType()); + pgEntity.setOccurredAt(entity.getOccurredAt()); + pgEntity.setStackTrace(entity.getStackTrace()); + pgEntity.setStatus(entity.getStatus()); + pgEntity.setDateClosed(entity.getDateClosed()); + pgEntity.setDocumentType(entity.getDocumentType()); + pgEntity.setRecordId(entity.getRecordId()); + pgEntity.setRetryUrl(entity.getRetryUrl()); + return pgEntity; + } + + private List convert(List pgErrors) { + if (pgErrors == null || pgErrors.isEmpty()) { + return new ArrayList<>(); + } + List errorTraces = new ArrayList<>(); + for (org.opensrp.domain.postgres.ErrorTrace pgError : pgErrors) { + ErrorTrace error = convert(pgError); + if (error != null) { + errorTraces.add(error); + } + } + + return errorTraces; + } + + /** + * Method should be used only during Unit testing + * Deletes all existing records + */ + public void removeAll() { + errorTraceMapper.deleteByExample(new ErrorTraceExample()); + } } diff --git a/src/main/java/org/opensrp/repository/postgres/EventsRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/EventsRepositoryImpl.java index 618a671e1..192446532 100644 --- a/src/main/java/org/opensrp/repository/postgres/EventsRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/EventsRepositoryImpl.java @@ -30,691 +30,689 @@ @Repository("eventsRepositoryPostgres") public class EventsRepositoryImpl extends BaseRepositoryImpl implements EventsRepository { - - @Autowired - private CustomEventMapper eventMapper; - - @Autowired - private CustomEventMetadataMapper eventMetadataMapper; - - @Override - public Event get(String id) { - if (StringUtils.isBlank(id)) { - return null; - } - org.opensrp.domain.postgres.Event pgEvent = eventMetadataMapper.selectByDocumentId(id); - - return convert(pgEvent); - } - - @Transactional - @Override - public void add(Event entity) { - if (entity == null || entity.getBaseEntityId() == null) { - throw new IllegalArgumentException("Empty event or missing baseEntityId"); - } - - if (retrievePrimaryKey(entity) != null) { // Event already added - throw new IllegalArgumentException("Event exists"); - } - - if (entity.getId() == null || entity.getId().isEmpty()) - entity.setId(UUID.randomUUID().toString()); - setRevision(entity); - - org.opensrp.domain.postgres.Event pgEvent = convert(entity, null); - if (pgEvent == null) { - throw new IllegalStateException(); - } - - int rowsAffected = eventMapper.insertSelectiveAndSetId(pgEvent); - if (rowsAffected < 1 || pgEvent.getId() == null) { - throw new IllegalStateException(); - } - - updateServerVersion(pgEvent, entity); - - EventMetadata eventMetadata = createMetadata(entity, pgEvent.getId()); - if (eventMetadata != null) { - eventMetadataMapper.insertSelective(eventMetadata); - } - - } - - private void updateServerVersion(org.opensrp.domain.postgres.Event pgEvent, Event entity) { - long serverVersion = eventMapper.selectServerVersionByPrimaryKey(pgEvent.getId()); - entity.setServerVersion(serverVersion); - pgEvent.setJson(entity); - pgEvent.setServerVersion(null); - int rowsAffected = eventMapper.updateByPrimaryKeySelective(pgEvent); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - } - - @Override - public void update(Event entity) { - update(entity, false); - } - - @Transactional - @Override - public void update(Event entity, boolean allowArchived) { - if (entity == null || entity.getBaseEntityId() == null) { - throw new IllegalStateException(); - } - - Long id = retrievePrimaryKey(entity, allowArchived); - if (id == null) { // Event not added - throw new IllegalStateException(); - } - - setRevision(entity); - - org.opensrp.domain.postgres.Event pgEvent = convert(entity, id); - if (pgEvent == null) { - throw new IllegalStateException(); - } - - int rowsAffected = eventMapper.updateByPrimaryKeyAndGenerateServerVersion(pgEvent); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - - updateServerVersion(pgEvent, entity); - - EventMetadata eventMetadata = createMetadata(entity, id); - if (eventMetadata == null) { - throw new IllegalStateException(); - } - - EventMetadataExample eventMetadataExample = new EventMetadataExample(); - Criteria criteria = eventMetadataExample.createCriteria(); - criteria.andEventIdEqualTo(id); - if (!allowArchived) { - criteria.andDateDeletedIsNull(); - } - eventMetadata.setId(eventMetadataMapper.selectByExample(eventMetadataExample).get(0).getId()); - eventMetadataMapper.updateByPrimaryKey(eventMetadata); - - } - - @Override - public List getAll() { - EventMetadataExample eventMetadataExample = new EventMetadataExample(); - eventMetadataExample.createCriteria().andDateDeletedIsNull(); - List events = eventMetadataMapper.selectManyWithRowBounds(eventMetadataExample, 0, - DEFAULT_FETCH_SIZE); - return convert(events); - } - - @Override - public void safeRemove(Event entity) { - if (entity == null || entity.getBaseEntityId() == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { - return; - } - - Date dateDeleted = entity.getDateVoided() == null ? new Date() : entity.getDateVoided().toDate(); - EventMetadata eventMetadata = new EventMetadata(); - eventMetadata.setDateDeleted(dateDeleted); - - EventMetadataExample eventMetadataExample = new EventMetadataExample(); - eventMetadataExample.createCriteria().andEventIdEqualTo(id).andDateDeletedIsNull(); - int rowsAffected = eventMetadataMapper.updateByExampleSelective(eventMetadata, eventMetadataExample); - if (rowsAffected < 1) { - return; - } - - org.opensrp.domain.postgres.Event pgEvent = new org.opensrp.domain.postgres.Event(); - pgEvent.setId(id); - pgEvent.setDateDeleted(dateDeleted); - eventMapper.updateByPrimaryKeySelective(pgEvent); - - } - - @Override - public List findAllByIdentifier(String identifier) { - List events = eventMapper.selectByIdentifier(identifier); - return convert(events); - } - - @Override - public List findAllByIdentifier(String identifierType, String identifier) { - List events = eventMapper.selectByIdentifierOfType(identifierType, identifier); - return convert(events); - } - - @Override - public Event findById(String id) { - return get(id); - } - - @Override - public Event findByFormSubmissionId(String formSubmissionId, boolean includeArchived) { - if (StringUtils.isBlank(formSubmissionId)) { - return null; - } - EventMetadataExample example = new EventMetadataExample(); - Criteria criteria = example.createCriteria().andFormSubmissionIdEqualTo(formSubmissionId); - if (!includeArchived) - criteria.andDateDeletedIsNull(); - List events = eventMetadataMapper.selectMany(example); - if (events.size() > 1) { - throw new IllegalStateException("Multiple events for formSubmissionId " + formSubmissionId); - } else if (!events.isEmpty()) - return convert(events.get(0)); - else - return null; - } - - @Override - public List findByBaseEntityId(String baseEntityId) { - EventMetadataExample example = new EventMetadataExample(); - example.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andDateDeletedIsNull(); - return convert(eventMetadataMapper.selectMany(example)); - } - - @Override - public Event findByBaseEntityAndFormSubmissionId(String baseEntityId, String formSubmissionId) { - EventMetadataExample example = new EventMetadataExample(); - example.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andFormSubmissionIdEqualTo(formSubmissionId) - .andDateDeletedIsNull(); - List events = eventMetadataMapper.selectMany(example); - if (events.size() > 1) { - throw new IllegalStateException("Multiple events for baseEntityId and formSubmissionId combination (" - + baseEntityId + "," + formSubmissionId + ")"); - } else if (!events.isEmpty()) - return convert(events.get(0)); - else - return null; - } - - @Override - public List findByBaseEntityAndType(String baseEntityId, String eventType) { - EventMetadataExample example = new EventMetadataExample(); - example.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andEventTypeEqualTo(eventType).andDateDeletedIsNull(); - return convert(eventMetadataMapper.selectMany(example)); - } - - @Override - public List findEvents(EventSearchBean eventSearchBean) { - EventMetadataExample example = new EventMetadataExample(); - Criteria criteria = example.createCriteria(); - if (StringUtils.isNotEmpty(eventSearchBean.getBaseEntityId())) - criteria.andBaseEntityIdEqualTo(eventSearchBean.getBaseEntityId()); - if (eventSearchBean.getEventDateFrom() != null && eventSearchBean.getEventDateTo() != null) - criteria.andEventDateBetween(eventSearchBean.getEventDateFrom().toDate(), - eventSearchBean.getEventDateTo().toDate()); - if (StringUtils.isNotEmpty(eventSearchBean.getEventType())) - criteria.andEventTypeEqualTo(eventSearchBean.getEventType()); - if (StringUtils.isNotEmpty(eventSearchBean.getEntityType())) - criteria.andEntityTypeEqualTo(eventSearchBean.getEntityType()); - if (StringUtils.isNotEmpty(eventSearchBean.getProviderId())) - criteria.andProviderIdEqualTo(eventSearchBean.getProviderId()); - if (StringUtils.isNotEmpty(eventSearchBean.getLocationId())) - criteria.andLocationIdEqualTo(eventSearchBean.getLocationId()); - if (eventSearchBean.getLastEditFrom() != null && eventSearchBean.getLastEditTo() != null) - criteria.andDateEditedBetween(eventSearchBean.getLastEditFrom().toDate(), - eventSearchBean.getLastEditTo().toDate()); - if (StringUtils.isNotEmpty(eventSearchBean.getTeam())) - criteria.andTeamEqualTo(eventSearchBean.getTeam()); - if (StringUtils.isNotEmpty(eventSearchBean.getTeamId())) - criteria.andTeamIdEqualTo(eventSearchBean.getTeamId()); - if (!criteria.isValid()) - throw new IllegalArgumentException("Atleast one search filter must be specified"); - criteria.andDateDeletedIsNull(); - return convert(eventMetadataMapper.selectManyWithRowBounds(example, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findEventsByDynamicQuery(String query) { - throw new IllegalArgumentException("Dynamic query feature not supported"); - } - - @Override - public List findByServerVersion(long serverVersion) { - EventMetadataExample example = new EventMetadataExample(); - example.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion + 1); - return convert(eventMetadataMapper.selectManyWithRowBounds(example, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List notInOpenMRSByServerVersion(long serverVersion, Calendar calendar) { - return convert(eventMetadataMapper.selectNotInOpenMRSByServerVersion(serverVersion, calendar.getTimeInMillis(), - DEFAULT_FETCH_SIZE)); - } - - @Override - public List notInOpenMRSByServerVersionAndType(String type, long serverVersion, Calendar calendar) { - return convert(eventMetadataMapper.selectNotInOpenMRSByServerVersionAndType(type, serverVersion, - calendar.getTimeInMillis(), DEFAULT_FETCH_SIZE)); - } - - @Override - public List findByClientAndConceptAndDate(String baseEntityId, String concept, String conceptValue, - String dateFrom, String dateTo) { - if (StringUtils.isBlank(baseEntityId) && StringUtils.isBlank(concept) && StringUtils.isBlank(conceptValue)) - return new ArrayList(); - Date from = null; - Date to = null; - if (StringUtils.isNotEmpty(dateFrom)) - from = new DateTime(dateFrom).toDate(); - if (StringUtils.isNotEmpty(dateTo)) - to = new DateTime(dateTo).toDate(); - return convert(eventMapper.selectByBaseEntityIdConceptAndDate(baseEntityId, concept, conceptValue, from, to)); - } - - @Override - public List findByBaseEntityIdAndConceptParentCode(String baseEntityId, String concept, String parentCode) { - if (StringUtils.isBlank(baseEntityId) && StringUtils.isBlank(concept) && StringUtils.isBlank(parentCode)) - return new ArrayList(); - return convert(eventMapper.selectByBaseEntityIdAndConceptParentCode(baseEntityId, concept, parentCode)); - } - - @Override - public List findByConceptAndValue(String concept, String conceptValue) { - if (StringUtils.isBlank(concept) && StringUtils.isBlank(conceptValue)) - return new ArrayList(); - return convert(eventMapper.selectByConceptAndValue(concept, conceptValue)); - } - - @Override - public List findByEmptyServerVersion() { - EventMetadataExample example = new EventMetadataExample(); - example.createCriteria().andServerVersionIsNull(); - example.or(example.createCriteria().andServerVersionEqualTo(0l)); - return convert(eventMetadataMapper.selectManyWithRowBounds(example, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findEvents(EventSearchBean eventSearchBean, String sortBy, String sortOrder, int limit) { - EventMetadataExample example = new EventMetadataExample(); - Criteria criteria = populateEventSearchCriteria(eventSearchBean, example); - - criteria.andDateDeletedIsNull(); - example.setOrderByClause(getOrderByClause(sortBy, sortOrder)); - return convert(eventMetadataMapper.selectManyWithRowBounds(example, 0, limit)); - } - - private Criteria populateEventSearchCriteria(EventSearchBean eventSearchBean, EventMetadataExample example) { - Criteria criteria = example.createCriteria(); - - addTeamCriteria(criteria, eventSearchBean); - - addTeamIdCriteria(criteria, eventSearchBean); - - addProviderIdCriteria(criteria, eventSearchBean); - - addLocationIdCriteria(criteria, eventSearchBean); - - addBaseEntityCriteria(criteria, eventSearchBean); - - if (eventSearchBean.getServerVersion() != null) - criteria.andServerVersionGreaterThanOrEqualTo(eventSearchBean.getServerVersion()); - - if (StringUtils.isNotEmpty(eventSearchBean.getEventType())) - criteria.andEventTypeEqualTo(eventSearchBean.getEventType()); - - if (!criteria.isValid()) - throw new IllegalArgumentException("Atleast one search filter must be specified"); - return criteria; - } - - private void addTeamCriteria(Criteria criteria, EventSearchBean eventSearchBean) { - if (StringUtils.isNotEmpty(eventSearchBean.getTeam())) { - if (eventSearchBean.getTeam().contains(",")) { - String[] teamsArray = org.apache.commons.lang.StringUtils.split(eventSearchBean.getTeam(), ","); - criteria.andTeamIn(Arrays.asList(teamsArray)); - } else { - criteria.andTeamEqualTo(eventSearchBean.getTeam()); - } - } - } - - private void addTeamIdCriteria(Criteria criteria, EventSearchBean eventSearchBean) { - if (StringUtils.isNotEmpty(eventSearchBean.getTeamId())) { - if (eventSearchBean.getTeamId().contains(",")) { - String[] teamsArray = org.apache.commons.lang.StringUtils.split(eventSearchBean.getTeamId(), ","); - criteria.andTeamIdIn(Arrays.asList(teamsArray)); - } else { - criteria.andTeamIdEqualTo(eventSearchBean.getTeamId()); - } - } - } - - private void addProviderIdCriteria(Criteria criteria, EventSearchBean eventSearchBean) { - if (StringUtils.isNotEmpty(eventSearchBean.getProviderId())) { - if (eventSearchBean.getProviderId().contains(",")) { - String[] providersArray = org.apache.commons.lang.StringUtils.split(eventSearchBean.getProviderId(), ","); - criteria.andProviderIdIn(Arrays.asList(providersArray)); - } else { - criteria.andProviderIdEqualTo(eventSearchBean.getProviderId()); - } - } - } - - private void addLocationIdCriteria(Criteria criteria, EventSearchBean eventSearchBean) { - if (StringUtils.isNotEmpty(eventSearchBean.getLocationId())) { - if (eventSearchBean.getLocationId().contains(",")) { - String[] locationArray = org.apache.commons.lang.StringUtils.split(eventSearchBean.getLocationId(), ","); - criteria.andLocationIdIn(Arrays.asList(locationArray)); - } else { - criteria.andLocationIdEqualTo(eventSearchBean.getLocationId()); - } - } - } - - private void addBaseEntityCriteria(Criteria criteria, EventSearchBean eventSearchBean) { - if (StringUtils.isNotEmpty(eventSearchBean.getBaseEntityId())) { - if (eventSearchBean.getBaseEntityId().contains(",")) { - String[] idsArray = org.apache.commons.lang.StringUtils.split(eventSearchBean.getBaseEntityId(), ","); - criteria.andBaseEntityIdIn(Arrays.asList(idsArray)); - } else { - criteria.andBaseEntityIdEqualTo(eventSearchBean.getBaseEntityId()); - } - } - } - - /** - * {@inheritDoc} - */ - @Override - public Long countEvents(EventSearchBean eventSearchBean) { - EventMetadataExample example = new EventMetadataExample(); - Criteria criteria = populateEventSearchCriteria(eventSearchBean, example); - criteria.andDateDeletedIsNull(); - return eventMetadataMapper.countByExample(example); - } - - /** - * Compatibility method inherited from couch to fetch events of a given type within the current - * month - * - * @param eventType the type of event to query - * @return list of events of given type within the current month - */ - @Override - public List findEventByEventTypeBetweenTwoDates(String eventType) { - Calendar calendar = Calendar.getInstance(); - calendar.set(Calendar.DATE, 1); - calendar.set(Calendar.HOUR, 0); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.MILLISECOND, 0); - EventMetadataExample example = new EventMetadataExample(); - example.createCriteria().andEventTypeEqualTo(eventType) - .andDateCreatedBetween(calendar.getTime(),new Date()).andDateDeletedIsNull(); - return convert(eventMetadataMapper.selectManyWithRowBounds(example, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findByProvider(String provider) { - EventMetadataExample example = new EventMetadataExample(); - example.createCriteria().andProviderIdEqualTo(provider); - return convert(eventMetadataMapper.selectManyWithRowBounds(example, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public Pair, Long> findIdsByEventType(String eventType, boolean isDeleted, Long serverVersion, int limit) { - Long lastServerVersion = null; - EventMetadataExample example = new EventMetadataExample(); - Criteria criteria = example.createCriteria(); - criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); - - if (!StringUtils.isBlank(eventType)) { - criteria.andEventTypeEqualTo(eventType); - } - - if (isDeleted) { - criteria.andDateDeletedIsNotNull(); - } else { - criteria.andDateDeletedIsNull(); - } - - example.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - - return getEventListLongPair(limit, lastServerVersion, example); - } - - @Override - public Pair, Long> findIdsByEventType(String eventType, boolean isDeleted, Long serverVersion, int limit, - Date fromDate, Date toDate) { - if (fromDate == null && toDate == null) { - return findIdsByEventType(eventType, isDeleted, serverVersion, limit); - } else { - Long lastServerVersion = null; - EventMetadataExample example = new EventMetadataExample(); - Criteria criteria = example.createCriteria(); - criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); - example.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - - if (!StringUtils.isBlank(eventType)) { - criteria.andEventTypeEqualTo(eventType); - } - - if (isDeleted) { - criteria.andDateDeletedIsNotNull(); - } else { - criteria.andDateDeletedIsNull(); - } - - if (fromDate != null && toDate != null) { - criteria.andDateCreatedBetween(fromDate, toDate); - } else if (fromDate != null) { - criteria.andDateCreatedGreaterThanOrEqualTo(fromDate); - } else { - criteria.andDateCreatedLessThanOrEqualTo(toDate); - } - - return getEventListLongPair(limit, lastServerVersion, example); - } - } - - private Pair, Long> getEventListLongPair(int limit, Long lastServerVersion, EventMetadataExample example) { - int fetchLimit = limit > 0 ? limit : DEFAULT_FETCH_SIZE; - - Long serverVersion = lastServerVersion; - EventMetadataExample eventMetadataExample = example; - List eventIdentifiers = eventMetadataMapper.selectManyIds(eventMetadataExample, 0, fetchLimit); - - if (eventIdentifiers != null && !eventIdentifiers.isEmpty()) { - eventMetadataExample = new EventMetadataExample(); - eventMetadataExample.createCriteria().andDocumentIdEqualTo(eventIdentifiers.get(eventIdentifiers.size() - 1)); - List eventMetaDataList = eventMetadataMapper.selectByExample(eventMetadataExample); - - serverVersion = eventMetaDataList != null && !eventMetaDataList.isEmpty() - ? eventMetaDataList.get(0).getServerVersion() - : 0; - } - return Pair.of(eventIdentifiers, serverVersion); - } - - @Override - public List findBaseEntityIdsByLocation(String locationId) { - EventMetadataExample example = new EventMetadataExample(); - Criteria criteria = example.createCriteria(); - criteria.andLocationIdEqualTo(locationId); - example.setDistinct(true); - return eventMetadataMapper.selectManyBaseEntityIds(example); - } - - /** - * - * @param planIdentifier - * @param eventType - * @param fromDate - * @param toDate - * @return - */ - - @Override - public List getEventData(String planIdentifier, String eventType, Date fromDate, - Date toDate) { - EventMetadataExample eventMetadataExample = new EventMetadataExample(); - EventMetadataExample.Criteria criteria = eventMetadataExample.createCriteria(); - criteria.andPlanIdentifierEqualTo(planIdentifier).andEventTypeEqualTo(eventType).andDateDeletedIsNull(); - if (fromDate != null) { - criteria.andDateCreatedGreaterThanOrEqualTo(fromDate); - } - if (toDate != null) { - criteria.andDateCreatedLessThanOrEqualTo(toDate); - } - return eventMetadataMapper.selectManyWithRowBounds(eventMetadataExample, 0, DEFAULT_FETCH_SIZE); - } - - /** - * Gets events for a entity with details values - * - * @param baseEntityId entity id - * @param planIdentifier plan id - * @return events for an entity in a plan - */ - private List findByBaseEntityIdAndPlanIdentifier(String baseEntityId, String planIdentifier) { - return convert(eventMetadataMapper.selectByBaseEntityIdAndPlanIdentifier(baseEntityId, planIdentifier)); - } - - /** - * Get the primary key of an event - * - * @param event - * @param allowArchived - * @return the promary key - */ - private Long retrievePrimaryKey(Event event, boolean allowArchived) { - Object uniqueId = getUniqueField(event); - if (uniqueId == null) { - return null; - } - - String documentId = uniqueId.toString(); - - EventMetadataExample eventMetadataExample = new EventMetadataExample(); - Criteria criteria = eventMetadataExample.createCriteria(); - criteria.andDocumentIdEqualTo(documentId); - if (!allowArchived) { - criteria.andDateDeletedIsNull(); - } - - return eventMetadataMapper.selectPrimaryKey(eventMetadataExample); - - } - - @Override - protected Long retrievePrimaryKey(Event event) { - return retrievePrimaryKey(event, false); - } - - @Override - protected Object getUniqueField(Event t) { - if (t == null) { - return null; - } - return t.getId(); - } - - // Private Methods - private Event convert(org.opensrp.domain.postgres.Event event) { - if (event == null || event.getJson() == null || !(event.getJson() instanceof Event)) { - return null; - } - return (Event) event.getJson(); - } - - private org.opensrp.domain.postgres.Event convert(Event event, Long primaryKey) { - if (event == null) { - return null; - } - - org.opensrp.domain.postgres.Event pgEvent = new org.opensrp.domain.postgres.Event(); - pgEvent.setId(primaryKey); - pgEvent.setJson(event); - - return pgEvent; - } - - private List convert(List events) { - if (events == null || events.isEmpty()) { - return new ArrayList<>(); - } - - List convertedEvents = new ArrayList<>(); - for (org.opensrp.domain.postgres.Event event : events) { - Event convertedEvent = convert(event); - if (convertedEvent != null) { - convertedEvents.add(convertedEvent); - } - } - - return convertedEvents; - } - - private EventMetadata createMetadata(Event event, Long eventId) { - try { - EventMetadata eventMetadata = new EventMetadata(); - eventMetadata.setBaseEntityId(event.getBaseEntityId()); - eventMetadata.setEventId(eventId); - eventMetadata.setDocumentId(event.getId()); - eventMetadata.setBaseEntityId(event.getBaseEntityId()); - eventMetadata.setFormSubmissionId(event.getFormSubmissionId()); - eventMetadata.setOpenmrsUuid(event.getIdentifier(AllConstants.Client.OPENMRS_UUID_IDENTIFIER_TYPE)); - eventMetadata.setEventType(event.getEventType()); - if (event.getEventDate() != null) - eventMetadata.setEventDate(event.getEventDate().toDate()); - eventMetadata.setEntityType(event.getEntityType()); - eventMetadata.setProviderId(event.getProviderId()); - eventMetadata.setLocationId(event.getLocationId()); - eventMetadata.setTeam(event.getTeam()); - eventMetadata.setTeamId(event.getTeamId()); - eventMetadata.setServerVersion(event.getServerVersion()); - if (event.getDateCreated() != null) - eventMetadata.setDateCreated(event.getDateCreated().toDate()); - if (event.getDateEdited() != null) - eventMetadata.setDateEdited(event.getDateEdited().toDate()); - if (event.getDateVoided() != null) - eventMetadata.setDateDeleted(event.getDateVoided().toDate()); - String planIdentifier = event.getDetails() != null ? event.getDetails().get("planIdentifier") : null; - eventMetadata.setPlanIdentifier(planIdentifier); - return eventMetadata; - } - catch (Exception e) { - logger.error(e.getMessage(), e); - return null; - } - } - - /** - * Method should be used only during Unit testing Deletes all existing records - */ - public void removeAll() { - eventMetadataMapper.deleteByExample(new EventMetadataExample()); - eventMapper.deleteByExample(new EventExample()); - - } - - @Override - public List findEventsByEntityIdAndPlan(String resourceId, String planIdentifier) { - return findByBaseEntityIdAndPlanIdentifier(resourceId, planIdentifier).stream() - .map(event -> EventConverter.convertEventToEncounterResource(event)).collect(Collectors.toList()); - } - - @Override - public List findEventsByJurisdictionIdAndPlan(String jurisdictionId, String planIdentifier) { - EventMetadataExample example = new EventMetadataExample(); - example.createCriteria().andLocationIdEqualTo(jurisdictionId).andPlanIdentifierEqualTo(planIdentifier) - .andDateDeletedIsNull(); - - /**@formatter:off*/ - return eventMetadataMapper.selectMany(example) - .stream() - .map(event -> convert(event)) - .map(event -> EventConverter.convertEventToEncounterResource(event)) - .collect(Collectors.toList()); - /**@formatter:on*/ - } - - + + @Autowired + private CustomEventMapper eventMapper; + + @Autowired + private CustomEventMetadataMapper eventMetadataMapper; + + @Override + public Event get(String id) { + if (StringUtils.isBlank(id)) { + return null; + } + org.opensrp.domain.postgres.Event pgEvent = eventMetadataMapper.selectByDocumentId(id); + + return convert(pgEvent); + } + + @Transactional + @Override + public void add(Event entity) { + if (entity == null || entity.getBaseEntityId() == null) { + throw new IllegalArgumentException("Empty event or missing baseEntityId"); + } + + if (retrievePrimaryKey(entity) != null) { // Event already added + throw new IllegalArgumentException("Event exists"); + } + + if (entity.getId() == null || entity.getId().isEmpty()) + entity.setId(UUID.randomUUID().toString()); + setRevision(entity); + + org.opensrp.domain.postgres.Event pgEvent = convert(entity, null); + if (pgEvent == null) { + throw new IllegalStateException(); + } + + int rowsAffected = eventMapper.insertSelectiveAndSetId(pgEvent); + if (rowsAffected < 1 || pgEvent.getId() == null) { + throw new IllegalStateException(); + } + + updateServerVersion(pgEvent, entity); + + EventMetadata eventMetadata = createMetadata(entity, pgEvent.getId()); + if (eventMetadata != null) { + eventMetadataMapper.insertSelective(eventMetadata); + } + + } + + private void updateServerVersion(org.opensrp.domain.postgres.Event pgEvent, Event entity) { + long serverVersion = eventMapper.selectServerVersionByPrimaryKey(pgEvent.getId()); + entity.setServerVersion(serverVersion); + pgEvent.setJson(entity); + pgEvent.setServerVersion(null); + int rowsAffected = eventMapper.updateByPrimaryKeySelective(pgEvent); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + } + + @Override + public void update(Event entity) { + update(entity, false); + } + + @Transactional + @Override + public void update(Event entity, boolean allowArchived) { + if (entity == null || entity.getBaseEntityId() == null) { + throw new IllegalStateException(); + } + + Long id = retrievePrimaryKey(entity, allowArchived); + if (id == null) { // Event not added + throw new IllegalStateException(); + } + + setRevision(entity); + + org.opensrp.domain.postgres.Event pgEvent = convert(entity, id); + if (pgEvent == null) { + throw new IllegalStateException(); + } + + int rowsAffected = eventMapper.updateByPrimaryKeyAndGenerateServerVersion(pgEvent); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + + updateServerVersion(pgEvent, entity); + + EventMetadata eventMetadata = createMetadata(entity, id); + if (eventMetadata == null) { + throw new IllegalStateException(); + } + + EventMetadataExample eventMetadataExample = new EventMetadataExample(); + Criteria criteria = eventMetadataExample.createCriteria(); + criteria.andEventIdEqualTo(id); + if (!allowArchived) { + criteria.andDateDeletedIsNull(); + } + eventMetadata.setId(eventMetadataMapper.selectByExample(eventMetadataExample).get(0).getId()); + eventMetadataMapper.updateByPrimaryKey(eventMetadata); + + } + + @Override + public List getAll() { + EventMetadataExample eventMetadataExample = new EventMetadataExample(); + eventMetadataExample.createCriteria().andDateDeletedIsNull(); + List events = eventMetadataMapper.selectManyWithRowBounds(eventMetadataExample, 0, + DEFAULT_FETCH_SIZE); + return convert(events); + } + + @Override + public void safeRemove(Event entity) { + if (entity == null || entity.getBaseEntityId() == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { + return; + } + + Date dateDeleted = entity.getDateVoided() == null ? new Date() : entity.getDateVoided().toDate(); + EventMetadata eventMetadata = new EventMetadata(); + eventMetadata.setDateDeleted(dateDeleted); + + EventMetadataExample eventMetadataExample = new EventMetadataExample(); + eventMetadataExample.createCriteria().andEventIdEqualTo(id).andDateDeletedIsNull(); + int rowsAffected = eventMetadataMapper.updateByExampleSelective(eventMetadata, eventMetadataExample); + if (rowsAffected < 1) { + return; + } + + org.opensrp.domain.postgres.Event pgEvent = new org.opensrp.domain.postgres.Event(); + pgEvent.setId(id); + pgEvent.setDateDeleted(dateDeleted); + eventMapper.updateByPrimaryKeySelective(pgEvent); + + } + + @Override + public List findAllByIdentifier(String identifier) { + List events = eventMapper.selectByIdentifier(identifier); + return convert(events); + } + + @Override + public List findAllByIdentifier(String identifierType, String identifier) { + List events = eventMapper.selectByIdentifierOfType(identifierType, identifier); + return convert(events); + } + + @Override + public Event findById(String id) { + return get(id); + } + + @Override + public Event findByFormSubmissionId(String formSubmissionId, boolean includeArchived) { + if (StringUtils.isBlank(formSubmissionId)) { + return null; + } + EventMetadataExample example = new EventMetadataExample(); + Criteria criteria = example.createCriteria().andFormSubmissionIdEqualTo(formSubmissionId); + if (!includeArchived) + criteria.andDateDeletedIsNull(); + List events = eventMetadataMapper.selectMany(example); + if (events.size() > 1) { + throw new IllegalStateException("Multiple events for formSubmissionId " + formSubmissionId); + } else if (!events.isEmpty()) + return convert(events.get(0)); + else + return null; + } + + @Override + public List findByBaseEntityId(String baseEntityId) { + EventMetadataExample example = new EventMetadataExample(); + example.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andDateDeletedIsNull(); + return convert(eventMetadataMapper.selectMany(example)); + } + + @Override + public Event findByBaseEntityAndFormSubmissionId(String baseEntityId, String formSubmissionId) { + EventMetadataExample example = new EventMetadataExample(); + example.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andFormSubmissionIdEqualTo(formSubmissionId) + .andDateDeletedIsNull(); + List events = eventMetadataMapper.selectMany(example); + if (events.size() > 1) { + throw new IllegalStateException("Multiple events for baseEntityId and formSubmissionId combination (" + + baseEntityId + "," + formSubmissionId + ")"); + } else if (!events.isEmpty()) + return convert(events.get(0)); + else + return null; + } + + @Override + public List findByBaseEntityAndType(String baseEntityId, String eventType) { + EventMetadataExample example = new EventMetadataExample(); + example.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andEventTypeEqualTo(eventType).andDateDeletedIsNull(); + return convert(eventMetadataMapper.selectMany(example)); + } + + @Override + public List findEvents(EventSearchBean eventSearchBean) { + EventMetadataExample example = new EventMetadataExample(); + Criteria criteria = example.createCriteria(); + if (StringUtils.isNotEmpty(eventSearchBean.getBaseEntityId())) + criteria.andBaseEntityIdEqualTo(eventSearchBean.getBaseEntityId()); + if (eventSearchBean.getEventDateFrom() != null && eventSearchBean.getEventDateTo() != null) + criteria.andEventDateBetween(eventSearchBean.getEventDateFrom().toDate(), + eventSearchBean.getEventDateTo().toDate()); + if (StringUtils.isNotEmpty(eventSearchBean.getEventType())) + criteria.andEventTypeEqualTo(eventSearchBean.getEventType()); + if (StringUtils.isNotEmpty(eventSearchBean.getEntityType())) + criteria.andEntityTypeEqualTo(eventSearchBean.getEntityType()); + if (StringUtils.isNotEmpty(eventSearchBean.getProviderId())) + criteria.andProviderIdEqualTo(eventSearchBean.getProviderId()); + if (StringUtils.isNotEmpty(eventSearchBean.getLocationId())) + criteria.andLocationIdEqualTo(eventSearchBean.getLocationId()); + if (eventSearchBean.getLastEditFrom() != null && eventSearchBean.getLastEditTo() != null) + criteria.andDateEditedBetween(eventSearchBean.getLastEditFrom().toDate(), + eventSearchBean.getLastEditTo().toDate()); + if (StringUtils.isNotEmpty(eventSearchBean.getTeam())) + criteria.andTeamEqualTo(eventSearchBean.getTeam()); + if (StringUtils.isNotEmpty(eventSearchBean.getTeamId())) + criteria.andTeamIdEqualTo(eventSearchBean.getTeamId()); + if (!criteria.isValid()) + throw new IllegalArgumentException("Atleast one search filter must be specified"); + criteria.andDateDeletedIsNull(); + return convert(eventMetadataMapper.selectManyWithRowBounds(example, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findEventsByDynamicQuery(String query) { + throw new IllegalArgumentException("Dynamic query feature not supported"); + } + + @Override + public List findByServerVersion(long serverVersion) { + EventMetadataExample example = new EventMetadataExample(); + example.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion + 1); + return convert(eventMetadataMapper.selectManyWithRowBounds(example, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List notInOpenMRSByServerVersion(long serverVersion, Calendar calendar) { + return convert(eventMetadataMapper.selectNotInOpenMRSByServerVersion(serverVersion, calendar.getTimeInMillis(), + DEFAULT_FETCH_SIZE)); + } + + @Override + public List notInOpenMRSByServerVersionAndType(String type, long serverVersion, Calendar calendar) { + return convert(eventMetadataMapper.selectNotInOpenMRSByServerVersionAndType(type, serverVersion, + calendar.getTimeInMillis(), DEFAULT_FETCH_SIZE)); + } + + @Override + public List findByClientAndConceptAndDate(String baseEntityId, String concept, String conceptValue, + String dateFrom, String dateTo) { + if (StringUtils.isBlank(baseEntityId) && StringUtils.isBlank(concept) && StringUtils.isBlank(conceptValue)) + return new ArrayList(); + Date from = null; + Date to = null; + if (StringUtils.isNotEmpty(dateFrom)) + from = new DateTime(dateFrom).toDate(); + if (StringUtils.isNotEmpty(dateTo)) + to = new DateTime(dateTo).toDate(); + return convert(eventMapper.selectByBaseEntityIdConceptAndDate(baseEntityId, concept, conceptValue, from, to)); + } + + @Override + public List findByBaseEntityIdAndConceptParentCode(String baseEntityId, String concept, String parentCode) { + if (StringUtils.isBlank(baseEntityId) && StringUtils.isBlank(concept) && StringUtils.isBlank(parentCode)) + return new ArrayList(); + return convert(eventMapper.selectByBaseEntityIdAndConceptParentCode(baseEntityId, concept, parentCode)); + } + + @Override + public List findByConceptAndValue(String concept, String conceptValue) { + if (StringUtils.isBlank(concept) && StringUtils.isBlank(conceptValue)) + return new ArrayList(); + return convert(eventMapper.selectByConceptAndValue(concept, conceptValue)); + } + + @Override + public List findByEmptyServerVersion() { + EventMetadataExample example = new EventMetadataExample(); + example.createCriteria().andServerVersionIsNull(); + example.or(example.createCriteria().andServerVersionEqualTo(0l)); + return convert(eventMetadataMapper.selectManyWithRowBounds(example, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findEvents(EventSearchBean eventSearchBean, String sortBy, String sortOrder, int limit) { + EventMetadataExample example = new EventMetadataExample(); + Criteria criteria = populateEventSearchCriteria(eventSearchBean, example); + + criteria.andDateDeletedIsNull(); + example.setOrderByClause(getOrderByClause(sortBy, sortOrder)); + return convert(eventMetadataMapper.selectManyWithRowBounds(example, 0, limit)); + } + + private Criteria populateEventSearchCriteria(EventSearchBean eventSearchBean, EventMetadataExample example) { + Criteria criteria = example.createCriteria(); + + addTeamCriteria(criteria, eventSearchBean); + + addTeamIdCriteria(criteria, eventSearchBean); + + addProviderIdCriteria(criteria, eventSearchBean); + + addLocationIdCriteria(criteria, eventSearchBean); + + addBaseEntityCriteria(criteria, eventSearchBean); + + if (eventSearchBean.getServerVersion() != null) + criteria.andServerVersionGreaterThanOrEqualTo(eventSearchBean.getServerVersion()); + + if (StringUtils.isNotEmpty(eventSearchBean.getEventType())) + criteria.andEventTypeEqualTo(eventSearchBean.getEventType()); + + if (!criteria.isValid()) + throw new IllegalArgumentException("Atleast one search filter must be specified"); + return criteria; + } + + private void addTeamCriteria(Criteria criteria, EventSearchBean eventSearchBean) { + if (StringUtils.isNotEmpty(eventSearchBean.getTeam())) { + if (eventSearchBean.getTeam().contains(",")) { + String[] teamsArray = org.apache.commons.lang.StringUtils.split(eventSearchBean.getTeam(), ","); + criteria.andTeamIn(Arrays.asList(teamsArray)); + } else { + criteria.andTeamEqualTo(eventSearchBean.getTeam()); + } + } + } + + private void addTeamIdCriteria(Criteria criteria, EventSearchBean eventSearchBean) { + if (StringUtils.isNotEmpty(eventSearchBean.getTeamId())) { + if (eventSearchBean.getTeamId().contains(",")) { + String[] teamsArray = org.apache.commons.lang.StringUtils.split(eventSearchBean.getTeamId(), ","); + criteria.andTeamIdIn(Arrays.asList(teamsArray)); + } else { + criteria.andTeamIdEqualTo(eventSearchBean.getTeamId()); + } + } + } + + private void addProviderIdCriteria(Criteria criteria, EventSearchBean eventSearchBean) { + if (StringUtils.isNotEmpty(eventSearchBean.getProviderId())) { + if (eventSearchBean.getProviderId().contains(",")) { + String[] providersArray = org.apache.commons.lang.StringUtils.split(eventSearchBean.getProviderId(), ","); + criteria.andProviderIdIn(Arrays.asList(providersArray)); + } else { + criteria.andProviderIdEqualTo(eventSearchBean.getProviderId()); + } + } + } + + private void addLocationIdCriteria(Criteria criteria, EventSearchBean eventSearchBean) { + if (StringUtils.isNotEmpty(eventSearchBean.getLocationId())) { + if (eventSearchBean.getLocationId().contains(",")) { + String[] locationArray = org.apache.commons.lang.StringUtils.split(eventSearchBean.getLocationId(), ","); + criteria.andLocationIdIn(Arrays.asList(locationArray)); + } else { + criteria.andLocationIdEqualTo(eventSearchBean.getLocationId()); + } + } + } + + private void addBaseEntityCriteria(Criteria criteria, EventSearchBean eventSearchBean) { + if (StringUtils.isNotEmpty(eventSearchBean.getBaseEntityId())) { + if (eventSearchBean.getBaseEntityId().contains(",")) { + String[] idsArray = org.apache.commons.lang.StringUtils.split(eventSearchBean.getBaseEntityId(), ","); + criteria.andBaseEntityIdIn(Arrays.asList(idsArray)); + } else { + criteria.andBaseEntityIdEqualTo(eventSearchBean.getBaseEntityId()); + } + } + } + + /** + * {@inheritDoc} + */ + @Override + public Long countEvents(EventSearchBean eventSearchBean) { + EventMetadataExample example = new EventMetadataExample(); + Criteria criteria = populateEventSearchCriteria(eventSearchBean, example); + criteria.andDateDeletedIsNull(); + return eventMetadataMapper.countByExample(example); + } + + /** + * Compatibility method inherited from couch to fetch events of a given type within the current + * month + * + * @param eventType the type of event to query + * @return list of events of given type within the current month + */ + @Override + public List findEventByEventTypeBetweenTwoDates(String eventType) { + Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.DATE, 1); + calendar.set(Calendar.HOUR, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.MILLISECOND, 0); + EventMetadataExample example = new EventMetadataExample(); + example.createCriteria().andEventTypeEqualTo(eventType) + .andDateCreatedBetween(calendar.getTime(), new Date()).andDateDeletedIsNull(); + return convert(eventMetadataMapper.selectManyWithRowBounds(example, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findByProvider(String provider) { + EventMetadataExample example = new EventMetadataExample(); + example.createCriteria().andProviderIdEqualTo(provider); + return convert(eventMetadataMapper.selectManyWithRowBounds(example, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public Pair, Long> findIdsByEventType(String eventType, boolean isDeleted, Long serverVersion, int limit) { + Long lastServerVersion = null; + EventMetadataExample example = new EventMetadataExample(); + Criteria criteria = example.createCriteria(); + criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); + + if (!StringUtils.isBlank(eventType)) { + criteria.andEventTypeEqualTo(eventType); + } + + if (isDeleted) { + criteria.andDateDeletedIsNotNull(); + } else { + criteria.andDateDeletedIsNull(); + } + + example.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + + return getEventListLongPair(limit, lastServerVersion, example); + } + + @Override + public Pair, Long> findIdsByEventType(String eventType, boolean isDeleted, Long serverVersion, int limit, + Date fromDate, Date toDate) { + if (fromDate == null && toDate == null) { + return findIdsByEventType(eventType, isDeleted, serverVersion, limit); + } else { + Long lastServerVersion = null; + EventMetadataExample example = new EventMetadataExample(); + Criteria criteria = example.createCriteria(); + criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); + example.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + + if (!StringUtils.isBlank(eventType)) { + criteria.andEventTypeEqualTo(eventType); + } + + if (isDeleted) { + criteria.andDateDeletedIsNotNull(); + } else { + criteria.andDateDeletedIsNull(); + } + + if (fromDate != null && toDate != null) { + criteria.andDateCreatedBetween(fromDate, toDate); + } else if (fromDate != null) { + criteria.andDateCreatedGreaterThanOrEqualTo(fromDate); + } else { + criteria.andDateCreatedLessThanOrEqualTo(toDate); + } + + return getEventListLongPair(limit, lastServerVersion, example); + } + } + + private Pair, Long> getEventListLongPair(int limit, Long lastServerVersion, EventMetadataExample example) { + int fetchLimit = limit > 0 ? limit : DEFAULT_FETCH_SIZE; + + Long serverVersion = lastServerVersion; + EventMetadataExample eventMetadataExample = example; + List eventIdentifiers = eventMetadataMapper.selectManyIds(eventMetadataExample, 0, fetchLimit); + + if (eventIdentifiers != null && !eventIdentifiers.isEmpty()) { + eventMetadataExample = new EventMetadataExample(); + eventMetadataExample.createCriteria().andDocumentIdEqualTo(eventIdentifiers.get(eventIdentifiers.size() - 1)); + List eventMetaDataList = eventMetadataMapper.selectByExample(eventMetadataExample); + + serverVersion = eventMetaDataList != null && !eventMetaDataList.isEmpty() + ? eventMetaDataList.get(0).getServerVersion() + : 0; + } + return Pair.of(eventIdentifiers, serverVersion); + } + + @Override + public List findBaseEntityIdsByLocation(String locationId) { + EventMetadataExample example = new EventMetadataExample(); + Criteria criteria = example.createCriteria(); + criteria.andLocationIdEqualTo(locationId); + example.setDistinct(true); + return eventMetadataMapper.selectManyBaseEntityIds(example); + } + + /** + * @param planIdentifier + * @param eventType + * @param fromDate + * @param toDate + * @return + */ + + @Override + public List getEventData(String planIdentifier, String eventType, Date fromDate, + Date toDate) { + EventMetadataExample eventMetadataExample = new EventMetadataExample(); + EventMetadataExample.Criteria criteria = eventMetadataExample.createCriteria(); + criteria.andPlanIdentifierEqualTo(planIdentifier).andEventTypeEqualTo(eventType).andDateDeletedIsNull(); + if (fromDate != null) { + criteria.andDateCreatedGreaterThanOrEqualTo(fromDate); + } + if (toDate != null) { + criteria.andDateCreatedLessThanOrEqualTo(toDate); + } + return eventMetadataMapper.selectManyWithRowBounds(eventMetadataExample, 0, DEFAULT_FETCH_SIZE); + } + + /** + * Gets events for a entity with details values + * + * @param baseEntityId entity id + * @param planIdentifier plan id + * @return events for an entity in a plan + */ + private List findByBaseEntityIdAndPlanIdentifier(String baseEntityId, String planIdentifier) { + return convert(eventMetadataMapper.selectByBaseEntityIdAndPlanIdentifier(baseEntityId, planIdentifier)); + } + + /** + * Get the primary key of an event + * + * @param event + * @param allowArchived + * @return the promary key + */ + private Long retrievePrimaryKey(Event event, boolean allowArchived) { + Object uniqueId = getUniqueField(event); + if (uniqueId == null) { + return null; + } + + String documentId = uniqueId.toString(); + + EventMetadataExample eventMetadataExample = new EventMetadataExample(); + Criteria criteria = eventMetadataExample.createCriteria(); + criteria.andDocumentIdEqualTo(documentId); + if (!allowArchived) { + criteria.andDateDeletedIsNull(); + } + + return eventMetadataMapper.selectPrimaryKey(eventMetadataExample); + + } + + @Override + protected Long retrievePrimaryKey(Event event) { + return retrievePrimaryKey(event, false); + } + + @Override + protected Object getUniqueField(Event t) { + if (t == null) { + return null; + } + return t.getId(); + } + + // Private Methods + private Event convert(org.opensrp.domain.postgres.Event event) { + if (event == null || event.getJson() == null || !(event.getJson() instanceof Event)) { + return null; + } + return (Event) event.getJson(); + } + + private org.opensrp.domain.postgres.Event convert(Event event, Long primaryKey) { + if (event == null) { + return null; + } + + org.opensrp.domain.postgres.Event pgEvent = new org.opensrp.domain.postgres.Event(); + pgEvent.setId(primaryKey); + pgEvent.setJson(event); + + return pgEvent; + } + + private List convert(List events) { + if (events == null || events.isEmpty()) { + return new ArrayList<>(); + } + + List convertedEvents = new ArrayList<>(); + for (org.opensrp.domain.postgres.Event event : events) { + Event convertedEvent = convert(event); + if (convertedEvent != null) { + convertedEvents.add(convertedEvent); + } + } + + return convertedEvents; + } + + private EventMetadata createMetadata(Event event, Long eventId) { + try { + EventMetadata eventMetadata = new EventMetadata(); + eventMetadata.setBaseEntityId(event.getBaseEntityId()); + eventMetadata.setEventId(eventId); + eventMetadata.setDocumentId(event.getId()); + eventMetadata.setBaseEntityId(event.getBaseEntityId()); + eventMetadata.setFormSubmissionId(event.getFormSubmissionId()); + eventMetadata.setOpenmrsUuid(event.getIdentifier(AllConstants.Client.OPENMRS_UUID_IDENTIFIER_TYPE)); + eventMetadata.setEventType(event.getEventType()); + if (event.getEventDate() != null) + eventMetadata.setEventDate(event.getEventDate().toDate()); + eventMetadata.setEntityType(event.getEntityType()); + eventMetadata.setProviderId(event.getProviderId()); + eventMetadata.setLocationId(event.getLocationId()); + eventMetadata.setTeam(event.getTeam()); + eventMetadata.setTeamId(event.getTeamId()); + eventMetadata.setServerVersion(event.getServerVersion()); + if (event.getDateCreated() != null) + eventMetadata.setDateCreated(event.getDateCreated().toDate()); + if (event.getDateEdited() != null) + eventMetadata.setDateEdited(event.getDateEdited().toDate()); + if (event.getDateVoided() != null) + eventMetadata.setDateDeleted(event.getDateVoided().toDate()); + String planIdentifier = event.getDetails() != null ? event.getDetails().get("planIdentifier") : null; + eventMetadata.setPlanIdentifier(planIdentifier); + return eventMetadata; + } catch (Exception e) { + logger.error(e.getMessage(), e); + return null; + } + } + + /** + * Method should be used only during Unit testing Deletes all existing records + */ + public void removeAll() { + eventMetadataMapper.deleteByExample(new EventMetadataExample()); + eventMapper.deleteByExample(new EventExample()); + + } + + @Override + public List findEventsByEntityIdAndPlan(String resourceId, String planIdentifier) { + return findByBaseEntityIdAndPlanIdentifier(resourceId, planIdentifier).stream() + .map(event -> EventConverter.convertEventToEncounterResource(event)).collect(Collectors.toList()); + } + + @Override + public List findEventsByJurisdictionIdAndPlan(String jurisdictionId, String planIdentifier) { + EventMetadataExample example = new EventMetadataExample(); + example.createCriteria().andLocationIdEqualTo(jurisdictionId).andPlanIdentifierEqualTo(planIdentifier) + .andDateDeletedIsNull(); + + /**@formatter:off*/ + return eventMetadataMapper.selectMany(example) + .stream() + .map(event -> convert(event)) + .map(event -> EventConverter.convertEventToEncounterResource(event)) + .collect(Collectors.toList()); + /**@formatter:on*/ + } + + } diff --git a/src/main/java/org/opensrp/repository/postgres/IdentifierSourceRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/IdentifierSourceRepositoryImpl.java index 0621cecdd..c23901ddd 100644 --- a/src/main/java/org/opensrp/repository/postgres/IdentifierSourceRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/IdentifierSourceRepositoryImpl.java @@ -14,175 +14,175 @@ @Repository("identifierSourceRepositoryPostgres") public class IdentifierSourceRepositoryImpl extends BaseRepositoryImpl - implements IdentifierSourceRepository { - - @Autowired - private CustomIdentifierSourceMapper customIdentifierSourceMapper; - - @Override - public IdentifierSource findByIdentifier(String identifier) { - org.opensrp.domain.postgres.IdentifierSource identifierSource = customIdentifierSourceMapper - .selectByIdentifier(identifier); - return convert(identifierSource); - } - - @Override - public IdentifierSource get(String id) { - throw new NotImplementedException(); - } - - @Override - public void add(IdentifierSource entity) { - if (entity == null || entity.getIdentifier() == null) { - return; - } - - if (retrievePrimaryKey(entity) != null) { // IdentifierSource already added - return; - } - org.opensrp.domain.postgres.IdentifierSource pgIdentifierSource = convert(entity, null); - if (pgIdentifierSource == null) { - return; - } - - int rowsAffected = customIdentifierSourceMapper.insertSelectiveAndSetId(pgIdentifierSource); - if (rowsAffected < 1 || pgIdentifierSource.getId() == null) { - return; - } - - } - - @Override - public void update(IdentifierSource entity) { - if (entity == null) { - return; - } - Long id = retrievePrimaryKey(entity); - - if (id == null) { //Identifier Source doesn't not exist - return; - } - - org.opensrp.domain.postgres.IdentifierSource pgIdentifierSource = convert(entity, id); - customIdentifierSourceMapper.updateByPrimaryKey(pgIdentifierSource); - } - - @Override - public void updateIdSourceWithSequenceValue(IdentifierSource identifierSource, Long sequenceValue) { - if (identifierSource == null) { - return; - } - Long id = retrievePrimaryKey(identifierSource); - - if (id == null) { //Identifier Source doesn't not exist - return; - } - - org.opensrp.domain.postgres.IdentifierSource pgIdentifierSource = convert(identifierSource, id); - pgIdentifierSource.setSequenceValue(sequenceValue); - customIdentifierSourceMapper.updateByPrimaryKey(pgIdentifierSource); - } - - @Override - public List getAll() { - IdentifierSourceExample identifierSourceExample = new IdentifierSourceExample(); - identifierSourceExample.createCriteria().andIdentifierIsNotNull(); - List identifierSources = customIdentifierSourceMapper - .selectMany(identifierSourceExample, 0, DEFAULT_FETCH_SIZE); - return convert(identifierSources); - } - - @Override - public void safeRemove(IdentifierSource entity) { - throw new NotImplementedException(); - } - - @Override - protected Long retrievePrimaryKey(IdentifierSource entity) { - - IdentifierSourceExample identifierSourceExample = new IdentifierSourceExample(); - IdentifierSourceExample.Criteria criteria = identifierSourceExample.createCriteria(); - if (entity.getId() != null && entity.getId() != 0) { - criteria.andIdEqualTo(entity.getId()); - } else { - criteria.andIdentifierEqualTo(entity.getIdentifier()); - } - - org.opensrp.domain.postgres.IdentifierSource identifierSource = customIdentifierSourceMapper - .selectOne(identifierSourceExample); - if (identifierSource == null) { - return null; - } - return identifierSource.getId(); - } - - @Override - protected Object getUniqueField(IdentifierSource identifierSource) { - if (identifierSource == null) { - return null; - } - return identifierSource.getIdentifier(); - } - - // Private Methods - protected List convert(List identifierSources) { - if (identifierSources == null || identifierSources.isEmpty()) { - return new ArrayList<>(); - } - - List convertedIdentifierSources = new ArrayList<>(); - for (org.opensrp.domain.postgres.IdentifierSource identifierSource : identifierSources) { - IdentifierSource convertedIdentifierSource = convert(identifierSource); - if (convertedIdentifierSource != null) { - convertedIdentifierSources.add(convertedIdentifierSource); - } - } - - return convertedIdentifierSources; - } - - private IdentifierSource convert(org.opensrp.domain.postgres.IdentifierSource identifierSource) { - if (identifierSource == null) { - return null; - } - IdentifierSource convertedIdentifierSource = new IdentifierSource(); - convertedIdentifierSource.setId(identifierSource.getId()); - convertedIdentifierSource.setIdentifier(identifierSource.getIdentifier()); - convertedIdentifierSource.setDescription(identifierSource.getDescription()); - convertedIdentifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.get(identifierSource.getIdentifierValidatorAlgorithm())); - convertedIdentifierSource.setBaseCharacterSet(identifierSource.getBaseCharacterSet()); - convertedIdentifierSource.setFirstIdentifierBase(identifierSource.getFirstIdentifierBase()); - convertedIdentifierSource.setPrefix(identifierSource.getPrefix()); - convertedIdentifierSource.setSuffix(identifierSource.getSuffix()); - convertedIdentifierSource.setMinLength(identifierSource.getMinLength()); - convertedIdentifierSource.setMaxLength(identifierSource.getMaxLength()); - convertedIdentifierSource.setRegexFormat(identifierSource.getRegexFormat()); - convertedIdentifierSource.setSequenceValue(identifierSource.getSequenceValue()); - - return convertedIdentifierSource; - } - - private org.opensrp.domain.postgres.IdentifierSource convert(IdentifierSource identifierSource, Long primaryKey) { - if (identifierSource == null) { - return null; - } - - org.opensrp.domain.postgres.IdentifierSource pgIdentifierSource = new org.opensrp.domain.postgres.IdentifierSource(); - pgIdentifierSource.setId(primaryKey); - pgIdentifierSource.setIdentifier(identifierSource.getIdentifier()); - pgIdentifierSource.setDescription(identifierSource.getDescription()); - pgIdentifierSource.setIdentifierValidatorAlgorithm(identifierSource.getIdentifierValidatorAlgorithm() != null ? - identifierSource.getIdentifierValidatorAlgorithm().name() : null); - pgIdentifierSource.setBaseCharacterSet(identifierSource.getBaseCharacterSet()); - pgIdentifierSource.setFirstIdentifierBase(identifierSource.getFirstIdentifierBase()); - pgIdentifierSource.setPrefix(identifierSource.getPrefix()); - pgIdentifierSource.setSuffix(identifierSource.getSuffix()); - pgIdentifierSource.setMinLength(identifierSource.getMinLength()); - pgIdentifierSource.setMaxLength(identifierSource.getMaxLength()); - pgIdentifierSource.setRegexFormat(identifierSource.getRegexFormat()); - pgIdentifierSource.setSequenceValue(identifierSource.getSequenceValue()); - - return pgIdentifierSource; - } + implements IdentifierSourceRepository { + + @Autowired + private CustomIdentifierSourceMapper customIdentifierSourceMapper; + + @Override + public IdentifierSource findByIdentifier(String identifier) { + org.opensrp.domain.postgres.IdentifierSource identifierSource = customIdentifierSourceMapper + .selectByIdentifier(identifier); + return convert(identifierSource); + } + + @Override + public IdentifierSource get(String id) { + throw new NotImplementedException(); + } + + @Override + public void add(IdentifierSource entity) { + if (entity == null || entity.getIdentifier() == null) { + return; + } + + if (retrievePrimaryKey(entity) != null) { // IdentifierSource already added + return; + } + org.opensrp.domain.postgres.IdentifierSource pgIdentifierSource = convert(entity, null); + if (pgIdentifierSource == null) { + return; + } + + int rowsAffected = customIdentifierSourceMapper.insertSelectiveAndSetId(pgIdentifierSource); + if (rowsAffected < 1 || pgIdentifierSource.getId() == null) { + return; + } + + } + + @Override + public void update(IdentifierSource entity) { + if (entity == null) { + return; + } + Long id = retrievePrimaryKey(entity); + + if (id == null) { //Identifier Source doesn't not exist + return; + } + + org.opensrp.domain.postgres.IdentifierSource pgIdentifierSource = convert(entity, id); + customIdentifierSourceMapper.updateByPrimaryKey(pgIdentifierSource); + } + + @Override + public void updateIdSourceWithSequenceValue(IdentifierSource identifierSource, Long sequenceValue) { + if (identifierSource == null) { + return; + } + Long id = retrievePrimaryKey(identifierSource); + + if (id == null) { //Identifier Source doesn't not exist + return; + } + + org.opensrp.domain.postgres.IdentifierSource pgIdentifierSource = convert(identifierSource, id); + pgIdentifierSource.setSequenceValue(sequenceValue); + customIdentifierSourceMapper.updateByPrimaryKey(pgIdentifierSource); + } + + @Override + public List getAll() { + IdentifierSourceExample identifierSourceExample = new IdentifierSourceExample(); + identifierSourceExample.createCriteria().andIdentifierIsNotNull(); + List identifierSources = customIdentifierSourceMapper + .selectMany(identifierSourceExample, 0, DEFAULT_FETCH_SIZE); + return convert(identifierSources); + } + + @Override + public void safeRemove(IdentifierSource entity) { + throw new NotImplementedException(); + } + + @Override + protected Long retrievePrimaryKey(IdentifierSource entity) { + + IdentifierSourceExample identifierSourceExample = new IdentifierSourceExample(); + IdentifierSourceExample.Criteria criteria = identifierSourceExample.createCriteria(); + if (entity.getId() != null && entity.getId() != 0) { + criteria.andIdEqualTo(entity.getId()); + } else { + criteria.andIdentifierEqualTo(entity.getIdentifier()); + } + + org.opensrp.domain.postgres.IdentifierSource identifierSource = customIdentifierSourceMapper + .selectOne(identifierSourceExample); + if (identifierSource == null) { + return null; + } + return identifierSource.getId(); + } + + @Override + protected Object getUniqueField(IdentifierSource identifierSource) { + if (identifierSource == null) { + return null; + } + return identifierSource.getIdentifier(); + } + + // Private Methods + protected List convert(List identifierSources) { + if (identifierSources == null || identifierSources.isEmpty()) { + return new ArrayList<>(); + } + + List convertedIdentifierSources = new ArrayList<>(); + for (org.opensrp.domain.postgres.IdentifierSource identifierSource : identifierSources) { + IdentifierSource convertedIdentifierSource = convert(identifierSource); + if (convertedIdentifierSource != null) { + convertedIdentifierSources.add(convertedIdentifierSource); + } + } + + return convertedIdentifierSources; + } + + private IdentifierSource convert(org.opensrp.domain.postgres.IdentifierSource identifierSource) { + if (identifierSource == null) { + return null; + } + IdentifierSource convertedIdentifierSource = new IdentifierSource(); + convertedIdentifierSource.setId(identifierSource.getId()); + convertedIdentifierSource.setIdentifier(identifierSource.getIdentifier()); + convertedIdentifierSource.setDescription(identifierSource.getDescription()); + convertedIdentifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.get(identifierSource.getIdentifierValidatorAlgorithm())); + convertedIdentifierSource.setBaseCharacterSet(identifierSource.getBaseCharacterSet()); + convertedIdentifierSource.setFirstIdentifierBase(identifierSource.getFirstIdentifierBase()); + convertedIdentifierSource.setPrefix(identifierSource.getPrefix()); + convertedIdentifierSource.setSuffix(identifierSource.getSuffix()); + convertedIdentifierSource.setMinLength(identifierSource.getMinLength()); + convertedIdentifierSource.setMaxLength(identifierSource.getMaxLength()); + convertedIdentifierSource.setRegexFormat(identifierSource.getRegexFormat()); + convertedIdentifierSource.setSequenceValue(identifierSource.getSequenceValue()); + + return convertedIdentifierSource; + } + + private org.opensrp.domain.postgres.IdentifierSource convert(IdentifierSource identifierSource, Long primaryKey) { + if (identifierSource == null) { + return null; + } + + org.opensrp.domain.postgres.IdentifierSource pgIdentifierSource = new org.opensrp.domain.postgres.IdentifierSource(); + pgIdentifierSource.setId(primaryKey); + pgIdentifierSource.setIdentifier(identifierSource.getIdentifier()); + pgIdentifierSource.setDescription(identifierSource.getDescription()); + pgIdentifierSource.setIdentifierValidatorAlgorithm(identifierSource.getIdentifierValidatorAlgorithm() != null ? + identifierSource.getIdentifierValidatorAlgorithm().name() : null); + pgIdentifierSource.setBaseCharacterSet(identifierSource.getBaseCharacterSet()); + pgIdentifierSource.setFirstIdentifierBase(identifierSource.getFirstIdentifierBase()); + pgIdentifierSource.setPrefix(identifierSource.getPrefix()); + pgIdentifierSource.setSuffix(identifierSource.getSuffix()); + pgIdentifierSource.setMinLength(identifierSource.getMinLength()); + pgIdentifierSource.setMaxLength(identifierSource.getMaxLength()); + pgIdentifierSource.setRegexFormat(identifierSource.getRegexFormat()); + pgIdentifierSource.setSequenceValue(identifierSource.getSequenceValue()); + + return pgIdentifierSource; + } } diff --git a/src/main/java/org/opensrp/repository/postgres/LocationRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/LocationRepositoryImpl.java index d2adaa211..f35840281 100644 --- a/src/main/java/org/opensrp/repository/postgres/LocationRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/LocationRepositoryImpl.java @@ -51,973 +51,973 @@ @Repository public class LocationRepositoryImpl extends BaseRepositoryImpl implements LocationRepository { - - @Autowired - private CustomLocationMapper locationMapper; - - @Autowired - private CustomLocationMetadataMapper locationMetadataMapper; - - @Autowired - private CustomStructureMapper structureMapper; - - @Autowired - private CustomStructureMetadataMapper structureMetadataMapper; - - @Autowired - private LocationTagService locationTagService; - - @Override - public PhysicalLocation get(String id) { - return convert(locationMetadataMapper.findById(id, true, false)); - } - - @Override - public PhysicalLocation get(String id, boolean returnGeography, boolean includeInactive) { - return convert(locationMetadataMapper.findById(id, returnGeography, includeInactive)); - } - - @Override - public PhysicalLocation getStructure(String id, boolean returnGeography) { - return convert(structureMetadataMapper.findById(id, returnGeography)); - } - - @Override - @Transactional - public void add(PhysicalLocation entity) { - if (getUniqueField(entity) == null) { - return; - } - - if (retrievePrimaryKey(entity) != null) { // PhysicalLocation already added - return; - } - - if (entity.isJurisdiction()) - addLocation(entity); - else - addStructure(entity); - - } - - private void updateLocationServerVersion(Location pgLocation, PhysicalLocation entity) { - long serverVersion = locationMapper.selectServerVersionByPrimaryKey(pgLocation.getId()); - entity.setServerVersion(serverVersion); - pgLocation.setJson(entity); - pgLocation.setServerVersion(null); - int rowsAffected = locationMapper.updateByPrimaryKeySelective(pgLocation); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - } - - private void updateStructureServerVersion(Structure pgStructure, PhysicalLocation entity) { - long serverVersion = structureMapper.selectServerVersionByPrimaryKey(pgStructure.getId()); - entity.setServerVersion(serverVersion); - pgStructure.setJson(entity); - pgStructure.setServerVersion(null); - int rowsAffected = structureMapper.updateByPrimaryKeySelective(pgStructure); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - } - - - private void addLocation(PhysicalLocation entity) { - - Location pgLocation = convert(entity, null); - if (pgLocation == null) { - throw new IllegalStateException(); - } - - int rowsAffected = locationMapper.insertSelectiveAndSetId(pgLocation); - - if (rowsAffected < 1 || pgLocation.getId() == null) { - throw new IllegalStateException(); - } - - updateLocationServerVersion(pgLocation, entity); - - LocationMetadata locationMetadata = createMetadata(entity, pgLocation.getId()); - - locationMetadataMapper.insertSelective(locationMetadata); - saveLocationTag(entity, pgLocation.getId(), false); - } - - private void addStructure(PhysicalLocation entity) { - - Structure pgStructure = convertStructure(entity, null); - if (pgStructure == null) { - throw new IllegalStateException(); - } - - int rowsAffected = structureMapper.insertSelectiveAndSetId(pgStructure); - if (rowsAffected < 1 || pgStructure.getId() == null) { - throw new IllegalStateException(); - } - - updateStructureServerVersion(pgStructure, entity); - - StructureMetadata structureMetadata = createStructureMetadata(entity, pgStructure.getId()); - - structureMetadataMapper.insertSelective(structureMetadata); - - } - - @Override - @Transactional - public void update(PhysicalLocation entity) { - if (getUniqueField(entity) == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { // PhysicalLocation does not exist - return; - } - if (entity.isJurisdiction()) - updateLocation(entity, id); - else - updateStructure(entity, id); - - } - - private void updateLocation(PhysicalLocation entity, Long id) { - Location pgLocation = convert(entity, id); - if (pgLocation == null) { - throw new IllegalStateException(); - } - - - int rowsAffected = locationMapper.updateByPrimaryKeyAndGenerateServerVersion(pgLocation); - if (rowsAffected < 1) { - return; - } - - updateLocationServerVersion(pgLocation, entity); - - - LocationMetadata locationMetadata = createMetadata(entity, pgLocation.getId()); - - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - locationMetadataExample.createCriteria().andLocationIdEqualTo(id); - LocationMetadata metadata = locationMetadataMapper.selectByExample(locationMetadataExample).get(0); - locationMetadata.setId(metadata.getId()); - locationMetadata.setDateCreated(metadata.getDateCreated()); - locationMetadataMapper.updateByPrimaryKey(locationMetadata); - saveLocationTag(entity, pgLocation.getId(), true); - } - - private void updateStructure(PhysicalLocation entity, Long id) { - Structure pgStructure = convertStructure(entity, id); - if (pgStructure == null) { - throw new IllegalStateException(); - } - - - int rowsAffected = structureMapper.updateByPrimaryKeyAndGenerateServerVersion(pgStructure); - if (rowsAffected < 1) { - return; - } - - updateStructureServerVersion(pgStructure, entity); - - StructureMetadata structureMetadata = createStructureMetadata(entity, pgStructure.getId()); - - StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); - structureMetadataExample.createCriteria().andStructureIdEqualTo(id); - StructureMetadata metadata = structureMetadataMapper.selectByExample(structureMetadataExample).get(0); - structureMetadata.setId(metadata.getId()); - structureMetadata.setDateCreated(metadata.getDateCreated()); - structureMetadataMapper.updateByPrimaryKey(structureMetadata); - } - - @Override - public List getAll() { - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - locationMetadataExample.createCriteria().andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); - List locations = locationMetadataMapper.selectMany(locationMetadataExample, 0, DEFAULT_FETCH_SIZE); - return convert(locations); - } - - @Override - public List getAllStructures() { - List structures = structureMetadataMapper.selectMany(new StructureMetadataExample(), 0, - DEFAULT_FETCH_SIZE); - return convertStructures(structures); - } - - @Override - @Transactional - public void safeRemove(PhysicalLocation entity) { - if (entity == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { - return; - } - - if (entity.isJurisdiction()) { - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - locationMetadataExample.createCriteria().andLocationIdEqualTo(id); - int rowsAffected = locationMetadataMapper.deleteByExample(locationMetadataExample); - if (rowsAffected < 1) { - return; - } - - locationMapper.deleteByPrimaryKey(id); - } else { - StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); - structureMetadataExample.createCriteria().andStructureIdEqualTo(id); - int rowsAffected = structureMetadataMapper.deleteByExample(structureMetadataExample); - if (rowsAffected < 1) { - return; - } - - structureMapper.deleteByPrimaryKey(id); - } - - } - - @Override - public List findLocationsByServerVersion(long serverVersion) { - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - locationMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion) - .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); - locationMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - List locations = locationMetadataMapper.selectMany(locationMetadataExample, 0, DEFAULT_FETCH_SIZE); - return convert(locations); - } - - @Override - public List findLocationsByNames(String locationNames, long serverVersion) { - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - locationMetadataExample.createCriteria() - .andNameIn(Arrays.asList(org.apache.commons.lang.StringUtils.split(locationNames, ","))) - .andServerVersionGreaterThanOrEqualTo(serverVersion) - .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); - locationMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - List locations = locationMetadataMapper.selectMany(locationMetadataExample, 0, DEFAULT_FETCH_SIZE); - return convert(locations); - } - - @Override - public List findStructuresByParentAndServerVersion(String parentIds, long serverVersion) { - StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); - structureMetadataExample.createCriteria() - .andParentIdIn(Arrays.asList(org.apache.commons.lang.StringUtils.split(parentIds, ","))) - .andServerVersionGreaterThanOrEqualTo(serverVersion); - structureMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - List locations = structureMetadataMapper.selectMany(structureMetadataExample, 0, DEFAULT_FETCH_SIZE); - return convertStructures(locations); - } - - @Override - public List findByEmptyServerVersion() { - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - locationMetadataExample.createCriteria().andServerVersionEqualTo(0l); - locationMetadataExample.or(locationMetadataExample.createCriteria().andServerVersionIsNull()); - List locations = locationMetadataMapper.selectMany(locationMetadataExample, 0, DEFAULT_FETCH_SIZE); - return convert(locations); - } - - @Override - public List findStructuresByEmptyServerVersion() { - StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); - structureMetadataExample.createCriteria().andServerVersionEqualTo(0l); - structureMetadataExample.or(structureMetadataExample.createCriteria().andServerVersionIsNull()); - List locations = structureMetadataMapper.selectMany(structureMetadataExample, 0, DEFAULT_FETCH_SIZE); - return convertStructures(locations); - } - - @Override - public Collection findStructureAndFamilyDetails(double latitude, double longitude, double radius) { - List pgList = structureMapper.selectStructureAndFamilyWithinRadius(latitude, longitude, - radius); - Map structureDetails = new HashMap<>(); - for (StructureFamilyDetails detail : pgList) { - StructureDetails structure; - if (!structureDetails.containsKey(detail.getId())) { - structure = new StructureDetails(detail.getId(), detail.getParentId(), detail.getType()); - - structureDetails.put(detail.getId(), structure); - } else { - structure = structureDetails.get(detail.getId()); - } - if (StringUtils.isNotBlank(detail.getBaseEntityId())) { - if ("Family".equalsIgnoreCase(detail.getLastName())) - structure.setFamilyId(detail.getBaseEntityId()); - else - structure.getFamilyMembers().add(detail.getBaseEntityId()); - } - } - return structureDetails.values(); - } - - /** - * {@inheritDoc} - */ - @Override - public List findLocationsByProperties(boolean returnGeometry, String parentId, - Map properties) { - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - if (parentId != null) { - locationMetadataExample.createCriteria().andParentIdEqualTo(parentId); - } - List locations = locationMetadataMapper.selectManyByProperties(locationMetadataExample, properties, - returnGeometry, 0, DEFAULT_FETCH_SIZE); - return convert(locations); - } - - /** - * {@inheritDoc} - */ - @Override - public List findStructuresByProperties(boolean returnGeometry, String parentId, - Map properties, int limit) { - int fetchLimit = limit > 0 ? limit : DEFAULT_FETCH_SIZE; - StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); - if (StringUtils.isNotBlank(parentId)) { - structureMetadataExample.createCriteria().andParentIdEqualTo(parentId); - } - List locations = structureMetadataMapper.selectManyByProperties(structureMetadataExample, properties, - returnGeometry, 0, fetchLimit); - return convert(locations); - } - - /** - * {@inheritDoc} - */ - @Override - public List findStructuresByProperties(boolean returnGeometry, String parentId, - Map properties) { - return findStructuresByProperties(returnGeometry,parentId,properties,DEFAULT_FETCH_SIZE); - } - - /** - * {@inheritDoc} - */ - @Override - public List findLocationsByIds(boolean returnGeometry, List ids, Long serverVersion) { - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - if (ids == null || ids.isEmpty()) { - return null; - } - - Criteria criteria = locationMetadataExample.createCriteria().andGeojsonIdIn(ids) - .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); - if (serverVersion != null) { - criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); - } - - List locations = locationMetadataMapper.selectManyWithOptionalGeometry(locationMetadataExample, - returnGeometry, 0, DEFAULT_FETCH_SIZE); - return convert(locations); - } - - /** - * {@inheritDoc} - */ - @Override - public List findLocationsByIdsOrParentIds(boolean returnGeometry, List ids) { - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - if (ids == null || ids.isEmpty()) { - return null; - } - - locationMetadataExample.createCriteria().andGeojsonIdIn(ids) - .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); - - locationMetadataExample.or(locationMetadataExample.createCriteria().andParentIdIn(ids) - .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name()))); - List locations = locationMetadataMapper.selectManyWithOptionalGeometry(locationMetadataExample, - returnGeometry, 0, DEFAULT_FETCH_SIZE); - return convert(locations); - } - - @Override - public Pair, Long> findAllStructureIds(Long serverVersion, int limit) { - Long lastServerVersion = null; - StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); - structureMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); - structureMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - return getStructuresListLongPair(limit, lastServerVersion, structureMetadataExample); - } - - @Override - public Pair, Long> findAllStructureIds(Long serverVersion, int limit, Date fromDate, Date toDate) { - if (fromDate == null && toDate == null) { - return findAllStructureIds(serverVersion, limit); - } else { - Long lastServerVersion = null; - StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); - structureMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - StructureMetadataExample.Criteria criteria = structureMetadataExample.createCriteria(); - criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); - if (toDate != null && fromDate != null) { - criteria.andDateCreatedBetween(fromDate, toDate); - } else if (fromDate != null) { - criteria.andDateCreatedGreaterThanOrEqualTo(fromDate); - } else { - criteria.andDateCreatedLessThanOrEqualTo(toDate); - } - - return getStructuresListLongPair(limit, lastServerVersion, structureMetadataExample); - } - - } - - private Pair, Long> getStructuresListLongPair(int limit, Long lastServerVersion, - StructureMetadataExample structureMetadataExample) { - int fetchLimit = limit > 0 ? limit : DEFAULT_FETCH_SIZE; - Long serverVersion = lastServerVersion; - StructureMetadataExample example = structureMetadataExample; - List structureIdentifiers = structureMetadataMapper.selectManyIds(example, 0, fetchLimit); - - if (structureIdentifiers != null && !structureIdentifiers.isEmpty()) { - example = new StructureMetadataExample(); - example.createCriteria() - .andGeojsonIdEqualTo(structureIdentifiers.get(structureIdentifiers.size() - 1)); - List structureMetaDataList = structureMetadataMapper - .selectByExample(example); - - serverVersion = structureMetaDataList != null && !structureMetaDataList.isEmpty() - ? structureMetaDataList.get(0).getServerVersion() - : 0; - } - - return Pair.of(structureIdentifiers, serverVersion); - } - - /** - * {@inheritDoc} - */ - @Override - public Set findLocationDetailsByPlanId(String planIdentifier) { - - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - locationMetadataExample.createCriteria().andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); - return locationMetadataMapper.selectDetailsByPlanId(locationMetadataExample, planIdentifier); - } - - /** - * {@inheritDoc} - */ - @Override - public List findLocationByIdWithChildren(boolean returnGeometry, String id, int pageSize) { - return findLocationByIdsWithChildren(returnGeometry, Collections.singleton(id), pageSize); - } - - /** - * {@inheritDoc} - */ - @Override - public List findLocationByIdsWithChildren(boolean returnGeometry, Set identifiers, - int pageSize) { - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - if (identifiers == null) { - return null; - } - - int limit = Math.abs(pageSize); - List locations = locationMetadataMapper.selectWithChildren(locationMetadataExample, returnGeometry, - identifiers, 0, limit); - return convert(locations); - } - - /** - * {@inheritDoc} - */ - @Override - public List findAllLocations(boolean returnGeometry, Long serverVersion, int limit, boolean includeInactive) { - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - LocationMetadataExample.Criteria criteria = locationMetadataExample.createCriteria(); - if(!includeInactive) { - criteria.andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); - } - criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); - locationMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - - List locations = locationMetadataMapper.selectManyWithOptionalGeometry(locationMetadataExample, - returnGeometry, 0, limit); - return convert(locations); - } - - /** - * {@inheritDoc} - */ - @Override - public Long countAllLocations(Long serverVersion) { - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - locationMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion) - .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); - return locationMetadataMapper.countMany(locationMetadataExample); - } - - /** - * {@inheritDoc} - */ - @Override - public List findAllStructures(boolean returnGeometry, Long serverVersion, int limit, Integer pageNumber, String orderByType, String orderByFieldName) { - StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); - structureMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); - String sortBy = orderByFieldName != null ? orderByFieldName : null; - String sortOrder = orderByType != null ? orderByType : null; - if (sortBy != null && sortOrder != null) { - structureMetadataExample.setOrderByClause(getOrderByClause(sortBy, sortOrder)); - } else { - structureMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - } - Pair pageLimitAndOffSet = RepositoryUtil.getPageSizeAndOffset(pageNumber, limit); - List locations = structureMetadataMapper.selectManyByProperties(structureMetadataExample, null, - returnGeometry, pageLimitAndOffSet.getRight(), pageLimitAndOffSet.getLeft()); - return convert(locations); - } - - /** - * {@inheritDoc} - */ - @Override - public Long countAllStructures(Long serverVersion) { - StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); - structureMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); - return structureMetadataMapper.countMany(structureMetadataExample); - } - - /** - * {@inheritDoc} - */ - @Override - public Pair, Long> findAllLocationIds(Long serverVersion, int limit) { - Long lastServerVersion = null; - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - locationMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); - locationMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - - return getLocationListLongPair(limit, lastServerVersion, locationMetadataExample); - } - - @Override - public Pair, Long> findAllLocationIds(Long serverVersion, int limit, Date fromDate, Date toDate) { - if (fromDate == null && toDate == null) { - return findAllLocationIds(serverVersion, limit); - } else { - Long lastServerVersion = null; - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - LocationMetadataExample.Criteria criteria = locationMetadataExample.createCriteria(); - criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); - locationMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - if (toDate != null && fromDate != null) { - criteria.andDateCreatedBetween(fromDate, toDate); - } else if (fromDate != null) { - criteria.andDateCreatedGreaterThanOrEqualTo(fromDate); - } else { - criteria.andDateCreatedLessThanOrEqualTo(toDate); - } - return getLocationListLongPair(limit, lastServerVersion, locationMetadataExample); - } - } - - private Pair, Long> getLocationListLongPair(int limit, Long lastServerVersion, - LocationMetadataExample locationMetadataExample) { - int fetchLimit = limit > 0 ? limit : DEFAULT_FETCH_SIZE; - Long serverVersion = lastServerVersion; - LocationMetadataExample metadataExample = locationMetadataExample; - List locationIdentifiers = locationMetadataMapper.selectManyIds(metadataExample, 0, fetchLimit); - - if (locationIdentifiers != null && !locationIdentifiers.isEmpty()) { - metadataExample = new LocationMetadataExample(); - metadataExample.createCriteria() - .andGeojsonIdEqualTo(locationIdentifiers.get(locationIdentifiers.size() - 1)); - List locationMetadataList = locationMetadataMapper.selectByExample(metadataExample); - - serverVersion = locationMetadataList != null && !locationMetadataList.isEmpty() - ? locationMetadataList.get(0).getServerVersion() - : 0; - } - - return Pair.of(locationIdentifiers, serverVersion); - } - - /** - * {@inheritDoc} - */ - @Override - public Set findParentLocationsInclusive(Set identifiers) { - return locationMetadataMapper.selectLocationHierachy(identifiers, true); - } - - /** - * {@inheritDoc} - */ - @Override - public Set findParentLocationsInclusive(Set identifiers, boolean returnTags) { - return locationMetadataMapper.selectLocationHierachy(identifiers, returnTags); - } - - @Override - public PhysicalLocation findLocationByIdentifierAndStatus(String identifier, List status, - boolean returnGeometry) { - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - locationMetadataExample.createCriteria().andGeojsonIdEqualTo(identifier).andStatusIn(status); - locationMetadataExample.setOrderByClause(getOrderByClause(VERSION, DESCENDING)); - - List locations = locationMetadataMapper.selectManyWithOptionalGeometry(locationMetadataExample, - returnGeometry, 0, 1); - if (locations == null || locations.isEmpty()) { - return null; - } - - PhysicalLocation locationEntity = convert(locations.get(0)); - return locationEntity; - } - - /** - * {@inheritDoc} - */ - @Override - public Long countStructuresByParentAndServerVersion(String parentIds, long serverVersion) { - StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); - structureMetadataExample.createCriteria() - .andParentIdIn(Arrays.asList(org.apache.commons.lang.StringUtils.split(parentIds, ","))) - .andServerVersionGreaterThanOrEqualTo(serverVersion); - return structureMetadataMapper.countByExample(structureMetadataExample); - } - - /** - * {@inheritDoc} - */ - @Override - public Long countLocationsByServerVersion(long serverVersion) { - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - locationMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion) - .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); - return locationMetadataMapper.countByExample(locationMetadataExample); - } - - /** - * {@inheritDoc} - */ - @Override - public Long countLocationsByNames(String locationNames, long serverVersion) { - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - locationMetadataExample.createCriteria() - .andNameIn(Arrays.asList(org.apache.commons.lang.StringUtils.split(locationNames, ","))) - .andServerVersionGreaterThanOrEqualTo(serverVersion) - .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); - return locationMetadataMapper.countByExample(locationMetadataExample); - } - - /** - * {@inheritDoc} - */ - @Override - public long countLocationsByIds(List locationIds, long serverVersion) { - LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); - locationMetadataExample.createCriteria().andGeojsonIdIn(locationIds) - .andServerVersionGreaterThanOrEqualTo(serverVersion) - .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); - return locationMetadataMapper.countByExample(locationMetadataExample); - } - - @Override - public List findLocationAndStocksByJurisdiction(String parentId) { - List locationAndStocks = findLocationAndStocksByJurisdiction(parentId, null, true, -1); - List bundleList = new ArrayList<>(); - for(PhysicalLocationAndStocks physicalLocationAndStock: locationAndStocks){ - bundleList.add(PhysicalLocationAndStocksConverter - .convertLocationAndStocksToBundleResource(physicalLocationAndStock)); - } - return bundleList; - } - - private List convertToPhysicalLocationAndStock(List locationAndStocks){ - if (locationAndStocks == null || locationAndStocks.isEmpty()) { - return new ArrayList<>(); - } - - List convertedLocations = new ArrayList<>(); - for (LocationAndStock locationAndStock : locationAndStocks) { - PhysicalLocationAndStocks convertedLocation = convertToPhysicalLocationAndStock(locationAndStock); - if (convertedLocation != null) { - convertedLocations.add(convertedLocation); - } - } - - return convertedLocations; - } - - @Override - public List findLocationAndStocksByJurisdiction(String parentId, Map properties, - boolean returnGeometry, int limit) { - StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); - if (StringUtils.isNotBlank(parentId)) { - structureMetadataExample.createCriteria().andParentIdEqualTo(parentId); - } - StockMetadataExample stockMetadataExample = new StockMetadataExample(); - stockMetadataExample.createCriteria().andDateDeletedIsNull(); - return convertToPhysicalLocationAndStock(structureMetadataMapper.findStructureAndStocksByJurisdiction(structureMetadataExample, - stockMetadataExample,null, - returnGeometry, 0, limit)); - } - - - private PhysicalLocationAndStocks convertToPhysicalLocationAndStock(LocationAndStock entity) { - if (entity == null || entity.getJson() == null || !(entity.getJson() instanceof PhysicalLocation)) { - return null; - } - - PhysicalLocationAndStocks location = (PhysicalLocationAndStocks) entity.getJson(); - location.setJurisdiction(false); - List stocks = new ArrayList<>(); - for(Stock stock: entity.getStocks()){ - if (stock != null && stock.getJson() != null && (stock.getJson() instanceof org.smartregister.domain.Stock)) { - stocks.add((org.smartregister.domain.Stock) stock.getJson()); - } - } - location.setStocks(stocks); - return location; - } - - @Override - protected Long retrievePrimaryKey(PhysicalLocation entity) { - Object uniqueId = getUniqueField(entity); - if (uniqueId == null) { - return null; - } - - String identifier = uniqueId.toString(); - return retrievePrimaryKey(identifier, entity.isJurisdiction()); - } - - @Override - public Long retrievePrimaryKey(String identifier, boolean isJurisdiction) { - - if (isJurisdiction) { - Location pgEntity = locationMetadataMapper.findById(identifier, true, false); - if (pgEntity == null) { - return null; - } - return pgEntity.getId(); - } else { - Structure pgEntity = structureMetadataMapper.findById(identifier, true); - if (pgEntity == null) { - return null; - } - return pgEntity.getId(); - } - } - - @Override - public PhysicalLocation get(String id, boolean returnGeometry, int version) { - return convert(locationMetadataMapper.findByIdAndVersion(id, true, version)); - } - - @Override - protected Object getUniqueField(PhysicalLocation entity) { - if (entity == null) { - return null; - } - return entity.getId(); - } - - private PhysicalLocation convert(Location entity) { - if (entity == null || entity.getJson() == null || !(entity.getJson() instanceof PhysicalLocation)) { - return null; - } - - PhysicalLocation location = (PhysicalLocation) entity.getJson(); - location.setJurisdiction(true); - return location; - } - - private PhysicalLocation convert(Structure entity) { - if (entity == null || entity.getJson() == null || !(entity.getJson() instanceof PhysicalLocation)) { - return null; - } - return (PhysicalLocation) entity.getJson(); - } - - private List convert(List locations) { - if (locations == null || locations.isEmpty()) { - return new ArrayList<>(); - } - - List convertedLocations = new ArrayList<>(); - for (Location location : locations) { - PhysicalLocation convertedLocation = convert(location); - if (convertedLocation != null) { - convertedLocations.add(convertedLocation); - } - } - - return convertedLocations; - } - - private List convertStructures(List structures) { - if (structures == null || structures.isEmpty()) { - return new ArrayList<>(); - } - - List convertedStructures = new ArrayList<>(); - for (Structure structure : structures) { - PhysicalLocation convertedStructure = convert(structure); - if (convertedStructure != null) { - convertedStructures.add(convertedStructure); - } - } - - return convertedStructures; - } - - private Location convert(PhysicalLocation physicalLocation, Long primaryKey) { - if (physicalLocation == null) { - return null; - } - - Location pgLocation = new Location(); - pgLocation.setId(primaryKey); - pgLocation.setJson(physicalLocation); - - return pgLocation; - } - - private Structure convertStructure(PhysicalLocation physicalLocation, Long primaryKey) { - if (physicalLocation == null) { - return null; - } - - Structure pgStructure = new Structure(); - pgStructure.setId(primaryKey); - pgStructure.setJson(physicalLocation); - - return pgStructure; - } - - private LocationMetadata createMetadata(PhysicalLocation entity, Long id) { - LocationMetadata locationMetadata = new LocationMetadata(); - locationMetadata.setLocationId(id); - locationMetadata.setGeojsonId(entity.getId()); - if (entity.getProperties() != null) { - locationMetadata.setParentId(entity.getProperties().getParentId()); - locationMetadata.setUuid(entity.getProperties().getUid()); - locationMetadata.setType(entity.getProperties().getType()); - locationMetadata.setName(entity.getProperties().getName()); - if (entity.getProperties().getStatus() != null) { - locationMetadata.setStatus(entity.getProperties().getStatus().name()); - } - locationMetadata.setVersion(entity.getProperties().getVersion()); - } - locationMetadata.setServerVersion(entity.getServerVersion()); - - if(id != null){ - locationMetadata.setDateEdited(new Date()); - } - return locationMetadata; - } - - private StructureMetadata createStructureMetadata(PhysicalLocation entity, Long id) { - StructureMetadata structureMetadata = new StructureMetadata(); - structureMetadata.setStructureId(id); - structureMetadata.setGeojsonId(entity.getId()); - if (entity.getProperties() != null) { - structureMetadata.setParentId(entity.getProperties().getParentId()); - structureMetadata.setUuid(entity.getProperties().getUid()); - structureMetadata.setType(entity.getProperties().getType()); - structureMetadata.setName(entity.getProperties().getName()); - if (entity.getProperties().getStatus() != null) { - structureMetadata.setStatus(entity.getProperties().getStatus().name()); - } - } - structureMetadata.setServerVersion(entity.getServerVersion()); - - if(id != null){ - structureMetadata.setDateEdited(new Date()); - } - return structureMetadata; - } - - private void saveLocationTag(PhysicalLocation physicalLocation, Long locationId, boolean isUpdate) { - Set locationTagMaps = physicalLocation.getLocationTags(); - - if (isUpdate) { - locationTagService.deleteLocationTagMapByLocationId(locationId); - } - if (locationTagMaps != null) { - for (LocationTag locationTag : locationTagMaps) { - - LocationTagMap locationTagMap = new LocationTagMap(); - locationTagMap.setLocationId(locationId); - locationTagMap.setLocationTagId(locationTag.getId()); - locationTagService.addLocationTagMap(locationTagMap); - - } - } - } - - @Override - public List searchLocations(LocationSearchBean locationSearchBean) { - Integer offset = 0; - if (locationSearchBean.getPageSize() == null || locationSearchBean.getPageSize() == 0) { - return convert(locationMetadataMapper.selectLocations(locationSearchBean, null, null)); - - } else if (locationSearchBean.getPageNumber() != null && locationSearchBean.getPageNumber() == 0) { - throw new IllegalArgumentException("pageNumber should be greater than 0"); - - } else if (locationSearchBean.getPageNumber() != null) { - - offset = locationSearchBean.getPageSize() * (locationSearchBean.getPageNumber() - 1); - } - return convert(locationMetadataMapper.selectLocations(locationSearchBean, offset, locationSearchBean.getPageSize())); - } - - @Override - public int countSearchLocations(LocationSearchBean locationSearchBean) { - return locationMetadataMapper.selectCountLocations(locationSearchBean); - } - - /** - * {@inheritDoc} - */ - @Override - public Set findLocationWithDescendants(String locationId, boolean returnTags) { - return locationMetadataMapper.selectLocationWithDescendants(locationId, returnTags); - } - - /** - * {@inheritDoc} - */ - @Override - public List findStructureCountsForLocation(Set locationIds) { - return structureMetadataMapper.findStructureCountsForLocation(locationIds); - } - - @Override - public List findJurisdictionsById(String id) { - PhysicalLocation location = get(id, false, false); - return location == null ? Collections.emptyList() : convertToFHIRLocation(Collections.singletonList(location)); - } - - @Override - public List findLocationsById(String id) { - PhysicalLocation location=getStructure(id, false); - return location == null ? Collections.emptyList() :convertToFHIRLocation(Collections.singletonList(location)); - } - - @Override - public List findLocationByJurisdiction(String jurisdiction) { - return convertToFHIRLocation(findStructuresByProperties(true, jurisdiction, null, Integer.MAX_VALUE)); - } - - @Override - public List findChildLocationByJurisdiction(String id) { - return locationMetadataMapper.selectChildrenIds(id); - } - - private List convertToFHIRLocation(List locations) { - return locations.stream().map(location -> LocationConverter.convertPhysicalLocationToLocationResource(location)) - .collect(Collectors.toList()); - } + + @Autowired + private CustomLocationMapper locationMapper; + + @Autowired + private CustomLocationMetadataMapper locationMetadataMapper; + + @Autowired + private CustomStructureMapper structureMapper; + + @Autowired + private CustomStructureMetadataMapper structureMetadataMapper; + + @Autowired + private LocationTagService locationTagService; + + @Override + public PhysicalLocation get(String id) { + return convert(locationMetadataMapper.findById(id, true, false)); + } + + @Override + public PhysicalLocation get(String id, boolean returnGeography, boolean includeInactive) { + return convert(locationMetadataMapper.findById(id, returnGeography, includeInactive)); + } + + @Override + public PhysicalLocation getStructure(String id, boolean returnGeography) { + return convert(structureMetadataMapper.findById(id, returnGeography)); + } + + @Override + @Transactional + public void add(PhysicalLocation entity) { + if (getUniqueField(entity) == null) { + return; + } + + if (retrievePrimaryKey(entity) != null) { // PhysicalLocation already added + return; + } + + if (entity.isJurisdiction()) + addLocation(entity); + else + addStructure(entity); + + } + + private void updateLocationServerVersion(Location pgLocation, PhysicalLocation entity) { + long serverVersion = locationMapper.selectServerVersionByPrimaryKey(pgLocation.getId()); + entity.setServerVersion(serverVersion); + pgLocation.setJson(entity); + pgLocation.setServerVersion(null); + int rowsAffected = locationMapper.updateByPrimaryKeySelective(pgLocation); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + } + + private void updateStructureServerVersion(Structure pgStructure, PhysicalLocation entity) { + long serverVersion = structureMapper.selectServerVersionByPrimaryKey(pgStructure.getId()); + entity.setServerVersion(serverVersion); + pgStructure.setJson(entity); + pgStructure.setServerVersion(null); + int rowsAffected = structureMapper.updateByPrimaryKeySelective(pgStructure); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + } + + + private void addLocation(PhysicalLocation entity) { + + Location pgLocation = convert(entity, null); + if (pgLocation == null) { + throw new IllegalStateException(); + } + + int rowsAffected = locationMapper.insertSelectiveAndSetId(pgLocation); + + if (rowsAffected < 1 || pgLocation.getId() == null) { + throw new IllegalStateException(); + } + + updateLocationServerVersion(pgLocation, entity); + + LocationMetadata locationMetadata = createMetadata(entity, pgLocation.getId()); + + locationMetadataMapper.insertSelective(locationMetadata); + saveLocationTag(entity, pgLocation.getId(), false); + } + + private void addStructure(PhysicalLocation entity) { + + Structure pgStructure = convertStructure(entity, null); + if (pgStructure == null) { + throw new IllegalStateException(); + } + + int rowsAffected = structureMapper.insertSelectiveAndSetId(pgStructure); + if (rowsAffected < 1 || pgStructure.getId() == null) { + throw new IllegalStateException(); + } + + updateStructureServerVersion(pgStructure, entity); + + StructureMetadata structureMetadata = createStructureMetadata(entity, pgStructure.getId()); + + structureMetadataMapper.insertSelective(structureMetadata); + + } + + @Override + @Transactional + public void update(PhysicalLocation entity) { + if (getUniqueField(entity) == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { // PhysicalLocation does not exist + return; + } + if (entity.isJurisdiction()) + updateLocation(entity, id); + else + updateStructure(entity, id); + + } + + private void updateLocation(PhysicalLocation entity, Long id) { + Location pgLocation = convert(entity, id); + if (pgLocation == null) { + throw new IllegalStateException(); + } + + + int rowsAffected = locationMapper.updateByPrimaryKeyAndGenerateServerVersion(pgLocation); + if (rowsAffected < 1) { + return; + } + + updateLocationServerVersion(pgLocation, entity); + + + LocationMetadata locationMetadata = createMetadata(entity, pgLocation.getId()); + + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + locationMetadataExample.createCriteria().andLocationIdEqualTo(id); + LocationMetadata metadata = locationMetadataMapper.selectByExample(locationMetadataExample).get(0); + locationMetadata.setId(metadata.getId()); + locationMetadata.setDateCreated(metadata.getDateCreated()); + locationMetadataMapper.updateByPrimaryKey(locationMetadata); + saveLocationTag(entity, pgLocation.getId(), true); + } + + private void updateStructure(PhysicalLocation entity, Long id) { + Structure pgStructure = convertStructure(entity, id); + if (pgStructure == null) { + throw new IllegalStateException(); + } + + + int rowsAffected = structureMapper.updateByPrimaryKeyAndGenerateServerVersion(pgStructure); + if (rowsAffected < 1) { + return; + } + + updateStructureServerVersion(pgStructure, entity); + + StructureMetadata structureMetadata = createStructureMetadata(entity, pgStructure.getId()); + + StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); + structureMetadataExample.createCriteria().andStructureIdEqualTo(id); + StructureMetadata metadata = structureMetadataMapper.selectByExample(structureMetadataExample).get(0); + structureMetadata.setId(metadata.getId()); + structureMetadata.setDateCreated(metadata.getDateCreated()); + structureMetadataMapper.updateByPrimaryKey(structureMetadata); + } + + @Override + public List getAll() { + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + locationMetadataExample.createCriteria().andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); + List locations = locationMetadataMapper.selectMany(locationMetadataExample, 0, DEFAULT_FETCH_SIZE); + return convert(locations); + } + + @Override + public List getAllStructures() { + List structures = structureMetadataMapper.selectMany(new StructureMetadataExample(), 0, + DEFAULT_FETCH_SIZE); + return convertStructures(structures); + } + + @Override + @Transactional + public void safeRemove(PhysicalLocation entity) { + if (entity == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { + return; + } + + if (entity.isJurisdiction()) { + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + locationMetadataExample.createCriteria().andLocationIdEqualTo(id); + int rowsAffected = locationMetadataMapper.deleteByExample(locationMetadataExample); + if (rowsAffected < 1) { + return; + } + + locationMapper.deleteByPrimaryKey(id); + } else { + StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); + structureMetadataExample.createCriteria().andStructureIdEqualTo(id); + int rowsAffected = structureMetadataMapper.deleteByExample(structureMetadataExample); + if (rowsAffected < 1) { + return; + } + + structureMapper.deleteByPrimaryKey(id); + } + + } + + @Override + public List findLocationsByServerVersion(long serverVersion) { + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + locationMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion) + .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); + locationMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + List locations = locationMetadataMapper.selectMany(locationMetadataExample, 0, DEFAULT_FETCH_SIZE); + return convert(locations); + } + + @Override + public List findLocationsByNames(String locationNames, long serverVersion) { + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + locationMetadataExample.createCriteria() + .andNameIn(Arrays.asList(org.apache.commons.lang.StringUtils.split(locationNames, ","))) + .andServerVersionGreaterThanOrEqualTo(serverVersion) + .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); + locationMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + List locations = locationMetadataMapper.selectMany(locationMetadataExample, 0, DEFAULT_FETCH_SIZE); + return convert(locations); + } + + @Override + public List findStructuresByParentAndServerVersion(String parentIds, long serverVersion) { + StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); + structureMetadataExample.createCriteria() + .andParentIdIn(Arrays.asList(org.apache.commons.lang.StringUtils.split(parentIds, ","))) + .andServerVersionGreaterThanOrEqualTo(serverVersion); + structureMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + List locations = structureMetadataMapper.selectMany(structureMetadataExample, 0, DEFAULT_FETCH_SIZE); + return convertStructures(locations); + } + + @Override + public List findByEmptyServerVersion() { + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + locationMetadataExample.createCriteria().andServerVersionEqualTo(0l); + locationMetadataExample.or(locationMetadataExample.createCriteria().andServerVersionIsNull()); + List locations = locationMetadataMapper.selectMany(locationMetadataExample, 0, DEFAULT_FETCH_SIZE); + return convert(locations); + } + + @Override + public List findStructuresByEmptyServerVersion() { + StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); + structureMetadataExample.createCriteria().andServerVersionEqualTo(0l); + structureMetadataExample.or(structureMetadataExample.createCriteria().andServerVersionIsNull()); + List locations = structureMetadataMapper.selectMany(structureMetadataExample, 0, DEFAULT_FETCH_SIZE); + return convertStructures(locations); + } + + @Override + public Collection findStructureAndFamilyDetails(double latitude, double longitude, double radius) { + List pgList = structureMapper.selectStructureAndFamilyWithinRadius(latitude, longitude, + radius); + Map structureDetails = new HashMap<>(); + for (StructureFamilyDetails detail : pgList) { + StructureDetails structure; + if (!structureDetails.containsKey(detail.getId())) { + structure = new StructureDetails(detail.getId(), detail.getParentId(), detail.getType()); + + structureDetails.put(detail.getId(), structure); + } else { + structure = structureDetails.get(detail.getId()); + } + if (StringUtils.isNotBlank(detail.getBaseEntityId())) { + if ("Family".equalsIgnoreCase(detail.getLastName())) + structure.setFamilyId(detail.getBaseEntityId()); + else + structure.getFamilyMembers().add(detail.getBaseEntityId()); + } + } + return structureDetails.values(); + } + + /** + * {@inheritDoc} + */ + @Override + public List findLocationsByProperties(boolean returnGeometry, String parentId, + Map properties) { + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + if (parentId != null) { + locationMetadataExample.createCriteria().andParentIdEqualTo(parentId); + } + List locations = locationMetadataMapper.selectManyByProperties(locationMetadataExample, properties, + returnGeometry, 0, DEFAULT_FETCH_SIZE); + return convert(locations); + } + + /** + * {@inheritDoc} + */ + @Override + public List findStructuresByProperties(boolean returnGeometry, String parentId, + Map properties, int limit) { + int fetchLimit = limit > 0 ? limit : DEFAULT_FETCH_SIZE; + StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); + if (StringUtils.isNotBlank(parentId)) { + structureMetadataExample.createCriteria().andParentIdEqualTo(parentId); + } + List locations = structureMetadataMapper.selectManyByProperties(structureMetadataExample, properties, + returnGeometry, 0, fetchLimit); + return convert(locations); + } + + /** + * {@inheritDoc} + */ + @Override + public List findStructuresByProperties(boolean returnGeometry, String parentId, + Map properties) { + return findStructuresByProperties(returnGeometry, parentId, properties, DEFAULT_FETCH_SIZE); + } + + /** + * {@inheritDoc} + */ + @Override + public List findLocationsByIds(boolean returnGeometry, List ids, Long serverVersion) { + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + if (ids == null || ids.isEmpty()) { + return null; + } + + Criteria criteria = locationMetadataExample.createCriteria().andGeojsonIdIn(ids) + .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); + if (serverVersion != null) { + criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); + } + + List locations = locationMetadataMapper.selectManyWithOptionalGeometry(locationMetadataExample, + returnGeometry, 0, DEFAULT_FETCH_SIZE); + return convert(locations); + } + + /** + * {@inheritDoc} + */ + @Override + public List findLocationsByIdsOrParentIds(boolean returnGeometry, List ids) { + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + if (ids == null || ids.isEmpty()) { + return null; + } + + locationMetadataExample.createCriteria().andGeojsonIdIn(ids) + .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); + + locationMetadataExample.or(locationMetadataExample.createCriteria().andParentIdIn(ids) + .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name()))); + List locations = locationMetadataMapper.selectManyWithOptionalGeometry(locationMetadataExample, + returnGeometry, 0, DEFAULT_FETCH_SIZE); + return convert(locations); + } + + @Override + public Pair, Long> findAllStructureIds(Long serverVersion, int limit) { + Long lastServerVersion = null; + StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); + structureMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); + structureMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + return getStructuresListLongPair(limit, lastServerVersion, structureMetadataExample); + } + + @Override + public Pair, Long> findAllStructureIds(Long serverVersion, int limit, Date fromDate, Date toDate) { + if (fromDate == null && toDate == null) { + return findAllStructureIds(serverVersion, limit); + } else { + Long lastServerVersion = null; + StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); + structureMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + StructureMetadataExample.Criteria criteria = structureMetadataExample.createCriteria(); + criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); + if (toDate != null && fromDate != null) { + criteria.andDateCreatedBetween(fromDate, toDate); + } else if (fromDate != null) { + criteria.andDateCreatedGreaterThanOrEqualTo(fromDate); + } else { + criteria.andDateCreatedLessThanOrEqualTo(toDate); + } + + return getStructuresListLongPair(limit, lastServerVersion, structureMetadataExample); + } + + } + + private Pair, Long> getStructuresListLongPair(int limit, Long lastServerVersion, + StructureMetadataExample structureMetadataExample) { + int fetchLimit = limit > 0 ? limit : DEFAULT_FETCH_SIZE; + Long serverVersion = lastServerVersion; + StructureMetadataExample example = structureMetadataExample; + List structureIdentifiers = structureMetadataMapper.selectManyIds(example, 0, fetchLimit); + + if (structureIdentifiers != null && !structureIdentifiers.isEmpty()) { + example = new StructureMetadataExample(); + example.createCriteria() + .andGeojsonIdEqualTo(structureIdentifiers.get(structureIdentifiers.size() - 1)); + List structureMetaDataList = structureMetadataMapper + .selectByExample(example); + + serverVersion = structureMetaDataList != null && !structureMetaDataList.isEmpty() + ? structureMetaDataList.get(0).getServerVersion() + : 0; + } + + return Pair.of(structureIdentifiers, serverVersion); + } + + /** + * {@inheritDoc} + */ + @Override + public Set findLocationDetailsByPlanId(String planIdentifier) { + + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + locationMetadataExample.createCriteria().andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); + return locationMetadataMapper.selectDetailsByPlanId(locationMetadataExample, planIdentifier); + } + + /** + * {@inheritDoc} + */ + @Override + public List findLocationByIdWithChildren(boolean returnGeometry, String id, int pageSize) { + return findLocationByIdsWithChildren(returnGeometry, Collections.singleton(id), pageSize); + } + + /** + * {@inheritDoc} + */ + @Override + public List findLocationByIdsWithChildren(boolean returnGeometry, Set identifiers, + int pageSize) { + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + if (identifiers == null) { + return null; + } + + int limit = Math.abs(pageSize); + List locations = locationMetadataMapper.selectWithChildren(locationMetadataExample, returnGeometry, + identifiers, 0, limit); + return convert(locations); + } + + /** + * {@inheritDoc} + */ + @Override + public List findAllLocations(boolean returnGeometry, Long serverVersion, int limit, boolean includeInactive) { + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + LocationMetadataExample.Criteria criteria = locationMetadataExample.createCriteria(); + if (!includeInactive) { + criteria.andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); + } + criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); + locationMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + + List locations = locationMetadataMapper.selectManyWithOptionalGeometry(locationMetadataExample, + returnGeometry, 0, limit); + return convert(locations); + } + + /** + * {@inheritDoc} + */ + @Override + public Long countAllLocations(Long serverVersion) { + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + locationMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion) + .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); + return locationMetadataMapper.countMany(locationMetadataExample); + } + + /** + * {@inheritDoc} + */ + @Override + public List findAllStructures(boolean returnGeometry, Long serverVersion, int limit, Integer pageNumber, String orderByType, String orderByFieldName) { + StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); + structureMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); + String sortBy = orderByFieldName != null ? orderByFieldName : null; + String sortOrder = orderByType != null ? orderByType : null; + if (sortBy != null && sortOrder != null) { + structureMetadataExample.setOrderByClause(getOrderByClause(sortBy, sortOrder)); + } else { + structureMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + } + Pair pageLimitAndOffSet = RepositoryUtil.getPageSizeAndOffset(pageNumber, limit); + List locations = structureMetadataMapper.selectManyByProperties(structureMetadataExample, null, + returnGeometry, pageLimitAndOffSet.getRight(), pageLimitAndOffSet.getLeft()); + return convert(locations); + } + + /** + * {@inheritDoc} + */ + @Override + public Long countAllStructures(Long serverVersion) { + StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); + structureMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); + return structureMetadataMapper.countMany(structureMetadataExample); + } + + /** + * {@inheritDoc} + */ + @Override + public Pair, Long> findAllLocationIds(Long serverVersion, int limit) { + Long lastServerVersion = null; + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + locationMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); + locationMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + + return getLocationListLongPair(limit, lastServerVersion, locationMetadataExample); + } + + @Override + public Pair, Long> findAllLocationIds(Long serverVersion, int limit, Date fromDate, Date toDate) { + if (fromDate == null && toDate == null) { + return findAllLocationIds(serverVersion, limit); + } else { + Long lastServerVersion = null; + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + LocationMetadataExample.Criteria criteria = locationMetadataExample.createCriteria(); + criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); + locationMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + if (toDate != null && fromDate != null) { + criteria.andDateCreatedBetween(fromDate, toDate); + } else if (fromDate != null) { + criteria.andDateCreatedGreaterThanOrEqualTo(fromDate); + } else { + criteria.andDateCreatedLessThanOrEqualTo(toDate); + } + return getLocationListLongPair(limit, lastServerVersion, locationMetadataExample); + } + } + + private Pair, Long> getLocationListLongPair(int limit, Long lastServerVersion, + LocationMetadataExample locationMetadataExample) { + int fetchLimit = limit > 0 ? limit : DEFAULT_FETCH_SIZE; + Long serverVersion = lastServerVersion; + LocationMetadataExample metadataExample = locationMetadataExample; + List locationIdentifiers = locationMetadataMapper.selectManyIds(metadataExample, 0, fetchLimit); + + if (locationIdentifiers != null && !locationIdentifiers.isEmpty()) { + metadataExample = new LocationMetadataExample(); + metadataExample.createCriteria() + .andGeojsonIdEqualTo(locationIdentifiers.get(locationIdentifiers.size() - 1)); + List locationMetadataList = locationMetadataMapper.selectByExample(metadataExample); + + serverVersion = locationMetadataList != null && !locationMetadataList.isEmpty() + ? locationMetadataList.get(0).getServerVersion() + : 0; + } + + return Pair.of(locationIdentifiers, serverVersion); + } + + /** + * {@inheritDoc} + */ + @Override + public Set findParentLocationsInclusive(Set identifiers) { + return locationMetadataMapper.selectLocationHierachy(identifiers, true); + } + + /** + * {@inheritDoc} + */ + @Override + public Set findParentLocationsInclusive(Set identifiers, boolean returnTags) { + return locationMetadataMapper.selectLocationHierachy(identifiers, returnTags); + } + + @Override + public PhysicalLocation findLocationByIdentifierAndStatus(String identifier, List status, + boolean returnGeometry) { + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + locationMetadataExample.createCriteria().andGeojsonIdEqualTo(identifier).andStatusIn(status); + locationMetadataExample.setOrderByClause(getOrderByClause(VERSION, DESCENDING)); + + List locations = locationMetadataMapper.selectManyWithOptionalGeometry(locationMetadataExample, + returnGeometry, 0, 1); + if (locations == null || locations.isEmpty()) { + return null; + } + + PhysicalLocation locationEntity = convert(locations.get(0)); + return locationEntity; + } + + /** + * {@inheritDoc} + */ + @Override + public Long countStructuresByParentAndServerVersion(String parentIds, long serverVersion) { + StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); + structureMetadataExample.createCriteria() + .andParentIdIn(Arrays.asList(org.apache.commons.lang.StringUtils.split(parentIds, ","))) + .andServerVersionGreaterThanOrEqualTo(serverVersion); + return structureMetadataMapper.countByExample(structureMetadataExample); + } + + /** + * {@inheritDoc} + */ + @Override + public Long countLocationsByServerVersion(long serverVersion) { + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + locationMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion) + .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); + return locationMetadataMapper.countByExample(locationMetadataExample); + } + + /** + * {@inheritDoc} + */ + @Override + public Long countLocationsByNames(String locationNames, long serverVersion) { + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + locationMetadataExample.createCriteria() + .andNameIn(Arrays.asList(org.apache.commons.lang.StringUtils.split(locationNames, ","))) + .andServerVersionGreaterThanOrEqualTo(serverVersion) + .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); + return locationMetadataMapper.countByExample(locationMetadataExample); + } + + /** + * {@inheritDoc} + */ + @Override + public long countLocationsByIds(List locationIds, long serverVersion) { + LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); + locationMetadataExample.createCriteria().andGeojsonIdIn(locationIds) + .andServerVersionGreaterThanOrEqualTo(serverVersion) + .andStatusIn(Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name())); + return locationMetadataMapper.countByExample(locationMetadataExample); + } + + @Override + public List findLocationAndStocksByJurisdiction(String parentId) { + List locationAndStocks = findLocationAndStocksByJurisdiction(parentId, null, true, -1); + List bundleList = new ArrayList<>(); + for (PhysicalLocationAndStocks physicalLocationAndStock : locationAndStocks) { + bundleList.add(PhysicalLocationAndStocksConverter + .convertLocationAndStocksToBundleResource(physicalLocationAndStock)); + } + return bundleList; + } + + private List convertToPhysicalLocationAndStock(List locationAndStocks) { + if (locationAndStocks == null || locationAndStocks.isEmpty()) { + return new ArrayList<>(); + } + + List convertedLocations = new ArrayList<>(); + for (LocationAndStock locationAndStock : locationAndStocks) { + PhysicalLocationAndStocks convertedLocation = convertToPhysicalLocationAndStock(locationAndStock); + if (convertedLocation != null) { + convertedLocations.add(convertedLocation); + } + } + + return convertedLocations; + } + + @Override + public List findLocationAndStocksByJurisdiction(String parentId, Map properties, + boolean returnGeometry, int limit) { + StructureMetadataExample structureMetadataExample = new StructureMetadataExample(); + if (StringUtils.isNotBlank(parentId)) { + structureMetadataExample.createCriteria().andParentIdEqualTo(parentId); + } + StockMetadataExample stockMetadataExample = new StockMetadataExample(); + stockMetadataExample.createCriteria().andDateDeletedIsNull(); + return convertToPhysicalLocationAndStock(structureMetadataMapper.findStructureAndStocksByJurisdiction(structureMetadataExample, + stockMetadataExample, null, + returnGeometry, 0, limit)); + } + + + private PhysicalLocationAndStocks convertToPhysicalLocationAndStock(LocationAndStock entity) { + if (entity == null || entity.getJson() == null || !(entity.getJson() instanceof PhysicalLocation)) { + return null; + } + + PhysicalLocationAndStocks location = (PhysicalLocationAndStocks) entity.getJson(); + location.setJurisdiction(false); + List stocks = new ArrayList<>(); + for (Stock stock : entity.getStocks()) { + if (stock != null && stock.getJson() != null && (stock.getJson() instanceof org.smartregister.domain.Stock)) { + stocks.add((org.smartregister.domain.Stock) stock.getJson()); + } + } + location.setStocks(stocks); + return location; + } + + @Override + protected Long retrievePrimaryKey(PhysicalLocation entity) { + Object uniqueId = getUniqueField(entity); + if (uniqueId == null) { + return null; + } + + String identifier = uniqueId.toString(); + return retrievePrimaryKey(identifier, entity.isJurisdiction()); + } + + @Override + public Long retrievePrimaryKey(String identifier, boolean isJurisdiction) { + + if (isJurisdiction) { + Location pgEntity = locationMetadataMapper.findById(identifier, true, false); + if (pgEntity == null) { + return null; + } + return pgEntity.getId(); + } else { + Structure pgEntity = structureMetadataMapper.findById(identifier, true); + if (pgEntity == null) { + return null; + } + return pgEntity.getId(); + } + } + + @Override + public PhysicalLocation get(String id, boolean returnGeometry, int version) { + return convert(locationMetadataMapper.findByIdAndVersion(id, true, version)); + } + + @Override + protected Object getUniqueField(PhysicalLocation entity) { + if (entity == null) { + return null; + } + return entity.getId(); + } + + private PhysicalLocation convert(Location entity) { + if (entity == null || entity.getJson() == null || !(entity.getJson() instanceof PhysicalLocation)) { + return null; + } + + PhysicalLocation location = (PhysicalLocation) entity.getJson(); + location.setJurisdiction(true); + return location; + } + + private PhysicalLocation convert(Structure entity) { + if (entity == null || entity.getJson() == null || !(entity.getJson() instanceof PhysicalLocation)) { + return null; + } + return (PhysicalLocation) entity.getJson(); + } + + private List convert(List locations) { + if (locations == null || locations.isEmpty()) { + return new ArrayList<>(); + } + + List convertedLocations = new ArrayList<>(); + for (Location location : locations) { + PhysicalLocation convertedLocation = convert(location); + if (convertedLocation != null) { + convertedLocations.add(convertedLocation); + } + } + + return convertedLocations; + } + + private List convertStructures(List structures) { + if (structures == null || structures.isEmpty()) { + return new ArrayList<>(); + } + + List convertedStructures = new ArrayList<>(); + for (Structure structure : structures) { + PhysicalLocation convertedStructure = convert(structure); + if (convertedStructure != null) { + convertedStructures.add(convertedStructure); + } + } + + return convertedStructures; + } + + private Location convert(PhysicalLocation physicalLocation, Long primaryKey) { + if (physicalLocation == null) { + return null; + } + + Location pgLocation = new Location(); + pgLocation.setId(primaryKey); + pgLocation.setJson(physicalLocation); + + return pgLocation; + } + + private Structure convertStructure(PhysicalLocation physicalLocation, Long primaryKey) { + if (physicalLocation == null) { + return null; + } + + Structure pgStructure = new Structure(); + pgStructure.setId(primaryKey); + pgStructure.setJson(physicalLocation); + + return pgStructure; + } + + private LocationMetadata createMetadata(PhysicalLocation entity, Long id) { + LocationMetadata locationMetadata = new LocationMetadata(); + locationMetadata.setLocationId(id); + locationMetadata.setGeojsonId(entity.getId()); + if (entity.getProperties() != null) { + locationMetadata.setParentId(entity.getProperties().getParentId()); + locationMetadata.setUuid(entity.getProperties().getUid()); + locationMetadata.setType(entity.getProperties().getType()); + locationMetadata.setName(entity.getProperties().getName()); + if (entity.getProperties().getStatus() != null) { + locationMetadata.setStatus(entity.getProperties().getStatus().name()); + } + locationMetadata.setVersion(entity.getProperties().getVersion()); + } + locationMetadata.setServerVersion(entity.getServerVersion()); + + if (id != null) { + locationMetadata.setDateEdited(new Date()); + } + return locationMetadata; + } + + private StructureMetadata createStructureMetadata(PhysicalLocation entity, Long id) { + StructureMetadata structureMetadata = new StructureMetadata(); + structureMetadata.setStructureId(id); + structureMetadata.setGeojsonId(entity.getId()); + if (entity.getProperties() != null) { + structureMetadata.setParentId(entity.getProperties().getParentId()); + structureMetadata.setUuid(entity.getProperties().getUid()); + structureMetadata.setType(entity.getProperties().getType()); + structureMetadata.setName(entity.getProperties().getName()); + if (entity.getProperties().getStatus() != null) { + structureMetadata.setStatus(entity.getProperties().getStatus().name()); + } + } + structureMetadata.setServerVersion(entity.getServerVersion()); + + if (id != null) { + structureMetadata.setDateEdited(new Date()); + } + return structureMetadata; + } + + private void saveLocationTag(PhysicalLocation physicalLocation, Long locationId, boolean isUpdate) { + Set locationTagMaps = physicalLocation.getLocationTags(); + + if (isUpdate) { + locationTagService.deleteLocationTagMapByLocationId(locationId); + } + if (locationTagMaps != null) { + for (LocationTag locationTag : locationTagMaps) { + + LocationTagMap locationTagMap = new LocationTagMap(); + locationTagMap.setLocationId(locationId); + locationTagMap.setLocationTagId(locationTag.getId()); + locationTagService.addLocationTagMap(locationTagMap); + + } + } + } + + @Override + public List searchLocations(LocationSearchBean locationSearchBean) { + Integer offset = 0; + if (locationSearchBean.getPageSize() == null || locationSearchBean.getPageSize() == 0) { + return convert(locationMetadataMapper.selectLocations(locationSearchBean, null, null)); + + } else if (locationSearchBean.getPageNumber() != null && locationSearchBean.getPageNumber() == 0) { + throw new IllegalArgumentException("pageNumber should be greater than 0"); + + } else if (locationSearchBean.getPageNumber() != null) { + + offset = locationSearchBean.getPageSize() * (locationSearchBean.getPageNumber() - 1); + } + return convert(locationMetadataMapper.selectLocations(locationSearchBean, offset, locationSearchBean.getPageSize())); + } + + @Override + public int countSearchLocations(LocationSearchBean locationSearchBean) { + return locationMetadataMapper.selectCountLocations(locationSearchBean); + } + + /** + * {@inheritDoc} + */ + @Override + public Set findLocationWithDescendants(String locationId, boolean returnTags) { + return locationMetadataMapper.selectLocationWithDescendants(locationId, returnTags); + } + + /** + * {@inheritDoc} + */ + @Override + public List findStructureCountsForLocation(Set locationIds) { + return structureMetadataMapper.findStructureCountsForLocation(locationIds); + } + + @Override + public List findJurisdictionsById(String id) { + PhysicalLocation location = get(id, false, false); + return location == null ? Collections.emptyList() : convertToFHIRLocation(Collections.singletonList(location)); + } + + @Override + public List findLocationsById(String id) { + PhysicalLocation location = getStructure(id, false); + return location == null ? Collections.emptyList() : convertToFHIRLocation(Collections.singletonList(location)); + } + + @Override + public List findLocationByJurisdiction(String jurisdiction) { + return convertToFHIRLocation(findStructuresByProperties(true, jurisdiction, null, Integer.MAX_VALUE)); + } + + @Override + public List findChildLocationByJurisdiction(String id) { + return locationMetadataMapper.selectChildrenIds(id); + } + + private List convertToFHIRLocation(List locations) { + return locations.stream().map(location -> LocationConverter.convertPhysicalLocationToLocationResource(location)) + .collect(Collectors.toList()); + } } diff --git a/src/main/java/org/opensrp/repository/postgres/LocationTagRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/LocationTagRepositoryImpl.java index 7138c7ba1..6e920be91 100644 --- a/src/main/java/org/opensrp/repository/postgres/LocationTagRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/LocationTagRepositoryImpl.java @@ -21,317 +21,317 @@ @Repository public class LocationTagRepositoryImpl extends BaseRepositoryImpl implements LocationTagRepository { - - @Autowired - private CustomLocationTagMapper locationTagMapper; - - @Autowired - private CustomLocationTagMapMapper locationTagMapMapper; - - @Override - public void add(LocationTag locationTag) { - if (locationTag == null) { - return; - } - if (getUniqueField(locationTag) == null) { - return; - } - - if (retrievePrimaryKey(locationTag) != null) { - throw new DuplicateKeyException("Location tag name already exists"); - - } - - if (getLocationTagByName(locationTag.getName()) != null) { - throw new DuplicateKeyException("Location tag name already exists"); - } - if (locationTag.getName().isEmpty()) { - return; - } - org.opensrp.domain.postgres.LocationTag pgLocationTag = convert(locationTag); - - locationTagMapper.insertSelective(pgLocationTag); - - } - - @Override - public void update(LocationTag locationTag) { - if (locationTag == null) { - return; - } - if (getUniqueField(locationTag) == null) { - return; - } - Long id = locationTag.getId(); - if (id == null) { - return; // location tag does not exist - } - if (locationTag.getName().isEmpty()) { - return; - } - - org.opensrp.domain.postgres.LocationTag getPgLocationTag = getLocationTagByNameAndNotEqualId(locationTag.getName(), - id); - - if (getPgLocationTag == null) { - org.opensrp.domain.postgres.LocationTag pgLocationTag = convert(locationTag); - pgLocationTag.setId(id); - locationTagMapper.updateByPrimaryKey(pgLocationTag); - } else { - throw new DuplicateKeyException("Location tag name already exists"); - - } - - } - - @Override - public List getAll() { - LocationTagExample locationTagExample = new LocationTagExample(); - locationTagExample.createCriteria().andActiveIsNotNull(); - List pgLocationTagList = locationTagMapper.selectMany(locationTagExample, - 0, DEFAULT_FETCH_SIZE); - return convert(pgLocationTagList); - } - - @Override - public void safeRemove(LocationTag locationTag) { - if (locationTag == null) { - return; - } - - Long id = (Long) retrievePrimaryKey(locationTag); - if (id == null) { - return; - } - - org.opensrp.domain.postgres.LocationTag pgLocationTag = convert(locationTag); - pgLocationTag.setId(id); - pgLocationTag.setActive(false); - locationTagMapper.updateByPrimaryKey(pgLocationTag); - - } - - @Override - public LocationTag getLocationTagByPrimaryKey(Long id) { - if (id == null) { - return null; - } - LocationTagExample example = new LocationTagExample(); - example.createCriteria().andIdEqualTo(id); - List locationTags = locationTagMapper.selectByExample(example); - return locationTags.isEmpty() ? null : convert(locationTags.get(0)); - } - - @Override - public void safeRemove(Long id) { - LocationTag locationTag = getLocationTagByPrimaryKey(id); - org.opensrp.domain.postgres.LocationTag pgLocationTag = convert(locationTag); - if (pgLocationTag == null) { - return; - } - pgLocationTag.setId(id); - pgLocationTag.setActive(false); - locationTagMapper.updateByPrimaryKey(pgLocationTag); - - } - - @Override - public org.opensrp.domain.postgres.LocationTag getLocationTagByName(String name) { - if (StringUtils.isBlank(name)) { - return null; - } - - LocationTagExample locationTagExample = new LocationTagExample(); - locationTagExample.createCriteria().andNameEqualTo(name); - List locationTagList = locationTagMapper - .selectByExample(locationTagExample); - - return isEmptyList(locationTagList) ? null : locationTagList.get(0); - } - - @Override - protected Object retrievePrimaryKey(LocationTag locationTag) { - Object uniqueId = getUniqueField(locationTag); - if (uniqueId == null) { - return null; - } - - String name = uniqueId.toString(); - org.opensrp.domain.postgres.LocationTag pgLocationTag = getLocationTagByName(name); - - return pgLocationTag == null ? null : pgLocationTag.getId(); - } - - @Override - protected Object getUniqueField(LocationTag locationTag) { - return locationTag == null ? null : locationTag.getName(); - } - - @Override - public LocationTag get(String id) { - throw new NotImplementedException(); - } - - private LocationTag convert(org.opensrp.domain.postgres.LocationTag pgLocationTag) { - if (pgLocationTag == null) { - return null; - } - LocationTag locationTag = new LocationTag(); - - locationTag.setName(pgLocationTag.getName()); - locationTag.setId(pgLocationTag.getId()); - locationTag.setActive(pgLocationTag.getActive()); - locationTag.setDescription(pgLocationTag.getDescription()); - - return locationTag; - } - - private org.opensrp.domain.postgres.LocationTag convert(LocationTag locationTag) { - if (locationTag == null) { - return null; - } - org.opensrp.domain.postgres.LocationTag pgLocationTag = new org.opensrp.domain.postgres.LocationTag(); - pgLocationTag.setName(locationTag.getName()); - locationTag.setId(pgLocationTag.getId()); - pgLocationTag.setActive(locationTag.getActive()); - pgLocationTag.setDescription(locationTag.getDescription()); - - return pgLocationTag; - } - - private List convert(List pgLocationTags) { - List locationTags = new ArrayList<>(); - if (isEmptyList(pgLocationTags)) { - return locationTags; - } - for (org.opensrp.domain.postgres.LocationTag pgLocationTag : pgLocationTags) { - locationTags.add(convert(pgLocationTag)); - } - return locationTags; - } - - @Override - public org.opensrp.domain.postgres.LocationTag getLocationTagByNameAndNotEqualId(String name, Long id) { - if (StringUtils.isBlank(name)) { - return null; - } - if (id != 0) { - return null; - } - - LocationTagExample locationTagExample = new LocationTagExample(); - locationTagExample.createCriteria().andNameEqualTo(name).andIdNotEqualTo(id); - List locationTagList = locationTagMapper - .selectByExample(locationTagExample); - - return isEmptyList(locationTagList) ? null : locationTagList.get(0); - } - - @Override - public List findByLocationTagExample(LocationTagExample locationTagExample, int offset, int limit) { - List pgLocationTagList = locationTagMapper.selectMany(locationTagExample, - offset, limit); - return convert(pgLocationTagList); - } - - private LocationTagMap convertLocationTagMap(org.opensrp.domain.postgres.LocationTagMap pgLocationTagMap) { - if (pgLocationTagMap == null) { - return null; - } - LocationTagMap locationTagmap = new LocationTagMap(); - - locationTagmap.setLocationId(pgLocationTagMap.getLocationId()); - locationTagmap.setLocationTagId(pgLocationTagMap.getLocationTagId()); - - return locationTagmap; - } - - private org.opensrp.domain.postgres.LocationTagMap convertLocationTagMap(LocationTagMap locationTagMap) { - if (locationTagMap == null) { - return null; - } - org.opensrp.domain.postgres.LocationTagMap pgLocationTagMap = new org.opensrp.domain.postgres.LocationTagMap(); - pgLocationTagMap.setLocationId(locationTagMap.getLocationId()); - pgLocationTagMap.setLocationTagId(locationTagMap.getLocationTagId()); - - return pgLocationTagMap; - } - - private List convertLocationTagMap(List pgLocationTagMaps) { - List locationTagMaps = new ArrayList<>(); - if (isEmptyList(pgLocationTagMaps)) { - return locationTagMaps; - } - for (org.opensrp.domain.postgres.LocationTagMap pgLocationTagMap : pgLocationTagMaps) { - locationTagMaps.add(convertLocationTagMap(pgLocationTagMap)); - } - return locationTagMaps; - } - - @Override - public int addLocationTagMap(LocationTagMap locationTagMap) { - org.opensrp.domain.postgres.LocationTagMap pgLocationTagMap = convertLocationTagMap(locationTagMap); - validateLocationTagMap(locationTagMap.getLocationId(), locationTagMap.getLocationTagId()); - - if (getLocationTagMapByExample(locationTagMap.getLocationId(), locationTagMap.getLocationTagId()).size() != 0) { - throw new DuplicateKeyException("Location tag map already exists"); - - } - - return locationTagMapMapper.insertSelective(pgLocationTagMap); - - } - - @Override - public void deleteLocationTagMapByLocationIdAndLocationTagId(Long locationId, Long locationTagId) { - - validateLocationTagMap(locationId, locationTagId); - LocationTagMapExample example = new LocationTagMapExample(); - example.createCriteria().andLocationIdEqualTo(locationId).andLocationTagIdEqualTo(locationTagId); - - locationTagMapMapper.deleteByExample(example); - - } - - @Override - public List getLocationTagMapByExample(Long locationId, Long locationTagId) { - LocationTagMapExample example = createLocationTagMapExample(locationId, locationTagId); - return convertLocationTagMap(locationTagMapMapper.selectByExample(example)); - } - - private LocationTagMapExample createLocationTagMapExample(Long locationId, Long locationTagId) { - LocationTagMapExample example = new LocationTagMapExample(); - Criteria criteria = example.createCriteria(); - if (locationId != null) { - criteria.andLocationIdEqualTo(locationId); - } - if (locationTagId != null) { - criteria.andLocationTagIdEqualTo(locationTagId); - - } - return example; - - } - - private void validateLocationTagMap(Long locationId, Long locationTagId) { - if (locationId == null || locationId == 0) { - throw new IllegalArgumentException("Location id not specified"); - } - if (locationTagId == null || locationTagId == 0) { - throw new IllegalArgumentException("location tag id not specified"); - } - } - - @Override - public void deleteLocationTagMapByLocationId(Long locationId) { - if (locationId == null || locationId == 0) { - throw new IllegalArgumentException("Location id not specified"); - } - LocationTagMapExample example = new LocationTagMapExample(); - example.createCriteria().andLocationIdEqualTo(locationId); - - locationTagMapMapper.deleteByExample(example); - - } - + + @Autowired + private CustomLocationTagMapper locationTagMapper; + + @Autowired + private CustomLocationTagMapMapper locationTagMapMapper; + + @Override + public void add(LocationTag locationTag) { + if (locationTag == null) { + return; + } + if (getUniqueField(locationTag) == null) { + return; + } + + if (retrievePrimaryKey(locationTag) != null) { + throw new DuplicateKeyException("Location tag name already exists"); + + } + + if (getLocationTagByName(locationTag.getName()) != null) { + throw new DuplicateKeyException("Location tag name already exists"); + } + if (locationTag.getName().isEmpty()) { + return; + } + org.opensrp.domain.postgres.LocationTag pgLocationTag = convert(locationTag); + + locationTagMapper.insertSelective(pgLocationTag); + + } + + @Override + public void update(LocationTag locationTag) { + if (locationTag == null) { + return; + } + if (getUniqueField(locationTag) == null) { + return; + } + Long id = locationTag.getId(); + if (id == null) { + return; // location tag does not exist + } + if (locationTag.getName().isEmpty()) { + return; + } + + org.opensrp.domain.postgres.LocationTag getPgLocationTag = getLocationTagByNameAndNotEqualId(locationTag.getName(), + id); + + if (getPgLocationTag == null) { + org.opensrp.domain.postgres.LocationTag pgLocationTag = convert(locationTag); + pgLocationTag.setId(id); + locationTagMapper.updateByPrimaryKey(pgLocationTag); + } else { + throw new DuplicateKeyException("Location tag name already exists"); + + } + + } + + @Override + public List getAll() { + LocationTagExample locationTagExample = new LocationTagExample(); + locationTagExample.createCriteria().andActiveIsNotNull(); + List pgLocationTagList = locationTagMapper.selectMany(locationTagExample, + 0, DEFAULT_FETCH_SIZE); + return convert(pgLocationTagList); + } + + @Override + public void safeRemove(LocationTag locationTag) { + if (locationTag == null) { + return; + } + + Long id = (Long) retrievePrimaryKey(locationTag); + if (id == null) { + return; + } + + org.opensrp.domain.postgres.LocationTag pgLocationTag = convert(locationTag); + pgLocationTag.setId(id); + pgLocationTag.setActive(false); + locationTagMapper.updateByPrimaryKey(pgLocationTag); + + } + + @Override + public LocationTag getLocationTagByPrimaryKey(Long id) { + if (id == null) { + return null; + } + LocationTagExample example = new LocationTagExample(); + example.createCriteria().andIdEqualTo(id); + List locationTags = locationTagMapper.selectByExample(example); + return locationTags.isEmpty() ? null : convert(locationTags.get(0)); + } + + @Override + public void safeRemove(Long id) { + LocationTag locationTag = getLocationTagByPrimaryKey(id); + org.opensrp.domain.postgres.LocationTag pgLocationTag = convert(locationTag); + if (pgLocationTag == null) { + return; + } + pgLocationTag.setId(id); + pgLocationTag.setActive(false); + locationTagMapper.updateByPrimaryKey(pgLocationTag); + + } + + @Override + public org.opensrp.domain.postgres.LocationTag getLocationTagByName(String name) { + if (StringUtils.isBlank(name)) { + return null; + } + + LocationTagExample locationTagExample = new LocationTagExample(); + locationTagExample.createCriteria().andNameEqualTo(name); + List locationTagList = locationTagMapper + .selectByExample(locationTagExample); + + return isEmptyList(locationTagList) ? null : locationTagList.get(0); + } + + @Override + protected Object retrievePrimaryKey(LocationTag locationTag) { + Object uniqueId = getUniqueField(locationTag); + if (uniqueId == null) { + return null; + } + + String name = uniqueId.toString(); + org.opensrp.domain.postgres.LocationTag pgLocationTag = getLocationTagByName(name); + + return pgLocationTag == null ? null : pgLocationTag.getId(); + } + + @Override + protected Object getUniqueField(LocationTag locationTag) { + return locationTag == null ? null : locationTag.getName(); + } + + @Override + public LocationTag get(String id) { + throw new NotImplementedException(); + } + + private LocationTag convert(org.opensrp.domain.postgres.LocationTag pgLocationTag) { + if (pgLocationTag == null) { + return null; + } + LocationTag locationTag = new LocationTag(); + + locationTag.setName(pgLocationTag.getName()); + locationTag.setId(pgLocationTag.getId()); + locationTag.setActive(pgLocationTag.getActive()); + locationTag.setDescription(pgLocationTag.getDescription()); + + return locationTag; + } + + private org.opensrp.domain.postgres.LocationTag convert(LocationTag locationTag) { + if (locationTag == null) { + return null; + } + org.opensrp.domain.postgres.LocationTag pgLocationTag = new org.opensrp.domain.postgres.LocationTag(); + pgLocationTag.setName(locationTag.getName()); + locationTag.setId(pgLocationTag.getId()); + pgLocationTag.setActive(locationTag.getActive()); + pgLocationTag.setDescription(locationTag.getDescription()); + + return pgLocationTag; + } + + private List convert(List pgLocationTags) { + List locationTags = new ArrayList<>(); + if (isEmptyList(pgLocationTags)) { + return locationTags; + } + for (org.opensrp.domain.postgres.LocationTag pgLocationTag : pgLocationTags) { + locationTags.add(convert(pgLocationTag)); + } + return locationTags; + } + + @Override + public org.opensrp.domain.postgres.LocationTag getLocationTagByNameAndNotEqualId(String name, Long id) { + if (StringUtils.isBlank(name)) { + return null; + } + if (id != 0) { + return null; + } + + LocationTagExample locationTagExample = new LocationTagExample(); + locationTagExample.createCriteria().andNameEqualTo(name).andIdNotEqualTo(id); + List locationTagList = locationTagMapper + .selectByExample(locationTagExample); + + return isEmptyList(locationTagList) ? null : locationTagList.get(0); + } + + @Override + public List findByLocationTagExample(LocationTagExample locationTagExample, int offset, int limit) { + List pgLocationTagList = locationTagMapper.selectMany(locationTagExample, + offset, limit); + return convert(pgLocationTagList); + } + + private LocationTagMap convertLocationTagMap(org.opensrp.domain.postgres.LocationTagMap pgLocationTagMap) { + if (pgLocationTagMap == null) { + return null; + } + LocationTagMap locationTagmap = new LocationTagMap(); + + locationTagmap.setLocationId(pgLocationTagMap.getLocationId()); + locationTagmap.setLocationTagId(pgLocationTagMap.getLocationTagId()); + + return locationTagmap; + } + + private org.opensrp.domain.postgres.LocationTagMap convertLocationTagMap(LocationTagMap locationTagMap) { + if (locationTagMap == null) { + return null; + } + org.opensrp.domain.postgres.LocationTagMap pgLocationTagMap = new org.opensrp.domain.postgres.LocationTagMap(); + pgLocationTagMap.setLocationId(locationTagMap.getLocationId()); + pgLocationTagMap.setLocationTagId(locationTagMap.getLocationTagId()); + + return pgLocationTagMap; + } + + private List convertLocationTagMap(List pgLocationTagMaps) { + List locationTagMaps = new ArrayList<>(); + if (isEmptyList(pgLocationTagMaps)) { + return locationTagMaps; + } + for (org.opensrp.domain.postgres.LocationTagMap pgLocationTagMap : pgLocationTagMaps) { + locationTagMaps.add(convertLocationTagMap(pgLocationTagMap)); + } + return locationTagMaps; + } + + @Override + public int addLocationTagMap(LocationTagMap locationTagMap) { + org.opensrp.domain.postgres.LocationTagMap pgLocationTagMap = convertLocationTagMap(locationTagMap); + validateLocationTagMap(locationTagMap.getLocationId(), locationTagMap.getLocationTagId()); + + if (getLocationTagMapByExample(locationTagMap.getLocationId(), locationTagMap.getLocationTagId()).size() != 0) { + throw new DuplicateKeyException("Location tag map already exists"); + + } + + return locationTagMapMapper.insertSelective(pgLocationTagMap); + + } + + @Override + public void deleteLocationTagMapByLocationIdAndLocationTagId(Long locationId, Long locationTagId) { + + validateLocationTagMap(locationId, locationTagId); + LocationTagMapExample example = new LocationTagMapExample(); + example.createCriteria().andLocationIdEqualTo(locationId).andLocationTagIdEqualTo(locationTagId); + + locationTagMapMapper.deleteByExample(example); + + } + + @Override + public List getLocationTagMapByExample(Long locationId, Long locationTagId) { + LocationTagMapExample example = createLocationTagMapExample(locationId, locationTagId); + return convertLocationTagMap(locationTagMapMapper.selectByExample(example)); + } + + private LocationTagMapExample createLocationTagMapExample(Long locationId, Long locationTagId) { + LocationTagMapExample example = new LocationTagMapExample(); + Criteria criteria = example.createCriteria(); + if (locationId != null) { + criteria.andLocationIdEqualTo(locationId); + } + if (locationTagId != null) { + criteria.andLocationTagIdEqualTo(locationTagId); + + } + return example; + + } + + private void validateLocationTagMap(Long locationId, Long locationTagId) { + if (locationId == null || locationId == 0) { + throw new IllegalArgumentException("Location id not specified"); + } + if (locationTagId == null || locationTagId == 0) { + throw new IllegalArgumentException("location tag id not specified"); + } + } + + @Override + public void deleteLocationTagMapByLocationId(Long locationId) { + if (locationId == null || locationId == 0) { + throw new IllegalArgumentException("Location id not specified"); + } + LocationTagMapExample example = new LocationTagMapExample(); + example.createCriteria().andLocationIdEqualTo(locationId); + + locationTagMapMapper.deleteByExample(example); + + } + } diff --git a/src/main/java/org/opensrp/repository/postgres/ManifestRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/ManifestRepositoryImpl.java index 00bca5923..534439c8c 100644 --- a/src/main/java/org/opensrp/repository/postgres/ManifestRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/ManifestRepositoryImpl.java @@ -90,7 +90,7 @@ public Manifest getManifestByAppId(String appId) { } List manifestList = manifestMapper.selectByAppId(appId); - + if (manifestList == null) { return null; } diff --git a/src/main/java/org/opensrp/repository/postgres/MultimediaRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/MultimediaRepositoryImpl.java index 9dea6b2df..f00afeb1a 100644 --- a/src/main/java/org/opensrp/repository/postgres/MultimediaRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/MultimediaRepositoryImpl.java @@ -14,197 +14,196 @@ @Repository("multimediaRepositoryPostgres") public class MultimediaRepositoryImpl extends BaseRepositoryImpl implements MultimediaRepository { - - @Autowired - private CustomMultiMediaMapper multiMediaMapper; - - @Override - public Multimedia get(String id) { - MultiMediaExample example = new MultiMediaExample(); - example.createCriteria().andDocumentIdEqualTo(id); - List files = multiMediaMapper.selectByExample(example); - return files.isEmpty() ? null : convert(files.get(0)); - } + + @Autowired + private CustomMultiMediaMapper multiMediaMapper; + + @Override + public Multimedia get(String id) { + MultiMediaExample example = new MultiMediaExample(); + example.createCriteria().andDocumentIdEqualTo(id); + List files = multiMediaMapper.selectByExample(example); + return files.isEmpty() ? null : convert(files.get(0)); + } /** - *{@inheritDoc} + * {@inheritDoc} */ - @Override - public List get(String entityId, String contentType, String fileCategory) { - MultiMediaExample example = new MultiMediaExample(); - example.createCriteria().andCaseIdEqualTo(entityId).andContentTypeEqualTo(contentType).andFileCategoryEqualTo(fileCategory); - List files = multiMediaMapper.selectByExample(example); - return convert(files); - } - - /** - *{@inheritDoc} - */ - @Override - public List getByProviderID(String providerID, String fileCategory, int offset, int count) { - MultiMediaExample example = new MultiMediaExample(); - example.createCriteria().andProviderIdEqualTo(providerID).andFileCategoryEqualTo(fileCategory); - return convert(multiMediaMapper.selectMany(example, offset, count)); - } - - @Override - public void add(Multimedia entity) { - if (entity == null || entity.getCaseId() == null) { - return; - } - - if (retrievePrimaryKey(entity) != null) { //Multimedia already added - return; - } - - if (entity.getId() == null || entity.getId().isEmpty()) - entity.setId(UUID.randomUUID().toString()); - setRevision(entity); - - MultiMedia pgMultiMedia = convert(entity, null); - if (pgMultiMedia == null) { - return; - } - - multiMediaMapper.insertSelective(pgMultiMedia); - - } - - @Override - public void update(Multimedia entity) { - if (entity == null || entity.getId() == null || entity.getCaseId() == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - - if (id == null) { //Multimedia doesn't not exist - return; - } - setRevision(entity); - - MultiMedia pgEntity = convert(entity, id); - multiMediaMapper.updateByPrimaryKey(pgEntity); - - } - - @Override - public List getAll() { - return convert(multiMediaMapper.selectMany(new MultiMediaExample(), 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public void safeRemove(Multimedia entity) { - if (entity == null || entity.getCaseId() == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { - return; - } - - multiMediaMapper.deleteByPrimaryKey(id); - - } + @Override + public List get(String entityId, String contentType, String fileCategory) { + MultiMediaExample example = new MultiMediaExample(); + example.createCriteria().andCaseIdEqualTo(entityId).andContentTypeEqualTo(contentType).andFileCategoryEqualTo(fileCategory); + List files = multiMediaMapper.selectByExample(example); + return convert(files); + } + + /** + * {@inheritDoc} + */ + @Override + public List getByProviderID(String providerID, String fileCategory, int offset, int count) { + MultiMediaExample example = new MultiMediaExample(); + example.createCriteria().andProviderIdEqualTo(providerID).andFileCategoryEqualTo(fileCategory); + return convert(multiMediaMapper.selectMany(example, offset, count)); + } + + @Override + public void add(Multimedia entity) { + if (entity == null || entity.getCaseId() == null) { + return; + } + + if (retrievePrimaryKey(entity) != null) { //Multimedia already added + return; + } + + if (entity.getId() == null || entity.getId().isEmpty()) + entity.setId(UUID.randomUUID().toString()); + setRevision(entity); + + MultiMedia pgMultiMedia = convert(entity, null); + if (pgMultiMedia == null) { + return; + } + + multiMediaMapper.insertSelective(pgMultiMedia); + + } + + @Override + public void update(Multimedia entity) { + if (entity == null || entity.getId() == null || entity.getCaseId() == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + + if (id == null) { //Multimedia doesn't not exist + return; + } + setRevision(entity); + + MultiMedia pgEntity = convert(entity, id); + multiMediaMapper.updateByPrimaryKey(pgEntity); + + } + + @Override + public List getAll() { + return convert(multiMediaMapper.selectMany(new MultiMediaExample(), 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public void safeRemove(Multimedia entity) { + if (entity == null || entity.getCaseId() == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { + return; + } + + multiMediaMapper.deleteByPrimaryKey(id); + + } /** * Returns the first Multimedia object that matches the entityId passed * and excluding all MULTI_VERSION category files * * @param entityId The baseEntityId of the client who owns the multimedia file(s) - * * @return A {@link Multimedia} object */ - @Override - public Multimedia findByCaseId(String entityId) { - MultiMediaExample example = new MultiMediaExample(); - example.createCriteria().andCaseIdEqualTo(entityId).andFileCategoryNotEqualTo(MULTI_VERSION); - List multiMediaFiles = multiMediaMapper.selectByExample(example); - return multiMediaFiles.isEmpty() ? null : convert(multiMediaFiles.get(0)); - } - - @Override - public List all(String providerId) { - MultiMediaExample example = new MultiMediaExample(); - example.createCriteria().andProviderIdEqualTo(providerId); - List multiMediaFiles = multiMediaMapper.selectByExample(example); - return convert(multiMediaFiles); - } - - @Override - protected Long retrievePrimaryKey(Multimedia multimedia) { - if (multimedia == null || multimedia.getId() == null) { - return null; - } - String documentId = multimedia.getId(); - - MultiMediaExample example = new MultiMediaExample(); - example.createCriteria().andDocumentIdEqualTo(documentId); - List files = multiMediaMapper.selectByExample(example); - return files.isEmpty() ? null : files.get(0).getId(); - } - - @Override - protected Object getUniqueField(Multimedia multiMedia) { - return multiMedia == null ? multiMedia : multiMedia.getId(); - } - - //private Methods - private Multimedia convert(MultiMedia pgMultiMedia) { - Multimedia multimedia = new Multimedia(); - multimedia.setId(pgMultiMedia.getDocumentId()); - multimedia.setCaseId(pgMultiMedia.getCaseId()); - multimedia.setProviderId(pgMultiMedia.getProviderId()); - multimedia.setContentType(pgMultiMedia.getContentType()); - multimedia.setFilePath(pgMultiMedia.getFilePath()); - multimedia.setFileCategory(pgMultiMedia.getFileCategory()); - multimedia.setOriginalFileName(pgMultiMedia.getOriginalFileName()); - multimedia.setDateUploaded(pgMultiMedia.getDateUploaded()); - multimedia.setSummary(pgMultiMedia.getSummary()); - return multimedia; - } - - private MultiMedia convert(Multimedia entity, Long primaryKey) { - if (entity == null) { - return null; - } - MultiMedia pgMultiMedia = new MultiMedia(); - pgMultiMedia.setId(primaryKey); - pgMultiMedia.setDocumentId(entity.getId()); - pgMultiMedia.setCaseId(entity.getCaseId()); - pgMultiMedia.setProviderId(entity.getProviderId()); - pgMultiMedia.setContentType(entity.getContentType()); - pgMultiMedia.setFilePath(entity.getFilePath()); - pgMultiMedia.setFileCategory(entity.getFileCategory()); - pgMultiMedia.setOriginalFileName(entity.getOriginalFileName()); - pgMultiMedia.setDateUploaded(entity.getDateUploaded()); - pgMultiMedia.setSummary(entity.getSummary()); - return pgMultiMedia; - } - - private List convert(List multiMediaFiles) { - if (multiMediaFiles == null || multiMediaFiles.isEmpty()) { - return new ArrayList<>(); - } - List convertedList = new ArrayList<>(); - for (MultiMedia pgMultiMedia : multiMediaFiles) { - Multimedia multimedia = convert(pgMultiMedia); - if (multimedia != null) { - convertedList.add(multimedia); - } - } - - return convertedList; - } - - /** - * Method should be used only during Unit testing - * Deletes all existing records - */ - public void removeAll() { - multiMediaMapper.deleteByExample(new MultiMediaExample()); - - } - + @Override + public Multimedia findByCaseId(String entityId) { + MultiMediaExample example = new MultiMediaExample(); + example.createCriteria().andCaseIdEqualTo(entityId).andFileCategoryNotEqualTo(MULTI_VERSION); + List multiMediaFiles = multiMediaMapper.selectByExample(example); + return multiMediaFiles.isEmpty() ? null : convert(multiMediaFiles.get(0)); + } + + @Override + public List all(String providerId) { + MultiMediaExample example = new MultiMediaExample(); + example.createCriteria().andProviderIdEqualTo(providerId); + List multiMediaFiles = multiMediaMapper.selectByExample(example); + return convert(multiMediaFiles); + } + + @Override + protected Long retrievePrimaryKey(Multimedia multimedia) { + if (multimedia == null || multimedia.getId() == null) { + return null; + } + String documentId = multimedia.getId(); + + MultiMediaExample example = new MultiMediaExample(); + example.createCriteria().andDocumentIdEqualTo(documentId); + List files = multiMediaMapper.selectByExample(example); + return files.isEmpty() ? null : files.get(0).getId(); + } + + @Override + protected Object getUniqueField(Multimedia multiMedia) { + return multiMedia == null ? multiMedia : multiMedia.getId(); + } + + //private Methods + private Multimedia convert(MultiMedia pgMultiMedia) { + Multimedia multimedia = new Multimedia(); + multimedia.setId(pgMultiMedia.getDocumentId()); + multimedia.setCaseId(pgMultiMedia.getCaseId()); + multimedia.setProviderId(pgMultiMedia.getProviderId()); + multimedia.setContentType(pgMultiMedia.getContentType()); + multimedia.setFilePath(pgMultiMedia.getFilePath()); + multimedia.setFileCategory(pgMultiMedia.getFileCategory()); + multimedia.setOriginalFileName(pgMultiMedia.getOriginalFileName()); + multimedia.setDateUploaded(pgMultiMedia.getDateUploaded()); + multimedia.setSummary(pgMultiMedia.getSummary()); + return multimedia; + } + + private MultiMedia convert(Multimedia entity, Long primaryKey) { + if (entity == null) { + return null; + } + MultiMedia pgMultiMedia = new MultiMedia(); + pgMultiMedia.setId(primaryKey); + pgMultiMedia.setDocumentId(entity.getId()); + pgMultiMedia.setCaseId(entity.getCaseId()); + pgMultiMedia.setProviderId(entity.getProviderId()); + pgMultiMedia.setContentType(entity.getContentType()); + pgMultiMedia.setFilePath(entity.getFilePath()); + pgMultiMedia.setFileCategory(entity.getFileCategory()); + pgMultiMedia.setOriginalFileName(entity.getOriginalFileName()); + pgMultiMedia.setDateUploaded(entity.getDateUploaded()); + pgMultiMedia.setSummary(entity.getSummary()); + return pgMultiMedia; + } + + private List convert(List multiMediaFiles) { + if (multiMediaFiles == null || multiMediaFiles.isEmpty()) { + return new ArrayList<>(); + } + List convertedList = new ArrayList<>(); + for (MultiMedia pgMultiMedia : multiMediaFiles) { + Multimedia multimedia = convert(pgMultiMedia); + if (multimedia != null) { + convertedList.add(multimedia); + } + } + + return convertedList; + } + + /** + * Method should be used only during Unit testing + * Deletes all existing records + */ + public void removeAll() { + multiMediaMapper.deleteByExample(new MultiMediaExample()); + + } + } diff --git a/src/main/java/org/opensrp/repository/postgres/OrganizationRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/OrganizationRepositoryImpl.java index dd48287eb..879c6566a 100755 --- a/src/main/java/org/opensrp/repository/postgres/OrganizationRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/OrganizationRepositoryImpl.java @@ -30,370 +30,371 @@ */ @Repository public class OrganizationRepositoryImpl extends BaseRepositoryImpl implements OrganizationRepository { - - @Autowired - private CustomOrganizationMapper organizationMapper; - - @Autowired - private CustomOrganizationLocationMapper organizationLocationMapper; - - @Override - public Organization get(String id) { - return convert(findOrganizationByIdentifier(id)); - } - - @Override - public Organization getByPrimaryKey(Long id) { - if (id == null) { - return null; - } - OrganizationExample example = new OrganizationExample(); - example.createCriteria().andIdEqualTo(id).andDateDeletedIsNull(); - List organizations = organizationMapper.selectByExample(example); - return organizations.isEmpty() ? null : convert(organizations.get(0)); - } - - @Override - public void add(Organization entity) { - if (getUniqueField(entity) == null) { - return; - } - - if (retrievePrimaryKey(entity) != null) { // Organization already added - return; - } - - org.opensrp.domain.postgres.Organization pgOrganization = convert(entity, null); - if (pgOrganization == null) { - return; - } - - organizationMapper.insertSelectiveAndGenerateServerVersion(pgOrganization); - } - - @Override - public void update(Organization entity) { - if (getUniqueField(entity) == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { // Organization does not exist - return; - } - - org.opensrp.domain.postgres.Organization pgOrganization = convert(entity, id); - if (pgOrganization == null) { - return; - } - - organizationMapper.updateByPrimaryKeySelectiveAndGenerateServerVersion(pgOrganization); - - } - - @Override - public List getAll() { - OrganizationExample example = new OrganizationExample(); - example.createCriteria().andDateDeletedIsNull(); - List organizations = organizationMapper.selectMany(example, 0, - DEFAULT_FETCH_SIZE); - return convert(organizations); - } - - @Override - public void safeRemove(Organization entity) { - if (getUniqueField(entity) == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { // Organization does not exist - return; - } - - org.opensrp.domain.postgres.Organization pgOrganization = convert(entity, id); - if (pgOrganization == null) { - return; - } - pgOrganization.setDateDeleted(new Date()); - - organizationMapper.updateByPrimaryKeySelective(pgOrganization); - - } - - @Override - public List selectOrganizationsEncompassLocations(String location_id, Date activeDate) { - List organizations = organizationMapper - .selectOrganizationsEncompassLocations(location_id, activeDate); - return convert(organizations); - } - - @Override - public void assignLocationAndPlan(Long organizationId, String jurisdictionIdentifier, Long jurisdictionId, - String planIdentifier, Long planId, Date fromDate, Date toDate) { - List assignedLocations = getAssignedLocations(organizationId); - for (OrganizationLocation organizationLocation : assignedLocations) { - if (isExistingAssignment(jurisdictionId, planId, fromDate, organizationLocation)) { - organizationLocation.setToDate(toDate); - organizationLocation.setDuration(new DateRange(organizationLocation.getFromDate(), toDate)); - OrganizationLocationExample example = new OrganizationLocationExample(); - example.createCriteria().andIdEqualTo(organizationLocation.getId()); - organizationLocationMapper.updateByExample(organizationLocation, example); - return; - } - } - insertOrganizationLocation(organizationId, jurisdictionId, planId, fromDate, toDate); - - } - - private List getAssignedLocations(Long organizationId) { - OrganizationLocationExample example = new OrganizationLocationExample(); - Date currentDate = new LocalDate().toDate(); - example.createCriteria().andOrganizationIdEqualTo(organizationId).andFromDateLessThanOrEqualTo(currentDate); - return organizationLocationMapper.selectByExampleAndDateTo(example.getOredCriteria(), example.getOrderByClause(), - currentDate); - } - - /** - * Find all team assignments against the given planId - * @param planId - * @return List of OrganizationLocation team assignments - */ - private List getAssignedLocationsByPlanId(Long planId) { - OrganizationLocationExample example = new OrganizationLocationExample(); - example.createCriteria().andPlanIdEqualTo(planId); //returns future assignments as well - return organizationLocationMapper.selectByExample(example); - } - - private boolean isExistingAssignment(Long jurisdictionId, Long planId, Date fromDate, - OrganizationLocation organizationLocation) { - if (!LocalDate.fromDateFields(fromDate).equals(LocalDate.fromDateFields(organizationLocation.getFromDate()))) { - logger.debug("from dates does not match"); - return false; - } else if (jurisdictionId != null && planId != null) { - return jurisdictionId.equals(organizationLocation.getLocationId()) - && planId.equals(organizationLocation.getPlanId()); - } else if (jurisdictionId == null && planId != null) { - return planId.equals(organizationLocation.getPlanId()) && organizationLocation.getLocationId() == null; - } else if (jurisdictionId != null && planId == null) { - return jurisdictionId.equals(organizationLocation.getLocationId()) && organizationLocation.getPlanId() == null; - } else { - return false; - } - } - - private void insertOrganizationLocation(Long organizationId, Long jurisdictionId, Long planId, Date fromDate, - Date toDate) { - OrganizationLocation organizationLocation = new OrganizationLocation(); - organizationLocation.setOrganizationId(organizationId); - organizationLocation.setLocationId(jurisdictionId); - organizationLocation.setPlanId(planId); - organizationLocation.setFromDate(fromDate); - organizationLocation.setToDate(toDate); - organizationLocation.setDuration(new DateRange(fromDate, toDate)); - organizationLocationMapper.insertSelective(organizationLocation); - } - - @Override - public List findAssignedLocations(AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean) { - Date currentDate = new LocalDate().toDate(); - OrganizationLocationExample example = new OrganizationLocationExample(); - Pair pageSizeAndOffset = RepositoryUtil.getPageSizeAndOffset(assignedLocationAndPlanSearchBean); - Criteria criteria = example.createCriteria(); - if (assignedLocationAndPlanSearchBean != null && assignedLocationAndPlanSearchBean.getOrganizationId() != null) { - criteria.andOrganizationIdEqualTo(assignedLocationAndPlanSearchBean.getOrganizationId()); - } - if (!assignedLocationAndPlanSearchBean.isReturnFutureAssignments()) { - criteria.andFromDateLessThanOrEqualTo(currentDate); - } - if (assignedLocationAndPlanSearchBean != null && assignedLocationAndPlanSearchBean.getPlanId() != null) { - criteria.andPlanIdEqualTo(assignedLocationAndPlanSearchBean.getPlanId()); - } - return organizationLocationMapper - .findAssignedlocationsAndPlans(assignedLocationAndPlanSearchBean, pageSizeAndOffset.getRight(), - pageSizeAndOffset.getLeft(), example.getOredCriteria(), - currentDate); - } - - @Override - public List findAssignedLocations(List organizationIds, boolean returnFutureAssignments) { - Date currentDate = new LocalDate().toDate(); - OrganizationLocationExample example = new OrganizationLocationExample(); - example.createCriteria().andOrganizationIdIn(organizationIds).andFromDateLessThanOrEqualTo(currentDate); - AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = new AssignedLocationAndPlanSearchBean(); - assignedLocationAndPlanSearchBean.setPageSize(Integer.MAX_VALUE); - Pair pageSizeAndOffset = RepositoryUtil.getPageSizeAndOffset(assignedLocationAndPlanSearchBean); - return organizationLocationMapper.findAssignedlocationsAndPlans(assignedLocationAndPlanSearchBean, - pageSizeAndOffset.getRight(), pageSizeAndOffset.getLeft(), example.getOredCriteria(),currentDate); - } - - /** - * This method is marked as deprecated - * Since, findAssignedLocations(AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean) has similar signature - * - * Therefore, incorporated the logic to get AssignedLocations by Plan Id in that method - */ - - @Deprecated - @Override - public List findAssignedLocationsByPlanId(AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean) { - return findAssignedLocations(assignedLocationAndPlanSearchBean); - } - - @Override - protected Long retrievePrimaryKey(Organization organization) { - String identifier = getUniqueField(organization); - if (identifier == null) { - return null; - } - - org.opensrp.domain.postgres.Organization pgEntity = findOrganizationByIdentifier(identifier); - if (pgEntity == null) { - return null; - } - return pgEntity.getId(); - } - - @Override - protected String getUniqueField(Organization organization) { - return organization.getIdentifier(); - } - - /** - * Get an Organization using an organization identifier - * - * @param identifier - * @return the organization - */ - private org.opensrp.domain.postgres.Organization findOrganizationByIdentifier(String identifier) { - if (StringUtils.isBlank(identifier)) { - return null; - } - OrganizationExample example = new OrganizationExample(); - example.createCriteria().andIdentifierEqualTo(identifier).andDateDeletedIsNull(); - List organizations = organizationMapper.selectByExample(example); - return organizations.isEmpty() ? null : organizations.get(0); - } - - private Organization convert(org.opensrp.domain.postgres.Organization pgEntity) { - if (pgEntity == null) { - return null; - } - Organization organization = new Organization(); - organization.setIdentifier(pgEntity.getIdentifier()); - organization.setActive(pgEntity.getActive()); - organization.setName(pgEntity.getName()); - organization.setId(pgEntity.getId()); - organization.setPartOf(pgEntity.getParentId()); - if (pgEntity.getDateCreated() != null) - organization.setDateCreated(new DateTime(pgEntity.getDateCreated())); - if (pgEntity.getDateEdited() != null) - organization.setDateEdited(new DateTime(pgEntity.getDateEdited())); - if (pgEntity.getServerVersion() != null) - organization.setServerVersion(pgEntity.getServerVersion()); - - if (pgEntity.getType() instanceof CodeSystem) { - organization.setType((CodeSystem) pgEntity.getType()); - } - - return organization; - } - - private List convert(List pgEntities) { - List organizations = new ArrayList<>(); - for (org.opensrp.domain.postgres.Organization pgEntity : pgEntities) { - organizations.add(convert(pgEntity)); - } - return organizations; - } - - private org.opensrp.domain.postgres.Organization convert(Organization organization, Long id) { - if (organization == null) { - return null; - } - org.opensrp.domain.postgres.Organization pgOrganization = new org.opensrp.domain.postgres.Organization(); - pgOrganization.setId(id); - pgOrganization.setIdentifier(organization.getIdentifier()); - pgOrganization.setActive(organization.isActive()); - pgOrganization.setName(organization.getName()); - pgOrganization.setType(organization.getType()); - pgOrganization.setParentId(organization.getPartOf()); - if (organization.getDateCreated() != null) - pgOrganization.setDateCreated(organization.getDateCreated().toDate()); - if (organization.getDateEdited() != null) - pgOrganization.setDateEdited(organization.getDateEdited().toDate()); - pgOrganization.setServerVersion(organization.getServerVersion()); - - return pgOrganization; - } - - @Override - public List findSearchOrganizations(OrganizationSearchBean organizationSearchBean) { - Pair pageSizeAndOffset = getPageSizeAndOffset(organizationSearchBean); - return organizationMapper.selectSearchOrganizations(organizationSearchBean, pageSizeAndOffset.getRight(), - pageSizeAndOffset.getLeft()); - } - - private Pair getPageSizeAndOffset(OrganizationSearchBean organizationSearchBean) { - return RepositoryUtil.getPageSizeAndOffset(organizationSearchBean.getPageNumber(), organizationSearchBean.getPageSize()); - } - - @Override - public int findOrganizationCount(OrganizationSearchBean organizationSearchBean) { - return organizationMapper.selectOrganizationCount(organizationSearchBean); - } - - @Override - public Organization findOrganizationByName(String name) { - if (StringUtils.isBlank(name)) { - return null; - } - OrganizationExample example = new OrganizationExample(); - example.createCriteria().andNameEqualTo(name).andDateDeletedIsNull(); - List organizations = organizationMapper.selectByExample(example); - return organizations.isEmpty() ? null : convert(organizations.get(0)); - } - - @Override - public List getAllOrganizations(OrganizationSearchBean organizationSearchBean) { - Pair pageSizeAndOffset = getPageSizeAndOffset(organizationSearchBean); - OrganizationExample example = new OrganizationExample(); - example.createCriteria().andDateDeletedIsNull(); - if(organizationSearchBean.getOrderByFieldName() != null && organizationSearchBean.getOrderByType() != null) { - example.setOrderByClause(organizationSearchBean.getOrderByFieldName() + " " + organizationSearchBean.getOrderByType()); - } - if (organizationSearchBean.getServerVersion() != null) { - example.createCriteria().andServerVersionGreaterThanOrEqualTo(organizationSearchBean.getServerVersion()); - } - List organizations = organizationMapper.selectMany(example, pageSizeAndOffset.getRight(), pageSizeAndOffset.getLeft()); - return convert(organizations); - } - - /** - * This method will revoke all the team assignments including future assignments as well - * by setting to_date param to the current date - */ - @Override - public void unassignLocationAndPlan(Long planId) { - List organizationLocations = getAssignedLocationsByPlanId(planId); - for (OrganizationLocation organizationLocation : organizationLocations) { - organizationLocation.setToDate(new Date()); - OrganizationLocationExample example = new OrganizationLocationExample(); - example.createCriteria().andIdEqualTo(organizationLocation.getId()); - organizationLocationMapper.updateByExample(organizationLocation, example); - } - } - - @Override - public long countAllOrganizations() { - return organizationMapper.countByExample(new OrganizationExample()); - } - - @Override - public List getOrganizationsByIds(List organizationIds) { - List organizations = organizationMapper.selectByOrganizationIds(organizationIds); - return organizations.isEmpty() ? null : convert(organizations); - - } + + @Autowired + private CustomOrganizationMapper organizationMapper; + + @Autowired + private CustomOrganizationLocationMapper organizationLocationMapper; + + @Override + public Organization get(String id) { + return convert(findOrganizationByIdentifier(id)); + } + + @Override + public Organization getByPrimaryKey(Long id) { + if (id == null) { + return null; + } + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andIdEqualTo(id).andDateDeletedIsNull(); + List organizations = organizationMapper.selectByExample(example); + return organizations.isEmpty() ? null : convert(organizations.get(0)); + } + + @Override + public void add(Organization entity) { + if (getUniqueField(entity) == null) { + return; + } + + if (retrievePrimaryKey(entity) != null) { // Organization already added + return; + } + + org.opensrp.domain.postgres.Organization pgOrganization = convert(entity, null); + if (pgOrganization == null) { + return; + } + + organizationMapper.insertSelectiveAndGenerateServerVersion(pgOrganization); + } + + @Override + public void update(Organization entity) { + if (getUniqueField(entity) == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { // Organization does not exist + return; + } + + org.opensrp.domain.postgres.Organization pgOrganization = convert(entity, id); + if (pgOrganization == null) { + return; + } + + organizationMapper.updateByPrimaryKeySelectiveAndGenerateServerVersion(pgOrganization); + + } + + @Override + public List getAll() { + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andDateDeletedIsNull(); + List organizations = organizationMapper.selectMany(example, 0, + DEFAULT_FETCH_SIZE); + return convert(organizations); + } + + @Override + public void safeRemove(Organization entity) { + if (getUniqueField(entity) == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { // Organization does not exist + return; + } + + org.opensrp.domain.postgres.Organization pgOrganization = convert(entity, id); + if (pgOrganization == null) { + return; + } + pgOrganization.setDateDeleted(new Date()); + + organizationMapper.updateByPrimaryKeySelective(pgOrganization); + + } + + @Override + public List selectOrganizationsEncompassLocations(String location_id, Date activeDate) { + List organizations = organizationMapper + .selectOrganizationsEncompassLocations(location_id, activeDate); + return convert(organizations); + } + + @Override + public void assignLocationAndPlan(Long organizationId, String jurisdictionIdentifier, Long jurisdictionId, + String planIdentifier, Long planId, Date fromDate, Date toDate) { + List assignedLocations = getAssignedLocations(organizationId); + for (OrganizationLocation organizationLocation : assignedLocations) { + if (isExistingAssignment(jurisdictionId, planId, fromDate, organizationLocation)) { + organizationLocation.setToDate(toDate); + organizationLocation.setDuration(new DateRange(organizationLocation.getFromDate(), toDate)); + OrganizationLocationExample example = new OrganizationLocationExample(); + example.createCriteria().andIdEqualTo(organizationLocation.getId()); + organizationLocationMapper.updateByExample(organizationLocation, example); + return; + } + } + insertOrganizationLocation(organizationId, jurisdictionId, planId, fromDate, toDate); + + } + + private List getAssignedLocations(Long organizationId) { + OrganizationLocationExample example = new OrganizationLocationExample(); + Date currentDate = new LocalDate().toDate(); + example.createCriteria().andOrganizationIdEqualTo(organizationId).andFromDateLessThanOrEqualTo(currentDate); + return organizationLocationMapper.selectByExampleAndDateTo(example.getOredCriteria(), example.getOrderByClause(), + currentDate); + } + + /** + * Find all team assignments against the given planId + * + * @param planId + * @return List of OrganizationLocation team assignments + */ + private List getAssignedLocationsByPlanId(Long planId) { + OrganizationLocationExample example = new OrganizationLocationExample(); + example.createCriteria().andPlanIdEqualTo(planId); //returns future assignments as well + return organizationLocationMapper.selectByExample(example); + } + + private boolean isExistingAssignment(Long jurisdictionId, Long planId, Date fromDate, + OrganizationLocation organizationLocation) { + if (!LocalDate.fromDateFields(fromDate).equals(LocalDate.fromDateFields(organizationLocation.getFromDate()))) { + logger.debug("from dates does not match"); + return false; + } else if (jurisdictionId != null && planId != null) { + return jurisdictionId.equals(organizationLocation.getLocationId()) + && planId.equals(organizationLocation.getPlanId()); + } else if (jurisdictionId == null && planId != null) { + return planId.equals(organizationLocation.getPlanId()) && organizationLocation.getLocationId() == null; + } else if (jurisdictionId != null && planId == null) { + return jurisdictionId.equals(organizationLocation.getLocationId()) && organizationLocation.getPlanId() == null; + } else { + return false; + } + } + + private void insertOrganizationLocation(Long organizationId, Long jurisdictionId, Long planId, Date fromDate, + Date toDate) { + OrganizationLocation organizationLocation = new OrganizationLocation(); + organizationLocation.setOrganizationId(organizationId); + organizationLocation.setLocationId(jurisdictionId); + organizationLocation.setPlanId(planId); + organizationLocation.setFromDate(fromDate); + organizationLocation.setToDate(toDate); + organizationLocation.setDuration(new DateRange(fromDate, toDate)); + organizationLocationMapper.insertSelective(organizationLocation); + } + + @Override + public List findAssignedLocations(AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean) { + Date currentDate = new LocalDate().toDate(); + OrganizationLocationExample example = new OrganizationLocationExample(); + Pair pageSizeAndOffset = RepositoryUtil.getPageSizeAndOffset(assignedLocationAndPlanSearchBean); + Criteria criteria = example.createCriteria(); + if (assignedLocationAndPlanSearchBean != null && assignedLocationAndPlanSearchBean.getOrganizationId() != null) { + criteria.andOrganizationIdEqualTo(assignedLocationAndPlanSearchBean.getOrganizationId()); + } + if (!assignedLocationAndPlanSearchBean.isReturnFutureAssignments()) { + criteria.andFromDateLessThanOrEqualTo(currentDate); + } + if (assignedLocationAndPlanSearchBean != null && assignedLocationAndPlanSearchBean.getPlanId() != null) { + criteria.andPlanIdEqualTo(assignedLocationAndPlanSearchBean.getPlanId()); + } + return organizationLocationMapper + .findAssignedlocationsAndPlans(assignedLocationAndPlanSearchBean, pageSizeAndOffset.getRight(), + pageSizeAndOffset.getLeft(), example.getOredCriteria(), + currentDate); + } + + @Override + public List findAssignedLocations(List organizationIds, boolean returnFutureAssignments) { + Date currentDate = new LocalDate().toDate(); + OrganizationLocationExample example = new OrganizationLocationExample(); + example.createCriteria().andOrganizationIdIn(organizationIds).andFromDateLessThanOrEqualTo(currentDate); + AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = new AssignedLocationAndPlanSearchBean(); + assignedLocationAndPlanSearchBean.setPageSize(Integer.MAX_VALUE); + Pair pageSizeAndOffset = RepositoryUtil.getPageSizeAndOffset(assignedLocationAndPlanSearchBean); + return organizationLocationMapper.findAssignedlocationsAndPlans(assignedLocationAndPlanSearchBean, + pageSizeAndOffset.getRight(), pageSizeAndOffset.getLeft(), example.getOredCriteria(), currentDate); + } + + /** + * This method is marked as deprecated + * Since, findAssignedLocations(AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean) has similar signature + *

+ * Therefore, incorporated the logic to get AssignedLocations by Plan Id in that method + */ + + @Deprecated + @Override + public List findAssignedLocationsByPlanId(AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean) { + return findAssignedLocations(assignedLocationAndPlanSearchBean); + } + + @Override + protected Long retrievePrimaryKey(Organization organization) { + String identifier = getUniqueField(organization); + if (identifier == null) { + return null; + } + + org.opensrp.domain.postgres.Organization pgEntity = findOrganizationByIdentifier(identifier); + if (pgEntity == null) { + return null; + } + return pgEntity.getId(); + } + + @Override + protected String getUniqueField(Organization organization) { + return organization.getIdentifier(); + } + + /** + * Get an Organization using an organization identifier + * + * @param identifier + * @return the organization + */ + private org.opensrp.domain.postgres.Organization findOrganizationByIdentifier(String identifier) { + if (StringUtils.isBlank(identifier)) { + return null; + } + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andIdentifierEqualTo(identifier).andDateDeletedIsNull(); + List organizations = organizationMapper.selectByExample(example); + return organizations.isEmpty() ? null : organizations.get(0); + } + + private Organization convert(org.opensrp.domain.postgres.Organization pgEntity) { + if (pgEntity == null) { + return null; + } + Organization organization = new Organization(); + organization.setIdentifier(pgEntity.getIdentifier()); + organization.setActive(pgEntity.getActive()); + organization.setName(pgEntity.getName()); + organization.setId(pgEntity.getId()); + organization.setPartOf(pgEntity.getParentId()); + if (pgEntity.getDateCreated() != null) + organization.setDateCreated(new DateTime(pgEntity.getDateCreated())); + if (pgEntity.getDateEdited() != null) + organization.setDateEdited(new DateTime(pgEntity.getDateEdited())); + if (pgEntity.getServerVersion() != null) + organization.setServerVersion(pgEntity.getServerVersion()); + + if (pgEntity.getType() instanceof CodeSystem) { + organization.setType((CodeSystem) pgEntity.getType()); + } + + return organization; + } + + private List convert(List pgEntities) { + List organizations = new ArrayList<>(); + for (org.opensrp.domain.postgres.Organization pgEntity : pgEntities) { + organizations.add(convert(pgEntity)); + } + return organizations; + } + + private org.opensrp.domain.postgres.Organization convert(Organization organization, Long id) { + if (organization == null) { + return null; + } + org.opensrp.domain.postgres.Organization pgOrganization = new org.opensrp.domain.postgres.Organization(); + pgOrganization.setId(id); + pgOrganization.setIdentifier(organization.getIdentifier()); + pgOrganization.setActive(organization.isActive()); + pgOrganization.setName(organization.getName()); + pgOrganization.setType(organization.getType()); + pgOrganization.setParentId(organization.getPartOf()); + if (organization.getDateCreated() != null) + pgOrganization.setDateCreated(organization.getDateCreated().toDate()); + if (organization.getDateEdited() != null) + pgOrganization.setDateEdited(organization.getDateEdited().toDate()); + pgOrganization.setServerVersion(organization.getServerVersion()); + + return pgOrganization; + } + + @Override + public List findSearchOrganizations(OrganizationSearchBean organizationSearchBean) { + Pair pageSizeAndOffset = getPageSizeAndOffset(organizationSearchBean); + return organizationMapper.selectSearchOrganizations(organizationSearchBean, pageSizeAndOffset.getRight(), + pageSizeAndOffset.getLeft()); + } + + private Pair getPageSizeAndOffset(OrganizationSearchBean organizationSearchBean) { + return RepositoryUtil.getPageSizeAndOffset(organizationSearchBean.getPageNumber(), organizationSearchBean.getPageSize()); + } + + @Override + public int findOrganizationCount(OrganizationSearchBean organizationSearchBean) { + return organizationMapper.selectOrganizationCount(organizationSearchBean); + } + + @Override + public Organization findOrganizationByName(String name) { + if (StringUtils.isBlank(name)) { + return null; + } + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andNameEqualTo(name).andDateDeletedIsNull(); + List organizations = organizationMapper.selectByExample(example); + return organizations.isEmpty() ? null : convert(organizations.get(0)); + } + + @Override + public List getAllOrganizations(OrganizationSearchBean organizationSearchBean) { + Pair pageSizeAndOffset = getPageSizeAndOffset(organizationSearchBean); + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andDateDeletedIsNull(); + if (organizationSearchBean.getOrderByFieldName() != null && organizationSearchBean.getOrderByType() != null) { + example.setOrderByClause(organizationSearchBean.getOrderByFieldName() + " " + organizationSearchBean.getOrderByType()); + } + if (organizationSearchBean.getServerVersion() != null) { + example.createCriteria().andServerVersionGreaterThanOrEqualTo(organizationSearchBean.getServerVersion()); + } + List organizations = organizationMapper.selectMany(example, pageSizeAndOffset.getRight(), pageSizeAndOffset.getLeft()); + return convert(organizations); + } + + /** + * This method will revoke all the team assignments including future assignments as well + * by setting to_date param to the current date + */ + @Override + public void unassignLocationAndPlan(Long planId) { + List organizationLocations = getAssignedLocationsByPlanId(planId); + for (OrganizationLocation organizationLocation : organizationLocations) { + organizationLocation.setToDate(new Date()); + OrganizationLocationExample example = new OrganizationLocationExample(); + example.createCriteria().andIdEqualTo(organizationLocation.getId()); + organizationLocationMapper.updateByExample(organizationLocation, example); + } + } + + @Override + public long countAllOrganizations() { + return organizationMapper.countByExample(new OrganizationExample()); + } + + @Override + public List getOrganizationsByIds(List organizationIds) { + List organizations = organizationMapper.selectByOrganizationIds(organizationIds); + return organizations.isEmpty() ? null : convert(organizations); + + } } diff --git a/src/main/java/org/opensrp/repository/postgres/PlanRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/PlanRepositoryImpl.java index 420f8beec..42c7cd260 100644 --- a/src/main/java/org/opensrp/repository/postgres/PlanRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/PlanRepositoryImpl.java @@ -51,17 +51,17 @@ public PlanDefinition get(String id) { return isEmptyList(plan) ? null : plan.get(0); } - + private void updateServerVersion(Plan pgPlan, PlanDefinition entity) { - long serverVersion = planMapper.selectServerVersionByPrimaryKey(pgPlan.getId()); - entity.setServerVersion(serverVersion); - pgPlan.setJson(entity); - pgPlan.setServerVersion(null); - int rowsAffected = planMapper.updateByPrimaryKeySelective(pgPlan); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - } + long serverVersion = planMapper.selectServerVersionByPrimaryKey(pgPlan.getId()); + entity.setServerVersion(serverVersion); + pgPlan.setJson(entity); + pgPlan.setServerVersion(null); + int rowsAffected = planMapper.updateByPrimaryKeySelective(pgPlan); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + } @Override public void add(PlanDefinition plan) { @@ -83,9 +83,9 @@ public void add(PlanDefinition plan) { if (rowsAffected < 1) { throw new IllegalStateException(); } - + updateServerVersion(pgPlan, plan); - + insertPlanMetadata(plan, pgPlan.getId()); } @@ -114,7 +114,7 @@ public void update(PlanDefinition plan) { } updateServerVersion(pgPlan, plan); - + updatePlanMetadata(plan, pgPlan.getId()); } @@ -223,9 +223,9 @@ public Pair, Long> findAllIds(Long serverVersion, int limit, boolea if (toDate != null && fromDate != null) { criteria.andDateCreatedBetween(fromDate, toDate); - } else if(fromDate !=null){ + } else if (fromDate != null) { criteria.andDateCreatedGreaterThanOrEqualTo(fromDate); - } else{ + } else { criteria.andDateCreatedLessThanOrEqualTo(toDate); } @@ -386,11 +386,11 @@ public List getAllPlans(PlanSearchBean planSearchBean) { } private Pair getPageSizeAndOffset(PlanSearchBean planSearchBean) { - return RepositoryUtil.getPageSizeAndOffset(planSearchBean.getPageNumber(), planSearchBean.getPageSize()); + return RepositoryUtil.getPageSizeAndOffset(planSearchBean.getPageNumber(), planSearchBean.getPageSize()); } - @Override - public PlanDefinition findPlanByIdentifier(String identifier) { - return get(identifier); - } + @Override + public PlanDefinition findPlanByIdentifier(String identifier) { + return get(identifier); + } } diff --git a/src/main/java/org/opensrp/repository/postgres/PractitionerRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/PractitionerRepositoryImpl.java index e51d5da4d..f096d8ff3 100755 --- a/src/main/java/org/opensrp/repository/postgres/PractitionerRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/PractitionerRepositoryImpl.java @@ -53,7 +53,7 @@ public List getPractitionersByOrgId(Long orgId) { PractitionerExample practitionerExample = new PractitionerExample(); practitionerExample.createCriteria().andDateDeletedIsNull(); List pgPractitionerList = practitionerMapper.selectManyByOrgId(practitionerExample, - orgId,0, DEFAULT_FETCH_SIZE); + orgId, 0, DEFAULT_FETCH_SIZE); return convert(pgPractitionerList); } @@ -105,7 +105,7 @@ public void update(Practitioner practitioner) { } Long id = retrievePrimaryKey(practitioner); - if ( id == null) { + if (id == null) { return; // practitioner does not exist } @@ -153,7 +153,7 @@ public void safeRemove(String identifier) { pgPractitioner.setDateDeleted(new Date()); practitionerMapper.updateByPrimaryKey(pgPractitioner); } - + @Override public Practitioner getPractitionerByUserId(String userId) { if (StringUtils.isBlank(userId)) { @@ -165,15 +165,15 @@ public Practitioner getPractitionerByUserId(String userId) { List practitionerList = practitionerMapper.selectByExample(practitionerExample); - return isEmptyList(practitionerList) ? null : convert(practitionerList.get(0)); + return isEmptyList(practitionerList) ? null : convert(practitionerList.get(0)); } - - + + @Override - /** - * {@inheritDoc} - */ + /** + * {@inheritDoc} + */ public Practitioner getPractitionerByUsername(String username) { if (StringUtils.isBlank(username)) { return null; @@ -184,7 +184,7 @@ public Practitioner getPractitionerByUsername(String username) { List practitionerList = practitionerMapper.selectByExample(practitionerExample); - return isEmptyList(practitionerList) ? null : convert(practitionerList.get(0)); + return isEmptyList(practitionerList) ? null : convert(practitionerList.get(0)); } @@ -193,7 +193,7 @@ public List getAllPractitioners(PractitionerSearchBean practitione Pair pageSizeAndOffset = RepositoryUtil.getPageSizeAndOffset(practitionerSearchBean); PractitionerExample practitionerExample = new PractitionerExample(); practitionerExample.createCriteria().andDateDeletedIsNull(); - if(practitionerSearchBean.getOrderByFieldName() != null && practitionerSearchBean.getOrderByType() != null) { + if (practitionerSearchBean.getOrderByFieldName() != null && practitionerSearchBean.getOrderByType() != null) { practitionerExample.setOrderByClause(practitionerSearchBean.getOrderByFieldName() + " " + practitionerSearchBean.getOrderByType()); } if (practitionerSearchBean.getServerVersion() != null) { @@ -203,17 +203,17 @@ public List getAllPractitioners(PractitionerSearchBean practitione return convert(pgPractitionerList); } - @Override - public List getAllPractitionersByIdentifiers(List practitionerIdentifiers) { - PractitionerSearchBean practitionerSearchBean = new PractitionerSearchBean(null); - Pair pageSizeAndOffset = RepositoryUtil.getPageSizeAndOffset(practitionerSearchBean); - PractitionerExample practitionerExample = new PractitionerExample(); - practitionerExample.createCriteria().andDateDeletedIsNull().andIdentifierIn(practitionerIdentifiers); - List pgPractitionerList = practitionerMapper.selectMany(practitionerExample, pageSizeAndOffset.getRight(), pageSizeAndOffset.getLeft()); - return convert(pgPractitionerList); - } - - @Override + @Override + public List getAllPractitionersByIdentifiers(List practitionerIdentifiers) { + PractitionerSearchBean practitionerSearchBean = new PractitionerSearchBean(null); + Pair pageSizeAndOffset = RepositoryUtil.getPageSizeAndOffset(practitionerSearchBean); + PractitionerExample practitionerExample = new PractitionerExample(); + practitionerExample.createCriteria().andDateDeletedIsNull().andIdentifierIn(practitionerIdentifiers); + List pgPractitionerList = practitionerMapper.selectMany(practitionerExample, pageSizeAndOffset.getRight(), pageSizeAndOffset.getLeft()); + return convert(pgPractitionerList); + } + + @Override protected Long retrievePrimaryKey(Practitioner practitioner) { Object uniqueId = getUniqueField(practitioner); if (uniqueId == null) { @@ -275,7 +275,7 @@ private List convert(List convert(List getRolesForPractitioner(String practitionerIdentifier) { - return convert(getPgRolesForPractitioner(practitionerIdentifier)); + return convert(getPgRolesForPractitioner(practitionerIdentifier)); } @Override @@ -192,14 +192,14 @@ public List getPgRolesForPractitio Practitioner practitioner = practitionerRepository.getPractitioner(practitionerIdentifier); - if (practitioner == null || practitioner.getId() == null) { + if (practitioner == null || practitioner.getId() == null) { return null; } PractitionerRoleExample practitionerRoleExample = new PractitionerRoleExample(); practitionerRoleExample.createCriteria().andPractitionerIdEqualTo(practitioner.getId()); - List pgPractitionerRoles = practitionerRoleMapper.selectMany(practitionerRoleExample, 0, DEFAULT_FETCH_SIZE); + List pgPractitionerRoles = practitionerRoleMapper.selectMany(practitionerRoleExample, 0, DEFAULT_FETCH_SIZE); return pgPractitionerRoles; } @@ -221,7 +221,7 @@ private PractitionerRole convert(org.opensrp.domain.postgres.PractitionerRole pg practitionerRole.setActive(pgPractitionerRole.getActive()); practitionerRole.setOrganizationIdentifier(pgOrganinization.getIdentifier()); practitionerRole.setPractitionerIdentifier(pgPractitioner.getIdentifier()); - PractitionerRoleCode code = new PractitionerRoleCode(); + PractitionerRoleCode code = new PractitionerRoleCode(); code.setText(pgPractitionerRole.getCode()); practitionerRole.setCode(code); @@ -236,12 +236,12 @@ private org.opensrp.domain.postgres.PractitionerRole convert(PractitionerRole pr org.opensrp.domain.postgres.PractitionerRole pgPractitionerRole = new org.opensrp.domain.postgres.PractitionerRole(); pgPractitionerRole.setIdentifier(practitionerRole.getIdentifier()); pgPractitionerRole.setActive(practitionerRole.getActive()); - Long organizationId = getOrganizationId(practitionerRole.getOrganizationIdentifier()); + Long organizationId = getOrganizationId(practitionerRole.getOrganizationIdentifier()); pgPractitionerRole.setOrganizationId(organizationId); Long practitionerId = getPractitionerId(practitionerRole.getPractitionerIdentifier()); pgPractitionerRole.setPractitionerId(practitionerId); - if(practitionerRole.getCode()!=null) - pgPractitionerRole.setCode(practitionerRole.getCode().getText()); + if (practitionerRole.getCode() != null) + pgPractitionerRole.setCode(practitionerRole.getCode().getText()); return pgPractitionerRole; } @@ -251,19 +251,19 @@ private List convert(List practitionerRoles = getPgRolesForPractitioner( practitionerIdentifier); for (org.opensrp.domain.postgres.PractitionerRole pgPractitionerRole : practitionerRoles) { @@ -292,7 +292,7 @@ public void assignPractitionerRole(Long organizationId, Long practitionerId, Str public List getAllPractitionerRoles(PractitionerRoleSearchBean practitionerRoleSearchBean) { Pair pageSizeAndOffset = RepositoryUtil.getPageSizeAndOffset(practitionerRoleSearchBean); PractitionerRoleExample practitionerRoleExample = new PractitionerRoleExample(); - if(practitionerRoleSearchBean.getOrderByFieldName() != null && practitionerRoleSearchBean.getOrderByType() != null) { + if (practitionerRoleSearchBean.getOrderByFieldName() != null && practitionerRoleSearchBean.getOrderByType() != null) { practitionerRoleExample.setOrderByClause(practitionerRoleSearchBean.getOrderByFieldName() + " " + practitionerRoleSearchBean.getOrderByType()); } List pgPractitionerRoleList = practitionerRoleMapper.selectMany(practitionerRoleExample, pageSizeAndOffset.getRight(), pageSizeAndOffset.getLeft()); @@ -309,13 +309,13 @@ public List getPractitionerRolesByOrgIdAndCode(Long organizati return convert(pgPractitionerRoleList); } - @Override - public long countAllPractitionerRoles() { - return practitionerRoleMapper.countByExample(new PractitionerRoleExample()); - } + @Override + public long countAllPractitionerRoles() { + return practitionerRoleMapper.countByExample(new PractitionerRoleExample()); + } - private boolean isExistingPractitionerRole(Long organizationId, Long practitionerId, String code, - org.opensrp.domain.postgres.PractitionerRole practitionerRole) { + private boolean isExistingPractitionerRole(Long organizationId, Long practitionerId, String code, + org.opensrp.domain.postgres.PractitionerRole practitionerRole) { if (organizationId != null && practitionerId != null) { return practitionerRole.getPractitionerId().equals(practitionerId) && practitionerRole.getOrganizationId().equals(organizationId) diff --git a/src/main/java/org/opensrp/repository/postgres/ProductCatalogueRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/ProductCatalogueRepositoryImpl.java index b229cba38..27144c4cb 100644 --- a/src/main/java/org/opensrp/repository/postgres/ProductCatalogueRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/ProductCatalogueRepositoryImpl.java @@ -19,238 +19,238 @@ @Repository("productCatalogueRepositoryPostgres") public class ProductCatalogueRepositoryImpl extends BaseRepositoryImpl - implements ProductCatalogueRepository { - - @Autowired - private CustomProductCatalogueMapper customProductCatalogueMapper; - - @Override - public ProductCatalogue get(String id) { - throw new NotImplementedException(); - } - - @Transactional - @Override - public void add(ProductCatalogue entity) { - - if (entity == null) { - return; - } - - if (retrievePrimaryKey(entity) != null) { // ProductCatalogue already added - return; - } - - org.opensrp.domain.postgres.ProductCatalogue pgProductCatalogue = convert(entity, null); - if (pgProductCatalogue == null) { - throw new IllegalStateException(); - } - - int rowsAffected = customProductCatalogueMapper.insertSelectiveAndSetId(pgProductCatalogue); - if (rowsAffected < 1 || pgProductCatalogue.getUniqueId() == null) { - throw new IllegalStateException(); - } - - updateServerVersion(pgProductCatalogue, entity); - } - - private void updateServerVersion(org.opensrp.domain.postgres.ProductCatalogue pgProductCatalog, ProductCatalogue entity) { - Long serverVersion = customProductCatalogueMapper.selectServerVersionByPrimaryKey(pgProductCatalog.getUniqueId()); - entity.setServerVersion(serverVersion); - pgProductCatalog.setJson(entity); - pgProductCatalog.setServerVersion(serverVersion); - int rowsAffected = customProductCatalogueMapper.updateByPrimaryKeySelective(pgProductCatalog); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - } - - @Transactional - @Override - public void update(ProductCatalogue entity) { - if (entity == null) { - return; - } - Long id = retrievePrimaryKey(entity); - - if (id == null) { //Product Catalogues doesn't not exist - throw new IllegalStateException(); - } - - org.opensrp.domain.postgres.ProductCatalogue pgProductCatalogue = convert(entity, id); - int rowsAffected = customProductCatalogueMapper.updateByPrimaryKeyAndGenerateServerVersion(pgProductCatalogue); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - updateServerVersion(pgProductCatalogue, entity); - } - - @Override - public List getAll() { - throw new NotImplementedException(); - } - - @Override - public List getAll(String baseUrl) { - ProductCatalogueExample productCatalogueExample = new ProductCatalogueExample(); - productCatalogueExample.createCriteria().andUniqueIdIsNotNull(); - List productCatalogues = customProductCatalogueMapper - .selectMany(productCatalogueExample, 0, DEFAULT_FETCH_SIZE); - return convert(productCatalogues, baseUrl); - } - - @Override - public void safeRemove(ProductCatalogue entity) { - if (entity == null) { - return; - } - - Long uniqueId = retrievePrimaryKey(entity); - if (uniqueId == null) { - return; - } - - ProductCatalogueExample productCatalogueExample = new ProductCatalogueExample(); - productCatalogueExample.createCriteria().andUniqueIdEqualTo(uniqueId); - int rowsAffected = customProductCatalogueMapper.deleteByPrimaryKey(uniqueId); - if (rowsAffected < 1) { - return; - } - - } - - @Override - protected Long retrievePrimaryKey(ProductCatalogue productCatalogue) { - - ProductCatalogueExample productCatalogueExample = new ProductCatalogueExample(); - ProductCatalogueExample.Criteria criteria = productCatalogueExample.createCriteria(); - if (productCatalogue.getUniqueId() != null && productCatalogue.getUniqueId() != 0) { - criteria.andUniqueIdEqualTo(productCatalogue.getUniqueId()); - } else { - criteria.andProductNameEqualTo(productCatalogue.getProductName()); - } - - org.opensrp.domain.postgres.ProductCatalogue pgProductCatalogue = customProductCatalogueMapper - .selectOne(productCatalogueExample); - if (pgProductCatalogue == null) { - return null; - } - return pgProductCatalogue.getUniqueId(); - } - - @Override - protected Object getUniqueField(ProductCatalogue productCatalogue) { - if (productCatalogue == null) { - return null; - } - return productCatalogue.getUniqueId(); - } - - @Override - public ProductCatalogue getById(Long uniqueId, String baseUrl) { - ProductCatalogueExample productCatalogueExample = new ProductCatalogueExample(); - productCatalogueExample.createCriteria().andUniqueIdEqualTo(uniqueId); - - List productCatalogues = customProductCatalogueMapper - .selectByExample(productCatalogueExample); - - return isEmptyList(productCatalogues) ? null : convert(productCatalogues.get(0), baseUrl); - } - - @Override - public List getProductCataloguesBySearchBean(ProductCatalogueSearchBean productCatalogueSearchBean, int limit, String baseUrl) { - ProductCatalogueExample productCatalogueExample = new ProductCatalogueExample(); - populateProductCatalogueSearchCriteria(productCatalogueSearchBean, - productCatalogueExample); - productCatalogueExample.setOrderByClause(this.getOrderByClause(SERVER_VERSION, ASCENDING)); - return convert(customProductCatalogueMapper.selectMany(productCatalogueExample, 0, limit), baseUrl); - } - - @Override - public List getProductCataloguesBySearchBean(ProductCatalogueSearchBean productCatalogueSearchBean, String baseUrl){ - return getProductCataloguesBySearchBean(productCatalogueSearchBean, DEFAULT_FETCH_SIZE, baseUrl); - } - - @Override - public void safeRemove(Long uniqueId) { - ProductCatalogueExample productCatalogueExample = new ProductCatalogueExample(); - productCatalogueExample.createCriteria().andUniqueIdEqualTo(uniqueId); - customProductCatalogueMapper.deleteByPrimaryKey(uniqueId); - } - - @Override - public ProductCatalogue getProductCatalogueByName(String productName) { - ProductCatalogueExample productCatalogueExample = new ProductCatalogueExample(); - productCatalogueExample.createCriteria().andProductNameEqualTo(productName); - org.opensrp.domain.postgres.ProductCatalogue pgProductCatalogue = customProductCatalogueMapper - .selectOne(productCatalogueExample); - return convert(pgProductCatalogue, ""); - } - - private List convert(List productCatalogues, String baseUrl) { - if (productCatalogues == null || productCatalogues.isEmpty()) { - return new ArrayList<>(); - } - - List convertedProductCatalogues = new ArrayList<>(); - for (org.opensrp.domain.postgres.ProductCatalogue productCatalogue : productCatalogues) { - ProductCatalogue convertedProductCatalogue = convert(productCatalogue, baseUrl); - if (convertedProductCatalogue != null) { - convertedProductCatalogues.add(convertedProductCatalogue); - } - } - - return convertedProductCatalogues; - } - - private ProductCatalogue convert(org.opensrp.domain.postgres.ProductCatalogue pgProductCatalogue, String baseUrl) { - if (pgProductCatalogue == null || pgProductCatalogue.getJson() == null || !(pgProductCatalogue - .getJson() instanceof ProductCatalogue)) { - return null; - } - ProductCatalogue productCatalogue = (ProductCatalogue) pgProductCatalogue.getJson(); - productCatalogue.setUniqueId(pgProductCatalogue.getUniqueId()); - String photoUrl = productCatalogue.getPhotoURL(); - if(!StringUtils.isBlank(photoUrl)) { - productCatalogue.setPhotoURL(baseUrl + photoUrl); - } - return productCatalogue; - } - - private org.opensrp.domain.postgres.ProductCatalogue convert(ProductCatalogue productCatalogue, Long primaryKey) { - if (productCatalogue == null) { - return null; - } - - org.opensrp.domain.postgres.ProductCatalogue pgProductCatalogue = new org.opensrp.domain.postgres.ProductCatalogue(); - pgProductCatalogue.setUniqueId(primaryKey); - pgProductCatalogue.setJson(productCatalogue); - pgProductCatalogue.setProductName(productCatalogue.getProductName()); - pgProductCatalogue.setServerVersion(productCatalogue.getServerVersion()); - - return pgProductCatalogue; - } - - private ProductCatalogueExample.Criteria populateProductCatalogueSearchCriteria( - ProductCatalogueSearchBean productCatalogueSearchBean, - ProductCatalogueExample productCatalogueExample) { - - ProductCatalogueExample.Criteria criteria = productCatalogueExample.createCriteria(); - - if (productCatalogueSearchBean.getServerVersion() != null && productCatalogueSearchBean.getServerVersion() >= 0) { - criteria.andServerVersionGreaterThanOrEqualTo(productCatalogueSearchBean.getServerVersion()); - } - - if (StringUtils.isNotEmpty(productCatalogueSearchBean.getProductName())) - criteria.andProductNameEqualTo(productCatalogueSearchBean.getProductName()); - - if (productCatalogueSearchBean.getUniqueId() != null && productCatalogueSearchBean.getUniqueId() != 0) - criteria.andUniqueIdEqualTo(productCatalogueSearchBean.getUniqueId()); - - if (!criteria.isValid()) - throw new IllegalArgumentException("Atleast one search filter must be specified"); - - return criteria; - } + implements ProductCatalogueRepository { + + @Autowired + private CustomProductCatalogueMapper customProductCatalogueMapper; + + @Override + public ProductCatalogue get(String id) { + throw new NotImplementedException(); + } + + @Transactional + @Override + public void add(ProductCatalogue entity) { + + if (entity == null) { + return; + } + + if (retrievePrimaryKey(entity) != null) { // ProductCatalogue already added + return; + } + + org.opensrp.domain.postgres.ProductCatalogue pgProductCatalogue = convert(entity, null); + if (pgProductCatalogue == null) { + throw new IllegalStateException(); + } + + int rowsAffected = customProductCatalogueMapper.insertSelectiveAndSetId(pgProductCatalogue); + if (rowsAffected < 1 || pgProductCatalogue.getUniqueId() == null) { + throw new IllegalStateException(); + } + + updateServerVersion(pgProductCatalogue, entity); + } + + private void updateServerVersion(org.opensrp.domain.postgres.ProductCatalogue pgProductCatalog, ProductCatalogue entity) { + Long serverVersion = customProductCatalogueMapper.selectServerVersionByPrimaryKey(pgProductCatalog.getUniqueId()); + entity.setServerVersion(serverVersion); + pgProductCatalog.setJson(entity); + pgProductCatalog.setServerVersion(serverVersion); + int rowsAffected = customProductCatalogueMapper.updateByPrimaryKeySelective(pgProductCatalog); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + } + + @Transactional + @Override + public void update(ProductCatalogue entity) { + if (entity == null) { + return; + } + Long id = retrievePrimaryKey(entity); + + if (id == null) { //Product Catalogues doesn't not exist + throw new IllegalStateException(); + } + + org.opensrp.domain.postgres.ProductCatalogue pgProductCatalogue = convert(entity, id); + int rowsAffected = customProductCatalogueMapper.updateByPrimaryKeyAndGenerateServerVersion(pgProductCatalogue); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + updateServerVersion(pgProductCatalogue, entity); + } + + @Override + public List getAll() { + throw new NotImplementedException(); + } + + @Override + public List getAll(String baseUrl) { + ProductCatalogueExample productCatalogueExample = new ProductCatalogueExample(); + productCatalogueExample.createCriteria().andUniqueIdIsNotNull(); + List productCatalogues = customProductCatalogueMapper + .selectMany(productCatalogueExample, 0, DEFAULT_FETCH_SIZE); + return convert(productCatalogues, baseUrl); + } + + @Override + public void safeRemove(ProductCatalogue entity) { + if (entity == null) { + return; + } + + Long uniqueId = retrievePrimaryKey(entity); + if (uniqueId == null) { + return; + } + + ProductCatalogueExample productCatalogueExample = new ProductCatalogueExample(); + productCatalogueExample.createCriteria().andUniqueIdEqualTo(uniqueId); + int rowsAffected = customProductCatalogueMapper.deleteByPrimaryKey(uniqueId); + if (rowsAffected < 1) { + return; + } + + } + + @Override + protected Long retrievePrimaryKey(ProductCatalogue productCatalogue) { + + ProductCatalogueExample productCatalogueExample = new ProductCatalogueExample(); + ProductCatalogueExample.Criteria criteria = productCatalogueExample.createCriteria(); + if (productCatalogue.getUniqueId() != null && productCatalogue.getUniqueId() != 0) { + criteria.andUniqueIdEqualTo(productCatalogue.getUniqueId()); + } else { + criteria.andProductNameEqualTo(productCatalogue.getProductName()); + } + + org.opensrp.domain.postgres.ProductCatalogue pgProductCatalogue = customProductCatalogueMapper + .selectOne(productCatalogueExample); + if (pgProductCatalogue == null) { + return null; + } + return pgProductCatalogue.getUniqueId(); + } + + @Override + protected Object getUniqueField(ProductCatalogue productCatalogue) { + if (productCatalogue == null) { + return null; + } + return productCatalogue.getUniqueId(); + } + + @Override + public ProductCatalogue getById(Long uniqueId, String baseUrl) { + ProductCatalogueExample productCatalogueExample = new ProductCatalogueExample(); + productCatalogueExample.createCriteria().andUniqueIdEqualTo(uniqueId); + + List productCatalogues = customProductCatalogueMapper + .selectByExample(productCatalogueExample); + + return isEmptyList(productCatalogues) ? null : convert(productCatalogues.get(0), baseUrl); + } + + @Override + public List getProductCataloguesBySearchBean(ProductCatalogueSearchBean productCatalogueSearchBean, int limit, String baseUrl) { + ProductCatalogueExample productCatalogueExample = new ProductCatalogueExample(); + populateProductCatalogueSearchCriteria(productCatalogueSearchBean, + productCatalogueExample); + productCatalogueExample.setOrderByClause(this.getOrderByClause(SERVER_VERSION, ASCENDING)); + return convert(customProductCatalogueMapper.selectMany(productCatalogueExample, 0, limit), baseUrl); + } + + @Override + public List getProductCataloguesBySearchBean(ProductCatalogueSearchBean productCatalogueSearchBean, String baseUrl) { + return getProductCataloguesBySearchBean(productCatalogueSearchBean, DEFAULT_FETCH_SIZE, baseUrl); + } + + @Override + public void safeRemove(Long uniqueId) { + ProductCatalogueExample productCatalogueExample = new ProductCatalogueExample(); + productCatalogueExample.createCriteria().andUniqueIdEqualTo(uniqueId); + customProductCatalogueMapper.deleteByPrimaryKey(uniqueId); + } + + @Override + public ProductCatalogue getProductCatalogueByName(String productName) { + ProductCatalogueExample productCatalogueExample = new ProductCatalogueExample(); + productCatalogueExample.createCriteria().andProductNameEqualTo(productName); + org.opensrp.domain.postgres.ProductCatalogue pgProductCatalogue = customProductCatalogueMapper + .selectOne(productCatalogueExample); + return convert(pgProductCatalogue, ""); + } + + private List convert(List productCatalogues, String baseUrl) { + if (productCatalogues == null || productCatalogues.isEmpty()) { + return new ArrayList<>(); + } + + List convertedProductCatalogues = new ArrayList<>(); + for (org.opensrp.domain.postgres.ProductCatalogue productCatalogue : productCatalogues) { + ProductCatalogue convertedProductCatalogue = convert(productCatalogue, baseUrl); + if (convertedProductCatalogue != null) { + convertedProductCatalogues.add(convertedProductCatalogue); + } + } + + return convertedProductCatalogues; + } + + private ProductCatalogue convert(org.opensrp.domain.postgres.ProductCatalogue pgProductCatalogue, String baseUrl) { + if (pgProductCatalogue == null || pgProductCatalogue.getJson() == null || !(pgProductCatalogue + .getJson() instanceof ProductCatalogue)) { + return null; + } + ProductCatalogue productCatalogue = (ProductCatalogue) pgProductCatalogue.getJson(); + productCatalogue.setUniqueId(pgProductCatalogue.getUniqueId()); + String photoUrl = productCatalogue.getPhotoURL(); + if (!StringUtils.isBlank(photoUrl)) { + productCatalogue.setPhotoURL(baseUrl + photoUrl); + } + return productCatalogue; + } + + private org.opensrp.domain.postgres.ProductCatalogue convert(ProductCatalogue productCatalogue, Long primaryKey) { + if (productCatalogue == null) { + return null; + } + + org.opensrp.domain.postgres.ProductCatalogue pgProductCatalogue = new org.opensrp.domain.postgres.ProductCatalogue(); + pgProductCatalogue.setUniqueId(primaryKey); + pgProductCatalogue.setJson(productCatalogue); + pgProductCatalogue.setProductName(productCatalogue.getProductName()); + pgProductCatalogue.setServerVersion(productCatalogue.getServerVersion()); + + return pgProductCatalogue; + } + + private ProductCatalogueExample.Criteria populateProductCatalogueSearchCriteria( + ProductCatalogueSearchBean productCatalogueSearchBean, + ProductCatalogueExample productCatalogueExample) { + + ProductCatalogueExample.Criteria criteria = productCatalogueExample.createCriteria(); + + if (productCatalogueSearchBean.getServerVersion() != null && productCatalogueSearchBean.getServerVersion() >= 0) { + criteria.andServerVersionGreaterThanOrEqualTo(productCatalogueSearchBean.getServerVersion()); + } + + if (StringUtils.isNotEmpty(productCatalogueSearchBean.getProductName())) + criteria.andProductNameEqualTo(productCatalogueSearchBean.getProductName()); + + if (productCatalogueSearchBean.getUniqueId() != null && productCatalogueSearchBean.getUniqueId() != 0) + criteria.andUniqueIdEqualTo(productCatalogueSearchBean.getUniqueId()); + + if (!criteria.isValid()) + throw new IllegalArgumentException("Atleast one search filter must be specified"); + + return criteria; + } } diff --git a/src/main/java/org/opensrp/repository/postgres/ReportsRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/ReportsRepositoryImpl.java index 62b7fa521..857a5f942 100644 --- a/src/main/java/org/opensrp/repository/postgres/ReportsRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/ReportsRepositoryImpl.java @@ -20,322 +20,321 @@ @Repository("reportsRepositoryPostgres") public class ReportsRepositoryImpl extends BaseRepositoryImpl implements ReportsRepository { - - @Autowired - private CustomReportMapper reportMapper; - - @Autowired - private CustomReportMetadataMapper reportMetadataMapper; - - @Override - public Report get(String id) { - if (StringUtils.isBlank(id)) { - return null; - } - org.opensrp.domain.postgres.Report pgReport = reportMetadataMapper.selectByDocumentId(id); - - return convert(pgReport); - } - - private void updateServerVersion(org.opensrp.domain.postgres.Report pgReport, Report entity) { - long serverVersion = reportMapper.selectServerVersionByPrimaryKey(pgReport.getId()); - entity.setServerVersion(serverVersion); - pgReport.setJson(entity); - pgReport.setServerVersion(null); - int rowsAffected = reportMapper.updateByPrimaryKeySelective(pgReport); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - } - - @Override - public void add(Report entity) { - if (entity == null) { - return; - } - - if (retrievePrimaryKey(entity) != null) { //Report already added - return; - } - - if (entity.getId() == null || entity.getId().isEmpty()) - entity.setId(UUID.randomUUID().toString()); - setRevision(entity); - - org.opensrp.domain.postgres.Report pgReport = convert(entity, null); - if (pgReport == null) { - return; - } - - int rowsAffected = reportMapper.insertSelectiveAndSetId(pgReport); - logger.info("rowsAffected, pgReport.getId():" + rowsAffected + "," + pgReport.getId()); - if (rowsAffected < 1 || pgReport.getId() == null) { - throw new IllegalStateException(); - } - - updateServerVersion(pgReport, entity); - - ReportMetadata reportMetadata = createMetadata(entity, pgReport.getId()); - if (reportMetadata != null) { - reportMetadataMapper.insertSelective(reportMetadata); - } - - } - - @Override - public void update(Report entity) { - if (entity == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { // Report not added - return; - } - - setRevision(entity); - org.opensrp.domain.postgres.Report pgReport = convert(entity, id); - if (pgReport == null) { - return; - } - - - - int rowsAffected = reportMapper.updateByPrimaryKeyAndGenerateServerVersion(pgReport); - if (rowsAffected < 1) { - return; - } - - updateServerVersion(pgReport, entity); - - ReportMetadata reportMetadata = createMetadata(entity, id); - if (reportMetadata == null) { - return; - } - - ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); - reportMetadataExample.createCriteria().andReportIdEqualTo(id); - reportMetadata.setId(reportMetadataMapper.selectByExample(reportMetadataExample).get(0).getId()); - reportMetadataMapper.updateByPrimaryKey(reportMetadata); - - } - - @Override - public List getAll() { - List reports = reportMetadataMapper.selectMany(new ReportMetadataExample(), 0, - DEFAULT_FETCH_SIZE); - return convert(reports); - } - - @Override - public void safeRemove(Report entity) { - if (entity == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { - return; - } - - ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); - reportMetadataExample.createCriteria().andReportIdEqualTo(id); - int rowsAffected = reportMetadataMapper.deleteByExample(reportMetadataExample); - if (rowsAffected < 1) { - return; - } - - reportMapper.deleteByPrimaryKey(id); - - } - - @Override - public Report findById(String id) { - return get(id); - } - - @Override - public List findByBaseEntityId(String baseEntityId) { - ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); - reportMetadataExample.createCriteria().andBaseEntityIdEqualTo(baseEntityId); - return convert(reportMetadataMapper.selectMany(reportMetadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findAllByIdentifier(String identifier) { - return convert(reportMapper.selectByIdentifier(identifier, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findByBaseEntityAndType(String baseEntityId, String reportType) { - ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); - reportMetadataExample.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andReportTypeEqualTo(reportType); - return convert(reportMetadataMapper.selectMany(reportMetadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findByEmptyServerVersion() { - ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); - reportMetadataExample.createCriteria().andServerVersionIsNull(); - reportMetadataExample.or(reportMetadataExample.createCriteria().andServerVersionEqualTo(0l)); - return convert(reportMetadataMapper.selectMany(reportMetadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findByServerVersion(long serverVersion) { - ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); - reportMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion + 1); - return convert(reportMetadataMapper.selectMany(reportMetadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findByBaseEntityAndFormSubmissionId(String baseEntityId, String formSubmissionId) { - ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); - reportMetadataExample.createCriteria().andBaseEntityIdEqualTo(baseEntityId) - .andFormSubmissionIdEqualTo(formSubmissionId); - return convert(reportMetadataMapper.selectMany(reportMetadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findReports(String team, String providerId, String locationId, String baseEntityId, - Long serverVersion, String sortBy, String sortOrder, int limit) { - ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); - Criteria criteria = reportMetadataExample.createCriteria(); - if (team != null && !team.isEmpty()) { - String[] idsArray = org.apache.commons.lang.StringUtils.split(team, ","); - List ids = new ArrayList(Arrays.asList(idsArray)); - if (providerId != null && !ids.contains(providerId)) { - ids.add(providerId); - } - criteria.andProviderIdIn(ids); - } else if ((providerId != null && StringUtils.isNotEmpty(providerId))) { - criteria.andProviderIdEqualTo(providerId); - } - if (StringUtils.isNotBlank(locationId)) - criteria.andLocationIdEqualTo(locationId); - if (StringUtils.isNotBlank(baseEntityId)) - criteria.andBaseEntityIdEqualTo(baseEntityId); - if (serverVersion != null) - criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); - reportMetadataExample.setOrderByClause(getOrderByClause(sortBy, sortOrder)); - if (!criteria.isValid()) { - throw new IllegalArgumentException("Atleast one search filter must be specified"); - } else - return convert(reportMetadataMapper.selectMany(reportMetadataExample, 0, limit)); - } - - @Override - public List findReports(String baseEntityId, DateTime from, DateTime to, String reportType, String providerId, - String locationId, DateTime lastEditFrom, DateTime lastEditTo) { - ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); - Criteria criteria = reportMetadataExample.createCriteria(); - if (StringUtils.isNotBlank(baseEntityId)) - criteria.andBaseEntityIdEqualTo(baseEntityId); - if (StringUtils.isNotBlank(locationId)) - criteria.andReportTypeEqualTo(reportType); - if (StringUtils.isNotBlank(providerId)) - criteria.andProviderIdEqualTo(providerId); - if (StringUtils.isNotBlank(locationId)) - criteria.andLocationIdEqualTo(locationId); - if (from != null || to != null) - criteria.andReportDateBetween(from.toDate(), to.toDate()); - if (lastEditFrom != null || lastEditTo != null) - criteria.andDateEditedBetween(lastEditFrom.toDate(), lastEditTo.toDate()); - if (!criteria.isValid()) - throw new IllegalArgumentException("Atleast one search filter must be specified"); - else - return convert(reportMetadataMapper.selectMany(reportMetadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findReportsByDynamicQuery(String query) { - throw new IllegalArgumentException("Method not supported"); - } - - @Override - protected Long retrievePrimaryKey(Report entity) { - if (entity == null || entity.getId() == null) { - return null; - } - String documentId = entity.getId(); - - ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); - reportMetadataExample.createCriteria().andDocumentIdEqualTo(documentId); - - org.opensrp.domain.postgres.Report pgReport = reportMetadataMapper.selectByDocumentId(documentId); - if (pgReport == null) { - return null; - } - return pgReport.getId(); - } - - @Override - protected Object getUniqueField(Report report) { - return report == null ? null : report.getId(); - } - - //private Methods - private Report convert(org.opensrp.domain.postgres.Report pgReport) { - if (pgReport == null || pgReport.getJson() == null || !(pgReport.getJson() instanceof Report)) { - return null; - } - return (Report) pgReport.getJson(); - } - - private org.opensrp.domain.postgres.Report convert(Report entity, Long primaryKey) { - if (entity == null) { - return null; - } - - org.opensrp.domain.postgres.Report pgReport = new org.opensrp.domain.postgres.Report(); - pgReport.setId(primaryKey); - pgReport.setJson(entity); - - return pgReport; - } - - private List convert(List reports) { - if (reports == null || reports.isEmpty()) { - return new ArrayList<>(); - } - - List convertedReports = new ArrayList<>(); - for (org.opensrp.domain.postgres.Report event : reports) { - Report convertedReport = convert(event); - if (convertedReport != null) { - convertedReports.add(convertedReport); - } - } - return convertedReports; - } - - private ReportMetadata createMetadata(Report entity, Long id) { - ReportMetadata reportMetadata = new ReportMetadata(); - reportMetadata.setReportId(id); - reportMetadata.setDocumentId(entity.getId()); - reportMetadata.setBaseEntityId(entity.getBaseEntityId()); - reportMetadata.setFormSubmissionId(entity.getFormSubmissionId()); - reportMetadata.setReportType(entity.getReportType()); - if (entity.getReportDate() != null) { - reportMetadata.setReportDate(entity.getReportDate().toDate()); - } - reportMetadata.setServerVersion(entity.getServerVersion()); - reportMetadata.setProviderId(entity.getProviderId()); - reportMetadata.setLocationId(entity.getLocationId()); - if (entity.getDateEdited() != null) { - reportMetadata.setDateEdited(entity.getDateEdited().toDate()); - } - return reportMetadata; - } - - /** - * Method should be used only during Unit testing - * Deletes all existing records - */ - public void removeAll() { - reportMetadataMapper.deleteByExample(new ReportMetadataExample()); - reportMapper.deleteByExample(new ReportExample()); - - } - + + @Autowired + private CustomReportMapper reportMapper; + + @Autowired + private CustomReportMetadataMapper reportMetadataMapper; + + @Override + public Report get(String id) { + if (StringUtils.isBlank(id)) { + return null; + } + org.opensrp.domain.postgres.Report pgReport = reportMetadataMapper.selectByDocumentId(id); + + return convert(pgReport); + } + + private void updateServerVersion(org.opensrp.domain.postgres.Report pgReport, Report entity) { + long serverVersion = reportMapper.selectServerVersionByPrimaryKey(pgReport.getId()); + entity.setServerVersion(serverVersion); + pgReport.setJson(entity); + pgReport.setServerVersion(null); + int rowsAffected = reportMapper.updateByPrimaryKeySelective(pgReport); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + } + + @Override + public void add(Report entity) { + if (entity == null) { + return; + } + + if (retrievePrimaryKey(entity) != null) { //Report already added + return; + } + + if (entity.getId() == null || entity.getId().isEmpty()) + entity.setId(UUID.randomUUID().toString()); + setRevision(entity); + + org.opensrp.domain.postgres.Report pgReport = convert(entity, null); + if (pgReport == null) { + return; + } + + int rowsAffected = reportMapper.insertSelectiveAndSetId(pgReport); + logger.info("rowsAffected, pgReport.getId():" + rowsAffected + "," + pgReport.getId()); + if (rowsAffected < 1 || pgReport.getId() == null) { + throw new IllegalStateException(); + } + + updateServerVersion(pgReport, entity); + + ReportMetadata reportMetadata = createMetadata(entity, pgReport.getId()); + if (reportMetadata != null) { + reportMetadataMapper.insertSelective(reportMetadata); + } + + } + + @Override + public void update(Report entity) { + if (entity == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { // Report not added + return; + } + + setRevision(entity); + org.opensrp.domain.postgres.Report pgReport = convert(entity, id); + if (pgReport == null) { + return; + } + + + int rowsAffected = reportMapper.updateByPrimaryKeyAndGenerateServerVersion(pgReport); + if (rowsAffected < 1) { + return; + } + + updateServerVersion(pgReport, entity); + + ReportMetadata reportMetadata = createMetadata(entity, id); + if (reportMetadata == null) { + return; + } + + ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); + reportMetadataExample.createCriteria().andReportIdEqualTo(id); + reportMetadata.setId(reportMetadataMapper.selectByExample(reportMetadataExample).get(0).getId()); + reportMetadataMapper.updateByPrimaryKey(reportMetadata); + + } + + @Override + public List getAll() { + List reports = reportMetadataMapper.selectMany(new ReportMetadataExample(), 0, + DEFAULT_FETCH_SIZE); + return convert(reports); + } + + @Override + public void safeRemove(Report entity) { + if (entity == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { + return; + } + + ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); + reportMetadataExample.createCriteria().andReportIdEqualTo(id); + int rowsAffected = reportMetadataMapper.deleteByExample(reportMetadataExample); + if (rowsAffected < 1) { + return; + } + + reportMapper.deleteByPrimaryKey(id); + + } + + @Override + public Report findById(String id) { + return get(id); + } + + @Override + public List findByBaseEntityId(String baseEntityId) { + ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); + reportMetadataExample.createCriteria().andBaseEntityIdEqualTo(baseEntityId); + return convert(reportMetadataMapper.selectMany(reportMetadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findAllByIdentifier(String identifier) { + return convert(reportMapper.selectByIdentifier(identifier, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findByBaseEntityAndType(String baseEntityId, String reportType) { + ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); + reportMetadataExample.createCriteria().andBaseEntityIdEqualTo(baseEntityId).andReportTypeEqualTo(reportType); + return convert(reportMetadataMapper.selectMany(reportMetadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findByEmptyServerVersion() { + ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); + reportMetadataExample.createCriteria().andServerVersionIsNull(); + reportMetadataExample.or(reportMetadataExample.createCriteria().andServerVersionEqualTo(0l)); + return convert(reportMetadataMapper.selectMany(reportMetadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findByServerVersion(long serverVersion) { + ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); + reportMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion + 1); + return convert(reportMetadataMapper.selectMany(reportMetadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findByBaseEntityAndFormSubmissionId(String baseEntityId, String formSubmissionId) { + ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); + reportMetadataExample.createCriteria().andBaseEntityIdEqualTo(baseEntityId) + .andFormSubmissionIdEqualTo(formSubmissionId); + return convert(reportMetadataMapper.selectMany(reportMetadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findReports(String team, String providerId, String locationId, String baseEntityId, + Long serverVersion, String sortBy, String sortOrder, int limit) { + ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); + Criteria criteria = reportMetadataExample.createCriteria(); + if (team != null && !team.isEmpty()) { + String[] idsArray = org.apache.commons.lang.StringUtils.split(team, ","); + List ids = new ArrayList(Arrays.asList(idsArray)); + if (providerId != null && !ids.contains(providerId)) { + ids.add(providerId); + } + criteria.andProviderIdIn(ids); + } else if ((providerId != null && StringUtils.isNotEmpty(providerId))) { + criteria.andProviderIdEqualTo(providerId); + } + if (StringUtils.isNotBlank(locationId)) + criteria.andLocationIdEqualTo(locationId); + if (StringUtils.isNotBlank(baseEntityId)) + criteria.andBaseEntityIdEqualTo(baseEntityId); + if (serverVersion != null) + criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); + reportMetadataExample.setOrderByClause(getOrderByClause(sortBy, sortOrder)); + if (!criteria.isValid()) { + throw new IllegalArgumentException("Atleast one search filter must be specified"); + } else + return convert(reportMetadataMapper.selectMany(reportMetadataExample, 0, limit)); + } + + @Override + public List findReports(String baseEntityId, DateTime from, DateTime to, String reportType, String providerId, + String locationId, DateTime lastEditFrom, DateTime lastEditTo) { + ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); + Criteria criteria = reportMetadataExample.createCriteria(); + if (StringUtils.isNotBlank(baseEntityId)) + criteria.andBaseEntityIdEqualTo(baseEntityId); + if (StringUtils.isNotBlank(locationId)) + criteria.andReportTypeEqualTo(reportType); + if (StringUtils.isNotBlank(providerId)) + criteria.andProviderIdEqualTo(providerId); + if (StringUtils.isNotBlank(locationId)) + criteria.andLocationIdEqualTo(locationId); + if (from != null || to != null) + criteria.andReportDateBetween(from.toDate(), to.toDate()); + if (lastEditFrom != null || lastEditTo != null) + criteria.andDateEditedBetween(lastEditFrom.toDate(), lastEditTo.toDate()); + if (!criteria.isValid()) + throw new IllegalArgumentException("Atleast one search filter must be specified"); + else + return convert(reportMetadataMapper.selectMany(reportMetadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findReportsByDynamicQuery(String query) { + throw new IllegalArgumentException("Method not supported"); + } + + @Override + protected Long retrievePrimaryKey(Report entity) { + if (entity == null || entity.getId() == null) { + return null; + } + String documentId = entity.getId(); + + ReportMetadataExample reportMetadataExample = new ReportMetadataExample(); + reportMetadataExample.createCriteria().andDocumentIdEqualTo(documentId); + + org.opensrp.domain.postgres.Report pgReport = reportMetadataMapper.selectByDocumentId(documentId); + if (pgReport == null) { + return null; + } + return pgReport.getId(); + } + + @Override + protected Object getUniqueField(Report report) { + return report == null ? null : report.getId(); + } + + //private Methods + private Report convert(org.opensrp.domain.postgres.Report pgReport) { + if (pgReport == null || pgReport.getJson() == null || !(pgReport.getJson() instanceof Report)) { + return null; + } + return (Report) pgReport.getJson(); + } + + private org.opensrp.domain.postgres.Report convert(Report entity, Long primaryKey) { + if (entity == null) { + return null; + } + + org.opensrp.domain.postgres.Report pgReport = new org.opensrp.domain.postgres.Report(); + pgReport.setId(primaryKey); + pgReport.setJson(entity); + + return pgReport; + } + + private List convert(List reports) { + if (reports == null || reports.isEmpty()) { + return new ArrayList<>(); + } + + List convertedReports = new ArrayList<>(); + for (org.opensrp.domain.postgres.Report event : reports) { + Report convertedReport = convert(event); + if (convertedReport != null) { + convertedReports.add(convertedReport); + } + } + return convertedReports; + } + + private ReportMetadata createMetadata(Report entity, Long id) { + ReportMetadata reportMetadata = new ReportMetadata(); + reportMetadata.setReportId(id); + reportMetadata.setDocumentId(entity.getId()); + reportMetadata.setBaseEntityId(entity.getBaseEntityId()); + reportMetadata.setFormSubmissionId(entity.getFormSubmissionId()); + reportMetadata.setReportType(entity.getReportType()); + if (entity.getReportDate() != null) { + reportMetadata.setReportDate(entity.getReportDate().toDate()); + } + reportMetadata.setServerVersion(entity.getServerVersion()); + reportMetadata.setProviderId(entity.getProviderId()); + reportMetadata.setLocationId(entity.getLocationId()); + if (entity.getDateEdited() != null) { + reportMetadata.setDateEdited(entity.getDateEdited().toDate()); + } + return reportMetadata; + } + + /** + * Method should be used only during Unit testing + * Deletes all existing records + */ + public void removeAll() { + reportMetadataMapper.deleteByExample(new ReportMetadataExample()); + reportMapper.deleteByExample(new ReportExample()); + + } + } diff --git a/src/main/java/org/opensrp/repository/postgres/SearchRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/SearchRepositoryImpl.java index c9b21af96..64e919129 100644 --- a/src/main/java/org/opensrp/repository/postgres/SearchRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/SearchRepositoryImpl.java @@ -13,22 +13,22 @@ @Repository("searchRepositoryPostgres") public class SearchRepositoryImpl implements SearchRepository { - - @Autowired - private CustomClientMetadataMapper clientMetadataMapper; - - @Autowired - private ClientsRepository clientsRepository; - - @Override - public List findByCriteria(ClientSearchBean clientSearchBean, String firstName, String middleName, - String lastName, Integer limit) { - clientSearchBean.setFirstName(firstName); - clientSearchBean.setMiddleName(middleName); - clientSearchBean.setLastName(lastName); - List clients = clientMetadataMapper.selectBySearchBean(clientSearchBean, - new AddressSearchBean(), 0, limit == null ? BaseRepositoryImpl.DEFAULT_FETCH_SIZE : limit); - return clientsRepository.convert(clients); - } - + + @Autowired + private CustomClientMetadataMapper clientMetadataMapper; + + @Autowired + private ClientsRepository clientsRepository; + + @Override + public List findByCriteria(ClientSearchBean clientSearchBean, String firstName, String middleName, + String lastName, Integer limit) { + clientSearchBean.setFirstName(firstName); + clientSearchBean.setMiddleName(middleName); + clientSearchBean.setLastName(lastName); + List clients = clientMetadataMapper.selectBySearchBean(clientSearchBean, + new AddressSearchBean(), 0, limit == null ? BaseRepositoryImpl.DEFAULT_FETCH_SIZE : limit); + return clientsRepository.convert(clients); + } + } diff --git a/src/main/java/org/opensrp/repository/postgres/SettingRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/SettingRepositoryImpl.java index 26d3deb6e..a4c6bbc8d 100755 --- a/src/main/java/org/opensrp/repository/postgres/SettingRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/SettingRepositoryImpl.java @@ -43,758 +43,754 @@ @Repository("settingRepositoryPostgres") public class SettingRepositoryImpl extends BaseRepositoryImpl implements SettingRepository { - private static final Logger logger = LogManager.getLogger(SettingRepositoryImpl.class); - - private final List reformattedLocationHierarchy = new ArrayList<>(); - - @Autowired - private CustomSettingMapper settingMapper; - - @Autowired - private CustomSettingMetadataMapper settingMetadataMapper; - - private String locationUuid; - - @Autowired - private DataSource openSRPDataSource; - - @Override - public SettingConfiguration get(String id) { - if (StringUtils.isBlank(id)) { - return null; - } - SettingSearchBean settingQueryBean = new SettingSearchBean(); - settingQueryBean.setDocumentId(id); - - return findSetting(settingQueryBean, null); - } - - private void updateServerVersion(Settings pgSettings, SettingConfiguration entity) { - long serverVersion = settingMapper.selectServerVersionByPrimaryKey(pgSettings.getId()); - entity.setServerVersion(serverVersion); - pgSettings.setJson(entity); - pgSettings.setServerVersion(null); - int rowsAffected = settingMapper.updateByPrimaryKeySelective(pgSettings); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - } - - @Override - public void add(SettingConfiguration entity) { - //todo not required. - } - - @Transactional - @Override - public void update(SettingConfiguration entity) { - if (entity == null || entity.getId() == null || entity.getIdentifier() == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - - if (id == null) { // Setting not exists - return; - } - - setRevision(entity); - - Settings pgSetting = convert(entity, id); - List settings = entity.getSettings(); - entity.setSettings(null); // strip out the settings block - if (pgSetting == null) { - return; - } - - int rowsAffected = settingMapper.updateByPrimaryKeyAndGenerateServerVersion(pgSetting); - if (rowsAffected < 1) { - return; - } - - updateServerVersion(pgSetting, entity); - entity.setSettings(settings);// re-inject settings block - List metadata = createMetadata(entity, id); - List settingsMetadataList = new ArrayList<>(); - - for (SettingsMetadata settingsMetadata : metadata) { - if (StringUtils.isBlank(settingsMetadata.getSettingValue())) { - deleteExistingSettingsMetadataByKeyAndIdentifier(settingsMetadata.getIdentifier(), settingsMetadata.getSettingKey(), - settingsMetadata.getLocationId()); //This method is called to delete existing settings metadata records where value field is empty - } - if (!checkIfMetadataExists(settingsMetadata) && StringUtils.isNotBlank(settingsMetadata.getSettingValue())) { - settingsMetadataList.add(settingsMetadata); - } - } - - if (!settingsMetadataList.isEmpty()) { - settingMetadataMapper.insertMany(settingsMetadataList); - } - settingMetadataMapper.updateMany(metadata); - } - - @Override - public List getAll() { - return convertToSettingConfigurations( - settingMetadataMapper.selectMany(new SettingsMetadataExample(), 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public void safeRemove(SettingConfiguration entity) { - if (entity == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { - return; - } - - SettingsMetadataExample metadataExample = new SettingsMetadataExample(); - metadataExample.createCriteria().andSettingsIdEqualTo(id); - int rowsAffected = settingMetadataMapper.deleteByExample(metadataExample); - if (rowsAffected < 1) { - return; - } - - settingMapper.deleteByPrimaryKey(id); - } - - @Override - public List findAllSettings() { - return getAll(); - } - - @Override - public List findSettings(SettingSearchBean settingQueryBean, - Map> treeNodeHashMap) { - Integer limit; - limit = settingQueryBean.getLimit() == null || settingQueryBean.getLimit() == 0? DEFAULT_FETCH_SIZE : settingQueryBean.getLimit(); - return findSettings(settingQueryBean, limit, treeNodeHashMap); - } - - @Override - public SettingConfiguration findSetting(SettingSearchBean settingQueryBean, - Map> treeNodeHashMap) { - List settingConfigurations = findSettings(settingQueryBean, treeNodeHashMap); - return settingConfigurations.isEmpty() ? null : settingConfigurations.get(0); - } - - public List findSettings(SettingSearchBean settingQueryBean, int limit, - Map> treeNodeHashMap) { - if (settingQueryBean.isResolveSettings()) { - return resolveSettings(findSettingsAndSettingsMetadata(settingQueryBean, treeNodeHashMap, limit), - settingQueryBean.isV1Settings(), settingQueryBean.isResolveSettings()); - } else { - return convertToSettingConfigurations(findSettingsAndSettingsMetadata(settingQueryBean, treeNodeHashMap, limit), - settingQueryBean.isV1Settings(), settingQueryBean.isResolveSettings()); - } - } - - public SettingsAndSettingsMetadataJoined findSettingsAndSettingsMetadata(SettingSearchBean settingQueryBean, - Map> treeNodeHashMap) { - List settingsAndSettingsMetadataJoined = findSettingsAndSettingsMetadata( - settingQueryBean, treeNodeHashMap, 1); - return isEmptyList(settingsAndSettingsMetadataJoined) ? null : settingsAndSettingsMetadataJoined.get(0); - } - - public List findSettingsAndSettingsMetadata(SettingSearchBean settingQueryBean, - Map> treeNodeHashMap, int limit) { - SettingsMetadataExample metadataExample = new SettingsMetadataExample(); - SettingsMetadataExample.Criteria criteria = metadataExample.createCriteria(); - String locationId = settingQueryBean.getLocationId(); - Long primaryKey = settingQueryBean.getPrimaryKey(); - updateCriteria(criteria, settingQueryBean); - - if (primaryKey != null) { - metadataExample.or(metadataExample.createCriteria().andSettingsIdEqualTo(primaryKey)); - } - - if (StringUtils.isBlank(settingQueryBean.getId())) { - criteria.andServerVersionGreaterThanOrEqualTo(settingQueryBean.getServerVersion()); - } - - if (settingQueryBean.getMetadataVersion() != null) { - criteria.andMetadataVersionGreaterThan(settingQueryBean.getMetadataVersion()); - } - - if (settingQueryBean.isResolveSettings()) { - return fetchSettingsPerLocation(settingQueryBean, metadataExample, treeNodeHashMap, limit, criteria); - } else { - if (StringUtils.isNotEmpty(locationId)) { - criteria.andLocationIdEqualTo(locationId); - } - return settingMetadataMapper.selectMany(metadataExample, 0, limit); - } - } - - private SettingsMetadataExample.Criteria updateCriteria(SettingsMetadataExample.Criteria criteria, - SettingSearchBean settingQueryBean) { - String providerId = settingQueryBean.getProviderId(); - String team = settingQueryBean.getTeam(); - String teamId = settingQueryBean.getTeamId(); - String documentId = settingQueryBean.getDocumentId(); - String identifier = settingQueryBean.getIdentifier(); - String locationId = settingQueryBean.getLocationId(); - String id = settingQueryBean.getId(); - - if (StringUtils.isBlank(providerId) && StringUtils.isBlank(locationId) && StringUtils.isBlank(team) - && StringUtils.isBlank(teamId) && StringUtils.isBlank(documentId) && StringUtils.isBlank(identifier) - && StringUtils.isBlank(id)) { - criteria.andTeamIdIsNull().andTeamIsNull().andProviderIdIsNull().andLocationIdIsNull().andDocumentIdIsNotNull() - .andIdentifierIsNotNull().andIdIsNotNull(); - } else { - if (StringUtils.isNotBlank(providerId)) { - criteria.andProviderIdEqualTo(providerId); - } - if (StringUtils.isNotBlank(team)) { - criteria.andTeamEqualTo(team); - } - if (StringUtils.isNotBlank(teamId)) { - criteria.andTeamIdEqualTo(teamId); - } - if (StringUtils.isNotBlank(documentId)) { - criteria.andDocumentIdEqualTo(documentId); - } - if (StringUtils.isNotBlank(identifier)) { - criteria.andIdentifierEqualTo(identifier); - } - if (StringUtils.isNotBlank(id)) { - criteria.andIdEqualTo(Long.valueOf(id)); - } - } - - return criteria; - } - - private List fetchSettingsPerLocation(SettingSearchBean settingSearchBean, - SettingsMetadataExample metadataExample, Map> treeNodeHashMap, int limit, - SettingsMetadataExample.Criteria criteria) { - - List settingsAndSettingsMetadataJoinedList = new ArrayList<>(); - if (StringUtils.isNotBlank(settingSearchBean.getLocationId())) { - locationUuid = settingSearchBean.getLocationId(); - - reformattedLocationHierarchy.clear(); - if (treeNodeHashMap != null && treeNodeHashMap.size() > 0) { - reformattedLocationHierarchy(treeNodeHashMap); - } - - if (reformattedLocationHierarchy.size() > 0) { - criteria.andLocationIdIn(reformattedLocationHierarchy); - settingsAndSettingsMetadataJoinedList = settingMetadataMapper.selectMany(metadataExample, 0, limit); - } - } - - return settingsAndSettingsMetadataJoinedList; - } - - private void reformattedLocationHierarchy(Map> parentLocation) { - Map.Entry> stringMapEntry = parentLocation.entrySet().iterator().next(); - String locationKey = stringMapEntry.getKey(); - if (StringUtils.isNotBlank(locationKey)) { - reformattedLocationHierarchy.add(locationKey); - } - - if (!locationUuid.equals(locationKey)) { - TreeNode childLocation = stringMapEntry.getValue(); - Map> newLocation = childLocation.getChildren(); - reformattedLocationHierarchy(newLocation); - } - } - - private List resolveSettings( - List settingsAndSettingsMetadataJoined, boolean isV1Settings, - boolean resolveSettings) { - Map stringConfigurationMap = new HashMap<>(); - Map stringSettingsMap = new HashMap<>(); - - List configurations = convertToSettingConfigurations(settingsAndSettingsMetadataJoined, - isV1Settings, resolveSettings); - - for (SettingConfiguration configuration : configurations) { - String configKey = - configuration.getId() + "_" + configuration.getLocationId() + "_" + configuration.getIdentifier(); - stringConfigurationMap.put(configKey, configuration); - - List settingsList = configuration.getSettings(); - for (Setting setting : settingsList) { - String settingKey = setting.getKey() + "_" + configuration.getIdentifier(); - stringSettingsMap.put(settingKey, setting); - } - } - - return reconcileConfigurations(stringConfigurationMap, stringSettingsMap); - } - - private List reconcileConfigurations(Map stringConfigurationMap, - Map stringSettingsMap) { - List settingConfigurations = new ArrayList<>(); - for (Map.Entry configElement : stringConfigurationMap.entrySet()) { - List settingList = new ArrayList<>(); - SettingConfiguration configuration = (SettingConfiguration) configElement.getValue(); - configuration.setSettings(new ArrayList<>()); - - for (Map.Entry settingsElement : stringSettingsMap.entrySet()) { - if (((String) settingsElement.getKey()).contains(configuration.getIdentifier())) { - settingList.add((Setting) settingsElement.getValue()); - } - } - - configuration.setSettings(settingList); - settingConfigurations.add(configuration); - } - - return settingConfigurations; - } - - @Override - public List findByEmptyServerVersion() { - SettingsMetadataExample metadataExample = new SettingsMetadataExample(); - metadataExample.createCriteria().andServerVersionIsNull(); - metadataExample.or(metadataExample.createCriteria().andServerVersionEqualTo(0L)); - return convertToSettingConfigurations(settingMetadataMapper.selectMany(metadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - protected Long retrievePrimaryKey(SettingConfiguration settingConfiguration) { - SettingSearchBean settingSearchBean = createDocumentIdSearchBean(settingConfiguration); - SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined = - findSettingsAndSettingsMetadata(settingSearchBean, null); - Settings pgSetting = - settingsAndSettingsMetadataJoined == null ? null : settingsAndSettingsMetadataJoined.getSettings(); - if (pgSetting == null) { - return null; - } - return pgSetting.getId(); - } - - private SettingSearchBean createDocumentIdSearchBean(SettingConfiguration settingConfiguration) { - SettingSearchBean settingSearchBean = new SettingSearchBean(); - Object uniqueId = getUniqueField(settingConfiguration); - if (uniqueId == null) { - return settingSearchBean; - } - - String settingId = settingConfiguration.getId(); - - if (StringUtils.isNotBlank(settingId)) { - settingSearchBean.setDocumentId(uniqueId.toString()); - } else { - settingSearchBean.setIdentifier(uniqueId.toString()); - } - - return settingSearchBean; - } - - @Override - protected Object getUniqueField(SettingConfiguration settingConfiguration) { - if (settingConfiguration == null) { - return null; - } - String settingId = settingConfiguration.getId(); - String settingIdentifier = settingConfiguration.getIdentifier(); - - return StringUtils.isNotBlank(settingId) ? settingId : settingIdentifier; - } - - private Settings convert(SettingConfiguration entity, Long id) { - if (entity == null) { - return null; - } - - Settings pgSetting = new Settings(); - pgSetting.setId(id); - pgSetting.setJson(entity); - - return pgSetting; - } - - private SettingConfiguration convert(Settings settings) { - return (SettingConfiguration) settings.getJson(); - } - - private List convertToSettingConfigurations( - List jointSettings) { - return convertToSettingConfigurations(jointSettings, false, false); - } - - private List convertToSettingConfigurations( - List settingsAndSettingsMetadataJoined, boolean isV1Settings, - boolean resolveSettings) { - List settingConfigurations = new ArrayList<>(); - if (settingsAndSettingsMetadataJoined == null || settingsAndSettingsMetadataJoined.isEmpty()) { - return settingConfigurations; - } - - Map settingConfigurationMap = new HashMap<>(); - for (SettingsAndSettingsMetadataJoined jointSetting : settingsAndSettingsMetadataJoined) { - SettingConfiguration settingConfiguration = settingConfigurationMap.get(jointSetting.getSettings().getId()); - if (settingConfiguration == null) { - settingConfiguration = convert(jointSetting.getSettings()); - settingConfigurationMap.put(jointSetting.getSettings().getId(), settingConfiguration); - settingConfiguration.setSettings(new ArrayList<>()); - } - settingConfiguration.getSettings() - .add(convertToSetting(jointSetting.getSettingsMetadata(), isV1Settings, resolveSettings)); - settingConfiguration.setDocumentId(settingConfiguration.getSettings().get(0).getDocumentId()); - settingConfiguration.setIdentifier(settingConfiguration.getSettings().get(0).getSettingIdentifier()); - } - settingConfigurations.addAll(settingConfigurationMap.values()); - return settingConfigurations; - } - - private Setting convertToSetting(SettingsMetadata settingsMetadata, boolean isV1Settings, boolean resolveSettings) { - Setting setting = new Setting(); - getSettingValue(settingsMetadata, setting); - setting.setKey(settingsMetadata.getSettingKey()); - setting.setSettingMetadataId(String.valueOf(settingsMetadata.getId())); - setting.setUuid(settingsMetadata.getUuid()); - if (resolveSettings && !locationUuid.equals(settingsMetadata.getLocationId())) { - setting.setInheritedFrom(settingsMetadata.getLocationId()); - } else { - setting.setInheritedFrom(settingsMetadata.getInheritedFrom()); - } - setting.setDescription(settingsMetadata.getSettingDescription()); - setting.setLabel(settingsMetadata.getSettingLabel()); - setting.setSettingIdentifier(settingsMetadata.getIdentifier()); - if (settingsMetadata.getMetadataVersion() != null) { - setting.setMetadataVersion(settingsMetadata.getMetadataVersion()); - } - if (!isV1Settings) { - setting.setProviderId(settingsMetadata.getProviderId()); - setting.setSettingsId(String.valueOf(settingsMetadata.getSettingsId())); - setting.setTeamId(settingsMetadata.getTeamId()); - setting.setTeam(settingsMetadata.getTeam()); - setting.setLocationId(settingsMetadata.getLocationId()); - setting.setType(settingsMetadata.getSettingType()); - if (settingsMetadata.getServerVersion() != null) { - setting.setServerVersion(settingsMetadata.getServerVersion()); - } - setting.setDocumentId(settingsMetadata.getDocumentId()); - } - return setting; - } - - private Setting convertToSetting(SettingsMetadata settingsMetadata, boolean isV1Settings) { - return convertToSetting(settingsMetadata, isV1Settings, false); - } - - private void getSettingValue(SettingsMetadata settingsMetadata, Setting setting) { - String value = settingsMetadata.getSettingValue(); - if (StringUtils.isNotBlank(value)) { - try { - JSONArray jsonArray = new JSONArray(value); - setting.setValues(jsonArray); - } - catch (JSONException e) { - setting.setValue(value); - } - } - } - - @Override - public String addOrUpdate(Setting setting) { - List settings = new ArrayList<>(); - settings.add(setting); - SettingConfiguration settingConfiguration = new SettingConfiguration(); - settingConfiguration.setChildLocationId(setting.getChildLocationId()); - settingConfiguration.setLocationId(setting.getLocationId()); - settingConfiguration.setProviderId(setting.getProviderId()); - settingConfiguration.setTeam(setting.getTeam()); - settingConfiguration.setTeamId(setting.getTeamId()); - settingConfiguration.setIdentifier(setting.getIdentifier()); - settingConfiguration.setType(setting.getType()); - settingConfiguration.setSettings(settings); - settingConfiguration.setDocumentId(setting.getDocumentId()); - if (StringUtils.isNotBlank(setting.getSettingsId())) { - settingConfiguration.setId(setting.getSettingsId()); - } - settingConfiguration.setV1Settings(false); - - if (StringUtils.isNotBlank(setting.getId())) { - update(settingConfiguration); - } else { - return addSettings(settingConfiguration); - } - - return null; - } - - @Override - public void delete(Long settingId) { - settingMetadataMapper.deleteByPrimaryKey(settingId); - } - - @Override - public String addSettings(SettingConfiguration entity) { - if (entity == null || entity.getSettings() == null || entity.getIdentifier() == null) { - return null; - } - - Long id = retrievePrimaryKey(entity); - List settings; - Settings pgSettings; - - if (id == null) { - if (entity.getId() == null || entity.getId().isEmpty()) { - entity.setId(UUID.randomUUID().toString()); - } - - setRevision(entity); - - settings = entity.getSettings(); - entity.setSettings(null); // strip out the settings block - pgSettings = convert(entity, id); - if (pgSettings == null) { - return null; - } - - int rowsAffected = settingMapper.insertSelectiveAndSetId(pgSettings); - if (rowsAffected < 1 || pgSettings.getId() == null) { - return null; - } - - updateServerVersion(pgSettings, entity); - } else { - settings = entity.getSettings(); - pgSettings = convert(entity, id); - } - - return checkWhetherMetadataExistsBeforeSave(entity, settings, pgSettings); - } - - private String checkWhetherMetadataExistsBeforeSave(SettingConfiguration entity, List settings, - Settings pgSettings) { - entity.setSettings(settings); // re-inject settings block - List settingsMetadata = createMetadata(entity, pgSettings.getId()); - List settingsMetadataList = new ArrayList<>(); - - for (SettingsMetadata metadata : settingsMetadata) { - if (!checkIfMetadataExists(metadata) && StringUtils.isNotBlank(metadata.getSettingValue())) { // Add a check to restrict persistence of settings metadata with empty value - settingsMetadataList.add(metadata); - } - } - - return insertSettingMetadata(settingsMetadataList); - } - - private String insertSettingMetadata(List settingsMetadataList) { - String insertSettingMetadata = "INSERT INTO core.settings_metadata ( settings_id, document_id, identifier, " - + "server_version, team, team_id, provider_id, location_id, uuid, json, setting_type, setting_value, " - + "setting_key, setting_description, setting_label, inherited_from) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?," - + "?) ON conflict DO NOTHING"; - - Connection connection = null; - - List notSavedSettings = new ArrayList<>(); - - try { - connection = DataSourceUtils.getConnection(openSRPDataSource); - PreparedStatement preparedStatement = connection.prepareStatement(insertSettingMetadata); - for (SettingsMetadata settingsMetadata : settingsMetadataList) { - - ObjectMapper objectMapper = new ObjectMapper(); - String json; - try { - json = objectMapper.writeValueAsString(settingsMetadata.getJson()); - - PGobject pGobject = new PGobject(); - pGobject.setType("json"); - pGobject.setValue(json); - - preparedStatement.setLong(1, settingsMetadata.getSettingsId()); - preparedStatement.setString(2, settingsMetadata.getDocumentId()); - preparedStatement.setString(3, settingsMetadata.getIdentifier()); - preparedStatement.setLong(4, settingsMetadata.getServerVersion()); - preparedStatement.setString(5, settingsMetadata.getTeam()); - preparedStatement.setString(6, settingsMetadata.getTeamId()); - preparedStatement.setString(7, settingsMetadata.getProviderId()); - preparedStatement.setString(8, settingsMetadata.getLocationId()); - preparedStatement.setString(9, settingsMetadata.getUuid()); - preparedStatement.setObject(10, pGobject); - preparedStatement.setString(11, settingsMetadata.getSettingType()); - preparedStatement.setString(12, settingsMetadata.getSettingValue()); - preparedStatement.setString(13, settingsMetadata.getSettingKey()); - preparedStatement.setString(14, settingsMetadata.getSettingDescription()); - preparedStatement.setString(15, settingsMetadata.getSettingLabel()); - preparedStatement.setString(16, settingsMetadata.getInheritedFrom()); - preparedStatement.addBatch(); - } - catch (JsonProcessingException e) { - e.printStackTrace(); - notSavedSettings.add(settingsMetadata.getSettingKey()); - } - } - preparedStatement.executeBatch(); - preparedStatement.close(); - connection.close(); - } - catch (SQLException e) { - logger.error(e.getMessage(), e); - throw new DatabaseException(e.getMessage()); - } - finally { - if (connection != null) { - DataSourceUtils.releaseConnection(connection, openSRPDataSource); - } - } - - String responce = ""; - if (notSavedSettings.size() > 0) { - responce = notSavedSettings.toString(); - } - - return responce; - } - - private boolean checkIfMetadataExists(SettingsMetadata settingsMetadata) { - SettingsMetadataExample metadataExample = new SettingsMetadataExample(); - SettingsMetadataExample.Criteria criteria = metadataExample.createCriteria(); - - String locationId = settingsMetadata.getLocationId(); - String teamId = settingsMetadata.getTeamId(); - String settingsId = String.valueOf(settingsMetadata.getSettingsId()); - String settingKey = settingsMetadata.getSettingKey(); - String documentId = settingsMetadata.getDocumentId(); - - if (StringUtils.isNotBlank(locationId)) { - criteria.andLocationIdEqualTo(locationId); - } - if (StringUtils.isNotBlank(teamId)) { - criteria.andTeamIdEqualTo(teamId); - } - - if (StringUtils.isNotBlank(settingsId)) { - criteria.andSettingsIdEqualTo(Long.valueOf(settingsId)); - } - - if (StringUtils.isNotBlank(documentId)) { - criteria.andDocumentIdEqualTo(documentId); - } - - if (StringUtils.isNotBlank(settingKey)) { - criteria.andSettingKeyEqualTo(settingKey); - } - List settingsAndSettingsMetadataJoinedList = settingMetadataMapper - .selectMany(metadataExample, 0, DEFAULT_FETCH_SIZE); - return settingsAndSettingsMetadataJoinedList.size() > 0; - } - - private List createMetadata(SettingConfiguration settingConfiguration, Long id) { - List settingsMetadata = new ArrayList<>(); - if (settingConfiguration != null) { - List settings = settingConfiguration.getSettings(); - - try { - for (Setting setting : settings) { - SettingsMetadata metadata = new SettingsMetadata(); - metadata.setSettingKey(setting.getKey()); - if (StringUtils.isNotBlank(setting.getValue())) { - metadata.setSettingValue(setting.getValue()); - } - - if (setting.getValues() != null && setting.getValues().length() > 0) { - metadata.setSettingValue(String.valueOf(setting.getValues())); - } - metadata.setSettingDescription(setting.getDescription()); - metadata.setSettingLabel(setting.getLabel()); - metadata.setSettingsId(id); - metadata.setSettingType(setting.getType()); - metadata.setUuid(setting.getUuid() != null ? setting.getUuid() : UUID.randomUUID().toString()); - metadata.setInheritedFrom(setting.getInheritedFrom()); - metadata.setDocumentId( - settingConfiguration.getId() != null ? - settingConfiguration.getId() : - UUID.randomUUID().toString()); - metadata.setIdentifier(settingConfiguration.getIdentifier()); - checkIdentityAttributtes(settingConfiguration, metadata); - metadata.setServerVersion(settingConfiguration.getServerVersion()); - metadata.setMetadataVersion(settingConfiguration.getMetadataVersion()); - metadata.setJson(convertToSetting(metadata, false)); //always want to create the json on the settings - // creation - - settingsMetadata.add(metadata); - } - } - catch (Exception e) { - logger.error(e.getMessage(), e); - } - } - - return settingsMetadata; - } - - private void checkIdentityAttributtes(SettingConfiguration settingConfiguration, SettingsMetadata metadata) { - if (StringUtils.isNotBlank(settingConfiguration.getProviderId())) { - metadata.setProviderId(settingConfiguration.getProviderId()); - } - - if (StringUtils.isNotBlank(settingConfiguration.getLocationId())) { - metadata.setLocationId(settingConfiguration.getLocationId()); - } - - if (StringUtils.isNotBlank(settingConfiguration.getTeam())) { - metadata.setTeam(settingConfiguration.getTeam()); - } - - if (StringUtils.isNotBlank(settingConfiguration.getTeamId())) { - metadata.setTeamId(settingConfiguration.getTeamId()); - } - } - - @Override - @Deprecated - public SettingsMetadata getSettingMetadataByDocumentId(String documentId) { - List settingsMetadata = getAllSettingMetadataByDocumentId(documentId); - return !settingsMetadata.isEmpty() ? settingsMetadata.get(0) : null; - } - - public List getAllSettingMetadataByDocumentId(String documentId) { - SettingsMetadataExample example = new SettingsMetadataExample(); - example.createCriteria().andDocumentIdEqualTo(documentId); - return settingMetadataMapper.selectByExample(example); - } - - @Override - public Settings getSettingById(Long id) { - SettingSearchBean settingQueryBean = new SettingSearchBean(); - settingQueryBean.setServerVersion(0L); - settingQueryBean.setPrimaryKey(id); - - SettingConfiguration settingConfiguration = findSetting(settingQueryBean, null); - return settingConfiguration == null ? null : convert(settingConfiguration, id); - } - - public List getReformattedLocationHierarchy() { - return reformattedLocationHierarchy; - } - - @Override - public List findSettingsAndSettingsMetadataByIdentifier(String identifier) { - SettingsMetadataExample metadataExample = new SettingsMetadataExample(); - SettingsMetadataExample.Criteria criteria = metadataExample.createCriteria(); - criteria.andIdentifierEqualTo(identifier); - return settingMetadataMapper.selectMany(metadataExample, 0, DEFAULT_FETCH_SIZE); - } - - /** - * This method deletes existing settings metadata by settings key, identifier and locationId - * @param identifier is the settings identifer - * @param key is the settings key - * @param locationId is used as an optional param to delete settings metadata records - */ - private void deleteExistingSettingsMetadataByKeyAndIdentifier(String identifier, String key, String locationId) { - SettingsMetadataExample metadataExample; - metadataExample = new SettingsMetadataExample(); - SettingsMetadataExample.Criteria criteria = metadataExample.createCriteria(); - - if (StringUtils.isNotBlank(locationId)) { - criteria.andLocationIdEqualTo(locationId); - } - - criteria.andIdentifierEqualTo(identifier).andSettingKeyEqualTo(key); - settingMetadataMapper.deleteByExample(metadataExample); - } + private static final Logger logger = LogManager.getLogger(SettingRepositoryImpl.class); + + private final List reformattedLocationHierarchy = new ArrayList<>(); + + @Autowired + private CustomSettingMapper settingMapper; + + @Autowired + private CustomSettingMetadataMapper settingMetadataMapper; + + private String locationUuid; + + @Autowired + private DataSource openSRPDataSource; + + @Override + public SettingConfiguration get(String id) { + if (StringUtils.isBlank(id)) { + return null; + } + SettingSearchBean settingQueryBean = new SettingSearchBean(); + settingQueryBean.setDocumentId(id); + + return findSetting(settingQueryBean, null); + } + + private void updateServerVersion(Settings pgSettings, SettingConfiguration entity) { + long serverVersion = settingMapper.selectServerVersionByPrimaryKey(pgSettings.getId()); + entity.setServerVersion(serverVersion); + pgSettings.setJson(entity); + pgSettings.setServerVersion(null); + int rowsAffected = settingMapper.updateByPrimaryKeySelective(pgSettings); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + } + + @Override + public void add(SettingConfiguration entity) { + //todo not required. + } + + @Transactional + @Override + public void update(SettingConfiguration entity) { + if (entity == null || entity.getId() == null || entity.getIdentifier() == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + + if (id == null) { // Setting not exists + return; + } + + setRevision(entity); + + Settings pgSetting = convert(entity, id); + List settings = entity.getSettings(); + entity.setSettings(null); // strip out the settings block + if (pgSetting == null) { + return; + } + + int rowsAffected = settingMapper.updateByPrimaryKeyAndGenerateServerVersion(pgSetting); + if (rowsAffected < 1) { + return; + } + + updateServerVersion(pgSetting, entity); + entity.setSettings(settings);// re-inject settings block + List metadata = createMetadata(entity, id); + List settingsMetadataList = new ArrayList<>(); + + for (SettingsMetadata settingsMetadata : metadata) { + if (StringUtils.isBlank(settingsMetadata.getSettingValue())) { + deleteExistingSettingsMetadataByKeyAndIdentifier(settingsMetadata.getIdentifier(), settingsMetadata.getSettingKey(), + settingsMetadata.getLocationId()); //This method is called to delete existing settings metadata records where value field is empty + } + if (!checkIfMetadataExists(settingsMetadata) && StringUtils.isNotBlank(settingsMetadata.getSettingValue())) { + settingsMetadataList.add(settingsMetadata); + } + } + + if (!settingsMetadataList.isEmpty()) { + settingMetadataMapper.insertMany(settingsMetadataList); + } + settingMetadataMapper.updateMany(metadata); + } + + @Override + public List getAll() { + return convertToSettingConfigurations( + settingMetadataMapper.selectMany(new SettingsMetadataExample(), 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public void safeRemove(SettingConfiguration entity) { + if (entity == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { + return; + } + + SettingsMetadataExample metadataExample = new SettingsMetadataExample(); + metadataExample.createCriteria().andSettingsIdEqualTo(id); + int rowsAffected = settingMetadataMapper.deleteByExample(metadataExample); + if (rowsAffected < 1) { + return; + } + + settingMapper.deleteByPrimaryKey(id); + } + + @Override + public List findAllSettings() { + return getAll(); + } + + @Override + public List findSettings(SettingSearchBean settingQueryBean, + Map> treeNodeHashMap) { + Integer limit; + limit = settingQueryBean.getLimit() == null || settingQueryBean.getLimit() == 0 ? DEFAULT_FETCH_SIZE : settingQueryBean.getLimit(); + return findSettings(settingQueryBean, limit, treeNodeHashMap); + } + + @Override + public SettingConfiguration findSetting(SettingSearchBean settingQueryBean, + Map> treeNodeHashMap) { + List settingConfigurations = findSettings(settingQueryBean, treeNodeHashMap); + return settingConfigurations.isEmpty() ? null : settingConfigurations.get(0); + } + + public List findSettings(SettingSearchBean settingQueryBean, int limit, + Map> treeNodeHashMap) { + if (settingQueryBean.isResolveSettings()) { + return resolveSettings(findSettingsAndSettingsMetadata(settingQueryBean, treeNodeHashMap, limit), + settingQueryBean.isV1Settings(), settingQueryBean.isResolveSettings()); + } else { + return convertToSettingConfigurations(findSettingsAndSettingsMetadata(settingQueryBean, treeNodeHashMap, limit), + settingQueryBean.isV1Settings(), settingQueryBean.isResolveSettings()); + } + } + + public SettingsAndSettingsMetadataJoined findSettingsAndSettingsMetadata(SettingSearchBean settingQueryBean, + Map> treeNodeHashMap) { + List settingsAndSettingsMetadataJoined = findSettingsAndSettingsMetadata( + settingQueryBean, treeNodeHashMap, 1); + return isEmptyList(settingsAndSettingsMetadataJoined) ? null : settingsAndSettingsMetadataJoined.get(0); + } + + public List findSettingsAndSettingsMetadata(SettingSearchBean settingQueryBean, + Map> treeNodeHashMap, int limit) { + SettingsMetadataExample metadataExample = new SettingsMetadataExample(); + SettingsMetadataExample.Criteria criteria = metadataExample.createCriteria(); + String locationId = settingQueryBean.getLocationId(); + Long primaryKey = settingQueryBean.getPrimaryKey(); + updateCriteria(criteria, settingQueryBean); + + if (primaryKey != null) { + metadataExample.or(metadataExample.createCriteria().andSettingsIdEqualTo(primaryKey)); + } + + if (StringUtils.isBlank(settingQueryBean.getId())) { + criteria.andServerVersionGreaterThanOrEqualTo(settingQueryBean.getServerVersion()); + } + + if (settingQueryBean.getMetadataVersion() != null) { + criteria.andMetadataVersionGreaterThan(settingQueryBean.getMetadataVersion()); + } + + if (settingQueryBean.isResolveSettings()) { + return fetchSettingsPerLocation(settingQueryBean, metadataExample, treeNodeHashMap, limit, criteria); + } else { + if (StringUtils.isNotEmpty(locationId)) { + criteria.andLocationIdEqualTo(locationId); + } + return settingMetadataMapper.selectMany(metadataExample, 0, limit); + } + } + + private SettingsMetadataExample.Criteria updateCriteria(SettingsMetadataExample.Criteria criteria, + SettingSearchBean settingQueryBean) { + String providerId = settingQueryBean.getProviderId(); + String team = settingQueryBean.getTeam(); + String teamId = settingQueryBean.getTeamId(); + String documentId = settingQueryBean.getDocumentId(); + String identifier = settingQueryBean.getIdentifier(); + String locationId = settingQueryBean.getLocationId(); + String id = settingQueryBean.getId(); + + if (StringUtils.isBlank(providerId) && StringUtils.isBlank(locationId) && StringUtils.isBlank(team) + && StringUtils.isBlank(teamId) && StringUtils.isBlank(documentId) && StringUtils.isBlank(identifier) + && StringUtils.isBlank(id)) { + criteria.andTeamIdIsNull().andTeamIsNull().andProviderIdIsNull().andLocationIdIsNull().andDocumentIdIsNotNull() + .andIdentifierIsNotNull().andIdIsNotNull(); + } else { + if (StringUtils.isNotBlank(providerId)) { + criteria.andProviderIdEqualTo(providerId); + } + if (StringUtils.isNotBlank(team)) { + criteria.andTeamEqualTo(team); + } + if (StringUtils.isNotBlank(teamId)) { + criteria.andTeamIdEqualTo(teamId); + } + if (StringUtils.isNotBlank(documentId)) { + criteria.andDocumentIdEqualTo(documentId); + } + if (StringUtils.isNotBlank(identifier)) { + criteria.andIdentifierEqualTo(identifier); + } + if (StringUtils.isNotBlank(id)) { + criteria.andIdEqualTo(Long.valueOf(id)); + } + } + + return criteria; + } + + private List fetchSettingsPerLocation(SettingSearchBean settingSearchBean, + SettingsMetadataExample metadataExample, Map> treeNodeHashMap, int limit, + SettingsMetadataExample.Criteria criteria) { + + List settingsAndSettingsMetadataJoinedList = new ArrayList<>(); + if (StringUtils.isNotBlank(settingSearchBean.getLocationId())) { + locationUuid = settingSearchBean.getLocationId(); + + reformattedLocationHierarchy.clear(); + if (treeNodeHashMap != null && treeNodeHashMap.size() > 0) { + reformattedLocationHierarchy(treeNodeHashMap); + } + + if (reformattedLocationHierarchy.size() > 0) { + criteria.andLocationIdIn(reformattedLocationHierarchy); + settingsAndSettingsMetadataJoinedList = settingMetadataMapper.selectMany(metadataExample, 0, limit); + } + } + + return settingsAndSettingsMetadataJoinedList; + } + + private void reformattedLocationHierarchy(Map> parentLocation) { + Map.Entry> stringMapEntry = parentLocation.entrySet().iterator().next(); + String locationKey = stringMapEntry.getKey(); + if (StringUtils.isNotBlank(locationKey)) { + reformattedLocationHierarchy.add(locationKey); + } + + if (!locationUuid.equals(locationKey)) { + TreeNode childLocation = stringMapEntry.getValue(); + Map> newLocation = childLocation.getChildren(); + reformattedLocationHierarchy(newLocation); + } + } + + private List resolveSettings( + List settingsAndSettingsMetadataJoined, boolean isV1Settings, + boolean resolveSettings) { + Map stringConfigurationMap = new HashMap<>(); + Map stringSettingsMap = new HashMap<>(); + + List configurations = convertToSettingConfigurations(settingsAndSettingsMetadataJoined, + isV1Settings, resolveSettings); + + for (SettingConfiguration configuration : configurations) { + String configKey = + configuration.getId() + "_" + configuration.getLocationId() + "_" + configuration.getIdentifier(); + stringConfigurationMap.put(configKey, configuration); + + List settingsList = configuration.getSettings(); + for (Setting setting : settingsList) { + String settingKey = setting.getKey() + "_" + configuration.getIdentifier(); + stringSettingsMap.put(settingKey, setting); + } + } + + return reconcileConfigurations(stringConfigurationMap, stringSettingsMap); + } + + private List reconcileConfigurations(Map stringConfigurationMap, + Map stringSettingsMap) { + List settingConfigurations = new ArrayList<>(); + for (Map.Entry configElement : stringConfigurationMap.entrySet()) { + List settingList = new ArrayList<>(); + SettingConfiguration configuration = (SettingConfiguration) configElement.getValue(); + configuration.setSettings(new ArrayList<>()); + + for (Map.Entry settingsElement : stringSettingsMap.entrySet()) { + if (((String) settingsElement.getKey()).contains(configuration.getIdentifier())) { + settingList.add((Setting) settingsElement.getValue()); + } + } + + configuration.setSettings(settingList); + settingConfigurations.add(configuration); + } + + return settingConfigurations; + } + + @Override + public List findByEmptyServerVersion() { + SettingsMetadataExample metadataExample = new SettingsMetadataExample(); + metadataExample.createCriteria().andServerVersionIsNull(); + metadataExample.or(metadataExample.createCriteria().andServerVersionEqualTo(0L)); + return convertToSettingConfigurations(settingMetadataMapper.selectMany(metadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + protected Long retrievePrimaryKey(SettingConfiguration settingConfiguration) { + SettingSearchBean settingSearchBean = createDocumentIdSearchBean(settingConfiguration); + SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined = + findSettingsAndSettingsMetadata(settingSearchBean, null); + Settings pgSetting = + settingsAndSettingsMetadataJoined == null ? null : settingsAndSettingsMetadataJoined.getSettings(); + if (pgSetting == null) { + return null; + } + return pgSetting.getId(); + } + + private SettingSearchBean createDocumentIdSearchBean(SettingConfiguration settingConfiguration) { + SettingSearchBean settingSearchBean = new SettingSearchBean(); + Object uniqueId = getUniqueField(settingConfiguration); + if (uniqueId == null) { + return settingSearchBean; + } + + String settingId = settingConfiguration.getId(); + + if (StringUtils.isNotBlank(settingId)) { + settingSearchBean.setDocumentId(uniqueId.toString()); + } else { + settingSearchBean.setIdentifier(uniqueId.toString()); + } + + return settingSearchBean; + } + + @Override + protected Object getUniqueField(SettingConfiguration settingConfiguration) { + if (settingConfiguration == null) { + return null; + } + String settingId = settingConfiguration.getId(); + String settingIdentifier = settingConfiguration.getIdentifier(); + + return StringUtils.isNotBlank(settingId) ? settingId : settingIdentifier; + } + + private Settings convert(SettingConfiguration entity, Long id) { + if (entity == null) { + return null; + } + + Settings pgSetting = new Settings(); + pgSetting.setId(id); + pgSetting.setJson(entity); + + return pgSetting; + } + + private SettingConfiguration convert(Settings settings) { + return (SettingConfiguration) settings.getJson(); + } + + private List convertToSettingConfigurations( + List jointSettings) { + return convertToSettingConfigurations(jointSettings, false, false); + } + + private List convertToSettingConfigurations( + List settingsAndSettingsMetadataJoined, boolean isV1Settings, + boolean resolveSettings) { + List settingConfigurations = new ArrayList<>(); + if (settingsAndSettingsMetadataJoined == null || settingsAndSettingsMetadataJoined.isEmpty()) { + return settingConfigurations; + } + + Map settingConfigurationMap = new HashMap<>(); + for (SettingsAndSettingsMetadataJoined jointSetting : settingsAndSettingsMetadataJoined) { + SettingConfiguration settingConfiguration = settingConfigurationMap.get(jointSetting.getSettings().getId()); + if (settingConfiguration == null) { + settingConfiguration = convert(jointSetting.getSettings()); + settingConfigurationMap.put(jointSetting.getSettings().getId(), settingConfiguration); + settingConfiguration.setSettings(new ArrayList<>()); + } + settingConfiguration.getSettings() + .add(convertToSetting(jointSetting.getSettingsMetadata(), isV1Settings, resolveSettings)); + settingConfiguration.setDocumentId(settingConfiguration.getSettings().get(0).getDocumentId()); + settingConfiguration.setIdentifier(settingConfiguration.getSettings().get(0).getSettingIdentifier()); + } + settingConfigurations.addAll(settingConfigurationMap.values()); + return settingConfigurations; + } + + private Setting convertToSetting(SettingsMetadata settingsMetadata, boolean isV1Settings, boolean resolveSettings) { + Setting setting = new Setting(); + getSettingValue(settingsMetadata, setting); + setting.setKey(settingsMetadata.getSettingKey()); + setting.setSettingMetadataId(String.valueOf(settingsMetadata.getId())); + setting.setUuid(settingsMetadata.getUuid()); + if (resolveSettings && !locationUuid.equals(settingsMetadata.getLocationId())) { + setting.setInheritedFrom(settingsMetadata.getLocationId()); + } else { + setting.setInheritedFrom(settingsMetadata.getInheritedFrom()); + } + setting.setDescription(settingsMetadata.getSettingDescription()); + setting.setLabel(settingsMetadata.getSettingLabel()); + setting.setSettingIdentifier(settingsMetadata.getIdentifier()); + if (settingsMetadata.getMetadataVersion() != null) { + setting.setMetadataVersion(settingsMetadata.getMetadataVersion()); + } + if (!isV1Settings) { + setting.setProviderId(settingsMetadata.getProviderId()); + setting.setSettingsId(String.valueOf(settingsMetadata.getSettingsId())); + setting.setTeamId(settingsMetadata.getTeamId()); + setting.setTeam(settingsMetadata.getTeam()); + setting.setLocationId(settingsMetadata.getLocationId()); + setting.setType(settingsMetadata.getSettingType()); + if (settingsMetadata.getServerVersion() != null) { + setting.setServerVersion(settingsMetadata.getServerVersion()); + } + setting.setDocumentId(settingsMetadata.getDocumentId()); + } + return setting; + } + + private Setting convertToSetting(SettingsMetadata settingsMetadata, boolean isV1Settings) { + return convertToSetting(settingsMetadata, isV1Settings, false); + } + + private void getSettingValue(SettingsMetadata settingsMetadata, Setting setting) { + String value = settingsMetadata.getSettingValue(); + if (StringUtils.isNotBlank(value)) { + try { + JSONArray jsonArray = new JSONArray(value); + setting.setValues(jsonArray); + } catch (JSONException e) { + setting.setValue(value); + } + } + } + + @Override + public String addOrUpdate(Setting setting) { + List settings = new ArrayList<>(); + settings.add(setting); + SettingConfiguration settingConfiguration = new SettingConfiguration(); + settingConfiguration.setChildLocationId(setting.getChildLocationId()); + settingConfiguration.setLocationId(setting.getLocationId()); + settingConfiguration.setProviderId(setting.getProviderId()); + settingConfiguration.setTeam(setting.getTeam()); + settingConfiguration.setTeamId(setting.getTeamId()); + settingConfiguration.setIdentifier(setting.getIdentifier()); + settingConfiguration.setType(setting.getType()); + settingConfiguration.setSettings(settings); + settingConfiguration.setDocumentId(setting.getDocumentId()); + if (StringUtils.isNotBlank(setting.getSettingsId())) { + settingConfiguration.setId(setting.getSettingsId()); + } + settingConfiguration.setV1Settings(false); + + if (StringUtils.isNotBlank(setting.getId())) { + update(settingConfiguration); + } else { + return addSettings(settingConfiguration); + } + + return null; + } + + @Override + public void delete(Long settingId) { + settingMetadataMapper.deleteByPrimaryKey(settingId); + } + + @Override + public String addSettings(SettingConfiguration entity) { + if (entity == null || entity.getSettings() == null || entity.getIdentifier() == null) { + return null; + } + + Long id = retrievePrimaryKey(entity); + List settings; + Settings pgSettings; + + if (id == null) { + if (entity.getId() == null || entity.getId().isEmpty()) { + entity.setId(UUID.randomUUID().toString()); + } + + setRevision(entity); + + settings = entity.getSettings(); + entity.setSettings(null); // strip out the settings block + pgSettings = convert(entity, id); + if (pgSettings == null) { + return null; + } + + int rowsAffected = settingMapper.insertSelectiveAndSetId(pgSettings); + if (rowsAffected < 1 || pgSettings.getId() == null) { + return null; + } + + updateServerVersion(pgSettings, entity); + } else { + settings = entity.getSettings(); + pgSettings = convert(entity, id); + } + + return checkWhetherMetadataExistsBeforeSave(entity, settings, pgSettings); + } + + private String checkWhetherMetadataExistsBeforeSave(SettingConfiguration entity, List settings, + Settings pgSettings) { + entity.setSettings(settings); // re-inject settings block + List settingsMetadata = createMetadata(entity, pgSettings.getId()); + List settingsMetadataList = new ArrayList<>(); + + for (SettingsMetadata metadata : settingsMetadata) { + if (!checkIfMetadataExists(metadata) && StringUtils.isNotBlank(metadata.getSettingValue())) { // Add a check to restrict persistence of settings metadata with empty value + settingsMetadataList.add(metadata); + } + } + + return insertSettingMetadata(settingsMetadataList); + } + + private String insertSettingMetadata(List settingsMetadataList) { + String insertSettingMetadata = "INSERT INTO core.settings_metadata ( settings_id, document_id, identifier, " + + "server_version, team, team_id, provider_id, location_id, uuid, json, setting_type, setting_value, " + + "setting_key, setting_description, setting_label, inherited_from) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?," + + "?) ON conflict DO NOTHING"; + + Connection connection = null; + + List notSavedSettings = new ArrayList<>(); + + try { + connection = DataSourceUtils.getConnection(openSRPDataSource); + PreparedStatement preparedStatement = connection.prepareStatement(insertSettingMetadata); + for (SettingsMetadata settingsMetadata : settingsMetadataList) { + + ObjectMapper objectMapper = new ObjectMapper(); + String json; + try { + json = objectMapper.writeValueAsString(settingsMetadata.getJson()); + + PGobject pGobject = new PGobject(); + pGobject.setType("json"); + pGobject.setValue(json); + + preparedStatement.setLong(1, settingsMetadata.getSettingsId()); + preparedStatement.setString(2, settingsMetadata.getDocumentId()); + preparedStatement.setString(3, settingsMetadata.getIdentifier()); + preparedStatement.setLong(4, settingsMetadata.getServerVersion()); + preparedStatement.setString(5, settingsMetadata.getTeam()); + preparedStatement.setString(6, settingsMetadata.getTeamId()); + preparedStatement.setString(7, settingsMetadata.getProviderId()); + preparedStatement.setString(8, settingsMetadata.getLocationId()); + preparedStatement.setString(9, settingsMetadata.getUuid()); + preparedStatement.setObject(10, pGobject); + preparedStatement.setString(11, settingsMetadata.getSettingType()); + preparedStatement.setString(12, settingsMetadata.getSettingValue()); + preparedStatement.setString(13, settingsMetadata.getSettingKey()); + preparedStatement.setString(14, settingsMetadata.getSettingDescription()); + preparedStatement.setString(15, settingsMetadata.getSettingLabel()); + preparedStatement.setString(16, settingsMetadata.getInheritedFrom()); + preparedStatement.addBatch(); + } catch (JsonProcessingException e) { + e.printStackTrace(); + notSavedSettings.add(settingsMetadata.getSettingKey()); + } + } + preparedStatement.executeBatch(); + preparedStatement.close(); + connection.close(); + } catch (SQLException e) { + logger.error(e.getMessage(), e); + throw new DatabaseException(e.getMessage()); + } finally { + if (connection != null) { + DataSourceUtils.releaseConnection(connection, openSRPDataSource); + } + } + + String responce = ""; + if (notSavedSettings.size() > 0) { + responce = notSavedSettings.toString(); + } + + return responce; + } + + private boolean checkIfMetadataExists(SettingsMetadata settingsMetadata) { + SettingsMetadataExample metadataExample = new SettingsMetadataExample(); + SettingsMetadataExample.Criteria criteria = metadataExample.createCriteria(); + + String locationId = settingsMetadata.getLocationId(); + String teamId = settingsMetadata.getTeamId(); + String settingsId = String.valueOf(settingsMetadata.getSettingsId()); + String settingKey = settingsMetadata.getSettingKey(); + String documentId = settingsMetadata.getDocumentId(); + + if (StringUtils.isNotBlank(locationId)) { + criteria.andLocationIdEqualTo(locationId); + } + if (StringUtils.isNotBlank(teamId)) { + criteria.andTeamIdEqualTo(teamId); + } + + if (StringUtils.isNotBlank(settingsId)) { + criteria.andSettingsIdEqualTo(Long.valueOf(settingsId)); + } + + if (StringUtils.isNotBlank(documentId)) { + criteria.andDocumentIdEqualTo(documentId); + } + + if (StringUtils.isNotBlank(settingKey)) { + criteria.andSettingKeyEqualTo(settingKey); + } + List settingsAndSettingsMetadataJoinedList = settingMetadataMapper + .selectMany(metadataExample, 0, DEFAULT_FETCH_SIZE); + return settingsAndSettingsMetadataJoinedList.size() > 0; + } + + private List createMetadata(SettingConfiguration settingConfiguration, Long id) { + List settingsMetadata = new ArrayList<>(); + if (settingConfiguration != null) { + List settings = settingConfiguration.getSettings(); + + try { + for (Setting setting : settings) { + SettingsMetadata metadata = new SettingsMetadata(); + metadata.setSettingKey(setting.getKey()); + if (StringUtils.isNotBlank(setting.getValue())) { + metadata.setSettingValue(setting.getValue()); + } + + if (setting.getValues() != null && setting.getValues().length() > 0) { + metadata.setSettingValue(String.valueOf(setting.getValues())); + } + metadata.setSettingDescription(setting.getDescription()); + metadata.setSettingLabel(setting.getLabel()); + metadata.setSettingsId(id); + metadata.setSettingType(setting.getType()); + metadata.setUuid(setting.getUuid() != null ? setting.getUuid() : UUID.randomUUID().toString()); + metadata.setInheritedFrom(setting.getInheritedFrom()); + metadata.setDocumentId( + settingConfiguration.getId() != null ? + settingConfiguration.getId() : + UUID.randomUUID().toString()); + metadata.setIdentifier(settingConfiguration.getIdentifier()); + checkIdentityAttributtes(settingConfiguration, metadata); + metadata.setServerVersion(settingConfiguration.getServerVersion()); + metadata.setMetadataVersion(settingConfiguration.getMetadataVersion()); + metadata.setJson(convertToSetting(metadata, false)); //always want to create the json on the settings + // creation + + settingsMetadata.add(metadata); + } + } catch (Exception e) { + logger.error(e.getMessage(), e); + } + } + + return settingsMetadata; + } + + private void checkIdentityAttributtes(SettingConfiguration settingConfiguration, SettingsMetadata metadata) { + if (StringUtils.isNotBlank(settingConfiguration.getProviderId())) { + metadata.setProviderId(settingConfiguration.getProviderId()); + } + + if (StringUtils.isNotBlank(settingConfiguration.getLocationId())) { + metadata.setLocationId(settingConfiguration.getLocationId()); + } + + if (StringUtils.isNotBlank(settingConfiguration.getTeam())) { + metadata.setTeam(settingConfiguration.getTeam()); + } + + if (StringUtils.isNotBlank(settingConfiguration.getTeamId())) { + metadata.setTeamId(settingConfiguration.getTeamId()); + } + } + + @Override + @Deprecated + public SettingsMetadata getSettingMetadataByDocumentId(String documentId) { + List settingsMetadata = getAllSettingMetadataByDocumentId(documentId); + return !settingsMetadata.isEmpty() ? settingsMetadata.get(0) : null; + } + + public List getAllSettingMetadataByDocumentId(String documentId) { + SettingsMetadataExample example = new SettingsMetadataExample(); + example.createCriteria().andDocumentIdEqualTo(documentId); + return settingMetadataMapper.selectByExample(example); + } + + @Override + public Settings getSettingById(Long id) { + SettingSearchBean settingQueryBean = new SettingSearchBean(); + settingQueryBean.setServerVersion(0L); + settingQueryBean.setPrimaryKey(id); + + SettingConfiguration settingConfiguration = findSetting(settingQueryBean, null); + return settingConfiguration == null ? null : convert(settingConfiguration, id); + } + + public List getReformattedLocationHierarchy() { + return reformattedLocationHierarchy; + } + + @Override + public List findSettingsAndSettingsMetadataByIdentifier(String identifier) { + SettingsMetadataExample metadataExample = new SettingsMetadataExample(); + SettingsMetadataExample.Criteria criteria = metadataExample.createCriteria(); + criteria.andIdentifierEqualTo(identifier); + return settingMetadataMapper.selectMany(metadataExample, 0, DEFAULT_FETCH_SIZE); + } + + /** + * This method deletes existing settings metadata by settings key, identifier and locationId + * + * @param identifier is the settings identifer + * @param key is the settings key + * @param locationId is used as an optional param to delete settings metadata records + */ + private void deleteExistingSettingsMetadataByKeyAndIdentifier(String identifier, String key, String locationId) { + SettingsMetadataExample metadataExample; + metadataExample = new SettingsMetadataExample(); + SettingsMetadataExample.Criteria criteria = metadataExample.createCriteria(); + + if (StringUtils.isNotBlank(locationId)) { + criteria.andLocationIdEqualTo(locationId); + } + + criteria.andIdentifierEqualTo(identifier).andSettingKeyEqualTo(key); + settingMetadataMapper.deleteByExample(metadataExample); + } } diff --git a/src/main/java/org/opensrp/repository/postgres/StocksRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/StocksRepositoryImpl.java index 795d1b15e..8e7173879 100755 --- a/src/main/java/org/opensrp/repository/postgres/StocksRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/StocksRepositoryImpl.java @@ -34,427 +34,425 @@ @Repository("stocksRepositoryPostgres") public class StocksRepositoryImpl extends BaseRepositoryImpl implements StocksRepository { - @Autowired - private CustomStockMapper stockMapper; - - @Autowired - private CustomStockMetadataMapper stockMetadataMapper; - - @Autowired - private LocationRepository locationRepository; - - @Override - public Stock get(String id) { - if (StringUtils.isBlank(id)) { - return null; - } - org.opensrp.domain.postgres.Stock pgStock = stockMetadataMapper.selectByDocumentId(id); - - return convert(pgStock); - } - - @Transactional - @Override - public void add(Stock entity) { - if (entity == null) { - return; - } - - if (retrievePrimaryKey(entity) != null) { //Stock already added - return; - } - - if (StringUtils.isBlank(entity.getId())) - entity.setId(UUID.randomUUID().toString()); - setRevision(entity); - - org.opensrp.domain.postgres.Stock pgStock = convert(entity, null); - if (pgStock == null) { - throw new IllegalStateException(); - } - - int rowsAffected = stockMapper.insertSelectiveAndSetId(pgStock); - - if (rowsAffected < 1 || pgStock.getId() == null) { - throw new IllegalStateException(); - } - - updateServerVersion(pgStock, entity); - - StockMetadata stockMetadata = createMetadata(entity, pgStock.getId()); - if (stockMetadata != null) { - stockMetadataMapper.insertSelective(stockMetadata); - } - - } - - private void updateServerVersion(org.opensrp.domain.postgres.Stock pgStock, Stock entity) { - long serverVersion = stockMapper.selectServerVersionByPrimaryKey(pgStock.getId()); - entity.setServerVersion(serverVersion); - pgStock.setJson(entity); - pgStock.setServerVersion(null); - int rowsAffected = stockMapper.updateByPrimaryKeySelective(pgStock); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - } - - @Transactional - @Override - public void update(Stock entity) { - if (entity == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { // Stock not added - throw new IllegalStateException(); - } - - setRevision(entity); - org.opensrp.domain.postgres.Stock pgStock = convert(entity, id); - if (pgStock == null) { - throw new IllegalStateException(); - } - - - - int rowsAffected = stockMapper.updateByPrimaryKeyAndGenerateServerVersion(pgStock); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - updateServerVersion(pgStock, entity); - - StockMetadata stockMetadata = createMetadata(entity, id); - if (stockMetadata == null) { - throw new IllegalStateException(); - } - - StockMetadataExample stockMetadataExample = new StockMetadataExample(); - stockMetadataExample.createCriteria().andStockIdEqualTo(id); - stockMetadata.setId(stockMetadataMapper.selectByExample(stockMetadataExample).get(0).getId()); - stockMetadataMapper.updateByPrimaryKey(stockMetadata); - - } - - @Override - public List getAll() { - List stocks = stockMetadataMapper.selectMany(new StockMetadataExample(), 0, - DEFAULT_FETCH_SIZE); - return convert(stocks); - } - - @Override - public void safeRemove(Stock entity) { - if (entity == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { - return; - } - - StockMetadataExample stockMetadataExample = new StockMetadataExample(); - stockMetadataExample.createCriteria().andStockIdEqualTo(id); - int rowsAffected = stockMetadataMapper.deleteByExample(stockMetadataExample); - if (rowsAffected < 1) { - return; - } - - stockMapper.deleteByPrimaryKey(id); - - } - - @Override - public List findAllByProviderid(String providerid) { - StockMetadataExample stockMetadataExample = new StockMetadataExample(); - stockMetadataExample.createCriteria().andProviderIdEqualTo(providerid); - return convert(stockMetadataMapper.selectMany(stockMetadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - /** - * implements the method equivalent in couch repository that return stocks matching stock type - * id - * - * @param stockType the stock type - * @param stockTypeId the stock type id - * @return list of stock of a particluar stock type id - */ - @Override - public List findAllByIdentifier(String stockType, String stockTypeId) { - return convert(stockMetadataMapper.selectByIdentifier(stockTypeId, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public Stock findById(String id) { - return get(id); - } - - @Override - public List findStocks(StockSearchBean searchBean, String sortBy, String sortOrder, int offset, int limit) { - String orderByClause = getOrderByClause(sortBy, sortOrder); - Date date = new Date(); - if(!searchBean.isReturnProduct()) { - return convert(stockMetadataMapper.selectManyBySearchBean(searchBean, date, orderByClause, offset, limit)); - } - else { - List pgStockAndProductDetails = stockMetadataMapper.selectManyStockAndProductDetailsBySearchBean(searchBean, date, orderByClause, offset, limit); - List stockAndProductDetails = convertStockAndProductDetails(pgStockAndProductDetails); - return convertStockAndProductListToStockList(stockAndProductDetails); - } - - } - - @Override - public List findStocks(StockSearchBean searchBean) { - String sortBy = searchBean.getOrderByFieldName() != null ? searchBean.getOrderByFieldName().name() : null; - String sortOrder= searchBean.getOrderByType() != null ? searchBean.getOrderByType().name() : null; - Pair pageLimitAndOffSet = getPageSizeAndOffset(searchBean); - searchBean.setOffset(pageLimitAndOffSet.getRight()); - searchBean.setLimit(pageLimitAndOffSet.getLeft()); - return findStocks(searchBean, sortBy, sortOrder, searchBean.getOffset(), searchBean.getLimit()); - } - - @Override - public List findAllStocks(Long serverVersion, Integer limit) { - StockMetadataExample stockMetadataExample = new StockMetadataExample(); - StockMetadataExample.Criteria criteria = stockMetadataExample.createCriteria(); - if(serverVersion != null) { - criteria.andServerVersionGreaterThan(serverVersion); - } - Integer pageLimit = limit == null ? DEFAULT_FETCH_SIZE : limit; - List stocks = stockMetadataMapper.selectMany(stockMetadataExample, 0, - pageLimit); - return convert(stocks); - } - - @Override - public Stock findByIdentifierAndServicePointId(String identifier, String locationId) { - return convert(stockMapper.selectByIdentifierAndLocationId(identifier,locationId)); - } - - @Override - public Stock getById(Long id) { - StockExample stockExample = new StockExample(); - stockExample.createCriteria().andIdEqualTo(id); - - List stocks = stockMapper.selectByExample(stockExample); - - return isEmptyList(stocks) ? null : convert(stocks.get(0)); - } - - @Override - public void delete(Long stockId) { - if (stockId == null) { - return; - } - - Stock stock = getById(stockId); - org.opensrp.domain.postgres.Stock pgStock = convert(stock, stockId); - Date dateDeleted = new Date(); - if (pgStock == null) { - return; - } - - pgStock.setDateDeleted(dateDeleted); - StockMetadata stockMetadata = findStockMetaDataByStockId(stockId); - stockMetadata.setDateDeleted(dateDeleted); - int rowsAffected = stockMetadataMapper.updateByPrimaryKey(stockMetadata); - if (rowsAffected < 1) { - return; - } - - stockMapper.updateByPrimaryKeySelective(pgStock); - } - - @Override - public List findStocksByLocationId(StockSearchBean stockSearchBean) { - Pair pageSizeAndOffset = getPageSizeAndOffset(stockSearchBean); + @Autowired + private CustomStockMapper stockMapper; + + @Autowired + private CustomStockMetadataMapper stockMetadataMapper; + + @Autowired + private LocationRepository locationRepository; + + @Override + public Stock get(String id) { + if (StringUtils.isBlank(id)) { + return null; + } + org.opensrp.domain.postgres.Stock pgStock = stockMetadataMapper.selectByDocumentId(id); + + return convert(pgStock); + } + + @Transactional + @Override + public void add(Stock entity) { + if (entity == null) { + return; + } + + if (retrievePrimaryKey(entity) != null) { //Stock already added + return; + } + + if (StringUtils.isBlank(entity.getId())) + entity.setId(UUID.randomUUID().toString()); + setRevision(entity); + + org.opensrp.domain.postgres.Stock pgStock = convert(entity, null); + if (pgStock == null) { + throw new IllegalStateException(); + } + + int rowsAffected = stockMapper.insertSelectiveAndSetId(pgStock); + + if (rowsAffected < 1 || pgStock.getId() == null) { + throw new IllegalStateException(); + } + + updateServerVersion(pgStock, entity); + + StockMetadata stockMetadata = createMetadata(entity, pgStock.getId()); + if (stockMetadata != null) { + stockMetadataMapper.insertSelective(stockMetadata); + } + + } + + private void updateServerVersion(org.opensrp.domain.postgres.Stock pgStock, Stock entity) { + long serverVersion = stockMapper.selectServerVersionByPrimaryKey(pgStock.getId()); + entity.setServerVersion(serverVersion); + pgStock.setJson(entity); + pgStock.setServerVersion(null); + int rowsAffected = stockMapper.updateByPrimaryKeySelective(pgStock); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + } + + @Transactional + @Override + public void update(Stock entity) { + if (entity == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { // Stock not added + throw new IllegalStateException(); + } + + setRevision(entity); + org.opensrp.domain.postgres.Stock pgStock = convert(entity, id); + if (pgStock == null) { + throw new IllegalStateException(); + } + + + int rowsAffected = stockMapper.updateByPrimaryKeyAndGenerateServerVersion(pgStock); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + updateServerVersion(pgStock, entity); + + StockMetadata stockMetadata = createMetadata(entity, id); + if (stockMetadata == null) { + throw new IllegalStateException(); + } + + StockMetadataExample stockMetadataExample = new StockMetadataExample(); + stockMetadataExample.createCriteria().andStockIdEqualTo(id); + stockMetadata.setId(stockMetadataMapper.selectByExample(stockMetadataExample).get(0).getId()); + stockMetadataMapper.updateByPrimaryKey(stockMetadata); + + } + + @Override + public List getAll() { + List stocks = stockMetadataMapper.selectMany(new StockMetadataExample(), 0, + DEFAULT_FETCH_SIZE); + return convert(stocks); + } + + @Override + public void safeRemove(Stock entity) { + if (entity == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { + return; + } + + StockMetadataExample stockMetadataExample = new StockMetadataExample(); + stockMetadataExample.createCriteria().andStockIdEqualTo(id); + int rowsAffected = stockMetadataMapper.deleteByExample(stockMetadataExample); + if (rowsAffected < 1) { + return; + } + + stockMapper.deleteByPrimaryKey(id); + + } + + @Override + public List findAllByProviderid(String providerid) { + StockMetadataExample stockMetadataExample = new StockMetadataExample(); + stockMetadataExample.createCriteria().andProviderIdEqualTo(providerid); + return convert(stockMetadataMapper.selectMany(stockMetadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + /** + * implements the method equivalent in couch repository that return stocks matching stock type + * id + * + * @param stockType the stock type + * @param stockTypeId the stock type id + * @return list of stock of a particluar stock type id + */ + @Override + public List findAllByIdentifier(String stockType, String stockTypeId) { + return convert(stockMetadataMapper.selectByIdentifier(stockTypeId, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public Stock findById(String id) { + return get(id); + } + + @Override + public List findStocks(StockSearchBean searchBean, String sortBy, String sortOrder, int offset, int limit) { + String orderByClause = getOrderByClause(sortBy, sortOrder); + Date date = new Date(); + if (!searchBean.isReturnProduct()) { + return convert(stockMetadataMapper.selectManyBySearchBean(searchBean, date, orderByClause, offset, limit)); + } else { + List pgStockAndProductDetails = stockMetadataMapper.selectManyStockAndProductDetailsBySearchBean(searchBean, date, orderByClause, offset, limit); + List stockAndProductDetails = convertStockAndProductDetails(pgStockAndProductDetails); + return convertStockAndProductListToStockList(stockAndProductDetails); + } + + } + + @Override + public List findStocks(StockSearchBean searchBean) { + String sortBy = searchBean.getOrderByFieldName() != null ? searchBean.getOrderByFieldName().name() : null; + String sortOrder = searchBean.getOrderByType() != null ? searchBean.getOrderByType().name() : null; + Pair pageLimitAndOffSet = getPageSizeAndOffset(searchBean); + searchBean.setOffset(pageLimitAndOffSet.getRight()); + searchBean.setLimit(pageLimitAndOffSet.getLeft()); + return findStocks(searchBean, sortBy, sortOrder, searchBean.getOffset(), searchBean.getLimit()); + } + + @Override + public List findAllStocks(Long serverVersion, Integer limit) { + StockMetadataExample stockMetadataExample = new StockMetadataExample(); + StockMetadataExample.Criteria criteria = stockMetadataExample.createCriteria(); + if (serverVersion != null) { + criteria.andServerVersionGreaterThan(serverVersion); + } + Integer pageLimit = limit == null ? DEFAULT_FETCH_SIZE : limit; + List stocks = stockMetadataMapper.selectMany(stockMetadataExample, 0, + pageLimit); + return convert(stocks); + } + + @Override + public Stock findByIdentifierAndServicePointId(String identifier, String locationId) { + return convert(stockMapper.selectByIdentifierAndLocationId(identifier, locationId)); + } + + @Override + public Stock getById(Long id) { + StockExample stockExample = new StockExample(); + stockExample.createCriteria().andIdEqualTo(id); + + List stocks = stockMapper.selectByExample(stockExample); + + return isEmptyList(stocks) ? null : convert(stocks.get(0)); + } + + @Override + public void delete(Long stockId) { + if (stockId == null) { + return; + } + + Stock stock = getById(stockId); + org.opensrp.domain.postgres.Stock pgStock = convert(stock, stockId); + Date dateDeleted = new Date(); + if (pgStock == null) { + return; + } + + pgStock.setDateDeleted(dateDeleted); + StockMetadata stockMetadata = findStockMetaDataByStockId(stockId); + stockMetadata.setDateDeleted(dateDeleted); + int rowsAffected = stockMetadataMapper.updateByPrimaryKey(stockMetadata); + if (rowsAffected < 1) { + return; + } + + stockMapper.updateByPrimaryKeySelective(pgStock); + } + + @Override + public List findStocksByLocationId(StockSearchBean stockSearchBean) { + Pair pageSizeAndOffset = getPageSizeAndOffset(stockSearchBean); stockSearchBean.setOffset(pageSizeAndOffset.getRight()); stockSearchBean.setLimit(pageSizeAndOffset.getLeft()); - return findStocks(stockSearchBean); - } - - public StockMetadata findStockMetaDataByStockId(Long stockId) { - return stockMetadataMapper.selectByStockId(stockId); - } - - @Override - protected Long retrievePrimaryKey(Stock entity) { - if (entity == null || entity.getId() == null) { - return null; - } - String documentId = entity.getId(); - - StockMetadataExample stockMetadataExample = new StockMetadataExample(); - stockMetadataExample.createCriteria().andDocumentIdEqualTo(documentId); - - org.opensrp.domain.postgres.Stock pgStock = stockMetadataMapper.selectByDocumentId(documentId); - if (pgStock == null) { - return null; - } - return pgStock.getId(); - } - - @Override - protected Object getUniqueField(Stock entity) { - return entity == null ? null : entity.getId(); - } - - //private methods - private Stock convert(org.opensrp.domain.postgres.Stock pgStock) { - if (pgStock == null || pgStock.getJson() == null || !(pgStock.getJson() instanceof Stock)) { - return null; - } - return (Stock) pgStock.getJson(); - } - - private org.opensrp.domain.postgres.Stock convert(Stock entity, Long id) { - if (entity == null) { - return null; - } - - org.opensrp.domain.postgres.Stock pgReport = new org.opensrp.domain.postgres.Stock(); - pgReport.setId(id); - pgReport.setJson(entity); - - return pgReport; - } - - private List convert(List stocks) { - if (stocks == null || stocks.isEmpty()) { - return new ArrayList<>(); - } - - List convertedStocks = new ArrayList<>(); - for (org.opensrp.domain.postgres.Stock stock : stocks) { - Stock convertedStock = convert(stock); - if (convertedStock != null) { - convertedStocks.add(convertedStock); - } - } - return convertedStocks; - } - - private StockMetadata createMetadata(Stock entity, Long id) { - StockMetadata metadata = new StockMetadata(); - metadata.setStockId(id); - metadata.setDocumentId(entity.getId()); - metadata.setProviderId(entity.getProviderid()); - metadata.setLocationId(entity.getLocationId()); - metadata.setServerVersion(entity.getServerVersion()); - return metadata; - } - - private Pair getPageSizeAndOffset(StockSearchBean stockSearchBean) { - return RepositoryUtil.getPageSizeAndOffset(stockSearchBean.getPageNumber(), stockSearchBean.getPageSize()); - } - - @Override - public List findInventoryItemsInAJurisdiction(String jurisdictionId) { - List childLocations = - locationRepository.findStructuresByProperties(false, jurisdictionId, null); - List servicePointIds = new ArrayList<>(); - for (PhysicalLocation physicalLocation : childLocations) { - servicePointIds.add(physicalLocation.getId()); - } - - if(servicePointIds != null && servicePointIds.size() > 0) { - return convertToFHIR(getInventoryWithProductDetails(servicePointIds)); - } - return convertToFHIR(new ArrayList<>()); - } - - - @Override - public List findInventoryInAServicePoint(String servicePointId) { - List locations = new ArrayList<>(); - locations.add(servicePointId); - return convertToFHIR(getInventoryWithProductDetails(locations)); - } - - @Override - public List getStockById(String stockId) { - return convertToFHIR(getInventoryWithProductDetailsByStockId(stockId)); - } - - private List convertStockAndProductDetails(List stockAndProductDetails) { - if (stockAndProductDetails == null || stockAndProductDetails.isEmpty()) { - return new ArrayList<>(); - } - - List convertedStocksAndProductDetails = new ArrayList<>(); - for (org.opensrp.domain.postgres.PgStockAndProductDetails stockAndProductDetail : stockAndProductDetails) { - StockAndProductDetails convertedStocksAndProductDetail = convert(stockAndProductDetail); - if (convertedStocksAndProductDetail != null) { - convertedStocksAndProductDetails.add(convertedStocksAndProductDetail); - } - } - return convertedStocksAndProductDetails; - } - - private List convertStockAndProductListToStockList(List stockAndProductDetails) { - if (stockAndProductDetails == null || stockAndProductDetails.isEmpty()) { - return new ArrayList<>(); - } - - List stocks = new ArrayList<>(); - for (StockAndProductDetails stockAndProductDetail : stockAndProductDetails) { - Stock stock = convertedStocksAndProductObjectToStockObject(stockAndProductDetail); - if (stock != null) { - stocks.add(stock); - } - } - return stocks; - } - - private Stock convertedStocksAndProductObjectToStockObject(StockAndProductDetails stockAndProductDetails) { - if(stockAndProductDetails == null) { - return null; - } - Stock stock = stockAndProductDetails.getStock(); - stock.setProduct(stockAndProductDetails.getProductCatalogue()); - return stock; - } - - - private StockAndProductDetails convert(org.opensrp.domain.postgres.PgStockAndProductDetails pgStockAndProductDetails) { - StockAndProductDetails stockAndProductDetails = new StockAndProductDetails(); - Stock stock = convert(pgStockAndProductDetails.getStock()); - ProductCatalogue productCatalogue = convert(pgStockAndProductDetails.getProductCatalogue(), ""); - stockAndProductDetails.setStock(stock); - stockAndProductDetails.setProductCatalogue(productCatalogue); - return stockAndProductDetails; - } - - private ProductCatalogue convert(org.opensrp.domain.postgres.ProductCatalogue pgProductCatalogue, String baseUrl) { - if (pgProductCatalogue == null || pgProductCatalogue.getJson() == null || !(pgProductCatalogue - .getJson() instanceof ProductCatalogue)) { - return null; - } - ProductCatalogue productCatalogue = (ProductCatalogue) pgProductCatalogue.getJson(); - productCatalogue.setUniqueId(pgProductCatalogue.getUniqueId()); - String photoUrl = productCatalogue.getPhotoURL(); - if(!StringUtils.isBlank(photoUrl)) { - productCatalogue.setPhotoURL(baseUrl + photoUrl); - } - return productCatalogue; - } - - @Override - public List getInventoryWithProductDetails(List locations) { - return convertStockAndProductDetails(stockMetadataMapper.selectManyStockAndProductDetailsByServicePointId(locations)); - } - - @Override - public List getInventoryWithProductDetailsByStockId(String stockId) { - return convertStockAndProductDetails(stockMetadataMapper.selectStockAndProductDetailsByStockId(stockId)); - } - - private List convertToFHIR(List stockAndProductDetails) { - return stockAndProductDetails.stream().map(stockAndProductDetail -> StockConverter.convertStockToBundleResource(stockAndProductDetail)) - .collect(Collectors.toList()); - } + return findStocks(stockSearchBean); + } + + public StockMetadata findStockMetaDataByStockId(Long stockId) { + return stockMetadataMapper.selectByStockId(stockId); + } + + @Override + protected Long retrievePrimaryKey(Stock entity) { + if (entity == null || entity.getId() == null) { + return null; + } + String documentId = entity.getId(); + + StockMetadataExample stockMetadataExample = new StockMetadataExample(); + stockMetadataExample.createCriteria().andDocumentIdEqualTo(documentId); + + org.opensrp.domain.postgres.Stock pgStock = stockMetadataMapper.selectByDocumentId(documentId); + if (pgStock == null) { + return null; + } + return pgStock.getId(); + } + + @Override + protected Object getUniqueField(Stock entity) { + return entity == null ? null : entity.getId(); + } + + //private methods + private Stock convert(org.opensrp.domain.postgres.Stock pgStock) { + if (pgStock == null || pgStock.getJson() == null || !(pgStock.getJson() instanceof Stock)) { + return null; + } + return (Stock) pgStock.getJson(); + } + + private org.opensrp.domain.postgres.Stock convert(Stock entity, Long id) { + if (entity == null) { + return null; + } + + org.opensrp.domain.postgres.Stock pgReport = new org.opensrp.domain.postgres.Stock(); + pgReport.setId(id); + pgReport.setJson(entity); + + return pgReport; + } + + private List convert(List stocks) { + if (stocks == null || stocks.isEmpty()) { + return new ArrayList<>(); + } + + List convertedStocks = new ArrayList<>(); + for (org.opensrp.domain.postgres.Stock stock : stocks) { + Stock convertedStock = convert(stock); + if (convertedStock != null) { + convertedStocks.add(convertedStock); + } + } + return convertedStocks; + } + + private StockMetadata createMetadata(Stock entity, Long id) { + StockMetadata metadata = new StockMetadata(); + metadata.setStockId(id); + metadata.setDocumentId(entity.getId()); + metadata.setProviderId(entity.getProviderid()); + metadata.setLocationId(entity.getLocationId()); + metadata.setServerVersion(entity.getServerVersion()); + return metadata; + } + + private Pair getPageSizeAndOffset(StockSearchBean stockSearchBean) { + return RepositoryUtil.getPageSizeAndOffset(stockSearchBean.getPageNumber(), stockSearchBean.getPageSize()); + } + + @Override + public List findInventoryItemsInAJurisdiction(String jurisdictionId) { + List childLocations = + locationRepository.findStructuresByProperties(false, jurisdictionId, null); + List servicePointIds = new ArrayList<>(); + for (PhysicalLocation physicalLocation : childLocations) { + servicePointIds.add(physicalLocation.getId()); + } + + if (servicePointIds != null && servicePointIds.size() > 0) { + return convertToFHIR(getInventoryWithProductDetails(servicePointIds)); + } + return convertToFHIR(new ArrayList<>()); + } + + + @Override + public List findInventoryInAServicePoint(String servicePointId) { + List locations = new ArrayList<>(); + locations.add(servicePointId); + return convertToFHIR(getInventoryWithProductDetails(locations)); + } + + @Override + public List getStockById(String stockId) { + return convertToFHIR(getInventoryWithProductDetailsByStockId(stockId)); + } + + private List convertStockAndProductDetails(List stockAndProductDetails) { + if (stockAndProductDetails == null || stockAndProductDetails.isEmpty()) { + return new ArrayList<>(); + } + + List convertedStocksAndProductDetails = new ArrayList<>(); + for (org.opensrp.domain.postgres.PgStockAndProductDetails stockAndProductDetail : stockAndProductDetails) { + StockAndProductDetails convertedStocksAndProductDetail = convert(stockAndProductDetail); + if (convertedStocksAndProductDetail != null) { + convertedStocksAndProductDetails.add(convertedStocksAndProductDetail); + } + } + return convertedStocksAndProductDetails; + } + + private List convertStockAndProductListToStockList(List stockAndProductDetails) { + if (stockAndProductDetails == null || stockAndProductDetails.isEmpty()) { + return new ArrayList<>(); + } + + List stocks = new ArrayList<>(); + for (StockAndProductDetails stockAndProductDetail : stockAndProductDetails) { + Stock stock = convertedStocksAndProductObjectToStockObject(stockAndProductDetail); + if (stock != null) { + stocks.add(stock); + } + } + return stocks; + } + + private Stock convertedStocksAndProductObjectToStockObject(StockAndProductDetails stockAndProductDetails) { + if (stockAndProductDetails == null) { + return null; + } + Stock stock = stockAndProductDetails.getStock(); + stock.setProduct(stockAndProductDetails.getProductCatalogue()); + return stock; + } + + + private StockAndProductDetails convert(org.opensrp.domain.postgres.PgStockAndProductDetails pgStockAndProductDetails) { + StockAndProductDetails stockAndProductDetails = new StockAndProductDetails(); + Stock stock = convert(pgStockAndProductDetails.getStock()); + ProductCatalogue productCatalogue = convert(pgStockAndProductDetails.getProductCatalogue(), ""); + stockAndProductDetails.setStock(stock); + stockAndProductDetails.setProductCatalogue(productCatalogue); + return stockAndProductDetails; + } + + private ProductCatalogue convert(org.opensrp.domain.postgres.ProductCatalogue pgProductCatalogue, String baseUrl) { + if (pgProductCatalogue == null || pgProductCatalogue.getJson() == null || !(pgProductCatalogue + .getJson() instanceof ProductCatalogue)) { + return null; + } + ProductCatalogue productCatalogue = (ProductCatalogue) pgProductCatalogue.getJson(); + productCatalogue.setUniqueId(pgProductCatalogue.getUniqueId()); + String photoUrl = productCatalogue.getPhotoURL(); + if (!StringUtils.isBlank(photoUrl)) { + productCatalogue.setPhotoURL(baseUrl + photoUrl); + } + return productCatalogue; + } + + @Override + public List getInventoryWithProductDetails(List locations) { + return convertStockAndProductDetails(stockMetadataMapper.selectManyStockAndProductDetailsByServicePointId(locations)); + } + + @Override + public List getInventoryWithProductDetailsByStockId(String stockId) { + return convertStockAndProductDetails(stockMetadataMapper.selectStockAndProductDetailsByStockId(stockId)); + } + + private List convertToFHIR(List stockAndProductDetails) { + return stockAndProductDetails.stream().map(stockAndProductDetail -> StockConverter.convertStockToBundleResource(stockAndProductDetail)) + .collect(Collectors.toList()); + } } diff --git a/src/main/java/org/opensrp/repository/postgres/TaskRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/TaskRepositoryImpl.java index 2d6d8101c..f77cf550f 100644 --- a/src/main/java/org/opensrp/repository/postgres/TaskRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/TaskRepositoryImpl.java @@ -26,428 +26,428 @@ @Repository public class TaskRepositoryImpl extends BaseRepositoryImpl implements TaskRepository { - - @Autowired - private CustomTaskMapper taskMapper; - - @Autowired - private CustomTaskMetadataMapper taskMetadataMapper; - - @Override - public Task get(String id) { - if (StringUtils.isBlank(id)) { - return null; - } - - org.opensrp.domain.postgres.Task pgTask = taskMetadataMapper.selectByIdentifier(id); - if (pgTask == null) { - return null; - } - return convert(pgTask); - } - - @Override - @Transactional - public void add(Task entity) { - if (getUniqueField(entity) == null) { - return; - } - - if (retrievePrimaryKey(entity) != null) { // Task already added - return; - } - - org.opensrp.domain.postgres.Task pgTask = convert(entity, null); - if (pgTask == null) { - throw new IllegalStateException(); - } - - int rowsAffected = taskMapper.insertSelectiveAndSetId(pgTask); - if (rowsAffected < 1 || pgTask.getId() == null) { - throw new IllegalStateException(); - } - - updateServerVersion(pgTask, entity); - - TaskMetadata taskMetadata = createMetadata(entity, pgTask.getId()); - - taskMetadataMapper.insertSelective(taskMetadata); - - } - - private void updateServerVersion(org.opensrp.domain.postgres.Task pgTask, Task entity) { - long serverVersion = taskMapper.selectServerVersionByPrimaryKey(pgTask.getId()); - entity.setServerVersion(serverVersion); - pgTask.setJson(entity); - pgTask.setServerVersion(null); - int rowsAffected = taskMapper.updateByPrimaryKeySelective(pgTask); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - } - - @Override - @Transactional - public void update(Task entity) { - if (getUniqueField(entity) == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { // Task does not exist - throw new IllegalStateException(); - } - - org.opensrp.domain.postgres.Task pgTask = convert(entity, id); - if (pgTask == null) { - throw new IllegalStateException(); - } - - - int rowsAffected = taskMapper.updateByPrimaryKeyAndGenerateServerVersion(pgTask); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - - updateServerVersion(pgTask, entity); - - TaskMetadata taskMetadata = createMetadata(entity, pgTask.getId()); - - TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); - taskMetadataExample.createCriteria().andTaskIdEqualTo(id); - TaskMetadata metadata = taskMetadataMapper.selectByExample(taskMetadataExample).get(0); - taskMetadata.setId(metadata.getId()); - taskMetadata.setDateCreated(metadata.getDateCreated()); - taskMetadataMapper.updateByPrimaryKey(taskMetadata); - - } - - @Override - public List getAll() { - List tasks = taskMetadataMapper.selectMany(new TaskMetadataExample(), 0, - DEFAULT_FETCH_SIZE); - return convert(tasks); - } - - @Override - public List getTasksByPlanAndGroup(String plan, String group, long serverVersion) { - return getTasksByPlanAndGroup(plan, group, serverVersion, false); - } - - @Override - public List getTasksByPlanAndGroup(String plan, String group, long serverVersion, boolean returnPk) { - List plans = Arrays.asList(org.apache.commons.lang.StringUtils.split(plan, ",")); - List groups = Arrays.asList(org.apache.commons.lang.StringUtils.split(group, ",")); - TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); - taskMetadataExample.createCriteria().andPlanIdentifierIn(plans).andGroupIdentifierIn(groups) - .andServerVersionGreaterThanOrEqualTo(serverVersion); - taskMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - List tasks = taskMetadataMapper.selectMany(taskMetadataExample, 0, - DEFAULT_FETCH_SIZE); - return convert(tasks,returnPk); - } - - @Override - public List findByEmptyServerVersion() { - TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); - taskMetadataExample.createCriteria().andServerVersionIsNull(); - taskMetadataExample.or(taskMetadataExample.createCriteria().andServerVersionEqualTo(0l)); - List tasks = taskMetadataMapper.selectMany(taskMetadataExample, 0, - DEFAULT_FETCH_SIZE); - return convert(tasks); - } - - /** - * {@inheritDoc} - */ - @Override - public Pair, Long> findAllIds(Long serverVersion, int limit) { - Long lastServerVersion = null; - TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); - taskMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); - taskMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - return getTaskListLongPair(limit, lastServerVersion, taskMetadataExample); - } - - @Override - public Pair, Long> findAllIds(Long serverVersion, int limit, Date fromDate, Date toDate) { - if (toDate == null && fromDate == null) { - return findAllIds(serverVersion, limit); - } else { - Long lastServerVersion = null; - TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); - TaskMetadataExample.Criteria criteria = taskMetadataExample.createCriteria(); - criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); - taskMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - - if (toDate != null && fromDate != null) { - criteria.andDateCreatedBetween(fromDate, toDate); - } else if (fromDate != null) { - criteria.andDateCreatedGreaterThanOrEqualTo(fromDate); - } else { - criteria.andDateCreatedLessThanOrEqualTo(toDate); - } - - return getTaskListLongPair(limit, lastServerVersion, taskMetadataExample); - } - } - - private Pair, Long> getTaskListLongPair(int limit, Long lastServerVersion, - TaskMetadataExample taskMetadataExample) { - int fetchLimit = limit > 0 ? limit : DEFAULT_FETCH_SIZE; - Long serverVersion = lastServerVersion; - TaskMetadataExample metadataExample = taskMetadataExample; - - List taskIdentifiers = taskMetadataMapper.selectManyIds(metadataExample, 0, fetchLimit); - - if (taskIdentifiers != null && !taskIdentifiers.isEmpty()) { - metadataExample = new TaskMetadataExample(); - metadataExample.createCriteria().andIdentifierEqualTo(taskIdentifiers.get(taskIdentifiers.size() - 1)); - List taskMetaDataList = taskMetadataMapper.selectByExample(metadataExample); - - serverVersion = taskMetaDataList != null && !taskMetaDataList.isEmpty() - ? taskMetaDataList.get(0).getServerVersion() - : 0; - - } - - return Pair.of(taskIdentifiers, serverVersion); - } - - /** - * {@inheritDoc} - */ - @Override - public List getAllTasks(Long serverVersion, int limit) { - TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); - taskMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); - taskMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - - List tasks = taskMetadataMapper.selectMany(taskMetadataExample, 0, limit); - return convert(tasks); - } - - /** - * {@inheritDoc} - */ - @Override - public Long countAllTasks(Long serverVersion) { - TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); - taskMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); - return taskMetadataMapper.countMany(taskMetadataExample); - } - - @Override - public List getTasksByPlanAndOwner(String plan, String owner, long serverVersion) { - List plans = Arrays.asList(org.apache.commons.lang.StringUtils.split(plan, ",")); - TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); - taskMetadataExample.createCriteria().andPlanIdentifierIn(plans).andOwnerEqualTo(owner) - .andServerVersionGreaterThanOrEqualTo(serverVersion); - taskMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); - List tasks = taskMetadataMapper.selectMany(taskMetadataExample, 0, - DEFAULT_FETCH_SIZE); - return convert(tasks); - } - - @Override - public Long countTasksByPlanAndGroup(String plan, String group, long serverVersion) { - List campaigns = Arrays.asList(org.apache.commons.lang.StringUtils.split(plan, ",")); - List groups = Arrays.asList(org.apache.commons.lang.StringUtils.split(group, ",")); - TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); - taskMetadataExample.createCriteria().andPlanIdentifierIn(campaigns).andGroupIdentifierIn(groups) - .andServerVersionGreaterThanOrEqualTo(serverVersion); - return taskMetadataMapper.countByExample(taskMetadataExample); - } - - @Override - public Long countTasksByPlanAndOwner(String plan, String owner, long serverVersion) { - List plans = Arrays.asList(org.apache.commons.lang.StringUtils.split(plan, ",")); - TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); - taskMetadataExample.createCriteria().andPlanIdentifierIn(plans).andOwnerEqualTo(owner) - .andServerVersionGreaterThanOrEqualTo(serverVersion); - return taskMetadataMapper.countByExample(taskMetadataExample); - } - - @Override - @Transactional - public void safeRemove(Task entity) { - if (entity == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { - return; - } - - TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); - taskMetadataExample.createCriteria().andTaskIdEqualTo(id); - int rowsAffected = taskMetadataMapper.deleteByExample(taskMetadataExample); - if (rowsAffected < 1) { - return; - } - - taskMapper.deleteByPrimaryKey(id); - - } - - @Override - protected Long retrievePrimaryKey(Task task) { - Object uniqueId = getUniqueField(task); - if (uniqueId == null) { - return null; - } - - String identifier = uniqueId.toString(); - - org.opensrp.domain.postgres.Task pgTask = taskMetadataMapper.selectByIdentifier(identifier); - if (pgTask == null) { - return null; - } - return pgTask.getId(); - } - - @Override - protected Object getUniqueField(Task task) { - if (task == null) { - return null; - } - return task.getIdentifier(); - } - - private Task convert(org.opensrp.domain.postgres.Task pgTask) { - return convert(pgTask,false); - } - - private Task convert(org.opensrp.domain.postgres.Task pgTask, boolean returnPk) { - if (pgTask == null || pgTask.getJson() == null || !(pgTask.getJson() instanceof Task)) { - return null; - } - Task task=(Task) pgTask.getJson(); - if(returnPk) { - task.setRowid(pgTask.getId()); - } - return task; - } - - private org.opensrp.domain.postgres.Task convert(Task task, Long primaryKey) { - if (task == null) { - return null; - } - - org.opensrp.domain.postgres.Task pgTask = new org.opensrp.domain.postgres.Task(); - pgTask.setId(primaryKey); - pgTask.setJson(task); - - return pgTask; - } - - private List convert(List tasks){ - return convert(tasks,false); - } - - private List convert(List tasks,boolean returnPk) { - if (tasks == null || tasks.isEmpty()) { - return new ArrayList<>(); - } - - List convertedTasks = new ArrayList<>(); - for (org.opensrp.domain.postgres.Task task : tasks) { - Task convertedTask = convert(task,returnPk); - if (convertedTask != null) { - convertedTasks.add(convertedTask); - } - } - - return convertedTasks; - } - - private TaskMetadata createMetadata(Task entity, Long id) { - TaskMetadata taskMetadata = new TaskMetadata(); - taskMetadata.setTaskId(id); - taskMetadata.setIdentifier(entity.getIdentifier()); - taskMetadata.setPlanIdentifier(entity.getPlanIdentifier()); - taskMetadata.setGroupIdentifier(entity.getGroupIdentifier()); - taskMetadata.setForEntity(entity.getForEntity()); - taskMetadata.setServerVersion(entity.getServerVersion()); - taskMetadata.setOwner(entity.getOwner()); - taskMetadata.setCode(entity.getCode()); - - if (id != null) { - taskMetadata.setDateEdited(new Date()); - } - return taskMetadata; - } - - @Override - public List findTasksForEntity(String id, String planIdentifier) { - TaskMetadataExample example = new TaskMetadataExample(); - example.createCriteria().andPlanIdentifierEqualTo(planIdentifier).andForEntityEqualTo(id); - return convertToFHIRTasks(convert(taskMetadataMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE))); - } - - @Override - public void saveTask(Task task, QuestionnaireResponse questionnaireResponse) { - add(task); - } - - @Override - public boolean checkIfTaskExists(String baseEntityId, String jurisdiction, String planIdentifier, String code) { - List statuses = new ArrayList<>(); - statuses.add("Cancelled"); - statuses.add("Archived"); - - int taskCount = taskMetadataMapper.countTasksByEntityIdAndPlanIdentifierAndCode(baseEntityId, jurisdiction, - planIdentifier, code, statuses); - return taskCount >= 1; - } - - @Override - public List findAllTasksForEntity(String id) { - TaskMetadataExample example = new TaskMetadataExample(); - example.createCriteria().andForEntityEqualTo(id); - return convertToFHIRTasks(convert(taskMetadataMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE))); - } - - @Override - public Task getTaskByIdentifier(String identifier) { - return get(identifier); - } - - @Override - public Task updateTask(Task task) { - update(task); - return get(task.getIdentifier()); - } - - @Override - public List findTasksByJurisdiction(String jurisdiction, String planIdentifier) { - TaskMetadataExample example = new TaskMetadataExample(); - example.createCriteria().andPlanIdentifierEqualTo(planIdentifier).andGroupIdentifierEqualTo(jurisdiction); - return convertToFHIRTasks(convert(taskMetadataMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE))); - } - - @Override - public List findTasksByJurisdiction(String jurisdiction) { - TaskMetadataExample example = new TaskMetadataExample(); - example.createCriteria().andGroupIdentifierEqualTo(jurisdiction); - return convertToFHIRTasks(convert(taskMetadataMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE))); - } - - @Override - public List getTasksBySearchBean(TaskSearchBean taskSearchBean) { - Pair pageSizeAndOffset = getPageSizeAndOffset(taskSearchBean); - return taskMetadataMapper.selectTasksBySearchBean(taskSearchBean, pageSizeAndOffset.getRight(), - pageSizeAndOffset.getLeft()); - } - - @Override - public int getTaskCount(TaskSearchBean taskSearchBean) { - return taskMetadataMapper.selectTaskCount(taskSearchBean); - } - - private List convertToFHIRTasks(List tasks) { - return tasks.stream().map(task -> TaskConverter.convertTasktoFihrResource(task)).collect(Collectors.toList()); - } - + + @Autowired + private CustomTaskMapper taskMapper; + + @Autowired + private CustomTaskMetadataMapper taskMetadataMapper; + + @Override + public Task get(String id) { + if (StringUtils.isBlank(id)) { + return null; + } + + org.opensrp.domain.postgres.Task pgTask = taskMetadataMapper.selectByIdentifier(id); + if (pgTask == null) { + return null; + } + return convert(pgTask); + } + + @Override + @Transactional + public void add(Task entity) { + if (getUniqueField(entity) == null) { + return; + } + + if (retrievePrimaryKey(entity) != null) { // Task already added + return; + } + + org.opensrp.domain.postgres.Task pgTask = convert(entity, null); + if (pgTask == null) { + throw new IllegalStateException(); + } + + int rowsAffected = taskMapper.insertSelectiveAndSetId(pgTask); + if (rowsAffected < 1 || pgTask.getId() == null) { + throw new IllegalStateException(); + } + + updateServerVersion(pgTask, entity); + + TaskMetadata taskMetadata = createMetadata(entity, pgTask.getId()); + + taskMetadataMapper.insertSelective(taskMetadata); + + } + + private void updateServerVersion(org.opensrp.domain.postgres.Task pgTask, Task entity) { + long serverVersion = taskMapper.selectServerVersionByPrimaryKey(pgTask.getId()); + entity.setServerVersion(serverVersion); + pgTask.setJson(entity); + pgTask.setServerVersion(null); + int rowsAffected = taskMapper.updateByPrimaryKeySelective(pgTask); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + } + + @Override + @Transactional + public void update(Task entity) { + if (getUniqueField(entity) == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { // Task does not exist + throw new IllegalStateException(); + } + + org.opensrp.domain.postgres.Task pgTask = convert(entity, id); + if (pgTask == null) { + throw new IllegalStateException(); + } + + + int rowsAffected = taskMapper.updateByPrimaryKeyAndGenerateServerVersion(pgTask); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + + updateServerVersion(pgTask, entity); + + TaskMetadata taskMetadata = createMetadata(entity, pgTask.getId()); + + TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); + taskMetadataExample.createCriteria().andTaskIdEqualTo(id); + TaskMetadata metadata = taskMetadataMapper.selectByExample(taskMetadataExample).get(0); + taskMetadata.setId(metadata.getId()); + taskMetadata.setDateCreated(metadata.getDateCreated()); + taskMetadataMapper.updateByPrimaryKey(taskMetadata); + + } + + @Override + public List getAll() { + List tasks = taskMetadataMapper.selectMany(new TaskMetadataExample(), 0, + DEFAULT_FETCH_SIZE); + return convert(tasks); + } + + @Override + public List getTasksByPlanAndGroup(String plan, String group, long serverVersion) { + return getTasksByPlanAndGroup(plan, group, serverVersion, false); + } + + @Override + public List getTasksByPlanAndGroup(String plan, String group, long serverVersion, boolean returnPk) { + List plans = Arrays.asList(org.apache.commons.lang.StringUtils.split(plan, ",")); + List groups = Arrays.asList(org.apache.commons.lang.StringUtils.split(group, ",")); + TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); + taskMetadataExample.createCriteria().andPlanIdentifierIn(plans).andGroupIdentifierIn(groups) + .andServerVersionGreaterThanOrEqualTo(serverVersion); + taskMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + List tasks = taskMetadataMapper.selectMany(taskMetadataExample, 0, + DEFAULT_FETCH_SIZE); + return convert(tasks, returnPk); + } + + @Override + public List findByEmptyServerVersion() { + TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); + taskMetadataExample.createCriteria().andServerVersionIsNull(); + taskMetadataExample.or(taskMetadataExample.createCriteria().andServerVersionEqualTo(0l)); + List tasks = taskMetadataMapper.selectMany(taskMetadataExample, 0, + DEFAULT_FETCH_SIZE); + return convert(tasks); + } + + /** + * {@inheritDoc} + */ + @Override + public Pair, Long> findAllIds(Long serverVersion, int limit) { + Long lastServerVersion = null; + TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); + taskMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); + taskMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + return getTaskListLongPair(limit, lastServerVersion, taskMetadataExample); + } + + @Override + public Pair, Long> findAllIds(Long serverVersion, int limit, Date fromDate, Date toDate) { + if (toDate == null && fromDate == null) { + return findAllIds(serverVersion, limit); + } else { + Long lastServerVersion = null; + TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); + TaskMetadataExample.Criteria criteria = taskMetadataExample.createCriteria(); + criteria.andServerVersionGreaterThanOrEqualTo(serverVersion); + taskMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + + if (toDate != null && fromDate != null) { + criteria.andDateCreatedBetween(fromDate, toDate); + } else if (fromDate != null) { + criteria.andDateCreatedGreaterThanOrEqualTo(fromDate); + } else { + criteria.andDateCreatedLessThanOrEqualTo(toDate); + } + + return getTaskListLongPair(limit, lastServerVersion, taskMetadataExample); + } + } + + private Pair, Long> getTaskListLongPair(int limit, Long lastServerVersion, + TaskMetadataExample taskMetadataExample) { + int fetchLimit = limit > 0 ? limit : DEFAULT_FETCH_SIZE; + Long serverVersion = lastServerVersion; + TaskMetadataExample metadataExample = taskMetadataExample; + + List taskIdentifiers = taskMetadataMapper.selectManyIds(metadataExample, 0, fetchLimit); + + if (taskIdentifiers != null && !taskIdentifiers.isEmpty()) { + metadataExample = new TaskMetadataExample(); + metadataExample.createCriteria().andIdentifierEqualTo(taskIdentifiers.get(taskIdentifiers.size() - 1)); + List taskMetaDataList = taskMetadataMapper.selectByExample(metadataExample); + + serverVersion = taskMetaDataList != null && !taskMetaDataList.isEmpty() + ? taskMetaDataList.get(0).getServerVersion() + : 0; + + } + + return Pair.of(taskIdentifiers, serverVersion); + } + + /** + * {@inheritDoc} + */ + @Override + public List getAllTasks(Long serverVersion, int limit) { + TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); + taskMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); + taskMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + + List tasks = taskMetadataMapper.selectMany(taskMetadataExample, 0, limit); + return convert(tasks); + } + + /** + * {@inheritDoc} + */ + @Override + public Long countAllTasks(Long serverVersion) { + TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); + taskMetadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(serverVersion); + return taskMetadataMapper.countMany(taskMetadataExample); + } + + @Override + public List getTasksByPlanAndOwner(String plan, String owner, long serverVersion) { + List plans = Arrays.asList(org.apache.commons.lang.StringUtils.split(plan, ",")); + TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); + taskMetadataExample.createCriteria().andPlanIdentifierIn(plans).andOwnerEqualTo(owner) + .andServerVersionGreaterThanOrEqualTo(serverVersion); + taskMetadataExample.setOrderByClause(getOrderByClause(SERVER_VERSION, ASCENDING)); + List tasks = taskMetadataMapper.selectMany(taskMetadataExample, 0, + DEFAULT_FETCH_SIZE); + return convert(tasks); + } + + @Override + public Long countTasksByPlanAndGroup(String plan, String group, long serverVersion) { + List campaigns = Arrays.asList(org.apache.commons.lang.StringUtils.split(plan, ",")); + List groups = Arrays.asList(org.apache.commons.lang.StringUtils.split(group, ",")); + TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); + taskMetadataExample.createCriteria().andPlanIdentifierIn(campaigns).andGroupIdentifierIn(groups) + .andServerVersionGreaterThanOrEqualTo(serverVersion); + return taskMetadataMapper.countByExample(taskMetadataExample); + } + + @Override + public Long countTasksByPlanAndOwner(String plan, String owner, long serverVersion) { + List plans = Arrays.asList(org.apache.commons.lang.StringUtils.split(plan, ",")); + TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); + taskMetadataExample.createCriteria().andPlanIdentifierIn(plans).andOwnerEqualTo(owner) + .andServerVersionGreaterThanOrEqualTo(serverVersion); + return taskMetadataMapper.countByExample(taskMetadataExample); + } + + @Override + @Transactional + public void safeRemove(Task entity) { + if (entity == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { + return; + } + + TaskMetadataExample taskMetadataExample = new TaskMetadataExample(); + taskMetadataExample.createCriteria().andTaskIdEqualTo(id); + int rowsAffected = taskMetadataMapper.deleteByExample(taskMetadataExample); + if (rowsAffected < 1) { + return; + } + + taskMapper.deleteByPrimaryKey(id); + + } + + @Override + protected Long retrievePrimaryKey(Task task) { + Object uniqueId = getUniqueField(task); + if (uniqueId == null) { + return null; + } + + String identifier = uniqueId.toString(); + + org.opensrp.domain.postgres.Task pgTask = taskMetadataMapper.selectByIdentifier(identifier); + if (pgTask == null) { + return null; + } + return pgTask.getId(); + } + + @Override + protected Object getUniqueField(Task task) { + if (task == null) { + return null; + } + return task.getIdentifier(); + } + + private Task convert(org.opensrp.domain.postgres.Task pgTask) { + return convert(pgTask, false); + } + + private Task convert(org.opensrp.domain.postgres.Task pgTask, boolean returnPk) { + if (pgTask == null || pgTask.getJson() == null || !(pgTask.getJson() instanceof Task)) { + return null; + } + Task task = (Task) pgTask.getJson(); + if (returnPk) { + task.setRowid(pgTask.getId()); + } + return task; + } + + private org.opensrp.domain.postgres.Task convert(Task task, Long primaryKey) { + if (task == null) { + return null; + } + + org.opensrp.domain.postgres.Task pgTask = new org.opensrp.domain.postgres.Task(); + pgTask.setId(primaryKey); + pgTask.setJson(task); + + return pgTask; + } + + private List convert(List tasks) { + return convert(tasks, false); + } + + private List convert(List tasks, boolean returnPk) { + if (tasks == null || tasks.isEmpty()) { + return new ArrayList<>(); + } + + List convertedTasks = new ArrayList<>(); + for (org.opensrp.domain.postgres.Task task : tasks) { + Task convertedTask = convert(task, returnPk); + if (convertedTask != null) { + convertedTasks.add(convertedTask); + } + } + + return convertedTasks; + } + + private TaskMetadata createMetadata(Task entity, Long id) { + TaskMetadata taskMetadata = new TaskMetadata(); + taskMetadata.setTaskId(id); + taskMetadata.setIdentifier(entity.getIdentifier()); + taskMetadata.setPlanIdentifier(entity.getPlanIdentifier()); + taskMetadata.setGroupIdentifier(entity.getGroupIdentifier()); + taskMetadata.setForEntity(entity.getForEntity()); + taskMetadata.setServerVersion(entity.getServerVersion()); + taskMetadata.setOwner(entity.getOwner()); + taskMetadata.setCode(entity.getCode()); + + if (id != null) { + taskMetadata.setDateEdited(new Date()); + } + return taskMetadata; + } + + @Override + public List findTasksForEntity(String id, String planIdentifier) { + TaskMetadataExample example = new TaskMetadataExample(); + example.createCriteria().andPlanIdentifierEqualTo(planIdentifier).andForEntityEqualTo(id); + return convertToFHIRTasks(convert(taskMetadataMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE))); + } + + @Override + public void saveTask(Task task, QuestionnaireResponse questionnaireResponse) { + add(task); + } + + @Override + public boolean checkIfTaskExists(String baseEntityId, String jurisdiction, String planIdentifier, String code) { + List statuses = new ArrayList<>(); + statuses.add("Cancelled"); + statuses.add("Archived"); + + int taskCount = taskMetadataMapper.countTasksByEntityIdAndPlanIdentifierAndCode(baseEntityId, jurisdiction, + planIdentifier, code, statuses); + return taskCount >= 1; + } + + @Override + public List findAllTasksForEntity(String id) { + TaskMetadataExample example = new TaskMetadataExample(); + example.createCriteria().andForEntityEqualTo(id); + return convertToFHIRTasks(convert(taskMetadataMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE))); + } + + @Override + public Task getTaskByIdentifier(String identifier) { + return get(identifier); + } + + @Override + public Task updateTask(Task task) { + update(task); + return get(task.getIdentifier()); + } + + @Override + public List findTasksByJurisdiction(String jurisdiction, String planIdentifier) { + TaskMetadataExample example = new TaskMetadataExample(); + example.createCriteria().andPlanIdentifierEqualTo(planIdentifier).andGroupIdentifierEqualTo(jurisdiction); + return convertToFHIRTasks(convert(taskMetadataMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE))); + } + + @Override + public List findTasksByJurisdiction(String jurisdiction) { + TaskMetadataExample example = new TaskMetadataExample(); + example.createCriteria().andGroupIdentifierEqualTo(jurisdiction); + return convertToFHIRTasks(convert(taskMetadataMapper.selectMany(example, 0, DEFAULT_FETCH_SIZE))); + } + + @Override + public List getTasksBySearchBean(TaskSearchBean taskSearchBean) { + Pair pageSizeAndOffset = getPageSizeAndOffset(taskSearchBean); + return taskMetadataMapper.selectTasksBySearchBean(taskSearchBean, pageSizeAndOffset.getRight(), + pageSizeAndOffset.getLeft()); + } + + @Override + public int getTaskCount(TaskSearchBean taskSearchBean) { + return taskMetadataMapper.selectTaskCount(taskSearchBean); + } + + private List convertToFHIRTasks(List tasks) { + return tasks.stream().map(task -> TaskConverter.convertTasktoFihrResource(task)).collect(Collectors.toList()); + } + } diff --git a/src/main/java/org/opensrp/repository/postgres/UniqueIdRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/UniqueIdRepositoryImpl.java index 4d531106e..54ded38bf 100644 --- a/src/main/java/org/opensrp/repository/postgres/UniqueIdRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/UniqueIdRepositoryImpl.java @@ -20,7 +20,7 @@ public class UniqueIdRepositoryImpl extends BaseRepositoryImpl impleme private CustomUniqueIdMapper uniqueIdMapper; @Override - public List getNotUsedIds( int limit) { + public List getNotUsedIds(int limit) { UniqueIdExample example = new UniqueIdExample(); example.createCriteria().andStatusEqualTo(UniqueId.STATUS_NOT_USED); int fetchLimit = limit > 0 ? limit : DEFAULT_FETCH_SIZE; @@ -57,7 +57,7 @@ public Long[] markAsUsed(List ids) { return null; } - for (org.opensrp.domain.postgres.UniqueId uniqueId: uniqueIdsToMarkAsUnused){ + for (org.opensrp.domain.postgres.UniqueId uniqueId : uniqueIdsToMarkAsUnused) { uniqueId.setStatus(UniqueId.STATUS_USED); uniqueIdMapper.updateByPrimaryKey(uniqueId); updatedrecords.add(uniqueId.getId()); @@ -98,8 +98,8 @@ public Set findReservedIdentifiers() { example.createCriteria().andIsReservedEqualTo(Boolean.TRUE).andIdentifierIsNotNull(); List uniqueIds = uniqueIdMapper.selectByExample(example); - return getReservedIdentifiers(convert(uniqueIds)); - + return getReservedIdentifiers(convert(uniqueIds)); + } @Override @@ -108,7 +108,7 @@ public UniqueId get(String id) { return null; } - return convert(findUniqueIdByOpenMrsId(id)); + return convert(findUniqueIdByOpenMrsId(id)); } private org.opensrp.domain.postgres.UniqueId findUniqueIdByOpenMrsId(String openMrsId) { @@ -128,7 +128,7 @@ public void add(UniqueId entity) { return; } - if (retrievePrimaryKey(entity) != null){// unique id already exists + if (retrievePrimaryKey(entity) != null) {// unique id already exists return; } @@ -142,12 +142,12 @@ public void add(UniqueId entity) { @Override public void update(UniqueId entity) { - if (getUniqueField(entity) == null){ + if (getUniqueField(entity) == null) { return; } Long id = retrievePrimaryKey(entity); - if (id == null){ // unique id does not exist + if (id == null) { // unique id does not exist return; } @@ -167,12 +167,12 @@ public List getAll() { @Override public void safeRemove(UniqueId entity) { - if (getUniqueField(entity) == null){ + if (getUniqueField(entity) == null) { return; } Long id = retrievePrimaryKey(entity); - if (id == null){ // unique id does not exist + if (id == null) { // unique id does not exist return; } @@ -182,7 +182,7 @@ public void safeRemove(UniqueId entity) { private List convert(List pgEntities) { List uniqueIds = new ArrayList<>(); - for (org.opensrp.domain.postgres.UniqueId entity: pgEntities) { + for (org.opensrp.domain.postgres.UniqueId entity : pgEntities) { uniqueIds.add(convert(entity)); } return uniqueIds; @@ -199,7 +199,7 @@ private UniqueId convert(org.opensrp.domain.postgres.UniqueId pgUniqueId) { uniqueId.setIdentifier(pgUniqueId.getIdentifier()); uniqueId.setIdSource(pgUniqueId.getIdSource()); uniqueId.setReserved(pgUniqueId.getIsReserved()); - return uniqueId; + return uniqueId; } @Override @@ -242,8 +242,8 @@ protected Object getUniqueField(UniqueId uniqueId) { } return uniqueId.getOpenmrsId(); } - - protected Object getUniqueIdentifierField(UniqueId uniqueId) { + + protected Object getUniqueIdentifierField(UniqueId uniqueId) { if (uniqueId == null) { return null; } @@ -266,16 +266,16 @@ private org.opensrp.domain.postgres.UniqueId convert(UniqueId uniqueId, Long pri pgUniqueId.setIdentifier(uniqueId.getIdentifier()); pgUniqueId.setIdSource(uniqueId.getIdSource()); pgUniqueId.setIsReserved(uniqueId.isReserved()); - - return pgUniqueId; + + return pgUniqueId; } - + private Set getReservedIdentifiers(List uniqueIds) { Set reservedIdentifiers = new HashSet<>(); - for(UniqueId uniqueId : uniqueIds) { + for (UniqueId uniqueId : uniqueIds) { reservedIdentifiers.add(uniqueId.getIdentifier()); } return reservedIdentifiers; } - + } diff --git a/src/main/java/org/opensrp/repository/postgres/ViewConfigurationRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/ViewConfigurationRepositoryImpl.java index 693efa3e2..877acc6fd 100644 --- a/src/main/java/org/opensrp/repository/postgres/ViewConfigurationRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/ViewConfigurationRepositoryImpl.java @@ -15,212 +15,211 @@ @Repository("viewConfigurationRepositoryPostgres") public class ViewConfigurationRepositoryImpl extends BaseRepositoryImpl implements ViewConfigurationRepository { - - @Autowired - private CustomViewConfigurationMapper viewConfigurationMapper; - - @Autowired - private CustomViewConfigurationMetadataMapper viewConfigurationMetadataMapper; - - @Override - public ViewConfiguration get(String id) { - return convert(viewConfigurationMetadataMapper.selectByDocumentId(id)); - } - - private void updateServerVersion(org.opensrp.domain.postgres.ViewConfiguration pgViewConfiguration, ViewConfiguration entity) { - long serverVersion = viewConfigurationMapper.selectServerVersionByPrimaryKey(pgViewConfiguration.getId()); - entity.setServerVersion(serverVersion); - pgViewConfiguration.setJson(entity); - int rowsAffected = viewConfigurationMapper.updateByPrimaryKeySelective(pgViewConfiguration); - if (rowsAffected < 1) { - throw new IllegalStateException(); - } - } - - @Override - public void add(ViewConfiguration entity) { - if (entity == null || entity.getIdentifier() == null) { - return; - } - - if (retrievePrimaryKey(entity) != null) { //ViewConfiguration already added - return; - } - - if (entity.getId() == null || entity.getId().isEmpty()) - entity.setId(UUID.randomUUID().toString()); - setRevision(entity); - - org.opensrp.domain.postgres.ViewConfiguration pgViewConfiguration = convert(entity, null); - if (pgViewConfiguration == null) { - return; - } - - int rowsAffected = viewConfigurationMapper.insertSelectiveAndSetId(pgViewConfiguration); - if (rowsAffected < 1 || pgViewConfiguration.getId() == null) { - return; - } - - ViewConfigurationMetadata metadata = createMetadata(entity, pgViewConfiguration.getId()); - if (metadata != null) { - viewConfigurationMetadataMapper.insertSelective(metadata); - } - } - - @Override - public void update(ViewConfiguration entity) { - if (entity == null || entity.getId() == null || entity.getIdentifier() == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - - if (id == null) { //ViewConfiguration not exists - return; - } - - setRevision(entity); - - org.opensrp.domain.postgres.ViewConfiguration pgViewConfiguration = convert(entity, id); - - if (pgViewConfiguration == null) { - return; - } - - - - int rowsAffected = viewConfigurationMapper.updateByPrimaryKeyAndGenerateServerVersion(pgViewConfiguration); - if (rowsAffected < 1) { - return; - } - - updateServerVersion(pgViewConfiguration, entity); - - ViewConfigurationMetadata metadata = createMetadata(entity, id); - if (metadata == null) { - throw new IllegalStateException(); - } - - ViewConfigurationMetadataExample metadataExample = new ViewConfigurationMetadataExample(); - metadataExample.createCriteria().andViewConfigurationIdEqualTo(id); - metadata.setId(viewConfigurationMetadataMapper.selectByExample(metadataExample).get(0).getId()); - viewConfigurationMetadataMapper.updateByPrimaryKey(metadata); - - } - - @Override - public List getAll() { - return convert( - viewConfigurationMetadataMapper.selectMany(new ViewConfigurationMetadataExample(), 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public void safeRemove(ViewConfiguration entity) { - if (entity == null) { - return; - } - - Long id = retrievePrimaryKey(entity); - if (id == null) { - return; - } - - ViewConfigurationMetadataExample metadataExample = new ViewConfigurationMetadataExample(); - metadataExample.createCriteria().andViewConfigurationIdEqualTo(id); - int rowsAffected = viewConfigurationMetadataMapper.deleteByExample(metadataExample); - if (rowsAffected < 1) { - return; - } - - viewConfigurationMapper.deleteByPrimaryKey(id); - - } - - @Override - public List findAllViewConfigurations() { - return getAll(); - } - - @Override - public List findViewConfigurationsByVersion(Long lastSyncedServerVersion) { - ViewConfigurationMetadataExample metadataExample = new ViewConfigurationMetadataExample(); - metadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(lastSyncedServerVersion); - return convert(viewConfigurationMetadataMapper.selectMany(metadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - public List findByEmptyServerVersion() { - ViewConfigurationMetadataExample metadataExample = new ViewConfigurationMetadataExample(); - metadataExample.createCriteria().andServerVersionIsNull(); - metadataExample.or(metadataExample.createCriteria().andServerVersionEqualTo(0l)); - return convert(viewConfigurationMetadataMapper.selectMany(metadataExample, 0, DEFAULT_FETCH_SIZE)); - } - - @Override - protected Long retrievePrimaryKey(ViewConfiguration viewConfiguration) { - if (getUniqueField(viewConfiguration) == null) { - return null; - } - String documentId = viewConfiguration.getId(); - - ViewConfigurationMetadataExample metadataExample = new ViewConfigurationMetadataExample(); - metadataExample.createCriteria().andDocumentIdEqualTo(documentId); - - org.opensrp.domain.postgres.ViewConfiguration pgViewConfiguration = viewConfigurationMetadataMapper - .selectByDocumentId(documentId); - if (pgViewConfiguration == null) { - return null; - } - return pgViewConfiguration.getId(); - } - - @Override - protected Object getUniqueField(ViewConfiguration viewConfiguration) { - return viewConfiguration == null ? null : viewConfiguration.getId(); - } - - //private Methods - private ViewConfiguration convert(org.opensrp.domain.postgres.ViewConfiguration viewConfiguration) { - if (viewConfiguration == null || viewConfiguration.getJson() == null - || !(viewConfiguration.getJson() instanceof ViewConfiguration)) { - return null; - } - return (ViewConfiguration) viewConfiguration.getJson(); - } - - private org.opensrp.domain.postgres.ViewConfiguration convert(ViewConfiguration entity, Long id) { - if (entity == null) { - return null; - } - - org.opensrp.domain.postgres.ViewConfiguration pgViewConfiguration = new org.opensrp.domain.postgres.ViewConfiguration(); - pgViewConfiguration.setId(id); - pgViewConfiguration.setJson(entity); - - return pgViewConfiguration; - } - - private List convert(List views) { - if (views == null || views.isEmpty()) { - return new ArrayList<>(); - } - - List viewConfigurations = new ArrayList<>(); - for (org.opensrp.domain.postgres.ViewConfiguration view : views) { - ViewConfiguration convertedView = convert(view); - if (convertedView != null) { - viewConfigurations.add(convertedView); - } - } - return viewConfigurations; - } - - private ViewConfigurationMetadata createMetadata(ViewConfiguration entity, Long id) { - ViewConfigurationMetadata metadata = new ViewConfigurationMetadata(); - metadata.setViewConfigurationId(id); - metadata.setDocumentId(entity.getId()); - metadata.setIdentifier(entity.getIdentifier()); - metadata.setServerVersion(entity.getServerVersion()); - return metadata; - } + + @Autowired + private CustomViewConfigurationMapper viewConfigurationMapper; + + @Autowired + private CustomViewConfigurationMetadataMapper viewConfigurationMetadataMapper; + + @Override + public ViewConfiguration get(String id) { + return convert(viewConfigurationMetadataMapper.selectByDocumentId(id)); + } + + private void updateServerVersion(org.opensrp.domain.postgres.ViewConfiguration pgViewConfiguration, ViewConfiguration entity) { + long serverVersion = viewConfigurationMapper.selectServerVersionByPrimaryKey(pgViewConfiguration.getId()); + entity.setServerVersion(serverVersion); + pgViewConfiguration.setJson(entity); + int rowsAffected = viewConfigurationMapper.updateByPrimaryKeySelective(pgViewConfiguration); + if (rowsAffected < 1) { + throw new IllegalStateException(); + } + } + + @Override + public void add(ViewConfiguration entity) { + if (entity == null || entity.getIdentifier() == null) { + return; + } + + if (retrievePrimaryKey(entity) != null) { //ViewConfiguration already added + return; + } + + if (entity.getId() == null || entity.getId().isEmpty()) + entity.setId(UUID.randomUUID().toString()); + setRevision(entity); + + org.opensrp.domain.postgres.ViewConfiguration pgViewConfiguration = convert(entity, null); + if (pgViewConfiguration == null) { + return; + } + + int rowsAffected = viewConfigurationMapper.insertSelectiveAndSetId(pgViewConfiguration); + if (rowsAffected < 1 || pgViewConfiguration.getId() == null) { + return; + } + + ViewConfigurationMetadata metadata = createMetadata(entity, pgViewConfiguration.getId()); + if (metadata != null) { + viewConfigurationMetadataMapper.insertSelective(metadata); + } + } + + @Override + public void update(ViewConfiguration entity) { + if (entity == null || entity.getId() == null || entity.getIdentifier() == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + + if (id == null) { //ViewConfiguration not exists + return; + } + + setRevision(entity); + + org.opensrp.domain.postgres.ViewConfiguration pgViewConfiguration = convert(entity, id); + + if (pgViewConfiguration == null) { + return; + } + + + int rowsAffected = viewConfigurationMapper.updateByPrimaryKeyAndGenerateServerVersion(pgViewConfiguration); + if (rowsAffected < 1) { + return; + } + + updateServerVersion(pgViewConfiguration, entity); + + ViewConfigurationMetadata metadata = createMetadata(entity, id); + if (metadata == null) { + throw new IllegalStateException(); + } + + ViewConfigurationMetadataExample metadataExample = new ViewConfigurationMetadataExample(); + metadataExample.createCriteria().andViewConfigurationIdEqualTo(id); + metadata.setId(viewConfigurationMetadataMapper.selectByExample(metadataExample).get(0).getId()); + viewConfigurationMetadataMapper.updateByPrimaryKey(metadata); + + } + + @Override + public List getAll() { + return convert( + viewConfigurationMetadataMapper.selectMany(new ViewConfigurationMetadataExample(), 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public void safeRemove(ViewConfiguration entity) { + if (entity == null) { + return; + } + + Long id = retrievePrimaryKey(entity); + if (id == null) { + return; + } + + ViewConfigurationMetadataExample metadataExample = new ViewConfigurationMetadataExample(); + metadataExample.createCriteria().andViewConfigurationIdEqualTo(id); + int rowsAffected = viewConfigurationMetadataMapper.deleteByExample(metadataExample); + if (rowsAffected < 1) { + return; + } + + viewConfigurationMapper.deleteByPrimaryKey(id); + + } + + @Override + public List findAllViewConfigurations() { + return getAll(); + } + + @Override + public List findViewConfigurationsByVersion(Long lastSyncedServerVersion) { + ViewConfigurationMetadataExample metadataExample = new ViewConfigurationMetadataExample(); + metadataExample.createCriteria().andServerVersionGreaterThanOrEqualTo(lastSyncedServerVersion); + return convert(viewConfigurationMetadataMapper.selectMany(metadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + public List findByEmptyServerVersion() { + ViewConfigurationMetadataExample metadataExample = new ViewConfigurationMetadataExample(); + metadataExample.createCriteria().andServerVersionIsNull(); + metadataExample.or(metadataExample.createCriteria().andServerVersionEqualTo(0l)); + return convert(viewConfigurationMetadataMapper.selectMany(metadataExample, 0, DEFAULT_FETCH_SIZE)); + } + + @Override + protected Long retrievePrimaryKey(ViewConfiguration viewConfiguration) { + if (getUniqueField(viewConfiguration) == null) { + return null; + } + String documentId = viewConfiguration.getId(); + + ViewConfigurationMetadataExample metadataExample = new ViewConfigurationMetadataExample(); + metadataExample.createCriteria().andDocumentIdEqualTo(documentId); + + org.opensrp.domain.postgres.ViewConfiguration pgViewConfiguration = viewConfigurationMetadataMapper + .selectByDocumentId(documentId); + if (pgViewConfiguration == null) { + return null; + } + return pgViewConfiguration.getId(); + } + + @Override + protected Object getUniqueField(ViewConfiguration viewConfiguration) { + return viewConfiguration == null ? null : viewConfiguration.getId(); + } + + //private Methods + private ViewConfiguration convert(org.opensrp.domain.postgres.ViewConfiguration viewConfiguration) { + if (viewConfiguration == null || viewConfiguration.getJson() == null + || !(viewConfiguration.getJson() instanceof ViewConfiguration)) { + return null; + } + return (ViewConfiguration) viewConfiguration.getJson(); + } + + private org.opensrp.domain.postgres.ViewConfiguration convert(ViewConfiguration entity, Long id) { + if (entity == null) { + return null; + } + + org.opensrp.domain.postgres.ViewConfiguration pgViewConfiguration = new org.opensrp.domain.postgres.ViewConfiguration(); + pgViewConfiguration.setId(id); + pgViewConfiguration.setJson(entity); + + return pgViewConfiguration; + } + + private List convert(List views) { + if (views == null || views.isEmpty()) { + return new ArrayList<>(); + } + + List viewConfigurations = new ArrayList<>(); + for (org.opensrp.domain.postgres.ViewConfiguration view : views) { + ViewConfiguration convertedView = convert(view); + if (convertedView != null) { + viewConfigurations.add(convertedView); + } + } + return viewConfigurations; + } + + private ViewConfigurationMetadata createMetadata(ViewConfiguration entity, Long id) { + ViewConfigurationMetadata metadata = new ViewConfigurationMetadata(); + metadata.setViewConfigurationId(id); + metadata.setDocumentId(entity.getId()); + metadata.setIdentifier(entity.getIdentifier()); + metadata.setServerVersion(entity.getServerVersion()); + return metadata; + } } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/ActionTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/ActionTypeHandler.java index cd26b8fa2..105404f05 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/ActionTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/ActionTypeHandler.java @@ -12,62 +12,58 @@ import org.postgresql.util.PGobject; public class ActionTypeHandler extends BaseTypeHandler implements TypeHandler { - - @Override - public void setParameter(PreparedStatement ps, int i, Action parameter, JdbcType jdbcType) throws SQLException { - try { - if (parameter != null) { - String jsonString = mapper.writeValueAsString(parameter); - PGobject jsonObject = new PGobject(); - jsonObject.setType("jsonb"); - jsonObject.setValue(jsonString); - ps.setObject(i, jsonObject); - } - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Action getResult(ResultSet rs, String columnName) throws SQLException { - try { - String jsonString = rs.getString(columnName); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Action.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Action getResult(ResultSet rs, int columnIndex) throws SQLException { - try { - String jsonString = rs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Action.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Action getResult(CallableStatement cs, int columnIndex) throws SQLException { - try { - String jsonString = cs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Action.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } + + @Override + public void setParameter(PreparedStatement ps, int i, Action parameter, JdbcType jdbcType) throws SQLException { + try { + if (parameter != null) { + String jsonString = mapper.writeValueAsString(parameter); + PGobject jsonObject = new PGobject(); + jsonObject.setType("jsonb"); + jsonObject.setValue(jsonString); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Action getResult(ResultSet rs, String columnName) throws SQLException { + try { + String jsonString = rs.getString(columnName); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Action.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Action getResult(ResultSet rs, int columnIndex) throws SQLException { + try { + String jsonString = rs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Action.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Action getResult(CallableStatement cs, int columnIndex) throws SQLException { + try { + String jsonString = cs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Action.class); + } catch (Exception e) { + throw new SQLException(e); + } + } } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/AlertTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/AlertTypeHandler.java index 576827b18..eb9c162d2 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/AlertTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/AlertTypeHandler.java @@ -12,62 +12,58 @@ import org.postgresql.util.PGobject; public class AlertTypeHandler extends BaseTypeHandler implements TypeHandler { - - @Override - public void setParameter(PreparedStatement ps, int i, Alert parameter, JdbcType jdbcType) throws SQLException { - try { - if (parameter != null) { - String jsonString = mapper.writeValueAsString(parameter); - PGobject jsonObject = new PGobject(); - jsonObject.setType("jsonb"); - jsonObject.setValue(jsonString); - ps.setObject(i, jsonObject); - } - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Alert getResult(ResultSet rs, String columnName) throws SQLException { - try { - String jsonString = rs.getString(columnName); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Alert.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Alert getResult(ResultSet rs, int columnIndex) throws SQLException { - try { - String jsonString = rs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Alert.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Alert getResult(CallableStatement cs, int columnIndex) throws SQLException { - try { - String jsonString = cs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Alert.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } + + @Override + public void setParameter(PreparedStatement ps, int i, Alert parameter, JdbcType jdbcType) throws SQLException { + try { + if (parameter != null) { + String jsonString = mapper.writeValueAsString(parameter); + PGobject jsonObject = new PGobject(); + jsonObject.setType("jsonb"); + jsonObject.setValue(jsonString); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Alert getResult(ResultSet rs, String columnName) throws SQLException { + try { + String jsonString = rs.getString(columnName); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Alert.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Alert getResult(ResultSet rs, int columnIndex) throws SQLException { + try { + String jsonString = rs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Alert.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Alert getResult(CallableStatement cs, int columnIndex) throws SQLException { + try { + String jsonString = cs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Alert.class); + } catch (Exception e) { + throw new SQLException(e); + } + } } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/BaseTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/BaseTypeHandler.java index 99642de74..e213a74f6 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/BaseTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/BaseTypeHandler.java @@ -10,30 +10,30 @@ import com.fasterxml.jackson.databind.module.SimpleModule; public class BaseTypeHandler { - - - public static ObjectMapper mapper ; - - protected BaseTypeHandler() { - createObjectMapper(); - } - - public synchronized static ObjectMapper createObjectMapper() { - if (mapper == null) { - mapper = new ObjectMapper(); - applyDefaultConfiguration(mapper); - } - SimpleModule dateTimeModule = new SimpleModule("DateTimeModule"); - dateTimeModule.addDeserializer(DateTime.class, new DateTimeDeserializer()); - dateTimeModule.addSerializer(DateTime.class, new DateTimeSerializer()); - mapper.registerModule(dateTimeModule); - return mapper; - } - - private static void applyDefaultConfiguration(ObjectMapper om) { - om.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); - om.setSerializationInclusion(JsonInclude.Include.NON_NULL); - } - - + + + public static ObjectMapper mapper; + + protected BaseTypeHandler() { + createObjectMapper(); + } + + public synchronized static ObjectMapper createObjectMapper() { + if (mapper == null) { + mapper = new ObjectMapper(); + applyDefaultConfiguration(mapper); + } + SimpleModule dateTimeModule = new SimpleModule("DateTimeModule"); + dateTimeModule.addDeserializer(DateTime.class, new DateTimeDeserializer()); + dateTimeModule.addSerializer(DateTime.class, new DateTimeSerializer()); + mapper.registerModule(dateTimeModule); + return mapper; + } + + private static void applyDefaultConfiguration(ObjectMapper om) { + om.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); + om.setSerializationInclusion(JsonInclude.Include.NON_NULL); + } + + } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/CampaignTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/CampaignTypeHandler.java index 96110a180..d915ab7e7 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/CampaignTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/CampaignTypeHandler.java @@ -20,48 +20,48 @@ public class CampaignTypeHandler extends BaseTypeHandler implements TypeHandler { - private static Gson gson = new GsonBuilder().registerTypeAdapter(DateTime.class, new TaskDateTimeTypeConverter()) - .registerTypeAdapter(LocalDate.class, new DateTypeConverter()).create(); + private static Gson gson = new GsonBuilder().registerTypeAdapter(DateTime.class, new TaskDateTimeTypeConverter()) + .registerTypeAdapter(LocalDate.class, new DateTypeConverter()).create(); - @Override - public void setParameter(PreparedStatement ps, int i, Campaign parameter, JdbcType jdbcType) throws SQLException { - try { - if (parameter != null) { - String jsonString = gson.toJson(parameter); - PGobject jsonObject = new PGobject(); - jsonObject.setType("jsonb"); - jsonObject.setValue(jsonString); - ps.setObject(i, jsonObject); - } - } catch (Exception e) { - throw new SQLException(e); - } - } + @Override + public void setParameter(PreparedStatement ps, int i, Campaign parameter, JdbcType jdbcType) throws SQLException { + try { + if (parameter != null) { + String jsonString = gson.toJson(parameter); + PGobject jsonObject = new PGobject(); + jsonObject.setType("jsonb"); + jsonObject.setValue(jsonString); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } + } - @Override - public Campaign getResult(ResultSet rs, String columnName) throws SQLException { - return getResult(rs.getString(columnName)); - } + @Override + public Campaign getResult(ResultSet rs, String columnName) throws SQLException { + return getResult(rs.getString(columnName)); + } - @Override - public Campaign getResult(ResultSet rs, int columnIndex) throws SQLException { - return getResult(rs.getString(columnIndex)); - } + @Override + public Campaign getResult(ResultSet rs, int columnIndex) throws SQLException { + return getResult(rs.getString(columnIndex)); + } - @Override - public Campaign getResult(CallableStatement cs, int columnIndex) throws SQLException { - return getResult(cs.getString(columnIndex)); - } + @Override + public Campaign getResult(CallableStatement cs, int columnIndex) throws SQLException { + return getResult(cs.getString(columnIndex)); + } - private Campaign getResult(String jsonString) throws SQLException { - try { - if (StringUtils.isBlank(jsonString)) { - return null; - } - return gson.fromJson(jsonString, Campaign.class); - } catch (Exception e) { - throw new SQLException(e); - } - } + private Campaign getResult(String jsonString) throws SQLException { + try { + if (StringUtils.isBlank(jsonString)) { + return null; + } + return gson.fromJson(jsonString, Campaign.class); + } catch (Exception e) { + throw new SQLException(e); + } + } } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/ClientTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/ClientTypeHandler.java index 0aeea5111..024ce9370 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/ClientTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/ClientTypeHandler.java @@ -12,63 +12,59 @@ import org.postgresql.util.PGobject; public class ClientTypeHandler extends BaseTypeHandler implements TypeHandler { - - @Override - public void setParameter(PreparedStatement ps, int i, Client parameter, JdbcType jdbcType) throws SQLException { - try { - if (parameter != null) { - String jsonString = mapper.writeValueAsString(parameter); - PGobject jsonObject = new PGobject(); - jsonObject.setType("jsonb"); - jsonObject.setValue(jsonString); - ps.setObject(i, jsonObject); - } - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Client getResult(ResultSet rs, String columnName) throws SQLException { - try { - String jsonString = rs.getString(columnName); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Client.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Client getResult(ResultSet rs, int columnIndex) throws SQLException { - try { - String jsonString = rs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Client.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Client getResult(CallableStatement cs, int columnIndex) throws SQLException { - try { - String jsonString = cs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Client.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - + + @Override + public void setParameter(PreparedStatement ps, int i, Client parameter, JdbcType jdbcType) throws SQLException { + try { + if (parameter != null) { + String jsonString = mapper.writeValueAsString(parameter); + PGobject jsonObject = new PGobject(); + jsonObject.setType("jsonb"); + jsonObject.setValue(jsonString); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Client getResult(ResultSet rs, String columnName) throws SQLException { + try { + String jsonString = rs.getString(columnName); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Client.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Client getResult(ResultSet rs, int columnIndex) throws SQLException { + try { + String jsonString = rs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Client.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Client getResult(CallableStatement cs, int columnIndex) throws SQLException { + try { + String jsonString = cs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Client.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/CodeSystemTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/CodeSystemTypeHandler.java index b2a3d5026..5fbb2efba 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/CodeSystemTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/CodeSystemTypeHandler.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.repository.postgres.handler; @@ -19,63 +19,60 @@ */ public class CodeSystemTypeHandler extends BaseTypeHandler implements TypeHandler { - @Override - public void setParameter(PreparedStatement ps, int i, CodeSystem parameter, JdbcType jdbcType) - throws SQLException { - try { - if (parameter != null) { - String jsonString = mapper.writeValueAsString(parameter); - PGobject jsonObject = new PGobject(); - jsonObject.setType("jsonb"); - jsonObject.setValue(jsonString); - ps.setObject(i, jsonObject); - } - } catch (Exception e) { - throw new SQLException(e); - } - - } + @Override + public void setParameter(PreparedStatement ps, int i, CodeSystem parameter, JdbcType jdbcType) + throws SQLException { + try { + if (parameter != null) { + String jsonString = mapper.writeValueAsString(parameter); + PGobject jsonObject = new PGobject(); + jsonObject.setType("jsonb"); + jsonObject.setValue(jsonString); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } - @Override - public CodeSystem getResult(ResultSet rs, String columnName) throws SQLException { - try { - String jsonString = rs.getString(columnName); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, CodeSystem.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } + } - @Override - public CodeSystem getResult(ResultSet rs, int columnIndex) throws SQLException { - try { - String jsonString = rs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, CodeSystem.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } + @Override + public CodeSystem getResult(ResultSet rs, String columnName) throws SQLException { + try { + String jsonString = rs.getString(columnName); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, CodeSystem.class); + } catch (Exception e) { + throw new SQLException(e); + } + } - @Override - public CodeSystem getResult(CallableStatement cs, int columnIndex) throws SQLException { - try { - String jsonString = cs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, CodeSystem.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } + @Override + public CodeSystem getResult(ResultSet rs, int columnIndex) throws SQLException { + try { + String jsonString = rs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, CodeSystem.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public CodeSystem getResult(CallableStatement cs, int columnIndex) throws SQLException { + try { + String jsonString = cs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, CodeSystem.class); + } catch (Exception e) { + throw new SQLException(e); + } + } } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/DateRangeTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/DateRangeTypeHandler.java index 634fdc094..2a3e309c3 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/DateRangeTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/DateRangeTypeHandler.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.repository.postgres.handler; @@ -24,81 +24,78 @@ * @author Samuel Githengi created on 09/25/20 */ public class DateRangeTypeHandler extends BaseTypeHandler implements TypeHandler { - - private static final Logger logger = LogManager.getLogger(DateRangeTypeHandler.class); - - private SimpleDateFormat dateFormat; - - public DateRangeTypeHandler() { - dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); - } - @Override - public void setParameter(PreparedStatement ps, int i, DateRange parameter, JdbcType jdbcType) throws SQLException { - try { - if (parameter != null) { - String[] rangeString = new String[] { dateFormat.format(parameter.getFromdate()), "" }; - boolean empty = false; - if (parameter.getFromdate().equals(parameter.getToDate())) { - empty = true; - } else if (parameter.getToDate() != null) { - rangeString[1] = dateFormat.format(parameter.getToDate()); - } - String range = empty ? "empty" : String.format("[%s,%s]", rangeString[0], rangeString[1]); - PGobject jsonObject = new PGobject(); - jsonObject.setType("daterange"); - jsonObject.setValue(range); - ps.setObject(i, jsonObject); - } - } - catch (Exception e) { - throw new SQLException(e); - } - - } - - private DateRange readResult(String range) { - if (range != null && !"empty".equals(range)) { - String[] dates = range.substring(1, range.length() - 1).split(":"); - Date fromDate = null; - Date toDate = null; - if (StringUtils.isNotBlank(dates[0])) { - try { - fromDate = dateFormat.parse(dates[0]); - } - catch (ParseException e) { - logger.error("Error reading duration", e); - } - } - if (dates.length == 2 && StringUtils.isNotBlank(dates[1])) { - try { - toDate = dateFormat.parse(dates[1]); - } - catch (ParseException e) { - logger.error("Error reading duration", e); - } - } - return new DateRange(fromDate, toDate); - } else { - return null; - } - } - - @Override - public DateRange getResult(ResultSet rs, String columnName) throws SQLException { - return readResult(rs.getString(columnName)); - - } - - @Override - public DateRange getResult(ResultSet rs, int columnIndex) throws SQLException { - return readResult(rs.getString(columnIndex)); - } - - @Override - public DateRange getResult(CallableStatement cs, int columnIndex) throws SQLException { - return readResult(cs.getString(columnIndex)); - } - + private static final Logger logger = LogManager.getLogger(DateRangeTypeHandler.class); + + private SimpleDateFormat dateFormat; + + public DateRangeTypeHandler() { + dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + } + + @Override + public void setParameter(PreparedStatement ps, int i, DateRange parameter, JdbcType jdbcType) throws SQLException { + try { + if (parameter != null) { + String[] rangeString = new String[]{dateFormat.format(parameter.getFromdate()), ""}; + boolean empty = false; + if (parameter.getFromdate().equals(parameter.getToDate())) { + empty = true; + } else if (parameter.getToDate() != null) { + rangeString[1] = dateFormat.format(parameter.getToDate()); + } + String range = empty ? "empty" : String.format("[%s,%s]", rangeString[0], rangeString[1]); + PGobject jsonObject = new PGobject(); + jsonObject.setType("daterange"); + jsonObject.setValue(range); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } + + } + + private DateRange readResult(String range) { + if (range != null && !"empty".equals(range)) { + String[] dates = range.substring(1, range.length() - 1).split(":"); + Date fromDate = null; + Date toDate = null; + if (StringUtils.isNotBlank(dates[0])) { + try { + fromDate = dateFormat.parse(dates[0]); + } catch (ParseException e) { + logger.error("Error reading duration", e); + } + } + if (dates.length == 2 && StringUtils.isNotBlank(dates[1])) { + try { + toDate = dateFormat.parse(dates[1]); + } catch (ParseException e) { + logger.error("Error reading duration", e); + } + } + return new DateRange(fromDate, toDate); + } else { + return null; + } + } + + @Override + public DateRange getResult(ResultSet rs, String columnName) throws SQLException { + return readResult(rs.getString(columnName)); + + } + + @Override + public DateRange getResult(ResultSet rs, int columnIndex) throws SQLException { + return readResult(rs.getString(columnIndex)); + } + + @Override + public DateRange getResult(CallableStatement cs, int columnIndex) throws SQLException { + return readResult(cs.getString(columnIndex)); + } + } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/DateTimeTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/DateTimeTypeHandler.java index 8dd579bf2..540d6f49f 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/DateTimeTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/DateTimeTypeHandler.java @@ -12,47 +12,47 @@ import org.joda.time.DateTime; public class DateTimeTypeHandler implements TypeHandler { - - @Override - public void setParameter(PreparedStatement ps, int i, DateTime parameter, JdbcType jdbcType) throws SQLException { - if (parameter != null) { - if (parameter.toLocalTime().toString().equals("00:00:00.000")) - ps.setDate(i, new Date(parameter.getMillis())); - else - ps.setTimestamp(i, new Timestamp(parameter.getMillis())); - } else { - ps.setDate(i, null); - } - } - - @Override - public DateTime getResult(ResultSet resultSet, String columnName) throws SQLException { - Timestamp timestamp = resultSet.getTimestamp(columnName); - if (timestamp != null) { - return new DateTime(timestamp.getTime()); - } else { - return null; - } - } - - @Override - public DateTime getResult(ResultSet resultSet, int columnIndex) throws SQLException { - Timestamp timestamp = resultSet.getTimestamp(columnIndex); - if (timestamp != null) { - return new DateTime(timestamp.getTime()); - } else { - return null; - } - } - - @Override - public DateTime getResult(CallableStatement cs, int columnIndex) throws SQLException { - Timestamp timestamp = cs.getTimestamp(columnIndex); - if (timestamp != null) { - return new DateTime(timestamp.getTime()); - } else { - return null; - } - } - + + @Override + public void setParameter(PreparedStatement ps, int i, DateTime parameter, JdbcType jdbcType) throws SQLException { + if (parameter != null) { + if (parameter.toLocalTime().toString().equals("00:00:00.000")) + ps.setDate(i, new Date(parameter.getMillis())); + else + ps.setTimestamp(i, new Timestamp(parameter.getMillis())); + } else { + ps.setDate(i, null); + } + } + + @Override + public DateTime getResult(ResultSet resultSet, String columnName) throws SQLException { + Timestamp timestamp = resultSet.getTimestamp(columnName); + if (timestamp != null) { + return new DateTime(timestamp.getTime()); + } else { + return null; + } + } + + @Override + public DateTime getResult(ResultSet resultSet, int columnIndex) throws SQLException { + Timestamp timestamp = resultSet.getTimestamp(columnIndex); + if (timestamp != null) { + return new DateTime(timestamp.getTime()); + } else { + return null; + } + } + + @Override + public DateTime getResult(CallableStatement cs, int columnIndex) throws SQLException { + Timestamp timestamp = cs.getTimestamp(columnIndex); + if (timestamp != null) { + return new DateTime(timestamp.getTime()); + } else { + return null; + } + } + } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/EventTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/EventTypeHandler.java index 4fe87ba01..68a31de6f 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/EventTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/EventTypeHandler.java @@ -12,63 +12,59 @@ import org.postgresql.util.PGobject; public class EventTypeHandler extends BaseTypeHandler implements TypeHandler { - - @Override - public void setParameter(PreparedStatement ps, int i, Event parameter, JdbcType jdbcType) throws SQLException { - try { - if (parameter != null) { - String jsonString = mapper.writeValueAsString(parameter); - PGobject jsonObject = new PGobject(); - jsonObject.setType("jsonb"); - jsonObject.setValue(jsonString); - ps.setObject(i, jsonObject); - } - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Event getResult(ResultSet rs, String columnName) throws SQLException { - try { - String jsonString = rs.getString(columnName); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Event.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Event getResult(ResultSet rs, int columnIndex) throws SQLException { - try { - String jsonString = rs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Event.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Event getResult(CallableStatement cs, int columnIndex) throws SQLException { - try { - String jsonString = cs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Event.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - + + @Override + public void setParameter(PreparedStatement ps, int i, Event parameter, JdbcType jdbcType) throws SQLException { + try { + if (parameter != null) { + String jsonString = mapper.writeValueAsString(parameter); + PGobject jsonObject = new PGobject(); + jsonObject.setType("jsonb"); + jsonObject.setValue(jsonString); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Event getResult(ResultSet rs, String columnName) throws SQLException { + try { + String jsonString = rs.getString(columnName); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Event.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Event getResult(ResultSet rs, int columnIndex) throws SQLException { + try { + String jsonString = rs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Event.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Event getResult(CallableStatement cs, int columnIndex) throws SQLException { + try { + String jsonString = cs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Event.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/JSONBTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/JSONBTypeHandler.java index 02f87e228..5ec6db8d1 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/JSONBTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/JSONBTypeHandler.java @@ -13,34 +13,33 @@ public class JSONBTypeHandler extends BaseTypeHandler { - private static final PGobject jsonObject = new PGobject(); - - @Override - public void setNonNullParameter(PreparedStatement ps, int i, Object parameter, JdbcType jdbcType) throws SQLException { - jsonObject.setType("json"); - - try { - jsonObject.setValue(new ObjectMapper().writeValueAsString(parameter)); //Converting java objects to json strings - } - catch (IOException e) { - e.printStackTrace(); - } - - ps.setObject(i, jsonObject); - } - - @Override - public Object getNullableResult(ResultSet rs, String columnName) throws SQLException { - return rs.getString(columnName); // Return to String - } - - @Override - public Object getNullableResult(ResultSet rs, int columnIndex) throws SQLException { - return rs.getString(columnIndex); - } - - @Override - public Object getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { - return cs.getString(columnIndex); - } + private static final PGobject jsonObject = new PGobject(); + + @Override + public void setNonNullParameter(PreparedStatement ps, int i, Object parameter, JdbcType jdbcType) throws SQLException { + jsonObject.setType("json"); + + try { + jsonObject.setValue(new ObjectMapper().writeValueAsString(parameter)); //Converting java objects to json strings + } catch (IOException e) { + e.printStackTrace(); + } + + ps.setObject(i, jsonObject); + } + + @Override + public Object getNullableResult(ResultSet rs, String columnName) throws SQLException { + return rs.getString(columnName); // Return to String + } + + @Override + public Object getNullableResult(ResultSet rs, int columnIndex) throws SQLException { + return rs.getString(columnIndex); + } + + @Override + public Object getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { + return cs.getString(columnIndex); + } } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/LocationAndStockTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/LocationAndStockTypeHandler.java index efb3b3df4..2dd8d00f2 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/LocationAndStockTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/LocationAndStockTypeHandler.java @@ -17,50 +17,50 @@ public class LocationAndStockTypeHandler extends BaseTypeHandler implements TypeHandler { - private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HHmm") - .registerTypeAdapter(LocationProperty.class, new PropertiesConverter()).create(); + private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HHmm") + .registerTypeAdapter(LocationProperty.class, new PropertiesConverter()).create(); - @Override - public void setParameter(PreparedStatement ps, int i, PhysicalLocationAndStocks parameter, JdbcType jdbcType) - throws SQLException { - try { - if (parameter != null) { - String jsonString = gson.toJson(parameter); - PGobject jsonObject = new PGobject(); - jsonObject.setType("jsonb"); - jsonObject.setValue(jsonString); - ps.setObject(i, jsonObject); - } - } catch (Exception e) { - throw new SQLException(e); - } - } + @Override + public void setParameter(PreparedStatement ps, int i, PhysicalLocationAndStocks parameter, JdbcType jdbcType) + throws SQLException { + try { + if (parameter != null) { + String jsonString = gson.toJson(parameter); + PGobject jsonObject = new PGobject(); + jsonObject.setType("jsonb"); + jsonObject.setValue(jsonString); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } + } - @Override - public PhysicalLocationAndStocks getResult(ResultSet rs, String columnName) throws SQLException { - return getResult(rs.getString(columnName)); - } + @Override + public PhysicalLocationAndStocks getResult(ResultSet rs, String columnName) throws SQLException { + return getResult(rs.getString(columnName)); + } - @Override - public PhysicalLocationAndStocks getResult(ResultSet rs, int columnIndex) throws SQLException { - return getResult(rs.getString(columnIndex)); - } + @Override + public PhysicalLocationAndStocks getResult(ResultSet rs, int columnIndex) throws SQLException { + return getResult(rs.getString(columnIndex)); + } - @Override - public PhysicalLocationAndStocks getResult(CallableStatement cs, int columnIndex) throws SQLException { - return getResult(cs.getString(columnIndex)); - } + @Override + public PhysicalLocationAndStocks getResult(CallableStatement cs, int columnIndex) throws SQLException { + return getResult(cs.getString(columnIndex)); + } - private PhysicalLocationAndStocks getResult(String jsonString) throws SQLException { - try { - if (StringUtils.isBlank(jsonString)) { - return null; - } - return gson.fromJson(jsonString, PhysicalLocationAndStocks.class); - } catch (Exception e) { - throw new SQLException(e); - } - } + private PhysicalLocationAndStocks getResult(String jsonString) throws SQLException { + try { + if (StringUtils.isBlank(jsonString)) { + return null; + } + return gson.fromJson(jsonString, PhysicalLocationAndStocks.class); + } catch (Exception e) { + throw new SQLException(e); + } + } } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/LocationTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/LocationTypeHandler.java index 1b1053502..5f9559625 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/LocationTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/LocationTypeHandler.java @@ -18,49 +18,49 @@ public class LocationTypeHandler extends BaseTypeHandler implements TypeHandler { - private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HHmm") - .registerTypeAdapter(LocationProperty.class, new PropertiesConverter()).create(); + private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HHmm") + .registerTypeAdapter(LocationProperty.class, new PropertiesConverter()).create(); - @Override - public void setParameter(PreparedStatement ps, int i, PhysicalLocation parameter, JdbcType jdbcType) - throws SQLException { - try { - if (parameter != null) { - String jsonString = gson.toJson(parameter); - PGobject jsonObject = new PGobject(); - jsonObject.setType("jsonb"); - jsonObject.setValue(jsonString); - ps.setObject(i, jsonObject); - } - } catch (Exception e) { - throw new SQLException(e); - } - } + @Override + public void setParameter(PreparedStatement ps, int i, PhysicalLocation parameter, JdbcType jdbcType) + throws SQLException { + try { + if (parameter != null) { + String jsonString = gson.toJson(parameter); + PGobject jsonObject = new PGobject(); + jsonObject.setType("jsonb"); + jsonObject.setValue(jsonString); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } + } - @Override - public PhysicalLocation getResult(ResultSet rs, String columnName) throws SQLException { - return getResult(rs.getString(columnName)); - } + @Override + public PhysicalLocation getResult(ResultSet rs, String columnName) throws SQLException { + return getResult(rs.getString(columnName)); + } - @Override - public PhysicalLocation getResult(ResultSet rs, int columnIndex) throws SQLException { - return getResult(rs.getString(columnIndex)); - } + @Override + public PhysicalLocation getResult(ResultSet rs, int columnIndex) throws SQLException { + return getResult(rs.getString(columnIndex)); + } - @Override - public PhysicalLocation getResult(CallableStatement cs, int columnIndex) throws SQLException { - return getResult(cs.getString(columnIndex)); - } + @Override + public PhysicalLocation getResult(CallableStatement cs, int columnIndex) throws SQLException { + return getResult(cs.getString(columnIndex)); + } - private PhysicalLocation getResult(String jsonString) throws SQLException { - try { - if (StringUtils.isBlank(jsonString)) { - return null; - } - return gson.fromJson(jsonString, PhysicalLocation.class); - } catch (Exception e) { - throw new SQLException(e); - } - } + private PhysicalLocation getResult(String jsonString) throws SQLException { + try { + if (StringUtils.isBlank(jsonString)) { + return null; + } + return gson.fromJson(jsonString, PhysicalLocation.class); + } catch (Exception e) { + throw new SQLException(e); + } + } } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/PlanTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/PlanTypeHandler.java index db6f875b9..c7edca181 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/PlanTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/PlanTypeHandler.java @@ -23,9 +23,9 @@ */ public class PlanTypeHandler extends BaseTypeHandler implements TypeHandler { - public Gson gson = new GsonBuilder().registerTypeAdapter(DateTime.class, new TaskDateTimeTypeConverter()) - .registerTypeAdapter(LocalDate.class, new DateTypeConverter()).create(); - + public Gson gson = new GsonBuilder().registerTypeAdapter(DateTime.class, new TaskDateTimeTypeConverter()) + .registerTypeAdapter(LocalDate.class, new DateTypeConverter()).create(); + @Override public void setParameter(PreparedStatement ps, int i, PlanDefinition parameter, JdbcType jdbcType) throws SQLException { try { @@ -36,8 +36,7 @@ public void setParameter(PreparedStatement ps, int i, PlanDefinition parameter, jsonObject.setValue(jsonString); ps.setObject(i, jsonObject); } - } - catch (Exception e) { + } catch (Exception e) { throw new SQLException(e); } } @@ -49,10 +48,9 @@ public PlanDefinition getResult(ResultSet rs, String columnName) throws SQLExcep if (StringUtils.isBlank(jsonString)) { return null; } - PlanDefinition result = gson.fromJson(jsonString, PlanDefinition.class); + PlanDefinition result = gson.fromJson(jsonString, PlanDefinition.class); return result; - } - catch (Exception e) { + } catch (Exception e) { throw new SQLException(e); } } @@ -66,8 +64,7 @@ public PlanDefinition getResult(ResultSet rs, int columnIndex) throws SQLExcepti } PlanDefinition result = gson.fromJson(jsonString, PlanDefinition.class); return result; - } - catch (Exception e) { + } catch (Exception e) { throw new SQLException(e); } } @@ -81,8 +78,7 @@ public PlanDefinition getResult(CallableStatement cs, int columnIndex) throws SQ } PlanDefinition result = gson.fromJson(jsonString, PlanDefinition.class); return result; - } - catch (Exception e) { + } catch (Exception e) { throw new SQLException(e); } } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/ProductCatalogueTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/ProductCatalogueTypeHandler.java index e685a9cf8..9ed085136 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/ProductCatalogueTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/ProductCatalogueTypeHandler.java @@ -20,68 +20,64 @@ public class ProductCatalogueTypeHandler extends BaseTypeHandler implements TypeHandler { - public Gson gson = new GsonBuilder().registerTypeAdapter(DateTime.class, new TaskDateTimeTypeConverter()) - .registerTypeAdapter(LocalDate.class, new DateTypeConverter()).create(); + public Gson gson = new GsonBuilder().registerTypeAdapter(DateTime.class, new TaskDateTimeTypeConverter()) + .registerTypeAdapter(LocalDate.class, new DateTypeConverter()).create(); - @Override - public void setParameter(PreparedStatement ps, int i, ProductCatalogue parameter, JdbcType jdbcType) throws SQLException { - try { - if (parameter != null) { - String jsonString = gson.toJson(parameter); - PGobject jsonObject = new PGobject(); - jsonObject.setType("jsonb"); - jsonObject.setValue(jsonString); - ps.setObject(i, jsonObject); - } - } - catch (Exception e) { - throw new SQLException(e); - } - } + @Override + public void setParameter(PreparedStatement ps, int i, ProductCatalogue parameter, JdbcType jdbcType) throws SQLException { + try { + if (parameter != null) { + String jsonString = gson.toJson(parameter); + PGobject jsonObject = new PGobject(); + jsonObject.setType("jsonb"); + jsonObject.setValue(jsonString); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } + } - @Override - public ProductCatalogue getResult(ResultSet rs, String columnName) throws SQLException { - try { - String jsonString = rs.getString(columnName); - if (StringUtils.isBlank(jsonString)) { - return null; - } - ProductCatalogue result = gson.fromJson(jsonString, ProductCatalogue.class); - return result; - } - catch (Exception e) { - throw new SQLException(e); - } - } + @Override + public ProductCatalogue getResult(ResultSet rs, String columnName) throws SQLException { + try { + String jsonString = rs.getString(columnName); + if (StringUtils.isBlank(jsonString)) { + return null; + } + ProductCatalogue result = gson.fromJson(jsonString, ProductCatalogue.class); + return result; + } catch (Exception e) { + throw new SQLException(e); + } + } - @Override - public ProductCatalogue getResult(ResultSet rs, int columnIndex) throws SQLException { - try { - String jsonString = rs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - ProductCatalogue result = gson.fromJson(jsonString, ProductCatalogue.class); - return result; - } - catch (Exception e) { - throw new SQLException(e); - } - } + @Override + public ProductCatalogue getResult(ResultSet rs, int columnIndex) throws SQLException { + try { + String jsonString = rs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + ProductCatalogue result = gson.fromJson(jsonString, ProductCatalogue.class); + return result; + } catch (Exception e) { + throw new SQLException(e); + } + } - @Override - public ProductCatalogue getResult(CallableStatement cs, int columnIndex) throws SQLException { - try { - String jsonString = cs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - ProductCatalogue result = gson.fromJson(jsonString, ProductCatalogue.class); - return result; - } - catch (Exception e) { - throw new SQLException(e); - } - } + @Override + public ProductCatalogue getResult(CallableStatement cs, int columnIndex) throws SQLException { + try { + String jsonString = cs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + ProductCatalogue result = gson.fromJson(jsonString, ProductCatalogue.class); + return result; + } catch (Exception e) { + throw new SQLException(e); + } + } } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/ReportTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/ReportTypeHandler.java index c4077d1a6..c665becba 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/ReportTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/ReportTypeHandler.java @@ -12,62 +12,58 @@ import org.postgresql.util.PGobject; public class ReportTypeHandler extends BaseTypeHandler implements TypeHandler { - - @Override - public void setParameter(PreparedStatement ps, int i, Report parameter, JdbcType jdbcType) throws SQLException { - try { - if (parameter != null) { - String jsonString = mapper.writeValueAsString(parameter); - PGobject jsonObject = new PGobject(); - jsonObject.setType("jsonb"); - jsonObject.setValue(jsonString); - ps.setObject(i, jsonObject); - } - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Report getResult(ResultSet rs, String columnName) throws SQLException { - try { - String jsonString = rs.getString(columnName); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Report.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Report getResult(ResultSet rs, int columnIndex) throws SQLException { - try { - String jsonString = rs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Report.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Report getResult(CallableStatement cs, int columnIndex) throws SQLException { - try { - String jsonString = cs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Report.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } + + @Override + public void setParameter(PreparedStatement ps, int i, Report parameter, JdbcType jdbcType) throws SQLException { + try { + if (parameter != null) { + String jsonString = mapper.writeValueAsString(parameter); + PGobject jsonObject = new PGobject(); + jsonObject.setType("jsonb"); + jsonObject.setValue(jsonString); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Report getResult(ResultSet rs, String columnName) throws SQLException { + try { + String jsonString = rs.getString(columnName); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Report.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Report getResult(ResultSet rs, int columnIndex) throws SQLException { + try { + String jsonString = rs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Report.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Report getResult(CallableStatement cs, int columnIndex) throws SQLException { + try { + String jsonString = cs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Report.class); + } catch (Exception e) { + throw new SQLException(e); + } + } } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/SettingMetadataTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/SettingMetadataTypeHandler.java index ff54564e5..ba017a59e 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/SettingMetadataTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/SettingMetadataTypeHandler.java @@ -16,61 +16,57 @@ */ public class SettingMetadataTypeHandler extends BaseTypeHandler implements TypeHandler { - @Override - public void setParameter(PreparedStatement ps, int i, Setting parameter, JdbcType jdbcType) throws SQLException { - try { - if (parameter != null) { - String jsonString = mapper.writeValueAsString(parameter); - PGobject jsonObject = new PGobject(); - jsonObject.setType("jsonb"); - jsonObject.setValue(jsonString); - ps.setObject(i, jsonObject); - } - } - catch (Exception e) { - throw new SQLException(e); - } - } + @Override + public void setParameter(PreparedStatement ps, int i, Setting parameter, JdbcType jdbcType) throws SQLException { + try { + if (parameter != null) { + String jsonString = mapper.writeValueAsString(parameter); + PGobject jsonObject = new PGobject(); + jsonObject.setType("jsonb"); + jsonObject.setValue(jsonString); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } + } - @Override - public Setting getResult(ResultSet rs, String columnName) throws SQLException { - try { - String jsonString = rs.getString(columnName); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Setting.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } + @Override + public Setting getResult(ResultSet rs, String columnName) throws SQLException { + try { + String jsonString = rs.getString(columnName); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Setting.class); + } catch (Exception e) { + throw new SQLException(e); + } + } - @Override - public Setting getResult(ResultSet rs, int columnIndex) throws SQLException { - try { - String jsonString = rs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Setting.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } + @Override + public Setting getResult(ResultSet rs, int columnIndex) throws SQLException { + try { + String jsonString = rs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Setting.class); + } catch (Exception e) { + throw new SQLException(e); + } + } - @Override - public Setting getResult(CallableStatement cs, int columnIndex) throws SQLException { - try { - String jsonString = cs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Setting.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } + @Override + public Setting getResult(CallableStatement cs, int columnIndex) throws SQLException { + try { + String jsonString = cs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Setting.class); + } catch (Exception e) { + throw new SQLException(e); + } + } } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/SettingTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/SettingTypeHandler.java index 4f4629e23..92596400f 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/SettingTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/SettingTypeHandler.java @@ -18,73 +18,69 @@ public class SettingTypeHandler extends BaseTypeHandler implements TypeHandler { - public SettingTypeHandler() { - super(); - SimpleModule jsonArrayDeserializerModule = new SimpleModule("JsonArrayDeserializerModule"); - jsonArrayDeserializerModule.addDeserializer(JSONArray.class, new JsonArrayDeserializer()); - mapper.registerModule(jsonArrayDeserializerModule); + public SettingTypeHandler() { + super(); + SimpleModule jsonArrayDeserializerModule = new SimpleModule("JsonArrayDeserializerModule"); + jsonArrayDeserializerModule.addDeserializer(JSONArray.class, new JsonArrayDeserializer()); + mapper.registerModule(jsonArrayDeserializerModule); - SimpleModule jsonArraySerializerModule = new SimpleModule("JsonArraySerializerModule"); - jsonArraySerializerModule.addSerializer(JSONArray.class, new JsonArraySerializer()); - mapper.registerModule(jsonArraySerializerModule); - } + SimpleModule jsonArraySerializerModule = new SimpleModule("JsonArraySerializerModule"); + jsonArraySerializerModule.addSerializer(JSONArray.class, new JsonArraySerializer()); + mapper.registerModule(jsonArraySerializerModule); + } - @Override - public void setParameter(PreparedStatement ps, int i, SettingConfiguration parameter, JdbcType jdbcType) throws SQLException { - try { - if (parameter != null) { - String jsonString = mapper.writeValueAsString(parameter); - PGobject jsonObject = new PGobject(); - jsonObject.setType("jsonb"); - jsonObject.setValue(jsonString); - ps.setObject(i, jsonObject); - } - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public SettingConfiguration getResult(ResultSet rs, String columnName) throws SQLException { - try { - String jsonString = rs.getString(columnName); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, SettingConfiguration.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public SettingConfiguration getResult(ResultSet rs, int columnIndex) throws SQLException { - try { - String jsonString = rs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, SettingConfiguration.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public SettingConfiguration getResult(CallableStatement cs, int columnIndex) throws SQLException { - try { - String jsonString = cs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, SettingConfiguration.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } + @Override + public void setParameter(PreparedStatement ps, int i, SettingConfiguration parameter, JdbcType jdbcType) throws SQLException { + try { + if (parameter != null) { + String jsonString = mapper.writeValueAsString(parameter); + PGobject jsonObject = new PGobject(); + jsonObject.setType("jsonb"); + jsonObject.setValue(jsonString); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public SettingConfiguration getResult(ResultSet rs, String columnName) throws SQLException { + try { + String jsonString = rs.getString(columnName); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, SettingConfiguration.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public SettingConfiguration getResult(ResultSet rs, int columnIndex) throws SQLException { + try { + String jsonString = rs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, SettingConfiguration.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public SettingConfiguration getResult(CallableStatement cs, int columnIndex) throws SQLException { + try { + String jsonString = cs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, SettingConfiguration.class); + } catch (Exception e) { + throw new SQLException(e); + } + } } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/StockTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/StockTypeHandler.java index 294ca7a8f..26a6c7266 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/StockTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/StockTypeHandler.java @@ -12,62 +12,58 @@ import org.postgresql.util.PGobject; public class StockTypeHandler extends BaseTypeHandler implements TypeHandler { - - @Override - public void setParameter(PreparedStatement ps, int i, Stock parameter, JdbcType jdbcType) throws SQLException { - try { - if (parameter != null) { - String jsonString = mapper.writeValueAsString(parameter); - PGobject jsonObject = new PGobject(); - jsonObject.setType("jsonb"); - jsonObject.setValue(jsonString); - ps.setObject(i, jsonObject); - } - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Stock getResult(ResultSet rs, String columnName) throws SQLException { - try { - String jsonString = rs.getString(columnName); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Stock.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Stock getResult(ResultSet rs, int columnIndex) throws SQLException { - try { - String jsonString = rs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Stock.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public Stock getResult(CallableStatement cs, int columnIndex) throws SQLException { - try { - String jsonString = cs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, Stock.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } + + @Override + public void setParameter(PreparedStatement ps, int i, Stock parameter, JdbcType jdbcType) throws SQLException { + try { + if (parameter != null) { + String jsonString = mapper.writeValueAsString(parameter); + PGobject jsonObject = new PGobject(); + jsonObject.setType("jsonb"); + jsonObject.setValue(jsonString); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Stock getResult(ResultSet rs, String columnName) throws SQLException { + try { + String jsonString = rs.getString(columnName); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Stock.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Stock getResult(ResultSet rs, int columnIndex) throws SQLException { + try { + String jsonString = rs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Stock.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public Stock getResult(CallableStatement cs, int columnIndex) throws SQLException { + try { + String jsonString = cs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, Stock.class); + } catch (Exception e) { + throw new SQLException(e); + } + } } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/TaskTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/TaskTypeHandler.java index 02b71b1fc..19249550b 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/TaskTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/TaskTypeHandler.java @@ -18,48 +18,48 @@ public class TaskTypeHandler extends BaseTypeHandler implements TypeHandler { - private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") - .registerTypeAdapter(DateTime.class, new DateTimeTypeConverter()).create(); - - @Override - public void setParameter(PreparedStatement ps, int i, Task parameter, JdbcType jdbcType) throws SQLException { - try { - if (parameter != null) { - String jsonString = gson.toJson(parameter); - PGobject jsonObject = new PGobject(); - jsonObject.setType("jsonb"); - jsonObject.setValue(jsonString); - ps.setObject(i, jsonObject); - } - } catch (Exception e) { - throw new SQLException(e); - } - } + private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") + .registerTypeAdapter(DateTime.class, new DateTimeTypeConverter()).create(); - @Override - public Task getResult(ResultSet rs, String columnName) throws SQLException { - return getResult(rs.getString(columnName)); - } + @Override + public void setParameter(PreparedStatement ps, int i, Task parameter, JdbcType jdbcType) throws SQLException { + try { + if (parameter != null) { + String jsonString = gson.toJson(parameter); + PGobject jsonObject = new PGobject(); + jsonObject.setType("jsonb"); + jsonObject.setValue(jsonString); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } + } - @Override - public Task getResult(ResultSet rs, int columnIndex) throws SQLException { - return getResult(rs.getString(columnIndex)); - } + @Override + public Task getResult(ResultSet rs, String columnName) throws SQLException { + return getResult(rs.getString(columnName)); + } - @Override - public Task getResult(CallableStatement cs, int columnIndex) throws SQLException { - return getResult(cs.getString(columnIndex)); - } + @Override + public Task getResult(ResultSet rs, int columnIndex) throws SQLException { + return getResult(rs.getString(columnIndex)); + } - private Task getResult(String jsonString) throws SQLException { - try { - if (StringUtils.isBlank(jsonString)) { - return null; - } - return gson.fromJson(jsonString, Task.class); - } catch (Exception e) { - throw new SQLException(e); - } - } + @Override + public Task getResult(CallableStatement cs, int columnIndex) throws SQLException { + return getResult(cs.getString(columnIndex)); + } + + private Task getResult(String jsonString) throws SQLException { + try { + if (StringUtils.isBlank(jsonString)) { + return null; + } + return gson.fromJson(jsonString, Task.class); + } catch (Exception e) { + throw new SQLException(e); + } + } } diff --git a/src/main/java/org/opensrp/repository/postgres/handler/ViewConfigurationTypeHandler.java b/src/main/java/org/opensrp/repository/postgres/handler/ViewConfigurationTypeHandler.java index 89d395af3..721b2828c 100644 --- a/src/main/java/org/opensrp/repository/postgres/handler/ViewConfigurationTypeHandler.java +++ b/src/main/java/org/opensrp/repository/postgres/handler/ViewConfigurationTypeHandler.java @@ -12,63 +12,59 @@ import org.postgresql.util.PGobject; public class ViewConfigurationTypeHandler extends BaseTypeHandler implements TypeHandler { - - @Override - public void setParameter(PreparedStatement ps, int i, ViewConfiguration parameter, JdbcType jdbcType) - throws SQLException { - try { - if (parameter != null) { - String jsonString = mapper.writeValueAsString(parameter); - PGobject jsonObject = new PGobject(); - jsonObject.setType("jsonb"); - jsonObject.setValue(jsonString); - ps.setObject(i, jsonObject); - } - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public ViewConfiguration getResult(ResultSet rs, String columnName) throws SQLException { - try { - String jsonString = rs.getString(columnName); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, ViewConfiguration.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public ViewConfiguration getResult(ResultSet rs, int columnIndex) throws SQLException { - try { - String jsonString = rs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, ViewConfiguration.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } - - @Override - public ViewConfiguration getResult(CallableStatement cs, int columnIndex) throws SQLException { - try { - String jsonString = cs.getString(columnIndex); - if (StringUtils.isBlank(jsonString)) { - return null; - } - return mapper.readValue(jsonString, ViewConfiguration.class); - } - catch (Exception e) { - throw new SQLException(e); - } - } + + @Override + public void setParameter(PreparedStatement ps, int i, ViewConfiguration parameter, JdbcType jdbcType) + throws SQLException { + try { + if (parameter != null) { + String jsonString = mapper.writeValueAsString(parameter); + PGobject jsonObject = new PGobject(); + jsonObject.setType("jsonb"); + jsonObject.setValue(jsonString); + ps.setObject(i, jsonObject); + } + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public ViewConfiguration getResult(ResultSet rs, String columnName) throws SQLException { + try { + String jsonString = rs.getString(columnName); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, ViewConfiguration.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public ViewConfiguration getResult(ResultSet rs, int columnIndex) throws SQLException { + try { + String jsonString = rs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, ViewConfiguration.class); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public ViewConfiguration getResult(CallableStatement cs, int columnIndex) throws SQLException { + try { + String jsonString = cs.getString(columnIndex); + if (StringUtils.isBlank(jsonString)) { + return null; + } + return mapper.readValue(jsonString, ViewConfiguration.class); + } catch (Exception e) { + throw new SQLException(e); + } + } } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/ActionMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/ActionMapper.java index cd43eb423..c8f378707 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/ActionMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/ActionMapper.java @@ -7,92 +7,92 @@ import org.opensrp.domain.postgres.ActionExample; public interface ActionMapper { - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - long countByExample(ActionExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int deleteByExample(ActionExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int insert(Action record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int insertSelective(Action record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - List selectByExample(ActionExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - Action selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int updateByExampleSelective(@Param("record") Action record, @Param("example") ActionExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int updateByExample(@Param("record") Action record, @Param("example") ActionExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int updateByPrimaryKeySelective(Action record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int updateByPrimaryKey(Action record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + long countByExample(ActionExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int deleteByExample(ActionExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int insert(Action record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int insertSelective(Action record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + List selectByExample(ActionExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + Action selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int updateByExampleSelective(@Param("record") Action record, @Param("example") ActionExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int updateByExample(@Param("record") Action record, @Param("example") ActionExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int updateByPrimaryKeySelective(Action record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int updateByPrimaryKey(Action record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/ActionMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/ActionMetadataMapper.java index 3c2dfd415..dd2c5302e 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/ActionMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/ActionMetadataMapper.java @@ -7,92 +7,92 @@ import org.opensrp.domain.postgres.ActionMetadataExample; public interface ActionMetadataMapper { - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - long countByExample(ActionMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int deleteByExample(ActionMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int insert(ActionMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int insertSelective(ActionMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - List selectByExample(ActionMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - ActionMetadata selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int updateByExampleSelective(@Param("record") ActionMetadata record, @Param("example") ActionMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int updateByExample(@Param("record") ActionMetadata record, @Param("example") ActionMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int updateByPrimaryKeySelective(ActionMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.action_metadata - * - * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 - */ - int updateByPrimaryKey(ActionMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + long countByExample(ActionMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int deleteByExample(ActionMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int insert(ActionMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int insertSelective(ActionMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + List selectByExample(ActionMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + ActionMetadata selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int updateByExampleSelective(@Param("record") ActionMetadata record, @Param("example") ActionMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int updateByExample(@Param("record") ActionMetadata record, @Param("example") ActionMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int updateByPrimaryKeySelective(ActionMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.action_metadata + * + * @mbg.generated Wed Mar 21 14:35:49 EAT 2018 + */ + int updateByPrimaryKey(ActionMetadata record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/AlertMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/AlertMapper.java index 3839a054d..edf2e93c1 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/AlertMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/AlertMapper.java @@ -7,92 +7,92 @@ import org.opensrp.domain.postgres.AlertExample; public interface AlertMapper { - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - long countByExample(AlertExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int deleteByExample(AlertExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int insert(Alert record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int insertSelective(Alert record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - List selectByExample(AlertExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - Alert selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int updateByExampleSelective(@Param("record") Alert record, @Param("example") AlertExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int updateByExample(@Param("record") Alert record, @Param("example") AlertExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int updateByPrimaryKeySelective(Alert record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int updateByPrimaryKey(Alert record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + long countByExample(AlertExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int deleteByExample(AlertExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int insert(Alert record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int insertSelective(Alert record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + List selectByExample(AlertExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + Alert selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int updateByExampleSelective(@Param("record") Alert record, @Param("example") AlertExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int updateByExample(@Param("record") Alert record, @Param("example") AlertExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int updateByPrimaryKeySelective(Alert record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int updateByPrimaryKey(Alert record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/AlertMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/AlertMetadataMapper.java index 2cbae3780..9a8e6739d 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/AlertMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/AlertMetadataMapper.java @@ -7,92 +7,92 @@ import org.opensrp.domain.postgres.AlertMetadataExample; public interface AlertMetadataMapper { - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - long countByExample(AlertMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int deleteByExample(AlertMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int insert(AlertMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int insertSelective(AlertMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - List selectByExample(AlertMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - AlertMetadata selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int updateByExampleSelective(@Param("record") AlertMetadata record, @Param("example") AlertMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int updateByExample(@Param("record") AlertMetadata record, @Param("example") AlertMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int updateByPrimaryKeySelective(AlertMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.alert_metadata - * - * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 - */ - int updateByPrimaryKey(AlertMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + long countByExample(AlertMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int deleteByExample(AlertMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int insert(AlertMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int insertSelective(AlertMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + List selectByExample(AlertMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + AlertMetadata selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int updateByExampleSelective(@Param("record") AlertMetadata record, @Param("example") AlertMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int updateByExample(@Param("record") AlertMetadata record, @Param("example") AlertMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int updateByPrimaryKeySelective(AlertMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.alert_metadata + * + * @mbg.generated Thu Mar 22 17:10:48 EAT 2018 + */ + int updateByPrimaryKey(AlertMetadata record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/AppStateTokenMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/AppStateTokenMapper.java index 79e7d755b..d6209193b 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/AppStateTokenMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/AppStateTokenMapper.java @@ -8,100 +8,100 @@ import org.opensrp.domain.postgres.AppStateTokenExample; public interface AppStateTokenMapper { - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - long countByExample(AppStateTokenExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - int deleteByExample(AppStateTokenExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - int insert(AppStateToken record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - int insertSelective(AppStateToken record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - List selectByExampleWithRowbounds(AppStateTokenExample example, RowBounds rowBounds); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - List selectByExample(AppStateTokenExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - AppStateToken selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - int updateByExampleSelective(@Param("record") AppStateToken record, @Param("example") AppStateTokenExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - int updateByExample(@Param("record") AppStateToken record, @Param("example") AppStateTokenExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - int updateByPrimaryKeySelective(AppStateToken record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.app_state_token - * - * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 - */ - int updateByPrimaryKey(AppStateToken record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + long countByExample(AppStateTokenExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + int deleteByExample(AppStateTokenExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + int insert(AppStateToken record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + int insertSelective(AppStateToken record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + List selectByExampleWithRowbounds(AppStateTokenExample example, RowBounds rowBounds); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + List selectByExample(AppStateTokenExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + AppStateToken selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + int updateByExampleSelective(@Param("record") AppStateToken record, @Param("example") AppStateTokenExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + int updateByExample(@Param("record") AppStateToken record, @Param("example") AppStateTokenExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + int updateByPrimaryKeySelective(AppStateToken record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.app_state_token + * + * @mbg.generated Wed Mar 14 17:13:39 EAT 2018 + */ + int updateByPrimaryKey(AppStateToken record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/CampaignMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/CampaignMapper.java index 5ab581b65..9265cf40e 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/CampaignMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/CampaignMapper.java @@ -1,75 +1,87 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.Campaign; import org.opensrp.domain.postgres.CampaignExample; public interface CampaignMapper { - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - long countByExample(CampaignExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + long countByExample(CampaignExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int deleteByExample(CampaignExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int deleteByExample(CampaignExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int insert(Campaign record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int insert(Campaign record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int insertSelective(Campaign record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int insertSelective(Campaign record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - List selectByExample(CampaignExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + List selectByExample(CampaignExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - Campaign selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + Campaign selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int updateByExampleSelective(@Param("record") Campaign record, @Param("example") CampaignExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int updateByExampleSelective(@Param("record") Campaign record, @Param("example") CampaignExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int updateByExample(@Param("record") Campaign record, @Param("example") CampaignExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int updateByExample(@Param("record") Campaign record, @Param("example") CampaignExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int updateByPrimaryKeySelective(Campaign record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int updateByPrimaryKeySelective(Campaign record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int updateByPrimaryKey(Campaign record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int updateByPrimaryKey(Campaign record); } \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/CampaignMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/CampaignMetadataMapper.java index 8919a7563..c65c376b9 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/CampaignMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/CampaignMetadataMapper.java @@ -1,76 +1,88 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.CampaignMetadata; import org.opensrp.domain.postgres.CampaignMetadataExample; public interface CampaignMetadataMapper { - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - long countByExample(CampaignMetadataExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + long countByExample(CampaignMetadataExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int deleteByExample(CampaignMetadataExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int deleteByExample(CampaignMetadataExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int insert(CampaignMetadata record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int insert(CampaignMetadata record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int insertSelective(CampaignMetadata record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int insertSelective(CampaignMetadata record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - List selectByExample(CampaignMetadataExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + List selectByExample(CampaignMetadataExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - CampaignMetadata selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + CampaignMetadata selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int updateByExampleSelective(@Param("record") CampaignMetadata record, - @Param("example") CampaignMetadataExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int updateByExampleSelective(@Param("record") CampaignMetadata record, + @Param("example") CampaignMetadataExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int updateByExample(@Param("record") CampaignMetadata record, @Param("example") CampaignMetadataExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int updateByExample(@Param("record") CampaignMetadata record, @Param("example") CampaignMetadataExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int updateByPrimaryKeySelective(CampaignMetadata record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int updateByPrimaryKeySelective(CampaignMetadata record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata - * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 - */ - int updateByPrimaryKey(CampaignMetadata record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.campaign_metadata + * + * @mbg.generated Fri Nov 09 12:47:47 EAT 2018 + */ + int updateByPrimaryKey(CampaignMetadata record); } \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/ClientFormMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/ClientFormMapper.java index 683d553b0..2847e5ee9 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/ClientFormMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/ClientFormMapper.java @@ -8,91 +8,91 @@ public interface ClientFormMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - long countByExample(ClientFormExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + long countByExample(ClientFormExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - int deleteByExample(ClientFormExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + int deleteByExample(ClientFormExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - int insert(ClientForm record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + int insert(ClientForm record); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - int insertSelective(ClientForm record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + int insertSelective(ClientForm record); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - List selectByExample(ClientFormExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + List selectByExample(ClientFormExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - ClientForm selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + ClientForm selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - int updateByExampleSelective(@Param("record") ClientForm record, @Param("example") ClientFormExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + int updateByExampleSelective(@Param("record") ClientForm record, @Param("example") ClientFormExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - int updateByExample(@Param("record") ClientForm record, @Param("example") ClientFormExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + int updateByExample(@Param("record") ClientForm record, @Param("example") ClientFormExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - int updateByPrimaryKeySelective(ClientForm record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + int updateByPrimaryKeySelective(ClientForm record); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form - * - * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 - */ - int updateByPrimaryKey(ClientForm record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form + * + * @mbg.generated Fri Mar 20 12:11:34 EAT 2020 + */ + int updateByPrimaryKey(ClientForm record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/ClientFormMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/ClientFormMetadataMapper.java index 0fc291870..d4498c4ee 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/ClientFormMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/ClientFormMetadataMapper.java @@ -8,92 +8,92 @@ public interface ClientFormMetadataMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - long countByExample(ClientFormMetadataExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + long countByExample(ClientFormMetadataExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - int deleteByExample(ClientFormMetadataExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + int deleteByExample(ClientFormMetadataExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - int insert(ClientFormMetadata record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + int insert(ClientFormMetadata record); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - int insertSelective(ClientFormMetadata record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + int insertSelective(ClientFormMetadata record); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - List selectByExample(ClientFormMetadataExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + List selectByExample(ClientFormMetadataExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - ClientFormMetadata selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + ClientFormMetadata selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - int updateByExampleSelective(@Param("record") ClientFormMetadata record, - @Param("example") ClientFormMetadataExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + int updateByExampleSelective(@Param("record") ClientFormMetadata record, + @Param("example") ClientFormMetadataExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - int updateByExample(@Param("record") ClientFormMetadata record, @Param("example") ClientFormMetadataExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + int updateByExample(@Param("record") ClientFormMetadata record, @Param("example") ClientFormMetadataExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - int updateByPrimaryKeySelective(ClientFormMetadata record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + int updateByPrimaryKeySelective(ClientFormMetadata record); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table core.client_form_metadata - * - * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 - */ - int updateByPrimaryKey(ClientFormMetadata record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table core.client_form_metadata + * + * @mbg.generated Mon Jun 15 11:22:33 EAT 2020 + */ + int updateByPrimaryKey(ClientFormMetadata record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/ClientMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/ClientMapper.java index 6fa255360..9f067867c 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/ClientMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/ClientMapper.java @@ -8,69 +8,80 @@ public interface ClientMapper { - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - long countByExample(ClientExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + long countByExample(ClientExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int deleteByExample(ClientExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int deleteByExample(ClientExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int insert(Client record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int insert(Client record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int insertSelective(Client record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int insertSelective(Client record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - List selectByExample(ClientExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + List selectByExample(ClientExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - Client selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + Client selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByExampleSelective(@Param("record") Client record, @Param("example") ClientExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByExampleSelective(@Param("record") Client record, @Param("example") ClientExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByExample(@Param("record") Client record, @Param("example") ClientExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByExample(@Param("record") Client record, @Param("example") ClientExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByPrimaryKeySelective(Client record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByPrimaryKeySelective(Client record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.client - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByPrimaryKey(Client record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.client + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByPrimaryKey(Client record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/ClientMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/ClientMetadataMapper.java index d3600279b..42722e5ae 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/ClientMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/ClientMetadataMapper.java @@ -1,97 +1,98 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.ClientMetadata; import org.opensrp.domain.postgres.ClientMetadataExample; public interface ClientMetadataMapper { - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - long countByExample(ClientMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int deleteByExample(ClientMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int insert(ClientMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int insertSelective(ClientMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - List selectByExample(ClientMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - ClientMetadata selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByExampleSelective(@Param("record") ClientMetadata record, @Param("example") ClientMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByExample(@Param("record") ClientMetadata record, @Param("example") ClientMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByPrimaryKeySelective(ClientMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.client_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByPrimaryKey(ClientMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + long countByExample(ClientMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int deleteByExample(ClientMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int insert(ClientMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int insertSelective(ClientMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + List selectByExample(ClientMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + ClientMetadata selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByExampleSelective(@Param("record") ClientMetadata record, @Param("example") ClientMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByExample(@Param("record") ClientMetadata record, @Param("example") ClientMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByPrimaryKeySelective(ClientMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.client_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByPrimaryKey(ClientMetadata record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/ClientMigrationFileMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/ClientMigrationFileMapper.java index 8f7a4feff..78305b032 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/ClientMigrationFileMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/ClientMigrationFileMapper.java @@ -1,6 +1,7 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.ClientMigrationFile; import org.opensrp.domain.postgres.ClientMigrationFileExample; diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/ErrorTraceMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/ErrorTraceMapper.java index adec08b5b..e2c3bb3d9 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/ErrorTraceMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/ErrorTraceMapper.java @@ -7,92 +7,92 @@ import org.opensrp.domain.postgres.ErrorTraceExample; public interface ErrorTraceMapper { - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - long countByExample(ErrorTraceExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - int deleteByExample(ErrorTraceExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - int insert(ErrorTrace record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - int insertSelective(ErrorTrace record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - List selectByExample(ErrorTraceExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - ErrorTrace selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - int updateByExampleSelective(@Param("record") ErrorTrace record, @Param("example") ErrorTraceExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - int updateByExample(@Param("record") ErrorTrace record, @Param("example") ErrorTraceExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - int updateByPrimaryKeySelective(ErrorTrace record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * error.error_trace - * - * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 - */ - int updateByPrimaryKey(ErrorTrace record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + long countByExample(ErrorTraceExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + int deleteByExample(ErrorTraceExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + int insert(ErrorTrace record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + int insertSelective(ErrorTrace record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + List selectByExample(ErrorTraceExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + ErrorTrace selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + int updateByExampleSelective(@Param("record") ErrorTrace record, @Param("example") ErrorTraceExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + int updateByExample(@Param("record") ErrorTrace record, @Param("example") ErrorTraceExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + int updateByPrimaryKeySelective(ErrorTrace record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * error.error_trace + * + * @mbg.generated Thu Apr 05 16:08:08 EAT 2018 + */ + int updateByPrimaryKey(ErrorTrace record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/EventMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/EventMapper.java index 035041216..8f8def950 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/EventMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/EventMapper.java @@ -8,69 +8,80 @@ public interface EventMapper { - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - long countByExample(EventExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + long countByExample(EventExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int deleteByExample(EventExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int deleteByExample(EventExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int insert(Event record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int insert(Event record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int insertSelective(Event record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int insertSelective(Event record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - List selectByExample(EventExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + List selectByExample(EventExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - Event selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + Event selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByExampleSelective(@Param("record") Event record, @Param("example") EventExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByExampleSelective(@Param("record") Event record, @Param("example") EventExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByExample(@Param("record") Event record, @Param("example") EventExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByExample(@Param("record") Event record, @Param("example") EventExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByPrimaryKeySelective(Event record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByPrimaryKeySelective(Event record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.event - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByPrimaryKey(Event record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.event + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByPrimaryKey(Event record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/EventMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/EventMetadataMapper.java index f520889b7..7ee287f14 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/EventMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/EventMetadataMapper.java @@ -7,92 +7,92 @@ import org.opensrp.domain.postgres.EventMetadataExample; public interface EventMetadataMapper { - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - long countByExample(EventMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - int deleteByExample(EventMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - int insert(EventMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - int insertSelective(EventMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - List selectByExample(EventMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - EventMetadata selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - int updateByExampleSelective(@Param("record") EventMetadata record, @Param("example") EventMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - int updateByExample(@Param("record") EventMetadata record, @Param("example") EventMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - int updateByPrimaryKeySelective(EventMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.event_metadata - * - * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 - */ - int updateByPrimaryKey(EventMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + long countByExample(EventMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + int deleteByExample(EventMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + int insert(EventMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + int insertSelective(EventMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + List selectByExample(EventMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + EventMetadata selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + int updateByExampleSelective(@Param("record") EventMetadata record, @Param("example") EventMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + int updateByExample(@Param("record") EventMetadata record, @Param("example") EventMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + int updateByPrimaryKeySelective(EventMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.event_metadata + * + * @mbg.generated Fri Apr 06 12:20:41 EAT 2018 + */ + int updateByPrimaryKey(EventMetadata record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/IdentifierSourceMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/IdentifierSourceMapper.java index 37417870a..f27418c8f 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/IdentifierSourceMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/IdentifierSourceMapper.java @@ -8,70 +8,81 @@ public interface IdentifierSourceMapper { - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source - * @mbg.generated Wed May 20 16:35:12 PKT 2020 - */ - long countByExample(IdentifierSourceExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source + * + * @mbg.generated Wed May 20 16:35:12 PKT 2020 + */ + long countByExample(IdentifierSourceExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source - * @mbg.generated Wed May 20 16:35:12 PKT 2020 - */ - int deleteByExample(IdentifierSourceExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source + * + * @mbg.generated Wed May 20 16:35:12 PKT 2020 + */ + int deleteByExample(IdentifierSourceExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source - * @mbg.generated Wed May 20 16:35:12 PKT 2020 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source + * + * @mbg.generated Wed May 20 16:35:12 PKT 2020 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source - * @mbg.generated Wed May 20 16:35:12 PKT 2020 - */ - int insert(IdentifierSource record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source + * + * @mbg.generated Wed May 20 16:35:12 PKT 2020 + */ + int insert(IdentifierSource record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source - * @mbg.generated Wed May 20 16:35:12 PKT 2020 - */ - int insertSelective(IdentifierSource record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source + * + * @mbg.generated Wed May 20 16:35:12 PKT 2020 + */ + int insertSelective(IdentifierSource record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source - * @mbg.generated Wed May 20 16:35:12 PKT 2020 - */ - List selectByExample(IdentifierSourceExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source + * + * @mbg.generated Wed May 20 16:35:12 PKT 2020 + */ + List selectByExample(IdentifierSourceExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source - * @mbg.generated Wed May 20 16:35:12 PKT 2020 - */ - IdentifierSource selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source + * + * @mbg.generated Wed May 20 16:35:12 PKT 2020 + */ + IdentifierSource selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source - * @mbg.generated Wed May 20 16:35:12 PKT 2020 - */ - int updateByExampleSelective(@Param("record") IdentifierSource record, - @Param("example") IdentifierSourceExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source + * + * @mbg.generated Wed May 20 16:35:12 PKT 2020 + */ + int updateByExampleSelective(@Param("record") IdentifierSource record, + @Param("example") IdentifierSourceExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source - * @mbg.generated Wed May 20 16:35:12 PKT 2020 - */ - int updateByExample(@Param("record") IdentifierSource record, @Param("example") IdentifierSourceExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source + * + * @mbg.generated Wed May 20 16:35:12 PKT 2020 + */ + int updateByExample(@Param("record") IdentifierSource record, @Param("example") IdentifierSourceExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source - * @mbg.generated Wed May 20 16:35:12 PKT 2020 - */ - int updateByPrimaryKeySelective(IdentifierSource record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source + * + * @mbg.generated Wed May 20 16:35:12 PKT 2020 + */ + int updateByPrimaryKeySelective(IdentifierSource record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source - * @mbg.generated Wed May 20 16:35:12 PKT 2020 - */ - int updateByPrimaryKey(IdentifierSource record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.identifier_source + * + * @mbg.generated Wed May 20 16:35:12 PKT 2020 + */ + int updateByPrimaryKey(IdentifierSource record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/LocationMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/LocationMapper.java index 4c211af80..79efe5577 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/LocationMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/LocationMapper.java @@ -1,75 +1,87 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.Location; import org.opensrp.domain.postgres.LocationExample; public interface LocationMapper { - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - long countByExample(LocationExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + long countByExample(LocationExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - int deleteByExample(LocationExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + int deleteByExample(LocationExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - int insert(Location record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + int insert(Location record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - int insertSelective(Location record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + int insertSelective(Location record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - List selectByExample(LocationExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + List selectByExample(LocationExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - Location selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + Location selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - int updateByExampleSelective(@Param("record") Location record, @Param("example") LocationExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + int updateByExampleSelective(@Param("record") Location record, @Param("example") LocationExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - int updateByExample(@Param("record") Location record, @Param("example") LocationExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + int updateByExample(@Param("record") Location record, @Param("example") LocationExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - int updateByPrimaryKeySelective(Location record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + int updateByPrimaryKeySelective(Location record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.location - * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 - */ - int updateByPrimaryKey(Location record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.location + * + * @mbg.generated Tue Dec 08 19:20:02 EAT 2020 + */ + int updateByPrimaryKey(Location record); } \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/LocationMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/LocationMetadataMapper.java index 6b8371126..42e90c893 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/LocationMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/LocationMetadataMapper.java @@ -1,98 +1,99 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.LocationMetadata; import org.opensrp.domain.postgres.LocationMetadataExample; public interface LocationMetadataMapper { - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - long countByExample(LocationMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int deleteByExample(LocationMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int insert(LocationMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int insertSelective(LocationMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - List selectByExample(LocationMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - LocationMetadata selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByExampleSelective(@Param("record") LocationMetadata record, - @Param("example") LocationMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByExample(@Param("record") LocationMetadata record, @Param("example") LocationMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByPrimaryKeySelective(LocationMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.location_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByPrimaryKey(LocationMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + long countByExample(LocationMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int deleteByExample(LocationMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int insert(LocationMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int insertSelective(LocationMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + List selectByExample(LocationMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + LocationMetadata selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByExampleSelective(@Param("record") LocationMetadata record, + @Param("example") LocationMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByExample(@Param("record") LocationMetadata record, @Param("example") LocationMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByPrimaryKeySelective(LocationMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.location_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByPrimaryKey(LocationMetadata record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/LocationTagMapMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/LocationTagMapMapper.java index 222f888f9..d06dac6b4 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/LocationTagMapMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/LocationTagMapMapper.java @@ -1,6 +1,7 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.LocationTagMap; import org.opensrp.domain.postgres.LocationTagMapExample; diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/LocationTagMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/LocationTagMapper.java index ce33ffcf2..30b304c7e 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/LocationTagMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/LocationTagMapper.java @@ -1,75 +1,87 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.LocationTag; import org.opensrp.domain.postgres.LocationTagExample; public interface LocationTagMapper { - /** + /** * This method was generated by MyBatis Generator. This method corresponds to the database table core.location_tag - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ int countByExample(LocationTagExample example); - /** + /** * This method was generated by MyBatis Generator. This method corresponds to the database table core.location_tag - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ int deleteByExample(LocationTagExample example); - /** + /** * This method was generated by MyBatis Generator. This method corresponds to the database table core.location_tag - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ int deleteByPrimaryKey(Long id); - /** + /** * This method was generated by MyBatis Generator. This method corresponds to the database table core.location_tag - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ int insert(LocationTag record); - /** + /** * This method was generated by MyBatis Generator. This method corresponds to the database table core.location_tag - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ int insertSelective(LocationTag record); - /** + /** * This method was generated by MyBatis Generator. This method corresponds to the database table core.location_tag - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ List selectByExample(LocationTagExample example); - /** + /** * This method was generated by MyBatis Generator. This method corresponds to the database table core.location_tag - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ LocationTag selectByPrimaryKey(Long id); - /** + /** * This method was generated by MyBatis Generator. This method corresponds to the database table core.location_tag - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ int updateByExampleSelective(@Param("record") LocationTag record, @Param("example") LocationTagExample example); - /** + /** * This method was generated by MyBatis Generator. This method corresponds to the database table core.location_tag - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ int updateByExample(@Param("record") LocationTag record, @Param("example") LocationTagExample example); - /** + /** * This method was generated by MyBatis Generator. This method corresponds to the database table core.location_tag - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ int updateByPrimaryKeySelective(LocationTag record); - /** + /** * This method was generated by MyBatis Generator. This method corresponds to the database table core.location_tag - * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 + * + * @mbggenerated Sun Mar 08 18:18:51 BDT 2020 */ int updateByPrimaryKey(LocationTag record); } \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/ManifestMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/ManifestMapper.java index 3893791a3..08a06b4b0 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/ManifestMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/ManifestMapper.java @@ -1,6 +1,7 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.Manifest; import org.opensrp.domain.postgres.ManifestExample; diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/MultiMediaMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/MultiMediaMapper.java index 45607ff4e..fe530f4f5 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/MultiMediaMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/MultiMediaMapper.java @@ -1,6 +1,7 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.MultiMedia; import org.opensrp.domain.postgres.MultiMediaExample; diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/OrganizationLocationMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/OrganizationLocationMapper.java index f942e2d5d..bc17e8d83 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/OrganizationLocationMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/OrganizationLocationMapper.java @@ -1,76 +1,88 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.OrganizationLocation; import org.opensrp.domain.postgres.OrganizationLocationExample; public interface OrganizationLocationMapper { - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - long countByExample(OrganizationLocationExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + long countByExample(OrganizationLocationExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - int deleteByExample(OrganizationLocationExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + int deleteByExample(OrganizationLocationExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - int insert(OrganizationLocation record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + int insert(OrganizationLocation record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - int insertSelective(OrganizationLocation record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + int insertSelective(OrganizationLocation record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - List selectByExample(OrganizationLocationExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + List selectByExample(OrganizationLocationExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - OrganizationLocation selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + OrganizationLocation selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - int updateByExampleSelective(@Param("record") OrganizationLocation record, - @Param("example") OrganizationLocationExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + int updateByExampleSelective(@Param("record") OrganizationLocation record, + @Param("example") OrganizationLocationExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - int updateByExample(@Param("record") OrganizationLocation record, @Param("example") OrganizationLocationExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + int updateByExample(@Param("record") OrganizationLocation record, @Param("example") OrganizationLocationExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - int updateByPrimaryKeySelective(OrganizationLocation record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + int updateByPrimaryKeySelective(OrganizationLocation record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location - * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 - */ - int updateByPrimaryKey(OrganizationLocation record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table team.organization_location + * + * @mbg.generated Fri Sep 25 10:18:05 EAT 2020 + */ + int updateByPrimaryKey(OrganizationLocation record); } \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/OrganizationMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/OrganizationMapper.java index 8cc6c1335..f0c319da7 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/OrganizationMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/OrganizationMapper.java @@ -8,91 +8,91 @@ public interface OrganizationMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - long countByExample(OrganizationExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + long countByExample(OrganizationExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - int deleteByExample(OrganizationExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + int deleteByExample(OrganizationExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - int insert(Organization record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + int insert(Organization record); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - int insertSelective(Organization record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + int insertSelective(Organization record); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - List selectByExample(OrganizationExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + List selectByExample(OrganizationExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - Organization selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + Organization selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - int updateByExampleSelective(@Param("record") Organization record, @Param("example") OrganizationExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + int updateByExampleSelective(@Param("record") Organization record, @Param("example") OrganizationExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - int updateByExample(@Param("record") Organization record, @Param("example") OrganizationExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + int updateByExample(@Param("record") Organization record, @Param("example") OrganizationExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - int updateByPrimaryKeySelective(Organization record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + int updateByPrimaryKeySelective(Organization record); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table team.organization - * - * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 - */ - int updateByPrimaryKey(Organization record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table team.organization + * + * @mbg.generated Mon Dec 06 14:53:20 EAT 2021 + */ + int updateByPrimaryKey(Organization record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/PlanMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/PlanMapper.java index 032c50ce2..6b4ac4774 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/PlanMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/PlanMapper.java @@ -1,97 +1,98 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.Plan; import org.opensrp.domain.postgres.PlanExample; public interface PlanMapper { - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - long countByExample(PlanExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int deleteByExample(PlanExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int insert(Plan record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int insertSelective(Plan record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - List selectByExample(PlanExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - Plan selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByExampleSelective(@Param("record") Plan record, @Param("example") PlanExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByExample(@Param("record") Plan record, @Param("example") PlanExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByPrimaryKeySelective(Plan record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.plan - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByPrimaryKey(Plan record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + long countByExample(PlanExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int deleteByExample(PlanExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int insert(Plan record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int insertSelective(Plan record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + List selectByExample(PlanExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + Plan selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByExampleSelective(@Param("record") Plan record, @Param("example") PlanExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByExample(@Param("record") Plan record, @Param("example") PlanExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByPrimaryKeySelective(Plan record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.plan + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByPrimaryKey(Plan record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/PlanMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/PlanMetadataMapper.java index 8451a0931..9afcf3668 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/PlanMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/PlanMetadataMapper.java @@ -8,45 +8,52 @@ public interface PlanMetadataMapper { - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.plan_metadata - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - long countByExample(PlanMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.plan_metadata - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - int deleteByExample(PlanMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.plan_metadata - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - int insert(PlanMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.plan_metadata - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - int insertSelective(PlanMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.plan_metadata - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - List selectByExample(PlanMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.plan_metadata - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - int updateByExampleSelective(@Param("record") PlanMetadata record, @Param("example") PlanMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.plan_metadata - * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 - */ - int updateByExample(@Param("record") PlanMetadata record, @Param("example") PlanMetadataExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + long countByExample(PlanMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + int deleteByExample(PlanMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + int insert(PlanMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + int insertSelective(PlanMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + List selectByExample(PlanMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + int updateByExampleSelective(@Param("record") PlanMetadata record, @Param("example") PlanMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.plan_metadata + * + * @mbg.generated Fri Aug 30 12:59:38 EAT 2019 + */ + int updateByExample(@Param("record") PlanMetadata record, @Param("example") PlanMetadataExample example); } \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/PractitionerMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/PractitionerMapper.java index 8ad64298e..49b7470a0 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/PractitionerMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/PractitionerMapper.java @@ -1,6 +1,7 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.Practitioner; import org.opensrp.domain.postgres.PractitionerExample; diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/PractitionerRoleMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/PractitionerRoleMapper.java index 9ff94bd21..321c07d7a 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/PractitionerRoleMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/PractitionerRoleMapper.java @@ -1,6 +1,7 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.PractitionerRole; import org.opensrp.domain.postgres.PractitionerRoleExample; diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/ProductCatalogueMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/ProductCatalogueMapper.java index ac959f81e..41eb39a7d 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/ProductCatalogueMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/ProductCatalogueMapper.java @@ -1,76 +1,88 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.ProductCatalogue; import org.opensrp.domain.postgres.ProductCatalogueExample; public interface ProductCatalogueMapper { - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - long countByExample(ProductCatalogueExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + long countByExample(ProductCatalogueExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - int deleteByExample(ProductCatalogueExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + int deleteByExample(ProductCatalogueExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - int deleteByPrimaryKey(Long uniqueId); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + int deleteByPrimaryKey(Long uniqueId); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - int insert(ProductCatalogue record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + int insert(ProductCatalogue record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - int insertSelective(ProductCatalogue record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + int insertSelective(ProductCatalogue record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - List selectByExample(ProductCatalogueExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + List selectByExample(ProductCatalogueExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - ProductCatalogue selectByPrimaryKey(Long uniqueId); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + ProductCatalogue selectByPrimaryKey(Long uniqueId); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - int updateByExampleSelective(@Param("record") ProductCatalogue record, - @Param("example") ProductCatalogueExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + int updateByExampleSelective(@Param("record") ProductCatalogue record, + @Param("example") ProductCatalogueExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - int updateByExample(@Param("record") ProductCatalogue record, @Param("example") ProductCatalogueExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + int updateByExample(@Param("record") ProductCatalogue record, @Param("example") ProductCatalogueExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - int updateByPrimaryKeySelective(ProductCatalogue record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + int updateByPrimaryKeySelective(ProductCatalogue record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue - * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 - */ - int updateByPrimaryKey(ProductCatalogue record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.product_catalogue + * + * @mbg.generated Thu Oct 01 12:40:29 PKT 2020 + */ + int updateByPrimaryKey(ProductCatalogue record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/ReportMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/ReportMapper.java index bb89edcb5..738ec5b49 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/ReportMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/ReportMapper.java @@ -8,69 +8,80 @@ public interface ReportMapper { - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - long countByExample(ReportExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + long countByExample(ReportExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int deleteByExample(ReportExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int deleteByExample(ReportExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int insert(Report record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int insert(Report record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int insertSelective(Report record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int insertSelective(Report record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - List selectByExample(ReportExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + List selectByExample(ReportExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - Report selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + Report selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByExampleSelective(@Param("record") Report record, @Param("example") ReportExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByExampleSelective(@Param("record") Report record, @Param("example") ReportExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByExample(@Param("record") Report record, @Param("example") ReportExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByExample(@Param("record") Report record, @Param("example") ReportExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByPrimaryKeySelective(Report record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByPrimaryKeySelective(Report record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.report - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByPrimaryKey(Report record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.report + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByPrimaryKey(Report record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/ReportMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/ReportMetadataMapper.java index 3bf20f767..a41391edc 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/ReportMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/ReportMetadataMapper.java @@ -7,92 +7,92 @@ import org.opensrp.domain.postgres.ReportMetadataExample; public interface ReportMetadataMapper { - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - long countByExample(ReportMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - int deleteByExample(ReportMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - int insert(ReportMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - int insertSelective(ReportMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - List selectByExample(ReportMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - ReportMetadata selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - int updateByExampleSelective(@Param("record") ReportMetadata record, @Param("example") ReportMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - int updateByExample(@Param("record") ReportMetadata record, @Param("example") ReportMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - int updateByPrimaryKeySelective(ReportMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.report_metadata - * - * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 - */ - int updateByPrimaryKey(ReportMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + long countByExample(ReportMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + int deleteByExample(ReportMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + int insert(ReportMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + int insertSelective(ReportMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + List selectByExample(ReportMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + ReportMetadata selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + int updateByExampleSelective(@Param("record") ReportMetadata record, @Param("example") ReportMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + int updateByExample(@Param("record") ReportMetadata record, @Param("example") ReportMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + int updateByPrimaryKeySelective(ReportMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.report_metadata + * + * @mbg.generated Fri Mar 23 14:23:39 EAT 2018 + */ + int updateByPrimaryKey(ReportMetadata record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/SettingsMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/SettingsMapper.java index 103163e96..57eae3529 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/SettingsMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/SettingsMapper.java @@ -1,75 +1,87 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.Settings; import org.opensrp.domain.postgres.SettingsExample; public interface SettingsMapper { - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - long countByExample(SettingsExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + long countByExample(SettingsExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int deleteByExample(SettingsExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int deleteByExample(SettingsExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int insert(Settings record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int insert(Settings record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int insertSelective(Settings record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int insertSelective(Settings record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - List selectByExample(SettingsExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + List selectByExample(SettingsExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - Settings selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + Settings selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByExampleSelective(@Param("record") Settings record, @Param("example") SettingsExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByExampleSelective(@Param("record") Settings record, @Param("example") SettingsExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByExample(@Param("record") Settings record, @Param("example") SettingsExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByExample(@Param("record") Settings record, @Param("example") SettingsExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByPrimaryKeySelective(Settings record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByPrimaryKeySelective(Settings record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByPrimaryKey(Settings record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.settings + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByPrimaryKey(Settings record); } \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/SettingsMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/SettingsMetadataMapper.java index 687a03ed4..336db8442 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/SettingsMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/SettingsMetadataMapper.java @@ -1,6 +1,7 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.SettingsMetadata; import org.opensrp.domain.postgres.SettingsMetadataExample; diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/StockMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/StockMapper.java index 4b8b8b452..82bb88a96 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/StockMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/StockMapper.java @@ -8,69 +8,80 @@ public interface StockMapper { - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - long countByExample(StockExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + long countByExample(StockExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - int deleteByExample(StockExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + int deleteByExample(StockExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - int insert(Stock record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + int insert(Stock record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - int insertSelective(Stock record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + int insertSelective(Stock record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - List selectByExample(StockExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + List selectByExample(StockExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - Stock selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + Stock selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - int updateByExampleSelective(@Param("record") Stock record, @Param("example") StockExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + int updateByExampleSelective(@Param("record") Stock record, @Param("example") StockExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - int updateByExample(@Param("record") Stock record, @Param("example") StockExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + int updateByExample(@Param("record") Stock record, @Param("example") StockExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - int updateByPrimaryKeySelective(Stock record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + int updateByPrimaryKeySelective(Stock record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock - * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 - */ - int updateByPrimaryKey(Stock record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.stock + * + * @mbg.generated Fri Jan 08 13:27:13 EAT 2021 + */ + int updateByPrimaryKey(Stock record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/StockMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/StockMetadataMapper.java index d17fa3ac4..6a6dc1aaa 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/StockMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/StockMetadataMapper.java @@ -7,92 +7,92 @@ import org.opensrp.domain.postgres.StockMetadataExample; public interface StockMetadataMapper { - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - long countByExample(StockMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - int deleteByExample(StockMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - int insert(StockMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - int insertSelective(StockMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - List selectByExample(StockMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - StockMetadata selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - int updateByExampleSelective(@Param("record") StockMetadata record, @Param("example") StockMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - int updateByExample(@Param("record") StockMetadata record, @Param("example") StockMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - int updateByPrimaryKeySelective(StockMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.stock_metadata - * - * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 - */ - int updateByPrimaryKey(StockMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + long countByExample(StockMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + int deleteByExample(StockMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + int insert(StockMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + int insertSelective(StockMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + List selectByExample(StockMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + StockMetadata selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + int updateByExampleSelective(@Param("record") StockMetadata record, @Param("example") StockMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + int updateByExample(@Param("record") StockMetadata record, @Param("example") StockMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + int updateByPrimaryKeySelective(StockMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.stock_metadata + * + * @mbg.generated Fri Mar 23 15:56:38 EAT 2018 + */ + int updateByPrimaryKey(StockMetadata record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/StructureMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/StructureMapper.java index 2211c7c0b..5d14b3202 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/StructureMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/StructureMapper.java @@ -1,75 +1,87 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.Structure; import org.opensrp.domain.postgres.StructureExample; public interface StructureMapper { - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - long countByExample(StructureExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + long countByExample(StructureExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int deleteByExample(StructureExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int deleteByExample(StructureExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int insert(Structure record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int insert(Structure record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int insertSelective(Structure record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int insertSelective(Structure record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - List selectByExample(StructureExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + List selectByExample(StructureExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - Structure selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + Structure selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByExampleSelective(@Param("record") Structure record, @Param("example") StructureExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByExampleSelective(@Param("record") Structure record, @Param("example") StructureExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByExample(@Param("record") Structure record, @Param("example") StructureExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByExample(@Param("record") Structure record, @Param("example") StructureExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByPrimaryKeySelective(Structure record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByPrimaryKeySelective(Structure record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByPrimaryKey(Structure record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.structure + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByPrimaryKey(Structure record); } \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/StructureMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/StructureMetadataMapper.java index 5e1d31cf2..9a59bf183 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/StructureMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/StructureMetadataMapper.java @@ -1,98 +1,99 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.StructureMetadata; import org.opensrp.domain.postgres.StructureMetadataExample; public interface StructureMetadataMapper { - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - long countByExample(StructureMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int deleteByExample(StructureMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int insert(StructureMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int insertSelective(StructureMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - List selectByExample(StructureMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - StructureMetadata selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByExampleSelective(@Param("record") StructureMetadata record, - @Param("example") StructureMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByExample(@Param("record") StructureMetadata record, @Param("example") StructureMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByPrimaryKeySelective(StructureMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.structure_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByPrimaryKey(StructureMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + long countByExample(StructureMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int deleteByExample(StructureMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int insert(StructureMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int insertSelective(StructureMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + List selectByExample(StructureMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + StructureMetadata selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByExampleSelective(@Param("record") StructureMetadata record, + @Param("example") StructureMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByExample(@Param("record") StructureMetadata record, @Param("example") StructureMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByPrimaryKeySelective(StructureMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.structure_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByPrimaryKey(StructureMetadata record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/TaskMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/TaskMapper.java index f37dc7799..3d91a986a 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/TaskMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/TaskMapper.java @@ -1,75 +1,87 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.Task; import org.opensrp.domain.postgres.TaskExample; public interface TaskMapper { - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - long countByExample(TaskExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + long countByExample(TaskExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int deleteByExample(TaskExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int deleteByExample(TaskExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int insert(Task record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int insert(Task record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int insertSelective(Task record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int insertSelective(Task record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - List selectByExample(TaskExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + List selectByExample(TaskExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - Task selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + Task selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByExampleSelective(@Param("record") Task record, @Param("example") TaskExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByExampleSelective(@Param("record") Task record, @Param("example") TaskExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByExample(@Param("record") Task record, @Param("example") TaskExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByExample(@Param("record") Task record, @Param("example") TaskExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByPrimaryKeySelective(Task record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByPrimaryKeySelective(Task record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.task - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByPrimaryKey(Task record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.task + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByPrimaryKey(Task record); } \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/TaskMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/TaskMetadataMapper.java index 97d7edea2..db290a5b9 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/TaskMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/TaskMetadataMapper.java @@ -1,97 +1,98 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.TaskMetadata; import org.opensrp.domain.postgres.TaskMetadataExample; public interface TaskMetadataMapper { - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.task_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - long countByExample(TaskMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.task_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int deleteByExample(TaskMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.task_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.task_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int insert(TaskMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.task_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int insertSelective(TaskMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.task_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - List selectByExample(TaskMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.task_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - TaskMetadata selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.task_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByExampleSelective(@Param("record") TaskMetadata record, @Param("example") TaskMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.task_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByExample(@Param("record") TaskMetadata record, @Param("example") TaskMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.task_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByPrimaryKeySelective(TaskMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.task_metadata - * - * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 - */ - int updateByPrimaryKey(TaskMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.task_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + long countByExample(TaskMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.task_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int deleteByExample(TaskMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.task_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.task_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int insert(TaskMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.task_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int insertSelective(TaskMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.task_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + List selectByExample(TaskMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.task_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + TaskMetadata selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.task_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByExampleSelective(@Param("record") TaskMetadata record, @Param("example") TaskMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.task_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByExample(@Param("record") TaskMetadata record, @Param("example") TaskMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.task_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByPrimaryKeySelective(TaskMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.task_metadata + * + * @mbg.generated Wed Sep 30 15:22:34 EAT 2020 + */ + int updateByPrimaryKey(TaskMetadata record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/UniqueIdMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/UniqueIdMapper.java index d399da35a..fd118e76b 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/UniqueIdMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/UniqueIdMapper.java @@ -1,97 +1,98 @@ package org.opensrp.repository.postgres.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.UniqueId; import org.opensrp.domain.postgres.UniqueIdExample; public interface UniqueIdMapper { - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - long countByExample(UniqueIdExample example); + */ + long countByExample(UniqueIdExample example); - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - int deleteByExample(UniqueIdExample example); + */ + int deleteByExample(UniqueIdExample example); - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - int deleteByPrimaryKey(Long id); + */ + int deleteByPrimaryKey(Long id); - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - int insert(UniqueId record); + */ + int insert(UniqueId record); - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - int insertSelective(UniqueId record); + */ + int insertSelective(UniqueId record); - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - List selectByExample(UniqueIdExample example); + */ + List selectByExample(UniqueIdExample example); - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - UniqueId selectByPrimaryKey(Long id); + */ + UniqueId selectByPrimaryKey(Long id); - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - int updateByExampleSelective(@Param("record") UniqueId record, @Param("example") UniqueIdExample example); + */ + int updateByExampleSelective(@Param("record") UniqueId record, @Param("example") UniqueIdExample example); - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - int updateByExample(@Param("record") UniqueId record, @Param("example") UniqueIdExample example); + */ + int updateByExample(@Param("record") UniqueId record, @Param("example") UniqueIdExample example); - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - int updateByPrimaryKeySelective(UniqueId record); + */ + int updateByPrimaryKeySelective(UniqueId record); - /** + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table core.unique_id * * @mbg.generated Tue Mar 10 15:45:35 EAT 2020 - */ - int updateByPrimaryKey(UniqueId record); + */ + int updateByPrimaryKey(UniqueId record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/ViewConfigurationMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/ViewConfigurationMapper.java index 6e749419b..ead2a626a 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/ViewConfigurationMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/ViewConfigurationMapper.java @@ -8,70 +8,81 @@ public interface ViewConfigurationMapper { - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - long countByExample(ViewConfigurationExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + long countByExample(ViewConfigurationExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int deleteByExample(ViewConfigurationExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int deleteByExample(ViewConfigurationExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int deleteByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int deleteByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int insert(ViewConfiguration record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int insert(ViewConfiguration record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int insertSelective(ViewConfiguration record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int insertSelective(ViewConfiguration record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - List selectByExample(ViewConfigurationExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + List selectByExample(ViewConfigurationExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - ViewConfiguration selectByPrimaryKey(Long id); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + ViewConfiguration selectByPrimaryKey(Long id); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByExampleSelective(@Param("record") ViewConfiguration record, - @Param("example") ViewConfigurationExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByExampleSelective(@Param("record") ViewConfiguration record, + @Param("example") ViewConfigurationExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByExample(@Param("record") ViewConfiguration record, @Param("example") ViewConfigurationExample example); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByExample(@Param("record") ViewConfiguration record, @Param("example") ViewConfigurationExample example); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByPrimaryKeySelective(ViewConfiguration record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByPrimaryKeySelective(ViewConfiguration record); - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration - * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 - */ - int updateByPrimaryKey(ViewConfiguration record); + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table core.view_configuration + * + * @mbg.generated Wed Nov 25 14:17:23 EAT 2020 + */ + int updateByPrimaryKey(ViewConfiguration record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/ViewConfigurationMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/ViewConfigurationMetadataMapper.java index a52b17b74..f46692c0e 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/ViewConfigurationMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/ViewConfigurationMetadataMapper.java @@ -7,94 +7,94 @@ import org.opensrp.domain.postgres.ViewConfigurationMetadataExample; public interface ViewConfigurationMetadataMapper { - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - long countByExample(ViewConfigurationMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - int deleteByExample(ViewConfigurationMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - int insert(ViewConfigurationMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - int insertSelective(ViewConfigurationMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - List selectByExample(ViewConfigurationMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - ViewConfigurationMetadata selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - int updateByExampleSelective(@Param("record") ViewConfigurationMetadata record, - @Param("example") ViewConfigurationMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - int updateByExample(@Param("record") ViewConfigurationMetadata record, - @Param("example") ViewConfigurationMetadataExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - int updateByPrimaryKeySelective(ViewConfigurationMetadata record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * core.view_configuration_metadata - * - * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 - */ - int updateByPrimaryKey(ViewConfigurationMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + long countByExample(ViewConfigurationMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + int deleteByExample(ViewConfigurationMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + int insert(ViewConfigurationMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + int insertSelective(ViewConfigurationMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + List selectByExample(ViewConfigurationMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + ViewConfigurationMetadata selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + int updateByExampleSelective(@Param("record") ViewConfigurationMetadata record, + @Param("example") ViewConfigurationMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + int updateByExample(@Param("record") ViewConfigurationMetadata record, + @Param("example") ViewConfigurationMetadataExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + int updateByPrimaryKeySelective(ViewConfigurationMetadata record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table + * core.view_configuration_metadata + * + * @mbg.generated Mon Apr 23 10:29:52 EAT 2018 + */ + int updateByPrimaryKey(ViewConfigurationMetadata record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomActionMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomActionMapper.java index 3957fae49..a63732ad1 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomActionMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomActionMapper.java @@ -7,12 +7,12 @@ import org.opensrp.repository.postgres.mapper.ActionMapper; public interface CustomActionMapper extends ActionMapper { - - int insertSelectiveAndSetId(Action action); - - Action selectByDocumentId(String documentId); - - List selectIdsByTarget(String actionTarget); - - List selectNotExpired(@Param("offset") int offset, @Param("limit") int limit); + + int insertSelectiveAndSetId(Action action); + + Action selectByDocumentId(String documentId); + + List selectIdsByTarget(String actionTarget); + + List selectNotExpired(@Param("offset") int offset, @Param("limit") int limit); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomActionMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomActionMetadataMapper.java index 1064744a2..5f35fdfee 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomActionMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomActionMetadataMapper.java @@ -8,14 +8,14 @@ import org.opensrp.repository.postgres.mapper.ActionMetadataMapper; public interface CustomActionMetadataMapper extends ActionMetadataMapper { - - Action selectByDocumentId(String documentId); - - List selectMany(@Param("example") ActionMetadataExample example, @Param("offset") int offset, - @Param("limit") int limit); - - List selectManyBySchedule(@Param("example") ActionMetadataExample example, - @Param("scheduleName") String scheduleName, @Param("offset") int offset, @Param("limit") int limit); - - Long countAll(@Param("example") ActionMetadataExample example); + + Action selectByDocumentId(String documentId); + + List selectMany(@Param("example") ActionMetadataExample example, @Param("offset") int offset, + @Param("limit") int limit); + + List selectManyBySchedule(@Param("example") ActionMetadataExample example, + @Param("scheduleName") String scheduleName, @Param("offset") int offset, @Param("limit") int limit); + + Long countAll(@Param("example") ActionMetadataExample example); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomAlertMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomAlertMapper.java index eb096ca43..9686df205 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomAlertMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomAlertMapper.java @@ -4,7 +4,7 @@ import org.opensrp.repository.postgres.mapper.AlertMapper; public interface CustomAlertMapper extends AlertMapper { - - int insertSelectiveAndSetId(Alert pgAlert); - + + int insertSelectiveAndSetId(Alert pgAlert); + } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomAlertMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomAlertMetadataMapper.java index 1a14b98dc..80bdbebee 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomAlertMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomAlertMetadataMapper.java @@ -8,9 +8,9 @@ import org.opensrp.repository.postgres.mapper.AlertMetadataMapper; public interface CustomAlertMetadataMapper extends AlertMetadataMapper { - - Alert selectByDocumentId(String documentId); - - List selectMany(@Param("example") AlertMetadataExample example, @Param("offset") int offset, - @Param("limit") int limit); + + Alert selectByDocumentId(String documentId); + + List selectMany(@Param("example") AlertMetadataExample example, @Param("offset") int offset, + @Param("limit") int limit); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomCampaignMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomCampaignMapper.java index 2018a7ebe..0dcd7f18c 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomCampaignMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomCampaignMapper.java @@ -5,6 +5,6 @@ public interface CustomCampaignMapper extends CampaignMapper { - int insertSelectiveAndSetId(Campaign campaign); + int insertSelectiveAndSetId(Campaign campaign); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomCampaignMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomCampaignMetadataMapper.java index afdabdd6b..5d0d2ea02 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomCampaignMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomCampaignMetadataMapper.java @@ -9,9 +9,9 @@ public interface CustomCampaignMetadataMapper extends CampaignMetadataMapper { - Campaign selectByIdentifier(String identifier); + Campaign selectByIdentifier(String identifier); - List selectMany(@Param("example") CampaignMetadataExample campaignMetadataExample, - @Param("offset") int offset, @Param("limit") int limit); + List selectMany(@Param("example") CampaignMetadataExample campaignMetadataExample, + @Param("offset") int offset, @Param("limit") int limit); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientFormMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientFormMapper.java index e8cb8f4c5..7b2f5276f 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientFormMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientFormMapper.java @@ -9,11 +9,11 @@ public interface CustomClientFormMapper extends ClientFormMapper { - ClientForm selectClientFormById(Long id); + ClientForm selectClientFormById(Long id); - int insertClientForm(@NonNull ClientForm clientForm); + int insertClientForm(@NonNull ClientForm clientForm); - List getAll(@Param("offset") int offset, @Param("batchSize") int batchSize); + List getAll(@Param("offset") int offset, @Param("batchSize") int batchSize); - ClientForm getMostRecentFormValidator(@NonNull String formIdentifier); + ClientForm getMostRecentFormValidator(@NonNull String formIdentifier); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientFormMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientFormMetadataMapper.java index 9d824cd71..2714e7440 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientFormMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientFormMetadataMapper.java @@ -10,22 +10,22 @@ public interface CustomClientFormMetadataMapper extends ClientFormMetadataMapper { - int countClientFormMetadataByFormIdentifier(@Param("formIdentifier") String formIdentifier, - @Param("isJsonValidator") boolean isJsonValidator); + int countClientFormMetadataByFormIdentifier(@Param("formIdentifier") String formIdentifier, + @Param("isJsonValidator") boolean isJsonValidator); - ClientFormMetadata selectClientFormMetadataByFormVersionAndIdentifier(@Param("formVersion") @NonNull String formVersion, - @Param("formIdentifier") @NonNull String formIdentifier, @Param("isJsonValidator") boolean isJsonValidator); + ClientFormMetadata selectClientFormMetadataByFormVersionAndIdentifier(@Param("formVersion") @NonNull String formVersion, + @Param("formIdentifier") @NonNull String formIdentifier, @Param("isJsonValidator") boolean isJsonValidator); - int insertClientFormMetadata(@NonNull ClientFormMetadata clientFormMetadata); + int insertClientFormMetadata(@NonNull ClientFormMetadata clientFormMetadata); - List getAvailableClientFormVersions(@Param("formIdentifier") @NonNull String formIdentifier, - @Param("isJsonValidator") boolean isJsonValidator); + List getAvailableClientFormVersions(@Param("formIdentifier") @NonNull String formIdentifier, + @Param("isJsonValidator") boolean isJsonValidator); - List getDraftClientFormMetadata(boolean isDraft); + List getDraftClientFormMetadata(boolean isDraft); - List getJsonWidgetValidatorClientFormMetadata(boolean isJsonValidator); + List getJsonWidgetValidatorClientFormMetadata(boolean isJsonValidator); - List getAllClientFormMetadata(); + List getAllClientFormMetadata(); - void updateClientMetadataIsDraftByVersion(@Param("isDraft") boolean isDraft, @Param("version") String version); + void updateClientMetadataIsDraftByVersion(@Param("isDraft") boolean isDraft, @Param("version") String version); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientMapper.java index f27185ba2..2bfdfc0af 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientMapper.java @@ -8,29 +8,29 @@ import org.opensrp.repository.postgres.mapper.ClientMapper; public interface CustomClientMapper extends ClientMapper { - - int insertSelectiveAndSetId(Client record); - - Client selectByDocumentId(String documentId); - - List selectByIdentifier(String identifier); - - List selectByIdentifierOfType(@Param("identifierType") String identifierType, - @Param("identifier") String identifier); - - List selectByAttributeOfType(@Param("attributeType") String attributeType, @Param("attribute") String attribute); - - List selectByAttributesOfType(@Param("attributeType") String attributeType, @Param("attributes") List attributes); - - List selectByRelationshipIdAndDateCreated(@Param("relationalId") String relationalId, - @Param("dateFrom") Date date, @Param("dateTo") Date date2); - - List selectByRelationshipIdOfType(@Param("relationshipType") String relationshipType, - @Param("relationshipId") String relationshipId); - - List selectByRelationShip(String relationshipId); - - Long selectServerVersionByPrimaryKey(Long id); - - int updateByPrimaryKeyAndGenerateServerVersion(Client record); + + int insertSelectiveAndSetId(Client record); + + Client selectByDocumentId(String documentId); + + List selectByIdentifier(String identifier); + + List selectByIdentifierOfType(@Param("identifierType") String identifierType, + @Param("identifier") String identifier); + + List selectByAttributeOfType(@Param("attributeType") String attributeType, @Param("attribute") String attribute); + + List selectByAttributesOfType(@Param("attributeType") String attributeType, @Param("attributes") List attributes); + + List selectByRelationshipIdAndDateCreated(@Param("relationalId") String relationalId, + @Param("dateFrom") Date date, @Param("dateTo") Date date2); + + List selectByRelationshipIdOfType(@Param("relationshipType") String relationshipType, + @Param("relationshipId") String relationshipId); + + List selectByRelationShip(String relationshipId); + + Long selectServerVersionByPrimaryKey(Long id); + + int updateByPrimaryKeyAndGenerateServerVersion(Client record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientMetadataMapper.java index b80fb7a4b..eeedbf9d1 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomClientMetadataMapper.java @@ -12,59 +12,59 @@ import org.opensrp.search.ClientSearchBean; public interface CustomClientMetadataMapper extends ClientMetadataMapper { - - List selectMany(@Param("example") ClientMetadataExample example, @Param("offset") int offset, - @Param("limit") int limit); - - Client selectOne(@Param("example") ClientMetadataExample example); - - Client selectByDocumentId(String documentId); - - List selectBySearchBean(@Param("clientBean") ClientSearchBean searchBean, - @Param("addressBean") AddressSearchBean addressSearchBean, @Param("offset") int offset, - @Param("limit") int limit); - - HouseholdClient selectHouseholdCountBySearchBean(@Param("clientBean") ClientSearchBean searchBean, - @Param("addressBean") AddressSearchBean addressSearchBean); - - List selectByName(@Param("name") String nameMatches, @Param("offset") int offset, @Param("limit") int limit); - - List selectMemberCountHouseholdHeadProviderByClients(@Param("example") ClientMetadataExample example, - @Param("clientType") String clientType); - - List selectMembersByRelationshipId(@Param("baseEntityId") String baseEntityId); - - List selectAllClientsBySearchBean(@Param("clientBean") ClientSearchBean searchBean, - @Param("addressBean") AddressSearchBean addressSearchBean, - @Param("offset") int offset, @Param("limit") int limit); - - HouseholdClient selectCountAllClientsBySearchBean(@Param("clientBean") ClientSearchBean searchBean, - @Param("addressBean") AddressSearchBean addressSearchBean); - - List selectHouseholdBySearchBean(@Param("clientBean") ClientSearchBean searchBean, - @Param("addressBean") AddressSearchBean addressSearchBean, - @Param("offset") int offset, @Param("limit") int limit); - - List selectANCBySearchBean(@Param("clientBean") ClientSearchBean searchBean, - @Param("addressBean") AddressSearchBean addressSearchBean, - @Param("offset") int offset, @Param("limit") int limit); - - int selectCountANCBySearchBean(@Param("clientBean") ClientSearchBean searchBean, - @Param("addressBean") AddressSearchBean addressSearchBean); - - List selectChildBySearchBean(@Param("clientBean") ClientSearchBean searchBean, - @Param("addressBean") AddressSearchBean addressSearchBean, - @Param("offset") int offset, @Param("limit") int limit); - - int selectCountChildBySearchBean(@Param("clientBean") ClientSearchBean searchBean, - @Param("addressBean") AddressSearchBean addressSearchBean); - - List selectManyIds(@Param("example") ClientMetadataExample example, @Param("offset") int offset, - @Param("limit") int limit); - - List selectByLocationIdOfType(@Param("clientType") String clientType, @Param("locationId") String locationId); - - List selectByLocationIdAndNotOfType(@Param("locationId") String locationId, @Param("clientType") String clientType); - - Long countMany(@Param("example") ClientMetadataExample clientMetadataExample); + + List selectMany(@Param("example") ClientMetadataExample example, @Param("offset") int offset, + @Param("limit") int limit); + + Client selectOne(@Param("example") ClientMetadataExample example); + + Client selectByDocumentId(String documentId); + + List selectBySearchBean(@Param("clientBean") ClientSearchBean searchBean, + @Param("addressBean") AddressSearchBean addressSearchBean, @Param("offset") int offset, + @Param("limit") int limit); + + HouseholdClient selectHouseholdCountBySearchBean(@Param("clientBean") ClientSearchBean searchBean, + @Param("addressBean") AddressSearchBean addressSearchBean); + + List selectByName(@Param("name") String nameMatches, @Param("offset") int offset, @Param("limit") int limit); + + List selectMemberCountHouseholdHeadProviderByClients(@Param("example") ClientMetadataExample example, + @Param("clientType") String clientType); + + List selectMembersByRelationshipId(@Param("baseEntityId") String baseEntityId); + + List selectAllClientsBySearchBean(@Param("clientBean") ClientSearchBean searchBean, + @Param("addressBean") AddressSearchBean addressSearchBean, + @Param("offset") int offset, @Param("limit") int limit); + + HouseholdClient selectCountAllClientsBySearchBean(@Param("clientBean") ClientSearchBean searchBean, + @Param("addressBean") AddressSearchBean addressSearchBean); + + List selectHouseholdBySearchBean(@Param("clientBean") ClientSearchBean searchBean, + @Param("addressBean") AddressSearchBean addressSearchBean, + @Param("offset") int offset, @Param("limit") int limit); + + List selectANCBySearchBean(@Param("clientBean") ClientSearchBean searchBean, + @Param("addressBean") AddressSearchBean addressSearchBean, + @Param("offset") int offset, @Param("limit") int limit); + + int selectCountANCBySearchBean(@Param("clientBean") ClientSearchBean searchBean, + @Param("addressBean") AddressSearchBean addressSearchBean); + + List selectChildBySearchBean(@Param("clientBean") ClientSearchBean searchBean, + @Param("addressBean") AddressSearchBean addressSearchBean, + @Param("offset") int offset, @Param("limit") int limit); + + int selectCountChildBySearchBean(@Param("clientBean") ClientSearchBean searchBean, + @Param("addressBean") AddressSearchBean addressSearchBean); + + List selectManyIds(@Param("example") ClientMetadataExample example, @Param("offset") int offset, + @Param("limit") int limit); + + List selectByLocationIdOfType(@Param("clientType") String clientType, @Param("locationId") String locationId); + + List selectByLocationIdAndNotOfType(@Param("locationId") String locationId, @Param("clientType") String clientType); + + Long countMany(@Param("example") ClientMetadataExample clientMetadataExample); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomErrorTraceMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomErrorTraceMapper.java index 030e066f9..b686cce4f 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomErrorTraceMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomErrorTraceMapper.java @@ -8,8 +8,8 @@ import org.opensrp.repository.postgres.mapper.ErrorTraceMapper; public interface CustomErrorTraceMapper extends ErrorTraceMapper { - - List selectMany(@Param("example") ErrorTraceExample example, @Param("offset") int offset, - @Param("limit") int limit); - + + List selectMany(@Param("example") ErrorTraceExample example, @Param("offset") int offset, + @Param("limit") int limit); + } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomEventMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomEventMapper.java index a6d59f5f6..9d4a19491 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomEventMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomEventMapper.java @@ -8,30 +8,30 @@ import org.opensrp.repository.postgres.mapper.EventMapper; public interface CustomEventMapper extends EventMapper { - - int insertSelectiveAndSetId(Event record); - - Event selectByDocumentId(String documentId); - - List selectByIdentifier(String identifier); - - List selectByIdentifierOfType(@Param("identifierType") String identifierType, - @Param("identifier") String identifier); - - List selectByBaseEntityIdConceptAndDate(@Param("baseEntityId") String baseEntityId, - @Param("concept") String concept, @Param("conceptValue") String conceptValue, @Param("dateFrom") Date dateFrom, - @Param("dateTo") Date dateTo); - - List selectByBaseEntityIdAndConceptParentCode(@Param("baseEntityId") String baseEntityId, - @Param("concept") String concept, @Param("parentCode") String parentCode); - - List selectByConceptAndValue(@Param("concept") String concept, @Param("conceptValue") String conceptValue); - - List selectByBaseEntityIdAndDetails(@Param("baseEntityId") String baseEntityId, @Param("detailKey") String detailKey, - @Param("detailValue") String detailValue); - - Long selectServerVersionByPrimaryKey(Long id); - - int updateByPrimaryKeyAndGenerateServerVersion(Event record); + + int insertSelectiveAndSetId(Event record); + + Event selectByDocumentId(String documentId); + + List selectByIdentifier(String identifier); + + List selectByIdentifierOfType(@Param("identifierType") String identifierType, + @Param("identifier") String identifier); + + List selectByBaseEntityIdConceptAndDate(@Param("baseEntityId") String baseEntityId, + @Param("concept") String concept, @Param("conceptValue") String conceptValue, @Param("dateFrom") Date dateFrom, + @Param("dateTo") Date dateTo); + + List selectByBaseEntityIdAndConceptParentCode(@Param("baseEntityId") String baseEntityId, + @Param("concept") String concept, @Param("parentCode") String parentCode); + + List selectByConceptAndValue(@Param("concept") String concept, @Param("conceptValue") String conceptValue); + + List selectByBaseEntityIdAndDetails(@Param("baseEntityId") String baseEntityId, @Param("detailKey") String detailKey, + @Param("detailValue") String detailValue); + + Long selectServerVersionByPrimaryKey(Long id); + + int updateByPrimaryKeyAndGenerateServerVersion(Event record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomEventMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomEventMetadataMapper.java index 0277dc262..5a098e480 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomEventMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomEventMetadataMapper.java @@ -8,35 +8,38 @@ import org.opensrp.repository.postgres.mapper.EventMetadataMapper; public interface CustomEventMetadataMapper extends EventMetadataMapper { - - Event selectByDocumentId(String documentId); - - List selectMany(EventMetadataExample eventMetadataExample); - - List selectManyWithRowBounds(@Param("example") EventMetadataExample example, @Param("offset") int offset, - @Param("limit") int limit); - - List selectNotInOpenMRSByServerVersion(@Param("from") long serverVersion, @Param("to") long calendar, - @Param("limit") int limit); - - List selectNotInOpenMRSByServerVersionAndType(@Param("eventType") String type, @Param("from") long serverVersion, - @Param("to") long calendar, @Param("limit") int limit); - - List selectManyIds(@Param("example") EventMetadataExample example, @Param("offset") long offset, - @Param("limit") int limit); - - /** Gets primary Key - * @param eventMetadataExample - * @return the primary key - */ - Long selectPrimaryKey(EventMetadataExample eventMetadataExample); - - /** - * Gets events baseEntityIds in matching the criteria - * @param example criteria - * @return baseEntityIds matching criteria - */ - List selectManyBaseEntityIds(@Param("example") EventMetadataExample example); - - List selectByBaseEntityIdAndPlanIdentifier(@Param("baseEntityId") String baseEntityId, @Param("planIdentifier") String planIdentifier); + + Event selectByDocumentId(String documentId); + + List selectMany(EventMetadataExample eventMetadataExample); + + List selectManyWithRowBounds(@Param("example") EventMetadataExample example, @Param("offset") int offset, + @Param("limit") int limit); + + List selectNotInOpenMRSByServerVersion(@Param("from") long serverVersion, @Param("to") long calendar, + @Param("limit") int limit); + + List selectNotInOpenMRSByServerVersionAndType(@Param("eventType") String type, @Param("from") long serverVersion, + @Param("to") long calendar, @Param("limit") int limit); + + List selectManyIds(@Param("example") EventMetadataExample example, @Param("offset") long offset, + @Param("limit") int limit); + + /** + * Gets primary Key + * + * @param eventMetadataExample + * @return the primary key + */ + Long selectPrimaryKey(EventMetadataExample eventMetadataExample); + + /** + * Gets events baseEntityIds in matching the criteria + * + * @param example criteria + * @return baseEntityIds matching criteria + */ + List selectManyBaseEntityIds(@Param("example") EventMetadataExample example); + + List selectByBaseEntityIdAndPlanIdentifier(@Param("baseEntityId") String baseEntityId, @Param("planIdentifier") String planIdentifier); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomIdentifierSourceMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomIdentifierSourceMapper.java index 1f8521115..367c63bc6 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomIdentifierSourceMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomIdentifierSourceMapper.java @@ -9,12 +9,12 @@ public interface CustomIdentifierSourceMapper extends IdentifierSourceMapper { - List selectMany(@Param("example") IdentifierSourceExample example, @Param("offset") int offset, - @Param("limit") int limit); + List selectMany(@Param("example") IdentifierSourceExample example, @Param("offset") int offset, + @Param("limit") int limit); - IdentifierSource selectByIdentifier(String identifier); + IdentifierSource selectByIdentifier(String identifier); - IdentifierSource selectOne(@Param("example") IdentifierSourceExample example); + IdentifierSource selectOne(@Param("example") IdentifierSourceExample example); - int insertSelectiveAndSetId(IdentifierSource record); + int insertSelectiveAndSetId(IdentifierSource record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationMapper.java index c05b6f612..3fdfee6e1 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationMapper.java @@ -5,10 +5,10 @@ public interface CustomLocationMapper extends LocationMapper { - int insertSelectiveAndSetId(Location location); - - Long selectServerVersionByPrimaryKey(Long id); - - int updateByPrimaryKeyAndGenerateServerVersion(Location location); + int insertSelectiveAndSetId(Location location); + + Long selectServerVersionByPrimaryKey(Long id); + + int updateByPrimaryKeyAndGenerateServerVersion(Location location); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationMetadataMapper.java index ba3fa76e6..e0ab24a2d 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationMetadataMapper.java @@ -13,43 +13,43 @@ import org.opensrp.search.LocationSearchBean; public interface CustomLocationMetadataMapper extends LocationMetadataMapper { - - Location findById(@Param("id") String id, @Param("geometry") boolean returnGeometry, @Param("includeInactive") boolean includeInactive); - List selectMany(@Param("example") LocationMetadataExample locationMetadataExample, @Param("offset") int offset, - @Param("limit") int limit); - - List selectManyByProperties(@Param("example") LocationMetadataExample locationMetadataExample, - @Param("properties") Map properties, @Param("geometry") boolean returnGeometry, - @Param("offset") int offset, @Param("limit") int limit); + Location findById(@Param("id") String id, @Param("geometry") boolean returnGeometry, @Param("includeInactive") boolean includeInactive); - List selectManyWithOptionalGeometry(@Param("example") LocationMetadataExample locationMetadataExample, - @Param("geometry") boolean returnGeometry, - @Param("offset") int offset, @Param("limit") int limit); + List selectMany(@Param("example") LocationMetadataExample locationMetadataExample, @Param("offset") int offset, + @Param("limit") int limit); - List selectWithChildren(@Param("example") LocationMetadataExample locationMetadataExample, - @Param("geometry") boolean returnGeometry, - @Param("locationIds") Set locationIds, - @Param("offset") int offset, @Param("limit") int limit); + List selectManyByProperties(@Param("example") LocationMetadataExample locationMetadataExample, + @Param("properties") Map properties, @Param("geometry") boolean returnGeometry, + @Param("offset") int offset, @Param("limit") int limit); - LinkedHashSet selectDetailsByPlanId(@Param("example") LocationMetadataExample locationMetadataExample, - @Param("planIdentifier") String planIdentifier); + List selectManyWithOptionalGeometry(@Param("example") LocationMetadataExample locationMetadataExample, + @Param("geometry") boolean returnGeometry, + @Param("offset") int offset, @Param("limit") int limit); - List selectManyIds(@Param("example") LocationMetadataExample locationMetadataExample, @Param("offset") int offset, - @Param("limit") int limit); - - List selectLocations(@Param("locationSearchBean") LocationSearchBean locationSearchBean, - @Param("offset") Integer offset, @Param("limit") Integer limit); + List selectWithChildren(@Param("example") LocationMetadataExample locationMetadataExample, + @Param("geometry") boolean returnGeometry, + @Param("locationIds") Set locationIds, + @Param("offset") int offset, @Param("limit") int limit); - int selectCountLocations(@Param("locationSearchBean") LocationSearchBean locationSearchBean); - - LinkedHashSet selectLocationHierachy( @Param("identifiers") Set identifiers, @Param("tags") boolean returnTags); + LinkedHashSet selectDetailsByPlanId(@Param("example") LocationMetadataExample locationMetadataExample, + @Param("planIdentifier") String planIdentifier); - Location findByIdAndVersion(@Param("id") String id, @Param("geometry") boolean returnGeometry, @Param("version") int version); + List selectManyIds(@Param("example") LocationMetadataExample locationMetadataExample, @Param("offset") int offset, + @Param("limit") int limit); - LinkedHashSet selectLocationWithDescendants(@Param("locationId") String locationId, @Param("tags") boolean returnTags); + List selectLocations(@Param("locationSearchBean") LocationSearchBean locationSearchBean, + @Param("offset") Integer offset, @Param("limit") Integer limit); - List selectChildrenIds(@Param("locationId") String locationId); + int selectCountLocations(@Param("locationSearchBean") LocationSearchBean locationSearchBean); - Long countMany(@Param("example")LocationMetadataExample locationMetadataExample); + LinkedHashSet selectLocationHierachy(@Param("identifiers") Set identifiers, @Param("tags") boolean returnTags); + + Location findByIdAndVersion(@Param("id") String id, @Param("geometry") boolean returnGeometry, @Param("version") int version); + + LinkedHashSet selectLocationWithDescendants(@Param("locationId") String locationId, @Param("tags") boolean returnTags); + + List selectChildrenIds(@Param("locationId") String locationId); + + Long countMany(@Param("example") LocationMetadataExample locationMetadataExample); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationTagMapMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationTagMapMapper.java index c13192dc6..19905abff 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationTagMapMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationTagMapMapper.java @@ -3,5 +3,5 @@ import org.opensrp.repository.postgres.mapper.LocationTagMapMapper; public interface CustomLocationTagMapMapper extends LocationTagMapMapper { - + } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationTagMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationTagMapper.java index cce5ccec8..3644a154b 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationTagMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomLocationTagMapper.java @@ -8,8 +8,8 @@ import org.opensrp.repository.postgres.mapper.LocationTagMapper; public interface CustomLocationTagMapper extends LocationTagMapper { - - List selectMany(@Param("example") LocationTagExample locationTagExample, @Param("offset") int offset, - @Param("limit") int limit); - + + List selectMany(@Param("example") LocationTagExample locationTagExample, @Param("offset") int offset, + @Param("limit") int limit); + } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomManifestMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomManifestMapper.java index 39fda5c63..6b91ff1b0 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomManifestMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomManifestMapper.java @@ -19,7 +19,7 @@ List selectMany(@Param("example") ManifestExample manifestExample, @Param("offset") int offset, @Param("limit") int limit); List selectManyWithOrdering(@Param("example") ManifestExample manifestExample, - @Param("offset") int offset, @Param("limit") int limit); + @Param("offset") int offset, @Param("limit") int limit); List selectByAppId(@Param("appId") String appId); diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomMultiMediaMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomMultiMediaMapper.java index cb6619531..5abbe1747 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomMultiMediaMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomMultiMediaMapper.java @@ -8,7 +8,7 @@ import org.opensrp.repository.postgres.mapper.MultiMediaMapper; public interface CustomMultiMediaMapper extends MultiMediaMapper { - - List selectMany(@Param("example") MultiMediaExample example, @Param("offset") int offset, - @Param("limit") int limit); + + List selectMany(@Param("example") MultiMediaExample example, @Param("offset") int offset, + @Param("limit") int limit); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomOrganizationLocationMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomOrganizationLocationMapper.java index 616523548..d813b0969 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomOrganizationLocationMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomOrganizationLocationMapper.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.repository.postgres.mapper.custom; @@ -18,26 +18,26 @@ */ public interface CustomOrganizationLocationMapper extends OrganizationLocationMapper { - /** - * Gets the assigned locations and plans for an organization - * - * @param organizationId - * @return - */ - List findAssignedlocationsAndPlans(@Param("searchBean") AssignedLocationAndPlanSearchBean searchBean, - @Param("offset") int offset, @Param("limit") int limit, @Param("oredCriteria") List oredCriteria, - @Param("toDate") Date toDate); + /** + * Gets the assigned locations and plans for an organization + * + * @param organizationId + * @return + */ + List findAssignedlocationsAndPlans(@Param("searchBean") AssignedLocationAndPlanSearchBean searchBean, + @Param("offset") int offset, @Param("limit") int limit, @Param("oredCriteria") List oredCriteria, + @Param("toDate") Date toDate); - /** - * Gets the locations and plans assigned to an organization valid until now - * - * @param example the criteria for filtering - * @param orderByClause the order by clause - * @param currentDate todays date - * @return organization locations and plans assigned to an organization valid - * until now - */ - List selectByExampleAndDateTo(@Param("oredCriteria") List oredCriteria, - @Param("orderByClause") String orderByClause, @Param("currentDate") Date currentDate); + /** + * Gets the locations and plans assigned to an organization valid until now + * + * @param example the criteria for filtering + * @param orderByClause the order by clause + * @param currentDate todays date + * @return organization locations and plans assigned to an organization valid + * until now + */ + List selectByExampleAndDateTo(@Param("oredCriteria") List oredCriteria, + @Param("orderByClause") String orderByClause, @Param("currentDate") Date currentDate); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomOrganizationMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomOrganizationMapper.java index a84576d7a..400688082 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomOrganizationMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomOrganizationMapper.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.repository.postgres.mapper.custom; @@ -17,31 +17,31 @@ */ public interface CustomOrganizationMapper extends OrganizationMapper { - /** - * Return list of Organization filtered by example with offset and limit - * - * @param example used to filter organizations - * @param offset - * @param limit - * @return the list of organizations - */ - List selectMany(@Param("example") OrganizationExample example, @Param("offset") int offset, - @Param("limit") int limit); - - List selectSearchOrganizations(@Param("searchBean") OrganizationSearchBean searchBean, - @Param("offset") int offset, @Param("limit") int limit); + /** + * Return list of Organization filtered by example with offset and limit + * + * @param example used to filter organizations + * @param offset + * @param limit + * @return the list of organizations + */ + List selectMany(@Param("example") OrganizationExample example, @Param("offset") int offset, + @Param("limit") int limit); + List selectSearchOrganizations(@Param("searchBean") OrganizationSearchBean searchBean, + @Param("offset") int offset, @Param("limit") int limit); - int selectOrganizationCount(@Param("searchBean") OrganizationSearchBean searchBean); - List selectOrganizationsEncompassLocations(@Param("identifier") String identifier, @Param("activeDate") Date activeDate); + int selectOrganizationCount(@Param("searchBean") OrganizationSearchBean searchBean); - List selectByOrganizationIds(@Param("organizationIds") List organizationIds); + List selectOrganizationsEncompassLocations(@Param("identifier") String identifier, @Param("activeDate") Date activeDate); - int insertSelectiveAndGenerateServerVersion(Organization organization); + List selectByOrganizationIds(@Param("organizationIds") List organizationIds); - int updateByPrimaryKeySelectiveAndGenerateServerVersion(Organization organization); + int insertSelectiveAndGenerateServerVersion(Organization organization); - Long selectServerVersionByPrimaryKey(Long id); + int updateByPrimaryKeySelectiveAndGenerateServerVersion(Organization organization); + + Long selectServerVersionByPrimaryKey(Long id); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomPlanMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomPlanMapper.java index 8eaa2ccd3..7fbd26b7b 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomPlanMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomPlanMapper.java @@ -12,24 +12,24 @@ * Created by Vincent Karuri on 02/05/2019 */ public interface CustomPlanMapper extends PlanMapper { - List selectMany(@Param("example") PlanExample planExample, @Param("offset") int offset, - @Param("limit") int limit); + List selectMany(@Param("example") PlanExample planExample, @Param("offset") int offset, + @Param("limit") int limit); - int insertSelectiveAndSetId(Plan plan); + int insertSelectiveAndSetId(Plan plan); - List selectManyReturnOptionalFields(@Param("example") PlanExample planExample, @Param("fields") List fields, @Param("offset") int offset, - @Param("limit") int limit); + List selectManyReturnOptionalFields(@Param("example") PlanExample planExample, @Param("fields") List fields, @Param("offset") int offset, + @Param("limit") int limit); - List selectManyIds(@Param("example") PlanExample planExample, @Param("offset") int offset, - @Param("limit") int limit); + List selectManyIds(@Param("example") PlanExample planExample, @Param("offset") int offset, + @Param("limit") int limit); - Long countMany(@Param("example") PlanExample planExample); + Long countMany(@Param("example") PlanExample planExample); - List selectPlansBySearchBean(@Param("searchBean") PlanSearchBean searchBean, - @Param("offset") int offset, @Param("limit") int limit); - - Long selectServerVersionByPrimaryKey(Long id); - - int updateByPrimaryKeyAndGenerateServerVersion(Plan plan); + List selectPlansBySearchBean(@Param("searchBean") PlanSearchBean searchBean, + @Param("offset") int offset, @Param("limit") int limit); + + Long selectServerVersionByPrimaryKey(Long id); + + int updateByPrimaryKeyAndGenerateServerVersion(Plan plan); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomPlanMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomPlanMetadataMapper.java index d04fa1ef5..0fa944694 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomPlanMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomPlanMetadataMapper.java @@ -8,7 +8,7 @@ import java.util.List; public interface CustomPlanMetadataMapper extends PlanMetadataMapper { - List selectMany(@Param("example") PlanExample planExample, @Param("operationalAreaIds") List operationalAreaIds, @Param("offset") int offset, - @Param("limit") int limit); + List selectMany(@Param("example") PlanExample planExample, @Param("operationalAreaIds") List operationalAreaIds, @Param("offset") int offset, + @Param("limit") int limit); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomPractitionerMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomPractitionerMapper.java index 4ced41ecb..ef30a5ae0 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomPractitionerMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomPractitionerMapper.java @@ -9,7 +9,7 @@ public interface CustomPractitionerMapper extends PractitionerMapper { List selectMany(@Param("example") PractitionerExample practitionerExample, - @Param("offset") int offset, @Param("limit") int limit); + @Param("offset") int offset, @Param("limit") int limit); List selectManyByOrgId(@Param("example") PractitionerExample practitionerExample, @Param("orgId") long orgId, @Param("offset") int offset, @Param("limit") int limit); diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomProductCatalogueMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomProductCatalogueMapper.java index 78e8a429e..6d6c1b956 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomProductCatalogueMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomProductCatalogueMapper.java @@ -9,14 +9,14 @@ public interface CustomProductCatalogueMapper extends ProductCatalogueMapper { - ProductCatalogue selectOne(@Param("example") ProductCatalogueExample productCatalogueExample); + ProductCatalogue selectOne(@Param("example") ProductCatalogueExample productCatalogueExample); - List selectMany(@Param("example") ProductCatalogueExample productCatalogueExample, @Param("offset") int offset, - @Param("limit") int limit); + List selectMany(@Param("example") ProductCatalogueExample productCatalogueExample, @Param("offset") int offset, + @Param("limit") int limit); - int insertSelectiveAndSetId(ProductCatalogue productCatalogue); - - Long selectServerVersionByPrimaryKey(Long uniqueId); - - int updateByPrimaryKeyAndGenerateServerVersion(ProductCatalogue productCatalogue); + int insertSelectiveAndSetId(ProductCatalogue productCatalogue); + + Long selectServerVersionByPrimaryKey(Long uniqueId); + + int updateByPrimaryKeyAndGenerateServerVersion(ProductCatalogue productCatalogue); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomReportMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomReportMapper.java index 290a75f6b..94dde1602 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomReportMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomReportMapper.java @@ -7,14 +7,14 @@ import org.opensrp.repository.postgres.mapper.ReportMapper; public interface CustomReportMapper extends ReportMapper { - - int insertSelectiveAndSetId(Report report); - - List selectByIdentifier(@Param("identifier") String identifier, @Param("offset") int offset, - @Param("limit") int limit); - - Long selectServerVersionByPrimaryKey(Long id); - - int updateByPrimaryKeyAndGenerateServerVersion(Report report); - + + int insertSelectiveAndSetId(Report report); + + List selectByIdentifier(@Param("identifier") String identifier, @Param("offset") int offset, + @Param("limit") int limit); + + Long selectServerVersionByPrimaryKey(Long id); + + int updateByPrimaryKeyAndGenerateServerVersion(Report report); + } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomReportMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomReportMetadataMapper.java index ad4b50062..580c60881 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomReportMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomReportMetadataMapper.java @@ -8,10 +8,10 @@ import org.opensrp.repository.postgres.mapper.ReportMetadataMapper; public interface CustomReportMetadataMapper extends ReportMetadataMapper { - - Report selectByDocumentId(String documentId); - - List selectMany(@Param("example") ReportMetadataExample example, @Param("offset") int offset, - @Param("limit") int limit); - + + Report selectByDocumentId(String documentId); + + List selectMany(@Param("example") ReportMetadataExample example, @Param("offset") int offset, + @Param("limit") int limit); + } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomSettingMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomSettingMapper.java index 1fe7de82c..b254086b0 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomSettingMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomSettingMapper.java @@ -4,10 +4,10 @@ import org.opensrp.repository.postgres.mapper.SettingsMapper; public interface CustomSettingMapper extends SettingsMapper { - - int insertSelectiveAndSetId(Settings setting); - - Long selectServerVersionByPrimaryKey(Long id); - - int updateByPrimaryKeyAndGenerateServerVersion(Settings settings); + + int insertSelectiveAndSetId(Settings setting); + + Long selectServerVersionByPrimaryKey(Long id); + + int updateByPrimaryKeyAndGenerateServerVersion(Settings settings); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomSettingMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomSettingMetadataMapper.java index 6a1fa0360..667a6ac76 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomSettingMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomSettingMetadataMapper.java @@ -10,14 +10,14 @@ public interface CustomSettingMetadataMapper extends SettingsMetadataMapper { - List selectMany(@Param("example") SettingsMetadataExample settingsExample, - @Param("offset") int offset, - @Param("limit") int limit); + List selectMany(@Param("example") SettingsMetadataExample settingsExample, + @Param("offset") int offset, + @Param("limit") int limit); - SettingsAndSettingsMetadataJoined selectByDocumentId(@Param("documentId") String documentId); + SettingsAndSettingsMetadataJoined selectByDocumentId(@Param("documentId") String documentId); - int insertMany(@Param("settingsMetadata") List settingsMetadata); + int insertMany(@Param("settingsMetadata") List settingsMetadata); - int updateMany(@Param("settingsMetadata") List settingsMetadata); + int updateMany(@Param("settingsMetadata") List settingsMetadata); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStockMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStockMapper.java index 0792adb20..80cfaaa02 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStockMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStockMapper.java @@ -6,14 +6,14 @@ import org.springframework.lang.NonNull; public interface CustomStockMapper extends StockMapper { - - int insertSelectiveAndSetId(Stock stock); - Stock selectByIdentifierAndLocationId(@Param("identifier") @NonNull String identifier, - @Param("locationId") @NonNull String locationId); - - Long selectServerVersionByPrimaryKey(Long id); - - int updateByPrimaryKeyAndGenerateServerVersion(Stock record); + int insertSelectiveAndSetId(Stock stock); + + Stock selectByIdentifierAndLocationId(@Param("identifier") @NonNull String identifier, + @Param("locationId") @NonNull String locationId); + + Long selectServerVersionByPrimaryKey(Long id); + + int updateByPrimaryKeyAndGenerateServerVersion(Stock record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStockMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStockMetadataMapper.java index 3717d29e6..3bf92ffd0 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStockMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStockMetadataMapper.java @@ -12,25 +12,25 @@ import org.opensrp.search.StockSearchBean; public interface CustomStockMetadataMapper extends StockMetadataMapper { - - Stock selectByDocumentId(String documentId); - - List selectMany(@Param("example") StockMetadataExample stockMetadataExample, @Param("offset") int offset, - @Param("limit") int limit); - - List selectByIdentifier(@Param("stockTypeId") String stockTypeId, @Param("offset") int offset, - @Param("limit") int limit); - - List selectManyBySearchBean(@Param("searchBean") StockSearchBean searchBean, - @Param("todayDate") Date todayDate, @Param("orderByClause") String orderByClause, @Param("offset") int offset, @Param("limit") int limit); - - StockMetadata selectByStockId(Long stockId); - - List selectManyStockAndProductDetailsByServicePointId(@Param("locations") List locations); - - List selectStockAndProductDetailsByStockId(@Param("documentId") String documentId); - - List selectManyStockAndProductDetailsBySearchBean(@Param("searchBean") StockSearchBean searchBean, - @Param("todayDate") Date todayDate, @Param("orderByClause") String orderByClause, @Param("offset") int offset, @Param("limit") int limit); + + Stock selectByDocumentId(String documentId); + + List selectMany(@Param("example") StockMetadataExample stockMetadataExample, @Param("offset") int offset, + @Param("limit") int limit); + + List selectByIdentifier(@Param("stockTypeId") String stockTypeId, @Param("offset") int offset, + @Param("limit") int limit); + + List selectManyBySearchBean(@Param("searchBean") StockSearchBean searchBean, + @Param("todayDate") Date todayDate, @Param("orderByClause") String orderByClause, @Param("offset") int offset, @Param("limit") int limit); + + StockMetadata selectByStockId(Long stockId); + + List selectManyStockAndProductDetailsByServicePointId(@Param("locations") List locations); + + List selectStockAndProductDetailsByStockId(@Param("documentId") String documentId); + + List selectManyStockAndProductDetailsBySearchBean(@Param("searchBean") StockSearchBean searchBean, + @Param("todayDate") Date todayDate, @Param("orderByClause") String orderByClause, @Param("offset") int offset, @Param("limit") int limit); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStructureMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStructureMapper.java index 02a8c2b9c..d9575cd09 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStructureMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStructureMapper.java @@ -9,12 +9,12 @@ public interface CustomStructureMapper extends StructureMapper { - int insertSelectiveAndSetId(Structure structure); + int insertSelectiveAndSetId(Structure structure); - List selectStructureAndFamilyWithinRadius(@Param("latitude") double latitude, - @Param("longitude") double longitude, @Param("radius") double radius); - - Long selectServerVersionByPrimaryKey(Long id); - - int updateByPrimaryKeyAndGenerateServerVersion(Structure structure); + List selectStructureAndFamilyWithinRadius(@Param("latitude") double latitude, + @Param("longitude") double longitude, @Param("radius") double radius); + + Long selectServerVersionByPrimaryKey(Long id); + + int updateByPrimaryKeyAndGenerateServerVersion(Structure structure); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStructureMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStructureMetadataMapper.java index eb09e3aca..7e28eed26 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStructureMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomStructureMetadataMapper.java @@ -15,25 +15,25 @@ public interface CustomStructureMetadataMapper extends StructureMetadataMapper { - Structure findById(@Param("id") String id, @Param("geometry") boolean returnGeometry); + Structure findById(@Param("id") String id, @Param("geometry") boolean returnGeometry); - List selectMany(@Param("example") StructureMetadataExample locationMetadataExample, - @Param("offset") int offset, @Param("limit") int limit); + List selectMany(@Param("example") StructureMetadataExample locationMetadataExample, + @Param("offset") int offset, @Param("limit") int limit); - List selectManyByProperties(@Param("example") StructureMetadataExample locationMetadataExample, - @Param("properties") Map properties, @Param("geometry") boolean returnGeometry, - @Param("offset") int offset, @Param("limit") int limit); + List selectManyByProperties(@Param("example") StructureMetadataExample locationMetadataExample, + @Param("properties") Map properties, @Param("geometry") boolean returnGeometry, + @Param("offset") int offset, @Param("limit") int limit); - List selectManyIds(@Param("example") StructureMetadataExample structureMetadataExample, - @Param("offset") int offset, @Param("limit") int limit); + List selectManyIds(@Param("example") StructureMetadataExample structureMetadataExample, + @Param("offset") int offset, @Param("limit") int limit); - List findStructureCountsForLocation(@Param("locationIdentifiers") Set locationIdentifiers); + List findStructureCountsForLocation(@Param("locationIdentifiers") Set locationIdentifiers); - Long countMany(@Param("example") StructureMetadataExample structureMetadataExample); + Long countMany(@Param("example") StructureMetadataExample structureMetadataExample); - List findStructureAndStocksByJurisdiction(@Param("example") StructureMetadataExample locationMetadataExample, - @Param("stockMetadataExample") StockMetadataExample stockMetadataExample, - @Param("properties") Map properties, @Param("geometry") boolean returnGeometry, - @Param("offset") int offset, @Param("limit") int limit); + List findStructureAndStocksByJurisdiction(@Param("example") StructureMetadataExample locationMetadataExample, + @Param("stockMetadataExample") StockMetadataExample stockMetadataExample, + @Param("properties") Map properties, @Param("geometry") boolean returnGeometry, + @Param("offset") int offset, @Param("limit") int limit); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomTaskMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomTaskMapper.java index 067522981..873f38e22 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomTaskMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomTaskMapper.java @@ -4,11 +4,11 @@ import org.opensrp.repository.postgres.mapper.TaskMapper; public interface CustomTaskMapper extends TaskMapper { - - int insertSelectiveAndSetId(Task task); - - Long selectServerVersionByPrimaryKey(Long id); - - int updateByPrimaryKeyAndGenerateServerVersion(Task record); - + + int insertSelectiveAndSetId(Task task); + + Long selectServerVersionByPrimaryKey(Long id); + + int updateByPrimaryKeyAndGenerateServerVersion(Task record); + } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomTaskMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomTaskMetadataMapper.java index 833eb28d0..29c1fda3c 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomTaskMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomTaskMetadataMapper.java @@ -9,23 +9,23 @@ import org.opensrp.search.TaskSearchBean; public interface CustomTaskMetadataMapper extends TaskMetadataMapper { - - Task selectByIdentifier(String identifier); - List selectMany(@Param("example") TaskMetadataExample taskMetadataExample, - @Param("offset") int offset, @Param("limit") int limit); + Task selectByIdentifier(String identifier); - List selectManyIds(@Param("example") TaskMetadataExample taskMetadataExample, - @Param("offset") int offset, @Param("limit") int limit ); + List selectMany(@Param("example") TaskMetadataExample taskMetadataExample, + @Param("offset") int offset, @Param("limit") int limit); - int countTasksByEntityIdAndPlanIdentifierAndCode(@Param("baseEntityId") String baseEntityId, @Param("jurisdiction") String jurisdiction ,@Param("planIdentifier") String planIdentifier, @Param("code") String code, - @Param("statuses") List statuses); + List selectManyIds(@Param("example") TaskMetadataExample taskMetadataExample, + @Param("offset") int offset, @Param("limit") int limit); - Long countMany(@Param("example") TaskMetadataExample taskMetadataExample); + int countTasksByEntityIdAndPlanIdentifierAndCode(@Param("baseEntityId") String baseEntityId, @Param("jurisdiction") String jurisdiction, @Param("planIdentifier") String planIdentifier, @Param("code") String code, + @Param("statuses") List statuses); - List selectTasksBySearchBean(@Param("searchBean") TaskSearchBean searchBean, - @Param("offset") int offset, @Param("limit") int limit); + Long countMany(@Param("example") TaskMetadataExample taskMetadataExample); + List selectTasksBySearchBean(@Param("searchBean") TaskSearchBean searchBean, + @Param("offset") int offset, @Param("limit") int limit); - int selectTaskCount(@Param("searchBean") TaskSearchBean searchBean); + + int selectTaskCount(@Param("searchBean") TaskSearchBean searchBean); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomUniqueIdMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomUniqueIdMapper.java index 901946aa9..21d632013 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomUniqueIdMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomUniqueIdMapper.java @@ -1,6 +1,7 @@ package org.opensrp.repository.postgres.mapper.custom; import java.util.List; + import org.apache.ibatis.annotations.Param; import org.opensrp.domain.postgres.UniqueId; import org.opensrp.domain.postgres.UniqueIdExample; @@ -12,7 +13,7 @@ List selectMany(@Param("example") UniqueIdExample uniqueIdExample, @Param("offset") int offset, @Param("limit") int limit); List selectManyIds(@Param("example") UniqueIdExample uniqueIdExample, - @Param("offset") int offset, @Param("limit") int limit); + @Param("offset") int offset, @Param("limit") int limit); int insertSelectiveAndSetId(UniqueId record); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomViewConfigurationMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomViewConfigurationMapper.java index cb273951e..fe870e2f5 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomViewConfigurationMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomViewConfigurationMapper.java @@ -4,10 +4,10 @@ import org.opensrp.repository.postgres.mapper.ViewConfigurationMapper; public interface CustomViewConfigurationMapper extends ViewConfigurationMapper { - - int insertSelectiveAndSetId(ViewConfiguration viewConfiguration); - - Long selectServerVersionByPrimaryKey(Long id); - - int updateByPrimaryKeyAndGenerateServerVersion(ViewConfiguration viewConfiguration); + + int insertSelectiveAndSetId(ViewConfiguration viewConfiguration); + + Long selectServerVersionByPrimaryKey(Long id); + + int updateByPrimaryKeyAndGenerateServerVersion(ViewConfiguration viewConfiguration); } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomViewConfigurationMetadataMapper.java b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomViewConfigurationMetadataMapper.java index d7ec35764..578c6f778 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomViewConfigurationMetadataMapper.java +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/CustomViewConfigurationMetadataMapper.java @@ -8,10 +8,10 @@ import org.opensrp.repository.postgres.mapper.ViewConfigurationMetadataMapper; public interface CustomViewConfigurationMetadataMapper extends ViewConfigurationMetadataMapper { - - List selectMany(@Param("example") ViewConfigurationMetadataExample viewConfigurationExample, - @Param("offset") int offset, @Param("limit") int limit); - - ViewConfiguration selectByDocumentId(String documentId); - + + List selectMany(@Param("example") ViewConfigurationMetadataExample viewConfigurationExample, + @Param("offset") int offset, @Param("limit") int limit); + + ViewConfiguration selectByDocumentId(String documentId); + } diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomActionMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomActionMapper.xml index 094073a95..eb0a98aa5 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomActionMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomActionMapper.xml @@ -1,48 +1,48 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomActionMapper"> - - - insert into core.action - - - id, - - - json, - - - - - #{id,jdbcType=BIGINT}, - - - #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler}, - - - - - - + + + insert into core.action + + + id, + + + json, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler}, + + + + + + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomActionMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomActionMetadataMapper.xml index 4d9251a61..edd855542 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomActionMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomActionMetadataMapper.xml @@ -1,92 +1,92 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomActionMetadataMapper"> - - a.id, a.json - + + a.id, a.json + - + - - - - - - - - - and am.${criterion.condition} - - - and am.${criterion.condition} #{criterion.value} - - - and am.${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and am.${criterion.condition} - - #{listItem} - - - - - - - - - + + + + + + + + + and am.${criterion.condition} + + + and am.${criterion.condition} #{criterion.value} + + + and am.${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and am.${criterion.condition} + + #{listItem} + + + + + + + + + - - - + + + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomAlertMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomAlertMapper.xml index eeba8c44e..c98a6f4e9 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomAlertMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomAlertMapper.xml @@ -1,25 +1,25 @@ - - insert into core.alert - - - id, - - - json, - - - - - #{id,jdbcType=BIGINT}, - - - #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler}, - - - + namespace="org.opensrp.repository.postgres.mapper.custom.CustomAlertMapper"> + + insert into core.alert + + + id, + + + json, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler}, + + + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomAlertMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomAlertMetadataMapper.xml index 7bb6bbcd6..a32c9f351 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomAlertMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomAlertMetadataMapper.xml @@ -1,68 +1,68 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomAlertMetadataMapper"> - - a.id, a.json - + + a.id, a.json + - - - - - - - - - - - - and am.${criterion.condition} - - - and am.${criterion.condition} #{criterion.value} - - - and am.${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and am.${criterion.condition} - - #{listItem} - - - - - - - - - + - + + + + + + + + + + and am.${criterion.condition} + + + and am.${criterion.condition} #{criterion.value} + + + and am.${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and am.${criterion.condition} + + #{listItem} + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomCampaignMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomCampaignMapper.xml index 13e104fc7..7604e6c35 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomCampaignMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomCampaignMapper.xml @@ -1,28 +1,28 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomCampaignMapper"> + + + + insert into core.campaign + + + id, + + + json, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler}, + + + - - - insert into core.campaign - - - id, - - - json, - - - - - #{id,jdbcType=BIGINT}, - - - #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler}, - - - - diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomCampaignMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomCampaignMetadataMapper.xml index b38377b05..961b00c33 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomCampaignMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomCampaignMetadataMapper.xml @@ -1,69 +1,69 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomCampaignMetadataMapper"> - - c.id, c.json - + + c.id, c.json + - + - - - - - - - - - and cm.${criterion.condition} - - - and cm.${criterion.condition} #{criterion.value} - - - and cm.${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and cm.${criterion.condition} - - #{listItem} - - - - - - - - - + + + + + + + + + and cm.${criterion.condition} + + + and cm.${criterion.condition} #{criterion.value} + + + and cm.${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and cm.${criterion.condition} + + #{listItem} + + + + + + + + + - + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientFormMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientFormMapper.xml index e4c8d8713..be8f511ed 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientFormMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientFormMapper.xml @@ -28,6 +28,7 @@ diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientFormMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientFormMetadataMapper.xml index 5003e01f5..74620e601 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientFormMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientFormMetadataMapper.xml @@ -56,7 +56,7 @@ diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientMapper.xml index 11682402f..f0046185b 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientMapper.xml @@ -1,127 +1,127 @@ - - - insert into core.client - - - id, - - - json, - - - date_deleted, - - server_version - - - - #{id,jdbcType=BIGINT}, - - - #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler}, - - - #{dateDeleted,jdbcType=TIMESTAMP}, - - nextVal('core.client_server_version_seq') - - - - update core.client - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler}, - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - server_version = nextVal('core.client_server_version_seq') - where id = #{id,jdbcType=BIGINT} + + + insert into core.client + + + id, + + + json, + + + date_deleted, + + server_version + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler}, + + + #{dateDeleted,jdbcType=TIMESTAMP}, + + nextVal('core.client_server_version_seq') + + + + update core.client + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler}, + date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, + server_version = nextVal('core.client_server_version_seq') + where id = #{id,jdbcType=BIGINT} - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientMetadataMapper.xml index dec37783a..8c7a7502b 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientMetadataMapper.xml @@ -1,22 +1,22 @@ - - - c.id, c.json - - - - from core.client_metadata cm - join core.client c on cm.client_id = c.id - - - - join core.event_metadata em on cm.base_entity_id = em.base_entity_id - - - + namespace="org.opensrp.repository.postgres.mapper.custom.CustomClientMetadataMapper"> + + + c.id, c.json + + + + from core.client_metadata cm + join core.client c on cm.client_id = c.id + + + + join core.event_metadata em on cm.base_entity_id = em.base_entity_id + + + @@ -32,971 +32,985 @@ - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - and cm.${criterion.condition} - - - and cm.${criterion.condition} #{criterion.value} - - - and cm.${criterion.condition} #{criterion.value} - and - #{criterion.secondValue} - - - and cm.${criterion.condition} - - #{listItem} - - - - - - - - - - - + + + + + + + + + + and cm.${criterion.condition} + + + and cm.${criterion.condition} #{criterion.value} + + + and cm.${criterion.condition} #{criterion.value} + and + #{criterion.secondValue} + + + and cm.${criterion.condition} + + #{listItem} + + + + + + + + + + + - INNER JOIN + INNER JOIN (#{listItem}) vals(v) ON (em.location_id = v) - - + + + + + + + + + + + + + + + + + and address ->> 'addressType' = #{addressBean.addressType,jdbcType=VARCHAR} + + + and address ->'addressFields' ->> 'country' = #{addressBean.country,jdbcType=VARCHAR} + + + and address ->'addressFields' ->> 'stateProvince' = #{addressBean.stateProvince,jdbcType=VARCHAR} + + + and address ->'addressFields' ->> 'cityVillage' = #{addressBean.cityVillage,jdbcType=VARCHAR} + + + and address ->'addressFields' ->> 'countyDistrict' = #{addressBean.countyDistrict,jdbcType=VARCHAR} + + + and address ->'addressFields' ->> 'town' = #{addressBean.town,jdbcType=VARCHAR} + + + and address ->'addressFields' ->> 'subTown' = #{addressBean.subTown,jdbcType=VARCHAR} + + + and address ->'addressFields' ->> 'subTown' = #{addressBean.subTown,jdbcType=VARCHAR} + + + + + + and ( cm.first_name ilike #{name} or + cm.middle_name ilike #{name} or + cm.last_name ilike #{name} or + cm.unique_id ilike #{name} or + c.json -> 'attributes' ->> 'phoneNumber' ilike #{name} + + or + em.provider_id ilike #{name} + + ) + + + + and em.entity_type = #{clientBean.clientType,jdbcType=VARCHAR} + + + + and em.provider_id = #{clientBean.providerId,jdbcType=VARCHAR} + + + and c.json->>'gender' = #{clientBean.gender,jdbcType=VARCHAR} + + + and cm.birth_date + between #{clientBean.birthdateFrom,typeHandler=org.opensrp.repository.postgres.handler.DateTimeTypeHandler} + and #{clientBean.birthdateTo,typeHandler=org.opensrp.repository.postgres.handler.DateTimeTypeHandler} + + + and (json->>'deathdate')::date + between #{clientBean.deathdateFrom,typeHandler=org.opensrp.repository.postgres.handler.DateTimeTypeHandler} + and #{clientBean.deathdateTo,typeHandler=org.opensrp.repository.postgres.handler.DateTimeTypeHandler} + + + and json -> 'attributes' ->> #{clientBean.attributeType,jdbcType=VARCHAR} = + #{clientBean.attributeValue,jdbcType=VARCHAR} + + + and (json->>'dateEdited')::timestamp + between #{clientBean.lastEditFrom,typeHandler=org.opensrp.repository.postgres.handler.DateTimeTypeHandler} + and #{clientBean.lastEditTo,typeHandler=org.opensrp.repository.postgres.handler.DateTimeTypeHandler} + + + + + and c.json->>'firstName' ilike #{firstName} + + + + and c.json->>'middleName' ilike #{middleName} + + + + and c.json->>'lastName' ilike #{lastName} + + + and c.json->>'lastName' != #{clientBean.lastNameNot,jdbcType=VARCHAR} + + + + + json -> 'identifiers' ->> #{key,jdbcType=VARCHAR} = #{value,jdbcType=VARCHAR} + + + + + + + json -> 'attributes' ->> #{key,jdbcType=VARCHAR} = #{value,jdbcType=VARCHAR} + + + + + + + + + + + + + and ( family_first_name ilike #{name} or + family_head_first_name ilike #{name} or + family_head_last_name ilike #{name} or + phone_number ilike #{name} or + provider_id ilike #{name} or + unique_id ilike #{name} + ) + + + + with family_event as ( + select + em.*, + max(em.id) over(partition by em.base_entity_id) last_id + from + core.event_metadata em + where + em.entity_type = 'ec_family' + + + and em.location_id = any (array + + #{listItem} + + ) + + ), + distinct_family_event as ( + select + fe.provider_id, + fe.location_id, + fe.event_date, + fe.entity_type, + fe.event_type, + cm.relational_id, + cm.base_entity_id, + cm.unique_id, + cm.first_name family_first_name, + cm.last_name family_last_name + from + family_event fe + join core.client_metadata cm + using(base_entity_id) + where + fe.id = fe.last_id ) , + + family_head as ( + select + cm.relational_id family_base_entity_id, + cm.base_entity_id family_head_base_entity_id, + cm.first_name family_head_first_name, + cm.last_name family_head_last_name + from + core.client_metadata cm + where + cm.base_entity_id = any ( + select + relational_id + from + distinct_family_event) ) + , + + + family_head_event as ( + select + e.json ejson, + em.base_entity_id, + em.id, + max(em.id) over(partition by em.base_entity_id) last_id + from + core.event_metadata em + join core."event" e on + em.id = e.id + where + em.base_entity_id = any ( + select + family_head_base_entity_id + from + family_head ) ) + , + + family_head_last_event as ( + select + id, + ejson, + base_entity_id + from + family_head_event fhe + where + id = last_id ), + obs as ( + select + id, + base_entity_id, + jsonb_array_elements(ejson->'obs') o + from + family_head_last_event ) + , + + phoneNumber as( + select + id, + max(base_entity_id) base_entity_id, + max(o->'values'->>0) filter( + where + (o->>'formSubmissionField') = 'phone_number') phone_number + from + obs + group by + id) + , + + family_and_family_head_and_phone as( + select + pn.phone_number, + dfe.family_first_name, + dfe.family_last_name , + dfe.base_entity_id, + dfe.unique_id, + fh.family_head_first_name, + fh.family_head_last_name, + fh.family_head_base_entity_id relational_id , + concat(fh.family_head_first_name, ' ', fh.family_head_last_name) as family_head, + dfe.provider_id, + dfe.location_id + from + family_head fh + join distinct_family_event dfe on + fh.family_head_base_entity_id = dfe.relational_id + join phoneNumber pn on + fh.family_head_base_entity_id = pn.base_entity_id + + + + + + + + ), + + member_count as ( + select + relational_id, + count(*) as member_count + from + core.client_metadata cm + where + relational_id = any ( + select + base_entity_id + from + family_and_family_head_and_phone) + group by + relational_id ), + + family_and_family_head_and_phone_member_count as( + select + ffhp.*, + member_count, + c."json", + c."json"->>'dateCreated' , + c.date_deleted, + c.id + + from + family_and_family_head_and_phone ffhp + join member_count mc on ffhp.base_entity_id = mc.relational_id + join core.client c on c."json"->>'baseEntityId' = ffhp.base_entity_id + ) + + + + + + + + + + + + + + + + + + + + + and ( cm.first_name ilike #{name} or + cm.middle_name ilike #{name} or + cm.last_name ilike #{name} or + cm.unique_id ilike #{name} + ) + + + + and em.entity_type != #{clientBean.clientType,jdbcType=VARCHAR} + + + + and c.json->>'gender' = #{clientBean.gender,jdbcType=VARCHAR} + + - - - - - - - - - - - - - - and address ->> 'addressType' = #{addressBean.addressType,jdbcType=VARCHAR} - - - and address ->'addressFields' ->> 'country' = #{addressBean.country,jdbcType=VARCHAR} - - - and address ->'addressFields' ->> 'stateProvince' = #{addressBean.stateProvince,jdbcType=VARCHAR} - - - and address ->'addressFields' ->> 'cityVillage' = #{addressBean.cityVillage,jdbcType=VARCHAR} - - - and address ->'addressFields' ->> 'countyDistrict' = #{addressBean.countyDistrict,jdbcType=VARCHAR} - - - and address ->'addressFields' ->> 'town' = #{addressBean.town,jdbcType=VARCHAR} - - - and address ->'addressFields' ->> 'subTown' = #{addressBean.subTown,jdbcType=VARCHAR} - - - and address ->'addressFields' ->> 'subTown' = #{addressBean.subTown,jdbcType=VARCHAR} - - - - - - and ( cm.first_name ilike #{name} or - cm.middle_name ilike #{name} or - cm.last_name ilike #{name} or - cm.unique_id ilike #{name} or - c.json -> 'attributes' ->> 'phoneNumber' ilike #{name} - - or - em.provider_id ilike #{name} - - ) - - - - and em.entity_type = #{clientBean.clientType,jdbcType=VARCHAR} - - - - and em.provider_id = #{clientBean.providerId,jdbcType=VARCHAR} - - - and c.json->>'gender' = #{clientBean.gender,jdbcType=VARCHAR} - - - and cm.birth_date - between #{clientBean.birthdateFrom,typeHandler=org.opensrp.repository.postgres.handler.DateTimeTypeHandler} - and #{clientBean.birthdateTo,typeHandler=org.opensrp.repository.postgres.handler.DateTimeTypeHandler} - - - and (json->>'deathdate')::date - between #{clientBean.deathdateFrom,typeHandler=org.opensrp.repository.postgres.handler.DateTimeTypeHandler} - and #{clientBean.deathdateTo,typeHandler=org.opensrp.repository.postgres.handler.DateTimeTypeHandler} - - - and json -> 'attributes' ->> #{clientBean.attributeType,jdbcType=VARCHAR} = #{clientBean.attributeValue,jdbcType=VARCHAR} - - - and (json->>'dateEdited')::timestamp - between #{clientBean.lastEditFrom,typeHandler=org.opensrp.repository.postgres.handler.DateTimeTypeHandler} - and #{clientBean.lastEditTo,typeHandler=org.opensrp.repository.postgres.handler.DateTimeTypeHandler} - - - - - and c.json->>'firstName' ilike #{firstName} - - - - and c.json->>'middleName' ilike #{middleName} - - - - and c.json->>'lastName' ilike #{lastName} - - - and c.json->>'lastName' != #{clientBean.lastNameNot,jdbcType=VARCHAR} - - - - - json -> 'identifiers' ->> #{key,jdbcType=VARCHAR} = #{value,jdbcType=VARCHAR} - - - - - - - json -> 'attributes' ->> #{key,jdbcType=VARCHAR} = #{value,jdbcType=VARCHAR} - - - - - - - - - - - - - and ( family_first_name ilike #{name} or - family_head_first_name ilike #{name} or - family_head_last_name ilike #{name} or - phone_number ilike #{name} or - provider_id ilike #{name} or - unique_id ilike #{name} - ) - - - - with family_event as ( - select - em.*, - max(em.id) over(partition by em.base_entity_id) last_id - from - core.event_metadata em - where - em.entity_type = 'ec_family' - - - and em.location_id = any (array - - #{listItem} - - ) - - ), - distinct_family_event as ( - select - fe.provider_id, - fe.location_id, - fe.event_date, - fe.entity_type, - fe.event_type, - cm.relational_id, - cm.base_entity_id, - cm.unique_id, - cm.first_name family_first_name, - cm.last_name family_last_name - from - family_event fe - join core.client_metadata cm - using(base_entity_id) - where - fe.id = fe.last_id ) , - - family_head as ( - select - cm.relational_id family_base_entity_id, - cm.base_entity_id family_head_base_entity_id, - cm.first_name family_head_first_name, - cm.last_name family_head_last_name - from - core.client_metadata cm - where - cm.base_entity_id = any ( - select - relational_id - from - distinct_family_event) ) - , - - - family_head_event as ( - select - e.json ejson, - em.base_entity_id, - em.id, - max(em.id) over(partition by em.base_entity_id) last_id - from - core.event_metadata em - join core."event" e on - em.id = e.id - where - em.base_entity_id = any ( - select - family_head_base_entity_id - from - family_head ) ) - , - - family_head_last_event as ( - select - id, - ejson, - base_entity_id - from - family_head_event fhe - where - id = last_id ), - obs as ( - select - id, - base_entity_id, - jsonb_array_elements(ejson->'obs') o - from - family_head_last_event ) - , - - phoneNumber as( - select - id, - max(base_entity_id) base_entity_id, - max(o->'values'->>0) filter( - where - (o->>'formSubmissionField') = 'phone_number') phone_number - from - obs - group by - id) - , - - family_and_family_head_and_phone as( - select - pn.phone_number, - dfe.family_first_name, - dfe.family_last_name , - dfe.base_entity_id, - dfe.unique_id, - fh.family_head_first_name, - fh.family_head_last_name, - fh.family_head_base_entity_id relational_id , - concat(fh.family_head_first_name, ' ', fh.family_head_last_name) as family_head, - dfe.provider_id, - dfe.location_id - from - family_head fh - join distinct_family_event dfe on - fh.family_head_base_entity_id = dfe.relational_id - join phoneNumber pn on - fh.family_head_base_entity_id = pn.base_entity_id - - - - - - - - ), - - member_count as ( - select - relational_id, - count(*) as member_count - from - core.client_metadata cm - where - relational_id = any ( - select - base_entity_id - from - family_and_family_head_and_phone) - group by - relational_id ), - - family_and_family_head_and_phone_member_count as( - select - ffhp.*, - member_count, - c."json", - c."json"->>'dateCreated' , - c.date_deleted, - c.id - - from - family_and_family_head_and_phone ffhp - join member_count mc on ffhp.base_entity_id = mc.relational_id - join core.client c on c."json"->>'baseEntityId' = ffhp.base_entity_id - ) - - - - - - - - - - - - - - - - - - - - - and ( cm.first_name ilike #{name} or - cm.middle_name ilike #{name} or - cm.last_name ilike #{name} or - cm.unique_id ilike #{name} - ) - - - - and em.entity_type != #{clientBean.clientType,jdbcType=VARCHAR} - - - - and c.json->>'gender' = #{clientBean.gender,jdbcType=VARCHAR} - - - - - - - and ( cm.first_name ilike #{name} or - cm.middle_name ilike #{name} or - cm.last_name ilike #{name} or - fh.family_head ilike #{name} or - cm.unique_id ilike #{name} - ) - - - - and cm.gender = #{clientBean.gender,jdbcType=VARCHAR} - - - - - with anc_event as( - select - e.json, - em.event_type, - em.location_id, - em.provider_id, - em.event_date, - em.base_entity_id, - em.id, - max(em.id) over(partition by em.base_entity_id) last_id - from - core.event_metadata em - join core."event" e on - em.id = e.id - where - (em.event_type = 'Update ANC Registration' - or em.event_type = 'ANC Registration') - - and em.location_id = any (array - - #{listItem} - - ) - - ) - , - last_anc_event as ( - select - em.id, - em.last_id, - cm.base_entity_id, - em.event_type, - cm.first_name, - cm.last_name, - cm.middle_name, - cm.unique_id, - cm.relational_id, - cm.birth_date, - em.json as ejson , - em.provider_id, - em.event_date, - em.location_id - from - anc_event em - join core.client_metadata cm on - em.base_entity_id = cm.base_entity_id - where - em.id = em.last_id ), - anc_event_client as ( - select - c.json, - c.id, - ce.ejson , - ce.base_entity_id, - ce.provider_id, - ce.event_date, - ce.location_id, - ce.relational_id, - extract(year - from - age(current_date, ce.birth_date)) :: int as age_year_part, - extract(month - from - age(current_date, ce.birth_date)) :: int as age_month_part, - ce.first_name, - ce.unique_id, - ce.middle_name, - ce.last_name - from - last_anc_event ce - join core.client as c on - c.json->>'baseEntityId' = ce.base_entity_id ), - obs as( - select - id, - jsonb_array_elements(ejson->'obs') o - from - anc_event_client ) , - last_obs as( - select - id, - max(to_date((o->'values'->>0), 'dd-mm-yyyy')) filter( - where - (o->>'formSubmissionField') = 'edd_note') edd, - max(to_date((o->'values'->>0), 'dd-mm-yyyy')) filter( - where - (o->>'formSubmissionField') = 'last_menstrual_period') lmp, - max(floor(extract(days from (now() - to_date((o->'values'->>0), 'dd-mm-yyyy') )) / 7)) filter( - where - (o->>'formSubmissionField') = 'last_menstrual_period' ) gestAge - from - obs - group by - id), - family_head as ( - select - cm.base_entity_id, - concat(cm.first_name, ' ', cm.last_name) as family_head - from - core.client_metadata cm - where - cm.base_entity_id = any ( - select - relational_id - from - anc_event_client) ), - anc_list as ( - select - cl.first_name, - cl.last_name, - cl.middle_name, - cl.unique_id, - cl.age_year_part, - cl.age_month_part, - cl.relational_id, - cl.event_date last_contact_date, - cl.provider_id, - cl.json , - edd, - coalesce(lmp,(edd- interval '180 DAY')::date) as lmp, - coalesce(gestAge, floor(extract(days from(now()-(edd- interval '180 DAY')::date))/ 7)) gestational_age - from - last_obs, - anc_event_client as cl - where - last_obs.id = cl.id - - and Date(edd) between '${clientBean.startDate}' and '${clientBean.endDate}' - - - ) - - - - - with child_event as( - select - e.json, - em.event_type, - em.location_id, - em.provider_id, - em.event_date, - em.base_entity_id, - em.id, - max(em.id) over(partition by em.base_entity_id) last_id - from - core.event_metadata em - join core."event" e on - em.id = e.id - where - (em.event_type = 'Child Registration' - or em.event_type = 'Update Child Registration' - or em.event_type = 'PNC Child Registration') - - and em.location_id = any (array - - #{listItem} - - ) - - ), - last_event as( - select - ce.id, - ce.last_id, - cm.base_entity_id, - ce.event_type, - cm.first_name, - cm.unique_id, - cm.last_name, - cm.middle_name, - cm.relational_id, - cm.birth_date, - ce.json as ejson , - ce.provider_id, - ce.event_date, - ce.location_id - from - child_event ce - join core.client_metadata cm on - ce.base_entity_id = cm.base_entity_id - where - ce.id = ce.last_id ) , - child_client as ( - select - c.json, - c.id, - le.provider_id, - le.event_date last_contact_date, - le.location_id, - le.base_entity_id, - le.first_name, - le.last_name, - le.middle_name, - le.birth_date, - le.unique_id, - le.relational_id, - c."json"->>'gender' gender, - extract(year - from - age(current_date, le.birth_date)) :: int as age_year_part , - extract(month - from - age(current_date, le.birth_date)) :: int as age_month_part , - extract(day - from - age(current_date, le.birth_date)) :: int as day , - (date_part('day', current_date::timestamp - le.birth_date::timestamp))/ 365.25 years - from - last_event le - join core.client as c on - c.json->>'baseEntityId' = le.base_entity_id ), - family_head as ( - select - cm.base_entity_id, - concat(cm.first_name, ' ', cm.last_name) as family_head - from - core.client_metadata cm - where - cm.base_entity_id = any ( - select - relational_id - from - child_client) ) - - - - - - - - - - - - - - - - + + + + and ( cm.first_name ilike #{name} or + cm.middle_name ilike #{name} or + cm.last_name ilike #{name} or + fh.family_head ilike #{name} or + cm.unique_id ilike #{name} + ) + + + + and cm.gender = #{clientBean.gender,jdbcType=VARCHAR} + + + + + with anc_event as( + select + e.json, + em.event_type, + em.location_id, + em.provider_id, + em.event_date, + em.base_entity_id, + em.id, + max(em.id) over(partition by em.base_entity_id) last_id + from + core.event_metadata em + join core."event" e on + em.id = e.id + where + (em.event_type = 'Update ANC Registration' + or em.event_type = 'ANC Registration') + + and em.location_id = any (array + + #{listItem} + + ) + + ) + , + last_anc_event as ( + select + em.id, + em.last_id, + cm.base_entity_id, + em.event_type, + cm.first_name, + cm.last_name, + cm.middle_name, + cm.unique_id, + cm.relational_id, + cm.birth_date, + em.json as ejson , + em.provider_id, + em.event_date, + em.location_id + from + anc_event em + join core.client_metadata cm on + em.base_entity_id = cm.base_entity_id + where + em.id = em.last_id ), + anc_event_client as ( + select + c.json, + c.id, + ce.ejson , + ce.base_entity_id, + ce.provider_id, + ce.event_date, + ce.location_id, + ce.relational_id, + extract(year + from + age(current_date, ce.birth_date)) :: int as age_year_part, + extract(month + from + age(current_date, ce.birth_date)) :: int as age_month_part, + ce.first_name, + ce.unique_id, + ce.middle_name, + ce.last_name + from + last_anc_event ce + join core.client as c on + c.json->>'baseEntityId' = ce.base_entity_id ), + obs as( + select + id, + jsonb_array_elements(ejson->'obs') o + from + anc_event_client ) , + last_obs as( + select + id, + max(to_date((o->'values'->>0), 'dd-mm-yyyy')) filter( + where + (o->>'formSubmissionField') = 'edd_note') edd, + max(to_date((o->'values'->>0), 'dd-mm-yyyy')) filter( + where + (o->>'formSubmissionField') = 'last_menstrual_period') lmp, + max(floor(extract(days from (now() - to_date((o->'values'->>0), 'dd-mm-yyyy') )) / 7)) filter( + where + (o->>'formSubmissionField') = 'last_menstrual_period' ) gestAge + from + obs + group by + id), + family_head as ( + select + cm.base_entity_id, + concat(cm.first_name, ' ', cm.last_name) as family_head + from + core.client_metadata cm + where + cm.base_entity_id = any ( + select + relational_id + from + anc_event_client) ), + anc_list as ( + select + cl.first_name, + cl.last_name, + cl.middle_name, + cl.unique_id, + cl.age_year_part, + cl.age_month_part, + cl.relational_id, + cl.event_date last_contact_date, + cl.provider_id, + cl.json , + edd, + coalesce(lmp,(edd- interval '180 DAY')::date) as lmp, + coalesce(gestAge, floor(extract(days from(now()-(edd- interval '180 DAY')::date))/ 7)) gestational_age + from + last_obs, + anc_event_client as cl + where + last_obs.id = cl.id + + and Date(edd) between '${clientBean.startDate}' and '${clientBean.endDate}' + + + ) + + + + + with child_event as( + select + e.json, + em.event_type, + em.location_id, + em.provider_id, + em.event_date, + em.base_entity_id, + em.id, + max(em.id) over(partition by em.base_entity_id) last_id + from + core.event_metadata em + join core."event" e on + em.id = e.id + where + (em.event_type = 'Child Registration' + or em.event_type = 'Update Child Registration' + or em.event_type = 'PNC Child Registration') + + and em.location_id = any (array + + #{listItem} + + ) + + ), + last_event as( + select + ce.id, + ce.last_id, + cm.base_entity_id, + ce.event_type, + cm.first_name, + cm.unique_id, + cm.last_name, + cm.middle_name, + cm.relational_id, + cm.birth_date, + ce.json as ejson , + ce.provider_id, + ce.event_date, + ce.location_id + from + child_event ce + join core.client_metadata cm on + ce.base_entity_id = cm.base_entity_id + where + ce.id = ce.last_id ) , + child_client as ( + select + c.json, + c.id, + le.provider_id, + le.event_date last_contact_date, + le.location_id, + le.base_entity_id, + le.first_name, + le.last_name, + le.middle_name, + le.birth_date, + le.unique_id, + le.relational_id, + c."json"->>'gender' gender, + extract(year + from + age(current_date, le.birth_date)) :: int as age_year_part , + extract(month + from + age(current_date, le.birth_date)) :: int as age_month_part , + extract(day + from + age(current_date, le.birth_date)) :: int as day , + (date_part('day', current_date::timestamp - le.birth_date::timestamp))/ 365.25 years + from + last_event le + join core.client as c on + c.json->>'baseEntityId' = le.base_entity_id ), + family_head as ( + select + cm.base_entity_id, + concat(cm.first_name, ' ', cm.last_name) as family_head + from + core.client_metadata cm + where + cm.base_entity_id = any ( + select + relational_id + from + child_client) ) + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientMigrationFileMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientMigrationFileMapper.xml index c03c6cacf..def400ad3 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientMigrationFileMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomClientMigrationFileMapper.xml @@ -80,7 +80,8 @@ - SELECT FROM core.client_migration_file ORDER BY created_at LIMIT #{batchSize} OFFSET #{offset} diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomErrorTraceMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomErrorTraceMapper.xml index c54e82f5c..fb90070e7 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomErrorTraceMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomErrorTraceMapper.xml @@ -1,53 +1,54 @@ - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + namespace="org.opensrp.repository.postgres.mapper.custom.CustomErrorTraceMapper"> + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + - select - - distinct - - - from error.error_trace - - - - - order by ${example.orderByClause} - - LIMIT #{limit} OFFSET #{offset} - + + from error.error_trace + + + + + order by ${example.orderByClause} + + LIMIT #{limit} OFFSET #{offset} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomEventMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomEventMapper.xml index df450ee58..e6f5aa837 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomEventMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomEventMapper.xml @@ -1,138 +1,138 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomEventMapper"> - - - - + + + + - - id, json - + + id, json + - + - - insert into core.event - - - id, - - - json, - - server_version - - - - #{id,jdbcType=BIGINT}, - - - #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler}, - - nextVal('core.event_server_version_seq') - - - - update core.event - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler}, - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - server_version = nextVal('core.event_server_version_seq') - where id = #{id,jdbcType=BIGINT} - + + insert into core.event + + + id, + + + json, + + server_version + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler}, + + nextVal('core.event_server_version_seq') + + + + update core.event + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler}, + date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, + server_version = nextVal('core.event_server_version_seq') + where id = #{id,jdbcType=BIGINT} + - - - - - - - - - - - + - + + + + + + + + + + + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomEventMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomEventMetadataMapper.xml index 6cd6d39e7..e7a987038 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomEventMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomEventMetadataMapper.xml @@ -1,203 +1,203 @@ - - - - - - - - e.id, e.json - - - - - - - - - - - and em.${criterion.condition} - - - and em.${criterion.condition} #{criterion.value} - - - and em.${criterion.condition} #{criterion.value} - and - #{criterion.secondValue} - - - and em.${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - and em.${criterion.condition} - - - and em.${criterion.condition} #{criterion.value} - - - and em.${criterion.condition} #{criterion.value} - and - #{criterion.secondValue} - - - and em.${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + namespace="org.opensrp.repository.postgres.mapper.custom.CustomEventMetadataMapper"> + + + + + + + + e.id, e.json + + + + + + + + + + + and em.${criterion.condition} + + + and em.${criterion.condition} #{criterion.value} + + + and em.${criterion.condition} #{criterion.value} + and + #{criterion.secondValue} + + + and em.${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and em.${criterion.condition} + + + and em.${criterion.condition} #{criterion.value} + + + and em.${criterion.condition} #{criterion.value} + and + #{criterion.secondValue} + + + and em.${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomIdentifierSourceMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomIdentifierSourceMapper.xml index b523226c8..402250e6c 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomIdentifierSourceMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomIdentifierSourceMapper.xml @@ -1,160 +1,159 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomIdentifierSourceMapper"> - - i.id, i.identifier, i.description, i.identifier_validator_algorithm, i.base_character_set, - i.first_identifier_base, i.prefix, i.suffix, i.min_length, i.max_length, i.regex_format , i.sequence_value - + + i.id, i.identifier, i.description, i.identifier_validator_algorithm, i.base_character_set, + i.first_identifier_base, i.prefix, i.suffix, i.min_length, i.max_length, i.regex_format , i.sequence_value + - - from core.identifier_source i - + + from core.identifier_source i + - - - - - - - - - and i.${criterion.condition} - - - and i.${criterion.condition} #{criterion.value} - - - and i.${criterion.condition} #{criterion.value} - and - #{criterion.secondValue} - - - and i.${criterion.condition} - - #{listItem} - - - - - - - - - + + + + + + + + + and i.${criterion.condition} + + + and i.${criterion.condition} #{criterion.value} + + + and i.${criterion.condition} #{criterion.value} + and + #{criterion.secondValue} + + + and i.${criterion.condition} + + #{listItem} + + + + + + + + + - - - + - + - - insert into core.identifier_source - - - id, - - - identifier, - - - description, - - - identifier_validator_algorithm, - - - base_character_set, - - - first_identifier_base, - - - prefix, - - - suffix, - - - min_length, - - - max_length, - - - regex_format, - - - - - #{id,jdbcType=BIGINT}, - - - #{identifier,jdbcType=VARCHAR}, - - - #{description,jdbcType=VARCHAR}, - - - #{identifierValidatorAlgorithm,jdbcType=VARCHAR}, - - - #{baseCharacterSet,jdbcType=VARCHAR}, - - - #{firstIdentifierBase,jdbcType=VARCHAR}, - - - #{prefix,jdbcType=VARCHAR}, - - - #{suffix,jdbcType=VARCHAR}, - - - #{minLength,jdbcType=INTEGER}, - - - #{maxLength,jdbcType=INTEGER}, - - - #{regexFormat,jdbcType=VARCHAR}, - - - + + + insert into core.identifier_source + + + id, + + + identifier, + + + description, + + + identifier_validator_algorithm, + + + base_character_set, + + + first_identifier_base, + + + prefix, + + + suffix, + + + min_length, + + + max_length, + + + regex_format, + + + + + #{id,jdbcType=BIGINT}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{identifierValidatorAlgorithm,jdbcType=VARCHAR}, + + + #{baseCharacterSet,jdbcType=VARCHAR}, + + + #{firstIdentifierBase,jdbcType=VARCHAR}, + + + #{prefix,jdbcType=VARCHAR}, + + + #{suffix,jdbcType=VARCHAR}, + + + #{minLength,jdbcType=INTEGER}, + + + #{maxLength,jdbcType=INTEGER}, + + + #{regexFormat,jdbcType=VARCHAR}, + + + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomLocationMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomLocationMapper.xml index 184c35a90..e0e43b514 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomLocationMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomLocationMapper.xml @@ -1,44 +1,44 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomLocationMapper"> - - - insert into core.location - - - id, - - - json, - - server_version - - - - #{id,jdbcType=BIGINT}, - - - #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - - nextVal('core.location_server_version_seq') - - - - - update core.location - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - server_version=nextVal('core.location_server_version_seq') - where id = #{id,jdbcType=BIGINT} - + + insert into core.location + + + id, + + + json, + + server_version + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, + + nextVal('core.location_server_version_seq') + + + + + update core.location + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, + server_version=nextVal('core.location_server_version_seq') + where id = #{id,jdbcType=BIGINT} + + + + - - diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomLocationMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomLocationMetadataMapper.xml index 5f99cd8f9..cf30cfc9f 100755 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomLocationMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomLocationMetadataMapper.xml @@ -1,415 +1,422 @@ - - - l.id, l.json - - - - l.id, l.json - 'geometry' as json - - - - - - - - - - - - - - and lm.${criterion.condition} - - - and lm.${criterion.condition} #{criterion.value} - - - and lm.${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and lm.${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - lm.name ilike '%${locationSearchBean.name}%' - - - and ltm.location_tag_id = #{locationSearchBean.locationTagId} - - - and lm.parent_id::bigint = #{locationSearchBean.parentId} - - - and lm.status = #{locationSearchBean.status} - - - - - - from - core.location as l - join core.location_metadata as lm on - l.id = lm.location_id - left join core.location_metadata as plm on - lm.parent_id::bigint = plm.location_id - inner join core.location_tag_map as ltm on - lm.location_id = ltm.location_id - inner join core.location_tag lt on - lt.id = ltm.location_tag_id - - + namespace="org.opensrp.repository.postgres.mapper.custom.CustomLocationMetadataMapper"> + + + l.id, l.json + + + + l.id, l.json - 'geometry' as json + + + + + + + + + + + + + + and lm.${criterion.condition} + + + and lm.${criterion.condition} #{criterion.value} + + + and lm.${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and lm.${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lm.name ilike '%${locationSearchBean.name}%' + + + and ltm.location_tag_id = #{locationSearchBean.locationTagId} + + + and lm.parent_id::bigint = #{locationSearchBean.parentId} + + + and lm.status = #{locationSearchBean.status} + + + + + + from + core.location as l + join core.location_metadata as lm on + l.id = lm.location_id + left join core.location_metadata as plm on + lm.parent_id::bigint = plm.location_id + inner join core.location_tag_map as ltm on + lm.location_id = ltm.location_id + inner join core.location_tag lt on + lt.id = ltm.location_tag_id + + - + + + - - - - - + + + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomLocationTagMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomLocationTagMapper.xml index 9706431d9..ed2721aa8 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomLocationTagMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomLocationTagMapper.xml @@ -20,7 +20,8 @@ and ${criterion.condition} - + #{listItem} @@ -36,10 +37,10 @@ resultMap="org.opensrp.repository.postgres.mapper.LocationTagMapper.BaseResultMap"> select + refid="org.opensrp.repository.postgres.mapper.LocationTagMapper.Base_Column_List"/> from core.location_tag - + order by p.${example.orderByClause} @@ -47,6 +48,5 @@ LIMIT #{limit} OFFSET #{offset} - \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomManifestMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomManifestMapper.xml index 9b4d52b7b..22ed29a20 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomManifestMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomManifestMapper.xml @@ -110,7 +110,7 @@ @@ -136,7 +136,7 @@ ORDER BY app_version DESC, created_at DESC LIMIT 10 - - select - - distinct - - - from core.multi_media - - - - - order by ${orderByClause} - - LIMIT #{limit} OFFSET #{offset} - + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomOrganizationLocationMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomOrganizationLocationMapper.xml index a1e25de1a..9eda15d5b 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomOrganizationLocationMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomOrganizationLocationMapper.xml @@ -1,59 +1,60 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomOrganizationLocationMapper"> - - - - - - + + + + + + - - - - p.identifier,l.geojson_id,ol.from_date,ol.to_date, org.identifier as org_identifier + + + + p.identifier,l.geojson_id,ol.from_date,ol.to_date, org.identifier as org_identifier - - - - - + + + + + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomOrganizationMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomOrganizationMapper.xml index 451d8db72..734021e1a 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomOrganizationMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomOrganizationMapper.xml @@ -1,153 +1,162 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomOrganizationMapper"> - + - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} - - - - - + + + + + + + + + + + + + + + from team.organization as o + left join team.practitioner_role as pr on o.id = pr.organization_id + left join team.organization_location ol on ol.organization_id =o.id + + o.date_deleted is null + + + and o."name" ilike #{name} + + + and ol.location_id in + + #{listItem} + + + + + + - select o.id,o.identifier,o."name",o."type",o.parent_id,count(distinct(pr.id))as member_count - - group by o.id,o.identifier,o."name",o."type",o.parent_id - - order by ${searchBean.orderByFieldName} ${searchBean.orderByType} - - LIMIT #{limit} OFFSET #{offset} - - + LIMIT #{limit} OFFSET #{offset} + + + + + insert into team.organization @@ -212,7 +221,8 @@ nextVal('team.organization_server_version_seq') - + update team.organization diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomPlanMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomPlanMapper.xml index 4033c8969..239179b8f 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomPlanMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomPlanMapper.xml @@ -1,199 +1,199 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomPlanMapper"> - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} - and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} + and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + - + - + - - insert into core.plan - - - id, - - - identifier, - - - json, - - - date_deleted, - - server_version, - - experimental, - - - - - #{id,jdbcType=BIGINT}, - - - #{identifier,jdbcType=VARCHAR}, - - - #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler}, - - - #{dateDeleted,jdbcType=TIMESTAMP}, - - nextVal('core.plan_server_version_seq'), - - #{experimental,jdbcType=BIT}, - - - + + insert into core.plan + + + id, + + + identifier, + + + json, + + + date_deleted, + + server_version, + + experimental, + + + + + #{id,jdbcType=BIGINT}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler}, + + + #{dateDeleted,jdbcType=TIMESTAMP}, + + nextVal('core.plan_server_version_seq'), + + #{experimental,jdbcType=BIT}, + + + - + - + - - - - update core.plan - set identifier = #{identifier,jdbcType=VARCHAR}, - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler}, - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - server_version = nextVal('core.plan_server_version_seq'), - experimental = #{experimental,jdbcType=BIT}, - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{dateEdited,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - - + + + + update core.plan + set identifier = #{identifier,jdbcType=VARCHAR}, + json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler}, + date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, + server_version = nextVal('core.plan_server_version_seq'), + experimental = #{experimental,jdbcType=BIT}, + date_created = #{dateCreated,jdbcType=TIMESTAMP}, + date_edited = #{dateEdited,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomPlanMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomPlanMetadataMapper.xml index 7eb3dc98b..8bfc13fe7 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomPlanMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomPlanMetadataMapper.xml @@ -9,50 +9,53 @@ - - - - - - - and p.${criterion.condition} - - - and p.${criterion.condition} #{criterion.value} - - - and p.${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and p.${criterion.condition} - - #{listItem} - - - - - - - + + + + + + + and p.${criterion.condition} + + + and p.${criterion.condition} #{criterion.value} + + + and p.${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and p.${criterion.condition} + + #{listItem} + + + + + + + select - - + + - + - - update core.product_catalogue - set product_name = #{productName,jdbcType=VARCHAR}, - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler}, - server_version = nextVal('core.product_catalogue_server_version_seq') - where unique_id = #{uniqueId,jdbcType=BIGINT} - - + + update core.product_catalogue + set product_name = #{productName,jdbcType=VARCHAR}, + json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler}, + server_version = nextVal('core.product_catalogue_server_version_seq') + where unique_id = #{uniqueId,jdbcType=BIGINT} + + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomReportMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomReportMapper.xml index fc89284d7..3a4cd8c50 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomReportMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomReportMapper.xml @@ -1,54 +1,54 @@ - - insert into core.report - - - id, - - - json, - - server_version - - - - #{id,jdbcType=BIGINT}, - - - #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler}, - - nextVal('core.report_server_version_seq') - - + namespace="org.opensrp.repository.postgres.mapper.custom.CustomReportMapper"> + + insert into core.report + + + id, + + + json, + + server_version + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler}, + + nextVal('core.report_server_version_seq') + + - - - update core.report - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler}, - server_version = nextVal('core.report_server_version_seq') - where id = #{id,jdbcType=BIGINT} - + + + update core.report + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler}, + server_version = nextVal('core.report_server_version_seq') + where id = #{id,jdbcType=BIGINT} + - + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomReportMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomReportMetadataMapper.xml index a25aa8206..0cd0f4ead 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomReportMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomReportMetadataMapper.xml @@ -1,72 +1,72 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomReportMetadataMapper"> - - r.id, r.json - - - - from core.report_metadata rm - join core.report r on rm.report_id = r.id - + + r.id, r.json + - - - - - - - - - - - - and rm.${criterion.condition} - - - and rm.${criterion.condition} #{criterion.value} - - - and rm.${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and rm.${criterion.condition} - - #{listItem} - - - - - - - - - - - + + from core.report_metadata rm + join core.report r on rm.report_id = r.id + + + + + + + + + + + + + + and rm.${criterion.condition} + + + and rm.${criterion.condition} #{criterion.value} + + + and rm.${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and rm.${criterion.condition} + + #{listItem} + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomSettingsMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomSettingsMapper.xml index 930f64e17..d6f89ff70 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomSettingsMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomSettingsMapper.xml @@ -1,40 +1,40 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomSettingMapper"> - - insert into core.settings - - - id, - - - json, - - server_version - - - - #{id,jdbcType=BIGINT}, - - - #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler}, - - nextVal('core.setting_server_version_seq') - - - - - update core.settings - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler}, - server_version = nextVal('core.setting_server_version_seq') - where id = #{id,jdbcType=BIGINT} - - + + insert into core.settings + + + id, + + + json, + + server_version + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler}, + + nextVal('core.setting_server_version_seq') + + + + + update core.settings + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler}, + server_version = nextVal('core.setting_server_version_seq') + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomSettingsMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomSettingsMetadataMapper.xml index 9e370f062..d725606e6 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomSettingsMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomSettingsMetadataMapper.xml @@ -1,168 +1,172 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomSettingMetadataMapper"> - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - s.json as settings_configuration_json, sm.id as settings_metadata_id, sm.json as settings_metadata_configuration_json, sm.* - + + s.json as settings_configuration_json, sm.id as settings_metadata_id, sm.json as + settings_metadata_configuration_json, sm.* + - - FROM core.settings_metadata sm - JOIN core.settings s ON - sm.settings_id = s.id - + + FROM core.settings_metadata sm + JOIN core.settings s ON + sm.settings_id = s.id + - + select + + - where sm.document_id = #{documentId,jdbcType=VARCHAR} - + where sm.document_id = #{documentId,jdbcType=VARCHAR} + - - - - - - - - - and sm.${criterion.condition} - - - and sm.${criterion.condition} #{criterion.value} - - - and sm.${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and sm.${criterion.condition} - - #{listItem} - - - - - - - - - + + + + + + + + + and sm.${criterion.condition} + + + and sm.${criterion.condition} #{criterion.value} + + + and sm.${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and sm.${criterion.condition} + + #{listItem} + + + + + + + + + - - INSERT INTO core.settings_metadata ( - settings_id, - document_id, - identifier, - server_version, - team, - team_id, - provider_id, - location_id, - uuid, - json, - setting_type, - setting_value, - setting_key, - setting_description, - setting_label, - inherited_from, - metadata_version - ) VALUES - - ( - #{setting.settingsId,jdbcType=BIGINT}, - #{setting.documentId,jdbcType=VARCHAR}, - #{setting.identifier,jdbcType=VARCHAR}, - #{setting.serverVersion,jdbcType=BIGINT}, - #{setting.team,jdbcType=VARCHAR}, - #{setting.teamId,jdbcType=VARCHAR}, - #{setting.providerId,jdbcType=VARCHAR}, - #{setting.locationId,jdbcType=VARCHAR}, - #{setting.uuid,jdbcType=VARCHAR}, - #{setting.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingMetadataTypeHandler}, - #{setting.settingType,jdbcType=VARCHAR}, - #{setting.settingValue,jdbcType=VARCHAR}, - #{setting.settingKey,jdbcType=VARCHAR}, - #{setting.settingDescription,jdbcType=VARCHAR}, - #{setting.settingLabel,jdbcType=VARCHAR}, - #{setting.inheritedFrom,jdbcType=VARCHAR}, - nextVal('core.setting_metadata_version_seq') - ) - - + + INSERT INTO core.settings_metadata ( + settings_id, + document_id, + identifier, + server_version, + team, + team_id, + provider_id, + location_id, + uuid, + json, + setting_type, + setting_value, + setting_key, + setting_description, + setting_label, + inherited_from, + metadata_version + ) VALUES + + ( + #{setting.settingsId,jdbcType=BIGINT}, + #{setting.documentId,jdbcType=VARCHAR}, + #{setting.identifier,jdbcType=VARCHAR}, + #{setting.serverVersion,jdbcType=BIGINT}, + #{setting.team,jdbcType=VARCHAR}, + #{setting.teamId,jdbcType=VARCHAR}, + #{setting.providerId,jdbcType=VARCHAR}, + #{setting.locationId,jdbcType=VARCHAR}, + #{setting.uuid,jdbcType=VARCHAR}, + #{setting.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingMetadataTypeHandler}, + #{setting.settingType,jdbcType=VARCHAR}, + #{setting.settingValue,jdbcType=VARCHAR}, + #{setting.settingKey,jdbcType=VARCHAR}, + #{setting.settingDescription,jdbcType=VARCHAR}, + #{setting.settingLabel,jdbcType=VARCHAR}, + #{setting.inheritedFrom,jdbcType=VARCHAR}, + nextVal('core.setting_metadata_version_seq') + ) + + - - - UPDATE core.settings_metadata SET - settings_id = #{setting.settingsId}, - document_id = #{setting.documentId}, - identifier = #{setting.identifier}, - server_version = #{setting.serverVersion}, - team = #{setting.team}, - team_id = #{setting.teamId}, - provider_id = #{setting.providerId}, - location_id = #{setting.locationId}, - uuid = #{setting.uuid}, - json = #{setting.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingMetadataTypeHandler}, - setting_type = #{setting.settingType}, - setting_value = #{setting.settingValue}, - setting_key = #{setting.settingKey}, - setting_description = #{setting.settingDescription}, - setting_label = #{setting.settingLabel}, - inherited_from = #{setting.inheritedFrom}, - metadata_version = nextVal('core.setting_metadata_version_seq') - WHERE uuid = #{setting.uuid} - AND setting_key = #{setting.settingKey} - - + + + UPDATE core.settings_metadata SET + settings_id = #{setting.settingsId}, + document_id = #{setting.documentId}, + identifier = #{setting.identifier}, + server_version = #{setting.serverVersion}, + team = #{setting.team}, + team_id = #{setting.teamId}, + provider_id = #{setting.providerId}, + location_id = #{setting.locationId}, + uuid = #{setting.uuid}, + json = + #{setting.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingMetadataTypeHandler}, + setting_type = #{setting.settingType}, + setting_value = #{setting.settingValue}, + setting_key = #{setting.settingKey}, + setting_description = #{setting.settingDescription}, + setting_label = #{setting.settingLabel}, + inherited_from = #{setting.inheritedFrom}, + metadata_version = nextVal('core.setting_metadata_version_seq') + WHERE uuid = #{setting.uuid} + AND setting_key = #{setting.settingKey} + + - + SELECT - - distinct - + + distinct + - - + + - - - + + + - - order by ${example.orderByClause} - + + order by ${example.orderByClause} + - LIMIT #{limit} OFFSET #{offset} - + LIMIT #{limit} OFFSET #{offset} + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStockMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStockMapper.xml index 813a0b234..49d9dcf9b 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStockMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStockMapper.xml @@ -1,65 +1,65 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomStockMapper"> - - id, json - + + id, json + - - from core.identifier_source i - + + from core.identifier_source i + - - insert into core.stock - - - id, - - - json, - - server_version - - - - #{id,jdbcType=BIGINT}, - - - #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler}, - - nextVal('core.stock_server_version_seq') - - + + insert into core.stock + + + id, + + + json, + + server_version + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler}, + + nextVal('core.stock_server_version_seq') + + - - - - update core.stock - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler}, - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - server_version = nextVal('core.stock_server_version_seq') - where id = #{id,jdbcType=BIGINT} - + + + update core.stock + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler}, + date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, + server_version = nextVal('core.stock_server_version_seq') + where id = #{id,jdbcType=BIGINT} + - + + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStockMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStockMetadataMapper.xml index 3a94d45b5..b8f8f4719 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStockMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStockMetadataMapper.xml @@ -1,213 +1,217 @@ - - - - - - - - - - s.id, s.json - - - - stock.id, stock.json , stock.date_deleted, productCatalogue.unique_id, productCatalogue.product_name, productCatalogue.json AS product_catalogue_json, productCatalogue.server_version - - - - from core.stock_metadata sm - join core.stock s on sm.stock_id - = s.id - - - - - sm.date_deleted is null - and (s.json->> 'accountabilityEndDate' is null or s.json->>'accountabilityEndDate' >= #{todayDate,jdbcType=DATE} ) - - - and sm.provider_id = #{searchBean.providerId,jdbcType=VARCHAR} - - - and sm.server_version >= #{searchBean.serverVersion,jdbcType=BIGINT} - - - and s.json->>'identifier' = #{searchBean.identifier,jdbcType=VARCHAR} - - - and s.json->>'vaccine_type_id' = - #{searchBean.stockTypeId,jdbcType=VARCHAR} - - - and s.json->>'transaction_type' = - #{searchBean.transactionType,jdbcType=VARCHAR} - - - and s.json->>'value' = #{searchBean.value,jdbcType=VARCHAR} - - - and s.json->>'date_created' = #{searchBean.dateCreated,jdbcType=VARCHAR} - - - and s.json->>'to_from' = #{searchBean.toFrom,jdbcType=VARCHAR} - - - and s.json->>'date_updated' = #{searchBean.dateUpdated,jdbcType=VARCHAR} - - - and sm.location_id IN - - #{item} - - - - - - - - - - - - - - - - and sm.${criterion.condition} - - - and sm.${criterion.condition} #{criterion.value} - - - and sm.${criterion.condition} #{criterion.value} and - #{criterion.secondValue} - - - and sm.${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - + select + + + where sm.document_id = #{documentId,jdbcType=VARCHAR} + + + + + + + + + + + and sm.${criterion.condition} + + + and sm.${criterion.condition} #{criterion.value} + + + and sm.${criterion.condition} #{criterion.value} and + #{criterion.secondValue} + + + and sm.${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + - + select + from core.stock stock join core.product_catalogue productCatalogue - on - CAST(NULLIF( stock.json->> 'identifier', '') as numeric) = productCatalogue.unique_id - - - - - and stock.json ->> 'locationId' IN - - #{item} - - - - - - - - - + on + CAST(NULLIF( stock.json->> 'identifier', '') as numeric) = productCatalogue.unique_id + + + + + and stock.json ->> 'locationId' IN + + #{item} + + + + + + + + + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStructureMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStructureMapper.xml index 92acd29d9..c253ac619 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStructureMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStructureMapper.xml @@ -1,63 +1,64 @@ - - - - insert into core.structure - - - id, - - - json, - - server_version - - - - #{id,jdbcType=BIGINT}, - - - #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - - nextVal('core.structure_server_version_seq') - - - - - - - - - - - - - - - - - - update core.structure - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - server_version = nextVal('core.structure_server_version_seq') - where id = #{id,jdbcType=BIGINT} + namespace="org.opensrp.repository.postgres.mapper.custom.CustomStructureMapper"> + + + + insert into core.structure + + + id, + + + json, + + server_version + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, + + nextVal('core.structure_server_version_seq') + + + + + + + + + + + + + + + + + + update core.structure + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, + server_version = nextVal('core.structure_server_version_seq') + where id = #{id,jdbcType=BIGINT} - - + + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStructureMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStructureMetadataMapper.xml index 7ee25135b..d2b0955f7 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStructureMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomStructureMetadataMapper.xml @@ -1,264 +1,266 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomStructureMetadataMapper"> - - s.id, s.json - - - - - s.id, s.json - 'geometry' as json - + + s.id, s.json + - + + s.id, s.json - 'geometry' as json + + - - - - + + + + + + + + + and sm.${criterion.condition} + + + and sm.${criterion.condition} #{criterion.value} + + + and sm.${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and sm.${criterion.condition} + + #{listItem} + + + + + + + + + - + - - - - + - SELECT parent_id, count(*) - FROM core.structure_metadata - WHERE parent_id IN - - #{value} - - GROUP BY parent_id - + + + - - - - - - + + + - - - - - - - - - and sm.${criterion.condition} - - - and sm.${criterion.condition} #{criterion.value} - - - and sm.${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and sm.${criterion.condition} - - #{listItem} - - - - - - - - - and - - - - - - - and stock.${criterion.condition} - - - and stock.${criterion.condition} #{criterion.value} - - - and stock.${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and stock.${criterion.condition} - - #{listItem} - - - - - - - - - - + from core.structure_metadata sm + join core.structure s on sm.structure_id = s.id + + + + + + + json -> 'properties' ->> #{propertyName,jdbcType=VARCHAR} = #{propertyValue,jdbcType=VARCHAR} + + + + + order by sm.${example.orderByClause} + + LIMIT #{limit} OFFSET #{offset} + - + select + count(sm.id) + from core.structure_metadata sm + join core.structure s on sm.structure_id = s.id + + + + - - - + - - - + + + + - from core.structure_metadata sm - join core.structure s on sm.structure_id = s.id - left join core.stock stock on sm.geojson_id = stock.json ->> 'locationId' - - - - - - - json -> 'properties' ->> #{propertyName,jdbcType=VARCHAR} = #{propertyValue,jdbcType=VARCHAR} - - - - - order by sm.${example.orderByClause} - - - LIMIT #{limit} - - OFFSET #{offset} - + + + + + + + + + + + + + + + + + + and sm.${criterion.condition} + + + and sm.${criterion.condition} #{criterion.value} + + + and sm.${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and sm.${criterion.condition} + + #{listItem} + + + + + + + + + and + + + + + + + and stock.${criterion.condition} + + + and stock.${criterion.condition} #{criterion.value} + + + and stock.${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and stock.${criterion.condition} + + #{listItem} + + + + + + + + + + + + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomTaskMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomTaskMapper.xml index 1f4e85009..5c0662d2f 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomTaskMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomTaskMapper.xml @@ -1,44 +1,44 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomTaskMapper"> - - - insert into core.task - - - id, - - - json, - - server_version - - - - #{id,jdbcType=BIGINT}, - - - #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler}, - - nextVal('core.task_server_version_seq') - - - - update core.task - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler}, - server_version = nextVal('core.task_server_version_seq') - where id = #{id,jdbcType=BIGINT} - + + insert into core.task + + + id, + + + json, + + server_version + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler}, + + nextVal('core.task_server_version_seq') + + + + update core.task + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler}, + server_version = nextVal('core.task_server_version_seq') + where id = #{id,jdbcType=BIGINT} + + + + - - diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomTaskMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomTaskMetadataMapper.xml index 136d7f3e8..bbdc42037 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomTaskMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomTaskMetadataMapper.xml @@ -1,151 +1,152 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomTaskMetadataMapper"> - - t.id, t.json - + + t.id, t.json + - + - - - - - - - - - and tm.${criterion.condition} - - - and tm.${criterion.condition} #{criterion.value} - - - and tm.${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and tm.${criterion.condition} - - #{listItem} - - - - - - - - - + + + + + + + + + and tm.${criterion.condition} + + + and tm.${criterion.condition} #{criterion.value} + + + and tm.${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and tm.${criterion.condition} + + #{listItem} + + + + + + + + + - + - + - select count(tm.id) from core.task_metadata tm - join core.task t on tm.task_id = t.id - where tm.plan_identifier = #{planIdentifier,jdbcType=VARCHAR} AND - tm.for_entity = #{baseEntityId,jdbcType=VARCHAR} AND - tm.code = #{code,jdbcType=VARCHAR} AND - tm.group_identifier = #{jurisdiction,jdbcType=VARCHAR} AND - t.json ->> 'status' NOT IN - - #{item} - + join core.task t on tm.task_id = t.id + where tm.plan_identifier = #{planIdentifier,jdbcType=VARCHAR} AND + tm.for_entity = #{baseEntityId,jdbcType=VARCHAR} AND + tm.code = #{code,jdbcType=VARCHAR} AND + tm.group_identifier = #{jurisdiction,jdbcType=VARCHAR} AND + t.json ->> 'status' NOT IN + + #{item} + - + - - from core.task_metadata tm - join core.task t on tm.task_id = t.id - - - tm.plan_identifier = #{searchBean.planIdentifier,jdbcType=VARCHAR} - - - and tm.group_identifier IN - - #{item} - - - - and tm.code = #{searchBean.code,jdbcType=VARCHAR} - - - and t.json ->> 'status' = #{searchBean.status,jdbcType=VARCHAR} - - - and t.json ->> 'businessStatus' = #{searchBean.businessStatus,jdbcType=VARCHAR} - - + + from core.task_metadata tm + join core.task t on tm.task_id = t.id + + + tm.plan_identifier = #{searchBean.planIdentifier,jdbcType=VARCHAR} + + + and tm.group_identifier IN + + #{item} + + + + and tm.code = #{searchBean.code,jdbcType=VARCHAR} + + + and t.json ->> 'status' = #{searchBean.status,jdbcType=VARCHAR} + + + and t.json ->> 'businessStatus' = #{searchBean.businessStatus,jdbcType=VARCHAR} + + - + - + - + select count(distinct t.id) + - + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomUniqueIdMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomUniqueIdMapper.xml index e812d9182..09a3b6bd7 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomUniqueIdMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomUniqueIdMapper.xml @@ -20,7 +20,8 @@ and ${criterion.condition} - + #{listItem} @@ -36,10 +37,10 @@ resultMap="org.opensrp.repository.postgres.mapper.UniqueIdMapper.BaseResultMap"> select + refid="org.opensrp.repository.postgres.mapper.UniqueIdMapper.Base_Column_List"/> from core.unique_id ui - + order by ui.${example.orderByClause} @@ -55,7 +56,7 @@ openmrs_id from core.unique_id ui - + order by tm.${example.orderByClause} @@ -65,71 +66,71 @@ - insert into core.unique_id - - - id, - - - location, - - - openmrs_id, - - - status, - - - used_by, - - - updated_at, - - - created_at, - - - identifier, - - - id_source, - - - is_reserved, - - - - - #{id,jdbcType=BIGINT}, - - - #{location,jdbcType=VARCHAR}, - - - #{openmrsId,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{usedBy,jdbcType=VARCHAR}, - - - #{updatedAt,jdbcType=TIMESTAMP}, - - - #{createdAt,jdbcType=TIMESTAMP}, - - - #{identifier,jdbcType=VARCHAR}, - - - #{idSource,jdbcType=BIGINT}, - - - #{isReserved,jdbcType=BIT}, - - + insert into core.unique_id + + + id, + + + location, + + + openmrs_id, + + + status, + + + used_by, + + + updated_at, + + + created_at, + + + identifier, + + + id_source, + + + is_reserved, + + + + + #{id,jdbcType=BIGINT}, + + + #{location,jdbcType=VARCHAR}, + + + #{openmrsId,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{usedBy,jdbcType=VARCHAR}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{idSource,jdbcType=BIGINT}, + + + #{isReserved,jdbcType=BIT}, + + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomViewConfigurationMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomViewConfigurationMapper.xml index ce4946816..512748fbf 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomViewConfigurationMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomViewConfigurationMapper.xml @@ -1,39 +1,41 @@ - - - insert into core.view_configuration - - - id, - - - json, - - server_version - - - - #{id,jdbcType=BIGINT}, - - + namespace="org.opensrp.repository.postgres.mapper.custom.CustomViewConfigurationMapper"> + + + insert into core.view_configuration + + + id, + + + json, + + server_version + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler}, + + nextVal('core.view_config_server_version_seq') + + + + update core.view_configuration + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler}, - - nextVal('core.view_config_server_version_seq') - - - - update core.view_configuration - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler}, - server_version = nextVal('core.view_config_server_version_seq') - where id = #{id,jdbcType=BIGINT} - - - + server_version = nextVal('core.view_config_server_version_seq') + where id = #{id,jdbcType=BIGINT} + + + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomViewConfigurationMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomViewConfigurationMetadataMapper.xml index e81ef6150..af1181df9 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomViewConfigurationMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/custom/xml/CustomViewConfigurationMetadataMapper.xml @@ -1,72 +1,72 @@ + namespace="org.opensrp.repository.postgres.mapper.custom.CustomViewConfigurationMetadataMapper"> - - v.id, v.json - + + v.id, v.json + - - from core.view_configuration_metadata m - join - core.view_configuration v on m.view_configuration_id = v.id - + + from core.view_configuration_metadata m + join + core.view_configuration v on m.view_configuration_id = v.id + - + - - - - - - - - - and m.${criterion.condition} - - - and m.${criterion.condition} #{criterion.value} - - - and m.${criterion.condition} #{criterion.value} and - #{criterion.secondValue} - - - and m.${criterion.condition} - - #{listItem} - - - - - - - - - + + + + + + + + + and m.${criterion.condition} + + + and m.${criterion.condition} #{criterion.value} + + + and m.${criterion.condition} #{criterion.value} and + #{criterion.secondValue} + + + and m.${criterion.condition} + + #{listItem} + + + + + + + + + - + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ActionMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ActionMapper.xml index 5487c07a1..00e54f3ae 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ActionMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ActionMapper.xml @@ -1,279 +1,294 @@ - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} + + + + + + - + + + + + id, json + + + + + + delete from core.action + where id = #{id,jdbcType=BIGINT} + + + + delete from core.action + + + + + + + insert into core.action (id, json + ) + values (#{id,jdbcType=BIGINT}, + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} + ) + + + + insert into core.action + + + id, + + + json, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler}, + + + + + + + update core.action + + + id = #{record.id,jdbcType=BIGINT}, + + + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler}, + + + + + + + + + update core.action + set id = #{record.id,jdbcType=BIGINT}, + json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} + + - - - - - - id, json - - - - - - delete from core.action - where id = #{id,jdbcType=BIGINT} - - - - delete from core.action - - - - - - - insert into core.action (id, json - ) - values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} - ) - - - - insert into core.action - - - id, - - - json, - - - - - #{id,jdbcType=BIGINT}, - - - #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler}, - - - - - - - update core.action - - - id = #{record.id,jdbcType=BIGINT}, - - - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler}, - - - - - - - - - update core.action - set id = #{record.id,jdbcType=BIGINT}, - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} - - - - - - - update core.action - - - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.action - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} - where id = #{id,jdbcType=BIGINT} - + + + + update core.action + + + json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.action + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ActionTypeHandler} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ActionMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ActionMetadataMapper.xml index 564024e25..4282d4664 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ActionMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ActionMetadataMapper.xml @@ -1,351 +1,355 @@ - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, action_id, document_id, base_entity_id, server_version, provider_id, location_id, + team, team_id + + + + + + delete from core.action_metadata + where id = #{id,jdbcType=BIGINT} + + + + delete from core.action_metadata + + - - - - - - id, action_id, document_id, base_entity_id, server_version, provider_id, location_id, - team, team_id - - - - - - delete from core.action_metadata - where id = #{id,jdbcType=BIGINT} - - - - delete from core.action_metadata - - - - - - - insert into core.action_metadata (id, action_id, document_id, - base_entity_id, server_version, provider_id, - location_id, team, team_id - ) - values (#{id,jdbcType=BIGINT}, #{actionId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, - #{baseEntityId,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, #{providerId,jdbcType=VARCHAR}, - #{locationId,jdbcType=VARCHAR}, #{team,jdbcType=VARCHAR}, #{teamId,jdbcType=VARCHAR} - ) - - - - insert into core.action_metadata - - - id, - - - action_id, - - - document_id, - - - base_entity_id, - - - server_version, - - - provider_id, - - - location_id, - - - team, - - - team_id, - - - - - #{id,jdbcType=BIGINT}, - - - #{actionId,jdbcType=BIGINT}, - - - #{documentId,jdbcType=VARCHAR}, - - - #{baseEntityId,jdbcType=VARCHAR}, - - - #{serverVersion,jdbcType=BIGINT}, - - - #{providerId,jdbcType=VARCHAR}, - - - #{locationId,jdbcType=VARCHAR}, - - - #{team,jdbcType=VARCHAR}, - - - #{teamId,jdbcType=VARCHAR}, - - - - - - - update core.action_metadata - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.action_metadata (id, action_id, document_id, + base_entity_id, server_version, provider_id, + location_id, team, team_id + ) + values (#{id,jdbcType=BIGINT}, #{actionId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, + #{baseEntityId,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, #{providerId,jdbcType=VARCHAR}, + #{locationId,jdbcType=VARCHAR}, #{team,jdbcType=VARCHAR}, #{teamId,jdbcType=VARCHAR} + ) + + + + insert into core.action_metadata + + + id, + + + action_id, + + + document_id, + + + base_entity_id, + + + server_version, + + + provider_id, + + + location_id, + + + team, + + + team_id, + + + + + #{id,jdbcType=BIGINT}, + + + #{actionId,jdbcType=BIGINT}, + + + #{documentId,jdbcType=VARCHAR}, + + + #{baseEntityId,jdbcType=VARCHAR}, + + + #{serverVersion,jdbcType=BIGINT}, + + + #{providerId,jdbcType=VARCHAR}, + + + #{locationId,jdbcType=VARCHAR}, + + + #{team,jdbcType=VARCHAR}, + + + #{teamId,jdbcType=VARCHAR}, + + + + + + + update core.action_metadata + + + id = #{record.id,jdbcType=BIGINT}, + + + action_id = #{record.actionId,jdbcType=BIGINT}, + + + document_id = #{record.documentId,jdbcType=VARCHAR}, + + + base_entity_id = #{record.baseEntityId,jdbcType=VARCHAR}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + provider_id = #{record.providerId,jdbcType=VARCHAR}, + + + location_id = #{record.locationId,jdbcType=VARCHAR}, + + + team = #{record.team,jdbcType=VARCHAR}, + + + team_id = #{record.teamId,jdbcType=VARCHAR}, + + + + + + + + + update core.action_metadata + set id = #{record.id,jdbcType=BIGINT}, action_id = #{record.actionId,jdbcType=BIGINT}, - - document_id = #{record.documentId,jdbcType=VARCHAR}, - - base_entity_id = #{record.baseEntityId,jdbcType=VARCHAR}, - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - provider_id = #{record.providerId,jdbcType=VARCHAR}, - - location_id = #{record.locationId,jdbcType=VARCHAR}, - - team = #{record.team,jdbcType=VARCHAR}, - - - team_id = #{record.teamId,jdbcType=VARCHAR}, - - - - - - - - - update core.action_metadata - set id = #{record.id,jdbcType=BIGINT}, - action_id = #{record.actionId,jdbcType=BIGINT}, - document_id = #{record.documentId,jdbcType=VARCHAR}, - base_entity_id = #{record.baseEntityId,jdbcType=VARCHAR}, - server_version = #{record.serverVersion,jdbcType=BIGINT}, - provider_id = #{record.providerId,jdbcType=VARCHAR}, - location_id = #{record.locationId,jdbcType=VARCHAR}, - team = #{record.team,jdbcType=VARCHAR}, - team_id = #{record.teamId,jdbcType=VARCHAR} - - - - - - - update core.action_metadata - - - action_id = #{actionId,jdbcType=BIGINT}, - - + team_id = #{record.teamId,jdbcType=VARCHAR} + + + + + + + update core.action_metadata + + + action_id = #{actionId,jdbcType=BIGINT}, + + + document_id = #{documentId,jdbcType=VARCHAR}, + + + base_entity_id = #{baseEntityId,jdbcType=VARCHAR}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + provider_id = #{providerId,jdbcType=VARCHAR}, + + + location_id = #{locationId,jdbcType=VARCHAR}, + + + team = #{team,jdbcType=VARCHAR}, + + + team_id = #{teamId,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.action_metadata + set action_id = #{actionId,jdbcType=BIGINT}, document_id = #{documentId,jdbcType=VARCHAR}, - - base_entity_id = #{baseEntityId,jdbcType=VARCHAR}, - - server_version = #{serverVersion,jdbcType=BIGINT}, - - provider_id = #{providerId,jdbcType=VARCHAR}, - - location_id = #{locationId,jdbcType=VARCHAR}, - - team = #{team,jdbcType=VARCHAR}, - - - team_id = #{teamId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.action_metadata - set action_id = #{actionId,jdbcType=BIGINT}, - document_id = #{documentId,jdbcType=VARCHAR}, - base_entity_id = #{baseEntityId,jdbcType=VARCHAR}, - server_version = #{serverVersion,jdbcType=BIGINT}, - provider_id = #{providerId,jdbcType=VARCHAR}, - location_id = #{locationId,jdbcType=VARCHAR}, - team = #{team,jdbcType=VARCHAR}, - team_id = #{teamId,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - + team_id = #{teamId,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/AlertMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/AlertMapper.xml index 1c9e81f93..79356982c 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/AlertMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/AlertMapper.xml @@ -1,279 +1,294 @@ - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} + + + + + + - + + + + + id, json + + + + + + delete from core.alert + where id = #{id,jdbcType=BIGINT} + + + + delete from core.alert + + + + + + + insert into core.alert (id, json + ) + values (#{id,jdbcType=BIGINT}, + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} + ) + + + + insert into core.alert + + + id, + + + json, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler}, + + + + + + + update core.alert + + + id = #{record.id,jdbcType=BIGINT}, + + + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler}, + + + + + + + + + update core.alert + set id = #{record.id,jdbcType=BIGINT}, + json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} + + - - - - - - id, json - - - - - - delete from core.alert - where id = #{id,jdbcType=BIGINT} - - - - delete from core.alert - - - - - - - insert into core.alert (id, json - ) - values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} - ) - - - - insert into core.alert - - - id, - - - json, - - - - - #{id,jdbcType=BIGINT}, - - - #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler}, - - - - - - - update core.alert - - - id = #{record.id,jdbcType=BIGINT}, - - - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler}, - - - - - - - - - update core.alert - set id = #{record.id,jdbcType=BIGINT}, - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} - - - - - - - update core.alert - - - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.alert - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} - where id = #{id,jdbcType=BIGINT} - + + + + update core.alert + + + json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.alert + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.AlertTypeHandler} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/AlertMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/AlertMetadataMapper.xml index 84ce1ac43..cceaf8d26 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/AlertMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/AlertMetadataMapper.xml @@ -1,381 +1,385 @@ - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, alert_id, document_id, base_entity_id, server_version, provider_id, location_id, + team, team_id, is_active, trigger_name + + + + + + delete from core.alert_metadata + where id = #{id,jdbcType=BIGINT} + + + + delete from core.alert_metadata + + - - - - - - id, alert_id, document_id, base_entity_id, server_version, provider_id, location_id, - team, team_id, is_active, trigger_name - - - - - - delete from core.alert_metadata - where id = #{id,jdbcType=BIGINT} - - - - delete from core.alert_metadata - - - - - - - insert into core.alert_metadata (id, alert_id, document_id, - base_entity_id, server_version, provider_id, - location_id, team, team_id, - is_active, trigger_name) - values (#{id,jdbcType=BIGINT}, #{alertId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, - #{baseEntityId,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, #{providerId,jdbcType=VARCHAR}, - #{locationId,jdbcType=VARCHAR}, #{team,jdbcType=VARCHAR}, #{teamId,jdbcType=VARCHAR}, - #{isActive,jdbcType=BIT}, #{triggerName,jdbcType=VARCHAR}) - - - - insert into core.alert_metadata - - - id, - - - alert_id, - - - document_id, - - - base_entity_id, - - - server_version, - - - provider_id, - - - location_id, - - - team, - - - team_id, - - - is_active, - - - trigger_name, - - - - - #{id,jdbcType=BIGINT}, - - - #{alertId,jdbcType=BIGINT}, - - - #{documentId,jdbcType=VARCHAR}, - - - #{baseEntityId,jdbcType=VARCHAR}, - - - #{serverVersion,jdbcType=BIGINT}, - - - #{providerId,jdbcType=VARCHAR}, - - - #{locationId,jdbcType=VARCHAR}, - - - #{team,jdbcType=VARCHAR}, - - - #{teamId,jdbcType=VARCHAR}, - - - #{isActive,jdbcType=BIT}, - - - #{triggerName,jdbcType=VARCHAR}, - - - - - - - update core.alert_metadata - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.alert_metadata (id, alert_id, document_id, + base_entity_id, server_version, provider_id, + location_id, team, team_id, + is_active, trigger_name) + values (#{id,jdbcType=BIGINT}, #{alertId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, + #{baseEntityId,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, #{providerId,jdbcType=VARCHAR}, + #{locationId,jdbcType=VARCHAR}, #{team,jdbcType=VARCHAR}, #{teamId,jdbcType=VARCHAR}, + #{isActive,jdbcType=BIT}, #{triggerName,jdbcType=VARCHAR}) + + + + insert into core.alert_metadata + + + id, + + + alert_id, + + + document_id, + + + base_entity_id, + + + server_version, + + + provider_id, + + + location_id, + + + team, + + + team_id, + + + is_active, + + + trigger_name, + + + + + #{id,jdbcType=BIGINT}, + + + #{alertId,jdbcType=BIGINT}, + + + #{documentId,jdbcType=VARCHAR}, + + + #{baseEntityId,jdbcType=VARCHAR}, + + + #{serverVersion,jdbcType=BIGINT}, + + + #{providerId,jdbcType=VARCHAR}, + + + #{locationId,jdbcType=VARCHAR}, + + + #{team,jdbcType=VARCHAR}, + + + #{teamId,jdbcType=VARCHAR}, + + + #{isActive,jdbcType=BIT}, + + + #{triggerName,jdbcType=VARCHAR}, + + + + + + + update core.alert_metadata + + + id = #{record.id,jdbcType=BIGINT}, + + + alert_id = #{record.alertId,jdbcType=BIGINT}, + + + document_id = #{record.documentId,jdbcType=VARCHAR}, + + + base_entity_id = #{record.baseEntityId,jdbcType=VARCHAR}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + provider_id = #{record.providerId,jdbcType=VARCHAR}, + + + location_id = #{record.locationId,jdbcType=VARCHAR}, + + + team = #{record.team,jdbcType=VARCHAR}, + + + team_id = #{record.teamId,jdbcType=VARCHAR}, + + + is_active = #{record.isActive,jdbcType=BIT}, + + + trigger_name = #{record.triggerName,jdbcType=VARCHAR}, + + + + + + + + + update core.alert_metadata + set id = #{record.id,jdbcType=BIGINT}, alert_id = #{record.alertId,jdbcType=BIGINT}, - - document_id = #{record.documentId,jdbcType=VARCHAR}, - - base_entity_id = #{record.baseEntityId,jdbcType=VARCHAR}, - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - provider_id = #{record.providerId,jdbcType=VARCHAR}, - - location_id = #{record.locationId,jdbcType=VARCHAR}, - - team = #{record.team,jdbcType=VARCHAR}, - - team_id = #{record.teamId,jdbcType=VARCHAR}, - - is_active = #{record.isActive,jdbcType=BIT}, - - - trigger_name = #{record.triggerName,jdbcType=VARCHAR}, - - - - - - - - - update core.alert_metadata - set id = #{record.id,jdbcType=BIGINT}, - alert_id = #{record.alertId,jdbcType=BIGINT}, - document_id = #{record.documentId,jdbcType=VARCHAR}, - base_entity_id = #{record.baseEntityId,jdbcType=VARCHAR}, - server_version = #{record.serverVersion,jdbcType=BIGINT}, - provider_id = #{record.providerId,jdbcType=VARCHAR}, - location_id = #{record.locationId,jdbcType=VARCHAR}, - team = #{record.team,jdbcType=VARCHAR}, - team_id = #{record.teamId,jdbcType=VARCHAR}, - is_active = #{record.isActive,jdbcType=BIT}, - trigger_name = #{record.triggerName,jdbcType=VARCHAR} - - - - - - - update core.alert_metadata - - - alert_id = #{alertId,jdbcType=BIGINT}, - - + trigger_name = #{record.triggerName,jdbcType=VARCHAR} + + + + + + + update core.alert_metadata + + + alert_id = #{alertId,jdbcType=BIGINT}, + + + document_id = #{documentId,jdbcType=VARCHAR}, + + + base_entity_id = #{baseEntityId,jdbcType=VARCHAR}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + provider_id = #{providerId,jdbcType=VARCHAR}, + + + location_id = #{locationId,jdbcType=VARCHAR}, + + + team = #{team,jdbcType=VARCHAR}, + + + team_id = #{teamId,jdbcType=VARCHAR}, + + + is_active = #{isActive,jdbcType=BIT}, + + + trigger_name = #{triggerName,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.alert_metadata + set alert_id = #{alertId,jdbcType=BIGINT}, document_id = #{documentId,jdbcType=VARCHAR}, - - base_entity_id = #{baseEntityId,jdbcType=VARCHAR}, - - server_version = #{serverVersion,jdbcType=BIGINT}, - - provider_id = #{providerId,jdbcType=VARCHAR}, - - location_id = #{locationId,jdbcType=VARCHAR}, - - team = #{team,jdbcType=VARCHAR}, - - team_id = #{teamId,jdbcType=VARCHAR}, - - is_active = #{isActive,jdbcType=BIT}, - - - trigger_name = #{triggerName,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.alert_metadata - set alert_id = #{alertId,jdbcType=BIGINT}, - document_id = #{documentId,jdbcType=VARCHAR}, - base_entity_id = #{baseEntityId,jdbcType=VARCHAR}, - server_version = #{serverVersion,jdbcType=BIGINT}, - provider_id = #{providerId,jdbcType=VARCHAR}, - location_id = #{locationId,jdbcType=VARCHAR}, - team = #{team,jdbcType=VARCHAR}, - team_id = #{teamId,jdbcType=VARCHAR}, - is_active = #{isActive,jdbcType=BIT}, - trigger_name = #{triggerName,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - + trigger_name = #{triggerName,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/AppStateTokenMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/AppStateTokenMapper.xml index 16f92d7bf..c3bd47312 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/AppStateTokenMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/AppStateTokenMapper.xml @@ -1,305 +1,310 @@ - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, name, description, value, last_edited_date + + + + + + delete from core.app_state_token + where id = #{id,jdbcType=BIGINT} + + + + delete from core.app_state_token + + + + + + + insert into core.app_state_token (id, name, description, + value, last_edited_date) + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, + #{value,jdbcType=VARCHAR}, #{lastEditedDate,jdbcType=BIGINT}) + + + + insert into core.app_state_token + + + id, + + + name, + + + description, + + + value, + + + last_edited_date, + + + + + #{id,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{value,jdbcType=VARCHAR}, + + + #{lastEditedDate,jdbcType=BIGINT}, + + + + - - select - - distinct - - - from core.app_state_token - - - - - order by ${orderByClause} - - - - - - delete from core.app_state_token - where id = #{id,jdbcType=BIGINT} - - - - delete from core.app_state_token - - - - - - - insert into core.app_state_token (id, name, description, - value, last_edited_date) - values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, - #{value,jdbcType=VARCHAR}, #{lastEditedDate,jdbcType=BIGINT}) - - - - insert into core.app_state_token - - - id, - - - name, - - - description, - - - value, - - - last_edited_date, - - - - - #{id,jdbcType=BIGINT}, - - - #{name,jdbcType=VARCHAR}, - - - #{description,jdbcType=VARCHAR}, - - - #{value,jdbcType=VARCHAR}, - - - #{lastEditedDate,jdbcType=BIGINT}, - - - - - - - update core.app_state_token - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + update core.app_state_token + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + value = #{record.value,jdbcType=VARCHAR}, + + + last_edited_date = #{record.lastEditedDate,jdbcType=BIGINT}, + + + + + + + + + update core.app_state_token + set id = #{record.id,jdbcType=BIGINT}, name = #{record.name,jdbcType=VARCHAR}, - - description = #{record.description,jdbcType=VARCHAR}, - - value = #{record.value,jdbcType=VARCHAR}, - - - last_edited_date = #{record.lastEditedDate,jdbcType=BIGINT}, - - - - - - - - - update core.app_state_token - set id = #{record.id,jdbcType=BIGINT}, - name = #{record.name,jdbcType=VARCHAR}, - description = #{record.description,jdbcType=VARCHAR}, - value = #{record.value,jdbcType=VARCHAR}, - last_edited_date = #{record.lastEditedDate,jdbcType=BIGINT} - - - - - - - update core.app_state_token - - - name = #{name,jdbcType=VARCHAR}, - - + last_edited_date = #{record.lastEditedDate,jdbcType=BIGINT} + + + + + + + update core.app_state_token + + + name = #{name,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + value = #{value,jdbcType=VARCHAR}, + + + last_edited_date = #{lastEditedDate,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.app_state_token + set name = #{name,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR}, - - value = #{value,jdbcType=VARCHAR}, - - - last_edited_date = #{lastEditedDate,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.app_state_token - set name = #{name,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR}, - value = #{value,jdbcType=VARCHAR}, - last_edited_date = #{lastEditedDate,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - - + last_edited_date = #{lastEditedDate,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/CampaignMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/CampaignMapper.xml index c4846f783..e2f859430 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/CampaignMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/CampaignMapper.xml @@ -1,279 +1,294 @@ - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} + + + + + + - + + + + + id, json + + + + + + delete from core.campaign + where id = #{id,jdbcType=BIGINT} + + + + delete from core.campaign + + + + + + + insert into core.campaign (id, json + ) + values (#{id,jdbcType=BIGINT}, + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} + ) + + + + insert into core.campaign + + + id, + + + json, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler}, + + + + + + + update core.campaign + + + id = #{record.id,jdbcType=BIGINT}, + + + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler}, + + + + + + + + + update core.campaign + set id = #{record.id,jdbcType=BIGINT}, + json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} + + - - - - - - id, json - - - - - - delete from core.campaign - where id = #{id,jdbcType=BIGINT} - - - - delete from core.campaign - - - - - - - insert into core.campaign (id, json - ) - values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} - ) - - - - insert into core.campaign - - - id, - - - json, - - - - - #{id,jdbcType=BIGINT}, - - - #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler}, - - - - - - - update core.campaign - - - id = #{record.id,jdbcType=BIGINT}, - - - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler}, - - - - - - - - - update core.campaign - set id = #{record.id,jdbcType=BIGINT}, - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} - - - - - - - update core.campaign - - - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.campaign - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} - where id = #{id,jdbcType=BIGINT} - + + + + update core.campaign + + + json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.campaign + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CampaignTypeHandler} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/CampaignMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/CampaignMetadataMapper.xml index 061aa4e11..4f97e0da8 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/CampaignMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/CampaignMetadataMapper.xml @@ -1,271 +1,275 @@ - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, campaign_id, identifier, server_version + + + + + + delete from core.campaign_metadata + where id = #{id,jdbcType=BIGINT} + + + + delete from core.campaign_metadata + + - - - - - - id, campaign_id, identifier, server_version - - - - - - delete from core.campaign_metadata - where id = #{id,jdbcType=BIGINT} - - - - delete from core.campaign_metadata - - - - - - - insert into core.campaign_metadata (id, campaign_id, identifier, - server_version) - values (#{id,jdbcType=BIGINT}, #{campaignId,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, - #{serverVersion,jdbcType=BIGINT}) - - - - insert into core.campaign_metadata - - - id, - - - campaign_id, - - - identifier, - - - server_version, - - - - - #{id,jdbcType=BIGINT}, - - - #{campaignId,jdbcType=BIGINT}, - - - #{identifier,jdbcType=VARCHAR}, - - - #{serverVersion,jdbcType=BIGINT}, - - - - - - - update core.campaign_metadata - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.campaign_metadata (id, campaign_id, identifier, + server_version) + values (#{id,jdbcType=BIGINT}, #{campaignId,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, + #{serverVersion,jdbcType=BIGINT}) + + + + insert into core.campaign_metadata + + + id, + + + campaign_id, + + + identifier, + + + server_version, + + + + + #{id,jdbcType=BIGINT}, + + + #{campaignId,jdbcType=BIGINT}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{serverVersion,jdbcType=BIGINT}, + + + + + + + update core.campaign_metadata + + + id = #{record.id,jdbcType=BIGINT}, + + + campaign_id = #{record.campaignId,jdbcType=BIGINT}, + + + identifier = #{record.identifier,jdbcType=VARCHAR}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + + + + + + + update core.campaign_metadata + set id = #{record.id,jdbcType=BIGINT}, campaign_id = #{record.campaignId,jdbcType=BIGINT}, - - identifier = #{record.identifier,jdbcType=VARCHAR}, - - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - - - - - - - - update core.campaign_metadata - set id = #{record.id,jdbcType=BIGINT}, - campaign_id = #{record.campaignId,jdbcType=BIGINT}, - identifier = #{record.identifier,jdbcType=VARCHAR}, - server_version = #{record.serverVersion,jdbcType=BIGINT} - - - - - - - update core.campaign_metadata - - - campaign_id = #{campaignId,jdbcType=BIGINT}, - - + server_version = #{record.serverVersion,jdbcType=BIGINT} + + + + + + + update core.campaign_metadata + + + campaign_id = #{campaignId,jdbcType=BIGINT}, + + + identifier = #{identifier,jdbcType=VARCHAR}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.campaign_metadata + set campaign_id = #{campaignId,jdbcType=BIGINT}, identifier = #{identifier,jdbcType=VARCHAR}, - - - server_version = #{serverVersion,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.campaign_metadata - set campaign_id = #{campaignId,jdbcType=BIGINT}, - identifier = #{identifier,jdbcType=VARCHAR}, - server_version = #{serverVersion,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - + server_version = #{serverVersion,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ClientFormMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ClientFormMapper.xml index b5da067fc..dad412af9 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ClientFormMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ClientFormMapper.xml @@ -35,7 +35,8 @@ and ${criterion.condition} - + #{listItem} @@ -69,7 +70,8 @@ and ${criterion.condition} - + #{listItem} @@ -88,7 +90,8 @@ --> id, json, created_at - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler} + + + + + + - + + + + + id, json, date_deleted, server_version + + + + + + delete from core.client + where id = #{id,jdbcType=BIGINT} + + + + delete from core.client + + - - - - - - id, json, date_deleted, server_version - - - - - - delete from core.client - where id = #{id,jdbcType=BIGINT} - - - - delete from core.client - - - - - - - insert into core.client (id, json, - date_deleted, server_version) - values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler}, - #{dateDeleted,jdbcType=TIMESTAMP}, #{serverVersion,jdbcType=BIGINT}) - - - - insert into core.client - - - id, - - - json, - - - date_deleted, - - - server_version, - - - - - #{id,jdbcType=BIGINT}, - - + + + + insert into core.client (id, json, + date_deleted, server_version) + values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler}, - - - #{dateDeleted,jdbcType=TIMESTAMP}, - - - #{serverVersion,jdbcType=BIGINT}, - - - - - - - update core.client - - - id = #{record.id,jdbcType=BIGINT}, - - + #{dateDeleted,jdbcType=TIMESTAMP}, #{serverVersion,jdbcType=BIGINT}) + + + + insert into core.client + + + id, + + + json, + + + date_deleted, + + + server_version, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler}, + + + #{dateDeleted,jdbcType=TIMESTAMP}, + + + #{serverVersion,jdbcType=BIGINT}, + + + + + + + update core.client + + + id = #{record.id,jdbcType=BIGINT}, + + + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler}, + + + date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + + + + + + + update core.client + set id = #{record.id,jdbcType=BIGINT}, json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler}, - - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - - - - - - - - update core.client - set id = #{record.id,jdbcType=BIGINT}, - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler}, - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - server_version = #{record.serverVersion,jdbcType=BIGINT} - - - - - - - update core.client - - - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler}, - - + server_version = #{record.serverVersion,jdbcType=BIGINT} + + + + + + + update core.client + + + json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler}, + + + date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.client + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler}, date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - - - server_version = #{serverVersion,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.client - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ClientTypeHandler}, - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - server_version = #{serverVersion,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - + server_version = #{serverVersion,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ClientMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ClientMetadataMapper.xml index 76419f106..991ce8231 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ClientMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ClientMetadataMapper.xml @@ -1,493 +1,497 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, client_id, document_id, base_entity_id, relational_id, server_version, openmrs_uuid, + unique_id, first_name, middle_name, last_name, birth_date, date_deleted, residence, + location_id, client_type, date_created, date_edited + + + + + + delete from core.client_metadata + where id = #{id,jdbcType=BIGINT} + + + + delete from core.client_metadata + + - - - - - - id, client_id, document_id, base_entity_id, relational_id, server_version, openmrs_uuid, - unique_id, first_name, middle_name, last_name, birth_date, date_deleted, residence, - location_id, client_type, date_created, date_edited - - - - - - delete from core.client_metadata - where id = #{id,jdbcType=BIGINT} - - - - delete from core.client_metadata - - - - - - - insert into core.client_metadata (id, client_id, document_id, - base_entity_id, relational_id, server_version, - openmrs_uuid, unique_id, first_name, - middle_name, last_name, birth_date, - date_deleted, residence, location_id, - client_type, date_created, date_edited - ) - values (#{id,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, - #{baseEntityId,jdbcType=VARCHAR}, #{relationalId,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, - #{openmrsUuid,jdbcType=VARCHAR}, #{uniqueId,jdbcType=VARCHAR}, #{firstName,jdbcType=VARCHAR}, - #{middleName,jdbcType=VARCHAR}, #{lastName,jdbcType=VARCHAR}, #{birthDate,jdbcType=DATE}, - #{dateDeleted,jdbcType=TIMESTAMP}, #{residence,jdbcType=VARCHAR}, #{locationId,jdbcType=VARCHAR}, - #{clientType,jdbcType=VARCHAR}, #{dateCreated,jdbcType=TIMESTAMP}, #{dateEdited,jdbcType=TIMESTAMP} - ) - - - - insert into core.client_metadata - - - id, - - - client_id, - - - document_id, - - - base_entity_id, - - - relational_id, - - - server_version, - - - openmrs_uuid, - - - unique_id, - - - first_name, - - - middle_name, - - - last_name, - - - birth_date, - - - date_deleted, - - - residence, - - - location_id, - - - client_type, - - - date_created, - - - date_edited, - - - - - #{id,jdbcType=BIGINT}, - - - #{clientId,jdbcType=BIGINT}, - - - #{documentId,jdbcType=VARCHAR}, - - - #{baseEntityId,jdbcType=VARCHAR}, - - - #{relationalId,jdbcType=VARCHAR}, - - - #{serverVersion,jdbcType=BIGINT}, - - - #{openmrsUuid,jdbcType=VARCHAR}, - - - #{uniqueId,jdbcType=VARCHAR}, - - - #{firstName,jdbcType=VARCHAR}, - - - #{middleName,jdbcType=VARCHAR}, - - - #{lastName,jdbcType=VARCHAR}, - - - #{birthDate,jdbcType=DATE}, - - - #{dateDeleted,jdbcType=TIMESTAMP}, - - - #{residence,jdbcType=VARCHAR}, - - - #{locationId,jdbcType=VARCHAR}, - - - #{clientType,jdbcType=VARCHAR}, - - - #{dateCreated,jdbcType=TIMESTAMP}, - - - #{dateEdited,jdbcType=TIMESTAMP}, - - - - - - - update core.client_metadata - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.client_metadata (id, client_id, document_id, + base_entity_id, relational_id, server_version, + openmrs_uuid, unique_id, first_name, + middle_name, last_name, birth_date, + date_deleted, residence, location_id, + client_type, date_created, date_edited + ) + values (#{id,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, + #{baseEntityId,jdbcType=VARCHAR}, #{relationalId,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, + #{openmrsUuid,jdbcType=VARCHAR}, #{uniqueId,jdbcType=VARCHAR}, #{firstName,jdbcType=VARCHAR}, + #{middleName,jdbcType=VARCHAR}, #{lastName,jdbcType=VARCHAR}, #{birthDate,jdbcType=DATE}, + #{dateDeleted,jdbcType=TIMESTAMP}, #{residence,jdbcType=VARCHAR}, #{locationId,jdbcType=VARCHAR}, + #{clientType,jdbcType=VARCHAR}, #{dateCreated,jdbcType=TIMESTAMP}, #{dateEdited,jdbcType=TIMESTAMP} + ) + + + + insert into core.client_metadata + + + id, + + + client_id, + + + document_id, + + + base_entity_id, + + + relational_id, + + + server_version, + + + openmrs_uuid, + + + unique_id, + + + first_name, + + + middle_name, + + + last_name, + + + birth_date, + + + date_deleted, + + + residence, + + + location_id, + + + client_type, + + + date_created, + + + date_edited, + + + + + #{id,jdbcType=BIGINT}, + + + #{clientId,jdbcType=BIGINT}, + + + #{documentId,jdbcType=VARCHAR}, + + + #{baseEntityId,jdbcType=VARCHAR}, + + + #{relationalId,jdbcType=VARCHAR}, + + + #{serverVersion,jdbcType=BIGINT}, + + + #{openmrsUuid,jdbcType=VARCHAR}, + + + #{uniqueId,jdbcType=VARCHAR}, + + + #{firstName,jdbcType=VARCHAR}, + + + #{middleName,jdbcType=VARCHAR}, + + + #{lastName,jdbcType=VARCHAR}, + + + #{birthDate,jdbcType=DATE}, + + + #{dateDeleted,jdbcType=TIMESTAMP}, + + + #{residence,jdbcType=VARCHAR}, + + + #{locationId,jdbcType=VARCHAR}, + + + #{clientType,jdbcType=VARCHAR}, + + + #{dateCreated,jdbcType=TIMESTAMP}, + + + #{dateEdited,jdbcType=TIMESTAMP}, + + + + + + + update core.client_metadata + + + id = #{record.id,jdbcType=BIGINT}, + + + client_id = #{record.clientId,jdbcType=BIGINT}, + + + document_id = #{record.documentId,jdbcType=VARCHAR}, + + + base_entity_id = #{record.baseEntityId,jdbcType=VARCHAR}, + + + relational_id = #{record.relationalId,jdbcType=VARCHAR}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + openmrs_uuid = #{record.openmrsUuid,jdbcType=VARCHAR}, + + + unique_id = #{record.uniqueId,jdbcType=VARCHAR}, + + + first_name = #{record.firstName,jdbcType=VARCHAR}, + + + middle_name = #{record.middleName,jdbcType=VARCHAR}, + + + last_name = #{record.lastName,jdbcType=VARCHAR}, + + + birth_date = #{record.birthDate,jdbcType=DATE}, + + + date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, + + + residence = #{record.residence,jdbcType=VARCHAR}, + + + location_id = #{record.locationId,jdbcType=VARCHAR}, + + + client_type = #{record.clientType,jdbcType=VARCHAR}, + + + date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, + + + + + + + + + update core.client_metadata + set id = #{record.id,jdbcType=BIGINT}, client_id = #{record.clientId,jdbcType=BIGINT}, - - document_id = #{record.documentId,jdbcType=VARCHAR}, - - base_entity_id = #{record.baseEntityId,jdbcType=VARCHAR}, - - relational_id = #{record.relationalId,jdbcType=VARCHAR}, - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - openmrs_uuid = #{record.openmrsUuid,jdbcType=VARCHAR}, - - unique_id = #{record.uniqueId,jdbcType=VARCHAR}, - - first_name = #{record.firstName,jdbcType=VARCHAR}, - - middle_name = #{record.middleName,jdbcType=VARCHAR}, - - last_name = #{record.lastName,jdbcType=VARCHAR}, - - birth_date = #{record.birthDate,jdbcType=DATE}, - - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - - residence = #{record.residence,jdbcType=VARCHAR}, - - location_id = #{record.locationId,jdbcType=VARCHAR}, - - client_type = #{record.clientType,jdbcType=VARCHAR}, - - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - - - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, - - - - - - - - - update core.client_metadata - set id = #{record.id,jdbcType=BIGINT}, - client_id = #{record.clientId,jdbcType=BIGINT}, - document_id = #{record.documentId,jdbcType=VARCHAR}, - base_entity_id = #{record.baseEntityId,jdbcType=VARCHAR}, - relational_id = #{record.relationalId,jdbcType=VARCHAR}, - server_version = #{record.serverVersion,jdbcType=BIGINT}, - openmrs_uuid = #{record.openmrsUuid,jdbcType=VARCHAR}, - unique_id = #{record.uniqueId,jdbcType=VARCHAR}, - first_name = #{record.firstName,jdbcType=VARCHAR}, - middle_name = #{record.middleName,jdbcType=VARCHAR}, - last_name = #{record.lastName,jdbcType=VARCHAR}, - birth_date = #{record.birthDate,jdbcType=DATE}, - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - residence = #{record.residence,jdbcType=VARCHAR}, - location_id = #{record.locationId,jdbcType=VARCHAR}, - client_type = #{record.clientType,jdbcType=VARCHAR}, - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP} - - - - - - - update core.client_metadata - - - client_id = #{clientId,jdbcType=BIGINT}, - - + date_edited = #{record.dateEdited,jdbcType=TIMESTAMP} + + + + + + + update core.client_metadata + + + client_id = #{clientId,jdbcType=BIGINT}, + + + document_id = #{documentId,jdbcType=VARCHAR}, + + + base_entity_id = #{baseEntityId,jdbcType=VARCHAR}, + + + relational_id = #{relationalId,jdbcType=VARCHAR}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + openmrs_uuid = #{openmrsUuid,jdbcType=VARCHAR}, + + + unique_id = #{uniqueId,jdbcType=VARCHAR}, + + + first_name = #{firstName,jdbcType=VARCHAR}, + + + middle_name = #{middleName,jdbcType=VARCHAR}, + + + last_name = #{lastName,jdbcType=VARCHAR}, + + + birth_date = #{birthDate,jdbcType=DATE}, + + + date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, + + + residence = #{residence,jdbcType=VARCHAR}, + + + location_id = #{locationId,jdbcType=VARCHAR}, + + + client_type = #{clientType,jdbcType=VARCHAR}, + + + date_created = #{dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{dateEdited,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.client_metadata + set client_id = #{clientId,jdbcType=BIGINT}, document_id = #{documentId,jdbcType=VARCHAR}, - - base_entity_id = #{baseEntityId,jdbcType=VARCHAR}, - - relational_id = #{relationalId,jdbcType=VARCHAR}, - - server_version = #{serverVersion,jdbcType=BIGINT}, - - openmrs_uuid = #{openmrsUuid,jdbcType=VARCHAR}, - - unique_id = #{uniqueId,jdbcType=VARCHAR}, - - first_name = #{firstName,jdbcType=VARCHAR}, - - middle_name = #{middleName,jdbcType=VARCHAR}, - - last_name = #{lastName,jdbcType=VARCHAR}, - - birth_date = #{birthDate,jdbcType=DATE}, - - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - - residence = #{residence,jdbcType=VARCHAR}, - - location_id = #{locationId,jdbcType=VARCHAR}, - - client_type = #{clientType,jdbcType=VARCHAR}, - - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - - - date_edited = #{dateEdited,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.client_metadata - set client_id = #{clientId,jdbcType=BIGINT}, - document_id = #{documentId,jdbcType=VARCHAR}, - base_entity_id = #{baseEntityId,jdbcType=VARCHAR}, - relational_id = #{relationalId,jdbcType=VARCHAR}, - server_version = #{serverVersion,jdbcType=BIGINT}, - openmrs_uuid = #{openmrsUuid,jdbcType=VARCHAR}, - unique_id = #{uniqueId,jdbcType=VARCHAR}, - first_name = #{firstName,jdbcType=VARCHAR}, - middle_name = #{middleName,jdbcType=VARCHAR}, - last_name = #{lastName,jdbcType=VARCHAR}, - birth_date = #{birthDate,jdbcType=DATE}, - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - residence = #{residence,jdbcType=VARCHAR}, - location_id = #{locationId,jdbcType=VARCHAR}, - client_type = #{clientType,jdbcType=VARCHAR}, - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{dateEdited,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - + date_edited = #{dateEdited,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ClientMigrationFileMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ClientMigrationFileMapper.xml index a1825abc5..61a153d8c 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ClientMigrationFileMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ClientMigrationFileMapper.xml @@ -1,366 +1,370 @@ - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, identifier, filename, on_object_storage, object_storage_path, jurisdiction, version, + manifest_id, file_contents, created_at + + + + + + delete from core.client_migration_file + where id = #{id,jdbcType=BIGINT} + + + + delete from core.client_migration_file + + - - - - - - id, identifier, filename, on_object_storage, object_storage_path, jurisdiction, version, - manifest_id, file_contents, created_at - - - - - - delete from core.client_migration_file - where id = #{id,jdbcType=BIGINT} - - - - delete from core.client_migration_file - - - - - - - insert into core.client_migration_file (id, identifier, filename, - on_object_storage, object_storage_path, jurisdiction, - version, manifest_id, file_contents, - created_at) - values (#{id,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, - #{onObjectStorage,jdbcType=BIT}, #{objectStoragePath,jdbcType=VARCHAR}, #{jurisdiction,jdbcType=VARCHAR}, - #{version,jdbcType=INTEGER}, #{manifestId,jdbcType=INTEGER}, #{fileContents,jdbcType=VARCHAR}, - #{createdAt,jdbcType=TIMESTAMP}) - - - - insert into core.client_migration_file - - - id, - - - identifier, - - - filename, - - - on_object_storage, - - - object_storage_path, - - - jurisdiction, - - - version, - - - manifest_id, - - - file_contents, - - - created_at, - - - - - #{id,jdbcType=BIGINT}, - - - #{identifier,jdbcType=VARCHAR}, - - - #{filename,jdbcType=VARCHAR}, - - - #{onObjectStorage,jdbcType=BIT}, - - - #{objectStoragePath,jdbcType=VARCHAR}, - - - #{jurisdiction,jdbcType=VARCHAR}, - - - #{version,jdbcType=INTEGER}, - - - #{manifestId,jdbcType=INTEGER}, - - - #{fileContents,jdbcType=VARCHAR}, - - - #{createdAt,jdbcType=TIMESTAMP}, - - - - - - - update core.client_migration_file - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.client_migration_file (id, identifier, filename, + on_object_storage, object_storage_path, jurisdiction, + version, manifest_id, file_contents, + created_at) + values (#{id,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, + #{onObjectStorage,jdbcType=BIT}, #{objectStoragePath,jdbcType=VARCHAR}, #{jurisdiction,jdbcType=VARCHAR}, + #{version,jdbcType=INTEGER}, #{manifestId,jdbcType=INTEGER}, #{fileContents,jdbcType=VARCHAR}, + #{createdAt,jdbcType=TIMESTAMP}) + + + + insert into core.client_migration_file + + + id, + + + identifier, + + + filename, + + + on_object_storage, + + + object_storage_path, + + + jurisdiction, + + + version, + + + manifest_id, + + + file_contents, + + + created_at, + + + + + #{id,jdbcType=BIGINT}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{filename,jdbcType=VARCHAR}, + + + #{onObjectStorage,jdbcType=BIT}, + + + #{objectStoragePath,jdbcType=VARCHAR}, + + + #{jurisdiction,jdbcType=VARCHAR}, + + + #{version,jdbcType=INTEGER}, + + + #{manifestId,jdbcType=INTEGER}, + + + #{fileContents,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + + + + + update core.client_migration_file + + + id = #{record.id,jdbcType=BIGINT}, + + + identifier = #{record.identifier,jdbcType=VARCHAR}, + + + filename = #{record.filename,jdbcType=VARCHAR}, + + + on_object_storage = #{record.onObjectStorage,jdbcType=BIT}, + + + object_storage_path = #{record.objectStoragePath,jdbcType=VARCHAR}, + + + jurisdiction = #{record.jurisdiction,jdbcType=VARCHAR}, + + + version = #{record.version,jdbcType=INTEGER}, + + + manifest_id = #{record.manifestId,jdbcType=INTEGER}, + + + file_contents = #{record.fileContents,jdbcType=VARCHAR}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + + + + + + + update core.client_migration_file + set id = #{record.id,jdbcType=BIGINT}, identifier = #{record.identifier,jdbcType=VARCHAR}, - - filename = #{record.filename,jdbcType=VARCHAR}, - - on_object_storage = #{record.onObjectStorage,jdbcType=BIT}, - - object_storage_path = #{record.objectStoragePath,jdbcType=VARCHAR}, - - jurisdiction = #{record.jurisdiction,jdbcType=VARCHAR}, - - version = #{record.version,jdbcType=INTEGER}, - - manifest_id = #{record.manifestId,jdbcType=INTEGER}, - - file_contents = #{record.fileContents,jdbcType=VARCHAR}, - - - created_at = #{record.createdAt,jdbcType=TIMESTAMP}, - - - - - - - - - update core.client_migration_file - set id = #{record.id,jdbcType=BIGINT}, - identifier = #{record.identifier,jdbcType=VARCHAR}, - filename = #{record.filename,jdbcType=VARCHAR}, - on_object_storage = #{record.onObjectStorage,jdbcType=BIT}, - object_storage_path = #{record.objectStoragePath,jdbcType=VARCHAR}, - jurisdiction = #{record.jurisdiction,jdbcType=VARCHAR}, - version = #{record.version,jdbcType=INTEGER}, - manifest_id = #{record.manifestId,jdbcType=INTEGER}, - file_contents = #{record.fileContents,jdbcType=VARCHAR}, - created_at = #{record.createdAt,jdbcType=TIMESTAMP} - - - - - - - update core.client_migration_file - - - identifier = #{identifier,jdbcType=VARCHAR}, - - + created_at = #{record.createdAt,jdbcType=TIMESTAMP} + + + + + + + update core.client_migration_file + + + identifier = #{identifier,jdbcType=VARCHAR}, + + + filename = #{filename,jdbcType=VARCHAR}, + + + on_object_storage = #{onObjectStorage,jdbcType=BIT}, + + + object_storage_path = #{objectStoragePath,jdbcType=VARCHAR}, + + + jurisdiction = #{jurisdiction,jdbcType=VARCHAR}, + + + version = #{version,jdbcType=INTEGER}, + + + manifest_id = #{manifestId,jdbcType=INTEGER}, + + + file_contents = #{fileContents,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.client_migration_file + set identifier = #{identifier,jdbcType=VARCHAR}, filename = #{filename,jdbcType=VARCHAR}, - - on_object_storage = #{onObjectStorage,jdbcType=BIT}, - - object_storage_path = #{objectStoragePath,jdbcType=VARCHAR}, - - jurisdiction = #{jurisdiction,jdbcType=VARCHAR}, - - version = #{version,jdbcType=INTEGER}, - - manifest_id = #{manifestId,jdbcType=INTEGER}, - - file_contents = #{fileContents,jdbcType=VARCHAR}, - - - created_at = #{createdAt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.client_migration_file - set identifier = #{identifier,jdbcType=VARCHAR}, - filename = #{filename,jdbcType=VARCHAR}, - on_object_storage = #{onObjectStorage,jdbcType=BIT}, - object_storage_path = #{objectStoragePath,jdbcType=VARCHAR}, - jurisdiction = #{jurisdiction,jdbcType=VARCHAR}, - version = #{version,jdbcType=INTEGER}, - manifest_id = #{manifestId,jdbcType=INTEGER}, - file_contents = #{fileContents,jdbcType=VARCHAR}, - created_at = #{createdAt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - + created_at = #{createdAt,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ErrorTraceMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ErrorTraceMapper.xml index 9fa1753e4..14d990c73 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ErrorTraceMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ErrorTraceMapper.xml @@ -1,381 +1,385 @@ - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, document_id, date_occurred, error_type, occurred_at, stack_trace, status, record_id, + date_closed, document_type, retry_url + + + + + + delete from error.error_trace + where id = #{id,jdbcType=BIGINT} + + + + delete from error.error_trace + + - - - - - - id, document_id, date_occurred, error_type, occurred_at, stack_trace, status, record_id, - date_closed, document_type, retry_url - - - - - - delete from error.error_trace - where id = #{id,jdbcType=BIGINT} - - - - delete from error.error_trace - - - - - - - insert into error.error_trace (id, document_id, date_occurred, - error_type, occurred_at, stack_trace, - status, record_id, date_closed, - document_type, retry_url) - values (#{id,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, #{dateOccurred,jdbcType=TIMESTAMP}, - #{errorType,jdbcType=VARCHAR}, #{occurredAt,jdbcType=VARCHAR}, #{stackTrace,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{recordId,jdbcType=VARCHAR}, #{dateClosed,jdbcType=TIMESTAMP}, - #{documentType,jdbcType=VARCHAR}, #{retryUrl,jdbcType=VARCHAR}) - - - - insert into error.error_trace - - - id, - - - document_id, - - - date_occurred, - - - error_type, - - - occurred_at, - - - stack_trace, - - - status, - - - record_id, - - - date_closed, - - - document_type, - - - retry_url, - - - - - #{id,jdbcType=BIGINT}, - - - #{documentId,jdbcType=VARCHAR}, - - - #{dateOccurred,jdbcType=TIMESTAMP}, - - - #{errorType,jdbcType=VARCHAR}, - - - #{occurredAt,jdbcType=VARCHAR}, - - - #{stackTrace,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{recordId,jdbcType=VARCHAR}, - - - #{dateClosed,jdbcType=TIMESTAMP}, - - - #{documentType,jdbcType=VARCHAR}, - - - #{retryUrl,jdbcType=VARCHAR}, - - - - - - - update error.error_trace - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into error.error_trace (id, document_id, date_occurred, + error_type, occurred_at, stack_trace, + status, record_id, date_closed, + document_type, retry_url) + values (#{id,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, #{dateOccurred,jdbcType=TIMESTAMP}, + #{errorType,jdbcType=VARCHAR}, #{occurredAt,jdbcType=VARCHAR}, #{stackTrace,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, #{recordId,jdbcType=VARCHAR}, #{dateClosed,jdbcType=TIMESTAMP}, + #{documentType,jdbcType=VARCHAR}, #{retryUrl,jdbcType=VARCHAR}) + + + + insert into error.error_trace + + + id, + + + document_id, + + + date_occurred, + + + error_type, + + + occurred_at, + + + stack_trace, + + + status, + + + record_id, + + + date_closed, + + + document_type, + + + retry_url, + + + + + #{id,jdbcType=BIGINT}, + + + #{documentId,jdbcType=VARCHAR}, + + + #{dateOccurred,jdbcType=TIMESTAMP}, + + + #{errorType,jdbcType=VARCHAR}, + + + #{occurredAt,jdbcType=VARCHAR}, + + + #{stackTrace,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{recordId,jdbcType=VARCHAR}, + + + #{dateClosed,jdbcType=TIMESTAMP}, + + + #{documentType,jdbcType=VARCHAR}, + + + #{retryUrl,jdbcType=VARCHAR}, + + + + + + + update error.error_trace + + + id = #{record.id,jdbcType=BIGINT}, + + + document_id = #{record.documentId,jdbcType=VARCHAR}, + + + date_occurred = #{record.dateOccurred,jdbcType=TIMESTAMP}, + + + error_type = #{record.errorType,jdbcType=VARCHAR}, + + + occurred_at = #{record.occurredAt,jdbcType=VARCHAR}, + + + stack_trace = #{record.stackTrace,jdbcType=VARCHAR}, + + + status = #{record.status,jdbcType=VARCHAR}, + + + record_id = #{record.recordId,jdbcType=VARCHAR}, + + + date_closed = #{record.dateClosed,jdbcType=TIMESTAMP}, + + + document_type = #{record.documentType,jdbcType=VARCHAR}, + + + retry_url = #{record.retryUrl,jdbcType=VARCHAR}, + + + + + + + + + update error.error_trace + set id = #{record.id,jdbcType=BIGINT}, document_id = #{record.documentId,jdbcType=VARCHAR}, - - date_occurred = #{record.dateOccurred,jdbcType=TIMESTAMP}, - - error_type = #{record.errorType,jdbcType=VARCHAR}, - - occurred_at = #{record.occurredAt,jdbcType=VARCHAR}, - - stack_trace = #{record.stackTrace,jdbcType=VARCHAR}, - - status = #{record.status,jdbcType=VARCHAR}, - - record_id = #{record.recordId,jdbcType=VARCHAR}, - - date_closed = #{record.dateClosed,jdbcType=TIMESTAMP}, - - document_type = #{record.documentType,jdbcType=VARCHAR}, - - - retry_url = #{record.retryUrl,jdbcType=VARCHAR}, - - - - - - - - - update error.error_trace - set id = #{record.id,jdbcType=BIGINT}, - document_id = #{record.documentId,jdbcType=VARCHAR}, - date_occurred = #{record.dateOccurred,jdbcType=TIMESTAMP}, - error_type = #{record.errorType,jdbcType=VARCHAR}, - occurred_at = #{record.occurredAt,jdbcType=VARCHAR}, - stack_trace = #{record.stackTrace,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=VARCHAR}, - record_id = #{record.recordId,jdbcType=VARCHAR}, - date_closed = #{record.dateClosed,jdbcType=TIMESTAMP}, - document_type = #{record.documentType,jdbcType=VARCHAR}, - retry_url = #{record.retryUrl,jdbcType=VARCHAR} - - - - - - - update error.error_trace - - - document_id = #{documentId,jdbcType=VARCHAR}, - - + retry_url = #{record.retryUrl,jdbcType=VARCHAR} + + + + + + + update error.error_trace + + + document_id = #{documentId,jdbcType=VARCHAR}, + + + date_occurred = #{dateOccurred,jdbcType=TIMESTAMP}, + + + error_type = #{errorType,jdbcType=VARCHAR}, + + + occurred_at = #{occurredAt,jdbcType=VARCHAR}, + + + stack_trace = #{stackTrace,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + record_id = #{recordId,jdbcType=VARCHAR}, + + + date_closed = #{dateClosed,jdbcType=TIMESTAMP}, + + + document_type = #{documentType,jdbcType=VARCHAR}, + + + retry_url = #{retryUrl,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + update error.error_trace + set document_id = #{documentId,jdbcType=VARCHAR}, date_occurred = #{dateOccurred,jdbcType=TIMESTAMP}, - - error_type = #{errorType,jdbcType=VARCHAR}, - - occurred_at = #{occurredAt,jdbcType=VARCHAR}, - - stack_trace = #{stackTrace,jdbcType=VARCHAR}, - - status = #{status,jdbcType=VARCHAR}, - - record_id = #{recordId,jdbcType=VARCHAR}, - - date_closed = #{dateClosed,jdbcType=TIMESTAMP}, - - document_type = #{documentType,jdbcType=VARCHAR}, - - - retry_url = #{retryUrl,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - - update error.error_trace - set document_id = #{documentId,jdbcType=VARCHAR}, - date_occurred = #{dateOccurred,jdbcType=TIMESTAMP}, - error_type = #{errorType,jdbcType=VARCHAR}, - occurred_at = #{occurredAt,jdbcType=VARCHAR}, - stack_trace = #{stackTrace,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - record_id = #{recordId,jdbcType=VARCHAR}, - date_closed = #{dateClosed,jdbcType=TIMESTAMP}, - document_type = #{documentType,jdbcType=VARCHAR}, - retry_url = #{retryUrl,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - + retry_url = #{retryUrl,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/EventMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/EventMapper.xml index 1e39159e2..392d0ba12 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/EventMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/EventMapper.xml @@ -1,309 +1,324 @@ - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler} + + + + + + - + + + + + id, json, date_deleted, server_version + + + + + + delete from core.event + where id = #{id,jdbcType=BIGINT} + + + + delete from core.event + + - - - - - - id, json, date_deleted, server_version - - - - - - delete from core.event - where id = #{id,jdbcType=BIGINT} - - - - delete from core.event - - - - - - - insert into core.event (id, json, - date_deleted, server_version) - values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler}, - #{dateDeleted,jdbcType=TIMESTAMP}, #{serverVersion,jdbcType=BIGINT}) - - - - insert into core.event - - - id, - - - json, - - - date_deleted, - - - server_version, - - - - - #{id,jdbcType=BIGINT}, - - + + + + insert into core.event (id, json, + date_deleted, server_version) + values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler}, - - - #{dateDeleted,jdbcType=TIMESTAMP}, - - - #{serverVersion,jdbcType=BIGINT}, - - - - - - - update core.event - - - id = #{record.id,jdbcType=BIGINT}, - - + #{dateDeleted,jdbcType=TIMESTAMP}, #{serverVersion,jdbcType=BIGINT}) + + + + insert into core.event + + + id, + + + json, + + + date_deleted, + + + server_version, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler}, + + + #{dateDeleted,jdbcType=TIMESTAMP}, + + + #{serverVersion,jdbcType=BIGINT}, + + + + + + + update core.event + + + id = #{record.id,jdbcType=BIGINT}, + + + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler}, + + + date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + + + + + + + update core.event + set id = #{record.id,jdbcType=BIGINT}, json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler}, - - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - - - - - - - - update core.event - set id = #{record.id,jdbcType=BIGINT}, - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler}, - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - server_version = #{record.serverVersion,jdbcType=BIGINT} - - - - - - - update core.event - - - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler}, - - + server_version = #{record.serverVersion,jdbcType=BIGINT} + + + + + + + update core.event + + + json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler}, + + + date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.event + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler}, date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - - - server_version = #{serverVersion,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.event - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.EventTypeHandler}, - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - server_version = #{serverVersion,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - + server_version = #{serverVersion,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/EventMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/EventMetadataMapper.xml index 5203bb9e6..818dffcdb 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/EventMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/EventMetadataMapper.xml @@ -1,493 +1,497 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, event_id, document_id, base_entity_id, form_submission_id, server_version, openmrs_uuid, + event_type, event_date, entity_type, provider_id, location_id, team, team_id, date_created, + date_edited, date_deleted, plan_identifier + + + + + + delete from core.event_metadata + where id = #{id,jdbcType=BIGINT} + + + + delete from core.event_metadata + + - - - - - - id, event_id, document_id, base_entity_id, form_submission_id, server_version, openmrs_uuid, - event_type, event_date, entity_type, provider_id, location_id, team, team_id, date_created, - date_edited, date_deleted, plan_identifier - - - - - - delete from core.event_metadata - where id = #{id,jdbcType=BIGINT} - - - - delete from core.event_metadata - - - - - - - insert into core.event_metadata (id, event_id, document_id, - base_entity_id, form_submission_id, server_version, - openmrs_uuid, event_type, event_date, - entity_type, provider_id, location_id, - team, team_id, date_created, - date_edited, date_deleted, plan_identifier - ) - values (#{id,jdbcType=BIGINT}, #{eventId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, - #{baseEntityId,jdbcType=VARCHAR}, #{formSubmissionId,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, - #{openmrsUuid,jdbcType=VARCHAR}, #{eventType,jdbcType=VARCHAR}, #{eventDate,jdbcType=TIMESTAMP}, - #{entityType,jdbcType=VARCHAR}, #{providerId,jdbcType=VARCHAR}, #{locationId,jdbcType=VARCHAR}, - #{team,jdbcType=VARCHAR}, #{teamId,jdbcType=VARCHAR}, #{dateCreated,jdbcType=TIMESTAMP}, - #{dateEdited,jdbcType=TIMESTAMP}, #{dateDeleted,jdbcType=TIMESTAMP}, #{planIdentifier,jdbcType=VARCHAR} - ) - - - - insert into core.event_metadata - - - id, - - - event_id, - - - document_id, - - - base_entity_id, - - - form_submission_id, - - - server_version, - - - openmrs_uuid, - - - event_type, - - - event_date, - - - entity_type, - - - provider_id, - - - location_id, - - - team, - - - team_id, - - - date_created, - - - date_edited, - - - date_deleted, - - - plan_identifier, - - - - - #{id,jdbcType=BIGINT}, - - - #{eventId,jdbcType=BIGINT}, - - - #{documentId,jdbcType=VARCHAR}, - - - #{baseEntityId,jdbcType=VARCHAR}, - - - #{formSubmissionId,jdbcType=VARCHAR}, - - - #{serverVersion,jdbcType=BIGINT}, - - - #{openmrsUuid,jdbcType=VARCHAR}, - - - #{eventType,jdbcType=VARCHAR}, - - - #{eventDate,jdbcType=TIMESTAMP}, - - - #{entityType,jdbcType=VARCHAR}, - - - #{providerId,jdbcType=VARCHAR}, - - - #{locationId,jdbcType=VARCHAR}, - - - #{team,jdbcType=VARCHAR}, - - - #{teamId,jdbcType=VARCHAR}, - - - #{dateCreated,jdbcType=TIMESTAMP}, - - - #{dateEdited,jdbcType=TIMESTAMP}, - - - #{dateDeleted,jdbcType=TIMESTAMP}, - - - #{planIdentifier,jdbcType=VARCHAR}, - - - - - - - update core.event_metadata - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.event_metadata (id, event_id, document_id, + base_entity_id, form_submission_id, server_version, + openmrs_uuid, event_type, event_date, + entity_type, provider_id, location_id, + team, team_id, date_created, + date_edited, date_deleted, plan_identifier + ) + values (#{id,jdbcType=BIGINT}, #{eventId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, + #{baseEntityId,jdbcType=VARCHAR}, #{formSubmissionId,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, + #{openmrsUuid,jdbcType=VARCHAR}, #{eventType,jdbcType=VARCHAR}, #{eventDate,jdbcType=TIMESTAMP}, + #{entityType,jdbcType=VARCHAR}, #{providerId,jdbcType=VARCHAR}, #{locationId,jdbcType=VARCHAR}, + #{team,jdbcType=VARCHAR}, #{teamId,jdbcType=VARCHAR}, #{dateCreated,jdbcType=TIMESTAMP}, + #{dateEdited,jdbcType=TIMESTAMP}, #{dateDeleted,jdbcType=TIMESTAMP}, #{planIdentifier,jdbcType=VARCHAR} + ) + + + + insert into core.event_metadata + + + id, + + + event_id, + + + document_id, + + + base_entity_id, + + + form_submission_id, + + + server_version, + + + openmrs_uuid, + + + event_type, + + + event_date, + + + entity_type, + + + provider_id, + + + location_id, + + + team, + + + team_id, + + + date_created, + + + date_edited, + + + date_deleted, + + + plan_identifier, + + + + + #{id,jdbcType=BIGINT}, + + + #{eventId,jdbcType=BIGINT}, + + + #{documentId,jdbcType=VARCHAR}, + + + #{baseEntityId,jdbcType=VARCHAR}, + + + #{formSubmissionId,jdbcType=VARCHAR}, + + + #{serverVersion,jdbcType=BIGINT}, + + + #{openmrsUuid,jdbcType=VARCHAR}, + + + #{eventType,jdbcType=VARCHAR}, + + + #{eventDate,jdbcType=TIMESTAMP}, + + + #{entityType,jdbcType=VARCHAR}, + + + #{providerId,jdbcType=VARCHAR}, + + + #{locationId,jdbcType=VARCHAR}, + + + #{team,jdbcType=VARCHAR}, + + + #{teamId,jdbcType=VARCHAR}, + + + #{dateCreated,jdbcType=TIMESTAMP}, + + + #{dateEdited,jdbcType=TIMESTAMP}, + + + #{dateDeleted,jdbcType=TIMESTAMP}, + + + #{planIdentifier,jdbcType=VARCHAR}, + + + + + + + update core.event_metadata + + + id = #{record.id,jdbcType=BIGINT}, + + + event_id = #{record.eventId,jdbcType=BIGINT}, + + + document_id = #{record.documentId,jdbcType=VARCHAR}, + + + base_entity_id = #{record.baseEntityId,jdbcType=VARCHAR}, + + + form_submission_id = #{record.formSubmissionId,jdbcType=VARCHAR}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + openmrs_uuid = #{record.openmrsUuid,jdbcType=VARCHAR}, + + + event_type = #{record.eventType,jdbcType=VARCHAR}, + + + event_date = #{record.eventDate,jdbcType=TIMESTAMP}, + + + entity_type = #{record.entityType,jdbcType=VARCHAR}, + + + provider_id = #{record.providerId,jdbcType=VARCHAR}, + + + location_id = #{record.locationId,jdbcType=VARCHAR}, + + + team = #{record.team,jdbcType=VARCHAR}, + + + team_id = #{record.teamId,jdbcType=VARCHAR}, + + + date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, + + + date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, + + + plan_identifier = #{record.planIdentifier,jdbcType=VARCHAR}, + + + + + + + + + update core.event_metadata + set id = #{record.id,jdbcType=BIGINT}, event_id = #{record.eventId,jdbcType=BIGINT}, - - document_id = #{record.documentId,jdbcType=VARCHAR}, - - base_entity_id = #{record.baseEntityId,jdbcType=VARCHAR}, - - form_submission_id = #{record.formSubmissionId,jdbcType=VARCHAR}, - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - openmrs_uuid = #{record.openmrsUuid,jdbcType=VARCHAR}, - - event_type = #{record.eventType,jdbcType=VARCHAR}, - - event_date = #{record.eventDate,jdbcType=TIMESTAMP}, - - entity_type = #{record.entityType,jdbcType=VARCHAR}, - - provider_id = #{record.providerId,jdbcType=VARCHAR}, - - location_id = #{record.locationId,jdbcType=VARCHAR}, - - team = #{record.team,jdbcType=VARCHAR}, - - team_id = #{record.teamId,jdbcType=VARCHAR}, - - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, - - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - - - plan_identifier = #{record.planIdentifier,jdbcType=VARCHAR}, - - - - - - - - - update core.event_metadata - set id = #{record.id,jdbcType=BIGINT}, - event_id = #{record.eventId,jdbcType=BIGINT}, - document_id = #{record.documentId,jdbcType=VARCHAR}, - base_entity_id = #{record.baseEntityId,jdbcType=VARCHAR}, - form_submission_id = #{record.formSubmissionId,jdbcType=VARCHAR}, - server_version = #{record.serverVersion,jdbcType=BIGINT}, - openmrs_uuid = #{record.openmrsUuid,jdbcType=VARCHAR}, - event_type = #{record.eventType,jdbcType=VARCHAR}, - event_date = #{record.eventDate,jdbcType=TIMESTAMP}, - entity_type = #{record.entityType,jdbcType=VARCHAR}, - provider_id = #{record.providerId,jdbcType=VARCHAR}, - location_id = #{record.locationId,jdbcType=VARCHAR}, - team = #{record.team,jdbcType=VARCHAR}, - team_id = #{record.teamId,jdbcType=VARCHAR}, - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - plan_identifier = #{record.planIdentifier,jdbcType=VARCHAR} - - - - - - - update core.event_metadata - - - event_id = #{eventId,jdbcType=BIGINT}, - - + plan_identifier = #{record.planIdentifier,jdbcType=VARCHAR} + + + + + + + update core.event_metadata + + + event_id = #{eventId,jdbcType=BIGINT}, + + + document_id = #{documentId,jdbcType=VARCHAR}, + + + base_entity_id = #{baseEntityId,jdbcType=VARCHAR}, + + + form_submission_id = #{formSubmissionId,jdbcType=VARCHAR}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + openmrs_uuid = #{openmrsUuid,jdbcType=VARCHAR}, + + + event_type = #{eventType,jdbcType=VARCHAR}, + + + event_date = #{eventDate,jdbcType=TIMESTAMP}, + + + entity_type = #{entityType,jdbcType=VARCHAR}, + + + provider_id = #{providerId,jdbcType=VARCHAR}, + + + location_id = #{locationId,jdbcType=VARCHAR}, + + + team = #{team,jdbcType=VARCHAR}, + + + team_id = #{teamId,jdbcType=VARCHAR}, + + + date_created = #{dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{dateEdited,jdbcType=TIMESTAMP}, + + + date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, + + + plan_identifier = #{planIdentifier,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.event_metadata + set event_id = #{eventId,jdbcType=BIGINT}, document_id = #{documentId,jdbcType=VARCHAR}, - - base_entity_id = #{baseEntityId,jdbcType=VARCHAR}, - - form_submission_id = #{formSubmissionId,jdbcType=VARCHAR}, - - server_version = #{serverVersion,jdbcType=BIGINT}, - - openmrs_uuid = #{openmrsUuid,jdbcType=VARCHAR}, - - event_type = #{eventType,jdbcType=VARCHAR}, - - event_date = #{eventDate,jdbcType=TIMESTAMP}, - - entity_type = #{entityType,jdbcType=VARCHAR}, - - provider_id = #{providerId,jdbcType=VARCHAR}, - - location_id = #{locationId,jdbcType=VARCHAR}, - - team = #{team,jdbcType=VARCHAR}, - - team_id = #{teamId,jdbcType=VARCHAR}, - - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - - date_edited = #{dateEdited,jdbcType=TIMESTAMP}, - - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - - - plan_identifier = #{planIdentifier,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.event_metadata - set event_id = #{eventId,jdbcType=BIGINT}, - document_id = #{documentId,jdbcType=VARCHAR}, - base_entity_id = #{baseEntityId,jdbcType=VARCHAR}, - form_submission_id = #{formSubmissionId,jdbcType=VARCHAR}, - server_version = #{serverVersion,jdbcType=BIGINT}, - openmrs_uuid = #{openmrsUuid,jdbcType=VARCHAR}, - event_type = #{eventType,jdbcType=VARCHAR}, - event_date = #{eventDate,jdbcType=TIMESTAMP}, - entity_type = #{entityType,jdbcType=VARCHAR}, - provider_id = #{providerId,jdbcType=VARCHAR}, - location_id = #{locationId,jdbcType=VARCHAR}, - team = #{team,jdbcType=VARCHAR}, - team_id = #{teamId,jdbcType=VARCHAR}, - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{dateEdited,jdbcType=TIMESTAMP}, - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - plan_identifier = #{planIdentifier,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - + plan_identifier = #{planIdentifier,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/IdentifierSourceMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/IdentifierSourceMapper.xml index 679ae4a3b..1b1782dfb 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/IdentifierSourceMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/IdentifierSourceMapper.xml @@ -1,398 +1,402 @@ - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, identifier, description, identifier_validator_algorithm, base_character_set, + first_identifier_base, prefix, suffix, min_length, max_length, regex_format, sequence_value + + + + + + delete from core.identifier_source + where id = #{id,jdbcType=BIGINT} + + + + delete from core.identifier_source + + - - - - - - id, identifier, description, identifier_validator_algorithm, base_character_set, - first_identifier_base, prefix, suffix, min_length, max_length, regex_format, sequence_value - - - - - - delete from core.identifier_source - where id = #{id,jdbcType=BIGINT} - - - - delete from core.identifier_source - - - - - - - insert into core.identifier_source (id, identifier, description, - identifier_validator_algorithm, base_character_set, - first_identifier_base, prefix, suffix, - min_length, max_length, regex_format, - sequence_value) - values (#{id,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, - #{identifierValidatorAlgorithm,jdbcType=VARCHAR}, #{baseCharacterSet,jdbcType=VARCHAR}, - #{firstIdentifierBase,jdbcType=VARCHAR}, #{prefix,jdbcType=VARCHAR}, #{suffix,jdbcType=VARCHAR}, - #{minLength,jdbcType=INTEGER}, #{maxLength,jdbcType=INTEGER}, #{regexFormat,jdbcType=VARCHAR}, - #{sequenceValue,jdbcType=BIGINT}) - - - - insert into core.identifier_source - - - id, - - - identifier, - - - description, - - - identifier_validator_algorithm, - - - base_character_set, - - - first_identifier_base, - - - prefix, - - - suffix, - - - min_length, - - - max_length, - - - regex_format, - - - sequence_value, - - - - - #{id,jdbcType=BIGINT}, - - - #{identifier,jdbcType=VARCHAR}, - - - #{description,jdbcType=VARCHAR}, - - - #{identifierValidatorAlgorithm,jdbcType=VARCHAR}, - - - #{baseCharacterSet,jdbcType=VARCHAR}, - - - #{firstIdentifierBase,jdbcType=VARCHAR}, - - - #{prefix,jdbcType=VARCHAR}, - - - #{suffix,jdbcType=VARCHAR}, - - - #{minLength,jdbcType=INTEGER}, - - - #{maxLength,jdbcType=INTEGER}, - - - #{regexFormat,jdbcType=VARCHAR}, - - - #{sequenceValue,jdbcType=BIGINT}, - - - - - - - update core.identifier_source - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.identifier_source (id, identifier, description, + identifier_validator_algorithm, base_character_set, + first_identifier_base, prefix, suffix, + min_length, max_length, regex_format, + sequence_value) + values (#{id,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, + #{identifierValidatorAlgorithm,jdbcType=VARCHAR}, #{baseCharacterSet,jdbcType=VARCHAR}, + #{firstIdentifierBase,jdbcType=VARCHAR}, #{prefix,jdbcType=VARCHAR}, #{suffix,jdbcType=VARCHAR}, + #{minLength,jdbcType=INTEGER}, #{maxLength,jdbcType=INTEGER}, #{regexFormat,jdbcType=VARCHAR}, + #{sequenceValue,jdbcType=BIGINT}) + + + + insert into core.identifier_source + + + id, + + + identifier, + + + description, + + + identifier_validator_algorithm, + + + base_character_set, + + + first_identifier_base, + + + prefix, + + + suffix, + + + min_length, + + + max_length, + + + regex_format, + + + sequence_value, + + + + + #{id,jdbcType=BIGINT}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{identifierValidatorAlgorithm,jdbcType=VARCHAR}, + + + #{baseCharacterSet,jdbcType=VARCHAR}, + + + #{firstIdentifierBase,jdbcType=VARCHAR}, + + + #{prefix,jdbcType=VARCHAR}, + + + #{suffix,jdbcType=VARCHAR}, + + + #{minLength,jdbcType=INTEGER}, + + + #{maxLength,jdbcType=INTEGER}, + + + #{regexFormat,jdbcType=VARCHAR}, + + + #{sequenceValue,jdbcType=BIGINT}, + + + + + + + update core.identifier_source + + + id = #{record.id,jdbcType=BIGINT}, + + + identifier = #{record.identifier,jdbcType=VARCHAR}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + identifier_validator_algorithm = #{record.identifierValidatorAlgorithm,jdbcType=VARCHAR}, + + + base_character_set = #{record.baseCharacterSet,jdbcType=VARCHAR}, + + + first_identifier_base = #{record.firstIdentifierBase,jdbcType=VARCHAR}, + + + prefix = #{record.prefix,jdbcType=VARCHAR}, + + + suffix = #{record.suffix,jdbcType=VARCHAR}, + + + min_length = #{record.minLength,jdbcType=INTEGER}, + + + max_length = #{record.maxLength,jdbcType=INTEGER}, + + + regex_format = #{record.regexFormat,jdbcType=VARCHAR}, + + + sequence_value = #{record.sequenceValue,jdbcType=BIGINT}, + + + + + + + + + update core.identifier_source + set id = #{record.id,jdbcType=BIGINT}, identifier = #{record.identifier,jdbcType=VARCHAR}, - - description = #{record.description,jdbcType=VARCHAR}, - - identifier_validator_algorithm = #{record.identifierValidatorAlgorithm,jdbcType=VARCHAR}, - - base_character_set = #{record.baseCharacterSet,jdbcType=VARCHAR}, - - first_identifier_base = #{record.firstIdentifierBase,jdbcType=VARCHAR}, - - prefix = #{record.prefix,jdbcType=VARCHAR}, - - suffix = #{record.suffix,jdbcType=VARCHAR}, - - min_length = #{record.minLength,jdbcType=INTEGER}, - - max_length = #{record.maxLength,jdbcType=INTEGER}, - - regex_format = #{record.regexFormat,jdbcType=VARCHAR}, - - - sequence_value = #{record.sequenceValue,jdbcType=BIGINT}, - - - - - - - - - update core.identifier_source - set id = #{record.id,jdbcType=BIGINT}, - identifier = #{record.identifier,jdbcType=VARCHAR}, - description = #{record.description,jdbcType=VARCHAR}, - identifier_validator_algorithm = #{record.identifierValidatorAlgorithm,jdbcType=VARCHAR}, - base_character_set = #{record.baseCharacterSet,jdbcType=VARCHAR}, - first_identifier_base = #{record.firstIdentifierBase,jdbcType=VARCHAR}, - prefix = #{record.prefix,jdbcType=VARCHAR}, - suffix = #{record.suffix,jdbcType=VARCHAR}, - min_length = #{record.minLength,jdbcType=INTEGER}, - max_length = #{record.maxLength,jdbcType=INTEGER}, - regex_format = #{record.regexFormat,jdbcType=VARCHAR}, - sequence_value = #{record.sequenceValue,jdbcType=BIGINT} - - - - - - - update core.identifier_source - - - identifier = #{identifier,jdbcType=VARCHAR}, - - + sequence_value = #{record.sequenceValue,jdbcType=BIGINT} + + + + + + + update core.identifier_source + + + identifier = #{identifier,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + identifier_validator_algorithm = #{identifierValidatorAlgorithm,jdbcType=VARCHAR}, + + + base_character_set = #{baseCharacterSet,jdbcType=VARCHAR}, + + + first_identifier_base = #{firstIdentifierBase,jdbcType=VARCHAR}, + + + prefix = #{prefix,jdbcType=VARCHAR}, + + + suffix = #{suffix,jdbcType=VARCHAR}, + + + min_length = #{minLength,jdbcType=INTEGER}, + + + max_length = #{maxLength,jdbcType=INTEGER}, + + + regex_format = #{regexFormat,jdbcType=VARCHAR}, + + + sequence_value = #{sequenceValue,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.identifier_source + set identifier = #{identifier,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR}, - - identifier_validator_algorithm = #{identifierValidatorAlgorithm,jdbcType=VARCHAR}, - - base_character_set = #{baseCharacterSet,jdbcType=VARCHAR}, - - first_identifier_base = #{firstIdentifierBase,jdbcType=VARCHAR}, - - prefix = #{prefix,jdbcType=VARCHAR}, - - suffix = #{suffix,jdbcType=VARCHAR}, - - min_length = #{minLength,jdbcType=INTEGER}, - - max_length = #{maxLength,jdbcType=INTEGER}, - - regex_format = #{regexFormat,jdbcType=VARCHAR}, - - - sequence_value = #{sequenceValue,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.identifier_source - set identifier = #{identifier,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR}, - identifier_validator_algorithm = #{identifierValidatorAlgorithm,jdbcType=VARCHAR}, - base_character_set = #{baseCharacterSet,jdbcType=VARCHAR}, - first_identifier_base = #{firstIdentifierBase,jdbcType=VARCHAR}, - prefix = #{prefix,jdbcType=VARCHAR}, - suffix = #{suffix,jdbcType=VARCHAR}, - min_length = #{minLength,jdbcType=INTEGER}, - max_length = #{maxLength,jdbcType=INTEGER}, - regex_format = #{regexFormat,jdbcType=VARCHAR}, - sequence_value = #{sequenceValue,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - + sequence_value = #{sequenceValue,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationMapper.xml index a632b5384..78e219894 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationMapper.xml @@ -1,294 +1,309 @@ - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + + + + + + - + + + + + id, json, server_version + + + + + + delete from core.location + where id = #{id,jdbcType=BIGINT} + + + + delete from core.location + + - - - - - - id, json, server_version - - - - - - delete from core.location - where id = #{id,jdbcType=BIGINT} - - - - delete from core.location - - - - - - - insert into core.location (id, json, - server_version) - values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - #{serverVersion,jdbcType=BIGINT}) - - - - insert into core.location - - - id, - - - json, - - - server_version, - - - - - #{id,jdbcType=BIGINT}, - - + + + + insert into core.location (id, json, + server_version) + values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - - - #{serverVersion,jdbcType=BIGINT}, - - - - - - - update core.location - - - id = #{record.id,jdbcType=BIGINT}, - - + #{serverVersion,jdbcType=BIGINT}) + + + + insert into core.location + + + id, + + + json, + + + server_version, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, + + + #{serverVersion,jdbcType=BIGINT}, + + + + + + + update core.location + + + id = #{record.id,jdbcType=BIGINT}, + + + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + + + + + + + update core.location + set id = #{record.id,jdbcType=BIGINT}, json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - - - - - - - - update core.location - set id = #{record.id,jdbcType=BIGINT}, - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - server_version = #{record.serverVersion,jdbcType=BIGINT} - - - - - - - update core.location - - - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - - - server_version = #{serverVersion,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.location - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - server_version = #{serverVersion,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - + server_version = #{record.serverVersion,jdbcType=BIGINT} + + + + + + + update core.location + + + json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.location + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, + server_version = #{serverVersion,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationMetadataMapper.xml index 652a425f7..49a43ee6f 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationMetadataMapper.xml @@ -1,398 +1,402 @@ - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, location_id, geojson_id, type, parent_id, uuid, status, server_version, name, + version, date_created, date_edited + + + + + + delete from core.location_metadata + where id = #{id,jdbcType=BIGINT} + + + + delete from core.location_metadata + + - - - - - - id, location_id, geojson_id, type, parent_id, uuid, status, server_version, name, - version, date_created, date_edited - - - - - - delete from core.location_metadata - where id = #{id,jdbcType=BIGINT} - - - - delete from core.location_metadata - - - - - - - insert into core.location_metadata (id, location_id, geojson_id, - type, parent_id, uuid, - status, server_version, name, - version, date_created, date_edited - ) - values (#{id,jdbcType=BIGINT}, #{locationId,jdbcType=BIGINT}, #{geojsonId,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, - #{version,jdbcType=INTEGER}, #{dateCreated,jdbcType=TIMESTAMP}, #{dateEdited,jdbcType=TIMESTAMP} - ) - - - - insert into core.location_metadata - - - id, - - - location_id, - - - geojson_id, - - - type, - - - parent_id, - - - uuid, - - - status, - - - server_version, - - - name, - - - version, - - - date_created, - - - date_edited, - - - - - #{id,jdbcType=BIGINT}, - - - #{locationId,jdbcType=BIGINT}, - - - #{geojsonId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{parentId,jdbcType=VARCHAR}, - - - #{uuid,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{serverVersion,jdbcType=BIGINT}, - - - #{name,jdbcType=VARCHAR}, - - - #{version,jdbcType=INTEGER}, - - - #{dateCreated,jdbcType=TIMESTAMP}, - - - #{dateEdited,jdbcType=TIMESTAMP}, - - - - - - - update core.location_metadata - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.location_metadata (id, location_id, geojson_id, + type, parent_id, uuid, + status, server_version, name, + version, date_created, date_edited + ) + values (#{id,jdbcType=BIGINT}, #{locationId,jdbcType=BIGINT}, #{geojsonId,jdbcType=VARCHAR}, + #{type,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, + #{version,jdbcType=INTEGER}, #{dateCreated,jdbcType=TIMESTAMP}, #{dateEdited,jdbcType=TIMESTAMP} + ) + + + + insert into core.location_metadata + + + id, + + + location_id, + + + geojson_id, + + + type, + + + parent_id, + + + uuid, + + + status, + + + server_version, + + + name, + + + version, + + + date_created, + + + date_edited, + + + + + #{id,jdbcType=BIGINT}, + + + #{locationId,jdbcType=BIGINT}, + + + #{geojsonId,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{parentId,jdbcType=VARCHAR}, + + + #{uuid,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{serverVersion,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{version,jdbcType=INTEGER}, + + + #{dateCreated,jdbcType=TIMESTAMP}, + + + #{dateEdited,jdbcType=TIMESTAMP}, + + + + + + + update core.location_metadata + + + id = #{record.id,jdbcType=BIGINT}, + + + location_id = #{record.locationId,jdbcType=BIGINT}, + + + geojson_id = #{record.geojsonId,jdbcType=VARCHAR}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + parent_id = #{record.parentId,jdbcType=VARCHAR}, + + + uuid = #{record.uuid,jdbcType=VARCHAR}, + + + status = #{record.status,jdbcType=VARCHAR}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + version = #{record.version,jdbcType=INTEGER}, + + + date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, + + + + + + + + + update core.location_metadata + set id = #{record.id,jdbcType=BIGINT}, location_id = #{record.locationId,jdbcType=BIGINT}, - - geojson_id = #{record.geojsonId,jdbcType=VARCHAR}, - - type = #{record.type,jdbcType=VARCHAR}, - - parent_id = #{record.parentId,jdbcType=VARCHAR}, - - uuid = #{record.uuid,jdbcType=VARCHAR}, - - status = #{record.status,jdbcType=VARCHAR}, - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - name = #{record.name,jdbcType=VARCHAR}, - - version = #{record.version,jdbcType=INTEGER}, - - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - - - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, - - - - - - - - - update core.location_metadata - set id = #{record.id,jdbcType=BIGINT}, - location_id = #{record.locationId,jdbcType=BIGINT}, - geojson_id = #{record.geojsonId,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=VARCHAR}, - parent_id = #{record.parentId,jdbcType=VARCHAR}, - uuid = #{record.uuid,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=VARCHAR}, - server_version = #{record.serverVersion,jdbcType=BIGINT}, - name = #{record.name,jdbcType=VARCHAR}, - version = #{record.version,jdbcType=INTEGER}, - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP} - - - - - - - update core.location_metadata - - - location_id = #{locationId,jdbcType=BIGINT}, - - + date_edited = #{record.dateEdited,jdbcType=TIMESTAMP} + + + + + + + update core.location_metadata + + + location_id = #{locationId,jdbcType=BIGINT}, + + + geojson_id = #{geojsonId,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + parent_id = #{parentId,jdbcType=VARCHAR}, + + + uuid = #{uuid,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + name = #{name,jdbcType=VARCHAR}, + + + version = #{version,jdbcType=INTEGER}, + + + date_created = #{dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{dateEdited,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.location_metadata + set location_id = #{locationId,jdbcType=BIGINT}, geojson_id = #{geojsonId,jdbcType=VARCHAR}, - - type = #{type,jdbcType=VARCHAR}, - - parent_id = #{parentId,jdbcType=VARCHAR}, - - uuid = #{uuid,jdbcType=VARCHAR}, - - status = #{status,jdbcType=VARCHAR}, - - server_version = #{serverVersion,jdbcType=BIGINT}, - - name = #{name,jdbcType=VARCHAR}, - - version = #{version,jdbcType=INTEGER}, - - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - - - date_edited = #{dateEdited,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.location_metadata - set location_id = #{locationId,jdbcType=BIGINT}, - geojson_id = #{geojsonId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - parent_id = #{parentId,jdbcType=VARCHAR}, - uuid = #{uuid,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - server_version = #{serverVersion,jdbcType=BIGINT}, - name = #{name,jdbcType=VARCHAR}, - version = #{version,jdbcType=INTEGER}, - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{dateEdited,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - + date_edited = #{dateEdited,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationTagMapMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationTagMapMapper.xml index 457cd6dcf..735a12f8e 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationTagMapMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationTagMapMapper.xml @@ -1,195 +1,199 @@ - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + location_id, location_tag_id + + + + + delete from core.location_tag_map + + + + + + + insert into core.location_tag_map (location_id, location_tag_id) + values (#{locationId,jdbcType=BIGINT}, #{locationTagId,jdbcType=BIGINT}) + + + + insert into core.location_tag_map + + + location_id, + + + location_tag_id, + + + + + #{locationId,jdbcType=BIGINT}, + + + #{locationTagId,jdbcType=BIGINT}, + + + + + + + update core.location_tag_map + + + location_id = #{record.locationId,jdbcType=BIGINT}, + + + location_tag_id = #{record.locationTagId,jdbcType=BIGINT}, + + + + + + + + + update core.location_tag_map + set location_id = #{record.locationId,jdbcType=BIGINT}, + location_tag_id = #{record.locationTagId,jdbcType=BIGINT} + + - - - - - - location_id, location_tag_id - - - - - delete from core.location_tag_map - - - - - - - insert into core.location_tag_map (location_id, location_tag_id) - values (#{locationId,jdbcType=BIGINT}, #{locationTagId,jdbcType=BIGINT}) - - - - insert into core.location_tag_map - - - location_id, - - - location_tag_id, - - - - - #{locationId,jdbcType=BIGINT}, - - - #{locationTagId,jdbcType=BIGINT}, - - - - - - - update core.location_tag_map - - - location_id = #{record.locationId,jdbcType=BIGINT}, - - - location_tag_id = #{record.locationTagId,jdbcType=BIGINT}, - - - - - - - - - update core.location_tag_map - set location_id = #{record.locationId,jdbcType=BIGINT}, - location_tag_id = #{record.locationTagId,jdbcType=BIGINT} - - - - + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationTagMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationTagMapper.xml index caeb8c42a..ab7e3a6f5 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationTagMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/LocationTagMapper.xml @@ -1,271 +1,275 @@ - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, name, description, active + + + + + + delete from core.location_tag + where id = #{id,jdbcType=BIGINT} + + + + delete from core.location_tag + + - - - - - - id, name, description, active - - - - - - delete from core.location_tag - where id = #{id,jdbcType=BIGINT} - - - - delete from core.location_tag - - - - - - - insert into core.location_tag (id, name, description, - active) - values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, - #{active,jdbcType=BIT}) - - - - insert into core.location_tag - - - id, - - - name, - - - description, - - - active, - - - - - #{id,jdbcType=BIGINT}, - - - #{name,jdbcType=VARCHAR}, - - - #{description,jdbcType=VARCHAR}, - - - #{active,jdbcType=BIT}, - - - - - - - update core.location_tag - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.location_tag (id, name, description, + active) + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, + #{active,jdbcType=BIT}) + + + + insert into core.location_tag + + + id, + + + name, + + + description, + + + active, + + + + + #{id,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{active,jdbcType=BIT}, + + + + + + + update core.location_tag + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + active = #{record.active,jdbcType=BIT}, + + + + + + + + + update core.location_tag + set id = #{record.id,jdbcType=BIGINT}, name = #{record.name,jdbcType=VARCHAR}, - - description = #{record.description,jdbcType=VARCHAR}, - - - active = #{record.active,jdbcType=BIT}, - - - - - - - - - update core.location_tag - set id = #{record.id,jdbcType=BIGINT}, - name = #{record.name,jdbcType=VARCHAR}, - description = #{record.description,jdbcType=VARCHAR}, - active = #{record.active,jdbcType=BIT} - - - - - - - update core.location_tag - - - name = #{name,jdbcType=VARCHAR}, - - + active = #{record.active,jdbcType=BIT} + + + + + + + update core.location_tag + + + name = #{name,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + active = #{active,jdbcType=BIT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.location_tag + set name = #{name,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=BIT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.location_tag - set name = #{name,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR}, - active = #{active,jdbcType=BIT} - where id = #{id,jdbcType=BIGINT} - + active = #{active,jdbcType=BIT} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ManifestMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ManifestMapper.xml index 40b06227d..055bdff94 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ManifestMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ManifestMapper.xml @@ -1,341 +1,356 @@ - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler} + + + + + + - + + + + + id, json, app_version, app_id, created_at, updated_at + + + + + + delete from core.manifest + where id = #{id,jdbcType=BIGINT} + + + + delete from core.manifest + + - - - - - - id, json, app_version, app_id, created_at, updated_at - - - - - - delete from core.manifest - where id = #{id,jdbcType=BIGINT} - - - - delete from core.manifest - - - - - - - insert into core.manifest (id, json, - app_version, app_id, created_at, - updated_at) - values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler}, - #{appVersion,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, - #{updatedAt,jdbcType=TIMESTAMP}) - - - - insert into core.manifest - - - id, - - - json, - - - app_version, - - - app_id, - - - created_at, - - - updated_at, - - - - - #{id,jdbcType=BIGINT}, - - + + + + insert into core.manifest (id, json, + app_version, app_id, created_at, + updated_at) + values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler}, - - - #{appVersion,jdbcType=VARCHAR}, - - - #{appId,jdbcType=VARCHAR}, - - - #{createdAt,jdbcType=TIMESTAMP}, - - - #{updatedAt,jdbcType=TIMESTAMP}, - - - - - - - update core.manifest - - - id = #{record.id,jdbcType=BIGINT}, - - + #{appVersion,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, + #{updatedAt,jdbcType=TIMESTAMP}) + + + + insert into core.manifest + + + id, + + + json, + + + app_version, + + + app_id, + + + created_at, + + + updated_at, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler}, + + + #{appVersion,jdbcType=VARCHAR}, + + + #{appId,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + + + + + update core.manifest + + + id = #{record.id,jdbcType=BIGINT}, + + + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler}, + + + app_version = #{record.appVersion,jdbcType=VARCHAR}, + + + app_id = #{record.appId,jdbcType=VARCHAR}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + + + + + + + update core.manifest + set id = #{record.id,jdbcType=BIGINT}, json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler}, - - app_version = #{record.appVersion,jdbcType=VARCHAR}, - - app_id = #{record.appId,jdbcType=VARCHAR}, - - created_at = #{record.createdAt,jdbcType=TIMESTAMP}, - - - updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, - - - - - - - - - update core.manifest - set id = #{record.id,jdbcType=BIGINT}, - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler}, - app_version = #{record.appVersion,jdbcType=VARCHAR}, - app_id = #{record.appId,jdbcType=VARCHAR}, - created_at = #{record.createdAt,jdbcType=TIMESTAMP}, - updated_at = #{record.updatedAt,jdbcType=TIMESTAMP} - - - - - - - update core.manifest - - - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler}, - - + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP} + + + + + + + update core.manifest + + + json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler}, + + + app_version = #{appVersion,jdbcType=VARCHAR}, + + + app_id = #{appId,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.manifest + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler}, app_version = #{appVersion,jdbcType=VARCHAR}, - - app_id = #{appId,jdbcType=VARCHAR}, - - created_at = #{createdAt,jdbcType=TIMESTAMP}, - - - updated_at = #{updatedAt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.manifest - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ManifestTypeHandler}, - app_version = #{appVersion,jdbcType=VARCHAR}, - app_id = #{appId,jdbcType=VARCHAR}, - created_at = #{createdAt,jdbcType=TIMESTAMP}, - updated_at = #{updatedAt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - + updated_at = #{updatedAt,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/MultiMediaMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/MultiMediaMapper.xml index 629e329cc..0c6199ea5 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/MultiMediaMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/MultiMediaMapper.xml @@ -1,366 +1,370 @@ - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, document_id, case_id, provider_id, content_type, file_path, file_category, date_uploaded, + summary, original_file_name + + + + + + delete from core.multi_media + where id = #{id,jdbcType=BIGINT} + + + + delete from core.multi_media + + - - - - - - id, document_id, case_id, provider_id, content_type, file_path, file_category, date_uploaded, - summary, original_file_name - - - - - - delete from core.multi_media - where id = #{id,jdbcType=BIGINT} - - - - delete from core.multi_media - - - - - - - insert into core.multi_media (id, document_id, case_id, - provider_id, content_type, file_path, - file_category, date_uploaded, summary, - original_file_name) - values (#{id,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, - #{providerId,jdbcType=VARCHAR}, #{contentType,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR}, - #{fileCategory,jdbcType=VARCHAR}, #{dateUploaded,jdbcType=TIMESTAMP}, #{summary,jdbcType=VARCHAR}, - #{originalFileName,jdbcType=VARCHAR}) - - - - insert into core.multi_media - - - id, - - - document_id, - - - case_id, - - - provider_id, - - - content_type, - - - file_path, - - - file_category, - - - date_uploaded, - - - summary, - - - original_file_name, - - - - - #{id,jdbcType=BIGINT}, - - - #{documentId,jdbcType=VARCHAR}, - - - #{caseId,jdbcType=VARCHAR}, - - - #{providerId,jdbcType=VARCHAR}, - - - #{contentType,jdbcType=VARCHAR}, - - - #{filePath,jdbcType=VARCHAR}, - - - #{fileCategory,jdbcType=VARCHAR}, - - - #{dateUploaded,jdbcType=TIMESTAMP}, - - - #{summary,jdbcType=VARCHAR}, - - - #{originalFileName,jdbcType=VARCHAR}, - - - - - - - update core.multi_media - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.multi_media (id, document_id, case_id, + provider_id, content_type, file_path, + file_category, date_uploaded, summary, + original_file_name) + values (#{id,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, + #{providerId,jdbcType=VARCHAR}, #{contentType,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR}, + #{fileCategory,jdbcType=VARCHAR}, #{dateUploaded,jdbcType=TIMESTAMP}, #{summary,jdbcType=VARCHAR}, + #{originalFileName,jdbcType=VARCHAR}) + + + + insert into core.multi_media + + + id, + + + document_id, + + + case_id, + + + provider_id, + + + content_type, + + + file_path, + + + file_category, + + + date_uploaded, + + + summary, + + + original_file_name, + + + + + #{id,jdbcType=BIGINT}, + + + #{documentId,jdbcType=VARCHAR}, + + + #{caseId,jdbcType=VARCHAR}, + + + #{providerId,jdbcType=VARCHAR}, + + + #{contentType,jdbcType=VARCHAR}, + + + #{filePath,jdbcType=VARCHAR}, + + + #{fileCategory,jdbcType=VARCHAR}, + + + #{dateUploaded,jdbcType=TIMESTAMP}, + + + #{summary,jdbcType=VARCHAR}, + + + #{originalFileName,jdbcType=VARCHAR}, + + + + + + + update core.multi_media + + + id = #{record.id,jdbcType=BIGINT}, + + + document_id = #{record.documentId,jdbcType=VARCHAR}, + + + case_id = #{record.caseId,jdbcType=VARCHAR}, + + + provider_id = #{record.providerId,jdbcType=VARCHAR}, + + + content_type = #{record.contentType,jdbcType=VARCHAR}, + + + file_path = #{record.filePath,jdbcType=VARCHAR}, + + + file_category = #{record.fileCategory,jdbcType=VARCHAR}, + + + date_uploaded = #{record.dateUploaded,jdbcType=TIMESTAMP}, + + + summary = #{record.summary,jdbcType=VARCHAR}, + + + original_file_name = #{record.originalFileName,jdbcType=VARCHAR}, + + + + + + + + + update core.multi_media + set id = #{record.id,jdbcType=BIGINT}, document_id = #{record.documentId,jdbcType=VARCHAR}, - - case_id = #{record.caseId,jdbcType=VARCHAR}, - - provider_id = #{record.providerId,jdbcType=VARCHAR}, - - content_type = #{record.contentType,jdbcType=VARCHAR}, - - file_path = #{record.filePath,jdbcType=VARCHAR}, - - file_category = #{record.fileCategory,jdbcType=VARCHAR}, - - date_uploaded = #{record.dateUploaded,jdbcType=TIMESTAMP}, - - summary = #{record.summary,jdbcType=VARCHAR}, - - - original_file_name = #{record.originalFileName,jdbcType=VARCHAR}, - - - - - - - - - update core.multi_media - set id = #{record.id,jdbcType=BIGINT}, - document_id = #{record.documentId,jdbcType=VARCHAR}, - case_id = #{record.caseId,jdbcType=VARCHAR}, - provider_id = #{record.providerId,jdbcType=VARCHAR}, - content_type = #{record.contentType,jdbcType=VARCHAR}, - file_path = #{record.filePath,jdbcType=VARCHAR}, - file_category = #{record.fileCategory,jdbcType=VARCHAR}, - date_uploaded = #{record.dateUploaded,jdbcType=TIMESTAMP}, - summary = #{record.summary,jdbcType=VARCHAR}, - original_file_name = #{record.originalFileName,jdbcType=VARCHAR} - - - - - - - update core.multi_media - - - document_id = #{documentId,jdbcType=VARCHAR}, - - + original_file_name = #{record.originalFileName,jdbcType=VARCHAR} + + + + + + + update core.multi_media + + + document_id = #{documentId,jdbcType=VARCHAR}, + + + case_id = #{caseId,jdbcType=VARCHAR}, + + + provider_id = #{providerId,jdbcType=VARCHAR}, + + + content_type = #{contentType,jdbcType=VARCHAR}, + + + file_path = #{filePath,jdbcType=VARCHAR}, + + + file_category = #{fileCategory,jdbcType=VARCHAR}, + + + date_uploaded = #{dateUploaded,jdbcType=TIMESTAMP}, + + + summary = #{summary,jdbcType=VARCHAR}, + + + original_file_name = #{originalFileName,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.multi_media + set document_id = #{documentId,jdbcType=VARCHAR}, case_id = #{caseId,jdbcType=VARCHAR}, - - provider_id = #{providerId,jdbcType=VARCHAR}, - - content_type = #{contentType,jdbcType=VARCHAR}, - - file_path = #{filePath,jdbcType=VARCHAR}, - - file_category = #{fileCategory,jdbcType=VARCHAR}, - - date_uploaded = #{dateUploaded,jdbcType=TIMESTAMP}, - - summary = #{summary,jdbcType=VARCHAR}, - - - original_file_name = #{originalFileName,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.multi_media - set document_id = #{documentId,jdbcType=VARCHAR}, - case_id = #{caseId,jdbcType=VARCHAR}, - provider_id = #{providerId,jdbcType=VARCHAR}, - content_type = #{contentType,jdbcType=VARCHAR}, - file_path = #{filePath,jdbcType=VARCHAR}, - file_category = #{fileCategory,jdbcType=VARCHAR}, - date_uploaded = #{dateUploaded,jdbcType=TIMESTAMP}, - summary = #{summary,jdbcType=VARCHAR}, - original_file_name = #{originalFileName,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - + original_file_name = #{originalFileName,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/OrganizationLocationMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/OrganizationLocationMapper.xml index d0b50bb34..a6696afbc 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/OrganizationLocationMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/OrganizationLocationMapper.xml @@ -1,358 +1,376 @@ - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} + + + + + + - + + + + + id, organization_id, location_id, plan_id, from_date, to_date, duration + + + + + + delete from team.organization_location + where id = #{id,jdbcType=BIGINT} + + + + delete from team.organization_location + + - - - - - - id, organization_id, location_id, plan_id, from_date, to_date, duration - - - - - - delete from team.organization_location - where id = #{id,jdbcType=BIGINT} - - - - delete from team.organization_location - - - - - - - insert into team.organization_location (id, organization_id, location_id, - plan_id, from_date, to_date, - duration - ) - values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=BIGINT}, #{locationId,jdbcType=BIGINT}, - #{planId,jdbcType=BIGINT}, #{fromDate,jdbcType=DATE}, #{toDate,jdbcType=DATE}, - #{duration,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} - ) - - - - insert into team.organization_location - - - id, - - - organization_id, - - - location_id, - - - plan_id, - - - from_date, - - - to_date, - - - duration, - - - - - #{id,jdbcType=BIGINT}, - - - #{organizationId,jdbcType=BIGINT}, - - - #{locationId,jdbcType=BIGINT}, - - - #{planId,jdbcType=BIGINT}, - - - #{fromDate,jdbcType=DATE}, - - - #{toDate,jdbcType=DATE}, - - - #{duration,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler}, - - - - - - - update team.organization_location - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into team.organization_location (id, organization_id, location_id, + plan_id, from_date, to_date, + duration + ) + values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=BIGINT}, #{locationId,jdbcType=BIGINT}, + #{planId,jdbcType=BIGINT}, #{fromDate,jdbcType=DATE}, #{toDate,jdbcType=DATE}, + #{duration,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} + ) + + + + insert into team.organization_location + + + id, + + + organization_id, + + + location_id, + + + plan_id, + + + from_date, + + + to_date, + + + duration, + + + + + #{id,jdbcType=BIGINT}, + + + #{organizationId,jdbcType=BIGINT}, + + + #{locationId,jdbcType=BIGINT}, + + + #{planId,jdbcType=BIGINT}, + + + #{fromDate,jdbcType=DATE}, + + + #{toDate,jdbcType=DATE}, + + + #{duration,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler}, + + + + + + + update team.organization_location + + + id = #{record.id,jdbcType=BIGINT}, + + + organization_id = #{record.organizationId,jdbcType=BIGINT}, + + + location_id = #{record.locationId,jdbcType=BIGINT}, + + + plan_id = #{record.planId,jdbcType=BIGINT}, + + + from_date = #{record.fromDate,jdbcType=DATE}, + + + to_date = #{record.toDate,jdbcType=DATE}, + + + duration = + #{record.duration,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler}, + + + + + + + + + update team.organization_location + set id = #{record.id,jdbcType=BIGINT}, organization_id = #{record.organizationId,jdbcType=BIGINT}, - - location_id = #{record.locationId,jdbcType=BIGINT}, - - plan_id = #{record.planId,jdbcType=BIGINT}, - - from_date = #{record.fromDate,jdbcType=DATE}, - - to_date = #{record.toDate,jdbcType=DATE}, - - - duration = #{record.duration,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler}, - - - - - - - - - update team.organization_location - set id = #{record.id,jdbcType=BIGINT}, - organization_id = #{record.organizationId,jdbcType=BIGINT}, - location_id = #{record.locationId,jdbcType=BIGINT}, - plan_id = #{record.planId,jdbcType=BIGINT}, - from_date = #{record.fromDate,jdbcType=DATE}, - to_date = #{record.toDate,jdbcType=DATE}, - duration = #{record.duration,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} - - - - - - - update team.organization_location - - - organization_id = #{organizationId,jdbcType=BIGINT}, - - + duration = + #{record.duration,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} + + + + + + + update team.organization_location + + + organization_id = #{organizationId,jdbcType=BIGINT}, + + + location_id = #{locationId,jdbcType=BIGINT}, + + + plan_id = #{planId,jdbcType=BIGINT}, + + + from_date = #{fromDate,jdbcType=DATE}, + + + to_date = #{toDate,jdbcType=DATE}, + + + duration = + #{duration,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler}, + + + where id = #{id,jdbcType=BIGINT} + + + + update team.organization_location + set organization_id = #{organizationId,jdbcType=BIGINT}, location_id = #{locationId,jdbcType=BIGINT}, - - plan_id = #{planId,jdbcType=BIGINT}, - - from_date = #{fromDate,jdbcType=DATE}, - - to_date = #{toDate,jdbcType=DATE}, - - - duration = #{duration,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler}, - - - where id = #{id,jdbcType=BIGINT} - - - - update team.organization_location - set organization_id = #{organizationId,jdbcType=BIGINT}, - location_id = #{locationId,jdbcType=BIGINT}, - plan_id = #{planId,jdbcType=BIGINT}, - from_date = #{fromDate,jdbcType=DATE}, - to_date = #{toDate,jdbcType=DATE}, - duration = #{duration,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} - where id = #{id,jdbcType=BIGINT} - + duration = #{duration,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.DateRangeTypeHandler} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/OrganizationMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/OrganizationMapper.xml index 2b2cd6f91..425c256e3 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/OrganizationMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/OrganizationMapper.xml @@ -1,404 +1,422 @@ - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler} + + + + + + - + + + + + id, identifier, active, name, type, date_deleted, parent_id, date_created, date_edited, + server_version + + + + + + delete from team.organization + where id = #{id,jdbcType=BIGINT} + + + + delete from team.organization + + - - - - - - id, identifier, active, name, type, date_deleted, parent_id, date_created, date_edited, - server_version - - - - - - delete from team.organization - where id = #{id,jdbcType=BIGINT} - - - - delete from team.organization - - - - - - - insert into team.organization (id, identifier, active, - name, type, date_deleted, - parent_id, date_created, date_edited, - server_version) - values (#{id,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, #{active,jdbcType=BIT}, - #{name,jdbcType=VARCHAR}, #{type,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler}, #{dateDeleted,jdbcType=TIMESTAMP}, - #{parentId,jdbcType=BIGINT}, #{dateCreated,jdbcType=TIMESTAMP}, #{dateEdited,jdbcType=TIMESTAMP}, - #{serverVersion,jdbcType=BIGINT}) - - - - insert into team.organization - - - id, - - - identifier, - - - active, - - - name, - - - type, - - - date_deleted, - - - parent_id, - - - date_created, - - - date_edited, - - - server_version, - - - - - #{id,jdbcType=BIGINT}, - - - #{identifier,jdbcType=VARCHAR}, - - - #{active,jdbcType=BIT}, - - + + + + insert into team.organization (id, identifier, active, + name, type, date_deleted, + parent_id, date_created, date_edited, + server_version) + values (#{id,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, #{active,jdbcType=BIT}, #{name,jdbcType=VARCHAR}, - - #{type,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler}, - - #{dateDeleted,jdbcType=TIMESTAMP}, - - - #{parentId,jdbcType=BIGINT}, - - - #{dateCreated,jdbcType=TIMESTAMP}, - - - #{dateEdited,jdbcType=TIMESTAMP}, - - - #{serverVersion,jdbcType=BIGINT}, - - - - - - - update team.organization - - - id = #{record.id,jdbcType=BIGINT}, - - + #{parentId,jdbcType=BIGINT}, #{dateCreated,jdbcType=TIMESTAMP}, #{dateEdited,jdbcType=TIMESTAMP}, + #{serverVersion,jdbcType=BIGINT}) + + + + insert into team.organization + + + id, + + + identifier, + + + active, + + + name, + + + type, + + + date_deleted, + + + parent_id, + + + date_created, + + + date_edited, + + + server_version, + + + + + #{id,jdbcType=BIGINT}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{active,jdbcType=BIT}, + + + #{name,jdbcType=VARCHAR}, + + + #{type,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler}, + + + #{dateDeleted,jdbcType=TIMESTAMP}, + + + #{parentId,jdbcType=BIGINT}, + + + #{dateCreated,jdbcType=TIMESTAMP}, + + + #{dateEdited,jdbcType=TIMESTAMP}, + + + #{serverVersion,jdbcType=BIGINT}, + + + + + + + update team.organization + + + id = #{record.id,jdbcType=BIGINT}, + + + identifier = #{record.identifier,jdbcType=VARCHAR}, + + + active = #{record.active,jdbcType=BIT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + type = + #{record.type,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler}, + + + date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, + + + parent_id = #{record.parentId,jdbcType=BIGINT}, + + + date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + + + + + + + update team.organization + set id = #{record.id,jdbcType=BIGINT}, identifier = #{record.identifier,jdbcType=VARCHAR}, - - active = #{record.active,jdbcType=BIT}, - - name = #{record.name,jdbcType=VARCHAR}, - - type = #{record.type,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler}, - - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - - parent_id = #{record.parentId,jdbcType=BIGINT}, - - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, - - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - - - - - - - - update team.organization - set id = #{record.id,jdbcType=BIGINT}, - identifier = #{record.identifier,jdbcType=VARCHAR}, - active = #{record.active,jdbcType=BIT}, - name = #{record.name,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler}, - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - parent_id = #{record.parentId,jdbcType=BIGINT}, - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, - server_version = #{record.serverVersion,jdbcType=BIGINT} - - - - - - - update team.organization - - - identifier = #{identifier,jdbcType=VARCHAR}, - - + server_version = #{record.serverVersion,jdbcType=BIGINT} + + + + + + + update team.organization + + + identifier = #{identifier,jdbcType=VARCHAR}, + + + active = #{active,jdbcType=BIT}, + + + name = #{name,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler}, + + + date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, + + + parent_id = #{parentId,jdbcType=BIGINT}, + + + date_created = #{dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{dateEdited,jdbcType=TIMESTAMP}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update team.organization + set identifier = #{identifier,jdbcType=VARCHAR}, active = #{active,jdbcType=BIT}, - - name = #{name,jdbcType=VARCHAR}, - - type = #{type,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler}, - - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - - parent_id = #{parentId,jdbcType=BIGINT}, - - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - - date_edited = #{dateEdited,jdbcType=TIMESTAMP}, - - - server_version = #{serverVersion,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update team.organization - set identifier = #{identifier,jdbcType=VARCHAR}, - active = #{active,jdbcType=BIT}, - name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.CodeSystemTypeHandler}, - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - parent_id = #{parentId,jdbcType=BIGINT}, - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{dateEdited,jdbcType=TIMESTAMP}, - server_version = #{serverVersion,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - + server_version = #{serverVersion,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/PlanMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/PlanMapper.xml index a499ec533..22663d796 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/PlanMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/PlanMapper.xml @@ -1,371 +1,386 @@ - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler} + + + + + + - + + + + + id, identifier, json, date_deleted, server_version, experimental, date_created, date_edited + + + + + + delete from core.plan + where id = #{id,jdbcType=BIGINT} + + + + delete from core.plan + + - - - - - - id, identifier, json, date_deleted, server_version, experimental, date_created, date_edited - - - - - - delete from core.plan - where id = #{id,jdbcType=BIGINT} - - - - delete from core.plan - - - - - - - insert into core.plan (id, identifier, json, - date_deleted, server_version, experimental, - date_created, date_edited) - values (#{id,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler}, - #{dateDeleted,jdbcType=TIMESTAMP}, #{serverVersion,jdbcType=BIGINT}, #{experimental,jdbcType=BIT}, - #{dateCreated,jdbcType=TIMESTAMP}, #{dateEdited,jdbcType=TIMESTAMP}) - - - - insert into core.plan - - - id, - - - identifier, - - - json, - - - date_deleted, - - - server_version, - - - experimental, - - - date_created, - - - date_edited, - - - - - #{id,jdbcType=BIGINT}, - - - #{identifier,jdbcType=VARCHAR}, - - + + + + insert into core.plan (id, identifier, json, + date_deleted, server_version, experimental, + date_created, date_edited) + values (#{id,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler}, - - - #{dateDeleted,jdbcType=TIMESTAMP}, - - - #{serverVersion,jdbcType=BIGINT}, - - - #{experimental,jdbcType=BIT}, - - - #{dateCreated,jdbcType=TIMESTAMP}, - - - #{dateEdited,jdbcType=TIMESTAMP}, - - - - - - - update core.plan - - - id = #{record.id,jdbcType=BIGINT}, - - + #{dateDeleted,jdbcType=TIMESTAMP}, #{serverVersion,jdbcType=BIGINT}, #{experimental,jdbcType=BIT}, + #{dateCreated,jdbcType=TIMESTAMP}, #{dateEdited,jdbcType=TIMESTAMP}) + + + + insert into core.plan + + + id, + + + identifier, + + + json, + + + date_deleted, + + + server_version, + + + experimental, + + + date_created, + + + date_edited, + + + + + #{id,jdbcType=BIGINT}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler}, + + + #{dateDeleted,jdbcType=TIMESTAMP}, + + + #{serverVersion,jdbcType=BIGINT}, + + + #{experimental,jdbcType=BIT}, + + + #{dateCreated,jdbcType=TIMESTAMP}, + + + #{dateEdited,jdbcType=TIMESTAMP}, + + + + + + + update core.plan + + + id = #{record.id,jdbcType=BIGINT}, + + + identifier = #{record.identifier,jdbcType=VARCHAR}, + + + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler}, + + + date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + experimental = #{record.experimental,jdbcType=BIT}, + + + date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, + + + + + + + + + update core.plan + set id = #{record.id,jdbcType=BIGINT}, identifier = #{record.identifier,jdbcType=VARCHAR}, - - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler}, - - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - experimental = #{record.experimental,jdbcType=BIT}, - - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - - - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, - - - - - - - - - update core.plan - set id = #{record.id,jdbcType=BIGINT}, - identifier = #{record.identifier,jdbcType=VARCHAR}, - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler}, - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - server_version = #{record.serverVersion,jdbcType=BIGINT}, - experimental = #{record.experimental,jdbcType=BIT}, - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP} - - - - - - - update core.plan - - - identifier = #{identifier,jdbcType=VARCHAR}, - - + date_edited = #{record.dateEdited,jdbcType=TIMESTAMP} + + + + + + + update core.plan + + + identifier = #{identifier,jdbcType=VARCHAR}, + + + json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler}, + + + date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + experimental = #{experimental,jdbcType=BIT}, + + + date_created = #{dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{dateEdited,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.plan + set identifier = #{identifier,jdbcType=VARCHAR}, json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler}, - - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - - server_version = #{serverVersion,jdbcType=BIGINT}, - - experimental = #{experimental,jdbcType=BIT}, - - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - - - date_edited = #{dateEdited,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.plan - set identifier = #{identifier,jdbcType=VARCHAR}, - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.PlanTypeHandler}, - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - server_version = #{serverVersion,jdbcType=BIGINT}, - experimental = #{experimental,jdbcType=BIT}, - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{dateEdited,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - + date_edited = #{dateEdited,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/PlanMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/PlanMetadataMapper.xml index 42d8cf486..2ce0fef99 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/PlanMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/PlanMetadataMapper.xml @@ -1,208 +1,212 @@ - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + operational_area_id, identifier, plan_id + + + + + delete from core.plan_metadata + + - - - - - - operational_area_id, identifier, plan_id - - - - - delete from core.plan_metadata - - - - - - - insert into core.plan_metadata (operational_area_id, identifier, plan_id - ) - values (#{operationalAreaId,jdbcType=VARCHAR}, #{identifier,jdbcType=VARCHAR}, #{planId,jdbcType=BIGINT} - ) - - - - insert into core.plan_metadata - - - operational_area_id, - - - identifier, - - - plan_id, - - - - - #{operationalAreaId,jdbcType=VARCHAR}, - - - #{identifier,jdbcType=VARCHAR}, - - - #{planId,jdbcType=BIGINT}, - - - - - - - update core.plan_metadata - - - operational_area_id = #{record.operationalAreaId,jdbcType=VARCHAR}, - - + + + + insert into core.plan_metadata (operational_area_id, identifier, plan_id + ) + values (#{operationalAreaId,jdbcType=VARCHAR}, #{identifier,jdbcType=VARCHAR}, #{planId,jdbcType=BIGINT} + ) + + + + insert into core.plan_metadata + + + operational_area_id, + + + identifier, + + + plan_id, + + + + + #{operationalAreaId,jdbcType=VARCHAR}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{planId,jdbcType=BIGINT}, + + + + + + + update core.plan_metadata + + + operational_area_id = #{record.operationalAreaId,jdbcType=VARCHAR}, + + + identifier = #{record.identifier,jdbcType=VARCHAR}, + + + plan_id = #{record.planId,jdbcType=BIGINT}, + + + + + + + + + update core.plan_metadata + set operational_area_id = #{record.operationalAreaId,jdbcType=VARCHAR}, identifier = #{record.identifier,jdbcType=VARCHAR}, - - - plan_id = #{record.planId,jdbcType=BIGINT}, - - - - - - - - - update core.plan_metadata - set operational_area_id = #{record.operationalAreaId,jdbcType=VARCHAR}, - identifier = #{record.identifier,jdbcType=VARCHAR}, - plan_id = #{record.planId,jdbcType=BIGINT} - - - - + plan_id = #{record.planId,jdbcType=BIGINT} + + + + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/PractitionerMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/PractitionerMapper.xml index d37ff54d6..4446b145d 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/PractitionerMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/PractitionerMapper.xml @@ -1,366 +1,370 @@ - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, identifier, active, name, user_id, username, date_deleted, date_created, date_edited, + server_version + + + + + + delete from team.practitioner + where id = #{id,jdbcType=BIGINT} + + + + delete from team.practitioner + + - - - - - - id, identifier, active, name, user_id, username, date_deleted, date_created, date_edited, - server_version - - - - - - delete from team.practitioner - where id = #{id,jdbcType=BIGINT} - - - - delete from team.practitioner - - - - - - - insert into team.practitioner (id, identifier, active, - name, user_id, username, - date_deleted, date_created, date_edited, - server_version) - values (#{id,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, #{active,jdbcType=BIT}, - #{name,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, - #{dateDeleted,jdbcType=TIMESTAMP}, #{dateCreated,jdbcType=TIMESTAMP}, #{dateEdited,jdbcType=TIMESTAMP}, - #{serverVersion,jdbcType=BIGINT}) - - - - insert into team.practitioner - - - id, - - - identifier, - - - active, - - - name, - - - user_id, - - - username, - - - date_deleted, - - - date_created, - - - date_edited, - - - server_version, - - - - - #{id,jdbcType=BIGINT}, - - - #{identifier,jdbcType=VARCHAR}, - - - #{active,jdbcType=BIT}, - - - #{name,jdbcType=VARCHAR}, - - - #{userId,jdbcType=VARCHAR}, - - - #{username,jdbcType=VARCHAR}, - - - #{dateDeleted,jdbcType=TIMESTAMP}, - - - #{dateCreated,jdbcType=TIMESTAMP}, - - - #{dateEdited,jdbcType=TIMESTAMP}, - - - #{serverVersion,jdbcType=BIGINT}, - - - - - - - update team.practitioner - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into team.practitioner (id, identifier, active, + name, user_id, username, + date_deleted, date_created, date_edited, + server_version) + values (#{id,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, #{active,jdbcType=BIT}, + #{name,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, + #{dateDeleted,jdbcType=TIMESTAMP}, #{dateCreated,jdbcType=TIMESTAMP}, #{dateEdited,jdbcType=TIMESTAMP}, + #{serverVersion,jdbcType=BIGINT}) + + + + insert into team.practitioner + + + id, + + + identifier, + + + active, + + + name, + + + user_id, + + + username, + + + date_deleted, + + + date_created, + + + date_edited, + + + server_version, + + + + + #{id,jdbcType=BIGINT}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{active,jdbcType=BIT}, + + + #{name,jdbcType=VARCHAR}, + + + #{userId,jdbcType=VARCHAR}, + + + #{username,jdbcType=VARCHAR}, + + + #{dateDeleted,jdbcType=TIMESTAMP}, + + + #{dateCreated,jdbcType=TIMESTAMP}, + + + #{dateEdited,jdbcType=TIMESTAMP}, + + + #{serverVersion,jdbcType=BIGINT}, + + + + + + + update team.practitioner + + + id = #{record.id,jdbcType=BIGINT}, + + + identifier = #{record.identifier,jdbcType=VARCHAR}, + + + active = #{record.active,jdbcType=BIT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + user_id = #{record.userId,jdbcType=VARCHAR}, + + + username = #{record.username,jdbcType=VARCHAR}, + + + date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, + + + date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + + + + + + + update team.practitioner + set id = #{record.id,jdbcType=BIGINT}, identifier = #{record.identifier,jdbcType=VARCHAR}, - - active = #{record.active,jdbcType=BIT}, - - name = #{record.name,jdbcType=VARCHAR}, - - user_id = #{record.userId,jdbcType=VARCHAR}, - - username = #{record.username,jdbcType=VARCHAR}, - - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, - - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - - - - - - - - update team.practitioner - set id = #{record.id,jdbcType=BIGINT}, - identifier = #{record.identifier,jdbcType=VARCHAR}, - active = #{record.active,jdbcType=BIT}, - name = #{record.name,jdbcType=VARCHAR}, - user_id = #{record.userId,jdbcType=VARCHAR}, - username = #{record.username,jdbcType=VARCHAR}, - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, - server_version = #{record.serverVersion,jdbcType=BIGINT} - - - - - - - update team.practitioner - - - identifier = #{identifier,jdbcType=VARCHAR}, - - + server_version = #{record.serverVersion,jdbcType=BIGINT} + + + + + + + update team.practitioner + + + identifier = #{identifier,jdbcType=VARCHAR}, + + + active = #{active,jdbcType=BIT}, + + + name = #{name,jdbcType=VARCHAR}, + + + user_id = #{userId,jdbcType=VARCHAR}, + + + username = #{username,jdbcType=VARCHAR}, + + + date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, + + + date_created = #{dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{dateEdited,jdbcType=TIMESTAMP}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update team.practitioner + set identifier = #{identifier,jdbcType=VARCHAR}, active = #{active,jdbcType=BIT}, - - name = #{name,jdbcType=VARCHAR}, - - user_id = #{userId,jdbcType=VARCHAR}, - - username = #{username,jdbcType=VARCHAR}, - - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - - date_edited = #{dateEdited,jdbcType=TIMESTAMP}, - - - server_version = #{serverVersion,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update team.practitioner - set identifier = #{identifier,jdbcType=VARCHAR}, - active = #{active,jdbcType=BIT}, - name = #{name,jdbcType=VARCHAR}, - user_id = #{userId,jdbcType=VARCHAR}, - username = #{username,jdbcType=VARCHAR}, - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{dateEdited,jdbcType=TIMESTAMP}, - server_version = #{serverVersion,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - + server_version = #{serverVersion,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/PractitionerRoleMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/PractitionerRoleMapper.xml index 2a73961c6..29ece51f5 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/PractitionerRoleMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/PractitionerRoleMapper.xml @@ -1,303 +1,307 @@ - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, identifier, active, organization_id, practitioner_id, code + + + + + + delete from team.practitioner_role + where id = #{id,jdbcType=BIGINT} + + + + delete from team.practitioner_role + + - - - - - - id, identifier, active, organization_id, practitioner_id, code - - - - - - delete from team.practitioner_role - where id = #{id,jdbcType=BIGINT} - - - - delete from team.practitioner_role - - - - - - - insert into team.practitioner_role (id, identifier, active, - organization_id, practitioner_id, code - ) - values (#{id,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, #{active,jdbcType=BIT}, - #{organizationId,jdbcType=BIGINT}, #{practitionerId,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR} - ) - - - - insert into team.practitioner_role - - - id, - - - identifier, - - - active, - - - organization_id, - - - practitioner_id, - - - code, - - - - - #{id,jdbcType=BIGINT}, - - - #{identifier,jdbcType=VARCHAR}, - - - #{active,jdbcType=BIT}, - - - #{organizationId,jdbcType=BIGINT}, - - - #{practitionerId,jdbcType=BIGINT}, - - - #{code,jdbcType=VARCHAR}, - - - - - - - update team.practitioner_role - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into team.practitioner_role (id, identifier, active, + organization_id, practitioner_id, code + ) + values (#{id,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, #{active,jdbcType=BIT}, + #{organizationId,jdbcType=BIGINT}, #{practitionerId,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR} + ) + + + + insert into team.practitioner_role + + + id, + + + identifier, + + + active, + + + organization_id, + + + practitioner_id, + + + code, + + + + + #{id,jdbcType=BIGINT}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{active,jdbcType=BIT}, + + + #{organizationId,jdbcType=BIGINT}, + + + #{practitionerId,jdbcType=BIGINT}, + + + #{code,jdbcType=VARCHAR}, + + + + + + + update team.practitioner_role + + + id = #{record.id,jdbcType=BIGINT}, + + + identifier = #{record.identifier,jdbcType=VARCHAR}, + + + active = #{record.active,jdbcType=BIT}, + + + organization_id = #{record.organizationId,jdbcType=BIGINT}, + + + practitioner_id = #{record.practitionerId,jdbcType=BIGINT}, + + + code = #{record.code,jdbcType=VARCHAR}, + + + + + + + + + update team.practitioner_role + set id = #{record.id,jdbcType=BIGINT}, identifier = #{record.identifier,jdbcType=VARCHAR}, - - active = #{record.active,jdbcType=BIT}, - - organization_id = #{record.organizationId,jdbcType=BIGINT}, - - practitioner_id = #{record.practitionerId,jdbcType=BIGINT}, - - - code = #{record.code,jdbcType=VARCHAR}, - - - - - - - - - update team.practitioner_role - set id = #{record.id,jdbcType=BIGINT}, - identifier = #{record.identifier,jdbcType=VARCHAR}, - active = #{record.active,jdbcType=BIT}, - organization_id = #{record.organizationId,jdbcType=BIGINT}, - practitioner_id = #{record.practitionerId,jdbcType=BIGINT}, - code = #{record.code,jdbcType=VARCHAR} - - - - - - - update team.practitioner_role - - - identifier = #{identifier,jdbcType=VARCHAR}, - - + code = #{record.code,jdbcType=VARCHAR} + + + + + + + update team.practitioner_role + + + identifier = #{identifier,jdbcType=VARCHAR}, + + + active = #{active,jdbcType=BIT}, + + + organization_id = #{organizationId,jdbcType=BIGINT}, + + + practitioner_id = #{practitionerId,jdbcType=BIGINT}, + + + code = #{code,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + update team.practitioner_role + set identifier = #{identifier,jdbcType=VARCHAR}, active = #{active,jdbcType=BIT}, - - organization_id = #{organizationId,jdbcType=BIGINT}, - - practitioner_id = #{practitionerId,jdbcType=BIGINT}, - - - code = #{code,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - - update team.practitioner_role - set identifier = #{identifier,jdbcType=VARCHAR}, - active = #{active,jdbcType=BIT}, - organization_id = #{organizationId,jdbcType=BIGINT}, - practitioner_id = #{practitionerId,jdbcType=BIGINT}, - code = #{code,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - + code = #{code,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ProductCatalogueMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ProductCatalogueMapper.xml index adae698d8..a8a24fb5e 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ProductCatalogueMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ProductCatalogueMapper.xml @@ -1,322 +1,342 @@ - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler} + + + + + + - + + + + + unique_id, product_name, json, server_version + + + + + + delete from core.product_catalogue + where unique_id = #{uniqueId,jdbcType=BIGINT} + + + + delete from core.product_catalogue + + - - - - - - unique_id, product_name, json, server_version - - - - - - delete from core.product_catalogue - where unique_id = #{uniqueId,jdbcType=BIGINT} - - - - delete from core.product_catalogue - - - - - - - insert into core.product_catalogue (unique_id, product_name, json, - server_version) - values (#{uniqueId,jdbcType=BIGINT}, #{productName,jdbcType=VARCHAR}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler}, - #{serverVersion,jdbcType=BIGINT}) - - - - insert into core.product_catalogue - - - unique_id, - - - product_name, - - - json, - - - server_version, - - - - - #{uniqueId,jdbcType=BIGINT}, - - - #{productName,jdbcType=VARCHAR}, - - + + + + insert into core.product_catalogue (unique_id, product_name, json, + server_version) + values (#{uniqueId,jdbcType=BIGINT}, #{productName,jdbcType=VARCHAR}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler}, - - - #{serverVersion,jdbcType=BIGINT}, - - - - - - - update core.product_catalogue - - - unique_id = #{record.uniqueId,jdbcType=BIGINT}, - - + #{serverVersion,jdbcType=BIGINT}) + + + + insert into core.product_catalogue + + + unique_id, + + + product_name, + + + json, + + + server_version, + + + + + #{uniqueId,jdbcType=BIGINT}, + + + #{productName,jdbcType=VARCHAR}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler}, + + + #{serverVersion,jdbcType=BIGINT}, + + + + + + + update core.product_catalogue + + + unique_id = #{record.uniqueId,jdbcType=BIGINT}, + + + product_name = #{record.productName,jdbcType=VARCHAR}, + + + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + + + + + + + update core.product_catalogue + set unique_id = #{record.uniqueId,jdbcType=BIGINT}, product_name = #{record.productName,jdbcType=VARCHAR}, - - - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler}, - - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - - - - - - - - update core.product_catalogue - set unique_id = #{record.uniqueId,jdbcType=BIGINT}, - product_name = #{record.productName,jdbcType=VARCHAR}, - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler}, - server_version = #{record.serverVersion,jdbcType=BIGINT} - - - - - - - update core.product_catalogue - - - product_name = #{productName,jdbcType=VARCHAR}, - - + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler}, + server_version = #{record.serverVersion,jdbcType=BIGINT} + + + + + + + update core.product_catalogue + + + product_name = #{productName,jdbcType=VARCHAR}, + + + json = + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + where unique_id = #{uniqueId,jdbcType=BIGINT} + + + + update core.product_catalogue + set product_name = #{productName,jdbcType=VARCHAR}, json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler}, - - - server_version = #{serverVersion,jdbcType=BIGINT}, - - - where unique_id = #{uniqueId,jdbcType=BIGINT} - - - - update core.product_catalogue - set product_name = #{productName,jdbcType=VARCHAR}, - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ProductCatalogueTypeHandler}, - server_version = #{serverVersion,jdbcType=BIGINT} - where unique_id = #{uniqueId,jdbcType=BIGINT} - + server_version = #{serverVersion,jdbcType=BIGINT} + where unique_id = #{uniqueId,jdbcType=BIGINT} + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ReportMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ReportMapper.xml index 828a9824b..df57ade80 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ReportMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ReportMapper.xml @@ -1,294 +1,309 @@ - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler} + + + + + + - + + + + + id, json, server_version + + + + + + delete from core.report + where id = #{id,jdbcType=BIGINT} + + + + delete from core.report + + - - - - - - id, json, server_version - - - - - - delete from core.report - where id = #{id,jdbcType=BIGINT} - - - - delete from core.report - - - - - - - insert into core.report (id, json, - server_version) - values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler}, - #{serverVersion,jdbcType=BIGINT}) - - - - insert into core.report - - - id, - - - json, - - - server_version, - - - - - #{id,jdbcType=BIGINT}, - - + + + + insert into core.report (id, json, + server_version) + values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler}, - - - #{serverVersion,jdbcType=BIGINT}, - - - - - - - update core.report - - - id = #{record.id,jdbcType=BIGINT}, - - + #{serverVersion,jdbcType=BIGINT}) + + + + insert into core.report + + + id, + + + json, + + + server_version, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler}, + + + #{serverVersion,jdbcType=BIGINT}, + + + + + + + update core.report + + + id = #{record.id,jdbcType=BIGINT}, + + + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + + + + + + + update core.report + set id = #{record.id,jdbcType=BIGINT}, json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler}, - - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - - - - - - - - update core.report - set id = #{record.id,jdbcType=BIGINT}, - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler}, - server_version = #{record.serverVersion,jdbcType=BIGINT} - - - - - - - update core.report - - - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler}, - - - server_version = #{serverVersion,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.report - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler}, - server_version = #{serverVersion,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - + server_version = #{record.serverVersion,jdbcType=BIGINT} + + + + + + + update core.report + + + json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.report + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ReportTypeHandler}, + server_version = #{serverVersion,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ReportMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ReportMetadataMapper.xml index d9f03d118..ba8e18711 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ReportMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ReportMetadataMapper.xml @@ -1,413 +1,417 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, report_id, document_id, form_submission_id, base_entity_id, server_version, report_type, + report_date, provider_id, location_id, team, team_id, date_edited + + + + + + delete from core.report_metadata + where id = #{id,jdbcType=BIGINT} + + + + delete from core.report_metadata + + - - - - - - id, report_id, document_id, form_submission_id, base_entity_id, server_version, report_type, - report_date, provider_id, location_id, team, team_id, date_edited - - - - - - delete from core.report_metadata - where id = #{id,jdbcType=BIGINT} - - - - delete from core.report_metadata - - - - - - - insert into core.report_metadata (id, report_id, document_id, - form_submission_id, base_entity_id, server_version, - report_type, report_date, provider_id, - location_id, team, team_id, - date_edited) - values (#{id,jdbcType=BIGINT}, #{reportId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, - #{formSubmissionId,jdbcType=VARCHAR}, #{baseEntityId,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, - #{reportType,jdbcType=VARCHAR}, #{reportDate,jdbcType=DATE}, #{providerId,jdbcType=VARCHAR}, - #{locationId,jdbcType=VARCHAR}, #{team,jdbcType=VARCHAR}, #{teamId,jdbcType=VARCHAR}, - #{dateEdited,jdbcType=DATE}) - - - - insert into core.report_metadata - - - id, - - - report_id, - - - document_id, - - - form_submission_id, - - - base_entity_id, - - - server_version, - - - report_type, - - - report_date, - - - provider_id, - - - location_id, - - - team, - - - team_id, - - - date_edited, - - - - - #{id,jdbcType=BIGINT}, - - - #{reportId,jdbcType=BIGINT}, - - - #{documentId,jdbcType=VARCHAR}, - - - #{formSubmissionId,jdbcType=VARCHAR}, - - - #{baseEntityId,jdbcType=VARCHAR}, - - - #{serverVersion,jdbcType=BIGINT}, - - - #{reportType,jdbcType=VARCHAR}, - - - #{reportDate,jdbcType=DATE}, - - - #{providerId,jdbcType=VARCHAR}, - - - #{locationId,jdbcType=VARCHAR}, - - - #{team,jdbcType=VARCHAR}, - - - #{teamId,jdbcType=VARCHAR}, - - - #{dateEdited,jdbcType=DATE}, - - - - - - - update core.report_metadata - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.report_metadata (id, report_id, document_id, + form_submission_id, base_entity_id, server_version, + report_type, report_date, provider_id, + location_id, team, team_id, + date_edited) + values (#{id,jdbcType=BIGINT}, #{reportId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, + #{formSubmissionId,jdbcType=VARCHAR}, #{baseEntityId,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, + #{reportType,jdbcType=VARCHAR}, #{reportDate,jdbcType=DATE}, #{providerId,jdbcType=VARCHAR}, + #{locationId,jdbcType=VARCHAR}, #{team,jdbcType=VARCHAR}, #{teamId,jdbcType=VARCHAR}, + #{dateEdited,jdbcType=DATE}) + + + + insert into core.report_metadata + + + id, + + + report_id, + + + document_id, + + + form_submission_id, + + + base_entity_id, + + + server_version, + + + report_type, + + + report_date, + + + provider_id, + + + location_id, + + + team, + + + team_id, + + + date_edited, + + + + + #{id,jdbcType=BIGINT}, + + + #{reportId,jdbcType=BIGINT}, + + + #{documentId,jdbcType=VARCHAR}, + + + #{formSubmissionId,jdbcType=VARCHAR}, + + + #{baseEntityId,jdbcType=VARCHAR}, + + + #{serverVersion,jdbcType=BIGINT}, + + + #{reportType,jdbcType=VARCHAR}, + + + #{reportDate,jdbcType=DATE}, + + + #{providerId,jdbcType=VARCHAR}, + + + #{locationId,jdbcType=VARCHAR}, + + + #{team,jdbcType=VARCHAR}, + + + #{teamId,jdbcType=VARCHAR}, + + + #{dateEdited,jdbcType=DATE}, + + + + + + + update core.report_metadata + + + id = #{record.id,jdbcType=BIGINT}, + + + report_id = #{record.reportId,jdbcType=BIGINT}, + + + document_id = #{record.documentId,jdbcType=VARCHAR}, + + + form_submission_id = #{record.formSubmissionId,jdbcType=VARCHAR}, + + + base_entity_id = #{record.baseEntityId,jdbcType=VARCHAR}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + report_type = #{record.reportType,jdbcType=VARCHAR}, + + + report_date = #{record.reportDate,jdbcType=DATE}, + + + provider_id = #{record.providerId,jdbcType=VARCHAR}, + + + location_id = #{record.locationId,jdbcType=VARCHAR}, + + + team = #{record.team,jdbcType=VARCHAR}, + + + team_id = #{record.teamId,jdbcType=VARCHAR}, + + + date_edited = #{record.dateEdited,jdbcType=DATE}, + + + + + + + + + update core.report_metadata + set id = #{record.id,jdbcType=BIGINT}, report_id = #{record.reportId,jdbcType=BIGINT}, - - document_id = #{record.documentId,jdbcType=VARCHAR}, - - form_submission_id = #{record.formSubmissionId,jdbcType=VARCHAR}, - - base_entity_id = #{record.baseEntityId,jdbcType=VARCHAR}, - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - report_type = #{record.reportType,jdbcType=VARCHAR}, - - report_date = #{record.reportDate,jdbcType=DATE}, - - provider_id = #{record.providerId,jdbcType=VARCHAR}, - - location_id = #{record.locationId,jdbcType=VARCHAR}, - - team = #{record.team,jdbcType=VARCHAR}, - - team_id = #{record.teamId,jdbcType=VARCHAR}, - - - date_edited = #{record.dateEdited,jdbcType=DATE}, - - - - - - - - - update core.report_metadata - set id = #{record.id,jdbcType=BIGINT}, - report_id = #{record.reportId,jdbcType=BIGINT}, - document_id = #{record.documentId,jdbcType=VARCHAR}, - form_submission_id = #{record.formSubmissionId,jdbcType=VARCHAR}, - base_entity_id = #{record.baseEntityId,jdbcType=VARCHAR}, - server_version = #{record.serverVersion,jdbcType=BIGINT}, - report_type = #{record.reportType,jdbcType=VARCHAR}, - report_date = #{record.reportDate,jdbcType=DATE}, - provider_id = #{record.providerId,jdbcType=VARCHAR}, - location_id = #{record.locationId,jdbcType=VARCHAR}, - team = #{record.team,jdbcType=VARCHAR}, - team_id = #{record.teamId,jdbcType=VARCHAR}, - date_edited = #{record.dateEdited,jdbcType=DATE} - - - - - - - update core.report_metadata - - - report_id = #{reportId,jdbcType=BIGINT}, - - + date_edited = #{record.dateEdited,jdbcType=DATE} + + + + + + + update core.report_metadata + + + report_id = #{reportId,jdbcType=BIGINT}, + + + document_id = #{documentId,jdbcType=VARCHAR}, + + + form_submission_id = #{formSubmissionId,jdbcType=VARCHAR}, + + + base_entity_id = #{baseEntityId,jdbcType=VARCHAR}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + report_type = #{reportType,jdbcType=VARCHAR}, + + + report_date = #{reportDate,jdbcType=DATE}, + + + provider_id = #{providerId,jdbcType=VARCHAR}, + + + location_id = #{locationId,jdbcType=VARCHAR}, + + + team = #{team,jdbcType=VARCHAR}, + + + team_id = #{teamId,jdbcType=VARCHAR}, + + + date_edited = #{dateEdited,jdbcType=DATE}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.report_metadata + set report_id = #{reportId,jdbcType=BIGINT}, document_id = #{documentId,jdbcType=VARCHAR}, - - form_submission_id = #{formSubmissionId,jdbcType=VARCHAR}, - - base_entity_id = #{baseEntityId,jdbcType=VARCHAR}, - - server_version = #{serverVersion,jdbcType=BIGINT}, - - report_type = #{reportType,jdbcType=VARCHAR}, - - report_date = #{reportDate,jdbcType=DATE}, - - provider_id = #{providerId,jdbcType=VARCHAR}, - - location_id = #{locationId,jdbcType=VARCHAR}, - - team = #{team,jdbcType=VARCHAR}, - - team_id = #{teamId,jdbcType=VARCHAR}, - - - date_edited = #{dateEdited,jdbcType=DATE}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.report_metadata - set report_id = #{reportId,jdbcType=BIGINT}, - document_id = #{documentId,jdbcType=VARCHAR}, - form_submission_id = #{formSubmissionId,jdbcType=VARCHAR}, - base_entity_id = #{baseEntityId,jdbcType=VARCHAR}, - server_version = #{serverVersion,jdbcType=BIGINT}, - report_type = #{reportType,jdbcType=VARCHAR}, - report_date = #{reportDate,jdbcType=DATE}, - provider_id = #{providerId,jdbcType=VARCHAR}, - location_id = #{locationId,jdbcType=VARCHAR}, - team = #{team,jdbcType=VARCHAR}, - team_id = #{teamId,jdbcType=VARCHAR}, - date_edited = #{dateEdited,jdbcType=DATE} - where id = #{id,jdbcType=BIGINT} - + date_edited = #{dateEdited,jdbcType=DATE} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/SettingsMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/SettingsMapper.xml index 1d3499041..9a7eef9e9 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/SettingsMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/SettingsMapper.xml @@ -1,294 +1,309 @@ - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler} + + + + + + - + + + + + id, json, server_version + + + + + + delete from core.settings + where id = #{id,jdbcType=BIGINT} + + + + delete from core.settings + + - - - - - - id, json, server_version - - - - - - delete from core.settings - where id = #{id,jdbcType=BIGINT} - - - - delete from core.settings - - - - - - - insert into core.settings (id, json, - server_version) - values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler}, - #{serverVersion,jdbcType=BIGINT}) - - - - insert into core.settings - - - id, - - - json, - - - server_version, - - - - - #{id,jdbcType=BIGINT}, - - + + + + insert into core.settings (id, json, + server_version) + values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler}, - - - #{serverVersion,jdbcType=BIGINT}, - - - - - - - update core.settings - - - id = #{record.id,jdbcType=BIGINT}, - - + #{serverVersion,jdbcType=BIGINT}) + + + + insert into core.settings + + + id, + + + json, + + + server_version, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler}, + + + #{serverVersion,jdbcType=BIGINT}, + + + + + + + update core.settings + + + id = #{record.id,jdbcType=BIGINT}, + + + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + + + + + + + update core.settings + set id = #{record.id,jdbcType=BIGINT}, json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler}, - - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - - - - - - - - update core.settings - set id = #{record.id,jdbcType=BIGINT}, - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler}, - server_version = #{record.serverVersion,jdbcType=BIGINT} - - - - - - - update core.settings - - - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler}, - - - server_version = #{serverVersion,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.settings - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler}, - server_version = #{serverVersion,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - + server_version = #{record.serverVersion,jdbcType=BIGINT} + + + + + + + update core.settings + + + json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.settings + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.SettingTypeHandler}, + server_version = #{serverVersion,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/SettingsMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/SettingsMetadataMapper.xml index 934b8a819..584ba38f0 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/SettingsMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/SettingsMetadataMapper.xml @@ -1,490 +1,494 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, settings_id, document_id, identifier, server_version, team, team_id, provider_id, + location_id, uuid, json, setting_type, setting_value, setting_key, setting_description, + inherited_from, metadata_version + + + + + + delete from core.settings_metadata + where id = #{id,jdbcType=BIGINT} + + + + delete from core.settings_metadata + + - - - - - - id, settings_id, document_id, identifier, server_version, team, team_id, provider_id, - location_id, uuid, json, setting_type, setting_value, setting_key, setting_description, - inherited_from, metadata_version - - - - - - delete from core.settings_metadata - where id = #{id,jdbcType=BIGINT} - - - - delete from core.settings_metadata - - - - - - - insert into core.settings_metadata (id, settings_id, document_id, - identifier, server_version, team, - team_id, provider_id, location_id, - uuid, json, setting_type, - setting_value, setting_key, setting_description, setting_label, - inherited_from, metadata_version) - values (#{id,jdbcType=BIGINT}, #{settingsId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, - #{identifier,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, #{team,jdbcType=VARCHAR}, - #{teamId,jdbcType=VARCHAR}, #{providerId,jdbcType=VARCHAR}, #{locationId,jdbcType=VARCHAR}, - #{uuid,jdbcType=VARCHAR}, #{json,jdbcType=OTHER}, #{settingType,jdbcType=VARCHAR}, - #{settingValue,jdbcType=VARCHAR}, #{settingKey,jdbcType=VARCHAR}, #{settingDescription,jdbcType=VARCHAR}, - #{settingLabel,jdbcType=VARCHAR},#{inheritedFrom,jdbcType=VARCHAR}, - nextVal('core.setting_metadata_version_seq')) - - - - insert into core.settings_metadata - - - id, - - - settings_id, - - - document_id, - - - identifier, - - - server_version, - - - team, - - - team_id, - - - provider_id, - - - location_id, - - - uuid, - - - json, - - - setting_type, - - - setting_value, - - - setting_key, - - - setting_description, - - - setting_label, - - - inherited_from, - - - metadata_version, - - - - - #{id,jdbcType=BIGINT}, - - - #{settingsId,jdbcType=BIGINT}, - - - #{documentId,jdbcType=VARCHAR}, - - - #{identifier,jdbcType=VARCHAR}, - - - #{serverVersion,jdbcType=BIGINT}, - - - #{team,jdbcType=VARCHAR}, - - - #{teamId,jdbcType=VARCHAR}, - - - #{providerId,jdbcType=VARCHAR}, - - - #{locationId,jdbcType=VARCHAR}, - - - #{uuid,jdbcType=VARCHAR}, - - - #{json,jdbcType=OTHER}, - - - #{settingType,jdbcType=VARCHAR}, - - - #{settingValue,jdbcType=VARCHAR}, - - - #{settingKey,jdbcType=VARCHAR}, - - - #{settingDescription,jdbcType=VARCHAR}, - - - #{settinglabel,jdbcType=VARCHAR}, - - - #{inheritedFrom,jdbcType=VARCHAR}, - - nextVal('core.setting_metadata_version_seq') - - - - - - update core.settings_metadata - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.settings_metadata (id, settings_id, document_id, + identifier, server_version, team, + team_id, provider_id, location_id, + uuid, json, setting_type, + setting_value, setting_key, setting_description, setting_label, + inherited_from, metadata_version) + values (#{id,jdbcType=BIGINT}, #{settingsId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, + #{identifier,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, #{team,jdbcType=VARCHAR}, + #{teamId,jdbcType=VARCHAR}, #{providerId,jdbcType=VARCHAR}, #{locationId,jdbcType=VARCHAR}, + #{uuid,jdbcType=VARCHAR}, #{json,jdbcType=OTHER}, #{settingType,jdbcType=VARCHAR}, + #{settingValue,jdbcType=VARCHAR}, #{settingKey,jdbcType=VARCHAR}, #{settingDescription,jdbcType=VARCHAR}, + #{settingLabel,jdbcType=VARCHAR},#{inheritedFrom,jdbcType=VARCHAR}, + nextVal('core.setting_metadata_version_seq')) + + + + insert into core.settings_metadata + + + id, + + + settings_id, + + + document_id, + + + identifier, + + + server_version, + + + team, + + + team_id, + + + provider_id, + + + location_id, + + + uuid, + + + json, + + + setting_type, + + + setting_value, + + + setting_key, + + + setting_description, + + + setting_label, + + + inherited_from, + + + metadata_version, + + + + + #{id,jdbcType=BIGINT}, + + + #{settingsId,jdbcType=BIGINT}, + + + #{documentId,jdbcType=VARCHAR}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{serverVersion,jdbcType=BIGINT}, + + + #{team,jdbcType=VARCHAR}, + + + #{teamId,jdbcType=VARCHAR}, + + + #{providerId,jdbcType=VARCHAR}, + + + #{locationId,jdbcType=VARCHAR}, + + + #{uuid,jdbcType=VARCHAR}, + + + #{json,jdbcType=OTHER}, + + + #{settingType,jdbcType=VARCHAR}, + + + #{settingValue,jdbcType=VARCHAR}, + + + #{settingKey,jdbcType=VARCHAR}, + + + #{settingDescription,jdbcType=VARCHAR}, + + + #{settinglabel,jdbcType=VARCHAR}, + + + #{inheritedFrom,jdbcType=VARCHAR}, + + nextVal('core.setting_metadata_version_seq') + + + + + + update core.settings_metadata + + + id = #{record.id,jdbcType=BIGINT}, + + + settings_id = #{record.settingsId,jdbcType=BIGINT}, + + + document_id = #{record.documentId,jdbcType=VARCHAR}, + + + identifier = #{record.identifier,jdbcType=VARCHAR}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + team = #{record.team,jdbcType=VARCHAR}, + + + team_id = #{record.teamId,jdbcType=VARCHAR}, + + + provider_id = #{record.providerId,jdbcType=VARCHAR}, + + + location_id = #{record.locationId,jdbcType=VARCHAR}, + + + uuid = #{record.uuid,jdbcType=VARCHAR}, + + + json = #{record.json,jdbcType=OTHER}, + + + setting_type = #{record.settingType,jdbcType=VARCHAR}, + + + setting_value = #{record.settingValue,jdbcType=VARCHAR}, + + + setting_key = #{record.settingKey,jdbcType=VARCHAR}, + + + setting_description = #{record.settingDescription,jdbcType=VARCHAR}, + + + setting_label = #{record.settingLabel,jdbcType=VARCHAR}, + + + inherited_from = #{record.inheritedFrom,jdbcType=VARCHAR}, + + + metadata_version = nextVal('core.setting_metadata_version_seq'), + + + + + + + + + update core.settings_metadata + set id = #{record.id,jdbcType=BIGINT}, settings_id = #{record.settingsId,jdbcType=BIGINT}, - - document_id = #{record.documentId,jdbcType=VARCHAR}, - - identifier = #{record.identifier,jdbcType=VARCHAR}, - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - team = #{record.team,jdbcType=VARCHAR}, - - team_id = #{record.teamId,jdbcType=VARCHAR}, - - provider_id = #{record.providerId,jdbcType=VARCHAR}, - - location_id = #{record.locationId,jdbcType=VARCHAR}, - - uuid = #{record.uuid,jdbcType=VARCHAR}, - - json = #{record.json,jdbcType=OTHER}, - - setting_type = #{record.settingType,jdbcType=VARCHAR}, - - setting_value = #{record.settingValue,jdbcType=VARCHAR}, - - setting_key = #{record.settingKey,jdbcType=VARCHAR}, - - setting_description = #{record.settingDescription,jdbcType=VARCHAR}, - - setting_label = #{record.settingLabel,jdbcType=VARCHAR}, - - inherited_from = #{record.inheritedFrom,jdbcType=VARCHAR}, - - - metadata_version = nextVal('core.setting_metadata_version_seq'), - - - - - - - - - update core.settings_metadata - set id = #{record.id,jdbcType=BIGINT}, - settings_id = #{record.settingsId,jdbcType=BIGINT}, - document_id = #{record.documentId,jdbcType=VARCHAR}, - identifier = #{record.identifier,jdbcType=VARCHAR}, - server_version = #{record.serverVersion,jdbcType=BIGINT}, - team = #{record.team,jdbcType=VARCHAR}, - team_id = #{record.teamId,jdbcType=VARCHAR}, - provider_id = #{record.providerId,jdbcType=VARCHAR}, - location_id = #{record.locationId,jdbcType=VARCHAR}, - uuid = #{record.uuid,jdbcType=VARCHAR}, - json = #{record.json,jdbcType=OTHER}, - setting_type = #{record.settingType,jdbcType=VARCHAR}, - setting_value = #{record.settingValue,jdbcType=VARCHAR}, - setting_key = #{record.settingKey,jdbcType=VARCHAR}, - setting_description = #{record.settingDescription,jdbcType=VARCHAR}, - setting_label = #{record.settingLabel,jdbcType=VARCHAR}, - inherited_from = #{record.inheritedFrom,jdbcType=VARCHAR}, - metadata_version = nextVal('core.setting_metadata_version_seq') - - - - - - - update core.settings_metadata - - - settings_id = #{settingsId,jdbcType=BIGINT}, - - + metadata_version = nextVal('core.setting_metadata_version_seq') + + + + + + + update core.settings_metadata + + + settings_id = #{settingsId,jdbcType=BIGINT}, + + + document_id = #{documentId,jdbcType=VARCHAR}, + + + identifier = #{identifier,jdbcType=VARCHAR}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + team = #{team,jdbcType=VARCHAR}, + + + team_id = #{teamId,jdbcType=VARCHAR}, + + + provider_id = #{providerId,jdbcType=VARCHAR}, + + + location_id = #{locationId,jdbcType=VARCHAR}, + + + uuid = #{uuid,jdbcType=VARCHAR}, + + + json = #{json,jdbcType=OTHER}, + + + setting_type = #{settingType,jdbcType=VARCHAR}, + + + setting_value = #{settingValue,jdbcType=VARCHAR}, + + + setting_key = #{settingKey,jdbcType=VARCHAR}, + + + setting_description = #{settingDescription,jdbcType=VARCHAR}, + + + setting_label = #{settingLabel,jdbcType=VARCHAR}, + + + inherited_from = #{inheritedFrom,jdbcType=VARCHAR}, + + + metadata_version = nextVal('core.setting_metadata_version_seq'), + + + where id = #{id,jdbcType=BIGINT} + + + + update core.settings_metadata + set settings_id = #{settingsId,jdbcType=BIGINT}, document_id = #{documentId,jdbcType=VARCHAR}, - - identifier = #{identifier,jdbcType=VARCHAR}, - - server_version = #{serverVersion,jdbcType=BIGINT}, - - team = #{team,jdbcType=VARCHAR}, - - team_id = #{teamId,jdbcType=VARCHAR}, - - provider_id = #{providerId,jdbcType=VARCHAR}, - - location_id = #{locationId,jdbcType=VARCHAR}, - - uuid = #{uuid,jdbcType=VARCHAR}, - - json = #{json,jdbcType=OTHER}, - - setting_type = #{settingType,jdbcType=VARCHAR}, - - setting_value = #{settingValue,jdbcType=VARCHAR}, - - setting_key = #{settingKey,jdbcType=VARCHAR}, - - setting_description = #{settingDescription,jdbcType=VARCHAR}, - - setting_label = #{settingLabel,jdbcType=VARCHAR}, - - inherited_from = #{inheritedFrom,jdbcType=VARCHAR}, - - - metadata_version = nextVal('core.setting_metadata_version_seq'), - - - where id = #{id,jdbcType=BIGINT} - - - - update core.settings_metadata - set settings_id = #{settingsId,jdbcType=BIGINT}, - document_id = #{documentId,jdbcType=VARCHAR}, - identifier = #{identifier,jdbcType=VARCHAR}, - server_version = #{serverVersion,jdbcType=BIGINT}, - team = #{team,jdbcType=VARCHAR}, - team_id = #{teamId,jdbcType=VARCHAR}, - provider_id = #{providerId,jdbcType=VARCHAR}, - location_id = #{locationId,jdbcType=VARCHAR}, - uuid = #{uuid,jdbcType=VARCHAR}, - json = #{json,jdbcType=OTHER}, - setting_type = #{settingType,jdbcType=VARCHAR}, - setting_value = #{settingValue,jdbcType=VARCHAR}, - setting_key = #{settingKey,jdbcType=VARCHAR}, - setting_description = #{settingDescription,jdbcType=VARCHAR}, - setting_label = #{settingLabel,jdbcType=VARCHAR}, - inherited_from = #{inheritedFrom,jdbcType=VARCHAR}, - metadata_version = nextVal('core.setting_metadata_version_seq') - where id = #{id,jdbcType=BIGINT} - + metadata_version = nextVal('core.setting_metadata_version_seq') + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/StockMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/StockMapper.xml index 1f7e21143..afa58cd7d 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/StockMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/StockMapper.xml @@ -1,309 +1,324 @@ - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler} + + + + + + - + + + + + id, json, date_deleted, server_version + + + + + + delete from core.stock + where id = #{id,jdbcType=BIGINT} + + + + delete from core.stock + + - - - - - - id, json, date_deleted, server_version - - - - - - delete from core.stock - where id = #{id,jdbcType=BIGINT} - - - - delete from core.stock - - - - - - - insert into core.stock (id, json, - date_deleted, server_version) - values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler}, - #{dateDeleted,jdbcType=TIMESTAMP}, #{serverVersion,jdbcType=BIGINT}) - - - - insert into core.stock - - - id, - - - json, - - - date_deleted, - - - server_version, - - - - - #{id,jdbcType=BIGINT}, - - + + + + insert into core.stock (id, json, + date_deleted, server_version) + values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler}, - - - #{dateDeleted,jdbcType=TIMESTAMP}, - - - #{serverVersion,jdbcType=BIGINT}, - - - - - - - update core.stock - - - id = #{record.id,jdbcType=BIGINT}, - - + #{dateDeleted,jdbcType=TIMESTAMP}, #{serverVersion,jdbcType=BIGINT}) + + + + insert into core.stock + + + id, + + + json, + + + date_deleted, + + + server_version, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler}, + + + #{dateDeleted,jdbcType=TIMESTAMP}, + + + #{serverVersion,jdbcType=BIGINT}, + + + + + + + update core.stock + + + id = #{record.id,jdbcType=BIGINT}, + + + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler}, + + + date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + + + + + + + update core.stock + set id = #{record.id,jdbcType=BIGINT}, json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler}, - - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - - - - - - - - update core.stock - set id = #{record.id,jdbcType=BIGINT}, - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler}, - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - server_version = #{record.serverVersion,jdbcType=BIGINT} - - - - - - - update core.stock - - - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler}, - - + server_version = #{record.serverVersion,jdbcType=BIGINT} + + + + + + + update core.stock + + + json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler}, + + + date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.stock + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler}, date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - - - server_version = #{serverVersion,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.stock - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.StockTypeHandler}, - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - server_version = #{serverVersion,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - + server_version = #{serverVersion,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/StockMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/StockMetadataMapper.xml index b88770075..6f3f3aaa0 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/StockMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/StockMetadataMapper.xml @@ -1,351 +1,355 @@ - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, stock_id, document_id, server_version, provider_id, location_id, team, team_id, + date_deleted + + + + + + delete from core.stock_metadata + where id = #{id,jdbcType=BIGINT} + + + + delete from core.stock_metadata + + - - - - - - id, stock_id, document_id, server_version, provider_id, location_id, team, team_id, - date_deleted - - - - - - delete from core.stock_metadata - where id = #{id,jdbcType=BIGINT} - - - - delete from core.stock_metadata - - - - - - - insert into core.stock_metadata (id, stock_id, document_id, - server_version, provider_id, location_id, - team, team_id, date_deleted - ) - values (#{id,jdbcType=BIGINT}, #{stockId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, - #{serverVersion,jdbcType=BIGINT}, #{providerId,jdbcType=VARCHAR}, #{locationId,jdbcType=VARCHAR}, - #{team,jdbcType=VARCHAR}, #{teamId,jdbcType=VARCHAR}, #{dateDeleted,jdbcType=TIMESTAMP} - ) - - - - insert into core.stock_metadata - - - id, - - - stock_id, - - - document_id, - - - server_version, - - - provider_id, - - - location_id, - - - team, - - - team_id, - - - date_deleted, - - - - - #{id,jdbcType=BIGINT}, - - - #{stockId,jdbcType=BIGINT}, - - - #{documentId,jdbcType=VARCHAR}, - - - #{serverVersion,jdbcType=BIGINT}, - - - #{providerId,jdbcType=VARCHAR}, - - - #{locationId,jdbcType=VARCHAR}, - - - #{team,jdbcType=VARCHAR}, - - - #{teamId,jdbcType=VARCHAR}, - - - #{dateDeleted,jdbcType=TIMESTAMP}, - - - - - - - update core.stock_metadata - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.stock_metadata (id, stock_id, document_id, + server_version, provider_id, location_id, + team, team_id, date_deleted + ) + values (#{id,jdbcType=BIGINT}, #{stockId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, + #{serverVersion,jdbcType=BIGINT}, #{providerId,jdbcType=VARCHAR}, #{locationId,jdbcType=VARCHAR}, + #{team,jdbcType=VARCHAR}, #{teamId,jdbcType=VARCHAR}, #{dateDeleted,jdbcType=TIMESTAMP} + ) + + + + insert into core.stock_metadata + + + id, + + + stock_id, + + + document_id, + + + server_version, + + + provider_id, + + + location_id, + + + team, + + + team_id, + + + date_deleted, + + + + + #{id,jdbcType=BIGINT}, + + + #{stockId,jdbcType=BIGINT}, + + + #{documentId,jdbcType=VARCHAR}, + + + #{serverVersion,jdbcType=BIGINT}, + + + #{providerId,jdbcType=VARCHAR}, + + + #{locationId,jdbcType=VARCHAR}, + + + #{team,jdbcType=VARCHAR}, + + + #{teamId,jdbcType=VARCHAR}, + + + #{dateDeleted,jdbcType=TIMESTAMP}, + + + + + + + update core.stock_metadata + + + id = #{record.id,jdbcType=BIGINT}, + + + stock_id = #{record.stockId,jdbcType=BIGINT}, + + + document_id = #{record.documentId,jdbcType=VARCHAR}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + provider_id = #{record.providerId,jdbcType=VARCHAR}, + + + location_id = #{record.locationId,jdbcType=VARCHAR}, + + + team = #{record.team,jdbcType=VARCHAR}, + + + team_id = #{record.teamId,jdbcType=VARCHAR}, + + + date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, + + + + + + + + + update core.stock_metadata + set id = #{record.id,jdbcType=BIGINT}, stock_id = #{record.stockId,jdbcType=BIGINT}, - - document_id = #{record.documentId,jdbcType=VARCHAR}, - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - provider_id = #{record.providerId,jdbcType=VARCHAR}, - - location_id = #{record.locationId,jdbcType=VARCHAR}, - - team = #{record.team,jdbcType=VARCHAR}, - - team_id = #{record.teamId,jdbcType=VARCHAR}, - - - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP}, - - - - - - - - - update core.stock_metadata - set id = #{record.id,jdbcType=BIGINT}, - stock_id = #{record.stockId,jdbcType=BIGINT}, - document_id = #{record.documentId,jdbcType=VARCHAR}, - server_version = #{record.serverVersion,jdbcType=BIGINT}, - provider_id = #{record.providerId,jdbcType=VARCHAR}, - location_id = #{record.locationId,jdbcType=VARCHAR}, - team = #{record.team,jdbcType=VARCHAR}, - team_id = #{record.teamId,jdbcType=VARCHAR}, - date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP} - - - - - - - update core.stock_metadata - - - stock_id = #{stockId,jdbcType=BIGINT}, - - + date_deleted = #{record.dateDeleted,jdbcType=TIMESTAMP} + + + + + + + update core.stock_metadata + + + stock_id = #{stockId,jdbcType=BIGINT}, + + + document_id = #{documentId,jdbcType=VARCHAR}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + provider_id = #{providerId,jdbcType=VARCHAR}, + + + location_id = #{locationId,jdbcType=VARCHAR}, + + + team = #{team,jdbcType=VARCHAR}, + + + team_id = #{teamId,jdbcType=VARCHAR}, + + + date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.stock_metadata + set stock_id = #{stockId,jdbcType=BIGINT}, document_id = #{documentId,jdbcType=VARCHAR}, - - server_version = #{serverVersion,jdbcType=BIGINT}, - - provider_id = #{providerId,jdbcType=VARCHAR}, - - location_id = #{locationId,jdbcType=VARCHAR}, - - team = #{team,jdbcType=VARCHAR}, - - team_id = #{teamId,jdbcType=VARCHAR}, - - - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.stock_metadata - set stock_id = #{stockId,jdbcType=BIGINT}, - document_id = #{documentId,jdbcType=VARCHAR}, - server_version = #{serverVersion,jdbcType=BIGINT}, - provider_id = #{providerId,jdbcType=VARCHAR}, - location_id = #{locationId,jdbcType=VARCHAR}, - team = #{team,jdbcType=VARCHAR}, - team_id = #{teamId,jdbcType=VARCHAR}, - date_deleted = #{dateDeleted,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - + date_deleted = #{dateDeleted,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/StructureMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/StructureMapper.xml index ab6d3a586..af80c7ea5 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/StructureMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/StructureMapper.xml @@ -1,294 +1,310 @@ - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler} + + + + + + - + + + + + id, json, server_version + + + + + + delete from core.structure + where id = #{id,jdbcType=BIGINT} + + + + delete from core.structure + + - - - - - - id, json, server_version - - - - - - delete from core.structure - where id = #{id,jdbcType=BIGINT} - - - - delete from core.structure - - - - - - - insert into core.structure (id, json, - server_version) - values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - #{serverVersion,jdbcType=BIGINT}) - - - - insert into core.structure - - - id, - - - json, - - - server_version, - - - - - #{id,jdbcType=BIGINT}, - - + + + + insert into core.structure (id, json, + server_version) + values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - - - #{serverVersion,jdbcType=BIGINT}, - - - - - - - update core.structure - - - id = #{record.id,jdbcType=BIGINT}, - - + #{serverVersion,jdbcType=BIGINT}) + + + + insert into core.structure + + + id, + + + json, + + + server_version, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, + + + #{serverVersion,jdbcType=BIGINT}, + + + + + + + update core.structure + + + id = #{record.id,jdbcType=BIGINT}, + + + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + + + + + + + update core.structure + set id = #{record.id,jdbcType=BIGINT}, json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - - - - - - - - update core.structure - set id = #{record.id,jdbcType=BIGINT}, - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - server_version = #{record.serverVersion,jdbcType=BIGINT} - - - - - - - update core.structure - - - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - - - server_version = #{serverVersion,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.structure - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, - server_version = #{serverVersion,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - + server_version = #{record.serverVersion,jdbcType=BIGINT} + + + + + + + update core.structure + + + json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.structure + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.LocationTypeHandler}, + server_version = #{serverVersion,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/StructureMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/StructureMetadataMapper.xml index 0770db978..44e796dea 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/StructureMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/StructureMetadataMapper.xml @@ -1,381 +1,385 @@ - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, structure_id, geojson_id, type, parent_id, uuid, status, server_version, name, + date_created, date_edited + + + + + + delete from core.structure_metadata + where id = #{id,jdbcType=BIGINT} + + + + delete from core.structure_metadata + + - - - - - - id, structure_id, geojson_id, type, parent_id, uuid, status, server_version, name, - date_created, date_edited - - - - - - delete from core.structure_metadata - where id = #{id,jdbcType=BIGINT} - - - - delete from core.structure_metadata - - - - - - - insert into core.structure_metadata (id, structure_id, geojson_id, - type, parent_id, uuid, - status, server_version, name, - date_created, date_edited) - values (#{id,jdbcType=BIGINT}, #{structureId,jdbcType=BIGINT}, #{geojsonId,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, - #{dateCreated,jdbcType=TIMESTAMP}, #{dateEdited,jdbcType=TIMESTAMP}) - - - - insert into core.structure_metadata - - - id, - - - structure_id, - - - geojson_id, - - - type, - - - parent_id, - - - uuid, - - - status, - - - server_version, - - - name, - - - date_created, - - - date_edited, - - - - - #{id,jdbcType=BIGINT}, - - - #{structureId,jdbcType=BIGINT}, - - - #{geojsonId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{parentId,jdbcType=VARCHAR}, - - - #{uuid,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{serverVersion,jdbcType=BIGINT}, - - - #{name,jdbcType=VARCHAR}, - - - #{dateCreated,jdbcType=TIMESTAMP}, - - - #{dateEdited,jdbcType=TIMESTAMP}, - - - - - - - update core.structure_metadata - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.structure_metadata (id, structure_id, geojson_id, + type, parent_id, uuid, + status, server_version, name, + date_created, date_edited) + values (#{id,jdbcType=BIGINT}, #{structureId,jdbcType=BIGINT}, #{geojsonId,jdbcType=VARCHAR}, + #{type,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, + #{dateCreated,jdbcType=TIMESTAMP}, #{dateEdited,jdbcType=TIMESTAMP}) + + + + insert into core.structure_metadata + + + id, + + + structure_id, + + + geojson_id, + + + type, + + + parent_id, + + + uuid, + + + status, + + + server_version, + + + name, + + + date_created, + + + date_edited, + + + + + #{id,jdbcType=BIGINT}, + + + #{structureId,jdbcType=BIGINT}, + + + #{geojsonId,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{parentId,jdbcType=VARCHAR}, + + + #{uuid,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{serverVersion,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{dateCreated,jdbcType=TIMESTAMP}, + + + #{dateEdited,jdbcType=TIMESTAMP}, + + + + + + + update core.structure_metadata + + + id = #{record.id,jdbcType=BIGINT}, + + + structure_id = #{record.structureId,jdbcType=BIGINT}, + + + geojson_id = #{record.geojsonId,jdbcType=VARCHAR}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + parent_id = #{record.parentId,jdbcType=VARCHAR}, + + + uuid = #{record.uuid,jdbcType=VARCHAR}, + + + status = #{record.status,jdbcType=VARCHAR}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, + + + + + + + + + update core.structure_metadata + set id = #{record.id,jdbcType=BIGINT}, structure_id = #{record.structureId,jdbcType=BIGINT}, - - geojson_id = #{record.geojsonId,jdbcType=VARCHAR}, - - type = #{record.type,jdbcType=VARCHAR}, - - parent_id = #{record.parentId,jdbcType=VARCHAR}, - - uuid = #{record.uuid,jdbcType=VARCHAR}, - - status = #{record.status,jdbcType=VARCHAR}, - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - name = #{record.name,jdbcType=VARCHAR}, - - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - - - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, - - - - - - - - - update core.structure_metadata - set id = #{record.id,jdbcType=BIGINT}, - structure_id = #{record.structureId,jdbcType=BIGINT}, - geojson_id = #{record.geojsonId,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=VARCHAR}, - parent_id = #{record.parentId,jdbcType=VARCHAR}, - uuid = #{record.uuid,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=VARCHAR}, - server_version = #{record.serverVersion,jdbcType=BIGINT}, - name = #{record.name,jdbcType=VARCHAR}, - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP} - - - - - - - update core.structure_metadata - - - structure_id = #{structureId,jdbcType=BIGINT}, - - + date_edited = #{record.dateEdited,jdbcType=TIMESTAMP} + + + + + + + update core.structure_metadata + + + structure_id = #{structureId,jdbcType=BIGINT}, + + + geojson_id = #{geojsonId,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + parent_id = #{parentId,jdbcType=VARCHAR}, + + + uuid = #{uuid,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + name = #{name,jdbcType=VARCHAR}, + + + date_created = #{dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{dateEdited,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.structure_metadata + set structure_id = #{structureId,jdbcType=BIGINT}, geojson_id = #{geojsonId,jdbcType=VARCHAR}, - - type = #{type,jdbcType=VARCHAR}, - - parent_id = #{parentId,jdbcType=VARCHAR}, - - uuid = #{uuid,jdbcType=VARCHAR}, - - status = #{status,jdbcType=VARCHAR}, - - server_version = #{serverVersion,jdbcType=BIGINT}, - - name = #{name,jdbcType=VARCHAR}, - - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - - - date_edited = #{dateEdited,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.structure_metadata - set structure_id = #{structureId,jdbcType=BIGINT}, - geojson_id = #{geojsonId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - parent_id = #{parentId,jdbcType=VARCHAR}, - uuid = #{uuid,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - server_version = #{serverVersion,jdbcType=BIGINT}, - name = #{name,jdbcType=VARCHAR}, - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{dateEdited,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - + date_edited = #{dateEdited,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/TaskMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/TaskMapper.xml index 0f962f48b..c4f31374e 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/TaskMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/TaskMapper.xml @@ -1,294 +1,309 @@ - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler} + + + + + + - + + + + + id, json, server_version + + + + + + delete from core.task + where id = #{id,jdbcType=BIGINT} + + + + delete from core.task + + - - - - - - id, json, server_version - - - - - - delete from core.task - where id = #{id,jdbcType=BIGINT} - - - - delete from core.task - - - - - - - insert into core.task (id, json, - server_version) - values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler}, - #{serverVersion,jdbcType=BIGINT}) - - - - insert into core.task - - - id, - - - json, - - - server_version, - - - - - #{id,jdbcType=BIGINT}, - - + + + + insert into core.task (id, json, + server_version) + values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler}, - - - #{serverVersion,jdbcType=BIGINT}, - - - - - - - update core.task - - - id = #{record.id,jdbcType=BIGINT}, - - + #{serverVersion,jdbcType=BIGINT}) + + + + insert into core.task + + + id, + + + json, + + + server_version, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler}, + + + #{serverVersion,jdbcType=BIGINT}, + + + + + + + update core.task + + + id = #{record.id,jdbcType=BIGINT}, + + + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + + + + + + + update core.task + set id = #{record.id,jdbcType=BIGINT}, json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler}, - - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - - - - - - - - update core.task - set id = #{record.id,jdbcType=BIGINT}, - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler}, - server_version = #{record.serverVersion,jdbcType=BIGINT} - - - - - - - update core.task - - - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler}, - - - server_version = #{serverVersion,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.task - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler}, - server_version = #{serverVersion,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - + server_version = #{record.serverVersion,jdbcType=BIGINT} + + + + + + + update core.task + + + json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.task + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.TaskTypeHandler}, + server_version = #{serverVersion,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/TaskMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/TaskMetadataMapper.xml index 8e608f5c4..abace1391 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/TaskMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/TaskMetadataMapper.xml @@ -1,381 +1,385 @@ - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, task_id, identifier, plan_identifier, group_identifier, for_entity, server_version, + owner, code, date_created, date_edited + + + + + + delete from core.task_metadata + where id = #{id,jdbcType=BIGINT} + + + + delete from core.task_metadata + + - - - - - - id, task_id, identifier, plan_identifier, group_identifier, for_entity, server_version, - owner, code, date_created, date_edited - - - - - - delete from core.task_metadata - where id = #{id,jdbcType=BIGINT} - - - - delete from core.task_metadata - - - - - - - insert into core.task_metadata (id, task_id, identifier, - plan_identifier, group_identifier, for_entity, - server_version, owner, code, - date_created, date_edited) - values (#{id,jdbcType=BIGINT}, #{taskId,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, - #{planIdentifier,jdbcType=VARCHAR}, #{groupIdentifier,jdbcType=VARCHAR}, #{forEntity,jdbcType=VARCHAR}, - #{serverVersion,jdbcType=BIGINT}, #{owner,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, - #{dateCreated,jdbcType=TIMESTAMP}, #{dateEdited,jdbcType=TIMESTAMP}) - - - - insert into core.task_metadata - - - id, - - - task_id, - - - identifier, - - - plan_identifier, - - - group_identifier, - - - for_entity, - - - server_version, - - - owner, - - - code, - - - date_created, - - - date_edited, - - - - - #{id,jdbcType=BIGINT}, - - - #{taskId,jdbcType=BIGINT}, - - - #{identifier,jdbcType=VARCHAR}, - - - #{planIdentifier,jdbcType=VARCHAR}, - - - #{groupIdentifier,jdbcType=VARCHAR}, - - - #{forEntity,jdbcType=VARCHAR}, - - - #{serverVersion,jdbcType=BIGINT}, - - - #{owner,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{dateCreated,jdbcType=TIMESTAMP}, - - - #{dateEdited,jdbcType=TIMESTAMP}, - - - - - - - update core.task_metadata - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.task_metadata (id, task_id, identifier, + plan_identifier, group_identifier, for_entity, + server_version, owner, code, + date_created, date_edited) + values (#{id,jdbcType=BIGINT}, #{taskId,jdbcType=BIGINT}, #{identifier,jdbcType=VARCHAR}, + #{planIdentifier,jdbcType=VARCHAR}, #{groupIdentifier,jdbcType=VARCHAR}, #{forEntity,jdbcType=VARCHAR}, + #{serverVersion,jdbcType=BIGINT}, #{owner,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, + #{dateCreated,jdbcType=TIMESTAMP}, #{dateEdited,jdbcType=TIMESTAMP}) + + + + insert into core.task_metadata + + + id, + + + task_id, + + + identifier, + + + plan_identifier, + + + group_identifier, + + + for_entity, + + + server_version, + + + owner, + + + code, + + + date_created, + + + date_edited, + + + + + #{id,jdbcType=BIGINT}, + + + #{taskId,jdbcType=BIGINT}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{planIdentifier,jdbcType=VARCHAR}, + + + #{groupIdentifier,jdbcType=VARCHAR}, + + + #{forEntity,jdbcType=VARCHAR}, + + + #{serverVersion,jdbcType=BIGINT}, + + + #{owner,jdbcType=VARCHAR}, + + + #{code,jdbcType=VARCHAR}, + + + #{dateCreated,jdbcType=TIMESTAMP}, + + + #{dateEdited,jdbcType=TIMESTAMP}, + + + + + + + update core.task_metadata + + + id = #{record.id,jdbcType=BIGINT}, + + + task_id = #{record.taskId,jdbcType=BIGINT}, + + + identifier = #{record.identifier,jdbcType=VARCHAR}, + + + plan_identifier = #{record.planIdentifier,jdbcType=VARCHAR}, + + + group_identifier = #{record.groupIdentifier,jdbcType=VARCHAR}, + + + for_entity = #{record.forEntity,jdbcType=VARCHAR}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + owner = #{record.owner,jdbcType=VARCHAR}, + + + code = #{record.code,jdbcType=VARCHAR}, + + + date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, + + + + + + + + + update core.task_metadata + set id = #{record.id,jdbcType=BIGINT}, task_id = #{record.taskId,jdbcType=BIGINT}, - - identifier = #{record.identifier,jdbcType=VARCHAR}, - - plan_identifier = #{record.planIdentifier,jdbcType=VARCHAR}, - - group_identifier = #{record.groupIdentifier,jdbcType=VARCHAR}, - - for_entity = #{record.forEntity,jdbcType=VARCHAR}, - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - owner = #{record.owner,jdbcType=VARCHAR}, - - code = #{record.code,jdbcType=VARCHAR}, - - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - - - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP}, - - - - - - - - - update core.task_metadata - set id = #{record.id,jdbcType=BIGINT}, - task_id = #{record.taskId,jdbcType=BIGINT}, - identifier = #{record.identifier,jdbcType=VARCHAR}, - plan_identifier = #{record.planIdentifier,jdbcType=VARCHAR}, - group_identifier = #{record.groupIdentifier,jdbcType=VARCHAR}, - for_entity = #{record.forEntity,jdbcType=VARCHAR}, - server_version = #{record.serverVersion,jdbcType=BIGINT}, - owner = #{record.owner,jdbcType=VARCHAR}, - code = #{record.code,jdbcType=VARCHAR}, - date_created = #{record.dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{record.dateEdited,jdbcType=TIMESTAMP} - - - - - - - update core.task_metadata - - - task_id = #{taskId,jdbcType=BIGINT}, - - + date_edited = #{record.dateEdited,jdbcType=TIMESTAMP} + + + + + + + update core.task_metadata + + + task_id = #{taskId,jdbcType=BIGINT}, + + + identifier = #{identifier,jdbcType=VARCHAR}, + + + plan_identifier = #{planIdentifier,jdbcType=VARCHAR}, + + + group_identifier = #{groupIdentifier,jdbcType=VARCHAR}, + + + for_entity = #{forEntity,jdbcType=VARCHAR}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + owner = #{owner,jdbcType=VARCHAR}, + + + code = #{code,jdbcType=VARCHAR}, + + + date_created = #{dateCreated,jdbcType=TIMESTAMP}, + + + date_edited = #{dateEdited,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.task_metadata + set task_id = #{taskId,jdbcType=BIGINT}, identifier = #{identifier,jdbcType=VARCHAR}, - - plan_identifier = #{planIdentifier,jdbcType=VARCHAR}, - - group_identifier = #{groupIdentifier,jdbcType=VARCHAR}, - - for_entity = #{forEntity,jdbcType=VARCHAR}, - - server_version = #{serverVersion,jdbcType=BIGINT}, - - owner = #{owner,jdbcType=VARCHAR}, - - code = #{code,jdbcType=VARCHAR}, - - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - - - date_edited = #{dateEdited,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.task_metadata - set task_id = #{taskId,jdbcType=BIGINT}, - identifier = #{identifier,jdbcType=VARCHAR}, - plan_identifier = #{planIdentifier,jdbcType=VARCHAR}, - group_identifier = #{groupIdentifier,jdbcType=VARCHAR}, - for_entity = #{forEntity,jdbcType=VARCHAR}, - server_version = #{serverVersion,jdbcType=BIGINT}, - owner = #{owner,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - date_edited = #{dateEdited,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - + date_edited = #{dateEdited,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/UniqueIdMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/UniqueIdMapper.xml index 78c4bac6b..9d641462b 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/UniqueIdMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/UniqueIdMapper.xml @@ -1,365 +1,367 @@ - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, location, openmrs_id, status, used_by, updated_at, created_at, identifier, id_source, + is_reserved + + + + + + delete from core.unique_id + where id = #{id,jdbcType=BIGINT} + + + + delete from core.unique_id + + - - - - - - id, location, openmrs_id, status, used_by, updated_at, created_at, identifier, id_source, - is_reserved - - - - - - delete from core.unique_id - where id = #{id,jdbcType=BIGINT} - - - - delete from core.unique_id - - - - - - - insert into core.unique_id (id, location, openmrs_id, - status, used_by, updated_at, - created_at) - values (#{id,jdbcType=BIGINT}, #{location,jdbcType=VARCHAR}, #{openmrsId,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{usedBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, - #{createdAt,jdbcType=TIMESTAMP}, #{identifier,jdbcType=VARCHAR}, #{idSource,jdbcType=BIGINT}, - #{isReserved,jdbcType=BIT}) - - - - insert into core.unique_id - - - id, - - - location, - - - openmrs_id, - - - status, - - - used_by, - - - updated_at, - - - created_at, - - - identifier, - - - id_source, - - - is_reserved, - - - - - #{id,jdbcType=BIGINT}, - - - #{location,jdbcType=VARCHAR}, - - - #{openmrsId,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{usedBy,jdbcType=VARCHAR}, - - - #{updatedAt,jdbcType=TIMESTAMP}, - - - #{createdAt,jdbcType=TIMESTAMP}, - - - #{identifier,jdbcType=VARCHAR}, - - - #{idSource,jdbcType=BIGINT}, - - - #{isReserved,jdbcType=BIT}, - - - - - - - update core.unique_id - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.unique_id (id, location, openmrs_id, + status, used_by, updated_at, + created_at) + values (#{id,jdbcType=BIGINT}, #{location,jdbcType=VARCHAR}, #{openmrsId,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, #{usedBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, + #{createdAt,jdbcType=TIMESTAMP}, #{identifier,jdbcType=VARCHAR}, #{idSource,jdbcType=BIGINT}, + #{isReserved,jdbcType=BIT}) + + + + insert into core.unique_id + + + id, + + + location, + + + openmrs_id, + + + status, + + + used_by, + + + updated_at, + + + created_at, + + + identifier, + + + id_source, + + + is_reserved, + + + + + #{id,jdbcType=BIGINT}, + + + #{location,jdbcType=VARCHAR}, + + + #{openmrsId,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{usedBy,jdbcType=VARCHAR}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{idSource,jdbcType=BIGINT}, + + + #{isReserved,jdbcType=BIT}, + + + + + + + update core.unique_id + + + id = #{record.id,jdbcType=BIGINT}, + + + location = #{record.location,jdbcType=VARCHAR}, + + + openmrs_id = #{record.openmrsId,jdbcType=VARCHAR}, + + + status = #{record.status,jdbcType=VARCHAR}, + + + used_by = #{record.usedBy,jdbcType=VARCHAR}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + identifier = #{record.identifier,jdbcType=VARCHAR}, + + + id_source = #{record.idSource,jdbcType=BIGINT}, + + + is_reserved = #{record.isReserved,jdbcType=BIT}, + + + + + + + + + update core.unique_id + set id = #{record.id,jdbcType=BIGINT}, location = #{record.location,jdbcType=VARCHAR}, - - openmrs_id = #{record.openmrsId,jdbcType=VARCHAR}, - - status = #{record.status,jdbcType=VARCHAR}, - - used_by = #{record.usedBy,jdbcType=VARCHAR}, - - updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, - - created_at = #{record.createdAt,jdbcType=TIMESTAMP}, - - identifier = #{record.identifier,jdbcType=VARCHAR}, - - id_source = #{record.idSource,jdbcType=BIGINT}, - - - is_reserved = #{record.isReserved,jdbcType=BIT}, - - - - - - - - - update core.unique_id - set id = #{record.id,jdbcType=BIGINT}, - location = #{record.location,jdbcType=VARCHAR}, - openmrs_id = #{record.openmrsId,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=VARCHAR}, - used_by = #{record.usedBy,jdbcType=VARCHAR}, - updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, - created_at = #{record.createdAt,jdbcType=TIMESTAMP}, - identifier = #{record.identifier,jdbcType=VARCHAR}, - id_source = #{record.idSource,jdbcType=BIGINT}, - is_reserved = #{record.isReserved,jdbcType=BIT} - - - - - - - update core.unique_id - - - location = #{location,jdbcType=VARCHAR}, - - + is_reserved = #{record.isReserved,jdbcType=BIT} + + + + + + + update core.unique_id + + + location = #{location,jdbcType=VARCHAR}, + + + openmrs_id = #{openmrsId,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + used_by = #{usedBy,jdbcType=VARCHAR}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + identifier = #{identifier,jdbcType=VARCHAR}, + + + id_source = #{idSource,jdbcType=BIGINT}, + + + is_reserved = #{isReserved,jdbcType=BIT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.unique_id + set location = #{location,jdbcType=VARCHAR}, openmrs_id = #{openmrsId,jdbcType=VARCHAR}, - - status = #{status,jdbcType=VARCHAR}, - - used_by = #{usedBy,jdbcType=VARCHAR}, - - updated_at = #{updatedAt,jdbcType=TIMESTAMP}, - - created_at = #{createdAt,jdbcType=TIMESTAMP}, - - identifier = #{identifier,jdbcType=VARCHAR}, - - id_source = #{idSource,jdbcType=BIGINT}, - - - is_reserved = #{isReserved,jdbcType=BIT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.unique_id - set location = #{location,jdbcType=VARCHAR}, - openmrs_id = #{openmrsId,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - used_by = #{usedBy,jdbcType=VARCHAR}, - updated_at = #{updatedAt,jdbcType=TIMESTAMP}, - created_at = #{createdAt,jdbcType=TIMESTAMP}, - identifier = #{identifier,jdbcType=VARCHAR}, - id_source = #{idSource,jdbcType=BIGINT}, - is_reserved = #{isReserved,jdbcType=BIT} - where id = #{id,jdbcType=BIGINT} - + is_reserved = #{isReserved,jdbcType=BIT} + where id = #{id,jdbcType=BIGINT} + diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ViewConfigurationMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ViewConfigurationMapper.xml index 264b52c34..cfc8148b0 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ViewConfigurationMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ViewConfigurationMapper.xml @@ -1,294 +1,314 @@ - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler} + + + + + + - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler} - - - and ${criterion.condition} #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler} and #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler} - - - and ${criterion.condition} - - #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler} + + + and ${criterion.condition} + #{criterion.value,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler} + and + #{criterion.secondValue,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler} + + + and ${criterion.condition} + + #{listItem,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler} + + + + + + - + + + + + id, json, server_version + + + + + + delete from core.view_configuration + where id = #{id,jdbcType=BIGINT} + + + + delete from core.view_configuration + + + + + + + insert into core.view_configuration (id, json, + server_version) + values (#{id,jdbcType=BIGINT}, + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler}, + #{serverVersion,jdbcType=BIGINT}) + + + + insert into core.view_configuration + + + id, + + + json, + + + server_version, + + + + + #{id,jdbcType=BIGINT}, + + + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler}, + + + #{serverVersion,jdbcType=BIGINT}, + + + + + + + update core.view_configuration + + + id = #{record.id,jdbcType=BIGINT}, + + + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + + + + + + + update core.view_configuration + set id = #{record.id,jdbcType=BIGINT}, + json = + #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler}, + server_version = #{record.serverVersion,jdbcType=BIGINT} + + - - - - - - id, json, server_version - - - - - - delete from core.view_configuration - where id = #{id,jdbcType=BIGINT} - - - - delete from core.view_configuration - - - - - - - insert into core.view_configuration (id, json, - server_version) - values (#{id,jdbcType=BIGINT}, #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler}, - #{serverVersion,jdbcType=BIGINT}) - - - - insert into core.view_configuration - - - id, - - - json, - - - server_version, - - - - - #{id,jdbcType=BIGINT}, - - + + + + update core.view_configuration + + + json = + #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.view_configuration + set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler}, - - - #{serverVersion,jdbcType=BIGINT}, - - - - - - - update core.view_configuration - - - id = #{record.id,jdbcType=BIGINT}, - - - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler}, - - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - - - - - - - - update core.view_configuration - set id = #{record.id,jdbcType=BIGINT}, - json = #{record.json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler}, - server_version = #{record.serverVersion,jdbcType=BIGINT} - - - - - - - update core.view_configuration - - - json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler}, - - - server_version = #{serverVersion,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.view_configuration - set json = #{json,jdbcType=OTHER,typeHandler=org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler}, - server_version = #{serverVersion,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - + server_version = #{serverVersion,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ViewConfigurationMetadataMapper.xml b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ViewConfigurationMetadataMapper.xml index f3bcb5d61..f6e46b81b 100644 --- a/src/main/java/org/opensrp/repository/postgres/mapper/xml/ViewConfigurationMetadataMapper.xml +++ b/src/main/java/org/opensrp/repository/postgres/mapper/xml/ViewConfigurationMetadataMapper.xml @@ -1,286 +1,290 @@ - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - + + + + + id, view_configuration_id, document_id, identifier, server_version + + + + + + delete from core.view_configuration_metadata + where id = #{id,jdbcType=BIGINT} + + + + delete from core.view_configuration_metadata + + - - - - - - id, view_configuration_id, document_id, identifier, server_version - - - - - - delete from core.view_configuration_metadata - where id = #{id,jdbcType=BIGINT} - - - - delete from core.view_configuration_metadata - - - - - - - insert into core.view_configuration_metadata (id, view_configuration_id, document_id, - identifier, server_version) - values (#{id,jdbcType=BIGINT}, #{viewConfigurationId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, - #{identifier,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}) - - - - insert into core.view_configuration_metadata - - - id, - - - view_configuration_id, - - - document_id, - - - identifier, - - - server_version, - - - - - #{id,jdbcType=BIGINT}, - - - #{viewConfigurationId,jdbcType=BIGINT}, - - - #{documentId,jdbcType=VARCHAR}, - - - #{identifier,jdbcType=VARCHAR}, - - - #{serverVersion,jdbcType=BIGINT}, - - - - - - - update core.view_configuration_metadata - - - id = #{record.id,jdbcType=BIGINT}, - - + + + + insert into core.view_configuration_metadata (id, view_configuration_id, document_id, + identifier, server_version) + values (#{id,jdbcType=BIGINT}, #{viewConfigurationId,jdbcType=BIGINT}, #{documentId,jdbcType=VARCHAR}, + #{identifier,jdbcType=VARCHAR}, #{serverVersion,jdbcType=BIGINT}) + + + + insert into core.view_configuration_metadata + + + id, + + + view_configuration_id, + + + document_id, + + + identifier, + + + server_version, + + + + + #{id,jdbcType=BIGINT}, + + + #{viewConfigurationId,jdbcType=BIGINT}, + + + #{documentId,jdbcType=VARCHAR}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{serverVersion,jdbcType=BIGINT}, + + + + + + + update core.view_configuration_metadata + + + id = #{record.id,jdbcType=BIGINT}, + + + view_configuration_id = #{record.viewConfigurationId,jdbcType=BIGINT}, + + + document_id = #{record.documentId,jdbcType=VARCHAR}, + + + identifier = #{record.identifier,jdbcType=VARCHAR}, + + + server_version = #{record.serverVersion,jdbcType=BIGINT}, + + + + + + + + + update core.view_configuration_metadata + set id = #{record.id,jdbcType=BIGINT}, view_configuration_id = #{record.viewConfigurationId,jdbcType=BIGINT}, - - document_id = #{record.documentId,jdbcType=VARCHAR}, - - identifier = #{record.identifier,jdbcType=VARCHAR}, - - - server_version = #{record.serverVersion,jdbcType=BIGINT}, - - - - - - - - - update core.view_configuration_metadata - set id = #{record.id,jdbcType=BIGINT}, - view_configuration_id = #{record.viewConfigurationId,jdbcType=BIGINT}, - document_id = #{record.documentId,jdbcType=VARCHAR}, - identifier = #{record.identifier,jdbcType=VARCHAR}, - server_version = #{record.serverVersion,jdbcType=BIGINT} - - - - - - - update core.view_configuration_metadata - - - view_configuration_id = #{viewConfigurationId,jdbcType=BIGINT}, - - + server_version = #{record.serverVersion,jdbcType=BIGINT} + + + + + + + update core.view_configuration_metadata + + + view_configuration_id = #{viewConfigurationId,jdbcType=BIGINT}, + + + document_id = #{documentId,jdbcType=VARCHAR}, + + + identifier = #{identifier,jdbcType=VARCHAR}, + + + server_version = #{serverVersion,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update core.view_configuration_metadata + set view_configuration_id = #{viewConfigurationId,jdbcType=BIGINT}, document_id = #{documentId,jdbcType=VARCHAR}, - - identifier = #{identifier,jdbcType=VARCHAR}, - - - server_version = #{serverVersion,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - - update core.view_configuration_metadata - set view_configuration_id = #{viewConfigurationId,jdbcType=BIGINT}, - document_id = #{documentId,jdbcType=VARCHAR}, - identifier = #{identifier,jdbcType=VARCHAR}, - server_version = #{serverVersion,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - + server_version = #{serverVersion,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + \ No newline at end of file diff --git a/src/main/java/org/opensrp/scheduler/Action.java b/src/main/java/org/opensrp/scheduler/Action.java index ac6893bec..007dc0dbd 100644 --- a/src/main/java/org/opensrp/scheduler/Action.java +++ b/src/main/java/org/opensrp/scheduler/Action.java @@ -16,111 +16,109 @@ * The entity which helps in identifying the type of action applicable for the entity or provider */ public class Action extends BaseDataEntity { - - @JsonProperty - private String providerId; - - @JsonProperty - private String baseEntityId; - - @JsonProperty - private Map data; - - @JsonProperty - private String actionTarget; - - @JsonProperty - private String actionType; - - @JsonProperty - private Boolean isActionActive; - - @JsonProperty - private long timeStamp; - - public long getTimeStamp() { - return timeStamp; - } - - @JsonProperty - private long version; - - @JsonProperty - private Map details; - - private Action() { - } - - public Action(String baseEntityId, String providerId, ActionData actionData) { - this.providerId = providerId; - this.baseEntityId = baseEntityId; - this.data = actionData.getData(); - this.actionTarget = actionData.getTarget(); - this.actionType = actionData.getType(); - this.timeStamp = DateTime.now().getMillis(); - this.details = actionData.getDetails(); - this.isActionActive = true; - } - - public String providerId() { - return providerId; - } - - public String baseEntityId() { - return baseEntityId; - } - - public Map data() { - return data; - } - - public String getActionType() { - return actionType; - } - - @JsonIgnore - public long getTimestamp() { - return timeStamp; - } - - @JsonIgnore - public String getTarget() { - return actionTarget; - } - - public Action markAsInActive() { - this.isActionActive = false; - return this; - } - - public Boolean getIsActionActive() { - return isActionActive; - } - - public Map getDetails() { - return details; - } - - private String getBaseEntityId() { - return baseEntityId; - } - - public String getActionTarget() { - return actionTarget; - } - - @Override - public final boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, "id", "timeStamp", "revision"); - } - - @Override - public final int hashCode() { - return HashCodeBuilder.reflectionHashCode(this, "id", "timeStamp", "revision"); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } + + @JsonProperty + private String providerId; + + @JsonProperty + private String baseEntityId; + + @JsonProperty + private Map data; + + @JsonProperty + private String actionTarget; + + @JsonProperty + private String actionType; + + @JsonProperty + private Boolean isActionActive; + + @JsonProperty + private long timeStamp; + @JsonProperty + private long version; + @JsonProperty + private Map details; + + private Action() { + } + + public Action(String baseEntityId, String providerId, ActionData actionData) { + this.providerId = providerId; + this.baseEntityId = baseEntityId; + this.data = actionData.getData(); + this.actionTarget = actionData.getTarget(); + this.actionType = actionData.getType(); + this.timeStamp = DateTime.now().getMillis(); + this.details = actionData.getDetails(); + this.isActionActive = true; + } + + public long getTimeStamp() { + return timeStamp; + } + + public String providerId() { + return providerId; + } + + public String baseEntityId() { + return baseEntityId; + } + + public Map data() { + return data; + } + + public String getActionType() { + return actionType; + } + + @JsonIgnore + public long getTimestamp() { + return timeStamp; + } + + @JsonIgnore + public String getTarget() { + return actionTarget; + } + + public Action markAsInActive() { + this.isActionActive = false; + return this; + } + + public Boolean getIsActionActive() { + return isActionActive; + } + + public Map getDetails() { + return details; + } + + private String getBaseEntityId() { + return baseEntityId; + } + + public String getActionTarget() { + return actionTarget; + } + + @Override + public final boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, "id", "timeStamp", "revision"); + } + + @Override + public final int hashCode() { + return HashCodeBuilder.reflectionHashCode(this, "id", "timeStamp", "revision"); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this); + } } diff --git a/src/main/java/org/opensrp/scheduler/Alert.java b/src/main/java/org/opensrp/scheduler/Alert.java index 112b202c2..724f559a1 100644 --- a/src/main/java/org/opensrp/scheduler/Alert.java +++ b/src/main/java/org/opensrp/scheduler/Alert.java @@ -17,348 +17,332 @@ * The entity which helps in identifying the type of action applicable for the entity or provider */ public class Alert extends BaseDataEntity { - - public enum AlertType { - notification, - reminder - } - - public enum TriggerType { - schedule, - report, - event, - caseClosed - } - - @JsonProperty - private String providerId; - - @JsonProperty - private String entityId; - - @JsonProperty - private String beneficiaryType; - - @JsonProperty - private String alertType; - - @JsonProperty - private String triggerType; - - @JsonProperty - private String triggerName; - - @JsonProperty - private String triggerCode; - - @JsonProperty - private String startDate; - - @JsonProperty - private String expiryDate; - - @JsonProperty - private String alertStatus; - - @JsonProperty - private String closingPeriod; - - @JsonProperty - private String dateClosed; - - @JsonProperty - private String dateComplete; - - @JsonProperty - private String reasonClosed; - - @JsonProperty - private Boolean isActive; - - @JsonProperty - private long timeStamp; - - @JsonProperty - private Map details; - - private Alert() { - } - - public Alert(String providerId, String entityId, String beneficiaryType, AlertType alertType, TriggerType triggerType, - String triggerName, String triggerCode, DateTime startDate, DateTime expiryDate, AlertStatus alertStatus, - Map details) { - setProviderId(providerId); - setEntityId(entityId); - setBeneficiaryType(beneficiaryType); - setAlertType(alertType.name()); - setTriggerType(triggerType.name()); - setTriggerName(triggerName); - setTriggerCode(triggerCode); - setStartDate(startDate.toLocalDate().toString()); - setExpiryDate(expiryDate.toLocalDate().toString()); - setAlertStatus(alertStatus.name()); - setIsActive(true); - setTimeStamp(DateTime.now().getMillis()); - setDetails(details); - } - - public Alert markAlertAsClosed(String reasonForClose) { - if (alertStatus.equalsIgnoreCase(AlertStatus.closed.name()) - || alertStatus.equalsIgnoreCase(AlertStatus.complete.name())) { - throw new IllegalStateException("Alert was found " + alertStatus); - } - this.closingPeriod = this.alertStatus; - this.reasonClosed = reasonForClose; - this.alertStatus = AlertStatus.closed.name(); - this.dateClosed = getCurrentDateTime().toLocalDate().toString(); - this.isActive = false; - - return this; - } - - public Alert markAlertAsComplete(String completionDate) { - if (alertStatus.equalsIgnoreCase(AlertStatus.closed.name()) - || alertStatus.equalsIgnoreCase(AlertStatus.complete.name())) { - throw new IllegalStateException("Alert was found " + alertStatus); - } - this.dateComplete = completionDate; - this.closingPeriod = this.alertStatus; - this.alertStatus = AlertStatus.complete.name(); - this.dateClosed = getCurrentDateTime().toLocalDate().toString(); - this.isActive = false; - - return this; - } - - @JsonIgnore - public DateTime getCurrentDateTime() { - return new DateTime(); - } - - public String providerId() { - return providerId; - } - - public String entityId() { - return entityId; - } - - public String beneficiaryType() { - return beneficiaryType; - } - - public String alertType() { - return alertType; - } - - public String triggerType() { - return triggerType; - } - - public String triggerName() { - return triggerName; - } - - public String triggerCode() { - return triggerCode; - } - - public String startDate() { - return startDate; - } - - public String expiryDate() { - return expiryDate; - } - - public String alertStatus() { - return alertStatus; - } - - public String closingPeriod() { - return closingPeriod; - } - - public String dateClosed() { - return dateClosed; - } - - public String reasonClosed() { - return reasonClosed; - } - - @JsonIgnore - public Boolean isActive() { - return isActive; - } - - public long timestamp() { - return timeStamp; - } - - public Map details() { - if (details == null) { - details = new HashMap<>(); - } - return details; - } - - public Alert withDetails(String key, String val) { - if (details == null) { - details = new HashMap<>(); - } - details.put(key, val); - return this; - } - - String getProviderId() { - return providerId; - } - - String getEntityId() { - return entityId; - } - - String getBeneficiaryType() { - return beneficiaryType; - } - - String getTriggerType() { - return triggerType; - } - - String getAlertType() { - return alertType; - } - - public String getTriggerName() { - return triggerName; - } - - public void setTriggerName(String triggerName) { - this.triggerName = triggerName; - } - - public String getTriggerCode() { - return triggerCode; - } - - public void setTriggerCode(String triggerCode) { - this.triggerCode = triggerCode; - } - - public String getStartDate() { - return startDate; - } - - public void setStartDate(String startDate) { - this.startDate = startDate; - } - - public String getExpiryDate() { - return expiryDate; - } - - public void setExpiryDate(String expiryDate) { - this.expiryDate = expiryDate; - } - - public String getAlertStatus() { - return alertStatus; - } - - public void setAlertStatus(String alertStatus) { - this.alertStatus = alertStatus; - } - - public String getClosingPeriod() { - return closingPeriod; - } - - public void setClosingPeriod(String closingPeriod) { - this.closingPeriod = closingPeriod; - } - - public String getDateClosed() { - return dateClosed; - } - - public void setDateClosed(String dateClosed) { - this.dateClosed = dateClosed; - } - - public String getDateComplete() { - return dateComplete; - } - - public void setDateComplete(String dateComplete) { - this.dateComplete = dateComplete; - } - - public String getReasonClosed() { - return reasonClosed; - } - - public void setReasonClosed(String reasonClosed) { - this.reasonClosed = reasonClosed; - } - - public Boolean getIsActive() { - return isActive; - } - - public void setIsActive(Boolean isActive) { - this.isActive = isActive; - } - - public long getTimeStamp() { - return timeStamp; - } - - public void setTimeStamp(long timeStamp) { - this.timeStamp = timeStamp; - } - - public Map getDetails() { - return details; - } - - public void setDetails(Map details) { - this.details = details; - } - - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - public void setEntityId(String entityId) { - this.entityId = entityId; - } - - public void setBeneficiaryType(String beneficiaryType) { - this.beneficiaryType = beneficiaryType; - } - - public void setAlertType(String alertType) { - this.alertType = alertType; - } - - public void setTriggerType(String triggerType) { - this.triggerType = triggerType; - } - - @Override - public final boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, "timeStamp", "revision"); - } - - @Override - public final int hashCode() { - return HashCodeBuilder.reflectionHashCode(this, "timeStamp", "revision"); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } + + @JsonProperty + private String providerId; + @JsonProperty + private String entityId; + @JsonProperty + private String beneficiaryType; + @JsonProperty + private String alertType; + @JsonProperty + private String triggerType; + @JsonProperty + private String triggerName; + @JsonProperty + private String triggerCode; + @JsonProperty + private String startDate; + @JsonProperty + private String expiryDate; + @JsonProperty + private String alertStatus; + @JsonProperty + private String closingPeriod; + @JsonProperty + private String dateClosed; + @JsonProperty + private String dateComplete; + @JsonProperty + private String reasonClosed; + @JsonProperty + private Boolean isActive; + @JsonProperty + private long timeStamp; + @JsonProperty + private Map details; + + private Alert() { + } + + public Alert(String providerId, String entityId, String beneficiaryType, AlertType alertType, TriggerType triggerType, + String triggerName, String triggerCode, DateTime startDate, DateTime expiryDate, AlertStatus alertStatus, + Map details) { + setProviderId(providerId); + setEntityId(entityId); + setBeneficiaryType(beneficiaryType); + setAlertType(alertType.name()); + setTriggerType(triggerType.name()); + setTriggerName(triggerName); + setTriggerCode(triggerCode); + setStartDate(startDate.toLocalDate().toString()); + setExpiryDate(expiryDate.toLocalDate().toString()); + setAlertStatus(alertStatus.name()); + setIsActive(true); + setTimeStamp(DateTime.now().getMillis()); + setDetails(details); + } + + public Alert markAlertAsClosed(String reasonForClose) { + if (alertStatus.equalsIgnoreCase(AlertStatus.closed.name()) + || alertStatus.equalsIgnoreCase(AlertStatus.complete.name())) { + throw new IllegalStateException("Alert was found " + alertStatus); + } + this.closingPeriod = this.alertStatus; + this.reasonClosed = reasonForClose; + this.alertStatus = AlertStatus.closed.name(); + this.dateClosed = getCurrentDateTime().toLocalDate().toString(); + this.isActive = false; + + return this; + } + + public Alert markAlertAsComplete(String completionDate) { + if (alertStatus.equalsIgnoreCase(AlertStatus.closed.name()) + || alertStatus.equalsIgnoreCase(AlertStatus.complete.name())) { + throw new IllegalStateException("Alert was found " + alertStatus); + } + this.dateComplete = completionDate; + this.closingPeriod = this.alertStatus; + this.alertStatus = AlertStatus.complete.name(); + this.dateClosed = getCurrentDateTime().toLocalDate().toString(); + this.isActive = false; + + return this; + } + + @JsonIgnore + public DateTime getCurrentDateTime() { + return new DateTime(); + } + + public String providerId() { + return providerId; + } + + public String entityId() { + return entityId; + } + + public String beneficiaryType() { + return beneficiaryType; + } + + public String alertType() { + return alertType; + } + + public String triggerType() { + return triggerType; + } + + public String triggerName() { + return triggerName; + } + + public String triggerCode() { + return triggerCode; + } + + public String startDate() { + return startDate; + } + + public String expiryDate() { + return expiryDate; + } + + public String alertStatus() { + return alertStatus; + } + + public String closingPeriod() { + return closingPeriod; + } + + public String dateClosed() { + return dateClosed; + } + + public String reasonClosed() { + return reasonClosed; + } + + @JsonIgnore + public Boolean isActive() { + return isActive; + } + + public long timestamp() { + return timeStamp; + } + + public Map details() { + if (details == null) { + details = new HashMap<>(); + } + return details; + } + + public Alert withDetails(String key, String val) { + if (details == null) { + details = new HashMap<>(); + } + details.put(key, val); + return this; + } + + String getProviderId() { + return providerId; + } + + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + String getEntityId() { + return entityId; + } + + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + String getBeneficiaryType() { + return beneficiaryType; + } + + public void setBeneficiaryType(String beneficiaryType) { + this.beneficiaryType = beneficiaryType; + } + + String getTriggerType() { + return triggerType; + } + + public void setTriggerType(String triggerType) { + this.triggerType = triggerType; + } + + String getAlertType() { + return alertType; + } + + public void setAlertType(String alertType) { + this.alertType = alertType; + } + + public String getTriggerName() { + return triggerName; + } + + public void setTriggerName(String triggerName) { + this.triggerName = triggerName; + } + + public String getTriggerCode() { + return triggerCode; + } + + public void setTriggerCode(String triggerCode) { + this.triggerCode = triggerCode; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getExpiryDate() { + return expiryDate; + } + + public void setExpiryDate(String expiryDate) { + this.expiryDate = expiryDate; + } + + public String getAlertStatus() { + return alertStatus; + } + + public void setAlertStatus(String alertStatus) { + this.alertStatus = alertStatus; + } + + public String getClosingPeriod() { + return closingPeriod; + } + + public void setClosingPeriod(String closingPeriod) { + this.closingPeriod = closingPeriod; + } + + public String getDateClosed() { + return dateClosed; + } + + public void setDateClosed(String dateClosed) { + this.dateClosed = dateClosed; + } + + public String getDateComplete() { + return dateComplete; + } + + public void setDateComplete(String dateComplete) { + this.dateComplete = dateComplete; + } + + public String getReasonClosed() { + return reasonClosed; + } + + public void setReasonClosed(String reasonClosed) { + this.reasonClosed = reasonClosed; + } + + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + public long getTimeStamp() { + return timeStamp; + } + + public void setTimeStamp(long timeStamp) { + this.timeStamp = timeStamp; + } + + public Map getDetails() { + return details; + } + + public void setDetails(Map details) { + this.details = details; + } + + @Override + public final boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, "timeStamp", "revision"); + } + + @Override + public final int hashCode() { + return HashCodeBuilder.reflectionHashCode(this, "timeStamp", "revision"); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this); + } + + public enum AlertType { + notification, + reminder + } + + public enum TriggerType { + schedule, + report, + event, + caseClosed + } } diff --git a/src/main/java/org/opensrp/scheduler/Matcher.java b/src/main/java/org/opensrp/scheduler/Matcher.java index 5c6ef57cb..8ab575239 100644 --- a/src/main/java/org/opensrp/scheduler/Matcher.java +++ b/src/main/java/org/opensrp/scheduler/Matcher.java @@ -4,54 +4,54 @@ import java.util.List; public abstract class Matcher { - - public abstract boolean matches(String actualValue); - - public static Matcher eq(String value) { - return new EqMatcher(value); - } - - public static Matcher any() { - return new AnyMatcher(); - } - - public static Matcher anyOf(String... values) { - return new AnyOfMatcher(values); - } - - private static class AnyMatcher extends Matcher { - - @Override - public boolean matches(String actualValue) { - return true; - } - } - - private static class EqMatcher extends Matcher { - - private final String expectedValue; - - public EqMatcher(String expectedValue) { - this.expectedValue = expectedValue; - } - - @Override - public boolean matches(String actualValue) { - return expectedValue.equals(actualValue); - } - } - - private static class AnyOfMatcher extends Matcher { - - private final List expectedValues; - - public AnyOfMatcher(String... expectedValues) { - this.expectedValues = Arrays.asList(expectedValues); - } - - @Override - public boolean matches(String actualValue) { - return expectedValues.contains(actualValue); - } - } + + public static Matcher eq(String value) { + return new EqMatcher(value); + } + + public static Matcher any() { + return new AnyMatcher(); + } + + public static Matcher anyOf(String... values) { + return new AnyOfMatcher(values); + } + + public abstract boolean matches(String actualValue); + + private static class AnyMatcher extends Matcher { + + @Override + public boolean matches(String actualValue) { + return true; + } + } + + private static class EqMatcher extends Matcher { + + private final String expectedValue; + + public EqMatcher(String expectedValue) { + this.expectedValue = expectedValue; + } + + @Override + public boolean matches(String actualValue) { + return expectedValue.equals(actualValue); + } + } + + private static class AnyOfMatcher extends Matcher { + + private final List expectedValues; + + public AnyOfMatcher(String... expectedValues) { + this.expectedValues = Arrays.asList(expectedValues); + } + + @Override + public boolean matches(String actualValue) { + return expectedValues.contains(actualValue); + } + } } diff --git a/src/main/java/org/opensrp/scheduler/RepeatingCronSchedule.java b/src/main/java/org/opensrp/scheduler/RepeatingCronSchedule.java index 2b0270640..024448a55 100644 --- a/src/main/java/org/opensrp/scheduler/RepeatingCronSchedule.java +++ b/src/main/java/org/opensrp/scheduler/RepeatingCronSchedule.java @@ -5,92 +5,92 @@ import java.util.concurrent.TimeUnit; public class RepeatingCronSchedule { - - public final String SUBJECT; - - public final int START_DELAY; - - public final TimeUnit START_DELAY_UNIT; - - public final String CRON; - - protected Date endTime; - - protected Map data; - - public RepeatingCronSchedule(String subject, int startDelay, TimeUnit startDelayUnit, String cronExpression) { - this.SUBJECT = subject; - this.START_DELAY = startDelay; - this.START_DELAY_UNIT = startDelayUnit; - this.CRON = cronExpression; - } - - public RepeatingCronSchedule(String subject, int startDelay, TimeUnit startDelayUnit, String cronExpression, - Date endTime, Map data) { - this.SUBJECT = subject; - this.START_DELAY = startDelay; - this.START_DELAY_UNIT = startDelayUnit; - this.CRON = cronExpression; - this.endTime = endTime; - this.data = data; - } - - public Date getEndTime() { - return endTime; - } - - public RepeatingCronSchedule withEndTime(Date endTime) { - this.endTime = endTime; - return this; - } - - public Map getData() { - return data; - } - - public RepeatingCronSchedule addData(String key, Object value) { - data.put(key, value); - return this; - } - - public RepeatingCronSchedule withData(Map data) { - this.data = data; - return this; - } - - public long getStartDelayMilis() { - return START_DELAY * millisConverter(START_DELAY_UNIT); - } - - protected long millisConverter(TimeUnit unit) { - long millis = 1L; - switch (unit) { - case DAYS: - millis = 1000 * 60 * 60 * 24L; - break; - case HOURS: - millis = 1000 * 60 * 60L; - break; - case MICROSECONDS: - millis = 1 / 1000; - break; - case MILLISECONDS: - millis = 1; - break; - case MINUTES: - millis = 1000 * 60L; - break; - case NANOSECONDS: - millis = 1 / 1000000; - break; - case SECONDS: - millis = 1000; - break; - default: - millis = 1; - break; - } - - return millis; - } + + public final String SUBJECT; + + public final int START_DELAY; + + public final TimeUnit START_DELAY_UNIT; + + public final String CRON; + + protected Date endTime; + + protected Map data; + + public RepeatingCronSchedule(String subject, int startDelay, TimeUnit startDelayUnit, String cronExpression) { + this.SUBJECT = subject; + this.START_DELAY = startDelay; + this.START_DELAY_UNIT = startDelayUnit; + this.CRON = cronExpression; + } + + public RepeatingCronSchedule(String subject, int startDelay, TimeUnit startDelayUnit, String cronExpression, + Date endTime, Map data) { + this.SUBJECT = subject; + this.START_DELAY = startDelay; + this.START_DELAY_UNIT = startDelayUnit; + this.CRON = cronExpression; + this.endTime = endTime; + this.data = data; + } + + public Date getEndTime() { + return endTime; + } + + public RepeatingCronSchedule withEndTime(Date endTime) { + this.endTime = endTime; + return this; + } + + public Map getData() { + return data; + } + + public RepeatingCronSchedule addData(String key, Object value) { + data.put(key, value); + return this; + } + + public RepeatingCronSchedule withData(Map data) { + this.data = data; + return this; + } + + public long getStartDelayMilis() { + return START_DELAY * millisConverter(START_DELAY_UNIT); + } + + protected long millisConverter(TimeUnit unit) { + long millis = 1L; + switch (unit) { + case DAYS: + millis = 1000 * 60 * 60 * 24L; + break; + case HOURS: + millis = 1000 * 60 * 60L; + break; + case MICROSECONDS: + millis = 1 / 1000; + break; + case MILLISECONDS: + millis = 1; + break; + case MINUTES: + millis = 1000 * 60L; + break; + case NANOSECONDS: + millis = 1 / 1000000; + break; + case SECONDS: + millis = 1000; + break; + default: + millis = 1; + break; + } + + return millis; + } } diff --git a/src/main/java/org/opensrp/scheduler/RepeatingSchedule.java b/src/main/java/org/opensrp/scheduler/RepeatingSchedule.java index c5fc07482..baca3b08a 100644 --- a/src/main/java/org/opensrp/scheduler/RepeatingSchedule.java +++ b/src/main/java/org/opensrp/scheduler/RepeatingSchedule.java @@ -5,102 +5,102 @@ import java.util.concurrent.TimeUnit; public class RepeatingSchedule { - - public final String SUBJECT; - - public final int START_DELAY; - - public final int REPEAT_INTERVAL; - - public final TimeUnit START_DELAY_UNIT; - - public final TimeUnit REPEAT_INTERVAL_UNIT; - - protected Date endTime; - - protected Map data; - - public RepeatingSchedule(String subject, int startDelay, TimeUnit startDelayUnit, int repeatInterval, - TimeUnit repeatIntervalUnit) { - this.SUBJECT = subject; - this.START_DELAY = startDelay; - this.REPEAT_INTERVAL = repeatInterval; - this.START_DELAY_UNIT = startDelayUnit; - this.REPEAT_INTERVAL_UNIT = repeatIntervalUnit; - } - - public RepeatingSchedule(String subject, int startDelay, TimeUnit startDelayUnit, int repeatInterval, - TimeUnit repeatIntervalUnit, Date endTime, Map data) { - this.SUBJECT = subject; - this.START_DELAY = startDelay; - this.REPEAT_INTERVAL = repeatInterval; - this.START_DELAY_UNIT = startDelayUnit; - this.REPEAT_INTERVAL_UNIT = repeatIntervalUnit; - this.endTime = endTime; - this.data = data; - } - - public Date getEndTime() { - return endTime; - } - - public RepeatingSchedule withEndTime(Date endTime) { - this.endTime = endTime; - return this; - } - - public Map getData() { - return data; - } - - public RepeatingSchedule addData(String key, Object value) { - data.put(key, value); - return this; - } - - public RepeatingSchedule withData(Map data) { - this.data = data; - return this; - } - - public long getStartDelayMilis() { - return START_DELAY * millisConverter(START_DELAY_UNIT); - } - - public long getRepeatIntervalMilis() { - return REPEAT_INTERVAL * millisConverter(REPEAT_INTERVAL_UNIT); - } - - protected long millisConverter(TimeUnit unit) { - long millis = 1L; - switch (unit) { - case DAYS: - millis = 1000 * 60 * 60 * 24L; - break; - case HOURS: - millis = 1000 * 60 * 60L; - break; - case MICROSECONDS: - millis = 1 / 1000; - break; - case MILLISECONDS: - millis = 1; - break; - case MINUTES: - millis = 1000 * 60L; - break; - case NANOSECONDS: - millis = 1 / 1000000; - break; - case SECONDS: - millis = 1000; - break; - default: - millis = 1; - break; - } - - return millis; - } - + + public final String SUBJECT; + + public final int START_DELAY; + + public final int REPEAT_INTERVAL; + + public final TimeUnit START_DELAY_UNIT; + + public final TimeUnit REPEAT_INTERVAL_UNIT; + + protected Date endTime; + + protected Map data; + + public RepeatingSchedule(String subject, int startDelay, TimeUnit startDelayUnit, int repeatInterval, + TimeUnit repeatIntervalUnit) { + this.SUBJECT = subject; + this.START_DELAY = startDelay; + this.REPEAT_INTERVAL = repeatInterval; + this.START_DELAY_UNIT = startDelayUnit; + this.REPEAT_INTERVAL_UNIT = repeatIntervalUnit; + } + + public RepeatingSchedule(String subject, int startDelay, TimeUnit startDelayUnit, int repeatInterval, + TimeUnit repeatIntervalUnit, Date endTime, Map data) { + this.SUBJECT = subject; + this.START_DELAY = startDelay; + this.REPEAT_INTERVAL = repeatInterval; + this.START_DELAY_UNIT = startDelayUnit; + this.REPEAT_INTERVAL_UNIT = repeatIntervalUnit; + this.endTime = endTime; + this.data = data; + } + + public Date getEndTime() { + return endTime; + } + + public RepeatingSchedule withEndTime(Date endTime) { + this.endTime = endTime; + return this; + } + + public Map getData() { + return data; + } + + public RepeatingSchedule addData(String key, Object value) { + data.put(key, value); + return this; + } + + public RepeatingSchedule withData(Map data) { + this.data = data; + return this; + } + + public long getStartDelayMilis() { + return START_DELAY * millisConverter(START_DELAY_UNIT); + } + + public long getRepeatIntervalMilis() { + return REPEAT_INTERVAL * millisConverter(REPEAT_INTERVAL_UNIT); + } + + protected long millisConverter(TimeUnit unit) { + long millis = 1L; + switch (unit) { + case DAYS: + millis = 1000 * 60 * 60 * 24L; + break; + case HOURS: + millis = 1000 * 60 * 60L; + break; + case MICROSECONDS: + millis = 1 / 1000; + break; + case MILLISECONDS: + millis = 1; + break; + case MINUTES: + millis = 1000 * 60L; + break; + case NANOSECONDS: + millis = 1 / 1000000; + break; + case SECONDS: + millis = 1000; + break; + default: + millis = 1; + break; + } + + return millis; + } + } diff --git a/src/main/java/org/opensrp/scheduler/Schedule.java b/src/main/java/org/opensrp/scheduler/Schedule.java index bd09151dc..144c7e736 100644 --- a/src/main/java/org/opensrp/scheduler/Schedule.java +++ b/src/main/java/org/opensrp/scheduler/Schedule.java @@ -18,159 +18,151 @@ import ch.maxant.rules.Rule; public class Schedule { - - public enum ActionType { - enroll, - unenroll, - fulfill - } - - private ActionType action; - - private List forms; - - private String schedule; - - private String milestone; - - private List triggerDateFields; - - private String entityType; - - private String passLogic; - - Schedule() { - - } - - public Schedule(String json) throws JSONException { - this(new JSONObject(json)); - } - - public Schedule(JSONObject json) throws JSONException { - this(ActionType.valueOf(json.getString("action").toLowerCase()), json.getString("form").split(","), - json.getString("schedule"), json.getString("milestone"), json.getString("triggerDateField").split(","), - json.getString("entityType"), json.has("passLogic") ? json.getString("passLogic") : null); - } - - public Schedule(ActionType action, String[] forms, String schedule, String milestone, String[] triggerDateFields, - String entityType, String passLogic) { - this.action = action; - this.forms = new ArrayList<>(); - for (String f : forms) { - this.forms.add(f.trim()); - } - this.schedule = schedule.trim(); - this.milestone = milestone.trim(); - this.triggerDateFields = new ArrayList<>(); - for (String tf : triggerDateFields) { - this.triggerDateFields.add(tf.trim()); - } - this.entityType = entityType.trim(); - this.passLogic = passLogic; - } - - public boolean hasForm(String form) { - for (String f : forms) { - if (f.trim().equalsIgnoreCase(form.trim())) { - return true; - } - } - return false; - } - - public boolean applicableForEntity(String entity) { - return entityType.equalsIgnoreCase(entity.trim()); - } - - public boolean haspassLogic() { - return !StringUtils.isBlank(passLogic); - } - - public boolean passesValidations(Map flvl) { - if (!haspassLogic()) { - return true; - } - - String xpr = passLogic; - for (Entry kv : flvl.entrySet()) { - if (kv.getValue() == null) { - flvl.put(kv.getKey(), ""); - } - xpr = xpr.replace("${fs." + kv.getKey() + "}", "input." + kv.getKey()); - } - - Rule r1 = new Rule("R1", xpr, "true", 4, "dynamic.rules"); - Rule r2 = new Rule("R2", "!#R1", "false", 4, "dynamic.rules"); - List rules = Arrays.asList(r1, r2); - try { - Engine engine = new Engine(rules, true); - String result = engine.getBestOutcome(flvl); - return Boolean.valueOf(result); - } - catch (DuplicateNameException | CompileException | ParseException e) { - e.printStackTrace(); - throw new RuntimeException("Error while parsing Schedule Logic: " + e.getMessage(), e); - } - catch (NoMatchingRuleFoundException e) {//although it would never be thrown - e.printStackTrace(); - throw new RuntimeException("Error while parsing Schedule Logic: " + e.getMessage(), e); - } - } - - public ActionType action() { - return action; - } - - public List forms() { - return forms; - } - - public String schedule() { - return schedule; - } - - public String milestone() { - return milestone; - } - - public List triggerDateFields() { - return triggerDateFields; - } - - public String entityType() { - return entityType; - } - - public String passLogic() { - return passLogic; - } - - public ActionType getAction() { - return action; - } - - public List getForms() { - return forms; - } - - public String getSchedule() { - return schedule; - } - - public String getMilestone() { - return milestone; - } - - public List getTriggerDateFields() { - return triggerDateFields; - } - - public String getEntityType() { - return entityType; - } - - public String getPassLogic() { - return passLogic; - } + + private ActionType action; + private List forms; + private String schedule; + private String milestone; + private List triggerDateFields; + private String entityType; + private String passLogic; + + Schedule() { + + } + + public Schedule(String json) throws JSONException { + this(new JSONObject(json)); + } + + public Schedule(JSONObject json) throws JSONException { + this(ActionType.valueOf(json.getString("action").toLowerCase()), json.getString("form").split(","), + json.getString("schedule"), json.getString("milestone"), json.getString("triggerDateField").split(","), + json.getString("entityType"), json.has("passLogic") ? json.getString("passLogic") : null); + } + + public Schedule(ActionType action, String[] forms, String schedule, String milestone, String[] triggerDateFields, + String entityType, String passLogic) { + this.action = action; + this.forms = new ArrayList<>(); + for (String f : forms) { + this.forms.add(f.trim()); + } + this.schedule = schedule.trim(); + this.milestone = milestone.trim(); + this.triggerDateFields = new ArrayList<>(); + for (String tf : triggerDateFields) { + this.triggerDateFields.add(tf.trim()); + } + this.entityType = entityType.trim(); + this.passLogic = passLogic; + } + + public boolean hasForm(String form) { + for (String f : forms) { + if (f.trim().equalsIgnoreCase(form.trim())) { + return true; + } + } + return false; + } + + public boolean applicableForEntity(String entity) { + return entityType.equalsIgnoreCase(entity.trim()); + } + + public boolean haspassLogic() { + return !StringUtils.isBlank(passLogic); + } + + public boolean passesValidations(Map flvl) { + if (!haspassLogic()) { + return true; + } + + String xpr = passLogic; + for (Entry kv : flvl.entrySet()) { + if (kv.getValue() == null) { + flvl.put(kv.getKey(), ""); + } + xpr = xpr.replace("${fs." + kv.getKey() + "}", "input." + kv.getKey()); + } + + Rule r1 = new Rule("R1", xpr, "true", 4, "dynamic.rules"); + Rule r2 = new Rule("R2", "!#R1", "false", 4, "dynamic.rules"); + List rules = Arrays.asList(r1, r2); + try { + Engine engine = new Engine(rules, true); + String result = engine.getBestOutcome(flvl); + return Boolean.valueOf(result); + } catch (DuplicateNameException | CompileException | ParseException e) { + e.printStackTrace(); + throw new RuntimeException("Error while parsing Schedule Logic: " + e.getMessage(), e); + } catch (NoMatchingRuleFoundException e) {//although it would never be thrown + e.printStackTrace(); + throw new RuntimeException("Error while parsing Schedule Logic: " + e.getMessage(), e); + } + } + + public ActionType action() { + return action; + } + + public List forms() { + return forms; + } + + public String schedule() { + return schedule; + } + + public String milestone() { + return milestone; + } + + public List triggerDateFields() { + return triggerDateFields; + } + + public String entityType() { + return entityType; + } + + public String passLogic() { + return passLogic; + } + + public ActionType getAction() { + return action; + } + + public List getForms() { + return forms; + } + + public String getSchedule() { + return schedule; + } + + public String getMilestone() { + return milestone; + } + + public List getTriggerDateFields() { + return triggerDateFields; + } + + public String getEntityType() { + return entityType; + } + + public String getPassLogic() { + return passLogic; + } + + public enum ActionType { + enroll, + unenroll, + fulfill + } } diff --git a/src/main/java/org/opensrp/scheduler/repository/ActionsRepository.java b/src/main/java/org/opensrp/scheduler/repository/ActionsRepository.java index b4dbe2048..8a4543e58 100644 --- a/src/main/java/org/opensrp/scheduler/repository/ActionsRepository.java +++ b/src/main/java/org/opensrp/scheduler/repository/ActionsRepository.java @@ -7,24 +7,24 @@ import org.opensrp.scheduler.Action; public interface ActionsRepository extends BaseRepository { - - List findByProviderIdAndTimeStamp(String providerId, long timeStamp); - - List findAlertByANMIdEntityIdScheduleName(String providerId, String baseEntityId, String scheduleName); - - List findByCaseIdScheduleAndTimeStamp(String baseEntityId, String schedule, DateTime start, DateTime end); - - List findByCaseIdAndTimeStamp(String baseEntityId, long timeStamp); - - void deleteAllByTarget(String target); - - void markAllAsInActiveFor(String baseEntityId); - - void addOrUpdateAlert(Action alertAction); - - void markAlertAsInactiveFor(String providerId, String baseEntityId, String scheduleName); - - List findByCriteria(String team, String providerId, long timeStamp, String sortBy, String sortOrder, int limit); - - List findAllActionNotExpired(); + + List findByProviderIdAndTimeStamp(String providerId, long timeStamp); + + List findAlertByANMIdEntityIdScheduleName(String providerId, String baseEntityId, String scheduleName); + + List findByCaseIdScheduleAndTimeStamp(String baseEntityId, String schedule, DateTime start, DateTime end); + + List findByCaseIdAndTimeStamp(String baseEntityId, long timeStamp); + + void deleteAllByTarget(String target); + + void markAllAsInActiveFor(String baseEntityId); + + void addOrUpdateAlert(Action alertAction); + + void markAlertAsInactiveFor(String providerId, String baseEntityId, String scheduleName); + + List findByCriteria(String team, String providerId, long timeStamp, String sortBy, String sortOrder, int limit); + + List findAllActionNotExpired(); } diff --git a/src/main/java/org/opensrp/scheduler/repository/AlertsRepository.java b/src/main/java/org/opensrp/scheduler/repository/AlertsRepository.java index 9fc427021..65aebca0b 100644 --- a/src/main/java/org/opensrp/scheduler/repository/AlertsRepository.java +++ b/src/main/java/org/opensrp/scheduler/repository/AlertsRepository.java @@ -8,30 +8,30 @@ import org.opensrp.scheduler.Alert; public interface AlertsRepository extends BaseRepository { - - List findByProviderAndTimestamp(String provider, long timeStamp); - - List findActiveByProviderAndTimestamp(String provider, long timeStamp); - - List findAlertByProviderEntityIdTriggerName(String provider, String entityId, String triggerName); - - List findActiveAlertByProviderEntityIdTriggerName(String provider, String entityId, String triggerName); - - List findActiveAlertByEntityIdTriggerName(String entityId, String triggerName); - - List findActiveAlertByEntityId(String entityId); - - List findByEntityIdTriggerAndTimeStamp(String entityId, String trigger, DateTime start, DateTime end); - - void markAllAsClosedFor(String entityId, String reasonForClose); - - void markAlertAsClosedFor(String providerId, String entityId, String triggerName, String reasonForClose); - - void markAlertAsCompleteFor(String providerId, String entityId, String triggerName, String completionDate); - - void addOrUpdateScheduleNotificationAlert(String beneficiaryType, String entityId, String providerId, String triggerName, - String triggerCode, AlertStatus alertStatus, DateTime startDate, DateTime expiryDate); - - void markAlertAsCompleteFor(String entityId, String triggerName, String completionDate); - + + List findByProviderAndTimestamp(String provider, long timeStamp); + + List findActiveByProviderAndTimestamp(String provider, long timeStamp); + + List findAlertByProviderEntityIdTriggerName(String provider, String entityId, String triggerName); + + List findActiveAlertByProviderEntityIdTriggerName(String provider, String entityId, String triggerName); + + List findActiveAlertByEntityIdTriggerName(String entityId, String triggerName); + + List findActiveAlertByEntityId(String entityId); + + List findByEntityIdTriggerAndTimeStamp(String entityId, String trigger, DateTime start, DateTime end); + + void markAllAsClosedFor(String entityId, String reasonForClose); + + void markAlertAsClosedFor(String providerId, String entityId, String triggerName, String reasonForClose); + + void markAlertAsCompleteFor(String providerId, String entityId, String triggerName, String completionDate); + + void addOrUpdateScheduleNotificationAlert(String beneficiaryType, String entityId, String providerId, String triggerName, + String triggerCode, AlertStatus alertStatus, DateTime startDate, DateTime expiryDate); + + void markAlertAsCompleteFor(String entityId, String triggerName, String completionDate); + } diff --git a/src/main/java/org/opensrp/scheduler/service/ActionService.java b/src/main/java/org/opensrp/scheduler/service/ActionService.java index 6165f2611..e98b4ccb6 100644 --- a/src/main/java/org/opensrp/scheduler/service/ActionService.java +++ b/src/main/java/org/opensrp/scheduler/service/ActionService.java @@ -17,101 +17,101 @@ @Service public class ActionService { - - public static final String ALL_PROVIDERS = "all_providers"; - - private ActionsRepository allActions; - - private AlertsRepository allAlerts; - - @Autowired - public ActionService(ActionsRepository allActions, AlertsRepository allAlerts) { - this.allActions = allActions; - this.allAlerts = allAlerts; - } - - public List getNewAlertsForANM(String anmIdentifier, long timeStamp) { - return allActions.findByProviderIdAndTimeStamp(anmIdentifier, timeStamp); - } - - public List getAlertsForProvider(String providerId, long timeStamp) { - return allAlerts.findByProviderAndTimestamp(providerId, timeStamp); - } - - public List getAlertsActiveForProvider(String providerId, long timeStamp) { - return allAlerts.findActiveByProviderAndTimestamp(providerId, timeStamp); - } - - public List findByCaseIdScheduleAndTimeStamp(String caseId, String schedule, DateTime start, DateTime end) { - return allActions.findByCaseIdScheduleAndTimeStamp(caseId, schedule, start, end); - } - - public List findByCaseIdAndTimeStamp(String caseId, long timeStamp) { - return allActions.findByCaseIdAndTimeStamp(caseId, timeStamp); - } - - public List findAlertByEntityIdScheduleAndTimeStamp(String entityId, String schedule, DateTime start, - DateTime end) { - return allAlerts.findByEntityIdTriggerAndTimeStamp(entityId, schedule, start, end); - } - - public void alertForBeneficiary(String beneficiaryType, String caseID, String anmIdentifier, String scheduleName, - String visitCode, AlertStatus alertStatus, DateTime startDate, DateTime expiryDate) { - allActions.addOrUpdateAlert(new Action(caseID, anmIdentifier, - ActionData.createAlert(beneficiaryType, scheduleName, visitCode, alertStatus, startDate, expiryDate))); - allAlerts.addOrUpdateScheduleNotificationAlert(beneficiaryType, caseID, anmIdentifier, scheduleName, visitCode, - alertStatus, startDate, expiryDate); - } - - public void alertForBeneficiary(Action action) { - allActions.addOrUpdateAlert(action); - } - - public void markAllAlertsAsInactive(String entityId) { - allActions.markAllAsInActiveFor(entityId); - allAlerts.markAllAsClosedFor(entityId, "unenrolled from schedule"); - } - - public void markAlertAsInactive(String anmId, String entityId, String scheduleName) { - allActions.markAlertAsInactiveFor(anmId, entityId, scheduleName); - allAlerts.markAlertAsClosedFor(anmId, entityId, scheduleName, "unenrolled from schedule"); - } - - public void markAlertAsClosed(String caseId, String anmIdentifier, String visitCode, String completionDate) { - allActions.add(new Action(caseId, anmIdentifier, ActionData.markAlertAsClosed(visitCode, completionDate))); - allAlerts.markAlertAsCompleteFor(anmIdentifier, caseId, visitCode, completionDate); - } - - public void markAlertAsClosed(String caseId, String visitCode, String completionDate) { - allActions.add(new Action(caseId, ALL_PROVIDERS, ActionData.markAlertAsClosed(visitCode, completionDate))); - allAlerts.markAlertAsCompleteFor(caseId, visitCode, completionDate); - } - - public void closeBeneficiary(BeneficiaryType beneficiary, String caseId, String anmIdentifier, String reasonForClose) { - allActions.add(new Action(caseId, anmIdentifier, ActionData.closeBeneficiary(beneficiary.name(), reasonForClose))); - //TODO - allAlerts.add(new Alert(anmIdentifier, caseId, beneficiary.name(), AlertType.notification, TriggerType.caseClosed, - null, null, getCurrentDateTime(), getCurrentDateTime(), AlertStatus.urgent, null)); - } - - public void reportForIndicator(String anmIdentifier, ActionData actionData) { - allActions.add(new Action("", anmIdentifier, actionData)); - } - - public void deleteReportActions() { - allActions.deleteAllByTarget("report"); - } - - public List findByCriteria(String team, String providerId, long timeStamp, String sortBy, String sortOrder, - int limit) { - return allActions.findByCriteria(team, providerId, timeStamp, sortBy, sortOrder, limit); - } - - public DateTime getCurrentDateTime() { - return new DateTime(); - } - - public List findAllActionNotExpired() { - return allActions.findAllActionNotExpired(); - } + + public static final String ALL_PROVIDERS = "all_providers"; + + private ActionsRepository allActions; + + private AlertsRepository allAlerts; + + @Autowired + public ActionService(ActionsRepository allActions, AlertsRepository allAlerts) { + this.allActions = allActions; + this.allAlerts = allAlerts; + } + + public List getNewAlertsForANM(String anmIdentifier, long timeStamp) { + return allActions.findByProviderIdAndTimeStamp(anmIdentifier, timeStamp); + } + + public List getAlertsForProvider(String providerId, long timeStamp) { + return allAlerts.findByProviderAndTimestamp(providerId, timeStamp); + } + + public List getAlertsActiveForProvider(String providerId, long timeStamp) { + return allAlerts.findActiveByProviderAndTimestamp(providerId, timeStamp); + } + + public List findByCaseIdScheduleAndTimeStamp(String caseId, String schedule, DateTime start, DateTime end) { + return allActions.findByCaseIdScheduleAndTimeStamp(caseId, schedule, start, end); + } + + public List findByCaseIdAndTimeStamp(String caseId, long timeStamp) { + return allActions.findByCaseIdAndTimeStamp(caseId, timeStamp); + } + + public List findAlertByEntityIdScheduleAndTimeStamp(String entityId, String schedule, DateTime start, + DateTime end) { + return allAlerts.findByEntityIdTriggerAndTimeStamp(entityId, schedule, start, end); + } + + public void alertForBeneficiary(String beneficiaryType, String caseID, String anmIdentifier, String scheduleName, + String visitCode, AlertStatus alertStatus, DateTime startDate, DateTime expiryDate) { + allActions.addOrUpdateAlert(new Action(caseID, anmIdentifier, + ActionData.createAlert(beneficiaryType, scheduleName, visitCode, alertStatus, startDate, expiryDate))); + allAlerts.addOrUpdateScheduleNotificationAlert(beneficiaryType, caseID, anmIdentifier, scheduleName, visitCode, + alertStatus, startDate, expiryDate); + } + + public void alertForBeneficiary(Action action) { + allActions.addOrUpdateAlert(action); + } + + public void markAllAlertsAsInactive(String entityId) { + allActions.markAllAsInActiveFor(entityId); + allAlerts.markAllAsClosedFor(entityId, "unenrolled from schedule"); + } + + public void markAlertAsInactive(String anmId, String entityId, String scheduleName) { + allActions.markAlertAsInactiveFor(anmId, entityId, scheduleName); + allAlerts.markAlertAsClosedFor(anmId, entityId, scheduleName, "unenrolled from schedule"); + } + + public void markAlertAsClosed(String caseId, String anmIdentifier, String visitCode, String completionDate) { + allActions.add(new Action(caseId, anmIdentifier, ActionData.markAlertAsClosed(visitCode, completionDate))); + allAlerts.markAlertAsCompleteFor(anmIdentifier, caseId, visitCode, completionDate); + } + + public void markAlertAsClosed(String caseId, String visitCode, String completionDate) { + allActions.add(new Action(caseId, ALL_PROVIDERS, ActionData.markAlertAsClosed(visitCode, completionDate))); + allAlerts.markAlertAsCompleteFor(caseId, visitCode, completionDate); + } + + public void closeBeneficiary(BeneficiaryType beneficiary, String caseId, String anmIdentifier, String reasonForClose) { + allActions.add(new Action(caseId, anmIdentifier, ActionData.closeBeneficiary(beneficiary.name(), reasonForClose))); + //TODO + allAlerts.add(new Alert(anmIdentifier, caseId, beneficiary.name(), AlertType.notification, TriggerType.caseClosed, + null, null, getCurrentDateTime(), getCurrentDateTime(), AlertStatus.urgent, null)); + } + + public void reportForIndicator(String anmIdentifier, ActionData actionData) { + allActions.add(new Action("", anmIdentifier, actionData)); + } + + public void deleteReportActions() { + allActions.deleteAllByTarget("report"); + } + + public List findByCriteria(String team, String providerId, long timeStamp, String sortBy, String sortOrder, + int limit) { + return allActions.findByCriteria(team, providerId, timeStamp, sortBy, sortOrder, limit); + } + + public DateTime getCurrentDateTime() { + return new DateTime(); + } + + public List findAllActionNotExpired() { + return allActions.findAllActionNotExpired(); + } } diff --git a/src/main/java/org/opensrp/search/AddressSearchBean.java b/src/main/java/org/opensrp/search/AddressSearchBean.java index ed3994bbf..79849148a 100644 --- a/src/main/java/org/opensrp/search/AddressSearchBean.java +++ b/src/main/java/org/opensrp/search/AddressSearchBean.java @@ -3,90 +3,90 @@ import org.apache.commons.lang.StringUtils; public class AddressSearchBean { - - private String addressType; - - private String country; - - private String stateProvince; - - private String cityVillage; - - private String countyDistrict; - - private String subDistrict; - - private String town; - - private String subTown; - - public String getAddressType() { - return addressType; - } - - public void setAddressType(String addressType) { - this.addressType = addressType; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String getStateProvince() { - return stateProvince; - } - - public void setStateProvince(String stateProvince) { - this.stateProvince = stateProvince; - } - - public String getCityVillage() { - return cityVillage; - } - - public void setCityVillage(String cityVillage) { - this.cityVillage = cityVillage; - } - - public String getCountyDistrict() { - return countyDistrict; - } - - public void setCountyDistrict(String countyDistrict) { - this.countyDistrict = countyDistrict; - } - - public String getSubDistrict() { - return subDistrict; - } - - public void setSubDistrict(String subDistrict) { - this.subDistrict = subDistrict; - } - - public String getTown() { - return town; - } - - public void setTown(String town) { - this.town = town; - } - - public String getSubTown() { - return subTown; - } - - public void setSubTown(String subTown) { - this.subTown = subTown; - } - - public boolean isHasFilter() { - return StringUtils.isNotEmpty(addressType) || StringUtils.isNotEmpty(country) - || StringUtils.isNotEmpty(stateProvince) || StringUtils.isNotEmpty(cityVillage) - || StringUtils.isNotEmpty(countyDistrict) || StringUtils.isNotEmpty(town) || StringUtils.isNotEmpty(subTown); - } + + private String addressType; + + private String country; + + private String stateProvince; + + private String cityVillage; + + private String countyDistrict; + + private String subDistrict; + + private String town; + + private String subTown; + + public String getAddressType() { + return addressType; + } + + public void setAddressType(String addressType) { + this.addressType = addressType; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public String getStateProvince() { + return stateProvince; + } + + public void setStateProvince(String stateProvince) { + this.stateProvince = stateProvince; + } + + public String getCityVillage() { + return cityVillage; + } + + public void setCityVillage(String cityVillage) { + this.cityVillage = cityVillage; + } + + public String getCountyDistrict() { + return countyDistrict; + } + + public void setCountyDistrict(String countyDistrict) { + this.countyDistrict = countyDistrict; + } + + public String getSubDistrict() { + return subDistrict; + } + + public void setSubDistrict(String subDistrict) { + this.subDistrict = subDistrict; + } + + public String getTown() { + return town; + } + + public void setTown(String town) { + this.town = town; + } + + public String getSubTown() { + return subTown; + } + + public void setSubTown(String subTown) { + this.subTown = subTown; + } + + public boolean isHasFilter() { + return StringUtils.isNotEmpty(addressType) || StringUtils.isNotEmpty(country) + || StringUtils.isNotEmpty(stateProvince) || StringUtils.isNotEmpty(cityVillage) + || StringUtils.isNotEmpty(countyDistrict) || StringUtils.isNotEmpty(town) || StringUtils.isNotEmpty(subTown); + } } diff --git a/src/main/java/org/opensrp/search/AssignedLocationAndPlanSearchBean.java b/src/main/java/org/opensrp/search/AssignedLocationAndPlanSearchBean.java index 2dbacc519..fa1ab874d 100644 --- a/src/main/java/org/opensrp/search/AssignedLocationAndPlanSearchBean.java +++ b/src/main/java/org/opensrp/search/AssignedLocationAndPlanSearchBean.java @@ -9,16 +9,16 @@ @NoArgsConstructor @AllArgsConstructor @SuperBuilder -public class AssignedLocationAndPlanSearchBean extends BaseSearchBean{ +public class AssignedLocationAndPlanSearchBean extends BaseSearchBean { - private String planIdentifier; + private String planIdentifier; - private String organizationIdentifier; + private String organizationIdentifier; - private Long planId; + private Long planId; - private Long organizationId; + private Long organizationId; - private boolean returnFutureAssignments; + private boolean returnFutureAssignments; } diff --git a/src/main/java/org/opensrp/search/BaseSearchBean.java b/src/main/java/org/opensrp/search/BaseSearchBean.java index 9fa523271..b1fffe6f6 100644 --- a/src/main/java/org/opensrp/search/BaseSearchBean.java +++ b/src/main/java/org/opensrp/search/BaseSearchBean.java @@ -11,20 +11,17 @@ @SuperBuilder public class BaseSearchBean { - public enum OrderByType { - ASC, DESC - } - - public enum FieldName { - id, server_version - } - - private Integer pageNumber = 0; - - private Integer pageSize = 0; - - private BaseSearchBean.OrderByType orderByType; - - private BaseSearchBean.FieldName orderByFieldName; + private Integer pageNumber = 0; + private Integer pageSize = 0; + private BaseSearchBean.OrderByType orderByType; + private BaseSearchBean.FieldName orderByFieldName; + + public enum OrderByType { + ASC, DESC + } + + public enum FieldName { + id, server_version + } } diff --git a/src/main/java/org/opensrp/search/ClientSearchBean.java b/src/main/java/org/opensrp/search/ClientSearchBean.java index 02ebb142f..218a4068a 100644 --- a/src/main/java/org/opensrp/search/ClientSearchBean.java +++ b/src/main/java/org/opensrp/search/ClientSearchBean.java @@ -13,247 +13,247 @@ @NoArgsConstructor @AllArgsConstructor public class ClientSearchBean { - - private String nameLike; - - private String gender; - - private DateTime birthdateFrom; - - private DateTime birthdateTo; - - private DateTime deathdateFrom; - - private DateTime deathdateTo; - - private String attributeType; - - private String attributeValue; - - private DateTime lastEditFrom; - - private DateTime lastEditTo; - - private Map identifiers; - - private Map attributes; - - private String firstName; - - private String middleName; - - private String lastName; - - private String clientType; - - private String providerId; - - @Builder.Default - private int pageNumber = 0; - - @Builder.Default - private int pageSize = 0; - - private String orderByField; // The field name which used to order result - - private String orderByType; // type of order ASC or DESC - - private List locations; - - private DateTime startDate; - - private DateTime endDate; - - public List getLocations() { - return locations; - } - - public void setLocations(List locations) { - this.locations = locations; - } - - public String getOrderByField() { - return orderByField; - } - - public void setOrderByField(String orderByField) { - this.orderByField = orderByField; - } - - public String getOrderByType() { - return orderByType; - } - - public void setOrderByType(String orderByType) { - this.orderByType = orderByType; - } - - public int getPageSize() { - return pageSize; - } - - public void setPageSize(int pageSize) { - this.pageSize = pageSize; - } - - public int getPageNumber() { - return pageNumber; - } - - public void setPageNumber(int pageNumber) { - this.pageNumber = pageNumber; - } - - public String getNameLike() { - return nameLike; - } - - public void setNameLike(String nameLike) { - this.nameLike = nameLike; - } - - public String getGender() { - return gender; - } - - public void setGender(String gender) { - this.gender = gender; - } - - public DateTime getBirthdateFrom() { - return birthdateFrom; - } - - public void setBirthdateFrom(DateTime birthdateFrom) { - this.birthdateFrom = birthdateFrom; - } - - public DateTime getBirthdateTo() { - return birthdateTo; - } - - public void setBirthdateTo(DateTime birthdateTo) { - this.birthdateTo = birthdateTo; - } - - public DateTime getDeathdateFrom() { - return deathdateFrom; - } - - public void setDeathdateFrom(DateTime deathdateFrom) { - this.deathdateFrom = deathdateFrom; - } - - public DateTime getDeathdateTo() { - return deathdateTo; - } - - public void setDeathdateTo(DateTime deathdateTo) { - this.deathdateTo = deathdateTo; - } - - public String getAttributeType() { - return attributeType; - } - - public void setAttributeType(String attributeType) { - this.attributeType = attributeType; - } - - public String getAttributeValue() { - return attributeValue; - } - - public void setAttributeValue(String attributeValue) { - this.attributeValue = attributeValue; - } - - public DateTime getLastEditFrom() { - return lastEditFrom; - } - - public void setLastEditFrom(DateTime lastEditFrom) { - this.lastEditFrom = lastEditFrom; - } - - public DateTime getLastEditTo() { - return lastEditTo; - } - - public void setLastEditTo(DateTime lastEditTo) { - this.lastEditTo = lastEditTo; - } - - public Map getIdentifiers() { - return identifiers; - } - - public void setIdentifiers(Map identifiers) { - this.identifiers = identifiers; - } - - public Map getAttributes() { - return attributes; - } - - public void setAttributes(Map attributes) { - this.attributes = attributes; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getMiddleName() { - return middleName; - } - - public void setMiddleName(String middleName) { - this.middleName = middleName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getClientType() { - return clientType; - } - - public void setClientType(String clientType) { - this.clientType = clientType; - } - - public String getProviderId() { - return providerId; - } - - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - public DateTime getStartDate() { - return startDate; - } - - public void setStartDate(DateTime startDate) { - this.startDate = startDate; - } - - public DateTime getEndDate() { - return endDate; - } - - public void setEndDate(DateTime endDate) { - this.endDate = endDate; - } - + + private String nameLike; + + private String gender; + + private DateTime birthdateFrom; + + private DateTime birthdateTo; + + private DateTime deathdateFrom; + + private DateTime deathdateTo; + + private String attributeType; + + private String attributeValue; + + private DateTime lastEditFrom; + + private DateTime lastEditTo; + + private Map identifiers; + + private Map attributes; + + private String firstName; + + private String middleName; + + private String lastName; + + private String clientType; + + private String providerId; + + @Builder.Default + private int pageNumber = 0; + + @Builder.Default + private int pageSize = 0; + + private String orderByField; // The field name which used to order result + + private String orderByType; // type of order ASC or DESC + + private List locations; + + private DateTime startDate; + + private DateTime endDate; + + public List getLocations() { + return locations; + } + + public void setLocations(List locations) { + this.locations = locations; + } + + public String getOrderByField() { + return orderByField; + } + + public void setOrderByField(String orderByField) { + this.orderByField = orderByField; + } + + public String getOrderByType() { + return orderByType; + } + + public void setOrderByType(String orderByType) { + this.orderByType = orderByType; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public String getNameLike() { + return nameLike; + } + + public void setNameLike(String nameLike) { + this.nameLike = nameLike; + } + + public String getGender() { + return gender; + } + + public void setGender(String gender) { + this.gender = gender; + } + + public DateTime getBirthdateFrom() { + return birthdateFrom; + } + + public void setBirthdateFrom(DateTime birthdateFrom) { + this.birthdateFrom = birthdateFrom; + } + + public DateTime getBirthdateTo() { + return birthdateTo; + } + + public void setBirthdateTo(DateTime birthdateTo) { + this.birthdateTo = birthdateTo; + } + + public DateTime getDeathdateFrom() { + return deathdateFrom; + } + + public void setDeathdateFrom(DateTime deathdateFrom) { + this.deathdateFrom = deathdateFrom; + } + + public DateTime getDeathdateTo() { + return deathdateTo; + } + + public void setDeathdateTo(DateTime deathdateTo) { + this.deathdateTo = deathdateTo; + } + + public String getAttributeType() { + return attributeType; + } + + public void setAttributeType(String attributeType) { + this.attributeType = attributeType; + } + + public String getAttributeValue() { + return attributeValue; + } + + public void setAttributeValue(String attributeValue) { + this.attributeValue = attributeValue; + } + + public DateTime getLastEditFrom() { + return lastEditFrom; + } + + public void setLastEditFrom(DateTime lastEditFrom) { + this.lastEditFrom = lastEditFrom; + } + + public DateTime getLastEditTo() { + return lastEditTo; + } + + public void setLastEditTo(DateTime lastEditTo) { + this.lastEditTo = lastEditTo; + } + + public Map getIdentifiers() { + return identifiers; + } + + public void setIdentifiers(Map identifiers) { + this.identifiers = identifiers; + } + + public Map getAttributes() { + return attributes; + } + + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(String middleName) { + this.middleName = middleName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getClientType() { + return clientType; + } + + public void setClientType(String clientType) { + this.clientType = clientType; + } + + public String getProviderId() { + return providerId; + } + + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + public DateTime getStartDate() { + return startDate; + } + + public void setStartDate(DateTime startDate) { + this.startDate = startDate; + } + + public DateTime getEndDate() { + return endDate; + } + + public void setEndDate(DateTime endDate) { + this.endDate = endDate; + } + } diff --git a/src/main/java/org/opensrp/search/EventSearchBean.java b/src/main/java/org/opensrp/search/EventSearchBean.java index 17f875a0f..6143a82d1 100644 --- a/src/main/java/org/opensrp/search/EventSearchBean.java +++ b/src/main/java/org/opensrp/search/EventSearchBean.java @@ -1,128 +1,127 @@ - package org.opensrp.search; import org.joda.time.DateTime; public class EventSearchBean { - - private String baseEntityId; - - private DateTime eventDateFrom; - - private DateTime eventDateTo; - - private String eventType; - - private String entityType; - - private String providerId; - - private String locationId; - - private DateTime lastEditFrom; - - private DateTime lastEditTo; - - private String team; - - private String teamId; - - private Long serverVersion; - - public String getBaseEntityId() { - return baseEntityId; - } - - public void setBaseEntityId(String baseEntityId) { - this.baseEntityId = baseEntityId; - } - - public DateTime getEventDateFrom() { - return eventDateFrom; - } - - public void setEventDateFrom(DateTime eventDateFrom) { - this.eventDateFrom = eventDateFrom; - } - - public DateTime getEventDateTo() { - return eventDateTo; - } - - public void setEventDateTo(DateTime eventDateTo) { - this.eventDateTo = eventDateTo; - } - - public String getEventType() { - return eventType; - } - - public void setEventType(String eventType) { - this.eventType = eventType; - } - - public String getEntityType() { - return entityType; - } - - public void setEntityType(String entityType) { - this.entityType = entityType; - } - - public String getProviderId() { - return providerId; - } - - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - public String getLocationId() { - return locationId; - } - - public void setLocationId(String locationId) { - this.locationId = locationId; - } - - public DateTime getLastEditFrom() { - return lastEditFrom; - } - - public void setLastEditFrom(DateTime lastEditFrom) { - this.lastEditFrom = lastEditFrom; - } - - public DateTime getLastEditTo() { - return lastEditTo; - } - - public void setLastEditTo(DateTime lastEditTo) { - this.lastEditTo = lastEditTo; - } - - public String getTeam() { - return team; - } - - public void setTeam(String team) { - this.team = team; - } - - public String getTeamId() { - return teamId; - } - - public void setTeamId(String teamId) { - this.teamId = teamId; - } - - public Long getServerVersion() { - return serverVersion; - } - - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } - + + private String baseEntityId; + + private DateTime eventDateFrom; + + private DateTime eventDateTo; + + private String eventType; + + private String entityType; + + private String providerId; + + private String locationId; + + private DateTime lastEditFrom; + + private DateTime lastEditTo; + + private String team; + + private String teamId; + + private Long serverVersion; + + public String getBaseEntityId() { + return baseEntityId; + } + + public void setBaseEntityId(String baseEntityId) { + this.baseEntityId = baseEntityId; + } + + public DateTime getEventDateFrom() { + return eventDateFrom; + } + + public void setEventDateFrom(DateTime eventDateFrom) { + this.eventDateFrom = eventDateFrom; + } + + public DateTime getEventDateTo() { + return eventDateTo; + } + + public void setEventDateTo(DateTime eventDateTo) { + this.eventDateTo = eventDateTo; + } + + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public String getEntityType() { + return entityType; + } + + public void setEntityType(String entityType) { + this.entityType = entityType; + } + + public String getProviderId() { + return providerId; + } + + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + public String getLocationId() { + return locationId; + } + + public void setLocationId(String locationId) { + this.locationId = locationId; + } + + public DateTime getLastEditFrom() { + return lastEditFrom; + } + + public void setLastEditFrom(DateTime lastEditFrom) { + this.lastEditFrom = lastEditFrom; + } + + public DateTime getLastEditTo() { + return lastEditTo; + } + + public void setLastEditTo(DateTime lastEditTo) { + this.lastEditTo = lastEditTo; + } + + public String getTeam() { + return team; + } + + public void setTeam(String team) { + this.team = team; + } + + public String getTeamId() { + return teamId; + } + + public void setTeamId(String teamId) { + this.teamId = teamId; + } + + public Long getServerVersion() { + return serverVersion; + } + + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } + } diff --git a/src/main/java/org/opensrp/search/LocationSearchBean.java b/src/main/java/org/opensrp/search/LocationSearchBean.java index acbb7e5a1..57f273704 100644 --- a/src/main/java/org/opensrp/search/LocationSearchBean.java +++ b/src/main/java/org/opensrp/search/LocationSearchBean.java @@ -1,95 +1,88 @@ package org.opensrp.search; +public class LocationSearchBean { + private String name; + + ; + private Long locationTagId; + private Long parentId; + private String status; + private Integer pageSize; + private Integer pageNumber; + private String orderByFieldName; + private OrderByType orderByType; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getLocationTagId() { + return locationTagId; + } + + public void setLocationTagId(Long locationTagId) { + this.locationTagId = locationTagId; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Integer getPageNumber() { + return pageNumber; + } + + public void setPageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + } + + public String getOrderByFieldName() { + return orderByFieldName; + } + + public void setOrderByFieldName(String orderByFieldName) { + this.orderByFieldName = orderByFieldName; + } + + public OrderByType getOrderByType() { + return orderByType; + } + + public void setOrderByType(OrderByType orderByType) { + this.orderByType = orderByType; + } + + public enum OrderByType { + + ASC, + DESC + + } -public class LocationSearchBean { - - public enum OrderByType { - - ASC, - DESC - - }; - - private String name; - - private Long locationTagId; - - private Long parentId; - - private String status; - - private Integer pageSize; - - private Integer pageNumber; - - private String orderByFieldName; - - private OrderByType orderByType; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Long getLocationTagId() { - return locationTagId; - } - - public void setLocationTagId(Long locationTagId) { - this.locationTagId = locationTagId; - } - - public Long getParentId() { - return parentId; - } - - public void setParentId(Long parentId) { - this.parentId = parentId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Integer getPageSize() { - return pageSize; - } - - public void setPageSize(Integer pageSize) { - this.pageSize = pageSize; - } - - public Integer getPageNumber() { - return pageNumber; - } - - public void setPageNumber(Integer pageNumber) { - this.pageNumber = pageNumber; - } - - public String getOrderByFieldName() { - return orderByFieldName; - } - - public void setOrderByFieldName(String orderByFieldName) { - this.orderByFieldName = orderByFieldName; - } - - public OrderByType getOrderByType() { - return orderByType; - } - - public void setOrderByType(OrderByType orderByType) { - this.orderByType = orderByType; - } - } diff --git a/src/main/java/org/opensrp/search/OrganizationSearchBean.java b/src/main/java/org/opensrp/search/OrganizationSearchBean.java index 7dea9e876..69cd5838d 100644 --- a/src/main/java/org/opensrp/search/OrganizationSearchBean.java +++ b/src/main/java/org/opensrp/search/OrganizationSearchBean.java @@ -3,82 +3,80 @@ import java.util.List; public class OrganizationSearchBean { - - public enum OrderByType { - ASC, DESC - }; - - public enum FieldName { - id, identifier, name, parent_id, member_count, server_version - }; - - private String name; - - private Integer pageNumber = 0; - - private Integer pageSize = 0; - - private FieldName orderByFieldName; - - private OrderByType orderByType; - - private List locations; - - private Long serverVersion; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getPageNumber() { - return pageNumber; - } - - public void setPageNumber(Integer pageNumber) { - this.pageNumber = pageNumber; - } - - public Integer getPageSize() { - return pageSize; - } - - public void setPageSize(Integer pageSize) { - this.pageSize = pageSize; - } - - public FieldName getOrderByFieldName() { - return orderByFieldName; - } - - public void setOrderByFieldName(FieldName orderByFieldName) { - this.orderByFieldName = orderByFieldName; - } - - public OrderByType getOrderByType() { - return orderByType; - } - - public void setOrderByType(OrderByType orderByType) { - this.orderByType = orderByType; - } - - public List getLocations() { - return locations; - } - - public void setLocations(List locations) { - this.locations = locations; - } - - public Long getServerVersion() { - return serverVersion; - } - - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } + + private String name; + + ; + private Integer pageNumber = 0; + + ; + private Integer pageSize = 0; + private FieldName orderByFieldName; + private OrderByType orderByType; + private List locations; + private Long serverVersion; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getPageNumber() { + return pageNumber; + } + + public void setPageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public FieldName getOrderByFieldName() { + return orderByFieldName; + } + + public void setOrderByFieldName(FieldName orderByFieldName) { + this.orderByFieldName = orderByFieldName; + } + + public OrderByType getOrderByType() { + return orderByType; + } + + public void setOrderByType(OrderByType orderByType) { + this.orderByType = orderByType; + } + + public List getLocations() { + return locations; + } + + public void setLocations(List locations) { + this.locations = locations; + } + + public Long getServerVersion() { + return serverVersion; + } + + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } + + public enum OrderByType { + ASC, DESC + } + + public enum FieldName { + id, identifier, name, parent_id, member_count, server_version + } } diff --git a/src/main/java/org/opensrp/search/PlanSearchBean.java b/src/main/java/org/opensrp/search/PlanSearchBean.java index 636d9c154..ca023827c 100644 --- a/src/main/java/org/opensrp/search/PlanSearchBean.java +++ b/src/main/java/org/opensrp/search/PlanSearchBean.java @@ -14,26 +14,24 @@ @AllArgsConstructor public class PlanSearchBean { - public enum OrderByType { - ASC, DESC - }; + private Integer pageNumber = 0; - public enum FieldName { - id - }; + ; + private Integer pageSize = 0; - private Integer pageNumber = 0; + ; + private OrderByType orderByType = OrderByType.DESC; + private FieldName orderByFieldName = FieldName.id; + private PlanDefinition.PlanStatus planStatus; + private Map useContexts; + private boolean isExperimental; - private Integer pageSize = 0; + public enum OrderByType { + ASC, DESC + } - private OrderByType orderByType = OrderByType.DESC; - - private FieldName orderByFieldName = FieldName.id; - - private PlanDefinition.PlanStatus planStatus; - - private Map useContexts; - - private boolean isExperimental; + public enum FieldName { + id + } } diff --git a/src/main/java/org/opensrp/search/PractitionerRoleSearchBean.java b/src/main/java/org/opensrp/search/PractitionerRoleSearchBean.java index 05d3830a2..706a244be 100644 --- a/src/main/java/org/opensrp/search/PractitionerRoleSearchBean.java +++ b/src/main/java/org/opensrp/search/PractitionerRoleSearchBean.java @@ -7,6 +7,6 @@ @Data @SuperBuilder @AllArgsConstructor -public class PractitionerRoleSearchBean extends BaseSearchBean{ +public class PractitionerRoleSearchBean extends BaseSearchBean { } diff --git a/src/main/java/org/opensrp/search/PractitionerSearchBean.java b/src/main/java/org/opensrp/search/PractitionerSearchBean.java index bc8afa376..b09cfd7ff 100644 --- a/src/main/java/org/opensrp/search/PractitionerSearchBean.java +++ b/src/main/java/org/opensrp/search/PractitionerSearchBean.java @@ -9,5 +9,5 @@ @SuperBuilder public class PractitionerSearchBean extends BaseSearchBean { - private Long serverVersion; + private Long serverVersion; } diff --git a/src/main/java/org/opensrp/search/ProductCatalogueSearchBean.java b/src/main/java/org/opensrp/search/ProductCatalogueSearchBean.java index c612fc58e..3b04e0af9 100644 --- a/src/main/java/org/opensrp/search/ProductCatalogueSearchBean.java +++ b/src/main/java/org/opensrp/search/ProductCatalogueSearchBean.java @@ -7,9 +7,9 @@ @Setter public class ProductCatalogueSearchBean { - private Long uniqueId; + private Long uniqueId; - private String productName; + private String productName; - private Long serverVersion; + private Long serverVersion; } diff --git a/src/main/java/org/opensrp/search/SettingSearchBean.java b/src/main/java/org/opensrp/search/SettingSearchBean.java index 1d8f171ae..298029812 100644 --- a/src/main/java/org/opensrp/search/SettingSearchBean.java +++ b/src/main/java/org/opensrp/search/SettingSearchBean.java @@ -1,4 +1,3 @@ - package org.opensrp.search; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -14,132 +13,132 @@ @NoArgsConstructor @AllArgsConstructor public class SettingSearchBean extends BaseDataObject { - - @JsonProperty - private String identifier; - - @JsonProperty - private String teamId; - - @JsonProperty - private String team; - - @JsonProperty - private String providerId; - - @JsonProperty - private String locationId; - - @JsonProperty - private String childLocationId; - - @JsonIgnore - private boolean v1Settings; - - @JsonIgnore - private boolean resolveSettings; - - private Long primaryKey; - - private String documentId; - - private Long metadataVersion ; - - private Integer limit; - - public String getProviderId() { - return providerId; - } - - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - public String getLocationId() { - return locationId; - } - - public void setLocationId(String locationId) { - this.locationId = locationId; - } - - public String getTeam() { - return team; - } - - public void setTeam(String team) { - this.team = team; - } - - public String getTeamId() { - return teamId; - } - - public void setTeamId(String teamId) { - this.teamId = teamId; - } - - public String getIdentifier() { - return identifier; - } - - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - public String getChildLocationId() { - return childLocationId; - } - - public void setChildLocationId(String childLocationId) { - this.childLocationId = childLocationId; - } - - public String getDocumentId() { - return documentId; - } - - public void setDocumentId(String documentId) { - this.documentId = documentId; - } - - public Long getPrimaryKey() { - return primaryKey; - } - - public void setPrimaryKey(Long primaryKey) { - this.primaryKey = primaryKey; - } - - public boolean isResolveSettings() { - return resolveSettings; - } - - public void setResolveSettings(boolean resolveSettings) { - this.resolveSettings = resolveSettings; - } - - public boolean isV1Settings() { - return v1Settings; - } - - public void setV1Settings(boolean v1Settings) { - this.v1Settings = v1Settings; - } - - public Long getMetadataVersion() { - return metadataVersion; - } - - public void setMetadataVersion(Long metadataVersion) { - this.metadataVersion = metadataVersion; - } - - public Integer getLimit() { - return limit; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } + + @JsonProperty + private String identifier; + + @JsonProperty + private String teamId; + + @JsonProperty + private String team; + + @JsonProperty + private String providerId; + + @JsonProperty + private String locationId; + + @JsonProperty + private String childLocationId; + + @JsonIgnore + private boolean v1Settings; + + @JsonIgnore + private boolean resolveSettings; + + private Long primaryKey; + + private String documentId; + + private Long metadataVersion; + + private Integer limit; + + public String getProviderId() { + return providerId; + } + + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + public String getLocationId() { + return locationId; + } + + public void setLocationId(String locationId) { + this.locationId = locationId; + } + + public String getTeam() { + return team; + } + + public void setTeam(String team) { + this.team = team; + } + + public String getTeamId() { + return teamId; + } + + public void setTeamId(String teamId) { + this.teamId = teamId; + } + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public String getChildLocationId() { + return childLocationId; + } + + public void setChildLocationId(String childLocationId) { + this.childLocationId = childLocationId; + } + + public String getDocumentId() { + return documentId; + } + + public void setDocumentId(String documentId) { + this.documentId = documentId; + } + + public Long getPrimaryKey() { + return primaryKey; + } + + public void setPrimaryKey(Long primaryKey) { + this.primaryKey = primaryKey; + } + + public boolean isResolveSettings() { + return resolveSettings; + } + + public void setResolveSettings(boolean resolveSettings) { + this.resolveSettings = resolveSettings; + } + + public boolean isV1Settings() { + return v1Settings; + } + + public void setV1Settings(boolean v1Settings) { + this.v1Settings = v1Settings; + } + + public Long getMetadataVersion() { + return metadataVersion; + } + + public void setMetadataVersion(Long metadataVersion) { + this.metadataVersion = metadataVersion; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } } diff --git a/src/main/java/org/opensrp/search/StockSearchBean.java b/src/main/java/org/opensrp/search/StockSearchBean.java index 92ac97422..37b2470c7 100644 --- a/src/main/java/org/opensrp/search/StockSearchBean.java +++ b/src/main/java/org/opensrp/search/StockSearchBean.java @@ -4,181 +4,169 @@ public class StockSearchBean { - public enum OrderByType { - ASC, DESC - }; - - public enum FieldName { - id, identifier, serverVersion - }; - - private String identifier; - - private String stockTypeId; - - private String transactionType; - - private String providerId; - - private String value; - - private String dateCreated; - - private String toFrom; - - private String dateUpdated; - - private Long serverVersion; - - private List locations; - - private Integer pageNumber = 0; - - private Integer pageSize = 0; - - private Integer offset; - - private Integer limit; - - private FieldName orderByFieldName; - - private OrderByType orderByType; - - private boolean returnProduct; - - public String getIdentifier() { - return identifier; - } - - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - public String getStockTypeId() { - return stockTypeId; - } - - public void setStockTypeId(String stockTypeId) { - this.stockTypeId = stockTypeId; - } - - public String getTransactionType() { - return transactionType; - } - - public void setTransactionType(String transactionType) { - this.transactionType = transactionType; - } - - public String getProviderId() { - return providerId; - } - - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getDateCreated() { - return dateCreated; - } - - public void setDateCreated(String dateCreated) { - this.dateCreated = dateCreated; - } - - public String getToFrom() { - return toFrom; - } - - public void setToFrom(String toFrom) { - this.toFrom = toFrom; - } - - public String getDateUpdated() { - return dateUpdated; - } - - public void setDateUpdated(String dateUpdated) { - this.dateUpdated = dateUpdated; - } - - public Long getServerVersion() { - return serverVersion; - } - - public void setServerVersion(Long serverVersion) { - this.serverVersion = serverVersion; - } - - public List getLocations() { - return locations; - } - - public void setLocations(List locations) { - this.locations = locations; - } - - public Integer getPageNumber() { - return pageNumber; - } - - public void setPageNumber(Integer pageNumber) { - this.pageNumber = pageNumber; - } - - public Integer getPageSize() { - return pageSize; - } - - public void setPageSize(Integer pageSize) { - this.pageSize = pageSize; - } - - public FieldName getOrderByFieldName() { - return orderByFieldName; - } - - public void setOrderByFieldName(FieldName orderByFieldName) { - this.orderByFieldName = orderByFieldName; - } - - public OrderByType getOrderByType() { - return orderByType; - } - - public void setOrderByType(OrderByType orderByType) { - this.orderByType = orderByType; - } - - public Integer getOffset() { - return offset; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public Integer getLimit() { - return limit; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public boolean isReturnProduct() { - return returnProduct; - } - - public void setReturnProduct(boolean returnProduct) { - this.returnProduct = returnProduct; - } + private String identifier; + + ; + private String stockTypeId; + + ; + private String transactionType; + private String providerId; + private String value; + private String dateCreated; + private String toFrom; + private String dateUpdated; + private Long serverVersion; + private List locations; + private Integer pageNumber = 0; + private Integer pageSize = 0; + private Integer offset; + private Integer limit; + private FieldName orderByFieldName; + private OrderByType orderByType; + private boolean returnProduct; + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public String getStockTypeId() { + return stockTypeId; + } + + public void setStockTypeId(String stockTypeId) { + this.stockTypeId = stockTypeId; + } + + public String getTransactionType() { + return transactionType; + } + + public void setTransactionType(String transactionType) { + this.transactionType = transactionType; + } + + public String getProviderId() { + return providerId; + } + + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getDateCreated() { + return dateCreated; + } + + public void setDateCreated(String dateCreated) { + this.dateCreated = dateCreated; + } + + public String getToFrom() { + return toFrom; + } + + public void setToFrom(String toFrom) { + this.toFrom = toFrom; + } + + public String getDateUpdated() { + return dateUpdated; + } + + public void setDateUpdated(String dateUpdated) { + this.dateUpdated = dateUpdated; + } + + public Long getServerVersion() { + return serverVersion; + } + + public void setServerVersion(Long serverVersion) { + this.serverVersion = serverVersion; + } + + public List getLocations() { + return locations; + } + + public void setLocations(List locations) { + this.locations = locations; + } + + public Integer getPageNumber() { + return pageNumber; + } + + public void setPageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public FieldName getOrderByFieldName() { + return orderByFieldName; + } + + public void setOrderByFieldName(FieldName orderByFieldName) { + this.orderByFieldName = orderByFieldName; + } + + public OrderByType getOrderByType() { + return orderByType; + } + + public void setOrderByType(OrderByType orderByType) { + this.orderByType = orderByType; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public boolean isReturnProduct() { + return returnProduct; + } + + public void setReturnProduct(boolean returnProduct) { + this.returnProduct = returnProduct; + } + + public enum OrderByType { + ASC, DESC + } + + public enum FieldName { + id, identifier, serverVersion + } } diff --git a/src/main/java/org/opensrp/search/TaskSearchBean.java b/src/main/java/org/opensrp/search/TaskSearchBean.java index 7d8c2199f..b032f95c8 100644 --- a/src/main/java/org/opensrp/search/TaskSearchBean.java +++ b/src/main/java/org/opensrp/search/TaskSearchBean.java @@ -12,13 +12,13 @@ @NoArgsConstructor @AllArgsConstructor @SuperBuilder -public class TaskSearchBean extends BaseSearchBean{ +public class TaskSearchBean extends BaseSearchBean { - @NotBlank - private String planIdentifier; - private List groupIdentifiers; - private String code; - private String status; - private String businessStatus; - private boolean returnTaskCountOnly; + @NotBlank + private String planIdentifier; + private List groupIdentifiers; + private String code; + private String status; + private String businessStatus; + private boolean returnTaskCountOnly; } diff --git a/src/main/java/org/opensrp/search/UploadValidationBean.java b/src/main/java/org/opensrp/search/UploadValidationBean.java index 5c5bbd53f..d695560bd 100644 --- a/src/main/java/org/opensrp/search/UploadValidationBean.java +++ b/src/main/java/org/opensrp/search/UploadValidationBean.java @@ -56,7 +56,7 @@ public void setErrors(List errors) { } public void addError(String error) { - if(this.errors == null) + if (this.errors == null) this.errors = new ArrayList<>(); this.errors.add(error); diff --git a/src/main/java/org/opensrp/service/BaseEntityService.java b/src/main/java/org/opensrp/service/BaseEntityService.java index a7cf6746d..ecae4c56f 100644 --- a/src/main/java/org/opensrp/service/BaseEntityService.java +++ b/src/main/java/org/opensrp/service/BaseEntityService.java @@ -9,27 +9,27 @@ @Service public class BaseEntityService { - - private final ClientsRepository allBaseEntities; - - @Autowired - public BaseEntityService(ClientsRepository allBaseEntities) { - this.allBaseEntities = allBaseEntities; - } - - public List getAllBaseEntities() { - return allBaseEntities.findAllClients(); - } - - public BaseEntity findByBaseEntityId(String baseEntityId) { - return allBaseEntities.findByBaseEntityId(baseEntityId); - } - - public List findByIdentifier(String identifier) { - return allBaseEntities.findAllByIdentifier(identifier); - } - - public List findByIdentifier(String identifierType, String identifier) { - return allBaseEntities.findAllByIdentifier(identifierType, identifier); - } + + private final ClientsRepository allBaseEntities; + + @Autowired + public BaseEntityService(ClientsRepository allBaseEntities) { + this.allBaseEntities = allBaseEntities; + } + + public List getAllBaseEntities() { + return allBaseEntities.findAllClients(); + } + + public BaseEntity findByBaseEntityId(String baseEntityId) { + return allBaseEntities.findByBaseEntityId(baseEntityId); + } + + public List findByIdentifier(String identifier) { + return allBaseEntities.findAllByIdentifier(identifier); + } + + public List findByIdentifier(String identifierType, String identifier) { + return allBaseEntities.findAllByIdentifier(identifierType, identifier); + } } diff --git a/src/main/java/org/opensrp/service/CampaignService.java b/src/main/java/org/opensrp/service/CampaignService.java index df6f9f31a..2f6e56bc8 100644 --- a/src/main/java/org/opensrp/service/CampaignService.java +++ b/src/main/java/org/opensrp/service/CampaignService.java @@ -12,62 +12,62 @@ @Service public class CampaignService { - private CampaignRepository campaignRepository; + private CampaignRepository campaignRepository; - @Autowired - public void setCampaignRepository(CampaignRepository campaignRepository) { - this.campaignRepository = campaignRepository; - } + @Autowired + public void setCampaignRepository(CampaignRepository campaignRepository) { + this.campaignRepository = campaignRepository; + } - @PreAuthorize("hasRole('CAMPAIGN_VIEW')") - public List getAllCampaigns() { - return campaignRepository.getAll(); - } + @PreAuthorize("hasRole('CAMPAIGN_VIEW')") + public List getAllCampaigns() { + return campaignRepository.getAll(); + } - - public void addOrUpdateCampaign(Campaign campaign) { - if (StringUtils.isBlank(campaign.getIdentifier())) - throw new IllegalArgumentException("Identifier not specified"); - if (getCampaign(campaign.getIdentifier()) != null) { - updateCampaign(campaign); - } else { - addCampaign(campaign); - } - } - - @PreAuthorize("hasRole('CAMPAIGN_CREATE')") - public Campaign addCampaign(Campaign campaign) { - if (StringUtils.isBlank(campaign.getIdentifier())) - throw new IllegalArgumentException("Identifier not specified"); - campaignRepository.add(campaign); - return campaign; - } - @PreAuthorize("hasRole('CAMPAIGN_UPDATE')") - public Campaign updateCampaign(Campaign campaign) { - if (StringUtils.isBlank(campaign.getIdentifier())) - throw new IllegalArgumentException("Identifier not specified"); - campaignRepository.update(campaign); - return campaign; - } + public void addOrUpdateCampaign(Campaign campaign) { + if (StringUtils.isBlank(campaign.getIdentifier())) + throw new IllegalArgumentException("Identifier not specified"); + if (getCampaign(campaign.getIdentifier()) != null) { + updateCampaign(campaign); + } else { + addCampaign(campaign); + } + } - @PreAuthorize("hasRole('CAMPAIGN_VIEW')") - public Campaign getCampaign(String identifier) { - if (StringUtils.isBlank(identifier)) - return null; - return campaignRepository.get(identifier); - } - - @PreAuthorize("hasRole('CAMPAIGN_VIEW')") - public List getCampaignsByIdentifiers(String identifiers) { - if (StringUtils.isBlank(identifiers)) - return null; - return campaignRepository.getCampaignsByIdentifiers(identifiers); - } + @PreAuthorize("hasRole('CAMPAIGN_CREATE')") + public Campaign addCampaign(Campaign campaign) { + if (StringUtils.isBlank(campaign.getIdentifier())) + throw new IllegalArgumentException("Identifier not specified"); + campaignRepository.add(campaign); + return campaign; + } - @PreAuthorize("hasRole('CAMPAIGN_VIEW')") - public List getCampaignsByServerVersion(long serverVersion) { - return campaignRepository.getCampaignsByServerVersion(serverVersion); - } + @PreAuthorize("hasRole('CAMPAIGN_UPDATE')") + public Campaign updateCampaign(Campaign campaign) { + if (StringUtils.isBlank(campaign.getIdentifier())) + throw new IllegalArgumentException("Identifier not specified"); + campaignRepository.update(campaign); + return campaign; + } + + @PreAuthorize("hasRole('CAMPAIGN_VIEW')") + public Campaign getCampaign(String identifier) { + if (StringUtils.isBlank(identifier)) + return null; + return campaignRepository.get(identifier); + } + + @PreAuthorize("hasRole('CAMPAIGN_VIEW')") + public List getCampaignsByIdentifiers(String identifiers) { + if (StringUtils.isBlank(identifiers)) + return null; + return campaignRepository.getCampaignsByIdentifiers(identifiers); + } + + @PreAuthorize("hasRole('CAMPAIGN_VIEW')") + public List getCampaignsByServerVersion(long serverVersion) { + return campaignRepository.getCampaignsByServerVersion(serverVersion); + } } diff --git a/src/main/java/org/opensrp/service/ClientFormService.java b/src/main/java/org/opensrp/service/ClientFormService.java index 0a3db881e..66c3b0f66 100644 --- a/src/main/java/org/opensrp/service/ClientFormService.java +++ b/src/main/java/org/opensrp/service/ClientFormService.java @@ -17,100 +17,99 @@ @Service public class ClientFormService { - private ClientFormRepository clientFormRepository; - - private static Logger logger = LogManager.getLogger(ClientFormService.class.toString()); - - @Autowired - public void setClientFormRepository(ClientFormRepository clientFormRepository) { - this.clientFormRepository = clientFormRepository; - } - - public boolean isClientFormExists(String formIdentifier) { - return isClientFormExists(formIdentifier, false); - } - - public boolean isClientFormExists(String formIdentifier, boolean isJsonValidator) { - return clientFormRepository.countClientFormByFormIdentifier(formIdentifier, isJsonValidator) > 0; - } - - @Nullable - public ClientFormMetadata getClientFormMetadataByIdentifierAndVersion(String formIdentifier, String formVersion) { - return getClientFormMetadataByIdentifierAndVersion(formIdentifier, formVersion, false); - } - - @Nullable - public ClientFormMetadata getClientFormMetadataByIdentifierAndVersion(String formIdentifier, String formVersion, boolean isJsonValidator) { - return clientFormRepository.getClientFormMetadata(formVersion, formIdentifier, isJsonValidator); - } - - public ClientForm getClientFormById(Long id) { - return clientFormRepository.get(id); - } - - public List getAvailableClientFormMetadataVersionByIdentifier(String formIdentifier) { - return getAvailableClientFormMetadataVersionByIdentifier(formIdentifier, false); - } - - public List getAvailableClientFormMetadataVersionByIdentifier(String formIdentifier, boolean isJsonValidator) { - return clientFormRepository.getAvailableClientFormVersions(formIdentifier, isJsonValidator); - } - - public ClientFormMetadata getClientFormMetadataById(long formId) { - return clientFormRepository.getFormMetadata(formId); - } - - @Nullable - public CompleteClientForm addClientForm(@NonNull ClientForm clientForm, @NonNull ClientFormMetadata clientFormMetadata) { - // Check if the same client form with that version & identifier exists - ClientFormMetadata clientFormMetadataResult = clientFormRepository - .getClientFormMetadata(clientFormMetadata.getVersion(), clientFormMetadata.getIdentifier(), clientFormMetadata.getIsJsonValidator() == null ? false : clientFormMetadata.getIsJsonValidator()); - if (clientFormMetadataResult != null) { - logger.error("ClientFormMetadata with version " + clientFormMetadata.getVersion() + " and Identifier " - + clientFormMetadata.getIdentifier() + " Already exists", new Exception()); - return null; - } - - return clientFormRepository.create(clientForm, clientFormMetadata); - } - - @NonNull - public List getDraftsClientFormMetadata(boolean isDraft) { - List clientFormMetadataList = clientFormRepository.getAllDraftsClientFormMetadata(isDraft); - return clientFormMetadataList == null ? new ArrayList<>() : clientFormMetadataList; - } - - @NonNull - public List getJsonWidgetValidatorClientFormMetadata(boolean isJsonValidator) { - List clientFormMetadataList = clientFormRepository.getAllJsonWidgetValidatorClientFormMetadata(isJsonValidator); - return clientFormMetadataList == null ? new ArrayList<>() : clientFormMetadataList; - } - - @NonNull - public List getAllClientFormMetadata() { - List clientFormMetadataList = clientFormRepository.getAllClientFormMetadata(); - return clientFormMetadataList == null ? new ArrayList<>() : clientFormMetadataList; - } - - @Nullable - public ClientForm getMostRecentFormValidator(@NonNull String formIdentifier) { - return clientFormRepository.getMostRecentFormValidator(formIdentifier); - } - - public void updateClientFormMetadataIsDraftValueByVersion(boolean isDraft, @NonNull String formVersion) { - clientFormRepository.updateClientMetadataIsDraftByVersion(isDraft, formVersion); - } - - public static class CompleteClientForm { - - public ClientForm clientForm; - - public ClientFormMetadata clientFormMetadata; - - public CompleteClientForm(@NonNull ClientForm clientForm, @NonNull ClientFormMetadata clientFormMetadata) { - this.clientForm = clientForm; - this.clientFormMetadata = clientFormMetadata; - } - } + private static Logger logger = LogManager.getLogger(ClientFormService.class.toString()); + private ClientFormRepository clientFormRepository; + + @Autowired + public void setClientFormRepository(ClientFormRepository clientFormRepository) { + this.clientFormRepository = clientFormRepository; + } + + public boolean isClientFormExists(String formIdentifier) { + return isClientFormExists(formIdentifier, false); + } + + public boolean isClientFormExists(String formIdentifier, boolean isJsonValidator) { + return clientFormRepository.countClientFormByFormIdentifier(formIdentifier, isJsonValidator) > 0; + } + + @Nullable + public ClientFormMetadata getClientFormMetadataByIdentifierAndVersion(String formIdentifier, String formVersion) { + return getClientFormMetadataByIdentifierAndVersion(formIdentifier, formVersion, false); + } + + @Nullable + public ClientFormMetadata getClientFormMetadataByIdentifierAndVersion(String formIdentifier, String formVersion, boolean isJsonValidator) { + return clientFormRepository.getClientFormMetadata(formVersion, formIdentifier, isJsonValidator); + } + + public ClientForm getClientFormById(Long id) { + return clientFormRepository.get(id); + } + + public List getAvailableClientFormMetadataVersionByIdentifier(String formIdentifier) { + return getAvailableClientFormMetadataVersionByIdentifier(formIdentifier, false); + } + + public List getAvailableClientFormMetadataVersionByIdentifier(String formIdentifier, boolean isJsonValidator) { + return clientFormRepository.getAvailableClientFormVersions(formIdentifier, isJsonValidator); + } + + public ClientFormMetadata getClientFormMetadataById(long formId) { + return clientFormRepository.getFormMetadata(formId); + } + + @Nullable + public CompleteClientForm addClientForm(@NonNull ClientForm clientForm, @NonNull ClientFormMetadata clientFormMetadata) { + // Check if the same client form with that version & identifier exists + ClientFormMetadata clientFormMetadataResult = clientFormRepository + .getClientFormMetadata(clientFormMetadata.getVersion(), clientFormMetadata.getIdentifier(), clientFormMetadata.getIsJsonValidator() == null ? false : clientFormMetadata.getIsJsonValidator()); + if (clientFormMetadataResult != null) { + logger.error("ClientFormMetadata with version " + clientFormMetadata.getVersion() + " and Identifier " + + clientFormMetadata.getIdentifier() + " Already exists", new Exception()); + return null; + } + + return clientFormRepository.create(clientForm, clientFormMetadata); + } + + @NonNull + public List getDraftsClientFormMetadata(boolean isDraft) { + List clientFormMetadataList = clientFormRepository.getAllDraftsClientFormMetadata(isDraft); + return clientFormMetadataList == null ? new ArrayList<>() : clientFormMetadataList; + } + + @NonNull + public List getJsonWidgetValidatorClientFormMetadata(boolean isJsonValidator) { + List clientFormMetadataList = clientFormRepository.getAllJsonWidgetValidatorClientFormMetadata(isJsonValidator); + return clientFormMetadataList == null ? new ArrayList<>() : clientFormMetadataList; + } + + @NonNull + public List getAllClientFormMetadata() { + List clientFormMetadataList = clientFormRepository.getAllClientFormMetadata(); + return clientFormMetadataList == null ? new ArrayList<>() : clientFormMetadataList; + } + + @Nullable + public ClientForm getMostRecentFormValidator(@NonNull String formIdentifier) { + return clientFormRepository.getMostRecentFormValidator(formIdentifier); + } + + public void updateClientFormMetadataIsDraftValueByVersion(boolean isDraft, @NonNull String formVersion) { + clientFormRepository.updateClientMetadataIsDraftByVersion(isDraft, formVersion); + } + + public static class CompleteClientForm { + + public ClientForm clientForm; + + public ClientFormMetadata clientFormMetadata; + + public CompleteClientForm(@NonNull ClientForm clientForm, @NonNull ClientFormMetadata clientFormMetadata) { + this.clientForm = clientForm; + this.clientFormMetadata = clientFormMetadata; + } + } } diff --git a/src/main/java/org/opensrp/service/ClientMigrationFileService.java b/src/main/java/org/opensrp/service/ClientMigrationFileService.java index a5bb5b013..eafdaf265 100644 --- a/src/main/java/org/opensrp/service/ClientMigrationFileService.java +++ b/src/main/java/org/opensrp/service/ClientMigrationFileService.java @@ -19,20 +19,22 @@ public class ClientMigrationFileService { private ClientMigrationFileRepository clientMigrationFileRepository; + public ClientMigrationFileRepository getClientMigrationFileRepository() { + return clientMigrationFileRepository; + } + @Autowired public void setClientMigrationFileRepository(ClientMigrationFileRepository clientMigrationFileRepository) { this.clientMigrationFileRepository = clientMigrationFileRepository; } - public ClientMigrationFileRepository getClientMigrationFileRepository() { - return clientMigrationFileRepository; - } - public List getAllClientMigrationFiles() { return clientMigrationFileRepository.getAll(); } - public List getAllClientMigrationFiles(int limit) { return clientMigrationFileRepository.getAll(limit);} + public List getAllClientMigrationFiles(int limit) { + return clientMigrationFileRepository.getAll(limit); + } public void addOrUpdateClientMigrationFile(ClientMigrationFile clientMigrationFile) { if (StringUtils.isBlank(clientMigrationFile.getIdentifier())) @@ -54,7 +56,7 @@ public ClientMigrationFile addClientMigrationFile(ClientMigrationFile clientMigr clientMigrationFile.setCreatedAt(new Date()); clientMigrationFileRepository.add(clientMigrationFile); return clientMigrationFile; - + } public ClientMigrationFile updateClientMigrationFile(ClientMigrationFile clientMigrationFile) { diff --git a/src/main/java/org/opensrp/service/ClientService.java b/src/main/java/org/opensrp/service/ClientService.java index dcbc53d13..0ef970ce5 100644 --- a/src/main/java/org/opensrp/service/ClientService.java +++ b/src/main/java/org/opensrp/service/ClientService.java @@ -22,447 +22,446 @@ @Service public class ClientService { - - private final ClientsRepository allClients; - - @Autowired - public ClientService(ClientsRepository allClients) { - this.allClients = allClients; - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostAuthorize("hasPermission(returnObject,'Client', 'CLIENT_VIEW')") - public Client getByBaseEntityId(String baseEntityId) { - return allClients.findByBaseEntityId(baseEntityId); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findAllClients() { - return allClients.findAllClients(); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findAllByIdentifier(String identifier) { - return allClients.findAllByIdentifier(identifier); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findAllByIdentifier(String identifierType, String identifier) { - return allClients.findAllByIdentifier(identifierType, identifier); - } - - public List findAllByIdentifierOutOfCatchment(String identifierType, String identifier) { - return allClients.findAllByIdentifier(identifierType, identifier); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findByRelationshipIdAndDateCreated(String relationalId, String dateFrom, String dateTo) { - return allClients.findByRelationshipIdAndDateCreated(relationalId, dateFrom, dateTo); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findByRelationship(String relationalId) { - return allClients.findByRelationShip(relationalId); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findByRelationshipIdAndType(String relationshipType, String entityId) { - return allClients.findByRelationshipId(relationshipType, entityId); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findAllByAttribute(String attributeType, String attribute) { - return allClients.findAllByAttribute(attributeType, attribute); - } - - public List findAllByAttributeOutOfCatchment(String attributeType, String attribute) { - return allClients.findAllByAttribute(attributeType, attribute); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findAllByAttributes(String attributeType, List attributes) { - return allClients.findAllByAttributes(attributeType, attributes); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findAllByMatchingName(String nameMatches) { - return allClients.findAllByMatchingName(nameMatches); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findByCriteria(ClientSearchBean clientSearchBean, AddressSearchBean addressSearchBean, - DateTime lastEditFrom, DateTime lastEditTo) { - clientSearchBean.setLastEditFrom(lastEditFrom); - clientSearchBean.setLastEditTo(lastEditTo); - - return allClients.findByCriteria(clientSearchBean, addressSearchBean);//db.queryView(q.includeDocs(true), Client.class); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findByCriteria(ClientSearchBean clientSearchBean, Long serverVersion) { - return allClients.findByCriteria(clientSearchBean, new AddressSearchBean()); - } + + private final ClientsRepository allClients; + + @Autowired + public ClientService(ClientsRepository allClients) { + this.allClients = allClients; + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostAuthorize("hasPermission(returnObject,'Client', 'CLIENT_VIEW')") + public Client getByBaseEntityId(String baseEntityId) { + return allClients.findByBaseEntityId(baseEntityId); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findAllClients() { + return allClients.findAllClients(); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findAllByIdentifier(String identifier) { + return allClients.findAllByIdentifier(identifier); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findAllByIdentifier(String identifierType, String identifier) { + return allClients.findAllByIdentifier(identifierType, identifier); + } + + public List findAllByIdentifierOutOfCatchment(String identifierType, String identifier) { + return allClients.findAllByIdentifier(identifierType, identifier); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findByRelationshipIdAndDateCreated(String relationalId, String dateFrom, String dateTo) { + return allClients.findByRelationshipIdAndDateCreated(relationalId, dateFrom, dateTo); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findByRelationship(String relationalId) { + return allClients.findByRelationShip(relationalId); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findByRelationshipIdAndType(String relationshipType, String entityId) { + return allClients.findByRelationshipId(relationshipType, entityId); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findAllByAttribute(String attributeType, String attribute) { + return allClients.findAllByAttribute(attributeType, attribute); + } + + public List findAllByAttributeOutOfCatchment(String attributeType, String attribute) { + return allClients.findAllByAttribute(attributeType, attribute); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findAllByAttributes(String attributeType, List attributes) { + return allClients.findAllByAttributes(attributeType, attributes); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findAllByMatchingName(String nameMatches) { + return allClients.findAllByMatchingName(nameMatches); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findByCriteria(ClientSearchBean clientSearchBean, AddressSearchBean addressSearchBean, + DateTime lastEditFrom, DateTime lastEditTo) { + clientSearchBean.setLastEditFrom(lastEditFrom); + clientSearchBean.setLastEditTo(lastEditTo); + + return allClients.findByCriteria(clientSearchBean, addressSearchBean);//db.queryView(q.includeDocs(true), Client.class); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findByCriteria(ClientSearchBean clientSearchBean, Long serverVersion) { + return allClients.findByCriteria(clientSearchBean, new AddressSearchBean()); + } /* public List findByCriteria(String addressType, String country, String stateProvince, String cityVillage, String countyDistrict, String subDistrict, String town, String subTown, DateTime lastEditFrom, DateTime lastEditTo) { return allClients.findByCriteria(null, null, null, null, null, null, null, null, addressType, country, stateProvince, cityVillage, countyDistrict, subDistrict, town, subTown, lastEditFrom, lastEditTo); }*/ - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findByDynamicQuery(String query) { - return allClients.findByDynamicQuery(query); - } - - @PreAuthorize("hasPermission(#client,'CLIENT', 'CLIENT_CREATE')") - public Client addClient(Client client) { - if (client.getBaseEntityId() == null) { - throw new RuntimeException("No baseEntityId"); - } - Client c = findClient(client); - if (c != null) { - try { - client.setId(c.getId()); - client.setRevision(c.getRevision()); - updateClient(client); - } - catch (JSONException e) { - throw new IllegalArgumentException( - "A client already exists with given list of identifiers. Consider updating data.[" + c + "]"); - } - } - - client.setDateCreated(DateTime.now()); - allClients.add(client); - return client; - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostAuthorize("hasPermission(returnObject,'Client', 'CLIENT_VIEW')") - public Client findClient(Client client) { - // find by auto assigned entity id - Client c = allClients.findByBaseEntityId(client.getBaseEntityId()); - if (c != null) { - return c; - } - - //still not found!! search by generic identifiers - - for (String idt : client.getIdentifiers().keySet()) { - List cl = allClients.findAllByIdentifier(client.getIdentifier(idt)); - if (cl.size() > 1) { - throw new IllegalArgumentException( - "Multiple clients with identifier type " + idt + " and ID " + client.getIdentifier(idt) + " exist."); - } else if (cl.size() != 0) { - return cl.get(0); - } - } - return c; - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostAuthorize("hasPermission(filterObject, 'Client' , 'CLIENT_VIEW')") - public Client find(String uniqueId) { - // find by document id - Client c = allClients.findByBaseEntityId(uniqueId); - if (c != null) { - return c; - } - - // if not found find if it is in any identifiers TODO refactor it later - List cl = allClients.findAllByIdentifier(uniqueId); - if (cl.size() > 1) { - throw new IllegalArgumentException("Multiple clients with identifier " + uniqueId + " exist."); - } else if (cl.size() != 0) { - return cl.get(0); - } - - return c; - } - - @PreAuthorize("hasPermission(#updatedClient,'Client', 'CLIENT_UPDATE')") - public void updateClient(Client updatedClient) throws JSONException { - // If update is on original entity - if (updatedClient.isNew()) { - throw new IllegalArgumentException( - "Client to be updated is not an existing and persisting domain object. Update database object instead of new pojo"); - } - - if (findClient(updatedClient) == null) { - throw new IllegalArgumentException("No client found with given list of identifiers. Consider adding new!"); - } - - updatedClient.setDateEdited(DateTime.now()); - allClients.update(updatedClient); - } - - @PreAuthorize("hasPermission(#updatedClient,'Client', 'CLIENT_UPDATE')") - public Client mergeClient(Client updatedClient) { - try { - Client original = findClient(updatedClient); - if (original == null) { - throw new IllegalArgumentException("No client found with given list of identifiers. Consider adding new!"); - } - - original = (Client) Utils.getMergedJSON(original, updatedClient, Arrays.asList(Client.class.getDeclaredFields()), - Client.class); - - for (Address a : updatedClient.getAddresses()) { - if (original.getAddress(a.getAddressType()) == null) { - original.addAddress(a); - } else { - original.removeAddress(a.getAddressType()); - original.addAddress(a); - } - } - for (String k : updatedClient.getIdentifiers().keySet()) { - original.addIdentifier(k, updatedClient.getIdentifier(k)); - } - for (String k : updatedClient.getAttributes().keySet()) { - original.addAttribute(k, updatedClient.getAttribute(k)); - } - - original.setDateEdited(DateTime.now()); - allClients.update(original); - return original; - } - catch (JSONException | JsonProcessingException | SecurityException e) { - throw new RuntimeException(e); - } - - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasRole('CLIENT_VIEW_GLOBAL') or hasPermission(filterObject, 'CLIENT_VIEW')") - public List findByServerVersion(long serverVersion, Integer limit) { - return allClients.findByServerVersion(serverVersion, limit); - } - - public Long countAll(long serverVersion) { - return allClients.countAll(serverVersion); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List notInOpenMRSByServerVersion(long serverVersion, Calendar calendar) { - return allClients.notInOpenMRSByServerVersion(serverVersion, calendar); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findByFieldValue(String field, List ids) { - return allClients.findByFieldValue(field, ids); - } - - @PreAuthorize("hasRole('CLIENT_VIEW') or hasRole('CLIENT_OUT_OF_CATCHMENT_VIEW')") - public List findByFieldValueOutOfCatchment(String field, List ids) { - return allClients.findByFieldValue(field, ids); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findByFieldValue(String id) { - return allClients.findByRelationShip(id); - } - - @PreAuthorize("((hasRole('CLIENT_CREATE') or (hasRole('CLIENT_UPDATE'))) and" - + " (hasPermission(#client,'Client','CLIENT_CREATE') or hasPermission(#client,'Client','CLIENT_UPDATE')))" - + " or ((hasRole('CLIENT_CREATE') or (hasRole('CLIENT_UPDATE')) or" - + " hasRole('CLIENT_OUT_OF_CATCHMENT_CREATE') or hasRole('CLIENT_OUT_OF_CATCHMENT_UPDATE')))") - public Client addorUpdate(Client client) { - if (client.getBaseEntityId() == null) { - throw new RuntimeException("No baseEntityId"); - } - Client c = findClient(client); - if (c != null) { - client.setRevision(c.getRevision()); - client.setId(c.getId()); - client.setDateEdited(DateTime.now()); - client.addIdentifier("OPENMRS_UUID", c.getIdentifier("OPENMRS_UUID")); - allClients.update(client); - } else { - client.setDateCreated(DateTime.now()); - allClients.add(client); - } - return client; - } - - @PreAuthorize("hasPermission(#client,'Client','CLIENT_CREATE') and hasPermission(#client,'Client','CLIENT_UPDATE')") - public Client addorUpdate(Client client, boolean resetServerVersion) { - if (client.getBaseEntityId() == null) { - throw new RuntimeException("No baseEntityId"); - } - Client c = findClient(client); - if (c != null) { - client.setRevision(c.getRevision()); - client.setId(c.getId()); - client.setDateEdited(DateTime.now()); - allClients.update(client); - - } else { - client.setDateCreated(DateTime.now()); - allClients.add(client); - } - return client; - } - - public Map getMemberCountHouseholdHeadProviderByClients(List ids, String clientType) { - List householdClients = allClients.selectMemberCountHouseholdHeadProviderByClients("", ids, - clientType); - Map households = new HashMap(); - if (householdClients != null) { - for (HouseholdClient householdClient : householdClients) { - households.put(householdClient.getRelationalId(), householdClient); - } - } - return households; - } - - public HouseholdClient findTotalCountHouseholdByCriteria(ClientSearchBean clientSearchBean, - AddressSearchBean addressSearchBean) { - return allClients.findTotalCountHouseholdByCriteria(clientSearchBean, addressSearchBean); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List getHouseholdList(List ids, String clientType, AddressSearchBean addressSearchBean, - ClientSearchBean searchBean, List clients) { - Map householdClients = getMemberCountHouseholdHeadProviderByClients(ids, clientType); - - List clientList = new ArrayList(); - - for (Client client : clients) { - if (householdClients != null) { - HouseholdClient householdClient = householdClients.get(client.getBaseEntityId()); - if (householdClient != null) { - client.addAttribute("memberCount", householdClient.getMemebrCount()); - client.addAttribute("HouseholdHead", householdClient.getHouseholdHead()); - client.addAttribute("ProvierId", householdClient.getProviderId()); - } else { - client.addAttribute("memberCount", 0); - client.addAttribute("HouseholdHead", ""); - client.addAttribute("ProvierId", ""); - } - clientList.add(client); - } - } - return clientList; - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findMembersByRelationshipId(String relationshipId) { - return allClients.findMembersByRelationshipId(relationshipId); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findAllClientsByCriteria(ClientSearchBean clientSearchBean, AddressSearchBean addressSearchBean) { - return allClients.findAllClientsByCriteria(clientSearchBean, addressSearchBean); - } - - public HouseholdClient findTotalCountAllClientsByCriteria(ClientSearchBean clientSearchBean, - AddressSearchBean addressSearchBean) { - return allClients.findCountAllClientsByCriteria(clientSearchBean, addressSearchBean); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findHouseholdByCriteria(ClientSearchBean clientSearchBean, AddressSearchBean addressSearchBean, - DateTime lastEditFrom, DateTime lastEditTo) { - clientSearchBean.setLastEditFrom(lastEditFrom); - clientSearchBean.setLastEditTo(lastEditTo); - return allClients.findHouseholdByCriteria(clientSearchBean, addressSearchBean); - - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findAllANCByCriteria(ClientSearchBean clientSearchBean, AddressSearchBean addressSearchBean) { - return allClients.findANCByCriteria(clientSearchBean, addressSearchBean); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - public int findCountANCByCriteria(ClientSearchBean clientSearchBean, AddressSearchBean addressSearchBean) { - return allClients.findCountANCByCriteria(clientSearchBean, addressSearchBean); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findAllChildByCriteria(ClientSearchBean clientSearchBean, AddressSearchBean addressSearchBean) { - return allClients.findChildByCriteria(clientSearchBean, addressSearchBean); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - public int findCountChildByCriteria(ClientSearchBean clientSearchBean, AddressSearchBean addressSearchBean) { - return allClients.findCountChildByCriteria(clientSearchBean, addressSearchBean); - } - - /** - * This method searches for client ids paginated by server version - * - * @param serverVersion server version for last client that was fetched - * @param limit upper limit on number of client ids to fetch - * @param isArchived whether to return archived events - * @return a list of client ids - */ - public Pair, Long> findAllIds(long serverVersion, int limit, boolean isArchived) { - return allClients.findAllIds(serverVersion, limit, isArchived); - } - - /** - * overloads {@link #findAllIds(long, int, boolean)} by adding date/time filters - * @param serverVersion - * @param limit - * @param fromDate - * @param toDate - * @return - */ - public Pair, Long> findAllIds(long serverVersion, int limit, boolean isArchived, Date fromDate, - Date toDate) { - return allClients.findAllIds(serverVersion, limit, isArchived, fromDate, toDate); - } - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List findByClientTypeAndLocationId(String clientType, String locationId) { - return allClients.findByClientTypeAndLocationId(clientType, locationId); - } - - /** - * This method searches for client using an id - * - * @param id server version for last client that was fetched - * @return a client object - */ - public Client findById(String id) { - return allClients.findById(id); - } - - /** - * This method is similar to {@link #findByFieldValue(String, List)}. This method however does not enforce ACL - * so that users can search clients globally and not just those within their jurisdiction. - */ - public List findGlobalByFieldValue(String field, List ids) { - return allClients.findByFieldValue(field, ids); - } - - /** - * This method is similar to {@link #findByRelationship(String)}. This method however does not enforce ACL - * so that users can search clients globally and not just those within their jurisdiction. - */ - public List findGlobalByRelationship(String relationalId) { - return allClients.findByRelationShip(relationalId); - } + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findByDynamicQuery(String query) { + return allClients.findByDynamicQuery(query); + } + + @PreAuthorize("hasPermission(#client,'CLIENT', 'CLIENT_CREATE')") + public Client addClient(Client client) { + if (client.getBaseEntityId() == null) { + throw new RuntimeException("No baseEntityId"); + } + Client c = findClient(client); + if (c != null) { + try { + client.setId(c.getId()); + client.setRevision(c.getRevision()); + updateClient(client); + } catch (JSONException e) { + throw new IllegalArgumentException( + "A client already exists with given list of identifiers. Consider updating data.[" + c + "]"); + } + } + + client.setDateCreated(DateTime.now()); + allClients.add(client); + return client; + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostAuthorize("hasPermission(returnObject,'Client', 'CLIENT_VIEW')") + public Client findClient(Client client) { + // find by auto assigned entity id + Client c = allClients.findByBaseEntityId(client.getBaseEntityId()); + if (c != null) { + return c; + } + + //still not found!! search by generic identifiers + + for (String idt : client.getIdentifiers().keySet()) { + List cl = allClients.findAllByIdentifier(client.getIdentifier(idt)); + if (cl.size() > 1) { + throw new IllegalArgumentException( + "Multiple clients with identifier type " + idt + " and ID " + client.getIdentifier(idt) + " exist."); + } else if (cl.size() != 0) { + return cl.get(0); + } + } + return c; + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostAuthorize("hasPermission(filterObject, 'Client' , 'CLIENT_VIEW')") + public Client find(String uniqueId) { + // find by document id + Client c = allClients.findByBaseEntityId(uniqueId); + if (c != null) { + return c; + } + + // if not found find if it is in any identifiers TODO refactor it later + List cl = allClients.findAllByIdentifier(uniqueId); + if (cl.size() > 1) { + throw new IllegalArgumentException("Multiple clients with identifier " + uniqueId + " exist."); + } else if (cl.size() != 0) { + return cl.get(0); + } + + return c; + } + + @PreAuthorize("hasPermission(#updatedClient,'Client', 'CLIENT_UPDATE')") + public void updateClient(Client updatedClient) throws JSONException { + // If update is on original entity + if (updatedClient.isNew()) { + throw new IllegalArgumentException( + "Client to be updated is not an existing and persisting domain object. Update database object instead of new pojo"); + } + + if (findClient(updatedClient) == null) { + throw new IllegalArgumentException("No client found with given list of identifiers. Consider adding new!"); + } + + updatedClient.setDateEdited(DateTime.now()); + allClients.update(updatedClient); + } + + @PreAuthorize("hasPermission(#updatedClient,'Client', 'CLIENT_UPDATE')") + public Client mergeClient(Client updatedClient) { + try { + Client original = findClient(updatedClient); + if (original == null) { + throw new IllegalArgumentException("No client found with given list of identifiers. Consider adding new!"); + } + + original = (Client) Utils.getMergedJSON(original, updatedClient, Arrays.asList(Client.class.getDeclaredFields()), + Client.class); + + for (Address a : updatedClient.getAddresses()) { + if (original.getAddress(a.getAddressType()) == null) { + original.addAddress(a); + } else { + original.removeAddress(a.getAddressType()); + original.addAddress(a); + } + } + for (String k : updatedClient.getIdentifiers().keySet()) { + original.addIdentifier(k, updatedClient.getIdentifier(k)); + } + for (String k : updatedClient.getAttributes().keySet()) { + original.addAttribute(k, updatedClient.getAttribute(k)); + } + + original.setDateEdited(DateTime.now()); + allClients.update(original); + return original; + } catch (JSONException | JsonProcessingException | SecurityException e) { + throw new RuntimeException(e); + } + + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasRole('CLIENT_VIEW_GLOBAL') or hasPermission(filterObject, 'CLIENT_VIEW')") + public List findByServerVersion(long serverVersion, Integer limit) { + return allClients.findByServerVersion(serverVersion, limit); + } + + public Long countAll(long serverVersion) { + return allClients.countAll(serverVersion); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List notInOpenMRSByServerVersion(long serverVersion, Calendar calendar) { + return allClients.notInOpenMRSByServerVersion(serverVersion, calendar); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findByFieldValue(String field, List ids) { + return allClients.findByFieldValue(field, ids); + } + + @PreAuthorize("hasRole('CLIENT_VIEW') or hasRole('CLIENT_OUT_OF_CATCHMENT_VIEW')") + public List findByFieldValueOutOfCatchment(String field, List ids) { + return allClients.findByFieldValue(field, ids); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findByFieldValue(String id) { + return allClients.findByRelationShip(id); + } + + @PreAuthorize("((hasRole('CLIENT_CREATE') or (hasRole('CLIENT_UPDATE'))) and" + + " (hasPermission(#client,'Client','CLIENT_CREATE') or hasPermission(#client,'Client','CLIENT_UPDATE')))" + + " or ((hasRole('CLIENT_CREATE') or (hasRole('CLIENT_UPDATE')) or" + + " hasRole('CLIENT_OUT_OF_CATCHMENT_CREATE') or hasRole('CLIENT_OUT_OF_CATCHMENT_UPDATE')))") + public Client addorUpdate(Client client) { + if (client.getBaseEntityId() == null) { + throw new RuntimeException("No baseEntityId"); + } + Client c = findClient(client); + if (c != null) { + client.setRevision(c.getRevision()); + client.setId(c.getId()); + client.setDateEdited(DateTime.now()); + client.addIdentifier("OPENMRS_UUID", c.getIdentifier("OPENMRS_UUID")); + allClients.update(client); + } else { + client.setDateCreated(DateTime.now()); + allClients.add(client); + } + return client; + } + + @PreAuthorize("hasPermission(#client,'Client','CLIENT_CREATE') and hasPermission(#client,'Client','CLIENT_UPDATE')") + public Client addorUpdate(Client client, boolean resetServerVersion) { + if (client.getBaseEntityId() == null) { + throw new RuntimeException("No baseEntityId"); + } + Client c = findClient(client); + if (c != null) { + client.setRevision(c.getRevision()); + client.setId(c.getId()); + client.setDateEdited(DateTime.now()); + allClients.update(client); + + } else { + client.setDateCreated(DateTime.now()); + allClients.add(client); + } + return client; + } + + public Map getMemberCountHouseholdHeadProviderByClients(List ids, String clientType) { + List householdClients = allClients.selectMemberCountHouseholdHeadProviderByClients("", ids, + clientType); + Map households = new HashMap(); + if (householdClients != null) { + for (HouseholdClient householdClient : householdClients) { + households.put(householdClient.getRelationalId(), householdClient); + } + } + return households; + } + + public HouseholdClient findTotalCountHouseholdByCriteria(ClientSearchBean clientSearchBean, + AddressSearchBean addressSearchBean) { + return allClients.findTotalCountHouseholdByCriteria(clientSearchBean, addressSearchBean); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List getHouseholdList(List ids, String clientType, AddressSearchBean addressSearchBean, + ClientSearchBean searchBean, List clients) { + Map householdClients = getMemberCountHouseholdHeadProviderByClients(ids, clientType); + + List clientList = new ArrayList(); + + for (Client client : clients) { + if (householdClients != null) { + HouseholdClient householdClient = householdClients.get(client.getBaseEntityId()); + if (householdClient != null) { + client.addAttribute("memberCount", householdClient.getMemebrCount()); + client.addAttribute("HouseholdHead", householdClient.getHouseholdHead()); + client.addAttribute("ProvierId", householdClient.getProviderId()); + } else { + client.addAttribute("memberCount", 0); + client.addAttribute("HouseholdHead", ""); + client.addAttribute("ProvierId", ""); + } + clientList.add(client); + } + } + return clientList; + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findMembersByRelationshipId(String relationshipId) { + return allClients.findMembersByRelationshipId(relationshipId); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findAllClientsByCriteria(ClientSearchBean clientSearchBean, AddressSearchBean addressSearchBean) { + return allClients.findAllClientsByCriteria(clientSearchBean, addressSearchBean); + } + + public HouseholdClient findTotalCountAllClientsByCriteria(ClientSearchBean clientSearchBean, + AddressSearchBean addressSearchBean) { + return allClients.findCountAllClientsByCriteria(clientSearchBean, addressSearchBean); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findHouseholdByCriteria(ClientSearchBean clientSearchBean, AddressSearchBean addressSearchBean, + DateTime lastEditFrom, DateTime lastEditTo) { + clientSearchBean.setLastEditFrom(lastEditFrom); + clientSearchBean.setLastEditTo(lastEditTo); + return allClients.findHouseholdByCriteria(clientSearchBean, addressSearchBean); + + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findAllANCByCriteria(ClientSearchBean clientSearchBean, AddressSearchBean addressSearchBean) { + return allClients.findANCByCriteria(clientSearchBean, addressSearchBean); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + public int findCountANCByCriteria(ClientSearchBean clientSearchBean, AddressSearchBean addressSearchBean) { + return allClients.findCountANCByCriteria(clientSearchBean, addressSearchBean); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findAllChildByCriteria(ClientSearchBean clientSearchBean, AddressSearchBean addressSearchBean) { + return allClients.findChildByCriteria(clientSearchBean, addressSearchBean); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + public int findCountChildByCriteria(ClientSearchBean clientSearchBean, AddressSearchBean addressSearchBean) { + return allClients.findCountChildByCriteria(clientSearchBean, addressSearchBean); + } + + /** + * This method searches for client ids paginated by server version + * + * @param serverVersion server version for last client that was fetched + * @param limit upper limit on number of client ids to fetch + * @param isArchived whether to return archived events + * @return a list of client ids + */ + public Pair, Long> findAllIds(long serverVersion, int limit, boolean isArchived) { + return allClients.findAllIds(serverVersion, limit, isArchived); + } + + /** + * overloads {@link #findAllIds(long, int, boolean)} by adding date/time filters + * + * @param serverVersion + * @param limit + * @param fromDate + * @param toDate + * @return + */ + public Pair, Long> findAllIds(long serverVersion, int limit, boolean isArchived, Date fromDate, + Date toDate) { + return allClients.findAllIds(serverVersion, limit, isArchived, fromDate, toDate); + } + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List findByClientTypeAndLocationId(String clientType, String locationId) { + return allClients.findByClientTypeAndLocationId(clientType, locationId); + } + + /** + * This method searches for client using an id + * + * @param id server version for last client that was fetched + * @return a client object + */ + public Client findById(String id) { + return allClients.findById(id); + } + + /** + * This method is similar to {@link #findByFieldValue(String, List)}. This method however does not enforce ACL + * so that users can search clients globally and not just those within their jurisdiction. + */ + public List findGlobalByFieldValue(String field, List ids) { + return allClients.findByFieldValue(field, ids); + } + + /** + * This method is similar to {@link #findByRelationship(String)}. This method however does not enforce ACL + * so that users can search clients globally and not just those within their jurisdiction. + */ + public List findGlobalByRelationship(String relationalId) { + return allClients.findByRelationShip(relationalId); + } } diff --git a/src/main/java/org/opensrp/service/ConfigService.java b/src/main/java/org/opensrp/service/ConfigService.java index d63f0a9b1..c1454239c 100644 --- a/src/main/java/org/opensrp/service/ConfigService.java +++ b/src/main/java/org/opensrp/service/ConfigService.java @@ -10,101 +10,101 @@ @Service public class ConfigService { - - private final AppStateTokensRepository allAppStateTokens; - - @Autowired - public ConfigService(AppStateTokensRepository allAppStateTokens) { - this.allAppStateTokens = allAppStateTokens; - } - - /** - * @param tokenName - * @return AppStateToken with given name. Since model is supposed to keep track of system`s - * state at any given time it throws IllegalStateException incase multiple Tokens found - * with same name. - */ - public AppStateToken getAppStateTokenByName(Enum tokenName) { - List ol = allAppStateTokens.findByName(tokenName.name()); - return getUniqueAppStateTokeFromTokenList(ol, tokenName); - } - - public void updateAppStateToken(Enum tokenName, Object value) { - List ol = allAppStateTokens.findByName(tokenName.name()); - AppStateToken ast = updateUniqueAppStateToken(ol, tokenName, value); - allAppStateTokens.update(ast); - } - - /** - * Registers a new token to manage the specified variable state (by token name) of App. Throws - * IllegalArgumentException if tokenName or description is not provided or if name is not unique - * >>>>>>> bda3b96... Define interfaces for Repositories. Services to use interfaces i.e. - * already exists in system and flag suppressExceptionIfExists is false. - * - * @param tokenName - * @param defaultValue - * @param description - * @param suppressExceptionIfExists - * @return The newly registered token. - */ - public AppStateToken registerAppStateToken(Enum tokenName, Object defaultValue, String description, - boolean suppressExceptionIfExists) { - - checkIfNameAndDescriptionExist(tokenName, description); - - List atl = allAppStateTokens.findByName(tokenName.name()); - - AppStateToken existingAppStateToken = checkIfTokenAlreadyExist(atl, tokenName, suppressExceptionIfExists); - - if (existingAppStateToken != null) { - return existingAppStateToken; - } - - AppStateToken token = new AppStateToken(tokenName.name(), defaultValue, 0L, description); - allAppStateTokens.add(token); - return token; - } - - private AppStateToken getUniqueAppStateTokeFromTokenList(List appStateTokens, Enum tokenName) { - if (appStateTokens.size() > 1) { - throw new IllegalStateException("System was found to have multiple token with same name (" + tokenName.name() - + "). This can lead to potential critical inconsistencies."); - } - - return appStateTokens.size() == 0 ? null : appStateTokens.get(0); - } - - private AppStateToken updateUniqueAppStateToken(List allAppStateTokens, Enum tokenName, Object value) { - if (allAppStateTokens.size() > 1) { - throw new IllegalStateException("System was found to have multiple token with same name (" + tokenName.name() - + "). This can lead to potential critical inconsistencies."); - } - - if (allAppStateTokens.size() == 0) { - throw new IllegalStateException("Property with name (" + tokenName.name() + ") not found."); - } - - AppStateToken ast = allAppStateTokens.get(0); - ast.setValue(value); - ast.setLastEditDate(System.currentTimeMillis()); - return ast; - } - - private void checkIfNameAndDescriptionExist(Enum tokenName, String description) { - if (tokenName == null || StringUtils.isBlank(description)) { - throw new IllegalArgumentException("Token name and description must be provided"); - } - } - - private AppStateToken checkIfTokenAlreadyExist(List appStateTokens, Enum tokenName, - boolean suppressExceptionIfExists) { - if (appStateTokens.size() > 0) { - if (!suppressExceptionIfExists) { - throw new IllegalArgumentException("Token with given name (" + tokenName.name() + ") already exists."); - } - return appStateTokens.get(0); - } - return null; - } - + + private final AppStateTokensRepository allAppStateTokens; + + @Autowired + public ConfigService(AppStateTokensRepository allAppStateTokens) { + this.allAppStateTokens = allAppStateTokens; + } + + /** + * @param tokenName + * @return AppStateToken with given name. Since model is supposed to keep track of system`s + * state at any given time it throws IllegalStateException incase multiple Tokens found + * with same name. + */ + public AppStateToken getAppStateTokenByName(Enum tokenName) { + List ol = allAppStateTokens.findByName(tokenName.name()); + return getUniqueAppStateTokeFromTokenList(ol, tokenName); + } + + public void updateAppStateToken(Enum tokenName, Object value) { + List ol = allAppStateTokens.findByName(tokenName.name()); + AppStateToken ast = updateUniqueAppStateToken(ol, tokenName, value); + allAppStateTokens.update(ast); + } + + /** + * Registers a new token to manage the specified variable state (by token name) of App. Throws + * IllegalArgumentException if tokenName or description is not provided or if name is not unique + * >>>>>>> bda3b96... Define interfaces for Repositories. Services to use interfaces i.e. + * already exists in system and flag suppressExceptionIfExists is false. + * + * @param tokenName + * @param defaultValue + * @param description + * @param suppressExceptionIfExists + * @return The newly registered token. + */ + public AppStateToken registerAppStateToken(Enum tokenName, Object defaultValue, String description, + boolean suppressExceptionIfExists) { + + checkIfNameAndDescriptionExist(tokenName, description); + + List atl = allAppStateTokens.findByName(tokenName.name()); + + AppStateToken existingAppStateToken = checkIfTokenAlreadyExist(atl, tokenName, suppressExceptionIfExists); + + if (existingAppStateToken != null) { + return existingAppStateToken; + } + + AppStateToken token = new AppStateToken(tokenName.name(), defaultValue, 0L, description); + allAppStateTokens.add(token); + return token; + } + + private AppStateToken getUniqueAppStateTokeFromTokenList(List appStateTokens, Enum tokenName) { + if (appStateTokens.size() > 1) { + throw new IllegalStateException("System was found to have multiple token with same name (" + tokenName.name() + + "). This can lead to potential critical inconsistencies."); + } + + return appStateTokens.size() == 0 ? null : appStateTokens.get(0); + } + + private AppStateToken updateUniqueAppStateToken(List allAppStateTokens, Enum tokenName, Object value) { + if (allAppStateTokens.size() > 1) { + throw new IllegalStateException("System was found to have multiple token with same name (" + tokenName.name() + + "). This can lead to potential critical inconsistencies."); + } + + if (allAppStateTokens.size() == 0) { + throw new IllegalStateException("Property with name (" + tokenName.name() + ") not found."); + } + + AppStateToken ast = allAppStateTokens.get(0); + ast.setValue(value); + ast.setLastEditDate(System.currentTimeMillis()); + return ast; + } + + private void checkIfNameAndDescriptionExist(Enum tokenName, String description) { + if (tokenName == null || StringUtils.isBlank(description)) { + throw new IllegalArgumentException("Token name and description must be provided"); + } + } + + private AppStateToken checkIfTokenAlreadyExist(List appStateTokens, Enum tokenName, + boolean suppressExceptionIfExists) { + if (appStateTokens.size() > 0) { + if (!suppressExceptionIfExists) { + throw new IllegalArgumentException("Token with given name (" + tokenName.name() + ") already exists."); + } + return appStateTokens.get(0); + } + return null; + } + } diff --git a/src/main/java/org/opensrp/service/ErrorTraceService.java b/src/main/java/org/opensrp/service/ErrorTraceService.java index 5bc340e8b..ae2754eda 100644 --- a/src/main/java/org/opensrp/service/ErrorTraceService.java +++ b/src/main/java/org/opensrp/service/ErrorTraceService.java @@ -13,93 +13,95 @@ */ @Service public class ErrorTraceService { - - private final ErrorTraceRepository allErrorTrace; - - @Autowired - public ErrorTraceService(ErrorTraceRepository allErrorTrace) { - this.allErrorTrace = allErrorTrace; - } - - /** - * Saves logs to on database - * This method has been disabled and logs are no longer saved on the database from 06/September/2018 - * @param Error - */ - public void addError(ErrorTrace entity) { - //allErrorTrace.add(entity); - } - - /** - * @param errorType - * @param documentType - * @param recordId - * @param stackTrace - * @param retryURL this method is used for logs and it should be called on Exception Catch . - * retryURL should be given by developer, it is for resubmission or retry of that - * particular record . - */ - public void log(String errorType, String documentType, String recordId, String stackTrace, String retryURL) { - ErrorTrace error = new ErrorTrace(); - error.setErrorType(errorType); - error.setDocumentType(documentType); - error.setRecordId(recordId); - error.setStackTrace(stackTrace); - error.setRetryUrl(retryURL); - error.setDateOccurred(DateTime.now()); - addError(error); - - } - - /** - * Update logs saved on database - * This method has been disabled logs are no longer saved on the database from 06/September/2018 - * @param Error - */ - public void updateError(ErrorTrace entity) { - //allErrorTrace.update(entity); - } - - public List getAllErrors() { - - List allErrorList = allErrorTrace.findAllErrors(); - if (null == allErrorList || allErrorList.isEmpty()) { - return null; - - } - - return allErrorList; - - } - - public List getAllSolvedErrors() { - - List allErrorList = allErrorTrace.findAllSolvedErrors(); - if (null == allErrorList || allErrorList.isEmpty()) { - return null; - - } - - return allErrorList; - - } - - public List getAllUnsolvedErrors() { - - List allErrorList = allErrorTrace.findAllUnSolvedErrors(); - if (null == allErrorList || allErrorList.isEmpty()) { - return null; - - } - - return allErrorList; - - } - - public ErrorTrace getError(String id) { - - return allErrorTrace.findById(id); - - } - + + private final ErrorTraceRepository allErrorTrace; + + @Autowired + public ErrorTraceService(ErrorTraceRepository allErrorTrace) { + this.allErrorTrace = allErrorTrace; + } + + /** + * Saves logs to on database + * This method has been disabled and logs are no longer saved on the database from 06/September/2018 + * + * @param Error + */ + public void addError(ErrorTrace entity) { + //allErrorTrace.add(entity); + } + + /** + * @param errorType + * @param documentType + * @param recordId + * @param stackTrace + * @param retryURL this method is used for logs and it should be called on Exception Catch . + * retryURL should be given by developer, it is for resubmission or retry of that + * particular record . + */ + public void log(String errorType, String documentType, String recordId, String stackTrace, String retryURL) { + ErrorTrace error = new ErrorTrace(); + error.setErrorType(errorType); + error.setDocumentType(documentType); + error.setRecordId(recordId); + error.setStackTrace(stackTrace); + error.setRetryUrl(retryURL); + error.setDateOccurred(DateTime.now()); + addError(error); + + } + + /** + * Update logs saved on database + * This method has been disabled logs are no longer saved on the database from 06/September/2018 + * + * @param Error + */ + public void updateError(ErrorTrace entity) { + //allErrorTrace.update(entity); + } + + public List getAllErrors() { + + List allErrorList = allErrorTrace.findAllErrors(); + if (null == allErrorList || allErrorList.isEmpty()) { + return null; + + } + + return allErrorList; + + } + + public List getAllSolvedErrors() { + + List allErrorList = allErrorTrace.findAllSolvedErrors(); + if (null == allErrorList || allErrorList.isEmpty()) { + return null; + + } + + return allErrorList; + + } + + public List getAllUnsolvedErrors() { + + List allErrorList = allErrorTrace.findAllUnSolvedErrors(); + if (null == allErrorList || allErrorList.isEmpty()) { + return null; + + } + + return allErrorList; + + } + + public ErrorTrace getError(String id) { + + return allErrorTrace.findById(id); + + } + } diff --git a/src/main/java/org/opensrp/service/EventService.java b/src/main/java/org/opensrp/service/EventService.java index 877918ee8..fd7f3f258 100644 --- a/src/main/java/org/opensrp/service/EventService.java +++ b/src/main/java/org/opensrp/service/EventService.java @@ -54,734 +54,720 @@ @Service public class EventService { - private final EventsRepository allEvents; - - private final ClientService clientService; - - private final TaskGenerator taskGenerator; - - private final PlanRepository planRepository; - - private final ExportEventDataMapper exportEventDataMapper; - - private final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); - - @Value("#{opensrp['plan.evaluation.enabled'] ?: false}") - private boolean isPlanEvaluationEnabled; - - @Autowired - public EventService(EventsRepository allEvents, ClientService clientService, TaskGenerator taskGenerator, - PlanRepository planRepository, ExportEventDataMapper exportEventDataMapper) { - this.allEvents = allEvents; - this.clientService = clientService; - this.taskGenerator = taskGenerator; - this.planRepository = planRepository; - this.exportEventDataMapper = exportEventDataMapper; - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") - public List findAllByIdentifier(String identifier) { - return allEvents.findAllByIdentifier(identifier); - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") - public List findAllByIdentifier(String identifierType, String identifier) { - return allEvents.findAllByIdentifier(identifierType, identifier); - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostAuthorize("hasPermission(returnObject,'Event', 'EVENT_VIEW')") - public Event getById(String id) { - return allEvents.findById(id); - } - - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostAuthorize("hasPermission(returnObject,'Event', 'EVENT_VIEW')") - public Event getByBaseEntityAndFormSubmissionId(String baseEntityId, String formSubmissionId) { - return allEvents.findByBaseEntityAndFormSubmissionId(baseEntityId, formSubmissionId); - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") - public List findByBaseEntityId(String baseEntityId) { - return allEvents.findByBaseEntityId(baseEntityId); - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostAuthorize("hasPermission(returnObject,'Event', 'EVENT_VIEW')") - public Event findByFormSubmissionId(String formSubmissionId) { - return allEvents.findByFormSubmissionId(formSubmissionId, false); - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") - public List findEventsBy(EventSearchBean eventSearchBean) { - return allEvents.findEvents(eventSearchBean); - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") - public List findEventsByDynamicQuery(String query) { - return allEvents.findEventsByDynamicQuery(query); - } - - private static Logger logger = LogManager.getLogger(EventService.class.toString()); - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostAuthorize("hasPermission(returnObject,'Event', 'EVENT_VIEW')") - public Event find(String uniqueId) { - try { - List el = allEvents.findAllByIdentifier(uniqueId); - return getUniqueEventFromEventList(el); - } - catch (IllegalArgumentException e) { - throw new IllegalArgumentException("Multiple events with identifier " + uniqueId + " exist."); - } - } - - @PreAuthorize("hasPermission(#event,'Event', 'EVENT_VIEW')") - public Event find(Event event) { - for (String idt : event.getIdentifiers().keySet()) { - try { - List el = allEvents.findAllByIdentifier(event.getIdentifier(idt)); - return getUniqueEventFromEventList(el); - } - catch (IllegalArgumentException e) { - throw new IllegalArgumentException( - "Multiple events with identifier type " + idt + " and ID " + event.getIdentifier(idt) + " exist."); - } - } - return null; - } - - /** - * Find an event using the event Id - * - * @param eventId the if for the event - * @return an event matching the eventId - */ - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostAuthorize("hasPermission(returnObject,'Event', 'EVENT_VIEW')") - public Event findById(String eventId) { - try { - if (StringUtils.isEmpty(eventId)) { - return null; - } - return allEvents.findById(eventId); - } - catch (Exception e) { - logger.error("", e); - } - return null; - } - - /** - * Find an event using an event Id or form Submission Id - * - * @param eventId the if for the event - * @param formSubmissionId form submission id for the events - * @return an event matching the eventId or formsubmission id - */ - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostAuthorize("hasPermission(returnObject,'Event', 'EVENT_VIEW')") - public Event findByIdOrFormSubmissionId(String eventId, String formSubmissionId) { - Event event = null; - try { - if (StringUtils.isNotEmpty(eventId)) { - event = findById(eventId); - } - if (event == null && StringUtils.isNotEmpty(formSubmissionId)) { - return allEvents.findByFormSubmissionId(formSubmissionId, true); - } - } - catch (Exception e) { - logger.error("", e); - } - return event; - } - - @PreAuthorize("hasPermission(#event,'Event', 'EVENT_CREATE')") - public synchronized Event addEvent(Event event, String username) { - Event e = find(event); - if (e != null) { - throw new IllegalArgumentException( - "An event already exists with given list of identifiers. Consider updating data.[" + e + "]"); - } - - if (event.getFormSubmissionId() != null - && getByBaseEntityAndFormSubmissionId(event.getBaseEntityId(), event.getFormSubmissionId()) != null) { - throw new IllegalArgumentException( - "An event already exists with given baseEntity and formSubmission combination. Consider updating"); - } - - event.setDateCreated(DateTime.now()); - allEvents.add(event); - triggerPlanEvaluation(event, username); - return event; - } - - public synchronized Event addEventOutOfCatchment(Event event, String username) { - Event e = find(event); - if (e != null) { - throw new IllegalArgumentException( - "An event already exists with given list of identifiers. Consider updating data.[" + e + "]"); - } - - if (event.getFormSubmissionId() != null - && getByBaseEntityAndFormSubmissionId(event.getBaseEntityId(), event.getFormSubmissionId()) != null) { - throw new IllegalArgumentException( - "An event already exists with given baseEntity and formSubmission combination. Consider updating"); - } - - event.setDateCreated(DateTime.now()); - allEvents.add(event); - triggerPlanEvaluation(event, username); - return event; - } - - /** - * An out of area event is used to record services offered outside a client's catchment area. The - * event usually will have a client unique identifier(ZEIR_ID) as the only way to identify the - * client.This method finds the client based on the identifier and assigns a basentityid to the - * event - * - * @param event event to be processed - * @return event - */ - public synchronized Event processOutOfArea(Event event) { - try { - String programClientId = event.getDetails() != null - ? event.getDetails().getOrDefault("program_client_id", "") - : ""; - - String identifier = StringUtils.isBlank(event.getIdentifier(Client.ZEIR_ID)) - ? (StringUtils.isBlank(event.getIdentifier(OPENSRP_ID)) ? programClientId : event.getIdentifier(OPENSRP_ID)) - : event.getIdentifier(Client.ZEIR_ID); - - logger.info("Processing out of area event: baseEntityId=" + event.getBaseEntityId() + "; identifier=" + identifier); - - if (StringUtils.isNotBlank(event.getBaseEntityId()) || StringUtils.isBlank(identifier)) { - return event; - } - - List clients = identifier.startsWith(CARD_ID_PREFIX) - ? clientService.findAllByAttributeOutOfCatchment(NFC_CARD_IDENTIFIER, identifier.substring(CARD_ID_PREFIX.length())) - : getClientByIdentifierOutOfCatchment(identifier); - - if (clients == null || clients.isEmpty()) { - return event; - } - - for (org.smartregister.domain.Client client : clients) { - List existingEvents = findByBaseEntityAndTypeOutOfCatchment(client.getBaseEntityId(), BIRTH_REGISTRATION_EVENT); - - if (existingEvents == null || existingEvents.isEmpty()) { - return event; - } - Event birthRegEvent = existingEvents.get(0); - createOutOfCatchmentService(event, birthRegEvent); - } - } - catch (Exception e) { - logger.error("Error processing out of catchment service", e); - } - - return event; - } - - private void createOutOfCatchmentService(Event event, Event birthRegEvent) { - if (event.getEventType() != null) { - //Remove identifier since entity id is present, also create new service with the right location and provider - String eventTypeLowercase = event.getEventType().toLowerCase(); - if ((event.getEventType().startsWith(EventConstants.OUT_OF_AREA_SERVICE) || event.getEventType() - .startsWith(EventConstants.NEW_OUT_OF_AREA_SERVICE))) { - - boolean hasGrowthMonitoring = - eventTypeLowercase.contains(EventConstants.GROWTH_MONITORING_EVENT.toLowerCase()) || - eventTypeLowercase.contains(EventConstants.GROWTH_MONITORING_EVENT_UNDERSCORED); - - if (hasGrowthMonitoring || eventTypeLowercase.contains(VACCINATION_EVENT.toLowerCase())) { - - String actualEventType = hasGrowthMonitoring ? GROWTH_MONITORING_EVENT : - eventTypeLowercase.contains(VACCINATION_EVENT.toLowerCase()) ? VACCINATION_EVENT : null; - - if (actualEventType != null) { - Event newEvent = getNewOutOfAreaServiceEvent(event, birthRegEvent, actualEventType); - addEventOutOfCatchment(newEvent, birthRegEvent.getProviderId()); - } - } else if (eventTypeLowercase.contains(RECURRING_SERVICE.toLowerCase()) || - eventTypeLowercase.contains(RECURRING_SERVICE_UNDERSCORED)) { - processOutOfAreaRecurringService(event, birthRegEvent); - } - } - } - } - - private void removeIdentifier(Event event) { - //Remove case sensitive identifiers - TreeMap newIdentifiers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); - newIdentifiers.putAll(event.getIdentifiers()); - newIdentifiers.remove(Client.ZEIR_ID); - newIdentifiers.remove(OPENSRP_ID); - event.setIdentifiers(newIdentifiers); - } - - private void processOutOfAreaRecurringService(Event event, Event birthRegEvent) { - //Get and sort previous recurring services related to the current - String recurringServiceTypes = event.getDetails().get(RECURRING_SERVICE_TYPES); - List outOfCatchmentServices = Arrays - .asList(recurringServiceTypes.substring(1, recurringServiceTypes.length() - 1).split(",")); - List previousServices = findByBaseEntityAndType(birthRegEvent.getBaseEntityId(), RECURRING_SERVICE); - Map> matchedRecurringServices = getMarchedRecurringServices(previousServices, - outOfCatchmentServices); - - //Create new recurring service event with correct sequence, incrementing on the old recurring service's - //Otherwise create first recurring service - for (String service : outOfCatchmentServices) { - - Event newEvent = getNewOutOfAreaServiceEvent(event, birthRegEvent, RECURRING_SERVICE); - newEvent.setEntityType(RECURRING_SERVICE_UNDERSCORED); - - //Check if there are any existing recurring services or create the first - List events = matchedRecurringServices.get(service); - if (!events.isEmpty()) { - Event lastRecurringService = events.get(events.size() - 1); - - Obs obsWithValue = getObsWithValue(lastRecurringService); - if (obsWithValue != null) { - int newVal = Integer.parseInt((String) obsWithValue.getValues().get(0)) + 1; - String newSequence = String.valueOf(newVal); - String newFormSubmissionField = String.format("%s_%s", service, newSequence); - List newObsList = updateObs(lastRecurringService, event, newSequence, newFormSubmissionField); - newEvent.setObs(newObsList); - addEvent(newEvent, birthRegEvent.getProviderId()); - } - } else { - createFirstRecurringService(service, newEvent, birthRegEvent); - } - } - } - - private void createFirstRecurringService(String service, Event newEvent, Event birthRegEvent) { - String submissionField = String.format("%s_%s", service, 1); - List values = Collections.singletonList(ObsConstants.CODED_FIELD_VALUE); - String codedFieldCode; - switch (service.trim()) { - case RecurringServiceConstants.DEWORMING: - codedFieldCode = ObsConstants.DEWORMING_CODED_FIELD_CODE; - break; - case RecurringServiceConstants.VIT_A: - codedFieldCode = ObsConstants.VIT_A_CODED_FIELD_CODE; - break; - case RecurringServiceConstants.ITN: - codedFieldCode = ObsConstants.ITN_CODED_FIELD_CODE; - break; - default: - codedFieldCode = submissionField; - break; - } - List obsList = new ArrayList<>(); - obsList.add(getServiceObs(submissionField, codedFieldCode, CODED, values, Collections.singletonList( - EventConstants.YES))); - obsList.add(getServiceObs(submissionField + _DOSE, ObsConstants.NUMERIC_FIELD_CODE, NUMERIC, - Collections.singletonList(String.valueOf(1)), Collections.emptyList())); - - if (service.equalsIgnoreCase(RecurringServiceConstants.ITN)) { - obsList.add(getServiceObs(submissionField + _DATE, ObsConstants.ITN_DATE_FIELD_CODE, DATE, - Collections.singletonList(newEvent.getEventDate()), Collections.emptyList())); - } - - newEvent.setObs(obsList); - newEvent.setEntityType(RECURRING_SERVICE_UNDERSCORED); - addEvent(newEvent, birthRegEvent.getProviderId()); - } - - public Obs getServiceObs(String submissionField, String fieldCode, String fieldDataType, List values, - List humanReadableValues) { - Obs obs = new Obs() - .withFormSubmissionField(submissionField) - .withFieldDataType(fieldDataType) - .withFieldType(CONCEPT) - .withFieldCode(fieldCode) - .withValues(values); - obs.setHumanReadableValues(humanReadableValues); - return obs; - } - - private List updateObs(Event lastRecurringService, Event incomingEvent, String newSequence, - String newFormSubmissionField) { - List newObsList = new ArrayList<>(); - for (Obs oldObs : lastRecurringService.getObs()) { - if (oldObs.getFieldDataType().equalsIgnoreCase(NUMERIC)) { - oldObs.setFormSubmissionField(newFormSubmissionField + _DOSE); - oldObs.getValues().clear(); - oldObs.getValues().add(newSequence); - } else if (oldObs.getFieldDataType().equalsIgnoreCase(DATE)) { - oldObs.setFormSubmissionField(newFormSubmissionField + _DATE); - oldObs.getValues().clear(); - oldObs.getValues().add(simpleDateFormat.format(incomingEvent.getEventDate())); - } else if (oldObs.getFieldDataType().equalsIgnoreCase(CODED)) { - oldObs.setFormSubmissionField(newFormSubmissionField); - } - newObsList.add(oldObs); - } - return newObsList; - } - - public Obs getObsWithValue(Event event) { - if (event != null) { - for (Obs obs : event.getObs()) { - if (obs.getFieldDataType().equalsIgnoreCase(NUMERIC) && obs.getFormSubmissionField().contains(DOSE) - && !obs.getValues().isEmpty()) { - return obs; - } - } - } - return null; - } - - private Map> getMarchedRecurringServices(List previousServices, - List outOfCatchmentServices) { - Map> marchedServices = new TreeMap<>(); - for (String service : outOfCatchmentServices) { - List serviceEvents = previousServices.stream().filter(event -> { - Obs obs = getObsWithValue(event); - if (obs == null) { - return false; - } - return obs.getFormSubmissionField().startsWith(service.trim()); - }).sorted((event1, event2) -> { - int value1 = Integer.parseInt((String) getObsWithValue(event1).getValues().get(0)); - int value2 = Integer.parseInt((String) getObsWithValue(event2).getValues().get(0)); - return Integer.compare(value1, value2); - }).collect(Collectors.toList()); - marchedServices.put(service, serviceEvents); - } - - return marchedServices; - } - - private Event getNewOutOfAreaServiceEvent(Event event, Event birthRegEvent, String eventType) { - String eventId = event.getBaseEntityId(); - if (StringUtils.isEmpty(eventId)) { - eventId = birthRegEvent.getBaseEntityId(); - } - - event.setBaseEntityId(birthRegEvent.getBaseEntityId()); - removeIdentifier(event); //Remove identifier from the old event first because entity id is found - Event newEvent = new Event(); - newEvent.withBaseEntityId(eventId) - .withEventType(eventType) - .withEventDate(event.getEventDate()) - .withEntityType(event.getEntityType()) - .withProviderId(birthRegEvent.getProviderId()) - .withLocationId(birthRegEvent.getLocationId()) - .withChildLocationId(birthRegEvent.getChildLocationId()) - .withFormSubmissionId(UUID.randomUUID().toString()) - .withDateCreated(event.getDateCreated()); - Map details = new HashMap<>(); - details.put(OUT_OF_CATCHMENT_PROVIDER_ID, event.getProviderId()); - newEvent.setDetails(details); - newEvent.setObs(event.getObs()); - newEvent.setTeam(birthRegEvent.getTeam()); - newEvent.setTeamId(birthRegEvent.getTeamId()); - newEvent.setIdentifiers(event.getIdentifiers()); - return newEvent; - } - - private List getClientByIdentifier(String identifier) { - List clients = clientService.findAllByIdentifier(Client.ZEIR_ID, identifier); - if (clients != null && clients.isEmpty()) { - clients = clientService.findAllByIdentifier(Client.ZEIR_ID.toUpperCase(), identifier); - } - return clients; - } - - private List getClientByIdentifierOutOfCatchment(String identifier) { - List clients = clientService.findAllByIdentifierOutOfCatchment(Client.ZEIR_ID, identifier); - if (clients != null && clients.isEmpty()) { - clients = clientService.findAllByIdentifierOutOfCatchment(Client.ZEIR_ID.toUpperCase(), identifier); - } - return clients; - } - - @PreAuthorize("(hasPermission(#event,'Event', 'EVENT_CREATE') and hasPermission(#event,'Event', 'EVENT_UPDATE'))" - + " or (hasRole('EVENT_OUT_OF_CATCHMENT_CREATE') or hasRole('EVENT_OUT_OF_CATCHMENT_UPDATE'))") - public synchronized Event addorUpdateEvent(Event event, String username) { - Event existingEvent = findByIdOrFormSubmissionId(event.getId(), event.getFormSubmissionId()); - if (existingEvent != null) { - event.setId(existingEvent.getId()); - event.setRevision(existingEvent.getRevision()); - event.setDateEdited(DateTime.now()); - event.setRevision(existingEvent.getRevision()); - allEvents.update(event); - - } else { - event.setDateCreated(DateTime.now()); - allEvents.add(event); - - } - - triggerPlanEvaluation(event, username); - - return event; - } - - @PreAuthorize("hasPermission(#updatedEvent,'Event', 'EVENT_UPDATE')") - public void updateEvent(Event updatedEvent, String username) { - // If update is on original entity - if (updatedEvent.isNew()) { - throw new IllegalArgumentException( - "Event to be updated is not an existing and persisting domain object. Update database object instead of new pojo"); - } - - updatedEvent.setDateEdited(DateTime.now()); - allEvents.update(updatedEvent); - triggerPlanEvaluation(updatedEvent, username); - } - - //TODO Review and add test cases as well - @PreAuthorize("hasPermission(#updatedEvent,'Event', 'EVENT_UPDATE')") - public Event mergeEvent(Event updatedEvent) { - try { - Event original = find(updatedEvent); - if (original == null) { - throw new IllegalArgumentException("No event found with given list of identifiers. Consider adding new!"); - } - - original = (Event) Utils.getMergedJSON(original, updatedEvent, Arrays.asList(Event.class.getDeclaredFields()), - Event.class); - for (Obs o : updatedEvent.getObs()) { - // TODO handle parent - if (original.getObs(null, o.getFieldCode()) == null) { - original.addObs(o); - } else { - original.getObs(null, o.getFieldCode()).setComments(o.getComments()); - original.getObs(null, o.getFieldCode()).setEffectiveDatetime(o.getEffectiveDatetime()); - original.getObs(null, o.getFieldCode()) - .setValue(o.getValues().size() < 2 ? o.getValue() : o.getValues()); - } - } - for (String k : updatedEvent.getIdentifiers().keySet()) { - original.addIdentifier(k, updatedEvent.getIdentifier(k)); - } - - original.setDateEdited(DateTime.now()); - allEvents.update(original); - return original; - } - catch (JSONException | JsonProcessingException | SecurityException e) { - throw new RuntimeException(e); - } - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") - public List findByServerVersion(long serverVersion) { - return allEvents.findByServerVersion(serverVersion); - } - - public List findByServerVersionOutOfCatchment(long serverVersion) { - return allEvents.findByServerVersion(serverVersion); - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") - public List notInOpenMRSByServerVersion(long serverVersion, Calendar calendar) { - return allEvents.notInOpenMRSByServerVersion(serverVersion, calendar); - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") - public List notInOpenMRSByServerVersionAndType(String type, long serverVersion, Calendar calendar) { - return allEvents.notInOpenMRSByServerVersionAndType(type, serverVersion, calendar); - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") - public List getAll() { - return allEvents.getAll(); - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasRole('EVENT_VIEW_GLOBAL') or hasPermission(filterObject, 'EVENT_VIEW')") - public List findEvents(EventSearchBean eventSearchBean, String sortBy, String sortOrder, int limit) { - return allEvents.findEvents(eventSearchBean, sortBy, sortOrder, limit); - } - - @PreAuthorize("hasRole('EVENT_VIEW') or hasRole('EVENT_OUT_OF_CATCHMENT_VIEW')") - public List findOutOfCatchmentEvents(EventSearchBean eventSearchBean, String sortBy, String sortOrder, int limit) { - return allEvents.findEvents(eventSearchBean, sortBy, sortOrder, limit); - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") - public List findEvents(EventSearchBean eventSearchBean) { - return allEvents.findEvents(eventSearchBean); - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") - public List findEventsByConceptAndValue(String concept, String conceptValue) { - return allEvents.findByConceptAndValue(concept, conceptValue); - - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") - public List findByBaseEntityAndType(String baseEntityId, String eventType) { - return allEvents.findByBaseEntityAndType(baseEntityId, eventType); - } - - public List findByBaseEntityAndTypeOutOfCatchment(String baseEntityId, String eventType) { - return allEvents.findByBaseEntityAndType(baseEntityId, eventType); - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") - private Event getUniqueEventFromEventList(List events) throws IllegalArgumentException { - if (events.size() > 1) { - throw new IllegalArgumentException(); - } - if (events.size() == 0) { - return null; - } - return events.get(0); - } - - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") - public List findByProviderAndEntityType(String provider) { - return allEvents.findByProvider(provider); - } - - /** - * This method searches for event ids filtered by eventType and the date they were deleted - * - * @param eventType used to filter the event ids - * @param isDeleted whether to return deleted event ids - * @param serverVersion incremental server version - * @param limit upper limit on number of tasks ids to fetch - * @return a list of event ids - */ - @PreAuthorize("hasRole('EVENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") - public Pair, Long> findAllIdsByEventType(String eventType, boolean isDeleted, Long serverVersion, - int limit) { - return allEvents.findIdsByEventType(eventType, isDeleted, serverVersion, limit); - } - - /** - * overrides {@link #findAllIdsByEventType(String, boolean, Long, int)} by adding date filters - * - * @param eventType - * @param isDeleted - * @param serverVersion - * @param limit - * @param fromDate - * @param toDate - * @return - */ - public Pair, Long> findAllIdsByEventType(String eventType, boolean isDeleted, Long serverVersion, int limit, - Date fromDate, Date toDate) { - return allEvents.findIdsByEventType(eventType, isDeleted, serverVersion, limit, fromDate, toDate); - } - - /** - * This method is used to return a count of events based on the provided parameters - * - * @param eventSearchBean object containing params to search by - * @return returns a count of events matching the passed parameters - */ - public Long countEvents(EventSearchBean eventSearchBean) { - return allEvents.countEvents(eventSearchBean); - } - - /** - * This method is similar to {@link #findEventsByConceptAndValue(String, String)}. This method however does not enforce ACL - * so that users can search events globally and not just those within their jurisdiction. - */ - public List findGlobalEventsByConceptAndValue(String concept, String conceptValue) { - return allEvents.findByConceptAndValue(concept, conceptValue); - } - - private void triggerPlanEvaluation(Event event, String username) { - String planIdentifier = event.getDetails() != null ? event.getDetails().get(EventConstants.PLAN_IDENTIFIER) : null; - if (isPlanEvaluationEnabled && planIdentifier != null) { - PlanDefinition plan = planRepository.get(planIdentifier); - if (plan != null && plan.getStatus().equals(PlanDefinition.PlanStatus.ACTIVE) && ( - plan.getEffectivePeriod().getEnd() == null - || plan.getEffectivePeriod().getEnd().isAfter(LocalDate.now().toDateTimeAtStartOfDay()))) - taskGenerator.processPlanEvaluation(plan, username, event); - } - } - - public ExportEventDataSummary exportEventData(String planIdentifier, String eventType, Date fromDate, Date toDate) - throws JsonProcessingException { - List pgEvents = allEvents - .getEventData(planIdentifier, eventType, fromDate, toDate); - ExportEventDataSummary exportEventDataSummary = new ExportEventDataSummary(); - List> allRows = new ArrayList<>(); - boolean returnHeader = true; - Map columnNamesAndLabels = exportEventDataMapper.getColumnNamesAndLabelsByEventType(eventType); - boolean settingsExist = columnNamesAndLabels != null && columnNamesAndLabels.size() > 0; - - if (settingsExist) { - allRows.add(exportEventDataMapper - .getExportEventDataAfterMapping(null, eventType, returnHeader, settingsExist)); //for header row - } - - //Assumption : All pgEvents would have similar obs fields to include as a header - else { - if (exportEventDataMapper.getExportEventDataAfterMapping( - pgEvents.size() > 0 ? pgEvents.get(0).getJson() : "", eventType, returnHeader, settingsExist) != null) - allRows.add(exportEventDataMapper.getExportEventDataAfterMapping( - pgEvents.size() > 0 ? pgEvents.get(0).getJson() : "", eventType, returnHeader, - settingsExist)); //for header row - } - - for (org.opensrp.domain.postgres.Event pgEvent : pgEvents) { - allRows.add(exportEventDataMapper - .getExportEventDataAfterMapping(pgEvent.getJson(), eventType, false, settingsExist)); - } - - exportEventDataSummary.setRowsData(allRows); - - PlanDefinition plan = planIdentifier != null ? planRepository.get(planIdentifier) : null; - if (plan != null) - exportEventDataSummary.setMissionName(plan.getName()); - return exportEventDataSummary; - } - - public ExportImagesSummary getImagesMetadataForFlagProblemEvent(String planIdentifier, String eventType, Date fromDate, - Date toDate) throws JsonProcessingException { - List pgEvents = allEvents - .getEventData(planIdentifier, eventType, fromDate, toDate); - - Set servicePoints = new HashSet<>(); - String servicePointName; - ExportImagesSummary exportImagesSummary = new ExportImagesSummary(); - ExportFlagProblemEventImageMetadata exportFlagProblemEventImageMetadata; - List exportFlagProblemEventImageMetadataList = new ArrayList<>(); - for (org.opensrp.domain.postgres.Event pgEvent : pgEvents) { - exportFlagProblemEventImageMetadata = exportEventDataMapper - .getFlagProblemEventImagesMetadata(pgEvent.getJson(), "$.baseEntityId", - "$.details.locationName", "$.details.productName"); - if (exportFlagProblemEventImageMetadata != null) { - exportFlagProblemEventImageMetadataList.add(exportFlagProblemEventImageMetadata); - servicePointName = exportFlagProblemEventImageMetadata.getServicePointName(); - if (servicePointName != null && !servicePoints.contains(servicePointName)) { - servicePoints.add(servicePointName); - } - } - } - - exportImagesSummary.setExportFlagProblemEventImageMetadataList(exportFlagProblemEventImageMetadataList); - exportImagesSummary.setServicePoints(servicePoints); - return exportImagesSummary; - - } + private static Logger logger = LogManager.getLogger(EventService.class.toString()); + private final EventsRepository allEvents; + private final ClientService clientService; + private final TaskGenerator taskGenerator; + private final PlanRepository planRepository; + private final ExportEventDataMapper exportEventDataMapper; + private final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); + @Value("#{opensrp['plan.evaluation.enabled'] ?: false}") + private boolean isPlanEvaluationEnabled; + + @Autowired + public EventService(EventsRepository allEvents, ClientService clientService, TaskGenerator taskGenerator, + PlanRepository planRepository, ExportEventDataMapper exportEventDataMapper) { + this.allEvents = allEvents; + this.clientService = clientService; + this.taskGenerator = taskGenerator; + this.planRepository = planRepository; + this.exportEventDataMapper = exportEventDataMapper; + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") + public List findAllByIdentifier(String identifier) { + return allEvents.findAllByIdentifier(identifier); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") + public List findAllByIdentifier(String identifierType, String identifier) { + return allEvents.findAllByIdentifier(identifierType, identifier); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostAuthorize("hasPermission(returnObject,'Event', 'EVENT_VIEW')") + public Event getById(String id) { + return allEvents.findById(id); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostAuthorize("hasPermission(returnObject,'Event', 'EVENT_VIEW')") + public Event getByBaseEntityAndFormSubmissionId(String baseEntityId, String formSubmissionId) { + return allEvents.findByBaseEntityAndFormSubmissionId(baseEntityId, formSubmissionId); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") + public List findByBaseEntityId(String baseEntityId) { + return allEvents.findByBaseEntityId(baseEntityId); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostAuthorize("hasPermission(returnObject,'Event', 'EVENT_VIEW')") + public Event findByFormSubmissionId(String formSubmissionId) { + return allEvents.findByFormSubmissionId(formSubmissionId, false); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") + public List findEventsBy(EventSearchBean eventSearchBean) { + return allEvents.findEvents(eventSearchBean); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") + public List findEventsByDynamicQuery(String query) { + return allEvents.findEventsByDynamicQuery(query); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostAuthorize("hasPermission(returnObject,'Event', 'EVENT_VIEW')") + public Event find(String uniqueId) { + try { + List el = allEvents.findAllByIdentifier(uniqueId); + return getUniqueEventFromEventList(el); + } catch (IllegalArgumentException e) { + throw new IllegalArgumentException("Multiple events with identifier " + uniqueId + " exist."); + } + } + + @PreAuthorize("hasPermission(#event,'Event', 'EVENT_VIEW')") + public Event find(Event event) { + for (String idt : event.getIdentifiers().keySet()) { + try { + List el = allEvents.findAllByIdentifier(event.getIdentifier(idt)); + return getUniqueEventFromEventList(el); + } catch (IllegalArgumentException e) { + throw new IllegalArgumentException( + "Multiple events with identifier type " + idt + " and ID " + event.getIdentifier(idt) + " exist."); + } + } + return null; + } + + /** + * Find an event using the event Id + * + * @param eventId the if for the event + * @return an event matching the eventId + */ + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostAuthorize("hasPermission(returnObject,'Event', 'EVENT_VIEW')") + public Event findById(String eventId) { + try { + if (StringUtils.isEmpty(eventId)) { + return null; + } + return allEvents.findById(eventId); + } catch (Exception e) { + logger.error("", e); + } + return null; + } + + /** + * Find an event using an event Id or form Submission Id + * + * @param eventId the if for the event + * @param formSubmissionId form submission id for the events + * @return an event matching the eventId or formsubmission id + */ + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostAuthorize("hasPermission(returnObject,'Event', 'EVENT_VIEW')") + public Event findByIdOrFormSubmissionId(String eventId, String formSubmissionId) { + Event event = null; + try { + if (StringUtils.isNotEmpty(eventId)) { + event = findById(eventId); + } + if (event == null && StringUtils.isNotEmpty(formSubmissionId)) { + return allEvents.findByFormSubmissionId(formSubmissionId, true); + } + } catch (Exception e) { + logger.error("", e); + } + return event; + } + + @PreAuthorize("hasPermission(#event,'Event', 'EVENT_CREATE')") + public synchronized Event addEvent(Event event, String username) { + Event e = find(event); + if (e != null) { + throw new IllegalArgumentException( + "An event already exists with given list of identifiers. Consider updating data.[" + e + "]"); + } + + if (event.getFormSubmissionId() != null + && getByBaseEntityAndFormSubmissionId(event.getBaseEntityId(), event.getFormSubmissionId()) != null) { + throw new IllegalArgumentException( + "An event already exists with given baseEntity and formSubmission combination. Consider updating"); + } + + event.setDateCreated(DateTime.now()); + allEvents.add(event); + triggerPlanEvaluation(event, username); + return event; + } + + public synchronized Event addEventOutOfCatchment(Event event, String username) { + Event e = find(event); + if (e != null) { + throw new IllegalArgumentException( + "An event already exists with given list of identifiers. Consider updating data.[" + e + "]"); + } + + if (event.getFormSubmissionId() != null + && getByBaseEntityAndFormSubmissionId(event.getBaseEntityId(), event.getFormSubmissionId()) != null) { + throw new IllegalArgumentException( + "An event already exists with given baseEntity and formSubmission combination. Consider updating"); + } + + event.setDateCreated(DateTime.now()); + allEvents.add(event); + triggerPlanEvaluation(event, username); + return event; + } + + /** + * An out of area event is used to record services offered outside a client's catchment area. The + * event usually will have a client unique identifier(ZEIR_ID) as the only way to identify the + * client.This method finds the client based on the identifier and assigns a basentityid to the + * event + * + * @param event event to be processed + * @return event + */ + public synchronized Event processOutOfArea(Event event) { + try { + String programClientId = event.getDetails() != null + ? event.getDetails().getOrDefault("program_client_id", "") + : ""; + + String identifier = StringUtils.isBlank(event.getIdentifier(Client.ZEIR_ID)) + ? (StringUtils.isBlank(event.getIdentifier(OPENSRP_ID)) ? programClientId : event.getIdentifier(OPENSRP_ID)) + : event.getIdentifier(Client.ZEIR_ID); + + logger.info("Processing out of area event: baseEntityId=" + event.getBaseEntityId() + "; identifier=" + identifier); + + if (StringUtils.isNotBlank(event.getBaseEntityId()) || StringUtils.isBlank(identifier)) { + return event; + } + + List clients = identifier.startsWith(CARD_ID_PREFIX) + ? clientService.findAllByAttributeOutOfCatchment(NFC_CARD_IDENTIFIER, identifier.substring(CARD_ID_PREFIX.length())) + : getClientByIdentifierOutOfCatchment(identifier); + + if (clients == null || clients.isEmpty()) { + return event; + } + + for (org.smartregister.domain.Client client : clients) { + List existingEvents = findByBaseEntityAndTypeOutOfCatchment(client.getBaseEntityId(), BIRTH_REGISTRATION_EVENT); + + if (existingEvents == null || existingEvents.isEmpty()) { + return event; + } + Event birthRegEvent = existingEvents.get(0); + createOutOfCatchmentService(event, birthRegEvent); + } + } catch (Exception e) { + logger.error("Error processing out of catchment service", e); + } + + return event; + } + + private void createOutOfCatchmentService(Event event, Event birthRegEvent) { + if (event.getEventType() != null) { + //Remove identifier since entity id is present, also create new service with the right location and provider + String eventTypeLowercase = event.getEventType().toLowerCase(); + if ((event.getEventType().startsWith(EventConstants.OUT_OF_AREA_SERVICE) || event.getEventType() + .startsWith(EventConstants.NEW_OUT_OF_AREA_SERVICE))) { + + boolean hasGrowthMonitoring = + eventTypeLowercase.contains(EventConstants.GROWTH_MONITORING_EVENT.toLowerCase()) || + eventTypeLowercase.contains(EventConstants.GROWTH_MONITORING_EVENT_UNDERSCORED); + + if (hasGrowthMonitoring || eventTypeLowercase.contains(VACCINATION_EVENT.toLowerCase())) { + + String actualEventType = hasGrowthMonitoring ? GROWTH_MONITORING_EVENT : + eventTypeLowercase.contains(VACCINATION_EVENT.toLowerCase()) ? VACCINATION_EVENT : null; + + if (actualEventType != null) { + Event newEvent = getNewOutOfAreaServiceEvent(event, birthRegEvent, actualEventType); + addEventOutOfCatchment(newEvent, birthRegEvent.getProviderId()); + } + } else if (eventTypeLowercase.contains(RECURRING_SERVICE.toLowerCase()) || + eventTypeLowercase.contains(RECURRING_SERVICE_UNDERSCORED)) { + processOutOfAreaRecurringService(event, birthRegEvent); + } + } + } + } + + private void removeIdentifier(Event event) { + //Remove case sensitive identifiers + TreeMap newIdentifiers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); + newIdentifiers.putAll(event.getIdentifiers()); + newIdentifiers.remove(Client.ZEIR_ID); + newIdentifiers.remove(OPENSRP_ID); + event.setIdentifiers(newIdentifiers); + } + + private void processOutOfAreaRecurringService(Event event, Event birthRegEvent) { + //Get and sort previous recurring services related to the current + String recurringServiceTypes = event.getDetails().get(RECURRING_SERVICE_TYPES); + List outOfCatchmentServices = Arrays + .asList(recurringServiceTypes.substring(1, recurringServiceTypes.length() - 1).split(",")); + List previousServices = findByBaseEntityAndType(birthRegEvent.getBaseEntityId(), RECURRING_SERVICE); + Map> matchedRecurringServices = getMarchedRecurringServices(previousServices, + outOfCatchmentServices); + + //Create new recurring service event with correct sequence, incrementing on the old recurring service's + //Otherwise create first recurring service + for (String service : outOfCatchmentServices) { + + Event newEvent = getNewOutOfAreaServiceEvent(event, birthRegEvent, RECURRING_SERVICE); + newEvent.setEntityType(RECURRING_SERVICE_UNDERSCORED); + + //Check if there are any existing recurring services or create the first + List events = matchedRecurringServices.get(service); + if (!events.isEmpty()) { + Event lastRecurringService = events.get(events.size() - 1); + + Obs obsWithValue = getObsWithValue(lastRecurringService); + if (obsWithValue != null) { + int newVal = Integer.parseInt((String) obsWithValue.getValues().get(0)) + 1; + String newSequence = String.valueOf(newVal); + String newFormSubmissionField = String.format("%s_%s", service, newSequence); + List newObsList = updateObs(lastRecurringService, event, newSequence, newFormSubmissionField); + newEvent.setObs(newObsList); + addEvent(newEvent, birthRegEvent.getProviderId()); + } + } else { + createFirstRecurringService(service, newEvent, birthRegEvent); + } + } + } + + private void createFirstRecurringService(String service, Event newEvent, Event birthRegEvent) { + String submissionField = String.format("%s_%s", service, 1); + List values = Collections.singletonList(ObsConstants.CODED_FIELD_VALUE); + String codedFieldCode; + switch (service.trim()) { + case RecurringServiceConstants.DEWORMING: + codedFieldCode = ObsConstants.DEWORMING_CODED_FIELD_CODE; + break; + case RecurringServiceConstants.VIT_A: + codedFieldCode = ObsConstants.VIT_A_CODED_FIELD_CODE; + break; + case RecurringServiceConstants.ITN: + codedFieldCode = ObsConstants.ITN_CODED_FIELD_CODE; + break; + default: + codedFieldCode = submissionField; + break; + } + List obsList = new ArrayList<>(); + obsList.add(getServiceObs(submissionField, codedFieldCode, CODED, values, Collections.singletonList( + EventConstants.YES))); + obsList.add(getServiceObs(submissionField + _DOSE, ObsConstants.NUMERIC_FIELD_CODE, NUMERIC, + Collections.singletonList(String.valueOf(1)), Collections.emptyList())); + + if (service.equalsIgnoreCase(RecurringServiceConstants.ITN)) { + obsList.add(getServiceObs(submissionField + _DATE, ObsConstants.ITN_DATE_FIELD_CODE, DATE, + Collections.singletonList(newEvent.getEventDate()), Collections.emptyList())); + } + + newEvent.setObs(obsList); + newEvent.setEntityType(RECURRING_SERVICE_UNDERSCORED); + addEvent(newEvent, birthRegEvent.getProviderId()); + } + + public Obs getServiceObs(String submissionField, String fieldCode, String fieldDataType, List values, + List humanReadableValues) { + Obs obs = new Obs() + .withFormSubmissionField(submissionField) + .withFieldDataType(fieldDataType) + .withFieldType(CONCEPT) + .withFieldCode(fieldCode) + .withValues(values); + obs.setHumanReadableValues(humanReadableValues); + return obs; + } + + private List updateObs(Event lastRecurringService, Event incomingEvent, String newSequence, + String newFormSubmissionField) { + List newObsList = new ArrayList<>(); + for (Obs oldObs : lastRecurringService.getObs()) { + if (oldObs.getFieldDataType().equalsIgnoreCase(NUMERIC)) { + oldObs.setFormSubmissionField(newFormSubmissionField + _DOSE); + oldObs.getValues().clear(); + oldObs.getValues().add(newSequence); + } else if (oldObs.getFieldDataType().equalsIgnoreCase(DATE)) { + oldObs.setFormSubmissionField(newFormSubmissionField + _DATE); + oldObs.getValues().clear(); + oldObs.getValues().add(simpleDateFormat.format(incomingEvent.getEventDate())); + } else if (oldObs.getFieldDataType().equalsIgnoreCase(CODED)) { + oldObs.setFormSubmissionField(newFormSubmissionField); + } + newObsList.add(oldObs); + } + return newObsList; + } + + public Obs getObsWithValue(Event event) { + if (event != null) { + for (Obs obs : event.getObs()) { + if (obs.getFieldDataType().equalsIgnoreCase(NUMERIC) && obs.getFormSubmissionField().contains(DOSE) + && !obs.getValues().isEmpty()) { + return obs; + } + } + } + return null; + } + + private Map> getMarchedRecurringServices(List previousServices, + List outOfCatchmentServices) { + Map> marchedServices = new TreeMap<>(); + for (String service : outOfCatchmentServices) { + List serviceEvents = previousServices.stream().filter(event -> { + Obs obs = getObsWithValue(event); + if (obs == null) { + return false; + } + return obs.getFormSubmissionField().startsWith(service.trim()); + }).sorted((event1, event2) -> { + int value1 = Integer.parseInt((String) getObsWithValue(event1).getValues().get(0)); + int value2 = Integer.parseInt((String) getObsWithValue(event2).getValues().get(0)); + return Integer.compare(value1, value2); + }).collect(Collectors.toList()); + marchedServices.put(service, serviceEvents); + } + + return marchedServices; + } + + private Event getNewOutOfAreaServiceEvent(Event event, Event birthRegEvent, String eventType) { + String eventId = event.getBaseEntityId(); + if (StringUtils.isEmpty(eventId)) { + eventId = birthRegEvent.getBaseEntityId(); + } + + event.setBaseEntityId(birthRegEvent.getBaseEntityId()); + removeIdentifier(event); //Remove identifier from the old event first because entity id is found + Event newEvent = new Event(); + newEvent.withBaseEntityId(eventId) + .withEventType(eventType) + .withEventDate(event.getEventDate()) + .withEntityType(event.getEntityType()) + .withProviderId(birthRegEvent.getProviderId()) + .withLocationId(birthRegEvent.getLocationId()) + .withChildLocationId(birthRegEvent.getChildLocationId()) + .withFormSubmissionId(UUID.randomUUID().toString()) + .withDateCreated(event.getDateCreated()); + Map details = new HashMap<>(); + details.put(OUT_OF_CATCHMENT_PROVIDER_ID, event.getProviderId()); + newEvent.setDetails(details); + newEvent.setObs(event.getObs()); + newEvent.setTeam(birthRegEvent.getTeam()); + newEvent.setTeamId(birthRegEvent.getTeamId()); + newEvent.setIdentifiers(event.getIdentifiers()); + return newEvent; + } + + private List getClientByIdentifier(String identifier) { + List clients = clientService.findAllByIdentifier(Client.ZEIR_ID, identifier); + if (clients != null && clients.isEmpty()) { + clients = clientService.findAllByIdentifier(Client.ZEIR_ID.toUpperCase(), identifier); + } + return clients; + } + + private List getClientByIdentifierOutOfCatchment(String identifier) { + List clients = clientService.findAllByIdentifierOutOfCatchment(Client.ZEIR_ID, identifier); + if (clients != null && clients.isEmpty()) { + clients = clientService.findAllByIdentifierOutOfCatchment(Client.ZEIR_ID.toUpperCase(), identifier); + } + return clients; + } + + @PreAuthorize("(hasPermission(#event,'Event', 'EVENT_CREATE') and hasPermission(#event,'Event', 'EVENT_UPDATE'))" + + " or (hasRole('EVENT_OUT_OF_CATCHMENT_CREATE') or hasRole('EVENT_OUT_OF_CATCHMENT_UPDATE'))") + public synchronized Event addorUpdateEvent(Event event, String username) { + Event existingEvent = findByIdOrFormSubmissionId(event.getId(), event.getFormSubmissionId()); + if (existingEvent != null) { + event.setId(existingEvent.getId()); + event.setRevision(existingEvent.getRevision()); + event.setDateEdited(DateTime.now()); + event.setRevision(existingEvent.getRevision()); + allEvents.update(event); + + } else { + event.setDateCreated(DateTime.now()); + allEvents.add(event); + + } + + triggerPlanEvaluation(event, username); + + return event; + } + + @PreAuthorize("hasPermission(#updatedEvent,'Event', 'EVENT_UPDATE')") + public void updateEvent(Event updatedEvent, String username) { + // If update is on original entity + if (updatedEvent.isNew()) { + throw new IllegalArgumentException( + "Event to be updated is not an existing and persisting domain object. Update database object instead of new pojo"); + } + + updatedEvent.setDateEdited(DateTime.now()); + allEvents.update(updatedEvent); + triggerPlanEvaluation(updatedEvent, username); + } + + //TODO Review and add test cases as well + @PreAuthorize("hasPermission(#updatedEvent,'Event', 'EVENT_UPDATE')") + public Event mergeEvent(Event updatedEvent) { + try { + Event original = find(updatedEvent); + if (original == null) { + throw new IllegalArgumentException("No event found with given list of identifiers. Consider adding new!"); + } + + original = (Event) Utils.getMergedJSON(original, updatedEvent, Arrays.asList(Event.class.getDeclaredFields()), + Event.class); + for (Obs o : updatedEvent.getObs()) { + // TODO handle parent + if (original.getObs(null, o.getFieldCode()) == null) { + original.addObs(o); + } else { + original.getObs(null, o.getFieldCode()).setComments(o.getComments()); + original.getObs(null, o.getFieldCode()).setEffectiveDatetime(o.getEffectiveDatetime()); + original.getObs(null, o.getFieldCode()) + .setValue(o.getValues().size() < 2 ? o.getValue() : o.getValues()); + } + } + for (String k : updatedEvent.getIdentifiers().keySet()) { + original.addIdentifier(k, updatedEvent.getIdentifier(k)); + } + + original.setDateEdited(DateTime.now()); + allEvents.update(original); + return original; + } catch (JSONException | JsonProcessingException | SecurityException e) { + throw new RuntimeException(e); + } + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") + public List findByServerVersion(long serverVersion) { + return allEvents.findByServerVersion(serverVersion); + } + + public List findByServerVersionOutOfCatchment(long serverVersion) { + return allEvents.findByServerVersion(serverVersion); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") + public List notInOpenMRSByServerVersion(long serverVersion, Calendar calendar) { + return allEvents.notInOpenMRSByServerVersion(serverVersion, calendar); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") + public List notInOpenMRSByServerVersionAndType(String type, long serverVersion, Calendar calendar) { + return allEvents.notInOpenMRSByServerVersionAndType(type, serverVersion, calendar); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") + public List getAll() { + return allEvents.getAll(); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasRole('EVENT_VIEW_GLOBAL') or hasPermission(filterObject, 'EVENT_VIEW')") + public List findEvents(EventSearchBean eventSearchBean, String sortBy, String sortOrder, int limit) { + return allEvents.findEvents(eventSearchBean, sortBy, sortOrder, limit); + } + + @PreAuthorize("hasRole('EVENT_VIEW') or hasRole('EVENT_OUT_OF_CATCHMENT_VIEW')") + public List findOutOfCatchmentEvents(EventSearchBean eventSearchBean, String sortBy, String sortOrder, int limit) { + return allEvents.findEvents(eventSearchBean, sortBy, sortOrder, limit); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") + public List findEvents(EventSearchBean eventSearchBean) { + return allEvents.findEvents(eventSearchBean); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") + public List findEventsByConceptAndValue(String concept, String conceptValue) { + return allEvents.findByConceptAndValue(concept, conceptValue); + + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") + public List findByBaseEntityAndType(String baseEntityId, String eventType) { + return allEvents.findByBaseEntityAndType(baseEntityId, eventType); + } + + public List findByBaseEntityAndTypeOutOfCatchment(String baseEntityId, String eventType) { + return allEvents.findByBaseEntityAndType(baseEntityId, eventType); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") + private Event getUniqueEventFromEventList(List events) throws IllegalArgumentException { + if (events.size() > 1) { + throw new IllegalArgumentException(); + } + if (events.size() == 0) { + return null; + } + return events.get(0); + } + + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") + public List findByProviderAndEntityType(String provider) { + return allEvents.findByProvider(provider); + } + + /** + * This method searches for event ids filtered by eventType and the date they were deleted + * + * @param eventType used to filter the event ids + * @param isDeleted whether to return deleted event ids + * @param serverVersion incremental server version + * @param limit upper limit on number of tasks ids to fetch + * @return a list of event ids + */ + @PreAuthorize("hasRole('EVENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'EVENT_VIEW')") + public Pair, Long> findAllIdsByEventType(String eventType, boolean isDeleted, Long serverVersion, + int limit) { + return allEvents.findIdsByEventType(eventType, isDeleted, serverVersion, limit); + } + + /** + * overrides {@link #findAllIdsByEventType(String, boolean, Long, int)} by adding date filters + * + * @param eventType + * @param isDeleted + * @param serverVersion + * @param limit + * @param fromDate + * @param toDate + * @return + */ + public Pair, Long> findAllIdsByEventType(String eventType, boolean isDeleted, Long serverVersion, int limit, + Date fromDate, Date toDate) { + return allEvents.findIdsByEventType(eventType, isDeleted, serverVersion, limit, fromDate, toDate); + } + + /** + * This method is used to return a count of events based on the provided parameters + * + * @param eventSearchBean object containing params to search by + * @return returns a count of events matching the passed parameters + */ + public Long countEvents(EventSearchBean eventSearchBean) { + return allEvents.countEvents(eventSearchBean); + } + + /** + * This method is similar to {@link #findEventsByConceptAndValue(String, String)}. This method however does not enforce ACL + * so that users can search events globally and not just those within their jurisdiction. + */ + public List findGlobalEventsByConceptAndValue(String concept, String conceptValue) { + return allEvents.findByConceptAndValue(concept, conceptValue); + } + + private void triggerPlanEvaluation(Event event, String username) { + String planIdentifier = event.getDetails() != null ? event.getDetails().get(EventConstants.PLAN_IDENTIFIER) : null; + if (isPlanEvaluationEnabled && planIdentifier != null) { + PlanDefinition plan = planRepository.get(planIdentifier); + if (plan != null && plan.getStatus().equals(PlanDefinition.PlanStatus.ACTIVE) && ( + plan.getEffectivePeriod().getEnd() == null + || plan.getEffectivePeriod().getEnd().isAfter(LocalDate.now().toDateTimeAtStartOfDay()))) + taskGenerator.processPlanEvaluation(plan, username, event); + } + } + + public ExportEventDataSummary exportEventData(String planIdentifier, String eventType, Date fromDate, Date toDate) + throws JsonProcessingException { + List pgEvents = allEvents + .getEventData(planIdentifier, eventType, fromDate, toDate); + ExportEventDataSummary exportEventDataSummary = new ExportEventDataSummary(); + List> allRows = new ArrayList<>(); + boolean returnHeader = true; + Map columnNamesAndLabels = exportEventDataMapper.getColumnNamesAndLabelsByEventType(eventType); + boolean settingsExist = columnNamesAndLabels != null && columnNamesAndLabels.size() > 0; + + if (settingsExist) { + allRows.add(exportEventDataMapper + .getExportEventDataAfterMapping(null, eventType, returnHeader, settingsExist)); //for header row + } + + //Assumption : All pgEvents would have similar obs fields to include as a header + else { + if (exportEventDataMapper.getExportEventDataAfterMapping( + pgEvents.size() > 0 ? pgEvents.get(0).getJson() : "", eventType, returnHeader, settingsExist) != null) + allRows.add(exportEventDataMapper.getExportEventDataAfterMapping( + pgEvents.size() > 0 ? pgEvents.get(0).getJson() : "", eventType, returnHeader, + settingsExist)); //for header row + } + + for (org.opensrp.domain.postgres.Event pgEvent : pgEvents) { + allRows.add(exportEventDataMapper + .getExportEventDataAfterMapping(pgEvent.getJson(), eventType, false, settingsExist)); + } + + exportEventDataSummary.setRowsData(allRows); + + PlanDefinition plan = planIdentifier != null ? planRepository.get(planIdentifier) : null; + if (plan != null) + exportEventDataSummary.setMissionName(plan.getName()); + return exportEventDataSummary; + } + + public ExportImagesSummary getImagesMetadataForFlagProblemEvent(String planIdentifier, String eventType, Date fromDate, + Date toDate) throws JsonProcessingException { + List pgEvents = allEvents + .getEventData(planIdentifier, eventType, fromDate, toDate); + + Set servicePoints = new HashSet<>(); + String servicePointName; + ExportImagesSummary exportImagesSummary = new ExportImagesSummary(); + ExportFlagProblemEventImageMetadata exportFlagProblemEventImageMetadata; + List exportFlagProblemEventImageMetadataList = new ArrayList<>(); + for (org.opensrp.domain.postgres.Event pgEvent : pgEvents) { + exportFlagProblemEventImageMetadata = exportEventDataMapper + .getFlagProblemEventImagesMetadata(pgEvent.getJson(), "$.baseEntityId", + "$.details.locationName", "$.details.productName"); + if (exportFlagProblemEventImageMetadata != null) { + exportFlagProblemEventImageMetadataList.add(exportFlagProblemEventImageMetadata); + servicePointName = exportFlagProblemEventImageMetadata.getServicePointName(); + if (servicePointName != null && !servicePoints.contains(servicePointName)) { + servicePoints.add(servicePointName); + } + } + } + + exportImagesSummary.setExportFlagProblemEventImageMetadataList(exportFlagProblemEventImageMetadataList); + exportImagesSummary.setServicePoints(servicePoints); + return exportImagesSummary; + + } } diff --git a/src/main/java/org/opensrp/service/ExportEventDataMapper.java b/src/main/java/org/opensrp/service/ExportEventDataMapper.java index 87ceed238..da454c4c0 100644 --- a/src/main/java/org/opensrp/service/ExportEventDataMapper.java +++ b/src/main/java/org/opensrp/service/ExportEventDataMapper.java @@ -28,172 +28,165 @@ @Component public class ExportEventDataMapper { - @Autowired - private SettingService settingService; - - private ObjectMapper objectMapper = BaseTypeHandler.createObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false); - - - private static Logger logger = LogManager.getLogger(ExportEventDataMapper.class.toString()); - - public List getExportEventDataAfterMapping(Object jsonObject, String eventType, boolean returnHeader, - boolean isSettingsExists) throws JsonProcessingException { - Map columnNamesAndLabels = getColumnNamesAndLabelsByEventType(eventType); - - String json = ""; - if (jsonObject != null && !jsonObject.equals("")) { - json = objectMapper.writeValueAsString(jsonObject); - } - - List headerData = new ArrayList<>(); - List rowData = new ArrayList<>(); - if (columnNamesAndLabels != null && columnNamesAndLabels.size() > 0 && returnHeader && isSettingsExists) { - for (Map.Entry columnNameAndLabel : columnNamesAndLabels.entrySet()) { - headerData.add(columnNameAndLabel.getKey()); - } - return headerData; - } else if (columnNamesAndLabels != null && !returnHeader && isSettingsExists) { - for (Map.Entry columnNameAndLabel : columnNamesAndLabels.entrySet()) { - try { - Object fieldValue = JsonPath.read(json, columnNameAndLabel.getValue()); - rowData.add(fieldValue); - } - catch (JsonPathException jsonPathException) { - logger.error("Key does not exists ", jsonPathException.getMessage()); - rowData.add(null); - } - } - return rowData; - } else if (columnNamesAndLabels != null && !returnHeader && !isSettingsExists) { - Event event = null; - if(!json.equals("")) { - event = objectMapper.readValue(json, Event.class); - for (Obs obs : event.getObs()) { - Object fieldValue = obs.getValues(); - rowData.add(fieldValue); - } - return rowData; - } - return null; - } else { //for header without settings configurations - Event event = null; - if (!json.equals("")) { - event = objectMapper.readValue(json, Event.class); - for (Obs obs : event.getObs()) { - Object fieldValue = obs.getFormSubmissionField() != null ? obs.getFormSubmissionField() : obs.getFieldCode(); - rowData.add(fieldValue); - } - return rowData; - } - return null; - } - } - - public ExportFlagProblemEventImageMetadata getFlagProblemEventImagesMetadata(Object jsonObject, String stockIdExpression, - String servicePointNameExpression, String productNameExpression) throws JsonProcessingException { - String json = ""; - ExportFlagProblemEventImageMetadata exportFlagProblemEventImageMetadata = new ExportFlagProblemEventImageMetadata(); - if (jsonObject != null) { - json = objectMapper.writeValueAsString(jsonObject); - } - JSONObject eventJsonObject = new JSONObject(json); - if (checkIfImageExists(eventJsonObject)) { - String stockId = ""; - String servicePointName = ""; - String productName = ""; - Object fieldValue; - try { - fieldValue = JsonPath.read(json, stockIdExpression); - stockId = (String) fieldValue; - exportFlagProblemEventImageMetadata.setStockId(stockId); - } - catch (JsonPathException jsonPathException) { - logger.error("Key does not exist" + jsonPathException.getMessage()); - } - - try { - fieldValue = JsonPath.read(json, servicePointNameExpression); - servicePointName = (String) fieldValue; - exportFlagProblemEventImageMetadata.setServicePointName(servicePointName); - } - catch (JsonPathException jsonPathException) { - logger.error("Key does not exist" + jsonPathException.getMessage()); - } - - try { - fieldValue = JsonPath.read(json, productNameExpression); - productName = (String) fieldValue; - exportFlagProblemEventImageMetadata.setProductName(productName); - } - catch (JsonPathException jsonPathException) { - logger.error("Key does not exist" + jsonPathException.getMessage()); - } - - return exportFlagProblemEventImageMetadata; - } - return null; - - } - - public Map getColumnNamesAndLabelsByEventType(String eventType) { - - String settingsConfigurationIdentifier = getSettingsConfigurationIdentifierByEventType(eventType); - - Map columnsLabelsAndKeys = new LinkedHashMap<>(); - List settingsAndSettingsMetadataJoinedList = settingService - .findSettingsByIdentifier(settingsConfigurationIdentifier); - - if (settingsAndSettingsMetadataJoinedList != null) { - for (SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined : settingsAndSettingsMetadataJoinedList) { - if (settingsAndSettingsMetadataJoined.getSettingsMetadata() != null - && settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingKey() != null - && settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingLabel() != null) { - columnsLabelsAndKeys.put(settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingLabel(), - settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingKey()); - } - } - } - return columnsLabelsAndKeys; - } - - private String getSettingsConfigurationIdentifierByEventType(String eventType) { - - Map eventTypeToSettingsConfigurationsIdentifier = new HashMap<>(); - List settingsAndSettingsMetadataJoinedList = settingService - .findSettingsByIdentifier(SETTINGS_CONFIGURATION_EVENT_TYPE_TO_SETTINGS_IDENTIFIER); - - if (settingsAndSettingsMetadataJoinedList != null) { - for (SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined : settingsAndSettingsMetadataJoinedList) { - if (settingsAndSettingsMetadataJoined.getSettingsMetadata() != null - && settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingKey() != null - && settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingValue() != null) { - eventTypeToSettingsConfigurationsIdentifier - .put(settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingKey(), - settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingValue()); - } - } - } - - if (eventTypeToSettingsConfigurationsIdentifier != null && eventTypeToSettingsConfigurationsIdentifier.size() > 0) { - return eventTypeToSettingsConfigurationsIdentifier.get(eventType); - } - return null; - } - - private boolean checkIfImageExists(JSONObject jsonObject) { - JSONArray obsArray = jsonObject.optJSONArray(OBS); - JSONObject properties; - if (obsArray != null) { - for (int i = 0; i < obsArray.length(); i++) { - if (obsArray.get(i) != null) { - properties = (JSONObject) obsArray.get(i); - if (properties.has(FORM_SUBMISSION_FIELD) && (properties.get(FORM_SUBMISSION_FIELD).equals(NOT_GOOD) || - properties.get(FORM_SUBMISSION_FIELD).equals(MISUSE))) { - return true; - } - } - } - } - return false; - } + private static Logger logger = LogManager.getLogger(ExportEventDataMapper.class.toString()); + @Autowired + private SettingService settingService; + private ObjectMapper objectMapper = BaseTypeHandler.createObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + public List getExportEventDataAfterMapping(Object jsonObject, String eventType, boolean returnHeader, + boolean isSettingsExists) throws JsonProcessingException { + Map columnNamesAndLabels = getColumnNamesAndLabelsByEventType(eventType); + + String json = ""; + if (jsonObject != null && !jsonObject.equals("")) { + json = objectMapper.writeValueAsString(jsonObject); + } + + List headerData = new ArrayList<>(); + List rowData = new ArrayList<>(); + if (columnNamesAndLabels != null && columnNamesAndLabels.size() > 0 && returnHeader && isSettingsExists) { + for (Map.Entry columnNameAndLabel : columnNamesAndLabels.entrySet()) { + headerData.add(columnNameAndLabel.getKey()); + } + return headerData; + } else if (columnNamesAndLabels != null && !returnHeader && isSettingsExists) { + for (Map.Entry columnNameAndLabel : columnNamesAndLabels.entrySet()) { + try { + Object fieldValue = JsonPath.read(json, columnNameAndLabel.getValue()); + rowData.add(fieldValue); + } catch (JsonPathException jsonPathException) { + logger.error("Key does not exists ", jsonPathException.getMessage()); + rowData.add(null); + } + } + return rowData; + } else if (columnNamesAndLabels != null && !returnHeader && !isSettingsExists) { + Event event = null; + if (!json.equals("")) { + event = objectMapper.readValue(json, Event.class); + for (Obs obs : event.getObs()) { + Object fieldValue = obs.getValues(); + rowData.add(fieldValue); + } + return rowData; + } + return null; + } else { //for header without settings configurations + Event event = null; + if (!json.equals("")) { + event = objectMapper.readValue(json, Event.class); + for (Obs obs : event.getObs()) { + Object fieldValue = obs.getFormSubmissionField() != null ? obs.getFormSubmissionField() : obs.getFieldCode(); + rowData.add(fieldValue); + } + return rowData; + } + return null; + } + } + + public ExportFlagProblemEventImageMetadata getFlagProblemEventImagesMetadata(Object jsonObject, String stockIdExpression, + String servicePointNameExpression, String productNameExpression) throws JsonProcessingException { + String json = ""; + ExportFlagProblemEventImageMetadata exportFlagProblemEventImageMetadata = new ExportFlagProblemEventImageMetadata(); + if (jsonObject != null) { + json = objectMapper.writeValueAsString(jsonObject); + } + JSONObject eventJsonObject = new JSONObject(json); + if (checkIfImageExists(eventJsonObject)) { + String stockId = ""; + String servicePointName = ""; + String productName = ""; + Object fieldValue; + try { + fieldValue = JsonPath.read(json, stockIdExpression); + stockId = (String) fieldValue; + exportFlagProblemEventImageMetadata.setStockId(stockId); + } catch (JsonPathException jsonPathException) { + logger.error("Key does not exist" + jsonPathException.getMessage()); + } + + try { + fieldValue = JsonPath.read(json, servicePointNameExpression); + servicePointName = (String) fieldValue; + exportFlagProblemEventImageMetadata.setServicePointName(servicePointName); + } catch (JsonPathException jsonPathException) { + logger.error("Key does not exist" + jsonPathException.getMessage()); + } + + try { + fieldValue = JsonPath.read(json, productNameExpression); + productName = (String) fieldValue; + exportFlagProblemEventImageMetadata.setProductName(productName); + } catch (JsonPathException jsonPathException) { + logger.error("Key does not exist" + jsonPathException.getMessage()); + } + + return exportFlagProblemEventImageMetadata; + } + return null; + + } + + public Map getColumnNamesAndLabelsByEventType(String eventType) { + + String settingsConfigurationIdentifier = getSettingsConfigurationIdentifierByEventType(eventType); + + Map columnsLabelsAndKeys = new LinkedHashMap<>(); + List settingsAndSettingsMetadataJoinedList = settingService + .findSettingsByIdentifier(settingsConfigurationIdentifier); + + if (settingsAndSettingsMetadataJoinedList != null) { + for (SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined : settingsAndSettingsMetadataJoinedList) { + if (settingsAndSettingsMetadataJoined.getSettingsMetadata() != null + && settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingKey() != null + && settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingLabel() != null) { + columnsLabelsAndKeys.put(settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingLabel(), + settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingKey()); + } + } + } + return columnsLabelsAndKeys; + } + + private String getSettingsConfigurationIdentifierByEventType(String eventType) { + + Map eventTypeToSettingsConfigurationsIdentifier = new HashMap<>(); + List settingsAndSettingsMetadataJoinedList = settingService + .findSettingsByIdentifier(SETTINGS_CONFIGURATION_EVENT_TYPE_TO_SETTINGS_IDENTIFIER); + + if (settingsAndSettingsMetadataJoinedList != null) { + for (SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined : settingsAndSettingsMetadataJoinedList) { + if (settingsAndSettingsMetadataJoined.getSettingsMetadata() != null + && settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingKey() != null + && settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingValue() != null) { + eventTypeToSettingsConfigurationsIdentifier + .put(settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingKey(), + settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingValue()); + } + } + } + + if (eventTypeToSettingsConfigurationsIdentifier != null && eventTypeToSettingsConfigurationsIdentifier.size() > 0) { + return eventTypeToSettingsConfigurationsIdentifier.get(eventType); + } + return null; + } + + private boolean checkIfImageExists(JSONObject jsonObject) { + JSONArray obsArray = jsonObject.optJSONArray(OBS); + JSONObject properties; + if (obsArray != null) { + for (int i = 0; i < obsArray.length(); i++) { + if (obsArray.get(i) != null) { + properties = (JSONObject) obsArray.get(i); + if (properties.has(FORM_SUBMISSION_FIELD) && (properties.get(FORM_SUBMISSION_FIELD).equals(NOT_GOOD) || + properties.get(FORM_SUBMISSION_FIELD).equals(MISUSE))) { + return true; + } + } + } + } + return false; + } } diff --git a/src/main/java/org/opensrp/service/IdentifierSourceService.java b/src/main/java/org/opensrp/service/IdentifierSourceService.java index 13be69f0f..489054444 100644 --- a/src/main/java/org/opensrp/service/IdentifierSourceService.java +++ b/src/main/java/org/opensrp/service/IdentifierSourceService.java @@ -14,63 +14,62 @@ @Service public class IdentifierSourceService { - private IdentifierSourceRepository identifierSourceRepository; + private static Logger logger = LogManager.getLogger(IdentifierSourceService.class.toString()); + private IdentifierSourceRepository identifierSourceRepository; - private static Logger logger = LogManager.getLogger(IdentifierSourceService.class.toString()); + @Autowired + public IdentifierSourceService(IdentifierSourceRepository identifierSourceRepository) { + this.identifierSourceRepository = identifierSourceRepository; + } - @Autowired - public IdentifierSourceService(IdentifierSourceRepository identifierSourceRepository) { - this.identifierSourceRepository = identifierSourceRepository; - } + @PreAuthorize("hasRole('IDENTIFIERSOURCE_VIEW')") + public List findAllIdentifierSources() { + return identifierSourceRepository.getAll(); + } - @PreAuthorize("hasRole('IDENTIFIERSOURCE_VIEW')") - public List findAllIdentifierSources() { - return identifierSourceRepository.getAll(); - } + @PreAuthorize("hasRole('IDENTIFIERSOURCE_VIEW')") + public IdentifierSource findByIdentifier(String identifier) { + return identifierSourceRepository.findByIdentifier(identifier); + } - @PreAuthorize("hasRole('IDENTIFIERSOURCE_VIEW')") - public IdentifierSource findByIdentifier(String identifier) { - return identifierSourceRepository.findByIdentifier(identifier); - } + @PreAuthorize("hasRole('IDENTIFIERSOURCE_CREATE')") + public void add(IdentifierSource identifierSource) { + validateFields(identifierSource); + identifierSourceRepository.add(identifierSource); + } - @PreAuthorize("hasRole('IDENTIFIERSOURCE_CREATE')") - public void add(IdentifierSource identifierSource) { - validateFields(identifierSource); - identifierSourceRepository.add(identifierSource); - } + @PreAuthorize("hasRole('IDENTIFIERSOURCE_UPDATE')") + public void update(IdentifierSource identifierSource) { + validateFields(identifierSource); + IdentifierSource idSource = findByIdentifier(identifierSource.getIdentifier()); + if (idSource == null) { + return; + } + identifierSource.setSequenceValue(idSource.getSequenceValue()); + identifierSourceRepository.update(identifierSource); + } - @PreAuthorize("hasRole('IDENTIFIERSOURCE_UPDATE')") - public void update(IdentifierSource identifierSource) { - validateFields(identifierSource); - IdentifierSource idSource = findByIdentifier(identifierSource.getIdentifier()); - if (idSource == null) { - return; - } - identifierSource.setSequenceValue(idSource.getSequenceValue()); - identifierSourceRepository.update(identifierSource); - } + public void saveSequenceValue(IdentifierSource identifierSource, Long sequenceValue) { + identifierSourceRepository.updateIdSourceWithSequenceValue(identifierSource, sequenceValue); + } - public void saveSequenceValue(IdentifierSource identifierSource, Long sequenceValue) { - identifierSourceRepository.updateIdSourceWithSequenceValue(identifierSource,sequenceValue); - } - - private void validateFields(IdentifierSource identifierSource) { - if (StringUtils.isBlank(identifierSource.getIdentifier())) { - throw new IllegalArgumentException("Identifier value was not specified"); - } else if (StringUtils.isBlank(identifierSource.getBaseCharacterSet())) { - throw new IllegalArgumentException("Base character set was not specified"); - } else if (identifierSource.getMinLength() == null || identifierSource.getMinLength() == 0) { - throw new IllegalArgumentException("Minimum length was not specified"); - } else if (identifierSource.getMaxLength() == null || identifierSource.getMaxLength() == 0) { - throw new IllegalArgumentException("Maximum length was not specified"); - } else if (!(identifierSource.getMinLength() >= 4 && identifierSource.getMinLength() <= 16)) { - throw new IllegalArgumentException("Minimum length was invalid"); - } else if (!(identifierSource.getMaxLength() >= 4 && identifierSource.getMaxLength() <= 16 - && identifierSource.getMaxLength() >= identifierSource.getMinLength())) { - throw new IllegalArgumentException("Maximum length was invalid"); - } else { - logger.info("All validations on fields passed"); - } - } + private void validateFields(IdentifierSource identifierSource) { + if (StringUtils.isBlank(identifierSource.getIdentifier())) { + throw new IllegalArgumentException("Identifier value was not specified"); + } else if (StringUtils.isBlank(identifierSource.getBaseCharacterSet())) { + throw new IllegalArgumentException("Base character set was not specified"); + } else if (identifierSource.getMinLength() == null || identifierSource.getMinLength() == 0) { + throw new IllegalArgumentException("Minimum length was not specified"); + } else if (identifierSource.getMaxLength() == null || identifierSource.getMaxLength() == 0) { + throw new IllegalArgumentException("Maximum length was not specified"); + } else if (!(identifierSource.getMinLength() >= 4 && identifierSource.getMinLength() <= 16)) { + throw new IllegalArgumentException("Minimum length was invalid"); + } else if (!(identifierSource.getMaxLength() >= 4 && identifierSource.getMaxLength() <= 16 + && identifierSource.getMaxLength() >= identifierSource.getMinLength())) { + throw new IllegalArgumentException("Maximum length was invalid"); + } else { + logger.info("All validations on fields passed"); + } + } } diff --git a/src/main/java/org/opensrp/service/ImportBulkDataService.java b/src/main/java/org/opensrp/service/ImportBulkDataService.java index 2102d9274..a468fa425 100644 --- a/src/main/java/org/opensrp/service/ImportBulkDataService.java +++ b/src/main/java/org/opensrp/service/ImportBulkDataService.java @@ -19,268 +19,253 @@ @Service public class ImportBulkDataService { - @Autowired - private OrganizationService organizationService; - - @Autowired - private PractitionerService practitionerService; - - @Autowired - private PractitionerRoleService practitionerRoleService; - - @Autowired - private PhysicalLocationService physicalLocationService; - - private static Logger logger = LogManager.getLogger(ImportBulkDataService.class.toString()); - - private static final String LOCATION_ID_KEY = "Location Id"; - - private static final String LOCATION_NAME_KEY = "Location Name"; - - private static final String ORGANIZATION_NAME_KEY = "Organization Name"; - - private static final String PLAN_ID_KEY = "Plan Id"; - - private static final String ORGANIZATION_ID_KEY = "Organization Id"; - - private static final String USER_ID_KEY = "User Id"; - - private static final String USER_NAME_KEY = "User Name"; - - private static final String NAME_KEY = "Name"; - - private static final String ROLE_KEY = "Role"; - - public CsvBulkImportDataSummary convertandPersistOrganizationdata(List> csvOrganizations) { - - CsvBulkImportDataSummary csvBulkImportDataSummary = new CsvBulkImportDataSummary(); - Integer rowsProcessed = 0; - Integer rowsInCsv = csvOrganizations.size(); - csvBulkImportDataSummary.setNumberOfCsvRows(rowsInCsv); - Integer rowCount = 0; - List failedRecordSummaries = new ArrayList<>(); - FailedRecordSummary failedRecordSummary; - - Organization organization; - String organizationIdentifier; - CodeSystem type; - List codes; - Code code; - - String locationId = ""; - String planId = ""; - String organizationName = ""; - Organization existingOrganization; - try { - for (Map csvdata : csvOrganizations) { - rowCount++; - - if (validateLocationData(csvdata)) { - organization = new Organization(); - organizationIdentifier = UUID.randomUUID().toString(); - organization.setIdentifier(organizationIdentifier); - type = new CodeSystem(); - codes = new ArrayList<>(); - code = new Code(); - code.setSystem("http://terminology.hl7.org/CodeSystem/organization-type"); - code.setCode("team"); - code.setDisplay("Team"); - codes.add(code); - type.setCoding(codes); - - organization.setType(type); - organization.setActive(Boolean.TRUE); - - organizationName = getValueFromMap(ORGANIZATION_NAME_KEY, csvdata); - organization.setName(organizationName); - - locationId = getValueFromMap(LOCATION_ID_KEY, csvdata); - - planId = getValueFromMap(PLAN_ID_KEY, csvdata); - existingOrganization = organizationService.findOrganizationByName(organizationName); - if (existingOrganization == null) { - organizationService.addOrganization(organization); // as it can not be edited - }else { - organizationIdentifier=existingOrganization.getIdentifier(); - } - organizationService - .assignLocationAndPlan(organizationIdentifier, locationId, planId, new Date(), - null); //handles update case as well - rowsProcessed++; - } else { - failedRecordSummary = getFailedRecordSummaryObject(rowCount, - "Validation failed, provided location name mismatches with the system"); - failedRecordSummaries.add(failedRecordSummary); - } - } - } - catch (Exception e) { - logger.error("Exception occurred while persisting organization and assignment data : " + e.getMessage(), e); - failedRecordSummary = getFailedRecordSummaryObject(rowCount, "Unknown error occurred"); - failedRecordSummaries.add(failedRecordSummary); - } - - csvBulkImportDataSummary.setNumberOfRowsProcessed(rowsProcessed); - csvBulkImportDataSummary.setFailedRecordSummaryList(failedRecordSummaries); - return csvBulkImportDataSummary; - - } - - public CsvBulkImportDataSummary convertandPersistPractitionerdata(List> csvOrganizations) { - - CsvBulkImportDataSummary csvBulkImportDataSummary = new CsvBulkImportDataSummary(); - Integer rowsProcessed = 0; - Integer rowsInCsv = csvOrganizations.size(); - csvBulkImportDataSummary.setNumberOfCsvRows(rowsInCsv); - Integer rowCount = 0; - List failedRecordSummaries = new ArrayList<>(); - - Practitioner practitioner; - String practitionerIdentifier; - String practitionerName; - String userId; - String userName; - String organizationIdentifier; - String code; - - String organizationIdFromCSV; - Long organizationId; - PractitionerRole practitionerRole; - for (Map csvdata : csvOrganizations) { - try { - rowCount++; - organizationIdFromCSV = getValueFromMap(ORGANIZATION_ID_KEY, csvdata); - organizationId = Long.valueOf(organizationIdFromCSV); - - organizationIdentifier = getOrganizationIdentifier(organizationId); - userName = getValueFromMap(USER_NAME_KEY, csvdata); - practitioner = practitionerService.getPractionerByUsername(userName); - - if (validateOrganizationFields(csvdata)) { - practitionerIdentifier = - practitioner != null ? practitioner.getIdentifier() : UUID.randomUUID().toString(); - if (practitioner == null) { - practitioner = new Practitioner(); - practitioner.setIdentifier(practitionerIdentifier); - } - practitioner.setActive(Boolean.TRUE); - if (csvdata.containsKey(NAME_KEY)) { - practitionerName = getValueFromMap(NAME_KEY, csvdata); - } else { - practitionerName = getValueFromMap(USER_NAME_KEY, csvdata); - } - - practitioner.setName(practitionerName); - - userId = getValueFromMap(USER_ID_KEY, csvdata); - practitioner.setUserId(userId); - - userName = getValueFromMap(USER_NAME_KEY, csvdata); - practitioner.setUsername(userName); - - practitionerRole = convertToPractitionerRole(practitionerIdentifier, csvdata); - if (organizationIdentifier != null) { - code = practitionerRole.getCode() != null ? practitionerRole.getCode().getText() : "Health Worker"; - practitionerRole.setOrganizationIdentifier(organizationIdentifier); - practitionerService.addOrUpdatePractitioner(practitioner); - practitionerRoleService - .assignPractitionerRole(organizationId, practitionerIdentifier, code, practitionerRole); - rowsProcessed++; - } - } else if (organizationIdentifier == null) { - failedRecordSummaries.add(getFailedRecordSummaryObject(rowCount, - "Failed to get organization against the given organization Id")); - } else { - failedRecordSummaries.add(getFailedRecordSummaryObject(rowCount, - "Validation failed, provided organization name mismatches with the system")); - } - } - catch (Exception e) { - logger.error( - "Exception occurred while persisting practitioner and pratitioner role data : " + e.getMessage() , e); - failedRecordSummaries - .add(getFailedRecordSummaryObject(rowCount, "Unknown error occurred")); - } - } - csvBulkImportDataSummary.setNumberOfRowsProcessed(rowsProcessed); - csvBulkImportDataSummary.setFailedRecordSummaryList(failedRecordSummaries); - return csvBulkImportDataSummary; - } - - private boolean validateLocationData(Map csvdata) { - String locationIdFromCSV; - String locationNameFromCSV; - PhysicalLocation physicalLocation; - - locationNameFromCSV = getValueFromMap(LOCATION_NAME_KEY, csvdata); - - if (csvdata.containsKey(LOCATION_ID_KEY)) { - locationIdFromCSV = getValueFromMap(LOCATION_ID_KEY, csvdata); - physicalLocation = physicalLocationService.getLocation(locationIdFromCSV, false, false); - if (locationNameFromCSV != null && physicalLocation != null && physicalLocation.getProperties() != null - && physicalLocation.getProperties() - .getName().equals(locationNameFromCSV)) { - return true; - } - } - return false; - } - - private boolean validateOrganizationFields(Map csvdata) { - String organizationIdFromCsv; - Long organizationId = 0l; - String organizationNameFromCSV = ""; - Organization organization; - - organizationNameFromCSV = getValueFromMap(ORGANIZATION_NAME_KEY, csvdata); - - if (csvdata.containsKey(ORGANIZATION_ID_KEY)) { - organizationIdFromCsv = csvdata.get(ORGANIZATION_ID_KEY); - organizationId = Long.valueOf(organizationIdFromCsv); - organization = organizationService.getOrganization(organizationId); - if (organization != null && organization.getName().equals(organizationNameFromCSV)) { - return true; - } - } - return false; - } - - private String getValueFromMap(String key, Map map) { - return map.get(key); - } - - private String getOrganizationIdentifier(Long organizationId) { - Organization organization = organizationService.getOrganization(organizationId); - return organization != null ? organization.getIdentifier() : null; - } - - private PractitionerRole convertToPractitionerRole(String practitionerIdentifier, Map csvdata) { - PractitionerRole practitionerRole = new PractitionerRole(); - String practitionerRoleIdentifier; - PractitionerRoleCode practitionerRoleCode; - String code; - practitionerRole.setActive(Boolean.TRUE); - practitionerRoleIdentifier = UUID.randomUUID().toString(); - practitionerRole.setIdentifier(practitionerRoleIdentifier); - practitionerRole.setPractitionerIdentifier(practitionerIdentifier); - practitionerRoleCode = new PractitionerRoleCode(); - if (csvdata.containsKey(ROLE_KEY)) { - code = csvdata.get(ROLE_KEY); - } else { - code = "Health Worker"; - } - - practitionerRoleCode.setText(code); - practitionerRole.setCode(practitionerRoleCode); - return practitionerRole; - } - - private FailedRecordSummary getFailedRecordSummaryObject(int rowNumber, String reasonOfFailure) { - FailedRecordSummary failedRecordSummary = new FailedRecordSummary(); - List failureReasons = new ArrayList<>(); - failedRecordSummary.setRowNumber(rowNumber); - failureReasons.add(reasonOfFailure); - failedRecordSummary.setReasonOfFailure(failureReasons); - return failedRecordSummary; - } + private static final String LOCATION_ID_KEY = "Location Id"; + private static final String LOCATION_NAME_KEY = "Location Name"; + private static final String ORGANIZATION_NAME_KEY = "Organization Name"; + private static final String PLAN_ID_KEY = "Plan Id"; + private static final String ORGANIZATION_ID_KEY = "Organization Id"; + private static final String USER_ID_KEY = "User Id"; + private static final String USER_NAME_KEY = "User Name"; + private static final String NAME_KEY = "Name"; + private static final String ROLE_KEY = "Role"; + private static Logger logger = LogManager.getLogger(ImportBulkDataService.class.toString()); + @Autowired + private OrganizationService organizationService; + @Autowired + private PractitionerService practitionerService; + @Autowired + private PractitionerRoleService practitionerRoleService; + @Autowired + private PhysicalLocationService physicalLocationService; + + public CsvBulkImportDataSummary convertandPersistOrganizationdata(List> csvOrganizations) { + + CsvBulkImportDataSummary csvBulkImportDataSummary = new CsvBulkImportDataSummary(); + Integer rowsProcessed = 0; + Integer rowsInCsv = csvOrganizations.size(); + csvBulkImportDataSummary.setNumberOfCsvRows(rowsInCsv); + Integer rowCount = 0; + List failedRecordSummaries = new ArrayList<>(); + FailedRecordSummary failedRecordSummary; + + Organization organization; + String organizationIdentifier; + CodeSystem type; + List codes; + Code code; + + String locationId = ""; + String planId = ""; + String organizationName = ""; + Organization existingOrganization; + try { + for (Map csvdata : csvOrganizations) { + rowCount++; + + if (validateLocationData(csvdata)) { + organization = new Organization(); + organizationIdentifier = UUID.randomUUID().toString(); + organization.setIdentifier(organizationIdentifier); + type = new CodeSystem(); + codes = new ArrayList<>(); + code = new Code(); + code.setSystem("http://terminology.hl7.org/CodeSystem/organization-type"); + code.setCode("team"); + code.setDisplay("Team"); + codes.add(code); + type.setCoding(codes); + + organization.setType(type); + organization.setActive(Boolean.TRUE); + + organizationName = getValueFromMap(ORGANIZATION_NAME_KEY, csvdata); + organization.setName(organizationName); + + locationId = getValueFromMap(LOCATION_ID_KEY, csvdata); + + planId = getValueFromMap(PLAN_ID_KEY, csvdata); + existingOrganization = organizationService.findOrganizationByName(organizationName); + if (existingOrganization == null) { + organizationService.addOrganization(organization); // as it can not be edited + } else { + organizationIdentifier = existingOrganization.getIdentifier(); + } + organizationService + .assignLocationAndPlan(organizationIdentifier, locationId, planId, new Date(), + null); //handles update case as well + rowsProcessed++; + } else { + failedRecordSummary = getFailedRecordSummaryObject(rowCount, + "Validation failed, provided location name mismatches with the system"); + failedRecordSummaries.add(failedRecordSummary); + } + } + } catch (Exception e) { + logger.error("Exception occurred while persisting organization and assignment data : " + e.getMessage(), e); + failedRecordSummary = getFailedRecordSummaryObject(rowCount, "Unknown error occurred"); + failedRecordSummaries.add(failedRecordSummary); + } + + csvBulkImportDataSummary.setNumberOfRowsProcessed(rowsProcessed); + csvBulkImportDataSummary.setFailedRecordSummaryList(failedRecordSummaries); + return csvBulkImportDataSummary; + + } + + public CsvBulkImportDataSummary convertandPersistPractitionerdata(List> csvOrganizations) { + + CsvBulkImportDataSummary csvBulkImportDataSummary = new CsvBulkImportDataSummary(); + Integer rowsProcessed = 0; + Integer rowsInCsv = csvOrganizations.size(); + csvBulkImportDataSummary.setNumberOfCsvRows(rowsInCsv); + Integer rowCount = 0; + List failedRecordSummaries = new ArrayList<>(); + + Practitioner practitioner; + String practitionerIdentifier; + String practitionerName; + String userId; + String userName; + String organizationIdentifier; + String code; + + String organizationIdFromCSV; + Long organizationId; + PractitionerRole practitionerRole; + for (Map csvdata : csvOrganizations) { + try { + rowCount++; + organizationIdFromCSV = getValueFromMap(ORGANIZATION_ID_KEY, csvdata); + organizationId = Long.valueOf(organizationIdFromCSV); + + organizationIdentifier = getOrganizationIdentifier(organizationId); + userName = getValueFromMap(USER_NAME_KEY, csvdata); + practitioner = practitionerService.getPractionerByUsername(userName); + + if (validateOrganizationFields(csvdata)) { + practitionerIdentifier = + practitioner != null ? practitioner.getIdentifier() : UUID.randomUUID().toString(); + if (practitioner == null) { + practitioner = new Practitioner(); + practitioner.setIdentifier(practitionerIdentifier); + } + practitioner.setActive(Boolean.TRUE); + if (csvdata.containsKey(NAME_KEY)) { + practitionerName = getValueFromMap(NAME_KEY, csvdata); + } else { + practitionerName = getValueFromMap(USER_NAME_KEY, csvdata); + } + + practitioner.setName(practitionerName); + + userId = getValueFromMap(USER_ID_KEY, csvdata); + practitioner.setUserId(userId); + + userName = getValueFromMap(USER_NAME_KEY, csvdata); + practitioner.setUsername(userName); + + practitionerRole = convertToPractitionerRole(practitionerIdentifier, csvdata); + if (organizationIdentifier != null) { + code = practitionerRole.getCode() != null ? practitionerRole.getCode().getText() : "Health Worker"; + practitionerRole.setOrganizationIdentifier(organizationIdentifier); + practitionerService.addOrUpdatePractitioner(practitioner); + practitionerRoleService + .assignPractitionerRole(organizationId, practitionerIdentifier, code, practitionerRole); + rowsProcessed++; + } + } else if (organizationIdentifier == null) { + failedRecordSummaries.add(getFailedRecordSummaryObject(rowCount, + "Failed to get organization against the given organization Id")); + } else { + failedRecordSummaries.add(getFailedRecordSummaryObject(rowCount, + "Validation failed, provided organization name mismatches with the system")); + } + } catch (Exception e) { + logger.error( + "Exception occurred while persisting practitioner and pratitioner role data : " + e.getMessage(), e); + failedRecordSummaries + .add(getFailedRecordSummaryObject(rowCount, "Unknown error occurred")); + } + } + csvBulkImportDataSummary.setNumberOfRowsProcessed(rowsProcessed); + csvBulkImportDataSummary.setFailedRecordSummaryList(failedRecordSummaries); + return csvBulkImportDataSummary; + } + + private boolean validateLocationData(Map csvdata) { + String locationIdFromCSV; + String locationNameFromCSV; + PhysicalLocation physicalLocation; + + locationNameFromCSV = getValueFromMap(LOCATION_NAME_KEY, csvdata); + + if (csvdata.containsKey(LOCATION_ID_KEY)) { + locationIdFromCSV = getValueFromMap(LOCATION_ID_KEY, csvdata); + physicalLocation = physicalLocationService.getLocation(locationIdFromCSV, false, false); + if (locationNameFromCSV != null && physicalLocation != null && physicalLocation.getProperties() != null + && physicalLocation.getProperties() + .getName().equals(locationNameFromCSV)) { + return true; + } + } + return false; + } + + private boolean validateOrganizationFields(Map csvdata) { + String organizationIdFromCsv; + Long organizationId = 0l; + String organizationNameFromCSV = ""; + Organization organization; + + organizationNameFromCSV = getValueFromMap(ORGANIZATION_NAME_KEY, csvdata); + + if (csvdata.containsKey(ORGANIZATION_ID_KEY)) { + organizationIdFromCsv = csvdata.get(ORGANIZATION_ID_KEY); + organizationId = Long.valueOf(organizationIdFromCsv); + organization = organizationService.getOrganization(organizationId); + if (organization != null && organization.getName().equals(organizationNameFromCSV)) { + return true; + } + } + return false; + } + + private String getValueFromMap(String key, Map map) { + return map.get(key); + } + + private String getOrganizationIdentifier(Long organizationId) { + Organization organization = organizationService.getOrganization(organizationId); + return organization != null ? organization.getIdentifier() : null; + } + + private PractitionerRole convertToPractitionerRole(String practitionerIdentifier, Map csvdata) { + PractitionerRole practitionerRole = new PractitionerRole(); + String practitionerRoleIdentifier; + PractitionerRoleCode practitionerRoleCode; + String code; + practitionerRole.setActive(Boolean.TRUE); + practitionerRoleIdentifier = UUID.randomUUID().toString(); + practitionerRole.setIdentifier(practitionerRoleIdentifier); + practitionerRole.setPractitionerIdentifier(practitionerIdentifier); + practitionerRoleCode = new PractitionerRoleCode(); + if (csvdata.containsKey(ROLE_KEY)) { + code = csvdata.get(ROLE_KEY); + } else { + code = "Health Worker"; + } + + practitionerRoleCode.setText(code); + practitionerRole.setCode(practitionerRoleCode); + return practitionerRole; + } + + private FailedRecordSummary getFailedRecordSummaryObject(int rowNumber, String reasonOfFailure) { + FailedRecordSummary failedRecordSummary = new FailedRecordSummary(); + List failureReasons = new ArrayList<>(); + failedRecordSummary.setRowNumber(rowNumber); + failureReasons.add(reasonOfFailure); + failedRecordSummary.setReasonOfFailure(failureReasons); + return failedRecordSummary; + } } diff --git a/src/main/java/org/opensrp/service/LocationTagService.java b/src/main/java/org/opensrp/service/LocationTagService.java index 85fb63323..a8db84499 100644 --- a/src/main/java/org/opensrp/service/LocationTagService.java +++ b/src/main/java/org/opensrp/service/LocationTagService.java @@ -13,82 +13,82 @@ @Service public class LocationTagService { - - private LocationTagRepository locationTagRepository; - - @Autowired - public void setLocationTagRepository(LocationTagRepository locationTagRepository) { - this.locationTagRepository = locationTagRepository; - } - - public LocationTagRepository getLocationTagRepository() { - return locationTagRepository; - } - - @PreAuthorize("hasRole('LOCATIONTAG_VIEW')") - public List getAllLocationTags() { - return getLocationTagRepository().getAll(); - } - - @PreAuthorize("hasRole('LOCATIONTAG_VIEW')") - public LocationTag getLocationTagById(String id) { - return getLocationTagRepository().getLocationTagByPrimaryKey(Long.valueOf(id)); - } - - @PreAuthorize("hasRole('LOCATIONTAG_CREATE') or hasRole('LOCATIONTAG_UPDATE')") - public LocationTag addOrUpdateLocationTag(LocationTag locationTag) { - if (StringUtils.isBlank(locationTag.getName())) { - throw new IllegalArgumentException("Location tag name not specified"); - } - - if (locationTag.getId() != 0) { - getLocationTagRepository().update(locationTag); - } else { - getLocationTagRepository().add(locationTag); - } - return locationTag; - } - - @PreAuthorize("hasRole('LOCATIONTAG_DELETE')") - public void deleteLocationTag(LocationTag locationTag) { - if (StringUtils.isBlank(locationTag.getName())) { - throw new IllegalArgumentException("Location tag name not specified"); - } - - getLocationTagRepository().safeRemove(locationTag); - - } - - @PreAuthorize("hasRole('LOCATIONTAG_DELETE')") - public void deleteLocationTag(Long id) { - if (id == 0) { - throw new IllegalArgumentException("Id not specified"); - } - - getLocationTagRepository().safeRemove(id); - - } - - public List findByLocationTagExample(LocationTagExample locationTagExample, int offset, int limit) { - return getLocationTagRepository().findByLocationTagExample(locationTagExample, offset, limit); - } - - public int addLocationTagMap(LocationTagMap locationTagMap) { - return getLocationTagRepository().addLocationTagMap(locationTagMap); - - } - - public List findLocationTagMapByCriteria(Long locationId, Long locationTagId) { - - return getLocationTagRepository().getLocationTagMapByExample(locationId, locationTagId); - } - - public void deleteLocationTagMapByLocationIdAndLocationTagId(Long locationId, Long locationTagId) { - getLocationTagRepository().deleteLocationTagMapByLocationIdAndLocationTagId(locationId, locationTagId); - } - - public void deleteLocationTagMapByLocationId(Long locationId) { - getLocationTagRepository().deleteLocationTagMapByLocationId(locationId); - } - + + private LocationTagRepository locationTagRepository; + + public LocationTagRepository getLocationTagRepository() { + return locationTagRepository; + } + + @Autowired + public void setLocationTagRepository(LocationTagRepository locationTagRepository) { + this.locationTagRepository = locationTagRepository; + } + + @PreAuthorize("hasRole('LOCATIONTAG_VIEW')") + public List getAllLocationTags() { + return getLocationTagRepository().getAll(); + } + + @PreAuthorize("hasRole('LOCATIONTAG_VIEW')") + public LocationTag getLocationTagById(String id) { + return getLocationTagRepository().getLocationTagByPrimaryKey(Long.valueOf(id)); + } + + @PreAuthorize("hasRole('LOCATIONTAG_CREATE') or hasRole('LOCATIONTAG_UPDATE')") + public LocationTag addOrUpdateLocationTag(LocationTag locationTag) { + if (StringUtils.isBlank(locationTag.getName())) { + throw new IllegalArgumentException("Location tag name not specified"); + } + + if (locationTag.getId() != 0) { + getLocationTagRepository().update(locationTag); + } else { + getLocationTagRepository().add(locationTag); + } + return locationTag; + } + + @PreAuthorize("hasRole('LOCATIONTAG_DELETE')") + public void deleteLocationTag(LocationTag locationTag) { + if (StringUtils.isBlank(locationTag.getName())) { + throw new IllegalArgumentException("Location tag name not specified"); + } + + getLocationTagRepository().safeRemove(locationTag); + + } + + @PreAuthorize("hasRole('LOCATIONTAG_DELETE')") + public void deleteLocationTag(Long id) { + if (id == 0) { + throw new IllegalArgumentException("Id not specified"); + } + + getLocationTagRepository().safeRemove(id); + + } + + public List findByLocationTagExample(LocationTagExample locationTagExample, int offset, int limit) { + return getLocationTagRepository().findByLocationTagExample(locationTagExample, offset, limit); + } + + public int addLocationTagMap(LocationTagMap locationTagMap) { + return getLocationTagRepository().addLocationTagMap(locationTagMap); + + } + + public List findLocationTagMapByCriteria(Long locationId, Long locationTagId) { + + return getLocationTagRepository().getLocationTagMapByExample(locationId, locationTagId); + } + + public void deleteLocationTagMapByLocationIdAndLocationTagId(Long locationId, Long locationTagId) { + getLocationTagRepository().deleteLocationTagMapByLocationIdAndLocationTagId(locationId, locationTagId); + } + + public void deleteLocationTagMapByLocationId(Long locationId) { + getLocationTagRepository().deleteLocationTagMapByLocationId(locationId); + } + } diff --git a/src/main/java/org/opensrp/service/ManifestService.java b/src/main/java/org/opensrp/service/ManifestService.java index 98f70ce81..b7a36dd26 100644 --- a/src/main/java/org/opensrp/service/ManifestService.java +++ b/src/main/java/org/opensrp/service/ManifestService.java @@ -22,22 +22,24 @@ public class ManifestService { private ManifestRepository manifestRepository; + public ManifestRepository getManifestRepository() { + return manifestRepository; + } + @Autowired public void setManifestRepository(ManifestRepository manifestRepository) { this.manifestRepository = manifestRepository; } - public ManifestRepository getManifestRepository() { - return manifestRepository; - } - @PreAuthorize("hasRole('MANIFEST_VIEW')") public List getAllManifest() { return manifestRepository.getAll(); } @PreAuthorize("hasRole('MANIFEST_VIEW')") - public List getAllManifest(int limit) { return manifestRepository.getAll(limit);} + public List getAllManifest(int limit) { + return manifestRepository.getAll(limit); + } @PreAuthorize("hasRole('MANIFEST_CREATE') or hasRole('MANIFEST_UPDATE')") public void addOrUpdateManifest(Manifest manifest) { @@ -60,7 +62,7 @@ public Manifest addManifest(Manifest manifest) { manifest.setUpdatedAt(new DateTime()); manifestRepository.add(manifest); return manifest; - + } @PreAuthorize("hasRole('MANIFEST_UPDATE')") diff --git a/src/main/java/org/opensrp/service/MultimediaService.java b/src/main/java/org/opensrp/service/MultimediaService.java index c77423658..e2fbe3945 100644 --- a/src/main/java/org/opensrp/service/MultimediaService.java +++ b/src/main/java/org/opensrp/service/MultimediaService.java @@ -17,101 +17,97 @@ @Service public class MultimediaService { - public static final String VIDEOS_DIR = "videos"; - - public static final String IMAGES_DIR = "patient_images"; - - public static final String CSV_DIR = "csv"; - - public static final String OTHER_DIR = "unknown_files"; - - public static final String MULTI_VERSION = "multi_version"; - - private final MultimediaRepository multimediaRepository; - - private MultimediaFileManager fileManager; - - private ClientService clientService; - - @Autowired - public MultimediaService(MultimediaRepository multimediaRepository, ClientService clientService) { - this.multimediaRepository = multimediaRepository; - this.clientService = clientService; - } - - @PreAuthorize("hasRole('MULTIMEDIA_VIEW')") - @PostFilter("hasPermission(filterObject, 'MULTIMEDIA_VIEW')") - public List getMultimediaFiles(String providerId) { - return multimediaRepository.all(providerId); - } - - @PreAuthorize("hasRole('MANIFEST_VIEW')") - @PostAuthorize("hasPermission(returnObject,'Multimedia', 'MANIFEST_VIEW')") - public Multimedia findByCaseId(String entityId) { - return multimediaRepository.findByCaseId(entityId); - } - - /** - * Returns a {@link List} of {@link Multimedia} objects that match the given parameters - * - * @param entityId The baseEntityId of the client who owns the multimedia file(s) - * @param contentType The contentType of the multimedia file(s) to be fetched - * @param fileCategory The file category of the multimedia file(s) - * - * @return A {@link List} of {@link Multimedia} objects - */ - @PreAuthorize("hasRole('MULTIMEDIA_VIEW')") - @PostFilter("hasPermission(filterObject, 'MULTIMEDIA_VIEW')") - public List getMultimediaFiles(String entityId, String contentType, String fileCategory) { - return multimediaRepository.get(entityId, contentType, fileCategory); - } - - /** - * - * Persists a {@link byte[]} to storage - * - * @param multimedia - * @param fileBytes - * @param originalFileName - * - * @return - */ - @PreAuthorize("hasRole('MULTIMEDIA_CREATE')") - public String saveFile(MultimediaDTO multimedia, byte[] fileBytes, String originalFileName) { - return fileManager.saveFile(multimedia, fileBytes, originalFileName); - } - - /** - * - * Retrieves a file from storage or null if it doesn't exist - * - * @param filePath - * @return - */ - public File retrieveFile(String filePath) { - return fileManager.retrieveFile(filePath); - } - - public void deleteMultimedia(Multimedia multimedia) { - if (multimedia == null) { - return; - } - - multimediaRepository.safeRemove(multimedia); - - } - - @Autowired - @Qualifier("multimedia.file.manager") - public void setFileManager(MultimediaFileManager fileManager) { - this.fileManager = fileManager; - } - - public MultimediaFileManager getFileManager() { - return fileManager; - } - - public ClientService getClientService() { - return clientService; - } + public static final String VIDEOS_DIR = "videos"; + + public static final String IMAGES_DIR = "patient_images"; + + public static final String CSV_DIR = "csv"; + + public static final String OTHER_DIR = "unknown_files"; + + public static final String MULTI_VERSION = "multi_version"; + + private final MultimediaRepository multimediaRepository; + + private MultimediaFileManager fileManager; + + private ClientService clientService; + + @Autowired + public MultimediaService(MultimediaRepository multimediaRepository, ClientService clientService) { + this.multimediaRepository = multimediaRepository; + this.clientService = clientService; + } + + @PreAuthorize("hasRole('MULTIMEDIA_VIEW')") + @PostFilter("hasPermission(filterObject, 'MULTIMEDIA_VIEW')") + public List getMultimediaFiles(String providerId) { + return multimediaRepository.all(providerId); + } + + @PreAuthorize("hasRole('MANIFEST_VIEW')") + @PostAuthorize("hasPermission(returnObject,'Multimedia', 'MANIFEST_VIEW')") + public Multimedia findByCaseId(String entityId) { + return multimediaRepository.findByCaseId(entityId); + } + + /** + * Returns a {@link List} of {@link Multimedia} objects that match the given parameters + * + * @param entityId The baseEntityId of the client who owns the multimedia file(s) + * @param contentType The contentType of the multimedia file(s) to be fetched + * @param fileCategory The file category of the multimedia file(s) + * @return A {@link List} of {@link Multimedia} objects + */ + @PreAuthorize("hasRole('MULTIMEDIA_VIEW')") + @PostFilter("hasPermission(filterObject, 'MULTIMEDIA_VIEW')") + public List getMultimediaFiles(String entityId, String contentType, String fileCategory) { + return multimediaRepository.get(entityId, contentType, fileCategory); + } + + /** + * Persists a {@link byte[]} to storage + * + * @param multimedia + * @param fileBytes + * @param originalFileName + * @return + */ + @PreAuthorize("hasRole('MULTIMEDIA_CREATE')") + public String saveFile(MultimediaDTO multimedia, byte[] fileBytes, String originalFileName) { + return fileManager.saveFile(multimedia, fileBytes, originalFileName); + } + + /** + * Retrieves a file from storage or null if it doesn't exist + * + * @param filePath + * @return + */ + public File retrieveFile(String filePath) { + return fileManager.retrieveFile(filePath); + } + + public void deleteMultimedia(Multimedia multimedia) { + if (multimedia == null) { + return; + } + + multimediaRepository.safeRemove(multimedia); + + } + + public MultimediaFileManager getFileManager() { + return fileManager; + } + + @Autowired + @Qualifier("multimedia.file.manager") + public void setFileManager(MultimediaFileManager fileManager) { + this.fileManager = fileManager; + } + + public ClientService getClientService() { + return clientService; + } } diff --git a/src/main/java/org/opensrp/service/OpenmrsIDService.java b/src/main/java/org/opensrp/service/OpenmrsIDService.java index e5b0fc81e..ee8d54d9e 100644 --- a/src/main/java/org/opensrp/service/OpenmrsIDService.java +++ b/src/main/java/org/opensrp/service/OpenmrsIDService.java @@ -26,193 +26,179 @@ @Service public class OpenmrsIDService { - - @Value("#{opensrp['openmrs.url']}") - private String openmrsUrl; - - @Value("#{opensrp['openmrs.username']}") - private String openmrsUserName; - - @Value("#{opensrp['openmrs.password']}") - private String openmrsPassword; - - @Value("#{opensrp['openmrs.idgen.idsource']}") - private int openmrsSourceId; - - // Client identifiers constant - public static final String ZEIR_IDENTIFIER = "ZEIR_ID"; - - public static final String CHILD_REGISTER_CARD_NUMBER = "Child_Register_Card_Number"; - - public static final String OPENMRS_IDGEN_URL = "module/idgen/exportIdentifiers.form"; - - private static Logger logger = LogManager.getLogger(OpenmrsIDService.class.toString()); - - private HttpClient client; - - @Autowired - private UniqueIdRepository uniqueIdPostgresRepository; - - public static OpenmrsIDService createInstanceWithOpenMrsUrl(String openmrsUrl) { - OpenmrsIDService openmrsIDService = new OpenmrsIDService(); - openmrsIDService.openmrsUrl = openmrsUrl; - return openmrsIDService; - } - - public OpenmrsIDService() { - this.client = HttpClientBuilder.create().build(); - } - - public List downloadOpenmrsIds(long size) { - List ids = new ArrayList(); - String openmrsQueryUrl = this.openmrsUrl + OPENMRS_IDGEN_URL; - // Add query parameters - openmrsQueryUrl += "?source=" + this.openmrsSourceId + "&numberToGenerate=" + size; - openmrsQueryUrl += "&username=" + this.openmrsUserName + "&password=" + this.openmrsPassword; - - try { - String jsonResponse = getHttpResponse(openmrsQueryUrl); - - JSONObject responseJson = new JSONObject(jsonResponse); - JSONArray jsonArray = responseJson.getJSONArray("identifiers"); - - if (jsonArray != null && jsonArray.length() > 0) { - for (int i = 0; i < jsonArray.length(); i++) { - ids.add(jsonArray.getString(i)); - } - } - } - catch (IOException | JSONException e) { - logger.error("", e); - return null; - } - // import IDs and client data to database together with assignments - return ids; - } - - /** - * download ids only if the total unused is less than the size specified - * - * @param size - */ - public void downloadAndSaveIds(int size, String userName) { - try { - Long totalUnUsed = uniqueIdPostgresRepository.totalUnUsedIds(); - if (totalUnUsed < size) { - long numberToGenerate = size - totalUnUsed; - List ids = downloadOpenmrsIds(numberToGenerate); - for (String id : ids) { - UniqueId uniqueId = new UniqueId(); - uniqueId.setCreatedAt(new Date()); - uniqueId.setOpenmrsId(id); - uniqueId.setUsedBy(userName); - uniqueId.setStatus(UniqueId.STATUS_NOT_USED); - uniqueIdPostgresRepository.add(uniqueId); - } - } - } - catch (Exception e) { - logger.error("", e); - } - - } - - public void clearRecords() { - try { - uniqueIdPostgresRepository.clearTable(); - } - catch (Exception e) { - logger.error("", e); - } - } - - public Boolean checkIfClientExists(Client client) throws SQLException { - try { - String location = client.getAddress("usual_residence").getAddressField("address2"); - - String usedBy = (String) client.getAttribute(CHILD_REGISTER_CARD_NUMBER); - - boolean clientExists = uniqueIdPostgresRepository.checkIfClientExists(usedBy, location); - - logger.info( - "[checkIfClientExists] - Card Number:" + usedBy + " - [Exists] " + clientExists); - - return clientExists; - } - catch (Exception e) { - logger.error("", e); - return null; - } - } - - public void assignOpenmrsIdToClient(String zeirID, Client client) throws SQLException { - // create jdbc template to persist the ids - try { - String location = client.getAddress("usual_residence").getAddressField("address2"); - - if (!this.checkIfClientExists(client)) { - String childRegisterCardNumber = (String) client.getAttribute(CHILD_REGISTER_CARD_NUMBER); - client.addIdentifier(ZEIR_IDENTIFIER, zeirID); - UniqueId uniqueId = new UniqueId(); - uniqueId.setOpenmrsId(zeirID); - uniqueId.setStatus(UniqueId.STATUS_USED); - uniqueId.setUsedBy(childRegisterCardNumber); - uniqueId.setLocation(location); - uniqueId.setCreatedAt(new Date()); - uniqueIdPostgresRepository.add(uniqueId); - logger.info("Assigned " + ZEIR_IDENTIFIER + " to " + client.fullName()); - } - } - catch (Exception e) { - logger.error("", e); - } - } - - public List getNotUsedIds(int limit) { - return uniqueIdPostgresRepository.getNotUsedIds(limit); - } - - public List getNotUsedIdsAsString(int limit) { - return uniqueIdPostgresRepository.getNotUsedIdsAsString(limit); - } - - public Long[] markIdsAsUsed(List ids) { - return uniqueIdPostgresRepository.markAsUsed(ids); - } - - @PreAuthorize("hasRole('OPENMRS')") - public List getOpenMRSIdentifiers(String source, String numberToGenerate) - throws JSONException { - List ids = new ArrayList<>(); - String openMRSUrl = this.openmrsUrl + OPENMRS_IDGEN_URL; - openMRSUrl += "?source=" + source + "&numberToGenerate=" + numberToGenerate; - openMRSUrl += "&username=" + openmrsUserName + "&password=" + openmrsPassword; - - try { - String jsonResponse = getHttpResponse(openMRSUrl); - JSONObject responseJson = new JSONObject(jsonResponse); - JSONArray jsonArray = responseJson.getJSONArray("identifiers"); - - if (jsonArray != null && jsonArray.length() > 0) { - for (int i = 0; i < jsonArray.length(); i++) { - ids.add(jsonArray.getString(i)); - } - } - - return ids; - - } - catch (IOException | JSONException e) { - logger.error("", e); - return null; - } - - } - - protected String getHttpResponse(String url) throws IOException { - HttpGet get = new HttpGet(url); - HttpResponse response = client.execute(get); - return EntityUtils.toString(response.getEntity()); - } - + + // Client identifiers constant + public static final String ZEIR_IDENTIFIER = "ZEIR_ID"; + public static final String CHILD_REGISTER_CARD_NUMBER = "Child_Register_Card_Number"; + public static final String OPENMRS_IDGEN_URL = "module/idgen/exportIdentifiers.form"; + private static Logger logger = LogManager.getLogger(OpenmrsIDService.class.toString()); + @Value("#{opensrp['openmrs.url']}") + private String openmrsUrl; + @Value("#{opensrp['openmrs.username']}") + private String openmrsUserName; + @Value("#{opensrp['openmrs.password']}") + private String openmrsPassword; + @Value("#{opensrp['openmrs.idgen.idsource']}") + private int openmrsSourceId; + private HttpClient client; + + @Autowired + private UniqueIdRepository uniqueIdPostgresRepository; + + public OpenmrsIDService() { + this.client = HttpClientBuilder.create().build(); + } + + public static OpenmrsIDService createInstanceWithOpenMrsUrl(String openmrsUrl) { + OpenmrsIDService openmrsIDService = new OpenmrsIDService(); + openmrsIDService.openmrsUrl = openmrsUrl; + return openmrsIDService; + } + + public List downloadOpenmrsIds(long size) { + List ids = new ArrayList(); + String openmrsQueryUrl = this.openmrsUrl + OPENMRS_IDGEN_URL; + // Add query parameters + openmrsQueryUrl += "?source=" + this.openmrsSourceId + "&numberToGenerate=" + size; + openmrsQueryUrl += "&username=" + this.openmrsUserName + "&password=" + this.openmrsPassword; + + try { + String jsonResponse = getHttpResponse(openmrsQueryUrl); + + JSONObject responseJson = new JSONObject(jsonResponse); + JSONArray jsonArray = responseJson.getJSONArray("identifiers"); + + if (jsonArray != null && jsonArray.length() > 0) { + for (int i = 0; i < jsonArray.length(); i++) { + ids.add(jsonArray.getString(i)); + } + } + } catch (IOException | JSONException e) { + logger.error("", e); + return null; + } + // import IDs and client data to database together with assignments + return ids; + } + + /** + * download ids only if the total unused is less than the size specified + * + * @param size + */ + public void downloadAndSaveIds(int size, String userName) { + try { + Long totalUnUsed = uniqueIdPostgresRepository.totalUnUsedIds(); + if (totalUnUsed < size) { + long numberToGenerate = size - totalUnUsed; + List ids = downloadOpenmrsIds(numberToGenerate); + for (String id : ids) { + UniqueId uniqueId = new UniqueId(); + uniqueId.setCreatedAt(new Date()); + uniqueId.setOpenmrsId(id); + uniqueId.setUsedBy(userName); + uniqueId.setStatus(UniqueId.STATUS_NOT_USED); + uniqueIdPostgresRepository.add(uniqueId); + } + } + } catch (Exception e) { + logger.error("", e); + } + + } + + public void clearRecords() { + try { + uniqueIdPostgresRepository.clearTable(); + } catch (Exception e) { + logger.error("", e); + } + } + + public Boolean checkIfClientExists(Client client) throws SQLException { + try { + String location = client.getAddress("usual_residence").getAddressField("address2"); + + String usedBy = (String) client.getAttribute(CHILD_REGISTER_CARD_NUMBER); + + boolean clientExists = uniqueIdPostgresRepository.checkIfClientExists(usedBy, location); + + logger.info( + "[checkIfClientExists] - Card Number:" + usedBy + " - [Exists] " + clientExists); + + return clientExists; + } catch (Exception e) { + logger.error("", e); + return null; + } + } + + public void assignOpenmrsIdToClient(String zeirID, Client client) throws SQLException { + // create jdbc template to persist the ids + try { + String location = client.getAddress("usual_residence").getAddressField("address2"); + + if (!this.checkIfClientExists(client)) { + String childRegisterCardNumber = (String) client.getAttribute(CHILD_REGISTER_CARD_NUMBER); + client.addIdentifier(ZEIR_IDENTIFIER, zeirID); + UniqueId uniqueId = new UniqueId(); + uniqueId.setOpenmrsId(zeirID); + uniqueId.setStatus(UniqueId.STATUS_USED); + uniqueId.setUsedBy(childRegisterCardNumber); + uniqueId.setLocation(location); + uniqueId.setCreatedAt(new Date()); + uniqueIdPostgresRepository.add(uniqueId); + logger.info("Assigned " + ZEIR_IDENTIFIER + " to " + client.fullName()); + } + } catch (Exception e) { + logger.error("", e); + } + } + + public List getNotUsedIds(int limit) { + return uniqueIdPostgresRepository.getNotUsedIds(limit); + } + + public List getNotUsedIdsAsString(int limit) { + return uniqueIdPostgresRepository.getNotUsedIdsAsString(limit); + } + + public Long[] markIdsAsUsed(List ids) { + return uniqueIdPostgresRepository.markAsUsed(ids); + } + + @PreAuthorize("hasRole('OPENMRS')") + public List getOpenMRSIdentifiers(String source, String numberToGenerate) + throws JSONException { + List ids = new ArrayList<>(); + String openMRSUrl = this.openmrsUrl + OPENMRS_IDGEN_URL; + openMRSUrl += "?source=" + source + "&numberToGenerate=" + numberToGenerate; + openMRSUrl += "&username=" + openmrsUserName + "&password=" + openmrsPassword; + + try { + String jsonResponse = getHttpResponse(openMRSUrl); + JSONObject responseJson = new JSONObject(jsonResponse); + JSONArray jsonArray = responseJson.getJSONArray("identifiers"); + + if (jsonArray != null && jsonArray.length() > 0) { + for (int i = 0; i < jsonArray.length(); i++) { + ids.add(jsonArray.getString(i)); + } + } + + return ids; + + } catch (IOException | JSONException e) { + logger.error("", e); + return null; + } + + } + + protected String getHttpResponse(String url) throws IOException { + HttpGet get = new HttpGet(url); + HttpResponse response = client.execute(get); + return EntityUtils.toString(response.getEntity()); + } + } diff --git a/src/main/java/org/opensrp/service/OrganizationService.java b/src/main/java/org/opensrp/service/OrganizationService.java index 63d085d05..59f412023 100644 --- a/src/main/java/org/opensrp/service/OrganizationService.java +++ b/src/main/java/org/opensrp/service/OrganizationService.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.service; @@ -32,347 +32,342 @@ */ @Service public class OrganizationService { - - private OrganizationRepository organizationRepository; - - private LocationRepository locationRepository; - - private PlanRepository planRepository; - - @Autowired - private PractitionerService practitionerService; - - @Resource(name = "redisTemplate") - private HashOperations> hashOps; - - private static final String ASSIGNED_LOCATIONS_HASH_KEY = "_assignedLocations"; - - @Autowired - public OrganizationService(OrganizationRepository organizationRepository, LocationRepository locationRepository, - PlanRepository planRepository) { - this.organizationRepository = organizationRepository; - this.locationRepository = locationRepository; - this.planRepository = planRepository; - } - - /** - * Get all organizations - * - * @return all organizations - */ - @PreAuthorize("hasRole('ORGANIZATION_VIEW')") - @PostFilter("hasPermission(filterObject, 'ORGANIZATION_VIEW')") - public List getAllOrganizations(OrganizationSearchBean organizationSearchBean) { - return organizationRepository.getAllOrganizations(organizationSearchBean); - } - - /** - * Returns all organizations filtered by locations - * - * @return all organizations - */ - @PreAuthorize("hasRole('ORGANIZATION_VIEW')") - @PostFilter("hasPermission(filterObject, 'ORGANIZATION_VIEW')") - public List selectOrganizationsEncompassLocations(String location_id) { - return organizationRepository.selectOrganizationsEncompassLocations(location_id, new Date()); - } - - /** - * Get the organization that has the identifier - * - * @param identifier - * @return organization with matching identifier - */ - @PreAuthorize("hasRole('ORGANIZATION_VIEW')") - @PostAuthorize("hasPermission(returnObject, 'ORGANIZATION_VIEW')") - public Organization getOrganization(String identifier) { - return organizationRepository.get(identifier); - } - - /** - * Get the organization that has the identifier - * - * @param id - * @return organization with matching identifier - */ - @PreAuthorize("hasRole('ORGANIZATION_VIEW')") - @PostAuthorize("hasPermission(returnObject, ORGANIZATION_VIEW')") - public Organization getOrganization(Long id) { - return organizationRepository.getByPrimaryKey(id); - } - - private void validateIdentifier(Organization organization) { - validateIdentifier(organization.getIdentifier()); - } - - public void validateIdentifier(String identifier) { - if (StringUtils.isBlank(identifier)) - throw new IllegalArgumentException("Organization Identifier not specified"); - } - - /** - * Adds or Updates an Organization - * - * @param organization to add on update - */ - @PreAuthorize("hasPermission(#organization,'Organization', 'ORGANIZATION_CREATE') and hasPermission(#organization,'Organization', 'ORGANIZATION_UPDATE')") - public void addOrUpdateOrganization(Organization organization) { - validateIdentifier(organization); - Organization entity = organizationRepository.get(organization.getIdentifier()); - if (entity != null) { - entity.setDateEdited(DateTime.now()); - organizationRepository.update(entity); - } else { - organization.setDateCreated(DateTime.now()); - organizationRepository.add(organization); - } - - } - - /** - * Adds an Organization - * - * @param organization to add - */ - @PreAuthorize("hasPermission(#organization,'Organization', 'ORGANIZATION_CREATE')") - public void addOrganization(Organization organization) { - validateIdentifier(organization); - organizationRepository.add(organization); - - } - - /** - * Updates an Organization - * - * @param organization to update - */ - @PreAuthorize("hasPermission(#organization,'Organization', 'ORGANIZATION_UPDATE')") - public void updateOrganization(Organization organization) { - validateIdentifier(organization); - organizationRepository.update(organization); - - } - - /** - * Assigns the jurisdiction and /or plan to the organization with organizationId - * - * @param identifier the id of the organization - * @param jurisdictionId the identifier of the jurisdiction - * @param planId the identifier of the plan - * @param fromDate - * @param toDate - */ - @PreAuthorize("hasPermission(#identifier,'OrganizationLocation','ORGANIZATION_ASSIGN_LOCATION')") - public void assignLocationAndPlan(String identifier, String jurisdictionId, String planId, Date fromDate, Date toDate) { - validateIdentifier(identifier); - if (StringUtils.isBlank(identifier)) - throw new IllegalArgumentException("identifier cannot be null or empty"); - if (StringUtils.isBlank(jurisdictionId) && StringUtils.isBlank(planId)) - throw new IllegalArgumentException("jurisdictionId and planId cannot be null"); - Organization organization = getOrganization(identifier); - if (organization == null) - throw new IllegalArgumentException("Organization not found"); - revokeFromCache(identifier); - organizationRepository.assignLocationAndPlan(organization.getId(), jurisdictionId, - locationRepository.retrievePrimaryKey(jurisdictionId, true), planId, planRepository.retrievePrimaryKey(planId), - fromDate == null ? new Date() : fromDate, toDate); - - } - - /** - * Gets the locations and Plans assigned to an organization - * - * @param identifier the organization identifier - * @param returnFutureAssignments flag to control if future assignments are returned - * @return the assigned locations and plans - */ - - @PreAuthorize("hasRole('ORGANIZATION_VIEW_LOCATIONS')") - @PostFilter("hasPermission(filterObject ,'ORGANIZATION_VIEW_LOCATIONS')") - public List findAssignedLocationsAndPlans(String identifier, boolean returnFutureAssignments, - Integer pageNumber, Integer pageSize, String orderByType, String orderByFieldName) { - validateIdentifier(identifier); - Organization organization = getOrganization(identifier); - if (organization == null) - throw new IllegalArgumentException("Organization not found"); - - BaseSearchBean.OrderByType orderByTypeEnum = orderByType != null ? BaseSearchBean.OrderByType.valueOf(orderByType) - : BaseSearchBean.OrderByType.DESC; - BaseSearchBean.FieldName fieldName = orderByFieldName != null ? BaseSearchBean.FieldName.valueOf(orderByFieldName) - : BaseSearchBean.FieldName.id; - - AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() - .pageNumber(pageNumber).pageSize(pageSize).orderByType(orderByTypeEnum).orderByFieldName(fieldName) - .organizationId(organization.getId()).returnFutureAssignments(returnFutureAssignments).build(); - return organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); - - } - - /** - * Gets the locations and Plans assigned to a list of organizations - * - * @param organizationIds the organization ids - * @param returnFutureAssignments flag to control if future assignments are returned - * @return the assigned locations and plans - */ - public List findAssignedLocationsAndPlans(List organizationIds, - boolean returnFutureAssignments) { - return organizationRepository.findAssignedLocations(organizationIds, returnFutureAssignments); - - } - - /** - * Gets the active locations and Plans assigned to a list of organizations - * - * @param organizationIds the organization ids - * @return the assigned locations and plans - */ - @PreAuthorize("hasRole('ORGANIZATION_VIEW_LOCATIONS')") - @PostFilter("hasPermission(filterObject,'ORGANIZATION_VIEW_LOCATIONS')") - public List findAssignedLocationsAndPlans(List organizationIds) { - return findAssignedLocationsAndPlans(organizationIds, false); - } - - /** - * Gets the locations and Plans using the Plan Identifier - * - * @param planIdentifier the plan identifier - * @return the assigned locations and plans - */ - @PreAuthorize("hasRole('ORGANIZATION_VIEW_LOCATIONS')") - @PostFilter("hasPermission(filterObject,'ORGANIZATION_VIEW_LOCATIONS')") - public List findAssignedLocationsAndPlansByPlanIdentifier(String planIdentifier, Integer pageNumber, - Integer pageSize, String orderByType, String orderByFieldName) { - if (StringUtils.isBlank(planIdentifier)) - throw new IllegalArgumentException("PlanIdentifier Identifier not specified"); - - Long planId = planRepository.retrievePrimaryKey(planIdentifier); - - if (planId == null) - throw new IllegalArgumentException("Plan not found"); - - BaseSearchBean.OrderByType orderByTypeEnum = orderByType != null ? BaseSearchBean.OrderByType.valueOf(orderByType) - : BaseSearchBean.OrderByType.DESC; - BaseSearchBean.FieldName fieldName = orderByFieldName != null ? BaseSearchBean.FieldName.valueOf(orderByFieldName) - : BaseSearchBean.FieldName.id; - - AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() - .pageNumber(pageNumber).pageSize(pageSize).orderByType(orderByTypeEnum).orderByFieldName(fieldName) - .planId(planId).build(); - return organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); - - } - - /** - * Set the Organization repository - * - * @param organizationRepository the organizationRepository to set - */ - @Autowired - public void setOrganizationRepository(OrganizationRepository organizationRepository) { - this.organizationRepository = organizationRepository; - } - - /** - * set the location repository - * - * @param locationRepository the locationRepository to set - */ - @Autowired - /** - * @param locationRepository the locationRepository to set - */ - public void setLocationRepository(LocationRepository locationRepository) { - this.locationRepository = locationRepository; - } - - /** - * set the plan Repository - * - * @param planRepository the planRepository to set - */ - @Autowired - public void setPlanRepository(PlanRepository planRepository) { - this.planRepository = planRepository; - } - - /** - * @param practitionerService the practitionerService to set - */ - public void setPractitionerService(PractitionerService practitionerService) { - this.practitionerService = practitionerService; - } - - @PreAuthorize("hasRole('ORGANIZATION_VIEW')") - @PostFilter("hasPermission(filterObject, 'ORGANIZATION_VIEW')") - public List getSearchOrganizations(OrganizationSearchBean organizationSearchBean) { - return organizationRepository.findSearchOrganizations(organizationSearchBean); - } - - public Integer findOrganizationCount(OrganizationSearchBean organizationSearchBean) { - return organizationRepository.findOrganizationCount(organizationSearchBean); - } - - private void revokeFromCache(String organizationIdentifier) { - List practitioners = getPractitionersByOrgIdentifier(organizationIdentifier); - for (Practitioner practitioner : practitioners) { - hashOps.delete(practitioner.getUsername(), ASSIGNED_LOCATIONS_HASH_KEY); - } - } - - /** - * Gets practitioners in an organization - * - * @param organizationIdentifier the identifier for organization - * @return practitioners in an organization - */ - - public List getPractitionersByOrgIdentifier(String organizationIdentifier) { - validateIdentifier(organizationIdentifier); - Organization organization = getOrganization(organizationIdentifier); - - if (organization == null) { - throw new IllegalArgumentException("Organization does not exist"); - } - - return practitionerService.getPractitionersByOrgId(organization.getId()); - } - - public Organization findOrganizationByName(String organizationName) { - return organizationRepository.findOrganizationByName(organizationName); - } - - /** - * This method will revoke all the team assignments including future assignments as well - * fetched from the plan Id - * by setting to_date param to the current date - */ - public void unassignLocationAndPlan(String planIdentifier) { - if (StringUtils.isBlank(planIdentifier)) - throw new IllegalArgumentException("PlanIdentfier cannot be null"); - - Long planId = planRepository.retrievePrimaryKey(planIdentifier); - if (planId == null) - throw new IllegalArgumentException("Plan not found"); - - organizationRepository.unassignLocationAndPlan(planId); - } - - @PreAuthorize("hasRole('ORGANIZATION_VIEW')") - public long countAllOrganizations() { - return organizationRepository.countAllOrganizations(); - } - - @PreAuthorize("hasRole('ORGANIZATION_VIEW')") - @PostFilter("hasPermission(filterObject, 'ORGANIZATION_VIEW')") - public List getAllOrganizationsByOrganizationIds(List organizationIds) { - return organizationRepository.getOrganizationsByIds(organizationIds); - } - - @PreAuthorize("hasRole('ORGANIZATION_VIEW')") - @PostFilter("hasPermission(filterObject, 'ORGANIZATION_VIEW')") - public List getOrganizationsByPractitionerIdentifier(String practitionerIdentifier) { - ImmutablePair> practitionerOrganizationIds = practitionerService.getOrganizationsByPractitionerIdentifier(practitionerIdentifier); - return practitionerOrganizationIds != null && practitionerOrganizationIds.getRight() != null && practitionerOrganizationIds.getRight().size() > 0 ? getAllOrganizationsByOrganizationIds(practitionerOrganizationIds.getRight()) : null; - } + + private static final String ASSIGNED_LOCATIONS_HASH_KEY = "_assignedLocations"; + private OrganizationRepository organizationRepository; + private LocationRepository locationRepository; + private PlanRepository planRepository; + @Autowired + private PractitionerService practitionerService; + @Resource(name = "redisTemplate") + private HashOperations> hashOps; + + @Autowired + public OrganizationService(OrganizationRepository organizationRepository, LocationRepository locationRepository, + PlanRepository planRepository) { + this.organizationRepository = organizationRepository; + this.locationRepository = locationRepository; + this.planRepository = planRepository; + } + + /** + * Get all organizations + * + * @return all organizations + */ + @PreAuthorize("hasRole('ORGANIZATION_VIEW')") + @PostFilter("hasPermission(filterObject, 'ORGANIZATION_VIEW')") + public List getAllOrganizations(OrganizationSearchBean organizationSearchBean) { + return organizationRepository.getAllOrganizations(organizationSearchBean); + } + + /** + * Returns all organizations filtered by locations + * + * @return all organizations + */ + @PreAuthorize("hasRole('ORGANIZATION_VIEW')") + @PostFilter("hasPermission(filterObject, 'ORGANIZATION_VIEW')") + public List selectOrganizationsEncompassLocations(String location_id) { + return organizationRepository.selectOrganizationsEncompassLocations(location_id, new Date()); + } + + /** + * Get the organization that has the identifier + * + * @param identifier + * @return organization with matching identifier + */ + @PreAuthorize("hasRole('ORGANIZATION_VIEW')") + @PostAuthorize("hasPermission(returnObject, 'ORGANIZATION_VIEW')") + public Organization getOrganization(String identifier) { + return organizationRepository.get(identifier); + } + + /** + * Get the organization that has the identifier + * + * @param id + * @return organization with matching identifier + */ + @PreAuthorize("hasRole('ORGANIZATION_VIEW')") + @PostAuthorize("hasPermission(returnObject, ORGANIZATION_VIEW')") + public Organization getOrganization(Long id) { + return organizationRepository.getByPrimaryKey(id); + } + + private void validateIdentifier(Organization organization) { + validateIdentifier(organization.getIdentifier()); + } + + public void validateIdentifier(String identifier) { + if (StringUtils.isBlank(identifier)) + throw new IllegalArgumentException("Organization Identifier not specified"); + } + + /** + * Adds or Updates an Organization + * + * @param organization to add on update + */ + @PreAuthorize("hasPermission(#organization,'Organization', 'ORGANIZATION_CREATE') and hasPermission(#organization,'Organization', 'ORGANIZATION_UPDATE')") + public void addOrUpdateOrganization(Organization organization) { + validateIdentifier(organization); + Organization entity = organizationRepository.get(organization.getIdentifier()); + if (entity != null) { + entity.setDateEdited(DateTime.now()); + organizationRepository.update(entity); + } else { + organization.setDateCreated(DateTime.now()); + organizationRepository.add(organization); + } + + } + + /** + * Adds an Organization + * + * @param organization to add + */ + @PreAuthorize("hasPermission(#organization,'Organization', 'ORGANIZATION_CREATE')") + public void addOrganization(Organization organization) { + validateIdentifier(organization); + organizationRepository.add(organization); + + } + + /** + * Updates an Organization + * + * @param organization to update + */ + @PreAuthorize("hasPermission(#organization,'Organization', 'ORGANIZATION_UPDATE')") + public void updateOrganization(Organization organization) { + validateIdentifier(organization); + organizationRepository.update(organization); + + } + + /** + * Assigns the jurisdiction and /or plan to the organization with organizationId + * + * @param identifier the id of the organization + * @param jurisdictionId the identifier of the jurisdiction + * @param planId the identifier of the plan + * @param fromDate + * @param toDate + */ + @PreAuthorize("hasPermission(#identifier,'OrganizationLocation','ORGANIZATION_ASSIGN_LOCATION')") + public void assignLocationAndPlan(String identifier, String jurisdictionId, String planId, Date fromDate, Date toDate) { + validateIdentifier(identifier); + if (StringUtils.isBlank(identifier)) + throw new IllegalArgumentException("identifier cannot be null or empty"); + if (StringUtils.isBlank(jurisdictionId) && StringUtils.isBlank(planId)) + throw new IllegalArgumentException("jurisdictionId and planId cannot be null"); + Organization organization = getOrganization(identifier); + if (organization == null) + throw new IllegalArgumentException("Organization not found"); + revokeFromCache(identifier); + organizationRepository.assignLocationAndPlan(organization.getId(), jurisdictionId, + locationRepository.retrievePrimaryKey(jurisdictionId, true), planId, planRepository.retrievePrimaryKey(planId), + fromDate == null ? new Date() : fromDate, toDate); + + } + + /** + * Gets the locations and Plans assigned to an organization + * + * @param identifier the organization identifier + * @param returnFutureAssignments flag to control if future assignments are returned + * @return the assigned locations and plans + */ + + @PreAuthorize("hasRole('ORGANIZATION_VIEW_LOCATIONS')") + @PostFilter("hasPermission(filterObject ,'ORGANIZATION_VIEW_LOCATIONS')") + public List findAssignedLocationsAndPlans(String identifier, boolean returnFutureAssignments, + Integer pageNumber, Integer pageSize, String orderByType, String orderByFieldName) { + validateIdentifier(identifier); + Organization organization = getOrganization(identifier); + if (organization == null) + throw new IllegalArgumentException("Organization not found"); + + BaseSearchBean.OrderByType orderByTypeEnum = orderByType != null ? BaseSearchBean.OrderByType.valueOf(orderByType) + : BaseSearchBean.OrderByType.DESC; + BaseSearchBean.FieldName fieldName = orderByFieldName != null ? BaseSearchBean.FieldName.valueOf(orderByFieldName) + : BaseSearchBean.FieldName.id; + + AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() + .pageNumber(pageNumber).pageSize(pageSize).orderByType(orderByTypeEnum).orderByFieldName(fieldName) + .organizationId(organization.getId()).returnFutureAssignments(returnFutureAssignments).build(); + return organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); + + } + + /** + * Gets the locations and Plans assigned to a list of organizations + * + * @param organizationIds the organization ids + * @param returnFutureAssignments flag to control if future assignments are returned + * @return the assigned locations and plans + */ + public List findAssignedLocationsAndPlans(List organizationIds, + boolean returnFutureAssignments) { + return organizationRepository.findAssignedLocations(organizationIds, returnFutureAssignments); + + } + + /** + * Gets the active locations and Plans assigned to a list of organizations + * + * @param organizationIds the organization ids + * @return the assigned locations and plans + */ + @PreAuthorize("hasRole('ORGANIZATION_VIEW_LOCATIONS')") + @PostFilter("hasPermission(filterObject,'ORGANIZATION_VIEW_LOCATIONS')") + public List findAssignedLocationsAndPlans(List organizationIds) { + return findAssignedLocationsAndPlans(organizationIds, false); + } + + /** + * Gets the locations and Plans using the Plan Identifier + * + * @param planIdentifier the plan identifier + * @return the assigned locations and plans + */ + @PreAuthorize("hasRole('ORGANIZATION_VIEW_LOCATIONS')") + @PostFilter("hasPermission(filterObject,'ORGANIZATION_VIEW_LOCATIONS')") + public List findAssignedLocationsAndPlansByPlanIdentifier(String planIdentifier, Integer pageNumber, + Integer pageSize, String orderByType, String orderByFieldName) { + if (StringUtils.isBlank(planIdentifier)) + throw new IllegalArgumentException("PlanIdentifier Identifier not specified"); + + Long planId = planRepository.retrievePrimaryKey(planIdentifier); + + if (planId == null) + throw new IllegalArgumentException("Plan not found"); + + BaseSearchBean.OrderByType orderByTypeEnum = orderByType != null ? BaseSearchBean.OrderByType.valueOf(orderByType) + : BaseSearchBean.OrderByType.DESC; + BaseSearchBean.FieldName fieldName = orderByFieldName != null ? BaseSearchBean.FieldName.valueOf(orderByFieldName) + : BaseSearchBean.FieldName.id; + + AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() + .pageNumber(pageNumber).pageSize(pageSize).orderByType(orderByTypeEnum).orderByFieldName(fieldName) + .planId(planId).build(); + return organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); + + } + + /** + * Set the Organization repository + * + * @param organizationRepository the organizationRepository to set + */ + @Autowired + public void setOrganizationRepository(OrganizationRepository organizationRepository) { + this.organizationRepository = organizationRepository; + } + + /** + * set the location repository + * + * @param locationRepository the locationRepository to set + */ + @Autowired + /** + * @param locationRepository the locationRepository to set + */ + public void setLocationRepository(LocationRepository locationRepository) { + this.locationRepository = locationRepository; + } + + /** + * set the plan Repository + * + * @param planRepository the planRepository to set + */ + @Autowired + public void setPlanRepository(PlanRepository planRepository) { + this.planRepository = planRepository; + } + + /** + * @param practitionerService the practitionerService to set + */ + public void setPractitionerService(PractitionerService practitionerService) { + this.practitionerService = practitionerService; + } + + @PreAuthorize("hasRole('ORGANIZATION_VIEW')") + @PostFilter("hasPermission(filterObject, 'ORGANIZATION_VIEW')") + public List getSearchOrganizations(OrganizationSearchBean organizationSearchBean) { + return organizationRepository.findSearchOrganizations(organizationSearchBean); + } + + public Integer findOrganizationCount(OrganizationSearchBean organizationSearchBean) { + return organizationRepository.findOrganizationCount(organizationSearchBean); + } + + private void revokeFromCache(String organizationIdentifier) { + List practitioners = getPractitionersByOrgIdentifier(organizationIdentifier); + for (Practitioner practitioner : practitioners) { + hashOps.delete(practitioner.getUsername(), ASSIGNED_LOCATIONS_HASH_KEY); + } + } + + /** + * Gets practitioners in an organization + * + * @param organizationIdentifier the identifier for organization + * @return practitioners in an organization + */ + + public List getPractitionersByOrgIdentifier(String organizationIdentifier) { + validateIdentifier(organizationIdentifier); + Organization organization = getOrganization(organizationIdentifier); + + if (organization == null) { + throw new IllegalArgumentException("Organization does not exist"); + } + + return practitionerService.getPractitionersByOrgId(organization.getId()); + } + + public Organization findOrganizationByName(String organizationName) { + return organizationRepository.findOrganizationByName(organizationName); + } + + /** + * This method will revoke all the team assignments including future assignments as well + * fetched from the plan Id + * by setting to_date param to the current date + */ + public void unassignLocationAndPlan(String planIdentifier) { + if (StringUtils.isBlank(planIdentifier)) + throw new IllegalArgumentException("PlanIdentfier cannot be null"); + + Long planId = planRepository.retrievePrimaryKey(planIdentifier); + if (planId == null) + throw new IllegalArgumentException("Plan not found"); + + organizationRepository.unassignLocationAndPlan(planId); + } + + @PreAuthorize("hasRole('ORGANIZATION_VIEW')") + public long countAllOrganizations() { + return organizationRepository.countAllOrganizations(); + } + + @PreAuthorize("hasRole('ORGANIZATION_VIEW')") + @PostFilter("hasPermission(filterObject, 'ORGANIZATION_VIEW')") + public List getAllOrganizationsByOrganizationIds(List organizationIds) { + return organizationRepository.getOrganizationsByIds(organizationIds); + } + + @PreAuthorize("hasRole('ORGANIZATION_VIEW')") + @PostFilter("hasPermission(filterObject, 'ORGANIZATION_VIEW')") + public List getOrganizationsByPractitionerIdentifier(String practitionerIdentifier) { + ImmutablePair> practitionerOrganizationIds = practitionerService.getOrganizationsByPractitionerIdentifier(practitionerIdentifier); + return practitionerOrganizationIds != null && practitionerOrganizationIds.getRight() != null && practitionerOrganizationIds.getRight().size() > 0 ? getAllOrganizationsByOrganizationIds(practitionerOrganizationIds.getRight()) : null; + } } diff --git a/src/main/java/org/opensrp/service/PhysicalLocationService.java b/src/main/java/org/opensrp/service/PhysicalLocationService.java index 0721a05f3..4e6f14540 100755 --- a/src/main/java/org/opensrp/service/PhysicalLocationService.java +++ b/src/main/java/org/opensrp/service/PhysicalLocationService.java @@ -1,7 +1,6 @@ package org.opensrp.service; - import static org.opensrp.domain.StructureCount.STRUCTURE_COUNT; import static org.smartregister.domain.LocationProperty.PropertyStatus.ACTIVE; import static org.smartregister.domain.LocationProperty.PropertyStatus.PENDING_REVIEW; @@ -49,605 +48,609 @@ @Service public class PhysicalLocationService { - - private static Logger logger = LogManager.getLogger(PhysicalLocationService.class.toString()); - - private LocationRepository locationRepository; - - private final boolean DEFAULT_RETURN_BOOLEAN = true; - - @Autowired - private OrganizationService organizationService; - - @Autowired - private PractitionerService practitionerService; - - @Resource(name = "redisTemplate") - private HashOperations> hashOps; - - @Autowired - private RedisTemplate redisTemplate; - - private static final String ASSIGNED_LOCATIONS_HASH_KEY = "_assignedLocations"; - - @Autowired - public void setLocationRepository(LocationRepository locationRepository) { - this.locationRepository = locationRepository; - } - - public void setOrganizationService(OrganizationService organizationService) { - this.organizationService = organizationService; - } - - public void setPractitionerService(PractitionerService practitionerService) { - this.practitionerService = practitionerService; - } - - @PreAuthorize("hasRole('LOCATION_VIEW')") - public PhysicalLocation getLocation(String id, boolean returnGeometry, boolean includeInactive) { - return locationRepository.get(id, returnGeometry, includeInactive); - } - - @PreAuthorize("hasRole('LOCATION_VIEW')") - public PhysicalLocation getLocation(String id, boolean returnGeometry, int version) { - return locationRepository.get(id, returnGeometry, version); - } - - @PreAuthorize("hasRole('LOCATION_VIEW')") - public PhysicalLocation getStructure(String id, boolean returnGeometry) { - return locationRepository.getStructure(id, returnGeometry); - } - - @PreAuthorize("hasRole('LOCATION_VIEW')") - public List getAllLocations() { - return locationRepository.getAll(); - } - - @PreAuthorize("hasRole('LOCATION_CREATE') or hasRole('LOCATION_UPDATE')") - public void addOrUpdate(PhysicalLocation physicalLocation) { - if (StringUtils.isBlank(physicalLocation.getId())) - throw new IllegalArgumentException("id not specified"); - if ((physicalLocation.isJurisdiction() && getLocation(physicalLocation.getId(), DEFAULT_RETURN_BOOLEAN, false) == null) - || (!physicalLocation.isJurisdiction() - && getStructure(physicalLocation.getId(), DEFAULT_RETURN_BOOLEAN) == null)) { - add(physicalLocation); - } else { - update(physicalLocation); - } - } - - @Transactional - @CacheEvict(value = {"locationsWIthChildrenByLocationIds","locationTreeFromLocation","locationTreeFromLocationIdentifiers"}, allEntries = true) - @PreAuthorize("hasRole('LOCATION_CREATE')") - public void add(PhysicalLocation physicalLocation) { - if (StringUtils.isBlank(physicalLocation.getId())) - throw new IllegalArgumentException("id not specified"); - locationRepository.add(physicalLocation); - } - - @Transactional - @CacheEvict(value = {"locationsWIthChildrenByLocationIds","locationTreeFromLocation","locationTreeFromLocationIdentifiers"}, allEntries = true) - @PreAuthorize("hasRole('LOCATION_UPDATE')") - public void update(PhysicalLocation physicalLocation) { - if (StringUtils.isBlank(physicalLocation.getId())) - throw new IllegalArgumentException("id not specified"); - PhysicalLocation existingEntity = locationRepository.findLocationByIdentifierAndStatus(physicalLocation.getId(), - Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name()), true); - boolean locationHasNoUpdates = isGeometryCoordsEqual(physicalLocation, existingEntity); - if (locationHasNoUpdates || !physicalLocation.isJurisdiction() || existingEntity == null) { - locationRepository.update(physicalLocation); - } else { - //make existing location inactive - existingEntity.getProperties().setStatus(LocationProperty.PropertyStatus.INACTIVE); - locationRepository.update(existingEntity); - - // create new location - //increment location version - int newVersion = existingEntity.getProperties().getVersion() + 1; - physicalLocation.getProperties().setVersion(newVersion); - - locationRepository.add(physicalLocation); - } - - } - - @PreAuthorize("hasRole('LOCATION_VIEW')") - public List findLocationsByServerVersion(long serverVersion) { - return locationRepository.findLocationsByServerVersion(serverVersion); - } - - @PreAuthorize("hasRole('LOCATION_VIEW')") - public List findLocationsByNames(String locationNames, long serverVersion) { - return locationRepository.findLocationsByNames(locationNames, serverVersion); - } - - @PreAuthorize("hasRole('LOCATION_VIEW')") - public List findStructuresByParentAndServerVersion(String parentId, long serverVersion) { - if (StringUtils.isBlank(parentId)) - throw new IllegalArgumentException("parentId not specified"); - return locationRepository.findStructuresByParentAndServerVersion(parentId, serverVersion); - } - - - @PreAuthorize("hasRole('LOCATION_CREATE') or hasRole('LOCATION_UPDATE')") - public Set saveLocations(List locations, boolean isJurisdiction) { - Set locationsWithErrors = new HashSet<>(); - for (PhysicalLocation location : locations) { - try { - location.setJurisdiction(isJurisdiction); - addOrUpdate(location); - } - catch (Exception e) { - logger.error(e.getMessage(), e); - locationsWithErrors.add(location.getId()); - } - } - return locationsWithErrors; - - } - - public Collection findStructuresWithinRadius(double latitude, double longitude, double radius) { - return locationRepository.findStructureAndFamilyDetails(latitude, longitude, radius); - } - - /** - * This methods searches for jurisdictions using the parentId and location properties It returns the - * Geometry optionally if @param returnGeometry is set to true. - * - * @param returnGeometry boolean which controls if geometry is returned - * @param parentId string the parent id of the jurisdiction being searched - * @param properties map of location properties to filter with, each entry in map has property name - * and value - * @return jurisdictions matching the params - * @see org.opensrp.repository.LocationRepository#findLocationsByProperties(boolean, String, Map) - */ - @PreAuthorize("hasRole('LOCATION_VIEW')") - public List findLocationsByProperties(boolean returnGeometry, String parentId, - Map properties) { - return locationRepository.findLocationsByProperties(returnGeometry, parentId, properties); - } - - /** - * This methods searches for structures using the parentId and location properties It returns the - * Geometry optionally if @param returnGeometry is set to true. - * - * @param returnGeometry boolean which controls if geometry is returned - * @param parentId string the parent id of the structure being searched - * @param properties map of location properties to filter with, each entry in map has property name - * and value - * @return structures matching the params - * @see org.opensrp.repository.LocationRepository#findStructuresByProperties(boolean, String, Map) - */ - @PreAuthorize("hasRole('LOCATION_VIEW')") - public List findStructuresByProperties(boolean returnGeometry, String parentId, - Map properties) { - return locationRepository.findStructuresByProperties(returnGeometry, parentId, properties); - } - - /** - * This methods provides an API endpoint that searches for locations using a list of provided - * location ids. It returns the Geometry optionally if @param returnGeometry is set to true. - * - * @param returnGeometry boolean which controls if geometry is returned - * @param ids list of location ids - * @return jurisdictions whose ids match the provided params - */ - @PreAuthorize("hasRole('LOCATION_VIEW')") - public List findLocationsByIds(boolean returnGeometry, List ids) { - return locationRepository.findLocationsByIds(returnGeometry, ids, null); - } - - /** - * This methods provides an API endpoint that searches for locations using a list of provided - * location ids. It returns the Geometry optionally if @param returnGeometry is set to true. - * - * @param returnGeometry boolean which controls if geometry is returned - * @param ids list of location ids - * @param serverVersion server version if not null filter - * @return jurisdictions whose ids match the provided params - */ - public List findLocationsByIds(boolean returnGeometry, List ids, Long serverVersion) { - return locationRepository.findLocationsByIds(returnGeometry, ids, serverVersion); - } - - /** - * This methods searches for locations using a list of provided location ids.It returns location - * whose is in the list or whose parent is in list It returns the Geometry optionally if @param - * returnGeometry is set to true. - * - * @param returnGeometry boolean which controls if geometry is returned - * @param ids list of location ids - * @return jurisdictions whose ids match the provided params - */ - @PreAuthorize("hasRole('LOCATION_VIEW')") - public List findLocationsByIdsOrParentIds(boolean returnGeometry, List ids) { - return locationRepository.findLocationsByIdsOrParentIds(returnGeometry, ids); - } - - /** - * This methods searches for a location and it's children using the provided location id It returns - * the Geometry optionally if @param returnGeometry is set to true. - * - * @param returnGeometry boolean which controls if geometry is returned - * @param id location id - * @param pageSize number of records to be returned - * @return location together with it's children whose id matches the provided param - */ - @PreAuthorize("hasRole('LOCATION_VIEW')") - public List findLocationByIdWithChildren(boolean returnGeometry, String id, int pageSize) { - return locationRepository.findLocationByIdWithChildren(returnGeometry, id, pageSize); - } - - /** - * This methods searches for a location and it's children using the provided location Ids returns - * the Geometry optionally if @param returnGeometry is set to true. - * - * @param returnGeometry boolean which controls if geometry is returned - * @param locationIds location ids - * @param pageSize number of records to be returned - * @return location together with it's children whose id matches the provided param - */ - @Cacheable(value = "locationsWIthChildrenByLocationIds", key = "{ #locationIds, #returnGeometry }") - public List findLocationByIdsWithChildren(boolean returnGeometry, Set locationIds, - int pageSize) { - return locationRepository.findLocationByIdsWithChildren(returnGeometry, locationIds, pageSize); - } - - /** - * This method searches for all structure ids - * - * @param serverVersion - * @param limit upper limit on number of structure ids to fetch - * @return a list of structure ids as well as the lastServerVersion - */ - public Pair, Long> findAllStructureIds(Long serverVersion, int limit) { - return locationRepository.findAllStructureIds(serverVersion, limit); - } - - /** - * overloads {@link #findAllStructureIds} by adding date/time filters - * - * @param serverVersion - * @param limit - * @param fromDate - * @param toDate - * @return - */ - public Pair, Long> findAllStructureIds(Long serverVersion, int limit, Date fromDate, Date toDate) { - return locationRepository.findAllStructureIds(serverVersion, limit, fromDate, toDate); - } - - /** - * This method searches for location identifier and name using a plan identifier. - * - * @param planIdentifier identifier of the plan - * @return list of location details i.e. identifier and name - */ - public Set findLocationDetailsByPlanId(String planIdentifier) { - return locationRepository.findLocationDetailsByPlanId(planIdentifier); - } - - /** - * This method searches for jurisdictions ordered by serverVersion ascending - * - * @param returnGeometry boolean which controls if geometry is returned - * @param serverVersion - * @param limit upper limit on number of jurisdictions to fetch - * @return list of jurisdictions - */ - @PreAuthorize("hasRole('LOCATION_VIEW')") - public List findAllLocations(boolean returnGeometry, Long serverVersion, int limit, boolean includeInactive) { - return locationRepository.findAllLocations(returnGeometry, serverVersion, limit, includeInactive); - }; - - /** - * This method searches for structures ordered by serverVersion ascending - * - * @param returnGeometry boolean which controls if geometry is returned - * @param limit upper limit on number of structures to fetch - * @return list of structures - */ - public List findAllStructures(boolean returnGeometry, Long serverVersion, int limit, Integer pageNumber, String orderByType, String orderByFieldName) { - return locationRepository.findAllStructures(returnGeometry, serverVersion, limit, pageNumber, orderByType, orderByFieldName); - }; - - /** - * This method searches for all location ids - * - * @param serverVersion - * @param limit upper limit on number of location ids to fetch - * @return a list of location ids - */ - public Pair, Long> findAllLocationIds(Long serverVersion, int limit) { - return locationRepository.findAllLocationIds(serverVersion, limit); - } - - /** - * overloads {@link #findAllLocationIds(Long, int)}} by adding date/time filters - * - * @param serverVersion - * @param limit - * @param fromDate - * @param toDate - * @return - */ - public Pair, Long> findAllLocationIds(Long serverVersion, int limit, Date fromDate, Date toDate) { - return locationRepository.findAllLocationIds(serverVersion, limit, fromDate, toDate); - } - - - @PreAuthorize("hasRole('LOCATION_VIEW')") - public List searchLocations(LocationSearchBean locationSearchBean) { - return locationRepository.searchLocations(locationSearchBean); - } - - public int countSearchLocations(LocationSearchBean locationSearchBean) { - return locationRepository.countSearchLocations(locationSearchBean); - } - - /** - * Gets the location tree for the location identifiers. This returns the details of ancestors - * including the identifiers - * - * @param identifiers the id of locations to get location hierarchy - * @param returnStructureCount whether to return structure counts for the jurisdictions - * @param returnTags whether to return loction tags - * @return the location hierarchy/tree of the identifiers - */ - @Cacheable(value = "locationTreeFromLocationIdentifiers", key = "{ #identifiers, #returnStructureCount, #returnTags }") - public LocationTree buildLocationHierachy(Set identifiers, boolean returnStructureCount, boolean returnTags) { - LocationTree locationTree = new LocationTree(); - Set locationDetails = locationRepository.findParentLocationsInclusive(identifiers, returnTags); - locationTree.buildTreeFromList(getLocations(locationDetails, returnStructureCount)); - return locationTree; - } - - private Location getLocationFromDetail(LocationDetail locationDetail, Map locationMap, - boolean returnStructureCounts, Map cumulativeCountsMap) { - Location location = new Location(); - location.setLocationId(locationDetail.getIdentifier()); - location.setName(locationDetail.getName()); - location.setVoided(locationDetail.isVoided()); - if (locationDetail.getTags() != null) { - location.setTags(new HashSet<>(Arrays.asList(locationDetail.getTags().split(",")))); - } - LocationDetail parent = locationMap.get(locationDetail.getParentId()); - if (parent != null) { - location.setParentLocation(new Location().withLocationId(parent.getIdentifier())); - } - location.addAttribute("geographicLevel", locationDetail.getGeographicLevel()); - - if (returnStructureCounts) { - location.addAttribute(STRUCTURE_COUNT, cumulativeCountsMap.get(location.getLocationId())); - } - return location; - } - - private void populateCumulativeCountsMap(Set locationDetails, Map cumulativeCountsMap, - Map structureCountMap) { - - for (LocationDetail locationDetail : locationDetails) { - StructureCount structureCount = structureCountMap.get(locationDetail.getIdentifier()); - if (structureCount != null) { //only locations with structure counts - int updatedCount = cumulativeCountsMap.get(locationDetail.getIdentifier()) == null - ? structureCount.getCount() - : cumulativeCountsMap.get(locationDetail.getIdentifier()) + structureCount.getCount(); - cumulativeCountsMap.put(locationDetail.getIdentifier(), updatedCount); - } else if (cumulativeCountsMap.get(locationDetail.getIdentifier()) == null) { - cumulativeCountsMap.put(locationDetail.getIdentifier(), 0); - } - - if (locationDetail.getParentId() != null) { - // init parent location map value - if (cumulativeCountsMap.get(locationDetail.getParentId()) == null) { - cumulativeCountsMap.put(locationDetail.getParentId(), 0); - } - - // update parent location structure count - int updatedCount = cumulativeCountsMap.get(locationDetail.getParentId()) - + cumulativeCountsMap.get(locationDetail.getIdentifier()); - cumulativeCountsMap.put(locationDetail.getParentId(), updatedCount); - } - - } - - } - - private List getLocations(Set locationDetails, boolean returnStructureCounts) { - /* @formatter:off */ - List structureCountsForLocation = null; - Map structureCountMap = null; - Map cumulativeCountsMap = new HashMap<>(); - Map locationMap = locationDetails - .stream() - .collect(Collectors.toMap(LocationDetail::getIdentifier, (entry) -> entry)); - - if (returnStructureCounts) { - structureCountsForLocation = locationRepository - .findStructureCountsForLocation(locationMap.keySet()); - - structureCountMap = structureCountsForLocation - .stream() - .collect(Collectors.toMap(StructureCount::getParentId, (entry) -> entry)); - - populateCumulativeCountsMap(locationDetails, cumulativeCountsMap, structureCountMap); - - } - - return locationDetails - .stream() - .map(location -> getLocationFromDetail(location, locationMap, returnStructureCounts, cumulativeCountsMap)) - .collect(Collectors.toList()); - - - /* @formatter:on */ - } - - /** - * This method is used to return a count of structure based on the provided parameters - * - * @param parentId id for the parent location - * @param serverVersion - * @return returns a count of structures matching the passed parameters - */ - public Long countStructuresByParentAndServerVersion(String parentId, long serverVersion) { - return locationRepository.countStructuresByParentAndServerVersion(parentId, serverVersion); - } - - /** - * This method is used to return a count of locations based on the provided parameters - * - * @param serverVersion - * @return returns a count of locations matching the passed parameters - */ - public Long countLocationsByServerVersion(long serverVersion) { - return locationRepository.countLocationsByServerVersion(serverVersion); - }; - - /** - * This method is used to return a count of locations based on the provided parameters - * - * @param locationNames A string of comma separated location names - * @param serverVersion - * @return returns a count of locations matching the passed parameters - */ - public Long countLocationsByNames(String locationNames, long serverVersion) { - return locationRepository.countLocationsByNames(locationNames, serverVersion); - }; - - public List getAssignedLocations(String username) { - List assignedLocations = new ArrayList<>(); - if (hashOps.hasKey(username, ASSIGNED_LOCATIONS_HASH_KEY)) { - return hashOps.get(username, ASSIGNED_LOCATIONS_HASH_KEY); - } else { - List organizationIds = practitionerService.getOrganizationsByUserId(username).right; - if (isEmptyOrNull(organizationIds)) { - return new ArrayList<>(); - } - assignedLocations = organizationService.findAssignedLocationsAndPlans(organizationIds); + + private static final String ASSIGNED_LOCATIONS_HASH_KEY = "_assignedLocations"; + private static Logger logger = LogManager.getLogger(PhysicalLocationService.class.toString()); + private final boolean DEFAULT_RETURN_BOOLEAN = true; + private LocationRepository locationRepository; + @Autowired + private OrganizationService organizationService; + @Autowired + private PractitionerService practitionerService; + @Resource(name = "redisTemplate") + private HashOperations> hashOps; + @Autowired + private RedisTemplate redisTemplate; + + @Autowired + public void setLocationRepository(LocationRepository locationRepository) { + this.locationRepository = locationRepository; + } + + public void setOrganizationService(OrganizationService organizationService) { + this.organizationService = organizationService; + } + + public void setPractitionerService(PractitionerService practitionerService) { + this.practitionerService = practitionerService; + } + + @PreAuthorize("hasRole('LOCATION_VIEW')") + public PhysicalLocation getLocation(String id, boolean returnGeometry, boolean includeInactive) { + return locationRepository.get(id, returnGeometry, includeInactive); + } + + @PreAuthorize("hasRole('LOCATION_VIEW')") + public PhysicalLocation getLocation(String id, boolean returnGeometry, int version) { + return locationRepository.get(id, returnGeometry, version); + } + + @PreAuthorize("hasRole('LOCATION_VIEW')") + public PhysicalLocation getStructure(String id, boolean returnGeometry) { + return locationRepository.getStructure(id, returnGeometry); + } + + @PreAuthorize("hasRole('LOCATION_VIEW')") + public List getAllLocations() { + return locationRepository.getAll(); + } + + @PreAuthorize("hasRole('LOCATION_CREATE') or hasRole('LOCATION_UPDATE')") + public void addOrUpdate(PhysicalLocation physicalLocation) { + if (StringUtils.isBlank(physicalLocation.getId())) + throw new IllegalArgumentException("id not specified"); + if ((physicalLocation.isJurisdiction() && getLocation(physicalLocation.getId(), DEFAULT_RETURN_BOOLEAN, false) == null) + || (!physicalLocation.isJurisdiction() + && getStructure(physicalLocation.getId(), DEFAULT_RETURN_BOOLEAN) == null)) { + add(physicalLocation); + } else { + update(physicalLocation); + } + } + + @Transactional + @CacheEvict(value = {"locationsWIthChildrenByLocationIds", "locationTreeFromLocation", "locationTreeFromLocationIdentifiers"}, allEntries = true) + @PreAuthorize("hasRole('LOCATION_CREATE')") + public void add(PhysicalLocation physicalLocation) { + if (StringUtils.isBlank(physicalLocation.getId())) + throw new IllegalArgumentException("id not specified"); + locationRepository.add(physicalLocation); + } + + @Transactional + @CacheEvict(value = {"locationsWIthChildrenByLocationIds", "locationTreeFromLocation", "locationTreeFromLocationIdentifiers"}, allEntries = true) + @PreAuthorize("hasRole('LOCATION_UPDATE')") + public void update(PhysicalLocation physicalLocation) { + if (StringUtils.isBlank(physicalLocation.getId())) + throw new IllegalArgumentException("id not specified"); + PhysicalLocation existingEntity = locationRepository.findLocationByIdentifierAndStatus(physicalLocation.getId(), + Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name()), true); + boolean locationHasNoUpdates = isGeometryCoordsEqual(physicalLocation, existingEntity); + if (locationHasNoUpdates || !physicalLocation.isJurisdiction() || existingEntity == null) { + locationRepository.update(physicalLocation); + } else { + //make existing location inactive + existingEntity.getProperties().setStatus(LocationProperty.PropertyStatus.INACTIVE); + locationRepository.update(existingEntity); + + // create new location + //increment location version + int newVersion = existingEntity.getProperties().getVersion() + 1; + physicalLocation.getProperties().setVersion(newVersion); + + locationRepository.add(physicalLocation); + } + + } + + @PreAuthorize("hasRole('LOCATION_VIEW')") + public List findLocationsByServerVersion(long serverVersion) { + return locationRepository.findLocationsByServerVersion(serverVersion); + } + + @PreAuthorize("hasRole('LOCATION_VIEW')") + public List findLocationsByNames(String locationNames, long serverVersion) { + return locationRepository.findLocationsByNames(locationNames, serverVersion); + } + + @PreAuthorize("hasRole('LOCATION_VIEW')") + public List findStructuresByParentAndServerVersion(String parentId, long serverVersion) { + if (StringUtils.isBlank(parentId)) + throw new IllegalArgumentException("parentId not specified"); + return locationRepository.findStructuresByParentAndServerVersion(parentId, serverVersion); + } + + + @PreAuthorize("hasRole('LOCATION_CREATE') or hasRole('LOCATION_UPDATE')") + public Set saveLocations(List locations, boolean isJurisdiction) { + Set locationsWithErrors = new HashSet<>(); + for (PhysicalLocation location : locations) { + try { + location.setJurisdiction(isJurisdiction); + addOrUpdate(location); + } catch (Exception e) { + logger.error(e.getMessage(), e); + locationsWithErrors.add(location.getId()); + } + } + return locationsWithErrors; + + } + + public Collection findStructuresWithinRadius(double latitude, double longitude, double radius) { + return locationRepository.findStructureAndFamilyDetails(latitude, longitude, radius); + } + + /** + * This methods searches for jurisdictions using the parentId and location properties It returns the + * Geometry optionally if @param returnGeometry is set to true. + * + * @param returnGeometry boolean which controls if geometry is returned + * @param parentId string the parent id of the jurisdiction being searched + * @param properties map of location properties to filter with, each entry in map has property name + * and value + * @return jurisdictions matching the params + * @see org.opensrp.repository.LocationRepository#findLocationsByProperties(boolean, String, Map) + */ + @PreAuthorize("hasRole('LOCATION_VIEW')") + public List findLocationsByProperties(boolean returnGeometry, String parentId, + Map properties) { + return locationRepository.findLocationsByProperties(returnGeometry, parentId, properties); + } + + /** + * This methods searches for structures using the parentId and location properties It returns the + * Geometry optionally if @param returnGeometry is set to true. + * + * @param returnGeometry boolean which controls if geometry is returned + * @param parentId string the parent id of the structure being searched + * @param properties map of location properties to filter with, each entry in map has property name + * and value + * @return structures matching the params + * @see org.opensrp.repository.LocationRepository#findStructuresByProperties(boolean, String, Map) + */ + @PreAuthorize("hasRole('LOCATION_VIEW')") + public List findStructuresByProperties(boolean returnGeometry, String parentId, + Map properties) { + return locationRepository.findStructuresByProperties(returnGeometry, parentId, properties); + } + + /** + * This methods provides an API endpoint that searches for locations using a list of provided + * location ids. It returns the Geometry optionally if @param returnGeometry is set to true. + * + * @param returnGeometry boolean which controls if geometry is returned + * @param ids list of location ids + * @return jurisdictions whose ids match the provided params + */ + @PreAuthorize("hasRole('LOCATION_VIEW')") + public List findLocationsByIds(boolean returnGeometry, List ids) { + return locationRepository.findLocationsByIds(returnGeometry, ids, null); + } + + /** + * This methods provides an API endpoint that searches for locations using a list of provided + * location ids. It returns the Geometry optionally if @param returnGeometry is set to true. + * + * @param returnGeometry boolean which controls if geometry is returned + * @param ids list of location ids + * @param serverVersion server version if not null filter + * @return jurisdictions whose ids match the provided params + */ + public List findLocationsByIds(boolean returnGeometry, List ids, Long serverVersion) { + return locationRepository.findLocationsByIds(returnGeometry, ids, serverVersion); + } + + /** + * This methods searches for locations using a list of provided location ids.It returns location + * whose is in the list or whose parent is in list It returns the Geometry optionally if @param + * returnGeometry is set to true. + * + * @param returnGeometry boolean which controls if geometry is returned + * @param ids list of location ids + * @return jurisdictions whose ids match the provided params + */ + @PreAuthorize("hasRole('LOCATION_VIEW')") + public List findLocationsByIdsOrParentIds(boolean returnGeometry, List ids) { + return locationRepository.findLocationsByIdsOrParentIds(returnGeometry, ids); + } + + /** + * This methods searches for a location and it's children using the provided location id It returns + * the Geometry optionally if @param returnGeometry is set to true. + * + * @param returnGeometry boolean which controls if geometry is returned + * @param id location id + * @param pageSize number of records to be returned + * @return location together with it's children whose id matches the provided param + */ + @PreAuthorize("hasRole('LOCATION_VIEW')") + public List findLocationByIdWithChildren(boolean returnGeometry, String id, int pageSize) { + return locationRepository.findLocationByIdWithChildren(returnGeometry, id, pageSize); + } + + /** + * This methods searches for a location and it's children using the provided location Ids returns + * the Geometry optionally if @param returnGeometry is set to true. + * + * @param returnGeometry boolean which controls if geometry is returned + * @param locationIds location ids + * @param pageSize number of records to be returned + * @return location together with it's children whose id matches the provided param + */ + @Cacheable(value = "locationsWIthChildrenByLocationIds", key = "{ #locationIds, #returnGeometry }") + public List findLocationByIdsWithChildren(boolean returnGeometry, Set locationIds, + int pageSize) { + return locationRepository.findLocationByIdsWithChildren(returnGeometry, locationIds, pageSize); + } + + /** + * This method searches for all structure ids + * + * @param serverVersion + * @param limit upper limit on number of structure ids to fetch + * @return a list of structure ids as well as the lastServerVersion + */ + public Pair, Long> findAllStructureIds(Long serverVersion, int limit) { + return locationRepository.findAllStructureIds(serverVersion, limit); + } + + /** + * overloads {@link #findAllStructureIds} by adding date/time filters + * + * @param serverVersion + * @param limit + * @param fromDate + * @param toDate + * @return + */ + public Pair, Long> findAllStructureIds(Long serverVersion, int limit, Date fromDate, Date toDate) { + return locationRepository.findAllStructureIds(serverVersion, limit, fromDate, toDate); + } + + /** + * This method searches for location identifier and name using a plan identifier. + * + * @param planIdentifier identifier of the plan + * @return list of location details i.e. identifier and name + */ + public Set findLocationDetailsByPlanId(String planIdentifier) { + return locationRepository.findLocationDetailsByPlanId(planIdentifier); + } + + /** + * This method searches for jurisdictions ordered by serverVersion ascending + * + * @param returnGeometry boolean which controls if geometry is returned + * @param serverVersion + * @param limit upper limit on number of jurisdictions to fetch + * @return list of jurisdictions + */ + @PreAuthorize("hasRole('LOCATION_VIEW')") + public List findAllLocations(boolean returnGeometry, Long serverVersion, int limit, boolean includeInactive) { + return locationRepository.findAllLocations(returnGeometry, serverVersion, limit, includeInactive); + } + + ; + + /** + * This method searches for structures ordered by serverVersion ascending + * + * @param returnGeometry boolean which controls if geometry is returned + * @param limit upper limit on number of structures to fetch + * @return list of structures + */ + public List findAllStructures(boolean returnGeometry, Long serverVersion, int limit, Integer pageNumber, String orderByType, String orderByFieldName) { + return locationRepository.findAllStructures(returnGeometry, serverVersion, limit, pageNumber, orderByType, orderByFieldName); + } + + ; + + /** + * This method searches for all location ids + * + * @param serverVersion + * @param limit upper limit on number of location ids to fetch + * @return a list of location ids + */ + public Pair, Long> findAllLocationIds(Long serverVersion, int limit) { + return locationRepository.findAllLocationIds(serverVersion, limit); + } + + /** + * overloads {@link #findAllLocationIds(Long, int)}} by adding date/time filters + * + * @param serverVersion + * @param limit + * @param fromDate + * @param toDate + * @return + */ + public Pair, Long> findAllLocationIds(Long serverVersion, int limit, Date fromDate, Date toDate) { + return locationRepository.findAllLocationIds(serverVersion, limit, fromDate, toDate); + } + + + @PreAuthorize("hasRole('LOCATION_VIEW')") + public List searchLocations(LocationSearchBean locationSearchBean) { + return locationRepository.searchLocations(locationSearchBean); + } + + public int countSearchLocations(LocationSearchBean locationSearchBean) { + return locationRepository.countSearchLocations(locationSearchBean); + } + + /** + * Gets the location tree for the location identifiers. This returns the details of ancestors + * including the identifiers + * + * @param identifiers the id of locations to get location hierarchy + * @param returnStructureCount whether to return structure counts for the jurisdictions + * @param returnTags whether to return loction tags + * @return the location hierarchy/tree of the identifiers + */ + @Cacheable(value = "locationTreeFromLocationIdentifiers", key = "{ #identifiers, #returnStructureCount, #returnTags }") + public LocationTree buildLocationHierachy(Set identifiers, boolean returnStructureCount, boolean returnTags) { + LocationTree locationTree = new LocationTree(); + Set locationDetails = locationRepository.findParentLocationsInclusive(identifiers, returnTags); + locationTree.buildTreeFromList(getLocations(locationDetails, returnStructureCount)); + return locationTree; + } + + private Location getLocationFromDetail(LocationDetail locationDetail, Map locationMap, + boolean returnStructureCounts, Map cumulativeCountsMap) { + Location location = new Location(); + location.setLocationId(locationDetail.getIdentifier()); + location.setName(locationDetail.getName()); + location.setVoided(locationDetail.isVoided()); + if (locationDetail.getTags() != null) { + location.setTags(new HashSet<>(Arrays.asList(locationDetail.getTags().split(",")))); + } + LocationDetail parent = locationMap.get(locationDetail.getParentId()); + if (parent != null) { + location.setParentLocation(new Location().withLocationId(parent.getIdentifier())); + } + location.addAttribute("geographicLevel", locationDetail.getGeographicLevel()); + + if (returnStructureCounts) { + location.addAttribute(STRUCTURE_COUNT, cumulativeCountsMap.get(location.getLocationId())); + } + return location; + } + + private void populateCumulativeCountsMap(Set locationDetails, Map cumulativeCountsMap, + Map structureCountMap) { + + for (LocationDetail locationDetail : locationDetails) { + StructureCount structureCount = structureCountMap.get(locationDetail.getIdentifier()); + if (structureCount != null) { //only locations with structure counts + int updatedCount = cumulativeCountsMap.get(locationDetail.getIdentifier()) == null + ? structureCount.getCount() + : cumulativeCountsMap.get(locationDetail.getIdentifier()) + structureCount.getCount(); + cumulativeCountsMap.put(locationDetail.getIdentifier(), updatedCount); + } else if (cumulativeCountsMap.get(locationDetail.getIdentifier()) == null) { + cumulativeCountsMap.put(locationDetail.getIdentifier(), 0); + } + + if (locationDetail.getParentId() != null) { + // init parent location map value + if (cumulativeCountsMap.get(locationDetail.getParentId()) == null) { + cumulativeCountsMap.put(locationDetail.getParentId(), 0); + } + + // update parent location structure count + int updatedCount = cumulativeCountsMap.get(locationDetail.getParentId()) + + cumulativeCountsMap.get(locationDetail.getIdentifier()); + cumulativeCountsMap.put(locationDetail.getParentId(), updatedCount); + } + + } + + } + + private List getLocations(Set locationDetails, boolean returnStructureCounts) { + /* @formatter:off */ + List structureCountsForLocation = null; + Map structureCountMap = null; + Map cumulativeCountsMap = new HashMap<>(); + Map locationMap = locationDetails + .stream() + .collect(Collectors.toMap(LocationDetail::getIdentifier, (entry) -> entry)); + + if (returnStructureCounts) { + structureCountsForLocation = locationRepository + .findStructureCountsForLocation(locationMap.keySet()); + + structureCountMap = structureCountsForLocation + .stream() + .collect(Collectors.toMap(StructureCount::getParentId, (entry) -> entry)); + + populateCumulativeCountsMap(locationDetails, cumulativeCountsMap, structureCountMap); + + } + + return locationDetails + .stream() + .map(location -> getLocationFromDetail(location, locationMap, returnStructureCounts, cumulativeCountsMap)) + .collect(Collectors.toList()); + + + /* @formatter:on */ + } + + /** + * This method is used to return a count of structure based on the provided parameters + * + * @param parentId id for the parent location + * @param serverVersion + * @return returns a count of structures matching the passed parameters + */ + public Long countStructuresByParentAndServerVersion(String parentId, long serverVersion) { + return locationRepository.countStructuresByParentAndServerVersion(parentId, serverVersion); + } + + /** + * This method is used to return a count of locations based on the provided parameters + * + * @param serverVersion + * @return returns a count of locations matching the passed parameters + */ + public Long countLocationsByServerVersion(long serverVersion) { + return locationRepository.countLocationsByServerVersion(serverVersion); + } + + ; + + /** + * This method is used to return a count of locations based on the provided parameters + * + * @param locationNames A string of comma separated location names + * @param serverVersion + * @return returns a count of locations matching the passed parameters + */ + public Long countLocationsByNames(String locationNames, long serverVersion) { + return locationRepository.countLocationsByNames(locationNames, serverVersion); + } + + ; + + public List getAssignedLocations(String username) { + List assignedLocations = new ArrayList<>(); + if (hashOps.hasKey(username, ASSIGNED_LOCATIONS_HASH_KEY)) { + return hashOps.get(username, ASSIGNED_LOCATIONS_HASH_KEY); + } else { + List organizationIds = practitionerService.getOrganizationsByUserId(username).right; + if (isEmptyOrNull(organizationIds)) { + return new ArrayList<>(); + } + assignedLocations = organizationService.findAssignedLocationsAndPlans(organizationIds); persistInRedisCache(assignedLocations, username); - return assignedLocations; - } - } - - private boolean isEmptyOrNull(Collection collection) { - return collection == null || collection.isEmpty(); - } - /** - * Gets the count of locations based on locationIds and server version - * - * @param locationIds the list of locationIds to filter with - * @param serverVersion the server version to filter with - * @return number of records - */ - public long countLocationsByIds(List locationIds, long serverVersion) { - return locationRepository.countLocationsByIds(locationIds, serverVersion); - } - - /** - * This method checks whether the coordinates contained in the locations Geometry are equal - * - * @param newEntity location entity - * @param existingEntity location entity - * @return - */ - public boolean isGeometryCoordsEqual(PhysicalLocation newEntity, PhysicalLocation existingEntity) { - if (newEntity == null || existingEntity == null) { - return false; - } - JsonElement newGeometryCoordsElement = JsonParser.parseString(geometryCoords(newEntity)); - JsonElement existingGeometryCoordsElement = JsonParser.parseString(geometryCoords(existingEntity)); - return newGeometryCoordsElement.equals(existingGeometryCoordsElement); - } - - /** - * Returns the geometry coordinates string. - * @param physicalLocation {@link PhysicalLocation} - * @return coordinates {@link String} - */ - private String geometryCoords(PhysicalLocation physicalLocation) { - String geometryCoordinates = ""; - if (physicalLocation != null && physicalLocation.getGeometry() != null - && physicalLocation.getGeometry().getCoordinates() != null) { - geometryCoordinates = physicalLocation.getGeometry().getCoordinates().toString(); - } - return geometryCoordinates; - } - - @Cacheable(value = "locationTreeFromLocation", key = "{ #locationId, #returnStructureCount }") - public LocationTree buildLocationHierachyFromLocation(String locationId, boolean returnStructureCount) { - return buildLocationHierachyFromLocation(locationId, false, returnStructureCount); - } - - /** - * Build full location tree with passed location id as tree root - * - * @param locationId id of the root location - * @return full location hierarchy from passed location plus all of its descendants - */ - @Cacheable(value = "locationTreeFromLocation", key = "{ #locationId, #returnTags, #returnStructureCount }") - public LocationTree buildLocationHierachyFromLocation(String locationId, boolean returnTags, - boolean returnStructureCount) { - LocationTree locationTree = new LocationTree(); - Set locationDetails = locationRepository.findLocationWithDescendants(locationId, returnTags); - locationTree.buildTreeFromList(getLocations(locationDetails, returnStructureCount)); - return locationTree; - } - - private void persistInRedisCache(List assignedLocations, String username) { - List toDates = new ArrayList<>(); - Boolean toDateExists = false; - for (AssignedLocations assignedLocation : assignedLocations) { - if (assignedLocation.getToDate() != null) { - toDates.add(assignedLocation.getToDate()); - toDateExists = true; - } - } - - if (toDateExists) { - long expiryTime = Math.abs(findMinimumDate(toDates).getTime() - new Date().getTime()); - expiryTime = expiryTime / 1000 ; - hashOps.put(username, ASSIGNED_LOCATIONS_HASH_KEY, assignedLocations); - redisTemplate.expire(username, expiryTime , TimeUnit.SECONDS); - } - } - - private Date findMinimumDate(List dates) { - if(!isEmptyOrNull(dates)) { - return Collections.min(dates); - } - return null; - } - - /** - * counts all locations - * @param serverVersion - * @return - */ - public Long countAllLocations(Long serverVersion){ - return locationRepository.countAllLocations(serverVersion); - } - - /** - * counts all structures - * @param serverVersion - * @return - */ - public Long countAllStructures(Long serverVersion){ - return locationRepository.countAllStructures(serverVersion); - } - - public Set buildLocationHeirarchyWithAncestors(String locationId) { - Set locationIds = new HashSet<>(); - locationIds.add(locationId); - Set locationDetails = locationRepository.findParentLocationsInclusive(locationIds); - return locationDetails; - } - - public LocationTree buildLocationTreeHierachyWithAncestors(String locationId, boolean returnStructureCount) { - LocationTree locationTree = new LocationTree(); - Set locationDetails = buildLocationHeirarchyWithAncestors(locationId); - locationTree.buildTreeFromList(getLocations(locationDetails, returnStructureCount)); - return locationTree; - } + return assignedLocations; + } + } + + private boolean isEmptyOrNull(Collection collection) { + return collection == null || collection.isEmpty(); + } + + /** + * Gets the count of locations based on locationIds and server version + * + * @param locationIds the list of locationIds to filter with + * @param serverVersion the server version to filter with + * @return number of records + */ + public long countLocationsByIds(List locationIds, long serverVersion) { + return locationRepository.countLocationsByIds(locationIds, serverVersion); + } + + /** + * This method checks whether the coordinates contained in the locations Geometry are equal + * + * @param newEntity location entity + * @param existingEntity location entity + * @return + */ + public boolean isGeometryCoordsEqual(PhysicalLocation newEntity, PhysicalLocation existingEntity) { + if (newEntity == null || existingEntity == null) { + return false; + } + JsonElement newGeometryCoordsElement = JsonParser.parseString(geometryCoords(newEntity)); + JsonElement existingGeometryCoordsElement = JsonParser.parseString(geometryCoords(existingEntity)); + return newGeometryCoordsElement.equals(existingGeometryCoordsElement); + } + + /** + * Returns the geometry coordinates string. + * + * @param physicalLocation {@link PhysicalLocation} + * @return coordinates {@link String} + */ + private String geometryCoords(PhysicalLocation physicalLocation) { + String geometryCoordinates = ""; + if (physicalLocation != null && physicalLocation.getGeometry() != null + && physicalLocation.getGeometry().getCoordinates() != null) { + geometryCoordinates = physicalLocation.getGeometry().getCoordinates().toString(); + } + return geometryCoordinates; + } + + @Cacheable(value = "locationTreeFromLocation", key = "{ #locationId, #returnStructureCount }") + public LocationTree buildLocationHierachyFromLocation(String locationId, boolean returnStructureCount) { + return buildLocationHierachyFromLocation(locationId, false, returnStructureCount); + } + + /** + * Build full location tree with passed location id as tree root + * + * @param locationId id of the root location + * @return full location hierarchy from passed location plus all of its descendants + */ + @Cacheable(value = "locationTreeFromLocation", key = "{ #locationId, #returnTags, #returnStructureCount }") + public LocationTree buildLocationHierachyFromLocation(String locationId, boolean returnTags, + boolean returnStructureCount) { + LocationTree locationTree = new LocationTree(); + Set locationDetails = locationRepository.findLocationWithDescendants(locationId, returnTags); + locationTree.buildTreeFromList(getLocations(locationDetails, returnStructureCount)); + return locationTree; + } + + private void persistInRedisCache(List assignedLocations, String username) { + List toDates = new ArrayList<>(); + Boolean toDateExists = false; + for (AssignedLocations assignedLocation : assignedLocations) { + if (assignedLocation.getToDate() != null) { + toDates.add(assignedLocation.getToDate()); + toDateExists = true; + } + } + + if (toDateExists) { + long expiryTime = Math.abs(findMinimumDate(toDates).getTime() - new Date().getTime()); + expiryTime = expiryTime / 1000; + hashOps.put(username, ASSIGNED_LOCATIONS_HASH_KEY, assignedLocations); + redisTemplate.expire(username, expiryTime, TimeUnit.SECONDS); + } + } + + private Date findMinimumDate(List dates) { + if (!isEmptyOrNull(dates)) { + return Collections.min(dates); + } + return null; + } + + /** + * counts all locations + * + * @param serverVersion + * @return + */ + public Long countAllLocations(Long serverVersion) { + return locationRepository.countAllLocations(serverVersion); + } + + /** + * counts all structures + * + * @param serverVersion + * @return + */ + public Long countAllStructures(Long serverVersion) { + return locationRepository.countAllStructures(serverVersion); + } + + public Set buildLocationHeirarchyWithAncestors(String locationId) { + Set locationIds = new HashSet<>(); + locationIds.add(locationId); + Set locationDetails = locationRepository.findParentLocationsInclusive(locationIds); + return locationDetails; + } + + public LocationTree buildLocationTreeHierachyWithAncestors(String locationId, boolean returnStructureCount) { + LocationTree locationTree = new LocationTree(); + Set locationDetails = buildLocationHeirarchyWithAncestors(locationId); + locationTree.buildTreeFromList(getLocations(locationDetails, returnStructureCount)); + return locationTree; + } } diff --git a/src/main/java/org/opensrp/service/PlanService.java b/src/main/java/org/opensrp/service/PlanService.java index f307f2a79..7efd7734b 100755 --- a/src/main/java/org/opensrp/service/PlanService.java +++ b/src/main/java/org/opensrp/service/PlanService.java @@ -23,299 +23,300 @@ @Service public class PlanService { - - private PlanRepository planRepository; - - private PractitionerService practitionerService; - - private PractitionerRoleService practitionerRoleService; - - private OrganizationService organizationService; - - private TaskGenerator taskGenerator; - - @Autowired - public PlanService(PlanRepository planRepository, PractitionerService practitionerService, - PractitionerRoleService practitionerRoleService, OrganizationService organizationService, - TaskGenerator taskGenerator) { - - this.planRepository = planRepository; - this.practitionerService = practitionerService; - this.practitionerRoleService=practitionerRoleService; - this.organizationService = organizationService; - this.taskGenerator = taskGenerator; - } - - public PlanRepository getPlanRepository() { - return planRepository; - } - - @PreAuthorize("hasRole('PLAN_VIEW')") - @PostFilter("hasPermission(filterObject, 'PLAN_VIEW')") - public List getAllPlans(PlanSearchBean planSearchBean) { - return getPlanRepository().getAllPlans(planSearchBean); - } - - @PreAuthorize("(hasPermission(#plan,'PlanDefinition', 'PLAN_CREATE') and " - + "hasPermission(#plan,'PlanDefinition', 'PLAN_UPDATE'))") - public void addOrUpdatePlan(PlanDefinition plan,String username) { - if (StringUtils.isBlank(plan.getIdentifier())) { - throw new IllegalArgumentException("Identifier not specified"); - } - plan.setServerVersion(System.currentTimeMillis()); - if (getPlan(plan.getIdentifier()) != null) { - updatePlan(plan, username); - } else { - addPlan(plan, username); - } - } - - /* @formatter:off */ - @PreAuthorize("hasPermission(#plan,'PlanDefinition', 'PLAN_CREATE')") - @CachePut(value = "plans", key = "#plan.identifier") - /* @formatter:on */ - public PlanDefinition addPlan(PlanDefinition plan, String username) { - if (StringUtils.isBlank(plan.getIdentifier())) { - throw new IllegalArgumentException("Identifier not specified"); - } - getPlanRepository().add(plan); - taskGenerator.processPlanEvaluation(plan, null, username); - return plan; - } - - /* @formatter:off */ - @PreAuthorize("hasPermission(#plan,'PlanDefinition', 'PLAN_UPDATE') ") + + private PlanRepository planRepository; + + private PractitionerService practitionerService; + + private PractitionerRoleService practitionerRoleService; + + private OrganizationService organizationService; + + private TaskGenerator taskGenerator; + + @Autowired + public PlanService(PlanRepository planRepository, PractitionerService practitionerService, + PractitionerRoleService practitionerRoleService, OrganizationService organizationService, + TaskGenerator taskGenerator) { + + this.planRepository = planRepository; + this.practitionerService = practitionerService; + this.practitionerRoleService = practitionerRoleService; + this.organizationService = organizationService; + this.taskGenerator = taskGenerator; + } + + public PlanRepository getPlanRepository() { + return planRepository; + } + + @PreAuthorize("hasRole('PLAN_VIEW')") + @PostFilter("hasPermission(filterObject, 'PLAN_VIEW')") + public List getAllPlans(PlanSearchBean planSearchBean) { + return getPlanRepository().getAllPlans(planSearchBean); + } + + @PreAuthorize("(hasPermission(#plan,'PlanDefinition', 'PLAN_CREATE') and " + + "hasPermission(#plan,'PlanDefinition', 'PLAN_UPDATE'))") + public void addOrUpdatePlan(PlanDefinition plan, String username) { + if (StringUtils.isBlank(plan.getIdentifier())) { + throw new IllegalArgumentException("Identifier not specified"); + } + plan.setServerVersion(System.currentTimeMillis()); + if (getPlan(plan.getIdentifier()) != null) { + updatePlan(plan, username); + } else { + addPlan(plan, username); + } + } + + /* @formatter:off */ + @PreAuthorize("hasPermission(#plan,'PlanDefinition', 'PLAN_CREATE')") + @CachePut(value = "plans", key = "#plan.identifier") + /* @formatter:on */ + public PlanDefinition addPlan(PlanDefinition plan, String username) { + if (StringUtils.isBlank(plan.getIdentifier())) { + throw new IllegalArgumentException("Identifier not specified"); + } + getPlanRepository().add(plan); + taskGenerator.processPlanEvaluation(plan, null, username); + return plan; + } + + /* @formatter:off */ + @PreAuthorize("hasPermission(#plan,'PlanDefinition', 'PLAN_UPDATE') ") @CachePut(value = "plans", key = "#plan.identifier") - /* @formatter:on */ - public PlanDefinition updatePlan(PlanDefinition plan, String username) { - if (StringUtils.isBlank(plan.getIdentifier())) { - throw new IllegalArgumentException("Identifier not specified"); - } - PlanDefinition existing = getPlan(plan.getIdentifier()); - getPlanRepository().update(plan); - taskGenerator.processPlanEvaluation(plan, existing, username); - if (plan.getStatus() != null && (plan.getStatus().equals(PlanDefinition.PlanStatus.COMPLETED) || plan.getStatus() - .equals(PlanDefinition.PlanStatus.RETIRED))) { - organizationService.unassignLocationAndPlan(plan.getIdentifier()); - } - return plan; - } - - - @PreAuthorize("hasRole('PLAN_VIEW')") - @PostAuthorize("hasPermission(returnObject,'PlanDefinition', 'PLAN_VIEW')") - @Cacheable(value = "plans", key = "#identifier") - public PlanDefinition getPlan(String identifier) { - return StringUtils.isBlank(identifier) ? null : getPlanRepository().get(identifier); - } - - @PreAuthorize("hasPermission(#operationalAreaIds,'Jurisdiction', 'PLAN_VIEW')") - public List getPlansByServerVersionAndOperationalArea(long serverVersion, - List operationalAreaIds, boolean experimental) { - return getPlanRepository().getPlansByServerVersionAndOperationalAreas(serverVersion, operationalAreaIds, - experimental); - } - - /** - * This method searches for plans using a list of provided plan identifiers and returns a subset of - * fields determined by the list of provided fields If no plan identifier(s) are provided the method - * returns all available plans If no fields are provided the method returns all the available fields - * - * @param ids list of plan identifiers - * @param fields list of fields to return - * @return plan definitions whose identifiers match the provided params - */ - @PreAuthorize("hasRole('PLAN_VIEW')") - @PostFilter("hasPermission(filterObject, 'PLAN_VIEW')") - public List getPlansByIdsReturnOptionalFields(List ids, List fields, boolean experimental) { - return getPlanRepository().getPlansByIdsReturnOptionalFields(ids, fields, experimental); - } - - /** - * Gets the plans using organization Ids that have server version >= the server version param - * - * @param organizationIds the list of organization Ids - * @param serverVersion the server version to filter plans with - * @return the plans matching the above - */ - @PreAuthorize("hasPermission(#organizationIds,'Organization', 'PLAN_VIEW')") - public List getPlansByOrganizationsAndServerVersion(List organizationIds, long serverVersion, - boolean experimental) { - - List assignedPlansAndLocations = organizationService - .findAssignedLocationsAndPlans(organizationIds); - List planIdentifiers = new ArrayList<>(); - for (AssignedLocations assignedLocation : assignedPlansAndLocations) { - planIdentifiers.add(assignedLocation.getPlanId()); - } - return planRepository.getPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion, experimental); - } - - /** - * Gets the plan identifiers using organization Ids - * - * @param organizationIds the list of organization Ids - * @return the plan identifiers matching the above - */ - @PreAuthorize("hasPermission(#organizationIds,'Organization', 'PLAN_VIEW')") - public List getPlanIdentifiersByOrganizations(List organizationIds) { - - List assignedPlansAndLocations = organizationService - .findAssignedLocationsAndPlans(organizationIds); - List planIdentifiers = new ArrayList<>(); - for (AssignedLocations assignedLocation : assignedPlansAndLocations) { - planIdentifiers.add(assignedLocation.getPlanId()); - } - return planIdentifiers; - } - - /** - * Gets the plans that a user has access to according to the plan location assignment that have - * server version >= the server version param - * - * @param username the username of user - * @param serverVersion the server version to filter plans with - * @return the plans a user has access to - */ - - @PreAuthorize("hasPermission(#username,'User', 'PLAN_VIEW')") - public List getPlansByUsernameAndServerVersion(String username, long serverVersion, - boolean experimental) { - - List organizationIds = getOrganizationIdsByUserName(username); - - if (organizationIds != null) { - return getPlansByOrganizationsAndServerVersion(organizationIds, serverVersion, experimental); - } - return null; - } - - /** - * Gets the plan identifiers that a user has access to according to the plan location assignment - * - * @param username the username of user - * @return the plans a user has access to - */ - @PreAuthorize("hasRole('PLAN_ADMIN') or hasPermission(#username,'User', 'PLAN_VIEW')") - public List getPlanIdentifiersByUsername(String username) { - List organizationIds = practitionerService.getOrganizationIdsByUserName(username); - if (organizationIds != null) { - return getPlanIdentifiersByOrganizations(organizationIds); - } - return null; - } - - /** - * Gets the organization ids that a user is assigned to according to the plan location assignment - * - * @param username the username of user - * @return the organization ids a user is assigned to - */ - public List getOrganizationIdsByUserName(String username) { - org.smartregister.domain.Practitioner practitioner = practitionerService.getPractionerByUsername(username); - if (practitioner != null) { - List roles = practitionerRoleService.getPgRolesForPractitioner(practitioner.getIdentifier()); - if (roles.isEmpty()) - return null; - List organizationIds = new ArrayList<>(); - for (PractitionerRole role : roles) - organizationIds.add(role.getOrganizationId()); - return organizationIds; - } - - return null; - } - - /** - * This method searches for plans ordered by serverVersion ascending - * - * @param serverVersion - * @param limit upper limit on number of plans to fetch - * @return list of plan identifiers - */ - @PreAuthorize("hasRole('PLAN_ADMIN')") - @PostFilter("hasPermission(filterObject, 'PLAN_VIEW')") - public List getAllPlans(Long serverVersion, int limit, boolean experimental) { - return getPlanRepository().getAllPlans(serverVersion, limit, experimental); - } - - /** - * counts all plans - * @param serverVersion - * @param experimental - * @return - */ - public Long countAllPlans(Long serverVersion, boolean experimental) { - return getPlanRepository().countAllPlans(serverVersion, experimental); - } - - /** - * This method searches for all location ids - * - * @param serverVersion - * @param limit upper limit on number of plans to fetch - * @param isDeleted whether to return deleted plan ids - * @return a list of location ids and the last server version - */ - @PreAuthorize("hasRole('PLAN_ADMIN')") - public Pair, Long> findAllIds(Long serverVersion, int limit, boolean isDeleted) { - return planRepository.findAllIds(serverVersion, limit, isDeleted); - } - - /** - * overloads {@link #findAllIds(Long, int, boolean)} by adding date/time filters - * - * @param serverVersion - * @param limit - * @param isDeleted - * @param fromDate - * @param toDate - * @return - */ - public Pair, Long> findAllIds(Long serverVersion, int limit, boolean isDeleted, Date fromDate, - Date toDate) { - return planRepository.findAllIds(serverVersion, limit, isDeleted, fromDate, toDate); - } - - /** - * Gets the count of plans using organization Ids that have server version >= the server version - * param - * - * @param organizationIds the list of organization Ids - * @param serverVersion the server version to filter plans with - * @return the count plans matching the above - */ - @PreAuthorize("hasPermission(#organizationIds,'Organization', 'PLAN_VIEW')") - public Long countPlansByOrganizationsAndServerVersion(List organizationIds, long serverVersion) { - - List assignedPlansAndLocations = organizationService - .findAssignedLocationsAndPlans(organizationIds); - /* @formatter:off */ - List planIdentifiers = assignedPlansAndLocations - .stream() - .map(a -> a.getPlanId()) - .collect(Collectors.toList()); - /* @formatter:on */ - return planRepository.countPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion); - } - - /** - * Gets the count of plans that a user has access to according to the plan location assignment that - * have server version >= the server version param - * - * @param username the username of user - * @param serverVersion the server version to filter plans with - * @return the count of plans a user has access to - */ - @PreAuthorize("hasPermission(#username,'User', 'PLAN_VIEW')") - public Long countPlansByUsernameAndServerVersion(String username, long serverVersion) { - - List organizationIds = practitionerService.getOrganizationIdsByUserName(username); - - if (organizationIds != null) { - return countPlansByOrganizationsAndServerVersion(organizationIds, serverVersion); - } - return 0l; - } + /* @formatter:on */ + public PlanDefinition updatePlan(PlanDefinition plan, String username) { + if (StringUtils.isBlank(plan.getIdentifier())) { + throw new IllegalArgumentException("Identifier not specified"); + } + PlanDefinition existing = getPlan(plan.getIdentifier()); + getPlanRepository().update(plan); + taskGenerator.processPlanEvaluation(plan, existing, username); + if (plan.getStatus() != null && (plan.getStatus().equals(PlanDefinition.PlanStatus.COMPLETED) || plan.getStatus() + .equals(PlanDefinition.PlanStatus.RETIRED))) { + organizationService.unassignLocationAndPlan(plan.getIdentifier()); + } + return plan; + } + + + @PreAuthorize("hasRole('PLAN_VIEW')") + @PostAuthorize("hasPermission(returnObject,'PlanDefinition', 'PLAN_VIEW')") + @Cacheable(value = "plans", key = "#identifier") + public PlanDefinition getPlan(String identifier) { + return StringUtils.isBlank(identifier) ? null : getPlanRepository().get(identifier); + } + + @PreAuthorize("hasPermission(#operationalAreaIds,'Jurisdiction', 'PLAN_VIEW')") + public List getPlansByServerVersionAndOperationalArea(long serverVersion, + List operationalAreaIds, boolean experimental) { + return getPlanRepository().getPlansByServerVersionAndOperationalAreas(serverVersion, operationalAreaIds, + experimental); + } + + /** + * This method searches for plans using a list of provided plan identifiers and returns a subset of + * fields determined by the list of provided fields If no plan identifier(s) are provided the method + * returns all available plans If no fields are provided the method returns all the available fields + * + * @param ids list of plan identifiers + * @param fields list of fields to return + * @return plan definitions whose identifiers match the provided params + */ + @PreAuthorize("hasRole('PLAN_VIEW')") + @PostFilter("hasPermission(filterObject, 'PLAN_VIEW')") + public List getPlansByIdsReturnOptionalFields(List ids, List fields, boolean experimental) { + return getPlanRepository().getPlansByIdsReturnOptionalFields(ids, fields, experimental); + } + + /** + * Gets the plans using organization Ids that have server version >= the server version param + * + * @param organizationIds the list of organization Ids + * @param serverVersion the server version to filter plans with + * @return the plans matching the above + */ + @PreAuthorize("hasPermission(#organizationIds,'Organization', 'PLAN_VIEW')") + public List getPlansByOrganizationsAndServerVersion(List organizationIds, long serverVersion, + boolean experimental) { + + List assignedPlansAndLocations = organizationService + .findAssignedLocationsAndPlans(organizationIds); + List planIdentifiers = new ArrayList<>(); + for (AssignedLocations assignedLocation : assignedPlansAndLocations) { + planIdentifiers.add(assignedLocation.getPlanId()); + } + return planRepository.getPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion, experimental); + } + + /** + * Gets the plan identifiers using organization Ids + * + * @param organizationIds the list of organization Ids + * @return the plan identifiers matching the above + */ + @PreAuthorize("hasPermission(#organizationIds,'Organization', 'PLAN_VIEW')") + public List getPlanIdentifiersByOrganizations(List organizationIds) { + + List assignedPlansAndLocations = organizationService + .findAssignedLocationsAndPlans(organizationIds); + List planIdentifiers = new ArrayList<>(); + for (AssignedLocations assignedLocation : assignedPlansAndLocations) { + planIdentifiers.add(assignedLocation.getPlanId()); + } + return planIdentifiers; + } + + /** + * Gets the plans that a user has access to according to the plan location assignment that have + * server version >= the server version param + * + * @param username the username of user + * @param serverVersion the server version to filter plans with + * @return the plans a user has access to + */ + + @PreAuthorize("hasPermission(#username,'User', 'PLAN_VIEW')") + public List getPlansByUsernameAndServerVersion(String username, long serverVersion, + boolean experimental) { + + List organizationIds = getOrganizationIdsByUserName(username); + + if (organizationIds != null) { + return getPlansByOrganizationsAndServerVersion(organizationIds, serverVersion, experimental); + } + return null; + } + + /** + * Gets the plan identifiers that a user has access to according to the plan location assignment + * + * @param username the username of user + * @return the plans a user has access to + */ + @PreAuthorize("hasRole('PLAN_ADMIN') or hasPermission(#username,'User', 'PLAN_VIEW')") + public List getPlanIdentifiersByUsername(String username) { + List organizationIds = practitionerService.getOrganizationIdsByUserName(username); + if (organizationIds != null) { + return getPlanIdentifiersByOrganizations(organizationIds); + } + return null; + } + + /** + * Gets the organization ids that a user is assigned to according to the plan location assignment + * + * @param username the username of user + * @return the organization ids a user is assigned to + */ + public List getOrganizationIdsByUserName(String username) { + org.smartregister.domain.Practitioner practitioner = practitionerService.getPractionerByUsername(username); + if (practitioner != null) { + List roles = practitionerRoleService.getPgRolesForPractitioner(practitioner.getIdentifier()); + if (roles.isEmpty()) + return null; + List organizationIds = new ArrayList<>(); + for (PractitionerRole role : roles) + organizationIds.add(role.getOrganizationId()); + return organizationIds; + } + + return null; + } + + /** + * This method searches for plans ordered by serverVersion ascending + * + * @param serverVersion + * @param limit upper limit on number of plans to fetch + * @return list of plan identifiers + */ + @PreAuthorize("hasRole('PLAN_ADMIN')") + @PostFilter("hasPermission(filterObject, 'PLAN_VIEW')") + public List getAllPlans(Long serverVersion, int limit, boolean experimental) { + return getPlanRepository().getAllPlans(serverVersion, limit, experimental); + } + + /** + * counts all plans + * + * @param serverVersion + * @param experimental + * @return + */ + public Long countAllPlans(Long serverVersion, boolean experimental) { + return getPlanRepository().countAllPlans(serverVersion, experimental); + } + + /** + * This method searches for all location ids + * + * @param serverVersion + * @param limit upper limit on number of plans to fetch + * @param isDeleted whether to return deleted plan ids + * @return a list of location ids and the last server version + */ + @PreAuthorize("hasRole('PLAN_ADMIN')") + public Pair, Long> findAllIds(Long serverVersion, int limit, boolean isDeleted) { + return planRepository.findAllIds(serverVersion, limit, isDeleted); + } + + /** + * overloads {@link #findAllIds(Long, int, boolean)} by adding date/time filters + * + * @param serverVersion + * @param limit + * @param isDeleted + * @param fromDate + * @param toDate + * @return + */ + public Pair, Long> findAllIds(Long serverVersion, int limit, boolean isDeleted, Date fromDate, + Date toDate) { + return planRepository.findAllIds(serverVersion, limit, isDeleted, fromDate, toDate); + } + + /** + * Gets the count of plans using organization Ids that have server version >= the server version + * param + * + * @param organizationIds the list of organization Ids + * @param serverVersion the server version to filter plans with + * @return the count plans matching the above + */ + @PreAuthorize("hasPermission(#organizationIds,'Organization', 'PLAN_VIEW')") + public Long countPlansByOrganizationsAndServerVersion(List organizationIds, long serverVersion) { + + List assignedPlansAndLocations = organizationService + .findAssignedLocationsAndPlans(organizationIds); + /* @formatter:off */ + List planIdentifiers = assignedPlansAndLocations + .stream() + .map(a -> a.getPlanId()) + .collect(Collectors.toList()); + /* @formatter:on */ + return planRepository.countPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion); + } + + /** + * Gets the count of plans that a user has access to according to the plan location assignment that + * have server version >= the server version param + * + * @param username the username of user + * @param serverVersion the server version to filter plans with + * @return the count of plans a user has access to + */ + @PreAuthorize("hasPermission(#username,'User', 'PLAN_VIEW')") + public Long countPlansByUsernameAndServerVersion(String username, long serverVersion) { + + List organizationIds = practitionerService.getOrganizationIdsByUserName(username); + + if (organizationIds != null) { + return countPlansByOrganizationsAndServerVersion(organizationIds, serverVersion); + } + return 0l; + } } diff --git a/src/main/java/org/opensrp/service/PractitionerRoleService.java b/src/main/java/org/opensrp/service/PractitionerRoleService.java index 8873f3402..3728c0af2 100755 --- a/src/main/java/org/opensrp/service/PractitionerRoleService.java +++ b/src/main/java/org/opensrp/service/PractitionerRoleService.java @@ -17,145 +17,145 @@ @Service public class PractitionerRoleService { - - private PractitionerRoleRepository practitionerRoleRepository; - - private PractitionerService practitionerService; - - private OrganizationService organizationService; - - @Autowired - public void setPractitionerRoleRepository(PractitionerRoleRepository practitionerRoleRepository) { - this.practitionerRoleRepository = practitionerRoleRepository; - } - - /** - * @param practitionerService the practitionerService to set - */ - @Autowired - @Lazy - public void setPractitionerService(PractitionerService practitionerService) { - this.practitionerService = practitionerService; - } - - /** - * @param organizationService the organizationService to set - */ - @Lazy - public void setOrganizationService(OrganizationService organizationService) { - this.organizationService = organizationService; - } - - public PractitionerRoleRepository getPractitionerRoleRepository() { - return practitionerRoleRepository; - } - - @PreAuthorize("hasRole('PRACTITIONER_ROLE_VIEW')") - @PostAuthorize("hasPermission(returnObject, 'PRACTITIONER_ROLE_VIEW')") - public PractitionerRole getPractitionerRole(String identifier) { - return StringUtils.isBlank(identifier) ? null : getPractitionerRoleRepository().get(identifier); - } - - @PreAuthorize("hasRole('PRACTITIONER_ROLE_VIEW')") - @PostFilter("hasPermission(returnObject, 'PRACTITIONER_ROLE_VIEW')") - public List getAllPractitionerRoles(PractitionerRoleSearchBean practitionerRoleSearchBean) { - return getPractitionerRoleRepository().getAllPractitionerRoles(practitionerRoleSearchBean); - } - - @PreAuthorize("(hasPermission(#practitionerRole,'PractitionerRole', 'PRACTITIONER_ROLE_VIEW') and " - + "hasPermission(#practitionerRole,'PractitionerRole', 'PRACTITIONER_ROLE_CREATE') and " - + "hasPermission(#practitionerRole,'PractitionerRole', 'PRACTITIONER_ROLE_UPDATE'))") - public PractitionerRole addOrUpdatePractitionerRole(PractitionerRole practitionerRole) { - if (StringUtils.isBlank(practitionerRole.getIdentifier())) { - throw new IllegalArgumentException("Identifier not specified"); - } - - if (getPractitionerRoleRepository().get(practitionerRole.getIdentifier()) != null) { - getPractitionerRoleRepository().update(practitionerRole); - } else { - getPractitionerRoleRepository().add(practitionerRole); - } - return practitionerRole; - } - - @PreAuthorize("hasPermission(#practitionerIdentifier,'PractitionerRole', 'PRACTITIONER_ROLE_DELETE')") - public void deletePractitionerRole(PractitionerRole practitionerRole) { - if (StringUtils.isBlank(practitionerRole.getIdentifier())) { - throw new IllegalArgumentException("Identifier not specified"); - } - - getPractitionerRoleRepository().safeRemove(practitionerRole); - } - - @PreAuthorize("hasPermission(#identifier,'PractitionerRole', 'PRACTITIONER_ROLE_DELETE')") - public void deletePractitionerRole(String identifier) { - if (StringUtils.isBlank(identifier)) { - throw new IllegalArgumentException("Identifier not specified"); - } - - getPractitionerRoleRepository().safeRemove(identifier); - } - - @PreAuthorize("hasPermission(#practitionerIdentifier,'PractitionerRole', 'PRACTITIONER_ROLE_DELETE')") - public void deletePractitionerRole(String organizationIdentifier, String practitionerIdentifier) { - if (StringUtils.isBlank(organizationIdentifier) || StringUtils.isBlank(practitionerIdentifier)) { - throw new IllegalArgumentException("Organization Identifier or Practitioner Identifier not specified"); - } - - Organization organization = organizationService.getOrganization(organizationIdentifier); - - Practitioner pgPractitioner = practitionerService.getPgPractitioner(practitionerIdentifier); - - if (organization == null || pgPractitioner == null) { - return; - } - - getPractitionerRoleRepository().safeRemove(organization.getId(), pgPractitioner.getId()); - } - - @PreAuthorize("hasRole('PRACTITIONER_ROLE_VIEW')") - @PostFilter("hasPermission(filterObject, 'PRACTITIONER_ROLE_VIEW')") - public List getRolesForPractitioner(String practitionerIdentifier) { - if (StringUtils.isBlank(practitionerIdentifier)) { - throw new IllegalArgumentException("Identifier not specified"); - } - - return getPractitionerRoleRepository().getRolesForPractitioner(practitionerIdentifier); - } - - @PreAuthorize("hasRole('PRACTITIONER_ROLE_VIEW')") - @PostFilter("hasPermission(filterObject, 'PRACTITIONER_ROLE_VIEW')") - public List getPgRolesForPractitioner(String practitionerIdentifier) { - if (StringUtils.isBlank(practitionerIdentifier)) { - throw new IllegalArgumentException("Identifier not specified"); - } - - return getPractitionerRoleRepository().getPgRolesForPractitioner(practitionerIdentifier); - } - - @PreAuthorize("hasPermission(#identifier,'PractitionerRole', 'PRACTITIONER_ROLE_ASSIGN')") - public void assignPractitionerRole(Long organizationId, String practitionerIdentifier, String code, - PractitionerRole practitionerRole) { - validateIdentifier(practitionerRole.getIdentifier()); - Long practitionerId = practitionerService.getPractitionerIdByIdentifier(practitionerIdentifier); - if (practitionerId == null) { - throw new IllegalArgumentException("Practitioner not found by the identifier : " + practitionerIdentifier); - } - practitionerRoleRepository.assignPractitionerRole(organizationId, practitionerId, practitionerIdentifier, code, - practitionerRole); - } - - public void validateIdentifier(String identifier) { - if (StringUtils.isBlank(identifier)) - throw new IllegalArgumentException("Practitioner Role Identifier not specified"); - } - + + private PractitionerRoleRepository practitionerRoleRepository; + + private PractitionerService practitionerService; + + private OrganizationService organizationService; + + /** + * @param practitionerService the practitionerService to set + */ + @Autowired + @Lazy + public void setPractitionerService(PractitionerService practitionerService) { + this.practitionerService = practitionerService; + } + + /** + * @param organizationService the organizationService to set + */ + @Lazy + public void setOrganizationService(OrganizationService organizationService) { + this.organizationService = organizationService; + } + + public PractitionerRoleRepository getPractitionerRoleRepository() { + return practitionerRoleRepository; + } + + @Autowired + public void setPractitionerRoleRepository(PractitionerRoleRepository practitionerRoleRepository) { + this.practitionerRoleRepository = practitionerRoleRepository; + } + + @PreAuthorize("hasRole('PRACTITIONER_ROLE_VIEW')") + @PostAuthorize("hasPermission(returnObject, 'PRACTITIONER_ROLE_VIEW')") + public PractitionerRole getPractitionerRole(String identifier) { + return StringUtils.isBlank(identifier) ? null : getPractitionerRoleRepository().get(identifier); + } + + @PreAuthorize("hasRole('PRACTITIONER_ROLE_VIEW')") + @PostFilter("hasPermission(returnObject, 'PRACTITIONER_ROLE_VIEW')") + public List getAllPractitionerRoles(PractitionerRoleSearchBean practitionerRoleSearchBean) { + return getPractitionerRoleRepository().getAllPractitionerRoles(practitionerRoleSearchBean); + } + + @PreAuthorize("(hasPermission(#practitionerRole,'PractitionerRole', 'PRACTITIONER_ROLE_VIEW') and " + + "hasPermission(#practitionerRole,'PractitionerRole', 'PRACTITIONER_ROLE_CREATE') and " + + "hasPermission(#practitionerRole,'PractitionerRole', 'PRACTITIONER_ROLE_UPDATE'))") + public PractitionerRole addOrUpdatePractitionerRole(PractitionerRole practitionerRole) { + if (StringUtils.isBlank(practitionerRole.getIdentifier())) { + throw new IllegalArgumentException("Identifier not specified"); + } + + if (getPractitionerRoleRepository().get(practitionerRole.getIdentifier()) != null) { + getPractitionerRoleRepository().update(practitionerRole); + } else { + getPractitionerRoleRepository().add(practitionerRole); + } + return practitionerRole; + } + + @PreAuthorize("hasPermission(#practitionerIdentifier,'PractitionerRole', 'PRACTITIONER_ROLE_DELETE')") + public void deletePractitionerRole(PractitionerRole practitionerRole) { + if (StringUtils.isBlank(practitionerRole.getIdentifier())) { + throw new IllegalArgumentException("Identifier not specified"); + } + + getPractitionerRoleRepository().safeRemove(practitionerRole); + } + + @PreAuthorize("hasPermission(#identifier,'PractitionerRole', 'PRACTITIONER_ROLE_DELETE')") + public void deletePractitionerRole(String identifier) { + if (StringUtils.isBlank(identifier)) { + throw new IllegalArgumentException("Identifier not specified"); + } + + getPractitionerRoleRepository().safeRemove(identifier); + } + + @PreAuthorize("hasPermission(#practitionerIdentifier,'PractitionerRole', 'PRACTITIONER_ROLE_DELETE')") + public void deletePractitionerRole(String organizationIdentifier, String practitionerIdentifier) { + if (StringUtils.isBlank(organizationIdentifier) || StringUtils.isBlank(practitionerIdentifier)) { + throw new IllegalArgumentException("Organization Identifier or Practitioner Identifier not specified"); + } + + Organization organization = organizationService.getOrganization(organizationIdentifier); + + Practitioner pgPractitioner = practitionerService.getPgPractitioner(practitionerIdentifier); + + if (organization == null || pgPractitioner == null) { + return; + } + + getPractitionerRoleRepository().safeRemove(organization.getId(), pgPractitioner.getId()); + } + + @PreAuthorize("hasRole('PRACTITIONER_ROLE_VIEW')") + @PostFilter("hasPermission(filterObject, 'PRACTITIONER_ROLE_VIEW')") + public List getRolesForPractitioner(String practitionerIdentifier) { + if (StringUtils.isBlank(practitionerIdentifier)) { + throw new IllegalArgumentException("Identifier not specified"); + } + + return getPractitionerRoleRepository().getRolesForPractitioner(practitionerIdentifier); + } + + @PreAuthorize("hasRole('PRACTITIONER_ROLE_VIEW')") + @PostFilter("hasPermission(filterObject, 'PRACTITIONER_ROLE_VIEW')") + public List getPgRolesForPractitioner(String practitionerIdentifier) { + if (StringUtils.isBlank(practitionerIdentifier)) { + throw new IllegalArgumentException("Identifier not specified"); + } + + return getPractitionerRoleRepository().getPgRolesForPractitioner(practitionerIdentifier); + } + + @PreAuthorize("hasPermission(#identifier,'PractitionerRole', 'PRACTITIONER_ROLE_ASSIGN')") + public void assignPractitionerRole(Long organizationId, String practitionerIdentifier, String code, + PractitionerRole practitionerRole) { + validateIdentifier(practitionerRole.getIdentifier()); + Long practitionerId = practitionerService.getPractitionerIdByIdentifier(practitionerIdentifier); + if (practitionerId == null) { + throw new IllegalArgumentException("Practitioner not found by the identifier : " + practitionerIdentifier); + } + practitionerRoleRepository.assignPractitionerRole(organizationId, practitionerId, practitionerIdentifier, code, + practitionerRole); + } + + public void validateIdentifier(String identifier) { + if (StringUtils.isBlank(identifier)) + throw new IllegalArgumentException("Practitioner Role Identifier not specified"); + } + public List getPractitionerRolesByOrgIdAndCode(Long organizationId, String code) { - return practitionerRoleRepository.getPractitionerRolesByOrgIdAndCode(organizationId, code); + return practitionerRoleRepository.getPractitionerRolesByOrgIdAndCode(organizationId, code); } - @PreAuthorize("hasRole('PRACTITIONER_ROLE_VIEW')") + @PreAuthorize("hasRole('PRACTITIONER_ROLE_VIEW')") public long countAllPractitionerRoles() { return practitionerRoleRepository.countAllPractitionerRoles(); } diff --git a/src/main/java/org/opensrp/service/PractitionerService.java b/src/main/java/org/opensrp/service/PractitionerService.java index 63b9ad3c5..d83ef59ad 100755 --- a/src/main/java/org/opensrp/service/PractitionerService.java +++ b/src/main/java/org/opensrp/service/PractitionerService.java @@ -20,231 +20,230 @@ @Service public class PractitionerService { - - private PractitionerRepository practitionerRepository; - - private PractitionerRoleService practitionerRoleService; - - private OrganizationService organizationService; - - @Autowired - public void setPractitionerRepository(PractitionerRepository practitionerRepository) { - this.practitionerRepository = practitionerRepository; - } - - /** - * @param practitionerRoleService the practitionerRoleService to set - */ - @Autowired - public void setPractitionerRoleService(PractitionerRoleService practitionerRoleService) { - this.practitionerRoleService = practitionerRoleService; - } - - @Autowired - public void setOrganizationService(OrganizationService organizationService) { - this.organizationService = organizationService; - } - - public PractitionerRepository getPractitionerRepository() { - return practitionerRepository; - } - - @PreAuthorize("hasRole('PRACTITIONER_VIEW')") - @PostAuthorize("hasPermission(returnObject, 'PRACTITIONER_VIEW')") - public Practitioner getPractitioner(String identifier) { - return StringUtils.isBlank(identifier) ? null : getPractitionerRepository().get(identifier); - } - - @PreAuthorize("hasRole('PRACTITIONER_VIEW')") - @PostAuthorize("hasPermission(returnObject, 'PRACTITIONER_VIEW')") - public org.opensrp.domain.postgres.Practitioner getPgPractitioner(String identifier) { - return StringUtils.isBlank(identifier) ? null : getPractitionerRepository().getPractitioner(identifier); - } - - @PreAuthorize("hasRole('PRACTITIONER_VIEW')") - @PostFilter("hasPermission(filterObject, 'PRACTITIONER_VIEW')") - public List getAllPractitioners(PractitionerSearchBean practitionerSearchBean) { - return getPractitionerRepository().getAllPractitioners(practitionerSearchBean); - } - - @PreAuthorize("hasPermission(#practitioner,'Practitioner','PRACTITIONER_CREATE') or hasPermission(#practitioner,'Practitioner','PRACTITIONER_UPDATE')") - public Practitioner addOrUpdatePractitioner(Practitioner practitioner) { - if (StringUtils.isBlank(practitioner.getIdentifier())) { - throw new IllegalArgumentException("Identifier not specified"); - } - - if (getPractitionerRepository().get(practitioner.getIdentifier()) != null) { - practitioner.setDateEdited(DateTime.now()); - getPractitionerRepository().update(practitioner); - } else { - practitioner.setDateCreated(DateTime.now()); - getPractitionerRepository().add(practitioner); - } - return practitioner; - } - - @PreAuthorize("hasPermission(#practitioner,'Practitioner','PRACTITIONER_DELETE')") - public void deletePractitioner(Practitioner practitioner) { - if (StringUtils.isBlank(practitioner.getIdentifier())) { - throw new IllegalArgumentException("Identifier not specified"); - } - - getPractitionerRepository().safeRemove(practitioner); - - } - - @PreAuthorize("hasPermission(#identifier,'Practitioner','PRACTITIONER_DELETE')") - public void deletePractitioner(String identifier) { - if (StringUtils.isBlank(identifier)) { - throw new IllegalArgumentException("Identifier not specified"); - } - - getPractitionerRepository().safeRemove(identifier); - - } - - @PreAuthorize("hasRole('PRACTITIONER_VIEW')") - @PostFilter("hasPermission(filterObject, 'PRACTITIONER_VIEW')") - public ImmutablePair> getOrganizationsByUserId(String userId) { - Practitioner practioner = getPractitionerRepository().getPractitionerByUserId(userId); - List organizationIds = new ArrayList<>(); - for (PractitionerRole practitionerRole : practitionerRoleService - .getPgRolesForPractitioner(practioner.getIdentifier())) { - organizationIds.add(practitionerRole.getOrganizationId()); - } - return new ImmutablePair<>(practioner, organizationIds); - - } - - /** - * Get practitioner using username - * - * - * @param username - * @return practitioner with the username - */ - @PreAuthorize("hasRole('PRACTITIONER_VIEW')") - @PostFilter("hasPermission(filterObject, 'PRACTITIONER_VIEW')") - public Practitioner getPractionerByUsername(String username) { - return getPractitionerRepository().getPractitionerByUsername(username); - - } - - /** - * Gets the organization ids that a user is assigned to according to the plan location - * assignment - * - * @param username the username of user - * @return the organization ids a user is assigned to - */ - @PreAuthorize("hasPermission(#username,'User', 'PRACTITIONER_VIEW')") - public List getOrganizationIdsByUserName(String username) { - Practitioner practitioner = getPractionerByUsername(username); - if (practitioner != null) { - return practitionerRoleService.getPgRolesForPractitioner(practitioner.getIdentifier()).stream() - .map(role -> role.getOrganizationId()).collect(Collectors.toList()); - } - - return null; - } - - /** - * Get practitioner using the user id - * - * @param userId {@link String}, User id from keycloak - * @return practitioner {@link Practitioner} - */ - public Practitioner getPractitionerByUserId(String userId) { - return getPractitionerRepository().getPractitionerByUserId(userId); - } - - public List getPractitionersByOrgIdentifier(String organizationIdentifier) { - organizationService.validateIdentifier(organizationIdentifier); - Organization organization = organizationService.getOrganization(organizationIdentifier); - - if (organization == null) { - throw new IllegalArgumentException("Organization does not exist"); - } - - return getPractitionerRepository().getPractitionersByOrgId(organization.getId()); - } - - - /** - * Gets the organization ids that a user is assigned to according to the plan location - * assignment - * - * @param userId the userId of user - * @return the organization ids a user is assigned to - */ - @PreAuthorize("hasPermission(#userId,'UserId', 'PRACTITIONER_VIEW')") - public List getOrganizationIdsByUserId(String userId) { - Practitioner practitioner = getPractitionerRepository().getPractitionerByUserId(userId); - if (practitioner != null) { - return practitionerRoleService.getPgRolesForPractitioner(practitioner.getIdentifier()).stream() - .map(role -> role.getOrganizationId()).collect(Collectors.toList()); - } - - return null; - } - - public Long getPractitionerIdByIdentifier(String identifier) { - org.opensrp.domain.postgres.Practitioner pgPractitioner = getPgPractitioner(identifier); - return pgPractitioner != null ? pgPractitioner.getId() : null; - } - - public List getPractitionersByOrgId(Long orgId) { - return practitionerRepository.getPractitionersByOrgId(orgId); - } - - public List getPractitionersByIdentifiers(List practitionerIdentifiers) { - List practitioners = new ArrayList<>(); - if (practitionerIdentifiers != null && practitionerIdentifiers.size() > 0) { - practitioners = practitionerRepository.getAllPractitionersByIdentifiers(practitionerIdentifiers); - } - return practitioners; - } - - public List getAssignedPractitionersByIdentifierAndCode(String practitionerIdentifier, String code) { - List organizationIds = new ArrayList<>(); - List practitionerRolesOfPractitioner = practitionerRoleService.getPgRolesForPractitioner(practitionerIdentifier); - if (practitionerRolesOfPractitioner != null) { - for (PractitionerRole practitionerRole : practitionerRolesOfPractitioner) { - if (practitionerRole.getOrganizationId() != null) { - organizationIds.add(practitionerRole.getOrganizationId()); - } - } - } - - // Retrieved teams, now get all members of the team - List practitionerRoles = new ArrayList<>(); - List practitionerIdentifiers = new ArrayList<>(); - for(Long organizationId : organizationIds) { - practitionerRoles = practitionerRoleService.getPractitionerRolesByOrgIdAndCode(organizationId,code); - practitionerRoles.stream().forEach(practitionerRole -> practitionerIdentifiers.add(practitionerRole.getPractitionerIdentifier())); - } - - // Now get all practitioners by the given Ids - return getPractitionersByIdentifiers(practitionerIdentifiers); - } - - @PreAuthorize("hasRole('PRACTITIONER_VIEW')") - public long countAllPractitioners () { - return getPractitionerRepository().countAllPractitioners(); - } - - @PreAuthorize("hasRole('ORGANIZATION_VIEW')") - @PostFilter("hasPermission(filterObject, 'ORGANIZATION_VIEW')") - public ImmutablePair> getOrganizationsByPractitionerIdentifier(String practitionerIdentifier) { - Practitioner practioner = getPractitionerRepository().getPractitionerByIdentifier(practitionerIdentifier); - List organizationIds = new ArrayList<>(); - if (practioner != null && practioner.getIdentifier() != null) { - for (PractitionerRole practitionerRole : practitionerRoleService - .getPgRolesForPractitioner(practioner.getIdentifier())) { - organizationIds.add(practitionerRole.getOrganizationId()); - } - } - return new ImmutablePair<>(practioner, organizationIds); - } + + private PractitionerRepository practitionerRepository; + + private PractitionerRoleService practitionerRoleService; + + private OrganizationService organizationService; + + /** + * @param practitionerRoleService the practitionerRoleService to set + */ + @Autowired + public void setPractitionerRoleService(PractitionerRoleService practitionerRoleService) { + this.practitionerRoleService = practitionerRoleService; + } + + @Autowired + public void setOrganizationService(OrganizationService organizationService) { + this.organizationService = organizationService; + } + + public PractitionerRepository getPractitionerRepository() { + return practitionerRepository; + } + + @Autowired + public void setPractitionerRepository(PractitionerRepository practitionerRepository) { + this.practitionerRepository = practitionerRepository; + } + + @PreAuthorize("hasRole('PRACTITIONER_VIEW')") + @PostAuthorize("hasPermission(returnObject, 'PRACTITIONER_VIEW')") + public Practitioner getPractitioner(String identifier) { + return StringUtils.isBlank(identifier) ? null : getPractitionerRepository().get(identifier); + } + + @PreAuthorize("hasRole('PRACTITIONER_VIEW')") + @PostAuthorize("hasPermission(returnObject, 'PRACTITIONER_VIEW')") + public org.opensrp.domain.postgres.Practitioner getPgPractitioner(String identifier) { + return StringUtils.isBlank(identifier) ? null : getPractitionerRepository().getPractitioner(identifier); + } + + @PreAuthorize("hasRole('PRACTITIONER_VIEW')") + @PostFilter("hasPermission(filterObject, 'PRACTITIONER_VIEW')") + public List getAllPractitioners(PractitionerSearchBean practitionerSearchBean) { + return getPractitionerRepository().getAllPractitioners(practitionerSearchBean); + } + + @PreAuthorize("hasPermission(#practitioner,'Practitioner','PRACTITIONER_CREATE') or hasPermission(#practitioner,'Practitioner','PRACTITIONER_UPDATE')") + public Practitioner addOrUpdatePractitioner(Practitioner practitioner) { + if (StringUtils.isBlank(practitioner.getIdentifier())) { + throw new IllegalArgumentException("Identifier not specified"); + } + + if (getPractitionerRepository().get(practitioner.getIdentifier()) != null) { + practitioner.setDateEdited(DateTime.now()); + getPractitionerRepository().update(practitioner); + } else { + practitioner.setDateCreated(DateTime.now()); + getPractitionerRepository().add(practitioner); + } + return practitioner; + } + + @PreAuthorize("hasPermission(#practitioner,'Practitioner','PRACTITIONER_DELETE')") + public void deletePractitioner(Practitioner practitioner) { + if (StringUtils.isBlank(practitioner.getIdentifier())) { + throw new IllegalArgumentException("Identifier not specified"); + } + + getPractitionerRepository().safeRemove(practitioner); + + } + + @PreAuthorize("hasPermission(#identifier,'Practitioner','PRACTITIONER_DELETE')") + public void deletePractitioner(String identifier) { + if (StringUtils.isBlank(identifier)) { + throw new IllegalArgumentException("Identifier not specified"); + } + + getPractitionerRepository().safeRemove(identifier); + + } + + @PreAuthorize("hasRole('PRACTITIONER_VIEW')") + @PostFilter("hasPermission(filterObject, 'PRACTITIONER_VIEW')") + public ImmutablePair> getOrganizationsByUserId(String userId) { + Practitioner practioner = getPractitionerRepository().getPractitionerByUserId(userId); + List organizationIds = new ArrayList<>(); + for (PractitionerRole practitionerRole : practitionerRoleService + .getPgRolesForPractitioner(practioner.getIdentifier())) { + organizationIds.add(practitionerRole.getOrganizationId()); + } + return new ImmutablePair<>(practioner, organizationIds); + + } + + /** + * Get practitioner using username + * + * @param username + * @return practitioner with the username + */ + @PreAuthorize("hasRole('PRACTITIONER_VIEW')") + @PostFilter("hasPermission(filterObject, 'PRACTITIONER_VIEW')") + public Practitioner getPractionerByUsername(String username) { + return getPractitionerRepository().getPractitionerByUsername(username); + + } + + /** + * Gets the organization ids that a user is assigned to according to the plan location + * assignment + * + * @param username the username of user + * @return the organization ids a user is assigned to + */ + @PreAuthorize("hasPermission(#username,'User', 'PRACTITIONER_VIEW')") + public List getOrganizationIdsByUserName(String username) { + Practitioner practitioner = getPractionerByUsername(username); + if (practitioner != null) { + return practitionerRoleService.getPgRolesForPractitioner(practitioner.getIdentifier()).stream() + .map(role -> role.getOrganizationId()).collect(Collectors.toList()); + } + + return null; + } + + /** + * Get practitioner using the user id + * + * @param userId {@link String}, User id from keycloak + * @return practitioner {@link Practitioner} + */ + public Practitioner getPractitionerByUserId(String userId) { + return getPractitionerRepository().getPractitionerByUserId(userId); + } + + public List getPractitionersByOrgIdentifier(String organizationIdentifier) { + organizationService.validateIdentifier(organizationIdentifier); + Organization organization = organizationService.getOrganization(organizationIdentifier); + + if (organization == null) { + throw new IllegalArgumentException("Organization does not exist"); + } + + return getPractitionerRepository().getPractitionersByOrgId(organization.getId()); + } + + + /** + * Gets the organization ids that a user is assigned to according to the plan location + * assignment + * + * @param userId the userId of user + * @return the organization ids a user is assigned to + */ + @PreAuthorize("hasPermission(#userId,'UserId', 'PRACTITIONER_VIEW')") + public List getOrganizationIdsByUserId(String userId) { + Practitioner practitioner = getPractitionerRepository().getPractitionerByUserId(userId); + if (practitioner != null) { + return practitionerRoleService.getPgRolesForPractitioner(practitioner.getIdentifier()).stream() + .map(role -> role.getOrganizationId()).collect(Collectors.toList()); + } + + return null; + } + + public Long getPractitionerIdByIdentifier(String identifier) { + org.opensrp.domain.postgres.Practitioner pgPractitioner = getPgPractitioner(identifier); + return pgPractitioner != null ? pgPractitioner.getId() : null; + } + + public List getPractitionersByOrgId(Long orgId) { + return practitionerRepository.getPractitionersByOrgId(orgId); + } + + public List getPractitionersByIdentifiers(List practitionerIdentifiers) { + List practitioners = new ArrayList<>(); + if (practitionerIdentifiers != null && practitionerIdentifiers.size() > 0) { + practitioners = practitionerRepository.getAllPractitionersByIdentifiers(practitionerIdentifiers); + } + return practitioners; + } + + public List getAssignedPractitionersByIdentifierAndCode(String practitionerIdentifier, String code) { + List organizationIds = new ArrayList<>(); + List practitionerRolesOfPractitioner = practitionerRoleService.getPgRolesForPractitioner(practitionerIdentifier); + if (practitionerRolesOfPractitioner != null) { + for (PractitionerRole practitionerRole : practitionerRolesOfPractitioner) { + if (practitionerRole.getOrganizationId() != null) { + organizationIds.add(practitionerRole.getOrganizationId()); + } + } + } + + // Retrieved teams, now get all members of the team + List practitionerRoles = new ArrayList<>(); + List practitionerIdentifiers = new ArrayList<>(); + for (Long organizationId : organizationIds) { + practitionerRoles = practitionerRoleService.getPractitionerRolesByOrgIdAndCode(organizationId, code); + practitionerRoles.stream().forEach(practitionerRole -> practitionerIdentifiers.add(practitionerRole.getPractitionerIdentifier())); + } + + // Now get all practitioners by the given Ids + return getPractitionersByIdentifiers(practitionerIdentifiers); + } + + @PreAuthorize("hasRole('PRACTITIONER_VIEW')") + public long countAllPractitioners() { + return getPractitionerRepository().countAllPractitioners(); + } + + @PreAuthorize("hasRole('ORGANIZATION_VIEW')") + @PostFilter("hasPermission(filterObject, 'ORGANIZATION_VIEW')") + public ImmutablePair> getOrganizationsByPractitionerIdentifier(String practitionerIdentifier) { + Practitioner practioner = getPractitionerRepository().getPractitionerByIdentifier(practitionerIdentifier); + List organizationIds = new ArrayList<>(); + if (practioner != null && practioner.getIdentifier() != null) { + for (PractitionerRole practitionerRole : practitionerRoleService + .getPgRolesForPractitioner(practioner.getIdentifier())) { + organizationIds.add(practitionerRole.getOrganizationId()); + } + } + return new ImmutablePair<>(practioner, organizationIds); + } } diff --git a/src/main/java/org/opensrp/service/ProductCatalogueService.java b/src/main/java/org/opensrp/service/ProductCatalogueService.java index ea1aff509..5b8535a7d 100644 --- a/src/main/java/org/opensrp/service/ProductCatalogueService.java +++ b/src/main/java/org/opensrp/service/ProductCatalogueService.java @@ -14,83 +14,82 @@ @Service public class ProductCatalogueService { - private ProductCatalogueRepository productCatalogueRepository; - - private static Logger logger = LogManager.getLogger(ProductCatalogueService.class.toString()); - - @Autowired - public ProductCatalogueService(ProductCatalogueRepository productCatalogueRepository) { - this.productCatalogueRepository = productCatalogueRepository; - } - - public List findAllProductCatalogues(String baseUrl) { - return productCatalogueRepository.getAll(baseUrl); - } - - public ProductCatalogue getProductCatalogue(Long uniqueId, String baseUrl) { - return uniqueId == 0 ? null : productCatalogueRepository.getById(uniqueId, baseUrl); - } - - public void add(ProductCatalogue productCatalogue) { - validateFields(productCatalogue); - productCatalogueRepository.add(productCatalogue); - } - - public void update(ProductCatalogue productCatalogue) { - validateFields(productCatalogue); - productCatalogueRepository.update(productCatalogue); - } - - public void deleteProductCatalogue(ProductCatalogue productCatalogue) { - if (StringUtils.isBlank(productCatalogue.getProductName())) { - throw new IllegalArgumentException("Product name not specified"); - } - - productCatalogueRepository.safeRemove(productCatalogue); - - } - - public void deleteProductCatalogueById(Long uniqueId) { - if (uniqueId == 0) { - throw new IllegalArgumentException("Id not specified"); - } - - productCatalogueRepository.safeRemove(uniqueId); - - } - - public List getProductCatalogues(ProductCatalogueSearchBean productCatalogueSearchBean, int limit, String baseUrl) { - if (StringUtils.isBlank(productCatalogueSearchBean.getProductName()) && - productCatalogueSearchBean.getUniqueId() == 0 - && productCatalogueSearchBean.getServerVersion() == null) { - return findAllProductCatalogues(baseUrl); - } else { - return productCatalogueRepository.getProductCataloguesBySearchBean(productCatalogueSearchBean, limit, baseUrl); - } - } - - @Deprecated(since = "2.11.4-SNAPSHOT") - public List getProductCatalogues(ProductCatalogueSearchBean productCatalogueSearchBean, String baseUrl) { - return getProductCatalogues(productCatalogueSearchBean, Integer.MAX_VALUE, baseUrl); - } - - public ProductCatalogue getProductCatalogueByName(String productName) { - return productCatalogueRepository.getProductCatalogueByName(productName); - } - - private void validateFields(ProductCatalogue productCatalogue) { - if (StringUtils.isBlank(productCatalogue.getProductName())) { - throw new IllegalArgumentException("Product Name was not specified"); - } else if (productCatalogue.getIsAttractiveItem() == null) { - throw new IllegalArgumentException("Is attractive item selection was not made"); - } else if (productCatalogue.getIsAttractiveItem() && StringUtils.isBlank(productCatalogue.getMaterialNumber())) { - throw new IllegalArgumentException("Material Number was not specified"); - } else if (StringUtils.isBlank(productCatalogue.getAvailability())) { - throw new IllegalArgumentException("The availability text was not specified"); - } else if (productCatalogue.getAccountabilityPeriod() == null) { - throw new IllegalArgumentException("Accountability period was not specified"); - } else { - logger.info("All validations on fields passed"); - } - } + private static Logger logger = LogManager.getLogger(ProductCatalogueService.class.toString()); + private ProductCatalogueRepository productCatalogueRepository; + + @Autowired + public ProductCatalogueService(ProductCatalogueRepository productCatalogueRepository) { + this.productCatalogueRepository = productCatalogueRepository; + } + + public List findAllProductCatalogues(String baseUrl) { + return productCatalogueRepository.getAll(baseUrl); + } + + public ProductCatalogue getProductCatalogue(Long uniqueId, String baseUrl) { + return uniqueId == 0 ? null : productCatalogueRepository.getById(uniqueId, baseUrl); + } + + public void add(ProductCatalogue productCatalogue) { + validateFields(productCatalogue); + productCatalogueRepository.add(productCatalogue); + } + + public void update(ProductCatalogue productCatalogue) { + validateFields(productCatalogue); + productCatalogueRepository.update(productCatalogue); + } + + public void deleteProductCatalogue(ProductCatalogue productCatalogue) { + if (StringUtils.isBlank(productCatalogue.getProductName())) { + throw new IllegalArgumentException("Product name not specified"); + } + + productCatalogueRepository.safeRemove(productCatalogue); + + } + + public void deleteProductCatalogueById(Long uniqueId) { + if (uniqueId == 0) { + throw new IllegalArgumentException("Id not specified"); + } + + productCatalogueRepository.safeRemove(uniqueId); + + } + + public List getProductCatalogues(ProductCatalogueSearchBean productCatalogueSearchBean, int limit, String baseUrl) { + if (StringUtils.isBlank(productCatalogueSearchBean.getProductName()) && + productCatalogueSearchBean.getUniqueId() == 0 + && productCatalogueSearchBean.getServerVersion() == null) { + return findAllProductCatalogues(baseUrl); + } else { + return productCatalogueRepository.getProductCataloguesBySearchBean(productCatalogueSearchBean, limit, baseUrl); + } + } + + @Deprecated(since = "2.11.4-SNAPSHOT") + public List getProductCatalogues(ProductCatalogueSearchBean productCatalogueSearchBean, String baseUrl) { + return getProductCatalogues(productCatalogueSearchBean, Integer.MAX_VALUE, baseUrl); + } + + public ProductCatalogue getProductCatalogueByName(String productName) { + return productCatalogueRepository.getProductCatalogueByName(productName); + } + + private void validateFields(ProductCatalogue productCatalogue) { + if (StringUtils.isBlank(productCatalogue.getProductName())) { + throw new IllegalArgumentException("Product Name was not specified"); + } else if (productCatalogue.getIsAttractiveItem() == null) { + throw new IllegalArgumentException("Is attractive item selection was not made"); + } else if (productCatalogue.getIsAttractiveItem() && StringUtils.isBlank(productCatalogue.getMaterialNumber())) { + throw new IllegalArgumentException("Material Number was not specified"); + } else if (StringUtils.isBlank(productCatalogue.getAvailability())) { + throw new IllegalArgumentException("The availability text was not specified"); + } else if (productCatalogue.getAccountabilityPeriod() == null) { + throw new IllegalArgumentException("Accountability period was not specified"); + } else { + logger.info("All validations on fields passed"); + } + } } diff --git a/src/main/java/org/opensrp/service/RapidProService.java b/src/main/java/org/opensrp/service/RapidProService.java index 98e5c9a4c..e8e48c3d6 100644 --- a/src/main/java/org/opensrp/service/RapidProService.java +++ b/src/main/java/org/opensrp/service/RapidProService.java @@ -4,19 +4,19 @@ import java.util.Map; public interface RapidProService { - - public static final String RAPIDPRO_UUID_IDENTIFIER_TYPE = "RAPIDPRO_UUID"; - - public static final String RAPIDPRO_GROUPS = "RAPIDPRO_GROUPS"; - - String sendMessage(List urns, List contacts, List groups, String text, String channel); - - String createContact(Map fieldValues); - - int deleteContact(String uuid); - - String createGroup(String name); - - String addField(String label, String valueType); - + + public static final String RAPIDPRO_UUID_IDENTIFIER_TYPE = "RAPIDPRO_UUID"; + + public static final String RAPIDPRO_GROUPS = "RAPIDPRO_GROUPS"; + + String sendMessage(List urns, List contacts, List groups, String text, String channel); + + String createContact(Map fieldValues); + + int deleteContact(String uuid); + + String createGroup(String name); + + String addField(String label, String valueType); + } diff --git a/src/main/java/org/opensrp/service/RapidProServiceImpl.java b/src/main/java/org/opensrp/service/RapidProServiceImpl.java index ab95c99a6..963e086ea 100644 --- a/src/main/java/org/opensrp/service/RapidProServiceImpl.java +++ b/src/main/java/org/opensrp/service/RapidProServiceImpl.java @@ -22,202 +22,195 @@ @Component public class RapidProServiceImpl implements RapidProService { - - @Value("#{opensrp['rapidpro.url']}") - private String rapidproUrl; - - @Value("#{opensrp['rapidpro.token']}") - private String rapidproToken; - - private static Logger logger = LogManager.getLogger(RapidProServiceImpl.class.toString()); - - HttpClient client = HttpClientBuilder.create().build(); - - /** - * urns - JSON array of URNs to send the message to (array of strings, optional) contacts - JSON - * array of contact UUIDs to send the message to (array of strings, optional) groups - JSON - * array of group UUIDs to send the message to (array of strings, optional) text - the text of - * the message to send (string, limit of 480 characters) channel - the id of the channel to use. - * Contacts and URNs which can't be reached with this channel are ignored (int, optional) - * - * @param urns - * @param contacts - * @param groups - * @param text - * @param channel - * @return - */ - - @Override - public String sendMessage(List urns, List contacts, List groups, String text, String channel) { - try { - HttpPost post = new HttpPost(); - if (text == null || text.isEmpty() || text.length() > 480) { - logger.info("RapidPro: Message character limit of 480 exceeded"); - return "Empty text or text longer than 480 characters not allowed"; - } - String uri = rapidproUrl + "/api/v1/broadcasts.json"; - post = setPostAuthHeader(uri, post); - - JSONObject jsonParams = new JSONObject(); - - if (urns != null && !urns.isEmpty()) { - jsonParams.put("urns", new JSONArray(urns)); - } - if (contacts != null && !contacts.isEmpty()) { - jsonParams.put("contacts", new JSONArray(contacts)); - } - if (groups != null && !groups.isEmpty()) { - jsonParams.put("groups", new JSONArray(groups)); - } - if (channel != null && !channel.isEmpty()) { - jsonParams.put("channel", channel); - } - - if (!jsonParams.has("urns") && !jsonParams.has("contacts") && !jsonParams.has("groups")) { - logger.info("RapidPro: No one to send message to!"); - return "No recipients specified"; - } - - jsonParams.put("text", text); - - StringEntity params = new StringEntity(jsonParams.toString()); - post.setEntity(params); - - HttpResponse response = client.execute(post); - HttpEntity entity = response.getEntity(); - String responseString = EntityUtils.toString(entity, "UTF-8"); - return responseString; - } - catch (Exception e) { - logger.error("", e); - return "Exception occurred"; - } - } - - /** - * This method creates a contact in rapidpro. The param fieldValues should contain a key urns(a - * list of URNs you want associated with the contact (java.util.arraylist)) which is required by - * rapidpro. uuid - the UUID of the contact to update (string) (optional, new contact created if - * not present). name - the full name of the contact (string, optional).language - the preferred - * language for the contact (3 letter iso code, optional). group_uuids - a list of the UUIDs of - * any groups this contact is part of (string array, optional). fields - a hashmap of contact - * fields you want to set or update on this contact (JSON, optional) - */ - @SuppressWarnings("unchecked") - @Override - public String createContact(Map fieldValues) { - try { - HttpPost post = new HttpPost(); - if (fieldValues == null || fieldValues.isEmpty() || !fieldValues.containsKey("urns")) { - return "Field values cannot be empty and must have urns"; - } - String uri = rapidproUrl + "/api/v1/contacts.json"; - post = setPostAuthHeader(uri, post); - - JSONObject jsonParams = new JSONObject(); - for (Map.Entry entry : fieldValues.entrySet()) { - String key = entry.getKey(); - Object value = entry.getValue(); - if (value instanceof List) { - value = new JSONArray((List) value); - } - // create the fields just in case they don't exist first - if (key.equalsIgnoreCase("fields")) { - for (Map.Entry fieldEntrySet : ((Map) value).entrySet()) { - String fieldName = fieldEntrySet.getKey(); - addField(fieldName, null); - logger.info("Creating RapidPro field " + fieldName); - } - } - jsonParams.put(key, value); - - } - StringEntity params = new StringEntity(jsonParams.toString()); - post.setEntity(params); - logger.info("Creating RapidPro contact for " + (fieldValues.containsKey("name") ? fieldValues.get("name") : "")); - HttpResponse response = client.execute(post); - HttpEntity entity = response.getEntity(); - String responseString = EntityUtils.toString(entity, "UTF-8"); - return responseString; - } - catch (Exception e) { - logger.error("", e); - return "Exception occurred"; - } - - } - - private HttpPost setPostAuthHeader(String url, HttpPost post) { - post.setURI(URI.create(url)); - // add header Authorization: Token YOUR_API_TOKEN_GOES_HERE - post.setHeader("Authorization", " Token " + rapidproToken); - post.addHeader("content-type", "application/json"); - post.addHeader("Accept", "application/json"); - return post; - } - - private HttpDelete setDeleteAuthHeader(String url, HttpDelete delete) { - delete.setURI(URI.create(url)); - // add header Authorization: Token YOUR_API_TOKEN_GOES_HERE - delete.setHeader("Authorization", " Token " + rapidproToken); - delete.addHeader("content-type", "application/json"); - delete.addHeader("Accept", "application/json"); - return delete; - } - - @Override - public String createGroup(String name) { - // FIXME Not currently supported in rapidpro - return "Exception occurred"; - } - - /** - * This method adds a field to rapidpro valuetype is a required field in rapidpro so if empty - * the default is set to T-text other acceptable fieldtypes are: N - Decimal Number D - Datetime - * S - State I - District label is the field name as it will appear in rapidpro and it's used to - * generate the field key e.g a field label like woman name translates to woman_name key - */ - @Override - public String addField(String label, String valueType) { - try { - HttpPost post = new HttpPost(); - if (label == null || label.isEmpty()) { - return "Field label is required"; - } - String uri = rapidproUrl + "/api/v1/fields.json"; - post = setPostAuthHeader(uri, post); - JSONObject jsonParams = new JSONObject(); - jsonParams.put("label", label); - jsonParams.put("value_type", valueType == null || valueType.isEmpty() ? "T" : valueType); - - StringEntity params = new StringEntity(jsonParams.toString()); - post.setEntity(params); - HttpResponse response = client.execute(post); - HttpEntity entity = response.getEntity(); - String responseString = EntityUtils.toString(entity, "UTF-8"); - return responseString; - } - catch (Exception e) { - logger.error("", e); - return "Exception occurred"; - } - } - - @Override - public int deleteContact(String uuid) { - try { - HttpDelete delete = new HttpDelete(); - String uri = rapidproUrl + "/api/v1/contacts.json?uuid=" + uuid; - delete = setDeleteAuthHeader(uri, delete); - HttpResponse response = client.execute(delete); - int status = response.getStatusLine().getStatusCode(); - return status; - - } - catch (Exception e) { - logger.error("", e); - return HttpStatus.SC_INTERNAL_SERVER_ERROR; - } - } + + private static Logger logger = LogManager.getLogger(RapidProServiceImpl.class.toString()); + HttpClient client = HttpClientBuilder.create().build(); + @Value("#{opensrp['rapidpro.url']}") + private String rapidproUrl; + @Value("#{opensrp['rapidpro.token']}") + private String rapidproToken; + + /** + * urns - JSON array of URNs to send the message to (array of strings, optional) contacts - JSON + * array of contact UUIDs to send the message to (array of strings, optional) groups - JSON + * array of group UUIDs to send the message to (array of strings, optional) text - the text of + * the message to send (string, limit of 480 characters) channel - the id of the channel to use. + * Contacts and URNs which can't be reached with this channel are ignored (int, optional) + * + * @param urns + * @param contacts + * @param groups + * @param text + * @param channel + * @return + */ + + @Override + public String sendMessage(List urns, List contacts, List groups, String text, String channel) { + try { + HttpPost post = new HttpPost(); + if (text == null || text.isEmpty() || text.length() > 480) { + logger.info("RapidPro: Message character limit of 480 exceeded"); + return "Empty text or text longer than 480 characters not allowed"; + } + String uri = rapidproUrl + "/api/v1/broadcasts.json"; + post = setPostAuthHeader(uri, post); + + JSONObject jsonParams = new JSONObject(); + + if (urns != null && !urns.isEmpty()) { + jsonParams.put("urns", new JSONArray(urns)); + } + if (contacts != null && !contacts.isEmpty()) { + jsonParams.put("contacts", new JSONArray(contacts)); + } + if (groups != null && !groups.isEmpty()) { + jsonParams.put("groups", new JSONArray(groups)); + } + if (channel != null && !channel.isEmpty()) { + jsonParams.put("channel", channel); + } + + if (!jsonParams.has("urns") && !jsonParams.has("contacts") && !jsonParams.has("groups")) { + logger.info("RapidPro: No one to send message to!"); + return "No recipients specified"; + } + + jsonParams.put("text", text); + + StringEntity params = new StringEntity(jsonParams.toString()); + post.setEntity(params); + + HttpResponse response = client.execute(post); + HttpEntity entity = response.getEntity(); + String responseString = EntityUtils.toString(entity, "UTF-8"); + return responseString; + } catch (Exception e) { + logger.error("", e); + return "Exception occurred"; + } + } + + /** + * This method creates a contact in rapidpro. The param fieldValues should contain a key urns(a + * list of URNs you want associated with the contact (java.util.arraylist)) which is required by + * rapidpro. uuid - the UUID of the contact to update (string) (optional, new contact created if + * not present). name - the full name of the contact (string, optional).language - the preferred + * language for the contact (3 letter iso code, optional). group_uuids - a list of the UUIDs of + * any groups this contact is part of (string array, optional). fields - a hashmap of contact + * fields you want to set or update on this contact (JSON, optional) + */ + @SuppressWarnings("unchecked") + @Override + public String createContact(Map fieldValues) { + try { + HttpPost post = new HttpPost(); + if (fieldValues == null || fieldValues.isEmpty() || !fieldValues.containsKey("urns")) { + return "Field values cannot be empty and must have urns"; + } + String uri = rapidproUrl + "/api/v1/contacts.json"; + post = setPostAuthHeader(uri, post); + + JSONObject jsonParams = new JSONObject(); + for (Map.Entry entry : fieldValues.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + if (value instanceof List) { + value = new JSONArray((List) value); + } + // create the fields just in case they don't exist first + if (key.equalsIgnoreCase("fields")) { + for (Map.Entry fieldEntrySet : ((Map) value).entrySet()) { + String fieldName = fieldEntrySet.getKey(); + addField(fieldName, null); + logger.info("Creating RapidPro field " + fieldName); + } + } + jsonParams.put(key, value); + + } + StringEntity params = new StringEntity(jsonParams.toString()); + post.setEntity(params); + logger.info("Creating RapidPro contact for " + (fieldValues.containsKey("name") ? fieldValues.get("name") : "")); + HttpResponse response = client.execute(post); + HttpEntity entity = response.getEntity(); + String responseString = EntityUtils.toString(entity, "UTF-8"); + return responseString; + } catch (Exception e) { + logger.error("", e); + return "Exception occurred"; + } + + } + + private HttpPost setPostAuthHeader(String url, HttpPost post) { + post.setURI(URI.create(url)); + // add header Authorization: Token YOUR_API_TOKEN_GOES_HERE + post.setHeader("Authorization", " Token " + rapidproToken); + post.addHeader("content-type", "application/json"); + post.addHeader("Accept", "application/json"); + return post; + } + + private HttpDelete setDeleteAuthHeader(String url, HttpDelete delete) { + delete.setURI(URI.create(url)); + // add header Authorization: Token YOUR_API_TOKEN_GOES_HERE + delete.setHeader("Authorization", " Token " + rapidproToken); + delete.addHeader("content-type", "application/json"); + delete.addHeader("Accept", "application/json"); + return delete; + } + + @Override + public String createGroup(String name) { + // FIXME Not currently supported in rapidpro + return "Exception occurred"; + } + + /** + * This method adds a field to rapidpro valuetype is a required field in rapidpro so if empty + * the default is set to T-text other acceptable fieldtypes are: N - Decimal Number D - Datetime + * S - State I - District label is the field name as it will appear in rapidpro and it's used to + * generate the field key e.g a field label like woman name translates to woman_name key + */ + @Override + public String addField(String label, String valueType) { + try { + HttpPost post = new HttpPost(); + if (label == null || label.isEmpty()) { + return "Field label is required"; + } + String uri = rapidproUrl + "/api/v1/fields.json"; + post = setPostAuthHeader(uri, post); + JSONObject jsonParams = new JSONObject(); + jsonParams.put("label", label); + jsonParams.put("value_type", valueType == null || valueType.isEmpty() ? "T" : valueType); + + StringEntity params = new StringEntity(jsonParams.toString()); + post.setEntity(params); + HttpResponse response = client.execute(post); + HttpEntity entity = response.getEntity(); + String responseString = EntityUtils.toString(entity, "UTF-8"); + return responseString; + } catch (Exception e) { + logger.error("", e); + return "Exception occurred"; + } + } + + @Override + public int deleteContact(String uuid) { + try { + HttpDelete delete = new HttpDelete(); + String uri = rapidproUrl + "/api/v1/contacts.json?uuid=" + uuid; + delete = setDeleteAuthHeader(uri, delete); + HttpResponse response = client.execute(delete); + int status = response.getStatusLine().getStatusCode(); + return status; + + } catch (Exception e) { + logger.error("", e); + return HttpStatus.SC_INTERNAL_SERVER_ERROR; + } + } } diff --git a/src/main/java/org/opensrp/service/ReportService.java b/src/main/java/org/opensrp/service/ReportService.java index 1843f37b8..c20fc9378 100644 --- a/src/main/java/org/opensrp/service/ReportService.java +++ b/src/main/java/org/opensrp/service/ReportService.java @@ -13,150 +13,148 @@ @Service public class ReportService { - - private final ReportsRepository allReports; - - private static Logger logger = LogManager.getLogger(ReportService.class.toString()); - - @Autowired - public ReportService(ReportsRepository allReports) { - this.allReports = allReports; - } - - @PreAuthorize("hasRole('REPORT_VIEW')") - public List findAllByIdentifier(String identifier) { - return allReports.findAllByIdentifier(identifier); - } - - @PreAuthorize("hasRole('REPORT_VIEW')") - public List findByServerVersion(long serverVersion) { - return allReports.findByServerVersion(serverVersion); - } - - @PreAuthorize("hasRole('REPORT_VIEW')") - public Report getById(String id) { - return allReports.findById(id); - } - - @PreAuthorize("hasRole('REPORT_VIEW')") - public List getAll() { - return allReports.getAll(); - } - - @PreAuthorize("hasRole('REPORT_VIEW')") - public Report find(String uniqueId) { - List reportList = allReports.findAllByIdentifier(uniqueId); - if (reportList.size() > 1) { - throw new IllegalArgumentException("Multiple reports with identifier " + uniqueId + " exist."); - } else if (reportList.size() != 0) { - return reportList.get(0); - } - return null; - } - - @PreAuthorize("hasRole('REPORT_VIEW')") - public Report find(Report report) { - for (String idt : report.getIdentifiers().keySet()) { - List reportList = allReports.findAllByIdentifier(report.getIdentifier(idt)); - if (reportList.size() > 1) { - throw new IllegalArgumentException( - "Multiple reports with identifier type " + idt + " and ID " + report.getIdentifier(idt) + " exist."); - } else if (reportList.size() != 0) { - return reportList.get(0); - } - } - return null; - } - - @PreAuthorize("hasRole('REPORT_VIEW')") - public Report findById(String reportId) { - try { - if (reportId == null || reportId.isEmpty()) { - return null; - } - return allReports.findById(reportId); - } - catch (Exception e) { - logger.error("", e); - } - return null; - } - - public synchronized Report addReport(Report report) { - Report existingReport = find(report); - if (existingReport != null) { - throw new IllegalArgumentException( - "An report already exists with given list of identifiers. Consider updating data.[" + existingReport - + "]"); - } - - if (report.getFormSubmissionId() != null - && getByBaseEntityAndFormSubmissionId(report.getBaseEntityId(), report.getFormSubmissionId()) != null) { - throw new IllegalArgumentException( - "An report already exists with given baseEntity and formSubmission combination. Consider updating"); - } - - report.setDateCreated(DateTime.now()); - allReports.add(report); - return report; - } - - public void updateReport(Report updatedReport) { - // If update is on original entity - if (updatedReport.isNew()) { - throw new IllegalArgumentException( - "Report to be updated is not an existing and persisting domain object. Update database object instead of new pojo"); - } - - updatedReport.setDateEdited(DateTime.now()); - allReports.update(updatedReport); - } - - @PreAuthorize("hasRole('REPORT_CREATE') or hasRole('REPORT_UPDATE')") - public synchronized Report addorUpdateReport(Report report) { - Report existingReport = findById(report.getId()); - if (existingReport != null) { - report.setDateEdited(DateTime.now()); - report.setRevision(existingReport.getRevision()); - allReports.update(report); - - } else { - report.setDateCreated(DateTime.now()); - allReports.add(report); - - } - - return report; - } - - @PreAuthorize("hasRole('REPORT_VIEW')") - public Report getByBaseEntityAndFormSubmissionId(String baseEntityId, String formSubmissionId) { - List reportList = allReports.findByBaseEntityAndFormSubmissionId(baseEntityId, formSubmissionId); - if (reportList.size() > 1) { - throw new IllegalStateException("Multiple reports for baseEntityId and formSubmissionId combination (" - + baseEntityId + "," + formSubmissionId + ")"); - } - if (reportList.size() == 0) { - return null; - } - return reportList.get(0); - } - - @PreAuthorize("hasRole('REPORT_VIEW')") - public List findByBaseEntityId(String baseEntityId) { - return allReports.findByBaseEntityId(baseEntityId); - } - - @PreAuthorize("hasRole('REPORT_VIEW')") - public List findReports(String team, String providerId, String locationId, Long serverVersion, String sortBy, - String sortOrder, int limit) { - return allReports.findReports(team, providerId, locationId, null, serverVersion, sortBy, sortOrder, limit); - } - - @PreAuthorize("hasRole('REPORT_VIEW')") - public List findReports(String team, String providerId, String locationId, String baseEntityId, - Long serverVersion, String sortBy, String sortOrder, int limit) { - return allReports.findReports(team, providerId, locationId, baseEntityId, serverVersion, sortBy, sortOrder, limit); - } - + + private static Logger logger = LogManager.getLogger(ReportService.class.toString()); + private final ReportsRepository allReports; + + @Autowired + public ReportService(ReportsRepository allReports) { + this.allReports = allReports; + } + + @PreAuthorize("hasRole('REPORT_VIEW')") + public List findAllByIdentifier(String identifier) { + return allReports.findAllByIdentifier(identifier); + } + + @PreAuthorize("hasRole('REPORT_VIEW')") + public List findByServerVersion(long serverVersion) { + return allReports.findByServerVersion(serverVersion); + } + + @PreAuthorize("hasRole('REPORT_VIEW')") + public Report getById(String id) { + return allReports.findById(id); + } + + @PreAuthorize("hasRole('REPORT_VIEW')") + public List getAll() { + return allReports.getAll(); + } + + @PreAuthorize("hasRole('REPORT_VIEW')") + public Report find(String uniqueId) { + List reportList = allReports.findAllByIdentifier(uniqueId); + if (reportList.size() > 1) { + throw new IllegalArgumentException("Multiple reports with identifier " + uniqueId + " exist."); + } else if (reportList.size() != 0) { + return reportList.get(0); + } + return null; + } + + @PreAuthorize("hasRole('REPORT_VIEW')") + public Report find(Report report) { + for (String idt : report.getIdentifiers().keySet()) { + List reportList = allReports.findAllByIdentifier(report.getIdentifier(idt)); + if (reportList.size() > 1) { + throw new IllegalArgumentException( + "Multiple reports with identifier type " + idt + " and ID " + report.getIdentifier(idt) + " exist."); + } else if (reportList.size() != 0) { + return reportList.get(0); + } + } + return null; + } + + @PreAuthorize("hasRole('REPORT_VIEW')") + public Report findById(String reportId) { + try { + if (reportId == null || reportId.isEmpty()) { + return null; + } + return allReports.findById(reportId); + } catch (Exception e) { + logger.error("", e); + } + return null; + } + + public synchronized Report addReport(Report report) { + Report existingReport = find(report); + if (existingReport != null) { + throw new IllegalArgumentException( + "An report already exists with given list of identifiers. Consider updating data.[" + existingReport + + "]"); + } + + if (report.getFormSubmissionId() != null + && getByBaseEntityAndFormSubmissionId(report.getBaseEntityId(), report.getFormSubmissionId()) != null) { + throw new IllegalArgumentException( + "An report already exists with given baseEntity and formSubmission combination. Consider updating"); + } + + report.setDateCreated(DateTime.now()); + allReports.add(report); + return report; + } + + public void updateReport(Report updatedReport) { + // If update is on original entity + if (updatedReport.isNew()) { + throw new IllegalArgumentException( + "Report to be updated is not an existing and persisting domain object. Update database object instead of new pojo"); + } + + updatedReport.setDateEdited(DateTime.now()); + allReports.update(updatedReport); + } + + @PreAuthorize("hasRole('REPORT_CREATE') or hasRole('REPORT_UPDATE')") + public synchronized Report addorUpdateReport(Report report) { + Report existingReport = findById(report.getId()); + if (existingReport != null) { + report.setDateEdited(DateTime.now()); + report.setRevision(existingReport.getRevision()); + allReports.update(report); + + } else { + report.setDateCreated(DateTime.now()); + allReports.add(report); + + } + + return report; + } + + @PreAuthorize("hasRole('REPORT_VIEW')") + public Report getByBaseEntityAndFormSubmissionId(String baseEntityId, String formSubmissionId) { + List reportList = allReports.findByBaseEntityAndFormSubmissionId(baseEntityId, formSubmissionId); + if (reportList.size() > 1) { + throw new IllegalStateException("Multiple reports for baseEntityId and formSubmissionId combination (" + + baseEntityId + "," + formSubmissionId + ")"); + } + if (reportList.size() == 0) { + return null; + } + return reportList.get(0); + } + + @PreAuthorize("hasRole('REPORT_VIEW')") + public List findByBaseEntityId(String baseEntityId) { + return allReports.findByBaseEntityId(baseEntityId); + } + + @PreAuthorize("hasRole('REPORT_VIEW')") + public List findReports(String team, String providerId, String locationId, Long serverVersion, String sortBy, + String sortOrder, int limit) { + return allReports.findReports(team, providerId, locationId, null, serverVersion, sortBy, sortOrder, limit); + } + + @PreAuthorize("hasRole('REPORT_VIEW')") + public List findReports(String team, String providerId, String locationId, String baseEntityId, + Long serverVersion, String sortBy, String sortOrder, int limit) { + return allReports.findReports(team, providerId, locationId, baseEntityId, serverVersion, sortBy, sortOrder, limit); + } + } diff --git a/src/main/java/org/opensrp/service/SearchService.java b/src/main/java/org/opensrp/service/SearchService.java index b3079b12d..810a69720 100644 --- a/src/main/java/org/opensrp/service/SearchService.java +++ b/src/main/java/org/opensrp/service/SearchService.java @@ -12,29 +12,29 @@ @Service public class SearchService { - - private final SearchRepository search; - - @Autowired - public SearchService(SearchRepository search) { - this.search = search; - } - - - @PreAuthorize("hasRole('CLIENT_VIEW')") - @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") - public List searchClient(ClientSearchBean clientSearchBean, String firstName, String middleName, String lastName, - Integer limit) { - return search.findByCriteria(clientSearchBean, firstName, middleName, lastName, limit); - } - - /** - * This method is similar to {@link #searchClient(ClientSearchBean, String, String, String, Integer)}. This method however does not enforce ACL - * so that users can search clients globally and not just those within their jurisdiction. - */ - public List searchGlobalClient(ClientSearchBean clientSearchBean, String firstName, String middleName, String lastName, - Integer limit) { - return search.findByCriteria(clientSearchBean, firstName, middleName, lastName, limit); - } - + + private final SearchRepository search; + + @Autowired + public SearchService(SearchRepository search) { + this.search = search; + } + + + @PreAuthorize("hasRole('CLIENT_VIEW')") + @PostFilter("hasPermission(filterObject, 'CLIENT_VIEW')") + public List searchClient(ClientSearchBean clientSearchBean, String firstName, String middleName, String lastName, + Integer limit) { + return search.findByCriteria(clientSearchBean, firstName, middleName, lastName, limit); + } + + /** + * This method is similar to {@link #searchClient(ClientSearchBean, String, String, String, Integer)}. This method however does not enforce ACL + * so that users can search clients globally and not just those within their jurisdiction. + */ + public List searchGlobalClient(ClientSearchBean clientSearchBean, String firstName, String middleName, String lastName, + Integer limit) { + return search.findByCriteria(clientSearchBean, firstName, middleName, lastName, limit); + } + } diff --git a/src/main/java/org/opensrp/service/SettingService.java b/src/main/java/org/opensrp/service/SettingService.java index 15f791d60..532fe2c1f 100644 --- a/src/main/java/org/opensrp/service/SettingService.java +++ b/src/main/java/org/opensrp/service/SettingService.java @@ -23,116 +23,115 @@ @Service public class SettingService { - private static Logger logger = LogManager.getLogger(SettingService.class.toString()); - - private SettingRepository settingRepository; - - @Autowired - public void setSettingRepository(SettingRepository settingRepository) { - this.settingRepository = settingRepository; - } - - /** - * Initiates the find settings functionality - * - * @param settingQueryBean {@link SettingSearchBean} -- has the required parameters for the search - * @return - */ - @PreAuthorize("hasRole('SETTINGS_VIEW_VIEW')") - public List findSettings(SettingSearchBean settingQueryBean, - Map> treeNodeHashMap) { - return settingRepository.findSettings(settingQueryBean, treeNodeHashMap); - } - - - /** - * Used by the v1 setting endpoint to create the settings configuration {@link SettingConfiguration} & save the settings - * - * @param jsonSettingConfiguration {@link String} -- the string representation of the settings configuration - * @return - */ - @PreAuthorize("hasRole('SETTINGS_VIEW_CREATE') or hasRole('SETTINGS_VIEW_UPDATE')") - public synchronized String saveSetting(String jsonSettingConfiguration) { - SettingTypeHandler settingTypeHandler = new SettingTypeHandler(); - SettingConfiguration settingConfigurations = null; - try { - settingConfigurations = settingTypeHandler.mapper - .readValue(jsonSettingConfiguration, SettingConfiguration.class); - } - catch (IOException e) { - logger.error("error reading json ",e); - } - - settingConfigurations.setV1Settings(true); - - SettingConfiguration existingConfiguration = null; - - if (StringUtils.isNotBlank(settingConfigurations.getId())) { - existingConfiguration = settingRepository.get(settingConfigurations.getId()); - } else if (StringUtils.isNotBlank(settingConfigurations.getIdentifier())) { - SettingSearchBean settingQueryBean = new SettingSearchBean(); - settingQueryBean.setIdentifier(settingConfigurations.getIdentifier()); - existingConfiguration = settingRepository.findSetting(settingQueryBean, null); - } - - String settingsResponse = null; - if (existingConfiguration != null) { - Map uuidMap = new HashMap<>(); - for (Setting setting : existingConfiguration.getSettings()) { - uuidMap.put(setting.getKey(), setting.getUuid()); - } - settingConfigurations.getSettings().stream().filter(s -> StringUtils.isBlank(s.getUuid())) - .forEach(s -> s.setUuid(uuidMap.get(s.getKey()))); - if (StringUtils.isBlank(settingConfigurations.getId())) { - settingConfigurations.setId(existingConfiguration.getId()); - } - settingRepository.update(settingConfigurations); - - } else { - settingsResponse = settingRepository.addSettings(settingConfigurations); - } - - String response = settingConfigurations.getIdentifier(); - if (StringUtils.isNotBlank(settingsResponse)) { - response = response + String.format("%s%s", " The following settings might not be saved ", settingsResponse); - } - - return response; - - } - - /** - * Gets a single setting object from the v2 endpoint to save - * - * @param setting {@link Setting} - * @return - */ - - @PreAuthorize("hasRole('SETTINGS_VIEW_CREATE') or hasRole('SETTINGS_VIEW_UPDATE')") - public String addOrUpdateSettings(Setting setting) { - String settingsResponse = null; - - if (setting != null) { - settingsResponse = settingRepository.addOrUpdate(setting); - } - - return settingsResponse; - } - - /** - * Performs a settings delete using the v2 endpoint - * - * @param id {@link Long} -- settings id - */ - @PreAuthorize("hasRole('SETTINGS_VIEW_DELETE')") - public void deleteSetting(Long id) { - if (id != null) { - settingRepository.delete(id); - } - } - - public List findSettingsByIdentifier(String identifier) { - return settingRepository.findSettingsAndSettingsMetadataByIdentifier(identifier); - } + private static Logger logger = LogManager.getLogger(SettingService.class.toString()); + + private SettingRepository settingRepository; + + @Autowired + public void setSettingRepository(SettingRepository settingRepository) { + this.settingRepository = settingRepository; + } + + /** + * Initiates the find settings functionality + * + * @param settingQueryBean {@link SettingSearchBean} -- has the required parameters for the search + * @return + */ + @PreAuthorize("hasRole('SETTINGS_VIEW_VIEW')") + public List findSettings(SettingSearchBean settingQueryBean, + Map> treeNodeHashMap) { + return settingRepository.findSettings(settingQueryBean, treeNodeHashMap); + } + + + /** + * Used by the v1 setting endpoint to create the settings configuration {@link SettingConfiguration} & save the settings + * + * @param jsonSettingConfiguration {@link String} -- the string representation of the settings configuration + * @return + */ + @PreAuthorize("hasRole('SETTINGS_VIEW_CREATE') or hasRole('SETTINGS_VIEW_UPDATE')") + public synchronized String saveSetting(String jsonSettingConfiguration) { + SettingTypeHandler settingTypeHandler = new SettingTypeHandler(); + SettingConfiguration settingConfigurations = null; + try { + settingConfigurations = settingTypeHandler.mapper + .readValue(jsonSettingConfiguration, SettingConfiguration.class); + } catch (IOException e) { + logger.error("error reading json ", e); + } + + settingConfigurations.setV1Settings(true); + + SettingConfiguration existingConfiguration = null; + + if (StringUtils.isNotBlank(settingConfigurations.getId())) { + existingConfiguration = settingRepository.get(settingConfigurations.getId()); + } else if (StringUtils.isNotBlank(settingConfigurations.getIdentifier())) { + SettingSearchBean settingQueryBean = new SettingSearchBean(); + settingQueryBean.setIdentifier(settingConfigurations.getIdentifier()); + existingConfiguration = settingRepository.findSetting(settingQueryBean, null); + } + + String settingsResponse = null; + if (existingConfiguration != null) { + Map uuidMap = new HashMap<>(); + for (Setting setting : existingConfiguration.getSettings()) { + uuidMap.put(setting.getKey(), setting.getUuid()); + } + settingConfigurations.getSettings().stream().filter(s -> StringUtils.isBlank(s.getUuid())) + .forEach(s -> s.setUuid(uuidMap.get(s.getKey()))); + if (StringUtils.isBlank(settingConfigurations.getId())) { + settingConfigurations.setId(existingConfiguration.getId()); + } + settingRepository.update(settingConfigurations); + + } else { + settingsResponse = settingRepository.addSettings(settingConfigurations); + } + + String response = settingConfigurations.getIdentifier(); + if (StringUtils.isNotBlank(settingsResponse)) { + response = response + String.format("%s%s", " The following settings might not be saved ", settingsResponse); + } + + return response; + + } + + /** + * Gets a single setting object from the v2 endpoint to save + * + * @param setting {@link Setting} + * @return + */ + + @PreAuthorize("hasRole('SETTINGS_VIEW_CREATE') or hasRole('SETTINGS_VIEW_UPDATE')") + public String addOrUpdateSettings(Setting setting) { + String settingsResponse = null; + + if (setting != null) { + settingsResponse = settingRepository.addOrUpdate(setting); + } + + return settingsResponse; + } + + /** + * Performs a settings delete using the v2 endpoint + * + * @param id {@link Long} -- settings id + */ + @PreAuthorize("hasRole('SETTINGS_VIEW_DELETE')") + public void deleteSetting(Long id) { + if (id != null) { + settingRepository.delete(id); + } + } + + public List findSettingsByIdentifier(String identifier) { + return settingRepository.findSettingsAndSettingsMetadataByIdentifier(identifier); + } } diff --git a/src/main/java/org/opensrp/service/StockService.java b/src/main/java/org/opensrp/service/StockService.java index 3f05c0ac0..faf0f0dd5 100755 --- a/src/main/java/org/opensrp/service/StockService.java +++ b/src/main/java/org/opensrp/service/StockService.java @@ -41,401 +41,392 @@ @Service public class StockService { - - private final StocksRepository allStocks; - - private ProductCatalogueService productCatalogueService; - - private PhysicalLocationService physicalLocationService; - - private InventoryDataValidator inventoryDataValidator; - - private static Logger logger = LogManager.getLogger(StockService.class.toString()); - - @Autowired - public StockService(StocksRepository allStocks, ProductCatalogueService productCatalogueService, PhysicalLocationService physicalLocationService, - InventoryDataValidator inventoryDataValidator) { - this.allStocks = allStocks; - this.productCatalogueService = productCatalogueService; - this.physicalLocationService = physicalLocationService; - this.inventoryDataValidator = inventoryDataValidator; - } - - @PreAuthorize("hasRole('STOCK_VIEW')") - public List findAllByProviderid(String providerid) { - return allStocks.findAllByProviderid(providerid); - } - - @PreAuthorize("hasRole('STOCK_VIEW')") - public Stock getById(String id) { - return allStocks.findById(id); - } - - @PreAuthorize("hasRole('STOCK_VIEW')") - public List getAll() { - return allStocks.getAll(); - } - - @PreAuthorize("hasRole('STOCK_VIEW')") - public List findStocks(StockSearchBean searchBean, String sortBy, String sortOrder, int limit) { - return allStocks.findStocks(searchBean, sortBy, sortOrder, 0, limit); - } - - @PreAuthorize("hasRole('STOCK_VIEW')") - public List findStocks(StockSearchBean searchBean) { - return allStocks.findStocks(searchBean); - } - - @PreAuthorize("hasRole('STOCK_VIEW')") - public List findAllStocks(Long serverVersion, Integer limit) { - return allStocks.findAllStocks(serverVersion, limit); - } - - public Stock find(Stock stock) { - Stock st = allStocks.findById(stock.getId()); - if (st == null) { - return null; - } else { - return stock; - } - } - - @PreAuthorize("hasRole('STOCK_CREATE')") - public synchronized Stock addStock(Stock stock) { - Stock st = find(stock); - if (st != null) { - throw new IllegalArgumentException( - "A stock already exists with given id. Consider updating data.[" + st.getId() + "]"); - } - allStocks.add(stock); - return stock; - } - - @PreAuthorize("hasRole('STOCK_CREATE') or hasRole('STOCK_UPDATE')") - public synchronized Stock addorUpdateStock(Stock stock) { - if (stock.getId() != null && getById(stock.getId()) != null) { - stock.setDateEdited(DateTime.now()); - stock.setRevision(getById(stock.getId()).getRevision()); - allStocks.update(stock); - } else { - stock.setDateCreated(DateTime.now()); - allStocks.add(stock); - } - return stock; - } - - @PreAuthorize("hasRole('STOCK_UPDATE')") - public void updateStock(Stock updatedStock) { - // If update is on original entity - if (updatedStock.isNew()) { - throw new IllegalArgumentException( - "Stock to be updated is not an existing and persisting domain object. Update database object instead of new pojo"); - } - - updatedStock.setDateEdited(DateTime.now()); - allStocks.update(updatedStock); - } - - @PreAuthorize("hasRole('STOCK_VIEW')") - public Stock find(String uniqueId) { - List sList = allStocks.findAllByProviderid(uniqueId); - if (sList.size() > 1) { - throw new IllegalArgumentException("Multiple events with identifier " + uniqueId + " exist."); - } else if (sList.size() != 0) { - return sList.get(0); - } - return null; - } - - @PreAuthorize("hasRole('STOCK_UPDATE')") - public Stock mergeStock(Stock updatedStock) { - Stock original = find(updatedStock); - if (original == null) { - throw new IllegalArgumentException("No stock found with given id. Consider adding new!"); - } - original.setDateEdited(DateTime.now()); - allStocks.update(original); - return original; - } - - @PreAuthorize("hasRole('STOCK_VIEW')") - public List findStocksBy(StockSearchBean searchBean) { - return allStocks.findStocks(searchBean); - } - - public void addInventory(Inventory inventory, String userName) { - if(inventory == null) { - return; - } - validateFields(inventory); - - ProductCatalogue productCatalogue = productCatalogueService.getProductCatalogueByName(inventory.getProductName()); - if(productCatalogue == null) { - throw new IllegalArgumentException( - "Invalid Product Name was selected"); - } - - if (productCatalogue != null && productCatalogue.getIsAttractiveItem() && inventory.getSerialNumber() == null) { - throw new IllegalArgumentException(MISSING_SERIAL_NUMBER); - } - - Stock existingStock = inventory.getStockId() != null ? getById(inventory.getStockId()) : null; - if (existingStock != null) { - throw new IllegalArgumentException( - "A stock already exists with given id. Consider updating data.[" + existingStock.getId() + "]"); - } - - Stock stock = convertInventoryToStock(inventory, userName); - if (stock == null) { - return; - } - allStocks.add(stock); - } - - public void updateInventory(Inventory inventory, String userName) { - validateFields(inventory); - if(inventory.getStockId() == null) { - return; - } - Stock stock = convertInventoryToStock(inventory, userName); - Stock existingStock = getById(inventory.getStockId()); - if (existingStock == null) { - throw new IllegalArgumentException( - "Stock to be updated is not an existing and persisting domain object. Update database object instead of new pojo"); - } + + private static Logger logger = LogManager.getLogger(StockService.class.toString()); + private final StocksRepository allStocks; + private ProductCatalogueService productCatalogueService; + private PhysicalLocationService physicalLocationService; + private InventoryDataValidator inventoryDataValidator; + + @Autowired + public StockService(StocksRepository allStocks, ProductCatalogueService productCatalogueService, PhysicalLocationService physicalLocationService, + InventoryDataValidator inventoryDataValidator) { + this.allStocks = allStocks; + this.productCatalogueService = productCatalogueService; + this.physicalLocationService = physicalLocationService; + this.inventoryDataValidator = inventoryDataValidator; + } + + @PreAuthorize("hasRole('STOCK_VIEW')") + public List findAllByProviderid(String providerid) { + return allStocks.findAllByProviderid(providerid); + } + + @PreAuthorize("hasRole('STOCK_VIEW')") + public Stock getById(String id) { + return allStocks.findById(id); + } + + @PreAuthorize("hasRole('STOCK_VIEW')") + public List getAll() { + return allStocks.getAll(); + } + + @PreAuthorize("hasRole('STOCK_VIEW')") + public List findStocks(StockSearchBean searchBean, String sortBy, String sortOrder, int limit) { + return allStocks.findStocks(searchBean, sortBy, sortOrder, 0, limit); + } + + @PreAuthorize("hasRole('STOCK_VIEW')") + public List findStocks(StockSearchBean searchBean) { + return allStocks.findStocks(searchBean); + } + + @PreAuthorize("hasRole('STOCK_VIEW')") + public List findAllStocks(Long serverVersion, Integer limit) { + return allStocks.findAllStocks(serverVersion, limit); + } + + public Stock find(Stock stock) { + Stock st = allStocks.findById(stock.getId()); + if (st == null) { + return null; + } else { + return stock; + } + } + + @PreAuthorize("hasRole('STOCK_CREATE')") + public synchronized Stock addStock(Stock stock) { + Stock st = find(stock); + if (st != null) { + throw new IllegalArgumentException( + "A stock already exists with given id. Consider updating data.[" + st.getId() + "]"); + } + allStocks.add(stock); + return stock; + } + + @PreAuthorize("hasRole('STOCK_CREATE') or hasRole('STOCK_UPDATE')") + public synchronized Stock addorUpdateStock(Stock stock) { + if (stock.getId() != null && getById(stock.getId()) != null) { + stock.setDateEdited(DateTime.now()); + stock.setRevision(getById(stock.getId()).getRevision()); + allStocks.update(stock); + } else { + stock.setDateCreated(DateTime.now()); + allStocks.add(stock); + } + return stock; + } + + @PreAuthorize("hasRole('STOCK_UPDATE')") + public void updateStock(Stock updatedStock) { + // If update is on original entity + if (updatedStock.isNew()) { + throw new IllegalArgumentException( + "Stock to be updated is not an existing and persisting domain object. Update database object instead of new pojo"); + } + + updatedStock.setDateEdited(DateTime.now()); + allStocks.update(updatedStock); + } + + @PreAuthorize("hasRole('STOCK_VIEW')") + public Stock find(String uniqueId) { + List sList = allStocks.findAllByProviderid(uniqueId); + if (sList.size() > 1) { + throw new IllegalArgumentException("Multiple events with identifier " + uniqueId + " exist."); + } else if (sList.size() != 0) { + return sList.get(0); + } + return null; + } + + @PreAuthorize("hasRole('STOCK_UPDATE')") + public Stock mergeStock(Stock updatedStock) { + Stock original = find(updatedStock); + if (original == null) { + throw new IllegalArgumentException("No stock found with given id. Consider adding new!"); + } + original.setDateEdited(DateTime.now()); + allStocks.update(original); + return original; + } + + @PreAuthorize("hasRole('STOCK_VIEW')") + public List findStocksBy(StockSearchBean searchBean) { + return allStocks.findStocks(searchBean); + } + + public void addInventory(Inventory inventory, String userName) { + if (inventory == null) { + return; + } + validateFields(inventory); + + ProductCatalogue productCatalogue = productCatalogueService.getProductCatalogueByName(inventory.getProductName()); + if (productCatalogue == null) { + throw new IllegalArgumentException( + "Invalid Product Name was selected"); + } + + if (productCatalogue != null && productCatalogue.getIsAttractiveItem() && inventory.getSerialNumber() == null) { + throw new IllegalArgumentException(MISSING_SERIAL_NUMBER); + } + + Stock existingStock = inventory.getStockId() != null ? getById(inventory.getStockId()) : null; + if (existingStock != null) { + throw new IllegalArgumentException( + "A stock already exists with given id. Consider updating data.[" + existingStock.getId() + "]"); + } + + Stock stock = convertInventoryToStock(inventory, userName); + if (stock == null) { + return; + } + allStocks.add(stock); + } + + public void updateInventory(Inventory inventory, String userName) { + validateFields(inventory); + if (inventory.getStockId() == null) { + return; + } + Stock stock = convertInventoryToStock(inventory, userName); + Stock existingStock = getById(inventory.getStockId()); + if (existingStock == null) { + throw new IllegalArgumentException( + "Stock to be updated is not an existing and persisting domain object. Update database object instead of new pojo"); + } stock.setId(existingStock.getId()); - stock.setDateEdited(DateTime.now()); - allStocks.update(stock); - } - - public Stock findByIdentifierAndServicePointId(String identifier, String locationId) { - return allStocks.findByIdentifierAndServicePointId(identifier,locationId); - } - - public void deleteStock(Long id) { - if (id != null) { - allStocks.delete(id); - } - } - - public List getStocksByServicePointId(StockSearchBean stockSearchBean) { - return allStocks.findStocksByLocationId(stockSearchBean); - } - - public CsvBulkImportDataSummary validateBulkInventoryData(List> csvStocks) { - int rowCount = 0; - CsvBulkImportDataSummary csvBulkImportDataSummary = new CsvBulkImportDataSummary(); - FailedRecordSummary failedRecordSummary; - List failedRecordSummaries = new ArrayList<>(); - Integer totalRows = csvStocks.size(); - Integer rowsProcessed = 0; - - try { - failedRecordSummaries = validateInventoryData(csvStocks); - } - catch (ParseException e) { - logger.error("Parse Exception occurred : " + e.getMessage(), e); - failedRecordSummary = new FailedRecordSummary(); - List validationError = new ArrayList<>(); - failedRecordSummary.setRowNumber(rowCount); - validationError.add("Parse Exception occurred"); - failedRecordSummary.setReasonOfFailure(validationError); - failedRecordSummaries.add(failedRecordSummary); - } - - csvBulkImportDataSummary.setFailedRecordSummaryList(failedRecordSummaries); - csvBulkImportDataSummary.setNumberOfCsvRows(totalRows); - csvBulkImportDataSummary.setNumberOfRowsProcessed(rowsProcessed); - return csvBulkImportDataSummary; - - } - - public CsvBulkImportDataSummary convertandPersistInventorydata(List> csvStocks, String userName) { - int rowCount = 0; - CsvBulkImportDataSummary csvBulkImportDataSummary = new CsvBulkImportDataSummary(); - FailedRecordSummary failedRecordSummary; - List failedRecordSummaries = new ArrayList<>(); - Inventory inventory; - Integer totalRows = csvStocks.size(); - Integer rowsProcessed = 0; - - try { - failedRecordSummaries = validateInventoryData(csvStocks); - } - catch (ParseException e) { - logger.error("Parse Exception occurred : " + e.getMessage(), e); - failedRecordSummary = new FailedRecordSummary(); - List validationError = new ArrayList<>(); - failedRecordSummary.setRowNumber(rowCount); - validationError.add("Parse Exception occurred"); - failedRecordSummary.setReasonOfFailure(validationError); - failedRecordSummaries.add(failedRecordSummary); - } - - if (failedRecordSummaries.size() == 0) { - for (Map csvdata : csvStocks) { - try { - rowCount++; - inventory = createInventoryObject(csvdata); - addInventory(inventory, userName); - rowsProcessed++; - } - catch (Exception e) { - failedRecordSummary = new FailedRecordSummary(); - List validationError = new ArrayList<>(); - failedRecordSummary.setRowNumber(rowCount); - validationError.add("Unknown error occurred"); - failedRecordSummary.setReasonOfFailure(validationError); - failedRecordSummaries.add(failedRecordSummary); - } - } - } - - csvBulkImportDataSummary.setFailedRecordSummaryList(failedRecordSummaries); - csvBulkImportDataSummary.setNumberOfCsvRows(totalRows); - csvBulkImportDataSummary.setNumberOfRowsProcessed(rowsProcessed); - return csvBulkImportDataSummary; - - } - - private List validateInventoryData(List> csvRows) throws ParseException { - - List failedRecordSummaries = new ArrayList<>(); - FailedRecordSummary failedRecordSummary; - int rowNumber = 0; - List validationErrors; - for (Map csvdata : csvRows) { - failedRecordSummary = new FailedRecordSummary(); - rowNumber++; - String locationId = getValueFromMap(SERVICE_POINT_ID, csvdata); - String productCatalogId = getValueFromMap(PRODUCT_ID, csvdata); - String deliveryDateInString = getValueFromMap(DELIVERY_DATE, csvdata); - String section = getValueFromMap(UNICEF_SECTION, csvdata); - String poNumber = getValueFromMap(PO_NUMBER, csvdata); - String serialNumber = getValueFromMap(SERIAL_NUMBER, csvdata); - String quantity = getValueFromMap(QUANTITY, csvdata); - String donor = getValueFromMap(DONOR, csvdata); - - validationErrors = inventoryDataValidator.getValidationErrors(locationId, productCatalogId, deliveryDateInString, section, poNumber, - serialNumber, quantity, donor); - - if (validationErrors.size() > 0) { - failedRecordSummary.setRowNumber(rowNumber); - failedRecordSummary.setReasonOfFailure(validationErrors); - failedRecordSummaries.add(failedRecordSummary); - } - } - return failedRecordSummaries; - } - - private Inventory createInventoryObject(Map data) throws ParseException { - Inventory inventory = new Inventory(); - String locationId = getValueFromMap(SERVICE_POINT_ID, data); - String productCatalogId = getValueFromMap(PRODUCT_ID, data); - String productName = getValueFromMap(PRODUCT_NAME, data); - String deliveryDateInString = getValueFromMap(DELIVERY_DATE, data); - String section = getValueFromMap(UNICEF_SECTION, data); - String poNumberFromCsv = getValueFromMap(PO_NUMBER, data); - String serialNumber = getValueFromMap(SERIAL_NUMBER, data); - String quantityFromCsv = getValueFromMap(QUANTITY, data); - String donor = getValueFromMap(DONOR, data); - int quantity = Integer.valueOf(quantityFromCsv); - int poNumber = Integer.valueOf(poNumberFromCsv); - - Long productId = Long.valueOf(productCatalogId); - ProductCatalogue productCatalogue = productCatalogueService.getProductCatalogue(productId, ""); - String productCatalogueName = productCatalogue != null ? productCatalogue.getProductName() : productName; - - inventory.setProductName(productCatalogueName); - inventory.setUnicefSection(section); - inventory.setQuantity(quantity); - inventory.setDeliveryDate(convertStringToDate(deliveryDateInString)); - inventory.setDonor(donor); - inventory.setServicePointId(locationId); - inventory.setPoNumber(poNumber); - inventory.setSerialNumber(serialNumber); - - return inventory; - } - - private Stock convertInventoryToStock(Inventory inventory, String username) { - Stock stock = new Stock(); - ProductCatalogue productCatalogue = productCatalogueService.getProductCatalogueByName(inventory.getProductName()); - if (inventory == null || productCatalogue == null) { - return null; - } - Date accountabilityEndDate = addMonthsToDate(inventory.getDeliveryDate(), - productCatalogue.getAccountabilityPeriod()); - Map customProperties = new HashMap<>(); - - stock.setIdentifier(String.valueOf(productCatalogue.getUniqueId())); - if(inventory.getProviderId() != null && !inventory.getProviderId().isBlank()) { - stock.setProviderid(inventory.getProviderId()); - } - else { - stock.setProviderid(username); - } - if(inventory.getQuantity() != null) { - stock.setValue(inventory.getQuantity()); - } - else { - stock.setValue(1); //As discussed set default value to 1 - } - stock.setTransactionType("Inventory"); - stock.setLocationId(inventory.getServicePointId()); - stock.setDeliveryDate(inventory.getDeliveryDate()); - if (inventory.getAccountabilityEndDate() != null) { - stock.setAccountabilityEndDate(inventory.getAccountabilityEndDate()); - } else { - stock.setAccountabilityEndDate(accountabilityEndDate); - } - stock.setDonor(inventory.getDonor()); - stock.setSerialNumber(inventory.getSerialNumber()); - customProperties.put("UNICEF section", inventory.getUnicefSection()); - customProperties.put("PO Number", String.valueOf(inventory.getPoNumber())); - stock.setCustomProperties(customProperties); - if (inventory.getStockId() != null) { - stock.setId(inventory.getStockId()); - } - return stock; - } - - private Date addMonthsToDate(Date date, Integer monthsCount) { - DateTime dateTime = new DateTime(date).plusMonths(monthsCount); - return dateTime.toDate(); - } - - private void validateFields(Inventory inventory) { - PhysicalLocation physicalLocation = inventory.getServicePointId() != null ? - physicalLocationService.getStructure(inventory.getServicePointId(), true) : - null; - - List donors = inventoryDataValidator.getValidDonors(); - List unicefSections = inventoryDataValidator.getValidUnicefSections(); - - Date deliveryDate = inventory.getDeliveryDate(); - if (inventory.getServicePointId() == null || inventory.getDeliveryDate() == null - || inventory.getProductName() == null - || inventory.getPoNumber() == null || inventory.getUnicefSection() == null) { - throw new IllegalArgumentException(MISSING_REQUIRED_FIELDS_V2); - } else if (physicalLocation == null) { - throw new IllegalArgumentException(SERVICE_POINT_DOES_NOT_EXISTS); - } else if (deliveryDate.getTime() > new Date().getTime()) { - throw new IllegalArgumentException(INVALID_DELIVERY_DATE); - } else if (inventory.getQuantity() != null && (!isWholeNumber(String.valueOf(inventory.getQuantity())) || inventory.getQuantity() < 1)) { - throw new IllegalArgumentException(INVALID_QUANTITY); - } else if (!unicefSections.contains(inventory.getUnicefSection())) { - throw new IllegalArgumentException(INVALID_UNICEF_SECTION); - } else if (inventory.getDonor() != null && !donors.contains(inventory.getDonor())) { - throw new IllegalArgumentException(INVALID_DONOR); - } else if (!isWholeNumber(String.valueOf(inventory.getPoNumber()))) { - throw new IllegalArgumentException(INVALID_PO_NUMBER); - } else { - logger.info("All validations on fields passed"); - } - } - - private String getValueFromMap(String key, Map map) { - return map.get(key); - } + stock.setDateEdited(DateTime.now()); + allStocks.update(stock); + } + + public Stock findByIdentifierAndServicePointId(String identifier, String locationId) { + return allStocks.findByIdentifierAndServicePointId(identifier, locationId); + } + + public void deleteStock(Long id) { + if (id != null) { + allStocks.delete(id); + } + } + + public List getStocksByServicePointId(StockSearchBean stockSearchBean) { + return allStocks.findStocksByLocationId(stockSearchBean); + } + + public CsvBulkImportDataSummary validateBulkInventoryData(List> csvStocks) { + int rowCount = 0; + CsvBulkImportDataSummary csvBulkImportDataSummary = new CsvBulkImportDataSummary(); + FailedRecordSummary failedRecordSummary; + List failedRecordSummaries = new ArrayList<>(); + Integer totalRows = csvStocks.size(); + Integer rowsProcessed = 0; + + try { + failedRecordSummaries = validateInventoryData(csvStocks); + } catch (ParseException e) { + logger.error("Parse Exception occurred : " + e.getMessage(), e); + failedRecordSummary = new FailedRecordSummary(); + List validationError = new ArrayList<>(); + failedRecordSummary.setRowNumber(rowCount); + validationError.add("Parse Exception occurred"); + failedRecordSummary.setReasonOfFailure(validationError); + failedRecordSummaries.add(failedRecordSummary); + } + + csvBulkImportDataSummary.setFailedRecordSummaryList(failedRecordSummaries); + csvBulkImportDataSummary.setNumberOfCsvRows(totalRows); + csvBulkImportDataSummary.setNumberOfRowsProcessed(rowsProcessed); + return csvBulkImportDataSummary; + + } + + public CsvBulkImportDataSummary convertandPersistInventorydata(List> csvStocks, String userName) { + int rowCount = 0; + CsvBulkImportDataSummary csvBulkImportDataSummary = new CsvBulkImportDataSummary(); + FailedRecordSummary failedRecordSummary; + List failedRecordSummaries = new ArrayList<>(); + Inventory inventory; + Integer totalRows = csvStocks.size(); + Integer rowsProcessed = 0; + + try { + failedRecordSummaries = validateInventoryData(csvStocks); + } catch (ParseException e) { + logger.error("Parse Exception occurred : " + e.getMessage(), e); + failedRecordSummary = new FailedRecordSummary(); + List validationError = new ArrayList<>(); + failedRecordSummary.setRowNumber(rowCount); + validationError.add("Parse Exception occurred"); + failedRecordSummary.setReasonOfFailure(validationError); + failedRecordSummaries.add(failedRecordSummary); + } + + if (failedRecordSummaries.size() == 0) { + for (Map csvdata : csvStocks) { + try { + rowCount++; + inventory = createInventoryObject(csvdata); + addInventory(inventory, userName); + rowsProcessed++; + } catch (Exception e) { + failedRecordSummary = new FailedRecordSummary(); + List validationError = new ArrayList<>(); + failedRecordSummary.setRowNumber(rowCount); + validationError.add("Unknown error occurred"); + failedRecordSummary.setReasonOfFailure(validationError); + failedRecordSummaries.add(failedRecordSummary); + } + } + } + + csvBulkImportDataSummary.setFailedRecordSummaryList(failedRecordSummaries); + csvBulkImportDataSummary.setNumberOfCsvRows(totalRows); + csvBulkImportDataSummary.setNumberOfRowsProcessed(rowsProcessed); + return csvBulkImportDataSummary; + + } + + private List validateInventoryData(List> csvRows) throws ParseException { + + List failedRecordSummaries = new ArrayList<>(); + FailedRecordSummary failedRecordSummary; + int rowNumber = 0; + List validationErrors; + for (Map csvdata : csvRows) { + failedRecordSummary = new FailedRecordSummary(); + rowNumber++; + String locationId = getValueFromMap(SERVICE_POINT_ID, csvdata); + String productCatalogId = getValueFromMap(PRODUCT_ID, csvdata); + String deliveryDateInString = getValueFromMap(DELIVERY_DATE, csvdata); + String section = getValueFromMap(UNICEF_SECTION, csvdata); + String poNumber = getValueFromMap(PO_NUMBER, csvdata); + String serialNumber = getValueFromMap(SERIAL_NUMBER, csvdata); + String quantity = getValueFromMap(QUANTITY, csvdata); + String donor = getValueFromMap(DONOR, csvdata); + + validationErrors = inventoryDataValidator.getValidationErrors(locationId, productCatalogId, deliveryDateInString, section, poNumber, + serialNumber, quantity, donor); + + if (validationErrors.size() > 0) { + failedRecordSummary.setRowNumber(rowNumber); + failedRecordSummary.setReasonOfFailure(validationErrors); + failedRecordSummaries.add(failedRecordSummary); + } + } + return failedRecordSummaries; + } + + private Inventory createInventoryObject(Map data) throws ParseException { + Inventory inventory = new Inventory(); + String locationId = getValueFromMap(SERVICE_POINT_ID, data); + String productCatalogId = getValueFromMap(PRODUCT_ID, data); + String productName = getValueFromMap(PRODUCT_NAME, data); + String deliveryDateInString = getValueFromMap(DELIVERY_DATE, data); + String section = getValueFromMap(UNICEF_SECTION, data); + String poNumberFromCsv = getValueFromMap(PO_NUMBER, data); + String serialNumber = getValueFromMap(SERIAL_NUMBER, data); + String quantityFromCsv = getValueFromMap(QUANTITY, data); + String donor = getValueFromMap(DONOR, data); + int quantity = Integer.valueOf(quantityFromCsv); + int poNumber = Integer.valueOf(poNumberFromCsv); + + Long productId = Long.valueOf(productCatalogId); + ProductCatalogue productCatalogue = productCatalogueService.getProductCatalogue(productId, ""); + String productCatalogueName = productCatalogue != null ? productCatalogue.getProductName() : productName; + + inventory.setProductName(productCatalogueName); + inventory.setUnicefSection(section); + inventory.setQuantity(quantity); + inventory.setDeliveryDate(convertStringToDate(deliveryDateInString)); + inventory.setDonor(donor); + inventory.setServicePointId(locationId); + inventory.setPoNumber(poNumber); + inventory.setSerialNumber(serialNumber); + + return inventory; + } + + private Stock convertInventoryToStock(Inventory inventory, String username) { + Stock stock = new Stock(); + ProductCatalogue productCatalogue = productCatalogueService.getProductCatalogueByName(inventory.getProductName()); + if (inventory == null || productCatalogue == null) { + return null; + } + Date accountabilityEndDate = addMonthsToDate(inventory.getDeliveryDate(), + productCatalogue.getAccountabilityPeriod()); + Map customProperties = new HashMap<>(); + + stock.setIdentifier(String.valueOf(productCatalogue.getUniqueId())); + if (inventory.getProviderId() != null && !inventory.getProviderId().isBlank()) { + stock.setProviderid(inventory.getProviderId()); + } else { + stock.setProviderid(username); + } + if (inventory.getQuantity() != null) { + stock.setValue(inventory.getQuantity()); + } else { + stock.setValue(1); //As discussed set default value to 1 + } + stock.setTransactionType("Inventory"); + stock.setLocationId(inventory.getServicePointId()); + stock.setDeliveryDate(inventory.getDeliveryDate()); + if (inventory.getAccountabilityEndDate() != null) { + stock.setAccountabilityEndDate(inventory.getAccountabilityEndDate()); + } else { + stock.setAccountabilityEndDate(accountabilityEndDate); + } + stock.setDonor(inventory.getDonor()); + stock.setSerialNumber(inventory.getSerialNumber()); + customProperties.put("UNICEF section", inventory.getUnicefSection()); + customProperties.put("PO Number", String.valueOf(inventory.getPoNumber())); + stock.setCustomProperties(customProperties); + if (inventory.getStockId() != null) { + stock.setId(inventory.getStockId()); + } + return stock; + } + + private Date addMonthsToDate(Date date, Integer monthsCount) { + DateTime dateTime = new DateTime(date).plusMonths(monthsCount); + return dateTime.toDate(); + } + + private void validateFields(Inventory inventory) { + PhysicalLocation physicalLocation = inventory.getServicePointId() != null ? + physicalLocationService.getStructure(inventory.getServicePointId(), true) : + null; + + List donors = inventoryDataValidator.getValidDonors(); + List unicefSections = inventoryDataValidator.getValidUnicefSections(); + + Date deliveryDate = inventory.getDeliveryDate(); + if (inventory.getServicePointId() == null || inventory.getDeliveryDate() == null + || inventory.getProductName() == null + || inventory.getPoNumber() == null || inventory.getUnicefSection() == null) { + throw new IllegalArgumentException(MISSING_REQUIRED_FIELDS_V2); + } else if (physicalLocation == null) { + throw new IllegalArgumentException(SERVICE_POINT_DOES_NOT_EXISTS); + } else if (deliveryDate.getTime() > new Date().getTime()) { + throw new IllegalArgumentException(INVALID_DELIVERY_DATE); + } else if (inventory.getQuantity() != null && (!isWholeNumber(String.valueOf(inventory.getQuantity())) || inventory.getQuantity() < 1)) { + throw new IllegalArgumentException(INVALID_QUANTITY); + } else if (!unicefSections.contains(inventory.getUnicefSection())) { + throw new IllegalArgumentException(INVALID_UNICEF_SECTION); + } else if (inventory.getDonor() != null && !donors.contains(inventory.getDonor())) { + throw new IllegalArgumentException(INVALID_DONOR); + } else if (!isWholeNumber(String.valueOf(inventory.getPoNumber()))) { + throw new IllegalArgumentException(INVALID_PO_NUMBER); + } else { + logger.info("All validations on fields passed"); + } + } + + private String getValueFromMap(String key, Map map) { + return map.get(key); + } } diff --git a/src/main/java/org/opensrp/service/TaskGenerator.java b/src/main/java/org/opensrp/service/TaskGenerator.java index dff6bb519..118feb1e6 100644 --- a/src/main/java/org/opensrp/service/TaskGenerator.java +++ b/src/main/java/org/opensrp/service/TaskGenerator.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.service; @@ -27,61 +27,61 @@ */ @Service public class TaskGenerator { - - @Autowired - private LocationRepository locationRepository; - - @Autowired - private ClientsRepository clientsRepository; - - @Autowired - private TaskRepository taskRepository; - - @Autowired - private EventsRepository eventsRepository; - - @Autowired - private StocksRepository stocksRepository; - - @Autowired - private PlanRepository planRepository; - - @Autowired - @Lazy - private QueueHelper queueHelper; - - @PostConstruct - private void postConstruct() { - PathEvaluatorLibrary.init(locationRepository, clientsRepository, taskRepository, eventsRepository, stocksRepository); - PathEvaluatorLibrary.getInstance().setPlanDao(planRepository); - } - - @Async - public void processPlanEvaluation(PlanDefinition planDefinition, PlanDefinition existingPlanDefinition, String username) { - if (!isInternalTaskGeneration(planDefinition)) { - return; - } - PlanEvaluator planEvaluator = new PlanEvaluator(username,queueHelper); - planEvaluator.evaluatePlan(planDefinition, existingPlanDefinition); - } - - @Async - public void processPlanEvaluation(PlanDefinition planDefinition, String username, Event event) { - PlanEvaluator planEvaluator = new PlanEvaluator(username,queueHelper); - planEvaluator.evaluatePlan(planDefinition, EventConverter.convertEventToEncounterResource(event)); - } - - public boolean isInternalTaskGeneration(PlanDefinition plan) { - boolean internalTaskGeneration = false; - for (PlanDefinition.UseContext useContext: plan.getUseContext()) { - if (useContext.getCode().equalsIgnoreCase("taskGenerationStatus") - && useContext.getValueCodableConcept().equalsIgnoreCase("Internal")) { - - internalTaskGeneration = true; - break; - } - } - return internalTaskGeneration; - } + + @Autowired + private LocationRepository locationRepository; + + @Autowired + private ClientsRepository clientsRepository; + + @Autowired + private TaskRepository taskRepository; + + @Autowired + private EventsRepository eventsRepository; + + @Autowired + private StocksRepository stocksRepository; + + @Autowired + private PlanRepository planRepository; + + @Autowired + @Lazy + private QueueHelper queueHelper; + + @PostConstruct + private void postConstruct() { + PathEvaluatorLibrary.init(locationRepository, clientsRepository, taskRepository, eventsRepository, stocksRepository); + PathEvaluatorLibrary.getInstance().setPlanDao(planRepository); + } + + @Async + public void processPlanEvaluation(PlanDefinition planDefinition, PlanDefinition existingPlanDefinition, String username) { + if (!isInternalTaskGeneration(planDefinition)) { + return; + } + PlanEvaluator planEvaluator = new PlanEvaluator(username, queueHelper); + planEvaluator.evaluatePlan(planDefinition, existingPlanDefinition); + } + + @Async + public void processPlanEvaluation(PlanDefinition planDefinition, String username, Event event) { + PlanEvaluator planEvaluator = new PlanEvaluator(username, queueHelper); + planEvaluator.evaluatePlan(planDefinition, EventConverter.convertEventToEncounterResource(event)); + } + + public boolean isInternalTaskGeneration(PlanDefinition plan) { + boolean internalTaskGeneration = false; + for (PlanDefinition.UseContext useContext : plan.getUseContext()) { + if (useContext.getCode().equalsIgnoreCase("taskGenerationStatus") + && useContext.getValueCodableConcept().equalsIgnoreCase("Internal")) { + + internalTaskGeneration = true; + break; + } + } + return internalTaskGeneration; + } } diff --git a/src/main/java/org/opensrp/service/TaskService.java b/src/main/java/org/opensrp/service/TaskService.java index b902beaa4..85b19b7e5 100644 --- a/src/main/java/org/opensrp/service/TaskService.java +++ b/src/main/java/org/opensrp/service/TaskService.java @@ -23,218 +23,217 @@ @Service public class TaskService { - - private static Logger logger = LogManager.getLogger(TaskService.class.toString()); - - private TaskRepository taskRepository; - - public static Task.TaskStatus fromString(String statusParam) { - for (Task.TaskStatus status : Task.TaskStatus.values()) { - if (status.name().equalsIgnoreCase(statusParam)) { - return status; - } - } - return null; - } - - @Autowired - public void setTaskRepository(TaskRepository taskRepository) { - this.taskRepository = taskRepository; - } - - - @PreAuthorize("hasRole('TASK_VIEW')") - @PostFilter("hasPermission(filterObject, 'TASK_VIEW')") - public List getAllTasks() { - return taskRepository.getAll(); - } - - @PreAuthorize("hasPermission(#task,'Task', 'TASK_CREATE') and hasPermission(#task,'Task', 'TASK_UPDATE')") - public void addOrUpdateTask(Task task) { - if (StringUtils.isBlank(task.getIdentifier())) - throw new IllegalArgumentException("Identifier not specified"); - task.setLastModified(new DateTime()); - if (getTask(task.getIdentifier()) != null) { - updateTask(task); - } else { - addTask(task); - } - } - - @PreAuthorize("hasPermission(#task,'Task', 'TASK_VIEW')") - public boolean taskExists(Task task){ - String taskIdentifier = task.getIdentifier(); - String entityId = task.getForEntity(); - String jurisdiction = task.getGroupIdentifier(); - String planIdentifier = task.getPlanIdentifier(); - String taskCode = task.getCode(); - - return (StringUtils.isNotBlank(taskIdentifier) && taskRepository.checkIfTaskExists(entityId, jurisdiction, planIdentifier, taskCode)); - } - - @PreAuthorize("hasPermission(#task,'Task', 'TASK_CREATE')") - public Task addTask(Task task) { - if (StringUtils.isBlank(task.getIdentifier())) - throw new IllegalArgumentException("Identifier not specified"); - if (!taskExists(task)) { - task.setAuthoredOn(new DateTime()); - task.setLastModified(new DateTime()); - taskRepository.add(task); - } - - return task; - } - - - @PreAuthorize("hasPermission(#task,'Task', 'TASK_UPDATE')") - public Task updateTask(Task task) { - if (StringUtils.isBlank(task.getIdentifier())) - throw new IllegalArgumentException("Identifier not specified"); - task.setLastModified(new DateTime()); - taskRepository.update(task); - return task; - } - - @PreAuthorize("hasRole('TASK_VIEW')") - @PostAuthorize("hasPermission(returnObject, 'TASK_VIEW')") - public Task getTask(String identifier) { - if (StringUtils.isBlank(identifier)) - return null; - return taskRepository.get(identifier); - } - - @PreAuthorize("hasRole('TASK_VIEW')") - @PostFilter("hasPermission(filterObject, 'TASK_VIEW')") - public List getTasksByTaskAndGroup(String task, String group, long serverVersion) { - return taskRepository.getTasksByPlanAndGroup(task, group, serverVersion); - } - - @PreAuthorize("hasPermission(#tasks,'Task','TASK_CREATE') and hasPermission(#tasks,'Task','TASK_UPDATE')") - public Set saveTasks(List tasks) { - Set tasksWithErrors = new HashSet<>(); - for (Task task : tasks) { - try { - addOrUpdateTask(task); - } - catch (Exception e) { - logger.error(e.getMessage(), e); - tasksWithErrors.add(task.getIdentifier()); - } - } - return tasksWithErrors; - } - - @PreAuthorize("hasPermission(#taskUpdates,'TaskUpdate','TASK_UPDATE')") - public List updateTaskStatus(List taskUpdates) { - List updatedTaskIds = new ArrayList<>(); - for (TaskUpdate taskUpdate : taskUpdates) { - Task task = taskRepository.get(taskUpdate.getIdentifier()); - try { - Task.TaskStatus status = fromString(taskUpdate.getStatus()); - if (task != null && status != null) { - task.setBusinessStatus(taskUpdate.getBusinessStatus()); - task.setStatus(status); - task.setLastModified(new DateTime()); - taskRepository.update(task); - updatedTaskIds.add(task.getIdentifier()); - } - } - catch (Exception e) { - logger.error(e.getMessage(), e); - } - } - return updatedTaskIds; - } - - /** - * This method searches for all task Ids - * - * @param serverVersion - * @param limit upper limit on number of tasks ids to fetch - * @return a list of all task ids and last server version - */ - public Pair, Long> findAllTaskIds(Long serverVersion, int limit) { - return taskRepository.findAllIds(serverVersion, limit); - } - - /** - * overloads {@link #findAllTaskIds(Long, int)} by adding date/time filters - * - * @param serverVersion - * @param limit - * @param fromDate - * @param toDate - * @return - */ - public Pair, Long> findAllTaskIds(Long serverVersion, int limit, Date fromDate, Date toDate) { - return taskRepository.findAllIds(serverVersion, limit, fromDate, toDate); - } - - /** - * This method searches for tasks ordered by serverVersion ascending - * - * @param serverVersion - * @param limit upper limit on number of tasks to fetch - * @return list of plan identifiers - */ - @PreAuthorize("hasRole('TASK_VIEW')") - @PostFilter("hasPermission(filterObject, 'TASK_VIEW')") - public List getAllTasks(Long serverVersion, int limit) { - return taskRepository.getAllTasks(serverVersion, limit); - } - - /** - * This method returns a list of tasks belonging to a particular owner - * - * @param plan plan identifier for the task - * @param owner the username of the person who initiated the task - * @param serverVersion Version of the server - * @return list of tasks created by the provider username (owner) - */ - @PreAuthorize("hasRole('TASK_VIEW')") - @PostFilter("hasPermission(filterObject, 'TASK_VIEW')") - public List getTasksByPlanAndOwner(String plan, String owner, long serverVersion) { - return taskRepository.getTasksByPlanAndOwner(plan, owner, serverVersion); - } - - /** - * This method returns a count of tasks belonging to a particular owner - * - * @param plan plan identifier for the task - * @param group the team who initiated the task - * @param serverVersion Version of the server - * @return count of tasks created by the provider username (owner) - */ - public Long countTasksByPlanAndGroup(String plan, String group, long serverVersion) { - return taskRepository.countTasksByPlanAndGroup(plan, group, serverVersion); - } - - /** - * This method returns a count of tasks belonging to a particular owner - * - * @param plan plan identifier for the task - * @param owner the username of the person who initiated the task - * @param serverVersion Version of the server - * @return count of tasks created by the provider username (owner) - */ - public Long countTasksByPlanAndOwner(String plan, String owner, long serverVersion) { - return taskRepository.countTasksByPlanAndOwner(plan, owner, serverVersion); - } - - /** - * Count all tasks - * @param serverVersion - * @return - */ - public Long countAllTasks(long serverVersion){ - return taskRepository.countAllTasks(serverVersion); - } - - public List getTasksBySearchBean(TaskSearchBean taskSearchBean) { - return taskRepository.getTasksBySearchBean(taskSearchBean); - } - - public int findTaskCountBySearchBean(TaskSearchBean taskSearchBean) { - return taskRepository.getTaskCount(taskSearchBean); - } + + private static Logger logger = LogManager.getLogger(TaskService.class.toString()); + + private TaskRepository taskRepository; + + public static Task.TaskStatus fromString(String statusParam) { + for (Task.TaskStatus status : Task.TaskStatus.values()) { + if (status.name().equalsIgnoreCase(statusParam)) { + return status; + } + } + return null; + } + + @Autowired + public void setTaskRepository(TaskRepository taskRepository) { + this.taskRepository = taskRepository; + } + + + @PreAuthorize("hasRole('TASK_VIEW')") + @PostFilter("hasPermission(filterObject, 'TASK_VIEW')") + public List getAllTasks() { + return taskRepository.getAll(); + } + + @PreAuthorize("hasPermission(#task,'Task', 'TASK_CREATE') and hasPermission(#task,'Task', 'TASK_UPDATE')") + public void addOrUpdateTask(Task task) { + if (StringUtils.isBlank(task.getIdentifier())) + throw new IllegalArgumentException("Identifier not specified"); + task.setLastModified(new DateTime()); + if (getTask(task.getIdentifier()) != null) { + updateTask(task); + } else { + addTask(task); + } + } + + @PreAuthorize("hasPermission(#task,'Task', 'TASK_VIEW')") + public boolean taskExists(Task task) { + String taskIdentifier = task.getIdentifier(); + String entityId = task.getForEntity(); + String jurisdiction = task.getGroupIdentifier(); + String planIdentifier = task.getPlanIdentifier(); + String taskCode = task.getCode(); + + return (StringUtils.isNotBlank(taskIdentifier) && taskRepository.checkIfTaskExists(entityId, jurisdiction, planIdentifier, taskCode)); + } + + @PreAuthorize("hasPermission(#task,'Task', 'TASK_CREATE')") + public Task addTask(Task task) { + if (StringUtils.isBlank(task.getIdentifier())) + throw new IllegalArgumentException("Identifier not specified"); + if (!taskExists(task)) { + task.setAuthoredOn(new DateTime()); + task.setLastModified(new DateTime()); + taskRepository.add(task); + } + + return task; + } + + + @PreAuthorize("hasPermission(#task,'Task', 'TASK_UPDATE')") + public Task updateTask(Task task) { + if (StringUtils.isBlank(task.getIdentifier())) + throw new IllegalArgumentException("Identifier not specified"); + task.setLastModified(new DateTime()); + taskRepository.update(task); + return task; + } + + @PreAuthorize("hasRole('TASK_VIEW')") + @PostAuthorize("hasPermission(returnObject, 'TASK_VIEW')") + public Task getTask(String identifier) { + if (StringUtils.isBlank(identifier)) + return null; + return taskRepository.get(identifier); + } + + @PreAuthorize("hasRole('TASK_VIEW')") + @PostFilter("hasPermission(filterObject, 'TASK_VIEW')") + public List getTasksByTaskAndGroup(String task, String group, long serverVersion) { + return taskRepository.getTasksByPlanAndGroup(task, group, serverVersion); + } + + @PreAuthorize("hasPermission(#tasks,'Task','TASK_CREATE') and hasPermission(#tasks,'Task','TASK_UPDATE')") + public Set saveTasks(List tasks) { + Set tasksWithErrors = new HashSet<>(); + for (Task task : tasks) { + try { + addOrUpdateTask(task); + } catch (Exception e) { + logger.error(e.getMessage(), e); + tasksWithErrors.add(task.getIdentifier()); + } + } + return tasksWithErrors; + } + + @PreAuthorize("hasPermission(#taskUpdates,'TaskUpdate','TASK_UPDATE')") + public List updateTaskStatus(List taskUpdates) { + List updatedTaskIds = new ArrayList<>(); + for (TaskUpdate taskUpdate : taskUpdates) { + Task task = taskRepository.get(taskUpdate.getIdentifier()); + try { + Task.TaskStatus status = fromString(taskUpdate.getStatus()); + if (task != null && status != null) { + task.setBusinessStatus(taskUpdate.getBusinessStatus()); + task.setStatus(status); + task.setLastModified(new DateTime()); + taskRepository.update(task); + updatedTaskIds.add(task.getIdentifier()); + } + } catch (Exception e) { + logger.error(e.getMessage(), e); + } + } + return updatedTaskIds; + } + + /** + * This method searches for all task Ids + * + * @param serverVersion + * @param limit upper limit on number of tasks ids to fetch + * @return a list of all task ids and last server version + */ + public Pair, Long> findAllTaskIds(Long serverVersion, int limit) { + return taskRepository.findAllIds(serverVersion, limit); + } + + /** + * overloads {@link #findAllTaskIds(Long, int)} by adding date/time filters + * + * @param serverVersion + * @param limit + * @param fromDate + * @param toDate + * @return + */ + public Pair, Long> findAllTaskIds(Long serverVersion, int limit, Date fromDate, Date toDate) { + return taskRepository.findAllIds(serverVersion, limit, fromDate, toDate); + } + + /** + * This method searches for tasks ordered by serverVersion ascending + * + * @param serverVersion + * @param limit upper limit on number of tasks to fetch + * @return list of plan identifiers + */ + @PreAuthorize("hasRole('TASK_VIEW')") + @PostFilter("hasPermission(filterObject, 'TASK_VIEW')") + public List getAllTasks(Long serverVersion, int limit) { + return taskRepository.getAllTasks(serverVersion, limit); + } + + /** + * This method returns a list of tasks belonging to a particular owner + * + * @param plan plan identifier for the task + * @param owner the username of the person who initiated the task + * @param serverVersion Version of the server + * @return list of tasks created by the provider username (owner) + */ + @PreAuthorize("hasRole('TASK_VIEW')") + @PostFilter("hasPermission(filterObject, 'TASK_VIEW')") + public List getTasksByPlanAndOwner(String plan, String owner, long serverVersion) { + return taskRepository.getTasksByPlanAndOwner(plan, owner, serverVersion); + } + + /** + * This method returns a count of tasks belonging to a particular owner + * + * @param plan plan identifier for the task + * @param group the team who initiated the task + * @param serverVersion Version of the server + * @return count of tasks created by the provider username (owner) + */ + public Long countTasksByPlanAndGroup(String plan, String group, long serverVersion) { + return taskRepository.countTasksByPlanAndGroup(plan, group, serverVersion); + } + + /** + * This method returns a count of tasks belonging to a particular owner + * + * @param plan plan identifier for the task + * @param owner the username of the person who initiated the task + * @param serverVersion Version of the server + * @return count of tasks created by the provider username (owner) + */ + public Long countTasksByPlanAndOwner(String plan, String owner, long serverVersion) { + return taskRepository.countTasksByPlanAndOwner(plan, owner, serverVersion); + } + + /** + * Count all tasks + * + * @param serverVersion + * @return + */ + public Long countAllTasks(long serverVersion) { + return taskRepository.countAllTasks(serverVersion); + } + + public List getTasksBySearchBean(TaskSearchBean taskSearchBean) { + return taskRepository.getTasksBySearchBean(taskSearchBean); + } + + public int findTaskCountBySearchBean(TaskSearchBean taskSearchBean) { + return taskRepository.getTaskCount(taskSearchBean); + } } diff --git a/src/main/java/org/opensrp/service/UniqueIdentifierService.java b/src/main/java/org/opensrp/service/UniqueIdentifierService.java index 41f626df3..d6ec74441 100644 --- a/src/main/java/org/opensrp/service/UniqueIdentifierService.java +++ b/src/main/java/org/opensrp/service/UniqueIdentifierService.java @@ -13,25 +13,24 @@ @Service public class UniqueIdentifierService { - @Autowired - private UniqueIdGeneratorProcessor uniqueIdGeneratorProcessor; - - public UniqueIdentifierService(UniqueIdGeneratorProcessor uniqueIdGeneratorProcessor) { - this.uniqueIdGeneratorProcessor = uniqueIdGeneratorProcessor; - } - - @PreAuthorize("hasRole('IDENTIFIER_CREATE')") - @Transactional - public List generateIdentifiers(IdentifierSource identifierSource, int numberOfIdsToGenerate, String usedBy) { - - try { - List identifiers = uniqueIdGeneratorProcessor - .getIdentifiers(identifierSource, numberOfIdsToGenerate, usedBy); - return identifiers; - } - catch (Exception ex) { - throw new IllegalArgumentException( - ex.getMessage()); - } - } + @Autowired + private UniqueIdGeneratorProcessor uniqueIdGeneratorProcessor; + + public UniqueIdentifierService(UniqueIdGeneratorProcessor uniqueIdGeneratorProcessor) { + this.uniqueIdGeneratorProcessor = uniqueIdGeneratorProcessor; + } + + @PreAuthorize("hasRole('IDENTIFIER_CREATE')") + @Transactional + public List generateIdentifiers(IdentifierSource identifierSource, int numberOfIdsToGenerate, String usedBy) { + + try { + List identifiers = uniqueIdGeneratorProcessor + .getIdentifiers(identifierSource, numberOfIdsToGenerate, usedBy); + return identifiers; + } catch (Exception ex) { + throw new IllegalArgumentException( + ex.getMessage()); + } + } } diff --git a/src/main/java/org/opensrp/service/UploadService.java b/src/main/java/org/opensrp/service/UploadService.java index cc449cc95..d35c2c31e 100644 --- a/src/main/java/org/opensrp/service/UploadService.java +++ b/src/main/java/org/opensrp/service/UploadService.java @@ -36,16 +36,13 @@ public class UploadService { //TODO : Add annotations of spring-security - private final Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") - .registerTypeAdapter(DateTime.class, new DateTimeTypeConverter()).create(); - public static final String CLIENT = "client"; public static final String EVENT = "event"; public static final String DEFAULT_RESIDENCE = "default_residence"; - private static final Logger logger = LogManager.getLogger(UploadService.class.toString()); public static String CSV_UPLOAD_SETTING = "csv_upload_config"; - + private final Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") + .registerTypeAdapter(DateTime.class, new DateTimeTypeConverter()).create(); private SettingRepository settingRepository; private ClientsRepository clientsRepository; @@ -86,7 +83,7 @@ public UploadValidationBean validateFieldValues(List> csvCli .stream() .collect(Collectors.groupingBy(CSVRowConfig::getColumnName)); - if(csvClients.size() > 0 && csvClients.get(0).size() != configs.size()) + if (csvClients.size() > 0 && csvClients.get(0).size() != configs.size()) throw new IllegalArgumentException("The number of rows must be equal to the mappings size"); int rowNumber = 1; @@ -105,7 +102,7 @@ public UploadValidationBean validateFieldValues(List> csvCli client.setBaseEntityId(baseEntityID); // Get structure by Id String uploadedStructureId = (String) client.getAttribute(DEFAULT_RESIDENCE); - dbStructure = locationRepository.getStructure(uploadedStructureId,false); + dbStructure = locationRepository.getStructure(uploadedStructureId, false); if (dbStructure == null) { throw new IllegalArgumentException("Structure with id " + uploadedStructureId + " does not exist"); } @@ -160,7 +157,7 @@ public List getCSVConfig(String eventName) { SettingSearchBean settingSearchBean = new SettingSearchBean(); settingSearchBean.setIdentifier(CSV_UPLOAD_SETTING); settingSearchBean.setServerVersion(0L); - List configurations = settingRepository.findSettings(settingSearchBean,null); + List configurations = settingRepository.findSettings(settingSearchBean, null); int count = 0; while (count < configurations.size()) { diff --git a/src/main/java/org/opensrp/service/ViewConfigurationService.java b/src/main/java/org/opensrp/service/ViewConfigurationService.java index b772cc11d..f4466b134 100644 --- a/src/main/java/org/opensrp/service/ViewConfigurationService.java +++ b/src/main/java/org/opensrp/service/ViewConfigurationService.java @@ -10,17 +10,17 @@ @Service public class ViewConfigurationService { - - private ViewConfigurationRepository viewConfigurationRepository; - - @Autowired - public void setViewConfigurationRepository(ViewConfigurationRepository viewConfigurationRepository) { - this.viewConfigurationRepository = viewConfigurationRepository; - } - @PreAuthorize("hasRole('SYNC_VIEWCONFIGURATION')") - public List findViewConfigurationsByVersion(Long lastSyncedServerVersion) { - return viewConfigurationRepository.findViewConfigurationsByVersion(lastSyncedServerVersion); - } - + private ViewConfigurationRepository viewConfigurationRepository; + + @Autowired + public void setViewConfigurationRepository(ViewConfigurationRepository viewConfigurationRepository) { + this.viewConfigurationRepository = viewConfigurationRepository; + } + + @PreAuthorize("hasRole('SYNC_VIEWCONFIGURATION')") + public List findViewConfigurationsByVersion(Long lastSyncedServerVersion) { + return viewConfigurationRepository.findViewConfigurationsByVersion(lastSyncedServerVersion); + } + } diff --git a/src/main/java/org/opensrp/service/formSubmission/EventsListener.java b/src/main/java/org/opensrp/service/formSubmission/EventsListener.java index e954912b3..1cb8b7fa8 100644 --- a/src/main/java/org/opensrp/service/formSubmission/EventsListener.java +++ b/src/main/java/org/opensrp/service/formSubmission/EventsListener.java @@ -24,89 +24,84 @@ @Component public class EventsListener { - - private static Logger logger = LogManager.getLogger(EventsListener.class.toString()); - - private static final ReentrantLock lock = new ReentrantLock(); - - private ConfigService configService; - - @Autowired - private EventService eventService; - - private EventsRouter eventsRouter; - - private ErrorTraceService errorTraceService; - - @Autowired - public EventsListener(EventsRouter eventsRouter, ConfigService configService, EventService eventService, - ErrorTraceService errorTraceService) { - this.configService = configService; - this.errorTraceService = errorTraceService; - this.eventsRouter = eventsRouter; - this.eventService = eventService; - this.configService.registerAppStateToken(AllConstants.Config.EVENTS_PARSER_LAST_PROCESSED_EVENT, 0, - "Token to keep track of events processed for client n event parsing and schedule handling", true); - } - - public void processEvent() { - if (!lock.tryLock()) { - logger.warn("Not fetching events from Message Queue. It is already in progress."); - return; - } - try { - logger.info("Fetching Events"); - long version = getVersion(); - - List events = eventService.findByServerVersionOutOfCatchment(version); - - if (events.isEmpty()) { - logger.info("No new events found. Export token: " + version); - return; - } - - logger.info(format("Fetched {0} new events found. Export token: {1}", events.size(), version)); - - sort(events, serverVersionComparator()); - - for (Event event : events) { - try { - event = eventService.processOutOfArea(event); - eventsRouter.route(event); - configService.updateAppStateToken(AllConstants.Config.EVENTS_PARSER_LAST_PROCESSED_EVENT, - event.getServerVersion()); - } - catch (Exception e) { - e.printStackTrace(); - errorTraceService - .addError(new ErrorTrace(new DateTime(), "FormSubmissionProcessor", this.getClass().getName(), - e.getStackTrace().toString(), "unsolved ", "FormSubmission")); - } - } - } - catch (Exception e) { - logger.error(format("{0} occurred while trying to fetch events. Message: {1} with stack trace {2}", e.toString(), - e.getMessage(), getFullStackTrace(e))); - } - finally { - lock.unlock(); - } - } - - public long getCurrentMilliseconds() { - return System.currentTimeMillis(); - } - - private long getVersion() { - AppStateToken token = configService.getAppStateTokenByName(AllConstants.Config.EVENTS_PARSER_LAST_PROCESSED_EVENT); - return token == null ? 0L : token.longValue(); - } - - private Comparator serverVersionComparator() { - return new Comparator() { - public int compare(Event firstEvent, Event secondEvent) { - return Long.compare(firstEvent.getVersion(), secondEvent.getVersion()); - } - }; - } + + private static final ReentrantLock lock = new ReentrantLock(); + private static Logger logger = LogManager.getLogger(EventsListener.class.toString()); + private ConfigService configService; + + @Autowired + private EventService eventService; + + private EventsRouter eventsRouter; + + private ErrorTraceService errorTraceService; + + @Autowired + public EventsListener(EventsRouter eventsRouter, ConfigService configService, EventService eventService, + ErrorTraceService errorTraceService) { + this.configService = configService; + this.errorTraceService = errorTraceService; + this.eventsRouter = eventsRouter; + this.eventService = eventService; + this.configService.registerAppStateToken(AllConstants.Config.EVENTS_PARSER_LAST_PROCESSED_EVENT, 0, + "Token to keep track of events processed for client n event parsing and schedule handling", true); + } + + public void processEvent() { + if (!lock.tryLock()) { + logger.warn("Not fetching events from Message Queue. It is already in progress."); + return; + } + try { + logger.info("Fetching Events"); + long version = getVersion(); + + List events = eventService.findByServerVersionOutOfCatchment(version); + + if (events.isEmpty()) { + logger.info("No new events found. Export token: " + version); + return; + } + + logger.info(format("Fetched {0} new events found. Export token: {1}", events.size(), version)); + + sort(events, serverVersionComparator()); + + for (Event event : events) { + try { + event = eventService.processOutOfArea(event); + eventsRouter.route(event); + configService.updateAppStateToken(AllConstants.Config.EVENTS_PARSER_LAST_PROCESSED_EVENT, + event.getServerVersion()); + } catch (Exception e) { + e.printStackTrace(); + errorTraceService + .addError(new ErrorTrace(new DateTime(), "FormSubmissionProcessor", this.getClass().getName(), + e.getStackTrace().toString(), "unsolved ", "FormSubmission")); + } + } + } catch (Exception e) { + logger.error(format("{0} occurred while trying to fetch events. Message: {1} with stack trace {2}", e.toString(), + e.getMessage(), getFullStackTrace(e))); + } finally { + lock.unlock(); + } + } + + public long getCurrentMilliseconds() { + return System.currentTimeMillis(); + } + + private long getVersion() { + AppStateToken token = configService.getAppStateTokenByName(AllConstants.Config.EVENTS_PARSER_LAST_PROCESSED_EVENT); + return token == null ? 0L : token.longValue(); + } + + private Comparator serverVersionComparator() { + return new Comparator() { + public int compare(Event firstEvent, Event secondEvent) { + return Long.compare(firstEvent.getVersion(), secondEvent.getVersion()); + } + }; + } } diff --git a/src/main/java/org/opensrp/service/formSubmission/handler/EventsHandler.java b/src/main/java/org/opensrp/service/formSubmission/handler/EventsHandler.java index eb9d1305a..ea835c640 100644 --- a/src/main/java/org/opensrp/service/formSubmission/handler/EventsHandler.java +++ b/src/main/java/org/opensrp/service/formSubmission/handler/EventsHandler.java @@ -4,6 +4,6 @@ import org.smartregister.domain.Event; public interface EventsHandler { - - public void handle(Event event, JSONObject scheduleConfigEvent, String scheduleName); + + public void handle(Event event, JSONObject scheduleConfigEvent, String scheduleName); } diff --git a/src/main/java/org/opensrp/service/formSubmission/handler/EventsRouter.java b/src/main/java/org/opensrp/service/formSubmission/handler/EventsRouter.java index 1c7ad3716..a876a30ba 100644 --- a/src/main/java/org/opensrp/service/formSubmission/handler/EventsRouter.java +++ b/src/main/java/org/opensrp/service/formSubmission/handler/EventsRouter.java @@ -20,129 +20,119 @@ @Component public class EventsRouter { - - private static Logger logger = LogManager.getLogger(EventsRouter.class.toString()); - - @Autowired - private IHandlerMapper handlerMapper; - - // @Value("#{opensrp['schedule.config.json.path']}") - // String scheduleConfigPath; - @Value("#{opensrp['schedules.config.files.dir']}") - String scheduleConfigFilesPath; - - // private static final String JSON_KEY_SCHEDULES = "schedules"; - private static final String JSON_KEY_HANDLER = "handler"; - - private static final String JSON_KEY_TYPES = "types"; - - private static final String JSON_KEY_SCHEDULE_NAME = "name"; - - private static final String JSON_KEY_EVENTS = "events"; - - ResourceLoader loader = new DefaultResourceLoader(); - - File scheduleConfigsFolder = null; - - Event event; - - @Autowired - public EventsRouter(IHandlerMapper handlerMapper, - @Value("#{opensrp['schedules.config.files.dir']}") String scheduleConfigFilesPath) { - this.handlerMapper = handlerMapper; - this.scheduleConfigFilesPath = scheduleConfigFilesPath; - } - - /** - * @param _event Event to route - */ - public void route(Event _event) { - try { - event = _event; - if (scheduleConfigFilesPath != null && !scheduleConfigFilesPath.isEmpty()) { - - String schedulesStr = getScheduleConfigs(); - - JSONArray schedulesJsonObject = new JSONArray("[" + schedulesStr + "]"); - //iterate through concatenated schedule-configs files to retrieve the events and compare with the current event from the db - for (int i = 0; i < schedulesJsonObject.length(); i++) { - JSONObject scheduleJsonObject = schedulesJsonObject.getJSONObject(i); - String handler = scheduleJsonObject.has(JSON_KEY_HANDLER) - ? scheduleJsonObject.getString(JSON_KEY_HANDLER) - : "VaccinesScheduleHandler"; - JSONArray eventsJsonArray = scheduleJsonObject.getJSONArray(JSON_KEY_EVENTS); - String scheduleName = scheduleJsonObject.getString(JSON_KEY_SCHEDULE_NAME); - processScheduleConfigEvents(eventsJsonArray, handler, scheduleName); - - } - - } - } - catch (IOException | JSONException e) { - logger.error("", e); - } - - } - - /** - * This method iterates through 'events' defined in the schedule-configs to see if they match - * the current event, if so get the handler and process the event - * - * @param eventsJsonArray - * @param handler - * @throws JSONException - */ - private void processScheduleConfigEvents(JSONArray eventsJsonArray, String handler, String scheduleName) - throws JSONException { - //iterate through the events in the scheduleconfigs to see if the current event (the one passed to this route method) has a schedule handler - for (int j = 0; j < eventsJsonArray.length(); j++) { - JSONObject scheduleConfigEvent = eventsJsonArray.getJSONObject(j); - JSONArray eventTypesJsonArray = scheduleConfigEvent.getJSONArray(JSON_KEY_TYPES); - List eventsList = jsonArrayToList(eventTypesJsonArray); - - if (eventsList.contains(event.getEventType())) { - if (handlerMapper.handlerMap().get(handler) != null) { - handlerMapper.handlerMap().get(handler).handle(event, scheduleConfigEvent, scheduleName); - } - - } - - } - } - - /** - * This method merges all the files in the schedule-configs folder to create one - * jsonobject/array - * - * @return - * @throws IOException - */ - private String getScheduleConfigs() throws IOException { - if (scheduleConfigsFolder == null && loader.getResource(scheduleConfigFilesPath).exists()) - scheduleConfigFilesPath = loader.getResource(scheduleConfigFilesPath).getURI().getPath(); - scheduleConfigsFolder = new File(scheduleConfigFilesPath); - String scheduleConfigMapping = ""; - File[] scheduleFiles = scheduleConfigsFolder.listFiles(); - if (scheduleFiles != null) - for (int i = 0; i < scheduleFiles.length; i++) { - final File fileEntry = scheduleFiles[i]; - String scheduleConfig = FileUtils.readFileToString(new File(fileEntry.getAbsolutePath()), "UTF-8"); - scheduleConfigMapping += (i + 1 == scheduleFiles.length) ? scheduleConfig : scheduleConfig.concat(","); - - } - return scheduleConfigMapping; - } - - private List jsonArrayToList(JSONArray jsonArray) throws JSONException { - List values = new ArrayList(); - if (jsonArray == null) { - return values; - } - - for (int i = 0; i < jsonArray.length(); i++) { - values.add((String) jsonArray.get(i)); - } - return values; - } - + + // private static final String JSON_KEY_SCHEDULES = "schedules"; + private static final String JSON_KEY_HANDLER = "handler"; + private static final String JSON_KEY_TYPES = "types"; + private static final String JSON_KEY_SCHEDULE_NAME = "name"; + private static final String JSON_KEY_EVENTS = "events"; + private static Logger logger = LogManager.getLogger(EventsRouter.class.toString()); + // @Value("#{opensrp['schedule.config.json.path']}") + // String scheduleConfigPath; + @Value("#{opensrp['schedules.config.files.dir']}") + String scheduleConfigFilesPath; + ResourceLoader loader = new DefaultResourceLoader(); + File scheduleConfigsFolder = null; + Event event; + @Autowired + private IHandlerMapper handlerMapper; + + @Autowired + public EventsRouter(IHandlerMapper handlerMapper, + @Value("#{opensrp['schedules.config.files.dir']}") String scheduleConfigFilesPath) { + this.handlerMapper = handlerMapper; + this.scheduleConfigFilesPath = scheduleConfigFilesPath; + } + + /** + * @param _event Event to route + */ + public void route(Event _event) { + try { + event = _event; + if (scheduleConfigFilesPath != null && !scheduleConfigFilesPath.isEmpty()) { + + String schedulesStr = getScheduleConfigs(); + + JSONArray schedulesJsonObject = new JSONArray("[" + schedulesStr + "]"); + //iterate through concatenated schedule-configs files to retrieve the events and compare with the current event from the db + for (int i = 0; i < schedulesJsonObject.length(); i++) { + JSONObject scheduleJsonObject = schedulesJsonObject.getJSONObject(i); + String handler = scheduleJsonObject.has(JSON_KEY_HANDLER) + ? scheduleJsonObject.getString(JSON_KEY_HANDLER) + : "VaccinesScheduleHandler"; + JSONArray eventsJsonArray = scheduleJsonObject.getJSONArray(JSON_KEY_EVENTS); + String scheduleName = scheduleJsonObject.getString(JSON_KEY_SCHEDULE_NAME); + processScheduleConfigEvents(eventsJsonArray, handler, scheduleName); + + } + + } + } catch (IOException | JSONException e) { + logger.error("", e); + } + + } + + /** + * This method iterates through 'events' defined in the schedule-configs to see if they match + * the current event, if so get the handler and process the event + * + * @param eventsJsonArray + * @param handler + * @throws JSONException + */ + private void processScheduleConfigEvents(JSONArray eventsJsonArray, String handler, String scheduleName) + throws JSONException { + //iterate through the events in the scheduleconfigs to see if the current event (the one passed to this route method) has a schedule handler + for (int j = 0; j < eventsJsonArray.length(); j++) { + JSONObject scheduleConfigEvent = eventsJsonArray.getJSONObject(j); + JSONArray eventTypesJsonArray = scheduleConfigEvent.getJSONArray(JSON_KEY_TYPES); + List eventsList = jsonArrayToList(eventTypesJsonArray); + + if (eventsList.contains(event.getEventType())) { + if (handlerMapper.handlerMap().get(handler) != null) { + handlerMapper.handlerMap().get(handler).handle(event, scheduleConfigEvent, scheduleName); + } + + } + + } + } + + /** + * This method merges all the files in the schedule-configs folder to create one + * jsonobject/array + * + * @return + * @throws IOException + */ + private String getScheduleConfigs() throws IOException { + if (scheduleConfigsFolder == null && loader.getResource(scheduleConfigFilesPath).exists()) + scheduleConfigFilesPath = loader.getResource(scheduleConfigFilesPath).getURI().getPath(); + scheduleConfigsFolder = new File(scheduleConfigFilesPath); + String scheduleConfigMapping = ""; + File[] scheduleFiles = scheduleConfigsFolder.listFiles(); + if (scheduleFiles != null) + for (int i = 0; i < scheduleFiles.length; i++) { + final File fileEntry = scheduleFiles[i]; + String scheduleConfig = FileUtils.readFileToString(new File(fileEntry.getAbsolutePath()), "UTF-8"); + scheduleConfigMapping += (i + 1 == scheduleFiles.length) ? scheduleConfig : scheduleConfig.concat(","); + + } + return scheduleConfigMapping; + } + + private List jsonArrayToList(JSONArray jsonArray) throws JSONException { + List values = new ArrayList(); + if (jsonArray == null) { + return values; + } + + for (int i = 0; i < jsonArray.length(); i++) { + values.add((String) jsonArray.get(i)); + } + return values; + } + } diff --git a/src/main/java/org/opensrp/service/formSubmission/handler/IHandlerMapper.java b/src/main/java/org/opensrp/service/formSubmission/handler/IHandlerMapper.java index 636207be0..8b36fd8ba 100644 --- a/src/main/java/org/opensrp/service/formSubmission/handler/IHandlerMapper.java +++ b/src/main/java/org/opensrp/service/formSubmission/handler/IHandlerMapper.java @@ -7,12 +7,12 @@ @Component public class IHandlerMapper { - - public Map handlerMap() { - return new HashMap<>(); - } - - public Map addHandler(String name, EventsHandler handler) { - return new HashMap<>(); - } + + public Map handlerMap() { + return new HashMap<>(); + } + + public Map addHandler(String name, EventsHandler handler) { + return new HashMap<>(); + } } diff --git a/src/main/java/org/opensrp/service/multimedia/BaseMultimediaFileManager.java b/src/main/java/org/opensrp/service/multimedia/BaseMultimediaFileManager.java index 0707cf401..39c54cfbe 100644 --- a/src/main/java/org/opensrp/service/multimedia/BaseMultimediaFileManager.java +++ b/src/main/java/org/opensrp/service/multimedia/BaseMultimediaFileManager.java @@ -26,21 +26,15 @@ public abstract class BaseMultimediaFileManager implements MultimediaFileManager { + private static final String SUCCESS = "success"; + private static final String FAIL = "fail"; + private static Logger logger = LogManager.getLogger(BaseMultimediaFileManager.class.getName()); private final MultimediaRepository multimediaRepository; - private final ClientService clientService; - protected String multimediaDirPath; - @Value("#{opensrp['multimedia.directory.name']}") protected String baseMultimediaDirPath; - private static Logger logger = LogManager.getLogger(BaseMultimediaFileManager.class.getName()); - - private static final String SUCCESS = "success"; - - private static final String FAIL = "fail"; - public BaseMultimediaFileManager(MultimediaRepository multimediaRepository, ClientService clientService) { this.multimediaRepository = multimediaRepository; this.clientService = clientService; @@ -61,6 +55,7 @@ public void copyBytesToFile(File destination, byte[] fileBytes) throws IOExcepti /** * Persists a {@link byte[]} with the given {@param fileName} to storage + * * @param fileName * @param fileBytes * @throws IOException @@ -108,10 +103,9 @@ public String saveMultimediaFile(MultimediaDTO multimediaDTO, byte[] fileBytes, /** * Saves a multi-part file uploaded to the server * - * @param multimediaDTO {@link MultimediaDTO} object populated with information about the file to be saved - * @param fileBytes {@link byte[]} bytes to save to disk + * @param multimediaDTO {@link MultimediaDTO} object populated with information about the file to be saved + * @param fileBytes {@link byte[]} bytes to save to disk * @param originalFileName {@link String} original name of the file - * * @return true if the file was saved else false */ public boolean uploadFile(MultimediaDTO multimediaDTO, byte[] fileBytes, String originalFileName) { @@ -159,7 +153,7 @@ public String getMultimediaFilePath(MultimediaDTO multimediaDTO, String original multimediaDirPath += OTHER_DIR; fileExt = getFileExtension(originalFileName); - if(StringUtils.isBlank(fileExt)) + if (StringUtils.isBlank(fileExt)) throw new IllegalArgumentException("Unknown content type : " + multimediaDTO.getContentType()); break; } diff --git a/src/main/java/org/opensrp/service/multimedia/FileSystemMultimediaFileManager.java b/src/main/java/org/opensrp/service/multimedia/FileSystemMultimediaFileManager.java index d7e2f7043..dddaa59cc 100644 --- a/src/main/java/org/opensrp/service/multimedia/FileSystemMultimediaFileManager.java +++ b/src/main/java/org/opensrp/service/multimedia/FileSystemMultimediaFileManager.java @@ -31,7 +31,7 @@ protected void persistFileToStorage(String fileName, byte[] fileBytes) throws IO @Override protected String getBaseMultiMediaDir() { - return baseMultimediaDirPath + File.separator; + return baseMultimediaDirPath + File.separator; } /** diff --git a/src/main/java/org/opensrp/service/multimedia/MultimediaFileManager.java b/src/main/java/org/opensrp/service/multimedia/MultimediaFileManager.java index c32347513..aa486b2dd 100644 --- a/src/main/java/org/opensrp/service/multimedia/MultimediaFileManager.java +++ b/src/main/java/org/opensrp/service/multimedia/MultimediaFileManager.java @@ -11,7 +11,6 @@ public interface MultimediaFileManager { /** - * * Persists a {@link byte[]} to storage * * @param multimedia @@ -22,7 +21,6 @@ public interface MultimediaFileManager { String saveFile(MultimediaDTO multimedia, byte[] fileBytes, String originalFileName); /** - * * Retrieves a file from storage or null if it doesn't exist * * @param filePath @@ -31,7 +29,6 @@ public interface MultimediaFileManager { File retrieveFile(String filePath); /** - * * Gets the path to the local (filesystem) multimedia file directory * * @return @@ -40,7 +37,6 @@ public interface MultimediaFileManager { /** - * * Gets the the local (filesystem) path where a file should be saved * * @return diff --git a/src/main/java/org/opensrp/service/multimedia/OSSClientBuilder.java b/src/main/java/org/opensrp/service/multimedia/OSSClientBuilder.java index 0549cfc4c..2ecebedda 100644 --- a/src/main/java/org/opensrp/service/multimedia/OSSClientBuilder.java +++ b/src/main/java/org/opensrp/service/multimedia/OSSClientBuilder.java @@ -6,29 +6,29 @@ * Created by Vincent Karuri on 26/05/2020 */ public class OSSClientBuilder { - - private String objectStorageAccessKeyId; - - private String objectStorageSecretAccessKey; - - private String objectStorageRegion; - - public OSSClientBuilder withObjectStorageAccessKeyId(String objectStorageAccessKeyId) { - this.objectStorageAccessKeyId = objectStorageAccessKeyId; - return this; - } - - public OSSClientBuilder withObjectStorageSecretAccessKey(String objectStorageSecretAccessKey) { - this.objectStorageSecretAccessKey = objectStorageSecretAccessKey; - return this; - } - - public OSSClientBuilder withObjectStorageRegion(String objectStorageRegion) { - this.objectStorageRegion = objectStorageRegion; - return this; - } - - public OSSClient getOssClient() { - return new OSSClient(objectStorageRegion, objectStorageAccessKeyId, objectStorageSecretAccessKey); - } + + private String objectStorageAccessKeyId; + + private String objectStorageSecretAccessKey; + + private String objectStorageRegion; + + public OSSClientBuilder withObjectStorageAccessKeyId(String objectStorageAccessKeyId) { + this.objectStorageAccessKeyId = objectStorageAccessKeyId; + return this; + } + + public OSSClientBuilder withObjectStorageSecretAccessKey(String objectStorageSecretAccessKey) { + this.objectStorageSecretAccessKey = objectStorageSecretAccessKey; + return this; + } + + public OSSClientBuilder withObjectStorageRegion(String objectStorageRegion) { + this.objectStorageRegion = objectStorageRegion; + return this; + } + + public OSSClient getOssClient() { + return new OSSClient(objectStorageRegion, objectStorageAccessKeyId, objectStorageSecretAccessKey); + } } diff --git a/src/main/java/org/opensrp/service/multimedia/OSSMultimediaFileManager.java b/src/main/java/org/opensrp/service/multimedia/OSSMultimediaFileManager.java index 07f4c2ef0..8a559b548 100644 --- a/src/main/java/org/opensrp/service/multimedia/OSSMultimediaFileManager.java +++ b/src/main/java/org/opensrp/service/multimedia/OSSMultimediaFileManager.java @@ -25,73 +25,73 @@ @Component("OSSMultimediaFileManager") public class OSSMultimediaFileManager extends ObjectStorageMultimediaFileManager { - private Logger logger = LogManager.getLogger(OSSMultimediaFileManager.class.toString()); - private OSSClientBuilder ossClientBuilder; - - @Autowired - public OSSMultimediaFileManager(MultimediaRepository multimediaRepository, ClientService clientService) { - super(multimediaRepository, clientService); - } + private Logger logger = LogManager.getLogger(OSSMultimediaFileManager.class.toString()); + private OSSClientBuilder ossClientBuilder; - /** - * {@inheritDoc} - */ - @Override - protected void persistFileToStorage(String fileName, byte[] fileBytes) { - OSSClient ossClient = getOssClient(); - ossClient.putObject(objectStorageBucketName, getOSSObjectStorageFilePath(fileName), new ByteArrayInputStream(fileBytes)); - ossClient.shutdown(); - } + @Autowired + public OSSMultimediaFileManager(MultimediaRepository multimediaRepository, ClientService clientService) { + super(multimediaRepository, clientService); + } - public String getOSSObjectStorageFilePath(String fileName) { - String objectStorageFilePath = getObjectStorageFilePath(fileName); - return objectStorageFilePath.charAt(0) == File.separatorChar - ? objectStorageFilePath.substring(1) : objectStorageFilePath; - } + /** + * {@inheritDoc} + */ + @Override + protected void persistFileToStorage(String fileName, byte[] fileBytes) { + OSSClient ossClient = getOssClient(); + ossClient.putObject(objectStorageBucketName, getOSSObjectStorageFilePath(fileName), new ByteArrayInputStream(fileBytes)); + ossClient.shutdown(); + } - /** - * {@inheritDoc} - */ - @Override - public File retrieveFile(String filePath) { - File file = null; - OSSClient ossClient = getOssClient(); - String filePathInBucket = getOSSObjectStorageFilePath(filePath); - if (!ossClient.doesObjectExist(objectStorageBucketName, filePathInBucket)) { - return file; - } + public String getOSSObjectStorageFilePath(String fileName) { + String objectStorageFilePath = getObjectStorageFilePath(fileName); + return objectStorageFilePath.charAt(0) == File.separatorChar + ? objectStorageFilePath.substring(1) : objectStorageFilePath; + } - InputStream content = null; - try { - content = ossClient.getObject(objectStorageBucketName, filePathInBucket).getObjectContent(); - file = new File(filePath); - FileUtils.copyInputStreamToFile(content, file); - } catch (IOException e) { - logger.error(e.getMessage(), e); - } catch (ClientException e) { - logger.error(e.getMessage(), e); - } catch (OSSException e) { - logger.error(e.getMessage(), e); - } finally { - closeCloseable(content); - ossClient.shutdown(); - } - return file; - } + /** + * {@inheritDoc} + */ + @Override + public File retrieveFile(String filePath) { + File file = null; + OSSClient ossClient = getOssClient(); + String filePathInBucket = getOSSObjectStorageFilePath(filePath); + if (!ossClient.doesObjectExist(objectStorageBucketName, filePathInBucket)) { + return file; + } - private OSSClient getOssClient() { - return getOSSClientBuilder().getOssClient(); - } + InputStream content = null; + try { + content = ossClient.getObject(objectStorageBucketName, filePathInBucket).getObjectContent(); + file = new File(filePath); + FileUtils.copyInputStreamToFile(content, file); + } catch (IOException e) { + logger.error(e.getMessage(), e); + } catch (ClientException e) { + logger.error(e.getMessage(), e); + } catch (OSSException e) { + logger.error(e.getMessage(), e); + } finally { + closeCloseable(content); + ossClient.shutdown(); + } + return file; + } - @PostConstruct - @SuppressWarnings("unused") - private OSSClientBuilder getOSSClientBuilder() { - if (ossClientBuilder == null) { - ossClientBuilder = new OSSClientBuilder(); - ossClientBuilder.withObjectStorageAccessKeyId(objectStorageAccessKeyId) - .withObjectStorageSecretAccessKey(objectStorageSecretAccessKey) - .withObjectStorageRegion(objectStorageRegion); - } - return ossClientBuilder; - } + private OSSClient getOssClient() { + return getOSSClientBuilder().getOssClient(); + } + + @PostConstruct + @SuppressWarnings("unused") + private OSSClientBuilder getOSSClientBuilder() { + if (ossClientBuilder == null) { + ossClientBuilder = new OSSClientBuilder(); + ossClientBuilder.withObjectStorageAccessKeyId(objectStorageAccessKeyId) + .withObjectStorageSecretAccessKey(objectStorageSecretAccessKey) + .withObjectStorageRegion(objectStorageRegion); + } + return ossClientBuilder; + } } diff --git a/src/main/java/org/opensrp/service/multimedia/ObjectStorageMultimediaFileManager.java b/src/main/java/org/opensrp/service/multimedia/ObjectStorageMultimediaFileManager.java index 2889fde6d..93b81cb4e 100644 --- a/src/main/java/org/opensrp/service/multimedia/ObjectStorageMultimediaFileManager.java +++ b/src/main/java/org/opensrp/service/multimedia/ObjectStorageMultimediaFileManager.java @@ -11,32 +11,32 @@ * Created by Vincent Karuri on 20/05/2020 */ public abstract class ObjectStorageMultimediaFileManager extends BaseMultimediaFileManager { - - @Value("#{opensrp['object.storage.access.key.id'] ?: ''}") - protected String objectStorageAccessKeyId; - @Value("#{opensrp['object.storage.secret.access.key'] ?: ''}") - protected String objectStorageSecretAccessKey; + @Value("#{opensrp['object.storage.access.key.id'] ?: ''}") + protected String objectStorageAccessKeyId; - @Value("#{opensrp['object.storage.region'] ?: ''}") - protected String objectStorageRegion; + @Value("#{opensrp['object.storage.secret.access.key'] ?: ''}") + protected String objectStorageSecretAccessKey; - @Value("#{opensrp['object.storage.bucket.name'] ?: ''}") - protected String objectStorageBucketName; + @Value("#{opensrp['object.storage.region'] ?: ''}") + protected String objectStorageRegion; - @Value("#{opensrp['object.storage.bucket.folder.path'] ?: ''}") - protected String objectStorageBucketFolderPath; + @Value("#{opensrp['object.storage.bucket.name'] ?: ''}") + protected String objectStorageBucketName; - public ObjectStorageMultimediaFileManager(MultimediaRepository multimediaRepository, ClientService clientService) { - super(multimediaRepository, clientService); - } + @Value("#{opensrp['object.storage.bucket.folder.path'] ?: ''}") + protected String objectStorageBucketFolderPath; - @Override - protected String getBaseMultiMediaDir() { - return File.separator + "tmp" + File.separator; - } + public ObjectStorageMultimediaFileManager(MultimediaRepository multimediaRepository, ClientService clientService) { + super(multimediaRepository, clientService); + } - public String getObjectStorageFilePath(String localFilePath) { - return StringUtils.isBlank(localFilePath) ? "" : objectStorageBucketFolderPath + File.separator + localFilePath.replace(getBaseMultiMediaDir(), ""); - } + @Override + protected String getBaseMultiMediaDir() { + return File.separator + "tmp" + File.separator; + } + + public String getObjectStorageFilePath(String localFilePath) { + return StringUtils.isBlank(localFilePath) ? "" : objectStorageBucketFolderPath + File.separator + localFilePath.replace(getBaseMultiMediaDir(), ""); + } } diff --git a/src/main/java/org/opensrp/service/multimedia/S3MultimediaFileManager.java b/src/main/java/org/opensrp/service/multimedia/S3MultimediaFileManager.java index 0b020d289..63af71505 100644 --- a/src/main/java/org/opensrp/service/multimedia/S3MultimediaFileManager.java +++ b/src/main/java/org/opensrp/service/multimedia/S3MultimediaFileManager.java @@ -27,19 +27,19 @@ @Component("S3MultimediaFileManager") public class S3MultimediaFileManager extends ObjectStorageMultimediaFileManager { - private AmazonS3 s3Client; + private AmazonS3 s3Client; @Autowired public S3MultimediaFileManager(MultimediaRepository multimediaRepository, ClientService clientService) { super(multimediaRepository, clientService); } - /** - * {@inheritDoc} - */ + /** + * {@inheritDoc} + */ @Override protected void persistFileToStorage(String fileName, byte[] fileBytes) throws IOException { - File multimediaFile = bytesToFile(fileName, fileBytes); + File multimediaFile = bytesToFile(fileName, fileBytes); byte[] md5 = DigestUtils.md5(new FileInputStream(multimediaFile)); InputStream inputStream = new FileInputStream(multimediaFile); ObjectMetadata metadata = new ObjectMetadata(); @@ -50,9 +50,9 @@ protected void persistFileToStorage(String fileName, byte[] fileBytes) throws IO multimediaFile.delete(); } - /** - * {@inheritDoc} - */ + /** + * {@inheritDoc} + */ @Override public File retrieveFile(String filePath) { File file = null; @@ -64,18 +64,17 @@ public File retrieveFile(String filePath) { return file; } - /** - * - * Converts {@link File} to {@link File} - * - * @param fileName - * @param fileBytes - * @return - * @throws IOException - */ - private File bytesToFile(String fileName, byte[] fileBytes) throws IOException { + /** + * Converts {@link File} to {@link File} + * + * @param fileName + * @param fileBytes + * @return + * @throws IOException + */ + private File bytesToFile(String fileName, byte[] fileBytes) throws IOException { File tempFile = new File(fileName); - copyBytesToFile(tempFile, fileBytes); + copyBytesToFile(tempFile, fileBytes); tempFile.deleteOnExit(); return tempFile; } @@ -86,7 +85,7 @@ private AmazonS3 getS3Client() { if (s3Client == null) { s3Client = AmazonS3ClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials(objectStorageAccessKeyId, - objectStorageSecretAccessKey))) + objectStorageSecretAccessKey))) .withRegion(objectStorageRegion) .build(); } diff --git a/src/main/java/org/opensrp/util/DataQuery.java b/src/main/java/org/opensrp/util/DataQuery.java index cfc1b6917..a7db3ec6d 100644 --- a/src/main/java/org/opensrp/util/DataQuery.java +++ b/src/main/java/org/opensrp/util/DataQuery.java @@ -8,61 +8,57 @@ import java.lang.reflect.Modifier; public class DataQuery { - - public static final String LUCENE_CLIENT_QUERY = new String("lucene-client-query"); - - static { - for (Field field : DataQuery.class.getDeclaredFields()) { - if (field.getName().toLowerCase().endsWith("_query")) { - try { - field.setAccessible(true); - Field modifiers = field.getClass().getDeclaredField("modifiers"); - modifiers.setAccessible(true); - modifiers.setInt(field, field.getModifiers() & ~Modifier.FINAL); - field.set(null, getQuery(field.get(null).toString())); - } - catch (IllegalArgumentException | IllegalAccessException e) { - e.printStackTrace(); - } - catch (NoSuchFieldException e) { - e.printStackTrace(); - } - catch (SecurityException e) { - e.printStackTrace(); - } - } - } - } - - private static String getQuery(String fileName) { - try { - InputStream in = DataQuery.class.getResourceAsStream("/queries/" + fileName); - BufferedReader r = new BufferedReader(new InputStreamReader(in)); - StringBuilder stringJson = new StringBuilder(); - - int chunksize = 1024; - char[] charBuffer = new char[chunksize]; - int count = 0; - - do { - count = r.read(charBuffer, 0, chunksize); - - if (count >= 0) { - stringJson.append(charBuffer, 0, count); - } - } while (count > 0); - - r.close(); - - return stringJson.toString(); - } - catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - public static void main(String[] args) { - System.out.println(LUCENE_CLIENT_QUERY); - } + + public static final String LUCENE_CLIENT_QUERY = new String("lucene-client-query"); + + static { + for (Field field : DataQuery.class.getDeclaredFields()) { + if (field.getName().toLowerCase().endsWith("_query")) { + try { + field.setAccessible(true); + Field modifiers = field.getClass().getDeclaredField("modifiers"); + modifiers.setAccessible(true); + modifiers.setInt(field, field.getModifiers() & ~Modifier.FINAL); + field.set(null, getQuery(field.get(null).toString())); + } catch (IllegalArgumentException | IllegalAccessException e) { + e.printStackTrace(); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } catch (SecurityException e) { + e.printStackTrace(); + } + } + } + } + + private static String getQuery(String fileName) { + try { + InputStream in = DataQuery.class.getResourceAsStream("/queries/" + fileName); + BufferedReader r = new BufferedReader(new InputStreamReader(in)); + StringBuilder stringJson = new StringBuilder(); + + int chunksize = 1024; + char[] charBuffer = new char[chunksize]; + int count = 0; + + do { + count = r.read(charBuffer, 0, chunksize); + + if (count >= 0) { + stringJson.append(charBuffer, 0, count); + } + } while (count > 0); + + r.close(); + + return stringJson.toString(); + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + public static void main(String[] args) { + System.out.println(LUCENE_CLIENT_QUERY); + } } diff --git a/src/main/java/org/opensrp/util/DateTimeDeserializer.java b/src/main/java/org/opensrp/util/DateTimeDeserializer.java index c81091578..445251b82 100644 --- a/src/main/java/org/opensrp/util/DateTimeDeserializer.java +++ b/src/main/java/org/opensrp/util/DateTimeDeserializer.java @@ -11,21 +11,21 @@ import com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer; public class DateTimeDeserializer extends StdScalarDeserializer { - - private static final long serialVersionUID = -805075518081134882L; - - public DateTimeDeserializer() { - super(DateTime.class); - } - - @Override - public DateTime deserialize(JsonParser jsonParser, DeserializationContext ctxt) - throws IOException, JsonProcessingException { - JsonToken currentToken = jsonParser.getCurrentToken(); - if (currentToken == JsonToken.VALUE_STRING) { - String dateTimeAsString = jsonParser.getText().trim(); - return new DateTime(dateTimeAsString); - } - return null; - } + + private static final long serialVersionUID = -805075518081134882L; + + public DateTimeDeserializer() { + super(DateTime.class); + } + + @Override + public DateTime deserialize(JsonParser jsonParser, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonToken currentToken = jsonParser.getCurrentToken(); + if (currentToken == JsonToken.VALUE_STRING) { + String dateTimeAsString = jsonParser.getText().trim(); + return new DateTime(dateTimeAsString); + } + return null; + } } diff --git a/src/main/java/org/opensrp/util/DateTimeSerializer.java b/src/main/java/org/opensrp/util/DateTimeSerializer.java index 7c4858037..509a7cf74 100644 --- a/src/main/java/org/opensrp/util/DateTimeSerializer.java +++ b/src/main/java/org/opensrp/util/DateTimeSerializer.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.util; @@ -15,16 +15,16 @@ * @author Samuel Githengi created on 02/20/20 */ public class DateTimeSerializer extends StdScalarSerializer { - - private static final long serialVersionUID = -6797135374503717200L; - - public DateTimeSerializer() { - super(DateTime.class); - } - - @Override - public void serialize(DateTime value, JsonGenerator gen, SerializerProvider provider) throws IOException { - gen.writeString(value.toString()); - } - + + private static final long serialVersionUID = -6797135374503717200L; + + public DateTimeSerializer() { + super(DateTime.class); + } + + @Override + public void serialize(DateTime value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeString(value.toString()); + } + } diff --git a/src/main/java/org/opensrp/util/DateTypeConverter.java b/src/main/java/org/opensrp/util/DateTypeConverter.java index 87f4a8849..6c4706b25 100644 --- a/src/main/java/org/opensrp/util/DateTypeConverter.java +++ b/src/main/java/org/opensrp/util/DateTypeConverter.java @@ -13,15 +13,15 @@ import com.google.gson.JsonSerializer; public class DateTypeConverter implements JsonSerializer, JsonDeserializer { - - @Override - public LocalDate deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) - throws JsonParseException { - return new LocalDate(json.getAsString()); - } - - @Override - public JsonElement serialize(LocalDate src, Type typeOfSrc, JsonSerializationContext context) { - return new JsonPrimitive(src.toString()); - } + + @Override + public LocalDate deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) + throws JsonParseException { + return new LocalDate(json.getAsString()); + } + + @Override + public JsonElement serialize(LocalDate src, Type typeOfSrc, JsonSerializationContext context) { + return new JsonPrimitive(src.toString()); + } } diff --git a/src/main/java/org/opensrp/util/FileCreator.java b/src/main/java/org/opensrp/util/FileCreator.java index a1ee8bf6d..a796931b5 100644 --- a/src/main/java/org/opensrp/util/FileCreator.java +++ b/src/main/java/org/opensrp/util/FileCreator.java @@ -23,168 +23,161 @@ import org.xml.sax.InputSource; public class FileCreator { - - // private static String directory=null;//= System.getProperty("user.home"); - - // public FileCreator() { - // directory = System.getProperty("user.home"); - // - // } - - public void createFile(String filename, String directory, byte[] content) throws FileNotFoundException, IOException { - - File f = new File(directory); - if (f.mkdirs()) { - - } - //System.out.println(s); - FileOutputStream fos2 = new FileOutputStream(f.getPath() + System.getProperty("file.separator") + filename); - fos2.write(content); - fos2.close(); - - } - - public String createDirectory(String directory) { - - File file = new File(osDirectorySet(directory)); - if (!file.exists()) { - if (file.mkdir()) { - System.out.println("Directory is created!"); - } else { - System.out.println("Failed to create directory!"); - } - } - - return file.getAbsolutePath(); - } - - public boolean createFormFiles(String directory, String formId, byte[] form, byte[] model, byte[] formjson) { - - try { - // System.out.println("before creating files "+directory); - createFile("form.xml", directory, form); - createFile("model.xml", directory, model); - createFile("form.json", directory, formjson); - // System.out.println("before creating files "+directory); - return true; - } - catch (Exception e) { - e.printStackTrace(); - } - return false; - } - - public boolean createTextFile(String directory, byte[] context, String formId) { - try { - directory = createDirectory(directory); - createFile(formId + ".txt", directory, context); - - return true; - } - catch (Exception e) { - e.printStackTrace(); - } - return false; - } - - public boolean createModelFile(String directory, String formId, byte[] context) { - try { - directory = createDirectory(directory); - createFile("model.xml", directory, context); - - return true; - } - catch (Exception e) { - e.printStackTrace(); - } - return false; - - } - - public boolean createFormFile(String directory, String formId, byte[] context) { - try { - directory = createDirectory(directory); - createFile("form.xml", directory, context); - - return true; - } - catch (Exception e) { - e.printStackTrace(); - } - return false; - } - - public boolean createFormJsonFile(String directory, String formId, byte[] context) { - try { - directory = createDirectory(directory); - createFile("form.json", directory, context); - - return true; - } - catch (Exception e) { - e.printStackTrace(); - } - return false; - } - - public String osDirectorySet(String name) { - - if (name.startsWith("/")) { - name += "/"; - // directory += "/"+name+"/"; - } else { - // directory += "\\"+name+"\\"; - name += "\\"; - } - return name; - } - - private String prettyFormat(String input, int indent) { - try { - // Source xmlInput = new StreamSource(new StringReader(input)); - // StringWriter stringWriter = new StringWriter(); - // StreamResult xmlOutput = new StreamResult(new OutputStreamWriter(System.out)); - // - final InputSource src = new InputSource(new StringReader(input)); - final Node document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(src).getDocumentElement(); - - Transformer transformer = TransformerFactory.newInstance().newTransformer(); - transformer.setOutputProperty(OutputKeys.INDENT, "yes"); - transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); - //initialize StreamResult with File object to save to file - StreamResult result = new StreamResult(new StringWriter()); - DOMSource source = new DOMSource(document); - transformer.transform(source, result); - String xmlString = result.getWriter().toString(); - System.out.println(xmlString); - - return xmlString; - } - catch (Throwable e) { - e.printStackTrace(); - // You'll come here if you are using JDK 1.5 - // you are getting an the following exeption - // java.lang.IllegalArgumentException: Not supported: indent-number - // Use this code (Set the output property in transformer. - try { - Source xmlInput = new StreamSource(new StringReader(input)); - StringWriter stringWriter = new StringWriter(); - StreamResult xmlOutput = new StreamResult(stringWriter); - TransformerFactory transformerFactory = TransformerFactory.newInstance(); - Transformer transformer = transformerFactory.newTransformer(); - transformer.setOutputProperty(OutputKeys.INDENT, "yes"); - transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", String.valueOf(indent)); - transformer.transform(xmlInput, xmlOutput); - return xmlOutput.getWriter().toString(); - } - catch (Throwable t) { - return input; - } - } - } - - public String prettyFormat(String input) { - return prettyFormat(input, 2); - } - + + // private static String directory=null;//= System.getProperty("user.home"); + + // public FileCreator() { + // directory = System.getProperty("user.home"); + // + // } + + public void createFile(String filename, String directory, byte[] content) throws FileNotFoundException, IOException { + + File f = new File(directory); + if (f.mkdirs()) { + + } + //System.out.println(s); + FileOutputStream fos2 = new FileOutputStream(f.getPath() + System.getProperty("file.separator") + filename); + fos2.write(content); + fos2.close(); + + } + + public String createDirectory(String directory) { + + File file = new File(osDirectorySet(directory)); + if (!file.exists()) { + if (file.mkdir()) { + System.out.println("Directory is created!"); + } else { + System.out.println("Failed to create directory!"); + } + } + + return file.getAbsolutePath(); + } + + public boolean createFormFiles(String directory, String formId, byte[] form, byte[] model, byte[] formjson) { + + try { + // System.out.println("before creating files "+directory); + createFile("form.xml", directory, form); + createFile("model.xml", directory, model); + createFile("form.json", directory, formjson); + // System.out.println("before creating files "+directory); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + public boolean createTextFile(String directory, byte[] context, String formId) { + try { + directory = createDirectory(directory); + createFile(formId + ".txt", directory, context); + + return true; + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + public boolean createModelFile(String directory, String formId, byte[] context) { + try { + directory = createDirectory(directory); + createFile("model.xml", directory, context); + + return true; + } catch (Exception e) { + e.printStackTrace(); + } + return false; + + } + + public boolean createFormFile(String directory, String formId, byte[] context) { + try { + directory = createDirectory(directory); + createFile("form.xml", directory, context); + + return true; + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + public boolean createFormJsonFile(String directory, String formId, byte[] context) { + try { + directory = createDirectory(directory); + createFile("form.json", directory, context); + + return true; + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + public String osDirectorySet(String name) { + + if (name.startsWith("/")) { + name += "/"; + // directory += "/"+name+"/"; + } else { + // directory += "\\"+name+"\\"; + name += "\\"; + } + return name; + } + + private String prettyFormat(String input, int indent) { + try { + // Source xmlInput = new StreamSource(new StringReader(input)); + // StringWriter stringWriter = new StringWriter(); + // StreamResult xmlOutput = new StreamResult(new OutputStreamWriter(System.out)); + // + final InputSource src = new InputSource(new StringReader(input)); + final Node document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(src).getDocumentElement(); + + Transformer transformer = TransformerFactory.newInstance().newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); + //initialize StreamResult with File object to save to file + StreamResult result = new StreamResult(new StringWriter()); + DOMSource source = new DOMSource(document); + transformer.transform(source, result); + String xmlString = result.getWriter().toString(); + System.out.println(xmlString); + + return xmlString; + } catch (Throwable e) { + e.printStackTrace(); + // You'll come here if you are using JDK 1.5 + // you are getting an the following exeption + // java.lang.IllegalArgumentException: Not supported: indent-number + // Use this code (Set the output property in transformer. + try { + Source xmlInput = new StreamSource(new StringReader(input)); + StringWriter stringWriter = new StringWriter(); + StreamResult xmlOutput = new StreamResult(stringWriter); + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", String.valueOf(indent)); + transformer.transform(xmlInput, xmlOutput); + return xmlOutput.getWriter().toString(); + } catch (Throwable t) { + return input; + } + } + } + + public String prettyFormat(String input) { + return prettyFormat(input, 2); + } + } diff --git a/src/main/java/org/opensrp/util/IdGeneratorUtil.java b/src/main/java/org/opensrp/util/IdGeneratorUtil.java index c3e67b2c2..93e8fe7eb 100644 --- a/src/main/java/org/opensrp/util/IdGeneratorUtil.java +++ b/src/main/java/org/opensrp/util/IdGeneratorUtil.java @@ -2,48 +2,50 @@ public class IdGeneratorUtil { - /** - * Converts a String back to an long based on the passed base characters - * @should convert from string in base character set to long - */ - public static long convertFromBase(String s, char[] baseCharacters) { - long ret = 0; - char[] inputChars = s.toCharArray(); - long multiplier = 1; - for (int i = inputChars.length-1; i>=0; i--) { - int index = -1; - for (int j=0; j= 0; i--) { + int index = -1; + for (int j = 0; j < baseCharacters.length; j++) { + if (baseCharacters[j] == inputChars[i]) { + index = j; + } + } + if (index == -1) { + throw new IllegalArgumentException("Invalid character " + inputChars[i] + " found in " + s + " - First Identifier Base"); + } + ret = ret + multiplier * index; + multiplier *= baseCharacters.length; + } + return ret; + } - /** - * Converts a long to a String given the passed base characters - * @should convert from long to string in base character set - */ - public static String convertToBase(long n, char[] baseCharacters, int padToLength,int minLength) { - StringBuilder base = new StringBuilder(); - long numInBase = (long)baseCharacters.length; - long i = n; - while (i > 0) { - int index = (int)(i % numInBase); - base.insert(0, baseCharacters[index]); - i = i / numInBase; - } - while (base.length() < padToLength) { - base.insert(0, baseCharacters[0]); - } + /** + * Converts a long to a String given the passed base characters + * + * @should convert from long to string in base character set + */ + public static String convertToBase(long n, char[] baseCharacters, int padToLength, int minLength) { + StringBuilder base = new StringBuilder(); + long numInBase = (long) baseCharacters.length; + long i = n; + while (i > 0) { + int index = (int) (i % numInBase); + base.insert(0, baseCharacters[index]); + i = i / numInBase; + } + while (base.length() < padToLength) { + base.insert(0, baseCharacters[0]); + } + + return base.toString(); + } - return base.toString(); - } - } diff --git a/src/main/java/org/opensrp/util/IdentifierValidatorAlgorithm.java b/src/main/java/org/opensrp/util/IdentifierValidatorAlgorithm.java index 39d0473ce..6b55a7d83 100644 --- a/src/main/java/org/opensrp/util/IdentifierValidatorAlgorithm.java +++ b/src/main/java/org/opensrp/util/IdentifierValidatorAlgorithm.java @@ -4,18 +4,18 @@ import java.util.Map; public enum IdentifierValidatorAlgorithm { - - LUHN_CHECK_DIGIT_ALGORITHM; - - private static final Map lookup = new HashMap(); - static { - for (IdentifierValidatorAlgorithm algo : IdentifierValidatorAlgorithm.values()) { - lookup.put(algo.name(), algo); - } - } + LUHN_CHECK_DIGIT_ALGORITHM; - public static IdentifierValidatorAlgorithm get(String algorithm) { - return lookup.get(algorithm); - } + private static final Map lookup = new HashMap(); + + static { + for (IdentifierValidatorAlgorithm algo : IdentifierValidatorAlgorithm.values()) { + lookup.put(algo.name(), algo); + } + } + + public static IdentifierValidatorAlgorithm get(String algorithm) { + return lookup.get(algorithm); + } } diff --git a/src/main/java/org/opensrp/util/JSONCSVUtil.java b/src/main/java/org/opensrp/util/JSONCSVUtil.java index 920d56bca..c07b09627 100644 --- a/src/main/java/org/opensrp/util/JSONCSVUtil.java +++ b/src/main/java/org/opensrp/util/JSONCSVUtil.java @@ -25,14 +25,14 @@ public static JSONObject toJSON(Map csvValues, Map value : csvValues.entrySet()) { List configs = configGroup.get(value.getKey()); - for(CSVRowConfig config : configs){ + for (CSVRowConfig config : configs) { if (config == null) throw new IllegalStateException("Column" + value.getKey() + " is missing a config"); if (config.validate(value.getValue())) { if (StringUtils.isNotBlank(value.getValue())) addNodeToJson(config.getFieldMapping(), value.getValue(), jsonObject); - }else{ + } else { throw new IllegalStateException("CSV has an invalid value for field " + config.getColumnName() + " mapping " + config.getFieldMapping()); } } @@ -49,7 +49,7 @@ public static JSONObject toJSON(Map csvValues, Map jsonToString(JSONObject jsonObject, List fieldMapping) { List values = new ArrayList<>(); - for(String mapping : fieldMapping){ + for (String mapping : fieldMapping) { values.add(readNodeFromJson(mapping, jsonObject)); } return values; @@ -73,14 +73,14 @@ public static String readNodeFromJson(String nodePath, JSONObject jsonObject) { if (arrayPosition > -1) { // add a json array to the position and JSONArray jsonArray = currentNode.has(node) ? currentNode.getJSONArray(node) : null; - if(jsonArray != null && jsonArray.length() > arrayPosition){ + if (jsonArray != null && jsonArray.length() > arrayPosition) { if (pos != (nodeAddress.length - 1)) { currentNode = jsonArray.getJSONObject(arrayPosition); - }else{ + } else { return jsonArray.getString(arrayPosition); } - }else{ + } else { return ""; } } else if (pos == (nodeAddress.length - 1)) { @@ -90,9 +90,9 @@ public static String readNodeFromJson(String nodePath, JSONObject jsonObject) { } else { // add the object as a json node - if(currentNode.has(node)) { + if (currentNode.has(node)) { currentNode = currentNode.getJSONObject(node); - }else{ + } else { return ""; } } diff --git a/src/main/java/org/opensrp/util/JsonArrayDeserializer.java b/src/main/java/org/opensrp/util/JsonArrayDeserializer.java index e89aad47d..6af51254e 100644 --- a/src/main/java/org/opensrp/util/JsonArrayDeserializer.java +++ b/src/main/java/org/opensrp/util/JsonArrayDeserializer.java @@ -12,23 +12,23 @@ import com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer; public class JsonArrayDeserializer extends StdScalarDeserializer { - - private static final long serialVersionUID = 428760301825551510L; - - private static Logger logger = LogManager.getLogger(JsonArrayDeserializer.class.toString()); + + private static final long serialVersionUID = 428760301825551510L; + + private static Logger logger = LogManager.getLogger(JsonArrayDeserializer.class.toString()); public JsonArrayDeserializer() { super(JsonArrayDeserializer.class); } - @Override - public JSONArray deserialize(com.fasterxml.jackson.core.JsonParser jsonParser, DeserializationContext ctxt) - throws IOException, JsonProcessingException { - try { - return new JSONArray(jsonParser.readValueAsTree().toString()); - } catch (JSONException e) { - logger.error("error deserialize JSONArray"); - } - return null; - } + @Override + public JSONArray deserialize(com.fasterxml.jackson.core.JsonParser jsonParser, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + try { + return new JSONArray(jsonParser.readValueAsTree().toString()); + } catch (JSONException e) { + logger.error("error deserialize JSONArray"); + } + return null; + } } diff --git a/src/main/java/org/opensrp/util/JsonArraySerializer.java b/src/main/java/org/opensrp/util/JsonArraySerializer.java index a18df6eed..4e2afcd46 100644 --- a/src/main/java/org/opensrp/util/JsonArraySerializer.java +++ b/src/main/java/org/opensrp/util/JsonArraySerializer.java @@ -9,11 +9,11 @@ import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.ser.std.StdScalarSerializer; -public class JsonArraySerializer extends StdScalarSerializer { - - private static final long serialVersionUID = -7318048190335430630L; +public class JsonArraySerializer extends StdScalarSerializer { - public JsonArraySerializer() { + private static final long serialVersionUID = -7318048190335430630L; + + public JsonArraySerializer() { super(JSONArray.class); } diff --git a/src/main/java/org/opensrp/util/JsonParser.java b/src/main/java/org/opensrp/util/JsonParser.java index d1862f14e..8a66cca72 100644 --- a/src/main/java/org/opensrp/util/JsonParser.java +++ b/src/main/java/org/opensrp/util/JsonParser.java @@ -15,185 +15,183 @@ import com.fasterxml.jackson.databind.ObjectMapper; public class JsonParser { - - public String getFormDefinition(byte[] jsonData) throws JsonProcessingException, IOException { - try { - - //read json file data to String - //byte[] jsonData = Files.readAllBytes(Paths.get("tt.json")); - JsonParser jsonParser = new JsonParser(); - //create ObjectMapper instance - ObjectMapper objectMapper = new ObjectMapper(); - // objectMapper.enable(SerializationFeature.INDENT_OUTPUT); - // objectMapper.readValue(jsonData, FormSubmission.class) - //read JSON like DOM Parser FormSubmission - JsonNode rootNode = objectMapper.readTree(jsonData); - FormDefinition formD = jsonParser.getForm(rootNode); - //System.out.println(objectMapper.writeValueAsString(formD));; - // objectMapper.configure(SerializationFeature.INDENT_OUTPUT, true); - //objectMapper.writeValue(new File("form_definition.json"), formD); - String s = objectMapper.writer().withDefaultPrettyPrinter().writeValueAsString(formD); - //String s=objectMapper.writeValueAsString(formD); - //objectMapper. - //System.out.println(s); - - return s; - } - catch (Exception e) { - System.err.println(e.getMessage()); - e.printStackTrace(); - - } - return null; - } - - private List getFields(JsonNode jsonNode) { - //StringBuilder fields=new StringBuilder(); - List fields = new ArrayList(); - - Iterator elements = jsonNode.elements(); - while (elements.hasNext()) { - Iterator phones = elements.next().elements(); - while (phones.hasNext()) { - JsonNode jsonNode1 = (JsonNode) phones.next(); - Iterator ps = jsonNode1.iterator(); - while (ps.hasNext()) { - JsonNode jsonNode2 = (JsonNode) ps.next(); - if (jsonNode2.get("name") != null) { - // System.out.println(jsonNode2.get("name")); - fields.add(jsonNode2.get("name").asText()); - } - } - // System.out.println("Phone No = "+Text()); - } - - } - return fields; - } - - private List getFields(JsonNode node, String source) { - List list = new ArrayList(); - //String source="/model/instance/"+source+"/"; - - Iterator elements = node.elements(); - - // System.err.println(node); - //System.out.println(phoneNosNode); - while (elements.hasNext()) { - JsonNode jjNode = elements.next(); - - if (!jjNode.get("type").asText().equalsIgnoreCase("group") - && !jjNode.get("type").asText().equalsIgnoreCase("repeat")) { - - // list.add(new FormField( Node.get("name").asText(), source+Node.get("name").asText() )); - - list.add(new FormField(jjNode.get("name").asText(), source + jjNode.get("name").asText())); - } else if (jjNode.get("type").asText().equalsIgnoreCase("group")) { - //System.err.println( ); - list.addAll(getGroupFields(jjNode, source)); - } - - //System.out.println(Node.get("name")); - } - - return list; - } - - private List getGroupFields(JsonNode node, String formName) { - - List list = new ArrayList(); - String source = formName + node.get("name").asText() + "/"; - try {//jjNode.path("children") - Iterator elements = node.path("children").elements(); - - //System.out.println(phoneNosNode); - while (elements.hasNext()) { - //System.err.println("sda"); - JsonNode jjNode = elements.next(); - //System.err.println(jjNode); - //Iterator phones = node.getElements(); - if (jjNode.get("name") != null) { - //System.err.println(jjNode.get("name").asText()); - - list.add(new FormField(jjNode.get("name").asText(), source + jjNode.get("name").asText())); - - // }//list.add(node.get("name")+"/"+(Node.get("name").asText())); - //System.out.println(Node.get("name")); - } else { - - // - System.err.println(jjNode.get("name").asText()); - } - } - } - catch (Exception e) { - e.printStackTrace(); - } - - return list; - - } - - private FormDefinition getForm(JsonNode rootNode) { - //StringBuilder sBuilder=new StringBuilder("{ "); - FormDefinition formDefinition = new FormDefinition(); - //FormInstance formInstance=new FormInstance(); - //formInstance. - - //] - - String formName = rootNode.get("name").asText(); - String source = "/model/instance/" + formName + "/"; - - //System.out.println(rootNode.get("name")); - JsonNode phoneNosNode = rootNode.path("children"); - //getFields(); - List fields = getFields(phoneNosNode, source); - //System.out.println(fields); - FormField field = new FormField("id", null); - field.setShouldLoadValue(true); - //fields.add(field); - // fields.set(0, field); - fields.add(0, field); - Form formData = new Form("", source, fields, null); - List sub_forms = getSubForms(phoneNosNode, source); - formData.setSub_forms(sub_forms); - formDefinition.setForm(formData); - return formDefinition; - } - - private SubFormDefinition getSubForm(JsonNode rootNode, String source) { - String formName = rootNode.get("name").asText(); - source += formName + "/"; - System.out.println(rootNode.path("children")); - List fields = getFields(rootNode.path("children"), source); - FormField field = new FormField("id", null); - field.setShouldLoadValue(true); - //fields.add(field); - fields.add(0, field); - SubFormDefinition subForm = new SubFormDefinition(formName, fields); - subForm.setDefault_bind_path(source); - subForm.setBind_type(""); - //SubFormDefinition - return subForm; - } - - private List getSubForms(JsonNode node, String source) { - List list = new ArrayList(); - //String source="/model/instance/"+source+"/"; - Iterator elements = node.elements(); - //System.out.println(phoneNosNode); - while (elements.hasNext()) { - JsonNode jjNode = elements.next(); - - if (jjNode.get("type").asText().equalsIgnoreCase("repeat")) { - - list.add(getSubForm(jjNode, source)); - } - - //System.out.println(Node.get("name")); - } - - return list; - } + + public String getFormDefinition(byte[] jsonData) throws JsonProcessingException, IOException { + try { + + //read json file data to String + //byte[] jsonData = Files.readAllBytes(Paths.get("tt.json")); + JsonParser jsonParser = new JsonParser(); + //create ObjectMapper instance + ObjectMapper objectMapper = new ObjectMapper(); + // objectMapper.enable(SerializationFeature.INDENT_OUTPUT); + // objectMapper.readValue(jsonData, FormSubmission.class) + //read JSON like DOM Parser FormSubmission + JsonNode rootNode = objectMapper.readTree(jsonData); + FormDefinition formD = jsonParser.getForm(rootNode); + //System.out.println(objectMapper.writeValueAsString(formD));; + // objectMapper.configure(SerializationFeature.INDENT_OUTPUT, true); + //objectMapper.writeValue(new File("form_definition.json"), formD); + String s = objectMapper.writer().withDefaultPrettyPrinter().writeValueAsString(formD); + //String s=objectMapper.writeValueAsString(formD); + //objectMapper. + //System.out.println(s); + + return s; + } catch (Exception e) { + System.err.println(e.getMessage()); + e.printStackTrace(); + + } + return null; + } + + private List getFields(JsonNode jsonNode) { + //StringBuilder fields=new StringBuilder(); + List fields = new ArrayList(); + + Iterator elements = jsonNode.elements(); + while (elements.hasNext()) { + Iterator phones = elements.next().elements(); + while (phones.hasNext()) { + JsonNode jsonNode1 = (JsonNode) phones.next(); + Iterator ps = jsonNode1.iterator(); + while (ps.hasNext()) { + JsonNode jsonNode2 = (JsonNode) ps.next(); + if (jsonNode2.get("name") != null) { + // System.out.println(jsonNode2.get("name")); + fields.add(jsonNode2.get("name").asText()); + } + } + // System.out.println("Phone No = "+Text()); + } + + } + return fields; + } + + private List getFields(JsonNode node, String source) { + List list = new ArrayList(); + //String source="/model/instance/"+source+"/"; + + Iterator elements = node.elements(); + + // System.err.println(node); + //System.out.println(phoneNosNode); + while (elements.hasNext()) { + JsonNode jjNode = elements.next(); + + if (!jjNode.get("type").asText().equalsIgnoreCase("group") + && !jjNode.get("type").asText().equalsIgnoreCase("repeat")) { + + // list.add(new FormField( Node.get("name").asText(), source+Node.get("name").asText() )); + + list.add(new FormField(jjNode.get("name").asText(), source + jjNode.get("name").asText())); + } else if (jjNode.get("type").asText().equalsIgnoreCase("group")) { + //System.err.println( ); + list.addAll(getGroupFields(jjNode, source)); + } + + //System.out.println(Node.get("name")); + } + + return list; + } + + private List getGroupFields(JsonNode node, String formName) { + + List list = new ArrayList(); + String source = formName + node.get("name").asText() + "/"; + try {//jjNode.path("children") + Iterator elements = node.path("children").elements(); + + //System.out.println(phoneNosNode); + while (elements.hasNext()) { + //System.err.println("sda"); + JsonNode jjNode = elements.next(); + //System.err.println(jjNode); + //Iterator phones = node.getElements(); + if (jjNode.get("name") != null) { + //System.err.println(jjNode.get("name").asText()); + + list.add(new FormField(jjNode.get("name").asText(), source + jjNode.get("name").asText())); + + // }//list.add(node.get("name")+"/"+(Node.get("name").asText())); + //System.out.println(Node.get("name")); + } else { + + // + System.err.println(jjNode.get("name").asText()); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + + return list; + + } + + private FormDefinition getForm(JsonNode rootNode) { + //StringBuilder sBuilder=new StringBuilder("{ "); + FormDefinition formDefinition = new FormDefinition(); + //FormInstance formInstance=new FormInstance(); + //formInstance. + + //] + + String formName = rootNode.get("name").asText(); + String source = "/model/instance/" + formName + "/"; + + //System.out.println(rootNode.get("name")); + JsonNode phoneNosNode = rootNode.path("children"); + //getFields(); + List fields = getFields(phoneNosNode, source); + //System.out.println(fields); + FormField field = new FormField("id", null); + field.setShouldLoadValue(true); + //fields.add(field); + // fields.set(0, field); + fields.add(0, field); + Form formData = new Form("", source, fields, null); + List sub_forms = getSubForms(phoneNosNode, source); + formData.setSub_forms(sub_forms); + formDefinition.setForm(formData); + return formDefinition; + } + + private SubFormDefinition getSubForm(JsonNode rootNode, String source) { + String formName = rootNode.get("name").asText(); + source += formName + "/"; + System.out.println(rootNode.path("children")); + List fields = getFields(rootNode.path("children"), source); + FormField field = new FormField("id", null); + field.setShouldLoadValue(true); + //fields.add(field); + fields.add(0, field); + SubFormDefinition subForm = new SubFormDefinition(formName, fields); + subForm.setDefault_bind_path(source); + subForm.setBind_type(""); + //SubFormDefinition + return subForm; + } + + private List getSubForms(JsonNode node, String source) { + List list = new ArrayList(); + //String source="/model/instance/"+source+"/"; + Iterator elements = node.elements(); + //System.out.println(phoneNosNode); + while (elements.hasNext()) { + JsonNode jjNode = elements.next(); + + if (jjNode.get("type").asText().equalsIgnoreCase("repeat")) { + + list.add(getSubForm(jjNode, source)); + } + + //System.out.println(Node.get("name")); + } + + return list; + } } diff --git a/src/main/java/org/opensrp/util/LocalDateDeserializer.java b/src/main/java/org/opensrp/util/LocalDateDeserializer.java index ed1b92c61..84f6ca44d 100644 --- a/src/main/java/org/opensrp/util/LocalDateDeserializer.java +++ b/src/main/java/org/opensrp/util/LocalDateDeserializer.java @@ -10,20 +10,20 @@ import com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer; public class LocalDateDeserializer extends StdScalarDeserializer { - - private static final long serialVersionUID = -805075518081134882L; - - public LocalDateDeserializer() { - super(LocalDate.class); - } - - @Override - public LocalDate deserialize(JsonParser jsonParser, DeserializationContext context) throws IOException { - JsonToken currentToken = jsonParser.getCurrentToken(); - if (currentToken == JsonToken.VALUE_STRING) { - String dateTimeAsString = jsonParser.getText().trim(); - return new LocalDate(dateTimeAsString); - } - return null; - } + + private static final long serialVersionUID = -805075518081134882L; + + public LocalDateDeserializer() { + super(LocalDate.class); + } + + @Override + public LocalDate deserialize(JsonParser jsonParser, DeserializationContext context) throws IOException { + JsonToken currentToken = jsonParser.getCurrentToken(); + if (currentToken == JsonToken.VALUE_STRING) { + String dateTimeAsString = jsonParser.getText().trim(); + return new LocalDate(dateTimeAsString); + } + return null; + } } diff --git a/src/main/java/org/opensrp/util/LocalDateSerializer.java b/src/main/java/org/opensrp/util/LocalDateSerializer.java index 19fdc2a42..18e28fef2 100644 --- a/src/main/java/org/opensrp/util/LocalDateSerializer.java +++ b/src/main/java/org/opensrp/util/LocalDateSerializer.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.util; @@ -15,16 +15,16 @@ * @author Samuel Githengi created on 02/20/20 */ public class LocalDateSerializer extends StdScalarSerializer { - - private static final long serialVersionUID = -6797135374503717200L; - - public LocalDateSerializer() { - super(LocalDate.class); - } - - @Override - public void serialize(LocalDate value, JsonGenerator gen, SerializerProvider provider) throws IOException { - gen.writeString(value.toString()); - } - + + private static final long serialVersionUID = -6797135374503717200L; + + public LocalDateSerializer() { + super(LocalDate.class); + } + + @Override + public void serialize(LocalDate value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeString(value.toString()); + } + } diff --git a/src/main/java/org/opensrp/util/NetClientGet.java b/src/main/java/org/opensrp/util/NetClientGet.java index f8ca90c56..56e476824 100644 --- a/src/main/java/org/opensrp/util/NetClientGet.java +++ b/src/main/java/org/opensrp/util/NetClientGet.java @@ -1,5 +1,5 @@ /** - * Contributors: muhammad.ahmed@ihsinformatics.com + * Contributors: muhammad.ahmed@ihsinformatics.com */ package org.opensrp.util; @@ -15,106 +15,102 @@ import org.apache.commons.codec.binary.Base64; public class NetClientGet { - - // http://localhost:8080/RESTfulExample/json/product/get - public String convertToString(String dataurl, String username, String formId) { - - try { - - URL url = new URL("https://enketo.formhub.org/transform/get_html_form"); - HttpURLConnection conn = (HttpURLConnection) url.openConnection(); - conn.setRequestMethod("POST"); - conn.setDoInput(true); - conn.setDoOutput(true); - String url1 = "server_url=https://ona.io/" + username + "&form_id=" + formId; //+dataurl; - //String url2="server_url=https://ona.io/"+username+"/forms/"+formId+"/form.json&callback=CALLBACKFN"; - - // System.out.println(url2); - //"server_url=https://ona.io/ahmedihs&form_id=crvs_birth_notification" - conn.getOutputStream().write(url1.getBytes()); - if (conn.getResponseCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode()); - } - // System.out.println(conn.getResponseCode()); - BufferedReader br = new BufferedReader(new InputStreamReader((conn.getInputStream()))); - - StringBuilder sb = new StringBuilder(); - String output = null; - // System.out.println("Output from Server .... \n"); - - while ((output = br.readLine()) != null) { - // System.out.println(output); - sb.append(output); - } + + // http://localhost:8080/RESTfulExample/json/product/get + public String convertToString(String dataurl, String username, String formId) { + + try { + + URL url = new URL("https://enketo.formhub.org/transform/get_html_form"); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("POST"); + conn.setDoInput(true); + conn.setDoOutput(true); + String url1 = "server_url=https://ona.io/" + username + "&form_id=" + formId; //+dataurl; + //String url2="server_url=https://ona.io/"+username+"/forms/"+formId+"/form.json&callback=CALLBACKFN"; + + // System.out.println(url2); + //"server_url=https://ona.io/ahmedihs&form_id=crvs_birth_notification" + conn.getOutputStream().write(url1.getBytes()); + if (conn.getResponseCode() != 200) { + throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode()); + } + // System.out.println(conn.getResponseCode()); + BufferedReader br = new BufferedReader(new InputStreamReader((conn.getInputStream()))); + + StringBuilder sb = new StringBuilder(); + String output = null; + // System.out.println("Output from Server .... \n"); + + while ((output = br.readLine()) != null) { + // System.out.println(output); + sb.append(output); + } /*FileOutputStream fop = new FileOutputStream("d:\\tlocal201312161608.xml"); fop.write(sb.toString().getBytes()); conn.disconnect();*/ - return sb.toString(); - - } - catch (MalformedURLException e) { - - e.printStackTrace(); - - } - catch (IOException e) { - - e.printStackTrace(); - - } - return null; - } - - public byte[] downloadJson(String username, String password, String formPk) throws IOException { - - try { - String authString = username + ":" + password; - System.out.println("auth string: " + authString); - byte[] authEncBytes = Base64.encodeBase64(authString.getBytes()); - String authStringEnc = new String(authEncBytes); - System.out.println("Base64 encoded auth string: " + authStringEnc); - //The file that you want to download - String url2 = "https://api.ona.io/api/v1/forms/" + formPk + "/form.json"; - URL link = new URL(url2); - URLConnection urlConnection = link.openConnection(); - urlConnection.setRequestProperty("Authorization", "Basic " + authStringEnc); - InputStream is = urlConnection.getInputStream(); - InputStreamReader isr = new InputStreamReader(is); - - int numCharsRead; - char[] charArray = new char[1024]; - StringBuffer sb = new StringBuffer(); - while ((numCharsRead = isr.read(charArray)) > 0) { - sb.append(charArray, 0, numCharsRead); - } - String result = sb.toString(); - - System.out.println("*** BEGIN ***"); - System.out.println(result); - System.out.println("*** END ***"); - - return result.getBytes(); - } - catch (MalformedURLException e) { - e.printStackTrace(); - } - catch (IOException e) { - e.printStackTrace(); - } - - return null; - } - - public String getModel(String data) { - - return data.substring(data.indexOf(""), data.indexOf("") + 8); - - } - - public String getForm(String data) { - - return data.substring(data.indexOf("
") + 7); - } - + return sb.toString(); + + } catch (MalformedURLException e) { + + e.printStackTrace(); + + } catch (IOException e) { + + e.printStackTrace(); + + } + return null; + } + + public byte[] downloadJson(String username, String password, String formPk) throws IOException { + + try { + String authString = username + ":" + password; + System.out.println("auth string: " + authString); + byte[] authEncBytes = Base64.encodeBase64(authString.getBytes()); + String authStringEnc = new String(authEncBytes); + System.out.println("Base64 encoded auth string: " + authStringEnc); + //The file that you want to download + String url2 = "https://api.ona.io/api/v1/forms/" + formPk + "/form.json"; + URL link = new URL(url2); + URLConnection urlConnection = link.openConnection(); + urlConnection.setRequestProperty("Authorization", "Basic " + authStringEnc); + InputStream is = urlConnection.getInputStream(); + InputStreamReader isr = new InputStreamReader(is); + + int numCharsRead; + char[] charArray = new char[1024]; + StringBuffer sb = new StringBuffer(); + while ((numCharsRead = isr.read(charArray)) > 0) { + sb.append(charArray, 0, numCharsRead); + } + String result = sb.toString(); + + System.out.println("*** BEGIN ***"); + System.out.println(result); + System.out.println("*** END ***"); + + return result.getBytes(); + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + + return null; + } + + public String getModel(String data) { + + return data.substring(data.indexOf(""), data.indexOf("") + 8); + + } + + public String getForm(String data) { + + return data.substring(data.indexOf("") + 7); + } + } diff --git a/src/main/java/org/opensrp/util/RepositoryUtil.java b/src/main/java/org/opensrp/util/RepositoryUtil.java index 3771fbf95..e246d2c68 100644 --- a/src/main/java/org/opensrp/util/RepositoryUtil.java +++ b/src/main/java/org/opensrp/util/RepositoryUtil.java @@ -7,24 +7,24 @@ public class RepositoryUtil { - public static Pair getPageSizeAndOffset(BaseSearchBean baseSearchBean) { - return getPageSizeAndOffset(baseSearchBean.getPageNumber(), baseSearchBean.getPageSize()); - } - - public static Pair getPageSizeAndOffset(Integer pageNumber, Integer pageSize){ - int currentPageSize; - int offset = 0; - - if (pageSize == null || pageSize == 0) { - currentPageSize = DEFAULT_FETCH_SIZE; - } else { - currentPageSize = pageSize; - } - - if (pageNumber != null && pageNumber != 0) { - offset = (pageNumber - 1) * currentPageSize; - } - - return Pair.of(currentPageSize, offset); - } + public static Pair getPageSizeAndOffset(BaseSearchBean baseSearchBean) { + return getPageSizeAndOffset(baseSearchBean.getPageNumber(), baseSearchBean.getPageSize()); + } + + public static Pair getPageSizeAndOffset(Integer pageNumber, Integer pageSize) { + int currentPageSize; + int offset = 0; + + if (pageSize == null || pageSize == 0) { + currentPageSize = DEFAULT_FETCH_SIZE; + } else { + currentPageSize = pageSize; + } + + if (pageNumber != null && pageNumber != 0) { + offset = (pageNumber - 1) * currentPageSize; + } + + return Pair.of(currentPageSize, offset); + } } diff --git a/src/main/java/org/opensrp/util/SafeMap.java b/src/main/java/org/opensrp/util/SafeMap.java index adc7f482d..922f7b4de 100644 --- a/src/main/java/org/opensrp/util/SafeMap.java +++ b/src/main/java/org/opensrp/util/SafeMap.java @@ -8,56 +8,56 @@ import org.apache.commons.lang.builder.ToStringBuilder; public class SafeMap { - - private Map data; - - public SafeMap() { - this(new HashMap()); - } - - public SafeMap(Map data) { - this.data = data; - } - - public SafeMap putAll(SafeMap formFieldsMap) { - for (String key : formFieldsMap.data.keySet()) { - put(key, formFieldsMap.get(key)); - } - return this; - } - - public String get(String key) { - if (!data.containsKey(key)) { - throw new RuntimeException("Key: " + key + " does not exist in: " + this); - } - return data.get(key); - } - - public SafeMap put(String key, String value) { - data.put(key, value); - return this; - } - - public boolean isEmpty() { - return data.isEmpty(); - } - - public boolean has(String key) { - return data.containsKey(key); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } - - @Override - public boolean equals(Object obj) { - return EqualsBuilder.reflectionEquals(this, obj); - } - - @Override - public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); - } + + private Map data; + + public SafeMap() { + this(new HashMap()); + } + + public SafeMap(Map data) { + this.data = data; + } + + public SafeMap putAll(SafeMap formFieldsMap) { + for (String key : formFieldsMap.data.keySet()) { + put(key, formFieldsMap.get(key)); + } + return this; + } + + public String get(String key) { + if (!data.containsKey(key)) { + throw new RuntimeException("Key: " + key + " does not exist in: " + this); + } + return data.get(key); + } + + public SafeMap put(String key, String value) { + data.put(key, value); + return this; + } + + public boolean isEmpty() { + return data.isEmpty(); + } + + public boolean has(String key) { + return data.containsKey(key); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this); + } + + @Override + public boolean equals(Object obj) { + return EqualsBuilder.reflectionEquals(this, obj); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } } diff --git a/src/main/java/org/opensrp/util/Utils.java b/src/main/java/org/opensrp/util/Utils.java index 55c22225b..07aa2b9bf 100644 --- a/src/main/java/org/opensrp/util/Utils.java +++ b/src/main/java/org/opensrp/util/Utils.java @@ -30,144 +30,145 @@ public class Utils { - private static Logger logger = LogManager.getLogger(Utils.class.toString()); - - private Utils() { - - } - - public static Map getStringMapFromJSON(String fields) { - return new Gson().fromJson(fields, new TypeToken>() {}.getType()); - } - - public static List getFieldsAsList(Class cls) { - List fieldList = new ArrayList<>(); - Field[] fieldSet = cls.getDeclaredFields(); - for (Field field : fieldSet) { - if (!field.isSynthetic()) { - fieldList.add(field.getName()); - } - } - return fieldList; - } - - public static Object getMergedJSON(Object original, Object updated, List fn, Class clazz) - throws JSONException, JsonMappingException, JsonProcessingException { - - ObjectMapper objectMapper= BaseTypeHandler.createObjectMapper(); - JSONObject originalJo = new JSONObject(objectMapper.writeValueAsString(original)); - - JSONObject updatedJo = new JSONObject(objectMapper.writeValueAsString(updated)); - - JSONObject mergedJson = new JSONObject(); - if (originalJo.length() > 0) { - mergedJson = new JSONObject(originalJo, JSONObject.getNames(originalJo)); - } - - if (updatedJo.length() > 0) { - for (Field key : fn) { - String jokey = key.getName(); - if (updatedJo.has(jokey)) - mergedJson.put(jokey, updatedJo.get(jokey)); - } - } - if (mergedJson.length() > 0) - return objectMapper.readValue(mergedJson.toString(), clazz); - return original; - } - - public static JSONArray getXlsToJson(String path) throws JSONException, IOException { - FileInputStream inp = new FileInputStream(new File(path)); - // Get the workbook instance for XLS file - HSSFWorkbook workbook = new HSSFWorkbook(inp); - - // Get first sheet from the workbook - HSSFSheet sheet = workbook.getSheetAt(0); - - int hrn = getHeaderRowNum(sheet); - List hr = getRowContent(sheet, hrn); - // Start constructing JSON. - JSONArray jarr = new JSONArray(); - - for (int i = hrn + 1; i <= sheet.getLastRowNum(); i++) { - List rc = getRowContent(sheet, i); - if (!isRowEmpty(rc)) { - JSONObject row = new JSONObject(); - for (int j = 0; j < hr.size(); j++) { - row.put(hr.get(j), rc.get(j)); - } - jarr.put(row); - } - } - - workbook.close(); - return jarr; - } - - private static int getHeaderRowNum(HSSFSheet sheet) { - Iterator i = sheet.iterator(); - while (i.hasNext()) { - Row r = i.next(); - for (Cell c : r) { - if (!StringUtils.isBlank(c.getStringCellValue())) { - return r.getRowNum(); - } - } - } - return -1; - } - - private static boolean isRowEmpty(List rcontent) { - for (String r : rcontent) { - if (!StringUtils.isBlank(r)) { - return false; - } - } - return true; - } - - private static List getRowContent(HSSFSheet sheet, int rowNum) { - List hc = new ArrayList<>(); - HSSFRow r = sheet.getRow(rowNum); - if (r != null && r.getPhysicalNumberOfCells() > 0) { - for (int i = 0; i < r.getLastCellNum(); i++) { - Cell c = r.getCell(i); - hc.add(c == null ? "" : c.getStringCellValue()); - } - } - - /* - * Iterator it = sheet.getRow(rowNum).cellIterator(); while - * (it.hasNext()) { Cell c = it.next(); hc.add(c.getStringCellValue()); - * } - */ - return hc; - } - - public static boolean isEmptyList(List list) { - return list == null || list.size() == 0; - } - - public static void closeCloseable(Closeable closeable) { - try { - if (closeable != null) { - closeable.close(); - } - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - } - - public static class DatabaseConnectionParams { - - public String url; - - public String portNumber; - - public String userName; - - public String password; - - public String dbName; - } + private static Logger logger = LogManager.getLogger(Utils.class.toString()); + + private Utils() { + + } + + public static Map getStringMapFromJSON(String fields) { + return new Gson().fromJson(fields, new TypeToken>() { + }.getType()); + } + + public static List getFieldsAsList(Class cls) { + List fieldList = new ArrayList<>(); + Field[] fieldSet = cls.getDeclaredFields(); + for (Field field : fieldSet) { + if (!field.isSynthetic()) { + fieldList.add(field.getName()); + } + } + return fieldList; + } + + public static Object getMergedJSON(Object original, Object updated, List fn, Class clazz) + throws JSONException, JsonMappingException, JsonProcessingException { + + ObjectMapper objectMapper = BaseTypeHandler.createObjectMapper(); + JSONObject originalJo = new JSONObject(objectMapper.writeValueAsString(original)); + + JSONObject updatedJo = new JSONObject(objectMapper.writeValueAsString(updated)); + + JSONObject mergedJson = new JSONObject(); + if (originalJo.length() > 0) { + mergedJson = new JSONObject(originalJo, JSONObject.getNames(originalJo)); + } + + if (updatedJo.length() > 0) { + for (Field key : fn) { + String jokey = key.getName(); + if (updatedJo.has(jokey)) + mergedJson.put(jokey, updatedJo.get(jokey)); + } + } + if (mergedJson.length() > 0) + return objectMapper.readValue(mergedJson.toString(), clazz); + return original; + } + + public static JSONArray getXlsToJson(String path) throws JSONException, IOException { + FileInputStream inp = new FileInputStream(new File(path)); + // Get the workbook instance for XLS file + HSSFWorkbook workbook = new HSSFWorkbook(inp); + + // Get first sheet from the workbook + HSSFSheet sheet = workbook.getSheetAt(0); + + int hrn = getHeaderRowNum(sheet); + List hr = getRowContent(sheet, hrn); + // Start constructing JSON. + JSONArray jarr = new JSONArray(); + + for (int i = hrn + 1; i <= sheet.getLastRowNum(); i++) { + List rc = getRowContent(sheet, i); + if (!isRowEmpty(rc)) { + JSONObject row = new JSONObject(); + for (int j = 0; j < hr.size(); j++) { + row.put(hr.get(j), rc.get(j)); + } + jarr.put(row); + } + } + + workbook.close(); + return jarr; + } + + private static int getHeaderRowNum(HSSFSheet sheet) { + Iterator i = sheet.iterator(); + while (i.hasNext()) { + Row r = i.next(); + for (Cell c : r) { + if (!StringUtils.isBlank(c.getStringCellValue())) { + return r.getRowNum(); + } + } + } + return -1; + } + + private static boolean isRowEmpty(List rcontent) { + for (String r : rcontent) { + if (!StringUtils.isBlank(r)) { + return false; + } + } + return true; + } + + private static List getRowContent(HSSFSheet sheet, int rowNum) { + List hc = new ArrayList<>(); + HSSFRow r = sheet.getRow(rowNum); + if (r != null && r.getPhysicalNumberOfCells() > 0) { + for (int i = 0; i < r.getLastCellNum(); i++) { + Cell c = r.getCell(i); + hc.add(c == null ? "" : c.getStringCellValue()); + } + } + + /* + * Iterator it = sheet.getRow(rowNum).cellIterator(); while + * (it.hasNext()) { Cell c = it.next(); hc.add(c.getStringCellValue()); + * } + */ + return hc; + } + + public static boolean isEmptyList(List list) { + return list == null || list.size() == 0; + } + + public static void closeCloseable(Closeable closeable) { + try { + if (closeable != null) { + closeable.close(); + } + } catch (IOException e) { + logger.error(e.getMessage(), e); + } + } + + public static class DatabaseConnectionParams { + + public String url; + + public String portNumber; + + public String userName; + + public String password; + + public String dbName; + } } diff --git a/src/main/java/org/opensrp/util/constants/EventConstants.java b/src/main/java/org/opensrp/util/constants/EventConstants.java index 400fc1dab..d830a307b 100644 --- a/src/main/java/org/opensrp/util/constants/EventConstants.java +++ b/src/main/java/org/opensrp/util/constants/EventConstants.java @@ -2,26 +2,26 @@ public interface EventConstants { - String OUT_OF_CATCHMENT_PROVIDER_ID = "out_of_catchment_provider_id"; - String BIRTH_REGISTRATION_EVENT = "Birth Registration"; - String GROWTH_MONITORING_EVENT = "Growth Monitoring"; - String GROWTH_MONITORING_EVENT_UNDERSCORED = "growth_monitoring"; - String VACCINATION_EVENT = "Vaccination"; - String OUT_OF_AREA_SERVICE = "Out of Area Service"; - String NEW_OUT_OF_AREA_SERVICE = "out_of_area_service"; - String RECURRING_SERVICE_UNDERSCORED = "recurring_service"; - String RECURRING_SERVICE = "Recurring Service"; - String NFC_CARD_IDENTIFIER = "NFC_Card_Identifier"; - String CARD_ID_PREFIX = "c_"; - String OPENSRP_ID = "opensrp_id"; - String RECURRING_SERVICE_TYPES = "recurring_service_types"; - String NUMERIC = "numeric"; - String DOSE = "dose"; - String DATE = "date"; - String CODED = "coded"; - String _DOSE = "_dose"; - String _DATE = "_date"; - String CONCEPT = "concept"; - String YES = "yes"; - String PLAN_IDENTIFIER = "planIdentifier"; + String OUT_OF_CATCHMENT_PROVIDER_ID = "out_of_catchment_provider_id"; + String BIRTH_REGISTRATION_EVENT = "Birth Registration"; + String GROWTH_MONITORING_EVENT = "Growth Monitoring"; + String GROWTH_MONITORING_EVENT_UNDERSCORED = "growth_monitoring"; + String VACCINATION_EVENT = "Vaccination"; + String OUT_OF_AREA_SERVICE = "Out of Area Service"; + String NEW_OUT_OF_AREA_SERVICE = "out_of_area_service"; + String RECURRING_SERVICE_UNDERSCORED = "recurring_service"; + String RECURRING_SERVICE = "Recurring Service"; + String NFC_CARD_IDENTIFIER = "NFC_Card_Identifier"; + String CARD_ID_PREFIX = "c_"; + String OPENSRP_ID = "opensrp_id"; + String RECURRING_SERVICE_TYPES = "recurring_service_types"; + String NUMERIC = "numeric"; + String DOSE = "dose"; + String DATE = "date"; + String CODED = "coded"; + String _DOSE = "_dose"; + String _DATE = "_date"; + String CONCEPT = "concept"; + String YES = "yes"; + String PLAN_IDENTIFIER = "planIdentifier"; } diff --git a/src/main/java/org/opensrp/util/constants/EventDataExportConstants.java b/src/main/java/org/opensrp/util/constants/EventDataExportConstants.java index 7441da048..d2b477256 100644 --- a/src/main/java/org/opensrp/util/constants/EventDataExportConstants.java +++ b/src/main/java/org/opensrp/util/constants/EventDataExportConstants.java @@ -2,11 +2,11 @@ public class EventDataExportConstants { - public static final String SETTINGS_CONFIGURATION_EVENT_TYPE_TO_SETTINGS_IDENTIFIER = "event_type_to_settings_identifier"; + public static final String SETTINGS_CONFIGURATION_EVENT_TYPE_TO_SETTINGS_IDENTIFIER = "event_type_to_settings_identifier"; - public static final String FORM_SUBMISSION_FIELD = "formSubmissionField"; - public static final String NOT_GOOD = "not_good"; - public static final String MISUSE = "misuse"; - public static final String OBS = "obs"; + public static final String FORM_SUBMISSION_FIELD = "formSubmissionField"; + public static final String NOT_GOOD = "not_good"; + public static final String MISUSE = "misuse"; + public static final String OBS = "obs"; } diff --git a/src/main/java/org/opensrp/util/constants/InventoryConstants.java b/src/main/java/org/opensrp/util/constants/InventoryConstants.java index 3f6bf57b5..7dba0344f 100644 --- a/src/main/java/org/opensrp/util/constants/InventoryConstants.java +++ b/src/main/java/org/opensrp/util/constants/InventoryConstants.java @@ -3,48 +3,48 @@ public class InventoryConstants { - public static final String SERVICE_POINT_ID = "service_point_id"; + public static final String SERVICE_POINT_ID = "service_point_id"; - public static final String PRODUCT_ID = "product_id"; + public static final String PRODUCT_ID = "product_id"; - public static final String QUANTITY = "quantity"; + public static final String QUANTITY = "quantity"; - public static final String DELIVERY_DATE = "delivery_date"; + public static final String DELIVERY_DATE = "delivery_date"; - public static final String UNICEF_SECTION = "unicef_section"; + public static final String UNICEF_SECTION = "unicef_section"; - public static final String SERIAL_NUMBER = "serial_number"; + public static final String SERIAL_NUMBER = "serial_number"; - public static final String DONOR = "donor"; + public static final String DONOR = "donor"; - public static final String PO_NUMBER = "po_number"; + public static final String PO_NUMBER = "po_number"; - public static final String PRODUCT_NAME = "product_name"; + public static final String PRODUCT_NAME = "product_name"; - public static final String MISSING_REQUIRED_FIELDS = "Required field(s) are missing (service point ID, product ID, UNICEF section, delivery date, and/or PO number)"; + public static final String MISSING_REQUIRED_FIELDS = "Required field(s) are missing (service point ID, product ID, UNICEF section, delivery date, and/or PO number)"; - public static final String MISSING_REQUIRED_FIELDS_V2 = "Required field(s) are missing (service point ID, product Name, UNICEF section, delivery date, and/or PO number)"; + public static final String MISSING_REQUIRED_FIELDS_V2 = "Required field(s) are missing (service point ID, product Name, UNICEF section, delivery date, and/or PO number)"; - public static final String MISSING_SERIAL_NUMBER = "Serial Number is required for attractive items"; + public static final String MISSING_SERIAL_NUMBER = "Serial Number is required for attractive items"; - public static final String PRODUCT_CATALOG_DOES_NOT_EXISTS = "Product ID does not exist in product catalogue"; + public static final String PRODUCT_CATALOG_DOES_NOT_EXISTS = "Product ID does not exist in product catalogue"; - public static final String SERVICE_POINT_DOES_NOT_EXISTS = "Service point ID does not exist"; + public static final String SERVICE_POINT_DOES_NOT_EXISTS = "Service point ID does not exist"; - public static final String INVALID_DELIVERY_DATE = "Delivery Date can not be a future date"; + public static final String INVALID_DELIVERY_DATE = "Delivery Date can not be a future date"; - public static final String INVALID_FORMAT_OF_DELIVERY_DATE = "Delivery Date format is invalid; the required format is DD/MM/YYYY"; + public static final String INVALID_FORMAT_OF_DELIVERY_DATE = "Delivery Date format is invalid; the required format is DD/MM/YYYY"; - public static final String INVALID_QUANTITY = "Quantity should be a whole number and greater than or equal to 1"; + public static final String INVALID_QUANTITY = "Quantity should be a whole number and greater than or equal to 1"; - public static final String INVALID_UNICEF_SECTION = "UNICEF section is not valid"; + public static final String INVALID_UNICEF_SECTION = "UNICEF section is not valid"; - public static final String INVALID_DONOR = "Donor is not valid"; + public static final String INVALID_DONOR = "Donor is not valid"; - public static final String INVALID_PO_NUMBER = "PO Number should be a whole number"; + public static final String INVALID_PO_NUMBER = "PO Number should be a whole number"; - public static final String SETTINGS_CONFIGURATION_SECTIONS_IDENTIFIER = "inventory_unicef_sections"; + public static final String SETTINGS_CONFIGURATION_SECTIONS_IDENTIFIER = "inventory_unicef_sections"; - public static final String SETTINGS_CONFIGURATION_DONOR_IDENTIFIER = "inventory_donors"; + public static final String SETTINGS_CONFIGURATION_DONOR_IDENTIFIER = "inventory_donors"; } diff --git a/src/main/java/org/opensrp/util/constants/ObsConstants.java b/src/main/java/org/opensrp/util/constants/ObsConstants.java index 13c1b6583..a89131989 100644 --- a/src/main/java/org/opensrp/util/constants/ObsConstants.java +++ b/src/main/java/org/opensrp/util/constants/ObsConstants.java @@ -2,10 +2,10 @@ public interface ObsConstants { - String CODED_FIELD_VALUE = "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; - String NUMERIC_FIELD_CODE = "1639AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; - String ITN_CODED_FIELD_CODE = "159855AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; - String ITN_DATE_FIELD_CODE = "159432AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; - String VIT_A_CODED_FIELD_CODE = "161534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; - String DEWORMING_CODED_FIELD_CODE = "159922AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; + String CODED_FIELD_VALUE = "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; + String NUMERIC_FIELD_CODE = "1639AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; + String ITN_CODED_FIELD_CODE = "159855AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; + String ITN_DATE_FIELD_CODE = "159432AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; + String VIT_A_CODED_FIELD_CODE = "161534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; + String DEWORMING_CODED_FIELD_CODE = "159922AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; } diff --git a/src/main/java/org/opensrp/util/constants/RecurringServiceConstants.java b/src/main/java/org/opensrp/util/constants/RecurringServiceConstants.java index 4800bb0b7..106a472e5 100644 --- a/src/main/java/org/opensrp/util/constants/RecurringServiceConstants.java +++ b/src/main/java/org/opensrp/util/constants/RecurringServiceConstants.java @@ -2,7 +2,7 @@ public interface RecurringServiceConstants { - String DEWORMING = "deworming"; - String VIT_A = "vit_a"; - String ITN = "itn"; + String DEWORMING = "deworming"; + String VIT_A = "vit_a"; + String ITN = "itn"; } diff --git a/src/main/java/org/opensrp/validator/InventoryDataValidator.java b/src/main/java/org/opensrp/validator/InventoryDataValidator.java index 8926fff05..7a15bc610 100755 --- a/src/main/java/org/opensrp/validator/InventoryDataValidator.java +++ b/src/main/java/org/opensrp/validator/InventoryDataValidator.java @@ -35,193 +35,184 @@ @Component public class InventoryDataValidator { - @Autowired - private PhysicalLocationService physicalLocationService; - - @Autowired - private ProductCatalogueService productCatalogueService; - - @Autowired - private SettingService settingService; - - private List validationErrors; - - private List validDonors; - - private List validUnicefSections; - - private static Logger logger = LogManager.getLogger(InventoryDataValidator.class.toString()); - - private static Pattern DATE_PATTERN = Pattern.compile("^\\d{2}/\\d{2}/\\d{4}$"); - - public InventoryDataValidator(List validationErrors) { - this.validationErrors = validationErrors; - } - - public InventoryDataValidator(PhysicalLocationService physicalLocationService, - ProductCatalogueService productCatalogueService, SettingService settingService) { - this.physicalLocationService = physicalLocationService; - this.productCatalogueService = productCatalogueService; - this.settingService = settingService; - } - - public InventoryDataValidator() { - - } - - public List getValidationErrors(String locationId, String productCatalogId, String deliveryDateInString, - String section, String poNumber, String serialNumber, String quantity, String donor) - throws ParseException { - validationErrors = new ArrayList<>(); - - validDonors = getValidDonors(); - validUnicefSections = getValidUnicefSections(); - - ProductCatalogue productCatalogue; - PhysicalLocation physicalLocation; - productCatalogue = productCatalogId != null ? - productCatalogueService.getProductCatalogue(Long.valueOf(productCatalogId), "") : - null; - physicalLocation = locationId != null ? physicalLocationService.getStructure(locationId, true) : null; - - validateRequiredFields(locationId, productCatalogId, deliveryDateInString, section, poNumber); - validateSerialNumber(productCatalogue, serialNumber); - validateProductCatalogue(productCatalogue); - validateLocation(physicalLocation); - validateDeliveryDate(deliveryDateInString); - validateQuantity(quantity); - validateUnicefSection(section); - validateDonor(donor); - validatePoNumber(poNumber); - return validationErrors; - } - - private void validateRequiredFields(String locationId, String productCatalogId, String deliveryDateInString, - String section, String poNumber) { - if (locationId == null || productCatalogId == null || deliveryDateInString == null || section == null - || poNumber == null) { - logger.error(MISSING_REQUIRED_FIELDS); - validationErrors.add(MISSING_REQUIRED_FIELDS); - } - } - - private void validateSerialNumber(ProductCatalogue productCatalogue, String serialNumber) { - if (productCatalogue != null && productCatalogue.getIsAttractiveItem() && serialNumber == null) { - logger.error(MISSING_SERIAL_NUMBER); - validationErrors.add(MISSING_SERIAL_NUMBER); - } - } - - private void validateProductCatalogue(ProductCatalogue productCatalogue) { - if (productCatalogue == null) { - logger.error(PRODUCT_CATALOG_DOES_NOT_EXISTS); - validationErrors.add(PRODUCT_CATALOG_DOES_NOT_EXISTS); - } - } - - private void validateLocation(PhysicalLocation physicalLocation) { - if (physicalLocation == null) { - logger.error(SERVICE_POINT_DOES_NOT_EXISTS); - validationErrors.add(SERVICE_POINT_DOES_NOT_EXISTS); - } - } - - private void validateDeliveryDate(String deliveryDateInString) { - Date deliveryDate = null; - - if (deliveryDateInString != null && !DATE_PATTERN.matcher(deliveryDateInString).matches()) { - validationErrors.add(INVALID_FORMAT_OF_DELIVERY_DATE); - return; - } - - try { - deliveryDate = deliveryDateInString != null ? convertStringToDate(deliveryDateInString) : null; - } - catch (ParseException e) { - logger.error("Parse Exception occurred" + e.getMessage()); - validationErrors.add(INVALID_FORMAT_OF_DELIVERY_DATE); - } - - if (deliveryDate != null && deliveryDate.getTime() > new Date().getTime()) { - logger.error(INVALID_DELIVERY_DATE); - validationErrors.add(INVALID_DELIVERY_DATE); - } - } - - private void validateQuantity(String quantity) { - if (quantity != null && (!isWholeNumber(quantity) || Integer.valueOf(quantity) < 1)) { - logger.error(INVALID_QUANTITY); - validationErrors.add(INVALID_QUANTITY); - } - - } - - private void validateUnicefSection(String section) { - if (!validUnicefSections.contains(section)) { - logger.error(INVALID_UNICEF_SECTION); - validationErrors.add(INVALID_UNICEF_SECTION); - } - } - - private void validateDonor(String donor) { - if (donor != null && !validDonors.contains(donor)) { - logger.error(INVALID_DONOR); - validationErrors.add(INVALID_DONOR); - } - } - - private void validatePoNumber(String poNumber) { - if (poNumber != null && !isWholeNumber(poNumber)) { - logger.error(INVALID_PO_NUMBER); - validationErrors.add(INVALID_PO_NUMBER); - } - } - - public List getValidDonors() { - List settingsAndSettingsMetadataJoinedList = settingService - .findSettingsByIdentifier(SETTINGS_CONFIGURATION_DONOR_IDENTIFIER); - List donors = new ArrayList<>(); - - if (settingsAndSettingsMetadataJoinedList != null) { - for (SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined : settingsAndSettingsMetadataJoinedList) { - if (settingsAndSettingsMetadataJoined.getSettingsMetadata() != null - && settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingValue() != null) { - donors.add(settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingValue()); - } - } - } - return donors; - } - - public List getValidUnicefSections() { - List settingsAndSettingsMetadataJoinedList = settingService - .findSettingsByIdentifier(SETTINGS_CONFIGURATION_SECTIONS_IDENTIFIER); - List unicefSections = new ArrayList<>(); - - if (settingsAndSettingsMetadataJoinedList != null) { - for (SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined : settingsAndSettingsMetadataJoinedList) { - if (settingsAndSettingsMetadataJoined.getSettingsMetadata() != null - && settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingValue() != null) { - unicefSections.add(settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingValue()); - } - } - } - return unicefSections; - } - - public static Date convertStringToDate(String stringDate) throws ParseException { - return (stringDate != null) ? new SimpleDateFormat("dd/MM/yyyy").parse(stringDate) : null; - } - - public static Boolean isWholeNumber(String number) { - try { - Integer parsedNumber = Integer.parseInt(number); - logger.info("Parsed Integer is : " + parsedNumber); - return true; - } - catch (NumberFormatException numberFormatException) { - logger.error("Number Format Exception occurred : ", numberFormatException.getMessage()); - return false; - } - } + private static Logger logger = LogManager.getLogger(InventoryDataValidator.class.toString()); + private static Pattern DATE_PATTERN = Pattern.compile("^\\d{2}/\\d{2}/\\d{4}$"); + @Autowired + private PhysicalLocationService physicalLocationService; + @Autowired + private ProductCatalogueService productCatalogueService; + @Autowired + private SettingService settingService; + private List validationErrors; + private List validDonors; + private List validUnicefSections; + + public InventoryDataValidator(List validationErrors) { + this.validationErrors = validationErrors; + } + + public InventoryDataValidator(PhysicalLocationService physicalLocationService, + ProductCatalogueService productCatalogueService, SettingService settingService) { + this.physicalLocationService = physicalLocationService; + this.productCatalogueService = productCatalogueService; + this.settingService = settingService; + } + + public InventoryDataValidator() { + + } + + public static Date convertStringToDate(String stringDate) throws ParseException { + return (stringDate != null) ? new SimpleDateFormat("dd/MM/yyyy").parse(stringDate) : null; + } + + public static Boolean isWholeNumber(String number) { + try { + Integer parsedNumber = Integer.parseInt(number); + logger.info("Parsed Integer is : " + parsedNumber); + return true; + } catch (NumberFormatException numberFormatException) { + logger.error("Number Format Exception occurred : ", numberFormatException.getMessage()); + return false; + } + } + + public List getValidationErrors(String locationId, String productCatalogId, String deliveryDateInString, + String section, String poNumber, String serialNumber, String quantity, String donor) + throws ParseException { + validationErrors = new ArrayList<>(); + + validDonors = getValidDonors(); + validUnicefSections = getValidUnicefSections(); + + ProductCatalogue productCatalogue; + PhysicalLocation physicalLocation; + productCatalogue = productCatalogId != null ? + productCatalogueService.getProductCatalogue(Long.valueOf(productCatalogId), "") : + null; + physicalLocation = locationId != null ? physicalLocationService.getStructure(locationId, true) : null; + + validateRequiredFields(locationId, productCatalogId, deliveryDateInString, section, poNumber); + validateSerialNumber(productCatalogue, serialNumber); + validateProductCatalogue(productCatalogue); + validateLocation(physicalLocation); + validateDeliveryDate(deliveryDateInString); + validateQuantity(quantity); + validateUnicefSection(section); + validateDonor(donor); + validatePoNumber(poNumber); + return validationErrors; + } + + private void validateRequiredFields(String locationId, String productCatalogId, String deliveryDateInString, + String section, String poNumber) { + if (locationId == null || productCatalogId == null || deliveryDateInString == null || section == null + || poNumber == null) { + logger.error(MISSING_REQUIRED_FIELDS); + validationErrors.add(MISSING_REQUIRED_FIELDS); + } + } + + private void validateSerialNumber(ProductCatalogue productCatalogue, String serialNumber) { + if (productCatalogue != null && productCatalogue.getIsAttractiveItem() && serialNumber == null) { + logger.error(MISSING_SERIAL_NUMBER); + validationErrors.add(MISSING_SERIAL_NUMBER); + } + } + + private void validateProductCatalogue(ProductCatalogue productCatalogue) { + if (productCatalogue == null) { + logger.error(PRODUCT_CATALOG_DOES_NOT_EXISTS); + validationErrors.add(PRODUCT_CATALOG_DOES_NOT_EXISTS); + } + } + + private void validateLocation(PhysicalLocation physicalLocation) { + if (physicalLocation == null) { + logger.error(SERVICE_POINT_DOES_NOT_EXISTS); + validationErrors.add(SERVICE_POINT_DOES_NOT_EXISTS); + } + } + + private void validateDeliveryDate(String deliveryDateInString) { + Date deliveryDate = null; + + if (deliveryDateInString != null && !DATE_PATTERN.matcher(deliveryDateInString).matches()) { + validationErrors.add(INVALID_FORMAT_OF_DELIVERY_DATE); + return; + } + + try { + deliveryDate = deliveryDateInString != null ? convertStringToDate(deliveryDateInString) : null; + } catch (ParseException e) { + logger.error("Parse Exception occurred" + e.getMessage()); + validationErrors.add(INVALID_FORMAT_OF_DELIVERY_DATE); + } + + if (deliveryDate != null && deliveryDate.getTime() > new Date().getTime()) { + logger.error(INVALID_DELIVERY_DATE); + validationErrors.add(INVALID_DELIVERY_DATE); + } + } + + private void validateQuantity(String quantity) { + if (quantity != null && (!isWholeNumber(quantity) || Integer.valueOf(quantity) < 1)) { + logger.error(INVALID_QUANTITY); + validationErrors.add(INVALID_QUANTITY); + } + + } + + private void validateUnicefSection(String section) { + if (!validUnicefSections.contains(section)) { + logger.error(INVALID_UNICEF_SECTION); + validationErrors.add(INVALID_UNICEF_SECTION); + } + } + + private void validateDonor(String donor) { + if (donor != null && !validDonors.contains(donor)) { + logger.error(INVALID_DONOR); + validationErrors.add(INVALID_DONOR); + } + } + + private void validatePoNumber(String poNumber) { + if (poNumber != null && !isWholeNumber(poNumber)) { + logger.error(INVALID_PO_NUMBER); + validationErrors.add(INVALID_PO_NUMBER); + } + } + + public List getValidDonors() { + List settingsAndSettingsMetadataJoinedList = settingService + .findSettingsByIdentifier(SETTINGS_CONFIGURATION_DONOR_IDENTIFIER); + List donors = new ArrayList<>(); + + if (settingsAndSettingsMetadataJoinedList != null) { + for (SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined : settingsAndSettingsMetadataJoinedList) { + if (settingsAndSettingsMetadataJoined.getSettingsMetadata() != null + && settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingValue() != null) { + donors.add(settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingValue()); + } + } + } + return donors; + } + + public List getValidUnicefSections() { + List settingsAndSettingsMetadataJoinedList = settingService + .findSettingsByIdentifier(SETTINGS_CONFIGURATION_SECTIONS_IDENTIFIER); + List unicefSections = new ArrayList<>(); + + if (settingsAndSettingsMetadataJoinedList != null) { + for (SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined : settingsAndSettingsMetadataJoinedList) { + if (settingsAndSettingsMetadataJoined.getSettingsMetadata() != null + && settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingValue() != null) { + unicefSections.add(settingsAndSettingsMetadataJoined.getSettingsMetadata().getSettingValue()); + } + } + } + return unicefSections; + } } diff --git a/src/test/java/org/opensrp/MultimediaServiceTest.java b/src/test/java/org/opensrp/MultimediaServiceTest.java index 9e799dadb..b2ef0d67b 100644 --- a/src/test/java/org/opensrp/MultimediaServiceTest.java +++ b/src/test/java/org/opensrp/MultimediaServiceTest.java @@ -28,58 +28,58 @@ @ContextConfiguration("classpath:test-applicationContext-opensrp.xml") public class MultimediaServiceTest { - @Autowired - private MultimediaService multimediaService; - - @Mock - private MultimediaRepositoryImpl multimediaRepository; - - @Mock - private ClientService clientService; + @Autowired + private MultimediaService multimediaService; - @Autowired - @Qualifier("multimedia.file.manager") - private BaseMultimediaFileManager fileManager; - - @Before - public void setUp() { - initMocks(this); - multimediaService = new MultimediaService(multimediaRepository, clientService); - } + @Mock + private MultimediaRepositoryImpl multimediaRepository; - @Test - public void testGetMultimediaFilesShouldReturnAllClientMultimediaFiles() { - List multimediaFiles = new ArrayList<>(); - multimediaFiles.add(new Multimedia("caseId1", "provideId1", "contentType1", "filePath1", "fileCategory1")); - multimediaFiles.add(new Multimedia("caseId2", "provideId2", "contentType2", "filePath2", "fileCategory2")); - doReturn(multimediaFiles).when(multimediaRepository).get(anyString(), anyString(), anyString()); - List result = multimediaService.getMultimediaFiles("entityId", "contentType", "fileCategory"); - assertEquals(result.size(), 2); - assertEquals(result.get(0).getCaseId(), "caseId1"); - assertEquals(result.get(1).getCaseId(), "caseId2"); - } + @Mock + private ClientService clientService; - @Test - public void testUploadFileShouldSetCorrectFilePath() { - final String BASE_MULTIMEDIA_DIR_PATH = "baseMultimediaDirPath"; - Whitebox.setInternalState(fileManager, "baseMultimediaDirPath", BASE_MULTIMEDIA_DIR_PATH); + @Autowired + @Qualifier("multimedia.file.manager") + private BaseMultimediaFileManager fileManager; - MultimediaDTO multimedia = new MultimediaDTO("caseId1", "provideId1", "image/jpeg", "filePath1", "multi_version"); - byte[] testBytes = new byte[10]; - String originalFileName = "original_file_name"; - //doReturn("original_file_name").when(multipartFile).getOriginalFilename(); - fileManager.uploadFile(multimedia, testBytes, originalFileName); - assertEquals(multimedia.getFilePath(), BASE_MULTIMEDIA_DIR_PATH + "/patient_images/caseId1/original_file_name"); + @Before + public void setUp() { + initMocks(this); + multimediaService = new MultimediaService(multimediaRepository, clientService); + } - multimedia = new MultimediaDTO("caseId1", "provideId1", "image/jpeg", "filePath1", "profileimage"); - fileManager.uploadFile(multimedia, new byte[10], originalFileName); - assertEquals(multimedia.getFilePath(), BASE_MULTIMEDIA_DIR_PATH + "/patient_images/caseId1.jpg"); - } + @Test + public void testGetMultimediaFilesShouldReturnAllClientMultimediaFiles() { + List multimediaFiles = new ArrayList<>(); + multimediaFiles.add(new Multimedia("caseId1", "provideId1", "contentType1", "filePath1", "fileCategory1")); + multimediaFiles.add(new Multimedia("caseId2", "provideId2", "contentType2", "filePath2", "fileCategory2")); + doReturn(multimediaFiles).when(multimediaRepository).get(anyString(), anyString(), anyString()); + List result = multimediaService.getMultimediaFiles("entityId", "contentType", "fileCategory"); + assertEquals(result.size(), 2); + assertEquals(result.get(0).getCaseId(), "caseId1"); + assertEquals(result.get(1).getCaseId(), "caseId2"); + } - @Test - public void testGetFileExtension(){ - assertEquals(".csv",fileManager.getFileExtension("text.csv")); - assertEquals("",fileManager.getFileExtension("text")); - assertEquals(".gz",fileManager.getFileExtension("sample.tr.gz")); - } + @Test + public void testUploadFileShouldSetCorrectFilePath() { + final String BASE_MULTIMEDIA_DIR_PATH = "baseMultimediaDirPath"; + Whitebox.setInternalState(fileManager, "baseMultimediaDirPath", BASE_MULTIMEDIA_DIR_PATH); + + MultimediaDTO multimedia = new MultimediaDTO("caseId1", "provideId1", "image/jpeg", "filePath1", "multi_version"); + byte[] testBytes = new byte[10]; + String originalFileName = "original_file_name"; + //doReturn("original_file_name").when(multipartFile).getOriginalFilename(); + fileManager.uploadFile(multimedia, testBytes, originalFileName); + assertEquals(multimedia.getFilePath(), BASE_MULTIMEDIA_DIR_PATH + "/patient_images/caseId1/original_file_name"); + + multimedia = new MultimediaDTO("caseId1", "provideId1", "image/jpeg", "filePath1", "profileimage"); + fileManager.uploadFile(multimedia, new byte[10], originalFileName); + assertEquals(multimedia.getFilePath(), BASE_MULTIMEDIA_DIR_PATH + "/patient_images/caseId1.jpg"); + } + + @Test + public void testGetFileExtension() { + assertEquals(".csv", fileManager.getFileExtension("text.csv")); + assertEquals("", fileManager.getFileExtension("text")); + assertEquals(".gz", fileManager.getFileExtension("sample.tr.gz")); + } } diff --git a/src/test/java/org/opensrp/SpringApplicationContextProvider.java b/src/test/java/org/opensrp/SpringApplicationContextProvider.java index 6d57159a3..7125387ce 100644 --- a/src/test/java/org/opensrp/SpringApplicationContextProvider.java +++ b/src/test/java/org/opensrp/SpringApplicationContextProvider.java @@ -9,15 +9,15 @@ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:test-applicationContext-opensrp.xml") public class SpringApplicationContextProvider extends TestResourceLoader { - - public static ApplicationContext context; - - public static ApplicationContext getContext() { - return context; - } - - public static void setContext(ApplicationContext context) { - SpringApplicationContextProvider.context = context; - } - + + public static ApplicationContext context; + + public static ApplicationContext getContext() { + return context; + } + + public static void setContext(ApplicationContext context) { + SpringApplicationContextProvider.context = context; + } + } diff --git a/src/test/java/org/opensrp/TestDriverManagerDataSource.java b/src/test/java/org/opensrp/TestDriverManagerDataSource.java index 7349ea1a9..21889bd43 100644 --- a/src/test/java/org/opensrp/TestDriverManagerDataSource.java +++ b/src/test/java/org/opensrp/TestDriverManagerDataSource.java @@ -4,9 +4,9 @@ public class TestDriverManagerDataSource extends DriverManagerDataSource { - @Override - public void setUrl(String url) { - super.setUrl(String.format("jdbc:postgresql://localhost:%d/%s", - TestPostgresInstance.postgresContainer.getMappedPort(TestPostgresInstance.DOCKER_EXPOSE_PORT), TestPostgresInstance.POSTGRES_DB)); - } + @Override + public void setUrl(String url) { + super.setUrl(String.format("jdbc:postgresql://localhost:%d/%s", + TestPostgresInstance.postgresContainer.getMappedPort(TestPostgresInstance.DOCKER_EXPOSE_PORT), TestPostgresInstance.POSTGRES_DB)); + } } diff --git a/src/test/java/org/opensrp/TestPostgresInstance.java b/src/test/java/org/opensrp/TestPostgresInstance.java index 48e1c6ef9..75b3585df 100644 --- a/src/test/java/org/opensrp/TestPostgresInstance.java +++ b/src/test/java/org/opensrp/TestPostgresInstance.java @@ -5,25 +5,21 @@ public abstract class TestPostgresInstance { - private static final String POSTGRES_USER = "opensrp_admin"; - private static final String POSTGRES_PASSWORD = "admin"; - private static final String POSTGRES_USER_CONFIG = "POSTGRES_USER"; - - private static final String POSTGRES_PASSWORD_CONFIG = "POSTGRES_PASSWORD"; - - protected static final String POSTGRES_DB_CONFIG = "POSTGRES_DB"; - protected static final String POSTGRES_DB = "opensrp_test"; - private static final String DOCKER_IMAGE_NAME = "postgis/postgis:12-2.5-alpine"; - - protected static final int DOCKER_EXPOSE_PORT = 5432; - - public static final GenericContainer postgresContainer = new GenericContainer<>(DockerImageName.parse(DOCKER_IMAGE_NAME)) - .withEnv(POSTGRES_PASSWORD_CONFIG, POSTGRES_PASSWORD) - .withEnv(POSTGRES_USER_CONFIG, POSTGRES_USER) - .withEnv(POSTGRES_DB_CONFIG, POSTGRES_DB) - .withExposedPorts(DOCKER_EXPOSE_PORT); - - static { - postgresContainer.start(); - } + protected static final String POSTGRES_DB_CONFIG = "POSTGRES_DB"; + protected static final String POSTGRES_DB = "opensrp_test"; + protected static final int DOCKER_EXPOSE_PORT = 5432; + private static final String POSTGRES_USER = "opensrp_admin"; + private static final String POSTGRES_PASSWORD = "admin"; + private static final String POSTGRES_USER_CONFIG = "POSTGRES_USER"; + private static final String POSTGRES_PASSWORD_CONFIG = "POSTGRES_PASSWORD"; + private static final String DOCKER_IMAGE_NAME = "postgis/postgis:12-2.5-alpine"; + public static final GenericContainer postgresContainer = new GenericContainer<>(DockerImageName.parse(DOCKER_IMAGE_NAME)) + .withEnv(POSTGRES_PASSWORD_CONFIG, POSTGRES_PASSWORD) + .withEnv(POSTGRES_USER_CONFIG, POSTGRES_USER) + .withEnv(POSTGRES_DB_CONFIG, POSTGRES_DB) + .withExposedPorts(DOCKER_EXPOSE_PORT); + + static { + postgresContainer.start(); + } } diff --git a/src/test/java/org/opensrp/TestRabbitMQInstance.java b/src/test/java/org/opensrp/TestRabbitMQInstance.java index 05e312f5e..4a4b70be9 100644 --- a/src/test/java/org/opensrp/TestRabbitMQInstance.java +++ b/src/test/java/org/opensrp/TestRabbitMQInstance.java @@ -6,30 +6,30 @@ import org.testcontainers.utility.DockerImageName; public abstract class TestRabbitMQInstance { - private static final String DOCKER_IMAGE_NAME = "rabbitmq:3-alpine"; + private static final String DOCKER_IMAGE_NAME = "rabbitmq:3-alpine"; - private static final String RABBITMQ_USERNAME_CONFIG = "rabbitmq.username"; + private static final String RABBITMQ_USERNAME_CONFIG = "rabbitmq.username"; - private static final String RABBITMQ_PASSWORD_CONFIG = "rabbitmq.password"; + private static final String RABBITMQ_PASSWORD_CONFIG = "rabbitmq.password"; - private static final String RABBITMQ_USERNAME = "guest"; + private static final String RABBITMQ_USERNAME = "guest"; - private static final String RABBITMQ_PASSWORD = "guest"; - private static final String RABBITMQ_PORT = "rabbitmq.port"; + private static final String RABBITMQ_PASSWORD = "guest"; + private static final String RABBITMQ_PORT = "rabbitmq.port"; - private static final int DOCKER_EXPOSE_PORT = 5672; + private static final int DOCKER_EXPOSE_PORT = 5672; - private static final GenericContainer rabbitMQContainer = new GenericContainer<>(DockerImageName.parse(DOCKER_IMAGE_NAME)) - .withExposedPorts(DOCKER_EXPOSE_PORT); + private static final GenericContainer rabbitMQContainer = new GenericContainer<>(DockerImageName.parse(DOCKER_IMAGE_NAME)) + .withExposedPorts(DOCKER_EXPOSE_PORT); - static { - rabbitMQContainer.start(); - } + static { + rabbitMQContainer.start(); + } - @DynamicPropertySource - private static void registerRabbitMQProperties(DynamicPropertyRegistry registry) { - registry.add(RABBITMQ_PORT, () -> rabbitMQContainer.getMappedPort(DOCKER_EXPOSE_PORT)); - registry.add(RABBITMQ_USERNAME_CONFIG, () -> RABBITMQ_USERNAME); - registry.add(RABBITMQ_PASSWORD_CONFIG, () -> RABBITMQ_PASSWORD); - } + @DynamicPropertySource + private static void registerRabbitMQProperties(DynamicPropertyRegistry registry) { + registry.add(RABBITMQ_PORT, () -> rabbitMQContainer.getMappedPort(DOCKER_EXPOSE_PORT)); + registry.add(RABBITMQ_USERNAME_CONFIG, () -> RABBITMQ_USERNAME); + registry.add(RABBITMQ_PASSWORD_CONFIG, () -> RABBITMQ_PASSWORD); + } } diff --git a/src/test/java/org/opensrp/config/RedisConfig.java b/src/test/java/org/opensrp/config/RedisConfig.java index 2ad057162..503e5f28f 100644 --- a/src/test/java/org/opensrp/config/RedisConfig.java +++ b/src/test/java/org/opensrp/config/RedisConfig.java @@ -13,46 +13,46 @@ @Configuration public class RedisConfig { - private int redisMaxConnections = 0; - - private int redisDatabase = 0; - - @Value("#{opensrp['redis.host']}") - private String redisHost; - - @Value("#{opensrp['redis.port']}") - private int redisPort; - - @Value("#{opensrp['redis.password']}") - private String redisPassword; - - @Bean(name = "jedisConnectionFactory") - public RedisConnectionFactory jedisConnectionFactory() { - JedisClientConfiguration clientConfiguration = JedisClientConfiguration.builder().usePooling() - .poolConfig(poolConfig()).build(); - JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory(redisStandaloneConfiguration(), - clientConfiguration); - return jedisConnectionFactory; - } - - @Bean(name = "redisTemplate") - public RedisTemplate jedisTemplate() { - RedisTemplate template = new RedisTemplate<>(); - template.setConnectionFactory(jedisConnectionFactory()); - return template; - } - - private RedisStandaloneConfiguration redisStandaloneConfiguration() { - RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration(redisHost, - redisPort); - redisStandaloneConfiguration.setDatabase(redisDatabase); - redisStandaloneConfiguration.setPassword(redisPassword); - return redisStandaloneConfiguration; - } - - private GenericObjectPoolConfig poolConfig() { - GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig(); - poolConfig.setMaxTotal(redisMaxConnections); - return poolConfig; - } + private int redisMaxConnections = 0; + + private int redisDatabase = 0; + + @Value("#{opensrp['redis.host']}") + private String redisHost; + + @Value("#{opensrp['redis.port']}") + private int redisPort; + + @Value("#{opensrp['redis.password']}") + private String redisPassword; + + @Bean(name = "jedisConnectionFactory") + public RedisConnectionFactory jedisConnectionFactory() { + JedisClientConfiguration clientConfiguration = JedisClientConfiguration.builder().usePooling() + .poolConfig(poolConfig()).build(); + JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory(redisStandaloneConfiguration(), + clientConfiguration); + return jedisConnectionFactory; + } + + @Bean(name = "redisTemplate") + public RedisTemplate jedisTemplate() { + RedisTemplate template = new RedisTemplate<>(); + template.setConnectionFactory(jedisConnectionFactory()); + return template; + } + + private RedisStandaloneConfiguration redisStandaloneConfiguration() { + RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration(redisHost, + redisPort); + redisStandaloneConfiguration.setDatabase(redisDatabase); + redisStandaloneConfiguration.setPassword(redisPassword); + return redisStandaloneConfiguration; + } + + private GenericObjectPoolConfig poolConfig() { + GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig(); + poolConfig.setMaxTotal(redisMaxConnections); + return poolConfig; + } } \ No newline at end of file diff --git a/src/test/java/org/opensrp/config/ThreadPoolExecutorConfigTest.java b/src/test/java/org/opensrp/config/ThreadPoolExecutorConfigTest.java index 2bb488fd1..875f2fadd 100644 --- a/src/test/java/org/opensrp/config/ThreadPoolExecutorConfigTest.java +++ b/src/test/java/org/opensrp/config/ThreadPoolExecutorConfigTest.java @@ -10,23 +10,23 @@ public class ThreadPoolExecutorConfigTest { - private ThreadPoolExecutorConfig poolExecutorConfig; + private ThreadPoolExecutorConfig poolExecutorConfig; - @Before - public void setUp() { - poolExecutorConfig = new ThreadPoolExecutorConfig(); - } + @Before + public void setUp() { + poolExecutorConfig = new ThreadPoolExecutorConfig(); + } - @Test - public void testTaskExecutorShouldReturnTaskExecutor() { - int threadPoolCoreSize = 3; - int threadPoolMaxSize = 4; - WhiteboxImpl.setInternalState(poolExecutorConfig, "threadPoolCoreSize", threadPoolCoreSize); - WhiteboxImpl.setInternalState(poolExecutorConfig, "threadPoolMaxSize", threadPoolMaxSize); + @Test + public void testTaskExecutorShouldReturnTaskExecutor() { + int threadPoolCoreSize = 3; + int threadPoolMaxSize = 4; + WhiteboxImpl.setInternalState(poolExecutorConfig, "threadPoolCoreSize", threadPoolCoreSize); + WhiteboxImpl.setInternalState(poolExecutorConfig, "threadPoolMaxSize", threadPoolMaxSize); - ThreadPoolTaskExecutor taskExecutor = poolExecutorConfig.taskExecutor(); - assertNotNull(taskExecutor); - assertEquals(threadPoolCoreSize, taskExecutor.getCorePoolSize()); - assertEquals(threadPoolMaxSize, taskExecutor.getMaxPoolSize()); - } + ThreadPoolTaskExecutor taskExecutor = poolExecutorConfig.taskExecutor(); + assertNotNull(taskExecutor); + assertEquals(threadPoolCoreSize, taskExecutor.getCorePoolSize()); + assertEquals(threadPoolMaxSize, taskExecutor.getMaxPoolSize()); + } } diff --git a/src/test/java/org/opensrp/domain/AppStateTokenTest.java b/src/test/java/org/opensrp/domain/AppStateTokenTest.java index b151abdb3..c1e75751b 100644 --- a/src/test/java/org/opensrp/domain/AppStateTokenTest.java +++ b/src/test/java/org/opensrp/domain/AppStateTokenTest.java @@ -16,35 +16,35 @@ import nl.jqno.equalsverifier.Warning; public class AppStateTokenTest { - - @Test - public void testGetterAndSetter() { - Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); - - validator.validate(PojoClassFactory.getPojoClass(AppStateToken.class)); - } - - @Test - public void testEqualAndHashcodeContract() { - EqualsVerifier.forClass(AppStateToken.class).suppress(Warning.NONFINAL_FIELDS).withIgnoredFields("id", "revision") - .withRedefinedSuperclass().verify(); - } - - @Test - public void testValueBasedOnType() { - AppStateToken appStateToken = new AppStateToken("name", "2.3", 3l); - - assertEquals(2.3, appStateToken.doubleValue(), 0); - assertEquals(2.3, appStateToken.floatValue(), 0.2); - assertEquals("2.3", appStateToken.stringValue()); - - appStateToken = new AppStateToken("name", "true", 3l); - assertTrue(appStateToken.booleanValue()); - - appStateToken = new AppStateToken("name", "2", 3l); - assertEquals(2, appStateToken.intValue()); - - appStateToken = new AppStateToken("name", new DateTime(0l).toLocalDate(), 3l); - assertEquals(new DateTime(0l).toLocalDate(), appStateToken.datetimeValue()); - } + + @Test + public void testGetterAndSetter() { + Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); + + validator.validate(PojoClassFactory.getPojoClass(AppStateToken.class)); + } + + @Test + public void testEqualAndHashcodeContract() { + EqualsVerifier.forClass(AppStateToken.class).suppress(Warning.NONFINAL_FIELDS).withIgnoredFields("id", "revision") + .withRedefinedSuperclass().verify(); + } + + @Test + public void testValueBasedOnType() { + AppStateToken appStateToken = new AppStateToken("name", "2.3", 3l); + + assertEquals(2.3, appStateToken.doubleValue(), 0); + assertEquals(2.3, appStateToken.floatValue(), 0.2); + assertEquals("2.3", appStateToken.stringValue()); + + appStateToken = new AppStateToken("name", "true", 3l); + assertTrue(appStateToken.booleanValue()); + + appStateToken = new AppStateToken("name", "2", 3l); + assertEquals(2, appStateToken.intValue()); + + appStateToken = new AppStateToken("name", new DateTime(0l).toLocalDate(), 3l); + assertEquals(new DateTime(0l).toLocalDate(), appStateToken.datetimeValue()); + } } diff --git a/src/test/java/org/opensrp/domain/CSVRowConfigTest.java b/src/test/java/org/opensrp/domain/CSVRowConfigTest.java index 705556b56..ab3331efd 100644 --- a/src/test/java/org/opensrp/domain/CSVRowConfigTest.java +++ b/src/test/java/org/opensrp/domain/CSVRowConfigTest.java @@ -6,7 +6,7 @@ public class CSVRowConfigTest { @Test - public void testConfigAccessors(){ + public void testConfigAccessors() { CSVRowConfig csvRowConfig = new CSVRowConfig(); csvRowConfig.setColumnName("column_name"); @@ -19,11 +19,11 @@ public void testConfigAccessors(){ Assert.assertTrue(csvRowConfig.isRequired()); csvRowConfig.setRegex("1235"); - Assert.assertEquals("1235",csvRowConfig.getRegex()); + Assert.assertEquals("1235", csvRowConfig.getRegex()); } @Test - public void testConfigValidation(){ + public void testConfigValidation() { CSVRowConfig csvRowConfig = new CSVRowConfig(); csvRowConfig.setRequired(true); csvRowConfig.setRegex("[0-9]+"); diff --git a/src/test/java/org/opensrp/domain/CampTest.java b/src/test/java/org/opensrp/domain/CampTest.java index 0fa573e86..c9a012cef 100644 --- a/src/test/java/org/opensrp/domain/CampTest.java +++ b/src/test/java/org/opensrp/domain/CampTest.java @@ -9,138 +9,138 @@ public class CampTest { - private Camp camp; + private Camp camp; - @Before - public void setUp() throws Exception { - camp = new Camp(); - } + @Before + public void setUp() throws Exception { + camp = new Camp(); + } - @Test - public void getProviderName() { - String providerName = "provider-name"; - camp.setProviderName(providerName); + @Test + public void getProviderName() { + String providerName = "provider-name"; + camp.setProviderName(providerName); - Assert.assertEquals(providerName, camp.getProviderName()); - } + Assert.assertEquals(providerName, camp.getProviderName()); + } - @Test - public void setProviderName() { - String providerName = "provider-name"; - camp.setProviderName(providerName); + @Test + public void setProviderName() { + String providerName = "provider-name"; + camp.setProviderName(providerName); - Assert.assertEquals(providerName, camp.getProviderName()); - } + Assert.assertEquals(providerName, camp.getProviderName()); + } - @Test - public void getDate() { - String date = "date"; - camp.setDate(date); + @Test + public void getDate() { + String date = "date"; + camp.setDate(date); - Assert.assertEquals(date, camp.getDate()); - } + Assert.assertEquals(date, camp.getDate()); + } - @Test - public void setDate() { - String date = "date"; - camp.setDate(date); + @Test + public void setDate() { + String date = "date"; + camp.setDate(date); - Assert.assertEquals(date, camp.getDate()); - } + Assert.assertEquals(date, camp.getDate()); + } - @Test - public void getCampName() { - String campName = "Camp Moses"; - camp.setCampName(campName); + @Test + public void getCampName() { + String campName = "Camp Moses"; + camp.setCampName(campName); - Assert.assertEquals(campName, camp.getCampName()); - } + Assert.assertEquals(campName, camp.getCampName()); + } - @Test - public void setCampName() { - String campName = "Camp Moses"; - camp.setCampName(campName); + @Test + public void setCampName() { + String campName = "Camp Moses"; + camp.setCampName(campName); - Assert.assertEquals(campName, camp.getCampName()); - } + Assert.assertEquals(campName, camp.getCampName()); + } - @Test - public void isStatus() { - boolean status = true; - camp.setStatus(status); + @Test + public void isStatus() { + boolean status = true; + camp.setStatus(status); - Assert.assertEquals(status, camp.isStatus()); - } + Assert.assertEquals(status, camp.isStatus()); + } - @Test - public void setStatus() { - boolean status = true; - camp.setStatus(status); + @Test + public void setStatus() { + boolean status = true; + camp.setStatus(status); - Assert.assertEquals(status, camp.isStatus()); - } + Assert.assertEquals(status, camp.isStatus()); + } - @Test - public void getTimestamp() { - long timestamp = 92389L; - camp.setTimestamp(timestamp); + @Test + public void getTimestamp() { + long timestamp = 92389L; + camp.setTimestamp(timestamp); - Assert.assertEquals(timestamp, camp.getTimestamp()); - } + Assert.assertEquals(timestamp, camp.getTimestamp()); + } - @Test - public void setTimestamp() { - long timestamp = 92389L; - camp.setTimestamp(timestamp); + @Test + public void setTimestamp() { + long timestamp = 92389L; + camp.setTimestamp(timestamp); - Assert.assertEquals(timestamp, camp.getTimestamp()); - } + Assert.assertEquals(timestamp, camp.getTimestamp()); + } - @Test - public void getCreatedBy() { - String createdBy = "Abel Maina"; - camp.setCreatedBy(createdBy); + @Test + public void getCreatedBy() { + String createdBy = "Abel Maina"; + camp.setCreatedBy(createdBy); - Assert.assertEquals(createdBy, camp.getCreatedBy()); - } + Assert.assertEquals(createdBy, camp.getCreatedBy()); + } - @Test - public void setCreatedBy() { - String createdBy = "Abel Maina"; - camp.setCreatedBy(createdBy); + @Test + public void setCreatedBy() { + String createdBy = "Abel Maina"; + camp.setCreatedBy(createdBy); - Assert.assertEquals(createdBy, camp.getCreatedBy()); - } - - @Test - public void getCreatedDate() { - Date createdDate = new Date(); - camp.setCreatedDate(createdDate); + Assert.assertEquals(createdBy, camp.getCreatedBy()); + } + + @Test + public void getCreatedDate() { + Date createdDate = new Date(); + camp.setCreatedDate(createdDate); - Assert.assertEquals(createdDate, camp.getCreatedDate()); - } + Assert.assertEquals(createdDate, camp.getCreatedDate()); + } - @Test - public void setCreatedDate() { - Date createdDate = new Date(); - camp.setCreatedDate(createdDate); + @Test + public void setCreatedDate() { + Date createdDate = new Date(); + camp.setCreatedDate(createdDate); - Assert.assertEquals(createdDate, camp.getCreatedDate()); - } + Assert.assertEquals(createdDate, camp.getCreatedDate()); + } - @Test - public void getCenterName() { - String centerName = "CBIIC"; - camp.setCenterName(centerName); + @Test + public void getCenterName() { + String centerName = "CBIIC"; + camp.setCenterName(centerName); - Assert.assertEquals(centerName, camp.getCenterName()); - } + Assert.assertEquals(centerName, camp.getCenterName()); + } - @Test - public void setCenterName() { - String centerName = "CBIIC"; - camp.setCenterName(centerName); + @Test + public void setCenterName() { + String centerName = "CBIIC"; + camp.setCenterName(centerName); - Assert.assertEquals(centerName, camp.getCenterName()); - } + Assert.assertEquals(centerName, camp.getCenterName()); + } } diff --git a/src/test/java/org/opensrp/domain/CampaignTest.java b/src/test/java/org/opensrp/domain/CampaignTest.java index 3f6a4647f..8f8878bc9 100644 --- a/src/test/java/org/opensrp/domain/CampaignTest.java +++ b/src/test/java/org/opensrp/domain/CampaignTest.java @@ -16,36 +16,34 @@ public class CampaignTest { - private static Gson gson = new GsonBuilder().registerTypeAdapter(DateTime.class, new TaskDateTimeTypeConverter()) - .registerTypeAdapter(LocalDate.class, new DateTypeConverter()) - .serializeNulls().create(); - - protected static DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd'T'HHmm"); - - private String campaignJson = "{\"identifier\":\"IRS_2018_S1\",\"title\":\"2019 IRS Season 1\",\"description\":\"This is the 2010 IRS Spray Campaign for Zambia for the first spray season dated 1 Jan 2019 - 31 Mar 2019.\",\"status\":\"In Progress\",\"executionPeriod\":{\"start\":\"2019-01-01T0000\",\"end\":\"2019-03-31T0000\"},\"authoredOn\":\"2018-10-01T0900\",\"lastModified\":\"2018-10-01T0900\",\"owner\":\"jdoe\",\"serverVersion\":0}"; - - @Test - public void testDeserialize() { - Campaign campaign = gson.fromJson(campaignJson, Campaign.class); - assertEquals("IRS_2018_S1", campaign.getIdentifier()); - assertEquals("2019 IRS Season 1", campaign.getTitle()); - assertEquals( - "This is the 2010 IRS Spray Campaign for Zambia for the first spray season dated 1 Jan 2019 - 31 Mar 2019.", - campaign.getDescription()); - assertEquals("2019 IRS Season 1", campaign.getTitle()); - assertEquals("2019-01-01", campaign.getExecutionPeriod().getStart().toString("yyyy-MM-dd")); - assertEquals("2019-03-31", campaign.getExecutionPeriod().getEnd().toString("yyyy-MM-dd")); - assertEquals(TaskStatus.IN_PROGRESS, campaign.getStatus()); - assertEquals("2018-10-01T0900", campaign.getAuthoredOn().toString(formatter)); - assertEquals("2018-10-01T0900", campaign.getLastModified().toString(formatter)); - assertEquals("jdoe", campaign.getOwner()); - - } - - @Test - public void testSerialize() { - Campaign campaign = gson.fromJson(campaignJson, Campaign.class); - assertEquals(campaignJson, gson.toJson(campaign)); - } + protected static DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd'T'HHmm"); + private static Gson gson = new GsonBuilder().registerTypeAdapter(DateTime.class, new TaskDateTimeTypeConverter()) + .registerTypeAdapter(LocalDate.class, new DateTypeConverter()) + .serializeNulls().create(); + private String campaignJson = "{\"identifier\":\"IRS_2018_S1\",\"title\":\"2019 IRS Season 1\",\"description\":\"This is the 2010 IRS Spray Campaign for Zambia for the first spray season dated 1 Jan 2019 - 31 Mar 2019.\",\"status\":\"In Progress\",\"executionPeriod\":{\"start\":\"2019-01-01T0000\",\"end\":\"2019-03-31T0000\"},\"authoredOn\":\"2018-10-01T0900\",\"lastModified\":\"2018-10-01T0900\",\"owner\":\"jdoe\",\"serverVersion\":0}"; + + @Test + public void testDeserialize() { + Campaign campaign = gson.fromJson(campaignJson, Campaign.class); + assertEquals("IRS_2018_S1", campaign.getIdentifier()); + assertEquals("2019 IRS Season 1", campaign.getTitle()); + assertEquals( + "This is the 2010 IRS Spray Campaign for Zambia for the first spray season dated 1 Jan 2019 - 31 Mar 2019.", + campaign.getDescription()); + assertEquals("2019 IRS Season 1", campaign.getTitle()); + assertEquals("2019-01-01", campaign.getExecutionPeriod().getStart().toString("yyyy-MM-dd")); + assertEquals("2019-03-31", campaign.getExecutionPeriod().getEnd().toString("yyyy-MM-dd")); + assertEquals(TaskStatus.IN_PROGRESS, campaign.getStatus()); + assertEquals("2018-10-01T0900", campaign.getAuthoredOn().toString(formatter)); + assertEquals("2018-10-01T0900", campaign.getLastModified().toString(formatter)); + assertEquals("jdoe", campaign.getOwner()); + + } + + @Test + public void testSerialize() { + Campaign campaign = gson.fromJson(campaignJson, Campaign.class); + assertEquals(campaignJson, gson.toJson(campaign)); + } } diff --git a/src/test/java/org/opensrp/domain/ErrorTraceFormTest.java b/src/test/java/org/opensrp/domain/ErrorTraceFormTest.java index 5b111aeb7..035bc3d37 100644 --- a/src/test/java/org/opensrp/domain/ErrorTraceFormTest.java +++ b/src/test/java/org/opensrp/domain/ErrorTraceFormTest.java @@ -9,11 +9,11 @@ import com.openpojo.validation.test.impl.SetterTester; public class ErrorTraceFormTest { - - @Test - public void testGetterAndSetter() { - Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); - - validator.validate(PojoClassFactory.getPojoClass(ErrorTraceForm.class)); - } + + @Test + public void testGetterAndSetter() { + Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); + + validator.validate(PojoClassFactory.getPojoClass(ErrorTraceForm.class)); + } } diff --git a/src/test/java/org/opensrp/domain/ErrorTraceTest.java b/src/test/java/org/opensrp/domain/ErrorTraceTest.java index be9e1d651..0205f3ce9 100644 --- a/src/test/java/org/opensrp/domain/ErrorTraceTest.java +++ b/src/test/java/org/opensrp/domain/ErrorTraceTest.java @@ -13,46 +13,46 @@ import com.openpojo.validation.test.impl.SetterTester; public class ErrorTraceTest { - - @Test - public void testGetterAndSetter() { - Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); - - validator.validate(PojoClassFactory.getPojoClass(ErrorTrace.class)); - } - - @Test - public void testConstructor() { - final Class clazz = ErrorTrace.class; - String document = "document"; - String status = "status"; - String stackTrace = "stactTrace"; - String occurredAt = "occuredAt"; - String errorType = "errorType"; - DateTime dateTime = new DateTime(0l); - - final Object obj1 = FormTest.getInstance(clazz, dateTime, errorType, occurredAt, stackTrace, status, document); - Affirm.affirmNotNull("Should have created an object", obj1); - - ErrorTrace errorTrace = (ErrorTrace) obj1; - assertEquals(dateTime, errorTrace.getDate()); - assertEquals(status, errorTrace.getStatus()); - assertEquals(errorType, errorTrace.getErrorType()); - assertEquals(document, errorTrace.getDocumentType()); - assertEquals(stackTrace, errorTrace.getStackTrace()); - assertEquals(occurredAt, errorTrace.getOccurredAt()); - - String recordId = "recordId"; - String name = "name"; - final Object obj2 = FormTest.getInstance(clazz, recordId, dateTime, name, occurredAt, stackTrace, status); - errorTrace = (ErrorTrace) obj2; - assertEquals(dateTime, errorTrace.getDate()); - assertEquals(status, errorTrace.getStatus()); - assertEquals(recordId, errorTrace.getRecordId()); - assertEquals(name, errorTrace.getErrorType()); - assertEquals(stackTrace, errorTrace.getStackTrace()); - assertEquals(occurredAt, errorTrace.getOccurredAt()); - - Affirm.affirmTrue("Should have created a different object", obj1 != obj2); - } + + @Test + public void testGetterAndSetter() { + Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); + + validator.validate(PojoClassFactory.getPojoClass(ErrorTrace.class)); + } + + @Test + public void testConstructor() { + final Class clazz = ErrorTrace.class; + String document = "document"; + String status = "status"; + String stackTrace = "stactTrace"; + String occurredAt = "occuredAt"; + String errorType = "errorType"; + DateTime dateTime = new DateTime(0l); + + final Object obj1 = FormTest.getInstance(clazz, dateTime, errorType, occurredAt, stackTrace, status, document); + Affirm.affirmNotNull("Should have created an object", obj1); + + ErrorTrace errorTrace = (ErrorTrace) obj1; + assertEquals(dateTime, errorTrace.getDate()); + assertEquals(status, errorTrace.getStatus()); + assertEquals(errorType, errorTrace.getErrorType()); + assertEquals(document, errorTrace.getDocumentType()); + assertEquals(stackTrace, errorTrace.getStackTrace()); + assertEquals(occurredAt, errorTrace.getOccurredAt()); + + String recordId = "recordId"; + String name = "name"; + final Object obj2 = FormTest.getInstance(clazz, recordId, dateTime, name, occurredAt, stackTrace, status); + errorTrace = (ErrorTrace) obj2; + assertEquals(dateTime, errorTrace.getDate()); + assertEquals(status, errorTrace.getStatus()); + assertEquals(recordId, errorTrace.getRecordId()); + assertEquals(name, errorTrace.getErrorType()); + assertEquals(stackTrace, errorTrace.getStackTrace()); + assertEquals(occurredAt, errorTrace.getOccurredAt()); + + Affirm.affirmTrue("Should have created a different object", obj1 != obj2); + } } diff --git a/src/test/java/org/opensrp/domain/FormDefinitionTest.java b/src/test/java/org/opensrp/domain/FormDefinitionTest.java index d124b6391..c55220030 100644 --- a/src/test/java/org/opensrp/domain/FormDefinitionTest.java +++ b/src/test/java/org/opensrp/domain/FormDefinitionTest.java @@ -9,12 +9,12 @@ import com.openpojo.validation.test.impl.SetterTester; public class FormDefinitionTest { - - @Test - public void testGetterAndSetter() { - Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); - - validator.validate(PojoClassFactory.getPojoClass(FormDefinition.class)); - } - + + @Test + public void testGetterAndSetter() { + Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); + + validator.validate(PojoClassFactory.getPojoClass(FormDefinition.class)); + } + } diff --git a/src/test/java/org/opensrp/domain/FormFieldTest.java b/src/test/java/org/opensrp/domain/FormFieldTest.java index 2ec67b92d..9f5a984a5 100644 --- a/src/test/java/org/opensrp/domain/FormFieldTest.java +++ b/src/test/java/org/opensrp/domain/FormFieldTest.java @@ -13,36 +13,36 @@ import org.opensrp.domain.FormField; public class FormFieldTest { - - @Test - @SuppressWarnings("RedundantArrayCreation") - public void shouldCreateUsingDefaultConstructor() { - final Class clazz = FormField.class; - final Object obj1 = FormTest.getInstance(clazz, (Object[]) null); - Affirm.affirmNotNull("Should have created an object", obj1); - - final Object obj2 = FormTest.getInstance(clazz, new Object[] {}); - Affirm.affirmTrue("Should have created a different object", obj1 != obj2); - } - - @Test - public void testGetterAndSetter() { - Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); - - validator.validate(PojoClassFactory.getPojoClass(FormField.class)); - } - - @Test - public void testConstructorWithParameter() { - final Class clazz = FormField.class; - final Object obj1 = FormTest.getInstance(clazz, "bind", "bind_path"); - FormField formField = (FormField) obj1; - Affirm.affirmNotNull("Should have created an object", obj1); - assertEquals("bind", formField.name()); - assertEquals("bind_path", formField.bind()); - - final Object obj2 = FormTest.getInstance(clazz, new Object[] {}); - Affirm.affirmTrue("Should have created a different object", obj1 != obj2); - } - + + @Test + @SuppressWarnings("RedundantArrayCreation") + public void shouldCreateUsingDefaultConstructor() { + final Class clazz = FormField.class; + final Object obj1 = FormTest.getInstance(clazz, (Object[]) null); + Affirm.affirmNotNull("Should have created an object", obj1); + + final Object obj2 = FormTest.getInstance(clazz, new Object[]{}); + Affirm.affirmTrue("Should have created a different object", obj1 != obj2); + } + + @Test + public void testGetterAndSetter() { + Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); + + validator.validate(PojoClassFactory.getPojoClass(FormField.class)); + } + + @Test + public void testConstructorWithParameter() { + final Class clazz = FormField.class; + final Object obj1 = FormTest.getInstance(clazz, "bind", "bind_path"); + FormField formField = (FormField) obj1; + Affirm.affirmNotNull("Should have created an object", obj1); + assertEquals("bind", formField.name()); + assertEquals("bind_path", formField.bind()); + + final Object obj2 = FormTest.getInstance(clazz, new Object[]{}); + Affirm.affirmTrue("Should have created a different object", obj1 != obj2); + } + } diff --git a/src/test/java/org/opensrp/domain/FormTest.java b/src/test/java/org/opensrp/domain/FormTest.java index 4a2417ff3..7dcd8ab02 100644 --- a/src/test/java/org/opensrp/domain/FormTest.java +++ b/src/test/java/org/opensrp/domain/FormTest.java @@ -13,27 +13,27 @@ import static java.util.Arrays.asList; public class FormTest { - - @Test - public void testGetterAndSetter() { - Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); - - validator.validate(PojoClassFactory.getPojoClass(Form.class)); - } - - @Test - public void testConstructor() { - final Class clazz = Form.class; - final Object obj1 = getInstance(clazz, "bind", "bind_path", asList(new FormField()), - asList(new SubFormDefinition())); - Affirm.affirmNotNull("Should have created an object", obj1); - - final Object obj2 = getInstance(clazz, new Object[] {}); - Affirm.affirmTrue("Should have created a different object", obj1 != obj2); - } - - public static Object getInstance(final Class clazz, final Object... parameters) { - final PojoClass pojoClass = PojoClassFactory.getPojoClass(clazz); - return InstanceFactory.getInstance(pojoClass, parameters); - } + + public static Object getInstance(final Class clazz, final Object... parameters) { + final PojoClass pojoClass = PojoClassFactory.getPojoClass(clazz); + return InstanceFactory.getInstance(pojoClass, parameters); + } + + @Test + public void testGetterAndSetter() { + Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); + + validator.validate(PojoClassFactory.getPojoClass(Form.class)); + } + + @Test + public void testConstructor() { + final Class clazz = Form.class; + final Object obj1 = getInstance(clazz, "bind", "bind_path", asList(new FormField()), + asList(new SubFormDefinition())); + Affirm.affirmNotNull("Should have created an object", obj1); + + final Object obj2 = getInstance(clazz, new Object[]{}); + Affirm.affirmTrue("Should have created a different object", obj1 != obj2); + } } diff --git a/src/test/java/org/opensrp/domain/IdentifierSourceTest.java b/src/test/java/org/opensrp/domain/IdentifierSourceTest.java index d69b8c919..678a8340f 100644 --- a/src/test/java/org/opensrp/domain/IdentifierSourceTest.java +++ b/src/test/java/org/opensrp/domain/IdentifierSourceTest.java @@ -6,15 +6,16 @@ import com.openpojo.validation.test.impl.GetterTester; import com.openpojo.validation.test.impl.SetterTester; import org.junit.Test; + import static org.junit.Assert.assertEquals; public class IdentifierSourceTest { - @Test - public void testGetterAndSetter() { - Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); + @Test + public void testGetterAndSetter() { + Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); - validator.validate(PojoClassFactory.getPojoClass(IdentifierSource.class)); - assertEquals(12,PojoClassFactory.getPojoClass(IdentifierSource.class).getPojoFields().size()); - } + validator.validate(PojoClassFactory.getPojoClass(IdentifierSource.class)); + assertEquals(12, PojoClassFactory.getPojoClass(IdentifierSource.class).getPojoFields().size()); + } } diff --git a/src/test/java/org/opensrp/domain/ManifestTest.java b/src/test/java/org/opensrp/domain/ManifestTest.java index 7686858be..6e69d3f9c 100644 --- a/src/test/java/org/opensrp/domain/ManifestTest.java +++ b/src/test/java/org/opensrp/domain/ManifestTest.java @@ -1,6 +1,7 @@ package org.opensrp.domain; import static org.junit.Assert.assertEquals; + import org.junit.Test; public class ManifestTest { @@ -11,13 +12,13 @@ public void testConstructor() { String appVersion = "1234234"; String json = "{}"; String appId = "1234567op"; - + Manifest manifest = new Manifest(); manifest.setAppId(appId); manifest.setAppVersion(appVersion); manifest.setIdentifier(identifier); manifest.setJson(json); - + Manifest manifest1 = (Manifest) manifest; assertEquals(identifier, manifest1.getIdentifier()); assertEquals(appVersion, manifest1.getAppVersion()); diff --git a/src/test/java/org/opensrp/domain/MultimediaTest.java b/src/test/java/org/opensrp/domain/MultimediaTest.java index bf1be8043..e1f22d809 100644 --- a/src/test/java/org/opensrp/domain/MultimediaTest.java +++ b/src/test/java/org/opensrp/domain/MultimediaTest.java @@ -14,34 +14,34 @@ import nl.jqno.equalsverifier.Warning; public class MultimediaTest { - - @Test - public void testEqualAndHashcodeContract() { - EqualsVerifier.forClass(Multimedia.class).withIgnoredFields("id", "revision").suppress(Warning.NONFINAL_FIELDS) - .withRedefinedSuperclass().verify(); - } - - @Test - public void testGetterAndSetter() { - Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); - - validator.validate(PojoClassFactory.getPojoClass(Multimedia.class)); - } - - @Test - public void testConstructor() { - String fileCategory = "fileCategory"; - String filePath = "filePath"; - String contentType = "contentType"; - String providerId = "providerId"; - String caseId = "caseId"; - - Multimedia multimedia = new Multimedia(caseId, providerId, contentType, filePath, fileCategory); - - Multimedia multimedia1 = new Multimedia().withCaseId(caseId).withProviderId(providerId).withContentType(contentType) - .withFilePath(filePath).withFileCategory(fileCategory); - - assertTrue(multimedia.equals(multimedia1)); - } - + + @Test + public void testEqualAndHashcodeContract() { + EqualsVerifier.forClass(Multimedia.class).withIgnoredFields("id", "revision").suppress(Warning.NONFINAL_FIELDS) + .withRedefinedSuperclass().verify(); + } + + @Test + public void testGetterAndSetter() { + Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); + + validator.validate(PojoClassFactory.getPojoClass(Multimedia.class)); + } + + @Test + public void testConstructor() { + String fileCategory = "fileCategory"; + String filePath = "filePath"; + String contentType = "contentType"; + String providerId = "providerId"; + String caseId = "caseId"; + + Multimedia multimedia = new Multimedia(caseId, providerId, contentType, filePath, fileCategory); + + Multimedia multimedia1 = new Multimedia().withCaseId(caseId).withProviderId(providerId).withContentType(contentType) + .withFilePath(filePath).withFileCategory(fileCategory); + + assertTrue(multimedia.equals(multimedia1)); + } + } diff --git a/src/test/java/org/opensrp/domain/ProviderTest.java b/src/test/java/org/opensrp/domain/ProviderTest.java index 6d2eaf687..dddb26d14 100644 --- a/src/test/java/org/opensrp/domain/ProviderTest.java +++ b/src/test/java/org/opensrp/domain/ProviderTest.java @@ -16,34 +16,34 @@ import org.smartregister.domain.User; public class ProviderTest { - - @Test - public void testEqualAndHashcodeContract() { - EqualsVerifier.forClass(Provider.class).withIgnoredFields("id", "revision").suppress(Warning.NONFINAL_FIELDS) - .withPrefabValues(User.class, new User("ll"), new User("e")).withRedefinedSuperclass().verify(); - } - - @Test - public void testGetterAndSetter() { - Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); - - validator.validate(PojoClassFactory.getPojoClass(Provider.class)); - } - - @Test - public void testConstructor() { - final Class clazz = Provider.class; - final Object obj1 = FormTest.getInstance(clazz, "entityId", "name"); - Affirm.affirmNotNull("Should have created an object", obj1); - - Provider provider = (Provider) obj1; - assertEquals("entityId", provider.getBaseEntityId()); - assertEquals("name", provider.getFullName()); - - final Object obj2 = FormTest.getInstance(clazz, "entityId"); - provider = (Provider) obj2; - assertEquals("entityId", provider.getBaseEntityId()); - assertEquals(null, provider.getFullName()); - Affirm.affirmTrue("Should have created a different object", obj1 != obj2); - } + + @Test + public void testEqualAndHashcodeContract() { + EqualsVerifier.forClass(Provider.class).withIgnoredFields("id", "revision").suppress(Warning.NONFINAL_FIELDS) + .withPrefabValues(User.class, new User("ll"), new User("e")).withRedefinedSuperclass().verify(); + } + + @Test + public void testGetterAndSetter() { + Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); + + validator.validate(PojoClassFactory.getPojoClass(Provider.class)); + } + + @Test + public void testConstructor() { + final Class clazz = Provider.class; + final Object obj1 = FormTest.getInstance(clazz, "entityId", "name"); + Affirm.affirmNotNull("Should have created an object", obj1); + + Provider provider = (Provider) obj1; + assertEquals("entityId", provider.getBaseEntityId()); + assertEquals("name", provider.getFullName()); + + final Object obj2 = FormTest.getInstance(clazz, "entityId"); + provider = (Provider) obj2; + assertEquals("entityId", provider.getBaseEntityId()); + assertEquals(null, provider.getFullName()); + Affirm.affirmTrue("Should have created a different object", obj1 != obj2); + } } diff --git a/src/test/java/org/opensrp/domain/SearchTest.java b/src/test/java/org/opensrp/domain/SearchTest.java index b46e7d961..63674a1df 100644 --- a/src/test/java/org/opensrp/domain/SearchTest.java +++ b/src/test/java/org/opensrp/domain/SearchTest.java @@ -24,76 +24,76 @@ import org.smartregister.domain.User; public class SearchTest { - - @Test - public void testEqualAndHashcodeContract() { - EqualsVerifier.forClass(Search.class).withIgnoredFields("id", "revision").suppress(Warning.NONFINAL_FIELDS) - .withPrefabValues(User.class, new User("ll"), new User("e")).withRedefinedSuperclass().verify(); - } - - @Test - public void testGetterAndSetter() { - Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); - - validator.validate(PojoClassFactory.getPojoClass(Search.class)); - } - - @Test - public void testFullName() { - Search search = new Search("ss").withFirstName("first").withMiddleName("middle").withLastName("last"); - assertEquals("first middle last", search.fullName()); - - search = new Search("ss").withName("first", "middle", null); - assertEquals("first middle", search.fullName()); - - search = new Search("ee", "first", "", "last", new DateTime(0l), true, "male"); - assertEquals("first last", search.fullName()); - - search = new Search("ee", "first", "", null, new DateTime(0l), true, "male"); - assertEquals("first", search.fullName()); - - search = new Search("ee", null, "middle", "", new DateTime(0l), true, "male"); - assertEquals("middle", search.fullName()); - - search = new Search("ee", null, "middle", "last", new DateTime(0l), true, "male"); - assertEquals("middle last", search.fullName()); - - search = new Search("ee", "", "", "last", new DateTime(0l), true, "male"); - assertEquals("last", search.fullName()); - - search = new Search("ee", "", "", null, new DateTime(0l), true, "male", Collections.EMPTY_LIST, - new HashMap(), new HashMap()); - assertEquals("", search.fullName()); - } - - @Test - public void testRelationShip() { - Search search = new Search("ee", "", "", "last", new DateTime(0l), true, "male", "d", "d"); - search.withBirthdate(new DateTime(0l), true); - search.withGender("male"); - search.withRelationships(null); - assertNull(search.findRelatives("d")); - - search.withRelationships(null); - search.addRelationship("t", "id"); - assertEquals(1, search.getRelationships().size()); - assertEquals(asList("id"), search.findRelatives("t")); - assertEquals(asList("t"), search.getRelationships("id")); - assertEquals(0, search.getRelationships("ddd").size()); - - search.withRelationships(null); - search.addRelationship("t", "id"); - search.addRelationship("t", "id1"); - search.addRelationship("t2", "id"); - assertEquals(2, search.getRelationships().size()); - List expectedRelationships = new ArrayList<>(); - expectedRelationships.add("t"); - expectedRelationships.add("t2"); - List expectedIds = new ArrayList<>(); - expectedIds.add("id"); - expectedIds.add("id1"); - assertEquals(new HashSet<>(expectedIds), new HashSet<>(search.findRelatives("t"))); - assertEquals(new HashSet<>(expectedRelationships), new HashSet<>(search.getRelationships("id"))); - - } + + @Test + public void testEqualAndHashcodeContract() { + EqualsVerifier.forClass(Search.class).withIgnoredFields("id", "revision").suppress(Warning.NONFINAL_FIELDS) + .withPrefabValues(User.class, new User("ll"), new User("e")).withRedefinedSuperclass().verify(); + } + + @Test + public void testGetterAndSetter() { + Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); + + validator.validate(PojoClassFactory.getPojoClass(Search.class)); + } + + @Test + public void testFullName() { + Search search = new Search("ss").withFirstName("first").withMiddleName("middle").withLastName("last"); + assertEquals("first middle last", search.fullName()); + + search = new Search("ss").withName("first", "middle", null); + assertEquals("first middle", search.fullName()); + + search = new Search("ee", "first", "", "last", new DateTime(0l), true, "male"); + assertEquals("first last", search.fullName()); + + search = new Search("ee", "first", "", null, new DateTime(0l), true, "male"); + assertEquals("first", search.fullName()); + + search = new Search("ee", null, "middle", "", new DateTime(0l), true, "male"); + assertEquals("middle", search.fullName()); + + search = new Search("ee", null, "middle", "last", new DateTime(0l), true, "male"); + assertEquals("middle last", search.fullName()); + + search = new Search("ee", "", "", "last", new DateTime(0l), true, "male"); + assertEquals("last", search.fullName()); + + search = new Search("ee", "", "", null, new DateTime(0l), true, "male", Collections.EMPTY_LIST, + new HashMap(), new HashMap()); + assertEquals("", search.fullName()); + } + + @Test + public void testRelationShip() { + Search search = new Search("ee", "", "", "last", new DateTime(0l), true, "male", "d", "d"); + search.withBirthdate(new DateTime(0l), true); + search.withGender("male"); + search.withRelationships(null); + assertNull(search.findRelatives("d")); + + search.withRelationships(null); + search.addRelationship("t", "id"); + assertEquals(1, search.getRelationships().size()); + assertEquals(asList("id"), search.findRelatives("t")); + assertEquals(asList("t"), search.getRelationships("id")); + assertEquals(0, search.getRelationships("ddd").size()); + + search.withRelationships(null); + search.addRelationship("t", "id"); + search.addRelationship("t", "id1"); + search.addRelationship("t2", "id"); + assertEquals(2, search.getRelationships().size()); + List expectedRelationships = new ArrayList<>(); + expectedRelationships.add("t"); + expectedRelationships.add("t2"); + List expectedIds = new ArrayList<>(); + expectedIds.add("id"); + expectedIds.add("id1"); + assertEquals(new HashSet<>(expectedIds), new HashSet<>(search.findRelatives("t"))); + assertEquals(new HashSet<>(expectedRelationships), new HashSet<>(search.getRelationships("id"))); + + } } diff --git a/src/test/java/org/opensrp/domain/StructureDetailsTest.java b/src/test/java/org/opensrp/domain/StructureDetailsTest.java index 95bb9d345..e48ef238c 100644 --- a/src/test/java/org/opensrp/domain/StructureDetailsTest.java +++ b/src/test/java/org/opensrp/domain/StructureDetailsTest.java @@ -11,104 +11,104 @@ public class StructureDetailsTest { - private StructureDetails structureDetails; - - @Before - public void setUp() throws Exception { - structureDetails = Mockito.mock(StructureDetails.class, Mockito.CALLS_REAL_METHODS);//new StructureDetails("structure-id", "structure-parent-id", "structure"); - } - - @Test - public void getStructureId() { - String structureId = "structure-id"; - - structureDetails.setStructureId(structureId); - Assert.assertEquals(structureId, structureDetails.getStructureId()); - } - - @Test - public void setStructureId() { - String structureId = "structure-id"; - - structureDetails.setStructureId(structureId); - Assert.assertEquals(structureId, structureDetails.getStructureId()); - } - - @Test - public void getStructureParentId() { - String structureParentId = "structure-parent-id"; - - structureDetails.setStructureParentId(structureParentId); - Assert.assertEquals(structureParentId, structureDetails.getStructureParentId()); - } - - @Test - public void setStructureParentId() { - String structureParentId = "structure-parent-id"; - - structureDetails.setStructureParentId(structureParentId); - Assert.assertEquals(structureParentId, structureDetails.getStructureParentId()); - } - - @Test - public void getStructureType() { - String structureType = "multi-point"; - - structureDetails.setStructureType(structureType); - Assert.assertEquals(structureType, structureDetails.getStructureType()); - } - - @Test - public void setStructureType() { - String structureType = "multi-point"; - - structureDetails.setStructureType(structureType); - Assert.assertEquals(structureType, structureDetails.getStructureType()); - } - - @Test - public void getFamilyId() { - String familyId = "family-id"; - - structureDetails.setFamilyId(familyId); - Assert.assertEquals(familyId, structureDetails.getFamilyId()); - } - - @Test - public void setFamilyId() { - String familyId = "family-id"; - - structureDetails.setFamilyId(familyId); - Assert.assertEquals(familyId, structureDetails.getFamilyId()); - } - - @Test - public void getFamilyMembers() { - Set familyMembers = new HashSet<>(); - familyMembers.add("son-junior"); - familyMembers.add("dad-abel"); - - structureDetails.setFamilyMembers(familyMembers); - Assert.assertEquals(familyMembers, structureDetails.getFamilyMembers()); - } - - @Test - public void setFamilyMembers() { - Set familyMembers = new HashSet<>(); - familyMembers.add("son-junior"); - familyMembers.add("dad-abel"); - - structureDetails.setFamilyMembers(familyMembers); - Assert.assertEquals(familyMembers, structureDetails.getFamilyMembers()); - } - - @Test - public void testEquals() { - String structureId = "structure-id"; - - StructureDetails structureDetails2 = new StructureDetails(structureId, "structure-parent-id", "structure"); - structureDetails = new StructureDetails(structureId, "structure-parent-id", "structure"); - - Assert.assertEquals(structureDetails, structureDetails2); - } + private StructureDetails structureDetails; + + @Before + public void setUp() throws Exception { + structureDetails = Mockito.mock(StructureDetails.class, Mockito.CALLS_REAL_METHODS);//new StructureDetails("structure-id", "structure-parent-id", "structure"); + } + + @Test + public void getStructureId() { + String structureId = "structure-id"; + + structureDetails.setStructureId(structureId); + Assert.assertEquals(structureId, structureDetails.getStructureId()); + } + + @Test + public void setStructureId() { + String structureId = "structure-id"; + + structureDetails.setStructureId(structureId); + Assert.assertEquals(structureId, structureDetails.getStructureId()); + } + + @Test + public void getStructureParentId() { + String structureParentId = "structure-parent-id"; + + structureDetails.setStructureParentId(structureParentId); + Assert.assertEquals(structureParentId, structureDetails.getStructureParentId()); + } + + @Test + public void setStructureParentId() { + String structureParentId = "structure-parent-id"; + + structureDetails.setStructureParentId(structureParentId); + Assert.assertEquals(structureParentId, structureDetails.getStructureParentId()); + } + + @Test + public void getStructureType() { + String structureType = "multi-point"; + + structureDetails.setStructureType(structureType); + Assert.assertEquals(structureType, structureDetails.getStructureType()); + } + + @Test + public void setStructureType() { + String structureType = "multi-point"; + + structureDetails.setStructureType(structureType); + Assert.assertEquals(structureType, structureDetails.getStructureType()); + } + + @Test + public void getFamilyId() { + String familyId = "family-id"; + + structureDetails.setFamilyId(familyId); + Assert.assertEquals(familyId, structureDetails.getFamilyId()); + } + + @Test + public void setFamilyId() { + String familyId = "family-id"; + + structureDetails.setFamilyId(familyId); + Assert.assertEquals(familyId, structureDetails.getFamilyId()); + } + + @Test + public void getFamilyMembers() { + Set familyMembers = new HashSet<>(); + familyMembers.add("son-junior"); + familyMembers.add("dad-abel"); + + structureDetails.setFamilyMembers(familyMembers); + Assert.assertEquals(familyMembers, structureDetails.getFamilyMembers()); + } + + @Test + public void setFamilyMembers() { + Set familyMembers = new HashSet<>(); + familyMembers.add("son-junior"); + familyMembers.add("dad-abel"); + + structureDetails.setFamilyMembers(familyMembers); + Assert.assertEquals(familyMembers, structureDetails.getFamilyMembers()); + } + + @Test + public void testEquals() { + String structureId = "structure-id"; + + StructureDetails structureDetails2 = new StructureDetails(structureId, "structure-parent-id", "structure"); + structureDetails = new StructureDetails(structureId, "structure-parent-id", "structure"); + + Assert.assertEquals(structureDetails, structureDetails2); + } } diff --git a/src/test/java/org/opensrp/domain/SubFormDefinitionTest.java b/src/test/java/org/opensrp/domain/SubFormDefinitionTest.java index 3e7f9f01b..996f824f7 100644 --- a/src/test/java/org/opensrp/domain/SubFormDefinitionTest.java +++ b/src/test/java/org/opensrp/domain/SubFormDefinitionTest.java @@ -15,39 +15,39 @@ import org.opensrp.domain.SubFormDefinition; public class SubFormDefinitionTest { - - @Test - @SuppressWarnings("RedundantArrayCreation") - public void shouldCreateUsingDefaultConstructor() { - final Class clazz = SubFormDefinition.class; - final Object obj1 = FormTest.getInstance(clazz, (Object[]) null); - SubFormDefinition subFormDefinition = (SubFormDefinition) obj1; - assertEquals("", subFormDefinition.name()); - Affirm.affirmNotNull("Should have created an object", obj1); - - final Object obj2 = FormTest.getInstance(clazz, new Object[] {}); - subFormDefinition = (SubFormDefinition) obj2; - assertEquals("", subFormDefinition.name()); - Affirm.affirmTrue("Should have created a different object", obj1 != obj2); - } - - @Test - public void testGetterAndSetter() { - Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); - - validator.validate(PojoClassFactory.getPojoClass(SubFormDefinition.class)); - } - - @Test - public void testConstructorWithParameter() { - final Class clazz = SubFormDefinition.class; - final Object obj1 = FormTest.getInstance(clazz, "bind", Collections.EMPTY_LIST); - SubFormDefinition subFormDefinition = (SubFormDefinition) obj1; - Affirm.affirmNotNull("Should have created an object", obj1); - assertEquals("bind", subFormDefinition.name()); - assertEquals(Collections.EMPTY_LIST, subFormDefinition.getFields()); - - final Object obj2 = FormTest.getInstance(clazz, new Object[] {}); - Affirm.affirmTrue("Should have created a different object", obj1 != obj2); - } + + @Test + @SuppressWarnings("RedundantArrayCreation") + public void shouldCreateUsingDefaultConstructor() { + final Class clazz = SubFormDefinition.class; + final Object obj1 = FormTest.getInstance(clazz, (Object[]) null); + SubFormDefinition subFormDefinition = (SubFormDefinition) obj1; + assertEquals("", subFormDefinition.name()); + Affirm.affirmNotNull("Should have created an object", obj1); + + final Object obj2 = FormTest.getInstance(clazz, new Object[]{}); + subFormDefinition = (SubFormDefinition) obj2; + assertEquals("", subFormDefinition.name()); + Affirm.affirmTrue("Should have created a different object", obj1 != obj2); + } + + @Test + public void testGetterAndSetter() { + Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); + + validator.validate(PojoClassFactory.getPojoClass(SubFormDefinition.class)); + } + + @Test + public void testConstructorWithParameter() { + final Class clazz = SubFormDefinition.class; + final Object obj1 = FormTest.getInstance(clazz, "bind", Collections.EMPTY_LIST); + SubFormDefinition subFormDefinition = (SubFormDefinition) obj1; + Affirm.affirmNotNull("Should have created an object", obj1); + assertEquals("bind", subFormDefinition.name()); + assertEquals(Collections.EMPTY_LIST, subFormDefinition.getFields()); + + final Object obj2 = FormTest.getInstance(clazz, new Object[]{}); + Affirm.affirmTrue("Should have created a different object", obj1 != obj2); + } } diff --git a/src/test/java/org/opensrp/domain/UniqueIdTest.java b/src/test/java/org/opensrp/domain/UniqueIdTest.java index ee1aeb505..12321ca78 100644 --- a/src/test/java/org/opensrp/domain/UniqueIdTest.java +++ b/src/test/java/org/opensrp/domain/UniqueIdTest.java @@ -7,17 +7,18 @@ import com.openpojo.validation.ValidatorBuilder; import com.openpojo.validation.test.impl.GetterTester; import com.openpojo.validation.test.impl.SetterTester; + import static org.junit.Assert.assertEquals; public class UniqueIdTest { - - @Test - public void testGetterAndSetter() { - Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); - - validator.validate(PojoClassFactory.getPojoClass(UniqueId.class)); - - assertEquals(19,PojoClassFactory.getPojoClass(UniqueId.class).getPojoFields().size()); - } - + + @Test + public void testGetterAndSetter() { + Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); + + validator.validate(PojoClassFactory.getPojoClass(UniqueId.class)); + + assertEquals(19, PojoClassFactory.getPojoClass(UniqueId.class).getPojoFields().size()); + } + } diff --git a/src/test/java/org/opensrp/domain/postgres/ClientFormExampleTest.java b/src/test/java/org/opensrp/domain/postgres/ClientFormExampleTest.java index d8213e36a..d27695ef1 100644 --- a/src/test/java/org/opensrp/domain/postgres/ClientFormExampleTest.java +++ b/src/test/java/org/opensrp/domain/postgres/ClientFormExampleTest.java @@ -13,134 +13,134 @@ public class ClientFormExampleTest { - @Test - public void testClear() { - ClientFormExample clientFormExample = new ClientFormExample(); - clientFormExample.or(); - clientFormExample.setOrderByClause("date_created DESC"); - clientFormExample.setDistinct(true); - - assertEquals(1, clientFormExample.getOredCriteria().size()); - assertTrue(clientFormExample.isDistinct()); - assertNotNull(clientFormExample.getOrderByClause()); - - clientFormExample.clear(); - - - assertEquals(0, clientFormExample.getOredCriteria().size()); - assertFalse(clientFormExample.isDistinct()); - assertNull(clientFormExample.getOrderByClause()); - } - - @Test - public void testCreateCriteria() { - ClientFormExample clientFormExample = new ClientFormExample(); - clientFormExample.createCriteria(); - - assertEquals(1, clientFormExample.getOredCriteria().size()); - } - - @Test - public void testCriteriaAddIdIsNull() { - ClientFormExample.Criteria criteria = new ClientFormExample.Criteria() - .andIdIsNull(); - - assertEquals("id is null", criteria.getAllCriteria().get(0).getCondition()); - } - - @Test - public void testCriteriaIsValid() { - ClientFormExample.Criteria criteria = new ClientFormExample.Criteria() - .andIdIsNotNull(); - - assertTrue(criteria.isValid()); - } - - @Test - public void testCriterionGetterSetter() { - ClientFormExample.Criterion criterion = new ClientFormExample.Criterion("id =", 1); - - assertTrue(criterion.isSingleValue()); - assertEquals("id =", criterion.getCondition()); - assertNull(criterion.getSecondValue()); - assertFalse(criterion.isNoValue()); - assertFalse(criterion.isBetweenValue()); - assertFalse(criterion.isListValue()); - assertNull(criterion.getTypeHandler()); - } - - @Test - public void testCriterionSecondValueConstructor() { - ClientFormExample.Criterion criterion = new ClientFormExample.Criterion("id in", 1, 2); - - assertFalse(criterion.isSingleValue()); - assertEquals("id in", criterion.getCondition()); - assertEquals(2, criterion.getSecondValue()); - assertFalse(criterion.isNoValue()); - assertTrue(criterion.isBetweenValue()); - assertFalse(criterion.isListValue()); - assertNull(criterion.getTypeHandler()); - } - - @Test(expected = IllegalArgumentException.class) - public void testGeneratedCriteriaAddCriterionThrowsException() { - ClientFormExample.Criteria criteria = new ClientFormExample.Criteria(); - criteria.addCriterion(null); - } - - @Test(expected = IllegalArgumentException.class) - public void testGeneratedCriteriaAddCriterion2ThrowsException() { - ClientFormExample.Criteria criteria = new ClientFormExample.Criteria(); - criteria.addCriterion("id is null", null, "id"); - } - - @Test(expected = IllegalArgumentException.class) - public void testGeneratedCriteriaAddCriterion3ThrowsException() { - ClientFormExample.Criteria criteria = new ClientFormExample.Criteria(); - criteria.addCriterion("id is null", 1, null, "id"); - } - - @Test - public void testGeneratedCriteriaBuilder() { - // If the builder changes/fails, there should be an NPE - List idsList = new ArrayList<>(); - idsList.add(22L); - idsList.add(24L); - idsList.add(26L); - - List idsExcludeList = new ArrayList<>(); - idsExcludeList.add(17L); - idsExcludeList.add(18L); - - ClientFormExample.Criteria criteria = new ClientFormExample.Criteria() - .andIdEqualTo(1L) - .andIdEqualTo(2L) - .andIdEqualTo(4L) - .andIdNotEqualTo(3L) - .andIdGreaterThan(8L) - .andIdLessThan(11L) - .andIdGreaterThanOrEqualTo(15L) - .andIdLessThanOrEqualTo(20L) - .andIdIn(idsList) - .andIdNotIn(idsExcludeList) - .andIdBetween(50L, 53L) - .andJsonIsNotNull() - .andCreatedAtIsNotNull(); - - assertEquals(13, criteria.getAllCriteria().size()); - } - - @Test - public void testGeneratedCriteriaBuilder2() { - // If the builder changes/fails, there should be an NPE - - ClientFormExample.Criteria criteria = new ClientFormExample.Criteria() - .andJsonIsNull() - .andJsonEqualTo("null") - .andJsonNotEqualTo("{}") - .andJsonGreaterThan("") - .andJsonGreaterThanOrEqualTo("{'property': 'empty'}"); - - assertEquals(5, criteria.getAllCriteria().size()); - } + @Test + public void testClear() { + ClientFormExample clientFormExample = new ClientFormExample(); + clientFormExample.or(); + clientFormExample.setOrderByClause("date_created DESC"); + clientFormExample.setDistinct(true); + + assertEquals(1, clientFormExample.getOredCriteria().size()); + assertTrue(clientFormExample.isDistinct()); + assertNotNull(clientFormExample.getOrderByClause()); + + clientFormExample.clear(); + + + assertEquals(0, clientFormExample.getOredCriteria().size()); + assertFalse(clientFormExample.isDistinct()); + assertNull(clientFormExample.getOrderByClause()); + } + + @Test + public void testCreateCriteria() { + ClientFormExample clientFormExample = new ClientFormExample(); + clientFormExample.createCriteria(); + + assertEquals(1, clientFormExample.getOredCriteria().size()); + } + + @Test + public void testCriteriaAddIdIsNull() { + ClientFormExample.Criteria criteria = new ClientFormExample.Criteria() + .andIdIsNull(); + + assertEquals("id is null", criteria.getAllCriteria().get(0).getCondition()); + } + + @Test + public void testCriteriaIsValid() { + ClientFormExample.Criteria criteria = new ClientFormExample.Criteria() + .andIdIsNotNull(); + + assertTrue(criteria.isValid()); + } + + @Test + public void testCriterionGetterSetter() { + ClientFormExample.Criterion criterion = new ClientFormExample.Criterion("id =", 1); + + assertTrue(criterion.isSingleValue()); + assertEquals("id =", criterion.getCondition()); + assertNull(criterion.getSecondValue()); + assertFalse(criterion.isNoValue()); + assertFalse(criterion.isBetweenValue()); + assertFalse(criterion.isListValue()); + assertNull(criterion.getTypeHandler()); + } + + @Test + public void testCriterionSecondValueConstructor() { + ClientFormExample.Criterion criterion = new ClientFormExample.Criterion("id in", 1, 2); + + assertFalse(criterion.isSingleValue()); + assertEquals("id in", criterion.getCondition()); + assertEquals(2, criterion.getSecondValue()); + assertFalse(criterion.isNoValue()); + assertTrue(criterion.isBetweenValue()); + assertFalse(criterion.isListValue()); + assertNull(criterion.getTypeHandler()); + } + + @Test(expected = IllegalArgumentException.class) + public void testGeneratedCriteriaAddCriterionThrowsException() { + ClientFormExample.Criteria criteria = new ClientFormExample.Criteria(); + criteria.addCriterion(null); + } + + @Test(expected = IllegalArgumentException.class) + public void testGeneratedCriteriaAddCriterion2ThrowsException() { + ClientFormExample.Criteria criteria = new ClientFormExample.Criteria(); + criteria.addCriterion("id is null", null, "id"); + } + + @Test(expected = IllegalArgumentException.class) + public void testGeneratedCriteriaAddCriterion3ThrowsException() { + ClientFormExample.Criteria criteria = new ClientFormExample.Criteria(); + criteria.addCriterion("id is null", 1, null, "id"); + } + + @Test + public void testGeneratedCriteriaBuilder() { + // If the builder changes/fails, there should be an NPE + List idsList = new ArrayList<>(); + idsList.add(22L); + idsList.add(24L); + idsList.add(26L); + + List idsExcludeList = new ArrayList<>(); + idsExcludeList.add(17L); + idsExcludeList.add(18L); + + ClientFormExample.Criteria criteria = new ClientFormExample.Criteria() + .andIdEqualTo(1L) + .andIdEqualTo(2L) + .andIdEqualTo(4L) + .andIdNotEqualTo(3L) + .andIdGreaterThan(8L) + .andIdLessThan(11L) + .andIdGreaterThanOrEqualTo(15L) + .andIdLessThanOrEqualTo(20L) + .andIdIn(idsList) + .andIdNotIn(idsExcludeList) + .andIdBetween(50L, 53L) + .andJsonIsNotNull() + .andCreatedAtIsNotNull(); + + assertEquals(13, criteria.getAllCriteria().size()); + } + + @Test + public void testGeneratedCriteriaBuilder2() { + // If the builder changes/fails, there should be an NPE + + ClientFormExample.Criteria criteria = new ClientFormExample.Criteria() + .andJsonIsNull() + .andJsonEqualTo("null") + .andJsonNotEqualTo("{}") + .andJsonGreaterThan("") + .andJsonGreaterThanOrEqualTo("{'property': 'empty'}"); + + assertEquals(5, criteria.getAllCriteria().size()); + } } diff --git a/src/test/java/org/opensrp/domain/postgres/ClientFormMetadataExampleTest.java b/src/test/java/org/opensrp/domain/postgres/ClientFormMetadataExampleTest.java index ffea15d29..1eb77f415 100644 --- a/src/test/java/org/opensrp/domain/postgres/ClientFormMetadataExampleTest.java +++ b/src/test/java/org/opensrp/domain/postgres/ClientFormMetadataExampleTest.java @@ -13,197 +13,197 @@ public class ClientFormMetadataExampleTest { - @Test - public void testClear() { - ClientFormMetadataExample clientFormMetadataExample = new ClientFormMetadataExample(); - clientFormMetadataExample.or(); - clientFormMetadataExample.setOrderByClause("date_created DESC"); - clientFormMetadataExample.setDistinct(true); - - assertEquals(1, clientFormMetadataExample.getOredCriteria().size()); - assertTrue(clientFormMetadataExample.isDistinct()); - assertNotNull(clientFormMetadataExample.getOrderByClause()); - - clientFormMetadataExample.clear(); - - assertEquals(0, clientFormMetadataExample.getOredCriteria().size()); - assertFalse(clientFormMetadataExample.isDistinct()); - assertNull(clientFormMetadataExample.getOrderByClause()); - } - - @Test - public void testCreateCriteria() { - ClientFormMetadataExample ClientFormMetadataExample = new ClientFormMetadataExample(); - ClientFormMetadataExample.createCriteria(); - - assertEquals(1, ClientFormMetadataExample.getOredCriteria().size()); - } - - @Test - public void testCriteriaAddIdIsNull() { - ClientFormMetadataExample.Criteria criteria = new ClientFormMetadataExample.Criteria() - .andIdIsNull(); - - assertEquals("id is null", criteria.getAllCriteria().get(0).getCondition()); - } - - @Test - public void testCriteriaIsValid() { - ClientFormMetadataExample.Criteria criteria = new ClientFormMetadataExample.Criteria() - .andIdIsNotNull(); - - assertTrue(criteria.isValid()); - } - - @Test - public void testCriterionGetterSetter() { - ClientFormMetadataExample.Criterion criterion = new ClientFormMetadataExample.Criterion("id =", 1); - - assertTrue(criterion.isSingleValue()); - assertEquals("id =", criterion.getCondition()); - assertNull(criterion.getSecondValue()); - assertFalse(criterion.isNoValue()); - assertFalse(criterion.isBetweenValue()); - assertFalse(criterion.isListValue()); - assertNull(criterion.getTypeHandler()); - } - - @Test - public void testCriterionSecondValueConstructor() { - ClientFormMetadataExample.Criterion criterion = new ClientFormMetadataExample.Criterion("id in", 1, 2); - - assertFalse(criterion.isSingleValue()); - assertEquals("id in", criterion.getCondition()); - assertEquals(2, criterion.getSecondValue()); - assertFalse(criterion.isNoValue()); - assertTrue(criterion.isBetweenValue()); - assertFalse(criterion.isListValue()); - assertNull(criterion.getTypeHandler()); - } - - @Test(expected = IllegalArgumentException.class) - public void testGeneratedCriteriaAddCriterionThrowsException() { - ClientFormMetadataExample.Criteria criteria = new ClientFormMetadataExample.Criteria(); - criteria.addCriterion(null); - } - - @Test(expected = IllegalArgumentException.class) - public void testGeneratedCriteriaAddCriterion2ThrowsException() { - ClientFormMetadataExample.Criteria criteria = new ClientFormMetadataExample.Criteria(); - criteria.addCriterion("id is null", null, "id"); - } - - @Test(expected = IllegalArgumentException.class) - public void testGeneratedCriteriaAddCriterion3ThrowsException() { - ClientFormMetadataExample.Criteria criteria = new ClientFormMetadataExample.Criteria(); - criteria.addCriterion("id is null", 1, null, "id"); - } - - @Test - public void testGeneratedCriteriaBuilder() { - // If the builder changes/fails, there should be an NPE - List idsList = new ArrayList<>(); - idsList.add(22L); - idsList.add(24L); - idsList.add(26L); - - List idsExcludeList = new ArrayList<>(); - idsExcludeList.add(17L); - idsExcludeList.add(18L); - - ClientFormMetadataExample.Criteria criteria = new ClientFormMetadataExample.Criteria() - .andIdEqualTo(1L) - .andIdEqualTo(2L) - .andIdEqualTo(4L) - .andIdNotEqualTo(3L) - .andIdGreaterThan(8L) - .andIdLessThan(11L) - .andIdGreaterThanOrEqualTo(15L) - .andIdLessThanOrEqualTo(20L) - .andIdIn(idsList) - .andIdNotIn(idsExcludeList) - .andIdBetween(50L, 53L) - .andCreatedAtIsNotNull(); - - assertEquals(12, criteria.getAllCriteria().size()); - } - - @Test - public void testGeneratedCriteriaBuilder2() { - // If the builder changes/fails, there should be an NPE - - ClientFormMetadataExample.Criteria criteria = new ClientFormMetadataExample.Criteria() - .andIdentifierIsNull() - .andIdentifierIsNotNull() - .andIdentifierEqualTo("anc/json") - .andIdentifierNotEqualTo("maternity/json") - .andIdentifierGreaterThan("anc/json") - .andIdentifierGreaterThanOrEqualTo("child/json") - .andIdentifierLessThan("child/json") - .andIdentifierLessThanOrEqualTo("child/json") - .andIdentifierLike("child/json") - .andIdentifierNotLike("child/json") - .andIdentifierIn(new ArrayList<>()) - .andIdentifierNotIn(new ArrayList<>()) - .andIdentifierBetween("1", "10") - .andIdentifierNotBetween("4", "7") - .andJurisdictionIsNotNull() - .andJurisdictionIsNull() - .andJurisdictionEqualTo("kenya") - .andJurisdictionNotEqualTo("kenya") - .andJurisdictionNotBetween("rwanda", "uganda") - .andJurisdictionLessThan("sa") - .andJurisdictionLessThanOrEqualTo("sa") - .andJurisdictionGreaterThan("sa") - .andJurisdictionGreaterThanOrEqualTo("sa") - .andJurisdictionLike("%a%") - .andJurisdictionNotLike("%a%") - .andJurisdictionIn(new ArrayList<>()) - .andJurisdictionNotIn(new ArrayList<>()) - .andJurisdictionBetween("a", "z") - .andJurisdictionNotBetween("ba", "chw") - .andVersionIsNull() - .andVersionIsNotNull() - .andVersionEqualTo("0.0.1") - .andVersionNotEqualTo("0.0.2") - .andVersionGreaterThan("0.0.3") - .andVersionGreaterThanOrEqualTo("0.0.3") - .andIsDraftIsNull() - .andIsDraftIsNotNull() - .andIsDraftEqualTo(true) - .andIsDraftGreaterThan(false) - .andIsDraftGreaterThanOrEqualTo(false) - .andIsDraftLessThan(true) - .andIsDraftLessThan(true) - .andIsDraftLessThanOrEqualTo(true) - .andIsDraftIn(new ArrayList<>()) - .andIsDraftBetween(true, false) - .andIsDraftNotBetween(true, false) - .andIsJsonValidatorIsNull() - .andIsJsonValidatorIsNotNull() - .andIsJsonValidatorEqualTo(true) - .andIsJsonValidatorNotEqualTo(true) - .andIsJsonValidatorGreaterThan(false) - .andIsJsonValidatorGreaterThanOrEqualTo(false) - .andIsJsonValidatorLessThan(true) - .andIsJsonValidatorLessThanOrEqualTo(true) - .andIsJsonValidatorIn(new ArrayList<>()) - .andIsJsonValidatorNotIn(new ArrayList<>()) - .andRelationIsNull() - .andRelationIsNotNull() - .andRelationEqualTo("anc/child.json") - .andRelationLike("%a%") - .andRelationNotLike("%a%") - .andRelationIn(new ArrayList<>()) - .andRelationNotIn(new ArrayList<>()) - .andRelationBetween("child", "registration") - .andRelationNotBetween("child", "registration") - .andRelationLessThan("child") - .andRelationLessThanOrEqualTo("child") - .andRelationGreaterThan("child") - .andRelationGreaterThanOrEqualTo("child"); - - assertEquals(69, criteria.getAllCriteria().size()); - } + @Test + public void testClear() { + ClientFormMetadataExample clientFormMetadataExample = new ClientFormMetadataExample(); + clientFormMetadataExample.or(); + clientFormMetadataExample.setOrderByClause("date_created DESC"); + clientFormMetadataExample.setDistinct(true); + + assertEquals(1, clientFormMetadataExample.getOredCriteria().size()); + assertTrue(clientFormMetadataExample.isDistinct()); + assertNotNull(clientFormMetadataExample.getOrderByClause()); + + clientFormMetadataExample.clear(); + + assertEquals(0, clientFormMetadataExample.getOredCriteria().size()); + assertFalse(clientFormMetadataExample.isDistinct()); + assertNull(clientFormMetadataExample.getOrderByClause()); + } + + @Test + public void testCreateCriteria() { + ClientFormMetadataExample ClientFormMetadataExample = new ClientFormMetadataExample(); + ClientFormMetadataExample.createCriteria(); + + assertEquals(1, ClientFormMetadataExample.getOredCriteria().size()); + } + + @Test + public void testCriteriaAddIdIsNull() { + ClientFormMetadataExample.Criteria criteria = new ClientFormMetadataExample.Criteria() + .andIdIsNull(); + + assertEquals("id is null", criteria.getAllCriteria().get(0).getCondition()); + } + + @Test + public void testCriteriaIsValid() { + ClientFormMetadataExample.Criteria criteria = new ClientFormMetadataExample.Criteria() + .andIdIsNotNull(); + + assertTrue(criteria.isValid()); + } + + @Test + public void testCriterionGetterSetter() { + ClientFormMetadataExample.Criterion criterion = new ClientFormMetadataExample.Criterion("id =", 1); + + assertTrue(criterion.isSingleValue()); + assertEquals("id =", criterion.getCondition()); + assertNull(criterion.getSecondValue()); + assertFalse(criterion.isNoValue()); + assertFalse(criterion.isBetweenValue()); + assertFalse(criterion.isListValue()); + assertNull(criterion.getTypeHandler()); + } + + @Test + public void testCriterionSecondValueConstructor() { + ClientFormMetadataExample.Criterion criterion = new ClientFormMetadataExample.Criterion("id in", 1, 2); + + assertFalse(criterion.isSingleValue()); + assertEquals("id in", criterion.getCondition()); + assertEquals(2, criterion.getSecondValue()); + assertFalse(criterion.isNoValue()); + assertTrue(criterion.isBetweenValue()); + assertFalse(criterion.isListValue()); + assertNull(criterion.getTypeHandler()); + } + + @Test(expected = IllegalArgumentException.class) + public void testGeneratedCriteriaAddCriterionThrowsException() { + ClientFormMetadataExample.Criteria criteria = new ClientFormMetadataExample.Criteria(); + criteria.addCriterion(null); + } + + @Test(expected = IllegalArgumentException.class) + public void testGeneratedCriteriaAddCriterion2ThrowsException() { + ClientFormMetadataExample.Criteria criteria = new ClientFormMetadataExample.Criteria(); + criteria.addCriterion("id is null", null, "id"); + } + + @Test(expected = IllegalArgumentException.class) + public void testGeneratedCriteriaAddCriterion3ThrowsException() { + ClientFormMetadataExample.Criteria criteria = new ClientFormMetadataExample.Criteria(); + criteria.addCriterion("id is null", 1, null, "id"); + } + + @Test + public void testGeneratedCriteriaBuilder() { + // If the builder changes/fails, there should be an NPE + List idsList = new ArrayList<>(); + idsList.add(22L); + idsList.add(24L); + idsList.add(26L); + + List idsExcludeList = new ArrayList<>(); + idsExcludeList.add(17L); + idsExcludeList.add(18L); + + ClientFormMetadataExample.Criteria criteria = new ClientFormMetadataExample.Criteria() + .andIdEqualTo(1L) + .andIdEqualTo(2L) + .andIdEqualTo(4L) + .andIdNotEqualTo(3L) + .andIdGreaterThan(8L) + .andIdLessThan(11L) + .andIdGreaterThanOrEqualTo(15L) + .andIdLessThanOrEqualTo(20L) + .andIdIn(idsList) + .andIdNotIn(idsExcludeList) + .andIdBetween(50L, 53L) + .andCreatedAtIsNotNull(); + + assertEquals(12, criteria.getAllCriteria().size()); + } + + @Test + public void testGeneratedCriteriaBuilder2() { + // If the builder changes/fails, there should be an NPE + + ClientFormMetadataExample.Criteria criteria = new ClientFormMetadataExample.Criteria() + .andIdentifierIsNull() + .andIdentifierIsNotNull() + .andIdentifierEqualTo("anc/json") + .andIdentifierNotEqualTo("maternity/json") + .andIdentifierGreaterThan("anc/json") + .andIdentifierGreaterThanOrEqualTo("child/json") + .andIdentifierLessThan("child/json") + .andIdentifierLessThanOrEqualTo("child/json") + .andIdentifierLike("child/json") + .andIdentifierNotLike("child/json") + .andIdentifierIn(new ArrayList<>()) + .andIdentifierNotIn(new ArrayList<>()) + .andIdentifierBetween("1", "10") + .andIdentifierNotBetween("4", "7") + .andJurisdictionIsNotNull() + .andJurisdictionIsNull() + .andJurisdictionEqualTo("kenya") + .andJurisdictionNotEqualTo("kenya") + .andJurisdictionNotBetween("rwanda", "uganda") + .andJurisdictionLessThan("sa") + .andJurisdictionLessThanOrEqualTo("sa") + .andJurisdictionGreaterThan("sa") + .andJurisdictionGreaterThanOrEqualTo("sa") + .andJurisdictionLike("%a%") + .andJurisdictionNotLike("%a%") + .andJurisdictionIn(new ArrayList<>()) + .andJurisdictionNotIn(new ArrayList<>()) + .andJurisdictionBetween("a", "z") + .andJurisdictionNotBetween("ba", "chw") + .andVersionIsNull() + .andVersionIsNotNull() + .andVersionEqualTo("0.0.1") + .andVersionNotEqualTo("0.0.2") + .andVersionGreaterThan("0.0.3") + .andVersionGreaterThanOrEqualTo("0.0.3") + .andIsDraftIsNull() + .andIsDraftIsNotNull() + .andIsDraftEqualTo(true) + .andIsDraftGreaterThan(false) + .andIsDraftGreaterThanOrEqualTo(false) + .andIsDraftLessThan(true) + .andIsDraftLessThan(true) + .andIsDraftLessThanOrEqualTo(true) + .andIsDraftIn(new ArrayList<>()) + .andIsDraftBetween(true, false) + .andIsDraftNotBetween(true, false) + .andIsJsonValidatorIsNull() + .andIsJsonValidatorIsNotNull() + .andIsJsonValidatorEqualTo(true) + .andIsJsonValidatorNotEqualTo(true) + .andIsJsonValidatorGreaterThan(false) + .andIsJsonValidatorGreaterThanOrEqualTo(false) + .andIsJsonValidatorLessThan(true) + .andIsJsonValidatorLessThanOrEqualTo(true) + .andIsJsonValidatorIn(new ArrayList<>()) + .andIsJsonValidatorNotIn(new ArrayList<>()) + .andRelationIsNull() + .andRelationIsNotNull() + .andRelationEqualTo("anc/child.json") + .andRelationLike("%a%") + .andRelationNotLike("%a%") + .andRelationIn(new ArrayList<>()) + .andRelationNotIn(new ArrayList<>()) + .andRelationBetween("child", "registration") + .andRelationNotBetween("child", "registration") + .andRelationLessThan("child") + .andRelationLessThanOrEqualTo("child") + .andRelationGreaterThan("child") + .andRelationGreaterThanOrEqualTo("child"); + + assertEquals(69, criteria.getAllCriteria().size()); + } } diff --git a/src/test/java/org/opensrp/domain/postgres/ClientMigrationFileExampleTest.java b/src/test/java/org/opensrp/domain/postgres/ClientMigrationFileExampleTest.java index 7597a1c9e..a56fa9cef 100644 --- a/src/test/java/org/opensrp/domain/postgres/ClientMigrationFileExampleTest.java +++ b/src/test/java/org/opensrp/domain/postgres/ClientMigrationFileExampleTest.java @@ -14,119 +14,119 @@ public class ClientMigrationFileExampleTest { - @Test - public void testClear() { - ClientMigrationFileExample clientMigrationFileExample = new ClientMigrationFileExample(); - clientMigrationFileExample.or(); - clientMigrationFileExample.setOrderByClause("date_created DESC"); - clientMigrationFileExample.setDistinct(true); - - assertEquals(1, clientMigrationFileExample.getOredCriteria().size()); - assertTrue(clientMigrationFileExample.isDistinct()); - assertNotNull(clientMigrationFileExample.getOrderByClause()); - - clientMigrationFileExample.clear(); - - - assertEquals(0, clientMigrationFileExample.getOredCriteria().size()); - assertFalse(clientMigrationFileExample.isDistinct()); - assertNull(clientMigrationFileExample.getOrderByClause()); - } - - @Test - public void testCreateCriteria() { - ClientMigrationFileExample clientMigrationFileExample = new ClientMigrationFileExample(); - clientMigrationFileExample.createCriteria(); - - assertEquals(1, clientMigrationFileExample.getOredCriteria().size()); - } - - @Test - public void testCriteriaAddIdIsNull() { - ClientMigrationFileExample.Criteria criteria = new ClientMigrationFileExample.Criteria() - .andIdIsNull(); - - assertEquals("id is null", criteria.getAllCriteria().get(0).getCondition()); - } - - @Test - public void testCriteriaIsValid() { - ClientMigrationFileExample.Criteria criteria = new ClientMigrationFileExample.Criteria() - .andIdIsNotNull(); - - assertTrue(criteria.isValid()); - } - - @Test - public void testCriterionGetterSetter() { - ClientMigrationFileExample.Criterion criterion = new ClientMigrationFileExample.Criterion("id =", 1); - - assertTrue(criterion.isSingleValue()); - assertEquals("id =", criterion.getCondition()); - assertNull(criterion.getSecondValue()); - assertFalse(criterion.isNoValue()); - assertFalse(criterion.isBetweenValue()); - assertFalse(criterion.isListValue()); - assertNull(criterion.getTypeHandler()); - } - - @Test - public void testCriterionSecondValueConstructor() { - ClientMigrationFileExample.Criterion criterion = new ClientMigrationFileExample.Criterion("id in", 1, 2); - - assertFalse(criterion.isSingleValue()); - assertEquals("id in", criterion.getCondition()); - assertEquals(2, criterion.getSecondValue()); - assertFalse(criterion.isNoValue()); - assertTrue(criterion.isBetweenValue()); - assertFalse(criterion.isListValue()); - assertNull(criterion.getTypeHandler()); - } - - @Test(expected = IllegalArgumentException.class) - public void testGeneratedCriteriaAddCriterionThrowsException() { - ClientMigrationFileExample.Criteria criteria = new ClientMigrationFileExample.Criteria(); - criteria.addCriterion(null); - } - - @Test(expected = IllegalArgumentException.class) - public void testGeneratedCriteriaAddCriterion2ThrowsException() { - ClientMigrationFileExample.Criteria criteria = new ClientMigrationFileExample.Criteria(); - criteria.addCriterion("id is null", null, "id"); - } - - @Test(expected = IllegalArgumentException.class) - public void testGeneratedCriteriaAddCriterion3ThrowsException() { - ClientMigrationFileExample.Criteria criteria = new ClientMigrationFileExample.Criteria(); - criteria.addCriterion("id is null", 1, null, "id"); - } - - @Test - public void testGeneratedCriteriaBuilder() { - // If the builder changes/fails, there should be an NPE - List idsList = new ArrayList<>(); - idsList.add(22L); - idsList.add(24L); - idsList.add(26L); - - List idsExcludeList = new ArrayList<>(); - idsExcludeList.add(17L); - idsExcludeList.add(18L); - - ClientMigrationFileExample.Criteria criteria = new ClientMigrationFileExample.Criteria() - .andIdEqualTo(1L) - .andIdEqualTo(2L) - .andIdEqualTo(4L) - .andIdNotEqualTo(3L) - .andIdGreaterThan(8L) - .andIdLessThan(11L) - .andIdGreaterThanOrEqualTo(15L) - .andIdLessThanOrEqualTo(20L) - .andIdIn(idsList) - .andIdNotIn(idsExcludeList) - .andIdBetween(50L, 53L) - .andCreatedAtIsNotNull(); - - assertEquals(12, criteria.getAllCriteria().size()); - } + @Test + public void testClear() { + ClientMigrationFileExample clientMigrationFileExample = new ClientMigrationFileExample(); + clientMigrationFileExample.or(); + clientMigrationFileExample.setOrderByClause("date_created DESC"); + clientMigrationFileExample.setDistinct(true); + + assertEquals(1, clientMigrationFileExample.getOredCriteria().size()); + assertTrue(clientMigrationFileExample.isDistinct()); + assertNotNull(clientMigrationFileExample.getOrderByClause()); + + clientMigrationFileExample.clear(); + + + assertEquals(0, clientMigrationFileExample.getOredCriteria().size()); + assertFalse(clientMigrationFileExample.isDistinct()); + assertNull(clientMigrationFileExample.getOrderByClause()); + } + + @Test + public void testCreateCriteria() { + ClientMigrationFileExample clientMigrationFileExample = new ClientMigrationFileExample(); + clientMigrationFileExample.createCriteria(); + + assertEquals(1, clientMigrationFileExample.getOredCriteria().size()); + } + + @Test + public void testCriteriaAddIdIsNull() { + ClientMigrationFileExample.Criteria criteria = new ClientMigrationFileExample.Criteria() + .andIdIsNull(); + + assertEquals("id is null", criteria.getAllCriteria().get(0).getCondition()); + } + + @Test + public void testCriteriaIsValid() { + ClientMigrationFileExample.Criteria criteria = new ClientMigrationFileExample.Criteria() + .andIdIsNotNull(); + + assertTrue(criteria.isValid()); + } + + @Test + public void testCriterionGetterSetter() { + ClientMigrationFileExample.Criterion criterion = new ClientMigrationFileExample.Criterion("id =", 1); + + assertTrue(criterion.isSingleValue()); + assertEquals("id =", criterion.getCondition()); + assertNull(criterion.getSecondValue()); + assertFalse(criterion.isNoValue()); + assertFalse(criterion.isBetweenValue()); + assertFalse(criterion.isListValue()); + assertNull(criterion.getTypeHandler()); + } + + @Test + public void testCriterionSecondValueConstructor() { + ClientMigrationFileExample.Criterion criterion = new ClientMigrationFileExample.Criterion("id in", 1, 2); + + assertFalse(criterion.isSingleValue()); + assertEquals("id in", criterion.getCondition()); + assertEquals(2, criterion.getSecondValue()); + assertFalse(criterion.isNoValue()); + assertTrue(criterion.isBetweenValue()); + assertFalse(criterion.isListValue()); + assertNull(criterion.getTypeHandler()); + } + + @Test(expected = IllegalArgumentException.class) + public void testGeneratedCriteriaAddCriterionThrowsException() { + ClientMigrationFileExample.Criteria criteria = new ClientMigrationFileExample.Criteria(); + criteria.addCriterion(null); + } + + @Test(expected = IllegalArgumentException.class) + public void testGeneratedCriteriaAddCriterion2ThrowsException() { + ClientMigrationFileExample.Criteria criteria = new ClientMigrationFileExample.Criteria(); + criteria.addCriterion("id is null", null, "id"); + } + + @Test(expected = IllegalArgumentException.class) + public void testGeneratedCriteriaAddCriterion3ThrowsException() { + ClientMigrationFileExample.Criteria criteria = new ClientMigrationFileExample.Criteria(); + criteria.addCriterion("id is null", 1, null, "id"); + } + + @Test + public void testGeneratedCriteriaBuilder() { + // If the builder changes/fails, there should be an NPE + List idsList = new ArrayList<>(); + idsList.add(22L); + idsList.add(24L); + idsList.add(26L); + + List idsExcludeList = new ArrayList<>(); + idsExcludeList.add(17L); + idsExcludeList.add(18L); + + ClientMigrationFileExample.Criteria criteria = new ClientMigrationFileExample.Criteria() + .andIdEqualTo(1L) + .andIdEqualTo(2L) + .andIdEqualTo(4L) + .andIdNotEqualTo(3L) + .andIdGreaterThan(8L) + .andIdLessThan(11L) + .andIdGreaterThanOrEqualTo(15L) + .andIdLessThanOrEqualTo(20L) + .andIdIn(idsList) + .andIdNotIn(idsExcludeList) + .andIdBetween(50L, 53L) + .andCreatedAtIsNotNull(); + + assertEquals(12, criteria.getAllCriteria().size()); + } } diff --git a/src/test/java/org/opensrp/generator/LuhnIdentifierValidatorTest.java b/src/test/java/org/opensrp/generator/LuhnIdentifierValidatorTest.java index b31d652c9..234f37cb7 100644 --- a/src/test/java/org/opensrp/generator/LuhnIdentifierValidatorTest.java +++ b/src/test/java/org/opensrp/generator/LuhnIdentifierValidatorTest.java @@ -6,38 +6,38 @@ public class LuhnIdentifierValidatorTest { - @Test(expected = UnallowedIdentifierException.class) - public void testGetCheckDigitWithEmptyId() { - LuhnIdentifierValidator luhnIdentifierValidator = new LuhnIdentifierValidator(); - luhnIdentifierValidator.getValidIdentifier("",createIdentifierSource()); - } + @Test(expected = UnallowedIdentifierException.class) + public void testGetCheckDigitWithEmptyId() { + LuhnIdentifierValidator luhnIdentifierValidator = new LuhnIdentifierValidator(); + luhnIdentifierValidator.getValidIdentifier("", createIdentifierSource()); + } - @Test(expected = UnallowedIdentifierException.class) - public void testGetCheckDigitWithNull() { - LuhnIdentifierValidator luhnIdentifierValidator = new LuhnIdentifierValidator(); - luhnIdentifierValidator.getValidIdentifier(null,createIdentifierSource()); - } + @Test(expected = UnallowedIdentifierException.class) + public void testGetCheckDigitWithNull() { + LuhnIdentifierValidator luhnIdentifierValidator = new LuhnIdentifierValidator(); + luhnIdentifierValidator.getValidIdentifier(null, createIdentifierSource()); + } - @Test(expected = UnallowedIdentifierException.class) - public void testGetCheckDigitWithWhiteSpaces() { - LuhnIdentifierValidator luhnIdentifierValidator = new LuhnIdentifierValidator(); - luhnIdentifierValidator.getValidIdentifier("A B12",createIdentifierSource()); - } + @Test(expected = UnallowedIdentifierException.class) + public void testGetCheckDigitWithWhiteSpaces() { + LuhnIdentifierValidator luhnIdentifierValidator = new LuhnIdentifierValidator(); + luhnIdentifierValidator.getValidIdentifier("A B12", createIdentifierSource()); + } - @Test(expected = UnallowedIdentifierException.class) - public void testGetCheckDigitWithIncorrectId() { - LuhnIdentifierValidator luhnIdentifierValidator = new LuhnIdentifierValidator(); - luhnIdentifierValidator.getValidIdentifier("aB12",createIdentifierSource()); - } + @Test(expected = UnallowedIdentifierException.class) + public void testGetCheckDigitWithIncorrectId() { + LuhnIdentifierValidator luhnIdentifierValidator = new LuhnIdentifierValidator(); + luhnIdentifierValidator.getValidIdentifier("aB12", createIdentifierSource()); + } - private IdentifierSource createIdentifierSource() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setId(1l); - identifierSource.setIdentifier("Test-1"); - identifierSource.setBaseCharacterSet("AB12"); - identifierSource.setFirstIdentifierBase("ab12"); - identifierSource.setMinLength(4); - identifierSource.setMaxLength(4); - return identifierSource; - } + private IdentifierSource createIdentifierSource() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setId(1l); + identifierSource.setIdentifier("Test-1"); + identifierSource.setBaseCharacterSet("AB12"); + identifierSource.setFirstIdentifierBase("ab12"); + identifierSource.setMinLength(4); + identifierSource.setMaxLength(4); + return identifierSource; + } } diff --git a/src/test/java/org/opensrp/generator/UniqueIdGeneratorProcessorTest.java b/src/test/java/org/opensrp/generator/UniqueIdGeneratorProcessorTest.java index adf5a8e8d..cf0332154 100644 --- a/src/test/java/org/opensrp/generator/UniqueIdGeneratorProcessorTest.java +++ b/src/test/java/org/opensrp/generator/UniqueIdGeneratorProcessorTest.java @@ -24,242 +24,241 @@ public class UniqueIdGeneratorProcessorTest { - @Mock - private UniqueIdRepository uniqueIdRepository; + @Mock + private UniqueIdRepository uniqueIdRepository; - @Mock - private IdentifierSourceService identifierSourceService; + @Mock + private IdentifierSourceService identifierSourceService; - private UniqueIdGeneratorProcessor uniqueIdGeneratorProcessor; + private UniqueIdGeneratorProcessor uniqueIdGeneratorProcessor; - @Before - public void setUp() { - initMocks(this); - uniqueIdGeneratorProcessor = new UniqueIdGeneratorProcessor(uniqueIdRepository, identifierSourceService); - } + @Before + public void setUp() { + initMocks(this); + uniqueIdGeneratorProcessor = new UniqueIdGeneratorProcessor(uniqueIdRepository, identifierSourceService); + } - @Test - public void testGetIdentifiers() { - Set reservedIds = new HashSet<>(); - when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); - when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); - doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); - Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); - List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSource(),5,""); - assertTrue(ids.get(0).contains("-")); //Ensure check digit implementation - } + @Test + public void testGetIdentifiers() { + Set reservedIds = new HashSet<>(); + when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); + when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); + doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); + Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); + List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSource(), 5, ""); + assertTrue(ids.get(0).contains("-")); //Ensure check digit implementation + } - @Test - public void testGetIdentifiersWithFirstIdentifierBase() { - Set reservedIds = new HashSet<>(); - when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(null); - when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); - doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); - Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); - List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceV2(),5,""); - assertTrue(ids.get(0).contains("-")); //Ensure check digit implementation - assertTrue(ids.get(0).contains("AA11")); //Ensure first identifier base is returned as it is - } + @Test + public void testGetIdentifiersWithFirstIdentifierBase() { + Set reservedIds = new HashSet<>(); + when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(null); + when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); + doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); + Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); + List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceV2(), 5, ""); + assertTrue(ids.get(0).contains("-")); //Ensure check digit implementation + assertTrue(ids.get(0).contains("AA11")); //Ensure first identifier base is returned as it is + } - @Test(expected = IllegalArgumentException.class) - public void testGetIdentifiersWithInvalidFirstIdentifierBase() { - Set reservedIds = new HashSet<>(); - when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(null); - when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); - doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); - Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); - uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceV3(),5,""); - } + @Test(expected = IllegalArgumentException.class) + public void testGetIdentifiersWithInvalidFirstIdentifierBase() { + Set reservedIds = new HashSet<>(); + when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(null); + when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); + doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); + Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); + uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceV3(), 5, ""); + } - @Test - public void testGetIdentifiersWithIdSourceA() { - Set reservedIds = new HashSet<>(); - when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); - when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); - doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); - Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); - List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceA(),5,""); - assertEquals(ids.size(),5); - } + @Test + public void testGetIdentifiersWithIdSourceA() { + Set reservedIds = new HashSet<>(); + when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); + when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); + doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); + Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); + List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceA(), 5, ""); + assertEquals(ids.size(), 5); + } - @Test - public void testGetIdentifiersWithIdSourceB() { - Set reservedIds = new HashSet<>(); - when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); - when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); - doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); - Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); - List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceB(),5,""); - assertEquals(ids.size(),5); - } + @Test + public void testGetIdentifiersWithIdSourceB() { + Set reservedIds = new HashSet<>(); + when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); + when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); + doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); + Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); + List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceB(), 5, ""); + assertEquals(ids.size(), 5); + } - @Test - public void testGetIdentifiersWithIdSourceC() { - Set reservedIds = new HashSet<>(); - when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); - when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); - doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); - Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); - List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceC(),5,""); - for(String id : ids) { - assertTrue(id.matches("^((?!404).)*$")); - } - } + @Test + public void testGetIdentifiersWithIdSourceC() { + Set reservedIds = new HashSet<>(); + when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); + when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); + doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); + Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); + List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceC(), 5, ""); + for (String id : ids) { + assertTrue(id.matches("^((?!404).)*$")); + } + } - @Test - public void testGetIdentifiersWithIdSourceD() { - Set reservedIds = new HashSet<>(); - when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); - when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); - doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); - Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); - List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceD(),5,""); - assertEquals(ids.size(),5); - } + @Test + public void testGetIdentifiersWithIdSourceD() { + Set reservedIds = new HashSet<>(); + when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); + when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); + doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); + Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); + List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceD(), 5, ""); + assertEquals(ids.size(), 5); + } - @Test - public void testGetIdentifiersWithIdSourceF() { - Set reservedIds = new HashSet<>(); - when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); - when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); - doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); - Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); - List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceF(),5,""); - assertEquals(ids.size(),5); - } + @Test + public void testGetIdentifiersWithIdSourceF() { + Set reservedIds = new HashSet<>(); + when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); + when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); + doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); + Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); + List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceF(), 5, ""); + assertEquals(ids.size(), 5); + } - @Test - public void testGetIdentifiersWithIdSourceI() { - Set reservedIds = new HashSet<>(); - when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); - when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); - doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); - Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); - List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceI(),5,""); - for(String id : ids) { - assertTrue(id.matches("[\\w-]*")); - } - } + @Test + public void testGetIdentifiersWithIdSourceI() { + Set reservedIds = new HashSet<>(); + when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); + when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); + doNothing().when(identifierSourceService).saveSequenceValue(any(IdentifierSource.class), anyLong()); + Mockito.doNothing().when(uniqueIdRepository).add(any(UniqueId.class)); + List ids = uniqueIdGeneratorProcessor.getIdentifiers(createIdentifierSourceI(), 5, ""); + for (String id : ids) { + assertTrue(id.matches("[\\w-]*")); + } + } - private UniqueId createUniqueId() { - UniqueId uniqueId = new UniqueId(); - uniqueId.setId(120l); - return uniqueId; - } + private UniqueId createUniqueId() { + UniqueId uniqueId = new UniqueId(); + uniqueId.setId(120l); + return uniqueId; + } - private IdentifierSource createIdentifierSource() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setId(1l); - identifierSource.setIdentifier("Test-1"); - identifierSource.setBaseCharacterSet("AB12"); - identifierSource.setMinLength(4); - identifierSource.setMaxLength(4); - identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); - return identifierSource; - } + private IdentifierSource createIdentifierSource() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setId(1l); + identifierSource.setIdentifier("Test-1"); + identifierSource.setBaseCharacterSet("AB12"); + identifierSource.setMinLength(4); + identifierSource.setMaxLength(4); + identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); + return identifierSource; + } - private IdentifierSource createIdentifierSourceV2() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setId(1l); - identifierSource.setIdentifier("Test-1"); - identifierSource.setBaseCharacterSet("AB12"); - identifierSource.setMinLength(4); - identifierSource.setMaxLength(4); - identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); - identifierSource.setFirstIdentifierBase("AA11"); - return identifierSource; - } + private IdentifierSource createIdentifierSourceV2() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setId(1l); + identifierSource.setIdentifier("Test-1"); + identifierSource.setBaseCharacterSet("AB12"); + identifierSource.setMinLength(4); + identifierSource.setMaxLength(4); + identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); + identifierSource.setFirstIdentifierBase("AA11"); + return identifierSource; + } - private IdentifierSource createIdentifierSourceV3() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setId(1l); - identifierSource.setIdentifier("Test-1"); - identifierSource.setBaseCharacterSet("AB12"); - identifierSource.setMinLength(4); - identifierSource.setMaxLength(4); - identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); - identifierSource.setFirstIdentifierBase("Aa11"); - return identifierSource; - } + private IdentifierSource createIdentifierSourceV3() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setId(1l); + identifierSource.setIdentifier("Test-1"); + identifierSource.setBaseCharacterSet("AB12"); + identifierSource.setMinLength(4); + identifierSource.setMaxLength(4); + identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); + identifierSource.setFirstIdentifierBase("Aa11"); + return identifierSource; + } - private IdentifierSource createIdentifierSourceA() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setId(1l); - identifierSource.setIdentifier("SOURCE-TEST-A"); - identifierSource.setBaseCharacterSet("0123456789"); - identifierSource.setMinLength(8); - identifierSource.setMaxLength(10); - identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); - identifierSource.setPrefix(""); - identifierSource.setRegexFormat(""); - return identifierSource; - } + private IdentifierSource createIdentifierSourceA() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setId(1l); + identifierSource.setIdentifier("SOURCE-TEST-A"); + identifierSource.setBaseCharacterSet("0123456789"); + identifierSource.setMinLength(8); + identifierSource.setMaxLength(10); + identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); + identifierSource.setPrefix(""); + identifierSource.setRegexFormat(""); + return identifierSource; + } - private IdentifierSource createIdentifierSourceB() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setId(1l); - identifierSource.setIdentifier("SOURCE-TEST-B"); - identifierSource.setBaseCharacterSet("0123456789"); - identifierSource.setMinLength(8); - identifierSource.setMaxLength(10); - identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); - identifierSource.setPrefix("DEPT"); - identifierSource.setRegexFormat(""); - return identifierSource; - } + private IdentifierSource createIdentifierSourceB() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setId(1l); + identifierSource.setIdentifier("SOURCE-TEST-B"); + identifierSource.setBaseCharacterSet("0123456789"); + identifierSource.setMinLength(8); + identifierSource.setMaxLength(10); + identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); + identifierSource.setPrefix("DEPT"); + identifierSource.setRegexFormat(""); + return identifierSource; + } - private IdentifierSource createIdentifierSourceC() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setId(1l); - identifierSource.setIdentifier("SOURCE-TEST-C"); - identifierSource.setBaseCharacterSet("0123456789"); - identifierSource.setMinLength(8); - identifierSource.setMaxLength(10); - identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); - identifierSource.setPrefix(""); - identifierSource.setRegexFormat("^((?!404).)*$"); - return identifierSource; - } + private IdentifierSource createIdentifierSourceC() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setId(1l); + identifierSource.setIdentifier("SOURCE-TEST-C"); + identifierSource.setBaseCharacterSet("0123456789"); + identifierSource.setMinLength(8); + identifierSource.setMaxLength(10); + identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); + identifierSource.setPrefix(""); + identifierSource.setRegexFormat("^((?!404).)*$"); + return identifierSource; + } - private IdentifierSource createIdentifierSourceD() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setId(1l); - identifierSource.setIdentifier("SOURCE-TEST-D"); - identifierSource.setBaseCharacterSet("0123456789"); - identifierSource.setMinLength(4); - identifierSource.setMaxLength(5); - identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); - identifierSource.setPrefix(""); - identifierSource.setRegexFormat(""); - return identifierSource; - } + private IdentifierSource createIdentifierSourceD() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setId(1l); + identifierSource.setIdentifier("SOURCE-TEST-D"); + identifierSource.setBaseCharacterSet("0123456789"); + identifierSource.setMinLength(4); + identifierSource.setMaxLength(5); + identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); + identifierSource.setPrefix(""); + identifierSource.setRegexFormat(""); + return identifierSource; + } - private IdentifierSource createIdentifierSourceF() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setId(1l); - identifierSource.setIdentifier("SOURCE-TEST-F"); - identifierSource.setBaseCharacterSet("01234ABCDE"); - identifierSource.setMinLength(5); - identifierSource.setMaxLength(8); - identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); - identifierSource.setPrefix(""); - identifierSource.setRegexFormat(""); - return identifierSource; - } - - private IdentifierSource createIdentifierSourceI() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setId(1l); - identifierSource.setIdentifier("SOURCE-TEST-I"); - identifierSource.setBaseCharacterSet("0123459789abcdefghij"); - identifierSource.setMinLength(4); - identifierSource.setMaxLength(7); - identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); - identifierSource.setPrefix("ICU"); - identifierSource.setRegexFormat("[\\w-]*"); - return identifierSource; - } + private IdentifierSource createIdentifierSourceF() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setId(1l); + identifierSource.setIdentifier("SOURCE-TEST-F"); + identifierSource.setBaseCharacterSet("01234ABCDE"); + identifierSource.setMinLength(5); + identifierSource.setMaxLength(8); + identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); + identifierSource.setPrefix(""); + identifierSource.setRegexFormat(""); + return identifierSource; + } + private IdentifierSource createIdentifierSourceI() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setId(1l); + identifierSource.setIdentifier("SOURCE-TEST-I"); + identifierSource.setBaseCharacterSet("0123459789abcdefghij"); + identifierSource.setMinLength(4); + identifierSource.setMaxLength(7); + identifierSource.setIdentifierValidatorAlgorithm(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); + identifierSource.setPrefix("ICU"); + identifierSource.setRegexFormat("[\\w-]*"); + return identifierSource; + } } diff --git a/src/test/java/org/opensrp/migrations/MybatisMigrationTest.java b/src/test/java/org/opensrp/migrations/MybatisMigrationTest.java index c7aa76e1b..cf8a8d181 100644 --- a/src/test/java/org/opensrp/migrations/MybatisMigrationTest.java +++ b/src/test/java/org/opensrp/migrations/MybatisMigrationTest.java @@ -17,31 +17,31 @@ @RunWith(MockitoJUnitRunner.class) public class MybatisMigrationTest { - private MybatisMigration mybatisMigration; + private MybatisMigration mybatisMigration; - @Before - public void setUp() { - mybatisMigration = Mockito.spy(new MybatisMigration()); - } + @Before + public void setUp() { + mybatisMigration = Mockito.spy(new MybatisMigration()); + } - @Test - public void testInitializeMybatisMigrationShouldInvokeRunMigrationOperation() throws IOException { - Mockito.doNothing().when(mybatisMigration).runMigrationOperation(Mockito.any(Properties.class), Mockito.any( - DatabaseOperationOption.class)); + @Test + public void testInitializeMybatisMigrationShouldInvokeRunMigrationOperation() throws IOException { + Mockito.doNothing().when(mybatisMigration).runMigrationOperation(Mockito.any(Properties.class), Mockito.any( + DatabaseOperationOption.class)); - mybatisMigration.initializeMybatisMigration(); + mybatisMigration.initializeMybatisMigration(); - ArgumentCaptor propertiesArgumentCaptor = ArgumentCaptor.forClass(Properties.class); - ArgumentCaptor databaseOperationOptionArgumentCaptor = ArgumentCaptor.forClass( - DatabaseOperationOption.class); + ArgumentCaptor propertiesArgumentCaptor = ArgumentCaptor.forClass(Properties.class); + ArgumentCaptor databaseOperationOptionArgumentCaptor = ArgumentCaptor.forClass( + DatabaseOperationOption.class); - Mockito.verify(mybatisMigration).runMigrationOperation(propertiesArgumentCaptor.capture(), - databaseOperationOptionArgumentCaptor.capture()); + Mockito.verify(mybatisMigration).runMigrationOperation(propertiesArgumentCaptor.capture(), + databaseOperationOptionArgumentCaptor.capture()); - assertNotNull(databaseOperationOptionArgumentCaptor.getValue()); - assertNotNull(propertiesArgumentCaptor.getValue()); + assertNotNull(databaseOperationOptionArgumentCaptor.getValue()); + assertNotNull(propertiesArgumentCaptor.getValue()); - // Has to be set to false - assertFalse(databaseOperationOptionArgumentCaptor.getValue().isAutoCommit()); - } + // Has to be set to false + assertFalse(databaseOperationOptionArgumentCaptor.getValue().isAutoCommit()); + } } diff --git a/src/test/java/org/opensrp/queue/QueueHelperTest.java b/src/test/java/org/opensrp/queue/QueueHelperTest.java index df918b74d..1de25169b 100644 --- a/src/test/java/org/opensrp/queue/QueueHelperTest.java +++ b/src/test/java/org/opensrp/queue/QueueHelperTest.java @@ -44,6 +44,7 @@ import java.util.UUID; import org.mockito.Mockito; + import static org.mockito.MockitoAnnotations.initMocks; import static org.mockito.Mockito.when; import static org.mockito.Matchers.anyString; @@ -55,351 +56,338 @@ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:test-applicationContext-opensrp.xml") -@ActiveProfiles(profiles = { "rabbitmq" }) +@ActiveProfiles(profiles = {"rabbitmq"}) public class QueueHelperTest extends TestRabbitMQInstance { - @Mock - private PlanService planService; - - @Mock - private PlanEvaluator planEvaluator; - - @Autowired - private RabbitMQSenderImpl rabbitMQSender; - - @Autowired - private AmqpTemplate rabbitTemplate; - - @Autowired - private Queue queue; - - @InjectMocks - private QueueHelper queueHelper; - - @Autowired - private AmqpAdmin amqpAdmin; - - @Autowired - private PlanRepository planRepository; - - private ArgumentCaptor domainResourceArgumentCaptor = ArgumentCaptor.forClass(DomainResource.class); - - public static Gson gson = new GsonBuilder().registerTypeAdapter(DateTime.class, new TaskDateTimeTypeConverter()) - .registerTypeAdapter(LocalDate.class, new DateTypeConverter()).create(); - - private String username="user12"; - - private final long ASYNC_TIMEOUT = 2000L; - - public static String location = "{\n" - + " \"resourceType\": \"Location\",\n" - + " \"id\": \"304cbcd4-0850-404a-a8b1-486b02f7b84d\",\n" - + " \"meta\": {\n" - + " \"versionId\": \"0\",\n" - + " \"lastUpdated\": \"2019-09-13T04:41:49.467+05:00\"\n" - + " },\n" - + " \"identifier\": [\n" - + " {\n" - + " \"system\": \"OpenMRS_Id\",\n" - + " \"value\": \"de28c78d-3111-4266-957b-c731a3330c1d\"\n" - + " }\n" - + " ],\n" - + " \"status\": \"active\",\n" - + " \"name\": \"TLv1_02\",\n" - + " \"mode\": \"instance\",\n" - + " \"_mode\": {\n" - + " \"id\": \"mode\"\n" - + " },\n" - + " \"physicalType\": {\n" - + " \"coding\": [\n" - + " {\n" - + " \"code\": \"jdn\"\n" - + " }\n" - + " ]\n" - + " },\n" - + " \"partOf\": {\n" - + " \"reference\": \"dad42fa6-b9b8-4658-bf25-bfa7ab5b16ae\"\n" - + " }\n" - + "}"; - - public static final String plan = "{\n" - + " \"identifier\": \"test-plan-identifier-\",\n" - + " \"version\": \"1\",\n" - + " \"name\": \"FI-Routine-Dynamic-Task-Test-Plan-2020-06-26\",\n" - + " \"title\": \"FI Routine Dynamic Task-Test Plan 2020-06-26\",\n" - + " \"status\": \"active\",\n" - + " \"date\": \"2020-06-26\",\n" - + " \"effectivePeriod\": {\n" - + " \"start\": \"2020-06-26\",\n" - + " \"end\": \"2020-07-13\"\n" - + " },\n" - + " \"useContext\": [\n" - + " {\n" - + " \"code\": \"fiStatus\",\n" - + " \"valueCodableConcept\": \"A1\"\n" - + " },\n" - + " {\n" - + " \"code\": \"fiReason\",\n" - + " \"valueCodableConcept\": \"Routine\"\n" - + " }\n" - + " ],\n" - + " \"jurisdiction\": [\n" - + " {\n" - + " \"code\": \"1435f854-e818-45bb-8de1-ee27c5ec4e1c\"\n" - + " }\n" - + " ],\n" - + " \"goal\": [\n" - + " {\n" - + " \"id\": \"RACD_register_families\",\n" - + " \"description\": \"Register all families & family members in all residential structures enumerated (100%) within the operational area\",\n" - + " \"priority\": \"medium-priority\",\n" - + " \"target\": [\n" - + " {\n" - + " \"measure\": \"Percent of residential structures with full family registration\",\n" - + " \"detail\": {\n" - + " \"detailQuantity\": {\n" - + " \"value\": 100,\n" - + " \"comparator\": \">=\",\n" - + " \"unit\": \"Percent\"\n" - + " }\n" - + " },\n" - + " \"due\": \"2020-07-06\"\n" - + " }\n" - + " ]\n" - + " },\n" - + " {\n" - + " \"id\": \"RACD_Blood_Screening\",\n" - + " \"description\": \"Visit all residential structures (100%) within a 1 km radius of a confirmed index case and test each registered person\",\n" - + " \"priority\": \"medium-priority\",\n" - + " \"target\": [\n" - + " {\n" - + " \"measure\": \"Number of registered people tested\",\n" - + " \"detail\": {\n" - + " \"detailQuantity\": {\n" - + " \"value\": 100,\n" - + " \"comparator\": \">=\",\n" - + " \"unit\": \"Person(s)\"\n" - + " }\n" - + " },\n" - + " \"due\": \"2020-07-06\"\n" - + " }\n" - + " ]\n" - + " },\n" - + " {\n" - + " \"id\": \"RACD_bednet_distribution\",\n" - + " \"description\": \"Visit 100% of residential structures in the operational area and provide nets\",\n" - + " \"priority\": \"medium-priority\",\n" - + " \"target\": [\n" - + " {\n" - + " \"measure\": \"Percent of residential structures received nets\",\n" - + " \"detail\": {\n" - + " \"detailQuantity\": {\n" - + " \"value\": 100,\n" - + " \"comparator\": \">=\",\n" - + " \"unit\": \"Percent\"\n" - + " }\n" - + " },\n" - + " \"due\": \"2020-07-06\"\n" - + " }\n" - + " ]\n" - + " },\n" - + " {\n" - + " \"id\": \"Larval_Dipping\",\n" - + " \"description\": \"Perform a minimum of three larval dipping activities in the operational area\",\n" - + " \"priority\": \"medium-priority\",\n" - + " \"target\": [\n" - + " {\n" - + " \"measure\": \"Number of larval dipping activities completed\",\n" - + " \"detail\": {\n" - + " \"detailQuantity\": {\n" - + " \"value\": 3,\n" - + " \"comparator\": \">=\",\n" - + " \"unit\": \"activit(y|ies)\"\n" - + " }\n" - + " },\n" - + " \"due\": \"2020-07-06\"\n" - + " }\n" - + " ]\n" - + " },\n" - + " {\n" - + " \"id\": \"Mosquito_Collection\",\n" - + " \"description\": \"Set a minimum of three mosquito collection traps and complete the mosquito collection process\",\n" - + " \"priority\": \"medium-priority\",\n" - + " \"target\": [\n" - + " {\n" - + " \"measure\": \"Number of mosquito collection activities completed\",\n" - + " \"detail\": {\n" - + " \"detailQuantity\": {\n" - + " \"value\": 3,\n" - + " \"comparator\": \">=\",\n" - + " \"unit\": \"activit(y|ies)\"\n" - + " }\n" - + " },\n" - + " \"due\": \"2020-07-06\"\n" - + " }\n" - + " ]\n" - + " },\n" - + " {\n" - + " \"id\": \"BCC_Focus\",\n" - + " \"description\": \"Complete at least 1 BCC activity for the operational area\",\n" - + " \"priority\": \"medium-priority\",\n" - + " \"target\": [\n" - + " {\n" - + " \"measure\": \"BCC Activities Completed\",\n" - + " \"detail\": {\n" - + " \"detailQuantity\": {\n" - + " \"value\": 1,\n" - + " \"comparator\": \">=\",\n" - + " \"unit\": \"activit(y|ies)\"\n" - + " }\n" - + " },\n" - + " \"due\": \"2020-07-06\"\n" - + " }\n" - + " ]\n" - + " }\n" - + " ],\n" - + " \"action\": [\n" - + " {\n" - + " \"identifier\": \"d1c6dac7-1ce8-4723-b28d-ac20621f171e\",\n" - + " \"prefix\": 1,\n" - + " \"title\": \"Family Registration\",\n" - + " \"description\": \"Register all families & family members in all residential structures enumerated (100%) within the operational area\",\n" - + " \"code\": \"RACD Register Family\",\n" - + " \"trigger\": [\n" - + " {\n" - + " \"type\": \"named-event\",\n" - + " \"name\": \"plan-activation\"\n" - + " },\n" - + " {\n" - + " \"type\": \"named-event\",\n" - + " \"name\": \"event-submission\",\n" - + " \"expression\": {\n" - + " \"expression\": \"questionnaire = 'Register_Structure'\"\n" - + " }\n" - + " }\n" - + " ],\n" - + " \"condition\": [\n" - + " {\n" - + " \"kind\": \"applicability\",\n" - + " \"expression\": {\n" - + " \"description\": \"Structure is residential\",\n" - + " \"reference\": \"plan-activation\",\n" - + " \"expression\": \"$this.type.where(id='locationType').text = 'Residential Structure'\"\n" - + " }\n" - + " },\n" - + " {\n" - + " \"kind\": \"applicability\",\n" - + " \"expression\": {\n" - + " \"description\": \"Family does not exist for structure\",\n" - + " \"reference\": \"plan-activation\",\n" - + " \"expression\": \"$this.contained.exists().not()\",\n" - + " \"subjectCodableConcept\": {\n" - + " \"text\": \"Family\"\n" - + " }\n" - + " }\n" - + " },\n" - + " {\n" - + " \"kind\": \"applicability\",\n" - + " \"expression\": {\n" - + " \"description\": \"Register stucture Event submitted for a residential structure\",\n" - + " \"reference\": \"event-submission\",\n" - + " \"expression\": \"questionnaire = 'Register_Structure' AND item.where(linkId='structureType').answer.value ='Residential Structure'\"\n" - + " }\n" - + " }\n" - + " ],\n" - + " \"timingPeriod\": {\n" - + " \"start\": \"2020-06-26\",\n" - + " \"end\": \"2020-07-06\"\n" - + " },\n" - + " \"reason\": \"Routine\",\n" - + " \"goalId\": \"RACD_register_families\",\n" - + " \"subjectCodableConcept\": {\n" - + " \"text\": \"Location\"\n" - + " },\n" - + " \"definitionUri\": \"thailand_family_register.json\"\n" - + " }\n" - + " ],\n" - + " \"experimental\": false\n" - + "}"; + public static final String plan = "{\n" + + " \"identifier\": \"test-plan-identifier-\",\n" + + " \"version\": \"1\",\n" + + " \"name\": \"FI-Routine-Dynamic-Task-Test-Plan-2020-06-26\",\n" + + " \"title\": \"FI Routine Dynamic Task-Test Plan 2020-06-26\",\n" + + " \"status\": \"active\",\n" + + " \"date\": \"2020-06-26\",\n" + + " \"effectivePeriod\": {\n" + + " \"start\": \"2020-06-26\",\n" + + " \"end\": \"2020-07-13\"\n" + + " },\n" + + " \"useContext\": [\n" + + " {\n" + + " \"code\": \"fiStatus\",\n" + + " \"valueCodableConcept\": \"A1\"\n" + + " },\n" + + " {\n" + + " \"code\": \"fiReason\",\n" + + " \"valueCodableConcept\": \"Routine\"\n" + + " }\n" + + " ],\n" + + " \"jurisdiction\": [\n" + + " {\n" + + " \"code\": \"1435f854-e818-45bb-8de1-ee27c5ec4e1c\"\n" + + " }\n" + + " ],\n" + + " \"goal\": [\n" + + " {\n" + + " \"id\": \"RACD_register_families\",\n" + + " \"description\": \"Register all families & family members in all residential structures enumerated (100%) within the operational area\",\n" + + " \"priority\": \"medium-priority\",\n" + + " \"target\": [\n" + + " {\n" + + " \"measure\": \"Percent of residential structures with full family registration\",\n" + + " \"detail\": {\n" + + " \"detailQuantity\": {\n" + + " \"value\": 100,\n" + + " \"comparator\": \">=\",\n" + + " \"unit\": \"Percent\"\n" + + " }\n" + + " },\n" + + " \"due\": \"2020-07-06\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " {\n" + + " \"id\": \"RACD_Blood_Screening\",\n" + + " \"description\": \"Visit all residential structures (100%) within a 1 km radius of a confirmed index case and test each registered person\",\n" + + " \"priority\": \"medium-priority\",\n" + + " \"target\": [\n" + + " {\n" + + " \"measure\": \"Number of registered people tested\",\n" + + " \"detail\": {\n" + + " \"detailQuantity\": {\n" + + " \"value\": 100,\n" + + " \"comparator\": \">=\",\n" + + " \"unit\": \"Person(s)\"\n" + + " }\n" + + " },\n" + + " \"due\": \"2020-07-06\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " {\n" + + " \"id\": \"RACD_bednet_distribution\",\n" + + " \"description\": \"Visit 100% of residential structures in the operational area and provide nets\",\n" + + " \"priority\": \"medium-priority\",\n" + + " \"target\": [\n" + + " {\n" + + " \"measure\": \"Percent of residential structures received nets\",\n" + + " \"detail\": {\n" + + " \"detailQuantity\": {\n" + + " \"value\": 100,\n" + + " \"comparator\": \">=\",\n" + + " \"unit\": \"Percent\"\n" + + " }\n" + + " },\n" + + " \"due\": \"2020-07-06\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " {\n" + + " \"id\": \"Larval_Dipping\",\n" + + " \"description\": \"Perform a minimum of three larval dipping activities in the operational area\",\n" + + " \"priority\": \"medium-priority\",\n" + + " \"target\": [\n" + + " {\n" + + " \"measure\": \"Number of larval dipping activities completed\",\n" + + " \"detail\": {\n" + + " \"detailQuantity\": {\n" + + " \"value\": 3,\n" + + " \"comparator\": \">=\",\n" + + " \"unit\": \"activit(y|ies)\"\n" + + " }\n" + + " },\n" + + " \"due\": \"2020-07-06\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " {\n" + + " \"id\": \"Mosquito_Collection\",\n" + + " \"description\": \"Set a minimum of three mosquito collection traps and complete the mosquito collection process\",\n" + + " \"priority\": \"medium-priority\",\n" + + " \"target\": [\n" + + " {\n" + + " \"measure\": \"Number of mosquito collection activities completed\",\n" + + " \"detail\": {\n" + + " \"detailQuantity\": {\n" + + " \"value\": 3,\n" + + " \"comparator\": \">=\",\n" + + " \"unit\": \"activit(y|ies)\"\n" + + " }\n" + + " },\n" + + " \"due\": \"2020-07-06\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " {\n" + + " \"id\": \"BCC_Focus\",\n" + + " \"description\": \"Complete at least 1 BCC activity for the operational area\",\n" + + " \"priority\": \"medium-priority\",\n" + + " \"target\": [\n" + + " {\n" + + " \"measure\": \"BCC Activities Completed\",\n" + + " \"detail\": {\n" + + " \"detailQuantity\": {\n" + + " \"value\": 1,\n" + + " \"comparator\": \">=\",\n" + + " \"unit\": \"activit(y|ies)\"\n" + + " }\n" + + " },\n" + + " \"due\": \"2020-07-06\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ],\n" + + " \"action\": [\n" + + " {\n" + + " \"identifier\": \"d1c6dac7-1ce8-4723-b28d-ac20621f171e\",\n" + + " \"prefix\": 1,\n" + + " \"title\": \"Family Registration\",\n" + + " \"description\": \"Register all families & family members in all residential structures enumerated (100%) within the operational area\",\n" + + " \"code\": \"RACD Register Family\",\n" + + " \"trigger\": [\n" + + " {\n" + + " \"type\": \"named-event\",\n" + + " \"name\": \"plan-activation\"\n" + + " },\n" + + " {\n" + + " \"type\": \"named-event\",\n" + + " \"name\": \"event-submission\",\n" + + " \"expression\": {\n" + + " \"expression\": \"questionnaire = 'Register_Structure'\"\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"condition\": [\n" + + " {\n" + + " \"kind\": \"applicability\",\n" + + " \"expression\": {\n" + + " \"description\": \"Structure is residential\",\n" + + " \"reference\": \"plan-activation\",\n" + + " \"expression\": \"$this.type.where(id='locationType').text = 'Residential Structure'\"\n" + + " }\n" + + " },\n" + + " {\n" + + " \"kind\": \"applicability\",\n" + + " \"expression\": {\n" + + " \"description\": \"Family does not exist for structure\",\n" + + " \"reference\": \"plan-activation\",\n" + + " \"expression\": \"$this.contained.exists().not()\",\n" + + " \"subjectCodableConcept\": {\n" + + " \"text\": \"Family\"\n" + + " }\n" + + " }\n" + + " },\n" + + " {\n" + + " \"kind\": \"applicability\",\n" + + " \"expression\": {\n" + + " \"description\": \"Register stucture Event submitted for a residential structure\",\n" + + " \"reference\": \"event-submission\",\n" + + " \"expression\": \"questionnaire = 'Register_Structure' AND item.where(linkId='structureType').answer.value ='Residential Structure'\"\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"timingPeriod\": {\n" + + " \"start\": \"2020-06-26\",\n" + + " \"end\": \"2020-07-06\"\n" + + " },\n" + + " \"reason\": \"Routine\",\n" + + " \"goalId\": \"RACD_register_families\",\n" + + " \"subjectCodableConcept\": {\n" + + " \"text\": \"Location\"\n" + + " },\n" + + " \"definitionUri\": \"thailand_family_register.json\"\n" + + " }\n" + + " ],\n" + + " \"experimental\": false\n" + + "}"; + public static Gson gson = new GsonBuilder().registerTypeAdapter(DateTime.class, new TaskDateTimeTypeConverter()) + .registerTypeAdapter(LocalDate.class, new DateTypeConverter()).create(); + public static String location = "{\n" + + " \"resourceType\": \"Location\",\n" + + " \"id\": \"304cbcd4-0850-404a-a8b1-486b02f7b84d\",\n" + + " \"meta\": {\n" + + " \"versionId\": \"0\",\n" + + " \"lastUpdated\": \"2019-09-13T04:41:49.467+05:00\"\n" + + " },\n" + + " \"identifier\": [\n" + + " {\n" + + " \"system\": \"OpenMRS_Id\",\n" + + " \"value\": \"de28c78d-3111-4266-957b-c731a3330c1d\"\n" + + " }\n" + + " ],\n" + + " \"status\": \"active\",\n" + + " \"name\": \"TLv1_02\",\n" + + " \"mode\": \"instance\",\n" + + " \"_mode\": {\n" + + " \"id\": \"mode\"\n" + + " },\n" + + " \"physicalType\": {\n" + + " \"coding\": [\n" + + " {\n" + + " \"code\": \"jdn\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"partOf\": {\n" + + " \"reference\": \"dad42fa6-b9b8-4658-bf25-bfa7ab5b16ae\"\n" + + " }\n" + + "}"; + private final long ASYNC_TIMEOUT = 2000L; + @Mock + private PlanService planService; + @Mock + private PlanEvaluator planEvaluator; + @Autowired + private RabbitMQSenderImpl rabbitMQSender; + @Autowired + private AmqpTemplate rabbitTemplate; + @Autowired + private Queue queue; + @InjectMocks + private QueueHelper queueHelper; + @Autowired + private AmqpAdmin amqpAdmin; + @Autowired + private PlanRepository planRepository; + private ArgumentCaptor domainResourceArgumentCaptor = ArgumentCaptor.forClass(DomainResource.class); + private String username = "user12"; - @Before - public void setup() { - initMocks(this); - amqpAdmin.purgeQueue(queue.getName()); - rabbitMQSender.setRabbitTemplate(rabbitTemplate); - rabbitMQSender.setQueue(queue); - queueHelper.setRabbitMQSender(rabbitMQSender); - } + public static PlanDefinition createPlan() { + return gson.fromJson(plan, PlanDefinition.class); + } - @Test - public void testAddToQueue() throws InterruptedException { - PlanDefinition planDefinition = createPlan(); - when(planService.getPlan(anyString())).thenReturn(planDefinition); - addNewPlanToRepo(); - Mockito.doNothing().when(planEvaluator) - .evaluatePlan(any(PlanDefinition.class), any(TriggerType.class), any(Jurisdiction.class), any( - QuestionnaireResponse.class)); - queueHelper.addToQueue("test-plan-identifier-", TriggerType.PLAN_ACTIVATION, "loc-1",username); - Thread.sleep(ASYNC_TIMEOUT); - int count = (Integer) amqpAdmin.getQueueProperties(queue.getName()).get("QUEUE_MESSAGE_COUNT"); - assertEquals(0, count); // This shows message has been consumed - } + public static DomainResource createFHIRLocation() { + return gson.fromJson(location, DomainResource.class); + } - @Test - public void testAddToQueueV2() throws InterruptedException { - Action action = new Action(); - action.setCondition(new HashSet<>()); - Mockito.doNothing().when(planEvaluator) - .evaluateResource(any(DomainResource.class), nullable(QuestionnaireResponse.class), any(Action.class), - anyString(), anyString(), any(TriggerType.class)); - queueHelper.addToQueue(location, null, action, "plan-id", "jur-id", TriggerType.PLAN_ACTIVATION,username); - Thread.sleep(ASYNC_TIMEOUT); - int count = (Integer) amqpAdmin.getQueueProperties(queue.getName()).get("QUEUE_MESSAGE_COUNT"); - assertEquals(0, count); // This shows message has been consumed - } + public static Location createLocation() { + return Location.builder().id(UUID.randomUUID().toString()).name(of("Nairobi")).status(LocationStatus.ACTIVE).build(); + } - @Test - public void testAddToQueueV2WithQueuingDisabledAndInvalidResource() { - Action action = createAction(); - queueHelper.addToQueue(plan, null, action, "plan-id", "jur-id", TriggerType.PLAN_ACTIVATION,username); - verify(planEvaluator, never()) - .evaluateResource(eq(domainResourceArgumentCaptor.capture()), null, eq(action), eq("plan-id"), eq("jur-id"), - eq(TriggerType.PLAN_ACTIVATION)); - } + public static Action createAction() { + Action action = new Action(); + Set conditions = new HashSet<>(); + Condition condition = new Condition(); + Expression expression = new Expression(); + expression.setExpression("'Cancelled'"); + condition.setExpression(expression); + conditions.add(condition); - public static PlanDefinition createPlan() { - return gson.fromJson(plan, PlanDefinition.class); - } + condition = new Condition(); + expression = new Expression(); + expression.setExpression("'Family Already Registered'"); + condition.setExpression(expression); + conditions.add(condition); + action.setCondition(conditions); + return action; + } - public static DomainResource createFHIRLocation() { - return gson.fromJson(location, DomainResource.class); - } + @Before + public void setup() { + initMocks(this); + amqpAdmin.purgeQueue(queue.getName()); + rabbitMQSender.setRabbitTemplate(rabbitTemplate); + rabbitMQSender.setQueue(queue); + queueHelper.setRabbitMQSender(rabbitMQSender); + } - public static Location createLocation() { - return Location.builder().id(UUID.randomUUID().toString()).name(of("Nairobi")).status(LocationStatus.ACTIVE).build(); - } + @Test + public void testAddToQueue() throws InterruptedException { + PlanDefinition planDefinition = createPlan(); + when(planService.getPlan(anyString())).thenReturn(planDefinition); + addNewPlanToRepo(); + Mockito.doNothing().when(planEvaluator) + .evaluatePlan(any(PlanDefinition.class), any(TriggerType.class), any(Jurisdiction.class), any( + QuestionnaireResponse.class)); + queueHelper.addToQueue("test-plan-identifier-", TriggerType.PLAN_ACTIVATION, "loc-1", username); + Thread.sleep(ASYNC_TIMEOUT); + int count = (Integer) amqpAdmin.getQueueProperties(queue.getName()).get("QUEUE_MESSAGE_COUNT"); + assertEquals(0, count); // This shows message has been consumed + } - public void addNewPlanToRepo() { - PlanDefinition planDefinition = createPlan(); - planRepository.add(planDefinition); - } + @Test + public void testAddToQueueV2() throws InterruptedException { + Action action = new Action(); + action.setCondition(new HashSet<>()); + Mockito.doNothing().when(planEvaluator) + .evaluateResource(any(DomainResource.class), nullable(QuestionnaireResponse.class), any(Action.class), + anyString(), anyString(), any(TriggerType.class)); + queueHelper.addToQueue(location, null, action, "plan-id", "jur-id", TriggerType.PLAN_ACTIVATION, username); + Thread.sleep(ASYNC_TIMEOUT); + int count = (Integer) amqpAdmin.getQueueProperties(queue.getName()).get("QUEUE_MESSAGE_COUNT"); + assertEquals(0, count); // This shows message has been consumed + } - public static Action createAction() { - Action action = new Action(); - Set conditions = new HashSet<>(); - Condition condition = new Condition(); - Expression expression = new Expression(); - expression.setExpression("'Cancelled'"); - condition.setExpression(expression); - conditions.add(condition); + @Test + public void testAddToQueueV2WithQueuingDisabledAndInvalidResource() { + Action action = createAction(); + queueHelper.addToQueue(plan, null, action, "plan-id", "jur-id", TriggerType.PLAN_ACTIVATION, username); + verify(planEvaluator, never()) + .evaluateResource(eq(domainResourceArgumentCaptor.capture()), null, eq(action), eq("plan-id"), eq("jur-id"), + eq(TriggerType.PLAN_ACTIVATION)); + } - condition = new Condition(); - expression = new Expression(); - expression.setExpression("'Family Already Registered'"); - condition.setExpression(expression); - conditions.add(condition); - action.setCondition(conditions); - return action; - } + public void addNewPlanToRepo() { + PlanDefinition planDefinition = createPlan(); + planRepository.add(planDefinition); + } } diff --git a/src/test/java/org/opensrp/repository/postgres/ActionsRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/ActionsRepositoryTest.java index ef38197d4..9e486f76c 100644 --- a/src/test/java/org/opensrp/repository/postgres/ActionsRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/ActionsRepositoryTest.java @@ -21,230 +21,230 @@ import org.springframework.beans.factory.annotation.Qualifier; public class ActionsRepositoryTest extends BaseRepositoryTest { - - @Autowired - @Qualifier("actionsRepositoryPostgres") - private ActionsRepository actionsRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("action.sql"); - return scripts; - } - - @Test - public void testGet() { - Action action = actionsRepository.get("05934ae338431f28bf6793b2417c98f9"); - assertEquals(6, action.data().size()); - assertEquals("PENTA 1", action.data().get("scheduleName")); - assertEquals("2018-02-22", action.data().get("startDate")); - assertEquals("aabcd2cc-c111-41c6-85e6-cb5d9e350d08", action.baseEntityId()); - - //missing action - assertNull(actionsRepository.get("05934ae338431f28bf6793b241")); - } - - @Test - public void testAdd() { - Action action = new Action("bshjfsdf-sdfsd9-4243-ssf", "tester", ActionData.markAlertAsClosed("BCG", "2018-02-23")); - actionsRepository.add(action); - assertEquals(35, actionsRepository.getAll().size()); - - action = actionsRepository.findByCaseIdAndTimeStamp("bshjfsdf-sdfsd9-4243-ssf", 0l).get(0); - assertEquals("BCG", action.data().get("visitCode")); - assertEquals("2018-02-23", action.data().get("completionDate")); - assertEquals("closeAlert", action.getActionType()); - - } - - @Test - public void testUpdate() { - Action action = actionsRepository.get("05934ae338431f28bf6793b2417c98f9"); - action.getDetails().put("Key11", "Baby123"); - String today = new LocalDate().toString(); - action.data().put("expiryDate", today); - - actionsRepository.update(action); - - Action updatedAction = actionsRepository.get("05934ae338431f28bf6793b2417c98f9"); - assertEquals("Baby123", updatedAction.getDetails().get("Key11")); - assertEquals(today, updatedAction.data().get("expiryDate")); - - } - - @Test - public void testGetAll() { - assertEquals(34, actionsRepository.getAll().size()); - - actionsRepository.safeRemove(actionsRepository.get("05934ae338431f28bf6793b2417c98f9")); - - List actions = actionsRepository.getAll(); - assertEquals(33, actions.size()); - - List ids = Arrays.asList("05934ae338431f28bf6793b241645f1f", "05934ae338431f28bf6793b24164a5d7", - "05934ae338431f28bf6793b2417c5aae"); - int found = 0; - for (Action act : actions) { - assertNotEquals("05934ae338431f28bf6793b2417c98f9", act.getId()); - if (ids.contains(act.getId())) - found++; - } - assertEquals(3, found); - - } - - @Test - public void testSafeRemove() { - - Action action = actionsRepository.get("05934ae338431f28bf6793b2417c7d94"); - actionsRepository.safeRemove(action); - - List actions = actionsRepository.getAll(); - assertEquals(33, actions.size()); - - for (Action act : actions) { - assertNotEquals("05934ae338431f28bf6793b2417c7d94", act.getId()); - } - - assertNull(actionsRepository.get("05934ae338431f28bf6793b2417c7d94")); - } - - @Test - public void testFindByProviderIdAndTimeStamp() { - assertEquals(34, actionsRepository.findByProviderIdAndTimeStamp("biddemo", 0l).size()); - - assertEquals(24, actionsRepository.findByProviderIdAndTimeStamp("biddemo", 1520932703825l).size()); - - List actions = actionsRepository.findByProviderIdAndTimeStamp("biddemo", 1520978414513l); - assertEquals(1, actions.size()); - assertEquals("05934ae338431f28bf6793b2417da475", actions.get(0).getId()); - - assertTrue(actionsRepository.findByProviderIdAndTimeStamp("biddeo", 0l).isEmpty()); - - assertTrue(actionsRepository.findByProviderIdAndTimeStamp("biddemo", System.currentTimeMillis()).isEmpty()); - } - - @Test - public void findAlertByANMIdEntityIdScheduleName() { - List actions = actionsRepository.findAlertByANMIdEntityIdScheduleName("biddemo", - "b06e0847-0d68-4f5c-9288-58bc394fe052", "BCG"); - assertEquals(1, actions.size()); - assertEquals("05934ae338431f28bf6793b2417db6ca", actions.get(0).getId()); - assertEquals("2018-01-11", actions.get(0).data().get("startDate")); - assertEquals("05934ae338431f28bf6793b2417db6ca", actions.get(0).getId()); - - assertTrue(actionsRepository - .findAlertByANMIdEntityIdScheduleName("biddemo", "b06e0847-0d68-4f5c-9288-58bc394fe052", "OPV 2").isEmpty()); - } - - @Test - public void testFindByCaseIdScheduleAndTimeStamp() { - List actions = actionsRepository.findByCaseIdScheduleAndTimeStamp("b06e0847-0d68-4f5c-9288-58bc394fe052", - "BCG", new DateTime("2018-03-13"), new DateTime()); - assertEquals(1, actions.size()); - assertEquals("05934ae338431f28bf6793b2417db6ca", actions.get(0).getId()); - assertEquals("2018-01-11", actions.get(0).data().get("startDate")); - assertEquals("05934ae338431f28bf6793b2417db6ca", actions.get(0).getId()); - - assertTrue(actionsRepository.findByCaseIdScheduleAndTimeStamp("b06e0847-0d68-4f5c-9288-58bc394fe052", "BCG", - new DateTime("2018-03-20"), new DateTime()).isEmpty()); - } - - @Test - public void testFindByCaseIdAndTimeStamp() { - List actions = actionsRepository.findByCaseIdAndTimeStamp("b06e0847-0d68-4f5c-9288-58bc394fe052", - new DateTime("2018-03-13").getMillis()); - assertEquals(5, actions.size()); - - actions = actionsRepository.findByCaseIdAndTimeStamp("b06e0847-0d68-4f5c-9288-58bc394fe052", 1520978414514l); - assertEquals("05934ae338431f28bf6793b2417da475", actions.get(0).getId()); - assertEquals("2018-02-22", actions.get(0).data().get("startDate")); - assertEquals("pcv1", actions.get(0).data().get("visitCode")); - - assertTrue(actionsRepository.findByCaseIdScheduleAndTimeStamp("b06e0847-0d68-4f5c-9288-58bc394fe052", "BCG", - new DateTime("2018-03-20"), new DateTime()).isEmpty()); - } - - @Test - public void testDeleteAllByTarget() { - actionsRepository.deleteAllByTarget("alert"); - assertTrue(actionsRepository.getAll().isEmpty()); - } - - @Test - public void testMarkAllAsInActiveFor() { - actionsRepository.markAllAsInActiveFor("b06e0847-0d68-4f5c-9288-58bc394fe052"); - List actions = actionsRepository.findByCaseIdAndTimeStamp("b06e0847-0d68-4f5c-9288-58bc394fe052", 0l); - for (Action action : actions) - assertFalse(action.getIsActionActive()); - } - - @Test - public void testAddOrUpdateAlert() { - Action action = new Action("bshjfsdf-sdfsd9-42642-ssf", "tester1", - ActionData.markAlertAsClosed("OPV 1", "2018-03-23")); - actionsRepository.addOrUpdateAlert(action); - assertEquals(35, actionsRepository.getAll().size()); - - action = actionsRepository.findByCaseIdAndTimeStamp("bshjfsdf-sdfsd9-42642-ssf", 0l).get(0); - assertEquals("OPV 1", action.data().get("visitCode")); - assertEquals("2018-03-23", action.data().get("completionDate")); - assertEquals("closeAlert", action.getActionType()); - - action.getDetails().put("tag", "1234"); - String today = new LocalDate().toString(); - action.data().put("expiryDate", today); - - actionsRepository.addOrUpdateAlert(action); - - assertEquals(35, actionsRepository.getAll().size()); - Action updatedAction = actionsRepository.findByCaseIdAndTimeStamp("bshjfsdf-sdfsd9-42642-ssf", 0l).get(0); - assertEquals("1234", updatedAction.getDetails().get("tag")); - assertEquals(today, updatedAction.data().get("expiryDate")); - - } - - @Test - public void testMarkAlertAsInactiveFor() { - String provider = "biddemo"; - String entityId = "b06e0847-0d68-4f5c-9288-58bc394fe052"; - String schedule = "BCG"; - actionsRepository.markAlertAsInactiveFor(provider, entityId, schedule); - List actions = actionsRepository.findAlertByANMIdEntityIdScheduleName(provider, entityId, schedule); - for (Action action : actions) - assertFalse(action.getIsActionActive()); - } - - @Test - public void testFindByCriteria() { - - long now = System.currentTimeMillis(); - Action action = new Action("bshdsf989-32hjh-d9-42642-ssf", "tester1", - ActionData.markAlertAsClosed("OPV 2", "2018-04-23")); - actionsRepository.addOrUpdateAlert(action); - - assertEquals(34, actionsRepository.findByCriteria(null, "biddemo", 0, null, null, 50).size()); - - assertEquals(35, actionsRepository.findByCriteria("biddemo,tester1", "biddemo", 0, null, null, 50).size()); - - assertEquals(35, actionsRepository.findByCriteria("biddemo,tester1", null, 0, null, null, 50).size()); - - assertEquals(5, actionsRepository.findByCriteria("biddemo,tester1", null, 0, "server_version", "desc", 5).size()); - - List actions = actionsRepository.findByCriteria("biddemo,tester1", null, now, null, null, 50); - assertEquals(1, actions.size()); - - assertEquals("bshdsf989-32hjh-d9-42642-ssf", actions.get(0).baseEntityId()); - assertEquals("OPV 2", actions.get(0).data().get("visitCode")); - assertEquals("2018-04-23", actions.get(0).data().get("completionDate")); - } - - @Test - public void testFindAllActionNotExpired() { - List actions = actionsRepository.findAllActionNotExpired(); - assertEquals(1, actions.size()); - assertEquals("05934ae338431f28bf6793b2417dba2d", actions.get(0).getId()); - - } + + @Autowired + @Qualifier("actionsRepositoryPostgres") + private ActionsRepository actionsRepository; + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("action.sql"); + return scripts; + } + + @Test + public void testGet() { + Action action = actionsRepository.get("05934ae338431f28bf6793b2417c98f9"); + assertEquals(6, action.data().size()); + assertEquals("PENTA 1", action.data().get("scheduleName")); + assertEquals("2018-02-22", action.data().get("startDate")); + assertEquals("aabcd2cc-c111-41c6-85e6-cb5d9e350d08", action.baseEntityId()); + + //missing action + assertNull(actionsRepository.get("05934ae338431f28bf6793b241")); + } + + @Test + public void testAdd() { + Action action = new Action("bshjfsdf-sdfsd9-4243-ssf", "tester", ActionData.markAlertAsClosed("BCG", "2018-02-23")); + actionsRepository.add(action); + assertEquals(35, actionsRepository.getAll().size()); + + action = actionsRepository.findByCaseIdAndTimeStamp("bshjfsdf-sdfsd9-4243-ssf", 0l).get(0); + assertEquals("BCG", action.data().get("visitCode")); + assertEquals("2018-02-23", action.data().get("completionDate")); + assertEquals("closeAlert", action.getActionType()); + + } + + @Test + public void testUpdate() { + Action action = actionsRepository.get("05934ae338431f28bf6793b2417c98f9"); + action.getDetails().put("Key11", "Baby123"); + String today = new LocalDate().toString(); + action.data().put("expiryDate", today); + + actionsRepository.update(action); + + Action updatedAction = actionsRepository.get("05934ae338431f28bf6793b2417c98f9"); + assertEquals("Baby123", updatedAction.getDetails().get("Key11")); + assertEquals(today, updatedAction.data().get("expiryDate")); + + } + + @Test + public void testGetAll() { + assertEquals(34, actionsRepository.getAll().size()); + + actionsRepository.safeRemove(actionsRepository.get("05934ae338431f28bf6793b2417c98f9")); + + List actions = actionsRepository.getAll(); + assertEquals(33, actions.size()); + + List ids = Arrays.asList("05934ae338431f28bf6793b241645f1f", "05934ae338431f28bf6793b24164a5d7", + "05934ae338431f28bf6793b2417c5aae"); + int found = 0; + for (Action act : actions) { + assertNotEquals("05934ae338431f28bf6793b2417c98f9", act.getId()); + if (ids.contains(act.getId())) + found++; + } + assertEquals(3, found); + + } + + @Test + public void testSafeRemove() { + + Action action = actionsRepository.get("05934ae338431f28bf6793b2417c7d94"); + actionsRepository.safeRemove(action); + + List actions = actionsRepository.getAll(); + assertEquals(33, actions.size()); + + for (Action act : actions) { + assertNotEquals("05934ae338431f28bf6793b2417c7d94", act.getId()); + } + + assertNull(actionsRepository.get("05934ae338431f28bf6793b2417c7d94")); + } + + @Test + public void testFindByProviderIdAndTimeStamp() { + assertEquals(34, actionsRepository.findByProviderIdAndTimeStamp("biddemo", 0l).size()); + + assertEquals(24, actionsRepository.findByProviderIdAndTimeStamp("biddemo", 1520932703825l).size()); + + List actions = actionsRepository.findByProviderIdAndTimeStamp("biddemo", 1520978414513l); + assertEquals(1, actions.size()); + assertEquals("05934ae338431f28bf6793b2417da475", actions.get(0).getId()); + + assertTrue(actionsRepository.findByProviderIdAndTimeStamp("biddeo", 0l).isEmpty()); + + assertTrue(actionsRepository.findByProviderIdAndTimeStamp("biddemo", System.currentTimeMillis()).isEmpty()); + } + + @Test + public void findAlertByANMIdEntityIdScheduleName() { + List actions = actionsRepository.findAlertByANMIdEntityIdScheduleName("biddemo", + "b06e0847-0d68-4f5c-9288-58bc394fe052", "BCG"); + assertEquals(1, actions.size()); + assertEquals("05934ae338431f28bf6793b2417db6ca", actions.get(0).getId()); + assertEquals("2018-01-11", actions.get(0).data().get("startDate")); + assertEquals("05934ae338431f28bf6793b2417db6ca", actions.get(0).getId()); + + assertTrue(actionsRepository + .findAlertByANMIdEntityIdScheduleName("biddemo", "b06e0847-0d68-4f5c-9288-58bc394fe052", "OPV 2").isEmpty()); + } + + @Test + public void testFindByCaseIdScheduleAndTimeStamp() { + List actions = actionsRepository.findByCaseIdScheduleAndTimeStamp("b06e0847-0d68-4f5c-9288-58bc394fe052", + "BCG", new DateTime("2018-03-13"), new DateTime()); + assertEquals(1, actions.size()); + assertEquals("05934ae338431f28bf6793b2417db6ca", actions.get(0).getId()); + assertEquals("2018-01-11", actions.get(0).data().get("startDate")); + assertEquals("05934ae338431f28bf6793b2417db6ca", actions.get(0).getId()); + + assertTrue(actionsRepository.findByCaseIdScheduleAndTimeStamp("b06e0847-0d68-4f5c-9288-58bc394fe052", "BCG", + new DateTime("2018-03-20"), new DateTime()).isEmpty()); + } + + @Test + public void testFindByCaseIdAndTimeStamp() { + List actions = actionsRepository.findByCaseIdAndTimeStamp("b06e0847-0d68-4f5c-9288-58bc394fe052", + new DateTime("2018-03-13").getMillis()); + assertEquals(5, actions.size()); + + actions = actionsRepository.findByCaseIdAndTimeStamp("b06e0847-0d68-4f5c-9288-58bc394fe052", 1520978414514l); + assertEquals("05934ae338431f28bf6793b2417da475", actions.get(0).getId()); + assertEquals("2018-02-22", actions.get(0).data().get("startDate")); + assertEquals("pcv1", actions.get(0).data().get("visitCode")); + + assertTrue(actionsRepository.findByCaseIdScheduleAndTimeStamp("b06e0847-0d68-4f5c-9288-58bc394fe052", "BCG", + new DateTime("2018-03-20"), new DateTime()).isEmpty()); + } + + @Test + public void testDeleteAllByTarget() { + actionsRepository.deleteAllByTarget("alert"); + assertTrue(actionsRepository.getAll().isEmpty()); + } + + @Test + public void testMarkAllAsInActiveFor() { + actionsRepository.markAllAsInActiveFor("b06e0847-0d68-4f5c-9288-58bc394fe052"); + List actions = actionsRepository.findByCaseIdAndTimeStamp("b06e0847-0d68-4f5c-9288-58bc394fe052", 0l); + for (Action action : actions) + assertFalse(action.getIsActionActive()); + } + + @Test + public void testAddOrUpdateAlert() { + Action action = new Action("bshjfsdf-sdfsd9-42642-ssf", "tester1", + ActionData.markAlertAsClosed("OPV 1", "2018-03-23")); + actionsRepository.addOrUpdateAlert(action); + assertEquals(35, actionsRepository.getAll().size()); + + action = actionsRepository.findByCaseIdAndTimeStamp("bshjfsdf-sdfsd9-42642-ssf", 0l).get(0); + assertEquals("OPV 1", action.data().get("visitCode")); + assertEquals("2018-03-23", action.data().get("completionDate")); + assertEquals("closeAlert", action.getActionType()); + + action.getDetails().put("tag", "1234"); + String today = new LocalDate().toString(); + action.data().put("expiryDate", today); + + actionsRepository.addOrUpdateAlert(action); + + assertEquals(35, actionsRepository.getAll().size()); + Action updatedAction = actionsRepository.findByCaseIdAndTimeStamp("bshjfsdf-sdfsd9-42642-ssf", 0l).get(0); + assertEquals("1234", updatedAction.getDetails().get("tag")); + assertEquals(today, updatedAction.data().get("expiryDate")); + + } + + @Test + public void testMarkAlertAsInactiveFor() { + String provider = "biddemo"; + String entityId = "b06e0847-0d68-4f5c-9288-58bc394fe052"; + String schedule = "BCG"; + actionsRepository.markAlertAsInactiveFor(provider, entityId, schedule); + List actions = actionsRepository.findAlertByANMIdEntityIdScheduleName(provider, entityId, schedule); + for (Action action : actions) + assertFalse(action.getIsActionActive()); + } + + @Test + public void testFindByCriteria() { + + long now = System.currentTimeMillis(); + Action action = new Action("bshdsf989-32hjh-d9-42642-ssf", "tester1", + ActionData.markAlertAsClosed("OPV 2", "2018-04-23")); + actionsRepository.addOrUpdateAlert(action); + + assertEquals(34, actionsRepository.findByCriteria(null, "biddemo", 0, null, null, 50).size()); + + assertEquals(35, actionsRepository.findByCriteria("biddemo,tester1", "biddemo", 0, null, null, 50).size()); + + assertEquals(35, actionsRepository.findByCriteria("biddemo,tester1", null, 0, null, null, 50).size()); + + assertEquals(5, actionsRepository.findByCriteria("biddemo,tester1", null, 0, "server_version", "desc", 5).size()); + + List actions = actionsRepository.findByCriteria("biddemo,tester1", null, now, null, null, 50); + assertEquals(1, actions.size()); + + assertEquals("bshdsf989-32hjh-d9-42642-ssf", actions.get(0).baseEntityId()); + assertEquals("OPV 2", actions.get(0).data().get("visitCode")); + assertEquals("2018-04-23", actions.get(0).data().get("completionDate")); + } + + @Test + public void testFindAllActionNotExpired() { + List actions = actionsRepository.findAllActionNotExpired(); + assertEquals(1, actions.size()); + assertEquals("05934ae338431f28bf6793b2417dba2d", actions.get(0).getId()); + + } } diff --git a/src/test/java/org/opensrp/repository/postgres/AlertsRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/AlertsRepositoryTest.java index d6e6bc69a..7ae011711 100644 --- a/src/test/java/org/opensrp/repository/postgres/AlertsRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/AlertsRepositoryTest.java @@ -21,301 +21,301 @@ import org.springframework.beans.factory.annotation.Qualifier; public class AlertsRepositoryTest extends BaseRepositoryTest { - - @Autowired - @Qualifier("alertsRepositoryPostgres") - private AlertsRepository alertsRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("alert.sql"); - return scripts; - } - - @Test - public void testGet() { - Alert alert = alertsRepository.get("170c64f5-a187-4c90-b76d-09ff14d5e280"); - assertEquals("06e4d8c0-f3ff-458c-8141-53d199355c7a", alert.entityId()); - assertEquals("PCV 3", alert.getTriggerName()); - assertEquals(1521756016156l, alert.timestamp()); - - assertNull(alertsRepository.get("170c64f5-nbnsd8-sdfds-234-09ff14d5e280")); - } - - @Test - public void testAdd() { - Alert alert = new Alert("tester1", "ssdf-mn878-jsdjsd-kn", "child", AlertType.notification, TriggerType.schedule, - "BCG 2", "b2g2", new DateTime("2017-08-22"), new DateTime("2018-02-22"), AlertStatus.normal, null); - alertsRepository.add(alert); - assertEquals(16, alertsRepository.getAll().size()); - Alert savedAlert = alertsRepository.findActiveAlertByEntityId("ssdf-mn878-jsdjsd-kn").get(0); - assertEquals("2017-08-22", savedAlert.startDate()); - assertEquals("2018-02-22", savedAlert.expiryDate()); - } - - @Test - public void testUpdate() { - Alert alert = alertsRepository.findActiveAlertByEntityId("4a2a4ad9-cd29-47cb-bdb9-5b617a73b898").get(0); - alert.setClosingPeriod("closingPresiod"); - alert.setDateClosed("2017-09-18"); - alert.setReasonClosed("Test closing"); - long timeStamp = System.currentTimeMillis(); - alert.setTimeStamp(timeStamp); - - alertsRepository.update(alert); - - Alert updatedAlert = alertsRepository.findActiveAlertByEntityId("4a2a4ad9-cd29-47cb-bdb9-5b617a73b898").get(0); - assertEquals("closingPresiod", updatedAlert.closingPeriod()); - assertEquals("2017-09-18", updatedAlert.getDateClosed()); - assertEquals("Test closing", updatedAlert.getReasonClosed()); - assertEquals(timeStamp, updatedAlert.timestamp()); - } - - @Test - public void testGetAll() { - assertEquals(15, alertsRepository.getAll().size()); - - alertsRepository.safeRemove(alertsRepository.get("f210392d-2905-458a-8301-5a7fb844c448")); - - List alerts = alertsRepository.getAll(); - assertEquals(14, alerts.size()); - - for (Alert alert : alerts) - assertNotEquals("f210392d-2905-458a-8301-5a7fb844c448", alert.getId()); - } - - @Test - public void testSafeRemove() { - Alert alert = alertsRepository.findActiveAlertByEntityId("4a2a4ad9-cd29-47cb-bdb9-5b617a73b898").get(0); - alertsRepository.safeRemove(alert); - assertEquals(14, alertsRepository.getAll().size()); - - assertTrue(alertsRepository.findActiveAlertByEntityId("4a2a4ad9-cd29-47cb-bdb9-5b617a73b898").isEmpty()); - - for (Alert alert_ : alertsRepository.getAll()) - assertNotEquals("4a2a4ad9-cd29-47cb-bdb9-5b617a73b898", alert_.entityId()); - } - - @Test - public void testFindByProviderAndTimestamp() { - assertEquals(8, alertsRepository.findActiveByProviderAndTimestamp("biddemo", 0l).size()); - - assertEquals(4, alertsRepository.findActiveByProviderAndTimestamp("biddemo", 1521842403899l).size()); - - List alerts = alertsRepository.findActiveByProviderAndTimestamp("biddemo", 1522188003908l); - - assertEquals(1, alerts.size()); - assertEquals("01741058-588c-4105-b2e4-6e5ae47f4880", alerts.get(0).getId()); - - assertTrue(alertsRepository.findActiveByProviderAndTimestamp("biddemo1", 0l).isEmpty()); - - assertTrue(alertsRepository.findActiveByProviderAndTimestamp("biddemo", System.currentTimeMillis()).isEmpty()); - } - - @Test - public void testFindActiveByProviderAndTimestamp() { - assertEquals(8, alertsRepository.findActiveByProviderAndTimestamp("biddemo", 0l).size()); - - alertsRepository.markAllAsClosedFor("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "testing"); - - assertEquals(3, alertsRepository.findActiveByProviderAndTimestamp("biddemo", 0l).size()); - - List alerts = alertsRepository.findActiveByProviderAndTimestamp("biddemo", 1520978414377l); - assertEquals(2, alerts.size()); - for (Alert alert : alerts) { - assertTrue(alert.getTimeStamp() > 1520978414377l); - assertEquals("biddemo", alert.providerId()); - } - - assertTrue(alertsRepository.findActiveByProviderAndTimestamp("biddemo1", 0l).isEmpty()); - - assertTrue(alertsRepository.findActiveByProviderAndTimestamp("biddemo", System.currentTimeMillis()).isEmpty()); - - } - - @Test - public void testFindAlertByProviderEntityIdTriggerName() { - - List alerts = alertsRepository.findAlertByProviderEntityIdTriggerName("biddemo", - "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PCV 1"); - assertEquals(1, alerts.size()); - assertEquals("f210392d-2905-458a-8301-5a7fb844c448", alerts.get(0).getId()); - - alerts = alertsRepository.findAlertByProviderEntityIdTriggerName("biddemo", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", - "PENTA 2"); - assertEquals(1, alerts.size()); - assertEquals("52e33167-4b64-4189-bf0c-e7a916815bc9", alerts.get(0).getId()); - - assertTrue(alertsRepository - .findAlertByProviderEntityIdTriggerName("biddemo1", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2") - .isEmpty()); - - assertTrue(alertsRepository - .findAlertByProviderEntityIdTriggerName("biddemo", "01a12dba-d25e-451-cfa8cf5ebf40", "PENTA 2").isEmpty()); - assertTrue(alertsRepository - .findAlertByProviderEntityIdTriggerName("biddemo", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "BCG").isEmpty()); - } - - @Test - public void testFindActiveAlertByProviderEntityIdTriggerName() { - List alerts = alertsRepository.findActiveAlertByProviderEntityIdTriggerName("biddemo", - "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PCV 1"); - assertEquals(1, alerts.size()); - assertEquals("f210392d-2905-458a-8301-5a7fb844c448", alerts.get(0).getId()); - - alerts = alertsRepository.findActiveAlertByProviderEntityIdTriggerName("biddemo", - "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2"); - assertEquals(1, alerts.size()); - assertEquals("52e33167-4b64-4189-bf0c-e7a916815bc9", alerts.get(0).getId()); - - alertsRepository.markAlertAsCompleteFor("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2", "2018-03-31"); - - assertTrue(alertsRepository - .findActiveAlertByProviderEntityIdTriggerName("biddemo", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2") - .isEmpty()); - - assertTrue(alertsRepository - .findActiveAlertByProviderEntityIdTriggerName("biddemo1", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2") - .isEmpty()); - - assertTrue(alertsRepository - .findActiveAlertByProviderEntityIdTriggerName("biddemo", "01a12dba-d25e-451-cfa8cf5ebf40", "PENTA 2") - .isEmpty()); - assertTrue(alertsRepository - .findActiveAlertByProviderEntityIdTriggerName("biddemo", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "BCG") - .isEmpty()); - } - - @Test - public void testFindActiveAlertByEntityIdTriggerName() { - List alerts = alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", - "PCV 1"); - assertEquals(1, alerts.size()); - assertEquals("f210392d-2905-458a-8301-5a7fb844c448", alerts.get(0).getId()); - - alerts = alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2"); - assertEquals(1, alerts.size()); - assertEquals("52e33167-4b64-4189-bf0c-e7a916815bc9", alerts.get(0).getId()); - - alertsRepository.markAlertAsCompleteFor("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2", "2018-03-31"); - - assertTrue(alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2") - .isEmpty()); - - assertTrue( - alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-451-cfa8cf5ebf40", "PENTA 2").isEmpty()); - assertTrue( - alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "BCG").isEmpty()); - } - - @Test - public void testFindActiveAlertByEntityId() { - List alerts = alertsRepository.findActiveAlertByEntityId("06e4d8c0-f3ff-458c-8141-53d199355c7a"); - assertEquals(3, alerts.size()); - - for (Alert alert : alerts) { - assertEquals("06e4d8c0-f3ff-458c-8141-53d199355c7a", alert.entityId()); - assertTrue(alert.isActive()); - } - - alertsRepository.markAllAsClosedFor("06e4d8c0-f3ff-458c-8141-53d199355c7a", "testing"); - - assertTrue(alertsRepository.findActiveAlertByEntityId("06e4d8c0-f3ff-458c-8141-53d199355c7a").isEmpty()); - - assertTrue(alertsRepository.findActiveAlertByEntityId("06e4d8c0-f3ff-453kk-kjj1-53d199355c7a").isEmpty()); - } - - @Test - public void testFindByEntityIdTriggerAndTimeStamp() { - List alerts = alertsRepository.findByEntityIdTriggerAndTimeStamp("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", - "PCV 1", new DateTime(0), new DateTime()); - assertEquals(1, alerts.size()); - assertEquals("f210392d-2905-458a-8301-5a7fb844c448", alerts.get(0).getId()); - - alertsRepository.markAlertAsCompleteFor("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PCV 1", "2018-03-31"); - - assertTrue(alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PCV 1") - .isEmpty()); - - assertTrue(alertsRepository.findByEntityIdTriggerAndTimeStamp("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PCV 1", - new DateTime(1521842403913l), new DateTime()).isEmpty()); - assertTrue(alertsRepository.findByEntityIdTriggerAndTimeStamp("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "BCG", - new DateTime(1521842403913l), new DateTime()).isEmpty()); - - } - - @Test - public void testMarkAllAsClosedFor() { - alertsRepository.markAllAsClosedFor("06e4d8c0-f3ff-458c-8141-53d199355c7a", "DYuyi"); - assertFalse(alertsRepository.get("89bcc696-9491-4b03-8064-d7752b0cb12a").isActive()); - assertTrue(alertsRepository.findActiveAlertByEntityId("06e4d8c0-f3ff-458c-8141-53d199355c7a").isEmpty()); - } - - @Test - public void testMarkAlertAsClosedFor() { - alertsRepository.markAlertAsClosedFor("biddemo", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2", - "Testing Close!!"); - - assertTrue(alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2") - .isEmpty()); - - Alert alert = alertsRepository.get("52e33167-4b64-4189-bf0c-e7a916815bc9"); - assertEquals(false, alert.isActive()); - assertEquals("Testing Close!!", alert.getReasonClosed()); - assertEquals(AlertStatus.closed.name(), alert.getAlertStatus()); - } - - @Test - public void testMarkAlertAsCompleteFor() { - alertsRepository.markAlertAsCompleteFor("biddemo", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2", "2018-03-27"); - - assertTrue(alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2") - .isEmpty()); - - Alert alert = alertsRepository.get("52e33167-4b64-4189-bf0c-e7a916815bc9"); - assertEquals(false, alert.isActive()); - assertEquals("2018-03-27", alert.getDateComplete()); - assertEquals(AlertStatus.complete.name(), alert.getAlertStatus()); - } - - @Test - public void testMarkAlertAsCompleteForWithoutProvider() { - alertsRepository.markAlertAsCompleteFor("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2", "2018-03-27"); - - assertTrue(alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2") - .isEmpty()); - - Alert alert = alertsRepository.get("52e33167-4b64-4189-bf0c-e7a916815bc9"); - assertEquals(false, alert.isActive()); - assertEquals("2018-03-27", alert.getDateComplete()); - assertEquals(AlertStatus.complete.name(), alert.getAlertStatus()); - } - - @Test - public void testAddOrUpdateScheduleNotificationAlert() { - //test update - alertsRepository.addOrUpdateScheduleNotificationAlert("vaccination", "06e4d8c0-f3ff-458c-8141-53d199355c7a", "DYuyi", - "OPV 3", "opv3", AlertStatus.upcoming, new DateTime("2018-04-28"), new DateTime("2021-02-19")); - - Alert alert = alertsRepository.findActiveAlertByEntityIdTriggerName("06e4d8c0-f3ff-458c-8141-53d199355c7a", "OPV 3") - .get(0); - assertEquals(new DateTime("2018-04-28").toString(), alert.getStartDate()); - assertEquals(new DateTime("2021-02-19").toString(), alert.getExpiryDate()); - assertEquals(AlertStatus.upcoming.name(), alert.getAlertStatus()); - - assertEquals(15, alertsRepository.getAll().size()); - - //test add - alertsRepository.addOrUpdateScheduleNotificationAlert("vaccination", "06e4d8c0-f3ff-458c-8141-53d199355c7a", "DYuyi", - "OPV 4", "opv4", AlertStatus.urgent, new DateTime("2017-01-21"), new DateTime("2020-05-09")); - - alert = alertsRepository.findActiveAlertByEntityIdTriggerName("06e4d8c0-f3ff-458c-8141-53d199355c7a", "OPV 4") - .get(0); - assertEquals("2017-01-21", alert.getStartDate()); - assertEquals("2020-05-09", alert.getExpiryDate()); - assertEquals(AlertStatus.urgent.name(), alert.getAlertStatus()); - - assertEquals(16, alertsRepository.getAll().size()); - } + + @Autowired + @Qualifier("alertsRepositoryPostgres") + private AlertsRepository alertsRepository; + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("alert.sql"); + return scripts; + } + + @Test + public void testGet() { + Alert alert = alertsRepository.get("170c64f5-a187-4c90-b76d-09ff14d5e280"); + assertEquals("06e4d8c0-f3ff-458c-8141-53d199355c7a", alert.entityId()); + assertEquals("PCV 3", alert.getTriggerName()); + assertEquals(1521756016156l, alert.timestamp()); + + assertNull(alertsRepository.get("170c64f5-nbnsd8-sdfds-234-09ff14d5e280")); + } + + @Test + public void testAdd() { + Alert alert = new Alert("tester1", "ssdf-mn878-jsdjsd-kn", "child", AlertType.notification, TriggerType.schedule, + "BCG 2", "b2g2", new DateTime("2017-08-22"), new DateTime("2018-02-22"), AlertStatus.normal, null); + alertsRepository.add(alert); + assertEquals(16, alertsRepository.getAll().size()); + Alert savedAlert = alertsRepository.findActiveAlertByEntityId("ssdf-mn878-jsdjsd-kn").get(0); + assertEquals("2017-08-22", savedAlert.startDate()); + assertEquals("2018-02-22", savedAlert.expiryDate()); + } + + @Test + public void testUpdate() { + Alert alert = alertsRepository.findActiveAlertByEntityId("4a2a4ad9-cd29-47cb-bdb9-5b617a73b898").get(0); + alert.setClosingPeriod("closingPresiod"); + alert.setDateClosed("2017-09-18"); + alert.setReasonClosed("Test closing"); + long timeStamp = System.currentTimeMillis(); + alert.setTimeStamp(timeStamp); + + alertsRepository.update(alert); + + Alert updatedAlert = alertsRepository.findActiveAlertByEntityId("4a2a4ad9-cd29-47cb-bdb9-5b617a73b898").get(0); + assertEquals("closingPresiod", updatedAlert.closingPeriod()); + assertEquals("2017-09-18", updatedAlert.getDateClosed()); + assertEquals("Test closing", updatedAlert.getReasonClosed()); + assertEquals(timeStamp, updatedAlert.timestamp()); + } + + @Test + public void testGetAll() { + assertEquals(15, alertsRepository.getAll().size()); + + alertsRepository.safeRemove(alertsRepository.get("f210392d-2905-458a-8301-5a7fb844c448")); + + List alerts = alertsRepository.getAll(); + assertEquals(14, alerts.size()); + + for (Alert alert : alerts) + assertNotEquals("f210392d-2905-458a-8301-5a7fb844c448", alert.getId()); + } + + @Test + public void testSafeRemove() { + Alert alert = alertsRepository.findActiveAlertByEntityId("4a2a4ad9-cd29-47cb-bdb9-5b617a73b898").get(0); + alertsRepository.safeRemove(alert); + assertEquals(14, alertsRepository.getAll().size()); + + assertTrue(alertsRepository.findActiveAlertByEntityId("4a2a4ad9-cd29-47cb-bdb9-5b617a73b898").isEmpty()); + + for (Alert alert_ : alertsRepository.getAll()) + assertNotEquals("4a2a4ad9-cd29-47cb-bdb9-5b617a73b898", alert_.entityId()); + } + + @Test + public void testFindByProviderAndTimestamp() { + assertEquals(8, alertsRepository.findActiveByProviderAndTimestamp("biddemo", 0l).size()); + + assertEquals(4, alertsRepository.findActiveByProviderAndTimestamp("biddemo", 1521842403899l).size()); + + List alerts = alertsRepository.findActiveByProviderAndTimestamp("biddemo", 1522188003908l); + + assertEquals(1, alerts.size()); + assertEquals("01741058-588c-4105-b2e4-6e5ae47f4880", alerts.get(0).getId()); + + assertTrue(alertsRepository.findActiveByProviderAndTimestamp("biddemo1", 0l).isEmpty()); + + assertTrue(alertsRepository.findActiveByProviderAndTimestamp("biddemo", System.currentTimeMillis()).isEmpty()); + } + + @Test + public void testFindActiveByProviderAndTimestamp() { + assertEquals(8, alertsRepository.findActiveByProviderAndTimestamp("biddemo", 0l).size()); + + alertsRepository.markAllAsClosedFor("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "testing"); + + assertEquals(3, alertsRepository.findActiveByProviderAndTimestamp("biddemo", 0l).size()); + + List alerts = alertsRepository.findActiveByProviderAndTimestamp("biddemo", 1520978414377l); + assertEquals(2, alerts.size()); + for (Alert alert : alerts) { + assertTrue(alert.getTimeStamp() > 1520978414377l); + assertEquals("biddemo", alert.providerId()); + } + + assertTrue(alertsRepository.findActiveByProviderAndTimestamp("biddemo1", 0l).isEmpty()); + + assertTrue(alertsRepository.findActiveByProviderAndTimestamp("biddemo", System.currentTimeMillis()).isEmpty()); + + } + + @Test + public void testFindAlertByProviderEntityIdTriggerName() { + + List alerts = alertsRepository.findAlertByProviderEntityIdTriggerName("biddemo", + "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PCV 1"); + assertEquals(1, alerts.size()); + assertEquals("f210392d-2905-458a-8301-5a7fb844c448", alerts.get(0).getId()); + + alerts = alertsRepository.findAlertByProviderEntityIdTriggerName("biddemo", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", + "PENTA 2"); + assertEquals(1, alerts.size()); + assertEquals("52e33167-4b64-4189-bf0c-e7a916815bc9", alerts.get(0).getId()); + + assertTrue(alertsRepository + .findAlertByProviderEntityIdTriggerName("biddemo1", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2") + .isEmpty()); + + assertTrue(alertsRepository + .findAlertByProviderEntityIdTriggerName("biddemo", "01a12dba-d25e-451-cfa8cf5ebf40", "PENTA 2").isEmpty()); + assertTrue(alertsRepository + .findAlertByProviderEntityIdTriggerName("biddemo", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "BCG").isEmpty()); + } + + @Test + public void testFindActiveAlertByProviderEntityIdTriggerName() { + List alerts = alertsRepository.findActiveAlertByProviderEntityIdTriggerName("biddemo", + "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PCV 1"); + assertEquals(1, alerts.size()); + assertEquals("f210392d-2905-458a-8301-5a7fb844c448", alerts.get(0).getId()); + + alerts = alertsRepository.findActiveAlertByProviderEntityIdTriggerName("biddemo", + "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2"); + assertEquals(1, alerts.size()); + assertEquals("52e33167-4b64-4189-bf0c-e7a916815bc9", alerts.get(0).getId()); + + alertsRepository.markAlertAsCompleteFor("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2", "2018-03-31"); + + assertTrue(alertsRepository + .findActiveAlertByProviderEntityIdTriggerName("biddemo", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2") + .isEmpty()); + + assertTrue(alertsRepository + .findActiveAlertByProviderEntityIdTriggerName("biddemo1", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2") + .isEmpty()); + + assertTrue(alertsRepository + .findActiveAlertByProviderEntityIdTriggerName("biddemo", "01a12dba-d25e-451-cfa8cf5ebf40", "PENTA 2") + .isEmpty()); + assertTrue(alertsRepository + .findActiveAlertByProviderEntityIdTriggerName("biddemo", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "BCG") + .isEmpty()); + } + + @Test + public void testFindActiveAlertByEntityIdTriggerName() { + List alerts = alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", + "PCV 1"); + assertEquals(1, alerts.size()); + assertEquals("f210392d-2905-458a-8301-5a7fb844c448", alerts.get(0).getId()); + + alerts = alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2"); + assertEquals(1, alerts.size()); + assertEquals("52e33167-4b64-4189-bf0c-e7a916815bc9", alerts.get(0).getId()); + + alertsRepository.markAlertAsCompleteFor("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2", "2018-03-31"); + + assertTrue(alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2") + .isEmpty()); + + assertTrue( + alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-451-cfa8cf5ebf40", "PENTA 2").isEmpty()); + assertTrue( + alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "BCG").isEmpty()); + } + + @Test + public void testFindActiveAlertByEntityId() { + List alerts = alertsRepository.findActiveAlertByEntityId("06e4d8c0-f3ff-458c-8141-53d199355c7a"); + assertEquals(3, alerts.size()); + + for (Alert alert : alerts) { + assertEquals("06e4d8c0-f3ff-458c-8141-53d199355c7a", alert.entityId()); + assertTrue(alert.isActive()); + } + + alertsRepository.markAllAsClosedFor("06e4d8c0-f3ff-458c-8141-53d199355c7a", "testing"); + + assertTrue(alertsRepository.findActiveAlertByEntityId("06e4d8c0-f3ff-458c-8141-53d199355c7a").isEmpty()); + + assertTrue(alertsRepository.findActiveAlertByEntityId("06e4d8c0-f3ff-453kk-kjj1-53d199355c7a").isEmpty()); + } + + @Test + public void testFindByEntityIdTriggerAndTimeStamp() { + List alerts = alertsRepository.findByEntityIdTriggerAndTimeStamp("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", + "PCV 1", new DateTime(0), new DateTime()); + assertEquals(1, alerts.size()); + assertEquals("f210392d-2905-458a-8301-5a7fb844c448", alerts.get(0).getId()); + + alertsRepository.markAlertAsCompleteFor("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PCV 1", "2018-03-31"); + + assertTrue(alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PCV 1") + .isEmpty()); + + assertTrue(alertsRepository.findByEntityIdTriggerAndTimeStamp("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PCV 1", + new DateTime(1521842403913l), new DateTime()).isEmpty()); + assertTrue(alertsRepository.findByEntityIdTriggerAndTimeStamp("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "BCG", + new DateTime(1521842403913l), new DateTime()).isEmpty()); + + } + + @Test + public void testMarkAllAsClosedFor() { + alertsRepository.markAllAsClosedFor("06e4d8c0-f3ff-458c-8141-53d199355c7a", "DYuyi"); + assertFalse(alertsRepository.get("89bcc696-9491-4b03-8064-d7752b0cb12a").isActive()); + assertTrue(alertsRepository.findActiveAlertByEntityId("06e4d8c0-f3ff-458c-8141-53d199355c7a").isEmpty()); + } + + @Test + public void testMarkAlertAsClosedFor() { + alertsRepository.markAlertAsClosedFor("biddemo", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2", + "Testing Close!!"); + + assertTrue(alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2") + .isEmpty()); + + Alert alert = alertsRepository.get("52e33167-4b64-4189-bf0c-e7a916815bc9"); + assertEquals(false, alert.isActive()); + assertEquals("Testing Close!!", alert.getReasonClosed()); + assertEquals(AlertStatus.closed.name(), alert.getAlertStatus()); + } + + @Test + public void testMarkAlertAsCompleteFor() { + alertsRepository.markAlertAsCompleteFor("biddemo", "01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2", "2018-03-27"); + + assertTrue(alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2") + .isEmpty()); + + Alert alert = alertsRepository.get("52e33167-4b64-4189-bf0c-e7a916815bc9"); + assertEquals(false, alert.isActive()); + assertEquals("2018-03-27", alert.getDateComplete()); + assertEquals(AlertStatus.complete.name(), alert.getAlertStatus()); + } + + @Test + public void testMarkAlertAsCompleteForWithoutProvider() { + alertsRepository.markAlertAsCompleteFor("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2", "2018-03-27"); + + assertTrue(alertsRepository.findActiveAlertByEntityIdTriggerName("01a12dba-d25e-4518-8da3-cfa8cf5ebf40", "PENTA 2") + .isEmpty()); + + Alert alert = alertsRepository.get("52e33167-4b64-4189-bf0c-e7a916815bc9"); + assertEquals(false, alert.isActive()); + assertEquals("2018-03-27", alert.getDateComplete()); + assertEquals(AlertStatus.complete.name(), alert.getAlertStatus()); + } + + @Test + public void testAddOrUpdateScheduleNotificationAlert() { + //test update + alertsRepository.addOrUpdateScheduleNotificationAlert("vaccination", "06e4d8c0-f3ff-458c-8141-53d199355c7a", "DYuyi", + "OPV 3", "opv3", AlertStatus.upcoming, new DateTime("2018-04-28"), new DateTime("2021-02-19")); + + Alert alert = alertsRepository.findActiveAlertByEntityIdTriggerName("06e4d8c0-f3ff-458c-8141-53d199355c7a", "OPV 3") + .get(0); + assertEquals(new DateTime("2018-04-28").toString(), alert.getStartDate()); + assertEquals(new DateTime("2021-02-19").toString(), alert.getExpiryDate()); + assertEquals(AlertStatus.upcoming.name(), alert.getAlertStatus()); + + assertEquals(15, alertsRepository.getAll().size()); + + //test add + alertsRepository.addOrUpdateScheduleNotificationAlert("vaccination", "06e4d8c0-f3ff-458c-8141-53d199355c7a", "DYuyi", + "OPV 4", "opv4", AlertStatus.urgent, new DateTime("2017-01-21"), new DateTime("2020-05-09")); + + alert = alertsRepository.findActiveAlertByEntityIdTriggerName("06e4d8c0-f3ff-458c-8141-53d199355c7a", "OPV 4") + .get(0); + assertEquals("2017-01-21", alert.getStartDate()); + assertEquals("2020-05-09", alert.getExpiryDate()); + assertEquals(AlertStatus.urgent.name(), alert.getAlertStatus()); + + assertEquals(16, alertsRepository.getAll().size()); + } } diff --git a/src/test/java/org/opensrp/repository/postgres/AllActionsIntegrationTest.java b/src/test/java/org/opensrp/repository/postgres/AllActionsIntegrationTest.java index 95e6ac94e..291a52dc7 100644 --- a/src/test/java/org/opensrp/repository/postgres/AllActionsIntegrationTest.java +++ b/src/test/java/org/opensrp/repository/postgres/AllActionsIntegrationTest.java @@ -21,218 +21,218 @@ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:test-applicationContext-opensrp.xml") -@ActiveProfiles(profiles = { "jedis"}) +@ActiveProfiles(profiles = {"jedis"}) public class AllActionsIntegrationTest { - - public static final String SCHEDULE_NAME = "Ante Natal Care - Normal"; - - public static final String VISIT_CODE = "ANC 1"; - - @Autowired - private ActionRepositoryImpl allActions; - - @Before - public void setUp() throws Exception { - allActions.removeAll(); - } - - @Test - public void shouldSaveAReminder() throws Exception { - Action alertAction = new Action("Case X", "ANM phone no", alert()); - - allActions.add(alertAction); - - List allTheAlertActionsInDB = allActions.getAll(); - assertEquals(1, allTheAlertActionsInDB.size()); - assertEquals(alertAction, allTheAlertActionsInDB.get(0)); - } - - @Test - public void shouldNotFindAnyAlertsIfNoneExistForGivenANM() throws Exception { - assertEquals(0, allActions.findByProviderIdAndTimeStamp("ANM 1", 0).size()); - } - - @Test - public void shouldReturnAlertActionsBasedOnProviderIdAndTimeStamp() throws Exception { - Action firstAction = new Action("Case X", "ANM 1", alert()); - allActions.add(firstAction); - - Action secondAction = new Action("Case Y", "ANM 1", alert()); - allActions.add(secondAction); - - Action thirdAction = new Action("Case Z", "ANM 1", alert()); - allActions.add(thirdAction); - - assertEquals(asList(firstAction, secondAction, thirdAction), allActions.findByProviderIdAndTimeStamp("ANM 1", 0)); - assertEquals(asList(secondAction, thirdAction), - allActions.findByProviderIdAndTimeStamp("ANM 1", firstAction.getTimestamp())); - assertEquals(asList(thirdAction), allActions.findByProviderIdAndTimeStamp("ANM 1", secondAction.getTimestamp())); - - assertEquals(0, allActions.findByProviderIdAndTimeStamp("ANM 1", thirdAction.getTimestamp()).size()); - } - - @Test - public void shouldReturnAlertActionsBasedOnCaseIdAndScheduleNameAndTimeStamp() throws Exception { - Action firstAction = new Action("Case X", "ANM 1", alert()); - allActions.add(firstAction); - - Action secondAction = new Action("Case X", "ANM 1", alert()); - allActions.add(secondAction); - - Action thirdAction = new Action("Case X", "ANM 1", alert()); - allActions.add(thirdAction); - - assertEquals(asList(firstAction, secondAction, thirdAction), allActions.findByCaseIdScheduleAndTimeStamp("Case X", - SCHEDULE_NAME, new DateTime(0), new DateTime(thirdAction.getTimeStamp()))); - assertEquals(asList(secondAction, thirdAction), allActions.findByCaseIdScheduleAndTimeStamp("Case X", SCHEDULE_NAME, - new DateTime(firstAction.getTimeStamp() + 1), new DateTime(thirdAction.getTimeStamp()))); - assertEquals(asList(thirdAction), allActions.findByCaseIdScheduleAndTimeStamp("Case X", SCHEDULE_NAME, - new DateTime(secondAction.getTimeStamp() + 1), new DateTime(thirdAction.getTimeStamp()))); - assertEquals(0, allActions.findByCaseIdScheduleAndTimeStamp("Case X", SCHEDULE_NAME, - new DateTime(thirdAction.getTimeStamp() + 1), new DateTime(thirdAction.getTimeStamp() + 2)).size()); - } - - @Test - public void shouldReturnAlertActionsBasedOnCaseIdAndTimeStamp() throws Exception { - Action firstAction = new Action("Case X", "ANM 1", alert()); - allActions.add(firstAction); - - Action secondAction = new Action("Case X", "ANM 1", alert()); - allActions.add(secondAction); - - Action thirdAction = new Action("Case X", "ANM 1", alert()); - allActions.add(thirdAction); - - assertEquals(asList(firstAction, secondAction, thirdAction), allActions.findByCaseIdAndTimeStamp("Case X", 0)); - assertEquals(asList(secondAction, thirdAction), - allActions.findByCaseIdAndTimeStamp("Case X", firstAction.getTimestamp() + 1)); - assertEquals(asList(thirdAction), allActions.findByCaseIdAndTimeStamp("Case X", secondAction.getTimestamp() + 1)); - - assertEquals(0, allActions.findByCaseIdAndTimeStamp("Case X", thirdAction.getTimestamp() + 1).size()); - } - - @Test - public void shouldFindAlertsOnlyForTheANMSpecified() throws Exception { - Action firstAction = new Action("Case X", "ANM 1", alert()); - allActions.add(firstAction); - - Action secondAction = new Action("Case Y", "ANM 2", alert()); - allActions.add(secondAction); - - assertEquals(asList(firstAction), allActions.findByProviderIdAndTimeStamp("ANM 1", 0)); - assertEquals(asList(secondAction), allActions.findByProviderIdAndTimeStamp("ANM 2", 0)); - } - - @Test - public void shouldMarkAllActionsAsInActiveForACase() throws Exception { - Action firstAction = new Action("Case X", "ANM 1", alert()); - Action secondAction = new Action("Case X", "ANM 1", alert()); - Action thirdAction = new Action("Case Y", "ANM 2", alert()); - allActions.add(firstAction); - allActions.add(secondAction); - allActions.add(thirdAction); - - allActions.markAllAsInActiveFor("Case X"); - - assertEquals(asList(firstAction.markAsInActive(), secondAction.markAsInActive()), - allActions.findByProviderIdAndTimeStamp("ANM 1", 0)); - assertEquals(asList(thirdAction), allActions.findByProviderIdAndTimeStamp("ANM 2", 0)); - } - - @Test - public void shouldFetchAlertsSortedByTimestamp() throws Exception { - Action earlierAction = new Action("Case X", "ANM 1", alert()); - Thread.sleep(100); - Action laterAction = new Action("Case X", "ANM 1", alert()); - Thread.sleep(100); - Action latestAction = new Action("Case X", "ANM 1", alert()); - - allActions.add(laterAction); - allActions.add(latestAction); - allActions.add(earlierAction); - - assertEquals(asList(earlierAction, laterAction, latestAction), allActions.findByProviderIdAndTimeStamp("ANM 1", 0)); - } - - @Test - public void shouldNotDoAnythingIfNoActionsAreFoundForATarget() { - Action alertAction = new Action("Case X", "ANM 1", alert()); - allActions.add(alertAction); - - allActions.deleteAllByTarget("report"); - - assertEquals(asList(alertAction), allActions.findByProviderIdAndTimeStamp("ANM 1", 0)); - } - - @Test - public void shouldReturnActionBasedOnANMIdEntityIdScheduleName() throws Exception { - Action anmAction = new Action("entity id 1", "anm id 1", alert("schedule1", "milestone1")); - Action anotherANMAction = new Action("entity id 2", "anm id 2", alert("schedule2", "milestone2")); - Action anotherEntityAction = new Action("entity id 2", "anm id 1", alert("schedule1", "milestone1")); - Action anotherScheduleAction = new Action("entity id 1", "anm id 1", alert("schedule2", "milestone1")); - allActions.add(anmAction); - allActions.add(anotherEntityAction); - allActions.add(anotherANMAction); - allActions.add(anotherScheduleAction); - - assertEquals(asList(anmAction), - allActions.findAlertByANMIdEntityIdScheduleName("anm id 1", "entity id 1", "schedule1")); - assertEquals(asList(anotherScheduleAction), - allActions.findAlertByANMIdEntityIdScheduleName("anm id 1", "entity id 1", "schedule2")); - assertEquals(asList(anotherEntityAction), - allActions.findAlertByANMIdEntityIdScheduleName("anm id 1", "entity id 2", "schedule1")); - assertEquals(asList(anotherANMAction), - allActions.findAlertByANMIdEntityIdScheduleName("anm id 2", "entity id 2", "schedule2")); - } - - @Test - public void shouldAllowAddingAnewAlertForExistingAlert() throws Exception { - Action existingAlert = new Action("entity id 1", "anm id 1", alert("schedule1", "milestone1")); - Action existingDifferentScheduleAlert = new Action("entity id 1", "anm id 1", alert("schedule2", "milestone3")); - allActions.add(existingAlert); - allActions.add(existingDifferentScheduleAlert); - - Action newAlert = new Action("entity id 1", "anm id 1", alert("schedule1", "milestone2")); - allActions.addOrUpdateAlert(newAlert); - - assertTrue(allActions.contains(existingAlert.getId())); - assertTrue(allActions.contains(existingDifferentScheduleAlert.getId())); - assertEquals(allActions.findAlertByANMIdEntityIdScheduleName("anm id 1", "entity id 1", "schedule1").get(0).getId(), - existingAlert.getId()); - - assertEquals(allActions.findAlertByANMIdEntityIdScheduleName("anm id 1", "entity id 1", "schedule2").get(0).getId(), - existingDifferentScheduleAlert.getId()); - } - - @Test - public void shouldAddNewAlertWhenThereIsNoExistingAlert() throws Exception { - Action newAlert = new Action("entity id 1", "anm id 1", alert("schedule1", "milestone2")); - allActions.addOrUpdateAlert(newAlert); - - assertTrue(allActions.contains(newAlert.getId())); - } - - @Test - public void shouldUpdateAlertAsAnInactive() { - Action firstAction = new Action("Case X", "ANM 1", alert("schedule1", "milestone1")); - Action secondAction = new Action("Case X", "ANM 1", alert("schedule2", "milestone2")); - allActions.add(firstAction); - allActions.add(secondAction); - - allActions.markAlertAsInactiveFor("ANM 1", "Case X", "schedule1"); - - assertEquals(asList(firstAction.markAsInActive()), - allActions.findAlertByANMIdEntityIdScheduleName("ANM 1", "Case X", "schedule1")); - assertEquals(asList(secondAction), allActions.findAlertByANMIdEntityIdScheduleName("ANM 1", "Case X", "schedule2")); - } - - private ActionData alert() { - return ActionData.createAlert(mother.value(), SCHEDULE_NAME, VISIT_CODE, normal, DateTime.now(), - DateTime.now().plusDays(3)); - } - - private ActionData alert(String schedule, String milestone) { - return ActionData.createAlert(mother.value(), schedule, milestone, normal, DateTime.now(), - DateTime.now().plusDays(3)); - } + + public static final String SCHEDULE_NAME = "Ante Natal Care - Normal"; + + public static final String VISIT_CODE = "ANC 1"; + + @Autowired + private ActionRepositoryImpl allActions; + + @Before + public void setUp() throws Exception { + allActions.removeAll(); + } + + @Test + public void shouldSaveAReminder() throws Exception { + Action alertAction = new Action("Case X", "ANM phone no", alert()); + + allActions.add(alertAction); + + List allTheAlertActionsInDB = allActions.getAll(); + assertEquals(1, allTheAlertActionsInDB.size()); + assertEquals(alertAction, allTheAlertActionsInDB.get(0)); + } + + @Test + public void shouldNotFindAnyAlertsIfNoneExistForGivenANM() throws Exception { + assertEquals(0, allActions.findByProviderIdAndTimeStamp("ANM 1", 0).size()); + } + + @Test + public void shouldReturnAlertActionsBasedOnProviderIdAndTimeStamp() throws Exception { + Action firstAction = new Action("Case X", "ANM 1", alert()); + allActions.add(firstAction); + + Action secondAction = new Action("Case Y", "ANM 1", alert()); + allActions.add(secondAction); + + Action thirdAction = new Action("Case Z", "ANM 1", alert()); + allActions.add(thirdAction); + + assertEquals(asList(firstAction, secondAction, thirdAction), allActions.findByProviderIdAndTimeStamp("ANM 1", 0)); + assertEquals(asList(secondAction, thirdAction), + allActions.findByProviderIdAndTimeStamp("ANM 1", firstAction.getTimestamp())); + assertEquals(asList(thirdAction), allActions.findByProviderIdAndTimeStamp("ANM 1", secondAction.getTimestamp())); + + assertEquals(0, allActions.findByProviderIdAndTimeStamp("ANM 1", thirdAction.getTimestamp()).size()); + } + + @Test + public void shouldReturnAlertActionsBasedOnCaseIdAndScheduleNameAndTimeStamp() throws Exception { + Action firstAction = new Action("Case X", "ANM 1", alert()); + allActions.add(firstAction); + + Action secondAction = new Action("Case X", "ANM 1", alert()); + allActions.add(secondAction); + + Action thirdAction = new Action("Case X", "ANM 1", alert()); + allActions.add(thirdAction); + + assertEquals(asList(firstAction, secondAction, thirdAction), allActions.findByCaseIdScheduleAndTimeStamp("Case X", + SCHEDULE_NAME, new DateTime(0), new DateTime(thirdAction.getTimeStamp()))); + assertEquals(asList(secondAction, thirdAction), allActions.findByCaseIdScheduleAndTimeStamp("Case X", SCHEDULE_NAME, + new DateTime(firstAction.getTimeStamp() + 1), new DateTime(thirdAction.getTimeStamp()))); + assertEquals(asList(thirdAction), allActions.findByCaseIdScheduleAndTimeStamp("Case X", SCHEDULE_NAME, + new DateTime(secondAction.getTimeStamp() + 1), new DateTime(thirdAction.getTimeStamp()))); + assertEquals(0, allActions.findByCaseIdScheduleAndTimeStamp("Case X", SCHEDULE_NAME, + new DateTime(thirdAction.getTimeStamp() + 1), new DateTime(thirdAction.getTimeStamp() + 2)).size()); + } + + @Test + public void shouldReturnAlertActionsBasedOnCaseIdAndTimeStamp() throws Exception { + Action firstAction = new Action("Case X", "ANM 1", alert()); + allActions.add(firstAction); + + Action secondAction = new Action("Case X", "ANM 1", alert()); + allActions.add(secondAction); + + Action thirdAction = new Action("Case X", "ANM 1", alert()); + allActions.add(thirdAction); + + assertEquals(asList(firstAction, secondAction, thirdAction), allActions.findByCaseIdAndTimeStamp("Case X", 0)); + assertEquals(asList(secondAction, thirdAction), + allActions.findByCaseIdAndTimeStamp("Case X", firstAction.getTimestamp() + 1)); + assertEquals(asList(thirdAction), allActions.findByCaseIdAndTimeStamp("Case X", secondAction.getTimestamp() + 1)); + + assertEquals(0, allActions.findByCaseIdAndTimeStamp("Case X", thirdAction.getTimestamp() + 1).size()); + } + + @Test + public void shouldFindAlertsOnlyForTheANMSpecified() throws Exception { + Action firstAction = new Action("Case X", "ANM 1", alert()); + allActions.add(firstAction); + + Action secondAction = new Action("Case Y", "ANM 2", alert()); + allActions.add(secondAction); + + assertEquals(asList(firstAction), allActions.findByProviderIdAndTimeStamp("ANM 1", 0)); + assertEquals(asList(secondAction), allActions.findByProviderIdAndTimeStamp("ANM 2", 0)); + } + + @Test + public void shouldMarkAllActionsAsInActiveForACase() throws Exception { + Action firstAction = new Action("Case X", "ANM 1", alert()); + Action secondAction = new Action("Case X", "ANM 1", alert()); + Action thirdAction = new Action("Case Y", "ANM 2", alert()); + allActions.add(firstAction); + allActions.add(secondAction); + allActions.add(thirdAction); + + allActions.markAllAsInActiveFor("Case X"); + + assertEquals(asList(firstAction.markAsInActive(), secondAction.markAsInActive()), + allActions.findByProviderIdAndTimeStamp("ANM 1", 0)); + assertEquals(asList(thirdAction), allActions.findByProviderIdAndTimeStamp("ANM 2", 0)); + } + + @Test + public void shouldFetchAlertsSortedByTimestamp() throws Exception { + Action earlierAction = new Action("Case X", "ANM 1", alert()); + Thread.sleep(100); + Action laterAction = new Action("Case X", "ANM 1", alert()); + Thread.sleep(100); + Action latestAction = new Action("Case X", "ANM 1", alert()); + + allActions.add(laterAction); + allActions.add(latestAction); + allActions.add(earlierAction); + + assertEquals(asList(earlierAction, laterAction, latestAction), allActions.findByProviderIdAndTimeStamp("ANM 1", 0)); + } + + @Test + public void shouldNotDoAnythingIfNoActionsAreFoundForATarget() { + Action alertAction = new Action("Case X", "ANM 1", alert()); + allActions.add(alertAction); + + allActions.deleteAllByTarget("report"); + + assertEquals(asList(alertAction), allActions.findByProviderIdAndTimeStamp("ANM 1", 0)); + } + + @Test + public void shouldReturnActionBasedOnANMIdEntityIdScheduleName() throws Exception { + Action anmAction = new Action("entity id 1", "anm id 1", alert("schedule1", "milestone1")); + Action anotherANMAction = new Action("entity id 2", "anm id 2", alert("schedule2", "milestone2")); + Action anotherEntityAction = new Action("entity id 2", "anm id 1", alert("schedule1", "milestone1")); + Action anotherScheduleAction = new Action("entity id 1", "anm id 1", alert("schedule2", "milestone1")); + allActions.add(anmAction); + allActions.add(anotherEntityAction); + allActions.add(anotherANMAction); + allActions.add(anotherScheduleAction); + + assertEquals(asList(anmAction), + allActions.findAlertByANMIdEntityIdScheduleName("anm id 1", "entity id 1", "schedule1")); + assertEquals(asList(anotherScheduleAction), + allActions.findAlertByANMIdEntityIdScheduleName("anm id 1", "entity id 1", "schedule2")); + assertEquals(asList(anotherEntityAction), + allActions.findAlertByANMIdEntityIdScheduleName("anm id 1", "entity id 2", "schedule1")); + assertEquals(asList(anotherANMAction), + allActions.findAlertByANMIdEntityIdScheduleName("anm id 2", "entity id 2", "schedule2")); + } + + @Test + public void shouldAllowAddingAnewAlertForExistingAlert() throws Exception { + Action existingAlert = new Action("entity id 1", "anm id 1", alert("schedule1", "milestone1")); + Action existingDifferentScheduleAlert = new Action("entity id 1", "anm id 1", alert("schedule2", "milestone3")); + allActions.add(existingAlert); + allActions.add(existingDifferentScheduleAlert); + + Action newAlert = new Action("entity id 1", "anm id 1", alert("schedule1", "milestone2")); + allActions.addOrUpdateAlert(newAlert); + + assertTrue(allActions.contains(existingAlert.getId())); + assertTrue(allActions.contains(existingDifferentScheduleAlert.getId())); + assertEquals(allActions.findAlertByANMIdEntityIdScheduleName("anm id 1", "entity id 1", "schedule1").get(0).getId(), + existingAlert.getId()); + + assertEquals(allActions.findAlertByANMIdEntityIdScheduleName("anm id 1", "entity id 1", "schedule2").get(0).getId(), + existingDifferentScheduleAlert.getId()); + } + + @Test + public void shouldAddNewAlertWhenThereIsNoExistingAlert() throws Exception { + Action newAlert = new Action("entity id 1", "anm id 1", alert("schedule1", "milestone2")); + allActions.addOrUpdateAlert(newAlert); + + assertTrue(allActions.contains(newAlert.getId())); + } + + @Test + public void shouldUpdateAlertAsAnInactive() { + Action firstAction = new Action("Case X", "ANM 1", alert("schedule1", "milestone1")); + Action secondAction = new Action("Case X", "ANM 1", alert("schedule2", "milestone2")); + allActions.add(firstAction); + allActions.add(secondAction); + + allActions.markAlertAsInactiveFor("ANM 1", "Case X", "schedule1"); + + assertEquals(asList(firstAction.markAsInActive()), + allActions.findAlertByANMIdEntityIdScheduleName("ANM 1", "Case X", "schedule1")); + assertEquals(asList(secondAction), allActions.findAlertByANMIdEntityIdScheduleName("ANM 1", "Case X", "schedule2")); + } + + private ActionData alert() { + return ActionData.createAlert(mother.value(), SCHEDULE_NAME, VISIT_CODE, normal, DateTime.now(), + DateTime.now().plusDays(3)); + } + + private ActionData alert(String schedule, String milestone) { + return ActionData.createAlert(mother.value(), schedule, milestone, normal, DateTime.now(), + DateTime.now().plusDays(3)); + } } diff --git a/src/test/java/org/opensrp/repository/postgres/AllAlertsIntegrationTest.java b/src/test/java/org/opensrp/repository/postgres/AllAlertsIntegrationTest.java index 6b58e7d2d..8004720cc 100644 --- a/src/test/java/org/opensrp/repository/postgres/AllAlertsIntegrationTest.java +++ b/src/test/java/org/opensrp/repository/postgres/AllAlertsIntegrationTest.java @@ -22,189 +22,189 @@ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:test-applicationContext-opensrp.xml") -@ActiveProfiles(profiles = { "jedis"}) +@ActiveProfiles(profiles = {"jedis"}) public class AllAlertsIntegrationTest { - - @Autowired - public AlertsRepositoryImpl allAlerts; - - @Before - public void setUp() throws Exception { - allAlerts.removeAll(); - } - - @Test - public void shouldSaveANotification() throws Exception { - DateTime dueDate = DateTime.now().minusDays(1); - DateTime expiryDate = dueDate.plusWeeks(2); - - Alert alert = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", - "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); - - allAlerts.add(alert); - - List allTheAlertsInDB = allAlerts.getAll(); - assertEquals(1, allTheAlertsInDB.size()); - assertEquals(alert, allTheAlertsInDB.get(0)); - } - - @Test - public void shouldNotFindAnyAlertsIfNoneExistForGivenProvider() throws Exception { - assertEquals(0, allAlerts.findActiveByProviderAndTimestamp("ANM 1", 0).size()); - } - - @Test - public void shouldReturnAlertActionsBasedOnProviderIDAndTimeStamp() throws Exception { - DateTime dueDate = DateTime.now().minusDays(1); - DateTime expiryDate = dueDate.plusWeeks(2); - - Alert alert1 = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", - "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); - allAlerts.add(alert1); - - Alert alert2 = new Alert("ANM 1", "Entity 2", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", - "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); - allAlerts.add(alert2); - - Alert alert3 = new Alert("ANM 1", "Entity 3", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", - "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); - allAlerts.add(alert3); - - assertEquals(asList(alert1, alert2, alert3), allAlerts.findActiveByProviderAndTimestamp("ANM 1", 0)); - assertEquals(asList(alert2, alert3), allAlerts.findActiveByProviderAndTimestamp("ANM 1", alert1.timestamp())); - assertEquals(asList(alert3), allAlerts.findActiveByProviderAndTimestamp("ANM 1", alert2.timestamp())); - - assertEquals(0, allAlerts.findActiveByProviderAndTimestamp("ANM 1", alert3.timestamp()).size()); - } - - @Test - public void shouldFindAlertsOnlyForTheANMSpecified() throws Exception { - DateTime dueDate = DateTime.now().minusDays(1); - DateTime expiryDate = dueDate.plusWeeks(2); - - Alert alert1 = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", - "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); - allAlerts.add(alert1); - - Alert alert2 = new Alert("ANM 2", "Entity 2", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", - "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); - allAlerts.add(alert2); - - Alert alert3 = new Alert("ANM 1", "Entity 3", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", - "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); - allAlerts.add(alert3); - - assertEquals(asList(alert1, alert3), allAlerts.findActiveByProviderAndTimestamp("ANM 1", 0)); - assertEquals(asList(alert2), allAlerts.findActiveByProviderAndTimestamp("ANM 2", 0)); - } - - @Test - public void shouldMarkAllAlertsAsInActiveForACase() throws Exception { - DateTime dueDate = DateTime.now().minusDays(1); - DateTime expiryDate = dueDate.plusWeeks(2); - - Alert alert1 = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", - "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); - - Alert alert2 = new Alert("ANM 1", "Entity 2", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", - "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); - - Alert alert3 = new Alert("ANM 2", "Entity 3", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", - "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); - - Alert alert4 = new Alert("ANM 1", "Entity 4", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", - "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); - - allAlerts.add(alert1); - allAlerts.add(alert2); - allAlerts.add(alert3); - allAlerts.add(alert4); - - allAlerts.markAllAsClosedFor("Entity 1", "none"); - - assertEquals(asList(alert2, alert4), allAlerts.findActiveByProviderAndTimestamp("ANM 1", 0)); - assertEquals(asList(alert3), allAlerts.findActiveByProviderAndTimestamp("ANM 2", 0)); - } - - @Test - public void shouldReturnActionBasedOnProviderIdEntityIdScheduleName() throws Exception { - DateTime dueDate = DateTime.now().minusDays(1); - DateTime expiryDate = dueDate.plusWeeks(2); - - Alert alert1 = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", - "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); - - Alert alert2 = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 2", - "penta2", dueDate, expiryDate, AlertStatus.upcoming, null); - - Alert alert3 = new Alert("ANM 2", "Entity 2", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", - "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); - - Alert alert4 = new Alert("ANM 1", "Entity 3", "mother", AlertType.notification, TriggerType.schedule, "Penta 2", - "penta2", dueDate, expiryDate, AlertStatus.upcoming, null); - - allAlerts.add(alert1); - allAlerts.add(alert2); - allAlerts.add(alert3); - allAlerts.add(alert4); - - assertEquals(asList(alert1), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 1", "Entity 1", "Penta 1")); - assertEquals(asList(alert2), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 1", "Entity 1", "Penta 2")); - assertEquals(asList(alert3), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 2", "Entity 2", "Penta 1")); - assertEquals(asList(alert4), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 1", "Entity 3", "Penta 2")); - } - - @Test - public void shouldRemoveExistingAlertBeforeAddingNewOne() throws Exception { - DateTime dueDate = DateTime.now().minusDays(1); - DateTime expiryDate = dueDate.plusWeeks(2); - - allAlerts.addOrUpdateScheduleNotificationAlert("mother", "Entity 1", "ANM 1", "Penta 1", "penta1", - AlertStatus.upcoming, dueDate, expiryDate); - assertTrue(allAlerts.findActiveAlertByEntityId("Entity 1").size() == 1); - - allAlerts.addOrUpdateScheduleNotificationAlert("mother", "Entity 1", "ANM 1", "Penta 1", "penta1", normal, dueDate, - expiryDate); - - List al = allAlerts.findActiveAlertByEntityId("Entity 1"); - assertTrue(al.size() == 1); - assertTrue(al.get(0).alertStatus().equalsIgnoreCase(normal.name())); - } - - @Test - public void shouldAddNewAlertWhenThereIsNoExistingAlert() throws Exception { - DateTime dueDate = DateTime.now().minusDays(1); - DateTime expiryDate = dueDate.plusWeeks(2); - - allAlerts.addOrUpdateScheduleNotificationAlert("mother", "Entity 1", "ANM 1", "Penta 1", "penta1", - AlertStatus.upcoming, dueDate, expiryDate); - - assertTrue(allAlerts.findActiveAlertByEntityId("Entity 1").size() == 1); - } - - @Test - public void shouldUpdateAlertAsAnInactive() { - DateTime dueDate = DateTime.now().minusDays(1); - DateTime expiryDate = dueDate.plusWeeks(2); - - Alert alert1 = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", - "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); - - Alert alert2 = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 2", - "penta2", dueDate, expiryDate, AlertStatus.upcoming, null); - - allAlerts.add(alert1); - allAlerts.add(alert2); - - assertEquals(asList(alert1, alert2), allAlerts.findActiveAlertByEntityId("Entity 1")); - assertEquals(asList(alert1), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 1", "Entity 1", "Penta 1")); - assertEquals(asList(alert2), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 1", "Entity 1", "Penta 2")); - - allAlerts.markAlertAsClosedFor("ANM 1", "Entity 1", "Penta 1", "none"); - - assertEquals(asList(alert2), allAlerts.findActiveAlertByEntityId("Entity 1")); - assertEquals(asList(), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 1", "Entity 1", "Penta 1")); - assertEquals(asList(alert2), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 1", "Entity 1", "Penta 2")); - } - + + @Autowired + public AlertsRepositoryImpl allAlerts; + + @Before + public void setUp() throws Exception { + allAlerts.removeAll(); + } + + @Test + public void shouldSaveANotification() throws Exception { + DateTime dueDate = DateTime.now().minusDays(1); + DateTime expiryDate = dueDate.plusWeeks(2); + + Alert alert = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", + "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); + + allAlerts.add(alert); + + List allTheAlertsInDB = allAlerts.getAll(); + assertEquals(1, allTheAlertsInDB.size()); + assertEquals(alert, allTheAlertsInDB.get(0)); + } + + @Test + public void shouldNotFindAnyAlertsIfNoneExistForGivenProvider() throws Exception { + assertEquals(0, allAlerts.findActiveByProviderAndTimestamp("ANM 1", 0).size()); + } + + @Test + public void shouldReturnAlertActionsBasedOnProviderIDAndTimeStamp() throws Exception { + DateTime dueDate = DateTime.now().minusDays(1); + DateTime expiryDate = dueDate.plusWeeks(2); + + Alert alert1 = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", + "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); + allAlerts.add(alert1); + + Alert alert2 = new Alert("ANM 1", "Entity 2", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", + "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); + allAlerts.add(alert2); + + Alert alert3 = new Alert("ANM 1", "Entity 3", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", + "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); + allAlerts.add(alert3); + + assertEquals(asList(alert1, alert2, alert3), allAlerts.findActiveByProviderAndTimestamp("ANM 1", 0)); + assertEquals(asList(alert2, alert3), allAlerts.findActiveByProviderAndTimestamp("ANM 1", alert1.timestamp())); + assertEquals(asList(alert3), allAlerts.findActiveByProviderAndTimestamp("ANM 1", alert2.timestamp())); + + assertEquals(0, allAlerts.findActiveByProviderAndTimestamp("ANM 1", alert3.timestamp()).size()); + } + + @Test + public void shouldFindAlertsOnlyForTheANMSpecified() throws Exception { + DateTime dueDate = DateTime.now().minusDays(1); + DateTime expiryDate = dueDate.plusWeeks(2); + + Alert alert1 = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", + "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); + allAlerts.add(alert1); + + Alert alert2 = new Alert("ANM 2", "Entity 2", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", + "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); + allAlerts.add(alert2); + + Alert alert3 = new Alert("ANM 1", "Entity 3", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", + "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); + allAlerts.add(alert3); + + assertEquals(asList(alert1, alert3), allAlerts.findActiveByProviderAndTimestamp("ANM 1", 0)); + assertEquals(asList(alert2), allAlerts.findActiveByProviderAndTimestamp("ANM 2", 0)); + } + + @Test + public void shouldMarkAllAlertsAsInActiveForACase() throws Exception { + DateTime dueDate = DateTime.now().minusDays(1); + DateTime expiryDate = dueDate.plusWeeks(2); + + Alert alert1 = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", + "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); + + Alert alert2 = new Alert("ANM 1", "Entity 2", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", + "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); + + Alert alert3 = new Alert("ANM 2", "Entity 3", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", + "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); + + Alert alert4 = new Alert("ANM 1", "Entity 4", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", + "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); + + allAlerts.add(alert1); + allAlerts.add(alert2); + allAlerts.add(alert3); + allAlerts.add(alert4); + + allAlerts.markAllAsClosedFor("Entity 1", "none"); + + assertEquals(asList(alert2, alert4), allAlerts.findActiveByProviderAndTimestamp("ANM 1", 0)); + assertEquals(asList(alert3), allAlerts.findActiveByProviderAndTimestamp("ANM 2", 0)); + } + + @Test + public void shouldReturnActionBasedOnProviderIdEntityIdScheduleName() throws Exception { + DateTime dueDate = DateTime.now().minusDays(1); + DateTime expiryDate = dueDate.plusWeeks(2); + + Alert alert1 = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", + "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); + + Alert alert2 = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 2", + "penta2", dueDate, expiryDate, AlertStatus.upcoming, null); + + Alert alert3 = new Alert("ANM 2", "Entity 2", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", + "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); + + Alert alert4 = new Alert("ANM 1", "Entity 3", "mother", AlertType.notification, TriggerType.schedule, "Penta 2", + "penta2", dueDate, expiryDate, AlertStatus.upcoming, null); + + allAlerts.add(alert1); + allAlerts.add(alert2); + allAlerts.add(alert3); + allAlerts.add(alert4); + + assertEquals(asList(alert1), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 1", "Entity 1", "Penta 1")); + assertEquals(asList(alert2), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 1", "Entity 1", "Penta 2")); + assertEquals(asList(alert3), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 2", "Entity 2", "Penta 1")); + assertEquals(asList(alert4), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 1", "Entity 3", "Penta 2")); + } + + @Test + public void shouldRemoveExistingAlertBeforeAddingNewOne() throws Exception { + DateTime dueDate = DateTime.now().minusDays(1); + DateTime expiryDate = dueDate.plusWeeks(2); + + allAlerts.addOrUpdateScheduleNotificationAlert("mother", "Entity 1", "ANM 1", "Penta 1", "penta1", + AlertStatus.upcoming, dueDate, expiryDate); + assertTrue(allAlerts.findActiveAlertByEntityId("Entity 1").size() == 1); + + allAlerts.addOrUpdateScheduleNotificationAlert("mother", "Entity 1", "ANM 1", "Penta 1", "penta1", normal, dueDate, + expiryDate); + + List al = allAlerts.findActiveAlertByEntityId("Entity 1"); + assertTrue(al.size() == 1); + assertTrue(al.get(0).alertStatus().equalsIgnoreCase(normal.name())); + } + + @Test + public void shouldAddNewAlertWhenThereIsNoExistingAlert() throws Exception { + DateTime dueDate = DateTime.now().minusDays(1); + DateTime expiryDate = dueDate.plusWeeks(2); + + allAlerts.addOrUpdateScheduleNotificationAlert("mother", "Entity 1", "ANM 1", "Penta 1", "penta1", + AlertStatus.upcoming, dueDate, expiryDate); + + assertTrue(allAlerts.findActiveAlertByEntityId("Entity 1").size() == 1); + } + + @Test + public void shouldUpdateAlertAsAnInactive() { + DateTime dueDate = DateTime.now().minusDays(1); + DateTime expiryDate = dueDate.plusWeeks(2); + + Alert alert1 = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 1", + "penta1", dueDate, expiryDate, AlertStatus.upcoming, null); + + Alert alert2 = new Alert("ANM 1", "Entity 1", "mother", AlertType.notification, TriggerType.schedule, "Penta 2", + "penta2", dueDate, expiryDate, AlertStatus.upcoming, null); + + allAlerts.add(alert1); + allAlerts.add(alert2); + + assertEquals(asList(alert1, alert2), allAlerts.findActiveAlertByEntityId("Entity 1")); + assertEquals(asList(alert1), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 1", "Entity 1", "Penta 1")); + assertEquals(asList(alert2), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 1", "Entity 1", "Penta 2")); + + allAlerts.markAlertAsClosedFor("ANM 1", "Entity 1", "Penta 1", "none"); + + assertEquals(asList(alert2), allAlerts.findActiveAlertByEntityId("Entity 1")); + assertEquals(asList(), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 1", "Entity 1", "Penta 1")); + assertEquals(asList(alert2), allAlerts.findActiveAlertByProviderEntityIdTriggerName("ANM 1", "Entity 1", "Penta 2")); + } + } diff --git a/src/test/java/org/opensrp/repository/postgres/AllClientsIntegrationTest.java b/src/test/java/org/opensrp/repository/postgres/AllClientsIntegrationTest.java index 14f4dbcbe..642af008e 100644 --- a/src/test/java/org/opensrp/repository/postgres/AllClientsIntegrationTest.java +++ b/src/test/java/org/opensrp/repository/postgres/AllClientsIntegrationTest.java @@ -32,213 +32,213 @@ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:test-applicationContext-opensrp.xml") -@ActiveProfiles(profiles = { "jedis"}) -public class AllClientsIntegrationTest extends BaseRepositoryTest{ - //TODO detailed testign - - @Autowired - private ClientService clientService; - - @Autowired - private ClientsRepository ac; - - @Before - public void setUp() throws Exception { - tableNames=Collections.singletonList("core.client"); - System.out.println("Removing all data"); - truncateTables(); - System.out.println("Removed"); - initMocks(this); - } - - private void addClients() { - for (int i = 0; i < 10; i++) { - Client c = new Client("eid" + i).withName("fn" + i, "mn" + i, "ln" + i).withGender("MALE") - .withBirthdate(new DateTime(), false); - c.withAddress(new Address().withAddressType("usual_residence").withCityVillage("city" + i).withTown("town" + i)); - c.withAttribute("at1", "atval" + i); - - clientService.addClient(c); - } - } - - @Test - public void shouldMergeSuccessfullyIfClientFound() throws JSONException {//TODO - Client c = new Client("eid0").withName("fn", "mn", "ln").withGender("MALE").withBirthdate(new DateTime(), false); - c.withAddress(new Address().withAddressType("usual_residence").withCityVillage("city").withTown("town")); - c.withAttribute("at1", "atval1"); - - c = clientService.addClient(c); - - Client cu = new Client("eid0").withGender("FEMALE").withBirthdate(new DateTime(), false); - cu.withAddress(new Address().withAddressType("deathplace").withCityVillage("city1").withTown("town1")); - cu.withAttribute("at2", "atval2"); - - clientService.mergeClient(cu); - - Client updated=clientService.findClient(cu); - assertEquals("FEMALE", updated.getGender()); - assertNotNull( updated.getAddress("deathplace")); - assertEquals("town1", updated.getAddress("deathplace").getTown()); - assertEquals("city1", updated.getAddress("deathplace").getCityVillage()); - assertEquals("atval2", updated.getAttribute("at2")); - } - - @Test - public void shouldSearchByLastUpdatedDate() throws JSONException {//TODO - addClients(); - DateTime start = DateTime.now(); - - addClients(); - - DateTime end = DateTime.now(); - - ClientSearchBean clientSearchBean = new ClientSearchBean(); - clientSearchBean.setLastEditFrom(start); - clientSearchBean.setLastEditTo(end); - - List cll = clientService.findByCriteria(clientSearchBean, null); - - assertEquals(10, cll.size()); - } - - public static void main(String[] args) { - System.out.println(new DateTime("2016-01-23").toString("MMMM (yyyy)")); - } - - @Test - public void shouldSearchFullDataClientsIn10Sec() throws MalformedURLException { - - final long start = System.currentTimeMillis(); - - for (int i = 0; i < 100; i++) { - addClient(i, false); - } - clientService.findAllByIdentifier("1234556" + "786"); - ClientSearchBean clientSearchBean = new ClientSearchBean(); - clientSearchBean.setNameLike("first"); - clientSearchBean.setGender("MALE"); - clientSearchBean.setBirthdateFrom(new DateTime()); - clientSearchBean.setAttributeType("ethnicity"); - clientSearchBean.setAttributeValue("eth3"); - List clientList = clientService.findByCriteria(clientSearchBean, null); - assertEquals(7,clientList.size()); - for(Client client : clientList) { - String filter=clientSearchBean.getNameLike().toLowerCase(); - assertTrue(client.getFirstName().contains(filter) - || client.getMiddleName().toLowerCase().contains(filter) - || client.getLastName().toLowerCase().contains(filter)); - assertEquals(clientSearchBean.getGender(), client.getGender()); - assertTrue( client.getBirthdate().equals(clientSearchBean.getDeathdateFrom()) - || client.getBirthdate().isBefore(clientSearchBean.getBirthdateFrom())); - assertEquals("eth3", client.getAttribute("ethnicity")); - } - } - - private void addClient(int i, boolean direct) { - int ageInWeeks = new Random().nextInt(2860);// assuming average age of people is 55 years - DateTime birthdate = new DateTime().minusWeeks(ageInWeeks); - DateTime deathdate = i % 7 == 0 ? new DateTime() : null;// every 7th person died today - Client c = new Client("entityId" + i, "firstName" + i, "middleName" + i, "lastName" + i, birthdate, deathdate, false, - false, i % 2 == 0 ? "FEMALE" : "MALE"); - - Map am = new HashMap<>(); - Address ab = new Address("birthplace", null, null, am, null, null, null, "Sindh", "Pakistan"); - ab.setCityVillage("Karachi"); - ab.setTown("Korangi"); - ab.setSubTown("UC" + i % 11); - c.addAddress(ab); - - Address ur = new Address("usual_residence", null, null, am, null, null, "752" + new Random().nextInt(5), "Sindh", - "Pakistan"); - ur.setCityVillage("Karachi"); - ur.setTown(i % 3 == 0 ? "Korangi" : "Baldia"); - ur.setSubTown("UC" + i % 11); - c.addAddress(ur); - - c.addAttribute("ethnicity", "eth" + i % 7); - c.addAttribute("health area", "healtha" + i % 7); - - c.addIdentifier("CNIC", "1234556" + i); - c.addIdentifier("NTN", "564300" + i); - if (direct) { - ac.add(c); - } else { - clientService.addClient(c); - } - } - - @Test - public void shouldGetByDynamicView() { - addClients(); - - ClientSearchBean clientSearchBean = new ClientSearchBean(); - clientSearchBean.setGender("MALE"); - List l2 = clientService.findByCriteria(clientSearchBean, new AddressSearchBean(), null, null); - assertTrue(l2.size() == 10); - - clientSearchBean = new ClientSearchBean(); - clientSearchBean.setGender("FEMALE"); - l2 = clientService.findByCriteria(clientSearchBean, new AddressSearchBean(), null, null); - assertTrue(l2.size() == 0); - } - - @Test - public void shouldFetchClientByIdentifier() { - String baseEntityId = "testclient2"; - Client c = new Client(baseEntityId).withBirthdate(new DateTime(), false).withFirstName("C first n") - .withLastName("C last n").withMiddleName("C middle n").withGender(Gender.MALE); - c.withAddress(new Address("birthplace", new DateTime(System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 2), - DateTime.now(), null, "lat", "lon", "75210", "Sindh", "Pakistan")); - c.withAttribute("ETHNICITY", "Mughal"); - c.withIdentifier("Program ID", "01001222"); - - clientService.addClient(c); - - Client ce = clientService.getByBaseEntityId("testclient2"); - assertEquals("testclient2", ce.getBaseEntityId()); - assertTrue(Client.class.getSimpleName().equals(ce.getType())); - assertEquals("birthplace", ce.getAddresses().get(0).getAddressType()); - assertEquals("Mughal", ce.getAttribute("ethnicity")); - assertEquals("01001222", ce.getIdentifier("program id")); - - List ce2 = clientService.findAllByIdentifier("01001222"); - assertTrue(ce2.size() == 1); - assertEquals("testclient2", ce2.get(0).getBaseEntityId()); - - List ce3 = clientService.findAllByIdentifier("Program ID", "01001222"); - assertTrue(ce3.size() == 1); - assertEquals("testclient2", ce3.get(0).getBaseEntityId()); - } - - @Test - public void shouldFetchClientByAttribute() { - String baseEntityId = "testclient2"; - Client c = new Client(baseEntityId).withBirthdate(new DateTime(), false).withFirstName("C first n") - .withLastName("C last n").withMiddleName("C middle n").withGender(Gender.MALE); - c.withAddress(new Address("birthplace", new DateTime(System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 2), - DateTime.now(), null, "lat", "lon", "75210", "Sindh", "Pakistan")); - c.withAttribute("ETHNICITY", "Mughal"); - c.withIdentifier("Program ID", "01001222"); - - clientService.addClient(c); - - c = new Client("testclient3").withBirthdate(new DateTime(), false).withFirstName("C first n") - .withLastName("C last n").withMiddleName("C middle n").withGender(Gender.MALE); - c.withAttribute("ETHNICITY", "Mughal"); - c.addIdentifier("Program ID", "01001223"); - - clientService.addClient(c); - - List ce = clientService.findAllByAttribute("ETHNICITY", "Mughal"); - assertTrue(ce.size() == 2); - assertEquals("testclient2", ce.get(0).getBaseEntityId()); - assertEquals("testclient3", ce.get(1).getBaseEntityId()); - } - - @Override - protected Set getDatabaseScripts() { - return null; - } - +@ActiveProfiles(profiles = {"jedis"}) +public class AllClientsIntegrationTest extends BaseRepositoryTest { + //TODO detailed testign + + @Autowired + private ClientService clientService; + + @Autowired + private ClientsRepository ac; + + public static void main(String[] args) { + System.out.println(new DateTime("2016-01-23").toString("MMMM (yyyy)")); + } + + @Before + public void setUp() throws Exception { + tableNames = Collections.singletonList("core.client"); + System.out.println("Removing all data"); + truncateTables(); + System.out.println("Removed"); + initMocks(this); + } + + private void addClients() { + for (int i = 0; i < 10; i++) { + Client c = new Client("eid" + i).withName("fn" + i, "mn" + i, "ln" + i).withGender("MALE") + .withBirthdate(new DateTime(), false); + c.withAddress(new Address().withAddressType("usual_residence").withCityVillage("city" + i).withTown("town" + i)); + c.withAttribute("at1", "atval" + i); + + clientService.addClient(c); + } + } + + @Test + public void shouldMergeSuccessfullyIfClientFound() throws JSONException {//TODO + Client c = new Client("eid0").withName("fn", "mn", "ln").withGender("MALE").withBirthdate(new DateTime(), false); + c.withAddress(new Address().withAddressType("usual_residence").withCityVillage("city").withTown("town")); + c.withAttribute("at1", "atval1"); + + c = clientService.addClient(c); + + Client cu = new Client("eid0").withGender("FEMALE").withBirthdate(new DateTime(), false); + cu.withAddress(new Address().withAddressType("deathplace").withCityVillage("city1").withTown("town1")); + cu.withAttribute("at2", "atval2"); + + clientService.mergeClient(cu); + + Client updated = clientService.findClient(cu); + assertEquals("FEMALE", updated.getGender()); + assertNotNull(updated.getAddress("deathplace")); + assertEquals("town1", updated.getAddress("deathplace").getTown()); + assertEquals("city1", updated.getAddress("deathplace").getCityVillage()); + assertEquals("atval2", updated.getAttribute("at2")); + } + + @Test + public void shouldSearchByLastUpdatedDate() throws JSONException {//TODO + addClients(); + DateTime start = DateTime.now(); + + addClients(); + + DateTime end = DateTime.now(); + + ClientSearchBean clientSearchBean = new ClientSearchBean(); + clientSearchBean.setLastEditFrom(start); + clientSearchBean.setLastEditTo(end); + + List cll = clientService.findByCriteria(clientSearchBean, null); + + assertEquals(10, cll.size()); + } + + @Test + public void shouldSearchFullDataClientsIn10Sec() throws MalformedURLException { + + final long start = System.currentTimeMillis(); + + for (int i = 0; i < 100; i++) { + addClient(i, false); + } + clientService.findAllByIdentifier("1234556" + "786"); + ClientSearchBean clientSearchBean = new ClientSearchBean(); + clientSearchBean.setNameLike("first"); + clientSearchBean.setGender("MALE"); + clientSearchBean.setBirthdateFrom(new DateTime()); + clientSearchBean.setAttributeType("ethnicity"); + clientSearchBean.setAttributeValue("eth3"); + List clientList = clientService.findByCriteria(clientSearchBean, null); + assertEquals(7, clientList.size()); + for (Client client : clientList) { + String filter = clientSearchBean.getNameLike().toLowerCase(); + assertTrue(client.getFirstName().contains(filter) + || client.getMiddleName().toLowerCase().contains(filter) + || client.getLastName().toLowerCase().contains(filter)); + assertEquals(clientSearchBean.getGender(), client.getGender()); + assertTrue(client.getBirthdate().equals(clientSearchBean.getDeathdateFrom()) + || client.getBirthdate().isBefore(clientSearchBean.getBirthdateFrom())); + assertEquals("eth3", client.getAttribute("ethnicity")); + } + } + + private void addClient(int i, boolean direct) { + int ageInWeeks = new Random().nextInt(2860);// assuming average age of people is 55 years + DateTime birthdate = new DateTime().minusWeeks(ageInWeeks); + DateTime deathdate = i % 7 == 0 ? new DateTime() : null;// every 7th person died today + Client c = new Client("entityId" + i, "firstName" + i, "middleName" + i, "lastName" + i, birthdate, deathdate, false, + false, i % 2 == 0 ? "FEMALE" : "MALE"); + + Map am = new HashMap<>(); + Address ab = new Address("birthplace", null, null, am, null, null, null, "Sindh", "Pakistan"); + ab.setCityVillage("Karachi"); + ab.setTown("Korangi"); + ab.setSubTown("UC" + i % 11); + c.addAddress(ab); + + Address ur = new Address("usual_residence", null, null, am, null, null, "752" + new Random().nextInt(5), "Sindh", + "Pakistan"); + ur.setCityVillage("Karachi"); + ur.setTown(i % 3 == 0 ? "Korangi" : "Baldia"); + ur.setSubTown("UC" + i % 11); + c.addAddress(ur); + + c.addAttribute("ethnicity", "eth" + i % 7); + c.addAttribute("health area", "healtha" + i % 7); + + c.addIdentifier("CNIC", "1234556" + i); + c.addIdentifier("NTN", "564300" + i); + if (direct) { + ac.add(c); + } else { + clientService.addClient(c); + } + } + + @Test + public void shouldGetByDynamicView() { + addClients(); + + ClientSearchBean clientSearchBean = new ClientSearchBean(); + clientSearchBean.setGender("MALE"); + List l2 = clientService.findByCriteria(clientSearchBean, new AddressSearchBean(), null, null); + assertTrue(l2.size() == 10); + + clientSearchBean = new ClientSearchBean(); + clientSearchBean.setGender("FEMALE"); + l2 = clientService.findByCriteria(clientSearchBean, new AddressSearchBean(), null, null); + assertTrue(l2.size() == 0); + } + + @Test + public void shouldFetchClientByIdentifier() { + String baseEntityId = "testclient2"; + Client c = new Client(baseEntityId).withBirthdate(new DateTime(), false).withFirstName("C first n") + .withLastName("C last n").withMiddleName("C middle n").withGender(Gender.MALE); + c.withAddress(new Address("birthplace", new DateTime(System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 2), + DateTime.now(), null, "lat", "lon", "75210", "Sindh", "Pakistan")); + c.withAttribute("ETHNICITY", "Mughal"); + c.withIdentifier("Program ID", "01001222"); + + clientService.addClient(c); + + Client ce = clientService.getByBaseEntityId("testclient2"); + assertEquals("testclient2", ce.getBaseEntityId()); + assertTrue(Client.class.getSimpleName().equals(ce.getType())); + assertEquals("birthplace", ce.getAddresses().get(0).getAddressType()); + assertEquals("Mughal", ce.getAttribute("ethnicity")); + assertEquals("01001222", ce.getIdentifier("program id")); + + List ce2 = clientService.findAllByIdentifier("01001222"); + assertTrue(ce2.size() == 1); + assertEquals("testclient2", ce2.get(0).getBaseEntityId()); + + List ce3 = clientService.findAllByIdentifier("Program ID", "01001222"); + assertTrue(ce3.size() == 1); + assertEquals("testclient2", ce3.get(0).getBaseEntityId()); + } + + @Test + public void shouldFetchClientByAttribute() { + String baseEntityId = "testclient2"; + Client c = new Client(baseEntityId).withBirthdate(new DateTime(), false).withFirstName("C first n") + .withLastName("C last n").withMiddleName("C middle n").withGender(Gender.MALE); + c.withAddress(new Address("birthplace", new DateTime(System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 2), + DateTime.now(), null, "lat", "lon", "75210", "Sindh", "Pakistan")); + c.withAttribute("ETHNICITY", "Mughal"); + c.withIdentifier("Program ID", "01001222"); + + clientService.addClient(c); + + c = new Client("testclient3").withBirthdate(new DateTime(), false).withFirstName("C first n") + .withLastName("C last n").withMiddleName("C middle n").withGender(Gender.MALE); + c.withAttribute("ETHNICITY", "Mughal"); + c.addIdentifier("Program ID", "01001223"); + + clientService.addClient(c); + + List ce = clientService.findAllByAttribute("ETHNICITY", "Mughal"); + assertTrue(ce.size() == 2); + assertEquals("testclient2", ce.get(0).getBaseEntityId()); + assertEquals("testclient3", ce.get(1).getBaseEntityId()); + } + + @Override + protected Set getDatabaseScripts() { + return null; + } + } diff --git a/src/test/java/org/opensrp/repository/postgres/AllErrorTraceIntegrationTest.java b/src/test/java/org/opensrp/repository/postgres/AllErrorTraceIntegrationTest.java index 8ea4f4b04..2560309dd 100644 --- a/src/test/java/org/opensrp/repository/postgres/AllErrorTraceIntegrationTest.java +++ b/src/test/java/org/opensrp/repository/postgres/AllErrorTraceIntegrationTest.java @@ -16,32 +16,32 @@ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:test-applicationContext-opensrp.xml") -@ActiveProfiles(profiles = { "jedis"}) +@ActiveProfiles(profiles = {"jedis"}) public class AllErrorTraceIntegrationTest { - - @Autowired - private ErrorTraceRepository allErrorTrace; - - @Before - public void setUp() throws Exception { - initMocks(this); - } - - @Test - public void shouldAddError() throws Exception { - //ErrorTrace error=new ErrorTrace(new Date(), "Error Testing" , "not availalbe","this is an Testing Error", "unsolved"); - ErrorTrace error = new ErrorTrace(); - error.setId("1234"); - error.setErrorType("error loggging test"); - error.setDate(DateTime.now()); - error.setStackTrace("Complete Stack Trace :"); - error.setStatus("unsolved"); - error.setDocumentType("Test Document"); - // error.setErrorType("test Error"); - allErrorTrace.add(error); - - assertEquals(error, allErrorTrace.get("1234")); - - } - + + @Autowired + private ErrorTraceRepository allErrorTrace; + + @Before + public void setUp() throws Exception { + initMocks(this); + } + + @Test + public void shouldAddError() throws Exception { + //ErrorTrace error=new ErrorTrace(new Date(), "Error Testing" , "not availalbe","this is an Testing Error", "unsolved"); + ErrorTrace error = new ErrorTrace(); + error.setId("1234"); + error.setErrorType("error loggging test"); + error.setDate(DateTime.now()); + error.setStackTrace("Complete Stack Trace :"); + error.setStatus("unsolved"); + error.setDocumentType("Test Document"); + // error.setErrorType("test Error"); + allErrorTrace.add(error); + + assertEquals(error, allErrorTrace.get("1234")); + + } + } diff --git a/src/test/java/org/opensrp/repository/postgres/AllEventsIntegrationTest.java b/src/test/java/org/opensrp/repository/postgres/AllEventsIntegrationTest.java index e04244ddd..e019e5da6 100644 --- a/src/test/java/org/opensrp/repository/postgres/AllEventsIntegrationTest.java +++ b/src/test/java/org/opensrp/repository/postgres/AllEventsIntegrationTest.java @@ -21,47 +21,47 @@ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:test-applicationContext-opensrp.xml") -@ActiveProfiles(profiles = { "jedis"}) -public class AllEventsIntegrationTest extends BaseRepositoryTest{ - - //TODO Detailed testing - @Autowired - private EventService eventService; +@ActiveProfiles(profiles = {"jedis"}) +public class AllEventsIntegrationTest extends BaseRepositoryTest { - private String username ="johndoe"; - - @Override - protected Set getDatabaseScripts() { - return null; - } - - @Before - public void setUp() throws Exception { - tableNames=Collections.singletonList("core.event"); - truncateTables(); - initMocks(this); - ReflectionTestUtils.setField(eventService, "isPlanEvaluationEnabled", true); - } - - private void addEvents() { - for (int i = 0; i < 20; i++) { - Event e = new Event("entityid" + i, "Immunization", new DateTime(), "testentity", "demotest", "location" + i, - "formSubmission" + i + 100); - e.addObs(new Obs("concept", "txt", "1025AAAAAAAAAAAAAAAA", null, "2015-01-01", "comments test" + i, "bcg")); - e.addObs(new Obs("concept", "txt", "1026AAAAAAAAAAAAAAAA", null, "2015-01-01", "comments test" + i, "penta1")); - e.addObs(new Obs("concept", "txt", "1027AAAAAAAAAAAAAAAA", null, "2015-01-01", "comments test" + i, "penta2")); - e.addObs(new Obs("concept", "txt", "1028AAAAAAAAAAAAAAAA", null, "2015-01-01", "comments test" + i, "penta3")); - e.addObs(new Obs("concept", "txt", "1029AAAAAAAAAAAAAAAA", null, "2015-01-01", "comments test" + i, "mealses1")); - e.addObs(new Obs("concept", "txt", "1030AAAAAAAAAAAAAAAA", null, "2015-01-01", "comments test" + i, "measles2")); - e.addObs(new Obs("concept", "txt", "1029AAAAAAAAAAAAAAAA", null, "2015-01-01", "comments test" + i, "tt1")); - e.addObs(new Obs("concept", "txt", "1030AAAAAAAAAAAAAAAA", null, "2016-02-01", "comments test" + i, "tt2")); - eventService.addEvent(e,username); - } - } - - @Test - public void test() { - addEvents(); - assertTrue(eventService.getByBaseEntityAndFormSubmissionId("entityid0", "formSubmission0100") != null); - } + //TODO Detailed testing + @Autowired + private EventService eventService; + + private String username = "johndoe"; + + @Override + protected Set getDatabaseScripts() { + return null; + } + + @Before + public void setUp() throws Exception { + tableNames = Collections.singletonList("core.event"); + truncateTables(); + initMocks(this); + ReflectionTestUtils.setField(eventService, "isPlanEvaluationEnabled", true); + } + + private void addEvents() { + for (int i = 0; i < 20; i++) { + Event e = new Event("entityid" + i, "Immunization", new DateTime(), "testentity", "demotest", "location" + i, + "formSubmission" + i + 100); + e.addObs(new Obs("concept", "txt", "1025AAAAAAAAAAAAAAAA", null, "2015-01-01", "comments test" + i, "bcg")); + e.addObs(new Obs("concept", "txt", "1026AAAAAAAAAAAAAAAA", null, "2015-01-01", "comments test" + i, "penta1")); + e.addObs(new Obs("concept", "txt", "1027AAAAAAAAAAAAAAAA", null, "2015-01-01", "comments test" + i, "penta2")); + e.addObs(new Obs("concept", "txt", "1028AAAAAAAAAAAAAAAA", null, "2015-01-01", "comments test" + i, "penta3")); + e.addObs(new Obs("concept", "txt", "1029AAAAAAAAAAAAAAAA", null, "2015-01-01", "comments test" + i, "mealses1")); + e.addObs(new Obs("concept", "txt", "1030AAAAAAAAAAAAAAAA", null, "2015-01-01", "comments test" + i, "measles2")); + e.addObs(new Obs("concept", "txt", "1029AAAAAAAAAAAAAAAA", null, "2015-01-01", "comments test" + i, "tt1")); + e.addObs(new Obs("concept", "txt", "1030AAAAAAAAAAAAAAAA", null, "2016-02-01", "comments test" + i, "tt2")); + eventService.addEvent(e, username); + } + } + + @Test + public void test() { + addEvents(); + assertTrue(eventService.getByBaseEntityAndFormSubmissionId("entityid0", "formSubmission0100") != null); + } } diff --git a/src/test/java/org/opensrp/repository/postgres/AppStateTokensRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/AppStateTokensRepositoryTest.java index ba0e86214..e7deb15ed 100644 --- a/src/test/java/org/opensrp/repository/postgres/AppStateTokensRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/AppStateTokensRepositoryTest.java @@ -16,86 +16,86 @@ import org.springframework.beans.factory.annotation.Qualifier; public class AppStateTokensRepositoryTest extends BaseRepositoryTest { - - @Autowired - @Qualifier("appStateTokensRepositoryPostgres") - private AppStateTokensRepository appStateTokensRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("app_state_token.sql"); - return scripts; - } - - @Test - public void testGet() { - AppStateToken token = appStateTokensRepository.get("1"); - assertEquals("sync_schedule_tracker_by_last_update_enrollment", token.getName()); - assertEquals("34343", token.getValue().toString()); - assertEquals("ScheduleTracker token to keep track of enrollment", token.getDescription()); - assertEquals(1521017416, token.getLastEditDate()); - //Try to find non-exist token - assertNull(appStateTokensRepository.get("10")); - } - - @Test - public void testGetAll() { - List tokens = appStateTokensRepository.getAll(); - assertEquals(5, tokens.size()); - - appStateTokensRepository.safeRemove(appStateTokensRepository.findByName("sync_event_by_date_updated").get(0)); - - tokens = appStateTokensRepository.getAll(); - assertEquals(4, tokens.size()); - for (AppStateToken token : tokens) - assertNotEquals("sync_event_by_date_updated", token.getName()); - } - - @Test - public void testFindByName() { - List tokens = appStateTokensRepository.findByName("sync_event_by_date_updated"); - assertEquals(1, tokens.size()); - assertEquals("343232", tokens.get(0).getValue()); - assertEquals(1521017416, tokens.get(0).getLastEditDate()); - //Try to find non-exist token - assertTrue(appStateTokensRepository.findByName("sync_client_non_existent").isEmpty()); - } - - @Test - public void testSafeRemove() { - appStateTokensRepository.safeRemove(appStateTokensRepository.findByName("sync_event_by_date_voided").get(0)); - assertTrue(appStateTokensRepository.findByName("sync_event_by_date_voided").isEmpty()); - List tokens = appStateTokensRepository.getAll(); - assertEquals(4, tokens.size()); - for (AppStateToken token : tokens) - assertNotEquals("sync_event_by_date_voided", token.getName()); - } - - @Test - public void testUpdate() { - AppStateToken token = new AppStateToken("sync_event_by_date_updated", "4564353453434", 1521019916); - appStateTokensRepository.update(token); - - AppStateToken updatedToken = appStateTokensRepository.findByName("sync_event_by_date_updated").get(0); - - assertEquals("4564353453434", updatedToken.getValue()); - assertEquals(1521019916, updatedToken.getLastEditDate()); - - } - - @Test - public void testAdd() { - AppStateToken token = new AppStateToken("sync_apptoken_custom", "45643534MKHT", 15210234516l, - "Custom Test App Token"); - appStateTokensRepository.add(token); - - AppStateToken savedToken = appStateTokensRepository.findByName("sync_apptoken_custom").get(0); - - assertEquals("45643534MKHT", savedToken.getValue()); - assertEquals(15210234516l, savedToken.getLastEditDate()); - assertEquals("Custom Test App Token", savedToken.getDescription()); - - } - + + @Autowired + @Qualifier("appStateTokensRepositoryPostgres") + private AppStateTokensRepository appStateTokensRepository; + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("app_state_token.sql"); + return scripts; + } + + @Test + public void testGet() { + AppStateToken token = appStateTokensRepository.get("1"); + assertEquals("sync_schedule_tracker_by_last_update_enrollment", token.getName()); + assertEquals("34343", token.getValue().toString()); + assertEquals("ScheduleTracker token to keep track of enrollment", token.getDescription()); + assertEquals(1521017416, token.getLastEditDate()); + //Try to find non-exist token + assertNull(appStateTokensRepository.get("10")); + } + + @Test + public void testGetAll() { + List tokens = appStateTokensRepository.getAll(); + assertEquals(5, tokens.size()); + + appStateTokensRepository.safeRemove(appStateTokensRepository.findByName("sync_event_by_date_updated").get(0)); + + tokens = appStateTokensRepository.getAll(); + assertEquals(4, tokens.size()); + for (AppStateToken token : tokens) + assertNotEquals("sync_event_by_date_updated", token.getName()); + } + + @Test + public void testFindByName() { + List tokens = appStateTokensRepository.findByName("sync_event_by_date_updated"); + assertEquals(1, tokens.size()); + assertEquals("343232", tokens.get(0).getValue()); + assertEquals(1521017416, tokens.get(0).getLastEditDate()); + //Try to find non-exist token + assertTrue(appStateTokensRepository.findByName("sync_client_non_existent").isEmpty()); + } + + @Test + public void testSafeRemove() { + appStateTokensRepository.safeRemove(appStateTokensRepository.findByName("sync_event_by_date_voided").get(0)); + assertTrue(appStateTokensRepository.findByName("sync_event_by_date_voided").isEmpty()); + List tokens = appStateTokensRepository.getAll(); + assertEquals(4, tokens.size()); + for (AppStateToken token : tokens) + assertNotEquals("sync_event_by_date_voided", token.getName()); + } + + @Test + public void testUpdate() { + AppStateToken token = new AppStateToken("sync_event_by_date_updated", "4564353453434", 1521019916); + appStateTokensRepository.update(token); + + AppStateToken updatedToken = appStateTokensRepository.findByName("sync_event_by_date_updated").get(0); + + assertEquals("4564353453434", updatedToken.getValue()); + assertEquals(1521019916, updatedToken.getLastEditDate()); + + } + + @Test + public void testAdd() { + AppStateToken token = new AppStateToken("sync_apptoken_custom", "45643534MKHT", 15210234516l, + "Custom Test App Token"); + appStateTokensRepository.add(token); + + AppStateToken savedToken = appStateTokensRepository.findByName("sync_apptoken_custom").get(0); + + assertEquals("45643534MKHT", savedToken.getValue()); + assertEquals(15210234516l, savedToken.getLastEditDate()); + assertEquals("Custom Test App Token", savedToken.getDescription()); + + } + } diff --git a/src/test/java/org/opensrp/repository/postgres/BaseRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/BaseRepositoryTest.java index d8ca87de7..86fdc58c0 100644 --- a/src/test/java/org/opensrp/repository/postgres/BaseRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/BaseRepositoryTest.java @@ -22,48 +22,46 @@ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:test-applicationContext-opensrp.xml") -@ActiveProfiles(profiles = { "jedis"}) +@ActiveProfiles(profiles = {"jedis"}) public abstract class BaseRepositoryTest extends TestPostgresInstance { - private static String TEST_SCRIPTS_ROOT_DIRECTORY = "test-scripts/"; - - @Autowired - private DataSource openSRPDataSource; - protected static List tableNames = new ArrayList<>(); + protected static List tableNames = new ArrayList<>(); + private static String TEST_SCRIPTS_ROOT_DIRECTORY = "test-scripts/"; + @Autowired + private DataSource openSRPDataSource; - /** - * Populates the configured {@link DataSource} with data from passed scripts - * - * @param the scripts to load - * @throws SQLException - */ - @Before - public void populateDatabase() throws SQLException { - truncateTables(); - if (getDatabaseScripts() == null || getDatabaseScripts().isEmpty()) - return; - ResourceDatabasePopulator populator = new ResourceDatabasePopulator(); - for (String script : getDatabaseScripts()) { - populator.addScript(new ClassPathResource(TEST_SCRIPTS_ROOT_DIRECTORY + script)); - } - - Connection connection = null; - - try { - connection = DataSourceUtils.getConnection(openSRPDataSource); - populator.populate(connection); - } - finally { - if (connection != null) { - DataSourceUtils.releaseConnection(connection, openSRPDataSource); - } - } - } + /** + * Populates the configured {@link DataSource} with data from passed scripts + * + * @param the scripts to load + * @throws SQLException + */ + @Before + public void populateDatabase() throws SQLException { + truncateTables(); + if (getDatabaseScripts() == null || getDatabaseScripts().isEmpty()) + return; + ResourceDatabasePopulator populator = new ResourceDatabasePopulator(); + for (String script : getDatabaseScripts()) { + populator.addScript(new ClassPathResource(TEST_SCRIPTS_ROOT_DIRECTORY + script)); + } - protected void truncateTables() { - for (String tableName : tableNames) { - DbAccessUtils.truncateTable(tableName, openSRPDataSource); - } - } - - protected abstract Set getDatabaseScripts(); + Connection connection = null; + + try { + connection = DataSourceUtils.getConnection(openSRPDataSource); + populator.populate(connection); + } finally { + if (connection != null) { + DataSourceUtils.releaseConnection(connection, openSRPDataSource); + } + } + } + + protected void truncateTables() { + for (String tableName : tableNames) { + DbAccessUtils.truncateTable(tableName, openSRPDataSource); + } + } + + protected abstract Set getDatabaseScripts(); } diff --git a/src/test/java/org/opensrp/repository/postgres/CampaignRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/CampaignRepositoryTest.java index 4578c9c18..278976507 100644 --- a/src/test/java/org/opensrp/repository/postgres/CampaignRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/CampaignRepositoryTest.java @@ -19,160 +19,160 @@ public class CampaignRepositoryTest extends BaseRepositoryTest { - @Autowired - private CampaignRepository campaignRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("campaign.sql"); - return scripts; - } - - @Test - public void testGet() { - - Campaign campaign = campaignRepository.get("IRS_2018_S1"); - assertEquals("2019 IRS Season 1", campaign.getTitle()); - assertEquals( - "This is the 2010 IRS Spray Campaign for Zambia for the first spray season dated 1 Jan 2019 - 31 Mar 2019.", - campaign.getDescription()); - assertEquals("2019 IRS Season 1", campaign.getTitle()); - assertEquals("2019-01-01", campaign.getExecutionPeriod().getStart().toString("yyyy-MM-dd")); - assertEquals("2019-03-31", campaign.getExecutionPeriod().getEnd().toString("yyyy-MM-dd")); - assertEquals(Task.TaskStatus.IN_PROGRESS, campaign.getStatus()); - assertEquals("2018-10-01T0900", campaign.getAuthoredOn().toString("yyyy-MM-dd'T'HHmm")); - assertEquals("2018-11-12T1149", campaign.getLastModified().toString("yyyy-MM-dd'T'HHmm")); - assertEquals("jdoe", campaign.getOwner()); - - } - - @Test - public void testGetWithNoIdentifier() { - - Campaign campaign = campaignRepository.get(""); - assertNull(campaign); - - } - - @Test - public void testSafeRemove() { - assertEquals(2, campaignRepository.getAll().size()); - Campaign campaign = campaignRepository.get("IRS_2018_S1"); - campaignRepository.safeRemove(campaign); - assertEquals(1, campaignRepository.getAll().size()); - assertNull(campaignRepository.get("IRS_2018_S1")); - - } - - @Test - public void testSafeRemoveNonExistentCampaign() { - campaignRepository.safeRemove(null); - campaignRepository.safeRemove(new Campaign()); - assertEquals(2, campaignRepository.getAll().size()); - - campaignRepository.safeRemove(campaignRepository.get("IRS_2018_S1")); - assertEquals(1, campaignRepository.getAll().size()); - - campaignRepository.safeRemove(campaignRepository.get("IRS_2018_S1")); - assertEquals(1, campaignRepository.getAll().size()); - - } - - @Test - public void testAdd() { - Campaign campaign = new Campaign(); - campaign.setIdentifier("ITN_2018_S1"); - campaign.setDescription("ITN for 2018 Season 1"); - Period executionPeriod = new Period(); - executionPeriod.setStart(new LocalDate("2018-01-01").toDateTimeAtStartOfDay()); - executionPeriod.setEnd(new LocalDate("2018-03-31").toDateTimeAtStartOfDay()); - campaign.setExecutionPeriod(executionPeriod); - campaign.setOwner("superAdmin"); - campaignRepository.add(campaign); - assertEquals(3, campaignRepository.getAll().size()); - Campaign addedCampaign = campaignRepository.get("ITN_2018_S1"); - assertNotNull(addedCampaign); - assertEquals("ITN for 2018 Season 1", addedCampaign.getDescription()); - - } - - @Test - public void testAddInvalidObject() { - assertEquals(2, campaignRepository.getAll().size()); - Campaign campaign = new Campaign(); - campaignRepository.add(campaign); - assertEquals(2, campaignRepository.getAll().size()); - - campaignRepository.add(null); - assertEquals(2, campaignRepository.getAll().size()); - - } - - @Test - public void testAddExistingObject() { - assertEquals(2, campaignRepository.getAll().size()); - Campaign campaign = campaignRepository.get("IRS_2018_S2"); - campaignRepository.add(campaign); - assertEquals(2, campaignRepository.getAll().size()); - - } - - @Test - public void testEdit() { - Campaign campaign = campaignRepository.get("IRS_2018_S2"); - campaign.setDescription("Sprap season 2 2018"); - Period executionPeriod = new Period(); - executionPeriod.setStart(new LocalDate("2018-04-01").toDateTimeAtStartOfDay()); - executionPeriod.setEnd(new LocalDate("2018-06-30").toDateTimeAtStartOfDay()); - campaign.setExecutionPeriod(executionPeriod); - campaignRepository.update(campaign); - - Campaign updatedCampaign = campaignRepository.get("IRS_2018_S2"); - assertEquals("Sprap season 2 2018", updatedCampaign.getDescription()); - assertEquals("2018-04-01", updatedCampaign.getExecutionPeriod().getStart().toString("yyyy-MM-dd")); - assertEquals("2018-06-30", updatedCampaign.getExecutionPeriod().getEnd().toString("yyyy-MM-dd")); - - } - - @Test - public void testEditInvalidObject() { - assertEquals(2, campaignRepository.getAll().size()); - Campaign campaign = campaignRepository.get("IRS_2018_S2"); - campaignRepository.safeRemove(campaign); + @Autowired + private CampaignRepository campaignRepository; + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("campaign.sql"); + return scripts; + } + + @Test + public void testGet() { + + Campaign campaign = campaignRepository.get("IRS_2018_S1"); + assertEquals("2019 IRS Season 1", campaign.getTitle()); + assertEquals( + "This is the 2010 IRS Spray Campaign for Zambia for the first spray season dated 1 Jan 2019 - 31 Mar 2019.", + campaign.getDescription()); + assertEquals("2019 IRS Season 1", campaign.getTitle()); + assertEquals("2019-01-01", campaign.getExecutionPeriod().getStart().toString("yyyy-MM-dd")); + assertEquals("2019-03-31", campaign.getExecutionPeriod().getEnd().toString("yyyy-MM-dd")); + assertEquals(Task.TaskStatus.IN_PROGRESS, campaign.getStatus()); + assertEquals("2018-10-01T0900", campaign.getAuthoredOn().toString("yyyy-MM-dd'T'HHmm")); + assertEquals("2018-11-12T1149", campaign.getLastModified().toString("yyyy-MM-dd'T'HHmm")); + assertEquals("jdoe", campaign.getOwner()); + + } + + @Test + public void testGetWithNoIdentifier() { + + Campaign campaign = campaignRepository.get(""); + assertNull(campaign); + + } + + @Test + public void testSafeRemove() { + assertEquals(2, campaignRepository.getAll().size()); + Campaign campaign = campaignRepository.get("IRS_2018_S1"); + campaignRepository.safeRemove(campaign); + assertEquals(1, campaignRepository.getAll().size()); + assertNull(campaignRepository.get("IRS_2018_S1")); + + } + + @Test + public void testSafeRemoveNonExistentCampaign() { + campaignRepository.safeRemove(null); + campaignRepository.safeRemove(new Campaign()); + assertEquals(2, campaignRepository.getAll().size()); + + campaignRepository.safeRemove(campaignRepository.get("IRS_2018_S1")); + assertEquals(1, campaignRepository.getAll().size()); + + campaignRepository.safeRemove(campaignRepository.get("IRS_2018_S1")); + assertEquals(1, campaignRepository.getAll().size()); + + } + + @Test + public void testAdd() { + Campaign campaign = new Campaign(); + campaign.setIdentifier("ITN_2018_S1"); + campaign.setDescription("ITN for 2018 Season 1"); + Period executionPeriod = new Period(); + executionPeriod.setStart(new LocalDate("2018-01-01").toDateTimeAtStartOfDay()); + executionPeriod.setEnd(new LocalDate("2018-03-31").toDateTimeAtStartOfDay()); + campaign.setExecutionPeriod(executionPeriod); + campaign.setOwner("superAdmin"); + campaignRepository.add(campaign); + assertEquals(3, campaignRepository.getAll().size()); + Campaign addedCampaign = campaignRepository.get("ITN_2018_S1"); + assertNotNull(addedCampaign); + assertEquals("ITN for 2018 Season 1", addedCampaign.getDescription()); + + } + + @Test + public void testAddInvalidObject() { + assertEquals(2, campaignRepository.getAll().size()); + Campaign campaign = new Campaign(); + campaignRepository.add(campaign); + assertEquals(2, campaignRepository.getAll().size()); + + campaignRepository.add(null); + assertEquals(2, campaignRepository.getAll().size()); + + } + + @Test + public void testAddExistingObject() { + assertEquals(2, campaignRepository.getAll().size()); + Campaign campaign = campaignRepository.get("IRS_2018_S2"); + campaignRepository.add(campaign); + assertEquals(2, campaignRepository.getAll().size()); + + } + + @Test + public void testEdit() { + Campaign campaign = campaignRepository.get("IRS_2018_S2"); + campaign.setDescription("Sprap season 2 2018"); + Period executionPeriod = new Period(); + executionPeriod.setStart(new LocalDate("2018-04-01").toDateTimeAtStartOfDay()); + executionPeriod.setEnd(new LocalDate("2018-06-30").toDateTimeAtStartOfDay()); + campaign.setExecutionPeriod(executionPeriod); + campaignRepository.update(campaign); + + Campaign updatedCampaign = campaignRepository.get("IRS_2018_S2"); + assertEquals("Sprap season 2 2018", updatedCampaign.getDescription()); + assertEquals("2018-04-01", updatedCampaign.getExecutionPeriod().getStart().toString("yyyy-MM-dd")); + assertEquals("2018-06-30", updatedCampaign.getExecutionPeriod().getEnd().toString("yyyy-MM-dd")); + + } + + @Test + public void testEditInvalidObject() { + assertEquals(2, campaignRepository.getAll().size()); + Campaign campaign = campaignRepository.get("IRS_2018_S2"); + campaignRepository.safeRemove(campaign); - campaignRepository.update(campaign); - assertNull(campaignRepository.get("IRS_2018_S2")); + campaignRepository.update(campaign); + assertNull(campaignRepository.get("IRS_2018_S2")); - } + } - @Test - public void testEditNonExistentCampaign() { - assertEquals(2, campaignRepository.getAll().size()); - Campaign campaign = new Campaign(); - campaignRepository.update(campaign); - assertEquals(2, campaignRepository.getAll().size()); + @Test + public void testEditNonExistentCampaign() { + assertEquals(2, campaignRepository.getAll().size()); + Campaign campaign = new Campaign(); + campaignRepository.update(campaign); + assertEquals(2, campaignRepository.getAll().size()); - campaignRepository.update(null); - assertEquals(2, campaignRepository.getAll().size()); - - } - - @Test - public void testGetCampaignsByServerVersion() { - List campaigns = campaignRepository.getCampaignsByServerVersion(0); - assertEquals(2, campaigns.size()); + campaignRepository.update(null); + assertEquals(2, campaignRepository.getAll().size()); + + } + + @Test + public void testGetCampaignsByServerVersion() { + List campaigns = campaignRepository.getCampaignsByServerVersion(0); + assertEquals(2, campaigns.size()); - assertEquals(2, campaignRepository.getCampaignsByServerVersion(1542012540782l).size()); + assertEquals(2, campaignRepository.getCampaignsByServerVersion(1542012540782l).size()); - campaigns = campaignRepository.getCampaignsByServerVersion(1542012540783l); - - assertEquals(1, campaigns.size()); + campaigns = campaignRepository.getCampaignsByServerVersion(1542012540783l); + + assertEquals(1, campaigns.size()); - assertEquals("IRS_2018_S2", campaigns.get(0).getIdentifier()); + assertEquals("IRS_2018_S2", campaigns.get(0).getIdentifier()); - assertTrue(campaignRepository.getCampaignsByServerVersion(System.currentTimeMillis()).isEmpty()); + assertTrue(campaignRepository.getCampaignsByServerVersion(System.currentTimeMillis()).isEmpty()); - } + } } diff --git a/src/test/java/org/opensrp/repository/postgres/ClientFormRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/ClientFormRepositoryTest.java index f2b65e66d..f59f003b2 100644 --- a/src/test/java/org/opensrp/repository/postgres/ClientFormRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/ClientFormRepositoryTest.java @@ -20,148 +20,148 @@ public class ClientFormRepositoryTest extends BaseRepositoryTest { - @Autowired - private ClientFormRepository clientFormRepository; - - private Set scripts = new HashSet(); - - @Override - protected Set getDatabaseScripts() { - scripts.add("client_form.sql"); - return scripts; - } - - @Test - public void testGet() { - assertNotNull(clientFormRepository.get(5)); - } - - @Test - public void testCountClientFormByFormIdentifier() { - assertEquals(5, clientFormRepository.countClientFormByFormIdentifier("json.form/adverse_event.json")); - } - - @Test - public void testGetClientFormMetadataFromIdentifierAndVersion() { - ClientFormMetadata clientFormMetadata = clientFormRepository - .getClientFormMetadata("0.0.1", "json.form/adverse_event.json"); - assertEquals("AEFI", clientFormMetadata.getLabel()); - assertEquals("child", clientFormMetadata.getModule()); - } - - @Test - public void testGetAvailableClientFormVersions() { - assertEquals(5, clientFormRepository.getAvailableClientFormVersions("json.form/adverse_event.json").size()); - } - - @Test - public void testGetFormMetadata() { - ClientFormMetadata clientFormMetadata = clientFormRepository.getFormMetadata(3); - assertEquals("child", clientFormMetadata.getModule()); - assertEquals("0.1.0", clientFormMetadata.getVersion()); - assertEquals("json.form/adverse_event.json", clientFormMetadata.getIdentifier()); - } - - @Test(expected = IllegalArgumentException.class) - public void testCreateShouldReturnNull() { - ClientForm clientForm = new ClientForm(); - clientForm.setId(2L); - clientFormRepository.create(clientForm, new ClientFormMetadata()); - } - - @Test - public void testCreateShouldReturnValidObject() { - ClientForm clientForm = new ClientForm(); - clientForm.setCreatedAt(new Date()); - clientForm.setJson("{'from': 'child'}"); - - ClientFormMetadata clientFormMetadata = new ClientFormMetadata(); - clientFormMetadata.setModule("child"); - clientFormMetadata.setVersion("1.0.0"); - clientFormMetadata.setIdentifier("json.form/child/sample.json"); - clientFormMetadata.setLabel("SAMPLE FORM"); - clientFormMetadata.setCreatedAt(new Date()); - - ClientFormService.CompleteClientForm completeClientForm = clientFormRepository - .create(clientForm, clientFormMetadata); - - assertEquals(7, (long) completeClientForm.clientForm.getId()); - assertEquals(7, (long) completeClientForm.clientFormMetadata.getId()); - } - - @Test - public void testFormRelationshipIsNullByDefault() { - ClientFormMetadata clientFormMetadata = clientFormRepository.getFormMetadata(3); - assertNull(clientFormMetadata.getRelation()); - } - - @Test - public void canCreateMetadataWithFormRelationship() { - ClientForm clientForm = new ClientForm(); - clientForm.setCreatedAt(new Date()); - clientForm.setJson("calculation = helper.getDuration(step1_date_died , step1_dob)"); - - ClientFormMetadata clientFormMetadata = new ClientFormMetadata(); - clientFormMetadata.setModule("anc"); - clientFormMetadata.setVersion("1.0.0"); - clientFormMetadata.setIdentifier("rule/sample_calc.yml"); - clientFormMetadata.setRelation("json.form/anc/sample.json"); - clientFormMetadata.setLabel("SAMPLE CALC FORM"); - clientFormMetadata.setCreatedAt(new Date()); - - ClientFormService.CompleteClientForm completeClientForm = clientFormRepository - .create(clientForm, clientFormMetadata); - - assertEquals(7, (long) completeClientForm.clientForm.getId()); - assertEquals("json.form/anc/sample.json", completeClientForm.clientFormMetadata.getRelation()); - } - - @Test - public void testGetAll() { - assertEquals(6, clientFormRepository.getAll().size()); - } - - @Test(expected = UnsupportedOperationException.class) - public void testAdd() { - ClientForm clientForm = new ClientForm(); - clientForm.setCreatedAt(new Date()); - clientForm.setJson("{}"); - - clientFormRepository.add(clientForm); - } - - @Test - public void testGetShouldReturnNullWhenIdIsEmpty() { - assertNull(clientFormRepository.get(null)); - } - - @Test - public void testGetShouldReturnNullWhenIdIsNotValidLong() { - assertNull(clientFormRepository.get("isd98")); - } - - @Test - public void testGetShouldValidForm() throws JsonProcessingException { - ClientForm clientForm = clientFormRepository.get("1"); - - ObjectMapper mapper = new ObjectMapper(); - JsonNode tree1 = mapper.readTree((String) clientForm.getJson()); - JsonNode tree2 = mapper.readTree("{\"count\":\"1\",\"encounter_type\":\"AEFI\",\"entity_id\":\"\",\"metadata\":{\"start\":{\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_data_type\":\"start\",\"openmrs_entity_id\":\"163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},\"end\":{\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_data_type\":\"end\",\"openmrs_entity_id\":\"163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},\"today\":{\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"encounter\",\"openmrs_entity_id\":\"encounter_date\"},\"deviceid\":{\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_data_type\":\"deviceid\",\"openmrs_entity_id\":\"163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},\"subscriberid\":{\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_data_type\":\"subscriberid\",\"openmrs_entity_id\":\"163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},\"simserial\":{\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_data_type\":\"simserial\",\"openmrs_entity_id\":\"163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},\"phonenumber\":{\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_data_type\":\"phonenumber\",\"openmrs_entity_id\":\"163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},\"encounter_location\":\"\"},\"step1\":{\"title\":\"Adverse Event Reporting\",\"fields\":[{\"key\":\"Reaction_Vaccine\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_entity_id\":\"6042AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"openmrs_data_type\":\"select one\",\"type\":\"spinner\",\"hint\":\"Vaccine that caused the reaction\",\"values\":[\"BCG\",\"HepB\",\"OPV\",\"Penta\",\"PCV\",\"Rota\",\"Measles\",\"MR\",\"Yellow Fever\"],\"openmrs_choice_ids\":{\"BCG\":\"149310AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"HepB\":\"162269AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"OPV\":\"129578AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"Penta\":\"162265AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"PCV\":\"162266AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"Rota\":\"162272AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"Measles\":\"149286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"MR\":\"149286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"Yellow Fever\":\"149253AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},\"v_required\":{\"value\":true,\"err\":\"Please enter the vaccine that caused the reaction\"}},{\"key\":\"aefi_start_date\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\",\"type\":\"date_picker\",\"hint\":\"Date the adverse effects began\",\"expanded\":false,\"v_required\":{\"value\":true,\"err\":\"Please enter the date the adverse effects began\"}},{\"key\":\"reaction\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\",\"openmrs_data_type\":\"\",\"type\":\"check_box\",\"label\":\"Select the reaction\",\"hint\":\"Select the reaction\",\"label_text_style\":\"bold\",\"options\":[{\"key\":\"bacteria_abscesses\",\"text\":\"Minor AEFI Bacteria abscesses\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"lymphadenitis\",\"text\":\"Minor AEFI Lymphadenitis\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"sepsis\",\"text\":\"Minor AEFI Sepsis\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"local_reaction\",\"text\":\"Minor AEFI Severe local reaction\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"birth_defect\",\"text\":\"Serious AEFI Birth Defect\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"death\",\"text\":\"Serious AEFI Death\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"encephalopathy\",\"text\":\"Serious AEFI Encephalopathy\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"high_fever \",\"text\":\"Serious AEFI High fever > 38 Degrees Celcius\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"paralysis\",\"text\":\"Serious AEFI Paralysis\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"seizures\",\"text\":\"Serious AEFI Seizures\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"birth_defect\",\"text\":\"Serious AEFI Significant Disability\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"toxic_shock_syndrome\",\"text\":\"Serious AEFI Toxic shock syndrome\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"other\",\"text\":\"Other (specify)\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"}],\"v_required\":{\"value\":false,\"err\":\"Please select at least one reaction\"}},{\"key\":\"other_reaction\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\",\"openmrs_data_type\":\"text\",\"type\":\"edit_text\",\"hint\":\"Other Reaction\",\"relevance\":{\"step1:reaction\":{\"ex-checkbox\":[{\"or\":[\"other\"]}]}}},{\"key\":\"child_referred\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_entity_id\":\"163340AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"openmrs_data_type\":\"select one\",\"type\":\"native_radio\",\"label\":\"Child Referred?\",\"label_text_style\":\"bold\",\"options\":[{\"key\":\"Yes\",\"text\":\"Yes\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_entity_id\":\"1267AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},{\"key\":\"No\",\"text\":\"No\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_entity_id\":\"163339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"}]},{\"key\":\"aefi_form\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_entity_id\":\"163340AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"openmrs_data_type\":\"select one\",\"type\":\"native_radio\",\"label\":\"Was the AEFI form completed?\",\"label_text_style\":\"bold\",\"options\":[{\"key\":\"Yes\",\"text\":\"Yes\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_entity_id\":\"1267AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},{\"key\":\"No\",\"text\":\"No\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_entity_id\":\"163339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"}]}]}}"); - - assertEquals(tree1, tree2); - } - - @Test - public void testSafeRemove() { - assertNotNull(clientFormRepository.get(1)); - - ClientForm clientForm = new ClientForm(); - clientForm.setId(1L); - - clientFormRepository.safeRemove(clientForm); - - assertNull(clientFormRepository.get(1L)); - assertNull(clientFormRepository.getClientFormMetadata("0.0.1", "json.form/adverse_event.json")); - } + @Autowired + private ClientFormRepository clientFormRepository; + + private Set scripts = new HashSet(); + + @Override + protected Set getDatabaseScripts() { + scripts.add("client_form.sql"); + return scripts; + } + + @Test + public void testGet() { + assertNotNull(clientFormRepository.get(5)); + } + + @Test + public void testCountClientFormByFormIdentifier() { + assertEquals(5, clientFormRepository.countClientFormByFormIdentifier("json.form/adverse_event.json")); + } + + @Test + public void testGetClientFormMetadataFromIdentifierAndVersion() { + ClientFormMetadata clientFormMetadata = clientFormRepository + .getClientFormMetadata("0.0.1", "json.form/adverse_event.json"); + assertEquals("AEFI", clientFormMetadata.getLabel()); + assertEquals("child", clientFormMetadata.getModule()); + } + + @Test + public void testGetAvailableClientFormVersions() { + assertEquals(5, clientFormRepository.getAvailableClientFormVersions("json.form/adverse_event.json").size()); + } + + @Test + public void testGetFormMetadata() { + ClientFormMetadata clientFormMetadata = clientFormRepository.getFormMetadata(3); + assertEquals("child", clientFormMetadata.getModule()); + assertEquals("0.1.0", clientFormMetadata.getVersion()); + assertEquals("json.form/adverse_event.json", clientFormMetadata.getIdentifier()); + } + + @Test(expected = IllegalArgumentException.class) + public void testCreateShouldReturnNull() { + ClientForm clientForm = new ClientForm(); + clientForm.setId(2L); + clientFormRepository.create(clientForm, new ClientFormMetadata()); + } + + @Test + public void testCreateShouldReturnValidObject() { + ClientForm clientForm = new ClientForm(); + clientForm.setCreatedAt(new Date()); + clientForm.setJson("{'from': 'child'}"); + + ClientFormMetadata clientFormMetadata = new ClientFormMetadata(); + clientFormMetadata.setModule("child"); + clientFormMetadata.setVersion("1.0.0"); + clientFormMetadata.setIdentifier("json.form/child/sample.json"); + clientFormMetadata.setLabel("SAMPLE FORM"); + clientFormMetadata.setCreatedAt(new Date()); + + ClientFormService.CompleteClientForm completeClientForm = clientFormRepository + .create(clientForm, clientFormMetadata); + + assertEquals(7, (long) completeClientForm.clientForm.getId()); + assertEquals(7, (long) completeClientForm.clientFormMetadata.getId()); + } + + @Test + public void testFormRelationshipIsNullByDefault() { + ClientFormMetadata clientFormMetadata = clientFormRepository.getFormMetadata(3); + assertNull(clientFormMetadata.getRelation()); + } + + @Test + public void canCreateMetadataWithFormRelationship() { + ClientForm clientForm = new ClientForm(); + clientForm.setCreatedAt(new Date()); + clientForm.setJson("calculation = helper.getDuration(step1_date_died , step1_dob)"); + + ClientFormMetadata clientFormMetadata = new ClientFormMetadata(); + clientFormMetadata.setModule("anc"); + clientFormMetadata.setVersion("1.0.0"); + clientFormMetadata.setIdentifier("rule/sample_calc.yml"); + clientFormMetadata.setRelation("json.form/anc/sample.json"); + clientFormMetadata.setLabel("SAMPLE CALC FORM"); + clientFormMetadata.setCreatedAt(new Date()); + + ClientFormService.CompleteClientForm completeClientForm = clientFormRepository + .create(clientForm, clientFormMetadata); + + assertEquals(7, (long) completeClientForm.clientForm.getId()); + assertEquals("json.form/anc/sample.json", completeClientForm.clientFormMetadata.getRelation()); + } + + @Test + public void testGetAll() { + assertEquals(6, clientFormRepository.getAll().size()); + } + + @Test(expected = UnsupportedOperationException.class) + public void testAdd() { + ClientForm clientForm = new ClientForm(); + clientForm.setCreatedAt(new Date()); + clientForm.setJson("{}"); + + clientFormRepository.add(clientForm); + } + + @Test + public void testGetShouldReturnNullWhenIdIsEmpty() { + assertNull(clientFormRepository.get(null)); + } + + @Test + public void testGetShouldReturnNullWhenIdIsNotValidLong() { + assertNull(clientFormRepository.get("isd98")); + } + + @Test + public void testGetShouldValidForm() throws JsonProcessingException { + ClientForm clientForm = clientFormRepository.get("1"); + + ObjectMapper mapper = new ObjectMapper(); + JsonNode tree1 = mapper.readTree((String) clientForm.getJson()); + JsonNode tree2 = mapper.readTree("{\"count\":\"1\",\"encounter_type\":\"AEFI\",\"entity_id\":\"\",\"metadata\":{\"start\":{\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_data_type\":\"start\",\"openmrs_entity_id\":\"163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},\"end\":{\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_data_type\":\"end\",\"openmrs_entity_id\":\"163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},\"today\":{\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"encounter\",\"openmrs_entity_id\":\"encounter_date\"},\"deviceid\":{\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_data_type\":\"deviceid\",\"openmrs_entity_id\":\"163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},\"subscriberid\":{\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_data_type\":\"subscriberid\",\"openmrs_entity_id\":\"163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},\"simserial\":{\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_data_type\":\"simserial\",\"openmrs_entity_id\":\"163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},\"phonenumber\":{\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_data_type\":\"phonenumber\",\"openmrs_entity_id\":\"163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},\"encounter_location\":\"\"},\"step1\":{\"title\":\"Adverse Event Reporting\",\"fields\":[{\"key\":\"Reaction_Vaccine\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_entity_id\":\"6042AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"openmrs_data_type\":\"select one\",\"type\":\"spinner\",\"hint\":\"Vaccine that caused the reaction\",\"values\":[\"BCG\",\"HepB\",\"OPV\",\"Penta\",\"PCV\",\"Rota\",\"Measles\",\"MR\",\"Yellow Fever\"],\"openmrs_choice_ids\":{\"BCG\":\"149310AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"HepB\":\"162269AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"OPV\":\"129578AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"Penta\":\"162265AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"PCV\":\"162266AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"Rota\":\"162272AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"Measles\":\"149286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"MR\":\"149286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"Yellow Fever\":\"149253AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},\"v_required\":{\"value\":true,\"err\":\"Please enter the vaccine that caused the reaction\"}},{\"key\":\"aefi_start_date\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\",\"type\":\"date_picker\",\"hint\":\"Date the adverse effects began\",\"expanded\":false,\"v_required\":{\"value\":true,\"err\":\"Please enter the date the adverse effects began\"}},{\"key\":\"reaction\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\",\"openmrs_data_type\":\"\",\"type\":\"check_box\",\"label\":\"Select the reaction\",\"hint\":\"Select the reaction\",\"label_text_style\":\"bold\",\"options\":[{\"key\":\"bacteria_abscesses\",\"text\":\"Minor AEFI Bacteria abscesses\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"lymphadenitis\",\"text\":\"Minor AEFI Lymphadenitis\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"sepsis\",\"text\":\"Minor AEFI Sepsis\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"local_reaction\",\"text\":\"Minor AEFI Severe local reaction\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"birth_defect\",\"text\":\"Serious AEFI Birth Defect\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"death\",\"text\":\"Serious AEFI Death\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"encephalopathy\",\"text\":\"Serious AEFI Encephalopathy\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"high_fever \",\"text\":\"Serious AEFI High fever > 38 Degrees Celcius\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"paralysis\",\"text\":\"Serious AEFI Paralysis\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"seizures\",\"text\":\"Serious AEFI Seizures\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"birth_defect\",\"text\":\"Serious AEFI Significant Disability\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"toxic_shock_syndrome\",\"text\":\"Serious AEFI Toxic shock syndrome\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"},{\"key\":\"other\",\"text\":\"Other (specify)\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\"}],\"v_required\":{\"value\":false,\"err\":\"Please select at least one reaction\"}},{\"key\":\"other_reaction\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"\",\"openmrs_entity_id\":\"\",\"openmrs_data_type\":\"text\",\"type\":\"edit_text\",\"hint\":\"Other Reaction\",\"relevance\":{\"step1:reaction\":{\"ex-checkbox\":[{\"or\":[\"other\"]}]}}},{\"key\":\"child_referred\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_entity_id\":\"163340AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"openmrs_data_type\":\"select one\",\"type\":\"native_radio\",\"label\":\"Child Referred?\",\"label_text_style\":\"bold\",\"options\":[{\"key\":\"Yes\",\"text\":\"Yes\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_entity_id\":\"1267AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},{\"key\":\"No\",\"text\":\"No\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_entity_id\":\"163339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"}]},{\"key\":\"aefi_form\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_entity_id\":\"163340AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"openmrs_data_type\":\"select one\",\"type\":\"native_radio\",\"label\":\"Was the AEFI form completed?\",\"label_text_style\":\"bold\",\"options\":[{\"key\":\"Yes\",\"text\":\"Yes\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_entity_id\":\"1267AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"},{\"key\":\"No\",\"text\":\"No\",\"openmrs_entity_parent\":\"\",\"openmrs_entity\":\"concept\",\"openmrs_entity_id\":\"163339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"}]}]}}"); + + assertEquals(tree1, tree2); + } + + @Test + public void testSafeRemove() { + assertNotNull(clientFormRepository.get(1)); + + ClientForm clientForm = new ClientForm(); + clientForm.setId(1L); + + clientFormRepository.safeRemove(clientForm); + + assertNull(clientFormRepository.get(1L)); + assertNull(clientFormRepository.getClientFormMetadata("0.0.1", "json.form/adverse_event.json")); + } } diff --git a/src/test/java/org/opensrp/repository/postgres/ClientMigrationFileRepositoryImplTest.java b/src/test/java/org/opensrp/repository/postgres/ClientMigrationFileRepositoryImplTest.java index 3fc25dfde..62e90386a 100644 --- a/src/test/java/org/opensrp/repository/postgres/ClientMigrationFileRepositoryImplTest.java +++ b/src/test/java/org/opensrp/repository/postgres/ClientMigrationFileRepositoryImplTest.java @@ -13,220 +13,220 @@ public class ClientMigrationFileRepositoryImplTest extends BaseRepositoryTest { - @Autowired - private ClientMigrationFileRepository clientMigrationFileRepository; - - private Set scripts = new HashSet(); - - @Test - public void getShouldReturnMigrationFileWhenGivenAValidId() { - ClientMigrationFile clientMigrationFile = clientMigrationFileRepository.get("1"); - - Assert.assertEquals("cec563c2-d3e7-4b2a-866e-82d5902d44de", clientMigrationFile.getIdentifier()); - Assert.assertEquals("1.up.sql", clientMigrationFile.getFilename()); - Assert.assertEquals("CREATE TABLE vaccines(id INTEGER, vaccine_name VARCHAR);", clientMigrationFile.getFileContents()); - Assert.assertEquals(null, clientMigrationFile.getJurisdiction()); - Assert.assertEquals(Integer.valueOf(1), clientMigrationFile.getVersion()); - Assert.assertEquals(Integer.valueOf(1), clientMigrationFile.getManifestId()); - Assert.assertEquals(null, clientMigrationFile.getObjectStoragePath()); - Assert.assertEquals(false, clientMigrationFile.getOnObjectStorage()); - } - - @Test - public void getShouldReturnNullWhenGivenBlankId() { - Assert.assertNull(clientMigrationFileRepository.get("")); - } - - @Test - public void getShouldReturnNullWhenGivenNonIntegerId() { - Assert.assertNull(clientMigrationFileRepository.get("98iu")); - } - - @Test(expected = IllegalStateException.class) - public void addShouldThrowExceptionWhenGiveNullClientMigrationFile() { - clientMigrationFileRepository.add(null); - } - - @Test(expected = IllegalStateException.class) - public void addShouldThrowExceptionWhenGiveClientMigrationFileWithNullIdentifier() { - ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); - clientMigrationFileRepository.add(clientMigrationFile); - } - - @Test(expected = EntityExistsException.class) - public void addShouldThrowExceptionWhenGiveClientMigrationFileWithId() { - ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); - clientMigrationFile.setIdentifier("my-identifier"); - clientMigrationFile.setId(2398L); - clientMigrationFileRepository.add(clientMigrationFile); - } - - @Test - public void addShouldCallInsertSelectiveOnMapper() { - ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); - clientMigrationFile.setIdentifier("my-identifier"); - String randomFileName = "some-random-filename"; - clientMigrationFile.setFilename(randomFileName); - clientMigrationFile.setVersion(89); - clientMigrationFileRepository.add(clientMigrationFile); - - ClientMigrationFile actualRecord = clientMigrationFileRepository.getClientMigrationFileByIdentifier("my-identifier"); - Assert.assertEquals(randomFileName, actualRecord.getFilename()); - } - - @Test - public void updateShouldUpdateClientMigrationFileDetails() { - ClientMigrationFile clientMigrationFile = clientMigrationFileRepository.getClientMigrationFileByIdentifier("38bc7c3f-7439-4d62-bd9b-fa40867d0a44"); - clientMigrationFile.setFilename("a different file name"); - - clientMigrationFileRepository.update(clientMigrationFile); - - ClientMigrationFile actualUpdatedRecord = clientMigrationFileRepository.getClientMigrationFileByIdentifier("38bc7c3f-7439-4d62-bd9b-fa40867d0a44"); - Assert.assertEquals("a different file name", actualUpdatedRecord.getFilename()); - } - - @Test - public void updateShouldNotUpdateClientMigrationFileDetailsWhenIdentifierIsNull() { - ClientMigrationFile clientMigrationFile = clientMigrationFileRepository.getClientMigrationFileByIdentifier("38bc7c3f-7439-4d62-bd9b-fa40867d0a44"); - clientMigrationFile.setFilename("a different file name"); - clientMigrationFile.setIdentifier(null); - - clientMigrationFileRepository.update(clientMigrationFile); - - // Assert that the file name is similar - ClientMigrationFile actualUpdatedRecord = clientMigrationFileRepository.getClientMigrationFileByIdentifier("38bc7c3f-7439-4d62-bd9b-fa40867d0a44"); - Assert.assertEquals("3.up.sql", actualUpdatedRecord.getFilename()); - } - - @Test - public void updateShouldNotUpdateClientMigrationFileDetailsWhenIdIsNull() { - ClientMigrationFile clientMigrationFile = clientMigrationFileRepository.getClientMigrationFileByIdentifier("38bc7c3f-7439-4d62-bd9b-fa40867d0a44"); - clientMigrationFile.setFilename("a different file name"); - clientMigrationFile.setId(null); - - clientMigrationFileRepository.update(clientMigrationFile); - - // Assert that the file name is similar - ClientMigrationFile actualUpdatedRecord = clientMigrationFileRepository.getClientMigrationFileByIdentifier("38bc7c3f-7439-4d62-bd9b-fa40867d0a44"); - Assert.assertEquals("3.up.sql", actualUpdatedRecord.getFilename()); - } - - @Test - public void getAll() { - List migrationFiles = clientMigrationFileRepository.getAll(); - - Assert.assertEquals(6, migrationFiles.size()); - } - - @Test - public void safeRemove() { - ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); - clientMigrationFile.setId(5L); - - clientMigrationFileRepository.safeRemove(clientMigrationFile); - - Assert.assertEquals(5, clientMigrationFileRepository.getAll().size()); - Assert.assertNull(clientMigrationFileRepository.get("5")); - } - - @Test - public void safeRemoveShouldFailWhenEntityPrimaryKeyIsNull() { - ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); - clientMigrationFile.setId(null); - - clientMigrationFileRepository.safeRemove(clientMigrationFile); - - Assert.assertEquals(6, clientMigrationFileRepository.getAll().size()); - } - - @Test - public void safeRemoveShouldFailWhenEntityIsNull() { - clientMigrationFileRepository.safeRemove(null); - - Assert.assertEquals(6, clientMigrationFileRepository.getAll().size()); - } - - @Test - public void getClientMigrationFileByFilename() { - ClientMigrationFile clientMigrationFile = clientMigrationFileRepository.getClientMigrationFileByFilename("3.up.sql"); - - Assert.assertEquals(Integer.valueOf(3), clientMigrationFile.getVersion()); - Assert.assertEquals(Integer.valueOf(3), clientMigrationFile.getManifestId()); - Assert.assertEquals("CREATE TABLE alerts(id INTEGER, alert_name VARCHAR, is_offline BOOLEAN);", clientMigrationFile.getFileContents()); - Assert.assertEquals("38bc7c3f-7439-4d62-bd9b-fa40867d0a44", clientMigrationFile.getIdentifier()); - } - - @Test - public void getClientMigrationFileByFilenameShouldReturnNullWhenFileNameisEmpty() { - Assert.assertNull(clientMigrationFileRepository.getClientMigrationFileByFilename("")); - } - - @Test - public void getClientMigrationFileByVersion() { - List migrationFiles = clientMigrationFileRepository.getClientMigrationFileByVersion(3); - - Assert.assertEquals(2, migrationFiles.size()); - Assert.assertEquals(Integer.valueOf(3), migrationFiles.get(0).getVersion()); - - Assert.assertEquals("3.up.sql", migrationFiles.get(0).getFilename()); - Assert.assertEquals("3.down.sql", migrationFiles.get(1).getFilename()); - } - - @Test - public void getClientMigrationFileByManifestId() { - List migrationFiles = clientMigrationFileRepository.getClientMigrationFileByManifestId(3); - - Assert.assertEquals(2, migrationFiles.size()); - Assert.assertEquals(Integer.valueOf(3), migrationFiles.get(0).getVersion()); - - Assert.assertEquals(Integer.valueOf(3), migrationFiles.get(0).getManifestId()); - Assert.assertEquals("3.up.sql", migrationFiles.get(0).getFilename()); - Assert.assertEquals("3.down.sql", migrationFiles.get(1).getFilename()); - } - - @Test - public void getClientMigrationFileByManifestIdShouldReturnNull() { - Assert.assertNull(clientMigrationFileRepository.getClientMigrationFileByManifestId(0)); - } - - @Test - public void getClientMigrationFileByIdShouldReturnNull() { - Assert.assertNull(clientMigrationFileRepository.getClientMigrationFileById(0)); - } - - @Test - public void getClientMigrationFileByIdShouldReturnClientMigrationFile() { - ClientMigrationFile clientMigrationFile = clientMigrationFileRepository.getClientMigrationFileById(1); - Assert.assertEquals("cec563c2-d3e7-4b2a-866e-82d5902d44de", clientMigrationFile.getIdentifier()); - Assert.assertEquals("1.up.sql", clientMigrationFile.getFilename()); - } - - @Test - public void getClientMigrationFileByIdentifierShouldReturnNull() { - Assert.assertNull(clientMigrationFileRepository.getClientMigrationFileByIdentifier("an-identifier")); - } - - @Test - public void getClientMigrationFileByIdentifierShouldReturnClientMigrationFile() { - ClientMigrationFile clientMigrationFile = clientMigrationFileRepository.getClientMigrationFileByIdentifier("70cbd363-5dd7-4e92-8364-bcc093cb4962"); - Assert.assertEquals("2.down.sql", clientMigrationFile.getFilename()); - Assert.assertEquals(Integer.valueOf(2), clientMigrationFile.getVersion()); - Assert.assertEquals("ALTER TABLE vaccines RENAME TO vaccines_old;\\nCREATE TABLE vaccines(id INTEGER, vaccine_name VARCHAR);\\nINSERT INTO vaccines(id, vaccine_name) SELECT id, vaccine_name FROM vaccines_old;\\nDROP TABLE vaccines_old", clientMigrationFile.getFileContents()); - } - - @Test - public void testGetAllWhenGivenLimit() { - List migrationFiles = clientMigrationFileRepository.getAll(3); - - Assert.assertEquals(3, migrationFiles.size()); - Assert.assertEquals("1.up.sql", migrationFiles.get(0).getFilename()); - Assert.assertEquals("1.down.sql", migrationFiles.get(1).getFilename()); - Assert.assertEquals("2.up.sql", migrationFiles.get(2).getFilename()); - } - - @Override - protected Set getDatabaseScripts() { - scripts.add("client_migration_file.sql"); - return scripts; - } + @Autowired + private ClientMigrationFileRepository clientMigrationFileRepository; + + private Set scripts = new HashSet(); + + @Test + public void getShouldReturnMigrationFileWhenGivenAValidId() { + ClientMigrationFile clientMigrationFile = clientMigrationFileRepository.get("1"); + + Assert.assertEquals("cec563c2-d3e7-4b2a-866e-82d5902d44de", clientMigrationFile.getIdentifier()); + Assert.assertEquals("1.up.sql", clientMigrationFile.getFilename()); + Assert.assertEquals("CREATE TABLE vaccines(id INTEGER, vaccine_name VARCHAR);", clientMigrationFile.getFileContents()); + Assert.assertEquals(null, clientMigrationFile.getJurisdiction()); + Assert.assertEquals(Integer.valueOf(1), clientMigrationFile.getVersion()); + Assert.assertEquals(Integer.valueOf(1), clientMigrationFile.getManifestId()); + Assert.assertEquals(null, clientMigrationFile.getObjectStoragePath()); + Assert.assertEquals(false, clientMigrationFile.getOnObjectStorage()); + } + + @Test + public void getShouldReturnNullWhenGivenBlankId() { + Assert.assertNull(clientMigrationFileRepository.get("")); + } + + @Test + public void getShouldReturnNullWhenGivenNonIntegerId() { + Assert.assertNull(clientMigrationFileRepository.get("98iu")); + } + + @Test(expected = IllegalStateException.class) + public void addShouldThrowExceptionWhenGiveNullClientMigrationFile() { + clientMigrationFileRepository.add(null); + } + + @Test(expected = IllegalStateException.class) + public void addShouldThrowExceptionWhenGiveClientMigrationFileWithNullIdentifier() { + ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); + clientMigrationFileRepository.add(clientMigrationFile); + } + + @Test(expected = EntityExistsException.class) + public void addShouldThrowExceptionWhenGiveClientMigrationFileWithId() { + ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); + clientMigrationFile.setIdentifier("my-identifier"); + clientMigrationFile.setId(2398L); + clientMigrationFileRepository.add(clientMigrationFile); + } + + @Test + public void addShouldCallInsertSelectiveOnMapper() { + ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); + clientMigrationFile.setIdentifier("my-identifier"); + String randomFileName = "some-random-filename"; + clientMigrationFile.setFilename(randomFileName); + clientMigrationFile.setVersion(89); + clientMigrationFileRepository.add(clientMigrationFile); + + ClientMigrationFile actualRecord = clientMigrationFileRepository.getClientMigrationFileByIdentifier("my-identifier"); + Assert.assertEquals(randomFileName, actualRecord.getFilename()); + } + + @Test + public void updateShouldUpdateClientMigrationFileDetails() { + ClientMigrationFile clientMigrationFile = clientMigrationFileRepository.getClientMigrationFileByIdentifier("38bc7c3f-7439-4d62-bd9b-fa40867d0a44"); + clientMigrationFile.setFilename("a different file name"); + + clientMigrationFileRepository.update(clientMigrationFile); + + ClientMigrationFile actualUpdatedRecord = clientMigrationFileRepository.getClientMigrationFileByIdentifier("38bc7c3f-7439-4d62-bd9b-fa40867d0a44"); + Assert.assertEquals("a different file name", actualUpdatedRecord.getFilename()); + } + + @Test + public void updateShouldNotUpdateClientMigrationFileDetailsWhenIdentifierIsNull() { + ClientMigrationFile clientMigrationFile = clientMigrationFileRepository.getClientMigrationFileByIdentifier("38bc7c3f-7439-4d62-bd9b-fa40867d0a44"); + clientMigrationFile.setFilename("a different file name"); + clientMigrationFile.setIdentifier(null); + + clientMigrationFileRepository.update(clientMigrationFile); + + // Assert that the file name is similar + ClientMigrationFile actualUpdatedRecord = clientMigrationFileRepository.getClientMigrationFileByIdentifier("38bc7c3f-7439-4d62-bd9b-fa40867d0a44"); + Assert.assertEquals("3.up.sql", actualUpdatedRecord.getFilename()); + } + + @Test + public void updateShouldNotUpdateClientMigrationFileDetailsWhenIdIsNull() { + ClientMigrationFile clientMigrationFile = clientMigrationFileRepository.getClientMigrationFileByIdentifier("38bc7c3f-7439-4d62-bd9b-fa40867d0a44"); + clientMigrationFile.setFilename("a different file name"); + clientMigrationFile.setId(null); + + clientMigrationFileRepository.update(clientMigrationFile); + + // Assert that the file name is similar + ClientMigrationFile actualUpdatedRecord = clientMigrationFileRepository.getClientMigrationFileByIdentifier("38bc7c3f-7439-4d62-bd9b-fa40867d0a44"); + Assert.assertEquals("3.up.sql", actualUpdatedRecord.getFilename()); + } + + @Test + public void getAll() { + List migrationFiles = clientMigrationFileRepository.getAll(); + + Assert.assertEquals(6, migrationFiles.size()); + } + + @Test + public void safeRemove() { + ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); + clientMigrationFile.setId(5L); + + clientMigrationFileRepository.safeRemove(clientMigrationFile); + + Assert.assertEquals(5, clientMigrationFileRepository.getAll().size()); + Assert.assertNull(clientMigrationFileRepository.get("5")); + } + + @Test + public void safeRemoveShouldFailWhenEntityPrimaryKeyIsNull() { + ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); + clientMigrationFile.setId(null); + + clientMigrationFileRepository.safeRemove(clientMigrationFile); + + Assert.assertEquals(6, clientMigrationFileRepository.getAll().size()); + } + + @Test + public void safeRemoveShouldFailWhenEntityIsNull() { + clientMigrationFileRepository.safeRemove(null); + + Assert.assertEquals(6, clientMigrationFileRepository.getAll().size()); + } + + @Test + public void getClientMigrationFileByFilename() { + ClientMigrationFile clientMigrationFile = clientMigrationFileRepository.getClientMigrationFileByFilename("3.up.sql"); + + Assert.assertEquals(Integer.valueOf(3), clientMigrationFile.getVersion()); + Assert.assertEquals(Integer.valueOf(3), clientMigrationFile.getManifestId()); + Assert.assertEquals("CREATE TABLE alerts(id INTEGER, alert_name VARCHAR, is_offline BOOLEAN);", clientMigrationFile.getFileContents()); + Assert.assertEquals("38bc7c3f-7439-4d62-bd9b-fa40867d0a44", clientMigrationFile.getIdentifier()); + } + + @Test + public void getClientMigrationFileByFilenameShouldReturnNullWhenFileNameisEmpty() { + Assert.assertNull(clientMigrationFileRepository.getClientMigrationFileByFilename("")); + } + + @Test + public void getClientMigrationFileByVersion() { + List migrationFiles = clientMigrationFileRepository.getClientMigrationFileByVersion(3); + + Assert.assertEquals(2, migrationFiles.size()); + Assert.assertEquals(Integer.valueOf(3), migrationFiles.get(0).getVersion()); + + Assert.assertEquals("3.up.sql", migrationFiles.get(0).getFilename()); + Assert.assertEquals("3.down.sql", migrationFiles.get(1).getFilename()); + } + + @Test + public void getClientMigrationFileByManifestId() { + List migrationFiles = clientMigrationFileRepository.getClientMigrationFileByManifestId(3); + + Assert.assertEquals(2, migrationFiles.size()); + Assert.assertEquals(Integer.valueOf(3), migrationFiles.get(0).getVersion()); + + Assert.assertEquals(Integer.valueOf(3), migrationFiles.get(0).getManifestId()); + Assert.assertEquals("3.up.sql", migrationFiles.get(0).getFilename()); + Assert.assertEquals("3.down.sql", migrationFiles.get(1).getFilename()); + } + + @Test + public void getClientMigrationFileByManifestIdShouldReturnNull() { + Assert.assertNull(clientMigrationFileRepository.getClientMigrationFileByManifestId(0)); + } + + @Test + public void getClientMigrationFileByIdShouldReturnNull() { + Assert.assertNull(clientMigrationFileRepository.getClientMigrationFileById(0)); + } + + @Test + public void getClientMigrationFileByIdShouldReturnClientMigrationFile() { + ClientMigrationFile clientMigrationFile = clientMigrationFileRepository.getClientMigrationFileById(1); + Assert.assertEquals("cec563c2-d3e7-4b2a-866e-82d5902d44de", clientMigrationFile.getIdentifier()); + Assert.assertEquals("1.up.sql", clientMigrationFile.getFilename()); + } + + @Test + public void getClientMigrationFileByIdentifierShouldReturnNull() { + Assert.assertNull(clientMigrationFileRepository.getClientMigrationFileByIdentifier("an-identifier")); + } + + @Test + public void getClientMigrationFileByIdentifierShouldReturnClientMigrationFile() { + ClientMigrationFile clientMigrationFile = clientMigrationFileRepository.getClientMigrationFileByIdentifier("70cbd363-5dd7-4e92-8364-bcc093cb4962"); + Assert.assertEquals("2.down.sql", clientMigrationFile.getFilename()); + Assert.assertEquals(Integer.valueOf(2), clientMigrationFile.getVersion()); + Assert.assertEquals("ALTER TABLE vaccines RENAME TO vaccines_old;\\nCREATE TABLE vaccines(id INTEGER, vaccine_name VARCHAR);\\nINSERT INTO vaccines(id, vaccine_name) SELECT id, vaccine_name FROM vaccines_old;\\nDROP TABLE vaccines_old", clientMigrationFile.getFileContents()); + } + + @Test + public void testGetAllWhenGivenLimit() { + List migrationFiles = clientMigrationFileRepository.getAll(3); + + Assert.assertEquals(3, migrationFiles.size()); + Assert.assertEquals("1.up.sql", migrationFiles.get(0).getFilename()); + Assert.assertEquals("1.down.sql", migrationFiles.get(1).getFilename()); + Assert.assertEquals("2.up.sql", migrationFiles.get(2).getFilename()); + } + + @Override + protected Set getDatabaseScripts() { + scripts.add("client_migration_file.sql"); + return scripts; + } } diff --git a/src/test/java/org/opensrp/repository/postgres/ClientsRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/ClientsRepositoryTest.java index 5594c8c05..1afc6265d 100644 --- a/src/test/java/org/opensrp/repository/postgres/ClientsRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/ClientsRepositoryTest.java @@ -33,795 +33,795 @@ import com.ibm.fhir.model.resource.Patient; public class ClientsRepositoryTest extends BaseRepositoryTest { - - @Autowired - @Qualifier("clientsRepositoryPostgres") - private ClientsRepository clientsRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("client.sql"); - scripts.add("event.sql"); - return scripts; - } - - @Test - public void testGet() { - Client client = clientsRepository.get("05934ae338431f28bf6793b2416946b7"); - assertEquals("469597f0-eefe-4171-afef-f7234cbb2859", client.getBaseEntityId()); - assertEquals("eb4b258c-7558-436c-a1fe-e91d9e12f849", client.getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); - assertEquals("January", client.getFirstName().trim()); - assertEquals("Babysix", client.getLastName()); - assertEquals("05934ae338431f28bf6793b2416946b7", client.getId()); - //missing client - assertNull(clientsRepository.get("05934ae338bf6793b2416946b7")); - - //test deleted client - clientsRepository.safeRemove(clientsRepository.get("05934ae338431f28bf6793b2416946b7")); - assertNull(clientsRepository.get("05934ae338431f28bf6793b2416946b7")); - } - - @Test - public void testAdd() { - Client client = new Client("f67823b0-378e-4a35-93fc-bb00def74e2f").withBirthdate(new DateTime("2017-03-31"), true) - .withGender("Male").withFirstName("xobili").withLastName("mbangwa"); - - client.withIdentifier("ZEIR_ID", "233864-8").withAttribute("Home_Facility", "Linda"); - clientsRepository.add(client); - assertEquals(24, clientsRepository.getAll().size()); - - Client savedClient = clientsRepository.findByBaseEntityId("f67823b0-378e-4a35-93fc-bb00def74e2f"); - assertNotNull(savedClient.getId()); - assertEquals(new DateTime("2017-03-31"), client.getBirthdate()); - assertEquals("xobili", client.getFirstName()); - assertEquals("mbangwa", client.getLastName()); - assertEquals("233864-8", client.getIdentifier("ZEIR_ID")); - - //test if a client with voided date add client as deleted - client = new Client("f67823b0-4a35-93fc-bb00def74e2f").withBirthdate(new DateTime("2017-03-31"), true) - .withGender("Male").withFirstName("Test").withLastName("Deleted"); - client.withDateVoided(new DateTime()); - clientsRepository.add(client); - assertNull(clientsRepository.findByBaseEntityId(client.getBaseEntityId())); - MatcherAssert.assertThat(savedClient.getServerVersion(), Matchers.greaterThan(5l)); - - } - - @Test - public void testUpdate() { - Client client = clientsRepository.get("05934ae338431f28bf6793b2416946b7"); - client.setFirstName("Hummel"); - client.setLastName("Basialis"); - client.withIdentifier("ZEIR_ID", "09876-98"); - long serverVersion=client.getServerVersion(); - clientsRepository.update(client); - - Client updatedClient = clientsRepository.get(client.getId()); - assertEquals("Hummel", updatedClient.getFirstName()); - assertEquals("Basialis", updatedClient.getLastName()); - assertEquals("09876-98", client.getIdentifier("ZEIR_ID")); - MatcherAssert.assertThat(updatedClient.getServerVersion(), Matchers.greaterThan(serverVersion)); - - //test update with voided date deletes client - updatedClient.setDateVoided(new DateTime()); - clientsRepository.update(updatedClient); - assertNull(clientsRepository.get(updatedClient.getId())); - } - - @Test - public void testGetAll() { - assertEquals(23, clientsRepository.getAll().size()); - clientsRepository.safeRemove(clientsRepository.get("05934ae338431f28bf6793b24164cbd9")); - - List clients = clientsRepository.getAll(); - - //test deleted clients - assertEquals(22, clients.size()); - for (Client client : clients) - assertNotEquals("05934ae338431f28bf6793b24164cbd9", client.getId()); - - assertNull(clientsRepository.get("05934ae338431f28bf6793b24164cbd9")); - - } - - @Test - public void testSafeRemove() { - Client client = clientsRepository.get("05934ae338431f28bf6793b2416946b7"); - clientsRepository.safeRemove(client); - List clients = clientsRepository.getAll(); - assertEquals(22, clients.size()); - - for (Client cl : clients) - assertNotEquals("05934ae338431f28bf6793b2416946b7", cl.getId()); - - assertNull(clientsRepository.get("05934ae338431f28bf6793b2416946b7")); - } - - @Test - public void testFindByBaseEntityId() { - Client client = clientsRepository.findByBaseEntityId("86c039a2-0b68-4166-849e-f49897e3a510"); - assertEquals("05934ae338431f28bf6793b24164cbd9", client.getId()); - assertEquals("ab91df5d-e433-40f3-b44f-427b73c9ae2a", client.getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); - assertEquals("Sally", client.getFirstName()); - assertEquals("Mtini", client.getLastName().trim()); - - assertNull(clientsRepository.findByBaseEntityId("f67823b0-378e-4a35-93fc-bb00def74e2f")); - - //test deleted client - clientsRepository.safeRemove(client); - assertNull(clientsRepository.findByBaseEntityId("86c039a2-0b68-4166-849e-f49897e3a510")); - } - - @Test - public void testFindAllClients() { - assertEquals(23, clientsRepository.findAllClients().size()); - - clientsRepository.safeRemove(clientsRepository.get("05934ae338431f28bf6793b24164cbd9")); - - List clients = clientsRepository.findAllClients(); - - assertEquals(22, clients.size()); - for (Client client : clients) - assertNotEquals("05934ae338431f28bf6793b24164cbd9", client.getId()); - - //test deleted client - assertNull(clientsRepository.get("05934ae338431f28bf6793b24164cbd9")); - } - - @Test - public void testFindAllByIdentifier() { - assertTrue(clientsRepository.findAllByIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "ab91df5d-e433-40f3-b44f-427b73ca") - .isEmpty()); - - assertTrue(clientsRepository.findAllByIdentifier("identifier_type", "ab91df5d-e433-40f3-b44f-427b73c9ae2a") - .isEmpty()); - - List clients = clientsRepository.findAllByIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, - "ab91df5d-e433-40f3-b44f-427b73c9ae2a"); - - assertEquals(1, clients.size()); - assertEquals("05934ae338431f28bf6793b24164cbd9", clients.get(0).getId()); - assertEquals("Sally", clients.get(0).getFirstName()); - assertEquals("Mtini", clients.get(0).getLastName().trim()); - - //test deleted clients - clientsRepository.safeRemove(clients.get(0)); - assertTrue(clientsRepository.findAllByIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, - "ab91df5d-e433-40f3-b44f-427b73c9ae2a").isEmpty()); - - } - - @Test - public void testAllByAttribute() { - List clients = clientsRepository.findAllByAttribute("Home_Facility", "Happy Kids Clinic"); - - assertEquals(9, clients.size()); - - clients = clientsRepository.findAllByAttribute("CHW_Phone_Number", "0964357951"); - assertEquals(1, clients.size()); - assertEquals("05934ae338431f28bf6793b24164cbd9", clients.get(0).getId()); - assertEquals("Sally", clients.get(0).getFirstName()); - assertEquals("Mtini", clients.get(0).getLastName().trim()); - - assertTrue(clientsRepository.findAllByAttribute("CHW_Phone_Number", "+0964357951").isEmpty()); - - assertTrue(clientsRepository.findAllByAttribute("Phone_Number", "0964357951").isEmpty()); - - //test deleted clients - clientsRepository.safeRemove(clients.get(0)); - assertTrue(clientsRepository.findAllByAttribute("CHW_Phone_Number", "0964357951").isEmpty()); - } - - @Test - public void testAllByAttributes() { - List clients = clientsRepository.findAllByAttribute("Home_Facility", "Happy Kids Clinic"); - - assertEquals(9, clients.size()); - - clients = clientsRepository.findAllByAttribute("CHW_Phone_Number", "0964357951"); - assertEquals(1, clients.size()); - assertEquals("05934ae338431f28bf6793b24164cbd9", clients.get(0).getId()); - assertEquals("Sally", clients.get(0).getFirstName()); - assertEquals("Mtini", clients.get(0).getLastName().trim()); - - assertEquals(clientsRepository.findAllByAttributes("CHW_Phone_Number", new ArrayList<>(Arrays.asList("+0964357951", "0964357951"))).size(), 1); - - //test deleted clients - clientsRepository.safeRemove(clients.get(0)); - assertTrue(clientsRepository.findAllByAttributes("Phone_Number", new ArrayList<>(Arrays.asList("+0964357951", "0964357951"))).isEmpty()); - } - - @Test - public void testFindAllByMatchingName() { - assertEquals(9, clientsRepository.findAllByMatchingName("b").size()); - - List clients = clientsRepository.findAllByMatchingName("babytwo"); - - assertEquals(1, clients.size()); - - assertEquals("05934ae338431f28bf6793b24167b6d1", clients.get(0).getId()); - assertEquals("fe7b6350-16d2-41d0-8574-c194088705df", clients.get(0).getBaseEntityId()); - assertEquals("218227-7", clients.get(0).getIdentifier("ZEIR_ID")); - assertEquals("ba5d3927-414f-4796-ae1e-9b73b50a5573", clients.get(0).getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); - - assertEquals(12, clientsRepository.findAllByMatchingName("a").size()); - - assertEquals(6, clientsRepository.findAllByMatchingName("Ja").size()); - - assertEquals(4, clientsRepository.findAllByMatchingName("Janu").size()); - - assertEquals(2, clientsRepository.findAllByMatchingName("January").size()); - - assertTrue(clientsRepository.findAllByMatchingName("Kimbley").isEmpty()); - - //test deleted clients - clientsRepository.safeRemove(clientsRepository.findAllByMatchingName("babytwo").get(0)); - assertTrue(clientsRepository.findAllByMatchingName("babytwo").isEmpty()); - } - - @Test - public void testFindByRelationshipIdAndDateCreated() { - assertEquals( - 2, - clientsRepository.findByRelationshipIdAndDateCreated("0154839f-8766-4eda-b729-89067c7a8c5d", - new DateTime("2018-03-13").toString(), new DateTime().toString()).size()); - - assertTrue(clientsRepository.findByRelationshipIdAndDateCreated("0154839f-8766-4eda-89067c7a8c5d", - new DateTime("2018-03-14").toString(), new DateTime().toString()).isEmpty()); - - assertTrue(clientsRepository.findByRelationshipIdAndDateCreated("0154839f-8766-4eda-b729-89067c7a8c5d", - new DateTime("2018-03-14").toString(), new DateTime().toString()).isEmpty()); - - Client client = clientsRepository.findByRelationshipIdAndDateCreated("3abdb25a-f151-4a95-9311-bd30bf935085", - new DateTime("2018-03-13").toString(), new DateTime().toString()).get(0); - assertEquals("05934ae338431f28bf6793b2415a0374", client.getId()); - assertEquals("94f3e8fb-2f05-4fca-8119-2b593d1962eb", client.getBaseEntityId()); - assertEquals("2018-03-01", client.getBirthdate().toLocalDate().toString()); - - //test deleted clients - clientsRepository.safeRemove(client); - assertTrue(clientsRepository.findByRelationshipIdAndDateCreated("3abdb25a-f151-4a95-9311-bd30bf935085", - new DateTime("2018-03-13").toString(), new DateTime().toString()).isEmpty()); - } - - @Test - public void testFindByRelationshipId() { - assertEquals(2, clientsRepository.findByRelationshipId("mother", "0154839f-8766-4eda-b729-89067c7a8c5d").size()); - - Client client = clientsRepository.findByRelationshipId("mother", "3abdb25a-f151-4a95-9311-bd30bf935085").get(0); - assertEquals("05934ae338431f28bf6793b2415a0374", client.getId()); - assertEquals("94f3e8fb-2f05-4fca-8119-2b593d1962eb", client.getBaseEntityId()); - assertEquals("cf58894b-71c6-41e0-a977-7283f2411cd5", client.getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); - assertEquals("2018-03-01", client.getBirthdate().toLocalDate().toString()); - - assertTrue(clientsRepository.findByRelationshipId("father", "0154839f-8766-4eda-b729-89067c7a8c5d").isEmpty()); - - assertTrue(clientsRepository.findByRelationshipId("mother", "0154839f-4eda-b729-89067c7a8c5d").isEmpty()); - - //test deleted clients - clientsRepository.safeRemove(client); - assertTrue(clientsRepository.findByRelationshipId("mother", "3abdb25a-f151-4a95-9311-bd30bf935085").isEmpty()); - } - - @Test - public void testFindByCriteria() { - ClientSearchBean searchBean = new ClientSearchBean(); - AddressSearchBean addressSearchBean = new AddressSearchBean(); - assertEquals(23, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); - - searchBean.setNameLike("Janu"); - assertEquals(4, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); - - searchBean.setNameLike("Baby"); - searchBean.setGender("Male"); - assertEquals(2, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); - - searchBean.setBirthdateFrom(new DateTime("2016-04-13")); - searchBean.setBirthdateTo(new DateTime()); - assertEquals(2, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); - - searchBean.setDeathdateFrom(new DateTime("2018-01-01")); - searchBean.setDeathdateTo(new DateTime()); - assertEquals(1, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); - - searchBean = new ClientSearchBean(); - searchBean.setAttributeType("Home_Facility"); - searchBean.setAttributeValue("Happy Kids Clinic"); - assertEquals(9, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); - - searchBean.setAttributeType("CHW_Name"); - searchBean.setAttributeValue("Hellen"); - List clients = clientsRepository.findByCriteria(searchBean, addressSearchBean); - assertEquals(1, clients.size()); - assertEquals("05934ae338431f28bf6793b24164cbd9", clients.get(0).getId()); - - searchBean = new ClientSearchBean(); - searchBean.setLastEditFrom(new DateTime("2018-03-13T12:57:05.652")); - searchBean.setLastEditTo(new DateTime()); - - assertEquals(6, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); - - addressSearchBean.setAddressType("usual_residence"); - assertEquals(6, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); - - addressSearchBean.setAddressType("usual_residence"); - assertEquals(6, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); - Client testClient = new Client("f67823b0-378e-4a35-93fc-bb00def74e2f").withBirthdate(new DateTime("2017-03-31"), true) - .withGender("Male").withFirstName("xobili").withLastName("mbangwa"); - testClient.setLocationId("123"); - clientsRepository.add(testClient); - List locationIds = new ArrayList<>(); - locationIds.add("123"); - searchBean.setLocations(locationIds); - searchBean = new ClientSearchBean(); - searchBean.setLocations(locationIds); - addressSearchBean = new AddressSearchBean(); - assertEquals(1, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); - - //test deleted clients - for (Client client : clientsRepository.findByCriteria(searchBean, addressSearchBean)) - clientsRepository.safeRemove(client); - assertTrue(clientsRepository.findByCriteria(searchBean, addressSearchBean).isEmpty()); - - } - - @Test - public void testFindByCriteriaWithoutAddressBean() { - ClientSearchBean searchBean = new ClientSearchBean(); - assertEquals(23, clientsRepository.findByCriteria(searchBean).size()); - - searchBean.setNameLike("Janu"); - assertEquals(4, clientsRepository.findByCriteria(searchBean).size()); - - searchBean.setNameLike("Baby"); - searchBean.setGender("Male"); - assertEquals(2, clientsRepository.findByCriteria(searchBean).size()); - - searchBean.setBirthdateFrom(new DateTime("2016-04-13")); - searchBean.setBirthdateTo(new DateTime()); - assertEquals(2, clientsRepository.findByCriteria(searchBean).size()); - - searchBean.setDeathdateFrom(new DateTime("2018-01-01")); - searchBean.setDeathdateTo(new DateTime()); - assertEquals(1, clientsRepository.findByCriteria(searchBean).size()); - - searchBean = new ClientSearchBean(); - searchBean.setAttributeType("Home_Facility"); - searchBean.setAttributeValue("Happy Kids Clinic"); - assertEquals(9, clientsRepository.findByCriteria(searchBean).size()); - - searchBean.setAttributeType("CHW_Name"); - searchBean.setAttributeValue("Hellen"); - List clients = clientsRepository.findByCriteria(searchBean); - assertEquals(1, clients.size()); - assertEquals("05934ae338431f28bf6793b24164cbd9", clients.get(0).getId()); - - searchBean = new ClientSearchBean(); - searchBean.setLastEditFrom(new DateTime("2018-03-13T12:57:05.652")); - searchBean.setLastEditTo(new DateTime()); - assertEquals(6, clientsRepository.findByCriteria(searchBean).size()); - - //test deleted clients - for (Client client : clientsRepository.findByCriteria(searchBean)) - clientsRepository.safeRemove(client); - assertTrue(clientsRepository.findByCriteria(searchBean).isEmpty()); - - } - - @Test - public void testFindByCriteriaWithEditDateParams() { - - DateTime from = new DateTime("2018-03-13T12:57:05.652"); - DateTime to = new DateTime(); - List clients = clientsRepository.findByCriteria(new AddressSearchBean(), from, to); - assertEquals(6, clients.size()); - - for (Client client : clients) - assertTrue(client.getDateEdited().isEqual(from) || client.getDateEdited().isAfter(from)); - - to = from; - from = new DateTime("2018-01-01"); - clients = clientsRepository.findByCriteria(new AddressSearchBean(), from, to); - assertEquals(11, clients.size()); - - for (Client client : clients) { - assertTrue(client.getDateEdited().isEqual(from) || client.getDateEdited().isAfter(from)); - assertTrue(client.getDateEdited().isEqual(to) || client.getDateEdited().isBefore(to)); - } - - AddressSearchBean addressSearchBean = new AddressSearchBean(); - addressSearchBean.setCityVillage("hui"); - assertTrue(clientsRepository.findByCriteria(addressSearchBean, new DateTime("2018-01-01"), new DateTime()).isEmpty()); - - //test deleted clients - for (Client client : clientsRepository.findByCriteria(new AddressSearchBean(), from, to)) - clientsRepository.safeRemove(client); - assertTrue(clientsRepository.findByCriteria(new AddressSearchBean(), from, to).isEmpty()); - } - - @Test - public void testFindByRelationShip() { - assertEquals(2, clientsRepository.findByRelationShip("0154839f-8766-4eda-b729-89067c7a8c5d").size()); - - Client client = clientsRepository.findByRelationShip("3abdb25a-f151-4a95-9311-bd30bf935085").get(0); - assertEquals("05934ae338431f28bf6793b2415a0374", client.getId()); - assertEquals("94f3e8fb-2f05-4fca-8119-2b593d1962eb", client.getBaseEntityId()); - assertEquals("Fith", client.getFirstName()); - assertEquals("2018-03-01", client.getBirthdate().toLocalDate().toString()); - - //test deleted clients - clientsRepository.safeRemove(client); - assertTrue(clientsRepository.findByRelationShip("3abdb25a-f151-4a95-9311-bd30bf935085").isEmpty()); - - assertTrue(clientsRepository.findByRelationShip("0154839f-4eda-b729-89067c7a8c5d").isEmpty()); - } - - @Test - public void testFindByEmptyServerVersion() { - assertTrue(clientsRepository.findByEmptyServerVersion().isEmpty()); - - Client client = clientsRepository.get("05934ae338431f28bf6793b2415a0374"); - client.setServerVersion(0l); - clientsRepository.update(client); - - assertTrue(clientsRepository.findByEmptyServerVersion().isEmpty()); - - //test deleted clients - clientsRepository.safeRemove(client); - assertTrue(clientsRepository.findByEmptyServerVersion().isEmpty()); - - } - - @Test - public void testFindByServerVersion() { - assertEquals(13, clientsRepository.findByServerVersion(1520935878136l, null).size()); - List clients = clientsRepository.findByServerVersion(1521003136406l, null); - List expectedIds = Arrays.asList("05934ae338431f28bf6793b241839005", "05934ae338431f28bf6793b2418380ce", - "ade884f8-2685-45fd-93f8-122045b2635e", "2e14b66f-206c-4314-a0f7-c5d2c4d9860f", - "b0cb057b-c396-4ec9-bfab-388117a9a5f6", "28ea8f0a-fa53-447d-b8f9-ad07263b382c", - "5bd3e1eb-5cd4-4e8d-9180-4293b7ea3b78", "f5934ae338431f28bf6793b24159ce5a", "c778e5a4-5384-4886-b783-65f1abb4c7b0", "5e287780-770e-460b-bc86-8559c73e85d9"); - assertEquals(10, clients.size()); - for (Client client : clients) { - assertTrue(client.getServerVersion() >= 1521003136406l); - assertTrue(expectedIds.contains(client.getId())); - } - - //test deleted clients - for (Client client : clients) - clientsRepository.safeRemove(client); - assertTrue(clientsRepository.findByServerVersion(1521003136406l, null).isEmpty()); - } - - @Test - public void testFindByFieldValue() { - assertEquals( - 3, - clientsRepository.findByFieldValue( - BASE_ENTITY_ID, - Arrays.asList(new String[] { "86c039a2-0b68-4166-849e-f49897e3a510", "f33c71c7-a9a4-495d-8028-b6d59e4034b3", - "fe7b6350-16d2-41d0-8574-c194088705df" })).size()); - - assertTrue(clientsRepository.findByFieldValue("Firstname", Arrays.asList(new String[] { "Baby", "Jan" })).isEmpty()); - - assertTrue(clientsRepository.findByFieldValue(BASE_ENTITY_ID, Arrays.asList(new String[] { "Baby", "Jan" })) - .isEmpty()); - - Client client = clientsRepository.findByFieldValue(BASE_ENTITY_ID, - Arrays.asList(new String[] { "f33c71c7-a9a4-495d-8028-b6d59e4034b3" })).get(0); - - assertEquals("05934ae338431f28bf6793b241679500", client.getId()); - assertEquals("Jan", client.getFirstName()); - assertEquals("2018-01-01", client.getBirthdate().toLocalDate().toString()); - assertEquals("218226-9", client.getIdentifier("ZEIR_ID")); - - //test deleted clients - clientsRepository.safeRemove(client); - assertTrue(clientsRepository.findByFieldValue(BASE_ENTITY_ID, - Arrays.asList(new String[] { "f33c71c7-a9a4-495d-8028-b6d59e4034b3" })).isEmpty()); - } - - - @Test - public void testNotInOpenMRSByServerVersion() { - assertTrue(clientsRepository.notInOpenMRSByServerVersion(0l, Calendar.getInstance()).isEmpty()); - - Client client = clientsRepository.get("05934ae338431f28bf6793b2415a0374"); - client.removeIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE); - client.setServerVersion(1l); - clientsRepository.update(client); - - client = clientsRepository.notInOpenMRSByServerVersion(0l, Calendar.getInstance()).get(0); - assertEquals("94f3e8fb-2f05-4fca-8119-2b593d1962eb", client.getBaseEntityId()); - assertEquals("Fith", client.getFirstName()); - assertEquals("2018-03-01", client.getBirthdate().toLocalDate().toString()); - assertEquals("218224-4", client.getIdentifier("ZEIR_ID")); - - //test deleted clients - clientsRepository.safeRemove(client); - assertTrue(clientsRepository.notInOpenMRSByServerVersion(0l, Calendar.getInstance()).isEmpty()); - } - - @Test - public void shouldFindMembersByRelationshipId() { - List expectedClient = clientsRepository.findMembersByRelationshipId("43930c23-c787-4ddb-ab76-770f77e7b17d"); - assertNotNull(expectedClient); - assertEquals(1, expectedClient.size()); - - } - - @Test - public void shouldGetMemberCountHouseholdHeadProviderByClients() { - List id = new ArrayList(); - id.add("43930c23-c787-4ddb-ab76-770f77e7b17d"); - List householdClient = clientsRepository.selectMemberCountHouseholdHeadProviderByClients("", id, - "mother"); - - assertEquals("biddemo", householdClient.get(0).getProviderId()); - assertEquals(1, householdClient.get(0).getMemebrCount()); - } - - @Test - public void shouldFindAllClientsByCriteria() { - AddressSearchBean addressSearchBean = new AddressSearchBean(); - ClientSearchBean searchBean = new ClientSearchBean(); - searchBean.setClientType("ec_family"); - List locationUuids = new ArrayList(); - locationUuids.add("42abc582-6658-488b-922e-7be500c070f3"); - searchBean.setLocations(locationUuids); - List clients = clientsRepository.findAllClientsByCriteria(searchBean, addressSearchBean); - assertNotNull(clients); - assertEquals(2, clients.size()); - } - - @Test - public void shouldFindCountAllClientsByCriteria() { - AddressSearchBean addressSearchBean = new AddressSearchBean(); - ClientSearchBean searchBean = new ClientSearchBean(); - searchBean.setClientType("ec_family"); - List locationUuids = new ArrayList(); - locationUuids.add("42abc582-6658-488b-922e-7be500c070f3"); - searchBean.setLocations(locationUuids); - HouseholdClient householdClient = clientsRepository.findCountAllClientsByCriteria(searchBean, addressSearchBean); - assertNotNull(householdClient.getTotalCount()); - assertEquals(2, householdClient.getTotalCount()); - } - - @Test - public void shouldFindHouseholdByCriteria() { - AddressSearchBean addressSearchBean = new AddressSearchBean(); - ClientSearchBean searchBean = new ClientSearchBean(); - searchBean.setNameLike("Haran Mia"); - List clients = clientsRepository.findHouseholdByCriteria(searchBean, addressSearchBean); - assertNotNull(clients); - assertEquals(1, clients.size()); - } - - @Test - public void shouldFindHouseholdByLocation() { - AddressSearchBean addressSearchBean = new AddressSearchBean(); - ClientSearchBean searchBean = new ClientSearchBean(); - List locationUuids = new ArrayList(); - locationUuids.add("e3170b23-bb22-42a4-875d-35c7f32c28ae"); - searchBean.setLocations(locationUuids); - List clients = clientsRepository.findHouseholdByCriteria(searchBean, addressSearchBean); - assertNotNull(clients); - assertEquals(1, clients.size()); - } - - @Test - public void shouldCountHouseholdByLocation() { - AddressSearchBean addressSearchBean = new AddressSearchBean(); - ClientSearchBean searchBean = new ClientSearchBean(); - List locationUuids = new ArrayList(); - locationUuids.add("e3170b23-bb22-42a4-875d-35c7f32c28ae"); - searchBean.setLocations(locationUuids); - HouseholdClient clients = clientsRepository.findTotalCountHouseholdByCriteria(searchBean, addressSearchBean); - assertNotNull(clients); - assertEquals(1, clients.getTotalCount()); - } - - @Test - public void shouldCountHouseholdByCriteria() { - AddressSearchBean addressSearchBean = new AddressSearchBean(); - ClientSearchBean searchBean = new ClientSearchBean(); - searchBean.setNameLike("Haran Mia"); - HouseholdClient clients = clientsRepository.findTotalCountHouseholdByCriteria(searchBean, addressSearchBean); - assertNotNull(clients); - assertEquals(1, clients.getTotalCount()); - } - - @Test - public void shouldFindANCByCriteria() { - AddressSearchBean addressSearchBean = new AddressSearchBean(); - ClientSearchBean searchBean = new ClientSearchBean(); - searchBean.setNameLike("Nobonita"); - searchBean.setClientType(null); - List clients = clientsRepository.findANCByCriteria(searchBean, addressSearchBean); - assertNotNull(clients); - assertEquals(1, clients.size()); - } - - @Test - public void shouldFindAllANCByCriteria() { - AddressSearchBean addressSearchBean = new AddressSearchBean(); - ClientSearchBean searchBean = new ClientSearchBean(); - searchBean.setClientType(null); - List clients = clientsRepository.findANCByCriteria(searchBean, addressSearchBean); - assertNotNull(clients); - assertEquals(1, clients.size()); - } - - @Test - public void shouldFindChildByCriteria() { - AddressSearchBean addressSearchBean = new AddressSearchBean(); - ClientSearchBean searchBean = new ClientSearchBean(); - searchBean.setNameLike("mala"); - searchBean.setClientType(null); - List clients = clientsRepository.findChildByCriteria(searchBean, addressSearchBean); - assertNotNull(clients); - assertEquals(1, clients.size()); - } - - @Test - public void shouldFindANCByLocation() { - AddressSearchBean addressSearchBean = new AddressSearchBean(); - ClientSearchBean searchBean = new ClientSearchBean(); - searchBean.setClientType(null); - List locations = new ArrayList<>(); - locations.add("ce39f858-a2f6-4676-8db1-81fbb1891b01"); - searchBean.setLocations(locations); - List clients = clientsRepository.findChildByCriteria(searchBean, addressSearchBean); - assertNotNull(clients); - assertEquals(1, clients.size()); - } - - @Test - public void shouldFindAllChildByCriteria() { - AddressSearchBean addressSearchBean = new AddressSearchBean(); - ClientSearchBean searchBean = new ClientSearchBean(); - searchBean.setClientType(null); - List clients = clientsRepository.findChildByCriteria(searchBean, addressSearchBean); - assertNotNull(clients); - assertEquals(1, clients.size()); - } - - @Test - public void shouldFindChildByLocation() { - AddressSearchBean addressSearchBean = new AddressSearchBean(); - ClientSearchBean searchBean = new ClientSearchBean(); - searchBean.setClientType(null); - List locations = new ArrayList<>(); - locations.add("ce39f858-a2f6-4676-8db1-81fbb1891b01"); - searchBean.setLocations(locations); - List clients = clientsRepository.findChildByCriteria(searchBean, addressSearchBean); - assertNotNull(clients); - assertEquals(1, clients.size()); - } - - @Ignore - @Test - public void testGetAllIdsShouldGetAllClientIds() { - Pair, Long> idsModel = clientsRepository.findAllIds(0, 1000, false); - List clientIds = idsModel.getLeft(); - assertEquals(21, clientIds.size()); - assertEquals(1573733953502l, idsModel.getRight().longValue()); - } - - @Ignore - @Test - public void testGetAllIdsShouldLimitByGiventAmount() { - Pair, Long> idsModel = clientsRepository.findAllIds(0, 1, false); - List clientIds = idsModel.getLeft(); - assertEquals(1, clientIds.size()); - assertEquals("05934ae338431f28bf6793b24159ce5d", clientIds.get(0)); - assertEquals(1520891339766l, idsModel.getRight().longValue()); - } - - @Ignore - @Test - public void testGetAllIdsShouldOrderByServerVersionAsc() { - Pair, Long> idsModel = clientsRepository.findAllIds(0, 3, false); - List clientIds = idsModel.getLeft(); - assertEquals(3, clientIds.size()); - assertEquals("05934ae338431f28bf6793b24159ce5d", clientIds.get(0)); - assertEquals("05934ae338431f28bf6793b24159dea7", clientIds.get(1)); - assertEquals("05934ae338431f28bf6793b24159ebc2", clientIds.get(2)); - assertEquals(1520891682846l, idsModel.getRight().longValue()); - } - - @Test - public void testGetAllIdsShouldGetAllArchivedClientIds() { - Pair, Long> idsModel = clientsRepository.findAllIds(0, 1000, true); - List clientIds = idsModel.getLeft(); - assertEquals(1, clientIds.size()); - assertEquals("5bd3e1eb-5cd4-4e8d-9180", clientIds.get(0)); - assertEquals(1573733955111l, idsModel.getRight().longValue()); - } - - @Test - public void testGetAllIdsShouldFilterBetweenFromDateAndToDate() { - String date1 = "2019-09-24T10:00:00+0300"; - String date2 = "2019-10-01T10:00:00+0300"; - Pair, Long> idsModel = clientsRepository.findAllIds(0, 10, - false, new DateTime(date1, DateTimeZone.UTC).toDate(), new DateTime(date2, DateTimeZone.UTC).toDate()); - List clientIds = idsModel.getLeft(); - assertEquals(6, clientIds.size()); - } - - @Test - public void testGetAllIdsShouldFilterFromDateAsMinimumDate() { - String date1 = "2019-09-25T10:00:00+0300"; - - Pair, Long> idsModel = clientsRepository.findAllIds(0, 10, - false, new DateTime(date1, DateTimeZone.UTC).toDate(), null); - List clientIds = idsModel.getLeft(); - assertEquals(10, clientIds.size()); - } - - @Test - public void testGetAllIdsShouldFilterToDateAsMaximumDate() { - String date1 = "2019-09-24T10:00:00+0300"; - - Pair, Long> idsModel = clientsRepository.findAllIds(0, 10, - false, null, new DateTime(date1, DateTimeZone.UTC).toDate()); - List clientIds = idsModel.getLeft(); - assertEquals(0, clientIds.size()); - } - - - @Test - public void testFindByClientTypeAndLocationId() { - Client client = new Client("f67823b0-378e-4a35-93fc-bb00def74e24").withLocationId("location-1"); - client.setClientType("Client-type-1"); - clientsRepository.add(client); - List clients = clientsRepository.findByClientTypeAndLocationId("Client-type-1","location-1"); - assertEquals(1,clients.size()); - assertEquals("f67823b0-378e-4a35-93fc-bb00def74e24", clients.get(0).getBaseEntityId()); - } - - @Test - public void testFindById() { - Client client = clientsRepository.findById("05934ae338431f28bf6793b24164cbd9"); - assertEquals("86c039a2-0b68-4166-849e-f49897e3a510", client.getBaseEntityId()); - assertEquals("ab91df5d-e433-40f3-b44f-427b73c9ae2a", client.getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); - assertEquals("Sally", client.getFirstName()); - assertEquals("Mtini", client.getLastName().trim()); - - } - - @Test - public void testFindByServerVersionWithLimit() { - assertEquals(23, clientsRepository.findByServerVersion(0l, null).size()); - List clients = clientsRepository.findByServerVersion(1521003136406l, 2); - List expectedIds = Arrays.asList("05934ae338431f28bf6793b241839005", "05934ae338431f28bf6793b2418380ce"); - assertEquals(2, clients.size()); - for (Client client : clients) { - assertTrue(client.getServerVersion() >= 1521003136406l); - assertTrue(expectedIds.contains(client.getId())); - } - } - - @Test - public void testCountAllClientsShouldReturnCorrectValue() { - Long count = clientsRepository.countAll(0l); - assertEquals(Long.valueOf(23), count); - } - - @Test - public void testFindFamilyMemberBYJurisdictionReturnsNotEmpty(){ - String jurisdictionId = "f9ce9265-88ef-4bdd-ac73-b24ca3653871"; - List patients = clientsRepository.findFamilyMemberyByJurisdiction(jurisdictionId); - assertEquals(1, patients.size()); - } - - @Test - public void testFindByLocationIdExclusiveOfTypeFiltersByLocationIdAndExcludesTypeFamily(){ - String jurisdictionId = "f9ce9265-88ef-4bdd-ac73-b24ca3653871"; - List clients = clientsRepository.findByLocationIdExclusiveOfType(jurisdictionId, "Family"); - boolean allHaveLocationIdExcludingFamilyType = clients.stream() - .allMatch(client -> (client.getClientType() == null || !client.getClientType().equalsIgnoreCase("Family"))); - assertTrue(allHaveLocationIdExcludingFamilyType); - } + + @Autowired + @Qualifier("clientsRepositoryPostgres") + private ClientsRepository clientsRepository; + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("client.sql"); + scripts.add("event.sql"); + return scripts; + } + + @Test + public void testGet() { + Client client = clientsRepository.get("05934ae338431f28bf6793b2416946b7"); + assertEquals("469597f0-eefe-4171-afef-f7234cbb2859", client.getBaseEntityId()); + assertEquals("eb4b258c-7558-436c-a1fe-e91d9e12f849", client.getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); + assertEquals("January", client.getFirstName().trim()); + assertEquals("Babysix", client.getLastName()); + assertEquals("05934ae338431f28bf6793b2416946b7", client.getId()); + //missing client + assertNull(clientsRepository.get("05934ae338bf6793b2416946b7")); + + //test deleted client + clientsRepository.safeRemove(clientsRepository.get("05934ae338431f28bf6793b2416946b7")); + assertNull(clientsRepository.get("05934ae338431f28bf6793b2416946b7")); + } + + @Test + public void testAdd() { + Client client = new Client("f67823b0-378e-4a35-93fc-bb00def74e2f").withBirthdate(new DateTime("2017-03-31"), true) + .withGender("Male").withFirstName("xobili").withLastName("mbangwa"); + + client.withIdentifier("ZEIR_ID", "233864-8").withAttribute("Home_Facility", "Linda"); + clientsRepository.add(client); + assertEquals(24, clientsRepository.getAll().size()); + + Client savedClient = clientsRepository.findByBaseEntityId("f67823b0-378e-4a35-93fc-bb00def74e2f"); + assertNotNull(savedClient.getId()); + assertEquals(new DateTime("2017-03-31"), client.getBirthdate()); + assertEquals("xobili", client.getFirstName()); + assertEquals("mbangwa", client.getLastName()); + assertEquals("233864-8", client.getIdentifier("ZEIR_ID")); + + //test if a client with voided date add client as deleted + client = new Client("f67823b0-4a35-93fc-bb00def74e2f").withBirthdate(new DateTime("2017-03-31"), true) + .withGender("Male").withFirstName("Test").withLastName("Deleted"); + client.withDateVoided(new DateTime()); + clientsRepository.add(client); + assertNull(clientsRepository.findByBaseEntityId(client.getBaseEntityId())); + MatcherAssert.assertThat(savedClient.getServerVersion(), Matchers.greaterThan(5l)); + + } + + @Test + public void testUpdate() { + Client client = clientsRepository.get("05934ae338431f28bf6793b2416946b7"); + client.setFirstName("Hummel"); + client.setLastName("Basialis"); + client.withIdentifier("ZEIR_ID", "09876-98"); + long serverVersion = client.getServerVersion(); + clientsRepository.update(client); + + Client updatedClient = clientsRepository.get(client.getId()); + assertEquals("Hummel", updatedClient.getFirstName()); + assertEquals("Basialis", updatedClient.getLastName()); + assertEquals("09876-98", client.getIdentifier("ZEIR_ID")); + MatcherAssert.assertThat(updatedClient.getServerVersion(), Matchers.greaterThan(serverVersion)); + + //test update with voided date deletes client + updatedClient.setDateVoided(new DateTime()); + clientsRepository.update(updatedClient); + assertNull(clientsRepository.get(updatedClient.getId())); + } + + @Test + public void testGetAll() { + assertEquals(23, clientsRepository.getAll().size()); + clientsRepository.safeRemove(clientsRepository.get("05934ae338431f28bf6793b24164cbd9")); + + List clients = clientsRepository.getAll(); + + //test deleted clients + assertEquals(22, clients.size()); + for (Client client : clients) + assertNotEquals("05934ae338431f28bf6793b24164cbd9", client.getId()); + + assertNull(clientsRepository.get("05934ae338431f28bf6793b24164cbd9")); + + } + + @Test + public void testSafeRemove() { + Client client = clientsRepository.get("05934ae338431f28bf6793b2416946b7"); + clientsRepository.safeRemove(client); + List clients = clientsRepository.getAll(); + assertEquals(22, clients.size()); + + for (Client cl : clients) + assertNotEquals("05934ae338431f28bf6793b2416946b7", cl.getId()); + + assertNull(clientsRepository.get("05934ae338431f28bf6793b2416946b7")); + } + + @Test + public void testFindByBaseEntityId() { + Client client = clientsRepository.findByBaseEntityId("86c039a2-0b68-4166-849e-f49897e3a510"); + assertEquals("05934ae338431f28bf6793b24164cbd9", client.getId()); + assertEquals("ab91df5d-e433-40f3-b44f-427b73c9ae2a", client.getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); + assertEquals("Sally", client.getFirstName()); + assertEquals("Mtini", client.getLastName().trim()); + + assertNull(clientsRepository.findByBaseEntityId("f67823b0-378e-4a35-93fc-bb00def74e2f")); + + //test deleted client + clientsRepository.safeRemove(client); + assertNull(clientsRepository.findByBaseEntityId("86c039a2-0b68-4166-849e-f49897e3a510")); + } + + @Test + public void testFindAllClients() { + assertEquals(23, clientsRepository.findAllClients().size()); + + clientsRepository.safeRemove(clientsRepository.get("05934ae338431f28bf6793b24164cbd9")); + + List clients = clientsRepository.findAllClients(); + + assertEquals(22, clients.size()); + for (Client client : clients) + assertNotEquals("05934ae338431f28bf6793b24164cbd9", client.getId()); + + //test deleted client + assertNull(clientsRepository.get("05934ae338431f28bf6793b24164cbd9")); + } + + @Test + public void testFindAllByIdentifier() { + assertTrue(clientsRepository.findAllByIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "ab91df5d-e433-40f3-b44f-427b73ca") + .isEmpty()); + + assertTrue(clientsRepository.findAllByIdentifier("identifier_type", "ab91df5d-e433-40f3-b44f-427b73c9ae2a") + .isEmpty()); + + List clients = clientsRepository.findAllByIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, + "ab91df5d-e433-40f3-b44f-427b73c9ae2a"); + + assertEquals(1, clients.size()); + assertEquals("05934ae338431f28bf6793b24164cbd9", clients.get(0).getId()); + assertEquals("Sally", clients.get(0).getFirstName()); + assertEquals("Mtini", clients.get(0).getLastName().trim()); + + //test deleted clients + clientsRepository.safeRemove(clients.get(0)); + assertTrue(clientsRepository.findAllByIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, + "ab91df5d-e433-40f3-b44f-427b73c9ae2a").isEmpty()); + + } + + @Test + public void testAllByAttribute() { + List clients = clientsRepository.findAllByAttribute("Home_Facility", "Happy Kids Clinic"); + + assertEquals(9, clients.size()); + + clients = clientsRepository.findAllByAttribute("CHW_Phone_Number", "0964357951"); + assertEquals(1, clients.size()); + assertEquals("05934ae338431f28bf6793b24164cbd9", clients.get(0).getId()); + assertEquals("Sally", clients.get(0).getFirstName()); + assertEquals("Mtini", clients.get(0).getLastName().trim()); + + assertTrue(clientsRepository.findAllByAttribute("CHW_Phone_Number", "+0964357951").isEmpty()); + + assertTrue(clientsRepository.findAllByAttribute("Phone_Number", "0964357951").isEmpty()); + + //test deleted clients + clientsRepository.safeRemove(clients.get(0)); + assertTrue(clientsRepository.findAllByAttribute("CHW_Phone_Number", "0964357951").isEmpty()); + } + + @Test + public void testAllByAttributes() { + List clients = clientsRepository.findAllByAttribute("Home_Facility", "Happy Kids Clinic"); + + assertEquals(9, clients.size()); + + clients = clientsRepository.findAllByAttribute("CHW_Phone_Number", "0964357951"); + assertEquals(1, clients.size()); + assertEquals("05934ae338431f28bf6793b24164cbd9", clients.get(0).getId()); + assertEquals("Sally", clients.get(0).getFirstName()); + assertEquals("Mtini", clients.get(0).getLastName().trim()); + + assertEquals(clientsRepository.findAllByAttributes("CHW_Phone_Number", new ArrayList<>(Arrays.asList("+0964357951", "0964357951"))).size(), 1); + + //test deleted clients + clientsRepository.safeRemove(clients.get(0)); + assertTrue(clientsRepository.findAllByAttributes("Phone_Number", new ArrayList<>(Arrays.asList("+0964357951", "0964357951"))).isEmpty()); + } + + @Test + public void testFindAllByMatchingName() { + assertEquals(9, clientsRepository.findAllByMatchingName("b").size()); + + List clients = clientsRepository.findAllByMatchingName("babytwo"); + + assertEquals(1, clients.size()); + + assertEquals("05934ae338431f28bf6793b24167b6d1", clients.get(0).getId()); + assertEquals("fe7b6350-16d2-41d0-8574-c194088705df", clients.get(0).getBaseEntityId()); + assertEquals("218227-7", clients.get(0).getIdentifier("ZEIR_ID")); + assertEquals("ba5d3927-414f-4796-ae1e-9b73b50a5573", clients.get(0).getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); + + assertEquals(12, clientsRepository.findAllByMatchingName("a").size()); + + assertEquals(6, clientsRepository.findAllByMatchingName("Ja").size()); + + assertEquals(4, clientsRepository.findAllByMatchingName("Janu").size()); + + assertEquals(2, clientsRepository.findAllByMatchingName("January").size()); + + assertTrue(clientsRepository.findAllByMatchingName("Kimbley").isEmpty()); + + //test deleted clients + clientsRepository.safeRemove(clientsRepository.findAllByMatchingName("babytwo").get(0)); + assertTrue(clientsRepository.findAllByMatchingName("babytwo").isEmpty()); + } + + @Test + public void testFindByRelationshipIdAndDateCreated() { + assertEquals( + 2, + clientsRepository.findByRelationshipIdAndDateCreated("0154839f-8766-4eda-b729-89067c7a8c5d", + new DateTime("2018-03-13").toString(), new DateTime().toString()).size()); + + assertTrue(clientsRepository.findByRelationshipIdAndDateCreated("0154839f-8766-4eda-89067c7a8c5d", + new DateTime("2018-03-14").toString(), new DateTime().toString()).isEmpty()); + + assertTrue(clientsRepository.findByRelationshipIdAndDateCreated("0154839f-8766-4eda-b729-89067c7a8c5d", + new DateTime("2018-03-14").toString(), new DateTime().toString()).isEmpty()); + + Client client = clientsRepository.findByRelationshipIdAndDateCreated("3abdb25a-f151-4a95-9311-bd30bf935085", + new DateTime("2018-03-13").toString(), new DateTime().toString()).get(0); + assertEquals("05934ae338431f28bf6793b2415a0374", client.getId()); + assertEquals("94f3e8fb-2f05-4fca-8119-2b593d1962eb", client.getBaseEntityId()); + assertEquals("2018-03-01", client.getBirthdate().toLocalDate().toString()); + + //test deleted clients + clientsRepository.safeRemove(client); + assertTrue(clientsRepository.findByRelationshipIdAndDateCreated("3abdb25a-f151-4a95-9311-bd30bf935085", + new DateTime("2018-03-13").toString(), new DateTime().toString()).isEmpty()); + } + + @Test + public void testFindByRelationshipId() { + assertEquals(2, clientsRepository.findByRelationshipId("mother", "0154839f-8766-4eda-b729-89067c7a8c5d").size()); + + Client client = clientsRepository.findByRelationshipId("mother", "3abdb25a-f151-4a95-9311-bd30bf935085").get(0); + assertEquals("05934ae338431f28bf6793b2415a0374", client.getId()); + assertEquals("94f3e8fb-2f05-4fca-8119-2b593d1962eb", client.getBaseEntityId()); + assertEquals("cf58894b-71c6-41e0-a977-7283f2411cd5", client.getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); + assertEquals("2018-03-01", client.getBirthdate().toLocalDate().toString()); + + assertTrue(clientsRepository.findByRelationshipId("father", "0154839f-8766-4eda-b729-89067c7a8c5d").isEmpty()); + + assertTrue(clientsRepository.findByRelationshipId("mother", "0154839f-4eda-b729-89067c7a8c5d").isEmpty()); + + //test deleted clients + clientsRepository.safeRemove(client); + assertTrue(clientsRepository.findByRelationshipId("mother", "3abdb25a-f151-4a95-9311-bd30bf935085").isEmpty()); + } + + @Test + public void testFindByCriteria() { + ClientSearchBean searchBean = new ClientSearchBean(); + AddressSearchBean addressSearchBean = new AddressSearchBean(); + assertEquals(23, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); + + searchBean.setNameLike("Janu"); + assertEquals(4, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); + + searchBean.setNameLike("Baby"); + searchBean.setGender("Male"); + assertEquals(2, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); + + searchBean.setBirthdateFrom(new DateTime("2016-04-13")); + searchBean.setBirthdateTo(new DateTime()); + assertEquals(2, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); + + searchBean.setDeathdateFrom(new DateTime("2018-01-01")); + searchBean.setDeathdateTo(new DateTime()); + assertEquals(1, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); + + searchBean = new ClientSearchBean(); + searchBean.setAttributeType("Home_Facility"); + searchBean.setAttributeValue("Happy Kids Clinic"); + assertEquals(9, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); + + searchBean.setAttributeType("CHW_Name"); + searchBean.setAttributeValue("Hellen"); + List clients = clientsRepository.findByCriteria(searchBean, addressSearchBean); + assertEquals(1, clients.size()); + assertEquals("05934ae338431f28bf6793b24164cbd9", clients.get(0).getId()); + + searchBean = new ClientSearchBean(); + searchBean.setLastEditFrom(new DateTime("2018-03-13T12:57:05.652")); + searchBean.setLastEditTo(new DateTime()); + + assertEquals(6, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); + + addressSearchBean.setAddressType("usual_residence"); + assertEquals(6, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); + + addressSearchBean.setAddressType("usual_residence"); + assertEquals(6, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); + Client testClient = new Client("f67823b0-378e-4a35-93fc-bb00def74e2f").withBirthdate(new DateTime("2017-03-31"), true) + .withGender("Male").withFirstName("xobili").withLastName("mbangwa"); + testClient.setLocationId("123"); + clientsRepository.add(testClient); + List locationIds = new ArrayList<>(); + locationIds.add("123"); + searchBean.setLocations(locationIds); + searchBean = new ClientSearchBean(); + searchBean.setLocations(locationIds); + addressSearchBean = new AddressSearchBean(); + assertEquals(1, clientsRepository.findByCriteria(searchBean, addressSearchBean).size()); + + //test deleted clients + for (Client client : clientsRepository.findByCriteria(searchBean, addressSearchBean)) + clientsRepository.safeRemove(client); + assertTrue(clientsRepository.findByCriteria(searchBean, addressSearchBean).isEmpty()); + + } + + @Test + public void testFindByCriteriaWithoutAddressBean() { + ClientSearchBean searchBean = new ClientSearchBean(); + assertEquals(23, clientsRepository.findByCriteria(searchBean).size()); + + searchBean.setNameLike("Janu"); + assertEquals(4, clientsRepository.findByCriteria(searchBean).size()); + + searchBean.setNameLike("Baby"); + searchBean.setGender("Male"); + assertEquals(2, clientsRepository.findByCriteria(searchBean).size()); + + searchBean.setBirthdateFrom(new DateTime("2016-04-13")); + searchBean.setBirthdateTo(new DateTime()); + assertEquals(2, clientsRepository.findByCriteria(searchBean).size()); + + searchBean.setDeathdateFrom(new DateTime("2018-01-01")); + searchBean.setDeathdateTo(new DateTime()); + assertEquals(1, clientsRepository.findByCriteria(searchBean).size()); + + searchBean = new ClientSearchBean(); + searchBean.setAttributeType("Home_Facility"); + searchBean.setAttributeValue("Happy Kids Clinic"); + assertEquals(9, clientsRepository.findByCriteria(searchBean).size()); + + searchBean.setAttributeType("CHW_Name"); + searchBean.setAttributeValue("Hellen"); + List clients = clientsRepository.findByCriteria(searchBean); + assertEquals(1, clients.size()); + assertEquals("05934ae338431f28bf6793b24164cbd9", clients.get(0).getId()); + + searchBean = new ClientSearchBean(); + searchBean.setLastEditFrom(new DateTime("2018-03-13T12:57:05.652")); + searchBean.setLastEditTo(new DateTime()); + assertEquals(6, clientsRepository.findByCriteria(searchBean).size()); + + //test deleted clients + for (Client client : clientsRepository.findByCriteria(searchBean)) + clientsRepository.safeRemove(client); + assertTrue(clientsRepository.findByCriteria(searchBean).isEmpty()); + + } + + @Test + public void testFindByCriteriaWithEditDateParams() { + + DateTime from = new DateTime("2018-03-13T12:57:05.652"); + DateTime to = new DateTime(); + List clients = clientsRepository.findByCriteria(new AddressSearchBean(), from, to); + assertEquals(6, clients.size()); + + for (Client client : clients) + assertTrue(client.getDateEdited().isEqual(from) || client.getDateEdited().isAfter(from)); + + to = from; + from = new DateTime("2018-01-01"); + clients = clientsRepository.findByCriteria(new AddressSearchBean(), from, to); + assertEquals(11, clients.size()); + + for (Client client : clients) { + assertTrue(client.getDateEdited().isEqual(from) || client.getDateEdited().isAfter(from)); + assertTrue(client.getDateEdited().isEqual(to) || client.getDateEdited().isBefore(to)); + } + + AddressSearchBean addressSearchBean = new AddressSearchBean(); + addressSearchBean.setCityVillage("hui"); + assertTrue(clientsRepository.findByCriteria(addressSearchBean, new DateTime("2018-01-01"), new DateTime()).isEmpty()); + + //test deleted clients + for (Client client : clientsRepository.findByCriteria(new AddressSearchBean(), from, to)) + clientsRepository.safeRemove(client); + assertTrue(clientsRepository.findByCriteria(new AddressSearchBean(), from, to).isEmpty()); + } + + @Test + public void testFindByRelationShip() { + assertEquals(2, clientsRepository.findByRelationShip("0154839f-8766-4eda-b729-89067c7a8c5d").size()); + + Client client = clientsRepository.findByRelationShip("3abdb25a-f151-4a95-9311-bd30bf935085").get(0); + assertEquals("05934ae338431f28bf6793b2415a0374", client.getId()); + assertEquals("94f3e8fb-2f05-4fca-8119-2b593d1962eb", client.getBaseEntityId()); + assertEquals("Fith", client.getFirstName()); + assertEquals("2018-03-01", client.getBirthdate().toLocalDate().toString()); + + //test deleted clients + clientsRepository.safeRemove(client); + assertTrue(clientsRepository.findByRelationShip("3abdb25a-f151-4a95-9311-bd30bf935085").isEmpty()); + + assertTrue(clientsRepository.findByRelationShip("0154839f-4eda-b729-89067c7a8c5d").isEmpty()); + } + + @Test + public void testFindByEmptyServerVersion() { + assertTrue(clientsRepository.findByEmptyServerVersion().isEmpty()); + + Client client = clientsRepository.get("05934ae338431f28bf6793b2415a0374"); + client.setServerVersion(0l); + clientsRepository.update(client); + + assertTrue(clientsRepository.findByEmptyServerVersion().isEmpty()); + + //test deleted clients + clientsRepository.safeRemove(client); + assertTrue(clientsRepository.findByEmptyServerVersion().isEmpty()); + + } + + @Test + public void testFindByServerVersion() { + assertEquals(13, clientsRepository.findByServerVersion(1520935878136l, null).size()); + List clients = clientsRepository.findByServerVersion(1521003136406l, null); + List expectedIds = Arrays.asList("05934ae338431f28bf6793b241839005", "05934ae338431f28bf6793b2418380ce", + "ade884f8-2685-45fd-93f8-122045b2635e", "2e14b66f-206c-4314-a0f7-c5d2c4d9860f", + "b0cb057b-c396-4ec9-bfab-388117a9a5f6", "28ea8f0a-fa53-447d-b8f9-ad07263b382c", + "5bd3e1eb-5cd4-4e8d-9180-4293b7ea3b78", "f5934ae338431f28bf6793b24159ce5a", "c778e5a4-5384-4886-b783-65f1abb4c7b0", "5e287780-770e-460b-bc86-8559c73e85d9"); + assertEquals(10, clients.size()); + for (Client client : clients) { + assertTrue(client.getServerVersion() >= 1521003136406l); + assertTrue(expectedIds.contains(client.getId())); + } + + //test deleted clients + for (Client client : clients) + clientsRepository.safeRemove(client); + assertTrue(clientsRepository.findByServerVersion(1521003136406l, null).isEmpty()); + } + + @Test + public void testFindByFieldValue() { + assertEquals( + 3, + clientsRepository.findByFieldValue( + BASE_ENTITY_ID, + Arrays.asList(new String[]{"86c039a2-0b68-4166-849e-f49897e3a510", "f33c71c7-a9a4-495d-8028-b6d59e4034b3", + "fe7b6350-16d2-41d0-8574-c194088705df"})).size()); + + assertTrue(clientsRepository.findByFieldValue("Firstname", Arrays.asList(new String[]{"Baby", "Jan"})).isEmpty()); + + assertTrue(clientsRepository.findByFieldValue(BASE_ENTITY_ID, Arrays.asList(new String[]{"Baby", "Jan"})) + .isEmpty()); + + Client client = clientsRepository.findByFieldValue(BASE_ENTITY_ID, + Arrays.asList(new String[]{"f33c71c7-a9a4-495d-8028-b6d59e4034b3"})).get(0); + + assertEquals("05934ae338431f28bf6793b241679500", client.getId()); + assertEquals("Jan", client.getFirstName()); + assertEquals("2018-01-01", client.getBirthdate().toLocalDate().toString()); + assertEquals("218226-9", client.getIdentifier("ZEIR_ID")); + + //test deleted clients + clientsRepository.safeRemove(client); + assertTrue(clientsRepository.findByFieldValue(BASE_ENTITY_ID, + Arrays.asList(new String[]{"f33c71c7-a9a4-495d-8028-b6d59e4034b3"})).isEmpty()); + } + + + @Test + public void testNotInOpenMRSByServerVersion() { + assertTrue(clientsRepository.notInOpenMRSByServerVersion(0l, Calendar.getInstance()).isEmpty()); + + Client client = clientsRepository.get("05934ae338431f28bf6793b2415a0374"); + client.removeIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE); + client.setServerVersion(1l); + clientsRepository.update(client); + + client = clientsRepository.notInOpenMRSByServerVersion(0l, Calendar.getInstance()).get(0); + assertEquals("94f3e8fb-2f05-4fca-8119-2b593d1962eb", client.getBaseEntityId()); + assertEquals("Fith", client.getFirstName()); + assertEquals("2018-03-01", client.getBirthdate().toLocalDate().toString()); + assertEquals("218224-4", client.getIdentifier("ZEIR_ID")); + + //test deleted clients + clientsRepository.safeRemove(client); + assertTrue(clientsRepository.notInOpenMRSByServerVersion(0l, Calendar.getInstance()).isEmpty()); + } + + @Test + public void shouldFindMembersByRelationshipId() { + List expectedClient = clientsRepository.findMembersByRelationshipId("43930c23-c787-4ddb-ab76-770f77e7b17d"); + assertNotNull(expectedClient); + assertEquals(1, expectedClient.size()); + + } + + @Test + public void shouldGetMemberCountHouseholdHeadProviderByClients() { + List id = new ArrayList(); + id.add("43930c23-c787-4ddb-ab76-770f77e7b17d"); + List householdClient = clientsRepository.selectMemberCountHouseholdHeadProviderByClients("", id, + "mother"); + + assertEquals("biddemo", householdClient.get(0).getProviderId()); + assertEquals(1, householdClient.get(0).getMemebrCount()); + } + + @Test + public void shouldFindAllClientsByCriteria() { + AddressSearchBean addressSearchBean = new AddressSearchBean(); + ClientSearchBean searchBean = new ClientSearchBean(); + searchBean.setClientType("ec_family"); + List locationUuids = new ArrayList(); + locationUuids.add("42abc582-6658-488b-922e-7be500c070f3"); + searchBean.setLocations(locationUuids); + List clients = clientsRepository.findAllClientsByCriteria(searchBean, addressSearchBean); + assertNotNull(clients); + assertEquals(2, clients.size()); + } + + @Test + public void shouldFindCountAllClientsByCriteria() { + AddressSearchBean addressSearchBean = new AddressSearchBean(); + ClientSearchBean searchBean = new ClientSearchBean(); + searchBean.setClientType("ec_family"); + List locationUuids = new ArrayList(); + locationUuids.add("42abc582-6658-488b-922e-7be500c070f3"); + searchBean.setLocations(locationUuids); + HouseholdClient householdClient = clientsRepository.findCountAllClientsByCriteria(searchBean, addressSearchBean); + assertNotNull(householdClient.getTotalCount()); + assertEquals(2, householdClient.getTotalCount()); + } + + @Test + public void shouldFindHouseholdByCriteria() { + AddressSearchBean addressSearchBean = new AddressSearchBean(); + ClientSearchBean searchBean = new ClientSearchBean(); + searchBean.setNameLike("Haran Mia"); + List clients = clientsRepository.findHouseholdByCriteria(searchBean, addressSearchBean); + assertNotNull(clients); + assertEquals(1, clients.size()); + } + + @Test + public void shouldFindHouseholdByLocation() { + AddressSearchBean addressSearchBean = new AddressSearchBean(); + ClientSearchBean searchBean = new ClientSearchBean(); + List locationUuids = new ArrayList(); + locationUuids.add("e3170b23-bb22-42a4-875d-35c7f32c28ae"); + searchBean.setLocations(locationUuids); + List clients = clientsRepository.findHouseholdByCriteria(searchBean, addressSearchBean); + assertNotNull(clients); + assertEquals(1, clients.size()); + } + + @Test + public void shouldCountHouseholdByLocation() { + AddressSearchBean addressSearchBean = new AddressSearchBean(); + ClientSearchBean searchBean = new ClientSearchBean(); + List locationUuids = new ArrayList(); + locationUuids.add("e3170b23-bb22-42a4-875d-35c7f32c28ae"); + searchBean.setLocations(locationUuids); + HouseholdClient clients = clientsRepository.findTotalCountHouseholdByCriteria(searchBean, addressSearchBean); + assertNotNull(clients); + assertEquals(1, clients.getTotalCount()); + } + + @Test + public void shouldCountHouseholdByCriteria() { + AddressSearchBean addressSearchBean = new AddressSearchBean(); + ClientSearchBean searchBean = new ClientSearchBean(); + searchBean.setNameLike("Haran Mia"); + HouseholdClient clients = clientsRepository.findTotalCountHouseholdByCriteria(searchBean, addressSearchBean); + assertNotNull(clients); + assertEquals(1, clients.getTotalCount()); + } + + @Test + public void shouldFindANCByCriteria() { + AddressSearchBean addressSearchBean = new AddressSearchBean(); + ClientSearchBean searchBean = new ClientSearchBean(); + searchBean.setNameLike("Nobonita"); + searchBean.setClientType(null); + List clients = clientsRepository.findANCByCriteria(searchBean, addressSearchBean); + assertNotNull(clients); + assertEquals(1, clients.size()); + } + + @Test + public void shouldFindAllANCByCriteria() { + AddressSearchBean addressSearchBean = new AddressSearchBean(); + ClientSearchBean searchBean = new ClientSearchBean(); + searchBean.setClientType(null); + List clients = clientsRepository.findANCByCriteria(searchBean, addressSearchBean); + assertNotNull(clients); + assertEquals(1, clients.size()); + } + + @Test + public void shouldFindChildByCriteria() { + AddressSearchBean addressSearchBean = new AddressSearchBean(); + ClientSearchBean searchBean = new ClientSearchBean(); + searchBean.setNameLike("mala"); + searchBean.setClientType(null); + List clients = clientsRepository.findChildByCriteria(searchBean, addressSearchBean); + assertNotNull(clients); + assertEquals(1, clients.size()); + } + + @Test + public void shouldFindANCByLocation() { + AddressSearchBean addressSearchBean = new AddressSearchBean(); + ClientSearchBean searchBean = new ClientSearchBean(); + searchBean.setClientType(null); + List locations = new ArrayList<>(); + locations.add("ce39f858-a2f6-4676-8db1-81fbb1891b01"); + searchBean.setLocations(locations); + List clients = clientsRepository.findChildByCriteria(searchBean, addressSearchBean); + assertNotNull(clients); + assertEquals(1, clients.size()); + } + + @Test + public void shouldFindAllChildByCriteria() { + AddressSearchBean addressSearchBean = new AddressSearchBean(); + ClientSearchBean searchBean = new ClientSearchBean(); + searchBean.setClientType(null); + List clients = clientsRepository.findChildByCriteria(searchBean, addressSearchBean); + assertNotNull(clients); + assertEquals(1, clients.size()); + } + + @Test + public void shouldFindChildByLocation() { + AddressSearchBean addressSearchBean = new AddressSearchBean(); + ClientSearchBean searchBean = new ClientSearchBean(); + searchBean.setClientType(null); + List locations = new ArrayList<>(); + locations.add("ce39f858-a2f6-4676-8db1-81fbb1891b01"); + searchBean.setLocations(locations); + List clients = clientsRepository.findChildByCriteria(searchBean, addressSearchBean); + assertNotNull(clients); + assertEquals(1, clients.size()); + } + + @Ignore + @Test + public void testGetAllIdsShouldGetAllClientIds() { + Pair, Long> idsModel = clientsRepository.findAllIds(0, 1000, false); + List clientIds = idsModel.getLeft(); + assertEquals(21, clientIds.size()); + assertEquals(1573733953502l, idsModel.getRight().longValue()); + } + + @Ignore + @Test + public void testGetAllIdsShouldLimitByGiventAmount() { + Pair, Long> idsModel = clientsRepository.findAllIds(0, 1, false); + List clientIds = idsModel.getLeft(); + assertEquals(1, clientIds.size()); + assertEquals("05934ae338431f28bf6793b24159ce5d", clientIds.get(0)); + assertEquals(1520891339766l, idsModel.getRight().longValue()); + } + + @Ignore + @Test + public void testGetAllIdsShouldOrderByServerVersionAsc() { + Pair, Long> idsModel = clientsRepository.findAllIds(0, 3, false); + List clientIds = idsModel.getLeft(); + assertEquals(3, clientIds.size()); + assertEquals("05934ae338431f28bf6793b24159ce5d", clientIds.get(0)); + assertEquals("05934ae338431f28bf6793b24159dea7", clientIds.get(1)); + assertEquals("05934ae338431f28bf6793b24159ebc2", clientIds.get(2)); + assertEquals(1520891682846l, idsModel.getRight().longValue()); + } + + @Test + public void testGetAllIdsShouldGetAllArchivedClientIds() { + Pair, Long> idsModel = clientsRepository.findAllIds(0, 1000, true); + List clientIds = idsModel.getLeft(); + assertEquals(1, clientIds.size()); + assertEquals("5bd3e1eb-5cd4-4e8d-9180", clientIds.get(0)); + assertEquals(1573733955111l, idsModel.getRight().longValue()); + } + + @Test + public void testGetAllIdsShouldFilterBetweenFromDateAndToDate() { + String date1 = "2019-09-24T10:00:00+0300"; + String date2 = "2019-10-01T10:00:00+0300"; + Pair, Long> idsModel = clientsRepository.findAllIds(0, 10, + false, new DateTime(date1, DateTimeZone.UTC).toDate(), new DateTime(date2, DateTimeZone.UTC).toDate()); + List clientIds = idsModel.getLeft(); + assertEquals(6, clientIds.size()); + } + + @Test + public void testGetAllIdsShouldFilterFromDateAsMinimumDate() { + String date1 = "2019-09-25T10:00:00+0300"; + + Pair, Long> idsModel = clientsRepository.findAllIds(0, 10, + false, new DateTime(date1, DateTimeZone.UTC).toDate(), null); + List clientIds = idsModel.getLeft(); + assertEquals(10, clientIds.size()); + } + + @Test + public void testGetAllIdsShouldFilterToDateAsMaximumDate() { + String date1 = "2019-09-24T10:00:00+0300"; + + Pair, Long> idsModel = clientsRepository.findAllIds(0, 10, + false, null, new DateTime(date1, DateTimeZone.UTC).toDate()); + List clientIds = idsModel.getLeft(); + assertEquals(0, clientIds.size()); + } + + + @Test + public void testFindByClientTypeAndLocationId() { + Client client = new Client("f67823b0-378e-4a35-93fc-bb00def74e24").withLocationId("location-1"); + client.setClientType("Client-type-1"); + clientsRepository.add(client); + List clients = clientsRepository.findByClientTypeAndLocationId("Client-type-1", "location-1"); + assertEquals(1, clients.size()); + assertEquals("f67823b0-378e-4a35-93fc-bb00def74e24", clients.get(0).getBaseEntityId()); + } + + @Test + public void testFindById() { + Client client = clientsRepository.findById("05934ae338431f28bf6793b24164cbd9"); + assertEquals("86c039a2-0b68-4166-849e-f49897e3a510", client.getBaseEntityId()); + assertEquals("ab91df5d-e433-40f3-b44f-427b73c9ae2a", client.getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); + assertEquals("Sally", client.getFirstName()); + assertEquals("Mtini", client.getLastName().trim()); + + } + + @Test + public void testFindByServerVersionWithLimit() { + assertEquals(23, clientsRepository.findByServerVersion(0l, null).size()); + List clients = clientsRepository.findByServerVersion(1521003136406l, 2); + List expectedIds = Arrays.asList("05934ae338431f28bf6793b241839005", "05934ae338431f28bf6793b2418380ce"); + assertEquals(2, clients.size()); + for (Client client : clients) { + assertTrue(client.getServerVersion() >= 1521003136406l); + assertTrue(expectedIds.contains(client.getId())); + } + } + + @Test + public void testCountAllClientsShouldReturnCorrectValue() { + Long count = clientsRepository.countAll(0l); + assertEquals(Long.valueOf(23), count); + } + + @Test + public void testFindFamilyMemberBYJurisdictionReturnsNotEmpty() { + String jurisdictionId = "f9ce9265-88ef-4bdd-ac73-b24ca3653871"; + List patients = clientsRepository.findFamilyMemberyByJurisdiction(jurisdictionId); + assertEquals(1, patients.size()); + } + + @Test + public void testFindByLocationIdExclusiveOfTypeFiltersByLocationIdAndExcludesTypeFamily() { + String jurisdictionId = "f9ce9265-88ef-4bdd-ac73-b24ca3653871"; + List clients = clientsRepository.findByLocationIdExclusiveOfType(jurisdictionId, "Family"); + boolean allHaveLocationIdExcludingFamilyType = clients.stream() + .allMatch(client -> (client.getClientType() == null || !client.getClientType().equalsIgnoreCase("Family"))); + assertTrue(allHaveLocationIdExcludingFamilyType); + } } diff --git a/src/test/java/org/opensrp/repository/postgres/ConfigServiceIntegrationTest.java b/src/test/java/org/opensrp/repository/postgres/ConfigServiceIntegrationTest.java index 1fd4f1e21..0180f7f08 100644 --- a/src/test/java/org/opensrp/repository/postgres/ConfigServiceIntegrationTest.java +++ b/src/test/java/org/opensrp/repository/postgres/ConfigServiceIntegrationTest.java @@ -20,127 +20,124 @@ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:test-applicationContext-opensrp.xml") @FixMethodOrder(MethodSorters.NAME_ASCENDING) -@ActiveProfiles(profiles = { "jedis"}) +@ActiveProfiles(profiles = {"jedis"}) public class ConfigServiceIntegrationTest { - - public enum TestToken { - token1_int(Integer.valueOf(12)), - token2_long(Long.valueOf(1234567890123L)), - token3_string("test string"), - token5_datetime(LocalDate.now()), - token6_float(Float.valueOf("21212.3323")), - token7_double(Double.valueOf(43748384.347384738)), - token9_boolean(true); - - private Object value; - - public Object value() { - return value; - } - - private TestToken(Object value) { - this.value = value; - } - } - - @Autowired - private AppStateTokensRepositoryImpl alltokens; - - private static AppStateTokensRepositoryImpl allAppTokens; - - @Autowired - private ConfigService configService; - - - @Before - public void setUp() { - if (allAppTokens == null) { - alltokens.removeAll(); - allAppTokens = alltokens; - - for (TestToken tk : TestToken.values()) { - configService.registerAppStateToken(tk, tk.value(), tk.name(), false); - } - - for (TestToken tk : TestToken.values()) { - assertEquals(tk.name(), configService.getAppStateTokenByName(tk).getName()); - } - } - } - - @AfterClass - public static void cleanup() { - allAppTokens.removeAll(); - } - - @Test - public void shouldGetIntToken() { - TestToken tk = TestToken.token1_int; - assertEquals(tk.value(), configService.getAppStateTokenByName(tk).intValue()); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionForRegisteringDuplicateEntryFlaggedAsDonotSuppressException() { - configService.registerAppStateToken(TestToken.token1_int, "", "token1_int", false); - } - - @Test - public void shouldNotThrowExceptionForRegisteringDuplicateEntryFlaggedAsSuppressException() { - configService.registerAppStateToken(TestToken.token1_int, "", "token1_int", true); - assertNotNull(configService.getAppStateTokenByName(TestToken.token1_int)); - assertEquals("token1_int",configService.getAppStateTokenByName(TestToken.token1_int).getDescription()); - assertEquals(TestToken.token1_int.value,Integer.valueOf(configService.getAppStateTokenByName(TestToken.token1_int).getValue().toString())); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionForRegisteringWithMissingDescription() { - configService.registerAppStateToken(TestToken.token1_int, "", "", false); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionForRegisteringWithMissingName() { - configService.registerAppStateToken(null, "", "", false); - } - - @Test(expected = IllegalStateException.class) - public void shouldThrowExceptionForUpdatingWithNonExistentName() { - configService.updateAppStateToken(Config.FORM_ENTITY_PARSER_LAST_SYNCED_FORM_SUBMISSION, ""); - } - - @Test - public void shouldGetLongToken() { - TestToken tk = TestToken.token2_long; - assertEquals(tk.value(), configService.getAppStateTokenByName(tk).longValue()); - } - - @Test - public void shouldGetStringToken() { - TestToken tk = TestToken.token3_string; - assertEquals(tk.value(), configService.getAppStateTokenByName(tk).stringValue()); - } - - @Test - public void shouldGetDatetimeToken() { - TestToken tk = TestToken.token5_datetime; - assertEquals(tk.value(), configService.getAppStateTokenByName(tk).datetimeValue()); - } - - @Test - public void shouldGetFloatToken() { - TestToken tk = TestToken.token6_float; - assertEquals(tk.value(), configService.getAppStateTokenByName(tk).floatValue()); - } - - @Test - public void shouldGetDoubleToken() { - TestToken tk = TestToken.token7_double; - assertEquals(tk.value(), configService.getAppStateTokenByName(tk).doubleValue()); - } - - @Test - public void shouldGetBooleanToken() { - TestToken tk = TestToken.token9_boolean; - assertEquals(tk.value(), configService.getAppStateTokenByName(tk).booleanValue()); - } - + + private static AppStateTokensRepositoryImpl allAppTokens; + @Autowired + private AppStateTokensRepositoryImpl alltokens; + @Autowired + private ConfigService configService; + + @AfterClass + public static void cleanup() { + allAppTokens.removeAll(); + } + + @Before + public void setUp() { + if (allAppTokens == null) { + alltokens.removeAll(); + allAppTokens = alltokens; + + for (TestToken tk : TestToken.values()) { + configService.registerAppStateToken(tk, tk.value(), tk.name(), false); + } + + for (TestToken tk : TestToken.values()) { + assertEquals(tk.name(), configService.getAppStateTokenByName(tk).getName()); + } + } + } + + @Test + public void shouldGetIntToken() { + TestToken tk = TestToken.token1_int; + assertEquals(tk.value(), configService.getAppStateTokenByName(tk).intValue()); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionForRegisteringDuplicateEntryFlaggedAsDonotSuppressException() { + configService.registerAppStateToken(TestToken.token1_int, "", "token1_int", false); + } + + @Test + public void shouldNotThrowExceptionForRegisteringDuplicateEntryFlaggedAsSuppressException() { + configService.registerAppStateToken(TestToken.token1_int, "", "token1_int", true); + assertNotNull(configService.getAppStateTokenByName(TestToken.token1_int)); + assertEquals("token1_int", configService.getAppStateTokenByName(TestToken.token1_int).getDescription()); + assertEquals(TestToken.token1_int.value, Integer.valueOf(configService.getAppStateTokenByName(TestToken.token1_int).getValue().toString())); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionForRegisteringWithMissingDescription() { + configService.registerAppStateToken(TestToken.token1_int, "", "", false); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionForRegisteringWithMissingName() { + configService.registerAppStateToken(null, "", "", false); + } + + @Test(expected = IllegalStateException.class) + public void shouldThrowExceptionForUpdatingWithNonExistentName() { + configService.updateAppStateToken(Config.FORM_ENTITY_PARSER_LAST_SYNCED_FORM_SUBMISSION, ""); + } + + @Test + public void shouldGetLongToken() { + TestToken tk = TestToken.token2_long; + assertEquals(tk.value(), configService.getAppStateTokenByName(tk).longValue()); + } + + @Test + public void shouldGetStringToken() { + TestToken tk = TestToken.token3_string; + assertEquals(tk.value(), configService.getAppStateTokenByName(tk).stringValue()); + } + + @Test + public void shouldGetDatetimeToken() { + TestToken tk = TestToken.token5_datetime; + assertEquals(tk.value(), configService.getAppStateTokenByName(tk).datetimeValue()); + } + + @Test + public void shouldGetFloatToken() { + TestToken tk = TestToken.token6_float; + assertEquals(tk.value(), configService.getAppStateTokenByName(tk).floatValue()); + } + + @Test + public void shouldGetDoubleToken() { + TestToken tk = TestToken.token7_double; + assertEquals(tk.value(), configService.getAppStateTokenByName(tk).doubleValue()); + } + + @Test + public void shouldGetBooleanToken() { + TestToken tk = TestToken.token9_boolean; + assertEquals(tk.value(), configService.getAppStateTokenByName(tk).booleanValue()); + } + + public enum TestToken { + token1_int(Integer.valueOf(12)), + token2_long(Long.valueOf(1234567890123L)), + token3_string("test string"), + token5_datetime(LocalDate.now()), + token6_float(Float.valueOf("21212.3323")), + token7_double(Double.valueOf(43748384.347384738)), + token9_boolean(true); + + private Object value; + + private TestToken(Object value) { + this.value = value; + } + + public Object value() { + return value; + } + } + } diff --git a/src/test/java/org/opensrp/repository/postgres/ErrorTraceRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/ErrorTraceRepositoryTest.java index b5f32e21b..a2875b285 100644 --- a/src/test/java/org/opensrp/repository/postgres/ErrorTraceRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/ErrorTraceRepositoryTest.java @@ -21,146 +21,146 @@ import org.springframework.beans.factory.annotation.Qualifier; public class ErrorTraceRepositoryTest extends BaseRepositoryTest { - - @Autowired - @Qualifier("errorRepositoryPostgres") - private ErrorTraceRepository errorTraceRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("error.sql"); - return scripts; - } - - @Test - public void testGet() { - ErrorTrace error = errorTraceRepository.get("85ed95b2-8436-4a93-9ae7-ab104d65edd7"); - assertEquals(new DateTime("2018-03-14T07:53:11.152"), error.getDateOccurred()); - assertEquals("OPENMRS FAILED CLIENT PUSH", error.getErrorType()); - assertEquals("org.opensrp.domain.Client", error.getDocumentType()); - assertNull(errorTraceRepository.get("07271855-4018-497a-b180-6af")); - } - - @Test - public void testAdd() { - DateTime occured = new DateTime(); - ErrorTrace error = new ErrorTrace(occured, "GENERIC ERROR 123!!", occured.toString(), - "error at stocktrace.java(677)", "unsolved", "org.test.bean"); - errorTraceRepository.add(error); - List errors = errorTraceRepository.getAll(); - assertEquals(9, errors.size()); - boolean found = false; - for (ErrorTrace er : errors) { - if (er.getDateOccurred().equals(occured)) { - found = true; - assertEquals("GENERIC ERROR 123!!", error.getErrorType()); - assertEquals("error at stocktrace.java(677)", error.getStackTrace()); - break; - } - } - assertTrue(found); - - } - - @Test - public void testUpdate() { - ErrorTrace error = errorTraceRepository.get("85ed95b2-8436-4a93-9ae7-ab104d65edd7"); - error.setStatus("closed"); - Date now = new Date(); - error.setDateClosed(now); - error.setRecordId("jjhi-iiui-234423-ll"); - errorTraceRepository.update(error); - - ErrorTrace updateError = errorTraceRepository.get("85ed95b2-8436-4a93-9ae7-ab104d65edd7"); - assertEquals("closed", updateError.getStatus()); - assertEquals(now, updateError.getDateClosed()); - assertEquals("jjhi-iiui-234423-ll", updateError.getRecordId()); - errorTraceRepository.update(error); - } - - @Test - public void testGetAll() { - assertEquals(8, errorTraceRepository.getAll().size()); - errorTraceRepository.safeRemove(errorTraceRepository.get("ea96c23d-bbf1-4365-bdf5-bcf56f08ce1f")); - assertEquals(7, errorTraceRepository.getAll().size()); - } - - @Test - public void testSafeRemove() { - errorTraceRepository.safeRemove(errorTraceRepository.get("911c7520-f701-419e-b225-5e21286b585b")); - List errors = errorTraceRepository.getAll(); - assertEquals(7, errors.size()); - for (ErrorTrace error : errors) - assertNotEquals("911c7520-f701-419e-b225-5e21286b585b", error.getId()); - } - - @Test - public void testFindById() { - ErrorTrace error = errorTraceRepository.get("07c32814-d7d1-48a5-8320-ed80435a4606"); - assertEquals(new DateTime("2018-01-03T17:06:11.166"), error.getDateOccurred()); - assertEquals("FormSubmissionProcessor", error.getErrorType()); - assertEquals("org.opensrp.service.formSubmission.FormSubmissionListener", error.getOccurredAt()); - assertEquals("[Ljava.lang.StackTraceElement;@50ef4583", error.getStackTrace()); - - assertNull(errorTraceRepository.get("07271855-4-b180-6af")); - } - - @Test - public void testExists() { - assertTrue(errorTraceRepository.exists("07c32814-d7d1-48a5-8320-ed80435a4606")); - - assertTrue(errorTraceRepository.exists("ea96c23d-bbf1-4365-bdf5-bcf56f08ce1f")); - - assertFalse(errorTraceRepository.exists("07c32814-d7d1-48a5-8320-ed804356")); - } - - @Test - public void testFindAllErrors() { - assertEquals(8, errorTraceRepository.findAllErrors().size()); - errorTraceRepository.safeRemove(errorTraceRepository.get("ea96c23d-bbf1-4365-bdf5-bcf56f08ce1f")); - - List errors = errorTraceRepository.findAllErrors(); - assertEquals(7, errors.size()); - - for (ErrorTrace error : errors) - assertNotEquals("ea96c23d-bbf1-4365-bdf5-bcf56f08ce1f", error.getId()); - } - - @Test - public void testFindAllUnSolvedErrors() { - assertEquals(6, errorTraceRepository.findAllUnSolvedErrors().size()); - - ErrorTrace error = errorTraceRepository.get("911c7520-f701-419e-b225-5e21286b585b"); - error.setStatus(SOLVED); - error.setDateClosed(new Date()); - errorTraceRepository.update(error); - - List errors = errorTraceRepository.findAllUnSolvedErrors(); - assertEquals(5, errors.size()); - - for (ErrorTrace err : errors) - assertTrue(err.getStatus() == null || err.getStatus().equals(UNSOLVED)); - } - - @Test - public void testFindAllSolvedErrors() { - List errors = errorTraceRepository.findAllSolvedErrors(); - assertEquals(2, errors.size()); - for (ErrorTrace err : errors) - assertTrue(err.getStatus().equals(SOLVED)); - - ErrorTrace error = errorTraceRepository.get("48106c03-8900-4156-a7bf-93226e1d3e58"); - error.setStatus(UNSOLVED); - error.setDateClosed(null); - errorTraceRepository.update(error); - - errors = errorTraceRepository.findAllSolvedErrors(); - assertEquals(1, errors.size()); - assertEquals(new DateTime("2018-01-03T17:06:11.166"), errors.get(0).getDateOccurred()); - assertEquals("FormSubmissionProcessor", errors.get(0).getErrorType()); - assertEquals("org.opensrp.service.formSubmission.FormSubmissionListener", errors.get(0).getOccurredAt()); - assertEquals("[Ljava.lang.StackTraceElement;@50ef4583", errors.get(0).getStackTrace()); - - } + + @Autowired + @Qualifier("errorRepositoryPostgres") + private ErrorTraceRepository errorTraceRepository; + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("error.sql"); + return scripts; + } + + @Test + public void testGet() { + ErrorTrace error = errorTraceRepository.get("85ed95b2-8436-4a93-9ae7-ab104d65edd7"); + assertEquals(new DateTime("2018-03-14T07:53:11.152"), error.getDateOccurred()); + assertEquals("OPENMRS FAILED CLIENT PUSH", error.getErrorType()); + assertEquals("org.opensrp.domain.Client", error.getDocumentType()); + assertNull(errorTraceRepository.get("07271855-4018-497a-b180-6af")); + } + + @Test + public void testAdd() { + DateTime occured = new DateTime(); + ErrorTrace error = new ErrorTrace(occured, "GENERIC ERROR 123!!", occured.toString(), + "error at stocktrace.java(677)", "unsolved", "org.test.bean"); + errorTraceRepository.add(error); + List errors = errorTraceRepository.getAll(); + assertEquals(9, errors.size()); + boolean found = false; + for (ErrorTrace er : errors) { + if (er.getDateOccurred().equals(occured)) { + found = true; + assertEquals("GENERIC ERROR 123!!", error.getErrorType()); + assertEquals("error at stocktrace.java(677)", error.getStackTrace()); + break; + } + } + assertTrue(found); + + } + + @Test + public void testUpdate() { + ErrorTrace error = errorTraceRepository.get("85ed95b2-8436-4a93-9ae7-ab104d65edd7"); + error.setStatus("closed"); + Date now = new Date(); + error.setDateClosed(now); + error.setRecordId("jjhi-iiui-234423-ll"); + errorTraceRepository.update(error); + + ErrorTrace updateError = errorTraceRepository.get("85ed95b2-8436-4a93-9ae7-ab104d65edd7"); + assertEquals("closed", updateError.getStatus()); + assertEquals(now, updateError.getDateClosed()); + assertEquals("jjhi-iiui-234423-ll", updateError.getRecordId()); + errorTraceRepository.update(error); + } + + @Test + public void testGetAll() { + assertEquals(8, errorTraceRepository.getAll().size()); + errorTraceRepository.safeRemove(errorTraceRepository.get("ea96c23d-bbf1-4365-bdf5-bcf56f08ce1f")); + assertEquals(7, errorTraceRepository.getAll().size()); + } + + @Test + public void testSafeRemove() { + errorTraceRepository.safeRemove(errorTraceRepository.get("911c7520-f701-419e-b225-5e21286b585b")); + List errors = errorTraceRepository.getAll(); + assertEquals(7, errors.size()); + for (ErrorTrace error : errors) + assertNotEquals("911c7520-f701-419e-b225-5e21286b585b", error.getId()); + } + + @Test + public void testFindById() { + ErrorTrace error = errorTraceRepository.get("07c32814-d7d1-48a5-8320-ed80435a4606"); + assertEquals(new DateTime("2018-01-03T17:06:11.166"), error.getDateOccurred()); + assertEquals("FormSubmissionProcessor", error.getErrorType()); + assertEquals("org.opensrp.service.formSubmission.FormSubmissionListener", error.getOccurredAt()); + assertEquals("[Ljava.lang.StackTraceElement;@50ef4583", error.getStackTrace()); + + assertNull(errorTraceRepository.get("07271855-4-b180-6af")); + } + + @Test + public void testExists() { + assertTrue(errorTraceRepository.exists("07c32814-d7d1-48a5-8320-ed80435a4606")); + + assertTrue(errorTraceRepository.exists("ea96c23d-bbf1-4365-bdf5-bcf56f08ce1f")); + + assertFalse(errorTraceRepository.exists("07c32814-d7d1-48a5-8320-ed804356")); + } + + @Test + public void testFindAllErrors() { + assertEquals(8, errorTraceRepository.findAllErrors().size()); + errorTraceRepository.safeRemove(errorTraceRepository.get("ea96c23d-bbf1-4365-bdf5-bcf56f08ce1f")); + + List errors = errorTraceRepository.findAllErrors(); + assertEquals(7, errors.size()); + + for (ErrorTrace error : errors) + assertNotEquals("ea96c23d-bbf1-4365-bdf5-bcf56f08ce1f", error.getId()); + } + + @Test + public void testFindAllUnSolvedErrors() { + assertEquals(6, errorTraceRepository.findAllUnSolvedErrors().size()); + + ErrorTrace error = errorTraceRepository.get("911c7520-f701-419e-b225-5e21286b585b"); + error.setStatus(SOLVED); + error.setDateClosed(new Date()); + errorTraceRepository.update(error); + + List errors = errorTraceRepository.findAllUnSolvedErrors(); + assertEquals(5, errors.size()); + + for (ErrorTrace err : errors) + assertTrue(err.getStatus() == null || err.getStatus().equals(UNSOLVED)); + } + + @Test + public void testFindAllSolvedErrors() { + List errors = errorTraceRepository.findAllSolvedErrors(); + assertEquals(2, errors.size()); + for (ErrorTrace err : errors) + assertTrue(err.getStatus().equals(SOLVED)); + + ErrorTrace error = errorTraceRepository.get("48106c03-8900-4156-a7bf-93226e1d3e58"); + error.setStatus(UNSOLVED); + error.setDateClosed(null); + errorTraceRepository.update(error); + + errors = errorTraceRepository.findAllSolvedErrors(); + assertEquals(1, errors.size()); + assertEquals(new DateTime("2018-01-03T17:06:11.166"), errors.get(0).getDateOccurred()); + assertEquals("FormSubmissionProcessor", errors.get(0).getErrorType()); + assertEquals("org.opensrp.service.formSubmission.FormSubmissionListener", errors.get(0).getOccurredAt()); + assertEquals("[Ljava.lang.StackTraceElement;@50ef4583", errors.get(0).getStackTrace()); + + } } diff --git a/src/test/java/org/opensrp/repository/postgres/EventsRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/EventsRepositoryTest.java index 8e29936dc..8576a0dac 100644 --- a/src/test/java/org/opensrp/repository/postgres/EventsRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/EventsRepositoryTest.java @@ -31,749 +31,749 @@ import org.springframework.beans.factory.annotation.Qualifier; public class EventsRepositoryTest extends BaseRepositoryTest { - - @Autowired - @Qualifier("eventsRepositoryPostgres") - private EventsRepository eventsRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("event.sql"); - return scripts; - } - - @Test - public void testGet() { - Event event = eventsRepository.get("05934ae338431f28bf6793b2419c319a"); - assertEquals("ea1f9439-a663-4073-93b9-6ef2b8bca3c1", event.getBaseEntityId()); - assertEquals("d960046a-e2a0-4bbf-b687-d41c2a52d8c8", event.getFormSubmissionId()); - assertEquals("Vaccination", event.getEventType()); - //find non existent event - assertNull(eventsRepository.get("05934ae338431f28bf4234gvnbvvh")); - assertNull(eventsRepository.get(null)); - - //test results with deleted event - eventsRepository.safeRemove(event); - assertNull(eventsRepository.get(event.getId())); - } - - @Test - public void testGetAll() { - List events = eventsRepository.getAll(); - assertEquals(21, events.size()); - - //test with deleted event - Event event = eventsRepository.findById("05934ae338431f28bf6793b2419c319a"); - eventsRepository.safeRemove(event); - events = eventsRepository.getAll(); - assertEquals(20, events.size()); - for (Event e : events) - assertNotEquals("05934ae338431f28bf6793b2419c319a", e.getId()); - - } - - @Test - public void testFindAllByIdentifier() { - assertTrue(eventsRepository.findAllByIdentifier(null).isEmpty()); - List events = eventsRepository.findAllByIdentifier("06c8644b-b560-45fd-9af5-b6b1484e3504"); - assertEquals(1, events.size()); - assertEquals("d59504cc-09ef-4d09-9dc3-8f7eb65882fd", events.get(0).getFormSubmissionId()); - assertEquals("05934ae338431f28bf6793b241bdb88c", events.get(0).getId()); - - //test with deleted event - eventsRepository.safeRemove(events.get(0)); - assertTrue(eventsRepository.findAllByIdentifier("06c8644b-b560-45fd-9af5-b6b1484e3504").isEmpty()); - } - - @Test - public void testFindAllByIdentifierAndType() { - assertTrue(eventsRepository.findAllByIdentifier(null, null).isEmpty()); - List events = eventsRepository.findAllByIdentifier("OPENMRS_UUID", "06c8644b-b560-45fd-9af5-b6b1484e3504"); - assertEquals(1, events.size()); - assertEquals("d59504cc-09ef-4d09-9dc3-8f7eb65882fd", events.get(0).getFormSubmissionId()); - assertEquals("05934ae338431f28bf6793b241bdb88c", events.get(0).getId()); - - assertTrue(eventsRepository.findAllByIdentifier("OPENMRS", "06c8644b-b560-45fd-9af5-b6b1484e3504").isEmpty()); - - //test with deleted event - eventsRepository.safeRemove(events.get(0)); - assertTrue(eventsRepository.findAllByIdentifier("OPENMRS_UUID", "06c8644b-b560-45fd-9af5-b6b1484e3504").isEmpty()); - } - - @Test - public void testFindById() { - Event event = eventsRepository.findById("05934ae338431f28bf6793b2419c319a"); - assertEquals("ea1f9439-a663-4073-93b9-6ef2b8bca3c1", event.getBaseEntityId()); - assertEquals("d960046a-e2a0-4bbf-b687-d41c2a52d8c8", event.getFormSubmissionId()); - assertEquals("Vaccination", event.getEventType()); - //find non existent event - assertNull(eventsRepository.findById("05934ae338431f28bf4234gvnbvvh")); - assertNull(eventsRepository.findById(null)); - - //test with deleted event - eventsRepository.safeRemove(event); - assertNull(eventsRepository.findById("05934ae338431f28bf6793b2419c319a")); - } - - @Test - public void testFindByFormSubmissionId() { - Event event = eventsRepository.findByFormSubmissionId("31c4a45a-09f4-4b01-abe8-a87526827df6",false); - assertEquals("ea1f9439-a663-4073-93b9-6ef2b8bca3c1", event.getBaseEntityId()); - assertEquals("05934ae338431f28bf6793b241781149", event.getId()); - assertEquals("Growth Monitoring", event.getEventType()); - //find non existent event - assertNull(eventsRepository.findByFormSubmissionId("05934ae338431f28bf4234gvnbvvh",false)); - assertNull(eventsRepository.findByFormSubmissionId(null,false)); - - //test with deleted event - eventsRepository.safeRemove(event); - assertNull(eventsRepository.findByFormSubmissionId("31c4a45a-09f4-4b01-abe8-a87526827df6",false)); - } - - @Test - public void testFindByBaseEntityId() { - List events = eventsRepository.findByBaseEntityId("58b33379-dab2-4f5c-8f09-6d2bd63023d8"); - assertEquals(8, events.size()); - - events = eventsRepository.findByBaseEntityId("43930c23-c787-4ddb-ab76-770f77e7b17d"); - assertEquals(1, events.size()); - assertEquals("6b3243e9-3d45-495c-af69-f012061def01", events.get(0).getFormSubmissionId()); - assertEquals("05934ae338431f28bf6793b24199e690", events.get(0).getId()); - assertEquals("New Woman Registration", events.get(0).getEventType()); - //non-existent records - assertTrue(eventsRepository.findByBaseEntityId("05934ae338431f28bf4234gvnbvvh").isEmpty()); - - //test with deleted event - eventsRepository.safeRemove(events.get(0)); - assertTrue(eventsRepository.findByBaseEntityId("43930c23-c787-4ddb-ab76-770f77e7b17d").isEmpty()); - } - - @Test - public void testFindByBaseEntityAndFormSubmissionId() { - Event event = eventsRepository.findByBaseEntityAndFormSubmissionId("58b33379-dab2-4f5c-8f09-6d2bd63023d8", - "baf8e663-71a1-4a30-8d40-2f3cab45a6d7"); - assertEquals("05934ae338431f28bf6793b241bdbb60", event.getId()); - - event = eventsRepository.findByBaseEntityAndFormSubmissionId("43930c23-c787-4ddb-ab76-770f77e7b17d", - "6b3243e9-3d45-495c-af69-f012061def01"); - assertEquals(3, event.getObs().size()); - assertEquals("05934ae338431f28bf6793b24199e690", event.getId()); - assertEquals("New Woman Registration", event.getEventType()); - //non-existent records - assertNull(eventsRepository.findByBaseEntityAndFormSubmissionId("58b33379-dab2-4f5c-8f09-6d2bd63023d8", "34354")); - - //test with deleted event - eventsRepository.safeRemove(event); - assertNull(eventsRepository.findByBaseEntityAndFormSubmissionId("43930c23-c787-4ddb-ab76-770f77e7b17d", - "6b3243e9-3d45-495c-af69-f012061def01")); - } - - @Test - public void testFindByBaseEntityAndType() { - List events = eventsRepository.findByBaseEntityAndType("58b33379-dab2-4f5c-8f09-6d2bd63023d8", "Vaccination"); - assertEquals(6, events.size()); - - events = eventsRepository.findByBaseEntityAndType("58b33379-dab2-4f5c-8f09-6d2bd63023d8", "Birth Registration"); - assertEquals(1, events.size()); - assertEquals("d59504cc-09ef-4d09-9dc3-8f7eb65882fd", events.get(0).getFormSubmissionId()); - assertEquals("05934ae338431f28bf6793b241bdb88c", events.get(0).getId()); - assertEquals(1521183592609l, events.get(0).getServerVersion().longValue()); - //non-existent records - assertTrue(eventsRepository.findByBaseEntityAndType("58b33379-dab2-4f5c-8f09-6d2bd63023d8", "Growth Monitoring") - .isEmpty()); - assertTrue(eventsRepository.findByBaseEntityAndType("58b33379", "Vaccination").isEmpty()); - - //test with deleted event - eventsRepository.safeRemove(events.get(0)); - assertTrue(eventsRepository.findByBaseEntityAndType("58b33379-dab2-4f5c-8f09-6d2bd63023d8", "Birth Registration") - .isEmpty()); - } - - @Test - public void testFindEvents() { - - EventSearchBean eventSearchBean = new EventSearchBean(); - eventSearchBean.setBaseEntityId("58b33379-dab2-4f5c-8f09-6d2bd63023d8"); - List events = eventsRepository.findEvents(eventSearchBean); - assertEquals(8, events.size()); - - DateTime from = new DateTime("2018-01-10T11:59:37.380"); - DateTime to = new DateTime("2018-02-21T12:00:08.788"); - - eventSearchBean.setEventDateFrom(from); - eventSearchBean.setEventDateTo(to); - events = eventsRepository.findEvents(eventSearchBean); - assertEquals(6, events.size()); - - eventSearchBean.setEventType("Vaccination"); - events = eventsRepository.findEvents(eventSearchBean); - assertEquals(6, events.size()); - - eventSearchBean.setEntityType("vaccination"); - events = eventsRepository.findEvents(eventSearchBean); - assertEquals(6, events.size()); - - eventSearchBean.setProviderId("biddemo"); - eventSearchBean.setLocationId("42abc582-6658-488b-922e-7be500c070f3"); - events = eventsRepository.findEvents(eventSearchBean); - assertEquals(6, events.size()); - - eventSearchBean.setTeam("ATeam"); - eventSearchBean.setTeamId("3453hgb454-4j345n-llk345"); - events = eventsRepository.findEvents(eventSearchBean); - assertEquals(2, events.size()); - for (Event event : events) { - assertEquals("3453hgb454-4j345n-llk345", event.getTeamId()); - assertEquals("ATeam", event.getTeam()); - assertEquals("42abc582-6658-488b-922e-7be500c070f3", event.getLocationId()); - assertEquals("biddemo", event.getProviderId()); - assertEquals("vaccination", event.getEntityType()); - assertEquals("Vaccination", event.getEventType()); - assertEquals("58b33379-dab2-4f5c-8f09-6d2bd63023d8", event.getBaseEntityId()); - assertTrue(event.getEventDate().isEqual(from) || event.getEventDate().isAfter(from)); - assertTrue(event.getEventDate().isEqual(to) || event.getEventDate().isBefore(to)); - } - - eventSearchBean.setLastEditFrom(new DateTime()); - eventSearchBean.setLastEditTo(new DateTime()); - events = eventsRepository.findEvents(eventSearchBean); - assertTrue(events.isEmpty()); - - DateTime editFrom = new DateTime("2018-03-16T10:03:01.537+03:00"); - DateTime editTo = new DateTime("2018-03-19T17:17:15.929+03:00"); - eventSearchBean.setLastEditFrom(editFrom); - eventSearchBean.setLastEditTo(editTo); - events = eventsRepository.findEvents(eventSearchBean); - assertEquals(2, events.size()); - for (Event event : events) { - assertTrue(event.getDateEdited().equals(editFrom) || event.getDateEdited().isAfter(editFrom)); - assertTrue(event.getDateEdited().equals(editTo) || event.getDateEdited().isBefore(editTo)); - } - - //test with deleted event - for (Event event : events) - eventsRepository.safeRemove(event); - assertTrue(eventsRepository.findEvents(eventSearchBean).isEmpty()); - } - - @Test(expected = IllegalArgumentException.class) - public void testFindEventsByDynamicQuery() { - eventsRepository.findEventsByDynamicQuery("baseEntityId:4234324"); - } - - @Test - public void testFindByServerVersion() { - assertEquals(22, eventsRepository.findByServerVersion(0).size()); - - //missing data - assertTrue(eventsRepository.findByServerVersion(1578908926000l).isEmpty()); - - List events = eventsRepository.findByServerVersion(1521469045587l); - assertEquals(10, events.size()); - List expectedIds = Arrays.asList("05934ae338431f28bf6793b241780bac", "05934ae338431f28bf6793b241781149", - "05934ae338431f28bf6793b241781a1e", "05934ae338431f28bf6793b241781149", "34166bde-2d40-4cb9-aec7-d8e4feb47c53", - "66c1ffdc-697c-4d31-b50d-6396ccb6368c", "f9db43e1-1b15-4d26-ba56-29136edb73d6", - "18a43e36-5701-4afc-b901-8eb4ce0e2002", "d945f800-eeca-415e-b737-e5611e19f706","cfcc0e7e3cef11eab77f2e728ce88125", - "81228b7f-b336-440e-9428-ebfba225ad17"); - for (Event event : events) { - assertTrue(event.getServerVersion() >= 1521469045587l); - assertTrue(expectedIds.contains(event.getId())); - } - - //test with deleted event - for (Event event : events) - eventsRepository.safeRemove(event); - assertFalse(eventsRepository.findByServerVersion(1521469045587l).isEmpty()); - } - - @Test - public void testNotInOpenMRSByServerVersion() { - Calendar cal = Calendar.getInstance(); - assertEquals(13, eventsRepository.notInOpenMRSByServerVersion(0, cal).size()); - - cal.setTimeInMillis(1521469045589l); - - //test missing data - assertTrue(eventsRepository.notInOpenMRSByServerVersion(1521469045597l, cal).isEmpty()); - - List events = eventsRepository.notInOpenMRSByServerVersion(1521469045588l, cal); - assertEquals(2, events.size()); - - List expectedIds = Arrays.asList("05934ae338431f28bf6793b241780bac", "05934ae338431f28bf6793b241781149"); - for (Event event : events) { - assertTrue(event.getServerVersion() >= 1521469045588l && event.getServerVersion() <= cal.getTimeInMillis()); - assertTrue(expectedIds.contains(event.getId())); - } - - //test with deleted event - for (Event event : events) - eventsRepository.safeRemove(event); - assertTrue(eventsRepository.notInOpenMRSByServerVersion(1521469045588l, cal).isEmpty()); - - } - - @Test - public void testNotInOpenMRSByServerVersionAndType() { - Calendar cal = Calendar.getInstance(); - assertEquals(4, eventsRepository.notInOpenMRSByServerVersionAndType("Growth Monitoring", 0, cal).size()); - //missing data - assertTrue(eventsRepository.notInOpenMRSByServerVersion(1578908926000l, cal).isEmpty()); - cal.setTimeInMillis(1521469045589l); - List events = eventsRepository.notInOpenMRSByServerVersionAndType("Growth Monitoring", 1521469045588l, cal); - List expectedIds = Arrays.asList("05934ae338431f28bf6793b241780bac", "05934ae338431f28bf6793b241781149"); - assertEquals(2, events.size()); - for (Event event : events) { - assertTrue(event.getServerVersion() >= 1521469045588l && event.getServerVersion() <= cal.getTimeInMillis()); - assertTrue(expectedIds.contains(event.getId())); - assertEquals("Growth Monitoring", event.getEventType()); - } - - //test with deleted event - for (Event event : events) - eventsRepository.safeRemove(event); - assertTrue(eventsRepository.notInOpenMRSByServerVersionAndType("Growth Monitoring", 1521469045588l, cal).isEmpty()); - - } - - @Test - public void testFindByClientAndConceptAndDate() { - List events = eventsRepository.findByClientAndConceptAndDate("58b33379-dab2-4f5c-8f09-6d2bd63023d8", - "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "1", "2018-01-10", new DateTime().toString("yyyy-MM-dd")); - assertEquals(5, events.size()); - for (Event event : events) { - assertTrue(event.getEventDate().equals(new DateTime("2018-01-10")) - || event.getEventDate().isAfter(new DateTime("2018-01-10"))); - assertEquals("58b33379-dab2-4f5c-8f09-6d2bd63023d8", event.getBaseEntityId()); - assertEquals("1", events.get(0).getObs(null, "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValues().get(0)); - } - - events = eventsRepository.findByClientAndConceptAndDate("58b33379-dab2-4f5c-8f09-6d2bd63023d8", - "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "1", "2018-03-20", new DateTime().toString("yyyy-MM-dd")); - - assertTrue(events.isEmpty()); - - events = eventsRepository.findByClientAndConceptAndDate("58b33379-dab2-4f5c-8f09-6d2bd63023d8", - "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "2018-02-21", "2018-03-19", new DateTime().toString("yyyy-MM-dd")); - - assertEquals(4, events.size()); - - events = eventsRepository - .findByClientAndConceptAndDate("58b33379-dab2-4f5c-8f09-6d2bd63023d8", - "163531AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "Happy Kids Clinic", "2018-03-19", - new DateTime().toString("yyyy-MM-dd")); - - assertEquals(1, events.size()); - assertEquals("58b33379-dab2-4f5c-8f09-6d2bd63023d8", events.get(0).getBaseEntityId()); - assertEquals("05934ae338431f28bf6793b241bdb88c", events.get(0).getId()); - assertEquals("Happy Kids Clinic", events.get(0).getObs(null, "163531AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValues() - .get(0)); - assertTrue(events.get(0).getDateCreated().equals(new DateTime("2018-03-19")) - || events.get(0).getDateCreated().isAfter(new DateTime("2018-03-19"))); - - //test with deleted event - eventsRepository.safeRemove(events.get(0)); - assertTrue(eventsRepository - .findByClientAndConceptAndDate("58b33379-dab2-4f5c-8f09-6d2bd63023d8", - "163531AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "Happy Kids Clinic", "2018-03-19", - new DateTime().toString("yyyy-MM-dd")).isEmpty()); - - } - - @Test - public void testFindByBaseEntityIdAndConceptParentCode() { - //missing data - List events = eventsRepository.findByBaseEntityIdAndConceptParentCode("58b33379-dab2-4f5c-8f09-6d2bd63023d8", - "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); - - assertTrue(events.isEmpty()); - - events = eventsRepository.findByBaseEntityIdAndConceptParentCode("58b33379-dab2-4f5c-8f09-6d2bd63023d8", - "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); - assertEquals(2, events.size()); - - events = eventsRepository.findByBaseEntityIdAndConceptParentCode("58b33379-dab2-4f5c-8f09-6d2bd63023d8", - "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); - - assertEquals(1, events.size()); - assertEquals("05934ae338431f28bf6793b241bdbc55", events.get(0).getId()); - boolean found = false; - for (Obs obs : events.get(0).getObs()) { - if (obs.getParentCode().equals("886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") - && obs.getFieldCode().equals("1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")) { - found = true; - break; - } - } - assertTrue(found); - - //test with deleted event - eventsRepository.safeRemove(events.get(0)); - assertTrue(eventsRepository.findByBaseEntityIdAndConceptParentCode("58b33379-dab2-4f5c-8f09-6d2bd63023d8", - "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").isEmpty()); - - } - - @Test - public void testFindByConceptAndValue() { - List events = eventsRepository.findByConceptAndValue("1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "1"); - assertEquals(8, events.size()); - - events = eventsRepository.findByConceptAndValue("1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "5"); - - assertTrue(events.isEmpty()); - - events = eventsRepository.findByConceptAndValue("1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "2018-02-21"); - - assertEquals(4, events.size()); - for (Event event : events) { - assertEquals("2018-02-21", event.getObs(null, "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValues().get(0)); - } - - events = eventsRepository.findByConceptAndValue("163531AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "Happy Kids Clinic"); - - assertEquals(1, events.size()); - assertEquals("58b33379-dab2-4f5c-8f09-6d2bd63023d8", events.get(0).getBaseEntityId()); - assertEquals("05934ae338431f28bf6793b241bdb88c", events.get(0).getId()); - - //test with deleted event - eventsRepository.safeRemove(events.get(0)); - assertTrue(eventsRepository.findByConceptAndValue("163531AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "Happy Kids Clinic") - .isEmpty()); - - } - - @Test - public void testFindEvents2() { - EventSearchBean eventSearchBean = new EventSearchBean(); - eventSearchBean.setTeam("ATeam"); - eventSearchBean.setTeamId("3453hgb454-4j345n-llk345"); - List events = eventsRepository.findEvents(eventSearchBean, null, null, 20); - assertEquals(2, events.size()); - - eventSearchBean = new EventSearchBean(); - eventSearchBean.setTeam("ATeam,BTeam"); - events = eventsRepository.findEvents(eventSearchBean, null, null, 20); - assertEquals(3, events.size()); - - eventSearchBean = new EventSearchBean(); - eventSearchBean.setProviderId("biddemo,biddemo2"); - eventSearchBean.setLocationId("42b88545-7ebb-4e11-8d1a-3d3a924c8af4,42b88545-7ebb-4e11-8d1a-3d3a924c8af5"); - events = eventsRepository.findEvents(eventSearchBean, null, null, 20); - assertEquals(7, events.size()); - - eventSearchBean.setBaseEntityId("58b33379-dab2-4f5c-8f09-6d2bd63023d8"); - events = eventsRepository.findEvents(eventSearchBean, null, null, 20); - assertEquals(0, events.size()); - - eventSearchBean.setLocationId("42abc582-6658-488b-922e-7be500c070f3"); - events = eventsRepository.findEvents(eventSearchBean, null, null, 20); - assertEquals(7, events.size()); - - eventSearchBean.setEventType("Birth Registration"); - events = eventsRepository.findEvents(eventSearchBean, null, null, 20); - assertEquals(1, events.size()); - assertEquals("Birth Registration", events.get(0).getEventType()); - assertEquals("05934ae338431f28bf6793b241bdb88c", events.get(0).getId()); - - eventSearchBean = new EventSearchBean(); - eventSearchBean.setTeam("ATeam,BTeam"); - eventSearchBean.setTeamId("3453hgb454-4j345n-llk345,3453hgb454-4j345n-llk348"); - eventSearchBean.setProviderId("biddemo"); - eventSearchBean.setServerVersion(0l); - events = eventsRepository.findEvents(eventSearchBean, BaseEntity.SERVER_VERSIOIN, "asc", 20); - assertEquals(3, events.size()); - - long previousVersion = 0; - for (Event event : events) { - assertTrue(event.getTeam().equals("ATeam") || event.getTeam().equals("BTeam")); - assertTrue(event.getTeamId().equals("3453hgb454-4j345n-llk345") - || event.getTeamId().equals("3453hgb454-4j345n-llk348")); - assertEquals("42abc582-6658-488b-922e-7be500c070f3", event.getLocationId()); - assertEquals("biddemo", event.getProviderId()); - assertTrue(event.getServerVersion() >= previousVersion); - previousVersion = event.getServerVersion(); - } - - //test with deleted event - for (Event event : events) - eventsRepository.safeRemove(event); - assertTrue(eventsRepository.findEvents(eventSearchBean, BaseEntity.SERVER_VERSIOIN, "asc", 20).isEmpty()); - } - - @Test - public void testUpdate() { - Event event = eventsRepository.get("05934ae338431f28bf6793b2419c64fb"); - long now = System.currentTimeMillis(); - event.setDateEdited(new DateTime(now)); - Obs obs = new Obs("concept", "text", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "25-Apr-2017", null, - "Date_Reaction"); - event.addObs(obs); - event.setServerVersion(1); - long serverVersion=event.getServerVersion(); - eventsRepository.update(event); - - Event updatedEvent = eventsRepository.get("05934ae338431f28bf6793b2419c64fb"); - assertNotEquals(now, updatedEvent.getServerVersion().longValue()); - assertEquals(now, updatedEvent.getDateEdited().getMillis()); - assertEquals(3, updatedEvent.getObs().size()); - assertEquals(obs.getValue(), updatedEvent.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); - MatcherAssert.assertThat(updatedEvent.getServerVersion(), Matchers.greaterThan(serverVersion)); - - //test update with voided date deletes event - event.setDateVoided(new DateTime()); - eventsRepository.update(event); - assertNull(eventsRepository.get(event.getId())); - } - - @Test - public void testFindByEmptyServerVersion() { - assertEquals(0, eventsRepository.findByEmptyServerVersion().size()); - Event event = eventsRepository.get("05934ae338431f28bf6793b241bdb88c"); - event.setServerVersion(0l); - eventsRepository.update(event); - - event = eventsRepository.get("05934ae338431f28bf6793b241bdbb60"); - event.setServerVersion(0l); - eventsRepository.update(event); - long beforeFetch = System.currentTimeMillis(); - List events = eventsRepository.findByEmptyServerVersion(); - assertEquals(0, events.size()); - for (Event loopEvent : events) { - assertTrue(loopEvent.getId().equals("05934ae338431f28bf6793b241bdb88c") - || loopEvent.getId().equals("05934ae338431f28bf6793b241bdbb60")); - //if serverVersion is null will automatically be set to current timestamp in org.opensrp.domain.BaseDataObject.serverVersion - assertTrue(loopEvent.getServerVersion() == 0 || loopEvent.getServerVersion() >= beforeFetch); - - } - - //test with deleted event - for (Event e : events) - eventsRepository.safeRemove(e); - assertTrue(eventsRepository.findByEmptyServerVersion().isEmpty()); - } - - @Test - public void testFindEventByEventTypeBetweenTwoDates() { - List events = eventsRepository.getAll(); - Calendar cal = Calendar.getInstance(); - cal.set(Calendar.DATE, 1); - for (Event event : events) { - if(event.getEventType().equalsIgnoreCase("Recurring Service")) continue; //Skip this event type - event.setDateCreated(new DateTime(cal.getTimeInMillis())); - eventsRepository.update(event); - } - assertEquals(9, eventsRepository.findEventByEventTypeBetweenTwoDates("Vaccination").size()); - assertEquals(4, eventsRepository.findEventByEventTypeBetweenTwoDates("Growth Monitoring").size()); - events = eventsRepository.findEventByEventTypeBetweenTwoDates("Birth Registration"); - assertEquals(1, events.size()); - assertEquals("58b33379-dab2-4f5c-8f09-6d2bd63023d8", events.get(0).getBaseEntityId()); - assertEquals("05934ae338431f28bf6793b241bdb88c", events.get(0).getId()); - - //test with deleted event - eventsRepository.safeRemove(events.get(0)); - assertTrue(eventsRepository.findEventByEventTypeBetweenTwoDates("Birth Registration").isEmpty()); - } - - @Test - public void testSafeRemove() { - Event event = eventsRepository.get("05934ae338431f28bf6793b241bdb88c"); - eventsRepository.safeRemove(event); - List events = eventsRepository.getAll(); - assertEquals(20, events.size()); - for (Event e : events) - assertNotEquals("05934ae338431f28bf6793b241bdb88c", e.getId()); - assertNull(eventsRepository.get("05934ae338431f28bf6793b241bdb88c")); - } - - @Test - public void testAdd() { - Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); - Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring") - .withFormSubmissionId("gjhg34534 nvbnv3345345__4").withEventDate(new DateTime()).withObs(obs); - - eventsRepository.add(event); - - event = eventsRepository.findByFormSubmissionId("gjhg34534 nvbnv3345345__4",false); - assertEquals("435534534543", event.getBaseEntityId()); - assertEquals("Growth Monitoring", event.getEventType()); - assertEquals(1, event.getObs().size()); - assertEquals("3.5", event.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); - MatcherAssert.assertThat(event.getServerVersion(), Matchers.greaterThan(5l)); - - //test if an event with voided date add event as deleted - event = new Event().withBaseEntityId("2423nj-sdfsd-sf2dfsd-2399d").withEventType("Vaccination") - .withFormSubmissionId("hshj2342_jsjs-jhjsdfds-23").withEventDate(new DateTime()).withObs(obs); - event.setDateVoided(new DateTime()); - eventsRepository.add(event); - assertNull(eventsRepository.findByFormSubmissionId(event.getFormSubmissionId(),false)); - - - } - - @Test - public void testFindByProvider() { - List events = eventsRepository.findByProvider("biddemo"); - assertEquals(13, events.size()); - events = eventsRepository.findByProvider("biddemo2"); - assertEquals(2, events.size()); - for (Event event : events) { - assertEquals("biddemo2", event.getProviderId()); - assertTrue(event.getId().equals("05934ae338431f28bf6793b241781149") - || event.getId().equals("05934ae338431f28bf6793b241781a1e")); - } - assertTrue(eventsRepository.findByProvider("biddemo9").isEmpty()); - } - - @Test - public void testCountEvents() { - - EventSearchBean eventSearchBean = new EventSearchBean(); - eventSearchBean.setBaseEntityId("58b33379-dab2-4f5c-8f09-6d2bd63023d8"); - Long events = eventsRepository.countEvents(eventSearchBean); - assertEquals(8, events.longValue()); - - eventSearchBean.setEventType("Vaccination"); - events = eventsRepository.countEvents(eventSearchBean); - assertEquals(6, events.longValue()); - - eventSearchBean.setProviderId("biddemo"); - eventSearchBean.setLocationId("42abc582-6658-488b-922e-7be500c070f3"); - events = eventsRepository.countEvents(eventSearchBean); - assertEquals(6, events.longValue()); - - eventSearchBean.setTeam("ATeam"); - eventSearchBean.setTeamId("3453hgb454-4j345n-llk345"); - events = eventsRepository.countEvents(eventSearchBean); - assertEquals(2, events.longValue()); - - DateTime editFrom = new DateTime("2018-03-16T10:03:01.537+03:00"); - DateTime editTo = new DateTime("2018-03-19T17:17:15.929+03:00"); - eventSearchBean.setLastEditFrom(editFrom); - eventSearchBean.setLastEditTo(editTo); - events = eventsRepository.countEvents(eventSearchBean); - assertEquals(2, events.longValue()); - - //test with deleted event - List eventObjects = eventsRepository.findEvents(eventSearchBean); - for (Event event : eventObjects) - eventsRepository.safeRemove(event); - assertEquals(0, eventsRepository.countEvents(eventSearchBean).longValue()); - } - - @Test - public void testFindEventsByEntityIdAndPlan() { - Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); - Event event = new Event().withBaseEntityId("4355345345431").withEventType("GrowthMonitoring"). - withFormSubmissionId("gjhg34534nvbnv33453450").withEventDate(new DateTime()).withObs(obs) - .withLocationId("test-location-id").withChildLocationId("test-child-location-id"); - event.setTeam("team"); - event.setTeamId("team-id"); - event.setProviderId("provider-id"); - event.setServerVersion(12345678l); - - Map details = new HashMap<>(); - details.put("planIdentifier", "plan-id-12345"); - event.setDetails(details); - eventsRepository.add(event); - List questionnaireResponses = eventsRepository.findEventsByEntityIdAndPlan("4355345345431","plan-id-12345"); - assertEquals(1,questionnaireResponses.size()); - assertEquals(event.getFormSubmissionId(),questionnaireResponses.get(0).getId()); - } - - @Test - public void testFindIdsByEventTypeShouldFilterBetweenFromDateToDate(){ - String date1 = "2018-03-19T17:27:29"; - String date2 = "2019-11-14T17:39:37"; - - Pair, Long> listLongPair = eventsRepository.findIdsByEventType("",false,0L,10, - new DateTime(date1).toDate(), new DateTime(date2).toDate()); - assertEquals(10, listLongPair.getLeft().size()); - } - - @Test - public void testFindIdsByEventTypeShouldFilterFromDateAsMinimumDate(){ - String date1 = "2019-11-14T18:57:36"; - - Pair, Long> listLongPair = eventsRepository.findIdsByEventType("",false,0L,10, - new DateTime(date1).toDate(), null); - assertEquals(3, listLongPair.getLeft().size()); - } - - @Test - public void testFindIdsByEventTypeShouldFilterToDateAsMaximumDate(){ - String date1 = "2018-03-19T17:26:00"; - Pair, Long> listLongPair = eventsRepository.findIdsByEventType("",false,0L,10, - null, new DateTime(date1).toDate()); - assertTrue(listLongPair.getLeft().isEmpty()); - } - - @Test - public void testGetEventData(){ - eventsRepository.add(createFlagProblemEvent()); - List events = eventsRepository.getEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); - assertNotNull(events); - assertEquals(1, events.size()); - } - - public static Event createFlagProblemEvent() { - Event event = new Event(); - event.setBaseEntityId("ddcaf383-882e-448b-b701-8b72cb0d4d7a"); - event.setEventDate(new DateTime()); - event.setEventType("flag_problem"); - event.setEntityType("product"); - event.setFormSubmissionId("78a92332-a918-4fd7-bda5-128c4525f468"); - event.setLocationId("f3199af5-2eaf-46df-87c9-40d59606a2fb"); - List obs = new ArrayList<>(); - Obs obsObject = new Obs(); - obsObject.setFormSubmissionField("flag_problem"); - obs.add(obsObject); - obsObject = new Obs(); - obsObject.setFormSubmissionField("profile_picture"); - List values = new ArrayList<>(); - values.add(" \"\\/storage\\/emulated\\/0\\/Android\\/data\\/org.smartregister.eusm\\/files\\/Pictures\\/JPEG_20201202_181259_6894730935869368202.jpg\""); - obs.add(obsObject); - obsObject = new Obs(); - obsObject.setFormSubmissionField("profile_picture"); - values = new ArrayList<>(); - values.add(" \"\\/storage\\/emulated\\/0\\/Android\\/data\\/org.smartregister.eusm\\/files\\/Pictures\\/JPEG_20201202_181259_6894730935869368202.jpg\""); - obs.add(obsObject); - obsObject = new Obs(); - obsObject.setFormSubmissionField("not_good"); - values = new ArrayList<>(); - values.add("Expired"); - obs.add(obsObject); - event.setObs(obs); - Map details = new HashMap<>(); - details.put("locationName", "EPP Ambodisatrana 2"); - details.put("productName", "Midwifery Kit"); - details.put("planIdentifier", "335ef7a3-7f35-58aa-8263-4419464946d8"); - event.setDetails(details); - return event; - } - - @Test - public void testFindEventsByJurisdictionIdAndPlan() { - Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); - Event event = new Event().withBaseEntityId("4355345345431").withEventType("GrowthMonitoring"). - withFormSubmissionId("gjhg34534nvbnv33453450").withEventDate(new DateTime()).withObs(obs) - .withLocationId("test-location-id").withChildLocationId("test-child-location-id"); - event.setTeam("team"); - event.setTeamId("team-id"); - event.setProviderId("provider-id"); - event.setServerVersion(12345678l); - - Map details = new HashMap<>(); - details.put("planIdentifier", "plan-id-12345"); - event.setDetails(details); - eventsRepository.add(event); - List questionnaireResponses = eventsRepository.findEventsByJurisdictionIdAndPlan("test-location-id","plan-id-12345"); - assertEquals(1,questionnaireResponses.size()); - assertEquals(event.getFormSubmissionId(),questionnaireResponses.get(0).getId()); - - assertTrue(eventsRepository.findEventsByJurisdictionIdAndPlan("test-location-id","plan-12345").isEmpty()); - - assertTrue(eventsRepository.findEventsByJurisdictionIdAndPlan("test-location-id1","plan-id-12345").isEmpty()); - } + + @Autowired + @Qualifier("eventsRepositoryPostgres") + private EventsRepository eventsRepository; + + public static Event createFlagProblemEvent() { + Event event = new Event(); + event.setBaseEntityId("ddcaf383-882e-448b-b701-8b72cb0d4d7a"); + event.setEventDate(new DateTime()); + event.setEventType("flag_problem"); + event.setEntityType("product"); + event.setFormSubmissionId("78a92332-a918-4fd7-bda5-128c4525f468"); + event.setLocationId("f3199af5-2eaf-46df-87c9-40d59606a2fb"); + List obs = new ArrayList<>(); + Obs obsObject = new Obs(); + obsObject.setFormSubmissionField("flag_problem"); + obs.add(obsObject); + obsObject = new Obs(); + obsObject.setFormSubmissionField("profile_picture"); + List values = new ArrayList<>(); + values.add(" \"\\/storage\\/emulated\\/0\\/Android\\/data\\/org.smartregister.eusm\\/files\\/Pictures\\/JPEG_20201202_181259_6894730935869368202.jpg\""); + obs.add(obsObject); + obsObject = new Obs(); + obsObject.setFormSubmissionField("profile_picture"); + values = new ArrayList<>(); + values.add(" \"\\/storage\\/emulated\\/0\\/Android\\/data\\/org.smartregister.eusm\\/files\\/Pictures\\/JPEG_20201202_181259_6894730935869368202.jpg\""); + obs.add(obsObject); + obsObject = new Obs(); + obsObject.setFormSubmissionField("not_good"); + values = new ArrayList<>(); + values.add("Expired"); + obs.add(obsObject); + event.setObs(obs); + Map details = new HashMap<>(); + details.put("locationName", "EPP Ambodisatrana 2"); + details.put("productName", "Midwifery Kit"); + details.put("planIdentifier", "335ef7a3-7f35-58aa-8263-4419464946d8"); + event.setDetails(details); + return event; + } + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("event.sql"); + return scripts; + } + + @Test + public void testGet() { + Event event = eventsRepository.get("05934ae338431f28bf6793b2419c319a"); + assertEquals("ea1f9439-a663-4073-93b9-6ef2b8bca3c1", event.getBaseEntityId()); + assertEquals("d960046a-e2a0-4bbf-b687-d41c2a52d8c8", event.getFormSubmissionId()); + assertEquals("Vaccination", event.getEventType()); + //find non existent event + assertNull(eventsRepository.get("05934ae338431f28bf4234gvnbvvh")); + assertNull(eventsRepository.get(null)); + + //test results with deleted event + eventsRepository.safeRemove(event); + assertNull(eventsRepository.get(event.getId())); + } + + @Test + public void testGetAll() { + List events = eventsRepository.getAll(); + assertEquals(21, events.size()); + + //test with deleted event + Event event = eventsRepository.findById("05934ae338431f28bf6793b2419c319a"); + eventsRepository.safeRemove(event); + events = eventsRepository.getAll(); + assertEquals(20, events.size()); + for (Event e : events) + assertNotEquals("05934ae338431f28bf6793b2419c319a", e.getId()); + + } + + @Test + public void testFindAllByIdentifier() { + assertTrue(eventsRepository.findAllByIdentifier(null).isEmpty()); + List events = eventsRepository.findAllByIdentifier("06c8644b-b560-45fd-9af5-b6b1484e3504"); + assertEquals(1, events.size()); + assertEquals("d59504cc-09ef-4d09-9dc3-8f7eb65882fd", events.get(0).getFormSubmissionId()); + assertEquals("05934ae338431f28bf6793b241bdb88c", events.get(0).getId()); + + //test with deleted event + eventsRepository.safeRemove(events.get(0)); + assertTrue(eventsRepository.findAllByIdentifier("06c8644b-b560-45fd-9af5-b6b1484e3504").isEmpty()); + } + + @Test + public void testFindAllByIdentifierAndType() { + assertTrue(eventsRepository.findAllByIdentifier(null, null).isEmpty()); + List events = eventsRepository.findAllByIdentifier("OPENMRS_UUID", "06c8644b-b560-45fd-9af5-b6b1484e3504"); + assertEquals(1, events.size()); + assertEquals("d59504cc-09ef-4d09-9dc3-8f7eb65882fd", events.get(0).getFormSubmissionId()); + assertEquals("05934ae338431f28bf6793b241bdb88c", events.get(0).getId()); + + assertTrue(eventsRepository.findAllByIdentifier("OPENMRS", "06c8644b-b560-45fd-9af5-b6b1484e3504").isEmpty()); + + //test with deleted event + eventsRepository.safeRemove(events.get(0)); + assertTrue(eventsRepository.findAllByIdentifier("OPENMRS_UUID", "06c8644b-b560-45fd-9af5-b6b1484e3504").isEmpty()); + } + + @Test + public void testFindById() { + Event event = eventsRepository.findById("05934ae338431f28bf6793b2419c319a"); + assertEquals("ea1f9439-a663-4073-93b9-6ef2b8bca3c1", event.getBaseEntityId()); + assertEquals("d960046a-e2a0-4bbf-b687-d41c2a52d8c8", event.getFormSubmissionId()); + assertEquals("Vaccination", event.getEventType()); + //find non existent event + assertNull(eventsRepository.findById("05934ae338431f28bf4234gvnbvvh")); + assertNull(eventsRepository.findById(null)); + + //test with deleted event + eventsRepository.safeRemove(event); + assertNull(eventsRepository.findById("05934ae338431f28bf6793b2419c319a")); + } + + @Test + public void testFindByFormSubmissionId() { + Event event = eventsRepository.findByFormSubmissionId("31c4a45a-09f4-4b01-abe8-a87526827df6", false); + assertEquals("ea1f9439-a663-4073-93b9-6ef2b8bca3c1", event.getBaseEntityId()); + assertEquals("05934ae338431f28bf6793b241781149", event.getId()); + assertEquals("Growth Monitoring", event.getEventType()); + //find non existent event + assertNull(eventsRepository.findByFormSubmissionId("05934ae338431f28bf4234gvnbvvh", false)); + assertNull(eventsRepository.findByFormSubmissionId(null, false)); + + //test with deleted event + eventsRepository.safeRemove(event); + assertNull(eventsRepository.findByFormSubmissionId("31c4a45a-09f4-4b01-abe8-a87526827df6", false)); + } + + @Test + public void testFindByBaseEntityId() { + List events = eventsRepository.findByBaseEntityId("58b33379-dab2-4f5c-8f09-6d2bd63023d8"); + assertEquals(8, events.size()); + + events = eventsRepository.findByBaseEntityId("43930c23-c787-4ddb-ab76-770f77e7b17d"); + assertEquals(1, events.size()); + assertEquals("6b3243e9-3d45-495c-af69-f012061def01", events.get(0).getFormSubmissionId()); + assertEquals("05934ae338431f28bf6793b24199e690", events.get(0).getId()); + assertEquals("New Woman Registration", events.get(0).getEventType()); + //non-existent records + assertTrue(eventsRepository.findByBaseEntityId("05934ae338431f28bf4234gvnbvvh").isEmpty()); + + //test with deleted event + eventsRepository.safeRemove(events.get(0)); + assertTrue(eventsRepository.findByBaseEntityId("43930c23-c787-4ddb-ab76-770f77e7b17d").isEmpty()); + } + + @Test + public void testFindByBaseEntityAndFormSubmissionId() { + Event event = eventsRepository.findByBaseEntityAndFormSubmissionId("58b33379-dab2-4f5c-8f09-6d2bd63023d8", + "baf8e663-71a1-4a30-8d40-2f3cab45a6d7"); + assertEquals("05934ae338431f28bf6793b241bdbb60", event.getId()); + + event = eventsRepository.findByBaseEntityAndFormSubmissionId("43930c23-c787-4ddb-ab76-770f77e7b17d", + "6b3243e9-3d45-495c-af69-f012061def01"); + assertEquals(3, event.getObs().size()); + assertEquals("05934ae338431f28bf6793b24199e690", event.getId()); + assertEquals("New Woman Registration", event.getEventType()); + //non-existent records + assertNull(eventsRepository.findByBaseEntityAndFormSubmissionId("58b33379-dab2-4f5c-8f09-6d2bd63023d8", "34354")); + + //test with deleted event + eventsRepository.safeRemove(event); + assertNull(eventsRepository.findByBaseEntityAndFormSubmissionId("43930c23-c787-4ddb-ab76-770f77e7b17d", + "6b3243e9-3d45-495c-af69-f012061def01")); + } + + @Test + public void testFindByBaseEntityAndType() { + List events = eventsRepository.findByBaseEntityAndType("58b33379-dab2-4f5c-8f09-6d2bd63023d8", "Vaccination"); + assertEquals(6, events.size()); + + events = eventsRepository.findByBaseEntityAndType("58b33379-dab2-4f5c-8f09-6d2bd63023d8", "Birth Registration"); + assertEquals(1, events.size()); + assertEquals("d59504cc-09ef-4d09-9dc3-8f7eb65882fd", events.get(0).getFormSubmissionId()); + assertEquals("05934ae338431f28bf6793b241bdb88c", events.get(0).getId()); + assertEquals(1521183592609l, events.get(0).getServerVersion().longValue()); + //non-existent records + assertTrue(eventsRepository.findByBaseEntityAndType("58b33379-dab2-4f5c-8f09-6d2bd63023d8", "Growth Monitoring") + .isEmpty()); + assertTrue(eventsRepository.findByBaseEntityAndType("58b33379", "Vaccination").isEmpty()); + + //test with deleted event + eventsRepository.safeRemove(events.get(0)); + assertTrue(eventsRepository.findByBaseEntityAndType("58b33379-dab2-4f5c-8f09-6d2bd63023d8", "Birth Registration") + .isEmpty()); + } + + @Test + public void testFindEvents() { + + EventSearchBean eventSearchBean = new EventSearchBean(); + eventSearchBean.setBaseEntityId("58b33379-dab2-4f5c-8f09-6d2bd63023d8"); + List events = eventsRepository.findEvents(eventSearchBean); + assertEquals(8, events.size()); + + DateTime from = new DateTime("2018-01-10T11:59:37.380"); + DateTime to = new DateTime("2018-02-21T12:00:08.788"); + + eventSearchBean.setEventDateFrom(from); + eventSearchBean.setEventDateTo(to); + events = eventsRepository.findEvents(eventSearchBean); + assertEquals(6, events.size()); + + eventSearchBean.setEventType("Vaccination"); + events = eventsRepository.findEvents(eventSearchBean); + assertEquals(6, events.size()); + + eventSearchBean.setEntityType("vaccination"); + events = eventsRepository.findEvents(eventSearchBean); + assertEquals(6, events.size()); + + eventSearchBean.setProviderId("biddemo"); + eventSearchBean.setLocationId("42abc582-6658-488b-922e-7be500c070f3"); + events = eventsRepository.findEvents(eventSearchBean); + assertEquals(6, events.size()); + + eventSearchBean.setTeam("ATeam"); + eventSearchBean.setTeamId("3453hgb454-4j345n-llk345"); + events = eventsRepository.findEvents(eventSearchBean); + assertEquals(2, events.size()); + for (Event event : events) { + assertEquals("3453hgb454-4j345n-llk345", event.getTeamId()); + assertEquals("ATeam", event.getTeam()); + assertEquals("42abc582-6658-488b-922e-7be500c070f3", event.getLocationId()); + assertEquals("biddemo", event.getProviderId()); + assertEquals("vaccination", event.getEntityType()); + assertEquals("Vaccination", event.getEventType()); + assertEquals("58b33379-dab2-4f5c-8f09-6d2bd63023d8", event.getBaseEntityId()); + assertTrue(event.getEventDate().isEqual(from) || event.getEventDate().isAfter(from)); + assertTrue(event.getEventDate().isEqual(to) || event.getEventDate().isBefore(to)); + } + + eventSearchBean.setLastEditFrom(new DateTime()); + eventSearchBean.setLastEditTo(new DateTime()); + events = eventsRepository.findEvents(eventSearchBean); + assertTrue(events.isEmpty()); + + DateTime editFrom = new DateTime("2018-03-16T10:03:01.537+03:00"); + DateTime editTo = new DateTime("2018-03-19T17:17:15.929+03:00"); + eventSearchBean.setLastEditFrom(editFrom); + eventSearchBean.setLastEditTo(editTo); + events = eventsRepository.findEvents(eventSearchBean); + assertEquals(2, events.size()); + for (Event event : events) { + assertTrue(event.getDateEdited().equals(editFrom) || event.getDateEdited().isAfter(editFrom)); + assertTrue(event.getDateEdited().equals(editTo) || event.getDateEdited().isBefore(editTo)); + } + + //test with deleted event + for (Event event : events) + eventsRepository.safeRemove(event); + assertTrue(eventsRepository.findEvents(eventSearchBean).isEmpty()); + } + + @Test(expected = IllegalArgumentException.class) + public void testFindEventsByDynamicQuery() { + eventsRepository.findEventsByDynamicQuery("baseEntityId:4234324"); + } + + @Test + public void testFindByServerVersion() { + assertEquals(22, eventsRepository.findByServerVersion(0).size()); + + //missing data + assertTrue(eventsRepository.findByServerVersion(1578908926000l).isEmpty()); + + List events = eventsRepository.findByServerVersion(1521469045587l); + assertEquals(10, events.size()); + List expectedIds = Arrays.asList("05934ae338431f28bf6793b241780bac", "05934ae338431f28bf6793b241781149", + "05934ae338431f28bf6793b241781a1e", "05934ae338431f28bf6793b241781149", "34166bde-2d40-4cb9-aec7-d8e4feb47c53", + "66c1ffdc-697c-4d31-b50d-6396ccb6368c", "f9db43e1-1b15-4d26-ba56-29136edb73d6", + "18a43e36-5701-4afc-b901-8eb4ce0e2002", "d945f800-eeca-415e-b737-e5611e19f706", "cfcc0e7e3cef11eab77f2e728ce88125", + "81228b7f-b336-440e-9428-ebfba225ad17"); + for (Event event : events) { + assertTrue(event.getServerVersion() >= 1521469045587l); + assertTrue(expectedIds.contains(event.getId())); + } + + //test with deleted event + for (Event event : events) + eventsRepository.safeRemove(event); + assertFalse(eventsRepository.findByServerVersion(1521469045587l).isEmpty()); + } + + @Test + public void testNotInOpenMRSByServerVersion() { + Calendar cal = Calendar.getInstance(); + assertEquals(13, eventsRepository.notInOpenMRSByServerVersion(0, cal).size()); + + cal.setTimeInMillis(1521469045589l); + + //test missing data + assertTrue(eventsRepository.notInOpenMRSByServerVersion(1521469045597l, cal).isEmpty()); + + List events = eventsRepository.notInOpenMRSByServerVersion(1521469045588l, cal); + assertEquals(2, events.size()); + + List expectedIds = Arrays.asList("05934ae338431f28bf6793b241780bac", "05934ae338431f28bf6793b241781149"); + for (Event event : events) { + assertTrue(event.getServerVersion() >= 1521469045588l && event.getServerVersion() <= cal.getTimeInMillis()); + assertTrue(expectedIds.contains(event.getId())); + } + + //test with deleted event + for (Event event : events) + eventsRepository.safeRemove(event); + assertTrue(eventsRepository.notInOpenMRSByServerVersion(1521469045588l, cal).isEmpty()); + + } + + @Test + public void testNotInOpenMRSByServerVersionAndType() { + Calendar cal = Calendar.getInstance(); + assertEquals(4, eventsRepository.notInOpenMRSByServerVersionAndType("Growth Monitoring", 0, cal).size()); + //missing data + assertTrue(eventsRepository.notInOpenMRSByServerVersion(1578908926000l, cal).isEmpty()); + cal.setTimeInMillis(1521469045589l); + List events = eventsRepository.notInOpenMRSByServerVersionAndType("Growth Monitoring", 1521469045588l, cal); + List expectedIds = Arrays.asList("05934ae338431f28bf6793b241780bac", "05934ae338431f28bf6793b241781149"); + assertEquals(2, events.size()); + for (Event event : events) { + assertTrue(event.getServerVersion() >= 1521469045588l && event.getServerVersion() <= cal.getTimeInMillis()); + assertTrue(expectedIds.contains(event.getId())); + assertEquals("Growth Monitoring", event.getEventType()); + } + + //test with deleted event + for (Event event : events) + eventsRepository.safeRemove(event); + assertTrue(eventsRepository.notInOpenMRSByServerVersionAndType("Growth Monitoring", 1521469045588l, cal).isEmpty()); + + } + + @Test + public void testFindByClientAndConceptAndDate() { + List events = eventsRepository.findByClientAndConceptAndDate("58b33379-dab2-4f5c-8f09-6d2bd63023d8", + "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "1", "2018-01-10", new DateTime().toString("yyyy-MM-dd")); + assertEquals(5, events.size()); + for (Event event : events) { + assertTrue(event.getEventDate().equals(new DateTime("2018-01-10")) + || event.getEventDate().isAfter(new DateTime("2018-01-10"))); + assertEquals("58b33379-dab2-4f5c-8f09-6d2bd63023d8", event.getBaseEntityId()); + assertEquals("1", events.get(0).getObs(null, "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValues().get(0)); + } + + events = eventsRepository.findByClientAndConceptAndDate("58b33379-dab2-4f5c-8f09-6d2bd63023d8", + "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "1", "2018-03-20", new DateTime().toString("yyyy-MM-dd")); + + assertTrue(events.isEmpty()); + + events = eventsRepository.findByClientAndConceptAndDate("58b33379-dab2-4f5c-8f09-6d2bd63023d8", + "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "2018-02-21", "2018-03-19", new DateTime().toString("yyyy-MM-dd")); + + assertEquals(4, events.size()); + + events = eventsRepository + .findByClientAndConceptAndDate("58b33379-dab2-4f5c-8f09-6d2bd63023d8", + "163531AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "Happy Kids Clinic", "2018-03-19", + new DateTime().toString("yyyy-MM-dd")); + + assertEquals(1, events.size()); + assertEquals("58b33379-dab2-4f5c-8f09-6d2bd63023d8", events.get(0).getBaseEntityId()); + assertEquals("05934ae338431f28bf6793b241bdb88c", events.get(0).getId()); + assertEquals("Happy Kids Clinic", events.get(0).getObs(null, "163531AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValues() + .get(0)); + assertTrue(events.get(0).getDateCreated().equals(new DateTime("2018-03-19")) + || events.get(0).getDateCreated().isAfter(new DateTime("2018-03-19"))); + + //test with deleted event + eventsRepository.safeRemove(events.get(0)); + assertTrue(eventsRepository + .findByClientAndConceptAndDate("58b33379-dab2-4f5c-8f09-6d2bd63023d8", + "163531AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "Happy Kids Clinic", "2018-03-19", + new DateTime().toString("yyyy-MM-dd")).isEmpty()); + + } + + @Test + public void testFindByBaseEntityIdAndConceptParentCode() { + //missing data + List events = eventsRepository.findByBaseEntityIdAndConceptParentCode("58b33379-dab2-4f5c-8f09-6d2bd63023d8", + "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); + + assertTrue(events.isEmpty()); + + events = eventsRepository.findByBaseEntityIdAndConceptParentCode("58b33379-dab2-4f5c-8f09-6d2bd63023d8", + "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); + assertEquals(2, events.size()); + + events = eventsRepository.findByBaseEntityIdAndConceptParentCode("58b33379-dab2-4f5c-8f09-6d2bd63023d8", + "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); + + assertEquals(1, events.size()); + assertEquals("05934ae338431f28bf6793b241bdbc55", events.get(0).getId()); + boolean found = false; + for (Obs obs : events.get(0).getObs()) { + if (obs.getParentCode().equals("886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") + && obs.getFieldCode().equals("1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")) { + found = true; + break; + } + } + assertTrue(found); + + //test with deleted event + eventsRepository.safeRemove(events.get(0)); + assertTrue(eventsRepository.findByBaseEntityIdAndConceptParentCode("58b33379-dab2-4f5c-8f09-6d2bd63023d8", + "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").isEmpty()); + + } + + @Test + public void testFindByConceptAndValue() { + List events = eventsRepository.findByConceptAndValue("1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "1"); + assertEquals(8, events.size()); + + events = eventsRepository.findByConceptAndValue("1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "5"); + + assertTrue(events.isEmpty()); + + events = eventsRepository.findByConceptAndValue("1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "2018-02-21"); + + assertEquals(4, events.size()); + for (Event event : events) { + assertEquals("2018-02-21", event.getObs(null, "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValues().get(0)); + } + + events = eventsRepository.findByConceptAndValue("163531AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "Happy Kids Clinic"); + + assertEquals(1, events.size()); + assertEquals("58b33379-dab2-4f5c-8f09-6d2bd63023d8", events.get(0).getBaseEntityId()); + assertEquals("05934ae338431f28bf6793b241bdb88c", events.get(0).getId()); + + //test with deleted event + eventsRepository.safeRemove(events.get(0)); + assertTrue(eventsRepository.findByConceptAndValue("163531AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "Happy Kids Clinic") + .isEmpty()); + + } + + @Test + public void testFindEvents2() { + EventSearchBean eventSearchBean = new EventSearchBean(); + eventSearchBean.setTeam("ATeam"); + eventSearchBean.setTeamId("3453hgb454-4j345n-llk345"); + List events = eventsRepository.findEvents(eventSearchBean, null, null, 20); + assertEquals(2, events.size()); + + eventSearchBean = new EventSearchBean(); + eventSearchBean.setTeam("ATeam,BTeam"); + events = eventsRepository.findEvents(eventSearchBean, null, null, 20); + assertEquals(3, events.size()); + + eventSearchBean = new EventSearchBean(); + eventSearchBean.setProviderId("biddemo,biddemo2"); + eventSearchBean.setLocationId("42b88545-7ebb-4e11-8d1a-3d3a924c8af4,42b88545-7ebb-4e11-8d1a-3d3a924c8af5"); + events = eventsRepository.findEvents(eventSearchBean, null, null, 20); + assertEquals(7, events.size()); + + eventSearchBean.setBaseEntityId("58b33379-dab2-4f5c-8f09-6d2bd63023d8"); + events = eventsRepository.findEvents(eventSearchBean, null, null, 20); + assertEquals(0, events.size()); + + eventSearchBean.setLocationId("42abc582-6658-488b-922e-7be500c070f3"); + events = eventsRepository.findEvents(eventSearchBean, null, null, 20); + assertEquals(7, events.size()); + + eventSearchBean.setEventType("Birth Registration"); + events = eventsRepository.findEvents(eventSearchBean, null, null, 20); + assertEquals(1, events.size()); + assertEquals("Birth Registration", events.get(0).getEventType()); + assertEquals("05934ae338431f28bf6793b241bdb88c", events.get(0).getId()); + + eventSearchBean = new EventSearchBean(); + eventSearchBean.setTeam("ATeam,BTeam"); + eventSearchBean.setTeamId("3453hgb454-4j345n-llk345,3453hgb454-4j345n-llk348"); + eventSearchBean.setProviderId("biddemo"); + eventSearchBean.setServerVersion(0l); + events = eventsRepository.findEvents(eventSearchBean, BaseEntity.SERVER_VERSIOIN, "asc", 20); + assertEquals(3, events.size()); + + long previousVersion = 0; + for (Event event : events) { + assertTrue(event.getTeam().equals("ATeam") || event.getTeam().equals("BTeam")); + assertTrue(event.getTeamId().equals("3453hgb454-4j345n-llk345") + || event.getTeamId().equals("3453hgb454-4j345n-llk348")); + assertEquals("42abc582-6658-488b-922e-7be500c070f3", event.getLocationId()); + assertEquals("biddemo", event.getProviderId()); + assertTrue(event.getServerVersion() >= previousVersion); + previousVersion = event.getServerVersion(); + } + + //test with deleted event + for (Event event : events) + eventsRepository.safeRemove(event); + assertTrue(eventsRepository.findEvents(eventSearchBean, BaseEntity.SERVER_VERSIOIN, "asc", 20).isEmpty()); + } + + @Test + public void testUpdate() { + Event event = eventsRepository.get("05934ae338431f28bf6793b2419c64fb"); + long now = System.currentTimeMillis(); + event.setDateEdited(new DateTime(now)); + Obs obs = new Obs("concept", "text", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "25-Apr-2017", null, + "Date_Reaction"); + event.addObs(obs); + event.setServerVersion(1); + long serverVersion = event.getServerVersion(); + eventsRepository.update(event); + + Event updatedEvent = eventsRepository.get("05934ae338431f28bf6793b2419c64fb"); + assertNotEquals(now, updatedEvent.getServerVersion().longValue()); + assertEquals(now, updatedEvent.getDateEdited().getMillis()); + assertEquals(3, updatedEvent.getObs().size()); + assertEquals(obs.getValue(), updatedEvent.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); + MatcherAssert.assertThat(updatedEvent.getServerVersion(), Matchers.greaterThan(serverVersion)); + + //test update with voided date deletes event + event.setDateVoided(new DateTime()); + eventsRepository.update(event); + assertNull(eventsRepository.get(event.getId())); + } + + @Test + public void testFindByEmptyServerVersion() { + assertEquals(0, eventsRepository.findByEmptyServerVersion().size()); + Event event = eventsRepository.get("05934ae338431f28bf6793b241bdb88c"); + event.setServerVersion(0l); + eventsRepository.update(event); + + event = eventsRepository.get("05934ae338431f28bf6793b241bdbb60"); + event.setServerVersion(0l); + eventsRepository.update(event); + long beforeFetch = System.currentTimeMillis(); + List events = eventsRepository.findByEmptyServerVersion(); + assertEquals(0, events.size()); + for (Event loopEvent : events) { + assertTrue(loopEvent.getId().equals("05934ae338431f28bf6793b241bdb88c") + || loopEvent.getId().equals("05934ae338431f28bf6793b241bdbb60")); + //if serverVersion is null will automatically be set to current timestamp in org.opensrp.domain.BaseDataObject.serverVersion + assertTrue(loopEvent.getServerVersion() == 0 || loopEvent.getServerVersion() >= beforeFetch); + + } + + //test with deleted event + for (Event e : events) + eventsRepository.safeRemove(e); + assertTrue(eventsRepository.findByEmptyServerVersion().isEmpty()); + } + + @Test + public void testFindEventByEventTypeBetweenTwoDates() { + List events = eventsRepository.getAll(); + Calendar cal = Calendar.getInstance(); + cal.set(Calendar.DATE, 1); + for (Event event : events) { + if (event.getEventType().equalsIgnoreCase("Recurring Service")) continue; //Skip this event type + event.setDateCreated(new DateTime(cal.getTimeInMillis())); + eventsRepository.update(event); + } + assertEquals(9, eventsRepository.findEventByEventTypeBetweenTwoDates("Vaccination").size()); + assertEquals(4, eventsRepository.findEventByEventTypeBetweenTwoDates("Growth Monitoring").size()); + events = eventsRepository.findEventByEventTypeBetweenTwoDates("Birth Registration"); + assertEquals(1, events.size()); + assertEquals("58b33379-dab2-4f5c-8f09-6d2bd63023d8", events.get(0).getBaseEntityId()); + assertEquals("05934ae338431f28bf6793b241bdb88c", events.get(0).getId()); + + //test with deleted event + eventsRepository.safeRemove(events.get(0)); + assertTrue(eventsRepository.findEventByEventTypeBetweenTwoDates("Birth Registration").isEmpty()); + } + + @Test + public void testSafeRemove() { + Event event = eventsRepository.get("05934ae338431f28bf6793b241bdb88c"); + eventsRepository.safeRemove(event); + List events = eventsRepository.getAll(); + assertEquals(20, events.size()); + for (Event e : events) + assertNotEquals("05934ae338431f28bf6793b241bdb88c", e.getId()); + assertNull(eventsRepository.get("05934ae338431f28bf6793b241bdb88c")); + } + + @Test + public void testAdd() { + Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); + Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring") + .withFormSubmissionId("gjhg34534 nvbnv3345345__4").withEventDate(new DateTime()).withObs(obs); + + eventsRepository.add(event); + + event = eventsRepository.findByFormSubmissionId("gjhg34534 nvbnv3345345__4", false); + assertEquals("435534534543", event.getBaseEntityId()); + assertEquals("Growth Monitoring", event.getEventType()); + assertEquals(1, event.getObs().size()); + assertEquals("3.5", event.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); + MatcherAssert.assertThat(event.getServerVersion(), Matchers.greaterThan(5l)); + + //test if an event with voided date add event as deleted + event = new Event().withBaseEntityId("2423nj-sdfsd-sf2dfsd-2399d").withEventType("Vaccination") + .withFormSubmissionId("hshj2342_jsjs-jhjsdfds-23").withEventDate(new DateTime()).withObs(obs); + event.setDateVoided(new DateTime()); + eventsRepository.add(event); + assertNull(eventsRepository.findByFormSubmissionId(event.getFormSubmissionId(), false)); + + + } + + @Test + public void testFindByProvider() { + List events = eventsRepository.findByProvider("biddemo"); + assertEquals(13, events.size()); + events = eventsRepository.findByProvider("biddemo2"); + assertEquals(2, events.size()); + for (Event event : events) { + assertEquals("biddemo2", event.getProviderId()); + assertTrue(event.getId().equals("05934ae338431f28bf6793b241781149") + || event.getId().equals("05934ae338431f28bf6793b241781a1e")); + } + assertTrue(eventsRepository.findByProvider("biddemo9").isEmpty()); + } + + @Test + public void testCountEvents() { + + EventSearchBean eventSearchBean = new EventSearchBean(); + eventSearchBean.setBaseEntityId("58b33379-dab2-4f5c-8f09-6d2bd63023d8"); + Long events = eventsRepository.countEvents(eventSearchBean); + assertEquals(8, events.longValue()); + + eventSearchBean.setEventType("Vaccination"); + events = eventsRepository.countEvents(eventSearchBean); + assertEquals(6, events.longValue()); + + eventSearchBean.setProviderId("biddemo"); + eventSearchBean.setLocationId("42abc582-6658-488b-922e-7be500c070f3"); + events = eventsRepository.countEvents(eventSearchBean); + assertEquals(6, events.longValue()); + + eventSearchBean.setTeam("ATeam"); + eventSearchBean.setTeamId("3453hgb454-4j345n-llk345"); + events = eventsRepository.countEvents(eventSearchBean); + assertEquals(2, events.longValue()); + + DateTime editFrom = new DateTime("2018-03-16T10:03:01.537+03:00"); + DateTime editTo = new DateTime("2018-03-19T17:17:15.929+03:00"); + eventSearchBean.setLastEditFrom(editFrom); + eventSearchBean.setLastEditTo(editTo); + events = eventsRepository.countEvents(eventSearchBean); + assertEquals(2, events.longValue()); + + //test with deleted event + List eventObjects = eventsRepository.findEvents(eventSearchBean); + for (Event event : eventObjects) + eventsRepository.safeRemove(event); + assertEquals(0, eventsRepository.countEvents(eventSearchBean).longValue()); + } + + @Test + public void testFindEventsByEntityIdAndPlan() { + Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); + Event event = new Event().withBaseEntityId("4355345345431").withEventType("GrowthMonitoring"). + withFormSubmissionId("gjhg34534nvbnv33453450").withEventDate(new DateTime()).withObs(obs) + .withLocationId("test-location-id").withChildLocationId("test-child-location-id"); + event.setTeam("team"); + event.setTeamId("team-id"); + event.setProviderId("provider-id"); + event.setServerVersion(12345678l); + + Map details = new HashMap<>(); + details.put("planIdentifier", "plan-id-12345"); + event.setDetails(details); + eventsRepository.add(event); + List questionnaireResponses = eventsRepository.findEventsByEntityIdAndPlan("4355345345431", "plan-id-12345"); + assertEquals(1, questionnaireResponses.size()); + assertEquals(event.getFormSubmissionId(), questionnaireResponses.get(0).getId()); + } + + @Test + public void testFindIdsByEventTypeShouldFilterBetweenFromDateToDate() { + String date1 = "2018-03-19T17:27:29"; + String date2 = "2019-11-14T17:39:37"; + + Pair, Long> listLongPair = eventsRepository.findIdsByEventType("", false, 0L, 10, + new DateTime(date1).toDate(), new DateTime(date2).toDate()); + assertEquals(10, listLongPair.getLeft().size()); + } + + @Test + public void testFindIdsByEventTypeShouldFilterFromDateAsMinimumDate() { + String date1 = "2019-11-14T18:57:36"; + + Pair, Long> listLongPair = eventsRepository.findIdsByEventType("", false, 0L, 10, + new DateTime(date1).toDate(), null); + assertEquals(3, listLongPair.getLeft().size()); + } + + @Test + public void testFindIdsByEventTypeShouldFilterToDateAsMaximumDate() { + String date1 = "2018-03-19T17:26:00"; + Pair, Long> listLongPair = eventsRepository.findIdsByEventType("", false, 0L, 10, + null, new DateTime(date1).toDate()); + assertTrue(listLongPair.getLeft().isEmpty()); + } + + @Test + public void testGetEventData() { + eventsRepository.add(createFlagProblemEvent()); + List events = eventsRepository.getEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); + assertNotNull(events); + assertEquals(1, events.size()); + } + + @Test + public void testFindEventsByJurisdictionIdAndPlan() { + Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); + Event event = new Event().withBaseEntityId("4355345345431").withEventType("GrowthMonitoring"). + withFormSubmissionId("gjhg34534nvbnv33453450").withEventDate(new DateTime()).withObs(obs) + .withLocationId("test-location-id").withChildLocationId("test-child-location-id"); + event.setTeam("team"); + event.setTeamId("team-id"); + event.setProviderId("provider-id"); + event.setServerVersion(12345678l); + + Map details = new HashMap<>(); + details.put("planIdentifier", "plan-id-12345"); + event.setDetails(details); + eventsRepository.add(event); + List questionnaireResponses = eventsRepository.findEventsByJurisdictionIdAndPlan("test-location-id", "plan-id-12345"); + assertEquals(1, questionnaireResponses.size()); + assertEquals(event.getFormSubmissionId(), questionnaireResponses.get(0).getId()); + + assertTrue(eventsRepository.findEventsByJurisdictionIdAndPlan("test-location-id", "plan-12345").isEmpty()); + + assertTrue(eventsRepository.findEventsByJurisdictionIdAndPlan("test-location-id1", "plan-id-12345").isEmpty()); + } } diff --git a/src/test/java/org/opensrp/repository/postgres/IdentifierSourceRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/IdentifierSourceRepositoryTest.java index f4debdf7b..a9f3f054e 100644 --- a/src/test/java/org/opensrp/repository/postgres/IdentifierSourceRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/IdentifierSourceRepositoryTest.java @@ -13,78 +13,78 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -public class IdentifierSourceRepositoryTest extends BaseRepositoryTest { +public class IdentifierSourceRepositoryTest extends BaseRepositoryTest { - @Autowired - @Qualifier("identifierSourceRepositoryPostgres") - private IdentifierSourceRepository identifierSourceRepository; + @Autowired + @Qualifier("identifierSourceRepositoryPostgres") + private IdentifierSourceRepository identifierSourceRepository; - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("identifier_source.sql"); - return scripts; - } - - @Test - public void testFindByIdentifier() { - IdentifierSource identifierSource = identifierSourceRepository.findByIdentifier("Test Identifier"); - assertEquals(identifierSource.getIdentifierValidatorAlgorithm(), IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); - assertEquals(identifierSource.getBaseCharacterSet(),"AB12"); - assertEquals(identifierSource.getMinLength(),new Integer(5)); - assertEquals(identifierSource.getMaxLength(),new Integer(10)); - } + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("identifier_source.sql"); + return scripts; + } - @Test - public void testAdd() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setIdentifier("Test-1"); - identifierSource.setBaseCharacterSet("AB12"); - identifierSource.setMinLength(4); - identifierSource.setMaxLength(4); + @Test + public void testFindByIdentifier() { + IdentifierSource identifierSource = identifierSourceRepository.findByIdentifier("Test Identifier"); + assertEquals(identifierSource.getIdentifierValidatorAlgorithm(), IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM); + assertEquals(identifierSource.getBaseCharacterSet(), "AB12"); + assertEquals(identifierSource.getMinLength(), new Integer(5)); + assertEquals(identifierSource.getMaxLength(), new Integer(10)); + } - identifierSourceRepository.add(identifierSource); - assertEquals(2, identifierSourceRepository.getAll().size()); - IdentifierSource addedIdentifierSource = identifierSourceRepository.findByIdentifier("Test-1"); - assertNotNull(addedIdentifierSource); - assertEquals("AB12", addedIdentifierSource.getBaseCharacterSet()); - } + @Test + public void testAdd() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setIdentifier("Test-1"); + identifierSource.setBaseCharacterSet("AB12"); + identifierSource.setMinLength(4); + identifierSource.setMaxLength(4); - @Test - public void testUpdate() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setIdentifier("Test-1"); - identifierSource.setBaseCharacterSet("AB12"); - identifierSource.setMinLength(4); - identifierSource.setMaxLength(4); + identifierSourceRepository.add(identifierSource); + assertEquals(2, identifierSourceRepository.getAll().size()); + IdentifierSource addedIdentifierSource = identifierSourceRepository.findByIdentifier("Test-1"); + assertNotNull(addedIdentifierSource); + assertEquals("AB12", addedIdentifierSource.getBaseCharacterSet()); + } - identifierSourceRepository.add(identifierSource); - assertEquals(2, identifierSourceRepository.getAll().size()); - IdentifierSource addedIdentifierSource = identifierSourceRepository.findByIdentifier("Test-1"); - addedIdentifierSource.setIdentifier("UpdatedTest-1"); + @Test + public void testUpdate() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setIdentifier("Test-1"); + identifierSource.setBaseCharacterSet("AB12"); + identifierSource.setMinLength(4); + identifierSource.setMaxLength(4); - identifierSourceRepository.update(addedIdentifierSource); - IdentifierSource updatedIdentifierSource = identifierSourceRepository.findByIdentifier("UpdatedTest-1"); - assertNotNull(updatedIdentifierSource); - assertEquals(updatedIdentifierSource.getIdentifier(), "UpdatedTest-1"); - } + identifierSourceRepository.add(identifierSource); + assertEquals(2, identifierSourceRepository.getAll().size()); + IdentifierSource addedIdentifierSource = identifierSourceRepository.findByIdentifier("Test-1"); + addedIdentifierSource.setIdentifier("UpdatedTest-1"); - @Test - public void testUpdateIdSourceWithSequenceValue() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setIdentifier("Test-1"); - identifierSource.setBaseCharacterSet("012345"); - identifierSource.setFirstIdentifierBase("2000000"); - identifierSource.setMinLength(7); - identifierSource.setMaxLength(10); + identifierSourceRepository.update(addedIdentifierSource); + IdentifierSource updatedIdentifierSource = identifierSourceRepository.findByIdentifier("UpdatedTest-1"); + assertNotNull(updatedIdentifierSource); + assertEquals(updatedIdentifierSource.getIdentifier(), "UpdatedTest-1"); + } - identifierSourceRepository.add(identifierSource); - assertEquals(2, identifierSourceRepository.getAll().size()); - IdentifierSource addedIdentifierSource = identifierSourceRepository.findByIdentifier("Test-1"); - identifierSourceRepository.updateIdSourceWithSequenceValue(addedIdentifierSource, 1234l); - IdentifierSource updatedIdentifierSource = identifierSourceRepository.findByIdentifier("Test-1"); - assertNotNull(updatedIdentifierSource); - assertEquals(new Long(1234), updatedIdentifierSource.getSequenceValue()); - } + @Test + public void testUpdateIdSourceWithSequenceValue() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setIdentifier("Test-1"); + identifierSource.setBaseCharacterSet("012345"); + identifierSource.setFirstIdentifierBase("2000000"); + identifierSource.setMinLength(7); + identifierSource.setMaxLength(10); + + identifierSourceRepository.add(identifierSource); + assertEquals(2, identifierSourceRepository.getAll().size()); + IdentifierSource addedIdentifierSource = identifierSourceRepository.findByIdentifier("Test-1"); + identifierSourceRepository.updateIdSourceWithSequenceValue(addedIdentifierSource, 1234l); + IdentifierSource updatedIdentifierSource = identifierSourceRepository.findByIdentifier("Test-1"); + assertNotNull(updatedIdentifierSource); + assertEquals(new Long(1234), updatedIdentifierSource.getSequenceValue()); + } } diff --git a/src/test/java/org/opensrp/repository/postgres/LocationRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/LocationRepositoryTest.java index 9a4de21cf..02ae730cb 100755 --- a/src/test/java/org/opensrp/repository/postgres/LocationRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/LocationRepositoryTest.java @@ -62,1234 +62,1232 @@ import com.google.gson.JsonPrimitive; public class LocationRepositoryTest extends BaseRepositoryTest { - - private String parentJson = "{\"id\": \"3366\",\"locationTags\": [{\"active\":true,\"name\":\"District\",\"description\":\"description\",\"id\":1}], \"type\": \"Feature\", \"geometry\": {\"type\": \"MultiPolygon\", \"coordinates\": [[[[32.60019625316408, -14.16712789883206], [32.60026392129685, -14.167200170670068], [32.600326068380916, -14.167277018364924], [32.60038237040833, -14.167358041272504], [32.60043253384264, -14.167442816981005], [32.600461865346055, -14.167501855260806], [32.600467305754925, -14.167504082164154], [32.6005567791152, -14.167548365892056], [32.60064274437109, -14.16759883363829], [32.60072475334385, -14.167655222291442], [32.600802378479834, -14.167717237871212], [32.60087521507938, -14.167784557061506], [32.60094288340667, -14.167856828895705], [32.60100503066945, -14.167933676586241], [32.6010613328587, -14.168014699489389], [32.60111149643739, -14.16809947519317], [32.601155259871, -14.168187561720227], [32.60119239499158, -14.168278499831782], [32.60122270818726, -14.168371815421606], [32.601246041411336, -14.168467021987961], [32.60126227300679, -14.16856362316997], [32.60127131834104, -14.168661115335109], [32.601273130246504, -14.168758990205273], [32.60126809520835, -14.168849611326149], [32.601268746132114, -14.168884772675423], [32.60126331515021, -14.16898251997554], [32.601250669585276, -14.1690796300968], [32.6012308753564, -14.169175596751185], [32.60120403565332, -14.169269919610993], [32.6011702903973, -14.169362106918296], [32.60112981551378, -14.169451678048457], [32.60108282201332, -14.169538166015567], [32.60102955489338, -14.169621119908012], [32.60097029185993, -14.169700107238382], [32.60090534188031, -14.169774716199182], [32.6008350435718, -14.169844557809366], [32.600817649001606, -14.169859510027148], [32.60076264386304, -14.169914157803586], [32.60068736370561, -14.169978867936662], [32.60060749419761, -14.170038109219828], [32.600559934780954, -14.170068364123377], [32.60056014202427, -14.170070597813773], [32.6005619539411, -14.170168472672398], [32.60055652292868, -14.170266219962112], [32.60054387729263, -14.170363330073084], [32.600524082952795, -14.170459296717066], [32.60049724309874, -14.170553619566872], [32.600463497653145, -14.170645806864396], [32.60042302254208, -14.17073537798495], [32.60037602877764, -14.170821865942909], [32.600344492416745, -14.170870977832461], [32.60034438539213, -14.170871496706125], [32.60031754548958, -14.170965819552745], [32.60028379998311, -14.171058006847087], [32.600243324799, -14.171147577964515], [32.600196330949636, -14.17123406591946], [32.600143063434295, -14.171317019800309], [32.60008379996071, -14.171396007119537], [32.600018849498774, -14.171470616069879], [32.59994855066821, -14.171540457670288], [32.59987326997469, -14.17160516779455], [32.59979339989791, -14.171664409069702], [32.59970935684628, -14.171717872634868], [32.59964225969093, -14.17175411050408], [32.59958840035244, -14.171794059057728], [32.599504357253004, -14.171847522622325], [32.59941657934149, -14.171894929738581], [32.59932552425658, -14.17193603324409], [32.59923166672291, -14.171970618840756], [32.599135496077615, -14.171998506212216], [32.599037513717285, -14.172019549964542], [32.59893823048531, -14.17203364038323], [32.598838164007354, -14.172040704006005], [32.59873783599283, -14.172040704006005], [32.5986377695147, -14.17203364038323], [32.598538486282784, -14.172019549964542], [32.59844050392257, -14.171998506212216], [32.59836476694522, -14.171976544154969], [32.598302157782705, -14.172016372605977], [32.598214379806386, -14.172063779721551], [32.59812332465395, -14.172104883226435], [32.59802946705104, -14.172139468822703], [32.59793329633447, -14.172167356193764], [32.59783531390183, -14.17218839994575], [32.59773603059636, -14.172202490364267], [32.59763596404451, -14.172209553987042], [32.597535635955744, -14.172209553987042], [32.59743556940372, -14.172202490364267], [32.59735870544443, -14.17219158172912], [32.59734235282223, -14.172210366013356], [32.597272053763895, -14.172280207609443], [32.59721759844722, -14.172327016406367], [32.59719788529895, -14.172349660918595], [32.59712758619781, -14.172419502513943], [32.59705230521461, -14.172484212633432], [32.59697243483037, -14.172543453904321], [32.59691580121147, -14.17257948095516], [32.596914419626664, -14.172580505700747], [32.596830376237726, -14.172633969261877], [32.59674259802403, -14.172681376375007], [32.59665154262529, -14.172722479877844], [32.59655768476852, -14.172757065472238], [32.59646151379189, -14.17278495284199], [32.59636353109419, -14.172805996592896], [32.59626424752013, -14.172820087010617], [32.596164180697365, -14.172827150632937], [32.596063852337345, -14.172827150632937], [32.595963785514634, -14.172820087010617], [32.595864501940746, -14.172805996592896], [32.59576651924305, -14.17278495284199], [32.595670348266246, -14.172757065472238], [32.59562983666279, -14.17274213738909], [32.59557352665137, -14.17277254919497], [32.595482471216194, -14.172813652697524], [32.59538861332191, -14.172848238291575], [32.595346903973216, -14.172860333037871], [32.59534239579221, -14.172862368083766], [32.59524853787786, -14.172896953677704], [32.59515236684228, -14.172924841047173], [32.595054384084555, -14.17294588479774], [32.59495510044973, -14.172959975215402], [32.594855033565686, -14.172967038837665], [32.59475470514422, -14.172967038837665], [32.59465463826023, -14.172959975215402], [32.594555354625406, -14.17294588479774], [32.59445737186763, -14.172924841047173], [32.59442506589232, -14.172915473063707], [32.59433007182053, -14.172915473063707], [32.59423000495905, -14.17290840944133], [32.594130721346794, -14.172894319023781], [32.59403273861107, -14.172873275273044], [32.593936567597375, -14.172845387903461], [32.59384270970417, -14.172810802309353], [32.59375165427024, -14.1727696988068], [32.59366387602261, -14.172722291693898], [32.59357983260116, -14.172668828133279], [32.593499962173034, -14.172609586863073], [32.5934246811484, -14.172544876744151], [32.5934126306829, -14.172532904709552], [32.59335004540372, -14.17247910759323], [32.593279746284274, -14.172409265998223], [32.593214795555234, -14.172334657053792], [32.59315553183807, -14.172255669740649], [32.59310226410371, -14.172172715866392], [32.59305527006142, -14.172086227918097], [32.593014794710705, -14.171996656807604], [32.592981049065706, -14.171904469520424], [32.59295420905283, -14.171810146681306], [32.592934414595895, -14.17171418004801], [32.59292176888527, -14.171617069947953], [32.59291633784067, -14.171519322669322], [32.59291814976836, -14.171421447821611], [32.592927195211864, -14.171323955678812], [32.59294342700377, -14.17122735451903], [32.5929667605099, -14.171132147974616], [32.59299707407205, -14.171038832406278], [32.593034209641694, -14.170947894315642], [32.59307797360429, -14.17085980780882], [32.59312813778927, -14.170775032124592], [32.59318444065922, -14.170694009240147], [32.593246588673246, -14.170617161567233], [32.59331425781857, -14.170544889749747], [32.59338709529839, -14.17047757057497], [32.59346472137269, -14.170415555009466], [32.59354673133668, -14.17035916636939], [32.593632697631556, -14.170308698634809], [32.59372217207328, -14.17026441491714], [32.59381468818895, -14.17022654608763], [32.59390976364897, -14.170195289573538], [32.59400690278124, -14.17017080832937], [32.59410559915556, -14.17015322998668], [32.594108641289544, -14.170152907171083], [32.59410452416977, -14.170078807274818], [32.594104747347494, -14.170066751816304], [32.59409492477396, -14.170019130079421], [32.594082279157185, -14.169922019965721], [32.59407684815306, -14.169824272673221], [32.59407866006705, -14.169726397811754], [32.59408770544342, -14.169628905655198], [32.5941039371147, -14.169532304481717], [32.59412727044752, -14.169437097923888], [32.59415758378457, -14.169343782342306], [32.59419471907852, -14.16925284423888], [32.59423848271643, -14.169164757719555], [32.59428864652886, -14.169079982023387], [32.59434494898084, -14.168998959127517], [32.59440709653352, -14.168922111443745], [32.594474765176464, -14.16884983961597], [32.59454760211582, -14.168782520431701], [32.59462522761384, -14.168720504857387], [32.594707236969036, -14.168664116209353], [32.59479320262607, -14.168613648467609], [32.59488267640358, -14.168569364743629], [32.594975191832525, -14.168531495908722], [32.59507026658701, -14.168500239390308], [32.59516740499827, -14.168475758142618], [32.59526610063994, -14.168458179797423], [32.59529244876699, -14.168455383848364], [32.59529777359045, -14.168442344202102], [32.59534153707289, -14.16835425767692], [32.595391700707346, -14.168269481975013], [32.595448002959465, -14.16818845907363], [32.59551015029154, -14.168111611384685], [32.59557781869437, -14.16803933955202], [32.5956506553752, -14.167972020363091], [32.595728280597704, -14.16791000478474], [32.59578277701842, -14.167872533564658], [32.59578663074716, -14.167869454781108], [32.59586863979683, -14.167813066128982], [32.595870154342826, -14.167812176983087], [32.59588304190657, -14.167790397169766], [32.595939344040566, -14.167709374265083], [32.59600149124241, -14.167632526573069], [32.59606915950308, -14.167560254737506], [32.59614199603117, -14.167492935545964], [32.59621962109099, -14.167430919964941], [32.59630162998314, -14.167374531310939], [32.59638759515462, -14.16732406356368], [32.59647706842696, -14.167279779834924], [32.596569583333626, -14.167241910996037], [32.59666465755111, -14.1672106544741], [32.59676179541406, -14.16718617322385], [32.59686049049849, -14.167168594876781], [32.59696022826284, -14.167158011076763], [32.597060488729475, -14.167154477001755], [32.59716074919606, -14.167158011076763], [32.5972604869604, -14.167168594876781], [32.59731452694961, -14.167178219810861], [32.59732387518306, -14.167149442233491], [32.597361010120146, -14.167058504113466], [32.59740477333741, -14.166970417578053], [32.59745493666792, -14.166885641866255], [32.59751123857881, -14.166804618955549], [32.59757338553447, -14.16672777125768], [32.59764105352729, -14.166655499416716], [32.59771388976673, -14.16658818022], [32.597791514519024, -14.166526164634373], [32.59787352308643, -14.166469775975994], [32.597959487917244, -14.166419308225041], [32.59804896083539, -14.166375024492819], [32.59814147537559, -14.166337155650975], [32.59823654921649, -14.166305899126767], [32.598333686694666, -14.166281417874698], [32.59843238138813, -14.16626383952632], [32.598480894615356, -14.16625869146247], [32.59854368499213, -14.166247507971715], [32.59864342235414, -14.166236924170786], [32.59874368241662, -14.16623339009561], [32.59884394247893, -14.166236924170786], [32.598943679841106, -14.166247507971715], [32.59904237452752, -14.166265086320092], [32.59913951199871, -14.166289567572331], [32.59923458583284, -14.166320824096541], [32.5993271003665, -14.166358692938498], [32.599416573278056, -14.166402976670607], [32.59950253810285, -14.166453444421673], [32.599584546664396, -14.166509833080223], [32.599662171411175, -14.16657184866585], [32.59973500764527, -14.166639167862566], [32.59980267563332, -14.166711439703702], [32.59986482258454, -14.166788287401683], [32.59992112449134, -14.166869310312448], [32.59996455353569, -14.16694270512846], [32.60004579186107, -14.166998564054833], [32.600123416774004, -14.167060579638072], [32.60019625316408, -14.16712789883206]]]]}, \"properties\": {\"name\": \"MKB_5\", \"status\": \"Active\", \"version\": 0, \"parentId\": \"2953\", \"geographicLevel\": 2}, \"serverVersion\": 1542965231623}"; - - private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HHmm") - .registerTypeAdapter(LocationProperty.class, new PropertiesConverter()).serializeNulls().create(); - - private Set scripts = new HashSet(); - - private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - - @Autowired - private LocationRepository locationRepository; - - @Autowired - private LocationTagRepository locationTagRepository; - - @Autowired - private StocksRepository stocksRepository; - - @Autowired - @Qualifier("clientsRepositoryPostgres") - private ClientsRepository clientsRepository; - - @Override - protected Set getDatabaseScripts() { - scripts.add("location.sql"); - scripts.add("structure.sql"); - scripts.add("location_tag.sql"); - scripts.add("plan.sql"); - scripts.add("stock.sql"); - return scripts; - } - - @Test - public void testGet() { - PhysicalLocation location = locationRepository.get("3734"); - assertNotNull(location); - assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", location.getProperties().getUid()); - assertEquals("21", location.getProperties().getParentId()); - assertEquals("Intervention Unit", location.getProperties().getType()); - assertEquals(PropertyStatus.ACTIVE, location.getProperties().getStatus()); - assertEquals(1542378347104l, location.getServerVersion().longValue()); - - JsonArray coordinates = location.getGeometry().getCoordinates().get(0).getAsJsonArray().get(0).getAsJsonArray(); - assertEquals(267, coordinates.size()); - - JsonArray coordinate1 = coordinates.get(0).getAsJsonArray(); - assertEquals(32.59989007736522, coordinate1.get(0).getAsDouble(), 0); - assertEquals(-14.167432040756012, coordinate1.get(1).getAsDouble(), 0); - - JsonArray coordinate67 = coordinates.get(66).getAsJsonArray(); - assertEquals(32.5988341383848, coordinate67.get(0).getAsDouble(), 0); - assertEquals(-14.171814074659776, coordinate67.get(1).getAsDouble(), 0); - } - - @Test - public void testGetWithNullOrEmptyParams() { - assertNull(locationRepository.get("")); - - assertNull(locationRepository.get(null)); - - } - - @Test - public void testFindLocationAndStocksByJurisdictionShouldReturnWithNoStock(){ - List physicalLocationAndStocks = locationRepository - .findLocationAndStocksByJurisdiction("3724", null, true, -1); - assertFalse(physicalLocationAndStocks.isEmpty()); - assertEquals(1, physicalLocationAndStocks.size()); - assertTrue(physicalLocationAndStocks.get(0).getStocks().isEmpty()); - } - - @Test - public void testFindLocationAndStocksByJurisdictionShouldReturnWithStock(){ - Stock stock = new Stock(); - stock.setId("05934ae338431f28bf6793b24181ea5e"); - stock.setLocationId("90397"); - stocksRepository.update(stock); - List physicalLocationAndStocks = locationRepository - .findLocationAndStocksByJurisdiction("3734",null, true, Integer.MAX_VALUE); - assertFalse(physicalLocationAndStocks.isEmpty()); - assertEquals(1, physicalLocationAndStocks.size()); - assertFalse(physicalLocationAndStocks.get(0).getStocks().isEmpty()); - } - - @Test - public void testFindLocationAndStocksByJurisdictionShouldReturnNonEmptyBundle(){ - List bundles = locationRepository - .findLocationAndStocksByJurisdiction("3724"); - assertFalse(bundles.isEmpty()); - assertEquals(1, bundles.size()); - } - - @Test - public void testGetNotExistingLocation() { - assertNull(locationRepository.get("1212121")); - } - - @Test - public void testGetStructure() throws ParseException { - PhysicalLocation structure = locationRepository.getStructure("90397", true); - assertNotNull(structure); - assertEquals("90397", structure.getId()); - - assertEquals(GeometryType.POLYGON, structure.getGeometry().getType()); - assertFalse(structure.getGeometry().getCoordinates().isJsonNull()); - - assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", structure.getProperties().getUid()); - assertEquals("21384443", structure.getProperties().getCode()); - assertEquals("Residential Structure", structure.getProperties().getType()); - assertEquals(PropertyStatus.ACTIVE, structure.getProperties().getStatus()); - assertEquals("3734", structure.getProperties().getParentId()); - assertNull(structure.getProperties().getName()); - assertEquals(5, structure.getProperties().getGeographicLevel()); - assertEquals(dateFormat.parse("2017-01-10"), structure.getProperties().getEffectiveStartDate()); - assertNull(structure.getProperties().getEffectiveEndDate()); - assertEquals(0, structure.getProperties().getVersion()); - } - - @Test - public void testGetStructureWithNullOrEmptyParams() { - assertNull(locationRepository.getStructure("", true)); - - assertNull(locationRepository.getStructure(null, true)); - - } - - @Test - public void testGetStructureNotExistingLocation() { - assertNull(locationRepository.getStructure("1212121", true)); - } - - @Test - public void testAddLocation() { - String uuid = UUID.randomUUID().toString(); - PhysicalLocation physicalLocation = createLocation(uuid); - physicalLocation.getProperties().setStatus(PropertyStatus.ACTIVE); - locationRepository.add(physicalLocation); - PhysicalLocation savedLocation = locationRepository.get("223232"); - - assertNotNull(savedLocation); - assertEquals("Feature", savedLocation.getType()); - MatcherAssert.assertThat(savedLocation.getServerVersion(), Matchers.greaterThan(5l)); - - assertNull(locationRepository.getStructure("223232", true)); - - } - - @Test - public void testAddLocationWithoutId() { - PhysicalLocation physicalLocation = new PhysicalLocation(); - physicalLocation.setJurisdiction(true); - locationRepository.add(physicalLocation); - - assertEquals(2, locationRepository.getAll().size()); - assertEquals(2, locationRepository.getAllStructures().size()); - - } - - @Test - public void testAddLocationExistingShouldNotChangeObject() { - - PhysicalLocation physicalLocation = locationRepository.get("3734"); - physicalLocation.getProperties().setName("MY Operational Area"); - physicalLocation.setJurisdiction(true); - - locationRepository.add(physicalLocation); - - physicalLocation = locationRepository.get("3734"); - assertNotEquals("MY Operational Area", physicalLocation.getProperties().getName()); - - assertEquals(2, locationRepository.getAll().size()); - assertEquals(2, locationRepository.getAllStructures().size()); - - } - - @Test - public void testAddStructure() { - String uuid = UUID.randomUUID().toString(); - PhysicalLocation physicalLocation = createStructure(uuid); - - locationRepository.add(physicalLocation); - PhysicalLocation savedLocation = locationRepository.getStructure("121212", true); - - assertNotNull(savedLocation); - assertEquals("Feature", savedLocation.getType()); - assertEquals(GeometryType.POLYGON, savedLocation.getGeometry().getType()); - assertEquals(PropertyStatus.ACTIVE, savedLocation.getProperties().getStatus()); - assertEquals(uuid, savedLocation.getProperties().getUid()); - MatcherAssert.assertThat(savedLocation.getServerVersion(), Matchers.greaterThan(5l)); - - assertNull(locationRepository.get("121212")); - - } - - @Test - public void testAddStructureWithoutId() { - PhysicalLocation physicalLocation = new PhysicalLocation(); - locationRepository.add(physicalLocation); - - assertEquals(2, locationRepository.getAll().size()); - assertEquals(2, locationRepository.getAllStructures().size()); - - } - - @Test - public void testAddStructureExistingShouldNotChangeObject() { - - PhysicalLocation physicalLocation = locationRepository.getStructure("90397", true); - physicalLocation.getProperties().setName("Mwangala Household"); - locationRepository.add(physicalLocation); - - physicalLocation = locationRepository.getStructure("90397", true); - assertNotEquals("Mwangala Household", physicalLocation.getProperties().getName()); - - assertEquals(2, locationRepository.getAll().size()); - assertEquals(2, locationRepository.getAllStructures().size()); - - } - - @Test - public void testUpdateLocation() throws ParseException { - PhysicalLocation physicalLocation = locationRepository.get("3734"); - assertEquals(0, physicalLocation.getProperties().getVersion()); - assertEquals(PropertyStatus.ACTIVE, physicalLocation.getProperties().getStatus()); - - physicalLocation.getGeometry().setType(GeometryType.POLYGON); - physicalLocation.getProperties().setStatus(PropertyStatus.NOT_ELIGIBLE); - physicalLocation.getProperties().setGeographicLevel(3); - - Date effectiveStartDate = dateFormat.parse("2019-07-15"); - Date effectiveEndDate = dateFormat.parse("2020-07-15"); - physicalLocation.getProperties().setEffectiveStartDate(effectiveStartDate); - physicalLocation.getProperties().setEffectiveEndDate(effectiveEndDate); - physicalLocation.setJurisdiction(true); - long serverVersion=physicalLocation.getServerVersion(); - locationRepository.update(physicalLocation); - assertNull(locationRepository.get("3734")); - PhysicalLocation updatedLocation = locationRepository.get("3734", true, 0); - - assertNotNull(updatedLocation); - assertEquals(GeometryType.POLYGON, updatedLocation.getGeometry().getType()); - assertEquals(PropertyStatus.NOT_ELIGIBLE, updatedLocation.getProperties().getStatus()); - assertEquals(3, updatedLocation.getProperties().getGeographicLevel()); - assertEquals(effectiveStartDate, updatedLocation.getProperties().getEffectiveStartDate()); - assertEquals(effectiveEndDate, updatedLocation.getProperties().getEffectiveEndDate()); - assertEquals(0, updatedLocation.getProperties().getVersion()); - MatcherAssert.assertThat(updatedLocation.getServerVersion(), Matchers.greaterThan(serverVersion)); - - assertNull(locationRepository.getStructure("3734", true)); - - } - - @Test - public void testUpdateActiveLocation() throws ParseException { - PhysicalLocation physicalLocation = locationRepository.get("3734"); - assertEquals(0, physicalLocation.getProperties().getVersion()); - assertEquals(PropertyStatus.ACTIVE, physicalLocation.getProperties().getStatus()); - physicalLocation.getGeometry().setType(GeometryType.POLYGON); - physicalLocation.getProperties().setStatus(PropertyStatus.ACTIVE); - physicalLocation.getProperties().setGeographicLevel(3); - - Date effectiveStartDate = dateFormat.parse("2019-07-15"); - Date effectiveEndDate = dateFormat.parse("2020-07-15"); - physicalLocation.getProperties().setEffectiveStartDate(effectiveStartDate); - physicalLocation.getProperties().setEffectiveEndDate(effectiveEndDate); - physicalLocation.setJurisdiction(true); - locationRepository.update(physicalLocation); - PhysicalLocation updatedLocation = locationRepository.get("3734"); - - assertNotNull(updatedLocation); - assertEquals(GeometryType.POLYGON, updatedLocation.getGeometry().getType()); - assertEquals(PropertyStatus.ACTIVE, updatedLocation.getProperties().getStatus()); - assertEquals(3, updatedLocation.getProperties().getGeographicLevel()); - assertEquals(effectiveStartDate, updatedLocation.getProperties().getEffectiveStartDate()); - assertEquals(effectiveEndDate, updatedLocation.getProperties().getEffectiveEndDate()); - assertEquals(0, updatedLocation.getProperties().getVersion()); - - assertNull(locationRepository.getStructure("3734", true)); - - } - - @Test - public void testUpdatePendingReviewLocation() throws ParseException { - PhysicalLocation physicalLocation = locationRepository.get("3734"); - assertEquals(0, physicalLocation.getProperties().getVersion()); - assertEquals(PropertyStatus.ACTIVE, physicalLocation.getProperties().getStatus()); - physicalLocation.getGeometry().setType(GeometryType.POLYGON); - physicalLocation.getProperties().setStatus(PropertyStatus.PENDING_REVIEW); - physicalLocation.getProperties().setGeographicLevel(3); - - Date effectiveStartDate = dateFormat.parse("2019-07-15"); - Date effectiveEndDate = dateFormat.parse("2020-07-15"); - physicalLocation.getProperties().setEffectiveStartDate(effectiveStartDate); - physicalLocation.getProperties().setEffectiveEndDate(effectiveEndDate); - physicalLocation.setJurisdiction(true); - locationRepository.update(physicalLocation); - PhysicalLocation updatedLocation = locationRepository.get("3734"); - - assertNotNull(updatedLocation); - assertEquals(GeometryType.POLYGON, updatedLocation.getGeometry().getType()); - assertEquals(PropertyStatus.PENDING_REVIEW, updatedLocation.getProperties().getStatus()); - assertEquals(3, updatedLocation.getProperties().getGeographicLevel()); - assertEquals(effectiveStartDate, updatedLocation.getProperties().getEffectiveStartDate()); - assertEquals(effectiveEndDate, updatedLocation.getProperties().getEffectiveEndDate()); - assertEquals(0, updatedLocation.getProperties().getVersion()); - - assertNull(locationRepository.getStructure("3734", true)); - - } - - @Test - public void testUpdateLocationWithoutId() { - PhysicalLocation physicalLocation = new PhysicalLocation(); - locationRepository.add(physicalLocation); - - assertEquals(2, locationRepository.getAll().size()); - assertEquals(2, locationRepository.getAllStructures().size()); - - } - - @Test - public void testUpdateLocationNonExistingShouldNotChangeObject() { - - PhysicalLocation physicalLocation = new PhysicalLocation(); - physicalLocation.setId("223232"); - physicalLocation.setType("Feature"); - physicalLocation.setJurisdiction(true); - locationRepository.update(physicalLocation); - - assertNull(locationRepository.get("223232")); - assertNull(locationRepository.getStructure("223232", true)); - - } - - @Test - public void testUpdateStructure() { - PhysicalLocation structure = locationRepository.getStructure("90397", true); - structure.getProperties().setCode("12121"); - structure.getProperties().setParentId("11"); - long serverVersion=structure.getServerVersion(); - locationRepository.update(structure); - - PhysicalLocation updatedStructure = locationRepository.getStructure("90397", true); - - assertNotNull(updatedStructure); - assertEquals("12121", updatedStructure.getProperties().getCode()); - assertEquals("11", updatedStructure.getProperties().getParentId()); - MatcherAssert.assertThat(updatedStructure.getServerVersion(), Matchers.greaterThan(serverVersion)); - - assertNull(locationRepository.get("90397")); - - } - - @Test - public void testUpdateStructureWithoutId() { - PhysicalLocation structure = new PhysicalLocation(); - locationRepository.add(structure); - - assertEquals(2, locationRepository.getAll().size()); - assertEquals(2, locationRepository.getAllStructures().size()); - - } - - @Test - public void testUpdateStructureExistingShouldNotChangeObject() { - - PhysicalLocation physicalLocation = new PhysicalLocation(); - physicalLocation.setId("223232"); - physicalLocation.setType("Feature"); - locationRepository.update(physicalLocation); - - assertNull(locationRepository.get("223232")); - assertNull(locationRepository.getStructure("223232", true)); - - } - - @Test - public void testGetAll() { - List locations = locationRepository.getAll(); - assertEquals(2, locations.size()); - - locationRepository.safeRemove(locationRepository.get("3734")); - locationRepository.safeRemove(locationRepository.get("3735")); - - assertTrue(locationRepository.getAll().isEmpty()); - - String uuid = UUID.randomUUID().toString(); - PhysicalLocation location = createLocation(uuid); - location.getProperties().setStatus(PropertyStatus.ACTIVE); - locationRepository.add(location); - - locations = locationRepository.getAll(); - - assertEquals(1, locations.size()); - assertEquals("223232", locations.get(0).getId()); - assertEquals(uuid, locations.get(0).getProperties().getUid()); - - } - - @Test - public void testSafeRemoveLocation() { - - assertNotNull(locationRepository.get("3734")); - - locationRepository.safeRemove(locationRepository.get("3734")); - - assertNull(locationRepository.get("3734")); - } - - @Test - public void testSafeRemoveStructure() { - - assertNotNull(locationRepository.getStructure("90397", true)); - - locationRepository.safeRemove(locationRepository.getStructure("90397", true)); - - assertNull(locationRepository.getStructure("90397", true)); - } - - @Test - public void testSafeRemoveNonExistentLocation() { - locationRepository.safeRemove(null); - locationRepository.safeRemove(new PhysicalLocation()); - assertEquals(2, locationRepository.getAll().size()); - - locationRepository.safeRemove(locationRepository.get("671198")); - assertEquals(2, locationRepository.getAll().size()); - - } - - @Test - public void testFindLocationsByServerVersion() { - - List locations = locationRepository.findLocationsByServerVersion(1542378347106l); - assertTrue(locations.isEmpty()); - - locations = locationRepository.findLocationsByServerVersion(1l); - System.out.println(ReflectionToStringBuilder.toString(locations.get(0))); - assertEquals(1, locations.size()); - assertEquals("3734", locations.get(0).getId()); - assertTrue(locations.get(0).getServerVersion() >= 1l); - - locations.get(0).setServerVersion(null); - locations.get(0).setJurisdiction(true); - locationRepository.update(locations.get(0)); - - locations = locationRepository.findLocationsByServerVersion(1l); - assertEquals(1,locations.size()); - - } - - @Test - public void testFindStructuresByParentAndServerVersion() { - - List locations = locationRepository.findStructuresByParentAndServerVersion("3734", 1542376382859l); - assertTrue(locations.isEmpty()); - - locations = locationRepository.findStructuresByParentAndServerVersion("3734", 1542376382851l); - assertEquals(1, locations.size()); - assertEquals("90397", locations.get(0).getId()); - assertEquals("3734", locations.get(0).getProperties().getParentId()); - assertEquals(1542376382851l, locations.get(0).getServerVersion().longValue()); - assertTrue(locations.get(0).getServerVersion() >= 1l); - - locations = locationRepository.findStructuresByParentAndServerVersion("3734,001", 1542376382851l); - assertEquals(1, locations.size()); - assertEquals("90397", locations.get(0).getId()); - assertEquals("3734", locations.get(0).getProperties().getParentId()); - - locations.get(0).setServerVersion(null); - locationRepository.update(locations.get(0)); - - locations = locationRepository.findStructuresByParentAndServerVersion("3734", 0l); - assertEquals(1, locations.size()); - assertTrue(locations.get(0).getServerVersion() > 0); - } - - @Test - public void testFindByEmptyServerVersion() { - - List locations = locationRepository.findByEmptyServerVersion(); - assertEquals(1, locations.size()); - assertEquals("3735", locations.get(0).getId()); - - PhysicalLocation location = locationRepository.get("3735"); - location.setServerVersion(12l); - locationRepository.update(location); - - locations = locationRepository.findByEmptyServerVersion(); - - assertTrue(locations.isEmpty()); - - } - - @Test - public void testFindStructuresByEmptyServerVersion() { - - List locations = locationRepository.findStructuresByEmptyServerVersion(); - assertTrue(locations.isEmpty()); - - PhysicalLocation location = locationRepository.getStructure("90397", true); - location.setServerVersion(null); - locationRepository.update(location); - - locations = locationRepository.findStructuresByEmptyServerVersion(); - assertEquals(0, locations.size()); - - } - - private PhysicalLocation createLocation(String uuid) { - PhysicalLocation physicalLocation = new PhysicalLocation(); - physicalLocation.setId("223232"); - physicalLocation.setType("Feature"); - physicalLocation.setJurisdiction(true); - Geometry geometry = new Geometry(); - geometry.setType(GeometryType.MULTI_POLYGON); - physicalLocation.setGeometry(geometry); - LocationProperty properties = new LocationProperty(); - properties.setStatus(PropertyStatus.INACTIVE); - properties.setUid(uuid); - properties.setName("01_5"); - physicalLocation.setProperties(properties); - return physicalLocation; - - } - - private PhysicalLocation createStructure(String uuid) { - PhysicalLocation physicalLocation = new PhysicalLocation(); - physicalLocation.setId("121212"); - physicalLocation.setType("Feature"); - Geometry geometry = new Geometry(); - geometry.setType(GeometryType.POLYGON); - physicalLocation.setGeometry(geometry); - LocationProperty properties = new LocationProperty(); - properties.setStatus(PropertyStatus.ACTIVE); - properties.setUid(uuid); - physicalLocation.setProperties(properties); - return physicalLocation; - } - - @Test - public void testFindLocationsByNames() { - - List locations = locationRepository.findLocationsByNames("MKB_5", 0l); - assertTrue(locations.isEmpty()); - - PhysicalLocation parentLocation = gson.fromJson(parentJson, PhysicalLocation.class); - parentLocation.setJurisdiction(true); - locationRepository.add(parentLocation); - - locations = locationRepository.findLocationsByNames("MKB_5", 0l); - assertEquals(1, locations.size()); - PhysicalLocation location = locations.get(0); - assertEquals("MKB_5", location.getProperties().getName()); - assertEquals("Feature", location.getType()); - assertEquals(GeometryType.MULTI_POLYGON, location.getGeometry().getType()); - - locations = locationRepository.findLocationsByNames("MKB_5,other_location_name", 0l); - assertEquals(1, locations.size()); - location = locations.get(0); - assertEquals("MKB_5", location.getProperties().getName()); - assertEquals("Feature", location.getType()); - assertEquals(GeometryType.MULTI_POLYGON, location.getGeometry().getType()); - - } - - @Test - public void testFindStructureAndFamilyDetailsWithFamilyDetails() throws SQLException { - scripts.add("client.sql"); - populateDatabase(); - - Client family = new Client(UUID.randomUUID().toString()).withFirstName("Otala").withLastName("Family"); - family.withAttribute(ClientsRepositoryImpl.RESIDENCE, "90397"); - clientsRepository.add(family); - - double latitude = -14.1619809; - double longitude = 32.5978597; - - Collection details = locationRepository.findStructureAndFamilyDetails(latitude, longitude, 100); - assertEquals(0, details.size()); - - details = locationRepository.findStructureAndFamilyDetails(latitude, longitude, 1000); - assertEquals(1, details.size()); - - StructureDetails structureDetails = details.iterator().next(); - assertEquals("90397", structureDetails.getStructureId()); - assertEquals("3734", structureDetails.getStructureParentId()); - assertEquals("Residential Structure", structureDetails.getStructureType()); - assertEquals(family.getBaseEntityId(), structureDetails.getFamilyId()); - assertEquals(1, structureDetails.getFamilyMembers().size()); - assertEquals("d4eda055-60c6-44a4-ba48-61dfe6485bea", structureDetails.getFamilyMembers().iterator().next()); - } - - @Test - public void testFindStructureAndFamilyDetailsWithoutFamilyDetails() { - double latitude = -14.1619809; - double longitude = 34.5978597; - - Collection details = locationRepository.findStructureAndFamilyDetails(latitude, longitude, 1000); - assertEquals(0, details.size()); - - String uuid = UUID.randomUUID().toString(); - PhysicalLocation structure = createStructure(uuid); - JsonArray cordinates = new JsonArray(); - cordinates.add(new JsonPrimitive(longitude)); - cordinates.add(new JsonPrimitive(latitude)); - structure.getGeometry().setCoordinates(cordinates); - structure.getGeometry().setType(GeometryType.POINT); - structure.getProperties().setParentId("2465476"); - structure.getProperties().setType("Larvacide Point"); - locationRepository.add(structure); - - details = locationRepository.findStructureAndFamilyDetails(latitude, longitude, 1000); - assertEquals(1, details.size()); - - StructureDetails structureDetails = details.iterator().next(); - assertEquals("121212", structureDetails.getStructureId()); - assertEquals("2465476", structureDetails.getStructureParentId()); - assertEquals("Larvacide Point", structureDetails.getStructureType()); - assertTrue(structureDetails.getFamilyMembers().isEmpty()); - - assertTrue(locationRepository.findStructureAndFamilyDetails(latitude + 1, longitude, 1000).isEmpty()); - - double metersPerDegree = 110637; - assertEquals(1, locationRepository.findStructureAndFamilyDetails(latitude + 1, longitude, metersPerDegree).size()); - } - - @Test - public void testFindLocationsByPropertiesWithoutProperties() { - List locations = locationRepository.findLocationsByProperties(false, "21", null); - assertEquals(1, locations.size()); - assertEquals("3734", locations.get(0).getId()); - assertNull(locations.get(0).getGeometry()); - - locations = locationRepository.findLocationsByProperties(true, "21", null); - assertEquals(1, locations.size()); - assertEquals("3734", locations.get(0).getId()); - assertNotNull(locations.get(0).getGeometry()); - - locations = locationRepository.findLocationsByProperties(true, null, null); - assertEquals(2, locations.size()); - assertEquals("3734", locations.get(0).getId()); - assertEquals(GeometryType.MULTI_POLYGON, locations.get(0).getGeometry().getType()); - assertEquals(267, - locations.get(0).getGeometry().getCoordinates().get(0).getAsJsonArray().get(0).getAsJsonArray().size()); - - // test non-existent parent - locations = locationRepository.findLocationsByProperties(true, "1233", null); - assertTrue(locations.isEmpty()); - - } - - @Test - public void testFindLocationsByProperties() { - - Map filters = new HashMap<>(); - filters.put("code", "3734"); - filters.put("name", "Bangladesh"); - filters.put("uid", "41587456-b7c8-4c4e-b433-23a786f742fc"); - List locations = locationRepository.findLocationsByProperties(true, null, filters); - assertEquals(1, locations.size()); - assertEquals("3734", locations.get(0).getId()); - assertEquals("Bangladesh", locations.get(0).getProperties().getName()); - assertEquals(GeometryType.MULTI_POLYGON, locations.get(0).getGeometry().getType()); - JsonArray coordinates = locations.get(0).getGeometry().getCoordinates().get(0).getAsJsonArray().get(0) - .getAsJsonArray(); - assertEquals(267, coordinates.size()); - - JsonArray coordinate1 = coordinates.get(0).getAsJsonArray(); - assertEquals(32.59989007736522, coordinate1.get(0).getAsDouble(), 0); - assertEquals(-14.167432040756012, coordinate1.get(1).getAsDouble(), 0); - - JsonArray coordinate67 = coordinates.get(66).getAsJsonArray(); - assertEquals(32.5988341383848, coordinate67.get(0).getAsDouble(), 0); - assertEquals(-14.171814074659776, coordinate67.get(1).getAsDouble(), 0); - - // test non-existent property value - filters.put("name", "name1"); - locations = locationRepository.findLocationsByProperties(true, null, filters); - assertTrue(locations.isEmpty()); - - } - - @Test - public void testFindStructuresByPropertiesWithoutProperties() { - List structures = locationRepository.findStructuresByProperties(false, "3734", null); - assertEquals(1, structures.size()); - assertEquals("90397", structures.get(0).getId()); - assertNull(structures.get(0).getGeometry()); - - structures = locationRepository.findStructuresByProperties(true, "3734", null); - assertEquals(1, structures.size()); - assertEquals("90397", structures.get(0).getId()); - assertNotNull(structures.get(0).getGeometry()); - - structures = locationRepository.findStructuresByProperties(true, null, null); - assertEquals(2, structures.size()); - assertEquals("90397", structures.get(0).getId()); - assertEquals(GeometryType.POLYGON, structures.get(0).getGeometry().getType()); - assertEquals(2, - structures.get(0).getGeometry().getCoordinates().get(0).getAsJsonArray().get(0).getAsJsonArray().size()); - - // test non-existent parent - structures = locationRepository.findLocationsByProperties(true, "1233", null); - assertTrue(structures.isEmpty()); - } - - @Test - public void testFindStructuresByProperties() { - - Map filters = new HashMap<>(); - filters.put("code", "21384443"); - filters.put("geographicLevel", "5"); - filters.put("type", "Residential Structure"); - List locations = locationRepository.findStructuresByProperties(true, null, filters); - assertEquals(1, locations.size()); - assertEquals("90397", locations.get(0).getId()); - assertEquals("21384443", locations.get(0).getProperties().getCode()); - assertNull(locations.get(0).getProperties().getName()); - assertEquals("Residential Structure", locations.get(0).getProperties().getType()); - assertEquals(GeometryType.POLYGON, locations.get(0).getGeometry().getType()); - assertEquals(2, - locations.get(0).getGeometry().getCoordinates().get(0).getAsJsonArray().get(0).getAsJsonArray().size()); - - // test non-existent property - filters.put("name", "House23"); - locations = locationRepository.findStructuresByProperties(true, null, filters); - assertTrue(locations.isEmpty()); - - } - - @Test - public void testFindLocationByIdWithChildren() { - - List locations = locationRepository.findLocationByIdWithChildren(true, "3734", 10); - assertEquals(2, locations.size()); - for (PhysicalLocation location : locations) { - MatcherAssert.assertThat(location.getId(), either(is("3734")).or(is("3735"))); - } - } - - @Test - public void testFindLocationByIdsWithChildren() { - - List locations = locationRepository.findLocationByIdsWithChildren(true, - new HashSet<>(Arrays.asList("3734", "3735")), 10); - assertEquals(2, locations.size()); - for (PhysicalLocation location : locations) { - MatcherAssert.assertThat(location.getId(), either(is("3734")).or(is("3735"))); - } - } - - @Test - public void testFindAllLocationIdsShouldOrderByServerVersion() { - - Pair, Long> idsModel = locationRepository.findAllLocationIds(-2l, 10); - List locationsIds = idsModel.getLeft(); - assertEquals(2, locationsIds.size()); - assertEquals("3735", locationsIds.get(0)); - assertEquals("3734", locationsIds.get(1)); - assertEquals(1542378347104l, idsModel.getRight().longValue()); - - } - - @Test - public void testFindAllLocationIdsShouldLimitByGivenParam() { - - Pair, Long> idsModel = locationRepository.findAllLocationIds(-2l, 1); - List locationsIds = idsModel.getLeft(); - assertEquals(1, locationsIds.size()); - assertEquals("3735", locationsIds.get(0)); - assertEquals(0l, idsModel.getRight().longValue()); - - } - - @Test - public void testFindAllStructureIdsShouldOrderByServerVersion() { - - Pair, Long> idsModel = locationRepository.findAllStructureIds(0l, 10); - List structureIds = idsModel.getLeft(); - assertEquals(2, structureIds.size()); - assertEquals("90397", structureIds.get(0)); - assertEquals("90398", structureIds.get(1)); - assertEquals(1542376382862l, idsModel.getRight().longValue()); - } - - @Test - public void testFindAllStructureIdsShouldLimitByGivenParam() { - - Pair, Long> idsModel = locationRepository.findAllStructureIds(0l, 1); - List structureIds = idsModel.getLeft(); - assertEquals(1, structureIds.size()); - assertEquals("90397", structureIds.get(0)); - assertEquals(1542376382851l, idsModel.getRight().longValue()); - } - - @Test - public void testFindAllStructureIdsShouldFilterBetweenFromAndToDate() { - String date1 = "2020-09-25T10:00:00+0300"; - String date2 = "2020-09-27T10:00:00+0300"; - - Pair, Long> idsModel = locationRepository.findAllStructureIds(0l, 2, - new DateTime(date1, DateTimeZone.UTC).toDate(), new DateTime(date2, DateTimeZone.UTC).toDate()); - List structureIds = idsModel.getLeft(); - assertEquals(2, structureIds.size()); - } - - @Test - public void testFindAllStructureIdsShouldFilterFromDateAsMinimumDate() { - String date2 = "2020-09-26T10:00:00+0300"; - - Pair, Long> idsModel = locationRepository.findAllStructureIds(0l, 2, - new DateTime(date2, DateTimeZone.UTC).toDate(), null); - List structureIds = idsModel.getLeft(); - assertEquals(1, structureIds.size()); - } - - @Test - public void testFindAllStructureIdsShouldFilterToDateAsMaximumDate() { - String date3 = "2020-09-27T10:00:00+0300"; - - Pair, Long> idsModel = locationRepository.findAllStructureIds(0l, 2, - null, new DateTime(date3, DateTimeZone.UTC).toDate()); - List structureIds = idsModel.getLeft(); - assertEquals(2, structureIds.size()); - } - - @Test - public void testSearchlLocationsWithFilters() { - LocationTagMap locationTagMap = new LocationTagMap(); - locationTagMap.setLocationId(2l); - locationTagMap.setLocationTagId(2l); - LocationSearchBean locationSearchBean = new LocationSearchBean(); - locationSearchBean.setName("a"); - locationSearchBean.setLocationTagId(2l); - locationSearchBean.setPageSize(20); - locationSearchBean.setPageNumber(1); - locationSearchBean.setOrderByFieldName("id"); - locationSearchBean.setOrderByType(OrderByType.ASC); - locationTagRepository.addLocationTagMap(locationTagMap); - List locations = new ArrayList(); - locations = locationRepository.searchLocations(locationSearchBean); - assertNotNull(locations); - assertEquals(1l, locations.size()); - } - - @Test - public void testSearchLocationsWithoutFilters() { - LocationTagMap locationTagMap = new LocationTagMap(); - locationTagMap.setLocationId(2l); - locationTagMap.setLocationTagId(2l); - LocationSearchBean locationSearchBean = new LocationSearchBean(); - locationTagRepository.addLocationTagMap(locationTagMap); - List locations = new ArrayList(); - locations = locationRepository.searchLocations(locationSearchBean); - assertNotNull(locations); - assertEquals(1l, locations.size()); - locationSearchBean.setPageSize(0); - locations = locationRepository.searchLocations(locationSearchBean); - assertEquals(1l, locations.size()); - } - - @Test - public void testSearchLocationsWithEmptyRecords() { - LocationTagMap locationTagMap = new LocationTagMap(); - locationTagMap.setLocationId(2l); - locationTagMap.setLocationTagId(2l); - - LocationSearchBean locationSearchBean = new LocationSearchBean(); - locationSearchBean.setName("no location"); - locationTagRepository.addLocationTagMap(locationTagMap); - List locations = new ArrayList(); - locations = locationRepository.searchLocations(locationSearchBean); - assertTrue(locations.isEmpty()); - } - - @Test(expected = IllegalArgumentException.class) - public void testSearchLocationsWithoutPageNumber() { - LocationSearchBean locationSearchBean = new LocationSearchBean(); - locationSearchBean.setName("a"); - locationSearchBean.setLocationTagId(2l); - locationSearchBean.setPageSize(20); - locationSearchBean.setPageNumber(0); - locationRepository.searchLocations(locationSearchBean); - } - - @Test - public void testCountSearchLocationsWithFilters() { - LocationTagMap locationTagMap = new LocationTagMap(); - locationTagMap.setLocationId(2l); - locationTagMap.setLocationTagId(2l); - locationTagRepository.addLocationTagMap(locationTagMap); - LocationSearchBean locationSearchBean = new LocationSearchBean(); - locationSearchBean.setName("a"); - locationSearchBean.setLocationTagId(2l); - int totalCount = locationRepository.countSearchLocations(locationSearchBean); - assertEquals(1l, totalCount); - } - - @Test - public void testCountSearchLocationsWithoutFilters() { - LocationTagMap locationTagMap = new LocationTagMap(); - locationTagMap.setLocationId(2l); - locationTagMap.setLocationTagId(2l); - locationTagRepository.addLocationTagMap(locationTagMap); - LocationSearchBean locationSearchBean = new LocationSearchBean(); - locationSearchBean.setName("Khulna"); - locationSearchBean.setLocationTagId(2l); - int totalCount = locationRepository.countSearchLocations(locationSearchBean); - assertEquals("total count should be zero", 0, totalCount); - } - - @Test - public void testfindParentLocationsInclusive() { - - PhysicalLocation location = locationRepository.get("3734"); - List expectedTags = locationTagRepository.getAll(); - location.setLocationTags(new HashSet<>(expectedTags)); - locationRepository.update(location); - - Set identifiers = Collections.singleton("3735"); - Set locations = locationRepository.findParentLocationsInclusive(identifiers); - assertEquals(2, locations.size()); - Iterator it = locations.iterator(); - LocationDetail locationDetail = it.next(); - MatcherAssert.assertThat(locationDetail.getIdentifier(), is("3735")); - assertEquals("Dhaka", locationDetail.getName()); - assertEquals("3734", locationDetail.getParentId()); - assertEquals(2l, locationDetail.getId().longValue()); - - locationDetail = it.next(); - MatcherAssert.assertThat(locationDetail.getIdentifier(), is("3734")); - assertEquals("Bangladesh", locationDetail.getName()); - assertEquals("21", locationDetail.getParentId()); - assertEquals(1l, locationDetail.getId().longValue()); - - - assertEquals(2, locationRepository.findParentLocationsInclusive(new HashSet<>(Arrays.asList("3735", "21"))).size()); - - //Location without a parent - locations = locationRepository.findParentLocationsInclusive(Collections.singleton("3734")); - assertEquals(1, locations.size()); - LocationDetail actualLocationDetail = locations.iterator().next(); - assertEquals("3734", actualLocationDetail.getIdentifier()); - assertEquals("Bangladesh", actualLocationDetail.getName()); - assertEquals("21", actualLocationDetail.getParentId()); - assertEquals(1l, actualLocationDetail.getId().longValue()); - List tags = Arrays.asList(actualLocationDetail.getTags().split(",")); - assertEquals(expectedTags.size(), tags.size()); - assertTrue(tags.contains(expectedTags.get(0).getName())); - assertTrue(tags.contains(expectedTags.get(1).getName())); - - //Non existent location - assertEquals(0, locationRepository.findParentLocationsInclusive(Collections.singleton("21")).size()); - } - - @Test - public void testfindParentLocationsInclusiveWithReturnTagsFalse() { - - PhysicalLocation location = locationRepository.get("3734"); - List expectedTags = locationTagRepository.getAll(); - location.setLocationTags(new HashSet<>(expectedTags)); - locationRepository.update(location); - - Set identifiers = Collections.singleton("3735"); - Set locations = locationRepository.findParentLocationsInclusive(identifiers, false); - assertEquals(2, locations.size()); - for (LocationDetail l : locations) { - MatcherAssert.assertThat(l.getIdentifier(), either(is("3734")).or(is("3735"))); - } - - assertEquals(2, locationRepository.findParentLocationsInclusive(new HashSet<>(Arrays.asList("3735", "21"))).size()); - - //Location without a parent - locations = locationRepository.findParentLocationsInclusive(Collections.singleton("3734"), false); - assertEquals(1, locations.size()); - LocationDetail actualLocationDetail = locations.iterator().next(); - assertEquals("3734", actualLocationDetail.getIdentifier()); - assertEquals("Bangladesh", actualLocationDetail.getName()); - assertEquals("21", actualLocationDetail.getParentId()); - assertEquals(1l, actualLocationDetail.getId().longValue()); - assertNull(actualLocationDetail.getTags()); - - //Non existent location - assertEquals(0, locationRepository.findParentLocationsInclusive(Collections.singleton("21")).size()); - } - - @Test - public void testCountStructuresByParentAndServerVersion() { - - Long locations = locationRepository.countStructuresByParentAndServerVersion("3734", 1542376382859l); - assertEquals(0, locations.longValue()); - - locations = locationRepository.countStructuresByParentAndServerVersion("3734", 1542376382851l); - assertEquals(1, locations.longValue()); - - locations = locationRepository.countStructuresByParentAndServerVersion("3734,001", 1542376382851l); - assertEquals(1, locations.longValue()); - - } - - @Test - public void testcountLocationsByServerVersion() { - - Long locations = locationRepository.countLocationsByServerVersion(1542378347106l); - assertEquals(0, locations.longValue()); - - locations = locationRepository.countLocationsByServerVersion(1l); - assertEquals(1, locations.longValue()); - - } - - @Test - public void testCountLocationsByNames() { - - Long locations = locationRepository.countLocationsByNames("MKB_5", 0l); - assertEquals(0, locations.longValue()); - - PhysicalLocation parentLocation = gson.fromJson(parentJson, PhysicalLocation.class); - parentLocation.setJurisdiction(true); - locationRepository.add(parentLocation); - - locations = locationRepository.countLocationsByNames("MKB_5", 0l); - assertEquals(1, locations.longValue()); - - locations = locationRepository.countLocationsByNames("MKB_5,other_location_name", 0l); - assertEquals(1, locations.longValue()); - - } - - @Test - public void testSelectDetailsByPlanId() { - - String planIdentifier = "a8b3010c-1ba5-556d-8b16-71266397b8b9"; - Set locationDetails = locationRepository.findLocationDetailsByPlanId(planIdentifier); - assertFalse(locationDetails.isEmpty()); - assertEquals(1, locationDetails.size()); - } - - @Test - public void testFindLocationWithDescendants() { - Set locations = locationRepository.findLocationWithDescendants("3734", false); - - assertEquals(2, locations.size()); - - Iterator it = locations.iterator(); - LocationDetail location = it.next(); - MatcherAssert.assertThat(location.getIdentifier(), is("3735")); - assertEquals("Dhaka", location.getName()); - assertEquals("3734", location.getParentId()); - assertEquals(2l, location.getId().longValue()); - - location = it.next(); - MatcherAssert.assertThat(location.getIdentifier(), is("3734")); - assertEquals("Bangladesh", location.getName()); - assertEquals("21", location.getParentId()); - assertEquals(1l, location.getId().longValue()); - - locations = locationRepository.findLocationWithDescendants("3735", true); - assertEquals(1, locations.size()); - LocationDetail actualLocationdetail = locations.iterator().next(); - assertEquals("3735", actualLocationdetail.getIdentifier()); - assertEquals("Dhaka", actualLocationdetail.getName()); - assertEquals("3734", actualLocationdetail.getParentId()); - assertEquals(2l, actualLocationdetail.getId().longValue()); - - assertEquals(0, locationRepository.findLocationWithDescendants("21", false).size()); - } - - @Test - public void testFindLocationWithDescendantsToCheckOrder() { - String uuid = UUID.randomUUID().toString(); - PhysicalLocation physicalLocation = createLocation(uuid); - physicalLocation.getProperties().setStatus(PropertyStatus.ACTIVE); - locationRepository.add(physicalLocation); - - uuid = UUID.randomUUID().toString(); - physicalLocation = createLocation(uuid); - physicalLocation.setId("1"); - physicalLocation.getProperties().setStatus(PropertyStatus.ACTIVE); - physicalLocation.getProperties().setParentId("223232"); - physicalLocation.getProperties().setGeographicLevel(1); - physicalLocation.getProperties().setName("Ambatondrazaka"); - locationRepository.add(physicalLocation); - - uuid = UUID.randomUUID().toString(); - physicalLocation = createLocation(uuid); - physicalLocation.setId("2"); - physicalLocation.getProperties().setStatus(PropertyStatus.ACTIVE); - physicalLocation.getProperties().setParentId("223232"); - physicalLocation.getProperties().setGeographicLevel(1); - physicalLocation.getProperties().setName("MAROVOAY"); - locationRepository.add(physicalLocation); - - Set locations = locationRepository.findLocationWithDescendants("223232", false); - - assertEquals(3, locations.size()); - Iterator it = locations.iterator(); - LocationDetail actualLocationdetail = it.next(); - assertEquals("Ambatondrazaka", actualLocationdetail.getName()); - assertEquals("223232", actualLocationdetail.getParentId()); - assertEquals(new Integer(1), actualLocationdetail.getGeographicLevel()); - - actualLocationdetail = it.next(); - assertEquals("MAROVOAY", actualLocationdetail.getName()); - assertEquals("223232", actualLocationdetail.getParentId()); - assertEquals(new Integer(1), actualLocationdetail.getGeographicLevel()); - - actualLocationdetail = it.next(); - assertEquals("01_5", actualLocationdetail.getName()); - assertEquals(null, actualLocationdetail.getParentId()); - assertEquals(new Integer(0), actualLocationdetail.getGeographicLevel()); - } - - @Test - public void testFindStructureCountsForLocation() { - Set locationIds = new HashSet<>(); - locationIds.add("3724"); - locationIds.add("3734"); - - List structureCounts = locationRepository.findStructureCountsForLocation(locationIds); - structureCounts.size(); - assertEquals("3724", structureCounts.get(0).getParentId()); - assertEquals(1, structureCounts.get(0).getCount()); - - assertEquals("3734", structureCounts.get(1).getParentId()); - assertEquals(1, structureCounts.get(0).getCount()); - - } - - @Test - public void testFindChildLocationByJurisdiction() { - - List locationIds = locationRepository.findChildLocationByJurisdiction("3734"); - assertEquals(2, locationIds.size()); - for (String id : locationIds) { - MatcherAssert.assertThat(id, either(is("3734")).or(is("3735"))); - } - } - - @Test - public void testFindLocationByIdentifierAndStatus() { - - PhysicalLocation actualLocation = locationRepository.findLocationByIdentifierAndStatus("3734", - Collections.singletonList(LocationProperty.PropertyStatus.ACTIVE.name()), false); - - assertEquals("3734", actualLocation.getId()); - assertEquals("Bangladesh", actualLocation.getProperties().getName()); - assertEquals("21", actualLocation.getProperties().getParentId()); - - PhysicalLocation actualInactiveLocation = locationRepository.findLocationByIdentifierAndStatus("3734", - Collections.singletonList(LocationProperty.PropertyStatus.INACTIVE.name()), false); - assertNull(actualInactiveLocation); - - } - - @Test - public void testFindLocationsByIdsReturnsCorrectLocations() { - List locations = locationRepository.findLocationsByIds(true, Arrays.asList("3734","3735"), 0l); - assertEquals(2, locations.size()); - for (PhysicalLocation location : locations) { - MatcherAssert.assertThat(location.getId(), either(is("3734")).or(is("3735"))); - } - - locations = locationRepository.findLocationsByIds(true, Arrays.asList("3734","3735"), 10l); - assertEquals(1, locations.size()); - assertEquals("3734", locations.get(0).getId()); - - - locations = locationRepository.findLocationsByIds(true, Arrays.asList("3734"), System.currentTimeMillis()); - assertEquals(0, locations.size()); - - locations = locationRepository.findLocationsByIds(true, Arrays.asList("373412"), 0l); - assertEquals(0, locations.size()); - - } - - @Test - public void testCountLocationsByIdsReturnsCorrectCount() { - assertEquals(2, locationRepository.countLocationsByIds( Arrays.asList("3734","3735"), 0l)); - - - assertEquals(1, locationRepository.countLocationsByIds( Arrays.asList("3734","3735"), 10l)); - - assertEquals(0,locationRepository.countLocationsByIds( Arrays.asList("3734"), System.currentTimeMillis())); - - assertEquals(0,locationRepository.countLocationsByIds( Arrays.asList("373412"), 0l)); - - } - - @Test - public void testCountAllStructuresShouldReturnCorrectValue() { - Long count = locationRepository.countAllStructures(0l); - assertEquals(Long.valueOf(2), count); - } - - @Test - public void testCountAllLocationsShouldReturnCorrectValue() { - Long count = locationRepository.countAllLocations(0l); - assertEquals(Long.valueOf(2), count); - } - - @Test - public void testFindAllLocations() { - List locations = locationRepository.findAllLocations(true, 0l, 10, true); - assertEquals(2,locations.size()); - String uuid = UUID.randomUUID().toString(); + + private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HHmm") + .registerTypeAdapter(LocationProperty.class, new PropertiesConverter()).serializeNulls().create(); + private String parentJson = "{\"id\": \"3366\",\"locationTags\": [{\"active\":true,\"name\":\"District\",\"description\":\"description\",\"id\":1}], \"type\": \"Feature\", \"geometry\": {\"type\": \"MultiPolygon\", \"coordinates\": [[[[32.60019625316408, -14.16712789883206], [32.60026392129685, -14.167200170670068], [32.600326068380916, -14.167277018364924], [32.60038237040833, -14.167358041272504], [32.60043253384264, -14.167442816981005], [32.600461865346055, -14.167501855260806], [32.600467305754925, -14.167504082164154], [32.6005567791152, -14.167548365892056], [32.60064274437109, -14.16759883363829], [32.60072475334385, -14.167655222291442], [32.600802378479834, -14.167717237871212], [32.60087521507938, -14.167784557061506], [32.60094288340667, -14.167856828895705], [32.60100503066945, -14.167933676586241], [32.6010613328587, -14.168014699489389], [32.60111149643739, -14.16809947519317], [32.601155259871, -14.168187561720227], [32.60119239499158, -14.168278499831782], [32.60122270818726, -14.168371815421606], [32.601246041411336, -14.168467021987961], [32.60126227300679, -14.16856362316997], [32.60127131834104, -14.168661115335109], [32.601273130246504, -14.168758990205273], [32.60126809520835, -14.168849611326149], [32.601268746132114, -14.168884772675423], [32.60126331515021, -14.16898251997554], [32.601250669585276, -14.1690796300968], [32.6012308753564, -14.169175596751185], [32.60120403565332, -14.169269919610993], [32.6011702903973, -14.169362106918296], [32.60112981551378, -14.169451678048457], [32.60108282201332, -14.169538166015567], [32.60102955489338, -14.169621119908012], [32.60097029185993, -14.169700107238382], [32.60090534188031, -14.169774716199182], [32.6008350435718, -14.169844557809366], [32.600817649001606, -14.169859510027148], [32.60076264386304, -14.169914157803586], [32.60068736370561, -14.169978867936662], [32.60060749419761, -14.170038109219828], [32.600559934780954, -14.170068364123377], [32.60056014202427, -14.170070597813773], [32.6005619539411, -14.170168472672398], [32.60055652292868, -14.170266219962112], [32.60054387729263, -14.170363330073084], [32.600524082952795, -14.170459296717066], [32.60049724309874, -14.170553619566872], [32.600463497653145, -14.170645806864396], [32.60042302254208, -14.17073537798495], [32.60037602877764, -14.170821865942909], [32.600344492416745, -14.170870977832461], [32.60034438539213, -14.170871496706125], [32.60031754548958, -14.170965819552745], [32.60028379998311, -14.171058006847087], [32.600243324799, -14.171147577964515], [32.600196330949636, -14.17123406591946], [32.600143063434295, -14.171317019800309], [32.60008379996071, -14.171396007119537], [32.600018849498774, -14.171470616069879], [32.59994855066821, -14.171540457670288], [32.59987326997469, -14.17160516779455], [32.59979339989791, -14.171664409069702], [32.59970935684628, -14.171717872634868], [32.59964225969093, -14.17175411050408], [32.59958840035244, -14.171794059057728], [32.599504357253004, -14.171847522622325], [32.59941657934149, -14.171894929738581], [32.59932552425658, -14.17193603324409], [32.59923166672291, -14.171970618840756], [32.599135496077615, -14.171998506212216], [32.599037513717285, -14.172019549964542], [32.59893823048531, -14.17203364038323], [32.598838164007354, -14.172040704006005], [32.59873783599283, -14.172040704006005], [32.5986377695147, -14.17203364038323], [32.598538486282784, -14.172019549964542], [32.59844050392257, -14.171998506212216], [32.59836476694522, -14.171976544154969], [32.598302157782705, -14.172016372605977], [32.598214379806386, -14.172063779721551], [32.59812332465395, -14.172104883226435], [32.59802946705104, -14.172139468822703], [32.59793329633447, -14.172167356193764], [32.59783531390183, -14.17218839994575], [32.59773603059636, -14.172202490364267], [32.59763596404451, -14.172209553987042], [32.597535635955744, -14.172209553987042], [32.59743556940372, -14.172202490364267], [32.59735870544443, -14.17219158172912], [32.59734235282223, -14.172210366013356], [32.597272053763895, -14.172280207609443], [32.59721759844722, -14.172327016406367], [32.59719788529895, -14.172349660918595], [32.59712758619781, -14.172419502513943], [32.59705230521461, -14.172484212633432], [32.59697243483037, -14.172543453904321], [32.59691580121147, -14.17257948095516], [32.596914419626664, -14.172580505700747], [32.596830376237726, -14.172633969261877], [32.59674259802403, -14.172681376375007], [32.59665154262529, -14.172722479877844], [32.59655768476852, -14.172757065472238], [32.59646151379189, -14.17278495284199], [32.59636353109419, -14.172805996592896], [32.59626424752013, -14.172820087010617], [32.596164180697365, -14.172827150632937], [32.596063852337345, -14.172827150632937], [32.595963785514634, -14.172820087010617], [32.595864501940746, -14.172805996592896], [32.59576651924305, -14.17278495284199], [32.595670348266246, -14.172757065472238], [32.59562983666279, -14.17274213738909], [32.59557352665137, -14.17277254919497], [32.595482471216194, -14.172813652697524], [32.59538861332191, -14.172848238291575], [32.595346903973216, -14.172860333037871], [32.59534239579221, -14.172862368083766], [32.59524853787786, -14.172896953677704], [32.59515236684228, -14.172924841047173], [32.595054384084555, -14.17294588479774], [32.59495510044973, -14.172959975215402], [32.594855033565686, -14.172967038837665], [32.59475470514422, -14.172967038837665], [32.59465463826023, -14.172959975215402], [32.594555354625406, -14.17294588479774], [32.59445737186763, -14.172924841047173], [32.59442506589232, -14.172915473063707], [32.59433007182053, -14.172915473063707], [32.59423000495905, -14.17290840944133], [32.594130721346794, -14.172894319023781], [32.59403273861107, -14.172873275273044], [32.593936567597375, -14.172845387903461], [32.59384270970417, -14.172810802309353], [32.59375165427024, -14.1727696988068], [32.59366387602261, -14.172722291693898], [32.59357983260116, -14.172668828133279], [32.593499962173034, -14.172609586863073], [32.5934246811484, -14.172544876744151], [32.5934126306829, -14.172532904709552], [32.59335004540372, -14.17247910759323], [32.593279746284274, -14.172409265998223], [32.593214795555234, -14.172334657053792], [32.59315553183807, -14.172255669740649], [32.59310226410371, -14.172172715866392], [32.59305527006142, -14.172086227918097], [32.593014794710705, -14.171996656807604], [32.592981049065706, -14.171904469520424], [32.59295420905283, -14.171810146681306], [32.592934414595895, -14.17171418004801], [32.59292176888527, -14.171617069947953], [32.59291633784067, -14.171519322669322], [32.59291814976836, -14.171421447821611], [32.592927195211864, -14.171323955678812], [32.59294342700377, -14.17122735451903], [32.5929667605099, -14.171132147974616], [32.59299707407205, -14.171038832406278], [32.593034209641694, -14.170947894315642], [32.59307797360429, -14.17085980780882], [32.59312813778927, -14.170775032124592], [32.59318444065922, -14.170694009240147], [32.593246588673246, -14.170617161567233], [32.59331425781857, -14.170544889749747], [32.59338709529839, -14.17047757057497], [32.59346472137269, -14.170415555009466], [32.59354673133668, -14.17035916636939], [32.593632697631556, -14.170308698634809], [32.59372217207328, -14.17026441491714], [32.59381468818895, -14.17022654608763], [32.59390976364897, -14.170195289573538], [32.59400690278124, -14.17017080832937], [32.59410559915556, -14.17015322998668], [32.594108641289544, -14.170152907171083], [32.59410452416977, -14.170078807274818], [32.594104747347494, -14.170066751816304], [32.59409492477396, -14.170019130079421], [32.594082279157185, -14.169922019965721], [32.59407684815306, -14.169824272673221], [32.59407866006705, -14.169726397811754], [32.59408770544342, -14.169628905655198], [32.5941039371147, -14.169532304481717], [32.59412727044752, -14.169437097923888], [32.59415758378457, -14.169343782342306], [32.59419471907852, -14.16925284423888], [32.59423848271643, -14.169164757719555], [32.59428864652886, -14.169079982023387], [32.59434494898084, -14.168998959127517], [32.59440709653352, -14.168922111443745], [32.594474765176464, -14.16884983961597], [32.59454760211582, -14.168782520431701], [32.59462522761384, -14.168720504857387], [32.594707236969036, -14.168664116209353], [32.59479320262607, -14.168613648467609], [32.59488267640358, -14.168569364743629], [32.594975191832525, -14.168531495908722], [32.59507026658701, -14.168500239390308], [32.59516740499827, -14.168475758142618], [32.59526610063994, -14.168458179797423], [32.59529244876699, -14.168455383848364], [32.59529777359045, -14.168442344202102], [32.59534153707289, -14.16835425767692], [32.595391700707346, -14.168269481975013], [32.595448002959465, -14.16818845907363], [32.59551015029154, -14.168111611384685], [32.59557781869437, -14.16803933955202], [32.5956506553752, -14.167972020363091], [32.595728280597704, -14.16791000478474], [32.59578277701842, -14.167872533564658], [32.59578663074716, -14.167869454781108], [32.59586863979683, -14.167813066128982], [32.595870154342826, -14.167812176983087], [32.59588304190657, -14.167790397169766], [32.595939344040566, -14.167709374265083], [32.59600149124241, -14.167632526573069], [32.59606915950308, -14.167560254737506], [32.59614199603117, -14.167492935545964], [32.59621962109099, -14.167430919964941], [32.59630162998314, -14.167374531310939], [32.59638759515462, -14.16732406356368], [32.59647706842696, -14.167279779834924], [32.596569583333626, -14.167241910996037], [32.59666465755111, -14.1672106544741], [32.59676179541406, -14.16718617322385], [32.59686049049849, -14.167168594876781], [32.59696022826284, -14.167158011076763], [32.597060488729475, -14.167154477001755], [32.59716074919606, -14.167158011076763], [32.5972604869604, -14.167168594876781], [32.59731452694961, -14.167178219810861], [32.59732387518306, -14.167149442233491], [32.597361010120146, -14.167058504113466], [32.59740477333741, -14.166970417578053], [32.59745493666792, -14.166885641866255], [32.59751123857881, -14.166804618955549], [32.59757338553447, -14.16672777125768], [32.59764105352729, -14.166655499416716], [32.59771388976673, -14.16658818022], [32.597791514519024, -14.166526164634373], [32.59787352308643, -14.166469775975994], [32.597959487917244, -14.166419308225041], [32.59804896083539, -14.166375024492819], [32.59814147537559, -14.166337155650975], [32.59823654921649, -14.166305899126767], [32.598333686694666, -14.166281417874698], [32.59843238138813, -14.16626383952632], [32.598480894615356, -14.16625869146247], [32.59854368499213, -14.166247507971715], [32.59864342235414, -14.166236924170786], [32.59874368241662, -14.16623339009561], [32.59884394247893, -14.166236924170786], [32.598943679841106, -14.166247507971715], [32.59904237452752, -14.166265086320092], [32.59913951199871, -14.166289567572331], [32.59923458583284, -14.166320824096541], [32.5993271003665, -14.166358692938498], [32.599416573278056, -14.166402976670607], [32.59950253810285, -14.166453444421673], [32.599584546664396, -14.166509833080223], [32.599662171411175, -14.16657184866585], [32.59973500764527, -14.166639167862566], [32.59980267563332, -14.166711439703702], [32.59986482258454, -14.166788287401683], [32.59992112449134, -14.166869310312448], [32.59996455353569, -14.16694270512846], [32.60004579186107, -14.166998564054833], [32.600123416774004, -14.167060579638072], [32.60019625316408, -14.16712789883206]]]]}, \"properties\": {\"name\": \"MKB_5\", \"status\": \"Active\", \"version\": 0, \"parentId\": \"2953\", \"geographicLevel\": 2}, \"serverVersion\": 1542965231623}"; + private Set scripts = new HashSet(); + + private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + + @Autowired + private LocationRepository locationRepository; + + @Autowired + private LocationTagRepository locationTagRepository; + + @Autowired + private StocksRepository stocksRepository; + + @Autowired + @Qualifier("clientsRepositoryPostgres") + private ClientsRepository clientsRepository; + + @Override + protected Set getDatabaseScripts() { + scripts.add("location.sql"); + scripts.add("structure.sql"); + scripts.add("location_tag.sql"); + scripts.add("plan.sql"); + scripts.add("stock.sql"); + return scripts; + } + + @Test + public void testGet() { + PhysicalLocation location = locationRepository.get("3734"); + assertNotNull(location); + assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", location.getProperties().getUid()); + assertEquals("21", location.getProperties().getParentId()); + assertEquals("Intervention Unit", location.getProperties().getType()); + assertEquals(PropertyStatus.ACTIVE, location.getProperties().getStatus()); + assertEquals(1542378347104l, location.getServerVersion().longValue()); + + JsonArray coordinates = location.getGeometry().getCoordinates().get(0).getAsJsonArray().get(0).getAsJsonArray(); + assertEquals(267, coordinates.size()); + + JsonArray coordinate1 = coordinates.get(0).getAsJsonArray(); + assertEquals(32.59989007736522, coordinate1.get(0).getAsDouble(), 0); + assertEquals(-14.167432040756012, coordinate1.get(1).getAsDouble(), 0); + + JsonArray coordinate67 = coordinates.get(66).getAsJsonArray(); + assertEquals(32.5988341383848, coordinate67.get(0).getAsDouble(), 0); + assertEquals(-14.171814074659776, coordinate67.get(1).getAsDouble(), 0); + } + + @Test + public void testGetWithNullOrEmptyParams() { + assertNull(locationRepository.get("")); + + assertNull(locationRepository.get(null)); + + } + + @Test + public void testFindLocationAndStocksByJurisdictionShouldReturnWithNoStock() { + List physicalLocationAndStocks = locationRepository + .findLocationAndStocksByJurisdiction("3724", null, true, -1); + assertFalse(physicalLocationAndStocks.isEmpty()); + assertEquals(1, physicalLocationAndStocks.size()); + assertTrue(physicalLocationAndStocks.get(0).getStocks().isEmpty()); + } + + @Test + public void testFindLocationAndStocksByJurisdictionShouldReturnWithStock() { + Stock stock = new Stock(); + stock.setId("05934ae338431f28bf6793b24181ea5e"); + stock.setLocationId("90397"); + stocksRepository.update(stock); + List physicalLocationAndStocks = locationRepository + .findLocationAndStocksByJurisdiction("3734", null, true, Integer.MAX_VALUE); + assertFalse(physicalLocationAndStocks.isEmpty()); + assertEquals(1, physicalLocationAndStocks.size()); + assertFalse(physicalLocationAndStocks.get(0).getStocks().isEmpty()); + } + + @Test + public void testFindLocationAndStocksByJurisdictionShouldReturnNonEmptyBundle() { + List bundles = locationRepository + .findLocationAndStocksByJurisdiction("3724"); + assertFalse(bundles.isEmpty()); + assertEquals(1, bundles.size()); + } + + @Test + public void testGetNotExistingLocation() { + assertNull(locationRepository.get("1212121")); + } + + @Test + public void testGetStructure() throws ParseException { + PhysicalLocation structure = locationRepository.getStructure("90397", true); + assertNotNull(structure); + assertEquals("90397", structure.getId()); + + assertEquals(GeometryType.POLYGON, structure.getGeometry().getType()); + assertFalse(structure.getGeometry().getCoordinates().isJsonNull()); + + assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", structure.getProperties().getUid()); + assertEquals("21384443", structure.getProperties().getCode()); + assertEquals("Residential Structure", structure.getProperties().getType()); + assertEquals(PropertyStatus.ACTIVE, structure.getProperties().getStatus()); + assertEquals("3734", structure.getProperties().getParentId()); + assertNull(structure.getProperties().getName()); + assertEquals(5, structure.getProperties().getGeographicLevel()); + assertEquals(dateFormat.parse("2017-01-10"), structure.getProperties().getEffectiveStartDate()); + assertNull(structure.getProperties().getEffectiveEndDate()); + assertEquals(0, structure.getProperties().getVersion()); + } + + @Test + public void testGetStructureWithNullOrEmptyParams() { + assertNull(locationRepository.getStructure("", true)); + + assertNull(locationRepository.getStructure(null, true)); + + } + + @Test + public void testGetStructureNotExistingLocation() { + assertNull(locationRepository.getStructure("1212121", true)); + } + + @Test + public void testAddLocation() { + String uuid = UUID.randomUUID().toString(); PhysicalLocation physicalLocation = createLocation(uuid); - LocationProperty properties = new LocationProperty(); - properties.setStatus(PropertyStatus.INACTIVE); - properties.setUid(uuid); - properties.setName("01_5"); - physicalLocation.setProperties(properties); - locationRepository.add(physicalLocation); - List onlyActiveLocations = locationRepository.findAllLocations(true, 0l, 10, false); - assertEquals(2,onlyActiveLocations.size()); - List locationList = locationRepository.findAllLocations(true, 0l, 10, true); - assertEquals(3,locationList.size()); - assertEquals(locationList.get(2).getProperties().getStatus(), PropertyStatus.INACTIVE); - } - - @Test - public void testFindAllStructures() { - List locations = locationRepository.findAllStructures(false,0l,10,null,null,null); - assertEquals(2, locations.size()); - assertEquals("90397", locations.get(0).getId()); - assertEquals("90398", locations.get(1).getId()); - } - + physicalLocation.getProperties().setStatus(PropertyStatus.ACTIVE); + locationRepository.add(physicalLocation); + PhysicalLocation savedLocation = locationRepository.get("223232"); + + assertNotNull(savedLocation); + assertEquals("Feature", savedLocation.getType()); + MatcherAssert.assertThat(savedLocation.getServerVersion(), Matchers.greaterThan(5l)); + + assertNull(locationRepository.getStructure("223232", true)); + + } + + @Test + public void testAddLocationWithoutId() { + PhysicalLocation physicalLocation = new PhysicalLocation(); + physicalLocation.setJurisdiction(true); + locationRepository.add(physicalLocation); + + assertEquals(2, locationRepository.getAll().size()); + assertEquals(2, locationRepository.getAllStructures().size()); + + } + + @Test + public void testAddLocationExistingShouldNotChangeObject() { + + PhysicalLocation physicalLocation = locationRepository.get("3734"); + physicalLocation.getProperties().setName("MY Operational Area"); + physicalLocation.setJurisdiction(true); + + locationRepository.add(physicalLocation); + + physicalLocation = locationRepository.get("3734"); + assertNotEquals("MY Operational Area", physicalLocation.getProperties().getName()); + + assertEquals(2, locationRepository.getAll().size()); + assertEquals(2, locationRepository.getAllStructures().size()); + + } + + @Test + public void testAddStructure() { + String uuid = UUID.randomUUID().toString(); + PhysicalLocation physicalLocation = createStructure(uuid); + + locationRepository.add(physicalLocation); + PhysicalLocation savedLocation = locationRepository.getStructure("121212", true); + + assertNotNull(savedLocation); + assertEquals("Feature", savedLocation.getType()); + assertEquals(GeometryType.POLYGON, savedLocation.getGeometry().getType()); + assertEquals(PropertyStatus.ACTIVE, savedLocation.getProperties().getStatus()); + assertEquals(uuid, savedLocation.getProperties().getUid()); + MatcherAssert.assertThat(savedLocation.getServerVersion(), Matchers.greaterThan(5l)); + + assertNull(locationRepository.get("121212")); + + } + + @Test + public void testAddStructureWithoutId() { + PhysicalLocation physicalLocation = new PhysicalLocation(); + locationRepository.add(physicalLocation); + + assertEquals(2, locationRepository.getAll().size()); + assertEquals(2, locationRepository.getAllStructures().size()); + + } + + @Test + public void testAddStructureExistingShouldNotChangeObject() { + + PhysicalLocation physicalLocation = locationRepository.getStructure("90397", true); + physicalLocation.getProperties().setName("Mwangala Household"); + locationRepository.add(physicalLocation); + + physicalLocation = locationRepository.getStructure("90397", true); + assertNotEquals("Mwangala Household", physicalLocation.getProperties().getName()); + + assertEquals(2, locationRepository.getAll().size()); + assertEquals(2, locationRepository.getAllStructures().size()); + + } + + @Test + public void testUpdateLocation() throws ParseException { + PhysicalLocation physicalLocation = locationRepository.get("3734"); + assertEquals(0, physicalLocation.getProperties().getVersion()); + assertEquals(PropertyStatus.ACTIVE, physicalLocation.getProperties().getStatus()); + + physicalLocation.getGeometry().setType(GeometryType.POLYGON); + physicalLocation.getProperties().setStatus(PropertyStatus.NOT_ELIGIBLE); + physicalLocation.getProperties().setGeographicLevel(3); + + Date effectiveStartDate = dateFormat.parse("2019-07-15"); + Date effectiveEndDate = dateFormat.parse("2020-07-15"); + physicalLocation.getProperties().setEffectiveStartDate(effectiveStartDate); + physicalLocation.getProperties().setEffectiveEndDate(effectiveEndDate); + physicalLocation.setJurisdiction(true); + long serverVersion = physicalLocation.getServerVersion(); + locationRepository.update(physicalLocation); + assertNull(locationRepository.get("3734")); + PhysicalLocation updatedLocation = locationRepository.get("3734", true, 0); + + assertNotNull(updatedLocation); + assertEquals(GeometryType.POLYGON, updatedLocation.getGeometry().getType()); + assertEquals(PropertyStatus.NOT_ELIGIBLE, updatedLocation.getProperties().getStatus()); + assertEquals(3, updatedLocation.getProperties().getGeographicLevel()); + assertEquals(effectiveStartDate, updatedLocation.getProperties().getEffectiveStartDate()); + assertEquals(effectiveEndDate, updatedLocation.getProperties().getEffectiveEndDate()); + assertEquals(0, updatedLocation.getProperties().getVersion()); + MatcherAssert.assertThat(updatedLocation.getServerVersion(), Matchers.greaterThan(serverVersion)); + + assertNull(locationRepository.getStructure("3734", true)); + + } + + @Test + public void testUpdateActiveLocation() throws ParseException { + PhysicalLocation physicalLocation = locationRepository.get("3734"); + assertEquals(0, physicalLocation.getProperties().getVersion()); + assertEquals(PropertyStatus.ACTIVE, physicalLocation.getProperties().getStatus()); + physicalLocation.getGeometry().setType(GeometryType.POLYGON); + physicalLocation.getProperties().setStatus(PropertyStatus.ACTIVE); + physicalLocation.getProperties().setGeographicLevel(3); + + Date effectiveStartDate = dateFormat.parse("2019-07-15"); + Date effectiveEndDate = dateFormat.parse("2020-07-15"); + physicalLocation.getProperties().setEffectiveStartDate(effectiveStartDate); + physicalLocation.getProperties().setEffectiveEndDate(effectiveEndDate); + physicalLocation.setJurisdiction(true); + locationRepository.update(physicalLocation); + PhysicalLocation updatedLocation = locationRepository.get("3734"); + + assertNotNull(updatedLocation); + assertEquals(GeometryType.POLYGON, updatedLocation.getGeometry().getType()); + assertEquals(PropertyStatus.ACTIVE, updatedLocation.getProperties().getStatus()); + assertEquals(3, updatedLocation.getProperties().getGeographicLevel()); + assertEquals(effectiveStartDate, updatedLocation.getProperties().getEffectiveStartDate()); + assertEquals(effectiveEndDate, updatedLocation.getProperties().getEffectiveEndDate()); + assertEquals(0, updatedLocation.getProperties().getVersion()); + + assertNull(locationRepository.getStructure("3734", true)); + + } + + @Test + public void testUpdatePendingReviewLocation() throws ParseException { + PhysicalLocation physicalLocation = locationRepository.get("3734"); + assertEquals(0, physicalLocation.getProperties().getVersion()); + assertEquals(PropertyStatus.ACTIVE, physicalLocation.getProperties().getStatus()); + physicalLocation.getGeometry().setType(GeometryType.POLYGON); + physicalLocation.getProperties().setStatus(PropertyStatus.PENDING_REVIEW); + physicalLocation.getProperties().setGeographicLevel(3); + + Date effectiveStartDate = dateFormat.parse("2019-07-15"); + Date effectiveEndDate = dateFormat.parse("2020-07-15"); + physicalLocation.getProperties().setEffectiveStartDate(effectiveStartDate); + physicalLocation.getProperties().setEffectiveEndDate(effectiveEndDate); + physicalLocation.setJurisdiction(true); + locationRepository.update(physicalLocation); + PhysicalLocation updatedLocation = locationRepository.get("3734"); + + assertNotNull(updatedLocation); + assertEquals(GeometryType.POLYGON, updatedLocation.getGeometry().getType()); + assertEquals(PropertyStatus.PENDING_REVIEW, updatedLocation.getProperties().getStatus()); + assertEquals(3, updatedLocation.getProperties().getGeographicLevel()); + assertEquals(effectiveStartDate, updatedLocation.getProperties().getEffectiveStartDate()); + assertEquals(effectiveEndDate, updatedLocation.getProperties().getEffectiveEndDate()); + assertEquals(0, updatedLocation.getProperties().getVersion()); + + assertNull(locationRepository.getStructure("3734", true)); + + } + + @Test + public void testUpdateLocationWithoutId() { + PhysicalLocation physicalLocation = new PhysicalLocation(); + locationRepository.add(physicalLocation); + + assertEquals(2, locationRepository.getAll().size()); + assertEquals(2, locationRepository.getAllStructures().size()); + + } + + @Test + public void testUpdateLocationNonExistingShouldNotChangeObject() { + + PhysicalLocation physicalLocation = new PhysicalLocation(); + physicalLocation.setId("223232"); + physicalLocation.setType("Feature"); + physicalLocation.setJurisdiction(true); + locationRepository.update(physicalLocation); + + assertNull(locationRepository.get("223232")); + assertNull(locationRepository.getStructure("223232", true)); + + } + + @Test + public void testUpdateStructure() { + PhysicalLocation structure = locationRepository.getStructure("90397", true); + structure.getProperties().setCode("12121"); + structure.getProperties().setParentId("11"); + long serverVersion = structure.getServerVersion(); + locationRepository.update(structure); + + PhysicalLocation updatedStructure = locationRepository.getStructure("90397", true); + + assertNotNull(updatedStructure); + assertEquals("12121", updatedStructure.getProperties().getCode()); + assertEquals("11", updatedStructure.getProperties().getParentId()); + MatcherAssert.assertThat(updatedStructure.getServerVersion(), Matchers.greaterThan(serverVersion)); + + assertNull(locationRepository.get("90397")); + + } + + @Test + public void testUpdateStructureWithoutId() { + PhysicalLocation structure = new PhysicalLocation(); + locationRepository.add(structure); + + assertEquals(2, locationRepository.getAll().size()); + assertEquals(2, locationRepository.getAllStructures().size()); + + } + + @Test + public void testUpdateStructureExistingShouldNotChangeObject() { + + PhysicalLocation physicalLocation = new PhysicalLocation(); + physicalLocation.setId("223232"); + physicalLocation.setType("Feature"); + locationRepository.update(physicalLocation); + + assertNull(locationRepository.get("223232")); + assertNull(locationRepository.getStructure("223232", true)); + + } + + @Test + public void testGetAll() { + List locations = locationRepository.getAll(); + assertEquals(2, locations.size()); + + locationRepository.safeRemove(locationRepository.get("3734")); + locationRepository.safeRemove(locationRepository.get("3735")); + + assertTrue(locationRepository.getAll().isEmpty()); + + String uuid = UUID.randomUUID().toString(); + PhysicalLocation location = createLocation(uuid); + location.getProperties().setStatus(PropertyStatus.ACTIVE); + locationRepository.add(location); + + locations = locationRepository.getAll(); + + assertEquals(1, locations.size()); + assertEquals("223232", locations.get(0).getId()); + assertEquals(uuid, locations.get(0).getProperties().getUid()); + + } + + @Test + public void testSafeRemoveLocation() { + + assertNotNull(locationRepository.get("3734")); + + locationRepository.safeRemove(locationRepository.get("3734")); + + assertNull(locationRepository.get("3734")); + } + + @Test + public void testSafeRemoveStructure() { + + assertNotNull(locationRepository.getStructure("90397", true)); + + locationRepository.safeRemove(locationRepository.getStructure("90397", true)); + + assertNull(locationRepository.getStructure("90397", true)); + } + + @Test + public void testSafeRemoveNonExistentLocation() { + locationRepository.safeRemove(null); + locationRepository.safeRemove(new PhysicalLocation()); + assertEquals(2, locationRepository.getAll().size()); + + locationRepository.safeRemove(locationRepository.get("671198")); + assertEquals(2, locationRepository.getAll().size()); + + } + + @Test + public void testFindLocationsByServerVersion() { + + List locations = locationRepository.findLocationsByServerVersion(1542378347106l); + assertTrue(locations.isEmpty()); + + locations = locationRepository.findLocationsByServerVersion(1l); + System.out.println(ReflectionToStringBuilder.toString(locations.get(0))); + assertEquals(1, locations.size()); + assertEquals("3734", locations.get(0).getId()); + assertTrue(locations.get(0).getServerVersion() >= 1l); + + locations.get(0).setServerVersion(null); + locations.get(0).setJurisdiction(true); + locationRepository.update(locations.get(0)); + + locations = locationRepository.findLocationsByServerVersion(1l); + assertEquals(1, locations.size()); + + } + + @Test + public void testFindStructuresByParentAndServerVersion() { + + List locations = locationRepository.findStructuresByParentAndServerVersion("3734", 1542376382859l); + assertTrue(locations.isEmpty()); + + locations = locationRepository.findStructuresByParentAndServerVersion("3734", 1542376382851l); + assertEquals(1, locations.size()); + assertEquals("90397", locations.get(0).getId()); + assertEquals("3734", locations.get(0).getProperties().getParentId()); + assertEquals(1542376382851l, locations.get(0).getServerVersion().longValue()); + assertTrue(locations.get(0).getServerVersion() >= 1l); + + locations = locationRepository.findStructuresByParentAndServerVersion("3734,001", 1542376382851l); + assertEquals(1, locations.size()); + assertEquals("90397", locations.get(0).getId()); + assertEquals("3734", locations.get(0).getProperties().getParentId()); + + locations.get(0).setServerVersion(null); + locationRepository.update(locations.get(0)); + + locations = locationRepository.findStructuresByParentAndServerVersion("3734", 0l); + assertEquals(1, locations.size()); + assertTrue(locations.get(0).getServerVersion() > 0); + } + + @Test + public void testFindByEmptyServerVersion() { + + List locations = locationRepository.findByEmptyServerVersion(); + assertEquals(1, locations.size()); + assertEquals("3735", locations.get(0).getId()); + + PhysicalLocation location = locationRepository.get("3735"); + location.setServerVersion(12l); + locationRepository.update(location); + + locations = locationRepository.findByEmptyServerVersion(); + + assertTrue(locations.isEmpty()); + + } + + @Test + public void testFindStructuresByEmptyServerVersion() { + + List locations = locationRepository.findStructuresByEmptyServerVersion(); + assertTrue(locations.isEmpty()); + + PhysicalLocation location = locationRepository.getStructure("90397", true); + location.setServerVersion(null); + locationRepository.update(location); + + locations = locationRepository.findStructuresByEmptyServerVersion(); + assertEquals(0, locations.size()); + + } + + private PhysicalLocation createLocation(String uuid) { + PhysicalLocation physicalLocation = new PhysicalLocation(); + physicalLocation.setId("223232"); + physicalLocation.setType("Feature"); + physicalLocation.setJurisdiction(true); + Geometry geometry = new Geometry(); + geometry.setType(GeometryType.MULTI_POLYGON); + physicalLocation.setGeometry(geometry); + LocationProperty properties = new LocationProperty(); + properties.setStatus(PropertyStatus.INACTIVE); + properties.setUid(uuid); + properties.setName("01_5"); + physicalLocation.setProperties(properties); + return physicalLocation; + + } + + private PhysicalLocation createStructure(String uuid) { + PhysicalLocation physicalLocation = new PhysicalLocation(); + physicalLocation.setId("121212"); + physicalLocation.setType("Feature"); + Geometry geometry = new Geometry(); + geometry.setType(GeometryType.POLYGON); + physicalLocation.setGeometry(geometry); + LocationProperty properties = new LocationProperty(); + properties.setStatus(PropertyStatus.ACTIVE); + properties.setUid(uuid); + physicalLocation.setProperties(properties); + return physicalLocation; + } + + @Test + public void testFindLocationsByNames() { + + List locations = locationRepository.findLocationsByNames("MKB_5", 0l); + assertTrue(locations.isEmpty()); + + PhysicalLocation parentLocation = gson.fromJson(parentJson, PhysicalLocation.class); + parentLocation.setJurisdiction(true); + locationRepository.add(parentLocation); + + locations = locationRepository.findLocationsByNames("MKB_5", 0l); + assertEquals(1, locations.size()); + PhysicalLocation location = locations.get(0); + assertEquals("MKB_5", location.getProperties().getName()); + assertEquals("Feature", location.getType()); + assertEquals(GeometryType.MULTI_POLYGON, location.getGeometry().getType()); + + locations = locationRepository.findLocationsByNames("MKB_5,other_location_name", 0l); + assertEquals(1, locations.size()); + location = locations.get(0); + assertEquals("MKB_5", location.getProperties().getName()); + assertEquals("Feature", location.getType()); + assertEquals(GeometryType.MULTI_POLYGON, location.getGeometry().getType()); + + } + + @Test + public void testFindStructureAndFamilyDetailsWithFamilyDetails() throws SQLException { + scripts.add("client.sql"); + populateDatabase(); + + Client family = new Client(UUID.randomUUID().toString()).withFirstName("Otala").withLastName("Family"); + family.withAttribute(ClientsRepositoryImpl.RESIDENCE, "90397"); + clientsRepository.add(family); + + double latitude = -14.1619809; + double longitude = 32.5978597; + + Collection details = locationRepository.findStructureAndFamilyDetails(latitude, longitude, 100); + assertEquals(0, details.size()); + + details = locationRepository.findStructureAndFamilyDetails(latitude, longitude, 1000); + assertEquals(1, details.size()); + + StructureDetails structureDetails = details.iterator().next(); + assertEquals("90397", structureDetails.getStructureId()); + assertEquals("3734", structureDetails.getStructureParentId()); + assertEquals("Residential Structure", structureDetails.getStructureType()); + assertEquals(family.getBaseEntityId(), structureDetails.getFamilyId()); + assertEquals(1, structureDetails.getFamilyMembers().size()); + assertEquals("d4eda055-60c6-44a4-ba48-61dfe6485bea", structureDetails.getFamilyMembers().iterator().next()); + } + + @Test + public void testFindStructureAndFamilyDetailsWithoutFamilyDetails() { + double latitude = -14.1619809; + double longitude = 34.5978597; + + Collection details = locationRepository.findStructureAndFamilyDetails(latitude, longitude, 1000); + assertEquals(0, details.size()); + + String uuid = UUID.randomUUID().toString(); + PhysicalLocation structure = createStructure(uuid); + JsonArray cordinates = new JsonArray(); + cordinates.add(new JsonPrimitive(longitude)); + cordinates.add(new JsonPrimitive(latitude)); + structure.getGeometry().setCoordinates(cordinates); + structure.getGeometry().setType(GeometryType.POINT); + structure.getProperties().setParentId("2465476"); + structure.getProperties().setType("Larvacide Point"); + locationRepository.add(structure); + + details = locationRepository.findStructureAndFamilyDetails(latitude, longitude, 1000); + assertEquals(1, details.size()); + + StructureDetails structureDetails = details.iterator().next(); + assertEquals("121212", structureDetails.getStructureId()); + assertEquals("2465476", structureDetails.getStructureParentId()); + assertEquals("Larvacide Point", structureDetails.getStructureType()); + assertTrue(structureDetails.getFamilyMembers().isEmpty()); + + assertTrue(locationRepository.findStructureAndFamilyDetails(latitude + 1, longitude, 1000).isEmpty()); + + double metersPerDegree = 110637; + assertEquals(1, locationRepository.findStructureAndFamilyDetails(latitude + 1, longitude, metersPerDegree).size()); + } + + @Test + public void testFindLocationsByPropertiesWithoutProperties() { + List locations = locationRepository.findLocationsByProperties(false, "21", null); + assertEquals(1, locations.size()); + assertEquals("3734", locations.get(0).getId()); + assertNull(locations.get(0).getGeometry()); + + locations = locationRepository.findLocationsByProperties(true, "21", null); + assertEquals(1, locations.size()); + assertEquals("3734", locations.get(0).getId()); + assertNotNull(locations.get(0).getGeometry()); + + locations = locationRepository.findLocationsByProperties(true, null, null); + assertEquals(2, locations.size()); + assertEquals("3734", locations.get(0).getId()); + assertEquals(GeometryType.MULTI_POLYGON, locations.get(0).getGeometry().getType()); + assertEquals(267, + locations.get(0).getGeometry().getCoordinates().get(0).getAsJsonArray().get(0).getAsJsonArray().size()); + + // test non-existent parent + locations = locationRepository.findLocationsByProperties(true, "1233", null); + assertTrue(locations.isEmpty()); + + } + + @Test + public void testFindLocationsByProperties() { + + Map filters = new HashMap<>(); + filters.put("code", "3734"); + filters.put("name", "Bangladesh"); + filters.put("uid", "41587456-b7c8-4c4e-b433-23a786f742fc"); + List locations = locationRepository.findLocationsByProperties(true, null, filters); + assertEquals(1, locations.size()); + assertEquals("3734", locations.get(0).getId()); + assertEquals("Bangladesh", locations.get(0).getProperties().getName()); + assertEquals(GeometryType.MULTI_POLYGON, locations.get(0).getGeometry().getType()); + JsonArray coordinates = locations.get(0).getGeometry().getCoordinates().get(0).getAsJsonArray().get(0) + .getAsJsonArray(); + assertEquals(267, coordinates.size()); + + JsonArray coordinate1 = coordinates.get(0).getAsJsonArray(); + assertEquals(32.59989007736522, coordinate1.get(0).getAsDouble(), 0); + assertEquals(-14.167432040756012, coordinate1.get(1).getAsDouble(), 0); + + JsonArray coordinate67 = coordinates.get(66).getAsJsonArray(); + assertEquals(32.5988341383848, coordinate67.get(0).getAsDouble(), 0); + assertEquals(-14.171814074659776, coordinate67.get(1).getAsDouble(), 0); + + // test non-existent property value + filters.put("name", "name1"); + locations = locationRepository.findLocationsByProperties(true, null, filters); + assertTrue(locations.isEmpty()); + + } + + @Test + public void testFindStructuresByPropertiesWithoutProperties() { + List structures = locationRepository.findStructuresByProperties(false, "3734", null); + assertEquals(1, structures.size()); + assertEquals("90397", structures.get(0).getId()); + assertNull(structures.get(0).getGeometry()); + + structures = locationRepository.findStructuresByProperties(true, "3734", null); + assertEquals(1, structures.size()); + assertEquals("90397", structures.get(0).getId()); + assertNotNull(structures.get(0).getGeometry()); + + structures = locationRepository.findStructuresByProperties(true, null, null); + assertEquals(2, structures.size()); + assertEquals("90397", structures.get(0).getId()); + assertEquals(GeometryType.POLYGON, structures.get(0).getGeometry().getType()); + assertEquals(2, + structures.get(0).getGeometry().getCoordinates().get(0).getAsJsonArray().get(0).getAsJsonArray().size()); + + // test non-existent parent + structures = locationRepository.findLocationsByProperties(true, "1233", null); + assertTrue(structures.isEmpty()); + } + + @Test + public void testFindStructuresByProperties() { + + Map filters = new HashMap<>(); + filters.put("code", "21384443"); + filters.put("geographicLevel", "5"); + filters.put("type", "Residential Structure"); + List locations = locationRepository.findStructuresByProperties(true, null, filters); + assertEquals(1, locations.size()); + assertEquals("90397", locations.get(0).getId()); + assertEquals("21384443", locations.get(0).getProperties().getCode()); + assertNull(locations.get(0).getProperties().getName()); + assertEquals("Residential Structure", locations.get(0).getProperties().getType()); + assertEquals(GeometryType.POLYGON, locations.get(0).getGeometry().getType()); + assertEquals(2, + locations.get(0).getGeometry().getCoordinates().get(0).getAsJsonArray().get(0).getAsJsonArray().size()); + + // test non-existent property + filters.put("name", "House23"); + locations = locationRepository.findStructuresByProperties(true, null, filters); + assertTrue(locations.isEmpty()); + + } + + @Test + public void testFindLocationByIdWithChildren() { + + List locations = locationRepository.findLocationByIdWithChildren(true, "3734", 10); + assertEquals(2, locations.size()); + for (PhysicalLocation location : locations) { + MatcherAssert.assertThat(location.getId(), either(is("3734")).or(is("3735"))); + } + } + + @Test + public void testFindLocationByIdsWithChildren() { + + List locations = locationRepository.findLocationByIdsWithChildren(true, + new HashSet<>(Arrays.asList("3734", "3735")), 10); + assertEquals(2, locations.size()); + for (PhysicalLocation location : locations) { + MatcherAssert.assertThat(location.getId(), either(is("3734")).or(is("3735"))); + } + } + + @Test + public void testFindAllLocationIdsShouldOrderByServerVersion() { + + Pair, Long> idsModel = locationRepository.findAllLocationIds(-2l, 10); + List locationsIds = idsModel.getLeft(); + assertEquals(2, locationsIds.size()); + assertEquals("3735", locationsIds.get(0)); + assertEquals("3734", locationsIds.get(1)); + assertEquals(1542378347104l, idsModel.getRight().longValue()); + + } + + @Test + public void testFindAllLocationIdsShouldLimitByGivenParam() { + + Pair, Long> idsModel = locationRepository.findAllLocationIds(-2l, 1); + List locationsIds = idsModel.getLeft(); + assertEquals(1, locationsIds.size()); + assertEquals("3735", locationsIds.get(0)); + assertEquals(0l, idsModel.getRight().longValue()); + + } + + @Test + public void testFindAllStructureIdsShouldOrderByServerVersion() { + + Pair, Long> idsModel = locationRepository.findAllStructureIds(0l, 10); + List structureIds = idsModel.getLeft(); + assertEquals(2, structureIds.size()); + assertEquals("90397", structureIds.get(0)); + assertEquals("90398", structureIds.get(1)); + assertEquals(1542376382862l, idsModel.getRight().longValue()); + } + + @Test + public void testFindAllStructureIdsShouldLimitByGivenParam() { + + Pair, Long> idsModel = locationRepository.findAllStructureIds(0l, 1); + List structureIds = idsModel.getLeft(); + assertEquals(1, structureIds.size()); + assertEquals("90397", structureIds.get(0)); + assertEquals(1542376382851l, idsModel.getRight().longValue()); + } + + @Test + public void testFindAllStructureIdsShouldFilterBetweenFromAndToDate() { + String date1 = "2020-09-25T10:00:00+0300"; + String date2 = "2020-09-27T10:00:00+0300"; + + Pair, Long> idsModel = locationRepository.findAllStructureIds(0l, 2, + new DateTime(date1, DateTimeZone.UTC).toDate(), new DateTime(date2, DateTimeZone.UTC).toDate()); + List structureIds = idsModel.getLeft(); + assertEquals(2, structureIds.size()); + } + + @Test + public void testFindAllStructureIdsShouldFilterFromDateAsMinimumDate() { + String date2 = "2020-09-26T10:00:00+0300"; + + Pair, Long> idsModel = locationRepository.findAllStructureIds(0l, 2, + new DateTime(date2, DateTimeZone.UTC).toDate(), null); + List structureIds = idsModel.getLeft(); + assertEquals(1, structureIds.size()); + } + + @Test + public void testFindAllStructureIdsShouldFilterToDateAsMaximumDate() { + String date3 = "2020-09-27T10:00:00+0300"; + + Pair, Long> idsModel = locationRepository.findAllStructureIds(0l, 2, + null, new DateTime(date3, DateTimeZone.UTC).toDate()); + List structureIds = idsModel.getLeft(); + assertEquals(2, structureIds.size()); + } + + @Test + public void testSearchlLocationsWithFilters() { + LocationTagMap locationTagMap = new LocationTagMap(); + locationTagMap.setLocationId(2l); + locationTagMap.setLocationTagId(2l); + LocationSearchBean locationSearchBean = new LocationSearchBean(); + locationSearchBean.setName("a"); + locationSearchBean.setLocationTagId(2l); + locationSearchBean.setPageSize(20); + locationSearchBean.setPageNumber(1); + locationSearchBean.setOrderByFieldName("id"); + locationSearchBean.setOrderByType(OrderByType.ASC); + locationTagRepository.addLocationTagMap(locationTagMap); + List locations = new ArrayList(); + locations = locationRepository.searchLocations(locationSearchBean); + assertNotNull(locations); + assertEquals(1l, locations.size()); + } + + @Test + public void testSearchLocationsWithoutFilters() { + LocationTagMap locationTagMap = new LocationTagMap(); + locationTagMap.setLocationId(2l); + locationTagMap.setLocationTagId(2l); + LocationSearchBean locationSearchBean = new LocationSearchBean(); + locationTagRepository.addLocationTagMap(locationTagMap); + List locations = new ArrayList(); + locations = locationRepository.searchLocations(locationSearchBean); + assertNotNull(locations); + assertEquals(1l, locations.size()); + locationSearchBean.setPageSize(0); + locations = locationRepository.searchLocations(locationSearchBean); + assertEquals(1l, locations.size()); + } + + @Test + public void testSearchLocationsWithEmptyRecords() { + LocationTagMap locationTagMap = new LocationTagMap(); + locationTagMap.setLocationId(2l); + locationTagMap.setLocationTagId(2l); + + LocationSearchBean locationSearchBean = new LocationSearchBean(); + locationSearchBean.setName("no location"); + locationTagRepository.addLocationTagMap(locationTagMap); + List locations = new ArrayList(); + locations = locationRepository.searchLocations(locationSearchBean); + assertTrue(locations.isEmpty()); + } + + @Test(expected = IllegalArgumentException.class) + public void testSearchLocationsWithoutPageNumber() { + LocationSearchBean locationSearchBean = new LocationSearchBean(); + locationSearchBean.setName("a"); + locationSearchBean.setLocationTagId(2l); + locationSearchBean.setPageSize(20); + locationSearchBean.setPageNumber(0); + locationRepository.searchLocations(locationSearchBean); + } + + @Test + public void testCountSearchLocationsWithFilters() { + LocationTagMap locationTagMap = new LocationTagMap(); + locationTagMap.setLocationId(2l); + locationTagMap.setLocationTagId(2l); + locationTagRepository.addLocationTagMap(locationTagMap); + LocationSearchBean locationSearchBean = new LocationSearchBean(); + locationSearchBean.setName("a"); + locationSearchBean.setLocationTagId(2l); + int totalCount = locationRepository.countSearchLocations(locationSearchBean); + assertEquals(1l, totalCount); + } + + @Test + public void testCountSearchLocationsWithoutFilters() { + LocationTagMap locationTagMap = new LocationTagMap(); + locationTagMap.setLocationId(2l); + locationTagMap.setLocationTagId(2l); + locationTagRepository.addLocationTagMap(locationTagMap); + LocationSearchBean locationSearchBean = new LocationSearchBean(); + locationSearchBean.setName("Khulna"); + locationSearchBean.setLocationTagId(2l); + int totalCount = locationRepository.countSearchLocations(locationSearchBean); + assertEquals("total count should be zero", 0, totalCount); + } + + @Test + public void testfindParentLocationsInclusive() { + + PhysicalLocation location = locationRepository.get("3734"); + List expectedTags = locationTagRepository.getAll(); + location.setLocationTags(new HashSet<>(expectedTags)); + locationRepository.update(location); + + Set identifiers = Collections.singleton("3735"); + Set locations = locationRepository.findParentLocationsInclusive(identifiers); + assertEquals(2, locations.size()); + Iterator it = locations.iterator(); + LocationDetail locationDetail = it.next(); + MatcherAssert.assertThat(locationDetail.getIdentifier(), is("3735")); + assertEquals("Dhaka", locationDetail.getName()); + assertEquals("3734", locationDetail.getParentId()); + assertEquals(2l, locationDetail.getId().longValue()); + + locationDetail = it.next(); + MatcherAssert.assertThat(locationDetail.getIdentifier(), is("3734")); + assertEquals("Bangladesh", locationDetail.getName()); + assertEquals("21", locationDetail.getParentId()); + assertEquals(1l, locationDetail.getId().longValue()); + + + assertEquals(2, locationRepository.findParentLocationsInclusive(new HashSet<>(Arrays.asList("3735", "21"))).size()); + + //Location without a parent + locations = locationRepository.findParentLocationsInclusive(Collections.singleton("3734")); + assertEquals(1, locations.size()); + LocationDetail actualLocationDetail = locations.iterator().next(); + assertEquals("3734", actualLocationDetail.getIdentifier()); + assertEquals("Bangladesh", actualLocationDetail.getName()); + assertEquals("21", actualLocationDetail.getParentId()); + assertEquals(1l, actualLocationDetail.getId().longValue()); + List tags = Arrays.asList(actualLocationDetail.getTags().split(",")); + assertEquals(expectedTags.size(), tags.size()); + assertTrue(tags.contains(expectedTags.get(0).getName())); + assertTrue(tags.contains(expectedTags.get(1).getName())); + + //Non existent location + assertEquals(0, locationRepository.findParentLocationsInclusive(Collections.singleton("21")).size()); + } + + @Test + public void testfindParentLocationsInclusiveWithReturnTagsFalse() { + + PhysicalLocation location = locationRepository.get("3734"); + List expectedTags = locationTagRepository.getAll(); + location.setLocationTags(new HashSet<>(expectedTags)); + locationRepository.update(location); + + Set identifiers = Collections.singleton("3735"); + Set locations = locationRepository.findParentLocationsInclusive(identifiers, false); + assertEquals(2, locations.size()); + for (LocationDetail l : locations) { + MatcherAssert.assertThat(l.getIdentifier(), either(is("3734")).or(is("3735"))); + } + + assertEquals(2, locationRepository.findParentLocationsInclusive(new HashSet<>(Arrays.asList("3735", "21"))).size()); + + //Location without a parent + locations = locationRepository.findParentLocationsInclusive(Collections.singleton("3734"), false); + assertEquals(1, locations.size()); + LocationDetail actualLocationDetail = locations.iterator().next(); + assertEquals("3734", actualLocationDetail.getIdentifier()); + assertEquals("Bangladesh", actualLocationDetail.getName()); + assertEquals("21", actualLocationDetail.getParentId()); + assertEquals(1l, actualLocationDetail.getId().longValue()); + assertNull(actualLocationDetail.getTags()); + + //Non existent location + assertEquals(0, locationRepository.findParentLocationsInclusive(Collections.singleton("21")).size()); + } + + @Test + public void testCountStructuresByParentAndServerVersion() { + + Long locations = locationRepository.countStructuresByParentAndServerVersion("3734", 1542376382859l); + assertEquals(0, locations.longValue()); + + locations = locationRepository.countStructuresByParentAndServerVersion("3734", 1542376382851l); + assertEquals(1, locations.longValue()); + + locations = locationRepository.countStructuresByParentAndServerVersion("3734,001", 1542376382851l); + assertEquals(1, locations.longValue()); + + } + + @Test + public void testcountLocationsByServerVersion() { + + Long locations = locationRepository.countLocationsByServerVersion(1542378347106l); + assertEquals(0, locations.longValue()); + + locations = locationRepository.countLocationsByServerVersion(1l); + assertEquals(1, locations.longValue()); + + } + + @Test + public void testCountLocationsByNames() { + + Long locations = locationRepository.countLocationsByNames("MKB_5", 0l); + assertEquals(0, locations.longValue()); + + PhysicalLocation parentLocation = gson.fromJson(parentJson, PhysicalLocation.class); + parentLocation.setJurisdiction(true); + locationRepository.add(parentLocation); + + locations = locationRepository.countLocationsByNames("MKB_5", 0l); + assertEquals(1, locations.longValue()); + + locations = locationRepository.countLocationsByNames("MKB_5,other_location_name", 0l); + assertEquals(1, locations.longValue()); + + } + + @Test + public void testSelectDetailsByPlanId() { + + String planIdentifier = "a8b3010c-1ba5-556d-8b16-71266397b8b9"; + Set locationDetails = locationRepository.findLocationDetailsByPlanId(planIdentifier); + assertFalse(locationDetails.isEmpty()); + assertEquals(1, locationDetails.size()); + } + + @Test + public void testFindLocationWithDescendants() { + Set locations = locationRepository.findLocationWithDescendants("3734", false); + + assertEquals(2, locations.size()); + + Iterator it = locations.iterator(); + LocationDetail location = it.next(); + MatcherAssert.assertThat(location.getIdentifier(), is("3735")); + assertEquals("Dhaka", location.getName()); + assertEquals("3734", location.getParentId()); + assertEquals(2l, location.getId().longValue()); + + location = it.next(); + MatcherAssert.assertThat(location.getIdentifier(), is("3734")); + assertEquals("Bangladesh", location.getName()); + assertEquals("21", location.getParentId()); + assertEquals(1l, location.getId().longValue()); + + locations = locationRepository.findLocationWithDescendants("3735", true); + assertEquals(1, locations.size()); + LocationDetail actualLocationdetail = locations.iterator().next(); + assertEquals("3735", actualLocationdetail.getIdentifier()); + assertEquals("Dhaka", actualLocationdetail.getName()); + assertEquals("3734", actualLocationdetail.getParentId()); + assertEquals(2l, actualLocationdetail.getId().longValue()); + + assertEquals(0, locationRepository.findLocationWithDescendants("21", false).size()); + } + + @Test + public void testFindLocationWithDescendantsToCheckOrder() { + String uuid = UUID.randomUUID().toString(); + PhysicalLocation physicalLocation = createLocation(uuid); + physicalLocation.getProperties().setStatus(PropertyStatus.ACTIVE); + locationRepository.add(physicalLocation); + + uuid = UUID.randomUUID().toString(); + physicalLocation = createLocation(uuid); + physicalLocation.setId("1"); + physicalLocation.getProperties().setStatus(PropertyStatus.ACTIVE); + physicalLocation.getProperties().setParentId("223232"); + physicalLocation.getProperties().setGeographicLevel(1); + physicalLocation.getProperties().setName("Ambatondrazaka"); + locationRepository.add(physicalLocation); + + uuid = UUID.randomUUID().toString(); + physicalLocation = createLocation(uuid); + physicalLocation.setId("2"); + physicalLocation.getProperties().setStatus(PropertyStatus.ACTIVE); + physicalLocation.getProperties().setParentId("223232"); + physicalLocation.getProperties().setGeographicLevel(1); + physicalLocation.getProperties().setName("MAROVOAY"); + locationRepository.add(physicalLocation); + + Set locations = locationRepository.findLocationWithDescendants("223232", false); + + assertEquals(3, locations.size()); + Iterator it = locations.iterator(); + LocationDetail actualLocationdetail = it.next(); + assertEquals("Ambatondrazaka", actualLocationdetail.getName()); + assertEquals("223232", actualLocationdetail.getParentId()); + assertEquals(new Integer(1), actualLocationdetail.getGeographicLevel()); + + actualLocationdetail = it.next(); + assertEquals("MAROVOAY", actualLocationdetail.getName()); + assertEquals("223232", actualLocationdetail.getParentId()); + assertEquals(new Integer(1), actualLocationdetail.getGeographicLevel()); + + actualLocationdetail = it.next(); + assertEquals("01_5", actualLocationdetail.getName()); + assertEquals(null, actualLocationdetail.getParentId()); + assertEquals(new Integer(0), actualLocationdetail.getGeographicLevel()); + } + + @Test + public void testFindStructureCountsForLocation() { + Set locationIds = new HashSet<>(); + locationIds.add("3724"); + locationIds.add("3734"); + + List structureCounts = locationRepository.findStructureCountsForLocation(locationIds); + structureCounts.size(); + assertEquals("3724", structureCounts.get(0).getParentId()); + assertEquals(1, structureCounts.get(0).getCount()); + + assertEquals("3734", structureCounts.get(1).getParentId()); + assertEquals(1, structureCounts.get(0).getCount()); + + } + + @Test + public void testFindChildLocationByJurisdiction() { + + List locationIds = locationRepository.findChildLocationByJurisdiction("3734"); + assertEquals(2, locationIds.size()); + for (String id : locationIds) { + MatcherAssert.assertThat(id, either(is("3734")).or(is("3735"))); + } + } + + @Test + public void testFindLocationByIdentifierAndStatus() { + + PhysicalLocation actualLocation = locationRepository.findLocationByIdentifierAndStatus("3734", + Collections.singletonList(LocationProperty.PropertyStatus.ACTIVE.name()), false); + + assertEquals("3734", actualLocation.getId()); + assertEquals("Bangladesh", actualLocation.getProperties().getName()); + assertEquals("21", actualLocation.getProperties().getParentId()); + + PhysicalLocation actualInactiveLocation = locationRepository.findLocationByIdentifierAndStatus("3734", + Collections.singletonList(LocationProperty.PropertyStatus.INACTIVE.name()), false); + assertNull(actualInactiveLocation); + + } + + @Test + public void testFindLocationsByIdsReturnsCorrectLocations() { + List locations = locationRepository.findLocationsByIds(true, Arrays.asList("3734", "3735"), 0l); + assertEquals(2, locations.size()); + for (PhysicalLocation location : locations) { + MatcherAssert.assertThat(location.getId(), either(is("3734")).or(is("3735"))); + } + + locations = locationRepository.findLocationsByIds(true, Arrays.asList("3734", "3735"), 10l); + assertEquals(1, locations.size()); + assertEquals("3734", locations.get(0).getId()); + + + locations = locationRepository.findLocationsByIds(true, Arrays.asList("3734"), System.currentTimeMillis()); + assertEquals(0, locations.size()); + + locations = locationRepository.findLocationsByIds(true, Arrays.asList("373412"), 0l); + assertEquals(0, locations.size()); + + } + + @Test + public void testCountLocationsByIdsReturnsCorrectCount() { + assertEquals(2, locationRepository.countLocationsByIds(Arrays.asList("3734", "3735"), 0l)); + + + assertEquals(1, locationRepository.countLocationsByIds(Arrays.asList("3734", "3735"), 10l)); + + assertEquals(0, locationRepository.countLocationsByIds(Arrays.asList("3734"), System.currentTimeMillis())); + + assertEquals(0, locationRepository.countLocationsByIds(Arrays.asList("373412"), 0l)); + + } + + @Test + public void testCountAllStructuresShouldReturnCorrectValue() { + Long count = locationRepository.countAllStructures(0l); + assertEquals(Long.valueOf(2), count); + } + + @Test + public void testCountAllLocationsShouldReturnCorrectValue() { + Long count = locationRepository.countAllLocations(0l); + assertEquals(Long.valueOf(2), count); + } + + @Test + public void testFindAllLocations() { + List locations = locationRepository.findAllLocations(true, 0l, 10, true); + assertEquals(2, locations.size()); + String uuid = UUID.randomUUID().toString(); + PhysicalLocation physicalLocation = createLocation(uuid); + LocationProperty properties = new LocationProperty(); + properties.setStatus(PropertyStatus.INACTIVE); + properties.setUid(uuid); + properties.setName("01_5"); + physicalLocation.setProperties(properties); + locationRepository.add(physicalLocation); + List onlyActiveLocations = locationRepository.findAllLocations(true, 0l, 10, false); + assertEquals(2, onlyActiveLocations.size()); + List locationList = locationRepository.findAllLocations(true, 0l, 10, true); + assertEquals(3, locationList.size()); + assertEquals(locationList.get(2).getProperties().getStatus(), PropertyStatus.INACTIVE); + } + + @Test + public void testFindAllStructures() { + List locations = locationRepository.findAllStructures(false, 0l, 10, null, null, null); + assertEquals(2, locations.size()); + assertEquals("90397", locations.get(0).getId()); + assertEquals("90398", locations.get(1).getId()); + } + } diff --git a/src/test/java/org/opensrp/repository/postgres/LocationTagRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/LocationTagRepositoryTest.java index 33d881693..b18839a61 100644 --- a/src/test/java/org/opensrp/repository/postgres/LocationTagRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/LocationTagRepositoryTest.java @@ -21,312 +21,312 @@ public class LocationTagRepositoryTest extends BaseRepositoryTest { - @Autowired - private LocationTagRepository locationTagRepository; + @Autowired + private LocationTagRepository locationTagRepository; - @BeforeClass - public static void bootStrap() { - tableNames=Arrays.asList("core.location_tag","core.location_tag_map"); - } + @BeforeClass + public static void bootStrap() { + tableNames = Arrays.asList("core.location_tag", "core.location_tag_map"); + } - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet<>(); - scripts.add("location.sql"); - return scripts; - } + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet<>(); + scripts.add("location.sql"); + return scripts; + } - @Test - public void testAddShouldAddNewLocationTag() { - LocationTag locationTag1 = initTestLocationTag1(); - locationTagRepository.add(locationTag1); + @Test + public void testAddShouldAddNewLocationTag() { + LocationTag locationTag1 = initTestLocationTag1(); + locationTagRepository.add(locationTag1); - List locationTags = locationTagRepository.getAll(); - assertNotNull(locationTags); - assertEquals(1, locationTags.size()); + List locationTags = locationTagRepository.getAll(); + assertNotNull(locationTags); + assertEquals(1, locationTags.size()); - assertEquals(true, locationTags.get(0).getActive()); - assertEquals("Country", locationTags.get(0).getName()); + assertEquals(true, locationTags.get(0).getActive()); + assertEquals("Country", locationTags.get(0).getName()); - } + } - @Test - public void testAddShouldAddNewLocationTagMap() { + @Test + public void testAddShouldAddNewLocationTagMap() { - LocationTag locationTag1 = initTestLocationTag6(); - locationTagRepository.add(locationTag1); + LocationTag locationTag1 = initTestLocationTag6(); + locationTagRepository.add(locationTag1); - List locationTags = locationTagRepository.getAll(); - LocationTagMap locationTagMap = new LocationTagMap(); - locationTagMap.setLocationId(1l); - locationTagMap.setLocationTagId(locationTags.get(0).getId()); + List locationTags = locationTagRepository.getAll(); + LocationTagMap locationTagMap = new LocationTagMap(); + locationTagMap.setLocationId(1l); + locationTagMap.setLocationTagId(locationTags.get(0).getId()); - int insert = locationTagRepository.addLocationTagMap(locationTagMap); + int insert = locationTagRepository.addLocationTagMap(locationTagMap); - List locationTagMaps = locationTagRepository.getLocationTagMapByExample(1l, locationTags.get(0) - .getId()); - assertNotEquals(0, insert); + List locationTagMaps = locationTagRepository.getLocationTagMapByExample(1l, locationTags.get(0) + .getId()); + assertNotEquals(0, insert); - assertEquals(1, locationTagMaps.get(0).getLocationId().longValue()); - assertEquals(locationTags.get(0).getId(), locationTagMaps.get(0).getLocationTagId()); + assertEquals(1, locationTagMaps.get(0).getLocationId().longValue()); + assertEquals(locationTags.get(0).getId(), locationTagMaps.get(0).getLocationTagId()); - } + } - @Test - public void testDeleteShouldAddNewLocationTagMap() { + @Test + public void testDeleteShouldAddNewLocationTagMap() { - LocationTag locationTag1 = initTestLocationTag6(); - locationTagRepository.add(locationTag1); + LocationTag locationTag1 = initTestLocationTag6(); + locationTagRepository.add(locationTag1); - List locationTags = locationTagRepository.getAll(); - LocationTagMap locationTagMap = new LocationTagMap(); - locationTagMap.setLocationId(1l); - locationTagMap.setLocationTagId(locationTags.get(0).getId()); + List locationTags = locationTagRepository.getAll(); + LocationTagMap locationTagMap = new LocationTagMap(); + locationTagMap.setLocationId(1l); + locationTagMap.setLocationTagId(locationTags.get(0).getId()); - locationTagRepository.addLocationTagMap(locationTagMap); - List locationTagMaps = locationTagRepository.getLocationTagMapByExample(1l, locationTags.get(0) - .getId()); + locationTagRepository.addLocationTagMap(locationTagMap); + List locationTagMaps = locationTagRepository.getLocationTagMapByExample(1l, locationTags.get(0) + .getId()); - locationTagRepository - .deleteLocationTagMapByLocationIdAndLocationTagId(1l, locationTagMaps.get(0).getLocationTagId()); - - List getDeletedLocationTagMaps = locationTagRepository.getLocationTagMapByExample(1l, - locationTagMaps.get(0).getLocationTagId()); - - assertEquals(0, getDeletedLocationTagMaps.size()); - } + locationTagRepository + .deleteLocationTagMapByLocationIdAndLocationTagId(1l, locationTagMaps.get(0).getLocationTagId()); + + List getDeletedLocationTagMaps = locationTagRepository.getLocationTagMapByExample(1l, + locationTagMaps.get(0).getLocationTagId()); + + assertEquals(0, getDeletedLocationTagMaps.size()); + } - @Test(expected = DuplicateKeyException.class) - public void testNotAddShouldAddNewLocationTagMap() { + @Test(expected = DuplicateKeyException.class) + public void testNotAddShouldAddNewLocationTagMap() { - LocationTag locationTag1 = initTestLocationTag6(); - locationTagRepository.add(locationTag1); - - List locationTags = locationTagRepository.getAll(); - LocationTagMap locationTagMap = new LocationTagMap(); - locationTagMap.setLocationId(1l); - locationTagMap.setLocationTagId(locationTags.get(0).getId()); - - locationTagRepository.addLocationTagMap(locationTagMap); - locationTagRepository.addLocationTagMap(locationTagMap); - - } - - @Test(expected = IllegalArgumentException.class) - public void testNotAddShouldAddNewLocationTagMapWithoutLocationTagIdandLocationId() { - LocationTagMap locationTagMap = new LocationTagMap(); - locationTagRepository.addLocationTagMap(locationTagMap); - - } - - @Test(expected = DuplicateKeyException.class) - public void testAddShouldNotAddDuplicateLocationTagMap() { - LocationTag locationTag1 = initTestLocationTag1(); - locationTagRepository.add(locationTag1); - locationTagRepository.add(locationTag1); - - } - - @Test - public void testShouldDeleteLocationTagMapByLocationId() { - LocationTag locationTag1 = initTestLocationTag6(); - locationTagRepository.add(locationTag1); - - List locationTags = locationTagRepository.getAll(); - LocationTagMap locationTagMap = new LocationTagMap(); - locationTagMap.setLocationId(1l); - locationTagMap.setLocationTagId(locationTags.get(0).getId()); - locationTagRepository.addLocationTagMap(locationTagMap); - - LocationTagMap locationTagMap1 = new LocationTagMap(); - locationTagMap1.setLocationId(2l); - locationTagMap1.setLocationTagId(locationTags.get(0).getId()); - locationTagRepository.addLocationTagMap(locationTagMap1); - - locationTagRepository.deleteLocationTagMapByLocationId(1l); - - List getDeletedLocationTagMaps = locationTagRepository.getLocationTagMapByExample(1l, locationTags - .get(0).getId()); - assertNotEquals(1, getDeletedLocationTagMaps.size()); - List getNotDeletedLocationTagMaps = locationTagRepository.getLocationTagMapByExample(2l, - locationTags.get(0).getId()); - - assertEquals(1, getNotDeletedLocationTagMaps.size()); - } - - @Test(expected = IllegalArgumentException.class) - public void testShouldIllegalArgumentExceptionOndeleteLocationTagMapByLocationIdZero() { - locationTagRepository.deleteLocationTagMapByLocationId(0l); - } - - @Test(expected = IllegalArgumentException.class) - public void testShouldIllegalArgumentExceptionOnDeleteLocationTagMapWitLocationIdZero() { - locationTagRepository.deleteLocationTagMapByLocationIdAndLocationTagId(0l, 1l); - } - - @Test(expected = IllegalArgumentException.class) - public void testShouldIllegalArgumentExceptionOnDeleteLocationTagMapWitLocationIdNull() { - locationTagRepository.deleteLocationTagMapByLocationIdAndLocationTagId(null, 1l); - } - - @Test(expected = IllegalArgumentException.class) - public void testShouldIllegalArgumentExceptionOnDeleteLocationTagMapWitLocationTagIdNull() { - locationTagRepository.deleteLocationTagMapByLocationIdAndLocationTagId(1l, null); - } - - @Test(expected = IllegalArgumentException.class) - public void testShouldIllegalArgumentExceptionOnDeleteLocationTagMapWitLocationTagIdZero() { - locationTagRepository.deleteLocationTagMapByLocationIdAndLocationTagId(1l, 0l); - } - - @Test - public void testAddShouldUpdateExistingLocationTag() { - LocationTag locationTag2 = initTestLocationTag2(); - locationTagRepository.add(locationTag2); - org.opensrp.domain.postgres.LocationTag getLocationTag = locationTagRepository.getLocationTagByName("Division"); - locationTag2.setId(getLocationTag.getId()); - locationTag2.setDescription("update second label tag name"); - locationTag2.setName("Division Tag"); - locationTagRepository.update(locationTag2); - List locationTags = locationTagRepository.getAll(); - assertNotNull(locationTags); - assertEquals(1, locationTags.size()); - - assertEquals(true, locationTags.get(0).getActive()); - assertEquals("Division Tag", locationTags.get(0).getName()); - - } - - @Test(expected = DuplicateKeyException.class) - public void testAddShouldNotUpdateExistingLocationTag() { - LocationTag locationTag2 = initTestLocationTag2(); - locationTagRepository.add(locationTag2); - locationTag2.setName("Division Tag"); - locationTagRepository.add(locationTag2); - org.opensrp.domain.postgres.LocationTag getLocationTag = locationTagRepository.getLocationTagByName("Division"); - locationTag2.setId(getLocationTag.getId()); - locationTag2.setDescription("update second label tag name"); - locationTag2.setName("Division Tag"); - locationTagRepository.update(locationTag2); - - } - - @Test - public void testAddShouldAInActiveExistingLocationTag() { - LocationTag locationTag4 = initTestLocationTag4(); - locationTagRepository.add(locationTag4); - org.opensrp.domain.postgres.LocationTag findLocationTag = locationTagRepository.getLocationTagByName("upazila"); - locationTagRepository.safeRemove(findLocationTag.getId()); - org.opensrp.domain.postgres.LocationTag getLocationTag = locationTagRepository.getLocationTagByName("upazila"); - assertNotNull(getLocationTag); - assertEquals(false, getLocationTag.getActive()); - assertEquals("upazila", getLocationTag.getName()); - - } - - @Test - public void testAddShouldAInActiveExistingLocationTagById() { - LocationTag locationTag2 = initTestLocationTag2(); - locationTagRepository.add(locationTag2); - locationTagRepository.safeRemove(locationTag2); - org.opensrp.domain.postgres.LocationTag getLocationTag = locationTagRepository.getLocationTagByName("Division"); - assertNotNull(getLocationTag); - assertEquals(false, getLocationTag.getActive()); - assertEquals("Division", getLocationTag.getName()); - - } - - @Test - public void testAddShouldNotAddRecordIfLocationTagIsNull() { - locationTagRepository.add(null); - List locationTags = locationTagRepository.getAll(); - assertTrue(locationTags.isEmpty()); - } - - @Test - public void testAddShouldNotAddRecordIfLocationTagNameIsNullOrEmpty() { - LocationTag locationTag1 = initTestLocationTag1(); - locationTag1.setName(null); - locationTagRepository.add(locationTag1); - - locationTag1.setName(""); - locationTagRepository.add(locationTag1); - List locationTags = locationTagRepository.getAll(); - assertTrue(locationTags.isEmpty()); - } - - @Test - public void testGetShouldGetLocationTagByName() { - - LocationTag locationTag1 = initTestLocationTag1(); - locationTagRepository.add(locationTag1); - - org.opensrp.domain.postgres.LocationTag locationTag = locationTagRepository.getLocationTagByName("Country"); - assertNotNull(locationTag); - assertEquals("Country", locationTag.getName()); - assertEquals(true, locationTag.getActive()); - - } - - @Test - public void testGetShouldGetLocationTagByLocationTagExample() { - - LocationTag locationTag3 = initTestLocationTag3(); - locationTagRepository.add(locationTag3); - LocationTagExample locationTagExample = new LocationTagExample(); - String d = "d"; - locationTagExample.createCriteria().andNameLike('%' + d + '%'); - List locationTags = locationTagRepository.findByLocationTagExample(locationTagExample, 0, 100); - - assertEquals(1, locationTags.size()); - assertEquals("district", locationTags.get(0).getName()); - assertEquals(true, locationTags.get(0).getActive()); - - } - - private LocationTag initTestLocationTag1() { - LocationTag locationTag = new LocationTag(); - locationTag.setName("Country"); - locationTag.setDescription("first label tag name"); - locationTag.setActive(true); - locationTag.setId(1L); - return locationTag; - } - - private LocationTag initTestLocationTag6() { - LocationTag locationTag = new LocationTag(); - locationTag.setName("Ward"); - locationTag.setDescription("first label tag name"); - locationTag.setActive(true); - locationTag.setId(2L); - return locationTag; - } - - private LocationTag initTestLocationTag2() { - LocationTag locationTag = new LocationTag(); - locationTag.setName("Division"); - locationTag.setDescription("second label tag name"); - locationTag.setActive(true); - locationTag.setId(3L); - return locationTag; - } - - private LocationTag initTestLocationTag3() { - LocationTag locationTag = new LocationTag(); - locationTag.setName("district"); - locationTag.setDescription("third label tag name"); - locationTag.setActive(true); - locationTag.setId(4L); - return locationTag; - } - - private LocationTag initTestLocationTag4() { - LocationTag locationTag = new LocationTag(); - locationTag.setName("upazila"); - locationTag.setDescription("fourth label tag name"); - locationTag.setActive(true); - locationTag.setId(5L); - return locationTag; - } + LocationTag locationTag1 = initTestLocationTag6(); + locationTagRepository.add(locationTag1); + + List locationTags = locationTagRepository.getAll(); + LocationTagMap locationTagMap = new LocationTagMap(); + locationTagMap.setLocationId(1l); + locationTagMap.setLocationTagId(locationTags.get(0).getId()); + + locationTagRepository.addLocationTagMap(locationTagMap); + locationTagRepository.addLocationTagMap(locationTagMap); + + } + + @Test(expected = IllegalArgumentException.class) + public void testNotAddShouldAddNewLocationTagMapWithoutLocationTagIdandLocationId() { + LocationTagMap locationTagMap = new LocationTagMap(); + locationTagRepository.addLocationTagMap(locationTagMap); + + } + + @Test(expected = DuplicateKeyException.class) + public void testAddShouldNotAddDuplicateLocationTagMap() { + LocationTag locationTag1 = initTestLocationTag1(); + locationTagRepository.add(locationTag1); + locationTagRepository.add(locationTag1); + + } + + @Test + public void testShouldDeleteLocationTagMapByLocationId() { + LocationTag locationTag1 = initTestLocationTag6(); + locationTagRepository.add(locationTag1); + + List locationTags = locationTagRepository.getAll(); + LocationTagMap locationTagMap = new LocationTagMap(); + locationTagMap.setLocationId(1l); + locationTagMap.setLocationTagId(locationTags.get(0).getId()); + locationTagRepository.addLocationTagMap(locationTagMap); + + LocationTagMap locationTagMap1 = new LocationTagMap(); + locationTagMap1.setLocationId(2l); + locationTagMap1.setLocationTagId(locationTags.get(0).getId()); + locationTagRepository.addLocationTagMap(locationTagMap1); + + locationTagRepository.deleteLocationTagMapByLocationId(1l); + + List getDeletedLocationTagMaps = locationTagRepository.getLocationTagMapByExample(1l, locationTags + .get(0).getId()); + assertNotEquals(1, getDeletedLocationTagMaps.size()); + List getNotDeletedLocationTagMaps = locationTagRepository.getLocationTagMapByExample(2l, + locationTags.get(0).getId()); + + assertEquals(1, getNotDeletedLocationTagMaps.size()); + } + + @Test(expected = IllegalArgumentException.class) + public void testShouldIllegalArgumentExceptionOndeleteLocationTagMapByLocationIdZero() { + locationTagRepository.deleteLocationTagMapByLocationId(0l); + } + + @Test(expected = IllegalArgumentException.class) + public void testShouldIllegalArgumentExceptionOnDeleteLocationTagMapWitLocationIdZero() { + locationTagRepository.deleteLocationTagMapByLocationIdAndLocationTagId(0l, 1l); + } + + @Test(expected = IllegalArgumentException.class) + public void testShouldIllegalArgumentExceptionOnDeleteLocationTagMapWitLocationIdNull() { + locationTagRepository.deleteLocationTagMapByLocationIdAndLocationTagId(null, 1l); + } + + @Test(expected = IllegalArgumentException.class) + public void testShouldIllegalArgumentExceptionOnDeleteLocationTagMapWitLocationTagIdNull() { + locationTagRepository.deleteLocationTagMapByLocationIdAndLocationTagId(1l, null); + } + + @Test(expected = IllegalArgumentException.class) + public void testShouldIllegalArgumentExceptionOnDeleteLocationTagMapWitLocationTagIdZero() { + locationTagRepository.deleteLocationTagMapByLocationIdAndLocationTagId(1l, 0l); + } + + @Test + public void testAddShouldUpdateExistingLocationTag() { + LocationTag locationTag2 = initTestLocationTag2(); + locationTagRepository.add(locationTag2); + org.opensrp.domain.postgres.LocationTag getLocationTag = locationTagRepository.getLocationTagByName("Division"); + locationTag2.setId(getLocationTag.getId()); + locationTag2.setDescription("update second label tag name"); + locationTag2.setName("Division Tag"); + locationTagRepository.update(locationTag2); + List locationTags = locationTagRepository.getAll(); + assertNotNull(locationTags); + assertEquals(1, locationTags.size()); + + assertEquals(true, locationTags.get(0).getActive()); + assertEquals("Division Tag", locationTags.get(0).getName()); + + } + + @Test(expected = DuplicateKeyException.class) + public void testAddShouldNotUpdateExistingLocationTag() { + LocationTag locationTag2 = initTestLocationTag2(); + locationTagRepository.add(locationTag2); + locationTag2.setName("Division Tag"); + locationTagRepository.add(locationTag2); + org.opensrp.domain.postgres.LocationTag getLocationTag = locationTagRepository.getLocationTagByName("Division"); + locationTag2.setId(getLocationTag.getId()); + locationTag2.setDescription("update second label tag name"); + locationTag2.setName("Division Tag"); + locationTagRepository.update(locationTag2); + + } + + @Test + public void testAddShouldAInActiveExistingLocationTag() { + LocationTag locationTag4 = initTestLocationTag4(); + locationTagRepository.add(locationTag4); + org.opensrp.domain.postgres.LocationTag findLocationTag = locationTagRepository.getLocationTagByName("upazila"); + locationTagRepository.safeRemove(findLocationTag.getId()); + org.opensrp.domain.postgres.LocationTag getLocationTag = locationTagRepository.getLocationTagByName("upazila"); + assertNotNull(getLocationTag); + assertEquals(false, getLocationTag.getActive()); + assertEquals("upazila", getLocationTag.getName()); + + } + + @Test + public void testAddShouldAInActiveExistingLocationTagById() { + LocationTag locationTag2 = initTestLocationTag2(); + locationTagRepository.add(locationTag2); + locationTagRepository.safeRemove(locationTag2); + org.opensrp.domain.postgres.LocationTag getLocationTag = locationTagRepository.getLocationTagByName("Division"); + assertNotNull(getLocationTag); + assertEquals(false, getLocationTag.getActive()); + assertEquals("Division", getLocationTag.getName()); + + } + + @Test + public void testAddShouldNotAddRecordIfLocationTagIsNull() { + locationTagRepository.add(null); + List locationTags = locationTagRepository.getAll(); + assertTrue(locationTags.isEmpty()); + } + + @Test + public void testAddShouldNotAddRecordIfLocationTagNameIsNullOrEmpty() { + LocationTag locationTag1 = initTestLocationTag1(); + locationTag1.setName(null); + locationTagRepository.add(locationTag1); + + locationTag1.setName(""); + locationTagRepository.add(locationTag1); + List locationTags = locationTagRepository.getAll(); + assertTrue(locationTags.isEmpty()); + } + + @Test + public void testGetShouldGetLocationTagByName() { + + LocationTag locationTag1 = initTestLocationTag1(); + locationTagRepository.add(locationTag1); + + org.opensrp.domain.postgres.LocationTag locationTag = locationTagRepository.getLocationTagByName("Country"); + assertNotNull(locationTag); + assertEquals("Country", locationTag.getName()); + assertEquals(true, locationTag.getActive()); + + } + + @Test + public void testGetShouldGetLocationTagByLocationTagExample() { + + LocationTag locationTag3 = initTestLocationTag3(); + locationTagRepository.add(locationTag3); + LocationTagExample locationTagExample = new LocationTagExample(); + String d = "d"; + locationTagExample.createCriteria().andNameLike('%' + d + '%'); + List locationTags = locationTagRepository.findByLocationTagExample(locationTagExample, 0, 100); + + assertEquals(1, locationTags.size()); + assertEquals("district", locationTags.get(0).getName()); + assertEquals(true, locationTags.get(0).getActive()); + + } + + private LocationTag initTestLocationTag1() { + LocationTag locationTag = new LocationTag(); + locationTag.setName("Country"); + locationTag.setDescription("first label tag name"); + locationTag.setActive(true); + locationTag.setId(1L); + return locationTag; + } + + private LocationTag initTestLocationTag6() { + LocationTag locationTag = new LocationTag(); + locationTag.setName("Ward"); + locationTag.setDescription("first label tag name"); + locationTag.setActive(true); + locationTag.setId(2L); + return locationTag; + } + + private LocationTag initTestLocationTag2() { + LocationTag locationTag = new LocationTag(); + locationTag.setName("Division"); + locationTag.setDescription("second label tag name"); + locationTag.setActive(true); + locationTag.setId(3L); + return locationTag; + } + + private LocationTag initTestLocationTag3() { + LocationTag locationTag = new LocationTag(); + locationTag.setName("district"); + locationTag.setDescription("third label tag name"); + locationTag.setActive(true); + locationTag.setId(4L); + return locationTag; + } + + private LocationTag initTestLocationTag4() { + LocationTag locationTag = new LocationTag(); + locationTag.setName("upazila"); + locationTag.setDescription("fourth label tag name"); + locationTag.setActive(true); + locationTag.setId(5L); + return locationTag; + } } diff --git a/src/test/java/org/opensrp/repository/postgres/ManifestRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/ManifestRepositoryTest.java index d8078262c..6819b72b9 100644 --- a/src/test/java/org/opensrp/repository/postgres/ManifestRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/ManifestRepositoryTest.java @@ -21,13 +21,6 @@ public class ManifestRepositoryTest extends BaseRepositoryTest { @Autowired private ManifestRepository manifestRepository; - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("manifest.sql"); - return scripts; - } - private static Manifest initTestManifest() { Manifest manifest = new Manifest(); String identifier = "7"; @@ -58,6 +51,12 @@ private static Manifest initTestManifest2() { return manifest; } + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("manifest.sql"); + return scripts; + } @Test public void testGet() { diff --git a/src/test/java/org/opensrp/repository/postgres/MultimediaRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/MultimediaRepositoryTest.java index a06419b97..f0d27dcd0 100644 --- a/src/test/java/org/opensrp/repository/postgres/MultimediaRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/MultimediaRepositoryTest.java @@ -14,122 +14,122 @@ import static org.junit.Assert.*; public class MultimediaRepositoryTest extends BaseRepositoryTest { - - @Autowired - @Qualifier("multimediaRepositoryPostgres") - private MultimediaRepository multimediaRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("multimedia.sql"); - return scripts; - } - - @Test - public void testGet() { - Multimedia multimedia = multimediaRepository.get("05934ae338431f28bf6793b241f0c5ca"); - assertEquals("040d4f18-8140-479c-aa21-725612073490", multimedia.getCaseId()); - assertEquals("/opt/multimedia/patient_images/040d4f18-8140-479c-aa21-725612073490.jpg", multimedia.getFilePath()); - assertEquals("profilepic", multimedia.getFileCategory()); - - assertNull(multimediaRepository.get("05934ae338431f28bf6793b241fa")); - } - - @Test - public void testAdd() { - Multimedia multimedia = new Multimedia("2332kkj-jhjmmn-23423423", "tester1", "image/jpeg", "/tmp/123.jpg", - "thumbnail"); - multimediaRepository.add(multimedia); - - assertEquals(6, multimediaRepository.getAll().size()); - - Multimedia savedEntity = multimediaRepository.findByCaseId("2332kkj-jhjmmn-23423423"); - assertEquals("/tmp/123.jpg", savedEntity.getFilePath()); - assertEquals("thumbnail", savedEntity.getFileCategory()); - assertEquals("image/jpeg", savedEntity.getContentType()); - } - - @Test - public void testUpdate() { - Multimedia multimedia = multimediaRepository.get("3157f9339bf0c948dd5d12aff82111e1"); - multimedia.setContentType("image/png"); - multimedia.setFilePath("/opt/images/783434-34534.png"); - multimediaRepository.update(multimedia); - - Multimedia updatedEntity = multimediaRepository.get("3157f9339bf0c948dd5d12aff82111e1"); - assertEquals("/opt/images/783434-34534.png", updatedEntity.getFilePath()); - assertEquals("image/png", updatedEntity.getContentType()); - } - - @Test - public void testGetAll() { - assertEquals(5, multimediaRepository.getAll().size()); - - Multimedia multimedia = new Multimedia("2332kkj-76385430sdfsd-23423423", "tester23", "image/jpeg", - "/tmp/b7jhkh23.jpg", "thumbnail"); - multimediaRepository.add(multimedia); - - List expectedClients = Arrays.asList("2332kkj-76385430sdfsd-23423423", - "87dc3230-84f7-4088-b257-e8b3130ab86b", "24eec0d8-e0ee-4f22-9d6b-3cca84bdefcf"); - int found = 0; - List multimediaList = multimediaRepository.getAll(); - assertEquals(6, multimediaList.size()); - for (Multimedia media : multimediaList) - if (expectedClients.contains(media.getCaseId())) - found++; - assertEquals(3, found); - - } - - @Test - public void testSafeRemove() { - - Multimedia multimedia = multimediaRepository.get("3157f9339bf0c948dd5d12aff82111e1"); - multimediaRepository.safeRemove(multimedia); - - List multimediaList = multimediaRepository.getAll(); - assertEquals(4, multimediaList.size()); - for (Multimedia media : multimediaList) - assertNotEquals("3157f9339bf0c948dd5d12aff82111e1", media.getId()); - - assertNull(multimediaRepository.get("3157f9339bf0c948dd5d12aff82111e1")); - - } - - @Test - public void testFindByCaseId() { - Multimedia multimedia = multimediaRepository.findByCaseId("87dc3230-84f7-4088-b257-e8b3130ab86b"); - assertEquals("091488163b6ecd589a915372a0ad3b0d", multimedia.getId()); - assertEquals("/opt/multimedia/patient_images/87dc3230-84f7-4088-b257-e8b3130ab86b.jpg", multimedia.getFilePath()); - assertEquals("profilepic", multimedia.getFileCategory()); - - assertNull(multimediaRepository.findByCaseId("05934ae338431f28bf6793b241fa")); - } - - @Test - public void testAll() { - assertEquals(4, multimediaRepository.all("biddemo").size()); - - List multimedia = multimediaRepository.all("tester11"); - assertEquals(1, multimedia.size()); - assertEquals("317f8db1bb6cc4b15ecc9993a2922f47", multimedia.get(0).getId()); - assertEquals("24eec0d8-e0ee-4f22-9d6b-3cca84bdefcf", multimedia.get(0).getCaseId()); - } - - @Test - public void testGetExtended() { - Multimedia multimedia = new Multimedia("caseId1", "providerId1", "contentType1", "filePath1", "fileCategory1"); - multimediaRepository.add(multimedia); - multimedia = new Multimedia("caseId1", "providerId1", "contentType1", "filePath2", "fileCategory1"); - multimediaRepository.add(multimedia); - - List multimediaFiles = multimediaRepository.get("caseId1", "contentType1", "fileCategory1"); - assertEquals(multimediaFiles.size(), 2); - - String filePath1 = multimediaFiles.get(0).getFilePath(); - String filePath2 = multimediaFiles.get(1).getFilePath(); - assertTrue("filePath1".equals(filePath1) || "filePath2".equals(filePath1)); - assertTrue("filePath1".equals(filePath2) || "filePath2".equals(filePath2)); - } + + @Autowired + @Qualifier("multimediaRepositoryPostgres") + private MultimediaRepository multimediaRepository; + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("multimedia.sql"); + return scripts; + } + + @Test + public void testGet() { + Multimedia multimedia = multimediaRepository.get("05934ae338431f28bf6793b241f0c5ca"); + assertEquals("040d4f18-8140-479c-aa21-725612073490", multimedia.getCaseId()); + assertEquals("/opt/multimedia/patient_images/040d4f18-8140-479c-aa21-725612073490.jpg", multimedia.getFilePath()); + assertEquals("profilepic", multimedia.getFileCategory()); + + assertNull(multimediaRepository.get("05934ae338431f28bf6793b241fa")); + } + + @Test + public void testAdd() { + Multimedia multimedia = new Multimedia("2332kkj-jhjmmn-23423423", "tester1", "image/jpeg", "/tmp/123.jpg", + "thumbnail"); + multimediaRepository.add(multimedia); + + assertEquals(6, multimediaRepository.getAll().size()); + + Multimedia savedEntity = multimediaRepository.findByCaseId("2332kkj-jhjmmn-23423423"); + assertEquals("/tmp/123.jpg", savedEntity.getFilePath()); + assertEquals("thumbnail", savedEntity.getFileCategory()); + assertEquals("image/jpeg", savedEntity.getContentType()); + } + + @Test + public void testUpdate() { + Multimedia multimedia = multimediaRepository.get("3157f9339bf0c948dd5d12aff82111e1"); + multimedia.setContentType("image/png"); + multimedia.setFilePath("/opt/images/783434-34534.png"); + multimediaRepository.update(multimedia); + + Multimedia updatedEntity = multimediaRepository.get("3157f9339bf0c948dd5d12aff82111e1"); + assertEquals("/opt/images/783434-34534.png", updatedEntity.getFilePath()); + assertEquals("image/png", updatedEntity.getContentType()); + } + + @Test + public void testGetAll() { + assertEquals(5, multimediaRepository.getAll().size()); + + Multimedia multimedia = new Multimedia("2332kkj-76385430sdfsd-23423423", "tester23", "image/jpeg", + "/tmp/b7jhkh23.jpg", "thumbnail"); + multimediaRepository.add(multimedia); + + List expectedClients = Arrays.asList("2332kkj-76385430sdfsd-23423423", + "87dc3230-84f7-4088-b257-e8b3130ab86b", "24eec0d8-e0ee-4f22-9d6b-3cca84bdefcf"); + int found = 0; + List multimediaList = multimediaRepository.getAll(); + assertEquals(6, multimediaList.size()); + for (Multimedia media : multimediaList) + if (expectedClients.contains(media.getCaseId())) + found++; + assertEquals(3, found); + + } + + @Test + public void testSafeRemove() { + + Multimedia multimedia = multimediaRepository.get("3157f9339bf0c948dd5d12aff82111e1"); + multimediaRepository.safeRemove(multimedia); + + List multimediaList = multimediaRepository.getAll(); + assertEquals(4, multimediaList.size()); + for (Multimedia media : multimediaList) + assertNotEquals("3157f9339bf0c948dd5d12aff82111e1", media.getId()); + + assertNull(multimediaRepository.get("3157f9339bf0c948dd5d12aff82111e1")); + + } + + @Test + public void testFindByCaseId() { + Multimedia multimedia = multimediaRepository.findByCaseId("87dc3230-84f7-4088-b257-e8b3130ab86b"); + assertEquals("091488163b6ecd589a915372a0ad3b0d", multimedia.getId()); + assertEquals("/opt/multimedia/patient_images/87dc3230-84f7-4088-b257-e8b3130ab86b.jpg", multimedia.getFilePath()); + assertEquals("profilepic", multimedia.getFileCategory()); + + assertNull(multimediaRepository.findByCaseId("05934ae338431f28bf6793b241fa")); + } + + @Test + public void testAll() { + assertEquals(4, multimediaRepository.all("biddemo").size()); + + List multimedia = multimediaRepository.all("tester11"); + assertEquals(1, multimedia.size()); + assertEquals("317f8db1bb6cc4b15ecc9993a2922f47", multimedia.get(0).getId()); + assertEquals("24eec0d8-e0ee-4f22-9d6b-3cca84bdefcf", multimedia.get(0).getCaseId()); + } + + @Test + public void testGetExtended() { + Multimedia multimedia = new Multimedia("caseId1", "providerId1", "contentType1", "filePath1", "fileCategory1"); + multimediaRepository.add(multimedia); + multimedia = new Multimedia("caseId1", "providerId1", "contentType1", "filePath2", "fileCategory1"); + multimediaRepository.add(multimedia); + + List multimediaFiles = multimediaRepository.get("caseId1", "contentType1", "fileCategory1"); + assertEquals(multimediaFiles.size(), 2); + + String filePath1 = multimediaFiles.get(0).getFilePath(); + String filePath2 = multimediaFiles.get(1).getFilePath(); + assertTrue("filePath1".equals(filePath1) || "filePath2".equals(filePath1)); + assertTrue("filePath1".equals(filePath2) || "filePath2".equals(filePath2)); + } } diff --git a/src/test/java/org/opensrp/repository/postgres/OrganizationRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/OrganizationRepositoryTest.java index 2f0644bf3..d797142f2 100755 --- a/src/test/java/org/opensrp/repository/postgres/OrganizationRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/OrganizationRepositoryTest.java @@ -49,541 +49,541 @@ * @author Samuel Githengi created on 09/16/19 */ public class OrganizationRepositoryTest extends BaseRepositoryTest { - - private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - - @Autowired - private OrganizationRepository organizationRepository; - - @Autowired - private PractitionerRepository practitionerRepository; - - @Autowired - private PractitionerRoleRepository practitionerRoleRepository; - - @Autowired - private PlanRepository planRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("organization.sql"); - scripts.add("plan.sql"); - return scripts; - } - - @Test - public void testGetOrganization() throws JsonGenerationException, JsonMappingException, IOException { - Organization organization = organizationRepository.get("fcc19470-d599-11e9-bb65-2a2ae2dbcce4"); - assertNotNull(organization); - assertEquals(1, organization.getId(), 0); - assertEquals("fcc19470-d599-11e9-bb65-2a2ae2dbcce4", organization.getIdentifier()); - assertEquals("The Luang", organization.getName()); - assertEquals(1, organization.getType().getCoding().size()); - Code code = organization.getType().getCoding().get(0); - assertEquals("http://terminology.hl7.org/CodeSystem/organization-type", code.getSystem()); - assertEquals("team", code.getCode()); - assertEquals("Team", code.getDisplay()); - assertNull(organization.getPartOf()); - - assertNull(organizationRepository.get("121sd")); - - } - - @Test - public void testAddOrganization() { - String identifier = UUID.randomUUID().toString(); - assertNull(organizationRepository.get(identifier)); - - Organization organization = new Organization(); - organization.setIdentifier(identifier); - organization.setName("Ateam"); - organization.setPartOf(1l); - organization.setActive(true); - organizationRepository.add(organization); - - Organization savedOrganization = organizationRepository.get(identifier); - - assertNotNull(savedOrganization); - assertNotNull(savedOrganization.getId()); - assertEquals(identifier, savedOrganization.getIdentifier()); - assertEquals("Ateam", savedOrganization.getName()); - assertNull(savedOrganization.getType()); - assertEquals(1, savedOrganization.getPartOf(), 0); - assertNotNull(savedOrganization.getDateEdited()); - assertNotNull(savedOrganization.getDateCreated()); - assertEquals(3, savedOrganization.getServerVersion()); - - } - - @Test - public void testUpdateOrganization() { - - Organization organization = organizationRepository.getByPrimaryKey(3l); - organization.setName("Ateam"); - organization.setPartOf(1l); - organization.setActive(false); - organizationRepository.update(organization); - - Organization updatedOrganization = organizationRepository.getByPrimaryKey(3l); - - assertNotNull(updatedOrganization); - assertEquals(3l, updatedOrganization.getId(), 0); - assertEquals("4c506c98-d3a9-11e9-bb65-2a2ae2dbcce4", updatedOrganization.getIdentifier()); - assertEquals("Ateam", updatedOrganization.getName()); - assertNull(updatedOrganization.getType()); - assertEquals(1l, updatedOrganization.getPartOf(), 0); - assertNotNull(updatedOrganization.getDateEdited()); - assertNotNull(updatedOrganization.getDateCreated()); - assertEquals(3, updatedOrganization.getServerVersion()); - - } - - @Test - public void testGetAll() { - assertEquals(3, organizationRepository.getAll().size()); - - Organization organization = new Organization(); - organization.setIdentifier(UUID.randomUUID().toString()); - organization.setName("Ateam"); - organization.setPartOf(1l); - organization.setActive(true); - organizationRepository.add(organization); - - assertEquals(4, organizationRepository.getAll().size()); - - } - - @Test - public void testSafeRemove() { - - Organization organization = organizationRepository.getByPrimaryKey(2l); - organizationRepository.safeRemove(organization); - - assertNull(organizationRepository.getByPrimaryKey(2l)); - - assertEquals(2, organizationRepository.getAll().size()); - - } - - @Test - public void testSelectOrganizationsEncompassLocations() throws ParseException { - String jurisdiction = "304cbcd4-0850-404a-a8b1-486b02f7b84d"; - DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH); - Date date = format.parse("2019-12-10 20:20:20"); - List organizations = organizationRepository.selectOrganizationsEncompassLocations(jurisdiction, date); - assertEquals(organizations.size(), 2); - } - - @Test - public void testAssignLocation() { - String identifier = UUID.randomUUID().toString(); - Organization organization = new Organization(); - organization.setIdentifier(identifier); - organization.setName("ATeam"); - organizationRepository.add(organization); - - organization = organizationRepository.get(identifier); - Calendar calendar = Calendar.getInstance(); - Date fromDate = calendar.getTime(); - calendar.add(Calendar.YEAR, 2); - Date toDate = calendar.getTime(); - organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, - "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, toDate); - - AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() - .organizationId(organization.getId()) - .returnFutureAssignments(true).build(); - List assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); - assertEquals(1, assignedLocations.size()); - assertEquals("304cbcd4-0850-404a-a8b1-486b02f7b84d", assignedLocations.get(0).getJurisdictionId()); - assertEquals("9d1403a5-756d-517b-91d6-5b19059a69f0", assignedLocations.get(0).getPlanId()); - assertEquals(dateFormat.format(fromDate), dateFormat.format(assignedLocations.get(0).getFromDate())); - assertEquals(dateFormat.format(toDate), dateFormat.format(assignedLocations.get(0).getToDate())); - - organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, - "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, null); - - assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() - .organizationId(organization.getId()) - .returnFutureAssignments(true).build(); - assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); - assertEquals(1, assignedLocations.size()); - assertNull(assignedLocations.get(0).getToDate()); - - } - - @Test(expected = DataIntegrityViolationException.class) - public void testAssignLocationAndPlanShouldErrorWithOverlappingData() { - String identifier = UUID.randomUUID().toString(); - Organization organization = new Organization(); - organization.setIdentifier(identifier); - organization.setName("ATeam"); - organizationRepository.add(organization); - - organization = organizationRepository.get(identifier); - Calendar calendar = Calendar.getInstance(); - Date fromDate = calendar.getTime(); - calendar.add(Calendar.YEAR, 2); - Date toDate = calendar.getTime(); - organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, - "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, toDate); - Calendar calendar2 = Calendar.getInstance(); - calendar2.add(Calendar.MONTH, 2); - organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, - "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, calendar2.getTime(), null); - - } - - @Test - public void testAssignLocationAndPlanExpired() { - String identifier = UUID.randomUUID().toString(); - Organization organization = new Organization(); - organization.setIdentifier(identifier); - organization.setName("ATeam"); - organizationRepository.add(organization); - - organization = organizationRepository.get(identifier); - Calendar calendar = Calendar.getInstance(); - calendar.add(Calendar.YEAR, -1); - Date fromDate = calendar.getTime(); - calendar.add(Calendar.MONTH, 2); - Date toDate = calendar.getTime(); - organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, - "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, toDate); - - AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() - .organizationId(organization.getId()) - .returnFutureAssignments(true).build(); - List assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); - assertEquals(0, assignedLocations.size()); - } - - @Test - public void testAssignLocationAndPlanExpiringTodayShouldNotReturned() { - String identifier = UUID.randomUUID().toString(); - Organization organization = new Organization(); - organization.setIdentifier(identifier); - organization.setName("ATeam"); - organizationRepository.add(organization); - - organization = organizationRepository.get(identifier); - Calendar calendar = Calendar.getInstance(); - Date fromDate = calendar.getTime(); - Date toDate = calendar.getTime(); - organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, - "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, toDate); - - AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() - .organizationId(organization.getId()) - .returnFutureAssignments(true).build(); - List assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); - assertEquals(0, assignedLocations.size()); - } - - @Test - public void testAssignLocationAndPlanUpdatesExistingIfFromDateMatches() { - String identifier = UUID.randomUUID().toString(); - Organization organization = new Organization(); - organization.setIdentifier(identifier); - organization.setName("ATeam"); - organizationRepository.add(organization); - - organization = organizationRepository.get(identifier); - Calendar calendar = Calendar.getInstance(); - Date fromDate = calendar.getTime(); - Date toDate = calendar.getTime(); - organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, - "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, toDate); - AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() - .organizationId(organization.getId()) - .returnFutureAssignments(true).build(); - List assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); - assertEquals(0, assignedLocations.size()); - - calendar.add(Calendar.YEAR, 1); - organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, - "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, calendar.getTime()); - assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() - .organizationId(organization.getId()) - .returnFutureAssignments(true).build(); - assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); - assertEquals(1, assignedLocations.size()); - } - - @Test - public void testAssignLocationAndPlanAcceptsMultipleAssigmentIfTheyDontOverlap() { - String identifier = UUID.randomUUID().toString(); - Organization organization = new Organization(); - organization.setIdentifier(identifier); - organization.setName("ATeam"); - organizationRepository.add(organization); - - organization = organizationRepository.get(identifier); - Calendar calendar = Calendar.getInstance(); - Date fromDate = calendar.getTime(); - calendar.add(Calendar.YEAR, 1); - Date toDate = calendar.getTime(); - organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, - "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, toDate); - AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() - .organizationId(organization.getId()) - .returnFutureAssignments(true).build(); - List assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); - assertEquals(1, assignedLocations.size()); - - calendar.add(Calendar.DATE, 1); - fromDate = calendar.getTime(); - calendar.add(Calendar.YEAR, 1); - toDate = calendar.getTime(); - organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, - "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, toDate); - assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() - .organizationId(organization.getId()) - .returnFutureAssignments(true).build(); - assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); - assertEquals(2, assignedLocations.size()); - } - - @Test - public void testFindAssignedLocations() { - AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() - .organizationId(1l) - .returnFutureAssignments(true).build(); - List assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); - assertEquals(2, assignedLocations.size()); - - assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() - .organizationId(2l) - .returnFutureAssignments(true).build(); - assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); - assertEquals(1, assignedLocations.size()); - assertEquals("304cbcd4-0850-404a-a8b1-486b02f7b84d", assignedLocations.get(0).getJurisdictionId()); - assertEquals("7f2ae03f-9569-5535-918c-9d976b3ae5f8", assignedLocations.get(0).getPlanId()); - assertEquals("2019-09-10", dateFormat.format(assignedLocations.get(0).getFromDate())); - assertEquals("2022-09-10", dateFormat.format(assignedLocations.get(0).getToDate())); - - } - - @Test - public void testFindAssignedLocationsMutipleIds() { - List assignedLocations = organizationRepository - .findAssignedLocations(Collections.singletonList(1l), true); - assertEquals(2, assignedLocations.size()); - - assignedLocations = organizationRepository.findAssignedLocations(Collections.singletonList(2l), true); - assertEquals(1, assignedLocations.size()); - assertEquals("304cbcd4-0850-404a-a8b1-486b02f7b84d", assignedLocations.get(0).getJurisdictionId()); - assertEquals("7f2ae03f-9569-5535-918c-9d976b3ae5f8", assignedLocations.get(0).getPlanId()); - assertEquals("2019-09-10", dateFormat.format(assignedLocations.get(0).getFromDate())); - assertEquals("2022-09-10", dateFormat.format(assignedLocations.get(0).getToDate())); - - assignedLocations = organizationRepository.findAssignedLocations(Arrays.asList(1l, 2l), true); - assertEquals(3, assignedLocations.size()); - } - - @Test - public void testFindOrganizationsByNameAndLcations() { - practitionerRepository.add(initTestPractitioner()); - practitionerRoleRepository.add(initTestPractitionerRole()); - OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); - organizationSearchBean.setPageNumber(0); - organizationSearchBean.setPageSize(10); - organizationSearchBean.setName("The Luang"); - List locations = new ArrayList<>(); - locations.add(2243); - locations.add(1); - organizationSearchBean.setLocations(locations); - List organizations = organizationRepository.findSearchOrganizations(organizationSearchBean); - assertEquals(1, organizations.size()); - } - - @Test - public void testFindOrganizationsWithoutSearchParam() { - practitionerRepository.add(initTestPractitioner()); - practitionerRoleRepository.add(initTestPractitionerRole()); - OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); - organizationSearchBean.setPageNumber(0); - organizationSearchBean.setPageSize(10); - organizationSearchBean.setOrderByFieldName(FieldName.valueOf("name")); - organizationSearchBean.setOrderByType(OrderByType.valueOf("ASC")); - List organizations = organizationRepository.findSearchOrganizations(organizationSearchBean); - assertEquals(3, organizations.size()); - } - - @Test - public void testFindEmptyOrganizationsByNameAndLcations() { - practitionerRepository.add(initTestPractitioner()); - practitionerRoleRepository.add(initTestPractitionerRole()); - OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); - organizationSearchBean.setPageNumber(0); - organizationSearchBean.setPageSize(10); - organizationSearchBean.setName("The Luang Bell"); - List locations = new ArrayList<>(); - locations.add(22435); - locations.add(1); - organizationSearchBean.setLocations(locations); - List organizations = organizationRepository.findSearchOrganizations(organizationSearchBean); - assertTrue(organizations.isEmpty()); - - } - - @Test(expected = IllegalArgumentException.class) - public void testFindOrganizationsByOrderByFieldNameNotExists() { - OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); - organizationSearchBean.setPageNumber(0); - organizationSearchBean.setPageSize(10); - organizationSearchBean.setOrderByFieldName(FieldName.valueOf("names")); - organizationSearchBean.setOrderByType(OrderByType.valueOf("ASC")); - organizationRepository.findSearchOrganizations(organizationSearchBean); - - } - - @Test - public void testFindTotalSearchOrganizationsByNameAndLcations() { - practitionerRepository.add(initTestPractitioner()); - practitionerRoleRepository.add(initTestPractitionerRole()); - OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); - organizationSearchBean.setPageNumber(0); - organizationSearchBean.setPageSize(10); - organizationSearchBean.setName("The Luang"); - List locations = new ArrayList<>(); - locations.add(2243); - locations.add(1); - organizationSearchBean.setLocations(locations); - int totalCount = organizationRepository.findOrganizationCount(organizationSearchBean); - assertEquals(1, totalCount); - - } - - @Test - public void testFindTotalSearchOrganizationsWithoutSearchParam() { - practitionerRepository.add(initTestPractitioner()); - practitionerRoleRepository.add(initTestPractitionerRole()); - OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); - - int totalCount = organizationRepository.findOrganizationCount(organizationSearchBean); - assertEquals(3, totalCount); - - } - - @Test - public void testGetAllOrganizations() { - OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); - organizationSearchBean.setOrderByType(OrderByType.ASC); - organizationSearchBean.setOrderByFieldName(FieldName.id); - organizationSearchBean.setServerVersion(1l); - assertEquals(3, organizationRepository.getAllOrganizations(organizationSearchBean).size()); - - Organization organization = new Organization(); - organization.setIdentifier(UUID.randomUUID().toString()); - organization.setName("Ateam"); - organization.setPartOf(1l); - organization.setActive(true); - organizationRepository.add(organization); - - List organizations = organizationRepository.getAllOrganizations(organizationSearchBean); - assertEquals(4, organizations.size()); - assertEquals(new Long(1l), organizations.get(0).getId()); - assertEquals(new Long(4l), organizations.get(3).getId()); - - } - - @Test - public void testUnassignLocationAndPlan() { - String identifier = UUID.randomUUID().toString(); - Organization organization = new Organization(); - organization.setIdentifier(identifier); - organization.setName("ATeam"); - organizationRepository.add(organization); - - String planIdentifier = UUID.randomUUID().toString(); - PlanDefinition planDefinition = new PlanDefinition(); - planDefinition.setIdentifier(planIdentifier); - planDefinition.setName("Plan A"); - planRepository.add(planDefinition); - - organization = organizationRepository.get(identifier); - Long planId = planRepository.retrievePrimaryKey(planIdentifier); - Calendar calendar = Calendar.getInstance(); - Date fromDate = calendar.getTime(); - calendar.add(Calendar.YEAR, 2); - Date toDate = calendar.getTime(); - organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, - planIdentifier, planId, fromDate, toDate); - - AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() - .planId(planId) - .returnFutureAssignments(true).build(); - List assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); - assertEquals(1, assignedLocations.size()); - assertEquals("304cbcd4-0850-404a-a8b1-486b02f7b84d", assignedLocations.get(0).getJurisdictionId()); - assertEquals(planIdentifier, assignedLocations.get(0).getPlanId()); - assertEquals(dateFormat.format(fromDate), dateFormat.format(assignedLocations.get(0).getFromDate())); - assertEquals(dateFormat.format(toDate), dateFormat.format(assignedLocations.get(0).getToDate())); - - organizationRepository.unassignLocationAndPlan(planId); - assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() - .planId(planId) - .build(); - assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); - assertEquals(0, assignedLocations.size()); // verified - removes all the assigned teams - } - - @Test - public void testCountAllOrganizations() { - Organization organization1 = new Organization(); - Organization organization2 = new Organization(); - organizationRepository.add(organization1); - organizationRepository.add(organization2); - assertEquals(3, organizationRepository.countAllOrganizations()); - } - - @Test - public void testGetOrganizationsByIds() { - List organizationIds = new ArrayList<>(); - organizationIds.add(1l); - organizationIds.add(2l); - organizationIds.add(3l); - List organizations = organizationRepository.getOrganizationsByIds(organizationIds); - assertNotNull(organizations); - assertEquals(3, organizations.size()); - assertEquals(new Long(1), organizations.get(0).getId()); - assertEquals("fcc19470-d599-11e9-bb65-2a2ae2dbcce4", organizations.get(0).getIdentifier()); - assertEquals("The Luang", organizations.get(0).getName()); - assertEquals(1, organizations.get(0).getType().getCoding().size()); - Code code = organizations.get(0).getType().getCoding().get(0); - assertEquals("http://terminology.hl7.org/CodeSystem/organization-type", code.getSystem()); - assertEquals("team", code.getCode()); - assertEquals("Team", code.getDisplay()); - assertNull(organizations.get(0).getPartOf()); - - assertEquals(new Long(3), organizations.get(1).getId()); - assertEquals("4c506c98-d3a9-11e9-bb65-2a2ae2dbcce4", organizations.get(1).getIdentifier()); - - assertEquals(new Long(2), organizations.get(2).getId()); - assertEquals("d23f7350-d406-11e9-bb65-2a2ae2dbcce4", organizations.get(2).getIdentifier()); - } - - private static PractitionerRole initTestPractitionerRole() { - PractitionerRole practitionerRole = new PractitionerRole(); - practitionerRole.setIdentifier("pr3-identifier"); - practitionerRole.setActive(true); - practitionerRole.setOrganizationIdentifier("fcc19470-d599-11e9-bb65-2a2ae2dbcce4"); - practitionerRole.setPractitionerIdentifier("practitoner-3-identifier"); - PractitionerRoleCode code = new PractitionerRoleCode(); - code.setText("pr3Code"); - practitionerRole.setCode(code); - return practitionerRole; - } - - private Practitioner initTestPractitioner() { - Practitioner practitioner = new Practitioner(); - practitioner.setIdentifier("practitoner-3-identifier"); - practitioner.setActive(false); - practitioner.setName("Third Practitioner"); - practitioner.setUsername("Practioner3"); - practitioner.setUserId("user3"); - return practitioner; - } + + private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + + @Autowired + private OrganizationRepository organizationRepository; + + @Autowired + private PractitionerRepository practitionerRepository; + + @Autowired + private PractitionerRoleRepository practitionerRoleRepository; + + @Autowired + private PlanRepository planRepository; + + private static PractitionerRole initTestPractitionerRole() { + PractitionerRole practitionerRole = new PractitionerRole(); + practitionerRole.setIdentifier("pr3-identifier"); + practitionerRole.setActive(true); + practitionerRole.setOrganizationIdentifier("fcc19470-d599-11e9-bb65-2a2ae2dbcce4"); + practitionerRole.setPractitionerIdentifier("practitoner-3-identifier"); + PractitionerRoleCode code = new PractitionerRoleCode(); + code.setText("pr3Code"); + practitionerRole.setCode(code); + return practitionerRole; + } + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("organization.sql"); + scripts.add("plan.sql"); + return scripts; + } + + @Test + public void testGetOrganization() throws JsonGenerationException, JsonMappingException, IOException { + Organization organization = organizationRepository.get("fcc19470-d599-11e9-bb65-2a2ae2dbcce4"); + assertNotNull(organization); + assertEquals(1, organization.getId(), 0); + assertEquals("fcc19470-d599-11e9-bb65-2a2ae2dbcce4", organization.getIdentifier()); + assertEquals("The Luang", organization.getName()); + assertEquals(1, organization.getType().getCoding().size()); + Code code = organization.getType().getCoding().get(0); + assertEquals("http://terminology.hl7.org/CodeSystem/organization-type", code.getSystem()); + assertEquals("team", code.getCode()); + assertEquals("Team", code.getDisplay()); + assertNull(organization.getPartOf()); + + assertNull(organizationRepository.get("121sd")); + + } + + @Test + public void testAddOrganization() { + String identifier = UUID.randomUUID().toString(); + assertNull(organizationRepository.get(identifier)); + + Organization organization = new Organization(); + organization.setIdentifier(identifier); + organization.setName("Ateam"); + organization.setPartOf(1l); + organization.setActive(true); + organizationRepository.add(organization); + + Organization savedOrganization = organizationRepository.get(identifier); + + assertNotNull(savedOrganization); + assertNotNull(savedOrganization.getId()); + assertEquals(identifier, savedOrganization.getIdentifier()); + assertEquals("Ateam", savedOrganization.getName()); + assertNull(savedOrganization.getType()); + assertEquals(1, savedOrganization.getPartOf(), 0); + assertNotNull(savedOrganization.getDateEdited()); + assertNotNull(savedOrganization.getDateCreated()); + assertEquals(3, savedOrganization.getServerVersion()); + + } + + @Test + public void testUpdateOrganization() { + + Organization organization = organizationRepository.getByPrimaryKey(3l); + organization.setName("Ateam"); + organization.setPartOf(1l); + organization.setActive(false); + organizationRepository.update(organization); + + Organization updatedOrganization = organizationRepository.getByPrimaryKey(3l); + + assertNotNull(updatedOrganization); + assertEquals(3l, updatedOrganization.getId(), 0); + assertEquals("4c506c98-d3a9-11e9-bb65-2a2ae2dbcce4", updatedOrganization.getIdentifier()); + assertEquals("Ateam", updatedOrganization.getName()); + assertNull(updatedOrganization.getType()); + assertEquals(1l, updatedOrganization.getPartOf(), 0); + assertNotNull(updatedOrganization.getDateEdited()); + assertNotNull(updatedOrganization.getDateCreated()); + assertEquals(3, updatedOrganization.getServerVersion()); + + } + + @Test + public void testGetAll() { + assertEquals(3, organizationRepository.getAll().size()); + + Organization organization = new Organization(); + organization.setIdentifier(UUID.randomUUID().toString()); + organization.setName("Ateam"); + organization.setPartOf(1l); + organization.setActive(true); + organizationRepository.add(organization); + + assertEquals(4, organizationRepository.getAll().size()); + + } + + @Test + public void testSafeRemove() { + + Organization organization = organizationRepository.getByPrimaryKey(2l); + organizationRepository.safeRemove(organization); + + assertNull(organizationRepository.getByPrimaryKey(2l)); + + assertEquals(2, organizationRepository.getAll().size()); + + } + + @Test + public void testSelectOrganizationsEncompassLocations() throws ParseException { + String jurisdiction = "304cbcd4-0850-404a-a8b1-486b02f7b84d"; + DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH); + Date date = format.parse("2019-12-10 20:20:20"); + List organizations = organizationRepository.selectOrganizationsEncompassLocations(jurisdiction, date); + assertEquals(organizations.size(), 2); + } + + @Test + public void testAssignLocation() { + String identifier = UUID.randomUUID().toString(); + Organization organization = new Organization(); + organization.setIdentifier(identifier); + organization.setName("ATeam"); + organizationRepository.add(organization); + + organization = organizationRepository.get(identifier); + Calendar calendar = Calendar.getInstance(); + Date fromDate = calendar.getTime(); + calendar.add(Calendar.YEAR, 2); + Date toDate = calendar.getTime(); + organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, + "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, toDate); + + AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() + .organizationId(organization.getId()) + .returnFutureAssignments(true).build(); + List assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); + assertEquals(1, assignedLocations.size()); + assertEquals("304cbcd4-0850-404a-a8b1-486b02f7b84d", assignedLocations.get(0).getJurisdictionId()); + assertEquals("9d1403a5-756d-517b-91d6-5b19059a69f0", assignedLocations.get(0).getPlanId()); + assertEquals(dateFormat.format(fromDate), dateFormat.format(assignedLocations.get(0).getFromDate())); + assertEquals(dateFormat.format(toDate), dateFormat.format(assignedLocations.get(0).getToDate())); + + organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, + "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, null); + + assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() + .organizationId(organization.getId()) + .returnFutureAssignments(true).build(); + assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); + assertEquals(1, assignedLocations.size()); + assertNull(assignedLocations.get(0).getToDate()); + + } + + @Test(expected = DataIntegrityViolationException.class) + public void testAssignLocationAndPlanShouldErrorWithOverlappingData() { + String identifier = UUID.randomUUID().toString(); + Organization organization = new Organization(); + organization.setIdentifier(identifier); + organization.setName("ATeam"); + organizationRepository.add(organization); + + organization = organizationRepository.get(identifier); + Calendar calendar = Calendar.getInstance(); + Date fromDate = calendar.getTime(); + calendar.add(Calendar.YEAR, 2); + Date toDate = calendar.getTime(); + organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, + "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, toDate); + Calendar calendar2 = Calendar.getInstance(); + calendar2.add(Calendar.MONTH, 2); + organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, + "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, calendar2.getTime(), null); + + } + + @Test + public void testAssignLocationAndPlanExpired() { + String identifier = UUID.randomUUID().toString(); + Organization organization = new Organization(); + organization.setIdentifier(identifier); + organization.setName("ATeam"); + organizationRepository.add(organization); + + organization = organizationRepository.get(identifier); + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.YEAR, -1); + Date fromDate = calendar.getTime(); + calendar.add(Calendar.MONTH, 2); + Date toDate = calendar.getTime(); + organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, + "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, toDate); + + AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() + .organizationId(organization.getId()) + .returnFutureAssignments(true).build(); + List assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); + assertEquals(0, assignedLocations.size()); + } + + @Test + public void testAssignLocationAndPlanExpiringTodayShouldNotReturned() { + String identifier = UUID.randomUUID().toString(); + Organization organization = new Organization(); + organization.setIdentifier(identifier); + organization.setName("ATeam"); + organizationRepository.add(organization); + + organization = organizationRepository.get(identifier); + Calendar calendar = Calendar.getInstance(); + Date fromDate = calendar.getTime(); + Date toDate = calendar.getTime(); + organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, + "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, toDate); + + AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() + .organizationId(organization.getId()) + .returnFutureAssignments(true).build(); + List assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); + assertEquals(0, assignedLocations.size()); + } + + @Test + public void testAssignLocationAndPlanUpdatesExistingIfFromDateMatches() { + String identifier = UUID.randomUUID().toString(); + Organization organization = new Organization(); + organization.setIdentifier(identifier); + organization.setName("ATeam"); + organizationRepository.add(organization); + + organization = organizationRepository.get(identifier); + Calendar calendar = Calendar.getInstance(); + Date fromDate = calendar.getTime(); + Date toDate = calendar.getTime(); + organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, + "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, toDate); + AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() + .organizationId(organization.getId()) + .returnFutureAssignments(true).build(); + List assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); + assertEquals(0, assignedLocations.size()); + + calendar.add(Calendar.YEAR, 1); + organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, + "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, calendar.getTime()); + assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() + .organizationId(organization.getId()) + .returnFutureAssignments(true).build(); + assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); + assertEquals(1, assignedLocations.size()); + } + + @Test + public void testAssignLocationAndPlanAcceptsMultipleAssigmentIfTheyDontOverlap() { + String identifier = UUID.randomUUID().toString(); + Organization organization = new Organization(); + organization.setIdentifier(identifier); + organization.setName("ATeam"); + organizationRepository.add(organization); + + organization = organizationRepository.get(identifier); + Calendar calendar = Calendar.getInstance(); + Date fromDate = calendar.getTime(); + calendar.add(Calendar.YEAR, 1); + Date toDate = calendar.getTime(); + organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, + "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, toDate); + AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() + .organizationId(organization.getId()) + .returnFutureAssignments(true).build(); + List assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); + assertEquals(1, assignedLocations.size()); + + calendar.add(Calendar.DATE, 1); + fromDate = calendar.getTime(); + calendar.add(Calendar.YEAR, 1); + toDate = calendar.getTime(); + organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, + "7f2ae03f-9569-5535-918c-9d976b3ae5f8", 11l, fromDate, toDate); + assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() + .organizationId(organization.getId()) + .returnFutureAssignments(true).build(); + assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); + assertEquals(2, assignedLocations.size()); + } + + @Test + public void testFindAssignedLocations() { + AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() + .organizationId(1l) + .returnFutureAssignments(true).build(); + List assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); + assertEquals(2, assignedLocations.size()); + + assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() + .organizationId(2l) + .returnFutureAssignments(true).build(); + assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); + assertEquals(1, assignedLocations.size()); + assertEquals("304cbcd4-0850-404a-a8b1-486b02f7b84d", assignedLocations.get(0).getJurisdictionId()); + assertEquals("7f2ae03f-9569-5535-918c-9d976b3ae5f8", assignedLocations.get(0).getPlanId()); + assertEquals("2019-09-10", dateFormat.format(assignedLocations.get(0).getFromDate())); + assertEquals("2022-09-10", dateFormat.format(assignedLocations.get(0).getToDate())); + + } + + @Test + public void testFindAssignedLocationsMutipleIds() { + List assignedLocations = organizationRepository + .findAssignedLocations(Collections.singletonList(1l), true); + assertEquals(2, assignedLocations.size()); + + assignedLocations = organizationRepository.findAssignedLocations(Collections.singletonList(2l), true); + assertEquals(1, assignedLocations.size()); + assertEquals("304cbcd4-0850-404a-a8b1-486b02f7b84d", assignedLocations.get(0).getJurisdictionId()); + assertEquals("7f2ae03f-9569-5535-918c-9d976b3ae5f8", assignedLocations.get(0).getPlanId()); + assertEquals("2019-09-10", dateFormat.format(assignedLocations.get(0).getFromDate())); + assertEquals("2022-09-10", dateFormat.format(assignedLocations.get(0).getToDate())); + + assignedLocations = organizationRepository.findAssignedLocations(Arrays.asList(1l, 2l), true); + assertEquals(3, assignedLocations.size()); + } + + @Test + public void testFindOrganizationsByNameAndLcations() { + practitionerRepository.add(initTestPractitioner()); + practitionerRoleRepository.add(initTestPractitionerRole()); + OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); + organizationSearchBean.setPageNumber(0); + organizationSearchBean.setPageSize(10); + organizationSearchBean.setName("The Luang"); + List locations = new ArrayList<>(); + locations.add(2243); + locations.add(1); + organizationSearchBean.setLocations(locations); + List organizations = organizationRepository.findSearchOrganizations(organizationSearchBean); + assertEquals(1, organizations.size()); + } + + @Test + public void testFindOrganizationsWithoutSearchParam() { + practitionerRepository.add(initTestPractitioner()); + practitionerRoleRepository.add(initTestPractitionerRole()); + OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); + organizationSearchBean.setPageNumber(0); + organizationSearchBean.setPageSize(10); + organizationSearchBean.setOrderByFieldName(FieldName.valueOf("name")); + organizationSearchBean.setOrderByType(OrderByType.valueOf("ASC")); + List organizations = organizationRepository.findSearchOrganizations(organizationSearchBean); + assertEquals(3, organizations.size()); + } + + @Test + public void testFindEmptyOrganizationsByNameAndLcations() { + practitionerRepository.add(initTestPractitioner()); + practitionerRoleRepository.add(initTestPractitionerRole()); + OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); + organizationSearchBean.setPageNumber(0); + organizationSearchBean.setPageSize(10); + organizationSearchBean.setName("The Luang Bell"); + List locations = new ArrayList<>(); + locations.add(22435); + locations.add(1); + organizationSearchBean.setLocations(locations); + List organizations = organizationRepository.findSearchOrganizations(organizationSearchBean); + assertTrue(organizations.isEmpty()); + + } + + @Test(expected = IllegalArgumentException.class) + public void testFindOrganizationsByOrderByFieldNameNotExists() { + OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); + organizationSearchBean.setPageNumber(0); + organizationSearchBean.setPageSize(10); + organizationSearchBean.setOrderByFieldName(FieldName.valueOf("names")); + organizationSearchBean.setOrderByType(OrderByType.valueOf("ASC")); + organizationRepository.findSearchOrganizations(organizationSearchBean); + + } + + @Test + public void testFindTotalSearchOrganizationsByNameAndLcations() { + practitionerRepository.add(initTestPractitioner()); + practitionerRoleRepository.add(initTestPractitionerRole()); + OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); + organizationSearchBean.setPageNumber(0); + organizationSearchBean.setPageSize(10); + organizationSearchBean.setName("The Luang"); + List locations = new ArrayList<>(); + locations.add(2243); + locations.add(1); + organizationSearchBean.setLocations(locations); + int totalCount = organizationRepository.findOrganizationCount(organizationSearchBean); + assertEquals(1, totalCount); + + } + + @Test + public void testFindTotalSearchOrganizationsWithoutSearchParam() { + practitionerRepository.add(initTestPractitioner()); + practitionerRoleRepository.add(initTestPractitionerRole()); + OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); + + int totalCount = organizationRepository.findOrganizationCount(organizationSearchBean); + assertEquals(3, totalCount); + + } + + @Test + public void testGetAllOrganizations() { + OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); + organizationSearchBean.setOrderByType(OrderByType.ASC); + organizationSearchBean.setOrderByFieldName(FieldName.id); + organizationSearchBean.setServerVersion(1l); + assertEquals(3, organizationRepository.getAllOrganizations(organizationSearchBean).size()); + + Organization organization = new Organization(); + organization.setIdentifier(UUID.randomUUID().toString()); + organization.setName("Ateam"); + organization.setPartOf(1l); + organization.setActive(true); + organizationRepository.add(organization); + + List organizations = organizationRepository.getAllOrganizations(organizationSearchBean); + assertEquals(4, organizations.size()); + assertEquals(new Long(1l), organizations.get(0).getId()); + assertEquals(new Long(4l), organizations.get(3).getId()); + + } + + @Test + public void testUnassignLocationAndPlan() { + String identifier = UUID.randomUUID().toString(); + Organization organization = new Organization(); + organization.setIdentifier(identifier); + organization.setName("ATeam"); + organizationRepository.add(organization); + + String planIdentifier = UUID.randomUUID().toString(); + PlanDefinition planDefinition = new PlanDefinition(); + planDefinition.setIdentifier(planIdentifier); + planDefinition.setName("Plan A"); + planRepository.add(planDefinition); + + organization = organizationRepository.get(identifier); + Long planId = planRepository.retrievePrimaryKey(planIdentifier); + Calendar calendar = Calendar.getInstance(); + Date fromDate = calendar.getTime(); + calendar.add(Calendar.YEAR, 2); + Date toDate = calendar.getTime(); + organizationRepository.assignLocationAndPlan(organization.getId(), "04cbcd4-0850-404a-a8b1-486b02f7b84d", 2243l, + planIdentifier, planId, fromDate, toDate); + + AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() + .planId(planId) + .returnFutureAssignments(true).build(); + List assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); + assertEquals(1, assignedLocations.size()); + assertEquals("304cbcd4-0850-404a-a8b1-486b02f7b84d", assignedLocations.get(0).getJurisdictionId()); + assertEquals(planIdentifier, assignedLocations.get(0).getPlanId()); + assertEquals(dateFormat.format(fromDate), dateFormat.format(assignedLocations.get(0).getFromDate())); + assertEquals(dateFormat.format(toDate), dateFormat.format(assignedLocations.get(0).getToDate())); + + organizationRepository.unassignLocationAndPlan(planId); + assignedLocationAndPlanSearchBean = AssignedLocationAndPlanSearchBean.builder() + .planId(planId) + .build(); + assignedLocations = organizationRepository.findAssignedLocations(assignedLocationAndPlanSearchBean); + assertEquals(0, assignedLocations.size()); // verified - removes all the assigned teams + } + + @Test + public void testCountAllOrganizations() { + Organization organization1 = new Organization(); + Organization organization2 = new Organization(); + organizationRepository.add(organization1); + organizationRepository.add(organization2); + assertEquals(3, organizationRepository.countAllOrganizations()); + } + + @Test + public void testGetOrganizationsByIds() { + List organizationIds = new ArrayList<>(); + organizationIds.add(1l); + organizationIds.add(2l); + organizationIds.add(3l); + List organizations = organizationRepository.getOrganizationsByIds(organizationIds); + assertNotNull(organizations); + assertEquals(3, organizations.size()); + assertEquals(new Long(1), organizations.get(0).getId()); + assertEquals("fcc19470-d599-11e9-bb65-2a2ae2dbcce4", organizations.get(0).getIdentifier()); + assertEquals("The Luang", organizations.get(0).getName()); + assertEquals(1, organizations.get(0).getType().getCoding().size()); + Code code = organizations.get(0).getType().getCoding().get(0); + assertEquals("http://terminology.hl7.org/CodeSystem/organization-type", code.getSystem()); + assertEquals("team", code.getCode()); + assertEquals("Team", code.getDisplay()); + assertNull(organizations.get(0).getPartOf()); + + assertEquals(new Long(3), organizations.get(1).getId()); + assertEquals("4c506c98-d3a9-11e9-bb65-2a2ae2dbcce4", organizations.get(1).getIdentifier()); + + assertEquals(new Long(2), organizations.get(2).getId()); + assertEquals("d23f7350-d406-11e9-bb65-2a2ae2dbcce4", organizations.get(2).getIdentifier()); + } + + private Practitioner initTestPractitioner() { + Practitioner practitioner = new Practitioner(); + practitioner.setIdentifier("practitoner-3-identifier"); + practitioner.setActive(false); + practitioner.setName("Third Practitioner"); + practitioner.setUsername("Practioner3"); + practitioner.setUserId("user3"); + return practitioner; + } } diff --git a/src/test/java/org/opensrp/repository/postgres/PlanRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/PlanRepositoryTest.java index 775c2154b..7bb469887 100644 --- a/src/test/java/org/opensrp/repository/postgres/PlanRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/PlanRepositoryTest.java @@ -38,7 +38,7 @@ public class PlanRepositoryTest extends BaseRepositoryTest { @BeforeClass public static void bootStrap() { - tableNames=Arrays.asList("core.plan","core.plan_metadata"); + tableNames = Arrays.asList("core.plan", "core.plan_metadata"); } @Override @@ -76,9 +76,9 @@ public void testAddShouldAddNewPlans() { ids.add("identifier_1"); ids.add("identifier_2"); assertTrue(testIfAllIdsExists(plans, ids)); - - for(PlanDefinition pl:plans) { - MatcherAssert.assertThat(pl.getServerVersion(),Matchers.greaterThan(0l)); + + for (PlanDefinition pl : plans) { + MatcherAssert.assertThat(pl.getServerVersion(), Matchers.greaterThan(0l)); } } @@ -165,7 +165,7 @@ public void testUpdateShouldUpdateExistingPlan() { jurisdictions.add(jurisdiction); plan.setJurisdiction(jurisdictions); plan.setServerVersion(1l); - Long serverVersion=plan.getServerVersion(); + Long serverVersion = plan.getServerVersion(); planRepository.update(plan); result = planRepository.get("identifier_5"); @@ -196,7 +196,7 @@ public void testGetAllShouldGetAllPlans() { planRepository.add(plan); List plans = planRepository.getAll(); - assertEquals(6,plans.size()); + assertEquals(6, plans.size()); Set ids = new HashSet<>(); ids.add("identifier_6"); @@ -270,7 +270,7 @@ public void testSyncPlansByServerVersionAndOperationalAreaShouldReturnAllPlansAt plan.setServerVersion(3l); planRepository.add(plan); - List plans = planRepository.getPlansByServerVersionAndOperationalAreas(2l, null,false); + List plans = planRepository.getPlansByServerVersionAndOperationalAreas(2l, null, false); assertEquals(3, plans.size()); testIfAllIdsExists(plans, ids); } @@ -314,7 +314,7 @@ public void testGetPlansByServerVersionAndOperationalAreaShouldReturnAllPlansAtO List operationalAreaIds = new ArrayList<>(); operationalAreaIds.add("operation_area_2"); - List plans = planRepository.getPlansByServerVersionAndOperationalAreas(2l, operationalAreaIds,false); + List plans = planRepository.getPlansByServerVersionAndOperationalAreas(2l, operationalAreaIds, false); assertEquals(plans.size(), 2); testIfAllIdsExists(plans, ids); } @@ -358,7 +358,7 @@ public void testSyncShouldNotGetDeletedOperationalAreas() { List operationalAreaIds = new ArrayList<>(); operationalAreaIds.add("operation_area_1"); - List plans = planRepository.getPlansByServerVersionAndOperationalAreas(0l, operationalAreaIds,false); + List plans = planRepository.getPlansByServerVersionAndOperationalAreas(0l, operationalAreaIds, false); assertEquals(plans.size(), 1); testIfAllIdsExists(plans, ids); @@ -388,7 +388,7 @@ public void testGetPlansByIdsReturnOptionalFields() { fields.add("identifier"); fields.add("name"); - plans = planRepository.getPlansByIdsReturnOptionalFields(Collections.singletonList("identifier_7"), fields,false); + plans = planRepository.getPlansByIdsReturnOptionalFields(Collections.singletonList("identifier_7"), fields, false); assertEquals(1, plans.size()); assertEquals("identifier_7", plans.get(0).getIdentifier()); assertEquals("Focus Investigation", plans.get(0).getName()); @@ -397,10 +397,10 @@ public void testGetPlansByIdsReturnOptionalFields() { assertEquals(null, plans.get(0).getStatus()); } - + @Test public void getGetPlansByIdentifiersAndServerVersion() { - PlanDefinition plan = new PlanDefinition(); + PlanDefinition plan = new PlanDefinition(); plan.setIdentifier("identifier_7"); List jurisdictions = new ArrayList<>(); @@ -426,24 +426,23 @@ public void getGetPlansByIdentifiersAndServerVersion() { List operationalAreaIds = new ArrayList<>(); operationalAreaIds.add("operation_area_1"); - List plans = planRepository.getPlansByIdentifiersAndServerVersion(Arrays.asList("identifier_7","identifier_8"), 0l,false); + List plans = planRepository.getPlansByIdentifiersAndServerVersion(Arrays.asList("identifier_7", "identifier_8"), 0l, false); - assertEquals(2,plans.size()); + assertEquals(2, plans.size()); testIfAllIdsExists(plans, ids); - - - - plans = planRepository.getPlansByIdentifiersAndServerVersion(Arrays.asList("identifier_7","identifier_8"), 2l,false); - assertEquals(2,plans.size()); - assertEquals("identifier_7",plans.get(0).getIdentifier()); - - - plans = planRepository.getPlansByIdentifiersAndServerVersion(Arrays.asList("identifier_7","identifier_8"), 3l,false); - assertEquals(2,plans.size()); - - - plans = planRepository.getPlansByIdentifiersAndServerVersion(Arrays.asList("identifier_70"), 0l,false); - assertEquals(0,plans.size()); + + + plans = planRepository.getPlansByIdentifiersAndServerVersion(Arrays.asList("identifier_7", "identifier_8"), 2l, false); + assertEquals(2, plans.size()); + assertEquals("identifier_7", plans.get(0).getIdentifier()); + + + plans = planRepository.getPlansByIdentifiersAndServerVersion(Arrays.asList("identifier_7", "identifier_8"), 3l, false); + assertEquals(2, plans.size()); + + + plans = planRepository.getPlansByIdentifiersAndServerVersion(Arrays.asList("identifier_70"), 0l, false); + assertEquals(0, plans.size()); } @@ -517,7 +516,7 @@ public void testGetAllIdsShouldFilterBetweenFromDateAndToDate() { String date1 = "2019-09-25T10:00:00+0300"; String date2 = "2019-09-29T10:00:00+0300"; Pair, Long> planIdsObject = planRepository.findAllIds(0L, 3, false, - new DateTime(date1, DateTimeZone.UTC).toDate(), new DateTime(date2,DateTimeZone.UTC).toDate()); + new DateTime(date1, DateTimeZone.UTC).toDate(), new DateTime(date2, DateTimeZone.UTC).toDate()); List planids = planIdsObject.getLeft(); assertEquals(3, planids.size()); } @@ -610,22 +609,22 @@ public void testCountPlansByIdentifiersAndServerVersion() { List operationalAreaIds = new ArrayList<>(); operationalAreaIds.add("operation_area_1"); - Long plans = planRepository.countPlansByIdentifiersAndServerVersion(Arrays.asList("identifier_7","identifier_8"), 0l); - assertEquals(2,plans.longValue()); + Long plans = planRepository.countPlansByIdentifiersAndServerVersion(Arrays.asList("identifier_7", "identifier_8"), 0l); + assertEquals(2, plans.longValue()); - plans = planRepository.countPlansByIdentifiersAndServerVersion(Arrays.asList("identifier_7","identifier_8"), 2l); - assertEquals(2,plans.longValue()); + plans = planRepository.countPlansByIdentifiersAndServerVersion(Arrays.asList("identifier_7", "identifier_8"), 2l); + assertEquals(2, plans.longValue()); - plans = planRepository.countPlansByIdentifiersAndServerVersion(Arrays.asList("identifier_7","identifier_8"), 3l); - assertEquals(2,plans.longValue()); + plans = planRepository.countPlansByIdentifiersAndServerVersion(Arrays.asList("identifier_7", "identifier_8"), 3l); + assertEquals(2, plans.longValue()); plans = planRepository.countPlansByIdentifiersAndServerVersion(Arrays.asList("identifier_70"), 0l); - assertEquals(0,plans.longValue()); + assertEquals(0, plans.longValue()); } @Test - public void testCountAllPlanShouldReturnCorrectValue(){ + public void testCountAllPlanShouldReturnCorrectValue() { PlanDefinition plan = new PlanDefinition(); plan.setIdentifier("x_identifier_1"); diff --git a/src/test/java/org/opensrp/repository/postgres/PractitionerRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/PractitionerRepositoryTest.java index 26d721466..f54a00728 100755 --- a/src/test/java/org/opensrp/repository/postgres/PractitionerRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/PractitionerRepositoryTest.java @@ -19,14 +19,14 @@ import org.opensrp.search.PractitionerSearchBean; import org.springframework.beans.factory.annotation.Autowired; -public class PractitionerRepositoryTest extends BaseRepositoryTest{ +public class PractitionerRepositoryTest extends BaseRepositoryTest { @Autowired private PractitionerRepository practitionerRepository; @BeforeClass public static void bootStrap() { - tableNames= Collections.singletonList("team.practitioner"); + tableNames = Collections.singletonList("team.practitioner"); } @Override @@ -42,12 +42,12 @@ public void testAddShouldAddNewPractitioner() { List practitioners = practitionerRepository.getAll(); assertNotNull(practitioners); - assertEquals(1,practitioners.size()); - assertEquals("practitioner-1-identifier",practitioners.get(0).getIdentifier()); - assertEquals(true,practitioners.get(0).getActive()); - assertEquals("Practitioner",practitioners.get(0).getName()); - assertEquals("Practitioner1",practitioners.get(0).getUsername()); - assertEquals("user1",practitioners.get(0).getUserId()); + assertEquals(1, practitioners.size()); + assertEquals("practitioner-1-identifier", practitioners.get(0).getIdentifier()); + assertEquals(true, practitioners.get(0).getActive()); + assertEquals("Practitioner", practitioners.get(0).getName()); + assertEquals("Practitioner1", practitioners.get(0).getUsername()); + assertEquals("user1", practitioners.get(0).getUserId()); assertNotNull(practitioners.get(0).getDateEdited()); assertNotNull(practitioners.get(0).getDateCreated()); assertTrue(practitioners.get(0).getServerVersion() > 0); @@ -111,12 +111,12 @@ public void testGetShouldnotReturnDeletedPractitioners() { List practitioners = practitionerRepository.getAll(); assertNotNull(practitioners); - assertEquals(1,practitioners.size()); - assertEquals("practitioner-1-identifier",practitioners.get(0).getIdentifier()); - assertEquals(true,practitioners.get(0).getActive()); - assertEquals("Practitioner",practitioners.get(0).getName()); - assertEquals("Practitioner1",practitioners.get(0).getUsername()); - assertEquals("user1",practitioners.get(0).getUserId()); + assertEquals(1, practitioners.size()); + assertEquals("practitioner-1-identifier", practitioners.get(0).getIdentifier()); + assertEquals(true, practitioners.get(0).getActive()); + assertEquals("Practitioner", practitioners.get(0).getName()); + assertEquals("Practitioner1", practitioners.get(0).getUsername()); + assertEquals("user1", practitioners.get(0).getUserId()); } @Test @@ -207,7 +207,7 @@ public void testGetAllShouldGetAllPractitioners() { List practitioners = practitionerRepository.getAll(); assertNotNull(practitioners); - assertEquals(2,practitioners.size()); + assertEquals(2, practitioners.size()); Set ids = new HashSet<>(); ids.add(practitioner1.getIdentifier()); @@ -225,7 +225,7 @@ public void testSafeRemoveShouldMarkPractitionerAsDeleted() { List practitioners = practitionerRepository.getAll(); assertNotNull(practitioners); - assertEquals(2,practitioners.size()); + assertEquals(2, practitioners.size()); practitionerRepository.safeRemove(practitioner2); @@ -242,7 +242,7 @@ public void testSafeRemoveWithEmptyParamDoesNotAffectExistingRecord() { List practitioners = practitionerRepository.getAll(); assertNotNull(practitioners); - assertEquals(1,practitioners.size()); + assertEquals(1, practitioners.size()); practitionerRepository.safeRemove(new Practitioner()); @@ -259,7 +259,7 @@ public void testSafeRemoveWithNonExistingRecordShouldDoesNotAffectExistingRecord List practitioners = practitionerRepository.getAll(); assertNotNull(practitioners); - assertEquals(1,practitioners.size()); + assertEquals(1, practitioners.size()); Practitioner practitioner2 = initTestPractitioner2(); practitionerRepository.safeRemove(practitioner2); @@ -300,15 +300,15 @@ public void testGetPractitionerByUsername() { Practitioner actualPractitioner = practitionerRepository.getPractitionerByUsername(expectedPractitioner.getUsername()); assertNotNull(actualPractitioner); - assertEquals(expectedPractitioner.getIdentifier(),actualPractitioner.getIdentifier()); - assertEquals(expectedPractitioner.getName(),actualPractitioner.getName()); - assertEquals(expectedPractitioner.getUserId(),actualPractitioner.getUserId()); - assertEquals(expectedPractitioner.getUsername(),actualPractitioner.getUsername()); - - assertNull( practitionerRepository.getPractitionerByUsername("janeDoe")); + assertEquals(expectedPractitioner.getIdentifier(), actualPractitioner.getIdentifier()); + assertEquals(expectedPractitioner.getName(), actualPractitioner.getName()); + assertEquals(expectedPractitioner.getUserId(), actualPractitioner.getUserId()); + assertEquals(expectedPractitioner.getUsername(), actualPractitioner.getUsername()); + + assertNull(practitionerRepository.getPractitionerByUsername("janeDoe")); } - private Practitioner initTestPractitioner1(){ + private Practitioner initTestPractitioner1() { Practitioner practitioner = new Practitioner(); practitioner.setIdentifier("practitioner-1-identifier"); practitioner.setActive(true); @@ -318,7 +318,7 @@ private Practitioner initTestPractitioner1(){ return practitioner; } - private Practitioner initTestPractitioner2(){ + private Practitioner initTestPractitioner2() { Practitioner practitioner = new Practitioner(); practitioner.setIdentifier("practitioner-2-identifier"); practitioner.setActive(false); @@ -347,35 +347,35 @@ public void testGetAllPractitioners() { practitionerSearchBean.setServerVersion(1l); List practitioners = practitionerRepository.getAllPractitioners(practitionerSearchBean); assertNotNull(practitioners); - assertEquals(2,practitioners.size()); - assertEquals("practitioner-2-identifier",practitioners.get(0).getIdentifier()); - assertEquals("practitioner-1-identifier",practitioners.get(1).getIdentifier()); + assertEquals(2, practitioners.size()); + assertEquals("practitioner-2-identifier", practitioners.get(0).getIdentifier()); + assertEquals("practitioner-1-identifier", practitioners.get(1).getIdentifier()); practitionerSearchBean = PractitionerSearchBean.builder().orderByType(BaseSearchBean.OrderByType.ASC). orderByFieldName(BaseSearchBean.FieldName.id).build(); practitionerSearchBean.setServerVersion(1l); practitioners = practitionerRepository.getAllPractitioners(practitionerSearchBean); assertNotNull(practitioners); - assertEquals(2,practitioners.size()); - assertEquals("practitioner-1-identifier",practitioners.get(0).getIdentifier()); - assertEquals("practitioner-2-identifier",practitioners.get(1).getIdentifier()); + assertEquals(2, practitioners.size()); + assertEquals("practitioner-1-identifier", practitioners.get(0).getIdentifier()); + assertEquals("practitioner-2-identifier", practitioners.get(1).getIdentifier()); } @Test - public void testGetAllPractitionersByIdentifiers() { - Practitioner practitioner1 = initTestPractitioner1(); - practitionerRepository.add(practitioner1); - Practitioner practitioner2 = initTestPractitioner2(); - practitionerRepository.add(practitioner2); - - List practitionerIdentifiers = new ArrayList<>(); - practitionerIdentifiers.add("practitioner-1-identifier"); - practitionerIdentifiers.add("practitioner-2-identifier"); - List practitioners = practitionerRepository.getAllPractitionersByIdentifiers(practitionerIdentifiers); - assertNotNull(practitioners); - assertEquals(2,practitioners.size()); - assertEquals("Practitioner",practitioners.get(0).getName()); - assertEquals("Second Practitioner",practitioners.get(1).getName()); + public void testGetAllPractitionersByIdentifiers() { + Practitioner practitioner1 = initTestPractitioner1(); + practitionerRepository.add(practitioner1); + Practitioner practitioner2 = initTestPractitioner2(); + practitionerRepository.add(practitioner2); + + List practitionerIdentifiers = new ArrayList<>(); + practitionerIdentifiers.add("practitioner-1-identifier"); + practitionerIdentifiers.add("practitioner-2-identifier"); + List practitioners = practitionerRepository.getAllPractitionersByIdentifiers(practitionerIdentifiers); + assertNotNull(practitioners); + assertEquals(2, practitioners.size()); + assertEquals("Practitioner", practitioners.get(0).getName()); + assertEquals("Second Practitioner", practitioners.get(1).getName()); } @Test @@ -391,10 +391,10 @@ public void testGetPractitionersByIdentifier() { practitionerRepository.add(expectedPractitioner); Practitioner actualPractitioner = practitionerRepository.getPractitionerByIdentifier(expectedPractitioner.getIdentifier()); assertNotNull(actualPractitioner); - assertEquals(expectedPractitioner.getIdentifier(),actualPractitioner.getIdentifier()); - assertEquals(expectedPractitioner.getName(),actualPractitioner.getName()); - assertEquals(expectedPractitioner.getUserId(),actualPractitioner.getUserId()); - assertEquals(expectedPractitioner.getUsername(),actualPractitioner.getUsername()); + assertEquals(expectedPractitioner.getIdentifier(), actualPractitioner.getIdentifier()); + assertEquals(expectedPractitioner.getName(), actualPractitioner.getName()); + assertEquals(expectedPractitioner.getUserId(), actualPractitioner.getUserId()); + assertEquals(expectedPractitioner.getUsername(), actualPractitioner.getUsername()); } } diff --git a/src/test/java/org/opensrp/repository/postgres/PractitionerRoleRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/PractitionerRoleRepositoryTest.java index 8b46af34d..a1e3a3307 100755 --- a/src/test/java/org/opensrp/repository/postgres/PractitionerRoleRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/PractitionerRoleRepositoryTest.java @@ -32,7 +32,31 @@ public class PractitionerRoleRepositoryTest extends BaseRepositoryTest { @BeforeClass public static void bootStrap() { - tableNames= Arrays.asList("team.organization","team.practitioner","team.practitioner_role"); + tableNames = Arrays.asList("team.organization", "team.practitioner", "team.practitioner_role"); + } + + private static PractitionerRole initTestPractitionerRole1() { + PractitionerRole practitionerRole = new PractitionerRole(); + practitionerRole.setIdentifier("pr1-identifier"); + practitionerRole.setActive(true); + practitionerRole.setOrganizationIdentifier("org1"); + practitionerRole.setPractitionerIdentifier("p1-identifier"); + PractitionerRoleCode code = new PractitionerRoleCode(); + code.setText("pr1Code"); + practitionerRole.setCode(code); + return practitionerRole; + } + + private static PractitionerRole initTestPractitionerRole2() { + PractitionerRole practitionerRole = new PractitionerRole(); + practitionerRole.setIdentifier("pr2-identifier"); + practitionerRole.setActive(true); + practitionerRole.setOrganizationIdentifier("org1"); + practitionerRole.setPractitionerIdentifier("p2-identifier"); + PractitionerRoleCode code = new PractitionerRoleCode(); + code.setText("pr2Code"); + practitionerRole.setCode(code); + return practitionerRole; } @Override @@ -195,7 +219,7 @@ public void testGetAllShouldGetAllPractitionerRoles() { List practitionerRoles = practitionerRoleRepository.getAll(); assertNotNull(practitionerRoles); - assertEquals(2,practitionerRoles.size()); + assertEquals(2, practitionerRoles.size()); Set ids = new HashSet<>(); ids.add(practitionerRole1.getIdentifier()); @@ -213,7 +237,7 @@ public void testSafeRemoveShouldDeletePractitionerRole() { List practitionerRoles = practitionerRoleRepository.getAll(); assertNotNull(practitionerRoles); - assertEquals(2,practitionerRoles.size()); + assertEquals(2, practitionerRoles.size()); practitionerRoleRepository.safeRemove(practitionerRole2); @@ -230,7 +254,7 @@ public void testSafeRemoveWithEmptyParamShouldDoesNotAffectExistingRecord() { List practitionerRoles = practitionerRoleRepository.getAll(); assertNotNull(practitionerRoles); - assertEquals(1,practitionerRoles.size()); + assertEquals(1, practitionerRoles.size()); practitionerRoleRepository.safeRemove(new PractitionerRole()); @@ -247,7 +271,7 @@ public void testSafeRemoveWithNonExistingRecordDoesNotAffectExistingRecord() { List practitionerRoles = practitionerRoleRepository.getAll(); assertNotNull(practitionerRoles); - assertEquals(1,practitionerRoles.size()); + assertEquals(1, practitionerRoles.size()); PractitionerRole practitionerRole2 = initTestPractitionerRole2(); practitionerRoleRepository.safeRemove(practitionerRole2); @@ -300,7 +324,7 @@ public void testGetAllPractitionerRoles() { } @Test - public void testCountAllPractitionerRoles(){ + public void testCountAllPractitionerRoles() { PractitionerRole practitionerRole1 = initTestPractitionerRole1(); PractitionerRole practitionerRole2 = initTestPractitionerRole2(); practitionerRoleRepository.add(practitionerRole1); @@ -338,30 +362,6 @@ public void testGetPractitionerRolesByOrgIdAndCode() { } - private static PractitionerRole initTestPractitionerRole1(){ - PractitionerRole practitionerRole = new PractitionerRole(); - practitionerRole.setIdentifier("pr1-identifier"); - practitionerRole.setActive(true); - practitionerRole.setOrganizationIdentifier("org1"); - practitionerRole.setPractitionerIdentifier("p1-identifier"); - PractitionerRoleCode code = new PractitionerRoleCode(); - code.setText("pr1Code"); - practitionerRole.setCode(code); - return practitionerRole; - } - - private static PractitionerRole initTestPractitionerRole2(){ - PractitionerRole practitionerRole = new PractitionerRole(); - practitionerRole.setIdentifier("pr2-identifier"); - practitionerRole.setActive(true); - practitionerRole.setOrganizationIdentifier("org1"); - practitionerRole.setPractitionerIdentifier("p2-identifier"); - PractitionerRoleCode code = new PractitionerRoleCode(); - code.setText("pr2Code"); - practitionerRole.setCode(code); - return practitionerRole; - } - private boolean testIfAllIdsExists(List practitionerRoles, Set ids) { for (PractitionerRole practitionerRole : practitionerRoles) { ids.remove(practitionerRole.getIdentifier()); diff --git a/src/test/java/org/opensrp/repository/postgres/ProductCatalogueRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/ProductCatalogueRepositoryTest.java index 7e45f1d9c..5e00403f3 100644 --- a/src/test/java/org/opensrp/repository/postgres/ProductCatalogueRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/ProductCatalogueRepositoryTest.java @@ -17,101 +17,101 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -public class ProductCatalogueRepositoryTest extends BaseRepositoryTest { - - @Autowired - @Qualifier("productCatalogueRepositoryPostgres") - private ProductCatalogueRepository productCatalogueRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("product_catalogue.sql"); - return scripts; - } - - @Test - public void testAdd() { - ProductCatalogue productCatalogue = createProductCatalogue(); - productCatalogueRepository.add(productCatalogue); - List productCatalogueList = productCatalogueRepository.getAll("http://localhost:8080/opensrp"); - assertEquals(2,productCatalogueList.size()); - for (ProductCatalogue pc : productCatalogueList) { - MatcherAssert.assertThat(pc.getServerVersion(), Matchers.greaterThanOrEqualTo(123344l)); - } - } - - @Test - public void testUpdate() { - ProductCatalogue productCatalogue = productCatalogueRepository.getById(1l, "http://localhost:8080/opensrp"); - productCatalogue.setProductName("Updated product name"); - long serverVersion=productCatalogue.getServerVersion(); - productCatalogueRepository.update(productCatalogue); - ProductCatalogue updated = productCatalogueRepository.getById(1l, "http://localhost:8080/opensrp"); - assertNotNull(updated); - assertEquals("Updated product name", updated.getProductName()); - MatcherAssert.assertThat(updated.getServerVersion(), Matchers.greaterThan(serverVersion)); - } - - @Test - public void testGetAll() { - List productCatalogues = productCatalogueRepository.getAll("http://localhost:8080/opensrp"); - assertEquals(1,productCatalogues.size()); - } - - @Test - public void testSafeRemove() { - ProductCatalogue productCatalogue = productCatalogueRepository.getById(1l, "http://localhost:8080/opensrp"); - productCatalogueRepository.safeRemove(productCatalogue); - List productCatalogues = productCatalogueRepository.getAll("http://localhost:8080/opensrp"); - assertEquals(0, productCatalogues.size()); - } - - @Test - public void testSafeRemoveById() { - productCatalogueRepository.safeRemove(1l); - List productCatalogues = productCatalogueRepository.getAll("http://localhost:8080/opensrp"); - assertEquals(0, productCatalogues.size()); - } - - @Test - public void testGetById() { - ProductCatalogue productCatalogue = productCatalogueRepository.getById(1l, "http://localhost:8080/opensrp"); - assertEquals("Midwifery Kit", productCatalogue.getProductName()); - } - - @Test - public void testGetProductCataloguesBySearchBeanWithLimit(){ - ProductCatalogueSearchBean productCatalogueSearchBean = new ProductCatalogueSearchBean(); - productCatalogueSearchBean.setUniqueId(1l); - int limit = Integer.MAX_VALUE; - List productCatalogues = productCatalogueRepository.getProductCataloguesBySearchBean(productCatalogueSearchBean, limit, "http://localhost:8080/opensrp"); - assertEquals(1,productCatalogues.size()); - assertEquals("Midwifery Kit", productCatalogues.get(0).getProductName()); - - } - - @Test - public void testGetProductCataloguesBySearchBeanWithNoLimitSet(){ - ProductCatalogueSearchBean productCatalogueSearchBean = new ProductCatalogueSearchBean(); - productCatalogueSearchBean.setUniqueId(1l); - List productCatalogues = productCatalogueRepository.getProductCataloguesBySearchBean(productCatalogueSearchBean, "http://localhost:8080/opensrp"); - assertEquals(1,productCatalogues.size()); - assertEquals("Midwifery Kit", productCatalogues.get(0).getProductName()); - - } - - private ProductCatalogue createProductCatalogue() { - ProductCatalogue productCatalogue = new ProductCatalogue(); - ArrayList sections = new ArrayList<>(); - sections.add("Health"); - productCatalogue.setProductName("Product A"); - productCatalogue.setAvailability("available"); - productCatalogue.setCondition("good condition"); - productCatalogue.setAppropriateUsage("staff is trained to use it appropriately"); - productCatalogue.setAccountabilityPeriod(1); - productCatalogue.setServerVersion(123456l); - return productCatalogue; - } +public class ProductCatalogueRepositoryTest extends BaseRepositoryTest { + + @Autowired + @Qualifier("productCatalogueRepositoryPostgres") + private ProductCatalogueRepository productCatalogueRepository; + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("product_catalogue.sql"); + return scripts; + } + + @Test + public void testAdd() { + ProductCatalogue productCatalogue = createProductCatalogue(); + productCatalogueRepository.add(productCatalogue); + List productCatalogueList = productCatalogueRepository.getAll("http://localhost:8080/opensrp"); + assertEquals(2, productCatalogueList.size()); + for (ProductCatalogue pc : productCatalogueList) { + MatcherAssert.assertThat(pc.getServerVersion(), Matchers.greaterThanOrEqualTo(123344l)); + } + } + + @Test + public void testUpdate() { + ProductCatalogue productCatalogue = productCatalogueRepository.getById(1l, "http://localhost:8080/opensrp"); + productCatalogue.setProductName("Updated product name"); + long serverVersion = productCatalogue.getServerVersion(); + productCatalogueRepository.update(productCatalogue); + ProductCatalogue updated = productCatalogueRepository.getById(1l, "http://localhost:8080/opensrp"); + assertNotNull(updated); + assertEquals("Updated product name", updated.getProductName()); + MatcherAssert.assertThat(updated.getServerVersion(), Matchers.greaterThan(serverVersion)); + } + + @Test + public void testGetAll() { + List productCatalogues = productCatalogueRepository.getAll("http://localhost:8080/opensrp"); + assertEquals(1, productCatalogues.size()); + } + + @Test + public void testSafeRemove() { + ProductCatalogue productCatalogue = productCatalogueRepository.getById(1l, "http://localhost:8080/opensrp"); + productCatalogueRepository.safeRemove(productCatalogue); + List productCatalogues = productCatalogueRepository.getAll("http://localhost:8080/opensrp"); + assertEquals(0, productCatalogues.size()); + } + + @Test + public void testSafeRemoveById() { + productCatalogueRepository.safeRemove(1l); + List productCatalogues = productCatalogueRepository.getAll("http://localhost:8080/opensrp"); + assertEquals(0, productCatalogues.size()); + } + + @Test + public void testGetById() { + ProductCatalogue productCatalogue = productCatalogueRepository.getById(1l, "http://localhost:8080/opensrp"); + assertEquals("Midwifery Kit", productCatalogue.getProductName()); + } + + @Test + public void testGetProductCataloguesBySearchBeanWithLimit() { + ProductCatalogueSearchBean productCatalogueSearchBean = new ProductCatalogueSearchBean(); + productCatalogueSearchBean.setUniqueId(1l); + int limit = Integer.MAX_VALUE; + List productCatalogues = productCatalogueRepository.getProductCataloguesBySearchBean(productCatalogueSearchBean, limit, "http://localhost:8080/opensrp"); + assertEquals(1, productCatalogues.size()); + assertEquals("Midwifery Kit", productCatalogues.get(0).getProductName()); + + } + + @Test + public void testGetProductCataloguesBySearchBeanWithNoLimitSet() { + ProductCatalogueSearchBean productCatalogueSearchBean = new ProductCatalogueSearchBean(); + productCatalogueSearchBean.setUniqueId(1l); + List productCatalogues = productCatalogueRepository.getProductCataloguesBySearchBean(productCatalogueSearchBean, "http://localhost:8080/opensrp"); + assertEquals(1, productCatalogues.size()); + assertEquals("Midwifery Kit", productCatalogues.get(0).getProductName()); + + } + + private ProductCatalogue createProductCatalogue() { + ProductCatalogue productCatalogue = new ProductCatalogue(); + ArrayList sections = new ArrayList<>(); + sections.add("Health"); + productCatalogue.setProductName("Product A"); + productCatalogue.setAvailability("available"); + productCatalogue.setCondition("good condition"); + productCatalogue.setAppropriateUsage("staff is trained to use it appropriately"); + productCatalogue.setAccountabilityPeriod(1); + productCatalogue.setServerVersion(123456l); + return productCatalogue; + } } diff --git a/src/test/java/org/opensrp/repository/postgres/ReportsRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/ReportsRepositoryTest.java index 48d5f32d6..330a1b9ac 100644 --- a/src/test/java/org/opensrp/repository/postgres/ReportsRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/ReportsRepositoryTest.java @@ -20,227 +20,227 @@ import org.springframework.beans.factory.annotation.Qualifier; public class ReportsRepositoryTest extends BaseRepositoryTest { - - @Autowired - @Qualifier("reportsRepositoryPostgres") - private ReportsRepository reportsRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("report.sql"); - return scripts; - } - - @Test - public void testGet() { - Report report = reportsRepository.get("07271855-4018-497a-b180-6af01f0fa62b"); - assertEquals("7073cef4-b974-4910-afa7-dd2ccadba089", report.getFormSubmissionId()); - assertEquals("b0781dd2-e1b1-4878-8e6c-fba488eb9fa3", report.getLocationId()); - assertNull(reportsRepository.get("07271855-4018-497a-b180-6af")); - } - - @Test - public void testAdd() { - Report report = new Report("ghsjf-s723-sj97s", "3453535sdfs", new DateTime(), "MONTHLY", "435-njhjh-jjh", "tester11", - "3", 1522829702064l, 0, null); - reportsRepository.add(report); - assertEquals(6, reportsRepository.getAll().size()); - List reports = reportsRepository.findByBaseEntityAndFormSubmissionId("ghsjf-s723-sj97s", "435-njhjh-jjh"); - assertEquals("3453535sdfs", reports.get(0).getLocationId()); - assertEquals("MONTHLY", report.getReportType()); - assertNull(report.getHia2Indicators()); - MatcherAssert.assertThat(reports, - Matchers.contains(Matchers.hasProperty("serverVersion", Matchers.greaterThan(0l)))); - - } - - @Test - public void testUpdate() { - Report report = reportsRepository.get("cd09a3d4-01d9-485c-a1c5-a2eb078a61be"); - report.setBaseEntityId("asads-asdas7676-ggas"); - report.setServerVersion(1522827820l); - report.setDuration(6); - long serverVersion=report.getServerVersion(); - reportsRepository.update(report); - - Report updateReport = reportsRepository.get("cd09a3d4-01d9-485c-a1c5-a2eb078a61be"); - assertEquals("asads-asdas7676-ggas", updateReport.getBaseEntityId()); - assertNotEquals(1522827820l, updateReport.getServerVersion().longValue()); - assertNotNull(updateReport.getServerVersion()); - assertEquals(6, updateReport.getDuration()); - MatcherAssert.assertThat(updateReport.getServerVersion(), Matchers.greaterThan(serverVersion)); - - } - - @Test - public void testGetAll() { - assertEquals(5, reportsRepository.getAll().size()); - reportsRepository.safeRemove(reportsRepository.get("cd09a3d4-01d9-485c-a1c5-a2eb078a61be")); - List reports = reportsRepository.getAll(); - assertEquals(4, reports.size()); - for (Report report : reports) - assertNotEquals("cd09a3d4-01d9-485c-a1c5-a2eb078a61be", report.getId()); - } - - @Test - public void testSafeRemove() { - reportsRepository.safeRemove(reportsRepository.get("c57ba49f-34b9-4986-9b87-69f48b1830c5")); - List reports = reportsRepository.getAll(); - assertEquals(4, reports.size()); - for (Report report : reports) - assertNotEquals("c57ba49f-34b9-4986-9b87-69f48b1830c5", report.getId()); - assertNull(reportsRepository.get("c57ba49f-34b9-4986-9b87-69f48b1830c5")); - } - - @Test - public void testFindById() { - Report report = reportsRepository.findById("c57ba49f-34b9-4986-9b87-69f48b1830c5"); - assertEquals("88f9fe90-1e45-46b3-8056-e932574dcbd9", report.getFormSubmissionId()); - assertEquals(64, report.getHia2Indicators().size()); - } - - @Test - public void testFindByBaseEntityId() { - - assertEquals(2, reportsRepository.findByBaseEntityId("6654kk-mnj45-mmnfgd-l45645").size()); - - List reports = reportsRepository.findByBaseEntityId("678343544-nhj7-jghdfgfd-mkjdkfg"); - assertEquals(1, reports.size()); - assertEquals("ecafd20f-c95b-4046-9355-9512e1908da4", reports.get(0).getId()); - assertEquals("1aea74ac-b737-477a-99d3-728011fbae3f", reports.get(0).getFormSubmissionId()); - - assertTrue(reportsRepository.findByBaseEntityId("sfsdfd").isEmpty()); - - } - - @Test - public void testFindAllByIdentifier() { - assertEquals(2, reportsRepository.findAllByIdentifier("56757L").size()); - - List reports = reportsRepository.findAllByIdentifier("1121K"); - assertEquals(1, reports.size()); - assertEquals("07271855-4018-497a-b180-6af01f0fa62b", reports.get(0).getId()); - - assertTrue(reportsRepository.findAllByIdentifier("7234M").isEmpty()); - } - - @Test - public void testFindByBaseEntityAndType() { - assertEquals(2, reportsRepository.findByBaseEntityAndType("6654kk-mnj45-mmnfgd-l45645", "HIA2").size()); - - List reports = reportsRepository.findByBaseEntityAndType("678343544-nhj7-jghdfgfd-mkjdkfg", "HIA2"); - assertEquals(1, reports.size()); - assertEquals("ecafd20f-c95b-4046-9355-9512e1908da4", reports.get(0).getId()); - assertEquals("1aea74ac-b737-477a-99d3-728011fbae3f", reports.get(0).getFormSubmissionId()); - - assertTrue(reportsRepository.findByBaseEntityAndType("678343544-nhj7-jghdfgfd-mkjdkfg", "HIA4").isEmpty()); - } - - @Test - public void testFindByEmptyServerVersion() { - List reports = reportsRepository.findByEmptyServerVersion(); - assertEquals(1, reports.size()); - assertEquals("60ab7d5c-a051-4633-b0b3-f52b701cb261", reports.get(0).getId()); - assertEquals("03b5d0b8-4f72-4415-9909-ce03b5802c75", reports.get(0).getFormSubmissionId()); - - reports.get(0).setServerVersion(System.currentTimeMillis()); - reportsRepository.update(reports.get(0)); - - assertTrue(reportsRepository.findByEmptyServerVersion().isEmpty()); - } - - @Test - public void testFindByServerVersion() { - List reports = reportsRepository.findByServerVersion(1503312366264l); - assertEquals(1, reports.size()); - assertEquals("07271855-4018-497a-b180-6af01f0fa62b", reports.get(0).getId()); - - reports = reportsRepository.findByServerVersion(1500307579515l); - assertEquals(3, reports.size()); - for (Report report : reports) - assertTrue(report.getServerVersion() >= 1500307579516l); - assertTrue(reportsRepository.findByServerVersion(System.currentTimeMillis()).isEmpty()); - } - - @Test - public void testFindByBaseEntityAndFormSubmissionId() { - List reports = reportsRepository.findByBaseEntityAndFormSubmissionId("6654kk-mnj45-mmnfgd-l45645", - "03b5d0b8-4f72-4415-9909-ce03b5802c75"); - assertEquals(1, reports.size()); - assertEquals("60ab7d5c-a051-4633-b0b3-f52b701cb261", reports.get(0).getId()); - - assertTrue(reportsRepository - .findByBaseEntityAndFormSubmissionId("6654kk-mnj45-mmnfgd-l45645", "d78a8105-f808-488a-b67a-0c4c46845194") - .isEmpty()); - } - - @Test - public void testFindReports() { - assertEquals(2, - reportsRepository.findReports(null, "biddemo", "", "6654kk-mnj45-mmnfgd-l45645", null, null, null, 20).size()); - - List reports = reportsRepository.findReports(null, "biddemo", "", "6654kk-mnj45-mmnfgd-l45645", 0l, null, - null, 20); - assertEquals(1, reports.size()); - - assertEquals("07271855-4018-497a-b180-6af01f0fa62b", reports.get(0).getId()); - - assertEquals(1, reportsRepository.findReports(null, "biddemo", "9e4fc064-d8e7-4fcb-942e-cbcf6524fb24", - "6654kk-mnj45-mmnfgd-l45645", null, null, null, 20).size()); - - assertEquals(4, reportsRepository.findReports("", "biddemo", null, null, 0l, null, null, 20).size()); - - assertEquals(5, reportsRepository.findReports("", "biddemo", null, null, null, null, null, 20).size()); - - assertEquals(3, reportsRepository.findReports("", "biddemo", null, null, 1500307579515l, null, null, 20).size()); - - assertEquals(2, reportsRepository.findReports("", "biddemo", null, null, 0l, null, null, 2).size()); - - assertTrue(reportsRepository.findReports("ATeam", "biddemo", "9e4fc064-d8e7-4fcb-942e-cbcf6524fb24", - "6654kk-mnj45-mmnfgd-l45645", System.currentTimeMillis(), null, null, 20).isEmpty()); - } - - @Test(expected = IllegalArgumentException.class) - public void testFindReportsNoParams() { - reportsRepository.findReports("", null, null, null, null, null, null, 2); - } - - @Test - public void testFindReportsV2() { - assertEquals(2, reportsRepository.findReports("6654kk-mnj45-mmnfgd-l45645", new DateTime("2017-05-01"), - new DateTime(), "HIA2", "biddemo", null, null, null).size()); - - assertEquals(5, reportsRepository - .findReports(null, new DateTime("2017-05-01"), new DateTime(), "HIA2", "biddemo", null, null, null).size()); - - assertEquals(4, reportsRepository.findReports(null, new DateTime("2017-05-01"), new DateTime(), "HIA2", "biddemo", - "9e4fc064-d8e7-4fcb-942e-cbcf6524fb24", new DateTime("2017-07-17"), new DateTime()).size()); - - assertEquals(2, reportsRepository.findReports(null, new DateTime("2017-05-01"), new DateTime(), "HIA2", "biddemo", - "9e4fc064-d8e7-4fcb-942e-cbcf6524fb24", new DateTime("2017-07-18"), new DateTime()).size()); - - List reports = reportsRepository.findReports("678343544-nhj7-jghdfgfd-mkjdkfg", new DateTime("2017-05-01"), - new DateTime(), "HIA2", "biddemo", "9e4fc064-d8e7-4fcb-942e-cbcf6524fb24", new DateTime("2017-07-17"), - new DateTime()); - - assertEquals(1, reports.size()); - - assertEquals("ecafd20f-c95b-4046-9355-9512e1908da4", reports.get(0).getId()); - - assertTrue( - reportsRepository.findReports("6654kk-mnj45-mmnfgd-l45645", new DateTime("2017-05-01"), new DateTime(), "HIA2", - "biddemo", "9e4fc064-d8e7-4fcb-942e-cbcf6524fb24", new DateTime("2017-07-31"), new DateTime()).isEmpty()); - } - - @Test(expected = IllegalArgumentException.class) - public void testFindReportsV2NoParams() { - reportsRepository.findReports(null, null, null, null, null, null, null, null); - } - - @Test(expected = IllegalArgumentException.class) - public void testFindReportsByDynamicQuery() { - reportsRepository.findReportsByDynamicQuery("reportType:HIA2"); - } - + + @Autowired + @Qualifier("reportsRepositoryPostgres") + private ReportsRepository reportsRepository; + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("report.sql"); + return scripts; + } + + @Test + public void testGet() { + Report report = reportsRepository.get("07271855-4018-497a-b180-6af01f0fa62b"); + assertEquals("7073cef4-b974-4910-afa7-dd2ccadba089", report.getFormSubmissionId()); + assertEquals("b0781dd2-e1b1-4878-8e6c-fba488eb9fa3", report.getLocationId()); + assertNull(reportsRepository.get("07271855-4018-497a-b180-6af")); + } + + @Test + public void testAdd() { + Report report = new Report("ghsjf-s723-sj97s", "3453535sdfs", new DateTime(), "MONTHLY", "435-njhjh-jjh", "tester11", + "3", 1522829702064l, 0, null); + reportsRepository.add(report); + assertEquals(6, reportsRepository.getAll().size()); + List reports = reportsRepository.findByBaseEntityAndFormSubmissionId("ghsjf-s723-sj97s", "435-njhjh-jjh"); + assertEquals("3453535sdfs", reports.get(0).getLocationId()); + assertEquals("MONTHLY", report.getReportType()); + assertNull(report.getHia2Indicators()); + MatcherAssert.assertThat(reports, + Matchers.contains(Matchers.hasProperty("serverVersion", Matchers.greaterThan(0l)))); + + } + + @Test + public void testUpdate() { + Report report = reportsRepository.get("cd09a3d4-01d9-485c-a1c5-a2eb078a61be"); + report.setBaseEntityId("asads-asdas7676-ggas"); + report.setServerVersion(1522827820l); + report.setDuration(6); + long serverVersion = report.getServerVersion(); + reportsRepository.update(report); + + Report updateReport = reportsRepository.get("cd09a3d4-01d9-485c-a1c5-a2eb078a61be"); + assertEquals("asads-asdas7676-ggas", updateReport.getBaseEntityId()); + assertNotEquals(1522827820l, updateReport.getServerVersion().longValue()); + assertNotNull(updateReport.getServerVersion()); + assertEquals(6, updateReport.getDuration()); + MatcherAssert.assertThat(updateReport.getServerVersion(), Matchers.greaterThan(serverVersion)); + + } + + @Test + public void testGetAll() { + assertEquals(5, reportsRepository.getAll().size()); + reportsRepository.safeRemove(reportsRepository.get("cd09a3d4-01d9-485c-a1c5-a2eb078a61be")); + List reports = reportsRepository.getAll(); + assertEquals(4, reports.size()); + for (Report report : reports) + assertNotEquals("cd09a3d4-01d9-485c-a1c5-a2eb078a61be", report.getId()); + } + + @Test + public void testSafeRemove() { + reportsRepository.safeRemove(reportsRepository.get("c57ba49f-34b9-4986-9b87-69f48b1830c5")); + List reports = reportsRepository.getAll(); + assertEquals(4, reports.size()); + for (Report report : reports) + assertNotEquals("c57ba49f-34b9-4986-9b87-69f48b1830c5", report.getId()); + assertNull(reportsRepository.get("c57ba49f-34b9-4986-9b87-69f48b1830c5")); + } + + @Test + public void testFindById() { + Report report = reportsRepository.findById("c57ba49f-34b9-4986-9b87-69f48b1830c5"); + assertEquals("88f9fe90-1e45-46b3-8056-e932574dcbd9", report.getFormSubmissionId()); + assertEquals(64, report.getHia2Indicators().size()); + } + + @Test + public void testFindByBaseEntityId() { + + assertEquals(2, reportsRepository.findByBaseEntityId("6654kk-mnj45-mmnfgd-l45645").size()); + + List reports = reportsRepository.findByBaseEntityId("678343544-nhj7-jghdfgfd-mkjdkfg"); + assertEquals(1, reports.size()); + assertEquals("ecafd20f-c95b-4046-9355-9512e1908da4", reports.get(0).getId()); + assertEquals("1aea74ac-b737-477a-99d3-728011fbae3f", reports.get(0).getFormSubmissionId()); + + assertTrue(reportsRepository.findByBaseEntityId("sfsdfd").isEmpty()); + + } + + @Test + public void testFindAllByIdentifier() { + assertEquals(2, reportsRepository.findAllByIdentifier("56757L").size()); + + List reports = reportsRepository.findAllByIdentifier("1121K"); + assertEquals(1, reports.size()); + assertEquals("07271855-4018-497a-b180-6af01f0fa62b", reports.get(0).getId()); + + assertTrue(reportsRepository.findAllByIdentifier("7234M").isEmpty()); + } + + @Test + public void testFindByBaseEntityAndType() { + assertEquals(2, reportsRepository.findByBaseEntityAndType("6654kk-mnj45-mmnfgd-l45645", "HIA2").size()); + + List reports = reportsRepository.findByBaseEntityAndType("678343544-nhj7-jghdfgfd-mkjdkfg", "HIA2"); + assertEquals(1, reports.size()); + assertEquals("ecafd20f-c95b-4046-9355-9512e1908da4", reports.get(0).getId()); + assertEquals("1aea74ac-b737-477a-99d3-728011fbae3f", reports.get(0).getFormSubmissionId()); + + assertTrue(reportsRepository.findByBaseEntityAndType("678343544-nhj7-jghdfgfd-mkjdkfg", "HIA4").isEmpty()); + } + + @Test + public void testFindByEmptyServerVersion() { + List reports = reportsRepository.findByEmptyServerVersion(); + assertEquals(1, reports.size()); + assertEquals("60ab7d5c-a051-4633-b0b3-f52b701cb261", reports.get(0).getId()); + assertEquals("03b5d0b8-4f72-4415-9909-ce03b5802c75", reports.get(0).getFormSubmissionId()); + + reports.get(0).setServerVersion(System.currentTimeMillis()); + reportsRepository.update(reports.get(0)); + + assertTrue(reportsRepository.findByEmptyServerVersion().isEmpty()); + } + + @Test + public void testFindByServerVersion() { + List reports = reportsRepository.findByServerVersion(1503312366264l); + assertEquals(1, reports.size()); + assertEquals("07271855-4018-497a-b180-6af01f0fa62b", reports.get(0).getId()); + + reports = reportsRepository.findByServerVersion(1500307579515l); + assertEquals(3, reports.size()); + for (Report report : reports) + assertTrue(report.getServerVersion() >= 1500307579516l); + assertTrue(reportsRepository.findByServerVersion(System.currentTimeMillis()).isEmpty()); + } + + @Test + public void testFindByBaseEntityAndFormSubmissionId() { + List reports = reportsRepository.findByBaseEntityAndFormSubmissionId("6654kk-mnj45-mmnfgd-l45645", + "03b5d0b8-4f72-4415-9909-ce03b5802c75"); + assertEquals(1, reports.size()); + assertEquals("60ab7d5c-a051-4633-b0b3-f52b701cb261", reports.get(0).getId()); + + assertTrue(reportsRepository + .findByBaseEntityAndFormSubmissionId("6654kk-mnj45-mmnfgd-l45645", "d78a8105-f808-488a-b67a-0c4c46845194") + .isEmpty()); + } + + @Test + public void testFindReports() { + assertEquals(2, + reportsRepository.findReports(null, "biddemo", "", "6654kk-mnj45-mmnfgd-l45645", null, null, null, 20).size()); + + List reports = reportsRepository.findReports(null, "biddemo", "", "6654kk-mnj45-mmnfgd-l45645", 0l, null, + null, 20); + assertEquals(1, reports.size()); + + assertEquals("07271855-4018-497a-b180-6af01f0fa62b", reports.get(0).getId()); + + assertEquals(1, reportsRepository.findReports(null, "biddemo", "9e4fc064-d8e7-4fcb-942e-cbcf6524fb24", + "6654kk-mnj45-mmnfgd-l45645", null, null, null, 20).size()); + + assertEquals(4, reportsRepository.findReports("", "biddemo", null, null, 0l, null, null, 20).size()); + + assertEquals(5, reportsRepository.findReports("", "biddemo", null, null, null, null, null, 20).size()); + + assertEquals(3, reportsRepository.findReports("", "biddemo", null, null, 1500307579515l, null, null, 20).size()); + + assertEquals(2, reportsRepository.findReports("", "biddemo", null, null, 0l, null, null, 2).size()); + + assertTrue(reportsRepository.findReports("ATeam", "biddemo", "9e4fc064-d8e7-4fcb-942e-cbcf6524fb24", + "6654kk-mnj45-mmnfgd-l45645", System.currentTimeMillis(), null, null, 20).isEmpty()); + } + + @Test(expected = IllegalArgumentException.class) + public void testFindReportsNoParams() { + reportsRepository.findReports("", null, null, null, null, null, null, 2); + } + + @Test + public void testFindReportsV2() { + assertEquals(2, reportsRepository.findReports("6654kk-mnj45-mmnfgd-l45645", new DateTime("2017-05-01"), + new DateTime(), "HIA2", "biddemo", null, null, null).size()); + + assertEquals(5, reportsRepository + .findReports(null, new DateTime("2017-05-01"), new DateTime(), "HIA2", "biddemo", null, null, null).size()); + + assertEquals(4, reportsRepository.findReports(null, new DateTime("2017-05-01"), new DateTime(), "HIA2", "biddemo", + "9e4fc064-d8e7-4fcb-942e-cbcf6524fb24", new DateTime("2017-07-17"), new DateTime()).size()); + + assertEquals(2, reportsRepository.findReports(null, new DateTime("2017-05-01"), new DateTime(), "HIA2", "biddemo", + "9e4fc064-d8e7-4fcb-942e-cbcf6524fb24", new DateTime("2017-07-18"), new DateTime()).size()); + + List reports = reportsRepository.findReports("678343544-nhj7-jghdfgfd-mkjdkfg", new DateTime("2017-05-01"), + new DateTime(), "HIA2", "biddemo", "9e4fc064-d8e7-4fcb-942e-cbcf6524fb24", new DateTime("2017-07-17"), + new DateTime()); + + assertEquals(1, reports.size()); + + assertEquals("ecafd20f-c95b-4046-9355-9512e1908da4", reports.get(0).getId()); + + assertTrue( + reportsRepository.findReports("6654kk-mnj45-mmnfgd-l45645", new DateTime("2017-05-01"), new DateTime(), "HIA2", + "biddemo", "9e4fc064-d8e7-4fcb-942e-cbcf6524fb24", new DateTime("2017-07-31"), new DateTime()).isEmpty()); + } + + @Test(expected = IllegalArgumentException.class) + public void testFindReportsV2NoParams() { + reportsRepository.findReports(null, null, null, null, null, null, null, null); + } + + @Test(expected = IllegalArgumentException.class) + public void testFindReportsByDynamicQuery() { + reportsRepository.findReportsByDynamicQuery("reportType:HIA2"); + } + } diff --git a/src/test/java/org/opensrp/repository/postgres/SearchRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/SearchRepositoryTest.java index 91583bd3c..a233409db 100644 --- a/src/test/java/org/opensrp/repository/postgres/SearchRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/SearchRepositoryTest.java @@ -16,92 +16,92 @@ import org.springframework.beans.factory.annotation.Qualifier; public class SearchRepositoryTest extends BaseRepositoryTest { - - @Autowired - @Qualifier("searchRepositoryPostgres") - private SearchRepository searchRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("client.sql"); - return scripts; - } - - @Test - public void testFindByCriteria() { - ClientSearchBean clientSearchBean = new ClientSearchBean(); - List clients = searchRepository.findByCriteria(clientSearchBean, "Jan", null, null, 20); - - assertEquals(5, clients.size()); - - clients = searchRepository.findByCriteria(clientSearchBean, "Jan", null, "Bab", 20); - - assertEquals(5, clients.size()); - - clients = searchRepository.findByCriteria(clientSearchBean, "Jan", null, "Baby", 20); - - assertEquals(4, clients.size()); - - clients = searchRepository.findByCriteria(clientSearchBean, "Janu", null, "Baby", 3); - - assertEquals(3, clients.size()); - - for (Client client : clients) { - assertTrue(client.getFirstName().contains("Janu")); - assertTrue(client.getLastName().contains("Baby")); - } - - clients = searchRepository.findByCriteria(clientSearchBean, "JAnu", null, "BABY", 3); - - assertEquals(3, clients.size()); - - for (Client client : clients) { - assertTrue(client.getFirstName().contains("Janu")); - assertTrue(client.getLastName().contains("Baby")); - } - - clients = searchRepository.findByCriteria(clientSearchBean, "Janu", null, "Babyfive", 3); - - assertEquals(1, clients.size()); - assertEquals("05934ae338431f28bf6793b241693a2f", clients.get(0).getId()); - assertEquals("aabcd2cc-c111-41c6-85e6-cb5d9e350d08", clients.get(0).getBaseEntityId()); - - ClientSearchBean searchBean = new ClientSearchBean(); - - assertEquals(20, searchRepository.findByCriteria(searchBean, null, null, null, 20).size()); - - searchBean.setNameLike("Jan"); - assertEquals(4, searchRepository.findByCriteria(searchBean, "Janu", null, null, 20).size()); - - searchBean.setNameLike("Baby"); - searchBean.setGender("Male"); - assertEquals(2, searchRepository.findByCriteria(searchBean, "Jan", null, "Baby", 20).size()); - - searchBean.setBirthdateFrom(new DateTime("2016-04-13")); - searchBean.setBirthdateTo(new DateTime()); - assertEquals(2, searchRepository.findByCriteria(searchBean, "Jan", null, "Baby", 20).size()); - - searchBean.setDeathdateFrom(new DateTime("2018-01-01")); - searchBean.setDeathdateTo(new DateTime()); - assertEquals(1, searchRepository.findByCriteria(searchBean, "Jan", null, "Baby", 20).size()); - - searchBean = new ClientSearchBean(); - searchBean.setAttributeType("Home_Facility"); - searchBean.setAttributeValue("Happy Kids Clinic"); - assertEquals(9, searchRepository.findByCriteria(searchBean, null, null, null, 20).size()); - - searchBean.setAttributeType("CHW_Name"); - searchBean.setAttributeValue("Hellen"); - clients = searchRepository.findByCriteria(searchBean, null, null, null, 20); - assertEquals(1, clients.size()); - assertEquals("05934ae338431f28bf6793b24164cbd9", clients.get(0).getId()); - - searchBean = new ClientSearchBean(); - searchBean.setLastEditFrom(new DateTime("2018-03-13T12:57:05.652")); - searchBean.setLastEditTo(new DateTime()); - assertEquals(6, searchRepository.findByCriteria(searchBean, null, null, null, 20).size()); - - } - + + @Autowired + @Qualifier("searchRepositoryPostgres") + private SearchRepository searchRepository; + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("client.sql"); + return scripts; + } + + @Test + public void testFindByCriteria() { + ClientSearchBean clientSearchBean = new ClientSearchBean(); + List clients = searchRepository.findByCriteria(clientSearchBean, "Jan", null, null, 20); + + assertEquals(5, clients.size()); + + clients = searchRepository.findByCriteria(clientSearchBean, "Jan", null, "Bab", 20); + + assertEquals(5, clients.size()); + + clients = searchRepository.findByCriteria(clientSearchBean, "Jan", null, "Baby", 20); + + assertEquals(4, clients.size()); + + clients = searchRepository.findByCriteria(clientSearchBean, "Janu", null, "Baby", 3); + + assertEquals(3, clients.size()); + + for (Client client : clients) { + assertTrue(client.getFirstName().contains("Janu")); + assertTrue(client.getLastName().contains("Baby")); + } + + clients = searchRepository.findByCriteria(clientSearchBean, "JAnu", null, "BABY", 3); + + assertEquals(3, clients.size()); + + for (Client client : clients) { + assertTrue(client.getFirstName().contains("Janu")); + assertTrue(client.getLastName().contains("Baby")); + } + + clients = searchRepository.findByCriteria(clientSearchBean, "Janu", null, "Babyfive", 3); + + assertEquals(1, clients.size()); + assertEquals("05934ae338431f28bf6793b241693a2f", clients.get(0).getId()); + assertEquals("aabcd2cc-c111-41c6-85e6-cb5d9e350d08", clients.get(0).getBaseEntityId()); + + ClientSearchBean searchBean = new ClientSearchBean(); + + assertEquals(20, searchRepository.findByCriteria(searchBean, null, null, null, 20).size()); + + searchBean.setNameLike("Jan"); + assertEquals(4, searchRepository.findByCriteria(searchBean, "Janu", null, null, 20).size()); + + searchBean.setNameLike("Baby"); + searchBean.setGender("Male"); + assertEquals(2, searchRepository.findByCriteria(searchBean, "Jan", null, "Baby", 20).size()); + + searchBean.setBirthdateFrom(new DateTime("2016-04-13")); + searchBean.setBirthdateTo(new DateTime()); + assertEquals(2, searchRepository.findByCriteria(searchBean, "Jan", null, "Baby", 20).size()); + + searchBean.setDeathdateFrom(new DateTime("2018-01-01")); + searchBean.setDeathdateTo(new DateTime()); + assertEquals(1, searchRepository.findByCriteria(searchBean, "Jan", null, "Baby", 20).size()); + + searchBean = new ClientSearchBean(); + searchBean.setAttributeType("Home_Facility"); + searchBean.setAttributeValue("Happy Kids Clinic"); + assertEquals(9, searchRepository.findByCriteria(searchBean, null, null, null, 20).size()); + + searchBean.setAttributeType("CHW_Name"); + searchBean.setAttributeValue("Hellen"); + clients = searchRepository.findByCriteria(searchBean, null, null, null, 20); + assertEquals(1, clients.size()); + assertEquals("05934ae338431f28bf6793b24164cbd9", clients.get(0).getId()); + + searchBean = new ClientSearchBean(); + searchBean.setLastEditFrom(new DateTime("2018-03-13T12:57:05.652")); + searchBean.setLastEditTo(new DateTime()); + assertEquals(6, searchRepository.findByCriteria(searchBean, null, null, null, 20).size()); + + } + } diff --git a/src/test/java/org/opensrp/repository/postgres/SettingRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/SettingRepositoryTest.java index 2f90540eb..93898800e 100755 --- a/src/test/java/org/opensrp/repository/postgres/SettingRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/SettingRepositoryTest.java @@ -37,509 +37,509 @@ public class SettingRepositoryTest extends BaseRepositoryTest { - @Autowired - @Qualifier("settingRepositoryPostgres") - private SettingRepository settingRepository; + @Autowired + @Qualifier("settingRepositoryPostgres") + private SettingRepository settingRepository; - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet<>(); - scripts.add("setting.sql"); - return scripts; - } + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet<>(); + scripts.add("setting.sql"); + return scripts; + } - @Test - public void testFindAllSettings() { + @Test + public void testFindAllSettings() { - List settings = settingRepository.findAllSettings(); - assertEquals(14, settings.size()); - - } - - @Test - public void testFindByEmptyServerVersion() { - - List settings = settingRepository.findByEmptyServerVersion(); - assertEquals(3, settings.size()); - - } - - @Test - public void testGetSettingById() { - Settings setting = settingRepository.getSettingById(1L); - assertNotNull(setting); - assertNotNull(setting.getJson()); - - SettingConfiguration settingConfiguration = settingRepository.get("151"); - assertNotNull(settingConfiguration); - assertEquals("global_configs1", settingConfiguration.getIdentifier()); - } - - @Test - public void testFindByCriteria() { - SettingSearchBean settingQueryBean = new SettingSearchBean(); - settingQueryBean.setServerVersion(0L); - settingQueryBean.setMetadataVersion(0L); - settingQueryBean.setLimit(1000); - - List settings = settingRepository.findSettings(settingQueryBean, null); - assertEquals(1, settings.size()); - assertEquals(3, settings.get(0).getSettings().size()); - - settingQueryBean.setTeamId("7e104eee-ec8a-4733-bcf7-c02c51cf43f4"); - settingQueryBean.setServerVersion(0L); - settings = settingRepository.findSettings(settingQueryBean, null); - - assertEquals(1, settings.size()); - - settingQueryBean = new SettingSearchBean(); - settingQueryBean.setServerVersion(0L); - settingQueryBean.setLocationId("44de66fb-e6c6-4bae-92bb-386dfe626eba"); - settings = settingRepository.findSettings(settingQueryBean, null); - - assertEquals(1, settings.size()); - - settingQueryBean = new SettingSearchBean(); - settingQueryBean.setServerVersion(0L); - settingQueryBean.setProviderId("demo"); - settings = settingRepository.findSettings(settingQueryBean, null); - - assertEquals(2, settings.size()); - - settingQueryBean = new SettingSearchBean(); - settingQueryBean.setServerVersion(0L); - settingQueryBean.setProviderId("demo"); - settingQueryBean.setTeamId("7e104eee-ec8a-4733-bcf7-c02c51cf43f4"); - settings = settingRepository.findSettings(settingQueryBean, null); - - assertEquals(1, settings.size()); - - settingQueryBean = new SettingSearchBean(); - settingQueryBean.setServerVersion(0L); - settingQueryBean.setTeam("my-team"); - settings = settingRepository.findSettings(settingQueryBean, null); - - assertEquals(5, settings.size()); - - } - - @Test - public void tesFindByCriteriaAndResolveSettings() { - SettingSearchBean settingQueryBean = new SettingSearchBean(); - settingQueryBean.setServerVersion(0L); - - List settings = settingRepository.findSettings(settingQueryBean, null); - assertEquals(1, settings.size()); - assertEquals(3, settings.get(0).getSettings().size()); - } - - @Test - public void testGetAllSettings() { - List settings = settingRepository.getAll(); - assertEquals(14, settings.size()); - - } - - @Test - public void testGetSettingMetadataByDocumentId() { - String documentId = "affc7614-a51b-4b5f-877a-ad932b38bf4b"; - SettingsMetadata settingMetadata = settingRepository.getSettingMetadataByDocumentId(documentId); - assertNotNull(settingMetadata); - assertEquals(documentId, settingMetadata.getDocumentId()); - assertEquals("lion_king_cast_2", settingMetadata.getIdentifier()); - } - - @Test - public void testAddAndUpdateShouldAddOrUpdate() { - SettingConfiguration expectedSettingConfiguration = new SettingConfiguration(); - expectedSettingConfiguration.setTeamId("test_team"); - expectedSettingConfiguration.setTeam("test_team"); - expectedSettingConfiguration.setId("test_id"); - expectedSettingConfiguration.setIdentifier("test_identifier"); - expectedSettingConfiguration.setServerVersion(0L); - - List settings = new ArrayList<>(); - Map settingMap = new HashMap<>(); - - // add - Setting setting = new Setting(); - setting.setKey("key1"); - setting.setValue("value1"); - setting.setDescription("description1"); - settings.add(setting); - settingMap.put("key1", setting); - - setting = new Setting(); - setting.setKey("key2"); - setting.setValue("value2"); - setting.setDescription("description2"); - settings.add(setting); - settingMap.put("key2", setting); - - setting = new Setting(); - setting.setKey("key3"); - setting.setValue("value3"); - setting.setDescription("description3"); - settings.add(setting); - settingMap.put("key3", setting); - - expectedSettingConfiguration.setSettings(settings); - settingRepository.addSettings(expectedSettingConfiguration); - - SettingConfiguration actualSettingConfiguration = settingRepository.get("test_id"); - assertNotNull(actualSettingConfiguration); - assertEquals(3, actualSettingConfiguration.getSettings().size()); - assertEquals(expectedSettingConfiguration.getTeam(), actualSettingConfiguration.getTeam()); - assertEquals(expectedSettingConfiguration.getId(), actualSettingConfiguration.getId()); - assertEquals(expectedSettingConfiguration.getIdentifier(), actualSettingConfiguration.getIdentifier()); - verifySettingsAreSame(settingMap, actualSettingConfiguration.getSettings()); - MatcherAssert.assertThat(actualSettingConfiguration.getServerVersion(), Matchers.greaterThan(0l)); - long serverVersion=actualSettingConfiguration.getServerVersion(); - - // update - settings.clear(); - expectedSettingConfiguration = new SettingConfiguration(); - expectedSettingConfiguration.setTeamId("test_team_40"); - expectedSettingConfiguration.setTeam("test_team"); - expectedSettingConfiguration.setId("test_id"); - expectedSettingConfiguration.setIdentifier("test_identifier_40"); - expectedSettingConfiguration.setServerVersion(0L); - - settingMap.clear(); - setting.setKey("key1"); - setting.setValue("value10"); - setting.setDescription("description10"); - settings.add(setting); - settingMap.put("key1", setting); - - setting = new Setting(); - setting.setKey("key2"); - setting.setValue("value20"); - setting.setDescription("description20"); - settings.add(setting); - settingMap.put("key2", setting); - - setting = new Setting(); - setting.setKey("key3"); - setting.setValue("value30"); - setting.setDescription("description30"); - settings.add(setting); - settingMap.put("key3", setting); - - Setting setting1 = new Setting(); - setting1.setKey("key4"); - setting1.setValue("value40"); - setting1.setDescription("description40"); - settings.add(setting1); - settingMap.put("key4", setting1); - - expectedSettingConfiguration.setSettings(settings); - - settingRepository.update(expectedSettingConfiguration); - SettingConfiguration updatedSettingConfiguration = settingRepository.get("test_id"); - assertNotNull(updatedSettingConfiguration); - assertEquals(3, actualSettingConfiguration.getSettings().size()); - assertEquals(expectedSettingConfiguration.getTeam(), updatedSettingConfiguration.getTeam()); - assertEquals(expectedSettingConfiguration.getId(), updatedSettingConfiguration.getId()); - assertEquals(expectedSettingConfiguration.getTeamId(), "test_team_40"); - assertEquals(expectedSettingConfiguration.getIdentifier(), "test_identifier_40"); - verifySettingsAreSame(settingMap, expectedSettingConfiguration.getSettings()); - MatcherAssert.assertThat(updatedSettingConfiguration.getServerVersion(), Matchers.greaterThan(serverVersion)); - - } - - @Test - public void testGetAllSettingMetadataByDocumentIdShouldGetAllMetadata() { - List settingsMetadataList = settingRepository.getAllSettingMetadataByDocumentId("151"); - assertEquals(3, settingsMetadataList.size()); - Set identifiers = new HashSet<>(); - identifiers.add("global_configs1"); - identifiers.add("global_configs12"); - identifiers.add("global_configs13"); - for (SettingsMetadata settingsMetadata : settingsMetadataList) { - assertTrue(identifiers.contains(settingsMetadata.getIdentifier())); - } - } - - @Test - public void testAddSettingShouldAddSetting() { - Setting setting = new Setting(); - setting.setDescription("description"); - setting.setLocationId("location_id"); - setting.setTeam("team"); - setting.setTeamId("team_id"); - setting.setProviderId("provider_id"); - setting.setSettingsId("document_id_32932"); - setting.setKey("key_32932"); - setting.setValue("value"); - setting.setInheritedFrom("location_id_2"); - setting.setIdentifier("setting_identifier_32932"); - setting.setServerVersion(0L); - settingRepository.addOrUpdate(setting); - - Map expectedSettings = new HashMap<>(); - expectedSettings.put("key_32932", setting); - - SettingSearchBean settingQueryBean = new SettingSearchBean(); - settingQueryBean.setServerVersion(0L); - settingQueryBean.setIdentifier("setting_identifier_32932"); - List settings = settingRepository.findSettings(settingQueryBean, null); - List actualSettings = settings.get(0).getSettings(); - assertNotNull(actualSettings); - verifySettingsAreSame(expectedSettings, actualSettings); - MatcherAssert.assertThat(settings, - Matchers.contains(Matchers.hasProperty("serverVersion", Matchers.greaterThan(0l)))); - } - - @Test - public void testAddGlobalSettingShouldAddSetting() { - Setting setting = new Setting(); - setting.setDescription("description"); - setting.setDocumentId("document_id_32932"); - setting.setKey("key_32932"); - setting.setValue("value"); - setting.setLabel("label"); - setting.setInheritedFrom("location_id_2"); - setting.setIdentifier("setting_identifier_32932"); - setting.setServerVersion(0L); - settingRepository.addOrUpdate(setting); - - Map expectedSettings = new HashMap<>(); - expectedSettings.put("key_32932", setting); - - SettingSearchBean settingQueryBean = new SettingSearchBean(); - settingQueryBean.setServerVersion(0L); - settingQueryBean.setIdentifier("setting_identifier_32932"); - List settings = settingRepository.findSettings(settingQueryBean, null); - List actualSettings = settings.get(0).getSettings(); - assertNotNull(actualSettings); - verifySettingsAreSame(expectedSettings, actualSettings); - } - - @Test - public void testSaveGlobalSettingsUsingV1endpoint() throws IOException { - String popCharacteristicsGlobal = "{\"identifier\":\"population_characteristics\",\"settings\":[{\"description\":\"The proportion of women in the adult population (18 years or older), with a BMI less than 18.5, is 20% or higher.\",\"label\":\"Undernourished prevalence 20% or higher\",\"value\":\"false\",\"key\":\"pop_undernourish\"},{\"description\":\"The proportion of pregnant women in the population with anaemia (haemoglobin level less than 11 g/dl) is 40% or higher.\",\"label\":\"Anaemia prevalence 40% or higher\",\"value\":\"false\",\"key\":\"pop_anaemia_40\"}],\"type\":\"SettingConfiguration\"}"; - String testGlobalsSaveV1 = "{\"identifier\":\"test_globals_save_v1\",\"settings\":[{\"description\":\"Is " - + "an ultrasound machine available and functional at your facility and a trained health worker available to use it?\",\"label\":\"Ultrasound available\",\"type\":\"SettingConfiguration\",\"value\":false,\"key\":\"site_ultrasound\"},{\"description\":\"Does your facility use an automated blood pressure (BP) measurement tool?\",\"label\":\"Automated BP measurement tool\",\"type\":\"SettingConfiguration\",\"value\":false,\"key\":\"site_bp_tool\"}],\"type\":\"SettingConfiguration\"}"; - FileInputStream fis = new FileInputStream("src/test/resources/settings.json"); - String largeSettingPayload = IOUtils.toString(fis, StandardCharsets.UTF_8); - - SettingTypeHandler settingTypeHandler = new SettingTypeHandler(); - SettingConfiguration popCharacteristicsSettingConfig = settingTypeHandler.mapper - .readValue(popCharacteristicsGlobal, SettingConfiguration.class); - SettingConfiguration siteCharacteristicsSettingConfig = settingTypeHandler.mapper - .readValue(testGlobalsSaveV1, SettingConfiguration.class); - SettingConfiguration largeSettingPayloadSettingConfig = settingTypeHandler.mapper - .readValue(largeSettingPayload, SettingConfiguration.class); - - popCharacteristicsSettingConfig.setServerVersion(Calendar.getInstance().getTimeInMillis()); - popCharacteristicsSettingConfig.setV1Settings(true); - - siteCharacteristicsSettingConfig.setServerVersion(Calendar.getInstance().getTimeInMillis()); - siteCharacteristicsSettingConfig.setV1Settings(true); - - largeSettingPayloadSettingConfig.setServerVersion(Calendar.getInstance().getTimeInMillis()); - largeSettingPayloadSettingConfig.setV1Settings(true); - - settingRepository.addSettings(popCharacteristicsSettingConfig); - settingRepository.addSettings(siteCharacteristicsSettingConfig); - settingRepository.addSettings(largeSettingPayloadSettingConfig); - - SettingSearchBean settingQueryBeanTwo = new SettingSearchBean(); - settingQueryBeanTwo.setServerVersion(0L); - List allGlobalSettings = settingRepository.findSettings(settingQueryBeanTwo, null); - assertEquals(3, allGlobalSettings.size()); - - String textGlobalSaveV1Update = "{\"type\":\"SettingConfiguration\",\"serverVersion\":1597999833442,\"identifier\":\"test_globals_save_v1\",\"settings\":[{\"type\":\"SettingConfiguration\",\"serverVersion\":1597999833442,\"documentId\":\"ff3efba8-cda1-4f88-a271-96afb1d4fd63\",\"key\":\"site_ultrasound\",\"value\":\"false\",\"label\":\"Ultrasound available\",\"description\":\"Is an ultrasound machine available and functional at your facility and a trained health worker available to use it?\",\"uuid\":\"e01cce9e-02cd-4443-880c-09d483597cca\",\"settingsId\":\"16\",\"settingIdentifier\":\"test_globals_save_v1\",\"settingMetadataId\":\"19\"},{\"type\":\"SettingConfiguration\",\"serverVersion\":1597999833442,\"documentId\":\"ff3efba8-cda1-4f88-a271-96afb1d4fd63\",\"key\":\"site_bp_tool\",\"value\":\"true\",\"label\":\"Automated BP measurement tool\",\"description\":\"Does your facility use an automated blood pressure (BP) measurement tool?\",\"uuid\":\"3298a9c0-57f3-41e7-ba5d-320274443db4\",\"settingsId\":\"16\",\"settingIdentifier\":\"test_globals_save_v1\",\"settingMetadataId\":\"20\"},{\"key\":\"site_bp_tool_update\",\"value\":\"true\",\"label\":\"Automated BP measurement tool\",\"description\":\"Does your facility use an automated blood pressure (BP) measurement tool?\"}],\"_rev\":\"v1\"}"; - SettingConfiguration testUpdateSettings = settingTypeHandler.mapper - .readValue(textGlobalSaveV1Update, SettingConfiguration.class); - testUpdateSettings.setServerVersion(Calendar.getInstance().getTimeInMillis()); - testUpdateSettings.setV1Settings(true); - testUpdateSettings.setId(allGlobalSettings.get(0).getId()); - - settingRepository.update(testUpdateSettings); - - SettingSearchBean settingQueryBeanThree = new SettingSearchBean(); - settingQueryBeanThree.setServerVersion(0L); - List allGlobalSettingsTwo = settingRepository.findSettings(settingQueryBeanThree, null); - assertEquals(3, allGlobalSettingsTwo.size()); - } - - private void verifySettingsAreSame(Map settingMap, List settings) { - for (Setting actualSetting : settings) { - Setting expectedSetting = settingMap.get(actualSetting.getKey()); - assertEquals(expectedSetting.getKey(), actualSetting.getKey()); - assertEquals(expectedSetting.getDescription(), actualSetting.getDescription()); - assertEquals(expectedSetting.getValue(), actualSetting.getValue()); - } - } - - @Test - public void testReformattedLocationHierarchyWithChildLocationId() throws Exception { - LocationTree locationTree = new Gson().fromJson( - "{\"locationsHierarchy\":{\"map\":{\"02ebbc84-5e29-4cd5-9b79-c594058923e9\":{\"id\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"label\":\"Uganda\",\"node\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"tags\":[\"Country\"],\"voided\":false},\"children\":{\"8340315f-48e4-4768-a1ce-414532b4c49b\":{\"id\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"label\":\"Kampala\",\"node\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"parentLocation\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"voided\":false},\"tags\":[\"District\"],\"voided\":false},\"children\":{\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\":{\"id\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"label\":\"KCCA\",\"node\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"parentLocation\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"parentLocation\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"voided\":false},\"voided\":false},\"tags\":[\"County\"],\"voided\":false},\"children\":{\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\":{\"id\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"label\":\"Central Division\",\"node\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"parentLocation\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"parentLocation\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"voided\":false},\"voided\":false},\"tags\":[\"Sub-county\"],\"voided\":false},\"children\":{\"44de66fb-e6c6-4bae-92bb-386dfe626eba\":{\"id\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"label\":\"Bukesa Urban Health Centre\",\"node\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"parentLocation\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"voided\":false},\"voided\":false},\"tags\":[\"Health Facility\"],\"voided\":false},\"children\":{\"982eb3f3-b7e3-450f-a38e-d067f2345212\":{\"id\":\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"label\":\"Jambula Girls School\",\"node\":{\"locationId\":\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"name\":\"Jambula Girls School\",\"parentLocation\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"voided\":false},\"voided\":false},\"tags\":[\"School\"],\"voided\":false},\"parent\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"},\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\":{\"id\":\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\",\"label\":\"Nsalo Secondary School\",\"node\":{\"locationId\":\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\",\"name\":\"Nsalo Secondary School\",\"parentLocation\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"voided\":false},\"voided\":false},\"tags\":[\"School\"],\"voided\":false},\"parent\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"}},\"parent\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\"}},\"parent\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\"}},\"parent\":\"8340315f-48e4-4768-a1ce-414532b4c49b\"}},\"parent\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\"}}}},\"parentChildren\":{\"8340315f-48e4-4768-a1ce-414532b4c49b\":[\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\"],\"02ebbc84-5e29-4cd5-9b79-c594058923e9\":[\"8340315f-48e4-4768-a1ce-414532b4c49b\"],\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\":[\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\"],\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\":[\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"],\"44de66fb-e6c6-4bae-92bb-386dfe626eba\":[\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\"]}}}", - LocationTree.class); - Map> treeNodeHashMap = new HashMap<>(); - if (locationTree != null) { - treeNodeHashMap = locationTree.getLocationsHierarchy(); - } - - assertNotNull(treeNodeHashMap); - SettingRepositoryImpl settingRepository = new SettingRepositoryImpl(); - - Whitebox.setInternalState(settingRepository, "locationUuid", "44de66fb-e6c6-4bae-92bb-386dfe626eba"); - Whitebox.invokeMethod(settingRepository, "reformattedLocationHierarchy", treeNodeHashMap); - List reformattedLocationHierarchy = settingRepository.getReformattedLocationHierarchy(); - assertNotNull(reformattedLocationHierarchy); - assertEquals(5, reformattedLocationHierarchy.size()); - } - - @Test - public void testReformattedLocationHierarchyWithParentLocationId() throws Exception { - LocationTree locationTree = new Gson().fromJson( - "{\"locationsHierarchy\":{\"map\":{\"02ebbc84-5e29-4cd5-9b79-c594058923e9\":{\"id\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"label\":\"Uganda\",\"node\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"tags\":[\"Country\"],\"voided\":false},\"children\":{\"8340315f-48e4-4768-a1ce-414532b4c49b\":{\"id\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"label\":\"Kampala\",\"node\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"parentLocation\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"voided\":false},\"tags\":[\"District\"],\"voided\":false},\"children\":{\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\":{\"id\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"label\":\"KCCA\",\"node\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"parentLocation\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"parentLocation\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"voided\":false},\"voided\":false},\"tags\":[\"County\"],\"voided\":false},\"children\":{\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\":{\"id\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"label\":\"Central Division\",\"node\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"parentLocation\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"parentLocation\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"voided\":false},\"voided\":false},\"tags\":[\"Sub-county\"],\"voided\":false},\"children\":{\"44de66fb-e6c6-4bae-92bb-386dfe626eba\":{\"id\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"label\":\"Bukesa Urban Health Centre\",\"node\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"parentLocation\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"voided\":false},\"voided\":false},\"tags\":[\"Health Facility\"],\"voided\":false},\"children\":{\"982eb3f3-b7e3-450f-a38e-d067f2345212\":{\"id\":\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"label\":\"Jambula Girls School\",\"node\":{\"locationId\":\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"name\":\"Jambula Girls School\",\"parentLocation\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"voided\":false},\"voided\":false},\"tags\":[\"School\"],\"voided\":false},\"parent\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"},\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\":{\"id\":\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\",\"label\":\"Nsalo Secondary School\",\"node\":{\"locationId\":\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\",\"name\":\"Nsalo Secondary School\",\"parentLocation\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"voided\":false},\"voided\":false},\"tags\":[\"School\"],\"voided\":false},\"parent\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"}},\"parent\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\"}},\"parent\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\"}},\"parent\":\"8340315f-48e4-4768-a1ce-414532b4c49b\"}},\"parent\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\"}}}},\"parentChildren\":{\"8340315f-48e4-4768-a1ce-414532b4c49b\":[\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\"],\"02ebbc84-5e29-4cd5-9b79-c594058923e9\":[\"8340315f-48e4-4768-a1ce-414532b4c49b\"],\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\":[\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\"],\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\":[\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"],\"44de66fb-e6c6-4bae-92bb-386dfe626eba\":[\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\"]}}}", - LocationTree.class); - Map> treeNodeHashMap = new HashMap<>(); - if (locationTree != null) { - treeNodeHashMap = locationTree.getLocationsHierarchy(); - } - - assertNotNull(treeNodeHashMap); - SettingRepositoryImpl settingRepository = new SettingRepositoryImpl(); - - Whitebox.setInternalState(settingRepository, "locationUuid", "02ebbc84-5e29-4cd5-9b79-c594058923e9"); - Whitebox.invokeMethod(settingRepository, "reformattedLocationHierarchy", treeNodeHashMap); - List reformattedLocationHierarchy = settingRepository.getReformattedLocationHierarchy(); - assertNotNull(reformattedLocationHierarchy); - assertEquals(1, reformattedLocationHierarchy.size()); - } - - @Test - public void testUpdateWithNewSettings() { - SettingConfiguration settingConfiguration = new SettingConfiguration(); - settingConfiguration.setTeamId("test_team"); - settingConfiguration.setTeam("test_team"); - settingConfiguration.setId("test_id"); - settingConfiguration.setIdentifier("test_identifier"); - settingConfiguration.setServerVersion(0L); - - List settings = new ArrayList<>(); - Map settingMap = new HashMap<>(); - Setting setting = new Setting(); - setting.setKey("key1"); - setting.setValue("value1"); - setting.setDescription("description1"); - settings.add(setting); - settingMap.put("key1", setting); - - settingConfiguration.setSettings(settings); - settingRepository.addSettings(settingConfiguration); - - SettingConfiguration actualSettingConfiguration = settingRepository.get("test_id"); - assertNotNull(actualSettingConfiguration); - assertEquals(1, actualSettingConfiguration.getSettings().size()); - settings.clear(); - settingMap.clear(); - settings = actualSettingConfiguration.getSettings(); - setting = settings.get(0); - setting.setValue("changedvalue10"); - settings.add(setting); - settingMap.put("key1", setting); - - setting = new Setting(); - setting.setKey("key2"); - setting.setValue("value20"); - setting.setDescription("description20"); - settings.add(setting); - settingMap.put("key2", setting); - - actualSettingConfiguration.setSettings(settings); - - settingRepository.update(actualSettingConfiguration); - SettingConfiguration updatedSettingConfiguration = settingRepository.get("test_id"); - assertNotNull(updatedSettingConfiguration); - assertEquals(2, updatedSettingConfiguration.getSettings().size()); - assertEquals("test_team", updatedSettingConfiguration.getTeam()); - assertEquals("test_id", updatedSettingConfiguration.getId()); - verifySettingsAreSame(settingMap, updatedSettingConfiguration.getSettings()); - - } - - - @Test - public void testUpdateShouldDeleteBlankValueRecords() { - SettingConfiguration expectedSettingConfiguration = new SettingConfiguration(); - expectedSettingConfiguration.setTeamId("test_team"); - expectedSettingConfiguration.setTeam("test_team"); - expectedSettingConfiguration.setId("test_id"); - expectedSettingConfiguration.setIdentifier("test_identifier"); - expectedSettingConfiguration.setServerVersion(0L); - - List settings = new ArrayList<>(); - Map settingMap = new HashMap<>(); - - // add - Setting setting = new Setting(); - setting.setKey("key1"); - setting.setValue("value1"); - setting.setDescription("description1"); - settings.add(setting); - settingMap.put("key1", setting); - - setting = new Setting(); - setting.setKey("key2"); - setting.setValue(""); - setting.setDescription("description2"); - settings.add(setting); - settingMap.put("key2", setting); - - expectedSettingConfiguration.setSettings(settings); - settingRepository.addSettings(expectedSettingConfiguration); - - SettingConfiguration actualSettingConfiguration = settingRepository.get("test_id"); - assertNotNull(actualSettingConfiguration); - assertEquals(1, actualSettingConfiguration.getSettings().size()); - - // update - settings.clear(); - expectedSettingConfiguration = new SettingConfiguration(); - expectedSettingConfiguration.setTeamId("test_team"); - expectedSettingConfiguration.setTeam("test_team"); - expectedSettingConfiguration.setId("test_id"); - expectedSettingConfiguration.setIdentifier("test_identifier"); - expectedSettingConfiguration.setServerVersion(0L); - - settingMap.clear(); - setting.setKey("key1"); - setting.setValue(""); - setting.setDescription("description10"); - settings.add(setting); - settingMap.put("key1", setting); - - expectedSettingConfiguration.setSettings(settings); - - settingRepository.update(expectedSettingConfiguration); - SettingConfiguration updatedSettingConfiguration = settingRepository.get("test_id"); - assertEquals(null, updatedSettingConfiguration); - } - - @Test - public void testFindSettingsReturnsSettingsWhenResolveParamTrueAndHasLocationHeirarchy() { - SettingSearchBean settingQueryBean = new SettingSearchBean(); - settingQueryBean.setServerVersion(0L); - settingQueryBean.setMetadataVersion(0L); - settingQueryBean.setLimit(1000); - settingQueryBean.setLocationId("44de66fb-e6c6-4bae-92bb-386dfe626eba"); - settingQueryBean.setResolveSettings(true); - LocationTree locationTree = new Gson().fromJson( - "{\"locationsHierarchy\":{\"map\":{\"02ebbc84-5e29-4cd5-9b79-c594058923e9\":{\"id\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"label\":\"Uganda\",\"node\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"tags\":[\"Country\"],\"voided\":false},\"children\":{\"8340315f-48e4-4768-a1ce-414532b4c49b\":{\"id\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"label\":\"Kampala\",\"node\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"parentLocation\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"voided\":false},\"tags\":[\"District\"],\"voided\":false},\"children\":{\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\":{\"id\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"label\":\"KCCA\",\"node\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"parentLocation\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"parentLocation\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"voided\":false},\"voided\":false},\"tags\":[\"County\"],\"voided\":false},\"children\":{\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\":{\"id\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"label\":\"Central Division\",\"node\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"parentLocation\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"parentLocation\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"voided\":false},\"voided\":false},\"tags\":[\"Sub-county\"],\"voided\":false},\"children\":{\"44de66fb-e6c6-4bae-92bb-386dfe626eba\":{\"id\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"label\":\"Bukesa Urban Health Centre\",\"node\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"parentLocation\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"voided\":false},\"voided\":false},\"tags\":[\"Health Facility\"],\"voided\":false},\"children\":{\"982eb3f3-b7e3-450f-a38e-d067f2345212\":{\"id\":\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"label\":\"Jambula Girls School\",\"node\":{\"locationId\":\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"name\":\"Jambula Girls School\",\"parentLocation\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"voided\":false},\"voided\":false},\"tags\":[\"School\"],\"voided\":false},\"parent\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"},\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\":{\"id\":\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\",\"label\":\"Nsalo Secondary School\",\"node\":{\"locationId\":\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\",\"name\":\"Nsalo Secondary School\",\"parentLocation\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"voided\":false},\"voided\":false},\"tags\":[\"School\"],\"voided\":false},\"parent\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"}},\"parent\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\"}},\"parent\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\"}},\"parent\":\"8340315f-48e4-4768-a1ce-414532b4c49b\"}},\"parent\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\"}}}},\"parentChildren\":{\"8340315f-48e4-4768-a1ce-414532b4c49b\":[\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\"],\"02ebbc84-5e29-4cd5-9b79-c594058923e9\":[\"8340315f-48e4-4768-a1ce-414532b4c49b\"],\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\":[\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\"],\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\":[\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"],\"44de66fb-e6c6-4bae-92bb-386dfe626eba\":[\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\"]}}}", - LocationTree.class); - List settings = settingRepository.findSettings(settingQueryBean, locationTree.getLocationsHierarchy()); - assertEquals(1, settings.size()); - assertEquals(1, settings.get(0).getSettings().size()); - assertEquals("Bukesa", settings.get(0).getSettings().get(0).getTeam()); - assertEquals("44de66fb-e6c6-4bae-92bb-386dfe626eba", settings.get(0).getSettings().get(0).getLocationId()); - assertEquals("settings-document-id-1", settings.get(0).getSettings().get(0).getDocumentId()); - } + List settings = settingRepository.findAllSettings(); + assertEquals(14, settings.size()); + + } + + @Test + public void testFindByEmptyServerVersion() { + + List settings = settingRepository.findByEmptyServerVersion(); + assertEquals(3, settings.size()); + + } + + @Test + public void testGetSettingById() { + Settings setting = settingRepository.getSettingById(1L); + assertNotNull(setting); + assertNotNull(setting.getJson()); + + SettingConfiguration settingConfiguration = settingRepository.get("151"); + assertNotNull(settingConfiguration); + assertEquals("global_configs1", settingConfiguration.getIdentifier()); + } + + @Test + public void testFindByCriteria() { + SettingSearchBean settingQueryBean = new SettingSearchBean(); + settingQueryBean.setServerVersion(0L); + settingQueryBean.setMetadataVersion(0L); + settingQueryBean.setLimit(1000); + + List settings = settingRepository.findSettings(settingQueryBean, null); + assertEquals(1, settings.size()); + assertEquals(3, settings.get(0).getSettings().size()); + + settingQueryBean.setTeamId("7e104eee-ec8a-4733-bcf7-c02c51cf43f4"); + settingQueryBean.setServerVersion(0L); + settings = settingRepository.findSettings(settingQueryBean, null); + + assertEquals(1, settings.size()); + + settingQueryBean = new SettingSearchBean(); + settingQueryBean.setServerVersion(0L); + settingQueryBean.setLocationId("44de66fb-e6c6-4bae-92bb-386dfe626eba"); + settings = settingRepository.findSettings(settingQueryBean, null); + + assertEquals(1, settings.size()); + + settingQueryBean = new SettingSearchBean(); + settingQueryBean.setServerVersion(0L); + settingQueryBean.setProviderId("demo"); + settings = settingRepository.findSettings(settingQueryBean, null); + + assertEquals(2, settings.size()); + + settingQueryBean = new SettingSearchBean(); + settingQueryBean.setServerVersion(0L); + settingQueryBean.setProviderId("demo"); + settingQueryBean.setTeamId("7e104eee-ec8a-4733-bcf7-c02c51cf43f4"); + settings = settingRepository.findSettings(settingQueryBean, null); + + assertEquals(1, settings.size()); + + settingQueryBean = new SettingSearchBean(); + settingQueryBean.setServerVersion(0L); + settingQueryBean.setTeam("my-team"); + settings = settingRepository.findSettings(settingQueryBean, null); + + assertEquals(5, settings.size()); + + } + + @Test + public void tesFindByCriteriaAndResolveSettings() { + SettingSearchBean settingQueryBean = new SettingSearchBean(); + settingQueryBean.setServerVersion(0L); + + List settings = settingRepository.findSettings(settingQueryBean, null); + assertEquals(1, settings.size()); + assertEquals(3, settings.get(0).getSettings().size()); + } + + @Test + public void testGetAllSettings() { + List settings = settingRepository.getAll(); + assertEquals(14, settings.size()); + + } + + @Test + public void testGetSettingMetadataByDocumentId() { + String documentId = "affc7614-a51b-4b5f-877a-ad932b38bf4b"; + SettingsMetadata settingMetadata = settingRepository.getSettingMetadataByDocumentId(documentId); + assertNotNull(settingMetadata); + assertEquals(documentId, settingMetadata.getDocumentId()); + assertEquals("lion_king_cast_2", settingMetadata.getIdentifier()); + } + + @Test + public void testAddAndUpdateShouldAddOrUpdate() { + SettingConfiguration expectedSettingConfiguration = new SettingConfiguration(); + expectedSettingConfiguration.setTeamId("test_team"); + expectedSettingConfiguration.setTeam("test_team"); + expectedSettingConfiguration.setId("test_id"); + expectedSettingConfiguration.setIdentifier("test_identifier"); + expectedSettingConfiguration.setServerVersion(0L); + + List settings = new ArrayList<>(); + Map settingMap = new HashMap<>(); + + // add + Setting setting = new Setting(); + setting.setKey("key1"); + setting.setValue("value1"); + setting.setDescription("description1"); + settings.add(setting); + settingMap.put("key1", setting); + + setting = new Setting(); + setting.setKey("key2"); + setting.setValue("value2"); + setting.setDescription("description2"); + settings.add(setting); + settingMap.put("key2", setting); + + setting = new Setting(); + setting.setKey("key3"); + setting.setValue("value3"); + setting.setDescription("description3"); + settings.add(setting); + settingMap.put("key3", setting); + + expectedSettingConfiguration.setSettings(settings); + settingRepository.addSettings(expectedSettingConfiguration); + + SettingConfiguration actualSettingConfiguration = settingRepository.get("test_id"); + assertNotNull(actualSettingConfiguration); + assertEquals(3, actualSettingConfiguration.getSettings().size()); + assertEquals(expectedSettingConfiguration.getTeam(), actualSettingConfiguration.getTeam()); + assertEquals(expectedSettingConfiguration.getId(), actualSettingConfiguration.getId()); + assertEquals(expectedSettingConfiguration.getIdentifier(), actualSettingConfiguration.getIdentifier()); + verifySettingsAreSame(settingMap, actualSettingConfiguration.getSettings()); + MatcherAssert.assertThat(actualSettingConfiguration.getServerVersion(), Matchers.greaterThan(0l)); + long serverVersion = actualSettingConfiguration.getServerVersion(); + + // update + settings.clear(); + expectedSettingConfiguration = new SettingConfiguration(); + expectedSettingConfiguration.setTeamId("test_team_40"); + expectedSettingConfiguration.setTeam("test_team"); + expectedSettingConfiguration.setId("test_id"); + expectedSettingConfiguration.setIdentifier("test_identifier_40"); + expectedSettingConfiguration.setServerVersion(0L); + + settingMap.clear(); + setting.setKey("key1"); + setting.setValue("value10"); + setting.setDescription("description10"); + settings.add(setting); + settingMap.put("key1", setting); + + setting = new Setting(); + setting.setKey("key2"); + setting.setValue("value20"); + setting.setDescription("description20"); + settings.add(setting); + settingMap.put("key2", setting); + + setting = new Setting(); + setting.setKey("key3"); + setting.setValue("value30"); + setting.setDescription("description30"); + settings.add(setting); + settingMap.put("key3", setting); + + Setting setting1 = new Setting(); + setting1.setKey("key4"); + setting1.setValue("value40"); + setting1.setDescription("description40"); + settings.add(setting1); + settingMap.put("key4", setting1); + + expectedSettingConfiguration.setSettings(settings); + + settingRepository.update(expectedSettingConfiguration); + SettingConfiguration updatedSettingConfiguration = settingRepository.get("test_id"); + assertNotNull(updatedSettingConfiguration); + assertEquals(3, actualSettingConfiguration.getSettings().size()); + assertEquals(expectedSettingConfiguration.getTeam(), updatedSettingConfiguration.getTeam()); + assertEquals(expectedSettingConfiguration.getId(), updatedSettingConfiguration.getId()); + assertEquals(expectedSettingConfiguration.getTeamId(), "test_team_40"); + assertEquals(expectedSettingConfiguration.getIdentifier(), "test_identifier_40"); + verifySettingsAreSame(settingMap, expectedSettingConfiguration.getSettings()); + MatcherAssert.assertThat(updatedSettingConfiguration.getServerVersion(), Matchers.greaterThan(serverVersion)); + + } + + @Test + public void testGetAllSettingMetadataByDocumentIdShouldGetAllMetadata() { + List settingsMetadataList = settingRepository.getAllSettingMetadataByDocumentId("151"); + assertEquals(3, settingsMetadataList.size()); + Set identifiers = new HashSet<>(); + identifiers.add("global_configs1"); + identifiers.add("global_configs12"); + identifiers.add("global_configs13"); + for (SettingsMetadata settingsMetadata : settingsMetadataList) { + assertTrue(identifiers.contains(settingsMetadata.getIdentifier())); + } + } + + @Test + public void testAddSettingShouldAddSetting() { + Setting setting = new Setting(); + setting.setDescription("description"); + setting.setLocationId("location_id"); + setting.setTeam("team"); + setting.setTeamId("team_id"); + setting.setProviderId("provider_id"); + setting.setSettingsId("document_id_32932"); + setting.setKey("key_32932"); + setting.setValue("value"); + setting.setInheritedFrom("location_id_2"); + setting.setIdentifier("setting_identifier_32932"); + setting.setServerVersion(0L); + settingRepository.addOrUpdate(setting); + + Map expectedSettings = new HashMap<>(); + expectedSettings.put("key_32932", setting); + + SettingSearchBean settingQueryBean = new SettingSearchBean(); + settingQueryBean.setServerVersion(0L); + settingQueryBean.setIdentifier("setting_identifier_32932"); + List settings = settingRepository.findSettings(settingQueryBean, null); + List actualSettings = settings.get(0).getSettings(); + assertNotNull(actualSettings); + verifySettingsAreSame(expectedSettings, actualSettings); + MatcherAssert.assertThat(settings, + Matchers.contains(Matchers.hasProperty("serverVersion", Matchers.greaterThan(0l)))); + } + + @Test + public void testAddGlobalSettingShouldAddSetting() { + Setting setting = new Setting(); + setting.setDescription("description"); + setting.setDocumentId("document_id_32932"); + setting.setKey("key_32932"); + setting.setValue("value"); + setting.setLabel("label"); + setting.setInheritedFrom("location_id_2"); + setting.setIdentifier("setting_identifier_32932"); + setting.setServerVersion(0L); + settingRepository.addOrUpdate(setting); + + Map expectedSettings = new HashMap<>(); + expectedSettings.put("key_32932", setting); + + SettingSearchBean settingQueryBean = new SettingSearchBean(); + settingQueryBean.setServerVersion(0L); + settingQueryBean.setIdentifier("setting_identifier_32932"); + List settings = settingRepository.findSettings(settingQueryBean, null); + List actualSettings = settings.get(0).getSettings(); + assertNotNull(actualSettings); + verifySettingsAreSame(expectedSettings, actualSettings); + } + + @Test + public void testSaveGlobalSettingsUsingV1endpoint() throws IOException { + String popCharacteristicsGlobal = "{\"identifier\":\"population_characteristics\",\"settings\":[{\"description\":\"The proportion of women in the adult population (18 years or older), with a BMI less than 18.5, is 20% or higher.\",\"label\":\"Undernourished prevalence 20% or higher\",\"value\":\"false\",\"key\":\"pop_undernourish\"},{\"description\":\"The proportion of pregnant women in the population with anaemia (haemoglobin level less than 11 g/dl) is 40% or higher.\",\"label\":\"Anaemia prevalence 40% or higher\",\"value\":\"false\",\"key\":\"pop_anaemia_40\"}],\"type\":\"SettingConfiguration\"}"; + String testGlobalsSaveV1 = "{\"identifier\":\"test_globals_save_v1\",\"settings\":[{\"description\":\"Is " + + "an ultrasound machine available and functional at your facility and a trained health worker available to use it?\",\"label\":\"Ultrasound available\",\"type\":\"SettingConfiguration\",\"value\":false,\"key\":\"site_ultrasound\"},{\"description\":\"Does your facility use an automated blood pressure (BP) measurement tool?\",\"label\":\"Automated BP measurement tool\",\"type\":\"SettingConfiguration\",\"value\":false,\"key\":\"site_bp_tool\"}],\"type\":\"SettingConfiguration\"}"; + FileInputStream fis = new FileInputStream("src/test/resources/settings.json"); + String largeSettingPayload = IOUtils.toString(fis, StandardCharsets.UTF_8); + + SettingTypeHandler settingTypeHandler = new SettingTypeHandler(); + SettingConfiguration popCharacteristicsSettingConfig = settingTypeHandler.mapper + .readValue(popCharacteristicsGlobal, SettingConfiguration.class); + SettingConfiguration siteCharacteristicsSettingConfig = settingTypeHandler.mapper + .readValue(testGlobalsSaveV1, SettingConfiguration.class); + SettingConfiguration largeSettingPayloadSettingConfig = settingTypeHandler.mapper + .readValue(largeSettingPayload, SettingConfiguration.class); + + popCharacteristicsSettingConfig.setServerVersion(Calendar.getInstance().getTimeInMillis()); + popCharacteristicsSettingConfig.setV1Settings(true); + + siteCharacteristicsSettingConfig.setServerVersion(Calendar.getInstance().getTimeInMillis()); + siteCharacteristicsSettingConfig.setV1Settings(true); + + largeSettingPayloadSettingConfig.setServerVersion(Calendar.getInstance().getTimeInMillis()); + largeSettingPayloadSettingConfig.setV1Settings(true); + + settingRepository.addSettings(popCharacteristicsSettingConfig); + settingRepository.addSettings(siteCharacteristicsSettingConfig); + settingRepository.addSettings(largeSettingPayloadSettingConfig); + + SettingSearchBean settingQueryBeanTwo = new SettingSearchBean(); + settingQueryBeanTwo.setServerVersion(0L); + List allGlobalSettings = settingRepository.findSettings(settingQueryBeanTwo, null); + assertEquals(3, allGlobalSettings.size()); + + String textGlobalSaveV1Update = "{\"type\":\"SettingConfiguration\",\"serverVersion\":1597999833442,\"identifier\":\"test_globals_save_v1\",\"settings\":[{\"type\":\"SettingConfiguration\",\"serverVersion\":1597999833442,\"documentId\":\"ff3efba8-cda1-4f88-a271-96afb1d4fd63\",\"key\":\"site_ultrasound\",\"value\":\"false\",\"label\":\"Ultrasound available\",\"description\":\"Is an ultrasound machine available and functional at your facility and a trained health worker available to use it?\",\"uuid\":\"e01cce9e-02cd-4443-880c-09d483597cca\",\"settingsId\":\"16\",\"settingIdentifier\":\"test_globals_save_v1\",\"settingMetadataId\":\"19\"},{\"type\":\"SettingConfiguration\",\"serverVersion\":1597999833442,\"documentId\":\"ff3efba8-cda1-4f88-a271-96afb1d4fd63\",\"key\":\"site_bp_tool\",\"value\":\"true\",\"label\":\"Automated BP measurement tool\",\"description\":\"Does your facility use an automated blood pressure (BP) measurement tool?\",\"uuid\":\"3298a9c0-57f3-41e7-ba5d-320274443db4\",\"settingsId\":\"16\",\"settingIdentifier\":\"test_globals_save_v1\",\"settingMetadataId\":\"20\"},{\"key\":\"site_bp_tool_update\",\"value\":\"true\",\"label\":\"Automated BP measurement tool\",\"description\":\"Does your facility use an automated blood pressure (BP) measurement tool?\"}],\"_rev\":\"v1\"}"; + SettingConfiguration testUpdateSettings = settingTypeHandler.mapper + .readValue(textGlobalSaveV1Update, SettingConfiguration.class); + testUpdateSettings.setServerVersion(Calendar.getInstance().getTimeInMillis()); + testUpdateSettings.setV1Settings(true); + testUpdateSettings.setId(allGlobalSettings.get(0).getId()); + + settingRepository.update(testUpdateSettings); + + SettingSearchBean settingQueryBeanThree = new SettingSearchBean(); + settingQueryBeanThree.setServerVersion(0L); + List allGlobalSettingsTwo = settingRepository.findSettings(settingQueryBeanThree, null); + assertEquals(3, allGlobalSettingsTwo.size()); + } + + private void verifySettingsAreSame(Map settingMap, List settings) { + for (Setting actualSetting : settings) { + Setting expectedSetting = settingMap.get(actualSetting.getKey()); + assertEquals(expectedSetting.getKey(), actualSetting.getKey()); + assertEquals(expectedSetting.getDescription(), actualSetting.getDescription()); + assertEquals(expectedSetting.getValue(), actualSetting.getValue()); + } + } + + @Test + public void testReformattedLocationHierarchyWithChildLocationId() throws Exception { + LocationTree locationTree = new Gson().fromJson( + "{\"locationsHierarchy\":{\"map\":{\"02ebbc84-5e29-4cd5-9b79-c594058923e9\":{\"id\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"label\":\"Uganda\",\"node\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"tags\":[\"Country\"],\"voided\":false},\"children\":{\"8340315f-48e4-4768-a1ce-414532b4c49b\":{\"id\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"label\":\"Kampala\",\"node\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"parentLocation\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"voided\":false},\"tags\":[\"District\"],\"voided\":false},\"children\":{\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\":{\"id\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"label\":\"KCCA\",\"node\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"parentLocation\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"parentLocation\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"voided\":false},\"voided\":false},\"tags\":[\"County\"],\"voided\":false},\"children\":{\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\":{\"id\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"label\":\"Central Division\",\"node\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"parentLocation\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"parentLocation\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"voided\":false},\"voided\":false},\"tags\":[\"Sub-county\"],\"voided\":false},\"children\":{\"44de66fb-e6c6-4bae-92bb-386dfe626eba\":{\"id\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"label\":\"Bukesa Urban Health Centre\",\"node\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"parentLocation\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"voided\":false},\"voided\":false},\"tags\":[\"Health Facility\"],\"voided\":false},\"children\":{\"982eb3f3-b7e3-450f-a38e-d067f2345212\":{\"id\":\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"label\":\"Jambula Girls School\",\"node\":{\"locationId\":\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"name\":\"Jambula Girls School\",\"parentLocation\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"voided\":false},\"voided\":false},\"tags\":[\"School\"],\"voided\":false},\"parent\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"},\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\":{\"id\":\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\",\"label\":\"Nsalo Secondary School\",\"node\":{\"locationId\":\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\",\"name\":\"Nsalo Secondary School\",\"parentLocation\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"voided\":false},\"voided\":false},\"tags\":[\"School\"],\"voided\":false},\"parent\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"}},\"parent\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\"}},\"parent\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\"}},\"parent\":\"8340315f-48e4-4768-a1ce-414532b4c49b\"}},\"parent\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\"}}}},\"parentChildren\":{\"8340315f-48e4-4768-a1ce-414532b4c49b\":[\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\"],\"02ebbc84-5e29-4cd5-9b79-c594058923e9\":[\"8340315f-48e4-4768-a1ce-414532b4c49b\"],\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\":[\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\"],\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\":[\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"],\"44de66fb-e6c6-4bae-92bb-386dfe626eba\":[\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\"]}}}", + LocationTree.class); + Map> treeNodeHashMap = new HashMap<>(); + if (locationTree != null) { + treeNodeHashMap = locationTree.getLocationsHierarchy(); + } + + assertNotNull(treeNodeHashMap); + SettingRepositoryImpl settingRepository = new SettingRepositoryImpl(); + + Whitebox.setInternalState(settingRepository, "locationUuid", "44de66fb-e6c6-4bae-92bb-386dfe626eba"); + Whitebox.invokeMethod(settingRepository, "reformattedLocationHierarchy", treeNodeHashMap); + List reformattedLocationHierarchy = settingRepository.getReformattedLocationHierarchy(); + assertNotNull(reformattedLocationHierarchy); + assertEquals(5, reformattedLocationHierarchy.size()); + } + + @Test + public void testReformattedLocationHierarchyWithParentLocationId() throws Exception { + LocationTree locationTree = new Gson().fromJson( + "{\"locationsHierarchy\":{\"map\":{\"02ebbc84-5e29-4cd5-9b79-c594058923e9\":{\"id\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"label\":\"Uganda\",\"node\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"tags\":[\"Country\"],\"voided\":false},\"children\":{\"8340315f-48e4-4768-a1ce-414532b4c49b\":{\"id\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"label\":\"Kampala\",\"node\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"parentLocation\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"voided\":false},\"tags\":[\"District\"],\"voided\":false},\"children\":{\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\":{\"id\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"label\":\"KCCA\",\"node\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"parentLocation\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"parentLocation\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"voided\":false},\"voided\":false},\"tags\":[\"County\"],\"voided\":false},\"children\":{\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\":{\"id\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"label\":\"Central Division\",\"node\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"parentLocation\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"parentLocation\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"voided\":false},\"voided\":false},\"tags\":[\"Sub-county\"],\"voided\":false},\"children\":{\"44de66fb-e6c6-4bae-92bb-386dfe626eba\":{\"id\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"label\":\"Bukesa Urban Health Centre\",\"node\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"parentLocation\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"voided\":false},\"voided\":false},\"tags\":[\"Health Facility\"],\"voided\":false},\"children\":{\"982eb3f3-b7e3-450f-a38e-d067f2345212\":{\"id\":\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"label\":\"Jambula Girls School\",\"node\":{\"locationId\":\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"name\":\"Jambula Girls School\",\"parentLocation\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"voided\":false},\"voided\":false},\"tags\":[\"School\"],\"voided\":false},\"parent\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"},\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\":{\"id\":\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\",\"label\":\"Nsalo Secondary School\",\"node\":{\"locationId\":\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\",\"name\":\"Nsalo Secondary School\",\"parentLocation\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"voided\":false},\"voided\":false},\"tags\":[\"School\"],\"voided\":false},\"parent\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"}},\"parent\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\"}},\"parent\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\"}},\"parent\":\"8340315f-48e4-4768-a1ce-414532b4c49b\"}},\"parent\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\"}}}},\"parentChildren\":{\"8340315f-48e4-4768-a1ce-414532b4c49b\":[\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\"],\"02ebbc84-5e29-4cd5-9b79-c594058923e9\":[\"8340315f-48e4-4768-a1ce-414532b4c49b\"],\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\":[\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\"],\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\":[\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"],\"44de66fb-e6c6-4bae-92bb-386dfe626eba\":[\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\"]}}}", + LocationTree.class); + Map> treeNodeHashMap = new HashMap<>(); + if (locationTree != null) { + treeNodeHashMap = locationTree.getLocationsHierarchy(); + } + + assertNotNull(treeNodeHashMap); + SettingRepositoryImpl settingRepository = new SettingRepositoryImpl(); + + Whitebox.setInternalState(settingRepository, "locationUuid", "02ebbc84-5e29-4cd5-9b79-c594058923e9"); + Whitebox.invokeMethod(settingRepository, "reformattedLocationHierarchy", treeNodeHashMap); + List reformattedLocationHierarchy = settingRepository.getReformattedLocationHierarchy(); + assertNotNull(reformattedLocationHierarchy); + assertEquals(1, reformattedLocationHierarchy.size()); + } + + @Test + public void testUpdateWithNewSettings() { + SettingConfiguration settingConfiguration = new SettingConfiguration(); + settingConfiguration.setTeamId("test_team"); + settingConfiguration.setTeam("test_team"); + settingConfiguration.setId("test_id"); + settingConfiguration.setIdentifier("test_identifier"); + settingConfiguration.setServerVersion(0L); + + List settings = new ArrayList<>(); + Map settingMap = new HashMap<>(); + Setting setting = new Setting(); + setting.setKey("key1"); + setting.setValue("value1"); + setting.setDescription("description1"); + settings.add(setting); + settingMap.put("key1", setting); + + settingConfiguration.setSettings(settings); + settingRepository.addSettings(settingConfiguration); + + SettingConfiguration actualSettingConfiguration = settingRepository.get("test_id"); + assertNotNull(actualSettingConfiguration); + assertEquals(1, actualSettingConfiguration.getSettings().size()); + settings.clear(); + settingMap.clear(); + settings = actualSettingConfiguration.getSettings(); + setting = settings.get(0); + setting.setValue("changedvalue10"); + settings.add(setting); + settingMap.put("key1", setting); + + setting = new Setting(); + setting.setKey("key2"); + setting.setValue("value20"); + setting.setDescription("description20"); + settings.add(setting); + settingMap.put("key2", setting); + + actualSettingConfiguration.setSettings(settings); + + settingRepository.update(actualSettingConfiguration); + SettingConfiguration updatedSettingConfiguration = settingRepository.get("test_id"); + assertNotNull(updatedSettingConfiguration); + assertEquals(2, updatedSettingConfiguration.getSettings().size()); + assertEquals("test_team", updatedSettingConfiguration.getTeam()); + assertEquals("test_id", updatedSettingConfiguration.getId()); + verifySettingsAreSame(settingMap, updatedSettingConfiguration.getSettings()); + + } + + + @Test + public void testUpdateShouldDeleteBlankValueRecords() { + SettingConfiguration expectedSettingConfiguration = new SettingConfiguration(); + expectedSettingConfiguration.setTeamId("test_team"); + expectedSettingConfiguration.setTeam("test_team"); + expectedSettingConfiguration.setId("test_id"); + expectedSettingConfiguration.setIdentifier("test_identifier"); + expectedSettingConfiguration.setServerVersion(0L); + + List settings = new ArrayList<>(); + Map settingMap = new HashMap<>(); + + // add + Setting setting = new Setting(); + setting.setKey("key1"); + setting.setValue("value1"); + setting.setDescription("description1"); + settings.add(setting); + settingMap.put("key1", setting); + + setting = new Setting(); + setting.setKey("key2"); + setting.setValue(""); + setting.setDescription("description2"); + settings.add(setting); + settingMap.put("key2", setting); + + expectedSettingConfiguration.setSettings(settings); + settingRepository.addSettings(expectedSettingConfiguration); + + SettingConfiguration actualSettingConfiguration = settingRepository.get("test_id"); + assertNotNull(actualSettingConfiguration); + assertEquals(1, actualSettingConfiguration.getSettings().size()); + + // update + settings.clear(); + expectedSettingConfiguration = new SettingConfiguration(); + expectedSettingConfiguration.setTeamId("test_team"); + expectedSettingConfiguration.setTeam("test_team"); + expectedSettingConfiguration.setId("test_id"); + expectedSettingConfiguration.setIdentifier("test_identifier"); + expectedSettingConfiguration.setServerVersion(0L); + + settingMap.clear(); + setting.setKey("key1"); + setting.setValue(""); + setting.setDescription("description10"); + settings.add(setting); + settingMap.put("key1", setting); + + expectedSettingConfiguration.setSettings(settings); + + settingRepository.update(expectedSettingConfiguration); + SettingConfiguration updatedSettingConfiguration = settingRepository.get("test_id"); + assertEquals(null, updatedSettingConfiguration); + } + + @Test + public void testFindSettingsReturnsSettingsWhenResolveParamTrueAndHasLocationHeirarchy() { + SettingSearchBean settingQueryBean = new SettingSearchBean(); + settingQueryBean.setServerVersion(0L); + settingQueryBean.setMetadataVersion(0L); + settingQueryBean.setLimit(1000); + settingQueryBean.setLocationId("44de66fb-e6c6-4bae-92bb-386dfe626eba"); + settingQueryBean.setResolveSettings(true); + LocationTree locationTree = new Gson().fromJson( + "{\"locationsHierarchy\":{\"map\":{\"02ebbc84-5e29-4cd5-9b79-c594058923e9\":{\"id\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"label\":\"Uganda\",\"node\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"tags\":[\"Country\"],\"voided\":false},\"children\":{\"8340315f-48e4-4768-a1ce-414532b4c49b\":{\"id\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"label\":\"Kampala\",\"node\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"parentLocation\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"voided\":false},\"tags\":[\"District\"],\"voided\":false},\"children\":{\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\":{\"id\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"label\":\"KCCA\",\"node\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"parentLocation\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"parentLocation\":{\"locationId\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\",\"name\":\"Uganda\",\"voided\":false},\"voided\":false},\"tags\":[\"County\"],\"voided\":false},\"children\":{\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\":{\"id\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"label\":\"Central Division\",\"node\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"parentLocation\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"parentLocation\":{\"locationId\":\"8340315f-48e4-4768-a1ce-414532b4c49b\",\"name\":\"Kampala\",\"voided\":false},\"voided\":false},\"tags\":[\"Sub-county\"],\"voided\":false},\"children\":{\"44de66fb-e6c6-4bae-92bb-386dfe626eba\":{\"id\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"label\":\"Bukesa Urban Health Centre\",\"node\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"parentLocation\":{\"locationId\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\",\"name\":\"KCCA\",\"voided\":false},\"voided\":false},\"tags\":[\"Health Facility\"],\"voided\":false},\"children\":{\"982eb3f3-b7e3-450f-a38e-d067f2345212\":{\"id\":\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"label\":\"Jambula Girls School\",\"node\":{\"locationId\":\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"name\":\"Jambula Girls School\",\"parentLocation\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"voided\":false},\"voided\":false},\"tags\":[\"School\"],\"voided\":false},\"parent\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"},\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\":{\"id\":\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\",\"label\":\"Nsalo Secondary School\",\"node\":{\"locationId\":\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\",\"name\":\"Nsalo Secondary School\",\"parentLocation\":{\"locationId\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\",\"name\":\"Bukesa Urban Health Centre\",\"parentLocation\":{\"locationId\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\",\"name\":\"Central Division\",\"voided\":false},\"voided\":false},\"tags\":[\"School\"],\"voided\":false},\"parent\":\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"}},\"parent\":\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\"}},\"parent\":\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\"}},\"parent\":\"8340315f-48e4-4768-a1ce-414532b4c49b\"}},\"parent\":\"02ebbc84-5e29-4cd5-9b79-c594058923e9\"}}}},\"parentChildren\":{\"8340315f-48e4-4768-a1ce-414532b4c49b\":[\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\"],\"02ebbc84-5e29-4cd5-9b79-c594058923e9\":[\"8340315f-48e4-4768-a1ce-414532b4c49b\"],\"b1ef8a0b-275b-43fc-a580-1e21ceb34c78\":[\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\"],\"4e188e6d-2ffb-4b25-85f9-b9fbf5010d40\":[\"44de66fb-e6c6-4bae-92bb-386dfe626eba\"],\"44de66fb-e6c6-4bae-92bb-386dfe626eba\":[\"982eb3f3-b7e3-450f-a38e-d067f2345212\",\"ee08a6e0-3f73-4c28-b186-64d5cd06f4ce\"]}}}", + LocationTree.class); + List settings = settingRepository.findSettings(settingQueryBean, locationTree.getLocationsHierarchy()); + assertEquals(1, settings.size()); + assertEquals(1, settings.get(0).getSettings().size()); + assertEquals("Bukesa", settings.get(0).getSettings().get(0).getTeam()); + assertEquals("44de66fb-e6c6-4bae-92bb-386dfe626eba", settings.get(0).getSettings().get(0).getLocationId()); + assertEquals("settings-document-id-1", settings.get(0).getSettings().get(0).getDocumentId()); + } } diff --git a/src/test/java/org/opensrp/repository/postgres/StocksRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/StocksRepositoryTest.java index ccf87a9a0..c9b919bd2 100755 --- a/src/test/java/org/opensrp/repository/postgres/StocksRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/StocksRepositoryTest.java @@ -22,294 +22,294 @@ import org.springframework.beans.factory.annotation.Qualifier; public class StocksRepositoryTest extends BaseRepositoryTest { - - @Autowired - @Qualifier("stocksRepositoryPostgres") - private StocksRepository stocksRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("location.sql"); - scripts.add("structure.sql"); - scripts.add("location_tag.sql"); - scripts.add("stock.sql"); - scripts.add("product_catalogue.sql"); - return scripts; - } - - @Test - public void testGet() { - Stock stock = stocksRepository.get("05934ae338431f28bf6793b241978ad9"); - assertEquals("5", stock.getIdentifier()); - assertEquals(20, stock.getValue()); - assertEquals("1", stock.getVaccineTypeId()); - assertEquals(1521009418783l, stock.getServerVersion().longValue()); - assertNull(stocksRepository.get("07271855-4018-497a-b180-6af")); - } - - @Test - public void testAdd() { - Stock stock = new Stock("521", "VC1", "received", "tester1", 31, 1521499800000l, "VCC1", 1521536143239l, - 1521536179443l); - stocksRepository.add(stock); - assertEquals(16, stocksRepository.getAll().size()); - - List stocks = stocksRepository.findAllByIdentifier("vaccine_type", "VC1"); - - assertEquals(1, stocks.size()); - assertEquals("tester1", stocks.get(0).getProviderid()); - assertEquals(31, stock.getValue()); - assertEquals("VC1", stock.getVaccineTypeId()); - MatcherAssert.assertThat(stocks, Matchers.contains(Matchers.hasProperty("serverVersion",Matchers.greaterThan(0l)))); - } - - @Test - public void testUpdate() { - Stock stock = stocksRepository.get("05934ae338431f28bf6793b241b2daa6"); - long now = System.currentTimeMillis(); - stock.setDateUpdated(now); - stock.setValue(23); - long serverVersion=stock.getServerVersion(); - stocksRepository.update(stock); - - Stock updatedStock = stocksRepository.get("05934ae338431f28bf6793b241b2daa6"); - assertEquals(now, updatedStock.getDateUpdated().longValue()); - assertEquals(23, stock.getValue()); - MatcherAssert.assertThat(updatedStock.getServerVersion(), Matchers.greaterThan(serverVersion)); - - } - - @Test - public void testGetAll() { - assertEquals(15, stocksRepository.getAll().size()); - stocksRepository.safeRemove(stocksRepository.get("05934ae338431f28bf6793b241b2daa6")); - List stocks = stocksRepository.getAll(); - assertEquals(14, stocks.size()); - for (Stock stock : stocks) - assertNotEquals("05934ae338431f28bf6793b241b2daa6", stock.getId()); - - } - - @Test - public void testSafeRemove() { - stocksRepository.safeRemove(stocksRepository.get("05934ae338431f28bf6793b2419a606f")); - List stocks = stocksRepository.getAll(); - assertEquals(14, stocks.size()); - for (Stock stock : stocks) - assertNotEquals("05934ae338431f28bf6793b2419a606f", stock.getId()); - - assertNull(stocksRepository.get("05934ae338431f28bf6793b2419a606f")); - } - - @Test - public void testFindAllByProviderid() { - assertEquals(12, stocksRepository.findAllByProviderid("biddemo").size()); - - List stocks = stocksRepository.findAllByProviderid("biddemo1"); - assertEquals(3, stocks.size()); - for (Stock stock : stocks) - assertEquals("biddemo1", stock.getProviderid()); - - assertTrue(stocksRepository.findAllByProviderid("biddemo2").isEmpty()); - } - - @Test - public void testFindAllByIdentifier() { - assertEquals(11, stocksRepository.findAllByIdentifier("vaccine_type", "1").size()); - - List stocks = stocksRepository.findAllByIdentifier("vaccine_type", "2"); - assertEquals(4, stocks.size()); - for (Stock stock : stocks) - assertEquals("2", stock.getVaccineTypeId()); - - assertTrue(stocksRepository.findAllByIdentifier("vaccine_type", "19").isEmpty()); - } - - @Test - public void testFindById() { - Stock stock = stocksRepository.findById("05934ae338431f28bf6793b241b2df09"); - assertEquals("12", stock.getIdentifier()); - assertEquals(-2, stock.getValue()); - assertEquals("1", stock.getVaccineTypeId()); - assertEquals("Physical_recount", stock.getToFrom()); - assertEquals("loss_adjustment", stock.getTransactionType()); - assertNull(stocksRepository.findById("07271855-4018-497a-b180-6af")); - } - - @Test - public void testFindStocksWithOrder() { - StockSearchBean searchBean = new StockSearchBean(); - List locations = new ArrayList<>(); - searchBean.setStockTypeId("1"); - searchBean.setLocations(locations); - List stocks = stocksRepository.findStocks(searchBean, BaseEntity.SERVER_VERSIOIN, "asc",0, 5); - assertEquals(5, stocks.size()); - long previousVersion = 0; - for (Stock stock : stocks) { - assertEquals("1", stock.getVaccineTypeId()); - assertTrue(stock.getServerVersion() >= previousVersion); - previousVersion = stock.getServerVersion(); - } - - } - - @Test - public void testFindStocksStockbeanOnly() { - StockSearchBean searchBean = new StockSearchBean(); - - searchBean.setIdentifier("10"); - List stocks = stocksRepository.findStocks(searchBean); - assertEquals(1, stocks.size()); - - assertEquals(-19, stocks.get(0).getValue()); - assertEquals("2", stocks.get(0).getVaccineTypeId()); - assertEquals("C/C", stocks.get(0).getToFrom()); - assertEquals("issued", stocks.get(0).getTransactionType()); - - searchBean = new StockSearchBean(); - searchBean.setStockTypeId("1"); - assertEquals(11, stocksRepository.findStocks(searchBean).size()); - - searchBean.setTransactionType("issued"); - searchBean.setProviderId("biddemo"); - assertEquals(3, stocksRepository.findStocks(searchBean).size()); - - searchBean = new StockSearchBean(); - searchBean.setValue("10"); - assertEquals(2, stocksRepository.findStocks(searchBean).size()); - - searchBean.setValue("2"); - stocks = stocksRepository.findStocks(searchBean); - assertEquals(1, stocks.size()); - assertEquals("14", stocks.get(0).getIdentifier()); - assertEquals("1", stocks.get(0).getVaccineTypeId()); - assertEquals("DHO", stocks.get(0).getToFrom()); - assertEquals("received", stocks.get(0).getTransactionType()); - - searchBean = new StockSearchBean(); - searchBean.setDateCreated("1518559200000"); - assertEquals(4, stocksRepository.findStocks(searchBean).size()); - - searchBean.setToFrom("DHO"); - assertEquals(2, stocksRepository.findStocks(searchBean).size()); - - searchBean.setDateUpdated("1521007053945"); - stocks = stocksRepository.findStocks(searchBean); - assertEquals(1, stocks.size()); - assertEquals("2", stocks.get(0).getIdentifier()); - assertEquals("1", stocks.get(0).getVaccineTypeId()); - assertEquals("DHO", stocks.get(0).getToFrom()); - assertEquals("received", stocks.get(0).getTransactionType()); - - searchBean = new StockSearchBean(); - searchBean.setServerVersion(1521009418783l); - assertEquals(11, stocksRepository.findStocks(searchBean).size()); - - searchBean.setServerVersion(1521023046990l); - assertEquals(8, stocksRepository.findStocks(searchBean).size()); - - } - - @Test - public void testFindAllStocks() { - assertEquals(15, stocksRepository.findAllStocks(null,null).size()); - stocksRepository.safeRemove(stocksRepository.get("05934ae338431f28bf6793b241b2df09")); - List stocks = stocksRepository.findAllStocks(0l,null); - assertEquals(14, stocks.size()); - for (Stock stock : stocks) - assertNotEquals("05934ae338431f28bf6793b241b2df09", stock.getId()); - } - - @Test - public void testFindInventoryItemsInAJurisdiction() { + + @Autowired + @Qualifier("stocksRepositoryPostgres") + private StocksRepository stocksRepository; + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("location.sql"); + scripts.add("structure.sql"); + scripts.add("location_tag.sql"); + scripts.add("stock.sql"); + scripts.add("product_catalogue.sql"); + return scripts; + } + + @Test + public void testGet() { + Stock stock = stocksRepository.get("05934ae338431f28bf6793b241978ad9"); + assertEquals("5", stock.getIdentifier()); + assertEquals(20, stock.getValue()); + assertEquals("1", stock.getVaccineTypeId()); + assertEquals(1521009418783l, stock.getServerVersion().longValue()); + assertNull(stocksRepository.get("07271855-4018-497a-b180-6af")); + } + + @Test + public void testAdd() { + Stock stock = new Stock("521", "VC1", "received", "tester1", 31, 1521499800000l, "VCC1", 1521536143239l, + 1521536179443l); + stocksRepository.add(stock); + assertEquals(16, stocksRepository.getAll().size()); + + List stocks = stocksRepository.findAllByIdentifier("vaccine_type", "VC1"); + + assertEquals(1, stocks.size()); + assertEquals("tester1", stocks.get(0).getProviderid()); + assertEquals(31, stock.getValue()); + assertEquals("VC1", stock.getVaccineTypeId()); + MatcherAssert.assertThat(stocks, Matchers.contains(Matchers.hasProperty("serverVersion", Matchers.greaterThan(0l)))); + } + + @Test + public void testUpdate() { + Stock stock = stocksRepository.get("05934ae338431f28bf6793b241b2daa6"); + long now = System.currentTimeMillis(); + stock.setDateUpdated(now); + stock.setValue(23); + long serverVersion = stock.getServerVersion(); + stocksRepository.update(stock); + + Stock updatedStock = stocksRepository.get("05934ae338431f28bf6793b241b2daa6"); + assertEquals(now, updatedStock.getDateUpdated().longValue()); + assertEquals(23, stock.getValue()); + MatcherAssert.assertThat(updatedStock.getServerVersion(), Matchers.greaterThan(serverVersion)); + + } + + @Test + public void testGetAll() { + assertEquals(15, stocksRepository.getAll().size()); + stocksRepository.safeRemove(stocksRepository.get("05934ae338431f28bf6793b241b2daa6")); + List stocks = stocksRepository.getAll(); + assertEquals(14, stocks.size()); + for (Stock stock : stocks) + assertNotEquals("05934ae338431f28bf6793b241b2daa6", stock.getId()); + + } + + @Test + public void testSafeRemove() { + stocksRepository.safeRemove(stocksRepository.get("05934ae338431f28bf6793b2419a606f")); + List stocks = stocksRepository.getAll(); + assertEquals(14, stocks.size()); + for (Stock stock : stocks) + assertNotEquals("05934ae338431f28bf6793b2419a606f", stock.getId()); + + assertNull(stocksRepository.get("05934ae338431f28bf6793b2419a606f")); + } + + @Test + public void testFindAllByProviderid() { + assertEquals(12, stocksRepository.findAllByProviderid("biddemo").size()); + + List stocks = stocksRepository.findAllByProviderid("biddemo1"); + assertEquals(3, stocks.size()); + for (Stock stock : stocks) + assertEquals("biddemo1", stock.getProviderid()); + + assertTrue(stocksRepository.findAllByProviderid("biddemo2").isEmpty()); + } + + @Test + public void testFindAllByIdentifier() { + assertEquals(11, stocksRepository.findAllByIdentifier("vaccine_type", "1").size()); + + List stocks = stocksRepository.findAllByIdentifier("vaccine_type", "2"); + assertEquals(4, stocks.size()); + for (Stock stock : stocks) + assertEquals("2", stock.getVaccineTypeId()); + + assertTrue(stocksRepository.findAllByIdentifier("vaccine_type", "19").isEmpty()); + } + + @Test + public void testFindById() { + Stock stock = stocksRepository.findById("05934ae338431f28bf6793b241b2df09"); + assertEquals("12", stock.getIdentifier()); + assertEquals(-2, stock.getValue()); + assertEquals("1", stock.getVaccineTypeId()); + assertEquals("Physical_recount", stock.getToFrom()); + assertEquals("loss_adjustment", stock.getTransactionType()); + assertNull(stocksRepository.findById("07271855-4018-497a-b180-6af")); + } + + @Test + public void testFindStocksWithOrder() { + StockSearchBean searchBean = new StockSearchBean(); + List locations = new ArrayList<>(); + searchBean.setStockTypeId("1"); + searchBean.setLocations(locations); + List stocks = stocksRepository.findStocks(searchBean, BaseEntity.SERVER_VERSIOIN, "asc", 0, 5); + assertEquals(5, stocks.size()); + long previousVersion = 0; + for (Stock stock : stocks) { + assertEquals("1", stock.getVaccineTypeId()); + assertTrue(stock.getServerVersion() >= previousVersion); + previousVersion = stock.getServerVersion(); + } + + } + + @Test + public void testFindStocksStockbeanOnly() { + StockSearchBean searchBean = new StockSearchBean(); + + searchBean.setIdentifier("10"); + List stocks = stocksRepository.findStocks(searchBean); + assertEquals(1, stocks.size()); + + assertEquals(-19, stocks.get(0).getValue()); + assertEquals("2", stocks.get(0).getVaccineTypeId()); + assertEquals("C/C", stocks.get(0).getToFrom()); + assertEquals("issued", stocks.get(0).getTransactionType()); + + searchBean = new StockSearchBean(); + searchBean.setStockTypeId("1"); + assertEquals(11, stocksRepository.findStocks(searchBean).size()); + + searchBean.setTransactionType("issued"); + searchBean.setProviderId("biddemo"); + assertEquals(3, stocksRepository.findStocks(searchBean).size()); + + searchBean = new StockSearchBean(); + searchBean.setValue("10"); + assertEquals(2, stocksRepository.findStocks(searchBean).size()); + + searchBean.setValue("2"); + stocks = stocksRepository.findStocks(searchBean); + assertEquals(1, stocks.size()); + assertEquals("14", stocks.get(0).getIdentifier()); + assertEquals("1", stocks.get(0).getVaccineTypeId()); + assertEquals("DHO", stocks.get(0).getToFrom()); + assertEquals("received", stocks.get(0).getTransactionType()); + + searchBean = new StockSearchBean(); + searchBean.setDateCreated("1518559200000"); + assertEquals(4, stocksRepository.findStocks(searchBean).size()); + + searchBean.setToFrom("DHO"); + assertEquals(2, stocksRepository.findStocks(searchBean).size()); + + searchBean.setDateUpdated("1521007053945"); + stocks = stocksRepository.findStocks(searchBean); + assertEquals(1, stocks.size()); + assertEquals("2", stocks.get(0).getIdentifier()); + assertEquals("1", stocks.get(0).getVaccineTypeId()); + assertEquals("DHO", stocks.get(0).getToFrom()); + assertEquals("received", stocks.get(0).getTransactionType()); + + searchBean = new StockSearchBean(); + searchBean.setServerVersion(1521009418783l); + assertEquals(11, stocksRepository.findStocks(searchBean).size()); + + searchBean.setServerVersion(1521023046990l); + assertEquals(8, stocksRepository.findStocks(searchBean).size()); + + } + + @Test + public void testFindAllStocks() { + assertEquals(15, stocksRepository.findAllStocks(null, null).size()); + stocksRepository.safeRemove(stocksRepository.get("05934ae338431f28bf6793b241b2df09")); + List stocks = stocksRepository.findAllStocks(0l, null); + assertEquals(14, stocks.size()); + for (Stock stock : stocks) + assertNotEquals("05934ae338431f28bf6793b241b2df09", stock.getId()); + } + + @Test + public void testFindInventoryItemsInAJurisdiction() { Stock stock = createInventoryStockObject("90397"); stocksRepository.add(stock); - List bundles = stocksRepository.findInventoryItemsInAJurisdiction("3734"); - assertEquals(1,bundles.size()); - assertEquals(2, bundles.get(0).getEntry().size()); - } - - @Test - public void testFindInventoryItemsInAJurisdictionWithNoServicePoint() { - Stock stock = createInventoryStockObject("90397"); - stocksRepository.add(stock); - List bundles = stocksRepository.findInventoryItemsInAJurisdiction("3730"); - assertEquals(0,bundles.size()); - } - - @Test - public void testFindInventoryInAServicePoint() { - Stock stock = createInventoryStockObject("90397"); - stocksRepository.add(stock); - List bundles = stocksRepository.findInventoryInAServicePoint("90397"); - assertEquals(1,bundles.size()); - assertEquals(2, bundles.get(0).getEntry().size()); - } - - @Test - public void testGetInventoryWithProductDetails() { - Stock stock = createInventoryStockObject("3734"); - stocksRepository.add(stock); - List locations = new ArrayList<>(); - locations.add("3734"); - List inventoryItems = stocksRepository.getInventoryWithProductDetails(locations); - assertEquals(1,inventoryItems.size()); - } - - @Test - public void testGetInventoryWithProductDetailsByStockId() { - Stock stock = createInventoryStockObject("3734"); - stocksRepository.add(stock); - List locations = new ArrayList<>(); - locations.add("3734"); - StockSearchBean stockSearchBean = new StockSearchBean(); - stockSearchBean.setLocations(locations); - List stocks = stocksRepository.findStocksByLocationId(stockSearchBean); - List inventoryItems = stocksRepository.getInventoryWithProductDetailsByStockId(stocks.get(0).getId()); - assertEquals(1,inventoryItems.size()); - } - - @Test - public void testFindStocksWithProductDetails() { - Stock stock = createInventoryStockObject("3734"); - stocksRepository.add(stock); - StockSearchBean searchBean = new StockSearchBean(); - searchBean.setReturnProduct(true); - List locations = new ArrayList<>(); - locations.add("3734"); - searchBean.setLocations(locations); - List stocks = stocksRepository.findStocks(searchBean, BaseEntity.SERVER_VERSIOIN, "asc",0, 5); - assertEquals(1, stocks.size()); - assertEquals("1",stocks.get(0).getIdentifier()); - assertNotNull(stocks.get(0).getProduct()); - assertEquals(new Long(1), stocks.get(0).getProduct().getUniqueId()); - assertEquals("Midwifery Kit", stocks.get(0).getProduct().getProductName()); - - } - - - @Test - public void testGetStockById() { - Stock stock = createInventoryStockObject("3734"); - stocksRepository.add(stock); - List locations = new ArrayList<>(); - locations.add("3734"); - StockSearchBean stockSearchBean = new StockSearchBean(); - stockSearchBean.setLocations(locations); - List stocks = stocksRepository.findStocksByLocationId(stockSearchBean); - List bundles = stocksRepository.getStockById(stocks.get(0).getId()); - assertEquals(1,bundles.size()); - assertEquals(2, bundles.get(0).getEntry().size()); - } - - private Stock createInventoryStockObject(String locationId) { - Stock stock = new Stock(); - stock.setIdentifier("1"); - stock.setTransactionType("Inventory"); - stock.setLocationId(locationId); - Date accountabilityEndDate = new Date(2025,11,12); - stock.setAccountabilityEndDate(accountabilityEndDate); - return stock; - } + List bundles = stocksRepository.findInventoryItemsInAJurisdiction("3734"); + assertEquals(1, bundles.size()); + assertEquals(2, bundles.get(0).getEntry().size()); + } + + @Test + public void testFindInventoryItemsInAJurisdictionWithNoServicePoint() { + Stock stock = createInventoryStockObject("90397"); + stocksRepository.add(stock); + List bundles = stocksRepository.findInventoryItemsInAJurisdiction("3730"); + assertEquals(0, bundles.size()); + } + + @Test + public void testFindInventoryInAServicePoint() { + Stock stock = createInventoryStockObject("90397"); + stocksRepository.add(stock); + List bundles = stocksRepository.findInventoryInAServicePoint("90397"); + assertEquals(1, bundles.size()); + assertEquals(2, bundles.get(0).getEntry().size()); + } + + @Test + public void testGetInventoryWithProductDetails() { + Stock stock = createInventoryStockObject("3734"); + stocksRepository.add(stock); + List locations = new ArrayList<>(); + locations.add("3734"); + List inventoryItems = stocksRepository.getInventoryWithProductDetails(locations); + assertEquals(1, inventoryItems.size()); + } + + @Test + public void testGetInventoryWithProductDetailsByStockId() { + Stock stock = createInventoryStockObject("3734"); + stocksRepository.add(stock); + List locations = new ArrayList<>(); + locations.add("3734"); + StockSearchBean stockSearchBean = new StockSearchBean(); + stockSearchBean.setLocations(locations); + List stocks = stocksRepository.findStocksByLocationId(stockSearchBean); + List inventoryItems = stocksRepository.getInventoryWithProductDetailsByStockId(stocks.get(0).getId()); + assertEquals(1, inventoryItems.size()); + } + + @Test + public void testFindStocksWithProductDetails() { + Stock stock = createInventoryStockObject("3734"); + stocksRepository.add(stock); + StockSearchBean searchBean = new StockSearchBean(); + searchBean.setReturnProduct(true); + List locations = new ArrayList<>(); + locations.add("3734"); + searchBean.setLocations(locations); + List stocks = stocksRepository.findStocks(searchBean, BaseEntity.SERVER_VERSIOIN, "asc", 0, 5); + assertEquals(1, stocks.size()); + assertEquals("1", stocks.get(0).getIdentifier()); + assertNotNull(stocks.get(0).getProduct()); + assertEquals(new Long(1), stocks.get(0).getProduct().getUniqueId()); + assertEquals("Midwifery Kit", stocks.get(0).getProduct().getProductName()); + + } + + + @Test + public void testGetStockById() { + Stock stock = createInventoryStockObject("3734"); + stocksRepository.add(stock); + List locations = new ArrayList<>(); + locations.add("3734"); + StockSearchBean stockSearchBean = new StockSearchBean(); + stockSearchBean.setLocations(locations); + List stocks = stocksRepository.findStocksByLocationId(stockSearchBean); + List bundles = stocksRepository.getStockById(stocks.get(0).getId()); + assertEquals(1, bundles.size()); + assertEquals(2, bundles.get(0).getEntry().size()); + } + + private Stock createInventoryStockObject(String locationId) { + Stock stock = new Stock(); + stock.setIdentifier("1"); + stock.setTransactionType("Inventory"); + stock.setLocationId(locationId); + Date accountabilityEndDate = new Date(2025, 11, 12); + stock.setAccountabilityEndDate(accountabilityEndDate); + return stock; + } } diff --git a/src/test/java/org/opensrp/repository/postgres/TaskRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/TaskRepositoryTest.java index b16e4f81e..5f097c23a 100644 --- a/src/test/java/org/opensrp/repository/postgres/TaskRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/TaskRepositoryTest.java @@ -25,421 +25,421 @@ import org.springframework.beans.factory.annotation.Autowired; public class TaskRepositoryTest extends BaseRepositoryTest { - - private String dateFormat = "yyyy-MM-dd'T'HHmm"; - - @Autowired - private TaskRepository taskRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("task.sql"); - return scripts; - } - - @Test - public void testGet() { - Task task = taskRepository.get("tsk11231jh22"); - assertEquals("tsk11231jh22", task.getIdentifier()); - assertEquals("2018_IRS-3734", task.getGroupIdentifier()); - assertEquals(TaskStatus.READY, task.getStatus()); - assertEquals("Not Visited", task.getBusinessStatus()); - assertEquals(TaskPriority.ROUTINE, task.getPriority()); - assertEquals("IRS", task.getCode()); - assertEquals("Spray House", task.getDescription()); - assertEquals("IRS Visit", task.getFocus()); - assertEquals("location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fc", task.getForEntity()); - assertEquals("2018-11-10T2200", task.getExecutionPeriod().getStart().toString(dateFormat)); - assertNull(task.getExecutionPeriod().getEnd()); - assertEquals("2018-10-31T0700", task.getAuthoredOn().toString(dateFormat)); - assertEquals("2018-11-12T1550", task.getLastModified().toString(dateFormat)); - assertEquals("demouser", task.getOwner()); - assertEquals(1, task.getNotes().size()); - assertEquals("demouser", task.getNotes().get(0).getAuthorString()); - assertEquals("2018-01-01T0800", task.getNotes().get(0).getTime().toString(dateFormat)); - assertEquals("This should be assigned to patrick.", task.getNotes().get(0).getText()); - } - - @Test - public void testGetWithNoIdentifier() { - - Task task = taskRepository.get(""); - assertNull(task); - - } - - @Test - public void testSafeRemove() { - assertEquals(2, taskRepository.getAll().size()); - Task task = taskRepository.get("iyr-998njoo"); - taskRepository.safeRemove(task); - - assertEquals(1, taskRepository.getAll().size()); - assertNull(taskRepository.get("iyr-998njoo")); - } - - @Test - public void testSafeRemoveNonExistentTask() { - taskRepository.safeRemove(null); - taskRepository.safeRemove(new Task()); - assertEquals(2, taskRepository.getAll().size()); - - taskRepository.safeRemove(taskRepository.get("iyr-998njoo")); - assertEquals(1, taskRepository.getAll().size()); - - taskRepository.safeRemove(taskRepository.get("iyr-998njoo")); - assertEquals(1, taskRepository.getAll().size()); - - } - - @Test - public void testAdd() { - Task task = new Task(); - task.setIdentifier("tsk-2332-j"); - task.setPlanIdentifier("2018-IRS-S4"); - task.setGroupIdentifier("7633hk-dsadsa"); - task.setDescription("Visit Mwangala household"); - task.setBusinessStatus("Not Visited"); - task.setStatus(TaskStatus.READY); - task.setOwner("worker12"); - task.setPriority(TaskPriority.URGENT); - taskRepository.add(task); - - assertEquals(3, taskRepository.getAll().size()); - Task addedTask = taskRepository.get("tsk-2332-j"); - assertNotNull(addedTask); - assertEquals("2018-IRS-S4", addedTask.getPlanIdentifier()); - assertEquals("7633hk-dsadsa", addedTask.getGroupIdentifier()); - assertEquals("Not Visited", addedTask.getBusinessStatus()); - assertEquals(TaskStatus.READY, addedTask.getStatus()); - assertEquals("worker12", addedTask.getOwner()); - assertEquals(TaskPriority.URGENT, addedTask.getPriority()); - MatcherAssert.assertThat(addedTask.getServerVersion(), Matchers.greaterThan(5l)); - - } - - @Test - public void testAddInvalidObject() { - assertEquals(2, taskRepository.getAll().size()); - Task task = new Task(); - taskRepository.add(task); - assertEquals(2, taskRepository.getAll().size()); - - taskRepository.add(null); - assertEquals(2, taskRepository.getAll().size()); - - } - - @Test - public void testAddExistingObject() { - assertEquals(2, taskRepository.getAll().size()); - Task task = taskRepository.get("iyr-998njoo"); - taskRepository.add(task); - assertEquals(2, taskRepository.getAll().size()); - - } - - @Test - public void testEdit() { - Task task = taskRepository.get("iyr-998njoo"); - task.setStatus(TaskStatus.FAILED); - task.setBusinessStatus("Non Residential"); - DateTime now = new DateTime(); - task.setLastModified(now); - long serverVersion = task.getServerVersion(); - taskRepository.update(task); - - Task updatedTask = taskRepository.get("iyr-998njoo"); - assertNotNull(updatedTask); - assertEquals("Non Residential", updatedTask.getBusinessStatus()); - assertEquals(TaskStatus.FAILED, updatedTask.getStatus()); - assertEquals(now, updatedTask.getLastModified()); - MatcherAssert.assertThat(updatedTask.getServerVersion(), Matchers.greaterThan(serverVersion)); - } - - @Test - public void testEditInvalidObject() { - assertEquals(2, taskRepository.getAll().size()); - Task task = new Task(); - taskRepository.update(task); - assertEquals(2, taskRepository.getAll().size()); - - taskRepository.update(null); - assertEquals(2, taskRepository.getAll().size()); - - } - - @Test(expected = IllegalStateException.class) - public void testEditNonExistingObject() { - Task task = taskRepository.get("iyr-998njoo"); - - taskRepository.safeRemove(task); - - taskRepository.update(task); - - } - - @Test - public void testGetTasksByPlanAndGroup() { - List tasks = taskRepository.getTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 0); - assertEquals(1, tasks.size()); - assertEquals("tsk11231jh22", tasks.get(0).getIdentifier()); - - Task task = new Task(); - task.setIdentifier("tsk-2332-j"); - task.setPlanIdentifier("IRS_2018_S1"); - task.setGroupIdentifier("2018_IRS-3734"); - task.setBusinessStatus("Not Visited"); - task.setStatus(TaskStatus.DRAFT); - task.setServerVersion(System.currentTimeMillis()); - taskRepository.add(task); - - assertEquals(2, taskRepository.getTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 0).size()); - - assertTrue(taskRepository.getTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS", 0).isEmpty()); - - assertTrue(taskRepository.getTasksByPlanAndGroup("IRS_201", "2018_IRS-3734", 0).isEmpty()); - - assertTrue( - taskRepository.getTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", System.currentTimeMillis()).isEmpty()); - - } - - @Test - public void testGetTasksByServerVersion() { - List tasks = taskRepository.findByEmptyServerVersion(); - assertTrue(tasks.isEmpty()); - - Task task = taskRepository.get("iyr-998njoo"); - task.setServerVersion(0l); - taskRepository.update(task); - - tasks = taskRepository.findByEmptyServerVersion(); - assertEquals(0, tasks.size()); - - } - - @Test - public void testFindAllIdsShouldOrderByServerVersion() { - Pair, Long> idsModel = taskRepository.findAllIds(0l, 10); - List taskIdentifiers = idsModel.getLeft(); - assertEquals(2, taskIdentifiers.size()); - assertEquals("tsk11231jh22", taskIdentifiers.get(0)); - assertEquals("iyr-998njoo", taskIdentifiers.get(1)); - assertEquals(1542031602680l, idsModel.getRight().longValue()); - } - - @Test - public void testFindAllIdsShouldLimitByGivenParam() { - Pair, Long> idsModel = taskRepository.findAllIds(0l, 1); - List taskIdentifiers = idsModel.getLeft(); - assertEquals(1, taskIdentifiers.size()); - assertEquals("tsk11231jh22", taskIdentifiers.get(0)); - assertEquals(1542027762554l, idsModel.getRight().longValue()); - } - - @Test - public void testFindAllIdsShouldFilterBetweenFromAndToDate() { - String date1 = "2020-09-25T10:00:00+0300"; - String date3 = "2020-09-27T10:00:00+0300"; - Pair, Long> idsModel = taskRepository.findAllIds(0l, 2, new DateTime(date1, DateTimeZone.UTC).toDate(), - new DateTime(date3, DateTimeZone.UTC).toDate()); - assertEquals(2, idsModel.getLeft().size()); - } - - @Test - public void testFindAllIdsShouldFilterFromDateAsMinimumDate() { - String date2 = "2020-09-26T10:00:00+0300"; - Pair, Long> idsModel = taskRepository.findAllIds(0l, 2, new DateTime(date2, DateTimeZone.UTC).toDate(), - null); - assertEquals(1, idsModel.getLeft().size()); - } - - @Test - public void testFindAllIdsShouldFilterFromToDateAsMaximumDate() { - String date1 = "2020-09-27T10:00:00+0300"; - Pair, Long> idsModel = taskRepository.findAllIds(0l, 2, null, - new DateTime(date1, DateTimeZone.UTC).toDate()); - assertEquals(2, idsModel.getLeft().size()); - } - - @Test - public void testGetTasksByOwnerAndPlan() { - List tasks = taskRepository.getTasksByPlanAndOwner("IRS_2018_S1", "demouser", 0); - assertEquals(1, tasks.size()); - assertEquals("tsk11231jh22", tasks.get(0).getIdentifier()); - - Task task = new Task(); - task.setIdentifier("tsk-2332-j"); - task.setPlanIdentifier("IRS_2018_S1"); - task.setGroupIdentifier("2018_IRS-3734"); - task.setBusinessStatus("Not Visited"); - task.setStatus(TaskStatus.DRAFT); - task.setOwner("demouser"); - task.setServerVersion(System.currentTimeMillis()); - taskRepository.add(task); - - assertEquals(2, taskRepository.getTasksByPlanAndOwner("IRS_2018_S1", "demouser", 0).size()); - - assertTrue(taskRepository.getTasksByPlanAndOwner("IRS_2018_S", "demouser", 0).isEmpty()); - - assertTrue(taskRepository.getTasksByPlanAndOwner("IRS_2018_S1", "demouser1", 0).isEmpty()); - - assertTrue(taskRepository.getTasksByPlanAndOwner("IRS_2018_S1", "demouser", System.currentTimeMillis()).isEmpty()); - } - - @Test - public void testCountTasksByPlanAndGroup() { - Long tasks = taskRepository.countTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 0); - assertEquals(1l, tasks.longValue()); - - Task task = new Task(); - task.setIdentifier("tsk-2332-j"); - task.setPlanIdentifier("IRS_2018_S1"); - task.setGroupIdentifier("2018_IRS-3734"); - task.setBusinessStatus("Not Visited"); - task.setStatus(TaskStatus.DRAFT); - task.setServerVersion(System.currentTimeMillis()); - taskRepository.add(task); - - assertEquals(2, taskRepository.countTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 0).longValue()); - - } - - @Test - public void countGetTasksByOwnerAndPlan() { - Long tasks = taskRepository.countTasksByPlanAndOwner("IRS_2018_S1", "demouser", 0); - assertEquals(1, tasks.longValue()); - - Task task = new Task(); - task.setIdentifier("tsk-2332-j"); - task.setPlanIdentifier("IRS_2018_S1"); - task.setGroupIdentifier("2018_IRS-3734"); - task.setBusinessStatus("Not Visited"); - task.setStatus(TaskStatus.DRAFT); - task.setOwner("demouser"); - task.setServerVersion(System.currentTimeMillis()); - taskRepository.add(task); - - assertEquals(2, taskRepository.countTasksByPlanAndOwner("IRS_2018_S1", "demouser", 0).longValue()); - - } - - @Test - public void testSaveTask() { - Task task = new Task(); - task.setIdentifier("tsk-2332-k"); - task.setPlanIdentifier("2018-IRS-S4"); - task.setGroupIdentifier("7633hk-dsadsa"); - task.setDescription("Visit Mwangala household"); - task.setBusinessStatus("Not Visited"); - task.setStatus(TaskStatus.READY); - task.setPriority(TaskPriority.STAT); - task.setOwner("testUser"); - task.setRequester("testUser"); - taskRepository.add(task); - - assertEquals(3, taskRepository.getAll().size()); - Task addedTask = taskRepository.get("tsk-2332-k"); - assertNotNull(addedTask); - assertEquals("2018-IRS-S4", addedTask.getPlanIdentifier()); - assertEquals("7633hk-dsadsa", addedTask.getGroupIdentifier()); - assertEquals("Visit Mwangala household", addedTask.getDescription()); - assertEquals("Not Visited", addedTask.getBusinessStatus()); - assertEquals(TaskStatus.READY, addedTask.getStatus()); - assertEquals("testUser", addedTask.getOwner()); - assertEquals("testUser", addedTask.getRequester()); - assertEquals(TaskPriority.STAT, addedTask.getPriority()); - } - - @Test - public void testCheckIfTaskExists() { - Task task = new Task(); - task.setIdentifier("tsk-2332-kl"); - task.setPlanIdentifier("test-plan-id-1"); - task.setForEntity("location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fd"); - task.setCode("test-code"); - task.setGroupIdentifier("group-1"); - task.setStatus(TaskStatus.READY); - taskRepository.add(task); - boolean taskExists = taskRepository.checkIfTaskExists("location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fd", - "group-1", "test-plan-id-1", "test-code"); - assertTrue(taskExists); - } - - @Test - public void testCheckIfTaskExistsReturnsFalse() { - Task task = new Task(); - task.setIdentifier("tsk-2332-km"); - task.setPlanIdentifier("test-plan-id-2"); - task.setForEntity("location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fe"); - task.setCode("test-code-2"); - task.setGroupIdentifier("group-1"); - task.setStatus(TaskStatus.ARCHIVED); - taskRepository.add(task); - boolean taskExists = taskRepository.checkIfTaskExists("location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fe", - "group-1", "test-plan-id-2", "test-code-2"); - assertFalse(taskExists); - } - - @Test - public void testCountAllTasksShouldReturnCorrectValue() { - Long count = taskRepository.countAllTasks(1000l); - assertEquals(Long.valueOf(2), count); - } - - @Test - public void testGetTasksBySearchBean() { - TaskSearchBean taskSearchBean = new TaskSearchBean(); - taskSearchBean.setPlanIdentifier("IRS_2018_S1"); - List groupIdentifiers = new ArrayList<>(); - groupIdentifiers.add("2018_IRS-3734"); - taskSearchBean.setGroupIdentifiers(groupIdentifiers); - taskSearchBean.setCode("IRS"); - taskSearchBean.setStatus("Ready"); - taskSearchBean.setBusinessStatus("Not Visited"); - - List tasks = taskRepository.getTasksBySearchBean(taskSearchBean); - assertEquals(1, tasks.size()); - } - - @Test - public void testGetTaskCount() { - TaskSearchBean taskSearchBean = new TaskSearchBean(); - taskSearchBean.setPlanIdentifier("IRS_2018_S1"); - List groupIdentifiers = new ArrayList<>(); - groupIdentifiers.add("2018_IRS-3734"); - taskSearchBean.setGroupIdentifiers(groupIdentifiers); - taskSearchBean.setCode("IRS"); - taskSearchBean.setStatus("Ready"); - taskSearchBean.setBusinessStatus("Not Visited"); - - int count = taskRepository.getTaskCount(taskSearchBean); - assertEquals(1, count); - } - - @Test - public void testFindTasksByJurisdictionWhenGivenJurisdictionIdAndPlanIdShouldReturnTasksOnlyInJurisdictionAndPlan() { - - List tasks = taskRepository.findTasksByJurisdiction("2018_IRS-3734","IRS_2018_S1"); - assertEquals(1, tasks.size()); - assertEquals("tsk11231jh22", tasks.get(0).getId()); - - tasks = taskRepository.findTasksByJurisdiction("2018_IRS-3734","IRS_2018_S11"); - assertEquals(0, tasks.size()); - } - - @Test - public void testFindTasksByJurisdictionWhenGivenJurisdictionIdShouldReturnAllTasks() { - - List tasks = taskRepository.findTasksByJurisdiction("2018_IRS-3734"); - assertEquals(2, tasks.size()); - assertEquals("tsk11231jh22", tasks.get(0).getId()); - assertEquals("iyr-998njoo", tasks.get(1).getId()); - - tasks = taskRepository.findTasksByJurisdiction("2018_IRS-37"); - assertEquals(0, tasks.size()); - } - + + private String dateFormat = "yyyy-MM-dd'T'HHmm"; + + @Autowired + private TaskRepository taskRepository; + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("task.sql"); + return scripts; + } + + @Test + public void testGet() { + Task task = taskRepository.get("tsk11231jh22"); + assertEquals("tsk11231jh22", task.getIdentifier()); + assertEquals("2018_IRS-3734", task.getGroupIdentifier()); + assertEquals(TaskStatus.READY, task.getStatus()); + assertEquals("Not Visited", task.getBusinessStatus()); + assertEquals(TaskPriority.ROUTINE, task.getPriority()); + assertEquals("IRS", task.getCode()); + assertEquals("Spray House", task.getDescription()); + assertEquals("IRS Visit", task.getFocus()); + assertEquals("location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fc", task.getForEntity()); + assertEquals("2018-11-10T2200", task.getExecutionPeriod().getStart().toString(dateFormat)); + assertNull(task.getExecutionPeriod().getEnd()); + assertEquals("2018-10-31T0700", task.getAuthoredOn().toString(dateFormat)); + assertEquals("2018-11-12T1550", task.getLastModified().toString(dateFormat)); + assertEquals("demouser", task.getOwner()); + assertEquals(1, task.getNotes().size()); + assertEquals("demouser", task.getNotes().get(0).getAuthorString()); + assertEquals("2018-01-01T0800", task.getNotes().get(0).getTime().toString(dateFormat)); + assertEquals("This should be assigned to patrick.", task.getNotes().get(0).getText()); + } + + @Test + public void testGetWithNoIdentifier() { + + Task task = taskRepository.get(""); + assertNull(task); + + } + + @Test + public void testSafeRemove() { + assertEquals(2, taskRepository.getAll().size()); + Task task = taskRepository.get("iyr-998njoo"); + taskRepository.safeRemove(task); + + assertEquals(1, taskRepository.getAll().size()); + assertNull(taskRepository.get("iyr-998njoo")); + } + + @Test + public void testSafeRemoveNonExistentTask() { + taskRepository.safeRemove(null); + taskRepository.safeRemove(new Task()); + assertEquals(2, taskRepository.getAll().size()); + + taskRepository.safeRemove(taskRepository.get("iyr-998njoo")); + assertEquals(1, taskRepository.getAll().size()); + + taskRepository.safeRemove(taskRepository.get("iyr-998njoo")); + assertEquals(1, taskRepository.getAll().size()); + + } + + @Test + public void testAdd() { + Task task = new Task(); + task.setIdentifier("tsk-2332-j"); + task.setPlanIdentifier("2018-IRS-S4"); + task.setGroupIdentifier("7633hk-dsadsa"); + task.setDescription("Visit Mwangala household"); + task.setBusinessStatus("Not Visited"); + task.setStatus(TaskStatus.READY); + task.setOwner("worker12"); + task.setPriority(TaskPriority.URGENT); + taskRepository.add(task); + + assertEquals(3, taskRepository.getAll().size()); + Task addedTask = taskRepository.get("tsk-2332-j"); + assertNotNull(addedTask); + assertEquals("2018-IRS-S4", addedTask.getPlanIdentifier()); + assertEquals("7633hk-dsadsa", addedTask.getGroupIdentifier()); + assertEquals("Not Visited", addedTask.getBusinessStatus()); + assertEquals(TaskStatus.READY, addedTask.getStatus()); + assertEquals("worker12", addedTask.getOwner()); + assertEquals(TaskPriority.URGENT, addedTask.getPriority()); + MatcherAssert.assertThat(addedTask.getServerVersion(), Matchers.greaterThan(5l)); + + } + + @Test + public void testAddInvalidObject() { + assertEquals(2, taskRepository.getAll().size()); + Task task = new Task(); + taskRepository.add(task); + assertEquals(2, taskRepository.getAll().size()); + + taskRepository.add(null); + assertEquals(2, taskRepository.getAll().size()); + + } + + @Test + public void testAddExistingObject() { + assertEquals(2, taskRepository.getAll().size()); + Task task = taskRepository.get("iyr-998njoo"); + taskRepository.add(task); + assertEquals(2, taskRepository.getAll().size()); + + } + + @Test + public void testEdit() { + Task task = taskRepository.get("iyr-998njoo"); + task.setStatus(TaskStatus.FAILED); + task.setBusinessStatus("Non Residential"); + DateTime now = new DateTime(); + task.setLastModified(now); + long serverVersion = task.getServerVersion(); + taskRepository.update(task); + + Task updatedTask = taskRepository.get("iyr-998njoo"); + assertNotNull(updatedTask); + assertEquals("Non Residential", updatedTask.getBusinessStatus()); + assertEquals(TaskStatus.FAILED, updatedTask.getStatus()); + assertEquals(now, updatedTask.getLastModified()); + MatcherAssert.assertThat(updatedTask.getServerVersion(), Matchers.greaterThan(serverVersion)); + } + + @Test + public void testEditInvalidObject() { + assertEquals(2, taskRepository.getAll().size()); + Task task = new Task(); + taskRepository.update(task); + assertEquals(2, taskRepository.getAll().size()); + + taskRepository.update(null); + assertEquals(2, taskRepository.getAll().size()); + + } + + @Test(expected = IllegalStateException.class) + public void testEditNonExistingObject() { + Task task = taskRepository.get("iyr-998njoo"); + + taskRepository.safeRemove(task); + + taskRepository.update(task); + + } + + @Test + public void testGetTasksByPlanAndGroup() { + List tasks = taskRepository.getTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 0); + assertEquals(1, tasks.size()); + assertEquals("tsk11231jh22", tasks.get(0).getIdentifier()); + + Task task = new Task(); + task.setIdentifier("tsk-2332-j"); + task.setPlanIdentifier("IRS_2018_S1"); + task.setGroupIdentifier("2018_IRS-3734"); + task.setBusinessStatus("Not Visited"); + task.setStatus(TaskStatus.DRAFT); + task.setServerVersion(System.currentTimeMillis()); + taskRepository.add(task); + + assertEquals(2, taskRepository.getTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 0).size()); + + assertTrue(taskRepository.getTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS", 0).isEmpty()); + + assertTrue(taskRepository.getTasksByPlanAndGroup("IRS_201", "2018_IRS-3734", 0).isEmpty()); + + assertTrue( + taskRepository.getTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", System.currentTimeMillis()).isEmpty()); + + } + + @Test + public void testGetTasksByServerVersion() { + List tasks = taskRepository.findByEmptyServerVersion(); + assertTrue(tasks.isEmpty()); + + Task task = taskRepository.get("iyr-998njoo"); + task.setServerVersion(0l); + taskRepository.update(task); + + tasks = taskRepository.findByEmptyServerVersion(); + assertEquals(0, tasks.size()); + + } + + @Test + public void testFindAllIdsShouldOrderByServerVersion() { + Pair, Long> idsModel = taskRepository.findAllIds(0l, 10); + List taskIdentifiers = idsModel.getLeft(); + assertEquals(2, taskIdentifiers.size()); + assertEquals("tsk11231jh22", taskIdentifiers.get(0)); + assertEquals("iyr-998njoo", taskIdentifiers.get(1)); + assertEquals(1542031602680l, idsModel.getRight().longValue()); + } + + @Test + public void testFindAllIdsShouldLimitByGivenParam() { + Pair, Long> idsModel = taskRepository.findAllIds(0l, 1); + List taskIdentifiers = idsModel.getLeft(); + assertEquals(1, taskIdentifiers.size()); + assertEquals("tsk11231jh22", taskIdentifiers.get(0)); + assertEquals(1542027762554l, idsModel.getRight().longValue()); + } + + @Test + public void testFindAllIdsShouldFilterBetweenFromAndToDate() { + String date1 = "2020-09-25T10:00:00+0300"; + String date3 = "2020-09-27T10:00:00+0300"; + Pair, Long> idsModel = taskRepository.findAllIds(0l, 2, new DateTime(date1, DateTimeZone.UTC).toDate(), + new DateTime(date3, DateTimeZone.UTC).toDate()); + assertEquals(2, idsModel.getLeft().size()); + } + + @Test + public void testFindAllIdsShouldFilterFromDateAsMinimumDate() { + String date2 = "2020-09-26T10:00:00+0300"; + Pair, Long> idsModel = taskRepository.findAllIds(0l, 2, new DateTime(date2, DateTimeZone.UTC).toDate(), + null); + assertEquals(1, idsModel.getLeft().size()); + } + + @Test + public void testFindAllIdsShouldFilterFromToDateAsMaximumDate() { + String date1 = "2020-09-27T10:00:00+0300"; + Pair, Long> idsModel = taskRepository.findAllIds(0l, 2, null, + new DateTime(date1, DateTimeZone.UTC).toDate()); + assertEquals(2, idsModel.getLeft().size()); + } + + @Test + public void testGetTasksByOwnerAndPlan() { + List tasks = taskRepository.getTasksByPlanAndOwner("IRS_2018_S1", "demouser", 0); + assertEquals(1, tasks.size()); + assertEquals("tsk11231jh22", tasks.get(0).getIdentifier()); + + Task task = new Task(); + task.setIdentifier("tsk-2332-j"); + task.setPlanIdentifier("IRS_2018_S1"); + task.setGroupIdentifier("2018_IRS-3734"); + task.setBusinessStatus("Not Visited"); + task.setStatus(TaskStatus.DRAFT); + task.setOwner("demouser"); + task.setServerVersion(System.currentTimeMillis()); + taskRepository.add(task); + + assertEquals(2, taskRepository.getTasksByPlanAndOwner("IRS_2018_S1", "demouser", 0).size()); + + assertTrue(taskRepository.getTasksByPlanAndOwner("IRS_2018_S", "demouser", 0).isEmpty()); + + assertTrue(taskRepository.getTasksByPlanAndOwner("IRS_2018_S1", "demouser1", 0).isEmpty()); + + assertTrue(taskRepository.getTasksByPlanAndOwner("IRS_2018_S1", "demouser", System.currentTimeMillis()).isEmpty()); + } + + @Test + public void testCountTasksByPlanAndGroup() { + Long tasks = taskRepository.countTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 0); + assertEquals(1l, tasks.longValue()); + + Task task = new Task(); + task.setIdentifier("tsk-2332-j"); + task.setPlanIdentifier("IRS_2018_S1"); + task.setGroupIdentifier("2018_IRS-3734"); + task.setBusinessStatus("Not Visited"); + task.setStatus(TaskStatus.DRAFT); + task.setServerVersion(System.currentTimeMillis()); + taskRepository.add(task); + + assertEquals(2, taskRepository.countTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 0).longValue()); + + } + + @Test + public void countGetTasksByOwnerAndPlan() { + Long tasks = taskRepository.countTasksByPlanAndOwner("IRS_2018_S1", "demouser", 0); + assertEquals(1, tasks.longValue()); + + Task task = new Task(); + task.setIdentifier("tsk-2332-j"); + task.setPlanIdentifier("IRS_2018_S1"); + task.setGroupIdentifier("2018_IRS-3734"); + task.setBusinessStatus("Not Visited"); + task.setStatus(TaskStatus.DRAFT); + task.setOwner("demouser"); + task.setServerVersion(System.currentTimeMillis()); + taskRepository.add(task); + + assertEquals(2, taskRepository.countTasksByPlanAndOwner("IRS_2018_S1", "demouser", 0).longValue()); + + } + + @Test + public void testSaveTask() { + Task task = new Task(); + task.setIdentifier("tsk-2332-k"); + task.setPlanIdentifier("2018-IRS-S4"); + task.setGroupIdentifier("7633hk-dsadsa"); + task.setDescription("Visit Mwangala household"); + task.setBusinessStatus("Not Visited"); + task.setStatus(TaskStatus.READY); + task.setPriority(TaskPriority.STAT); + task.setOwner("testUser"); + task.setRequester("testUser"); + taskRepository.add(task); + + assertEquals(3, taskRepository.getAll().size()); + Task addedTask = taskRepository.get("tsk-2332-k"); + assertNotNull(addedTask); + assertEquals("2018-IRS-S4", addedTask.getPlanIdentifier()); + assertEquals("7633hk-dsadsa", addedTask.getGroupIdentifier()); + assertEquals("Visit Mwangala household", addedTask.getDescription()); + assertEquals("Not Visited", addedTask.getBusinessStatus()); + assertEquals(TaskStatus.READY, addedTask.getStatus()); + assertEquals("testUser", addedTask.getOwner()); + assertEquals("testUser", addedTask.getRequester()); + assertEquals(TaskPriority.STAT, addedTask.getPriority()); + } + + @Test + public void testCheckIfTaskExists() { + Task task = new Task(); + task.setIdentifier("tsk-2332-kl"); + task.setPlanIdentifier("test-plan-id-1"); + task.setForEntity("location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fd"); + task.setCode("test-code"); + task.setGroupIdentifier("group-1"); + task.setStatus(TaskStatus.READY); + taskRepository.add(task); + boolean taskExists = taskRepository.checkIfTaskExists("location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fd", + "group-1", "test-plan-id-1", "test-code"); + assertTrue(taskExists); + } + + @Test + public void testCheckIfTaskExistsReturnsFalse() { + Task task = new Task(); + task.setIdentifier("tsk-2332-km"); + task.setPlanIdentifier("test-plan-id-2"); + task.setForEntity("location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fe"); + task.setCode("test-code-2"); + task.setGroupIdentifier("group-1"); + task.setStatus(TaskStatus.ARCHIVED); + taskRepository.add(task); + boolean taskExists = taskRepository.checkIfTaskExists("location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fe", + "group-1", "test-plan-id-2", "test-code-2"); + assertFalse(taskExists); + } + + @Test + public void testCountAllTasksShouldReturnCorrectValue() { + Long count = taskRepository.countAllTasks(1000l); + assertEquals(Long.valueOf(2), count); + } + + @Test + public void testGetTasksBySearchBean() { + TaskSearchBean taskSearchBean = new TaskSearchBean(); + taskSearchBean.setPlanIdentifier("IRS_2018_S1"); + List groupIdentifiers = new ArrayList<>(); + groupIdentifiers.add("2018_IRS-3734"); + taskSearchBean.setGroupIdentifiers(groupIdentifiers); + taskSearchBean.setCode("IRS"); + taskSearchBean.setStatus("Ready"); + taskSearchBean.setBusinessStatus("Not Visited"); + + List tasks = taskRepository.getTasksBySearchBean(taskSearchBean); + assertEquals(1, tasks.size()); + } + + @Test + public void testGetTaskCount() { + TaskSearchBean taskSearchBean = new TaskSearchBean(); + taskSearchBean.setPlanIdentifier("IRS_2018_S1"); + List groupIdentifiers = new ArrayList<>(); + groupIdentifiers.add("2018_IRS-3734"); + taskSearchBean.setGroupIdentifiers(groupIdentifiers); + taskSearchBean.setCode("IRS"); + taskSearchBean.setStatus("Ready"); + taskSearchBean.setBusinessStatus("Not Visited"); + + int count = taskRepository.getTaskCount(taskSearchBean); + assertEquals(1, count); + } + + @Test + public void testFindTasksByJurisdictionWhenGivenJurisdictionIdAndPlanIdShouldReturnTasksOnlyInJurisdictionAndPlan() { + + List tasks = taskRepository.findTasksByJurisdiction("2018_IRS-3734", "IRS_2018_S1"); + assertEquals(1, tasks.size()); + assertEquals("tsk11231jh22", tasks.get(0).getId()); + + tasks = taskRepository.findTasksByJurisdiction("2018_IRS-3734", "IRS_2018_S11"); + assertEquals(0, tasks.size()); + } + + @Test + public void testFindTasksByJurisdictionWhenGivenJurisdictionIdShouldReturnAllTasks() { + + List tasks = taskRepository.findTasksByJurisdiction("2018_IRS-3734"); + assertEquals(2, tasks.size()); + assertEquals("tsk11231jh22", tasks.get(0).getId()); + assertEquals("iyr-998njoo", tasks.get(1).getId()); + + tasks = taskRepository.findTasksByJurisdiction("2018_IRS-37"); + assertEquals(0, tasks.size()); + } + } diff --git a/src/test/java/org/opensrp/repository/postgres/UniqueIdRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/UniqueIdRepositoryTest.java index 537211e08..a487e57c3 100644 --- a/src/test/java/org/opensrp/repository/postgres/UniqueIdRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/UniqueIdRepositoryTest.java @@ -4,42 +4,43 @@ import org.springframework.beans.factory.annotation.Autowired; import org.opensrp.repository.UniqueIdRepository; import org.opensrp.domain.UniqueId; + import static org.junit.Assert.assertEquals; import java.util.HashSet; import java.util.Set; -public class UniqueIdRepositoryTest extends BaseRepositoryTest{ - - @Autowired - private UniqueIdRepository uniqueIdRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("unique_id.sql"); - return scripts; - } - - @Test - public void testFindByIdentifierSourceOrderByIdDesc() { - UniqueId uniqueId = uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(1l); - assertEquals(2l,(long)uniqueId.getId()); - } - - @Test - public void testFindReservedIdentifiers() { - Set reservedIdentifiers = uniqueIdRepository.findReservedIdentifiers(); - assertEquals(1,reservedIdentifiers.size()); - } - - @Test(expected = Test.None.class) - public void testUpdate() { - UniqueId uniqueId = new UniqueId(); - uniqueId.setId(2l); - uniqueId.setOpenmrsId(""); - uniqueId.setIdentifier("AAAA-1"); - uniqueId.setReserved(Boolean.TRUE); - uniqueIdRepository.update(uniqueId); - } +public class UniqueIdRepositoryTest extends BaseRepositoryTest { + + @Autowired + private UniqueIdRepository uniqueIdRepository; + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("unique_id.sql"); + return scripts; + } + + @Test + public void testFindByIdentifierSourceOrderByIdDesc() { + UniqueId uniqueId = uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(1l); + assertEquals(2l, (long) uniqueId.getId()); + } + + @Test + public void testFindReservedIdentifiers() { + Set reservedIdentifiers = uniqueIdRepository.findReservedIdentifiers(); + assertEquals(1, reservedIdentifiers.size()); + } + + @Test(expected = Test.None.class) + public void testUpdate() { + UniqueId uniqueId = new UniqueId(); + uniqueId.setId(2l); + uniqueId.setOpenmrsId(""); + uniqueId.setIdentifier("AAAA-1"); + uniqueId.setReserved(Boolean.TRUE); + uniqueIdRepository.update(uniqueId); + } } diff --git a/src/test/java/org/opensrp/repository/postgres/ViewConfigurationRepositoryTest.java b/src/test/java/org/opensrp/repository/postgres/ViewConfigurationRepositoryTest.java index ab196d453..0a39d57c9 100644 --- a/src/test/java/org/opensrp/repository/postgres/ViewConfigurationRepositoryTest.java +++ b/src/test/java/org/opensrp/repository/postgres/ViewConfigurationRepositoryTest.java @@ -22,145 +22,145 @@ import org.springframework.beans.factory.annotation.Qualifier; public class ViewConfigurationRepositoryTest extends BaseRepositoryTest { - - @Autowired - @Qualifier("viewConfigurationRepositoryPostgres") - private ViewConfigurationRepository viewConfigurationRepository; - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet<>(); - scripts.add("view_configuration.sql"); - return scripts; - } - - @Test - public void testGet() { - ViewConfiguration view = viewConfigurationRepository.get("19a2e8aa6739d77a2b780199c6122867"); - assertEquals("main", view.getIdentifier()); - assertEquals(1516890951253l, view.getServerVersion().longValue()); - - assertNull(viewConfigurationRepository.get("19a2e8aa6739d22867")); - - } - - @Test - public void testAdd() { + + @Autowired + @Qualifier("viewConfigurationRepositoryPostgres") + private ViewConfigurationRepository viewConfigurationRepository; + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet<>(); + scripts.add("view_configuration.sql"); + return scripts; + } + + @Test + public void testGet() { + ViewConfiguration view = viewConfigurationRepository.get("19a2e8aa6739d77a2b780199c6122867"); + assertEquals("main", view.getIdentifier()); + assertEquals(1516890951253l, view.getServerVersion().longValue()); + + assertNull(viewConfigurationRepository.get("19a2e8aa6739d22867")); + + } + + @Test + public void testAdd() { // long now = System.currentTimeMillis(); - long lastSyncedVersion = 1517890951252l; - ViewConfiguration viewConfiguration = new ViewConfiguration(); - viewConfiguration.setIdentifier("help"); - View view = new View(); - view.setIdentifier("faq"); - view.setLabel("FAQ"); - view.setVisible(true); - view.setOrientation("vertical"); - viewConfiguration.setViews(new ArrayList()); - viewConfiguration.getViews().add(view); - viewConfiguration.setServerVersion(1518890951252l); - - viewConfigurationRepository.add(viewConfiguration); - - assertEquals(6, viewConfigurationRepository.getAll().size()); - - List savedViews = viewConfigurationRepository.findViewConfigurationsByVersion(lastSyncedVersion); - assertEquals(1, savedViews.size()); - assertEquals(1, savedViews.get(0).getViews().size()); - assertEquals("faq", savedViews.get(0).getViews().get(0).getIdentifier()); - MatcherAssert.assertThat(savedViews,Matchers.contains(Matchers.hasProperty("serverVersion",Matchers.greaterThan(0l)))); - } - - @Test - public void testUpdate() { - ViewConfiguration view = viewConfigurationRepository.get("92141b17040021a7ce326194ff0029f7"); - LoginConfiguration configuration = (LoginConfiguration) view.getMetadata(); - configuration.setShowPasswordCheckbox(false); - configuration.setLanguage("fr_cn"); - configuration.setLogoUrl("http://localhost:98778/test.jpg"); - view.setMetadata(configuration); - long serverVersion=view.getServerVersion(); - viewConfigurationRepository.update(view); - - - ViewConfiguration updatedView =viewConfigurationRepository - .get("92141b17040021a7ce326194ff0029f7"); - LoginConfiguration updatedConfiguration = (LoginConfiguration) updatedView.getMetadata(); - assertEquals("fr_cn", updatedConfiguration.getLanguage()); - assertEquals("http://localhost:98778/test.jpg", updatedConfiguration.getLogoUrl()); - assertFalse(updatedConfiguration.getShowPasswordCheckbox()); - MatcherAssert.assertThat(updatedView.getServerVersion(), Matchers.greaterThan(serverVersion)); - - } - - @Test - public void testGetAll() { - assertEquals(5, viewConfigurationRepository.getAll().size()); - - viewConfigurationRepository.safeRemove(viewConfigurationRepository.get("3a065d7c3354eb2bc23c8a3bc303ef62")); - - assertEquals(4, viewConfigurationRepository.getAll().size()); - } - - @Test - public void testSafeRemove() { - - ViewConfiguration view = viewConfigurationRepository.get("3a065d7c3354eb2bc23c8a3bc303ef62"); - viewConfigurationRepository.safeRemove(view); - - assertNull(viewConfigurationRepository.get(view.getId())); - - List views = viewConfigurationRepository.getAll(); - for (ViewConfiguration v : views) { - assertNotEquals(view.getId(), v.getId()); - assertNotEquals(view.getIdentifier(), v.getIdentifier()); - } - } - - @Test - public void testFindAllViewConfigurations() { - assertEquals(5, viewConfigurationRepository.getAll().size()); - - ViewConfiguration viewConfiguration = new ViewConfiguration(); - viewConfiguration.setIdentifier("bmi"); - - viewConfigurationRepository.add(viewConfiguration); - - assertEquals(6, viewConfigurationRepository.getAll().size()); - } - - @Test - public void testFindViewConfigurationsByVersion() { - assertEquals(5, viewConfigurationRepository.findViewConfigurationsByVersion(0l).size()); - - List views = viewConfigurationRepository.findViewConfigurationsByVersion(1516614392971l); - assertEquals(2, views.size()); - - for (ViewConfiguration view : views) { - assertTrue(view.getServerVersion() >= 1516614392971l); - assertTrue(view.getIdentifier().equals("positive_register_header") || view.getIdentifier().equals("main")); - } - - } - - @Test - public void testFindByEmptyServerVersion() { - assertTrue(viewConfigurationRepository.findByEmptyServerVersion().isEmpty()); - - ViewConfiguration view = viewConfigurationRepository.get("d243bc5737fb389e52601cb850299541"); - view.setServerVersion(0l); - viewConfigurationRepository.update(view); - - List views = viewConfigurationRepository.findByEmptyServerVersion(); - assertEquals(0, views.size()); - - - ViewConfiguration view2 = viewConfigurationRepository.get("3a065d7c3354eb2bc23c8a3bc303ba20"); - view2.setServerVersion(0l); - viewConfigurationRepository.update(view2); - - views = viewConfigurationRepository.findByEmptyServerVersion(); - assertEquals(0, views.size()); - - } - + long lastSyncedVersion = 1517890951252l; + ViewConfiguration viewConfiguration = new ViewConfiguration(); + viewConfiguration.setIdentifier("help"); + View view = new View(); + view.setIdentifier("faq"); + view.setLabel("FAQ"); + view.setVisible(true); + view.setOrientation("vertical"); + viewConfiguration.setViews(new ArrayList()); + viewConfiguration.getViews().add(view); + viewConfiguration.setServerVersion(1518890951252l); + + viewConfigurationRepository.add(viewConfiguration); + + assertEquals(6, viewConfigurationRepository.getAll().size()); + + List savedViews = viewConfigurationRepository.findViewConfigurationsByVersion(lastSyncedVersion); + assertEquals(1, savedViews.size()); + assertEquals(1, savedViews.get(0).getViews().size()); + assertEquals("faq", savedViews.get(0).getViews().get(0).getIdentifier()); + MatcherAssert.assertThat(savedViews, Matchers.contains(Matchers.hasProperty("serverVersion", Matchers.greaterThan(0l)))); + } + + @Test + public void testUpdate() { + ViewConfiguration view = viewConfigurationRepository.get("92141b17040021a7ce326194ff0029f7"); + LoginConfiguration configuration = (LoginConfiguration) view.getMetadata(); + configuration.setShowPasswordCheckbox(false); + configuration.setLanguage("fr_cn"); + configuration.setLogoUrl("http://localhost:98778/test.jpg"); + view.setMetadata(configuration); + long serverVersion = view.getServerVersion(); + viewConfigurationRepository.update(view); + + + ViewConfiguration updatedView = viewConfigurationRepository + .get("92141b17040021a7ce326194ff0029f7"); + LoginConfiguration updatedConfiguration = (LoginConfiguration) updatedView.getMetadata(); + assertEquals("fr_cn", updatedConfiguration.getLanguage()); + assertEquals("http://localhost:98778/test.jpg", updatedConfiguration.getLogoUrl()); + assertFalse(updatedConfiguration.getShowPasswordCheckbox()); + MatcherAssert.assertThat(updatedView.getServerVersion(), Matchers.greaterThan(serverVersion)); + + } + + @Test + public void testGetAll() { + assertEquals(5, viewConfigurationRepository.getAll().size()); + + viewConfigurationRepository.safeRemove(viewConfigurationRepository.get("3a065d7c3354eb2bc23c8a3bc303ef62")); + + assertEquals(4, viewConfigurationRepository.getAll().size()); + } + + @Test + public void testSafeRemove() { + + ViewConfiguration view = viewConfigurationRepository.get("3a065d7c3354eb2bc23c8a3bc303ef62"); + viewConfigurationRepository.safeRemove(view); + + assertNull(viewConfigurationRepository.get(view.getId())); + + List views = viewConfigurationRepository.getAll(); + for (ViewConfiguration v : views) { + assertNotEquals(view.getId(), v.getId()); + assertNotEquals(view.getIdentifier(), v.getIdentifier()); + } + } + + @Test + public void testFindAllViewConfigurations() { + assertEquals(5, viewConfigurationRepository.getAll().size()); + + ViewConfiguration viewConfiguration = new ViewConfiguration(); + viewConfiguration.setIdentifier("bmi"); + + viewConfigurationRepository.add(viewConfiguration); + + assertEquals(6, viewConfigurationRepository.getAll().size()); + } + + @Test + public void testFindViewConfigurationsByVersion() { + assertEquals(5, viewConfigurationRepository.findViewConfigurationsByVersion(0l).size()); + + List views = viewConfigurationRepository.findViewConfigurationsByVersion(1516614392971l); + assertEquals(2, views.size()); + + for (ViewConfiguration view : views) { + assertTrue(view.getServerVersion() >= 1516614392971l); + assertTrue(view.getIdentifier().equals("positive_register_header") || view.getIdentifier().equals("main")); + } + + } + + @Test + public void testFindByEmptyServerVersion() { + assertTrue(viewConfigurationRepository.findByEmptyServerVersion().isEmpty()); + + ViewConfiguration view = viewConfigurationRepository.get("d243bc5737fb389e52601cb850299541"); + view.setServerVersion(0l); + viewConfigurationRepository.update(view); + + List views = viewConfigurationRepository.findByEmptyServerVersion(); + assertEquals(0, views.size()); + + + ViewConfiguration view2 = viewConfigurationRepository.get("3a065d7c3354eb2bc23c8a3bc303ba20"); + view2.setServerVersion(0l); + viewConfigurationRepository.update(view2); + + views = viewConfigurationRepository.findByEmptyServerVersion(); + assertEquals(0, views.size()); + + } + } diff --git a/src/test/java/org/opensrp/scheduler/ActionTest.java b/src/test/java/org/opensrp/scheduler/ActionTest.java index 49988dd7b..d29d71118 100644 --- a/src/test/java/org/opensrp/scheduler/ActionTest.java +++ b/src/test/java/org/opensrp/scheduler/ActionTest.java @@ -12,18 +12,18 @@ import nl.jqno.equalsverifier.Warning; public class ActionTest { - - @Test - public void testEqualityAndHashCode() { - EqualsVerifier.forClass(Action.class).withIgnoredFields("id", "timeStamp", "revision") - .suppress(Warning.NONFINAL_FIELDS).verify(); - } - - @Test - public void testGetterAndSetter() { - Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); - - validator.validate(PojoClassFactory.getPojoClass(Action.class)); - } - + + @Test + public void testEqualityAndHashCode() { + EqualsVerifier.forClass(Action.class).withIgnoredFields("id", "timeStamp", "revision") + .suppress(Warning.NONFINAL_FIELDS).verify(); + } + + @Test + public void testGetterAndSetter() { + Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); + + validator.validate(PojoClassFactory.getPojoClass(Action.class)); + } + } diff --git a/src/test/java/org/opensrp/scheduler/AlertTest.java b/src/test/java/org/opensrp/scheduler/AlertTest.java index bd8ba85ee..914e63348 100644 --- a/src/test/java/org/opensrp/scheduler/AlertTest.java +++ b/src/test/java/org/opensrp/scheduler/AlertTest.java @@ -23,88 +23,88 @@ import nl.jqno.equalsverifier.Warning; public class AlertTest { - - @Test - public void testEqualityAndHashCode() { - EqualsVerifier.forClass(Alert.class).withIgnoredFields("timeStamp", "revision").suppress(Warning.NONFINAL_FIELDS) - .verify(); - } - - @Test - public void testConstructorGetterAndSetter() { - Validator validator = ValidatorBuilder.create() - // Add Rules to validate structure for POJO_PACKAGE - // See com.openpojo.validation.rule.impl for more ... - .with(new GetterMustExistRule()).with(new SetterMustExistRule()) - // Add Testers to validate behaviour for POJO_PACKAGE - // See com.openpojo.validation.test.impl for more ... - .with(new SetterTester()).with(new GetterTester()).build(); - - validator.validate(PojoClassFactory.getPojoClass(Alert.class)); - } - - @Test(expected = IllegalStateException.class) - public void testExceptionMarkAsClosedWithClosedAlert() { - Alert alert = new Alert("pr", "en", "ben", Alert.AlertType.notification, Alert.TriggerType.event, "", "", - new DateTime(1l), new DateTime(2l), AlertStatus.closed, new HashMap()); - - alert.markAlertAsClosed("reason"); - } - - @Test(expected = IllegalStateException.class) - public void testExceptionMarkAsClosedWithCompletedAlert() { - Alert alert = new Alert("pr", "en", "ben", Alert.AlertType.notification, Alert.TriggerType.event, "", "", - new DateTime(1l), new DateTime(2l), AlertStatus.complete, new HashMap()); - - alert.markAlertAsClosed("reason"); - } - - @Test - public void testMarkAsClosed() { - Alert alert = new Alert("pr", "en", "ben", Alert.AlertType.notification, Alert.TriggerType.event, "", "", - new DateTime(1l), new DateTime(2l), AlertStatus.normal, new HashMap()); - - Alert spyAlert = spy(alert); - when(spyAlert.getCurrentDateTime()).thenReturn(new DateTime(1l)); - spyAlert.markAlertAsClosed("reason"); - - assertEquals("reason", spyAlert.reasonClosed()); - assertEquals(AlertStatus.normal.name(), spyAlert.closingPeriod()); - assertEquals(AlertStatus.closed.name(), spyAlert.alertStatus()); - assertEquals(new DateTime(1l).toLocalDate().toString(), spyAlert.dateClosed()); - assertFalse(spyAlert.isActive()); - } - - @Test(expected = IllegalStateException.class) - public void testExceptionMarkAsCompletedWithCompletedAlert() { - Alert alert = new Alert("pr", "en", "ben", Alert.AlertType.notification, Alert.TriggerType.event, "", "", - new DateTime(1l), new DateTime(2l), AlertStatus.complete, new HashMap()); - - alert.markAlertAsComplete("reason"); - } - - @Test(expected = IllegalStateException.class) - public void testExceptionMarkAsCompletedWithClosedAlert() { - Alert alert = new Alert("pr", "en", "ben", Alert.AlertType.notification, Alert.TriggerType.event, "", "", - new DateTime(1l), new DateTime(2l), AlertStatus.closed, new HashMap()); - - alert.markAlertAsComplete("reason"); - } - - @Test - public void testMarkAsCompleted() { - Alert alert = new Alert("pr", "en", "ben", Alert.AlertType.notification, Alert.TriggerType.event, "", "", - new DateTime(1l), new DateTime(2l), AlertStatus.normal, new HashMap()); - - Alert spyAlert = spy(alert); - when(spyAlert.getCurrentDateTime()).thenReturn(new DateTime(1l)); - spyAlert.markAlertAsComplete("date"); - - assertEquals("date", spyAlert.getDateComplete()); - assertEquals(AlertStatus.normal.name(), spyAlert.closingPeriod()); - assertEquals(AlertStatus.complete.name(), spyAlert.alertStatus()); - assertEquals(new DateTime(1l).toLocalDate().toString(), spyAlert.dateClosed()); - assertFalse(spyAlert.isActive()); - } - + + @Test + public void testEqualityAndHashCode() { + EqualsVerifier.forClass(Alert.class).withIgnoredFields("timeStamp", "revision").suppress(Warning.NONFINAL_FIELDS) + .verify(); + } + + @Test + public void testConstructorGetterAndSetter() { + Validator validator = ValidatorBuilder.create() + // Add Rules to validate structure for POJO_PACKAGE + // See com.openpojo.validation.rule.impl for more ... + .with(new GetterMustExistRule()).with(new SetterMustExistRule()) + // Add Testers to validate behaviour for POJO_PACKAGE + // See com.openpojo.validation.test.impl for more ... + .with(new SetterTester()).with(new GetterTester()).build(); + + validator.validate(PojoClassFactory.getPojoClass(Alert.class)); + } + + @Test(expected = IllegalStateException.class) + public void testExceptionMarkAsClosedWithClosedAlert() { + Alert alert = new Alert("pr", "en", "ben", Alert.AlertType.notification, Alert.TriggerType.event, "", "", + new DateTime(1l), new DateTime(2l), AlertStatus.closed, new HashMap()); + + alert.markAlertAsClosed("reason"); + } + + @Test(expected = IllegalStateException.class) + public void testExceptionMarkAsClosedWithCompletedAlert() { + Alert alert = new Alert("pr", "en", "ben", Alert.AlertType.notification, Alert.TriggerType.event, "", "", + new DateTime(1l), new DateTime(2l), AlertStatus.complete, new HashMap()); + + alert.markAlertAsClosed("reason"); + } + + @Test + public void testMarkAsClosed() { + Alert alert = new Alert("pr", "en", "ben", Alert.AlertType.notification, Alert.TriggerType.event, "", "", + new DateTime(1l), new DateTime(2l), AlertStatus.normal, new HashMap()); + + Alert spyAlert = spy(alert); + when(spyAlert.getCurrentDateTime()).thenReturn(new DateTime(1l)); + spyAlert.markAlertAsClosed("reason"); + + assertEquals("reason", spyAlert.reasonClosed()); + assertEquals(AlertStatus.normal.name(), spyAlert.closingPeriod()); + assertEquals(AlertStatus.closed.name(), spyAlert.alertStatus()); + assertEquals(new DateTime(1l).toLocalDate().toString(), spyAlert.dateClosed()); + assertFalse(spyAlert.isActive()); + } + + @Test(expected = IllegalStateException.class) + public void testExceptionMarkAsCompletedWithCompletedAlert() { + Alert alert = new Alert("pr", "en", "ben", Alert.AlertType.notification, Alert.TriggerType.event, "", "", + new DateTime(1l), new DateTime(2l), AlertStatus.complete, new HashMap()); + + alert.markAlertAsComplete("reason"); + } + + @Test(expected = IllegalStateException.class) + public void testExceptionMarkAsCompletedWithClosedAlert() { + Alert alert = new Alert("pr", "en", "ben", Alert.AlertType.notification, Alert.TriggerType.event, "", "", + new DateTime(1l), new DateTime(2l), AlertStatus.closed, new HashMap()); + + alert.markAlertAsComplete("reason"); + } + + @Test + public void testMarkAsCompleted() { + Alert alert = new Alert("pr", "en", "ben", Alert.AlertType.notification, Alert.TriggerType.event, "", "", + new DateTime(1l), new DateTime(2l), AlertStatus.normal, new HashMap()); + + Alert spyAlert = spy(alert); + when(spyAlert.getCurrentDateTime()).thenReturn(new DateTime(1l)); + spyAlert.markAlertAsComplete("date"); + + assertEquals("date", spyAlert.getDateComplete()); + assertEquals(AlertStatus.normal.name(), spyAlert.closingPeriod()); + assertEquals(AlertStatus.complete.name(), spyAlert.alertStatus()); + assertEquals(new DateTime(1l).toLocalDate().toString(), spyAlert.dateClosed()); + assertFalse(spyAlert.isActive()); + } + } diff --git a/src/test/java/org/opensrp/scheduler/RepeatingCornScheduleTest.java b/src/test/java/org/opensrp/scheduler/RepeatingCornScheduleTest.java index 2d6bd6c54..9e21e7d6d 100644 --- a/src/test/java/org/opensrp/scheduler/RepeatingCornScheduleTest.java +++ b/src/test/java/org/opensrp/scheduler/RepeatingCornScheduleTest.java @@ -11,47 +11,47 @@ import org.junit.Test; public class RepeatingCornScheduleTest { - - public static final String CRON_EXPRESSION = "cornexpression"; - - public static final int START_DELAY = 100; - - public static final String SUBJECT = "Subject"; - - RepeatingCronSchedule repeatingCronSchedule = new RepeatingCronSchedule(SUBJECT, START_DELAY, TimeUnit.HOURS, - CRON_EXPRESSION); - - @Test - public void testMillisConverter() { - assertEquals(1 / 1000000l, repeatingCronSchedule.millisConverter(TimeUnit.NANOSECONDS)); - assertEquals(1 / 1000l, repeatingCronSchedule.millisConverter(TimeUnit.MICROSECONDS)); - assertEquals(1l, repeatingCronSchedule.millisConverter(TimeUnit.MILLISECONDS)); - assertEquals(1000l, repeatingCronSchedule.millisConverter(TimeUnit.SECONDS)); - assertEquals(1000 * 60, repeatingCronSchedule.millisConverter(TimeUnit.MINUTES)); - assertEquals(1000 * 60 * 60l, repeatingCronSchedule.millisConverter(TimeUnit.HOURS)); - assertEquals(1000 * 60 * 60 * 24, repeatingCronSchedule.millisConverter(TimeUnit.DAYS)); - } - - @Test - public void testConstructor() { - Map extraData = new HashMap<>(); - extraData.put("key1", "value1"); - RepeatingCronSchedule repeatingCronSchedule = new RepeatingCronSchedule(SUBJECT, START_DELAY, TimeUnit.MILLISECONDS, - CRON_EXPRESSION, new Date(0l), extraData); - - assertEquals(extraData, repeatingCronSchedule.getData()); - assertEquals(new Date(0l), repeatingCronSchedule.getEndTime()); - assertEquals(START_DELAY, repeatingCronSchedule.getStartDelayMilis()); - - repeatingCronSchedule.addData("key2", "value2"); - extraData.put("key2", "value2"); - assertEquals(extraData, repeatingCronSchedule.getData()); - - repeatingCronSchedule.withData(Collections.EMPTY_MAP); - assertEquals(Collections.EMPTY_MAP, repeatingCronSchedule.getData()); - - repeatingCronSchedule.withEndTime(new Date(1l)); - assertEquals(new Date(1l), repeatingCronSchedule.getEndTime()); - - } + + public static final String CRON_EXPRESSION = "cornexpression"; + + public static final int START_DELAY = 100; + + public static final String SUBJECT = "Subject"; + + RepeatingCronSchedule repeatingCronSchedule = new RepeatingCronSchedule(SUBJECT, START_DELAY, TimeUnit.HOURS, + CRON_EXPRESSION); + + @Test + public void testMillisConverter() { + assertEquals(1 / 1000000l, repeatingCronSchedule.millisConverter(TimeUnit.NANOSECONDS)); + assertEquals(1 / 1000l, repeatingCronSchedule.millisConverter(TimeUnit.MICROSECONDS)); + assertEquals(1l, repeatingCronSchedule.millisConverter(TimeUnit.MILLISECONDS)); + assertEquals(1000l, repeatingCronSchedule.millisConverter(TimeUnit.SECONDS)); + assertEquals(1000 * 60, repeatingCronSchedule.millisConverter(TimeUnit.MINUTES)); + assertEquals(1000 * 60 * 60l, repeatingCronSchedule.millisConverter(TimeUnit.HOURS)); + assertEquals(1000 * 60 * 60 * 24, repeatingCronSchedule.millisConverter(TimeUnit.DAYS)); + } + + @Test + public void testConstructor() { + Map extraData = new HashMap<>(); + extraData.put("key1", "value1"); + RepeatingCronSchedule repeatingCronSchedule = new RepeatingCronSchedule(SUBJECT, START_DELAY, TimeUnit.MILLISECONDS, + CRON_EXPRESSION, new Date(0l), extraData); + + assertEquals(extraData, repeatingCronSchedule.getData()); + assertEquals(new Date(0l), repeatingCronSchedule.getEndTime()); + assertEquals(START_DELAY, repeatingCronSchedule.getStartDelayMilis()); + + repeatingCronSchedule.addData("key2", "value2"); + extraData.put("key2", "value2"); + assertEquals(extraData, repeatingCronSchedule.getData()); + + repeatingCronSchedule.withData(Collections.EMPTY_MAP); + assertEquals(Collections.EMPTY_MAP, repeatingCronSchedule.getData()); + + repeatingCronSchedule.withEndTime(new Date(1l)); + assertEquals(new Date(1l), repeatingCronSchedule.getEndTime()); + + } } diff --git a/src/test/java/org/opensrp/scheduler/RepeatingScheduleTest.java b/src/test/java/org/opensrp/scheduler/RepeatingScheduleTest.java index 59a8e8ffc..ba245880a 100644 --- a/src/test/java/org/opensrp/scheduler/RepeatingScheduleTest.java +++ b/src/test/java/org/opensrp/scheduler/RepeatingScheduleTest.java @@ -11,49 +11,49 @@ import org.junit.Test; public class RepeatingScheduleTest { - - public static final int START_DELAY = 100; - - public static final String SUBJECT = "Subject"; - - public static final int REPEAT_INTERVAL = 5; - - RepeatingSchedule repeatingSchedule = new RepeatingSchedule(SUBJECT, START_DELAY, TimeUnit.HOURS, REPEAT_INTERVAL, - TimeUnit.MILLISECONDS); - - @Test - public void testMillisConverter() { - assertEquals(1 / 1000000l, repeatingSchedule.millisConverter(TimeUnit.NANOSECONDS)); - assertEquals(1 / 1000l, repeatingSchedule.millisConverter(TimeUnit.MICROSECONDS)); - assertEquals(1l, repeatingSchedule.millisConverter(TimeUnit.MILLISECONDS)); - assertEquals(1000l, repeatingSchedule.millisConverter(TimeUnit.SECONDS)); - assertEquals(1000 * 60, repeatingSchedule.millisConverter(TimeUnit.MINUTES)); - assertEquals(1000 * 60 * 60l, repeatingSchedule.millisConverter(TimeUnit.HOURS)); - assertEquals(1000 * 60 * 60 * 24, repeatingSchedule.millisConverter(TimeUnit.DAYS)); - } - - @Test - public void testConstructor() { - Map extraData = new HashMap<>(); - extraData.put("key1", "value1"); - RepeatingSchedule repeatingSchedule = new RepeatingSchedule(SUBJECT, START_DELAY, TimeUnit.MILLISECONDS, - REPEAT_INTERVAL, TimeUnit.MILLISECONDS, new Date(0l), extraData); - - assertEquals(extraData, repeatingSchedule.getData()); - assertEquals(new Date(0l), repeatingSchedule.getEndTime()); - assertEquals(START_DELAY, repeatingSchedule.getStartDelayMilis()); - assertEquals(REPEAT_INTERVAL, repeatingSchedule.getRepeatIntervalMilis()); - - repeatingSchedule.addData("key2", "value2"); - extraData.put("key2", "value2"); - assertEquals(extraData, repeatingSchedule.getData()); - - repeatingSchedule.withData(Collections.EMPTY_MAP); - assertEquals(Collections.EMPTY_MAP, repeatingSchedule.getData()); - - repeatingSchedule.withEndTime(new Date(1l)); - assertEquals(new Date(1l), repeatingSchedule.getEndTime()); - - } - + + public static final int START_DELAY = 100; + + public static final String SUBJECT = "Subject"; + + public static final int REPEAT_INTERVAL = 5; + + RepeatingSchedule repeatingSchedule = new RepeatingSchedule(SUBJECT, START_DELAY, TimeUnit.HOURS, REPEAT_INTERVAL, + TimeUnit.MILLISECONDS); + + @Test + public void testMillisConverter() { + assertEquals(1 / 1000000l, repeatingSchedule.millisConverter(TimeUnit.NANOSECONDS)); + assertEquals(1 / 1000l, repeatingSchedule.millisConverter(TimeUnit.MICROSECONDS)); + assertEquals(1l, repeatingSchedule.millisConverter(TimeUnit.MILLISECONDS)); + assertEquals(1000l, repeatingSchedule.millisConverter(TimeUnit.SECONDS)); + assertEquals(1000 * 60, repeatingSchedule.millisConverter(TimeUnit.MINUTES)); + assertEquals(1000 * 60 * 60l, repeatingSchedule.millisConverter(TimeUnit.HOURS)); + assertEquals(1000 * 60 * 60 * 24, repeatingSchedule.millisConverter(TimeUnit.DAYS)); + } + + @Test + public void testConstructor() { + Map extraData = new HashMap<>(); + extraData.put("key1", "value1"); + RepeatingSchedule repeatingSchedule = new RepeatingSchedule(SUBJECT, START_DELAY, TimeUnit.MILLISECONDS, + REPEAT_INTERVAL, TimeUnit.MILLISECONDS, new Date(0l), extraData); + + assertEquals(extraData, repeatingSchedule.getData()); + assertEquals(new Date(0l), repeatingSchedule.getEndTime()); + assertEquals(START_DELAY, repeatingSchedule.getStartDelayMilis()); + assertEquals(REPEAT_INTERVAL, repeatingSchedule.getRepeatIntervalMilis()); + + repeatingSchedule.addData("key2", "value2"); + extraData.put("key2", "value2"); + assertEquals(extraData, repeatingSchedule.getData()); + + repeatingSchedule.withData(Collections.EMPTY_MAP); + assertEquals(Collections.EMPTY_MAP, repeatingSchedule.getData()); + + repeatingSchedule.withEndTime(new Date(1l)); + assertEquals(new Date(1l), repeatingSchedule.getEndTime()); + + } + } diff --git a/src/test/java/org/opensrp/scheduler/ScheduleTest.java b/src/test/java/org/opensrp/scheduler/ScheduleTest.java index e67d5dbca..9df408039 100644 --- a/src/test/java/org/opensrp/scheduler/ScheduleTest.java +++ b/src/test/java/org/opensrp/scheduler/ScheduleTest.java @@ -13,32 +13,32 @@ import org.springframework.core.io.ResourceLoader; public class ScheduleTest { - - @Test(expected = JSONException.class) - public void testConstructorInvalidString() throws JSONException { - new Schedule(" dsf"); - } - - @Test(expected = JSONException.class) - public void testWithInvalidJsonObject() throws JSONException { - new Schedule(new JSONObject()); - } - - @Test(expected = Exception.class) - public void testCompilerExceptionInPassesValidation() throws IOException, JSONException { - String scheduleConfigPath = "/schedules/schedule-config.xls"; - ResourceLoader loader = new DefaultResourceLoader(); - scheduleConfigPath = loader.getResource(scheduleConfigPath).getURI().getPath(); - - JSONArray xlsToJsonScheduleArray = Utils.getXlsToJson(scheduleConfigPath); - - String duplicatePassLogic = "${fs.pentavalent_2} !=s ${fs.pentavalent_2}"; - Schedule schedule = new Schedule(xlsToJsonScheduleArray.getJSONObject(0).put("passLogic", duplicatePassLogic)); - - Map flvl = new HashMap<>(); - - flvl.put("pentavalent_2", null); - schedule.passesValidations(flvl); - - } + + @Test(expected = JSONException.class) + public void testConstructorInvalidString() throws JSONException { + new Schedule(" dsf"); + } + + @Test(expected = JSONException.class) + public void testWithInvalidJsonObject() throws JSONException { + new Schedule(new JSONObject()); + } + + @Test(expected = Exception.class) + public void testCompilerExceptionInPassesValidation() throws IOException, JSONException { + String scheduleConfigPath = "/schedules/schedule-config.xls"; + ResourceLoader loader = new DefaultResourceLoader(); + scheduleConfigPath = loader.getResource(scheduleConfigPath).getURI().getPath(); + + JSONArray xlsToJsonScheduleArray = Utils.getXlsToJson(scheduleConfigPath); + + String duplicatePassLogic = "${fs.pentavalent_2} !=s ${fs.pentavalent_2}"; + Schedule schedule = new Schedule(xlsToJsonScheduleArray.getJSONObject(0).put("passLogic", duplicatePassLogic)); + + Map flvl = new HashMap<>(); + + flvl.put("pentavalent_2", null); + schedule.passesValidations(flvl); + + } } diff --git a/src/test/java/org/opensrp/scheduler/service/ActionServiceTest.java b/src/test/java/org/opensrp/scheduler/service/ActionServiceTest.java index 268e40c46..e5ed67ed4 100644 --- a/src/test/java/org/opensrp/scheduler/service/ActionServiceTest.java +++ b/src/test/java/org/opensrp/scheduler/service/ActionServiceTest.java @@ -34,191 +34,191 @@ import com.google.gson.Gson; @RunWith(PowerMockRunner.class) -@PrepareForTest({ DateTime.class }) -@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*","org.w3c.*"}) +@PrepareForTest({DateTime.class}) +@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*", "org.w3c.*"}) public class ActionServiceTest { - - public static final String ANM_1 = "ANM 1"; - - public static final String CASE_X = "Case X"; - - public static final String REASON_FOR_CLOSE = "reason for close"; - - public static final DateTime DATE_TIME = new DateTime(0l); - - public static final String SCHDEDULE = "schdedule"; - - @Mock - private ActionsRepository allActions; - - @Mock - private AlertsRepository allAlerts; - - private ActionService service; - - @Before - public void setUp() throws Exception { - initMocks(this); - service = new ActionService(allActions, allAlerts); - } - - @Test - public void shouldSaveAlertActionForEntity() throws Exception { - DateTime dueDate = DateTime.now().minusDays(1); - DateTime expiryDate = dueDate.plusWeeks(2); - - service.alertForBeneficiary("mother", "Case X", "ANM ID M", "Ante Natal Care - Normal", "ANC 1", normal, dueDate, - expiryDate); - Action action = new Action("Case X", "ANM ID M", - ActionData.createAlert("mother", "Ante Natal Care - Normal", "ANC 1", normal, dueDate, expiryDate)); - - verify(allActions).addOrUpdateAlert(action); - verify(allAlerts).addOrUpdateScheduleNotificationAlert("mother", "Case X", "ANM ID M", "Ante Natal Care - Normal", - "ANC 1", normal, dueDate, expiryDate); - } - - @Test - public void shouldSaveAlertActionForEntityWithActionObject() throws Exception { - DateTime dueDate = DateTime.now().minusDays(1); - DateTime expiryDate = dueDate.plusWeeks(2); - - Action action = new Action("Case X", "ANM ID M", - ActionData.createAlert("mother", "Ante Natal Care - Normal", "ANC 1", normal, dueDate, expiryDate)); - - service.alertForBeneficiary(action); - - verify(allActions).addOrUpdateAlert(action); - // verify(allAlerts).addOrUpdateScheduleNotificationAlert("mother", "Case X", "ANM ID M", "Ante Natal Care - Normal", "ANC 1", normal, dueDate, expiryDate); - } - - @Test - public void shouldCreateACloseActionForAVisitOfAChild() throws Exception { - service.markAlertAsClosed("Case X", "ANM 1", "OPV 1", "2012-01-01"); - - verify(allActions).add(new Action("Case X", "ANM 1", ActionData.markAlertAsClosed("OPV 1", "2012-01-01"))); - } - - @Test - public void shouldCreateADeleteAllActionForAMother() throws Exception { - service.markAllAlertsAsInactive("Case X"); - - verify(allActions).markAllAsInActiveFor("Case X"); - } - - @Test - public void shouldMarkAnAlertAsInactive() throws Exception { - service.markAlertAsInactive("ANM 1", "Case X", "Schedule 1"); - - verify(allActions).markAlertAsInactiveFor("ANM 1", "Case X", "Schedule 1"); - } - - @Test - public void shouldReportForIndicator() { - ActionData summaryActionData = ActionData.reportForIndicator("ANC", "30", - new Gson().toJson(asList(new MonthSummaryDatum("3", "2012", "2", "2", asList("CASE 5", "CASE 6"))))); - - service.reportForIndicator("ANM X", summaryActionData); - - verify(allActions).add(new Action("", "ANM X", summaryActionData)); - } - - @Test - public void shouldDeleteAllActionsWithTargetReport() { - service.deleteReportActions(); - - verify(allActions).deleteAllByTarget("report"); - } - - @Test - public void shouldCreateACloseActionForAVisitOfAMother() throws Exception { - service.markAlertAsClosed("Case X", "ANM ID 1", "ANC 1", "2012-12-12"); - - Action action = new Action("Case X", "ANM ID 1", ActionData.markAlertAsClosed("ANC 1", "2012-12-12")); - verify(allActions).add(action); - verify(allAlerts).markAlertAsCompleteFor("ANM ID 1", "Case X", "ANC 1", "2012-12-12"); - } - - @Test - public void shouldCloseAlertBasedOnCaseId() throws Exception { - service.markAlertAsClosed(CASE_X, "ANC 1", "2012-12-12"); - - Action action = new Action(CASE_X, ALL_PROVIDERS, ActionData.markAlertAsClosed("ANC 1", "2012-12-12")); - verify(allActions).add(action); - verify(allAlerts).markAlertAsCompleteFor(CASE_X, "ANC 1", "2012-12-12"); - } - - @Test - public void shouldCloseBeneficiary() throws Exception { - PowerMockito.mockStatic(DateTime.class); - DateTime dateTime = mock(DateTime.class); - - when(DateTime.now()).thenReturn(new DateTime(0l)); - PowerMockito.whenNew(DateTime.class).withNoArguments().thenReturn(dateTime); - when(dateTime.toLocalDate()).thenReturn(new LocalDate(0l)); - - service.closeBeneficiary(BeneficiaryType.mother, CASE_X, ANM_1, REASON_FOR_CLOSE); - - Action action = new Action(CASE_X, ANM_1, - ActionData.closeBeneficiary(BeneficiaryType.mother.name(), REASON_FOR_CLOSE)); - DateTime defaultDate = service.getCurrentDateTime(); - Alert alert = new Alert(ANM_1, CASE_X, BeneficiaryType.mother.name(), Alert.AlertType.notification, - Alert.TriggerType.caseClosed, null, null, defaultDate, defaultDate, AlertStatus.urgent, null); - - verify(allActions).add(action); - verify(allAlerts).add(alert); - } - - @Test - public void shouldReturnAlertsBasedOnANMIDAndTimeStamp() throws Exception { - List alertActions = Arrays.asList(new Action("Case X", "ANM 1", ActionData.createAlert("mother", - "Ante Natal Care - Normal", "ANC 1", normal, DateTime.now(), DateTime.now().plusDays(3)))); - when(allActions.findByProviderIdAndTimeStamp("ANM 1", 1010101)).thenReturn(alertActions); - - List alerts = service.getNewAlertsForANM("ANM 1", 1010101); - - assertEquals(1, alerts.size()); - assertEquals(alertActions, alerts); - } - - @Test - public void shouldFindAllByCriteria() { - List alerts = service.findByCriteria("team", "ANM 1", 1010101, "sortBy", "sortOrder", 1); - verify(allActions).findByCriteria("team", "ANM 1", 1010101, "sortBy", "sortOrder", 1); - - } - - @Test - public void shouldGetAlertsForProvider() { - service.getAlertsForProvider(ANM_1, 200l); - verify(allAlerts).findByProviderAndTimestamp(ANM_1, 200l); - } - - @Test - public void shouldGetAlertsActiveForProvider() { - service.getAlertsActiveForProvider(ANM_1, DATE_TIME.getMillis()); - - verify(allAlerts).findActiveByProviderAndTimestamp(ANM_1, new DateTime(0l).getMillis()); - } - - @Test - public void shouldFindByCaseIdScheduleAndTimeStamp() { - service.findByCaseIdScheduleAndTimeStamp(CASE_X, SCHDEDULE, DATE_TIME, DATE_TIME); - - verify(allActions).findByCaseIdScheduleAndTimeStamp(CASE_X, SCHDEDULE, DATE_TIME, DATE_TIME); - } - - @Test - public void shouldFindByCaseIdAndTimeStamp() { - service.findByCaseIdAndTimeStamp(CASE_X, DATE_TIME.getMillis()); - - verify(allActions).findByCaseIdAndTimeStamp(CASE_X, DATE_TIME.getMillis()); - } - - @Test - public void shouldFindAlertByEntityIdScheduleAndTimeStamp() { - service.findAlertByEntityIdScheduleAndTimeStamp(CASE_X, SCHDEDULE, DATE_TIME, DATE_TIME); - - verify(allAlerts).findByEntityIdTriggerAndTimeStamp(CASE_X, SCHDEDULE, DATE_TIME, DATE_TIME); - } - + + public static final String ANM_1 = "ANM 1"; + + public static final String CASE_X = "Case X"; + + public static final String REASON_FOR_CLOSE = "reason for close"; + + public static final DateTime DATE_TIME = new DateTime(0l); + + public static final String SCHDEDULE = "schdedule"; + + @Mock + private ActionsRepository allActions; + + @Mock + private AlertsRepository allAlerts; + + private ActionService service; + + @Before + public void setUp() throws Exception { + initMocks(this); + service = new ActionService(allActions, allAlerts); + } + + @Test + public void shouldSaveAlertActionForEntity() throws Exception { + DateTime dueDate = DateTime.now().minusDays(1); + DateTime expiryDate = dueDate.plusWeeks(2); + + service.alertForBeneficiary("mother", "Case X", "ANM ID M", "Ante Natal Care - Normal", "ANC 1", normal, dueDate, + expiryDate); + Action action = new Action("Case X", "ANM ID M", + ActionData.createAlert("mother", "Ante Natal Care - Normal", "ANC 1", normal, dueDate, expiryDate)); + + verify(allActions).addOrUpdateAlert(action); + verify(allAlerts).addOrUpdateScheduleNotificationAlert("mother", "Case X", "ANM ID M", "Ante Natal Care - Normal", + "ANC 1", normal, dueDate, expiryDate); + } + + @Test + public void shouldSaveAlertActionForEntityWithActionObject() throws Exception { + DateTime dueDate = DateTime.now().minusDays(1); + DateTime expiryDate = dueDate.plusWeeks(2); + + Action action = new Action("Case X", "ANM ID M", + ActionData.createAlert("mother", "Ante Natal Care - Normal", "ANC 1", normal, dueDate, expiryDate)); + + service.alertForBeneficiary(action); + + verify(allActions).addOrUpdateAlert(action); + // verify(allAlerts).addOrUpdateScheduleNotificationAlert("mother", "Case X", "ANM ID M", "Ante Natal Care - Normal", "ANC 1", normal, dueDate, expiryDate); + } + + @Test + public void shouldCreateACloseActionForAVisitOfAChild() throws Exception { + service.markAlertAsClosed("Case X", "ANM 1", "OPV 1", "2012-01-01"); + + verify(allActions).add(new Action("Case X", "ANM 1", ActionData.markAlertAsClosed("OPV 1", "2012-01-01"))); + } + + @Test + public void shouldCreateADeleteAllActionForAMother() throws Exception { + service.markAllAlertsAsInactive("Case X"); + + verify(allActions).markAllAsInActiveFor("Case X"); + } + + @Test + public void shouldMarkAnAlertAsInactive() throws Exception { + service.markAlertAsInactive("ANM 1", "Case X", "Schedule 1"); + + verify(allActions).markAlertAsInactiveFor("ANM 1", "Case X", "Schedule 1"); + } + + @Test + public void shouldReportForIndicator() { + ActionData summaryActionData = ActionData.reportForIndicator("ANC", "30", + new Gson().toJson(asList(new MonthSummaryDatum("3", "2012", "2", "2", asList("CASE 5", "CASE 6"))))); + + service.reportForIndicator("ANM X", summaryActionData); + + verify(allActions).add(new Action("", "ANM X", summaryActionData)); + } + + @Test + public void shouldDeleteAllActionsWithTargetReport() { + service.deleteReportActions(); + + verify(allActions).deleteAllByTarget("report"); + } + + @Test + public void shouldCreateACloseActionForAVisitOfAMother() throws Exception { + service.markAlertAsClosed("Case X", "ANM ID 1", "ANC 1", "2012-12-12"); + + Action action = new Action("Case X", "ANM ID 1", ActionData.markAlertAsClosed("ANC 1", "2012-12-12")); + verify(allActions).add(action); + verify(allAlerts).markAlertAsCompleteFor("ANM ID 1", "Case X", "ANC 1", "2012-12-12"); + } + + @Test + public void shouldCloseAlertBasedOnCaseId() throws Exception { + service.markAlertAsClosed(CASE_X, "ANC 1", "2012-12-12"); + + Action action = new Action(CASE_X, ALL_PROVIDERS, ActionData.markAlertAsClosed("ANC 1", "2012-12-12")); + verify(allActions).add(action); + verify(allAlerts).markAlertAsCompleteFor(CASE_X, "ANC 1", "2012-12-12"); + } + + @Test + public void shouldCloseBeneficiary() throws Exception { + PowerMockito.mockStatic(DateTime.class); + DateTime dateTime = mock(DateTime.class); + + when(DateTime.now()).thenReturn(new DateTime(0l)); + PowerMockito.whenNew(DateTime.class).withNoArguments().thenReturn(dateTime); + when(dateTime.toLocalDate()).thenReturn(new LocalDate(0l)); + + service.closeBeneficiary(BeneficiaryType.mother, CASE_X, ANM_1, REASON_FOR_CLOSE); + + Action action = new Action(CASE_X, ANM_1, + ActionData.closeBeneficiary(BeneficiaryType.mother.name(), REASON_FOR_CLOSE)); + DateTime defaultDate = service.getCurrentDateTime(); + Alert alert = new Alert(ANM_1, CASE_X, BeneficiaryType.mother.name(), Alert.AlertType.notification, + Alert.TriggerType.caseClosed, null, null, defaultDate, defaultDate, AlertStatus.urgent, null); + + verify(allActions).add(action); + verify(allAlerts).add(alert); + } + + @Test + public void shouldReturnAlertsBasedOnANMIDAndTimeStamp() throws Exception { + List alertActions = Arrays.asList(new Action("Case X", "ANM 1", ActionData.createAlert("mother", + "Ante Natal Care - Normal", "ANC 1", normal, DateTime.now(), DateTime.now().plusDays(3)))); + when(allActions.findByProviderIdAndTimeStamp("ANM 1", 1010101)).thenReturn(alertActions); + + List alerts = service.getNewAlertsForANM("ANM 1", 1010101); + + assertEquals(1, alerts.size()); + assertEquals(alertActions, alerts); + } + + @Test + public void shouldFindAllByCriteria() { + List alerts = service.findByCriteria("team", "ANM 1", 1010101, "sortBy", "sortOrder", 1); + verify(allActions).findByCriteria("team", "ANM 1", 1010101, "sortBy", "sortOrder", 1); + + } + + @Test + public void shouldGetAlertsForProvider() { + service.getAlertsForProvider(ANM_1, 200l); + verify(allAlerts).findByProviderAndTimestamp(ANM_1, 200l); + } + + @Test + public void shouldGetAlertsActiveForProvider() { + service.getAlertsActiveForProvider(ANM_1, DATE_TIME.getMillis()); + + verify(allAlerts).findActiveByProviderAndTimestamp(ANM_1, new DateTime(0l).getMillis()); + } + + @Test + public void shouldFindByCaseIdScheduleAndTimeStamp() { + service.findByCaseIdScheduleAndTimeStamp(CASE_X, SCHDEDULE, DATE_TIME, DATE_TIME); + + verify(allActions).findByCaseIdScheduleAndTimeStamp(CASE_X, SCHDEDULE, DATE_TIME, DATE_TIME); + } + + @Test + public void shouldFindByCaseIdAndTimeStamp() { + service.findByCaseIdAndTimeStamp(CASE_X, DATE_TIME.getMillis()); + + verify(allActions).findByCaseIdAndTimeStamp(CASE_X, DATE_TIME.getMillis()); + } + + @Test + public void shouldFindAlertByEntityIdScheduleAndTimeStamp() { + service.findAlertByEntityIdScheduleAndTimeStamp(CASE_X, SCHDEDULE, DATE_TIME, DATE_TIME); + + verify(allAlerts).findByEntityIdTriggerAndTimeStamp(CASE_X, SCHDEDULE, DATE_TIME, DATE_TIME); + } + } diff --git a/src/test/java/org/opensrp/service/CampaignServiceTest.java b/src/test/java/org/opensrp/service/CampaignServiceTest.java index c08262925..6ada8e7bb 100644 --- a/src/test/java/org/opensrp/service/CampaignServiceTest.java +++ b/src/test/java/org/opensrp/service/CampaignServiceTest.java @@ -24,130 +24,130 @@ @RunWith(PowerMockRunner.class) public class CampaignServiceTest { - private CampaignService campaignService; - - private CampaignRepository campaignRepository; - - @Before - public void setUp() { - campaignRepository = mock(CampaignRepository.class); - campaignService = new CampaignService(); - campaignService.setCampaignRepository(campaignRepository); - } - - @Test - public void testGetAllCampaigns() { - List expected = new ArrayList<>(); - Campaign campaign = new Campaign(); - campaign.setIdentifier("ITN_2018_S1"); - campaign.setDescription("ITN for 2018 Season 1"); - expected.add(campaign); - when(campaignRepository.getAll()).thenReturn(expected); - List campaigns = campaignService.getAllCampaigns(); - verify(campaignRepository).getAll(); - assertEquals(1, campaigns.size()); - assertEquals("ITN_2018_S1", campaigns.get(0).getIdentifier()); - } - - @Test(expected = IllegalArgumentException.class) - public void testaAddOrUpdateCampaignWithoutIdentifier() { - Campaign campaign = new Campaign(); - campaignService.addOrUpdateCampaign(campaign); - } - - @Test - public void testExistingCampaignAddOrUpdateCampaignShouldUpdate() { - Campaign campaign = getCampaign(); - when(campaignRepository.get("ITN_2018_S1")).thenReturn(campaign); - campaignService.addOrUpdateCampaign(campaign); - verify(campaignRepository).update(campaign); - - } - - @Test - public void testNonExistingCampaignAddOrUpdateCampaignShouldAdd() { - Campaign campaign = getCampaign(); - when(campaignRepository.get("ITN_2018_S1")).thenReturn(null); - campaignService.addOrUpdateCampaign(campaign); - verify(campaignRepository).add(campaign); - - } - - @Test - public void testaAddCampaign() { - Campaign campaign = getCampaign(); - campaignService.addCampaign(campaign); - verify(campaignRepository).add(campaign); - - } - - @Test(expected = IllegalArgumentException.class) - public void testAddCampaignWithoutIdentifier() { - Campaign campaign = new Campaign(); - campaignService.addCampaign(campaign); - } - - @Test - public void testUpdateCampaign() { - Campaign campaign = getCampaign(); - campaignService.updateCampaign(campaign); - verify(campaignRepository).update(campaign); - - } - - @Test(expected = IllegalArgumentException.class) - public void testUpdateCampaignWithoutIdentifier() { - Campaign campaign = new Campaign(); - campaignService.updateCampaign(campaign); - - } - - @Test - public void testGetCampaign() { - when(campaignRepository.get("ITN_2018_S1")).thenReturn(getCampaign()); - Campaign campaign = campaignService.getCampaign("ITN_2018_S1"); - verify(campaignRepository).get("ITN_2018_S1"); - assertEquals("ITN for 2018 Season 1", campaign.getDescription()); - assertEquals(TaskStatus.READY, campaign.getStatus()); - assertEquals(1542115657234l, campaign.getServerVersion()); - - } - - @Test - public void testGetCampaignWithNoIdentifier() { - Campaign campaign = campaignService.getCampaign(""); - verify(campaignRepository, never()).get(anyString()); - assertNull(campaign); - - } - - @Test - public void testGetCampaigns() { - List expected = new ArrayList<>(); - expected.add(getCampaign()); - when(campaignRepository.getCampaignsByServerVersion(1542115657234l)).thenReturn(expected); - List campaigns = campaignService.getCampaignsByServerVersion(1542115657234l); - verify(campaignRepository).getCampaignsByServerVersion(1542115657234l); - assertEquals(1, campaigns.size()); - assertEquals("ITN_2018_S1", campaigns.get(0).getIdentifier()); - assertEquals("ITN for 2018 Season 1", campaigns.get(0).getDescription()); - assertEquals(TaskStatus.READY, campaigns.get(0).getStatus()); - assertEquals(1542115657234l, campaigns.get(0).getServerVersion()); - - } - - private Campaign getCampaign() { - Campaign campaign = new Campaign(); - campaign.setIdentifier("ITN_2018_S1"); - campaign.setDescription("ITN for 2018 Season 1"); - campaign.setStatus(TaskStatus.READY); - Period executionPeriod = new Period(); - executionPeriod.setStart(new LocalDate("2018-01-01").toDateTimeAtStartOfDay()); - executionPeriod.setEnd(new LocalDate("2018-03-31").toDateTimeAtStartOfDay()); - campaign.setExecutionPeriod(executionPeriod); - campaign.setOwner("superAdmin23"); - campaign.setServerVersion(1542115657234l); - return campaign; - - } + private CampaignService campaignService; + + private CampaignRepository campaignRepository; + + @Before + public void setUp() { + campaignRepository = mock(CampaignRepository.class); + campaignService = new CampaignService(); + campaignService.setCampaignRepository(campaignRepository); + } + + @Test + public void testGetAllCampaigns() { + List expected = new ArrayList<>(); + Campaign campaign = new Campaign(); + campaign.setIdentifier("ITN_2018_S1"); + campaign.setDescription("ITN for 2018 Season 1"); + expected.add(campaign); + when(campaignRepository.getAll()).thenReturn(expected); + List campaigns = campaignService.getAllCampaigns(); + verify(campaignRepository).getAll(); + assertEquals(1, campaigns.size()); + assertEquals("ITN_2018_S1", campaigns.get(0).getIdentifier()); + } + + @Test(expected = IllegalArgumentException.class) + public void testaAddOrUpdateCampaignWithoutIdentifier() { + Campaign campaign = new Campaign(); + campaignService.addOrUpdateCampaign(campaign); + } + + @Test + public void testExistingCampaignAddOrUpdateCampaignShouldUpdate() { + Campaign campaign = getCampaign(); + when(campaignRepository.get("ITN_2018_S1")).thenReturn(campaign); + campaignService.addOrUpdateCampaign(campaign); + verify(campaignRepository).update(campaign); + + } + + @Test + public void testNonExistingCampaignAddOrUpdateCampaignShouldAdd() { + Campaign campaign = getCampaign(); + when(campaignRepository.get("ITN_2018_S1")).thenReturn(null); + campaignService.addOrUpdateCampaign(campaign); + verify(campaignRepository).add(campaign); + + } + + @Test + public void testaAddCampaign() { + Campaign campaign = getCampaign(); + campaignService.addCampaign(campaign); + verify(campaignRepository).add(campaign); + + } + + @Test(expected = IllegalArgumentException.class) + public void testAddCampaignWithoutIdentifier() { + Campaign campaign = new Campaign(); + campaignService.addCampaign(campaign); + } + + @Test + public void testUpdateCampaign() { + Campaign campaign = getCampaign(); + campaignService.updateCampaign(campaign); + verify(campaignRepository).update(campaign); + + } + + @Test(expected = IllegalArgumentException.class) + public void testUpdateCampaignWithoutIdentifier() { + Campaign campaign = new Campaign(); + campaignService.updateCampaign(campaign); + + } + + @Test + public void testGetCampaign() { + when(campaignRepository.get("ITN_2018_S1")).thenReturn(getCampaign()); + Campaign campaign = campaignService.getCampaign("ITN_2018_S1"); + verify(campaignRepository).get("ITN_2018_S1"); + assertEquals("ITN for 2018 Season 1", campaign.getDescription()); + assertEquals(TaskStatus.READY, campaign.getStatus()); + assertEquals(1542115657234l, campaign.getServerVersion()); + + } + + @Test + public void testGetCampaignWithNoIdentifier() { + Campaign campaign = campaignService.getCampaign(""); + verify(campaignRepository, never()).get(anyString()); + assertNull(campaign); + + } + + @Test + public void testGetCampaigns() { + List expected = new ArrayList<>(); + expected.add(getCampaign()); + when(campaignRepository.getCampaignsByServerVersion(1542115657234l)).thenReturn(expected); + List campaigns = campaignService.getCampaignsByServerVersion(1542115657234l); + verify(campaignRepository).getCampaignsByServerVersion(1542115657234l); + assertEquals(1, campaigns.size()); + assertEquals("ITN_2018_S1", campaigns.get(0).getIdentifier()); + assertEquals("ITN for 2018 Season 1", campaigns.get(0).getDescription()); + assertEquals(TaskStatus.READY, campaigns.get(0).getStatus()); + assertEquals(1542115657234l, campaigns.get(0).getServerVersion()); + + } + + private Campaign getCampaign() { + Campaign campaign = new Campaign(); + campaign.setIdentifier("ITN_2018_S1"); + campaign.setDescription("ITN for 2018 Season 1"); + campaign.setStatus(TaskStatus.READY); + Period executionPeriod = new Period(); + executionPeriod.setStart(new LocalDate("2018-01-01").toDateTimeAtStartOfDay()); + executionPeriod.setEnd(new LocalDate("2018-03-31").toDateTimeAtStartOfDay()); + campaign.setExecutionPeriod(executionPeriod); + campaign.setOwner("superAdmin23"); + campaign.setServerVersion(1542115657234l); + return campaign; + + } } diff --git a/src/test/java/org/opensrp/service/ClientFormServiceTest.java b/src/test/java/org/opensrp/service/ClientFormServiceTest.java index a5c5cfc57..bfaf35648 100644 --- a/src/test/java/org/opensrp/service/ClientFormServiceTest.java +++ b/src/test/java/org/opensrp/service/ClientFormServiceTest.java @@ -19,218 +19,218 @@ public class ClientFormServiceTest extends BaseRepositoryTest { - private ClientFormService clientFormService; - - @Autowired - private ClientFormRepository clientFormRepository; - - private Set scripts = new HashSet(); - - @Before - public void setUpService() { - clientFormService = new ClientFormService(); - clientFormService.setClientFormRepository(clientFormRepository); - } - - @Test - public void isClientFormExistsShouldReturnTrue() { - assertTrue(clientFormService.isClientFormExists("json.form/adverse_event.json")); - } - - @Test - public void getClientFormMetadataByIdentifierAndVersion() { - ClientFormMetadata clientFormMetadata = clientFormService - .getClientFormMetadataByIdentifierAndVersion("json.form/adverse_event.json", "0.0.1"); - assertNotNull(clientFormMetadata); - assertEquals("child", clientFormMetadata.getModule()); - assertNull(clientFormMetadata.getJurisdiction()); - assertEquals("AEFI", clientFormMetadata.getLabel()); - } - - @Test - public void getClientFormById() { - ClientForm clientForm = clientFormService.getClientFormById(3L); - assertNotNull(clientForm.getJson()); - } - - @Test - public void getAvailableClientFormMetadataVersionByIdentifier() { - List idVersionTupleList = clientFormService - .getAvailableClientFormMetadataVersionByIdentifier("json.form/adverse_event.json"); - - Collections.sort(idVersionTupleList, new Comparator() { - - @Override - public int compare(IdVersionTuple idVersionTuple, IdVersionTuple t1) { - return (int) (idVersionTuple.getId() - t1.getId()); - } - }); - - assertEquals(5, idVersionTupleList.size()); - assertEquals("0.0.1", idVersionTupleList.get(0).getVersion()); - assertEquals(1, idVersionTupleList.get(0).getId()); - assertEquals("0.1.2", idVersionTupleList.get(4).getVersion()); - assertEquals(5, idVersionTupleList.get(4).getId()); - } - - @Test - public void getClientFormMetadataById() { - ClientFormMetadata clientFormMetadata = clientFormService.getClientFormMetadataById(3); - assertEquals("0.1.0", clientFormMetadata.getVersion()); - assertEquals("child", clientFormMetadata.getModule()); - assertEquals("json.form/adverse_event.json", clientFormMetadata.getIdentifier()); - } - - @Test - public void testAddClientForm() { - ClientForm clientForm = new ClientForm(); - clientForm.setCreatedAt(new Date()); - clientForm.setJson("{'from': 'child'}"); - - ClientFormMetadata clientFormMetadata = new ClientFormMetadata(); - clientFormMetadata.setModule("child"); - clientFormMetadata.setVersion("1.0.0"); - clientFormMetadata.setIdentifier("json.form/child/sample.json"); - clientFormMetadata.setLabel("SAMPLE FORM"); - clientFormMetadata.setCreatedAt(new Date()); - - ClientFormService.CompleteClientForm completeClientForm = clientFormService - .addClientForm(clientForm, clientFormMetadata); - - assertEquals(clientForm, completeClientForm.clientForm); - assertEquals(clientFormMetadata, completeClientForm.clientFormMetadata); - - assertEquals(7, (long) completeClientForm.clientForm.getId()); - assertEquals(7, (long) completeClientForm.clientFormMetadata.getId()); - } - - @Test - public void testGetAllClientFormMetadataShouldReturnOnlyDraftFormsMetadata() { - int count = 10; - - for (int i = 0; i < count; i++) { - ClientForm clientForm = new ClientForm(); - clientForm.setCreatedAt(new Date()); - clientForm.setJson("{'from': 'child'}"); - - ClientFormMetadata clientFormMetadata = new ClientFormMetadata(); - clientFormMetadata.setModule("child"); - clientFormMetadata.setVersion("1.0." + i); - clientFormMetadata.setIdentifier("json.form/child/sample.json"); - clientFormMetadata.setLabel("SAMPLE FORM"); - clientFormMetadata.setIsDraft(true); - clientFormMetadata.setCreatedAt(new Date()); - - clientFormService.addClientForm(clientForm, clientFormMetadata); - } - - List clientFormMetadataList = clientFormService.getDraftsClientFormMetadata(true); - assertEquals(count, clientFormMetadataList.size()); - } - - @Test - public void testGetAllClientFormMetadataShouldReturnNonDraftFormsMetadata() { - List clientFormMetadataList = clientFormService.getDraftsClientFormMetadata(false); - assertEquals(6, clientFormMetadataList.size()); - } - - @Test - public void testGetAllClientFormMetadataShouldReturnOnlyJsonValidatorFormsMetadata() { - int count = 10; - - for (int i = 0; i < count; i++) { - ClientForm clientForm = new ClientForm(); - clientForm.setCreatedAt(new Date()); - clientForm.setJson("{'from': 'child'}"); - - ClientFormMetadata clientFormMetadata = new ClientFormMetadata(); - clientFormMetadata.setModule("child"); - clientFormMetadata.setVersion("1.0." + i); - clientFormMetadata.setIdentifier("json.form/child/sample.json"); - clientFormMetadata.setLabel("SAMPLE FORM"); - clientFormMetadata.setIsDraft(true); - clientFormMetadata.setIsJsonValidator(true); - clientFormMetadata.setCreatedAt(new Date()); - - clientFormService.addClientForm(clientForm, clientFormMetadata); - } - - List clientFormMetadataList = clientFormService.getJsonWidgetValidatorClientFormMetadata(true); - assertEquals(count, clientFormMetadataList.size()); - } - - @Test - public void testGetAllClientFormMetadataShouldReturnNonJsonValidatorFormsMetadata() { - List clientFormMetadataList = clientFormService.getJsonWidgetValidatorClientFormMetadata(false); - assertEquals(6, clientFormMetadataList.size()); - } - - @Test - public void testGetAllClientFormMetadataShouldReturnAllFormMetadata() { - int count = 10; - - for (int i = 0; i < count; i++) { - ClientForm clientForm = new ClientForm(); - clientForm.setCreatedAt(new Date()); - clientForm.setJson("{'from': 'child'}"); - - ClientFormMetadata clientFormMetadata = new ClientFormMetadata(); - clientFormMetadata.setModule("child"); - clientFormMetadata.setVersion("1.0." + i); - clientFormMetadata.setIdentifier("json.form/child/sample.json"); - clientFormMetadata.setLabel("SAMPLE FORM"); - clientFormMetadata.setIsDraft(true); - clientFormMetadata.setCreatedAt(new Date()); - - clientFormService.addClientForm(clientForm, clientFormMetadata); - } - - List clientFormMetadataList = clientFormService.getAllClientFormMetadata(); - assertEquals(count + 6, clientFormMetadataList.size()); - } - - @Test - public void testGetMostRecentFormValidator() { - int count = 5; - String formIdentifier = "json.form/child/sample.json"; - - for (int i = 0; i < count; i++) { - ClientFormMetadata clientFormMetadata = new ClientFormMetadata(); - clientFormMetadata.setModule("child"); - clientFormMetadata.setVersion("1.0." + i); - clientFormMetadata.setIdentifier(formIdentifier); - clientFormMetadata.setLabel("SAMPLE FORM"); - clientFormMetadata.setIsJsonValidator(true); - clientFormMetadata.setCreatedAt(new Date()); - - ClientForm clientForm = new ClientForm(); - clientForm.setCreatedAt(new Date()); - clientForm.setJson( - clientFormMetadata.getVersion() + "{\"cannot_remove\":{\"title\":\"Fields you cannot remove\",\"fields\":[\"anc_ga\",\"anc_lmp_ga\"]}}"); - - clientFormService.addClientForm(clientForm, clientFormMetadata); - } - - ClientForm clientForm = clientFormService.getMostRecentFormValidator(formIdentifier); - System.out.println(clientForm.getJson()); - assertTrue(((String) clientForm.getJson()).startsWith("\"1.0.4")); - assertEquals((Long) 11L, clientForm.getId()); - } - - @Test - public void testUpdateIsDraftByFormVersion() { - ClientFormMetadata metadata1 = clientFormService.getClientFormMetadataById(5); - assertFalse(metadata1.getIsDraft()); - clientFormService.updateClientFormMetadataIsDraftValueByVersion(true, metadata1.getVersion()); - metadata1 = clientFormService.getClientFormMetadataById(5); - ClientFormMetadata metadata2 = clientFormService.getClientFormMetadataById(6); - assertTrue(metadata1.getIsDraft()); - assertTrue(metadata2.getIsDraft()); - } - - @Override - protected Set getDatabaseScripts() { - scripts.add("client_form.sql"); - return scripts; - } + private ClientFormService clientFormService; + + @Autowired + private ClientFormRepository clientFormRepository; + + private Set scripts = new HashSet(); + + @Before + public void setUpService() { + clientFormService = new ClientFormService(); + clientFormService.setClientFormRepository(clientFormRepository); + } + + @Test + public void isClientFormExistsShouldReturnTrue() { + assertTrue(clientFormService.isClientFormExists("json.form/adverse_event.json")); + } + + @Test + public void getClientFormMetadataByIdentifierAndVersion() { + ClientFormMetadata clientFormMetadata = clientFormService + .getClientFormMetadataByIdentifierAndVersion("json.form/adverse_event.json", "0.0.1"); + assertNotNull(clientFormMetadata); + assertEquals("child", clientFormMetadata.getModule()); + assertNull(clientFormMetadata.getJurisdiction()); + assertEquals("AEFI", clientFormMetadata.getLabel()); + } + + @Test + public void getClientFormById() { + ClientForm clientForm = clientFormService.getClientFormById(3L); + assertNotNull(clientForm.getJson()); + } + + @Test + public void getAvailableClientFormMetadataVersionByIdentifier() { + List idVersionTupleList = clientFormService + .getAvailableClientFormMetadataVersionByIdentifier("json.form/adverse_event.json"); + + Collections.sort(idVersionTupleList, new Comparator() { + + @Override + public int compare(IdVersionTuple idVersionTuple, IdVersionTuple t1) { + return (int) (idVersionTuple.getId() - t1.getId()); + } + }); + + assertEquals(5, idVersionTupleList.size()); + assertEquals("0.0.1", idVersionTupleList.get(0).getVersion()); + assertEquals(1, idVersionTupleList.get(0).getId()); + assertEquals("0.1.2", idVersionTupleList.get(4).getVersion()); + assertEquals(5, idVersionTupleList.get(4).getId()); + } + + @Test + public void getClientFormMetadataById() { + ClientFormMetadata clientFormMetadata = clientFormService.getClientFormMetadataById(3); + assertEquals("0.1.0", clientFormMetadata.getVersion()); + assertEquals("child", clientFormMetadata.getModule()); + assertEquals("json.form/adverse_event.json", clientFormMetadata.getIdentifier()); + } + + @Test + public void testAddClientForm() { + ClientForm clientForm = new ClientForm(); + clientForm.setCreatedAt(new Date()); + clientForm.setJson("{'from': 'child'}"); + + ClientFormMetadata clientFormMetadata = new ClientFormMetadata(); + clientFormMetadata.setModule("child"); + clientFormMetadata.setVersion("1.0.0"); + clientFormMetadata.setIdentifier("json.form/child/sample.json"); + clientFormMetadata.setLabel("SAMPLE FORM"); + clientFormMetadata.setCreatedAt(new Date()); + + ClientFormService.CompleteClientForm completeClientForm = clientFormService + .addClientForm(clientForm, clientFormMetadata); + + assertEquals(clientForm, completeClientForm.clientForm); + assertEquals(clientFormMetadata, completeClientForm.clientFormMetadata); + + assertEquals(7, (long) completeClientForm.clientForm.getId()); + assertEquals(7, (long) completeClientForm.clientFormMetadata.getId()); + } + + @Test + public void testGetAllClientFormMetadataShouldReturnOnlyDraftFormsMetadata() { + int count = 10; + + for (int i = 0; i < count; i++) { + ClientForm clientForm = new ClientForm(); + clientForm.setCreatedAt(new Date()); + clientForm.setJson("{'from': 'child'}"); + + ClientFormMetadata clientFormMetadata = new ClientFormMetadata(); + clientFormMetadata.setModule("child"); + clientFormMetadata.setVersion("1.0." + i); + clientFormMetadata.setIdentifier("json.form/child/sample.json"); + clientFormMetadata.setLabel("SAMPLE FORM"); + clientFormMetadata.setIsDraft(true); + clientFormMetadata.setCreatedAt(new Date()); + + clientFormService.addClientForm(clientForm, clientFormMetadata); + } + + List clientFormMetadataList = clientFormService.getDraftsClientFormMetadata(true); + assertEquals(count, clientFormMetadataList.size()); + } + + @Test + public void testGetAllClientFormMetadataShouldReturnNonDraftFormsMetadata() { + List clientFormMetadataList = clientFormService.getDraftsClientFormMetadata(false); + assertEquals(6, clientFormMetadataList.size()); + } + + @Test + public void testGetAllClientFormMetadataShouldReturnOnlyJsonValidatorFormsMetadata() { + int count = 10; + + for (int i = 0; i < count; i++) { + ClientForm clientForm = new ClientForm(); + clientForm.setCreatedAt(new Date()); + clientForm.setJson("{'from': 'child'}"); + + ClientFormMetadata clientFormMetadata = new ClientFormMetadata(); + clientFormMetadata.setModule("child"); + clientFormMetadata.setVersion("1.0." + i); + clientFormMetadata.setIdentifier("json.form/child/sample.json"); + clientFormMetadata.setLabel("SAMPLE FORM"); + clientFormMetadata.setIsDraft(true); + clientFormMetadata.setIsJsonValidator(true); + clientFormMetadata.setCreatedAt(new Date()); + + clientFormService.addClientForm(clientForm, clientFormMetadata); + } + + List clientFormMetadataList = clientFormService.getJsonWidgetValidatorClientFormMetadata(true); + assertEquals(count, clientFormMetadataList.size()); + } + + @Test + public void testGetAllClientFormMetadataShouldReturnNonJsonValidatorFormsMetadata() { + List clientFormMetadataList = clientFormService.getJsonWidgetValidatorClientFormMetadata(false); + assertEquals(6, clientFormMetadataList.size()); + } + + @Test + public void testGetAllClientFormMetadataShouldReturnAllFormMetadata() { + int count = 10; + + for (int i = 0; i < count; i++) { + ClientForm clientForm = new ClientForm(); + clientForm.setCreatedAt(new Date()); + clientForm.setJson("{'from': 'child'}"); + + ClientFormMetadata clientFormMetadata = new ClientFormMetadata(); + clientFormMetadata.setModule("child"); + clientFormMetadata.setVersion("1.0." + i); + clientFormMetadata.setIdentifier("json.form/child/sample.json"); + clientFormMetadata.setLabel("SAMPLE FORM"); + clientFormMetadata.setIsDraft(true); + clientFormMetadata.setCreatedAt(new Date()); + + clientFormService.addClientForm(clientForm, clientFormMetadata); + } + + List clientFormMetadataList = clientFormService.getAllClientFormMetadata(); + assertEquals(count + 6, clientFormMetadataList.size()); + } + + @Test + public void testGetMostRecentFormValidator() { + int count = 5; + String formIdentifier = "json.form/child/sample.json"; + + for (int i = 0; i < count; i++) { + ClientFormMetadata clientFormMetadata = new ClientFormMetadata(); + clientFormMetadata.setModule("child"); + clientFormMetadata.setVersion("1.0." + i); + clientFormMetadata.setIdentifier(formIdentifier); + clientFormMetadata.setLabel("SAMPLE FORM"); + clientFormMetadata.setIsJsonValidator(true); + clientFormMetadata.setCreatedAt(new Date()); + + ClientForm clientForm = new ClientForm(); + clientForm.setCreatedAt(new Date()); + clientForm.setJson( + clientFormMetadata.getVersion() + "{\"cannot_remove\":{\"title\":\"Fields you cannot remove\",\"fields\":[\"anc_ga\",\"anc_lmp_ga\"]}}"); + + clientFormService.addClientForm(clientForm, clientFormMetadata); + } + + ClientForm clientForm = clientFormService.getMostRecentFormValidator(formIdentifier); + System.out.println(clientForm.getJson()); + assertTrue(((String) clientForm.getJson()).startsWith("\"1.0.4")); + assertEquals((Long) 11L, clientForm.getId()); + } + + @Test + public void testUpdateIsDraftByFormVersion() { + ClientFormMetadata metadata1 = clientFormService.getClientFormMetadataById(5); + assertFalse(metadata1.getIsDraft()); + clientFormService.updateClientFormMetadataIsDraftValueByVersion(true, metadata1.getVersion()); + metadata1 = clientFormService.getClientFormMetadataById(5); + ClientFormMetadata metadata2 = clientFormService.getClientFormMetadataById(6); + assertTrue(metadata1.getIsDraft()); + assertTrue(metadata2.getIsDraft()); + } + + @Override + protected Set getDatabaseScripts() { + scripts.add("client_form.sql"); + return scripts; + } } diff --git a/src/test/java/org/opensrp/service/ClientMigrationFileServiceTest.java b/src/test/java/org/opensrp/service/ClientMigrationFileServiceTest.java index f19e960fa..0a7fc015e 100644 --- a/src/test/java/org/opensrp/service/ClientMigrationFileServiceTest.java +++ b/src/test/java/org/opensrp/service/ClientMigrationFileServiceTest.java @@ -20,242 +20,242 @@ public class ClientMigrationFileServiceTest extends BaseRepositoryTest { - private ClientMigrationFileService clientMigrationFileService; + private ClientMigrationFileService clientMigrationFileService; - private ClientMigrationFileRepository clientMigrationFileRepository; + private ClientMigrationFileRepository clientMigrationFileRepository; - private Set scripts = new HashSet(); + private Set scripts = new HashSet(); - @Before - public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); - clientMigrationFileService = Mockito.mock(ClientMigrationFileService.class); - clientMigrationFileRepository = Mockito.mock(ClientMigrationFileRepository.class); + clientMigrationFileService = Mockito.mock(ClientMigrationFileService.class); + clientMigrationFileRepository = Mockito.mock(ClientMigrationFileRepository.class); - clientMigrationFileService = new ClientMigrationFileService(); - clientMigrationFileService.setClientMigrationFileRepository(clientMigrationFileRepository); - } + clientMigrationFileService = new ClientMigrationFileService(); + clientMigrationFileService.setClientMigrationFileRepository(clientMigrationFileRepository); + } - @Test - public void setClientMigrationFileRepository() { - clientMigrationFileService.setClientMigrationFileRepository(clientMigrationFileRepository); + @Test + public void setClientMigrationFileRepository() { + clientMigrationFileService.setClientMigrationFileRepository(clientMigrationFileRepository); - Assert.assertEquals(clientMigrationFileRepository, clientMigrationFileService.getClientMigrationFileRepository()); - } + Assert.assertEquals(clientMigrationFileRepository, clientMigrationFileService.getClientMigrationFileRepository()); + } - @Test - public void getClientMigrationFileRepository() { - Whitebox.setInternalState(clientMigrationFileService, "clientMigrationFileRepository", clientMigrationFileRepository); + @Test + public void getClientMigrationFileRepository() { + Whitebox.setInternalState(clientMigrationFileService, "clientMigrationFileRepository", clientMigrationFileRepository); - Assert.assertEquals(clientMigrationFileRepository, clientMigrationFileService.getClientMigrationFileRepository()); - } + Assert.assertEquals(clientMigrationFileRepository, clientMigrationFileService.getClientMigrationFileRepository()); + } - @Test - public void getAllClientMigrationFiles() { - clientMigrationFileService.getAllClientMigrationFiles(); + @Test + public void getAllClientMigrationFiles() { + clientMigrationFileService.getAllClientMigrationFiles(); - Mockito.verify(clientMigrationFileRepository).getAll(); - } + Mockito.verify(clientMigrationFileRepository).getAll(); + } - @Test - public void testGetAllClientMigrationFiles() { - int limit = 78; - clientMigrationFileService.getAllClientMigrationFiles(limit); + @Test + public void testGetAllClientMigrationFiles() { + int limit = 78; + clientMigrationFileService.getAllClientMigrationFiles(limit); - Mockito.verify(clientMigrationFileRepository).getAll(limit); - } + Mockito.verify(clientMigrationFileRepository).getAll(limit); + } - @Test - public void addOrUpdateClientMigrationFileShouldCallRepositoryAddMethod() { - ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); - clientMigrationFile.setIdentifier("my-identifier"); + @Test + public void addOrUpdateClientMigrationFileShouldCallRepositoryAddMethod() { + ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); + clientMigrationFile.setIdentifier("my-identifier"); - clientMigrationFileService.addOrUpdateClientMigrationFile(clientMigrationFile); + clientMigrationFileService.addOrUpdateClientMigrationFile(clientMigrationFile); - Mockito.verify(clientMigrationFileRepository).add(clientMigrationFile); - } + Mockito.verify(clientMigrationFileRepository).add(clientMigrationFile); + } - @Test - public void addOrUpdateClientMigrationFileShouldCallRepositoryUpdateMethod() { - ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); - clientMigrationFile.setIdentifier("my-identifier"); + @Test + public void addOrUpdateClientMigrationFileShouldCallRepositoryUpdateMethod() { + ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); + clientMigrationFile.setIdentifier("my-identifier"); - Mockito.doReturn(clientMigrationFile).when(clientMigrationFileRepository).get("my-identifier"); + Mockito.doReturn(clientMigrationFile).when(clientMigrationFileRepository).get("my-identifier"); - // Call the method under test - clientMigrationFileService.addOrUpdateClientMigrationFile(clientMigrationFile); + // Call the method under test + clientMigrationFileService.addOrUpdateClientMigrationFile(clientMigrationFile); - Mockito.verify(clientMigrationFileRepository).update(clientMigrationFile); - } + Mockito.verify(clientMigrationFileRepository).update(clientMigrationFile); + } - @Test(expected = IllegalArgumentException.class) - public void addOrUpdateClientMigrationFileShouldThrowExceptionWhenGivenClientMigrationFileWithoutIdentifier() { - ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); + @Test(expected = IllegalArgumentException.class) + public void addOrUpdateClientMigrationFileShouldThrowExceptionWhenGivenClientMigrationFileWithoutIdentifier() { + ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); - // Call the method under test - clientMigrationFileService.addOrUpdateClientMigrationFile(clientMigrationFile); - } + // Call the method under test + clientMigrationFileService.addOrUpdateClientMigrationFile(clientMigrationFile); + } - @Test(expected = IllegalArgumentException.class) - public void addClientMigrationFileShouldThrowExceptionWhenGivenClientMigrationFileWithoutIdentifier() { - ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); + @Test(expected = IllegalArgumentException.class) + public void addClientMigrationFileShouldThrowExceptionWhenGivenClientMigrationFileWithoutIdentifier() { + ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); - clientMigrationFileService.addClientMigrationFile(clientMigrationFile); - } + clientMigrationFileService.addClientMigrationFile(clientMigrationFile); + } - @Test - public void addClientMigrationFileShouldCallRepositoryAddMethod() { - ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); - clientMigrationFile.setIdentifier("my-identifier"); + @Test + public void addClientMigrationFileShouldCallRepositoryAddMethod() { + ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); + clientMigrationFile.setIdentifier("my-identifier"); - // call the method under test - Assert.assertNotNull(clientMigrationFileService.addClientMigrationFile(clientMigrationFile)); + // call the method under test + Assert.assertNotNull(clientMigrationFileService.addClientMigrationFile(clientMigrationFile)); - Mockito.verify(clientMigrationFileRepository).add(clientMigrationFile); - } + Mockito.verify(clientMigrationFileRepository).add(clientMigrationFile); + } - @Test(expected = IllegalArgumentException.class) - public void updateClientMigrationFileShouldThrowExceptionWhenGivenClientMigrationFileWithoutIdentifier() { - ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); + @Test(expected = IllegalArgumentException.class) + public void updateClientMigrationFileShouldThrowExceptionWhenGivenClientMigrationFileWithoutIdentifier() { + ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); - clientMigrationFileService.updateClientMigrationFile(clientMigrationFile); - } + clientMigrationFileService.updateClientMigrationFile(clientMigrationFile); + } - @Test - public void updateClientMigrationFileShouldCallRepositoryUpdateClientMigrationFile() { - ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); - clientMigrationFile.setIdentifier("my-identifier"); + @Test + public void updateClientMigrationFileShouldCallRepositoryUpdateClientMigrationFile() { + ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); + clientMigrationFile.setIdentifier("my-identifier"); - clientMigrationFileService.updateClientMigrationFile(clientMigrationFile); + clientMigrationFileService.updateClientMigrationFile(clientMigrationFile); - Mockito.verify(clientMigrationFileRepository).update(clientMigrationFile); - } + Mockito.verify(clientMigrationFileRepository).update(clientMigrationFile); + } - @Test - public void getClientMigrationFileShouldReturnClientMigrationFile() { - String identifier = "my-identifier"; + @Test + public void getClientMigrationFileShouldReturnClientMigrationFile() { + String identifier = "my-identifier"; - ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); - clientMigrationFile.setIdentifier(identifier); - Mockito.doReturn(clientMigrationFile).when(clientMigrationFileRepository).getClientMigrationFileByIdentifier(identifier); + ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); + clientMigrationFile.setIdentifier(identifier); + Mockito.doReturn(clientMigrationFile).when(clientMigrationFileRepository).getClientMigrationFileByIdentifier(identifier); - // call the method under test - Assert.assertEquals(clientMigrationFile, clientMigrationFileService.getClientMigrationFile(identifier)); + // call the method under test + Assert.assertEquals(clientMigrationFile, clientMigrationFileService.getClientMigrationFile(identifier)); - Mockito.verify(clientMigrationFileRepository).getClientMigrationFileByIdentifier(identifier); - } + Mockito.verify(clientMigrationFileRepository).getClientMigrationFileByIdentifier(identifier); + } - @Test - public void getClientMigrationFileShouldReturnNull() { - // call the method under test - Assert.assertNull(clientMigrationFileService.getClientMigrationFile(null)); + @Test + public void getClientMigrationFileShouldReturnNull() { + // call the method under test + Assert.assertNull(clientMigrationFileService.getClientMigrationFile(null)); - Mockito.verify(clientMigrationFileRepository, Mockito.never()).getClientMigrationFileByIdentifier(Mockito.nullable(String.class)); - } + Mockito.verify(clientMigrationFileRepository, Mockito.never()).getClientMigrationFileByIdentifier(Mockito.nullable(String.class)); + } - @Test - public void saveClientMigrationFilesShouldCallAddOrUpdateClientMigrationFileAndReturnEmptyErrorSet() { - ClientMigrationFileService clientMigrationFileService1 = Mockito.spy(clientMigrationFileService); + @Test + public void saveClientMigrationFilesShouldCallAddOrUpdateClientMigrationFileAndReturnEmptyErrorSet() { + ClientMigrationFileService clientMigrationFileService1 = Mockito.spy(clientMigrationFileService); - List clientMigrationFileList = new ArrayList<>(); + List clientMigrationFileList = new ArrayList<>(); - for (int i = 0; i < 8; i++) { - ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); - clientMigrationFile.setIdentifier(UUID.randomUUID().toString()); - clientMigrationFileList.add(clientMigrationFile); - } + for (int i = 0; i < 8; i++) { + ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); + clientMigrationFile.setIdentifier(UUID.randomUUID().toString()); + clientMigrationFileList.add(clientMigrationFile); + } - ArgumentCaptor clientMigrationFileArgumentCaptor = ArgumentCaptor.forClass(ClientMigrationFile.class); + ArgumentCaptor clientMigrationFileArgumentCaptor = ArgumentCaptor.forClass(ClientMigrationFile.class); - // Call the method under test - ArrayList errorSet = clientMigrationFileService1.saveClientMigrationFiles(clientMigrationFileList); + // Call the method under test + ArrayList errorSet = clientMigrationFileService1.saveClientMigrationFiles(clientMigrationFileList); - Mockito.verify(clientMigrationFileService1, Mockito.times(8)).addOrUpdateClientMigrationFile( - clientMigrationFileArgumentCaptor.capture()); + Mockito.verify(clientMigrationFileService1, Mockito.times(8)).addOrUpdateClientMigrationFile( + clientMigrationFileArgumentCaptor.capture()); - Assert.assertEquals(0, errorSet.size()); - Assert.assertEquals(8, clientMigrationFileArgumentCaptor.getAllValues().size()); - } + Assert.assertEquals(0, errorSet.size()); + Assert.assertEquals(8, clientMigrationFileArgumentCaptor.getAllValues().size()); + } - @Test - public void saveClientMigrationFilesShouldReturnSaveErrors() { - ClientMigrationFileService clientMigrationFileService1 = Mockito.spy(clientMigrationFileService); + @Test + public void saveClientMigrationFilesShouldReturnSaveErrors() { + ClientMigrationFileService clientMigrationFileService1 = Mockito.spy(clientMigrationFileService); - List clientMigrationFileList = new ArrayList<>(); + List clientMigrationFileList = new ArrayList<>(); - for (int i = 0; i < 8; i++) { - clientMigrationFileList.add(new ClientMigrationFile()); - } + for (int i = 0; i < 8; i++) { + clientMigrationFileList.add(new ClientMigrationFile()); + } - ArgumentCaptor clientMigrationFileArgumentCaptor = ArgumentCaptor.forClass(ClientMigrationFile.class); + ArgumentCaptor clientMigrationFileArgumentCaptor = ArgumentCaptor.forClass(ClientMigrationFile.class); - // Call the method under test - ArrayList errorSet = clientMigrationFileService1.saveClientMigrationFiles(clientMigrationFileList); + // Call the method under test + ArrayList errorSet = clientMigrationFileService1.saveClientMigrationFiles(clientMigrationFileList); - Mockito.verify(clientMigrationFileService1, Mockito.times(8)).addOrUpdateClientMigrationFile( - clientMigrationFileArgumentCaptor.capture()); + Mockito.verify(clientMigrationFileService1, Mockito.times(8)).addOrUpdateClientMigrationFile( + clientMigrationFileArgumentCaptor.capture()); - Assert.assertEquals(8, errorSet.size()); - Assert.assertEquals(8, clientMigrationFileArgumentCaptor.getAllValues().size()); - Assert.assertEquals("unknown file!!", errorSet.get(0)); - } + Assert.assertEquals(8, errorSet.size()); + Assert.assertEquals(8, clientMigrationFileArgumentCaptor.getAllValues().size()); + Assert.assertEquals("unknown file!!", errorSet.get(0)); + } - @Test(expected = IllegalArgumentException.class) - public void deleteClientMigrationFileShouldThrowExceptionWhenGivenClientMigrationFileWithoutIdentifier() { - clientMigrationFileService.deleteClientMigrationFile(new ClientMigrationFile()); - } + @Test(expected = IllegalArgumentException.class) + public void deleteClientMigrationFileShouldThrowExceptionWhenGivenClientMigrationFileWithoutIdentifier() { + clientMigrationFileService.deleteClientMigrationFile(new ClientMigrationFile()); + } - @Test - public void deleteClientMigrationFileShouldCallRepositorySafeRemove() { - ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); - clientMigrationFile.setIdentifier("my-identifier"); + @Test + public void deleteClientMigrationFileShouldCallRepositorySafeRemove() { + ClientMigrationFile clientMigrationFile = new ClientMigrationFile(); + clientMigrationFile.setIdentifier("my-identifier"); - clientMigrationFileService.deleteClientMigrationFile(clientMigrationFile); + clientMigrationFileService.deleteClientMigrationFile(clientMigrationFile); - Mockito.verify(clientMigrationFileRepository).safeRemove(clientMigrationFile); - } + Mockito.verify(clientMigrationFileRepository).safeRemove(clientMigrationFile); + } - @Test - public void getClientMigrationFileByFilenameShouldCallRepositoryMethod() { - String filename = "89.up.sql"; - clientMigrationFileService.getClientMigrationFileByFilename(filename); + @Test + public void getClientMigrationFileByFilenameShouldCallRepositoryMethod() { + String filename = "89.up.sql"; + clientMigrationFileService.getClientMigrationFileByFilename(filename); - Mockito.verify(clientMigrationFileRepository).getClientMigrationFileByFilename(filename); - } + Mockito.verify(clientMigrationFileRepository).getClientMigrationFileByFilename(filename); + } - @Test - public void getClientMigrationFileByFilenameShouldReturnNullWhenFilenamebIsBlank() { - Assert.assertNull(clientMigrationFileService.getClientMigrationFileByFilename(null)); - } + @Test + public void getClientMigrationFileByFilenameShouldReturnNullWhenFilenamebIsBlank() { + Assert.assertNull(clientMigrationFileService.getClientMigrationFileByFilename(null)); + } - @Test - public void getClientMigrationFileByVersion() { - int version = 7; - clientMigrationFileService.getClientMigrationFileByVersion(version); + @Test + public void getClientMigrationFileByVersion() { + int version = 7; + clientMigrationFileService.getClientMigrationFileByVersion(version); - Mockito.verify(clientMigrationFileRepository).getClientMigrationFileByVersion(version); - } + Mockito.verify(clientMigrationFileRepository).getClientMigrationFileByVersion(version); + } - @Test - public void getClientMigrationFileByManifestId() { - int manifestId = 7; - clientMigrationFileService.getClientMigrationFileByManifestId(manifestId); + @Test + public void getClientMigrationFileByManifestId() { + int manifestId = 7; + clientMigrationFileService.getClientMigrationFileByManifestId(manifestId); - Mockito.verify(clientMigrationFileRepository).getClientMigrationFileByManifestId(manifestId); - } + Mockito.verify(clientMigrationFileRepository).getClientMigrationFileByManifestId(manifestId); + } - @Test - public void getClientMigrationFileById() { - int id = 7; - clientMigrationFileService.getClientMigrationFileById(id); + @Test + public void getClientMigrationFileById() { + int id = 7; + clientMigrationFileService.getClientMigrationFileById(id); - Mockito.verify(clientMigrationFileRepository).getClientMigrationFileById(id); - } + Mockito.verify(clientMigrationFileRepository).getClientMigrationFileById(id); + } - @Override - protected Set getDatabaseScripts() { - scripts.add("client_form.sql"); - return scripts; - } + @Override + protected Set getDatabaseScripts() { + scripts.add("client_form.sql"); + return scripts; + } } diff --git a/src/test/java/org/opensrp/service/ClientServiceTest.java b/src/test/java/org/opensrp/service/ClientServiceTest.java index c0138fe86..8e025bf7c 100644 --- a/src/test/java/org/opensrp/service/ClientServiceTest.java +++ b/src/test/java/org/opensrp/service/ClientServiceTest.java @@ -26,243 +26,243 @@ public class ClientServiceTest extends BaseRepositoryTest { - private ClientService clientService; - - @Autowired - @Qualifier("clientsRepositoryPostgres") - private ClientsRepository clientsRepository; - - @Before - public void setUpPostgresRepository() { - clientService = new ClientService(clientsRepository); - } - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("client.sql"); - return scripts; - } - - @Test - public void testAddClient() { - Client client = new Client("f67823b0-378e-4a35-93fc-bb00def74e2f").withBirthdate(new DateTime("2017-03-31"), true) - .withGender("Male").withFirstName("xobili").withLastName("mbangwa"); - client.withIdentifier("ZEIR_ID", "233864-8").withAttribute("Home_Facility", "Linda"); - clientService.addClient(client); - assertEquals(24, clientService.findAllClients().size()); - - Client savedClient = clientService.find("f67823b0-378e-4a35-93fc-bb00def74e2f"); - assertNotNull(savedClient.getId()); - assertEquals(new DateTime("2017-03-31"), client.getBirthdate()); - assertEquals("xobili", client.getFirstName()); - assertEquals("mbangwa", client.getLastName()); - assertEquals("233864-8", client.getIdentifier("ZEIR_ID")); - - //test adding existing client is updated - DateTime timeBeforeUpdate = new DateTime(); - savedClient.withMiddleName("Rustus"); - clientService.addClient(savedClient); - - Client updatedClient = clientService.find(savedClient.getBaseEntityId()); - assertEquals("Rustus", updatedClient.getMiddleName()); - assertEquals(ClientsRepositoryImpl.REVISION_PREFIX + 2, updatedClient.getRevision()); - assertTrue(timeBeforeUpdate.isBefore(updatedClient.getDateEdited())); - - } - - @Test - public void testFindClient() { - Client client = new Client("33d9a17f-d729-4276-9891-b43e8b60fd12"); - assertEquals("05934ae338431f28bf6793b24159c647", clientService.findClient(client).getId()); - - client.withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "9c4260f2-d296-4af1-b771-debda1b6cfd1").withIdentifier( - "ZEIR_ID", "218220-2"); - assertEquals("05934ae338431f28bf6793b24159c647", clientService.findClient(client).getId()); - - client = new Client(""); - client.withIdentifier("ZEIR_ID", "218220-211"); - assertNull(clientService.findClient(client)); - - client.withBaseEntityId("3423fdsf-23423-hjh23423"); - - assertNull(clientService.findClient(client)); - - client = new Client(""); - assertNull(clientService.findClient(client)); - - client.withIdentifier("ZEIR_ID", "218225-1"); - assertEquals("05934ae338431f28bf6793b24167817d", clientService.findClient(client).getId()); - } - - @Test - public void testFind() { - assertEquals("05934ae338431f28bf6793b24159c647", clientService.find("33d9a17f-d729-4276-9891-b43e8b60fd12").getId()); - - assertNull(clientService.find("3423fdsf-23423-hjh23423")); - } - - @Test(expected = IllegalArgumentException.class) - public void testUpdateClientNewClient() throws JSONException { - Client client = new Client("33d9a17f-d729-4276-9891-b43e8b60fd12"); - clientService.updateClient(client); - } - - @Test(expected = IllegalArgumentException.class) - public void testUpdateClientClientNotExists() throws JSONException { - Client client = clientService.find("67007c17-97bb-4732-a1b8-3a0c292b5432"); - clientsRepository.safeRemove(client); - client.setFirstName("Conses"); - clientService.updateClient(client); - } - - @Test() - public void testUpdateClient() throws JSONException { - Client client = clientService.find("67007c17-97bb-4732-a1b8-3a0c292b5432"); - client.withFirstName("Conses").withMiddleName("Divens") - .withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "2321312-dsfsd"); - clientService.updateClient(client); - - Client updatedClient = clientService.find("67007c17-97bb-4732-a1b8-3a0c292b5432"); - assertEquals("Conses", updatedClient.getFirstName()); - assertEquals("Divens", updatedClient.getMiddleName()); - assertEquals("2321312-dsfsd", updatedClient.getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); - } - - @Test - public void testMergeClient() { - Client client = clientService.find("cc127350-c1cd-4c3a-99d4-4d632882f522"); - Address address = new Address().withCountry("KE").withStateProvince("Punja").withAddressType("home"); - - client.withFirstName("Conses").withMiddleName("Divens") - .withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "2321312-dsfsd").withAttribute("Zone", "Zone3") - .withAddress(address); - - Client mergedClient = clientService.mergeClient(client); - assertEquals("Conses", mergedClient.getFirstName()); - assertEquals("Divens", mergedClient.getMiddleName()); - assertEquals("2321312-dsfsd", mergedClient.getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); - assertEquals("Zone3", mergedClient.getAttribute("Zone")); - assertEquals(address, mergedClient.getAddress(address.getAddressType())); - - } - - @Test - public void testAddorUpdate() { - Client client = new Client("f67823b0-378e-4a35-93fc-bb00def74e2f").withBirthdate(new DateTime("2017-03-31"), true) - .withGender("Male").withFirstName("xobili").withLastName("mbangwa"); - client.withIdentifier("ZEIR_ID", "233864-8").withAttribute("Home_Facility", "Linda"); - clientService.addorUpdate(client); - assertEquals(24, clientService.findAllClients().size()); - - Client savedClient = clientService.find("f67823b0-378e-4a35-93fc-bb00def74e2f"); - assertNotNull(savedClient.getId()); - assertEquals(new DateTime("2017-03-31"), client.getBirthdate()); - assertEquals("xobili", client.getFirstName()); - assertEquals("mbangwa", client.getLastName()); - assertEquals("233864-8", client.getIdentifier("ZEIR_ID")); - - //test adding existing client is updated - DateTime timeBeforeUpdate = new DateTime(); - savedClient.withMiddleName("Rustus"); - clientService.addorUpdate(savedClient); - - Client updatedClient = clientService.find(savedClient.getBaseEntityId()); - assertEquals("Rustus", updatedClient.getMiddleName()); - assertEquals(ClientsRepositoryImpl.REVISION_PREFIX + 2, updatedClient.getRevision()); - assertTrue(timeBeforeUpdate.isBefore(updatedClient.getDateEdited())); - } - - @Test - public void testAddorUpdateWithServerVersionFlag() { - Client client = new Client("f67823b0-378e-4a35-93fc-bb00def74e2f").withBirthdate(new DateTime("2017-03-31"), true) - .withGender("Male").withFirstName("xobili").withLastName("mbangwa"); - client.withIdentifier("ZEIR_ID", "233864-8").withAttribute("Home_Facility", "Linda"); - clientService.addorUpdate(client, false); - assertEquals(24, clientService.findAllClients().size()); - - Client savedClient = clientService.find("f67823b0-378e-4a35-93fc-bb00def74e2f"); - assertNotNull(savedClient.getId()); - assertEquals(new DateTime("2017-03-31"), client.getBirthdate()); - assertEquals("xobili", client.getFirstName()); - assertEquals("mbangwa", client.getLastName()); - assertEquals("233864-8", client.getIdentifier("ZEIR_ID")); - - long existingServerVesion = savedClient.getServerVersion(); - //test adding existing client is updated - DateTime timeBeforeUpdate = new DateTime(); - savedClient.withMiddleName("Rustus"); - clientService.addorUpdate(savedClient, false); - - Client updatedClient = clientService.find(savedClient.getBaseEntityId()); - assertEquals("Rustus", updatedClient.getMiddleName()); - assertEquals(ClientsRepositoryImpl.REVISION_PREFIX + 2, updatedClient.getRevision()); - assertTrue(timeBeforeUpdate.isBefore(updatedClient.getDateEdited())); - assertNotEquals(existingServerVesion, updatedClient.getServerVersion().longValue()); - assertNotNull(updatedClient.getServerVersion()); - - clientService.addorUpdate(savedClient, true); - assertNotNull(clientService.find(savedClient.getBaseEntityId()).getServerVersion()); - } - - @Test - public void testFindByClientTypeAndLocationId() { - Client client = new Client("f67823b0-378e-4a35-93fc-bb00def75e2f").withBirthdate(new DateTime("2017-03-31"), true) - .withGender("Male").withFirstName("xobili").withLastName("mbangwa"); - client.setClientType("test-client-type"); - client.setLocationId("test-location-id"); - clientService.addClient(client); - List clients = clientService.findByClientTypeAndLocationId("test-client-type", "test-location-id"); - assertEquals(1, clients.size()); - assertEquals("f67823b0-378e-4a35-93fc-bb00def75e2f", clients.get(0).getBaseEntityId()); - } - - @Test - public void testFindAllByIdentifier() { - List clients = clientService.findAllByIdentifier("ZEIR_ID", "218221-0"); - assertEquals(2, clients.size()); - } - - @Test - public void testFindByRelationship() { - List clients = clientService.findByRelationship("d0ecee83-6ccd-4096-9188-f63a40fa2f63"); - assertNotNull(clients); - assertEquals("33d9a17f-d729-4276-9891-b43e8b60fd12", clients.get(0).getBaseEntityId()); - } - - @Test - public void testFindByRelationshipIdAndType() { - List clients = clientService.findByRelationshipIdAndType("mother", "d0ecee83-6ccd-4096-9188-f63a40fa2f63"); - assertNotNull(clients); - assertEquals("33d9a17f-d729-4276-9891-b43e8b60fd12", clients.get(0).getBaseEntityId()); - } - - @Test - public void testFindAllByAttribute() { - List clients = clientService.findAllByAttribute("Father_NRC_Number","721345/67/8"); - assertNotNull(clients); - assertEquals("86c039a2-0b68-4166-849e-f49897e3a510", clients.get(0).getBaseEntityId()); - } - - @Test - public void testFindAllByAttributeOutOfCatchment() { - List clients = clientService.findAllByAttributeOutOfCatchment("Father_NRC_Number","721345/67/8"); - assertNotNull(clients); - assertEquals("86c039a2-0b68-4166-849e-f49897e3a510", clients.get(0).getBaseEntityId()); - } - - @Test - public void testFindAllByAttributes() { - List attributes = asList("Dar Naim", "Happy Kids Clinic"); - List clients = clientService.findAllByAttributes("Home_Facility", attributes); - assertNotNull(clients); - assertEquals(9, clients.size()); - } - - @Test - public void testFindAllByMatchingName() { - List clients = clientService.findAllByMatchingName("Child"); - assertNotNull(clients); - assertEquals(6, clients.size()); - } + private ClientService clientService; + + @Autowired + @Qualifier("clientsRepositoryPostgres") + private ClientsRepository clientsRepository; + + @Before + public void setUpPostgresRepository() { + clientService = new ClientService(clientsRepository); + } + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("client.sql"); + return scripts; + } + + @Test + public void testAddClient() { + Client client = new Client("f67823b0-378e-4a35-93fc-bb00def74e2f").withBirthdate(new DateTime("2017-03-31"), true) + .withGender("Male").withFirstName("xobili").withLastName("mbangwa"); + client.withIdentifier("ZEIR_ID", "233864-8").withAttribute("Home_Facility", "Linda"); + clientService.addClient(client); + assertEquals(24, clientService.findAllClients().size()); + + Client savedClient = clientService.find("f67823b0-378e-4a35-93fc-bb00def74e2f"); + assertNotNull(savedClient.getId()); + assertEquals(new DateTime("2017-03-31"), client.getBirthdate()); + assertEquals("xobili", client.getFirstName()); + assertEquals("mbangwa", client.getLastName()); + assertEquals("233864-8", client.getIdentifier("ZEIR_ID")); + + //test adding existing client is updated + DateTime timeBeforeUpdate = new DateTime(); + savedClient.withMiddleName("Rustus"); + clientService.addClient(savedClient); + + Client updatedClient = clientService.find(savedClient.getBaseEntityId()); + assertEquals("Rustus", updatedClient.getMiddleName()); + assertEquals(ClientsRepositoryImpl.REVISION_PREFIX + 2, updatedClient.getRevision()); + assertTrue(timeBeforeUpdate.isBefore(updatedClient.getDateEdited())); + + } + + @Test + public void testFindClient() { + Client client = new Client("33d9a17f-d729-4276-9891-b43e8b60fd12"); + assertEquals("05934ae338431f28bf6793b24159c647", clientService.findClient(client).getId()); + + client.withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "9c4260f2-d296-4af1-b771-debda1b6cfd1").withIdentifier( + "ZEIR_ID", "218220-2"); + assertEquals("05934ae338431f28bf6793b24159c647", clientService.findClient(client).getId()); + + client = new Client(""); + client.withIdentifier("ZEIR_ID", "218220-211"); + assertNull(clientService.findClient(client)); + + client.withBaseEntityId("3423fdsf-23423-hjh23423"); + + assertNull(clientService.findClient(client)); + + client = new Client(""); + assertNull(clientService.findClient(client)); + + client.withIdentifier("ZEIR_ID", "218225-1"); + assertEquals("05934ae338431f28bf6793b24167817d", clientService.findClient(client).getId()); + } + + @Test + public void testFind() { + assertEquals("05934ae338431f28bf6793b24159c647", clientService.find("33d9a17f-d729-4276-9891-b43e8b60fd12").getId()); + + assertNull(clientService.find("3423fdsf-23423-hjh23423")); + } + + @Test(expected = IllegalArgumentException.class) + public void testUpdateClientNewClient() throws JSONException { + Client client = new Client("33d9a17f-d729-4276-9891-b43e8b60fd12"); + clientService.updateClient(client); + } + + @Test(expected = IllegalArgumentException.class) + public void testUpdateClientClientNotExists() throws JSONException { + Client client = clientService.find("67007c17-97bb-4732-a1b8-3a0c292b5432"); + clientsRepository.safeRemove(client); + client.setFirstName("Conses"); + clientService.updateClient(client); + } + + @Test() + public void testUpdateClient() throws JSONException { + Client client = clientService.find("67007c17-97bb-4732-a1b8-3a0c292b5432"); + client.withFirstName("Conses").withMiddleName("Divens") + .withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "2321312-dsfsd"); + clientService.updateClient(client); + + Client updatedClient = clientService.find("67007c17-97bb-4732-a1b8-3a0c292b5432"); + assertEquals("Conses", updatedClient.getFirstName()); + assertEquals("Divens", updatedClient.getMiddleName()); + assertEquals("2321312-dsfsd", updatedClient.getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); + } + + @Test + public void testMergeClient() { + Client client = clientService.find("cc127350-c1cd-4c3a-99d4-4d632882f522"); + Address address = new Address().withCountry("KE").withStateProvince("Punja").withAddressType("home"); + + client.withFirstName("Conses").withMiddleName("Divens") + .withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "2321312-dsfsd").withAttribute("Zone", "Zone3") + .withAddress(address); + + Client mergedClient = clientService.mergeClient(client); + assertEquals("Conses", mergedClient.getFirstName()); + assertEquals("Divens", mergedClient.getMiddleName()); + assertEquals("2321312-dsfsd", mergedClient.getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); + assertEquals("Zone3", mergedClient.getAttribute("Zone")); + assertEquals(address, mergedClient.getAddress(address.getAddressType())); + + } + + @Test + public void testAddorUpdate() { + Client client = new Client("f67823b0-378e-4a35-93fc-bb00def74e2f").withBirthdate(new DateTime("2017-03-31"), true) + .withGender("Male").withFirstName("xobili").withLastName("mbangwa"); + client.withIdentifier("ZEIR_ID", "233864-8").withAttribute("Home_Facility", "Linda"); + clientService.addorUpdate(client); + assertEquals(24, clientService.findAllClients().size()); + + Client savedClient = clientService.find("f67823b0-378e-4a35-93fc-bb00def74e2f"); + assertNotNull(savedClient.getId()); + assertEquals(new DateTime("2017-03-31"), client.getBirthdate()); + assertEquals("xobili", client.getFirstName()); + assertEquals("mbangwa", client.getLastName()); + assertEquals("233864-8", client.getIdentifier("ZEIR_ID")); + + //test adding existing client is updated + DateTime timeBeforeUpdate = new DateTime(); + savedClient.withMiddleName("Rustus"); + clientService.addorUpdate(savedClient); + + Client updatedClient = clientService.find(savedClient.getBaseEntityId()); + assertEquals("Rustus", updatedClient.getMiddleName()); + assertEquals(ClientsRepositoryImpl.REVISION_PREFIX + 2, updatedClient.getRevision()); + assertTrue(timeBeforeUpdate.isBefore(updatedClient.getDateEdited())); + } + + @Test + public void testAddorUpdateWithServerVersionFlag() { + Client client = new Client("f67823b0-378e-4a35-93fc-bb00def74e2f").withBirthdate(new DateTime("2017-03-31"), true) + .withGender("Male").withFirstName("xobili").withLastName("mbangwa"); + client.withIdentifier("ZEIR_ID", "233864-8").withAttribute("Home_Facility", "Linda"); + clientService.addorUpdate(client, false); + assertEquals(24, clientService.findAllClients().size()); + + Client savedClient = clientService.find("f67823b0-378e-4a35-93fc-bb00def74e2f"); + assertNotNull(savedClient.getId()); + assertEquals(new DateTime("2017-03-31"), client.getBirthdate()); + assertEquals("xobili", client.getFirstName()); + assertEquals("mbangwa", client.getLastName()); + assertEquals("233864-8", client.getIdentifier("ZEIR_ID")); + + long existingServerVesion = savedClient.getServerVersion(); + //test adding existing client is updated + DateTime timeBeforeUpdate = new DateTime(); + savedClient.withMiddleName("Rustus"); + clientService.addorUpdate(savedClient, false); + + Client updatedClient = clientService.find(savedClient.getBaseEntityId()); + assertEquals("Rustus", updatedClient.getMiddleName()); + assertEquals(ClientsRepositoryImpl.REVISION_PREFIX + 2, updatedClient.getRevision()); + assertTrue(timeBeforeUpdate.isBefore(updatedClient.getDateEdited())); + assertNotEquals(existingServerVesion, updatedClient.getServerVersion().longValue()); + assertNotNull(updatedClient.getServerVersion()); + + clientService.addorUpdate(savedClient, true); + assertNotNull(clientService.find(savedClient.getBaseEntityId()).getServerVersion()); + } + + @Test + public void testFindByClientTypeAndLocationId() { + Client client = new Client("f67823b0-378e-4a35-93fc-bb00def75e2f").withBirthdate(new DateTime("2017-03-31"), true) + .withGender("Male").withFirstName("xobili").withLastName("mbangwa"); + client.setClientType("test-client-type"); + client.setLocationId("test-location-id"); + clientService.addClient(client); + List clients = clientService.findByClientTypeAndLocationId("test-client-type", "test-location-id"); + assertEquals(1, clients.size()); + assertEquals("f67823b0-378e-4a35-93fc-bb00def75e2f", clients.get(0).getBaseEntityId()); + } + + @Test + public void testFindAllByIdentifier() { + List clients = clientService.findAllByIdentifier("ZEIR_ID", "218221-0"); + assertEquals(2, clients.size()); + } + + @Test + public void testFindByRelationship() { + List clients = clientService.findByRelationship("d0ecee83-6ccd-4096-9188-f63a40fa2f63"); + assertNotNull(clients); + assertEquals("33d9a17f-d729-4276-9891-b43e8b60fd12", clients.get(0).getBaseEntityId()); + } + + @Test + public void testFindByRelationshipIdAndType() { + List clients = clientService.findByRelationshipIdAndType("mother", "d0ecee83-6ccd-4096-9188-f63a40fa2f63"); + assertNotNull(clients); + assertEquals("33d9a17f-d729-4276-9891-b43e8b60fd12", clients.get(0).getBaseEntityId()); + } + + @Test + public void testFindAllByAttribute() { + List clients = clientService.findAllByAttribute("Father_NRC_Number", "721345/67/8"); + assertNotNull(clients); + assertEquals("86c039a2-0b68-4166-849e-f49897e3a510", clients.get(0).getBaseEntityId()); + } + + @Test + public void testFindAllByAttributeOutOfCatchment() { + List clients = clientService.findAllByAttributeOutOfCatchment("Father_NRC_Number", "721345/67/8"); + assertNotNull(clients); + assertEquals("86c039a2-0b68-4166-849e-f49897e3a510", clients.get(0).getBaseEntityId()); + } + + @Test + public void testFindAllByAttributes() { + List attributes = asList("Dar Naim", "Happy Kids Clinic"); + List clients = clientService.findAllByAttributes("Home_Facility", attributes); + assertNotNull(clients); + assertEquals(9, clients.size()); + } + + @Test + public void testFindAllByMatchingName() { + List clients = clientService.findAllByMatchingName("Child"); + assertNotNull(clients); + assertEquals(6, clients.size()); + } } diff --git a/src/test/java/org/opensrp/service/EventServiceTest.java b/src/test/java/org/opensrp/service/EventServiceTest.java index c7dfaada4..62cbc1704 100644 --- a/src/test/java/org/opensrp/service/EventServiceTest.java +++ b/src/test/java/org/opensrp/service/EventServiceTest.java @@ -62,559 +62,560 @@ public class EventServiceTest extends BaseRepositoryTest { - @InjectMocks - private EventService eventService; - - @Autowired - @Qualifier("eventsRepositoryPostgres") - private EventsRepository eventsRepository; - - @Autowired - @Qualifier("clientsRepositoryPostgres") - private ClientsRepository clientsRepository; - - @Mock - private PlanRepository planRepository; - - @Mock - private ExportEventDataMapper exportEventDataMapper; - - @Mock - private TaskGenerator taskGenerator; - - private Set scripts = new HashSet();; - - private String username ="johndoe"; - - @Captor - private ArgumentCaptor planDefinitionArgumentCaptor; - - @Captor - private ArgumentCaptor stringArgumentCaptor = ArgumentCaptor.forClass(String.class); - - @Captor - private ArgumentCaptor eventArgumentCaptor; - - - @Before - public void setUpPostgresRepository() { - initMocks(this); - eventService = new EventService(eventsRepository, new ClientService(clientsRepository), taskGenerator, planRepository, exportEventDataMapper); - ReflectionTestUtils.setField(eventService, "isPlanEvaluationEnabled", true); - } - - @Override - protected Set getDatabaseScripts() { - scripts.add("event.sql"); - scripts.add("client.sql"); - return scripts; - } - - @Test - public void testFindByUniqueId() { - assertEquals("05934ae338431f28bf6793b241be69a5", eventService.find("4aecc0c1-e008-4227-938d-66db17236a3d").getId()); - - assertEquals("05934ae338431f28bf6793b241bdb88c", eventService.find("06c8644b-b560-45fd-9af5-b6b1484e3504").getId()); - - assertNull(eventService.find("50102f0a-a9c9-1d-a6c476433b3c")); - - //deleted event - eventsRepository.safeRemove(eventService.find("06c8644b-b560-45fd-9af5-b6b1484e3504")); - assertNull(eventService.find("06c8644b-b560-45fd-9af5-b6b1484e3504")); - } - - @Test - public void testFindByEvent() { - Event event = new Event(); - assertNull(eventService.find(event)); - - event.withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "94ec8561-14ab-48d1-a6d4-4ae05191f6e6"); - - assertEquals("05934ae338431f28bf6793b241bdbc55", eventService.find(event).getId()); - - //deleted event - eventsRepository.safeRemove(eventService.find(event)); - assertNull(eventService.find(event)); - } - - @Test - public void testFindByEventId() { - Event event = eventService.findById("05934ae338431f28bf6793b2419c319a"); - assertEquals("ea1f9439-a663-4073-93b9-6ef2b8bca3c1", event.getBaseEntityId()); - assertEquals("d960046a-e2a0-4bbf-b687-d41c2a52d8c8", event.getFormSubmissionId()); - assertEquals("Vaccination", event.getEventType()); - - assertNull(eventService.findById("50102f0a-a9c9-1d-a6c476433b3c")); - - //deleted event - eventsRepository.safeRemove(event); - assertNull(eventService.findById(event.getId())); - } - - @Test - public void testAddEvent() { - Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); - Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring") - .withFormSubmissionId("gjhg34534 nvbnv3345345__4").withEventDate(new DateTime()).withObs(obs); - PlanDefinition plan = new PlanDefinition(); - plan.setIdentifier("identifier"); - - when(planRepository.get(anyString())).thenReturn(plan); - Mockito.doNothing().when(taskGenerator).processPlanEvaluation(any(PlanDefinition.class), anyString(), any(Event.class)); - eventService.addEvent(event, username); - - event = eventService.findByFormSubmissionId("gjhg34534 nvbnv3345345__4"); - assertEquals("435534534543", event.getBaseEntityId()); - assertEquals("Growth Monitoring", event.getEventType()); - assertEquals(1, event.getObs().size()); - assertEquals("3.5", event.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); - - //test if an event with voided date add event as deleted - event = new Event().withBaseEntityId("2423nj-sdfsd-sf2dfsd-2399d").withEventType("Vaccination") - .withFormSubmissionId("hshj2342_jsjs-jhjsdfds-23").withEventDate(new DateTime()).withObs(obs); - event.setDateVoided(new DateTime()); - eventService.addEvent(event,username); - assertNull(eventService.findByFormSubmissionId(event.getFormSubmissionId())); - } - - @Test - public void testAddEventOutOfCatchment() { - Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); - Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring") - .withFormSubmissionId("gjhg34534 nvbnv3345345__4").withEventDate(new DateTime()).withObs(obs); - PlanDefinition plan = new PlanDefinition(); - plan.setIdentifier("identifier"); - - when(planRepository.get(anyString())).thenReturn(plan); - Mockito.doNothing().when(taskGenerator).processPlanEvaluation(any(PlanDefinition.class), anyString(), any(Event.class)); - eventService.addEvent(event, username); - - event = eventService.findByFormSubmissionId("gjhg34534 nvbnv3345345__4"); - assertEquals("435534534543", event.getBaseEntityId()); - assertEquals("Growth Monitoring", event.getEventType()); - assertEquals(1, event.getObs().size()); - assertEquals("3.5", event.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); - - //test if an event with voided date add event as deleted - event = new Event().withBaseEntityId("2423nj-sdfsd-sf2dfsd-2399d").withEventType("Vaccination") - .withFormSubmissionId("hshj2342_jsjs-jhjsdfds-23").withEventDate(new DateTime()).withObs(obs); - event.setDateVoided(new DateTime()); - eventService.addEventOutOfCatchment(event, username); - assertNull(eventService.findByFormSubmissionId(event.getFormSubmissionId())); - } - - @Test(expected = IllegalArgumentException.class) - public void testAddEventForExistingEvent() { - Event event = eventService.findById("05934ae338431f28bf6793b241bdc44a"); - eventService.addEvent(event, username); - } - - @Test(expected = IllegalArgumentException.class) - public void testAddEventDuplicateIdentifiers() { - Event event = new Event().withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "4aecc0c1-e008-4227-938d-66db17236a3d"); - eventService.addEvent(event, username); - } - - @Test(expected = IllegalArgumentException.class) - public void testAddEventDuplicateBaseEntityFormSubmission() { - Event event = new Event().withBaseEntityId("58b33379-dab2-4f5c-8f09-6d2bd63023d8").withFormSubmissionId( - "5f1b201d-2132-4eb9-8fa1-3169a61cc50a"); - eventService.addEvent(event, username); - } - - @Test(expected = DuplicateKeyException.class) - public void testAddEventDuplicateFormSubmission() { - Event event = new Event().withBaseEntityId("58b33379-dab2-4f").withFormSubmissionId( - "5f1b201d-2132-4eb9-8fa1-3169a61cc50a"); - eventService.addEvent(event, username); - - } - - @Test - public void testAddEventShouldEvaluatePlan() { - Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); - Map details = new HashMap<>(); - details.put("planIdentifier", "plan-id-1"); - Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring") - .withFormSubmissionId("gjhg34534 nvbnv3345345__4").withEventDate(new DateTime()).withObs(obs); + @InjectMocks + private EventService eventService; + + @Autowired + @Qualifier("eventsRepositoryPostgres") + private EventsRepository eventsRepository; + + @Autowired + @Qualifier("clientsRepositoryPostgres") + private ClientsRepository clientsRepository; + + @Mock + private PlanRepository planRepository; + + @Mock + private ExportEventDataMapper exportEventDataMapper; + + @Mock + private TaskGenerator taskGenerator; + + private Set scripts = new HashSet(); + ; + + private String username = "johndoe"; + + @Captor + private ArgumentCaptor planDefinitionArgumentCaptor; + + @Captor + private ArgumentCaptor stringArgumentCaptor = ArgumentCaptor.forClass(String.class); + + @Captor + private ArgumentCaptor eventArgumentCaptor; + + + @Before + public void setUpPostgresRepository() { + initMocks(this); + eventService = new EventService(eventsRepository, new ClientService(clientsRepository), taskGenerator, planRepository, exportEventDataMapper); + ReflectionTestUtils.setField(eventService, "isPlanEvaluationEnabled", true); + } + + @Override + protected Set getDatabaseScripts() { + scripts.add("event.sql"); + scripts.add("client.sql"); + return scripts; + } + + @Test + public void testFindByUniqueId() { + assertEquals("05934ae338431f28bf6793b241be69a5", eventService.find("4aecc0c1-e008-4227-938d-66db17236a3d").getId()); + + assertEquals("05934ae338431f28bf6793b241bdb88c", eventService.find("06c8644b-b560-45fd-9af5-b6b1484e3504").getId()); + + assertNull(eventService.find("50102f0a-a9c9-1d-a6c476433b3c")); + + //deleted event + eventsRepository.safeRemove(eventService.find("06c8644b-b560-45fd-9af5-b6b1484e3504")); + assertNull(eventService.find("06c8644b-b560-45fd-9af5-b6b1484e3504")); + } + + @Test + public void testFindByEvent() { + Event event = new Event(); + assertNull(eventService.find(event)); + + event.withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "94ec8561-14ab-48d1-a6d4-4ae05191f6e6"); + + assertEquals("05934ae338431f28bf6793b241bdbc55", eventService.find(event).getId()); + + //deleted event + eventsRepository.safeRemove(eventService.find(event)); + assertNull(eventService.find(event)); + } + + @Test + public void testFindByEventId() { + Event event = eventService.findById("05934ae338431f28bf6793b2419c319a"); + assertEquals("ea1f9439-a663-4073-93b9-6ef2b8bca3c1", event.getBaseEntityId()); + assertEquals("d960046a-e2a0-4bbf-b687-d41c2a52d8c8", event.getFormSubmissionId()); + assertEquals("Vaccination", event.getEventType()); + + assertNull(eventService.findById("50102f0a-a9c9-1d-a6c476433b3c")); + + //deleted event + eventsRepository.safeRemove(event); + assertNull(eventService.findById(event.getId())); + } + + @Test + public void testAddEvent() { + Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); + Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring") + .withFormSubmissionId("gjhg34534 nvbnv3345345__4").withEventDate(new DateTime()).withObs(obs); + PlanDefinition plan = new PlanDefinition(); + plan.setIdentifier("identifier"); + + when(planRepository.get(anyString())).thenReturn(plan); + Mockito.doNothing().when(taskGenerator).processPlanEvaluation(any(PlanDefinition.class), anyString(), any(Event.class)); + eventService.addEvent(event, username); + + event = eventService.findByFormSubmissionId("gjhg34534 nvbnv3345345__4"); + assertEquals("435534534543", event.getBaseEntityId()); + assertEquals("Growth Monitoring", event.getEventType()); + assertEquals(1, event.getObs().size()); + assertEquals("3.5", event.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); + + //test if an event with voided date add event as deleted + event = new Event().withBaseEntityId("2423nj-sdfsd-sf2dfsd-2399d").withEventType("Vaccination") + .withFormSubmissionId("hshj2342_jsjs-jhjsdfds-23").withEventDate(new DateTime()).withObs(obs); + event.setDateVoided(new DateTime()); + eventService.addEvent(event, username); + assertNull(eventService.findByFormSubmissionId(event.getFormSubmissionId())); + } + + @Test + public void testAddEventOutOfCatchment() { + Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); + Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring") + .withFormSubmissionId("gjhg34534 nvbnv3345345__4").withEventDate(new DateTime()).withObs(obs); + PlanDefinition plan = new PlanDefinition(); + plan.setIdentifier("identifier"); + + when(planRepository.get(anyString())).thenReturn(plan); + Mockito.doNothing().when(taskGenerator).processPlanEvaluation(any(PlanDefinition.class), anyString(), any(Event.class)); + eventService.addEvent(event, username); + + event = eventService.findByFormSubmissionId("gjhg34534 nvbnv3345345__4"); + assertEquals("435534534543", event.getBaseEntityId()); + assertEquals("Growth Monitoring", event.getEventType()); + assertEquals(1, event.getObs().size()); + assertEquals("3.5", event.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); + + //test if an event with voided date add event as deleted + event = new Event().withBaseEntityId("2423nj-sdfsd-sf2dfsd-2399d").withEventType("Vaccination") + .withFormSubmissionId("hshj2342_jsjs-jhjsdfds-23").withEventDate(new DateTime()).withObs(obs); + event.setDateVoided(new DateTime()); + eventService.addEventOutOfCatchment(event, username); + assertNull(eventService.findByFormSubmissionId(event.getFormSubmissionId())); + } + + @Test(expected = IllegalArgumentException.class) + public void testAddEventForExistingEvent() { + Event event = eventService.findById("05934ae338431f28bf6793b241bdc44a"); + eventService.addEvent(event, username); + } + + @Test(expected = IllegalArgumentException.class) + public void testAddEventDuplicateIdentifiers() { + Event event = new Event().withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "4aecc0c1-e008-4227-938d-66db17236a3d"); + eventService.addEvent(event, username); + } + + @Test(expected = IllegalArgumentException.class) + public void testAddEventDuplicateBaseEntityFormSubmission() { + Event event = new Event().withBaseEntityId("58b33379-dab2-4f5c-8f09-6d2bd63023d8").withFormSubmissionId( + "5f1b201d-2132-4eb9-8fa1-3169a61cc50a"); + eventService.addEvent(event, username); + } + + @Test(expected = DuplicateKeyException.class) + public void testAddEventDuplicateFormSubmission() { + Event event = new Event().withBaseEntityId("58b33379-dab2-4f").withFormSubmissionId( + "5f1b201d-2132-4eb9-8fa1-3169a61cc50a"); + eventService.addEvent(event, username); + + } + + @Test + public void testAddEventShouldEvaluatePlan() { + Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); + Map details = new HashMap<>(); + details.put("planIdentifier", "plan-id-1"); + Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring") + .withFormSubmissionId("gjhg34534 nvbnv3345345__4").withEventDate(new DateTime()).withObs(obs); + event.setDetails(details); + PlanDefinition plan = new PlanDefinition(); + plan.setIdentifier("plan-id-1"); + plan.setStatus(PlanDefinition.PlanStatus.ACTIVE); + Period executionPeriod = new Period(); + executionPeriod.setEnd(new LocalDate().plusYears(2).toDateTimeAtStartOfDay()); + plan.setEffectivePeriod(executionPeriod); + + when(planRepository.get("plan-id-1")).thenReturn(plan); + Mockito.doNothing().when(taskGenerator).processPlanEvaluation(any(PlanDefinition.class), any(PlanDefinition.class), anyString()); + eventService.addEvent(event, username); + verify(planRepository, times(1)).get(stringArgumentCaptor.capture()); + verify(taskGenerator, times(1)).processPlanEvaluation(planDefinitionArgumentCaptor.capture(), stringArgumentCaptor.capture(), eventArgumentCaptor.capture()); + } + + @Test + public void testProcessOutOfAreaDoesNotAddOutOfCatchmentEventWhenClientIdentifierIsInvalid() throws SQLException { + populateDatabase(); + + Event event = new Event().withEventType("Out of Area Service - Vaccination") + .withProviderId("tester112") + .withLocationId("2242342-23dsfsdfds") + .withIdentifier(Client.ZEIR_ID, "c_2182291985"); + + int prevCount = eventService.getAll().size(); + Event outOfAreaEvent = eventService.processOutOfArea(event); + assertNotNull(outOfAreaEvent); + assertEquals(event, outOfAreaEvent); + assertEquals(prevCount, eventService.getAll().size()); + } + + @Test + public void testProcessOutOfAreaAddsOutOfCatchmentVaccinationEventWhenEventHasValidClientIdentifier() throws SQLException { + populateDatabase(); + + Event event = new Event() + .withEventType("Out of Area Service - Vaccination") + .withProviderId("tester111") + .withLocationId("2242342-23dsfsdfds") + .withIdentifier(Client.ZEIR_ID, "218229-3"); + + int prevCount = eventService.getAll().size(); + Event outOfAreaEvent = eventService.processOutOfArea(event); + assertEquals(event, outOfAreaEvent); + assertEquals(prevCount + 1, eventService.getAll().size()); + } + + @Test + public void testProcessOutOfAreaAddsOutOfCatchmentGrowthMonitoringEventWhenEventHasValidClientIdentifier() throws SQLException { + populateDatabase(); + + Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); + Event event = new Event() + .withEventType("Out of Area Service - Growth Monitoring") + .withFormSubmissionId("gjhg34534 nvbnv3345345__4") + .withEventDate(new DateTime()).withObs(obs) + .withIdentifier(Client.ZEIR_ID, "218229-3"); + + int prevCount = eventService.getAll().size(); + Event outOfAreaEvent = eventService.processOutOfArea(event); + assertEquals(event, outOfAreaEvent); + assertEquals(prevCount + 1, eventService.getAll().size()); + } + + @Test + public void testProcessOutOfAreaRecurringService() throws SQLException { + scripts.add("client.sql"); + populateDatabase(); + Event event = new Event().withEventType("Out of Area Service - Recurring Service") + .withIdentifier(Client.ZEIR_ID, "218229-3"); + Map details = new HashMap<>() { + { + put(EventConstants.RECURRING_SERVICE_TYPES, "[deworming, vit_a]"); + } + }; event.setDetails(details); - PlanDefinition plan = new PlanDefinition(); - plan.setIdentifier("plan-id-1"); - plan.setStatus(PlanDefinition.PlanStatus.ACTIVE); - Period executionPeriod = new Period(); - executionPeriod.setEnd(new LocalDate().plusYears(2).toDateTimeAtStartOfDay()); - plan.setEffectivePeriod(executionPeriod); - - when(planRepository.get("plan-id-1")).thenReturn(plan); - Mockito.doNothing().when(taskGenerator).processPlanEvaluation(any(PlanDefinition.class), any(PlanDefinition.class), anyString()); - eventService.addEvent(event, username); - verify(planRepository, times(1)).get(stringArgumentCaptor.capture()); - verify(taskGenerator, times(1)).processPlanEvaluation(planDefinitionArgumentCaptor.capture(),stringArgumentCaptor.capture(),eventArgumentCaptor.capture()); - } - - @Test - public void testProcessOutOfAreaDoesNotAddOutOfCatchmentEventWhenClientIdentifierIsInvalid() throws SQLException { - populateDatabase(); - - Event event = new Event().withEventType("Out of Area Service - Vaccination") - .withProviderId("tester112") - .withLocationId("2242342-23dsfsdfds") - .withIdentifier(Client.ZEIR_ID, "c_2182291985"); - - int prevCount = eventService.getAll().size(); - Event outOfAreaEvent = eventService.processOutOfArea(event); - assertNotNull(outOfAreaEvent); - assertEquals(event, outOfAreaEvent); - assertEquals(prevCount, eventService.getAll().size()); - } - - @Test - public void testProcessOutOfAreaAddsOutOfCatchmentVaccinationEventWhenEventHasValidClientIdentifier() throws SQLException { - populateDatabase(); - - Event event = new Event() - .withEventType("Out of Area Service - Vaccination") - .withProviderId("tester111") - .withLocationId("2242342-23dsfsdfds") - .withIdentifier(Client.ZEIR_ID, "218229-3"); - - int prevCount = eventService.getAll().size(); - Event outOfAreaEvent = eventService.processOutOfArea(event); - assertEquals(event, outOfAreaEvent); - assertEquals(prevCount + 1, eventService.getAll().size()); - } - - @Test - public void testProcessOutOfAreaAddsOutOfCatchmentGrowthMonitoringEventWhenEventHasValidClientIdentifier() throws SQLException { - populateDatabase(); - - Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); - Event event = new Event() - .withEventType("Out of Area Service - Growth Monitoring") - .withFormSubmissionId("gjhg34534 nvbnv3345345__4") - .withEventDate(new DateTime()).withObs(obs) - .withIdentifier(Client.ZEIR_ID, "218229-3"); - - int prevCount = eventService.getAll().size(); - Event outOfAreaEvent = eventService.processOutOfArea(event); - assertEquals(event, outOfAreaEvent); - assertEquals(prevCount + 1, eventService.getAll().size()); - } - - @Test - public void testProcessOutOfAreaRecurringService() throws SQLException { - scripts.add("client.sql"); - populateDatabase(); - Event event = new Event().withEventType("Out of Area Service - Recurring Service") - .withIdentifier(Client.ZEIR_ID, "218229-3"); - Map details = new HashMap<>() { - { - put(EventConstants.RECURRING_SERVICE_TYPES, "[deworming, vit_a]"); - } - }; - event.setDetails(details); - Event outOfAreaEvent = eventService.processOutOfArea(event); - assertEquals(event, outOfAreaEvent); - assertEquals(23, eventService.getAll().size()); - - } - - @Test - public void testAddorUpdateEvent() { - Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); - Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring") - .withFormSubmissionId("gjhg34534 nvbnv3345345__4").withEventDate(new DateTime()).withObs(obs); - - eventService.addorUpdateEvent(event, username); - - Event updatedEvent = eventService.findByFormSubmissionId("gjhg34534 nvbnv3345345__4"); - assertEquals("435534534543", updatedEvent.getBaseEntityId()); - assertEquals("Growth Monitoring", updatedEvent.getEventType()); - assertEquals(1, updatedEvent.getObs().size()); - assertEquals("3.5", updatedEvent.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); - assertNull(updatedEvent.getDateEdited()); - event.setTeam("ATeam"); - event.setProviderId("tester11"); - event.setLocationId("321312-fsff-2328"); - eventService.addorUpdateEvent(event, username); - - updatedEvent = eventService.findByFormSubmissionId("gjhg34534 nvbnv3345345__4"); - assertEquals("ATeam", updatedEvent.getTeam()); - assertEquals("tester11", updatedEvent.getProviderId()); - assertEquals("321312-fsff-2328", updatedEvent.getLocationId()); - assertEquals(EventsRepositoryImpl.REVISION_PREFIX + 2, updatedEvent.getRevision()); - assertNotNull(updatedEvent.getDateEdited()); - - //test if an event with voided date add event as deleted - event = new Event().withBaseEntityId("2423nj-sdfsd-sf2dfsd-2399d").withEventType("Vaccination") - .withFormSubmissionId("hshj2342_jsjs-jhjsdfds-23").withEventDate(new DateTime()).withObs(obs); - event.setDateVoided(new DateTime()); - eventService.addorUpdateEvent(event, username); - assertNull(eventService.findByFormSubmissionId(event.getFormSubmissionId())); - } - - @Test - public void testAddorUpdateEventWithMissingEventIdUpdatesEvent() throws Exception { - String baseEntityId = UUID.randomUUID().toString(); - Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); - Event event = new Event().withBaseEntityId(baseEntityId).withEventType("Growth Monitoring") - .withFormSubmissionId("gjhg34534 nvbnv3345345__4").withEventDate(new DateTime()).withObs(obs); - ObjectMapper mapper = BaseTypeHandler.mapper; - SimpleModule dateTimeModule = new SimpleModule("DateTimeModule"); - dateTimeModule.addDeserializer(DateTime.class, new DateTimeDeserializer()); - mapper.registerModule(dateTimeModule); - String jsonString = mapper.writeValueAsString(event); - eventService.addorUpdateEvent(event, username); - - Event updatedEvent = eventService.findByFormSubmissionId("gjhg34534 nvbnv3345345__4"); - String eventId = updatedEvent.getId(); - assertEquals(baseEntityId, updatedEvent.getBaseEntityId()); - assertEquals("Growth Monitoring", updatedEvent.getEventType()); - assertEquals(1, updatedEvent.getObs().size()); - assertEquals("3.5", updatedEvent.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); - assertNull(updatedEvent.getDateEdited()); - - Event originalEventWithoutId = mapper.readValue(jsonString, Event.class); - originalEventWithoutId.setTeam("ATeam"); - originalEventWithoutId.setProviderId("tester11"); - originalEventWithoutId.setLocationId("321312-fsff-2328"); - eventService.addorUpdateEvent(originalEventWithoutId, username); - - updatedEvent = eventService.findByFormSubmissionId("gjhg34534 nvbnv3345345__4"); - assertEquals(eventId, updatedEvent.getId()); - assertEquals("ATeam", updatedEvent.getTeam()); - assertEquals("tester11", updatedEvent.getProviderId()); - assertEquals("321312-fsff-2328", updatedEvent.getLocationId()); - assertEquals(EventsRepositoryImpl.REVISION_PREFIX + 2, updatedEvent.getRevision()); - assertNotNull(updatedEvent.getDateEdited()); - - List events = eventService.findByBaseEntityId(baseEntityId); - assertEquals(1, events.size()); - assertEquals(eventId, events.get(0).getId()); - - } - - @Test(expected = IllegalArgumentException.class) - public void testUpdateEventNonExistingEvent() { - Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); - Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring") - .withFormSubmissionId("gjhg34534 nvbnv3345345__4").withEventDate(new DateTime()).withObs(obs); - - eventService.updateEvent(event, username); - } - - @Test - public void testUpdateEvent() { - DateTime timebeforeUpdate = DateTime.now(); - Event event = eventService.findById("05934ae338431f28bf6793b24177a1dc"); - Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); - event.withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "62242n-223423-2332").addObs(obs); - eventService.updateEvent(event, username); - - Event updatedEvent = eventService.findById(event.getId()); - assertEquals(0, Minutes.minutesBetween(timebeforeUpdate, updatedEvent.getDateEdited()).getMinutes()); - assertEquals("3.5", updatedEvent.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); - assertEquals("62242n-223423-2332", updatedEvent.getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); - - } - - @Test(expected = IllegalArgumentException.class) - public void testMergeEventMissingIdentifiers() { - Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring"); - eventService.mergeEvent(event); - } - - @Test(expected = IllegalArgumentException.class) - public void testMergeEventNonExistingIdentifiers() { - Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring") - .withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "242332-hgfhfh-dfg8d"); - eventService.mergeEvent(event); - } - - @Test - public void testMergeEvent() { - Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); - Event event = new Event().withEventType("Growth Monitoring") - .withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "4aecc0c1-e008-4227-938d-66db17236a3d") - .withEventDate(new DateTime()).withObs(obs); - - eventService.mergeEvent(event); - - Event updatedEvent = eventService.find("4aecc0c1-e008-4227-938d-66db17236a3d"); - - assertEquals("05934ae338431f28bf6793b241be69a5", updatedEvent.getId()); - assertEquals("Growth Monitoring", updatedEvent.getEventType()); - assertEquals(1, updatedEvent.getObs().size()); - assertEquals("3.5", updatedEvent.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); - assertEquals(0, Minutes.minutesBetween(DateTime.now(), updatedEvent.getDateEdited()).getMinutes()); - } - - @Test - public void testFindAllEventIds() { - Pair, Long> eventIdsModel = eventService.findAllIdsByEventType(null, false, 0l, 100); - List actualEventIds = eventIdsModel.getLeft(); - - assertNotNull(actualEventIds); - assertEquals(21, actualEventIds.size()); - } - - @Test - public void testFindAllIdsByEventType() { - - String growthMonitoringEventype = "Growth Monitoring"; - Pair, Long> eventIdsModel = eventService.findAllIdsByEventType(growthMonitoringEventype, false, 0l, 100); - List actualEventIds = eventIdsModel.getLeft(); - - assertNotNull(actualEventIds); - assertEquals(4, actualEventIds.size()); - - Map expectedIdMap = new HashMap<>(); - expectedIdMap.put("05934ae338431f28bf6793b24177a1dc", true); - expectedIdMap.put("05934ae338431f28bf6793b241780bac", true); - expectedIdMap.put("05934ae338431f28bf6793b241781149", true); - expectedIdMap.put("05934ae338431f28bf6793b241781a1e", true); - - assertTrue(expectedIdMap.containsKey(actualEventIds.get(0))); - assertTrue(expectedIdMap.containsKey(actualEventIds.get(1))); - assertTrue(expectedIdMap.containsKey(actualEventIds.get(2))); - assertTrue(expectedIdMap.containsKey(actualEventIds.get(3))); - - } - - @Test - public void testFindAllDeletedIdsByEventType() { - - String growthMonitoringEventype = "Growth Monitoring"; - - Pair, Long> eventIdsModel = eventService.findAllIdsByEventType(growthMonitoringEventype, true, 0l, 100); - List actualEventIds = eventIdsModel.getLeft(); - - assertNotNull(actualEventIds); - assertEquals(1, actualEventIds.size()); - - assertEquals("cfcc0e7e3cef11eab77f2e728ce88125", actualEventIds.get(0)); - } - - @Test - public void testFindAllDeletedIds() { - - Pair, Long> eventIdsModel = eventService.findAllIdsByEventType(null, true, 0l, 100); - List actualEventIds = eventIdsModel.getLeft(); - - assertNotNull(actualEventIds); - assertEquals(1, actualEventIds.size()); - assertEquals("cfcc0e7e3cef11eab77f2e728ce88125", actualEventIds.get(0)); - } - - @Test - public void testFindAllIdsByEventTypeOrderedByServerVersion() { - - String growthMonitoringEventype = "Growth Monitoring"; - Pair, Long> eventIdsModel = eventService.findAllIdsByEventType(growthMonitoringEventype, false, 0l, 100); - List actualEventIds = eventIdsModel.getLeft(); - - assertNotNull(actualEventIds); - assertEquals(4, actualEventIds.size()); - assertEquals("05934ae338431f28bf6793b24177a1dc", actualEventIds.get(0)); - assertEquals("05934ae338431f28bf6793b241780bac", actualEventIds.get(1)); - assertEquals("05934ae338431f28bf6793b241781149", actualEventIds.get(2)); - assertEquals("05934ae338431f28bf6793b241781a1e", actualEventIds.get(3)); - assertEquals(1521469045590l, eventIdsModel.getRight().longValue()); - - } - - @Test - public void testFindAllIdsByEventTypeLimitsByGivenParam() { - - String growthMonitoringEventype = "Growth Monitoring"; - Pair, Long> eventIdsModel = eventService.findAllIdsByEventType(growthMonitoringEventype, false, 0l, 2); - List actualEventIds = eventIdsModel.getLeft(); - - assertNotNull(actualEventIds); - assertEquals(2, actualEventIds.size()); - assertEquals("05934ae338431f28bf6793b24177a1dc", actualEventIds.get(0)); - assertEquals("05934ae338431f28bf6793b241780bac", actualEventIds.get(1)); - assertEquals(1521469045588l, eventIdsModel.getRight().longValue()); - - } - - @Test - public void testFindAllIdsOrdersByServerVersionAnd() { - - Pair, Long> eventIdsModel = eventService.findAllIdsByEventType(null, false, 0l, 100); - List actualEventIds = eventIdsModel.getLeft(); - - assertNotNull(actualEventIds); - assertEquals(21, actualEventIds.size()); - assertEquals("05934ae338431f28bf6793b2417696bf", actualEventIds.get(0)); - assertEquals("65de6fd9-c061-4026-b2e7-e10eb22169af", actualEventIds.get(19)); - assertEquals(1573736256054l, eventIdsModel.getRight().longValue()); - - } - - @Test - public void testExportEventDataWithoutSettingsConfigured() throws JsonProcessingException { - List rowData = new ArrayList<>(); - rowData.add("location_name"); - rowData.add("location_id"); - eventsRepository.add(createFlagProblemEvent()); - when(exportEventDataMapper - .getExportEventDataAfterMapping(any(Object.class), anyString(), anyBoolean(), anyBoolean())) - .thenReturn(rowData); - ExportEventDataSummary exportEventDataSummary = eventService - .exportEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); - assertNotNull(exportEventDataSummary); - assertEquals(2, exportEventDataSummary.getRowsData().size()); - } - - @Test - public void testExportEventDataWithSettingsConfigured() throws JsonProcessingException { - eventsRepository.add(createFlagProblemEvent()); - List rowData = new ArrayList<>(); - rowData.add("location_name"); - rowData.add("location_id"); - Map settingsConfigsMap = new HashMap<>(); - settingsConfigsMap.put("Location id","$.locationId"); - PlanDefinition plan = new PlanDefinition(); - plan.setIdentifier("identifier"); - - when(planRepository.get(anyString())).thenReturn(plan); - when(exportEventDataMapper.getColumnNamesAndLabelsByEventType(anyString())).thenReturn(settingsConfigsMap); - when(exportEventDataMapper - .getExportEventDataAfterMapping(any(Object.class), anyString(), anyBoolean(), anyBoolean())) - .thenReturn(rowData); - ExportEventDataSummary exportEventDataSummary = eventService - .exportEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); - assertNotNull(exportEventDataSummary); - assertEquals(2, exportEventDataSummary.getRowsData().size()); - } - - @Test - public void testGetImagesMetadataForFlagProblemEvent() throws JsonProcessingException { - eventsRepository.add(createFlagProblemEvent()); - when(exportEventDataMapper.getFlagProblemEventImagesMetadata(anyObject(), anyString(),anyString(),anyString())).thenReturn(createExportFlagProblemEventImageMetadata()); - ExportImagesSummary exportImagesSummary = eventService.getImagesMetadataForFlagProblemEvent("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); - assertNotNull(exportImagesSummary); - assertEquals("ddcaf383-882e-448b-b701-8b72cb0d4d7a", exportImagesSummary.getExportFlagProblemEventImageMetadataList().get(0).getStockId()); - assertEquals("EPP Ambodisatrana 2", exportImagesSummary.getExportFlagProblemEventImageMetadataList().get(0).getServicePointName()); - assertEquals("Midwifery Kit", exportImagesSummary.getExportFlagProblemEventImageMetadataList().get(0).getProductName()); - - assertEquals(1, exportImagesSummary.getServicePoints().size()); - assertTrue(exportImagesSummary.getServicePoints().contains("EPP Ambodisatrana 2")); - } - - private ExportFlagProblemEventImageMetadata createExportFlagProblemEventImageMetadata() { - ExportFlagProblemEventImageMetadata exportFlagProblemEventImageMetadata = new ExportFlagProblemEventImageMetadata(); - exportFlagProblemEventImageMetadata.setProductName("Midwifery Kit"); - exportFlagProblemEventImageMetadata.setStockId("ddcaf383-882e-448b-b701-8b72cb0d4d7a"); - exportFlagProblemEventImageMetadata.setServicePointName("EPP Ambodisatrana 2"); - return exportFlagProblemEventImageMetadata; - } - - @Test - public void testFindByServerVersion() { - List events = eventService.findByServerVersion(0L); - - assertEquals(22, events.size()); - } + Event outOfAreaEvent = eventService.processOutOfArea(event); + assertEquals(event, outOfAreaEvent); + assertEquals(23, eventService.getAll().size()); + + } + + @Test + public void testAddorUpdateEvent() { + Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); + Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring") + .withFormSubmissionId("gjhg34534 nvbnv3345345__4").withEventDate(new DateTime()).withObs(obs); + + eventService.addorUpdateEvent(event, username); + + Event updatedEvent = eventService.findByFormSubmissionId("gjhg34534 nvbnv3345345__4"); + assertEquals("435534534543", updatedEvent.getBaseEntityId()); + assertEquals("Growth Monitoring", updatedEvent.getEventType()); + assertEquals(1, updatedEvent.getObs().size()); + assertEquals("3.5", updatedEvent.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); + assertNull(updatedEvent.getDateEdited()); + event.setTeam("ATeam"); + event.setProviderId("tester11"); + event.setLocationId("321312-fsff-2328"); + eventService.addorUpdateEvent(event, username); + + updatedEvent = eventService.findByFormSubmissionId("gjhg34534 nvbnv3345345__4"); + assertEquals("ATeam", updatedEvent.getTeam()); + assertEquals("tester11", updatedEvent.getProviderId()); + assertEquals("321312-fsff-2328", updatedEvent.getLocationId()); + assertEquals(EventsRepositoryImpl.REVISION_PREFIX + 2, updatedEvent.getRevision()); + assertNotNull(updatedEvent.getDateEdited()); + + //test if an event with voided date add event as deleted + event = new Event().withBaseEntityId("2423nj-sdfsd-sf2dfsd-2399d").withEventType("Vaccination") + .withFormSubmissionId("hshj2342_jsjs-jhjsdfds-23").withEventDate(new DateTime()).withObs(obs); + event.setDateVoided(new DateTime()); + eventService.addorUpdateEvent(event, username); + assertNull(eventService.findByFormSubmissionId(event.getFormSubmissionId())); + } + + @Test + public void testAddorUpdateEventWithMissingEventIdUpdatesEvent() throws Exception { + String baseEntityId = UUID.randomUUID().toString(); + Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); + Event event = new Event().withBaseEntityId(baseEntityId).withEventType("Growth Monitoring") + .withFormSubmissionId("gjhg34534 nvbnv3345345__4").withEventDate(new DateTime()).withObs(obs); + ObjectMapper mapper = BaseTypeHandler.mapper; + SimpleModule dateTimeModule = new SimpleModule("DateTimeModule"); + dateTimeModule.addDeserializer(DateTime.class, new DateTimeDeserializer()); + mapper.registerModule(dateTimeModule); + String jsonString = mapper.writeValueAsString(event); + eventService.addorUpdateEvent(event, username); + + Event updatedEvent = eventService.findByFormSubmissionId("gjhg34534 nvbnv3345345__4"); + String eventId = updatedEvent.getId(); + assertEquals(baseEntityId, updatedEvent.getBaseEntityId()); + assertEquals("Growth Monitoring", updatedEvent.getEventType()); + assertEquals(1, updatedEvent.getObs().size()); + assertEquals("3.5", updatedEvent.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); + assertNull(updatedEvent.getDateEdited()); + + Event originalEventWithoutId = mapper.readValue(jsonString, Event.class); + originalEventWithoutId.setTeam("ATeam"); + originalEventWithoutId.setProviderId("tester11"); + originalEventWithoutId.setLocationId("321312-fsff-2328"); + eventService.addorUpdateEvent(originalEventWithoutId, username); + + updatedEvent = eventService.findByFormSubmissionId("gjhg34534 nvbnv3345345__4"); + assertEquals(eventId, updatedEvent.getId()); + assertEquals("ATeam", updatedEvent.getTeam()); + assertEquals("tester11", updatedEvent.getProviderId()); + assertEquals("321312-fsff-2328", updatedEvent.getLocationId()); + assertEquals(EventsRepositoryImpl.REVISION_PREFIX + 2, updatedEvent.getRevision()); + assertNotNull(updatedEvent.getDateEdited()); + + List events = eventService.findByBaseEntityId(baseEntityId); + assertEquals(1, events.size()); + assertEquals(eventId, events.get(0).getId()); + + } + + @Test(expected = IllegalArgumentException.class) + public void testUpdateEventNonExistingEvent() { + Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); + Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring") + .withFormSubmissionId("gjhg34534 nvbnv3345345__4").withEventDate(new DateTime()).withObs(obs); + + eventService.updateEvent(event, username); + } + + @Test + public void testUpdateEvent() { + DateTime timebeforeUpdate = DateTime.now(); + Event event = eventService.findById("05934ae338431f28bf6793b24177a1dc"); + Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); + event.withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "62242n-223423-2332").addObs(obs); + eventService.updateEvent(event, username); + + Event updatedEvent = eventService.findById(event.getId()); + assertEquals(0, Minutes.minutesBetween(timebeforeUpdate, updatedEvent.getDateEdited()).getMinutes()); + assertEquals("3.5", updatedEvent.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); + assertEquals("62242n-223423-2332", updatedEvent.getIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE)); + + } + + @Test(expected = IllegalArgumentException.class) + public void testMergeEventMissingIdentifiers() { + Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring"); + eventService.mergeEvent(event); + } + + @Test(expected = IllegalArgumentException.class) + public void testMergeEventNonExistingIdentifiers() { + Event event = new Event().withBaseEntityId("435534534543").withEventType("Growth Monitoring") + .withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "242332-hgfhfh-dfg8d"); + eventService.mergeEvent(event); + } + + @Test + public void testMergeEvent() { + Obs obs = new Obs("concept", "decimal", "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", null, "3.5", null, "weight"); + Event event = new Event().withEventType("Growth Monitoring") + .withIdentifier(OPENMRS_UUID_IDENTIFIER_TYPE, "4aecc0c1-e008-4227-938d-66db17236a3d") + .withEventDate(new DateTime()).withObs(obs); + + eventService.mergeEvent(event); + + Event updatedEvent = eventService.find("4aecc0c1-e008-4227-938d-66db17236a3d"); + + assertEquals("05934ae338431f28bf6793b241be69a5", updatedEvent.getId()); + assertEquals("Growth Monitoring", updatedEvent.getEventType()); + assertEquals(1, updatedEvent.getObs().size()); + assertEquals("3.5", updatedEvent.getObs(null, "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").getValue()); + assertEquals(0, Minutes.minutesBetween(DateTime.now(), updatedEvent.getDateEdited()).getMinutes()); + } + + @Test + public void testFindAllEventIds() { + Pair, Long> eventIdsModel = eventService.findAllIdsByEventType(null, false, 0l, 100); + List actualEventIds = eventIdsModel.getLeft(); + + assertNotNull(actualEventIds); + assertEquals(21, actualEventIds.size()); + } + + @Test + public void testFindAllIdsByEventType() { + + String growthMonitoringEventype = "Growth Monitoring"; + Pair, Long> eventIdsModel = eventService.findAllIdsByEventType(growthMonitoringEventype, false, 0l, 100); + List actualEventIds = eventIdsModel.getLeft(); + + assertNotNull(actualEventIds); + assertEquals(4, actualEventIds.size()); + + Map expectedIdMap = new HashMap<>(); + expectedIdMap.put("05934ae338431f28bf6793b24177a1dc", true); + expectedIdMap.put("05934ae338431f28bf6793b241780bac", true); + expectedIdMap.put("05934ae338431f28bf6793b241781149", true); + expectedIdMap.put("05934ae338431f28bf6793b241781a1e", true); + + assertTrue(expectedIdMap.containsKey(actualEventIds.get(0))); + assertTrue(expectedIdMap.containsKey(actualEventIds.get(1))); + assertTrue(expectedIdMap.containsKey(actualEventIds.get(2))); + assertTrue(expectedIdMap.containsKey(actualEventIds.get(3))); + + } + + @Test + public void testFindAllDeletedIdsByEventType() { + + String growthMonitoringEventype = "Growth Monitoring"; + + Pair, Long> eventIdsModel = eventService.findAllIdsByEventType(growthMonitoringEventype, true, 0l, 100); + List actualEventIds = eventIdsModel.getLeft(); + + assertNotNull(actualEventIds); + assertEquals(1, actualEventIds.size()); + + assertEquals("cfcc0e7e3cef11eab77f2e728ce88125", actualEventIds.get(0)); + } + + @Test + public void testFindAllDeletedIds() { + + Pair, Long> eventIdsModel = eventService.findAllIdsByEventType(null, true, 0l, 100); + List actualEventIds = eventIdsModel.getLeft(); + + assertNotNull(actualEventIds); + assertEquals(1, actualEventIds.size()); + assertEquals("cfcc0e7e3cef11eab77f2e728ce88125", actualEventIds.get(0)); + } + + @Test + public void testFindAllIdsByEventTypeOrderedByServerVersion() { + + String growthMonitoringEventype = "Growth Monitoring"; + Pair, Long> eventIdsModel = eventService.findAllIdsByEventType(growthMonitoringEventype, false, 0l, 100); + List actualEventIds = eventIdsModel.getLeft(); + + assertNotNull(actualEventIds); + assertEquals(4, actualEventIds.size()); + assertEquals("05934ae338431f28bf6793b24177a1dc", actualEventIds.get(0)); + assertEquals("05934ae338431f28bf6793b241780bac", actualEventIds.get(1)); + assertEquals("05934ae338431f28bf6793b241781149", actualEventIds.get(2)); + assertEquals("05934ae338431f28bf6793b241781a1e", actualEventIds.get(3)); + assertEquals(1521469045590l, eventIdsModel.getRight().longValue()); + + } + + @Test + public void testFindAllIdsByEventTypeLimitsByGivenParam() { + + String growthMonitoringEventype = "Growth Monitoring"; + Pair, Long> eventIdsModel = eventService.findAllIdsByEventType(growthMonitoringEventype, false, 0l, 2); + List actualEventIds = eventIdsModel.getLeft(); + + assertNotNull(actualEventIds); + assertEquals(2, actualEventIds.size()); + assertEquals("05934ae338431f28bf6793b24177a1dc", actualEventIds.get(0)); + assertEquals("05934ae338431f28bf6793b241780bac", actualEventIds.get(1)); + assertEquals(1521469045588l, eventIdsModel.getRight().longValue()); + + } + + @Test + public void testFindAllIdsOrdersByServerVersionAnd() { + + Pair, Long> eventIdsModel = eventService.findAllIdsByEventType(null, false, 0l, 100); + List actualEventIds = eventIdsModel.getLeft(); + + assertNotNull(actualEventIds); + assertEquals(21, actualEventIds.size()); + assertEquals("05934ae338431f28bf6793b2417696bf", actualEventIds.get(0)); + assertEquals("65de6fd9-c061-4026-b2e7-e10eb22169af", actualEventIds.get(19)); + assertEquals(1573736256054l, eventIdsModel.getRight().longValue()); + + } + + @Test + public void testExportEventDataWithoutSettingsConfigured() throws JsonProcessingException { + List rowData = new ArrayList<>(); + rowData.add("location_name"); + rowData.add("location_id"); + eventsRepository.add(createFlagProblemEvent()); + when(exportEventDataMapper + .getExportEventDataAfterMapping(any(Object.class), anyString(), anyBoolean(), anyBoolean())) + .thenReturn(rowData); + ExportEventDataSummary exportEventDataSummary = eventService + .exportEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); + assertNotNull(exportEventDataSummary); + assertEquals(2, exportEventDataSummary.getRowsData().size()); + } + + @Test + public void testExportEventDataWithSettingsConfigured() throws JsonProcessingException { + eventsRepository.add(createFlagProblemEvent()); + List rowData = new ArrayList<>(); + rowData.add("location_name"); + rowData.add("location_id"); + Map settingsConfigsMap = new HashMap<>(); + settingsConfigsMap.put("Location id", "$.locationId"); + PlanDefinition plan = new PlanDefinition(); + plan.setIdentifier("identifier"); + + when(planRepository.get(anyString())).thenReturn(plan); + when(exportEventDataMapper.getColumnNamesAndLabelsByEventType(anyString())).thenReturn(settingsConfigsMap); + when(exportEventDataMapper + .getExportEventDataAfterMapping(any(Object.class), anyString(), anyBoolean(), anyBoolean())) + .thenReturn(rowData); + ExportEventDataSummary exportEventDataSummary = eventService + .exportEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); + assertNotNull(exportEventDataSummary); + assertEquals(2, exportEventDataSummary.getRowsData().size()); + } + + @Test + public void testGetImagesMetadataForFlagProblemEvent() throws JsonProcessingException { + eventsRepository.add(createFlagProblemEvent()); + when(exportEventDataMapper.getFlagProblemEventImagesMetadata(anyObject(), anyString(), anyString(), anyString())).thenReturn(createExportFlagProblemEventImageMetadata()); + ExportImagesSummary exportImagesSummary = eventService.getImagesMetadataForFlagProblemEvent("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); + assertNotNull(exportImagesSummary); + assertEquals("ddcaf383-882e-448b-b701-8b72cb0d4d7a", exportImagesSummary.getExportFlagProblemEventImageMetadataList().get(0).getStockId()); + assertEquals("EPP Ambodisatrana 2", exportImagesSummary.getExportFlagProblemEventImageMetadataList().get(0).getServicePointName()); + assertEquals("Midwifery Kit", exportImagesSummary.getExportFlagProblemEventImageMetadataList().get(0).getProductName()); + + assertEquals(1, exportImagesSummary.getServicePoints().size()); + assertTrue(exportImagesSummary.getServicePoints().contains("EPP Ambodisatrana 2")); + } + + private ExportFlagProblemEventImageMetadata createExportFlagProblemEventImageMetadata() { + ExportFlagProblemEventImageMetadata exportFlagProblemEventImageMetadata = new ExportFlagProblemEventImageMetadata(); + exportFlagProblemEventImageMetadata.setProductName("Midwifery Kit"); + exportFlagProblemEventImageMetadata.setStockId("ddcaf383-882e-448b-b701-8b72cb0d4d7a"); + exportFlagProblemEventImageMetadata.setServicePointName("EPP Ambodisatrana 2"); + return exportFlagProblemEventImageMetadata; + } + + @Test + public void testFindByServerVersion() { + List events = eventService.findByServerVersion(0L); + + assertEquals(22, events.size()); + } } diff --git a/src/test/java/org/opensrp/service/ExportEventDataMapperTest.java b/src/test/java/org/opensrp/service/ExportEventDataMapperTest.java index 971d047d9..9d0eac9a4 100644 --- a/src/test/java/org/opensrp/service/ExportEventDataMapperTest.java +++ b/src/test/java/org/opensrp/service/ExportEventDataMapperTest.java @@ -28,130 +28,126 @@ import static org.opensrp.repository.postgres.EventsRepositoryTest.createFlagProblemEvent; import static org.opensrp.util.constants.EventDataExportConstants.SETTINGS_CONFIGURATION_EVENT_TYPE_TO_SETTINGS_IDENTIFIER; -public class ExportEventDataMapperTest extends BaseRepositoryTest { - - @InjectMocks - private ExportEventDataMapper exportEventDataMapper; - - @Mock - private SettingService settingService; - - @Autowired - @Qualifier("eventsRepositoryPostgres") - private EventsRepository eventsRepository; - - private Set scripts = new HashSet(); - - private final Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") - .registerTypeAdapter(DateTime.class, new DateTimeTypeConverter()).create(); - - @Before - public void setUpPostgresRepository() { - initMocks(this); - } - - @Override - protected Set getDatabaseScripts() { - scripts.add("event.sql"); - return scripts; - } - - - @Test - public void testGetExportEventDataAfterMappingForHeaderWithoutSettings() throws JsonProcessingException { - eventsRepository.add(createFlagProblemEvent()); - List events = eventsRepository.getEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); - String json = ""; - if (events != null && events.get(0) != null && events.get(0).getJson() != null) { - json = gson.toJson(events.get(0).getJson()); - } - Event event = gson.fromJson(json, Event.class); - List result = exportEventDataMapper.getExportEventDataAfterMapping(events.get(0).getJson(),"flag_problem",true,false); - assertNotNull(result); - int eventObsSize = event.getObs().size(); - int resultSize = result.size(); - assertEquals(eventObsSize, resultSize); - assertEquals(event.getObs().get(0).getFormSubmissionField(), result.get(0)); - assertEquals(event.getObs().get(eventObsSize - 1).getFormSubmissionField(), result.get(resultSize - 1)); - } - - @Test - public void testGetExportEventDataAfterMappingForRowDataWithoutSettings() throws JsonProcessingException { - eventsRepository.add(createFlagProblemEvent()); - List events = eventsRepository.getEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); - String json = ""; - if (events != null && events.get(0) != null && events.get(0).getJson() != null) { - json = gson.toJson(events.get(0).getJson()); - } - Event event = gson.fromJson(json, Event.class); - List result = exportEventDataMapper.getExportEventDataAfterMapping(events.get(0).getJson(),"flag_problem",false,false); - assertNotNull(result); - int eventObsSize = event.getObs().size(); - int resultSize = result.size(); - assertEquals(eventObsSize, resultSize); - assertEquals(event.getObs().get(0).getValues(), result.get(0)); - assertEquals(event.getObs().get(eventObsSize - 1).getValues(), result.get(resultSize - 1)); - } - - @Test - public void testGetExportEventDataAfterMappingForHeaderWithSettings() throws JsonProcessingException { - eventsRepository.add(createFlagProblemEvent()); - List events = eventsRepository.getEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); - when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_EVENT_TYPE_TO_SETTINGS_IDENTIFIER)).thenReturn(createSettingsMetaDataAgainstIdentfier()); - doReturn(createSettingsConfigurations()).when(settingService).findSettingsByIdentifier("event_type_flag_problem"); - List result = exportEventDataMapper.getExportEventDataAfterMapping(events.get(0).getJson(),"flag_problem",true,true); - assertNotNull(result); - assertEquals("Location id", result.get(0)); - assertEquals("Location name", result.get(1)); - } - - @Test - public void testGetExportEventDataAfterMappingForRowDataWithSettings() throws JsonProcessingException { - eventsRepository.add(createFlagProblemEvent()); - List events = eventsRepository.getEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); - when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_EVENT_TYPE_TO_SETTINGS_IDENTIFIER)).thenReturn(createSettingsMetaDataAgainstIdentfier()); - doReturn(createSettingsConfigurations()).when(settingService).findSettingsByIdentifier("event_type_flag_problem"); - List result = exportEventDataMapper.getExportEventDataAfterMapping(events.get(0).getJson(),"flag_problem",false,true); - assertNotNull(result); - assertEquals("f3199af5-2eaf-46df-87c9-40d59606a2fb", result.get(0)); - assertEquals("EPP Ambodisatrana 2", result.get(1)); - } - - @Test - public void testGetFlagProblemEventImagesMetadata() throws JsonProcessingException { - eventsRepository.add(createFlagProblemEvent()); - List events = eventsRepository.getEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); - ExportFlagProblemEventImageMetadata exportFlagProblemEventImageMetadata = exportEventDataMapper.getFlagProblemEventImagesMetadata(events.get(0).getJson(),"$.baseEntityId", "$.details.locationName", "$.details.productName"); - assertNotNull(exportFlagProblemEventImageMetadata); - assertEquals("ddcaf383-882e-448b-b701-8b72cb0d4d7a", exportFlagProblemEventImageMetadata.getStockId()); - assertEquals("EPP Ambodisatrana 2", exportFlagProblemEventImageMetadata.getServicePointName()); - assertEquals("Midwifery Kit", exportFlagProblemEventImageMetadata.getProductName()); - } - - - private List createSettingsConfigurations() { - List settingsAndSettingsMetadataJoinedList = new ArrayList<>(); - SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined = new SettingsAndSettingsMetadataJoined(); +public class ExportEventDataMapperTest extends BaseRepositoryTest { + + private final Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") + .registerTypeAdapter(DateTime.class, new DateTimeTypeConverter()).create(); + @InjectMocks + private ExportEventDataMapper exportEventDataMapper; + @Mock + private SettingService settingService; + @Autowired + @Qualifier("eventsRepositoryPostgres") + private EventsRepository eventsRepository; + private Set scripts = new HashSet(); + + @Before + public void setUpPostgresRepository() { + initMocks(this); + } + + @Override + protected Set getDatabaseScripts() { + scripts.add("event.sql"); + return scripts; + } + + + @Test + public void testGetExportEventDataAfterMappingForHeaderWithoutSettings() throws JsonProcessingException { + eventsRepository.add(createFlagProblemEvent()); + List events = eventsRepository.getEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); + String json = ""; + if (events != null && events.get(0) != null && events.get(0).getJson() != null) { + json = gson.toJson(events.get(0).getJson()); + } + Event event = gson.fromJson(json, Event.class); + List result = exportEventDataMapper.getExportEventDataAfterMapping(events.get(0).getJson(), "flag_problem", true, false); + assertNotNull(result); + int eventObsSize = event.getObs().size(); + int resultSize = result.size(); + assertEquals(eventObsSize, resultSize); + assertEquals(event.getObs().get(0).getFormSubmissionField(), result.get(0)); + assertEquals(event.getObs().get(eventObsSize - 1).getFormSubmissionField(), result.get(resultSize - 1)); + } + + @Test + public void testGetExportEventDataAfterMappingForRowDataWithoutSettings() throws JsonProcessingException { + eventsRepository.add(createFlagProblemEvent()); + List events = eventsRepository.getEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); + String json = ""; + if (events != null && events.get(0) != null && events.get(0).getJson() != null) { + json = gson.toJson(events.get(0).getJson()); + } + Event event = gson.fromJson(json, Event.class); + List result = exportEventDataMapper.getExportEventDataAfterMapping(events.get(0).getJson(), "flag_problem", false, false); + assertNotNull(result); + int eventObsSize = event.getObs().size(); + int resultSize = result.size(); + assertEquals(eventObsSize, resultSize); + assertEquals(event.getObs().get(0).getValues(), result.get(0)); + assertEquals(event.getObs().get(eventObsSize - 1).getValues(), result.get(resultSize - 1)); + } + + @Test + public void testGetExportEventDataAfterMappingForHeaderWithSettings() throws JsonProcessingException { + eventsRepository.add(createFlagProblemEvent()); + List events = eventsRepository.getEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); + when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_EVENT_TYPE_TO_SETTINGS_IDENTIFIER)).thenReturn(createSettingsMetaDataAgainstIdentfier()); + doReturn(createSettingsConfigurations()).when(settingService).findSettingsByIdentifier("event_type_flag_problem"); + List result = exportEventDataMapper.getExportEventDataAfterMapping(events.get(0).getJson(), "flag_problem", true, true); + assertNotNull(result); + assertEquals("Location id", result.get(0)); + assertEquals("Location name", result.get(1)); + } + + @Test + public void testGetExportEventDataAfterMappingForRowDataWithSettings() throws JsonProcessingException { + eventsRepository.add(createFlagProblemEvent()); + List events = eventsRepository.getEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); + when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_EVENT_TYPE_TO_SETTINGS_IDENTIFIER)).thenReturn(createSettingsMetaDataAgainstIdentfier()); + doReturn(createSettingsConfigurations()).when(settingService).findSettingsByIdentifier("event_type_flag_problem"); + List result = exportEventDataMapper.getExportEventDataAfterMapping(events.get(0).getJson(), "flag_problem", false, true); + assertNotNull(result); + assertEquals("f3199af5-2eaf-46df-87c9-40d59606a2fb", result.get(0)); + assertEquals("EPP Ambodisatrana 2", result.get(1)); + } + + @Test + public void testGetFlagProblemEventImagesMetadata() throws JsonProcessingException { + eventsRepository.add(createFlagProblemEvent()); + List events = eventsRepository.getEventData("335ef7a3-7f35-58aa-8263-4419464946d8", "flag_problem", null, null); + ExportFlagProblemEventImageMetadata exportFlagProblemEventImageMetadata = exportEventDataMapper.getFlagProblemEventImagesMetadata(events.get(0).getJson(), "$.baseEntityId", "$.details.locationName", "$.details.productName"); + assertNotNull(exportFlagProblemEventImageMetadata); + assertEquals("ddcaf383-882e-448b-b701-8b72cb0d4d7a", exportFlagProblemEventImageMetadata.getStockId()); + assertEquals("EPP Ambodisatrana 2", exportFlagProblemEventImageMetadata.getServicePointName()); + assertEquals("Midwifery Kit", exportFlagProblemEventImageMetadata.getProductName()); + } + + + private List createSettingsConfigurations() { + List settingsAndSettingsMetadataJoinedList = new ArrayList<>(); + SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined = new SettingsAndSettingsMetadataJoined(); SettingsMetadata settingsMetadata = new SettingsMetadata(); - settingsMetadata.setSettingLabel("Location id"); - settingsMetadata.setSettingKey("$.locationId"); - settingsAndSettingsMetadataJoined.setSettingsMetadata(settingsMetadata); - settingsAndSettingsMetadataJoinedList.add(settingsAndSettingsMetadataJoined); - settingsMetadata = new SettingsMetadata(); - settingsAndSettingsMetadataJoined = new SettingsAndSettingsMetadataJoined(); - settingsMetadata.setSettingLabel("Location name"); - settingsMetadata.setSettingKey("$.details.locationName"); - settingsAndSettingsMetadataJoined.setSettingsMetadata(settingsMetadata); - settingsAndSettingsMetadataJoinedList.add(settingsAndSettingsMetadataJoined); - return settingsAndSettingsMetadataJoinedList; - } - - private List createSettingsMetaDataAgainstIdentfier() { - SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined = new SettingsAndSettingsMetadataJoined(); - SettingsMetadata settingsMetadata = new SettingsMetadata(); - settingsMetadata.setSettingKey("flag_problem"); - settingsMetadata.setSettingValue("event_type_flag_problem"); - settingsAndSettingsMetadataJoined.setSettingsMetadata(settingsMetadata); - return Collections.singletonList(settingsAndSettingsMetadataJoined); - } + settingsMetadata.setSettingLabel("Location id"); + settingsMetadata.setSettingKey("$.locationId"); + settingsAndSettingsMetadataJoined.setSettingsMetadata(settingsMetadata); + settingsAndSettingsMetadataJoinedList.add(settingsAndSettingsMetadataJoined); + settingsMetadata = new SettingsMetadata(); + settingsAndSettingsMetadataJoined = new SettingsAndSettingsMetadataJoined(); + settingsMetadata.setSettingLabel("Location name"); + settingsMetadata.setSettingKey("$.details.locationName"); + settingsAndSettingsMetadataJoined.setSettingsMetadata(settingsMetadata); + settingsAndSettingsMetadataJoinedList.add(settingsAndSettingsMetadataJoined); + return settingsAndSettingsMetadataJoinedList; + } + + private List createSettingsMetaDataAgainstIdentfier() { + SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined = new SettingsAndSettingsMetadataJoined(); + SettingsMetadata settingsMetadata = new SettingsMetadata(); + settingsMetadata.setSettingKey("flag_problem"); + settingsMetadata.setSettingValue("event_type_flag_problem"); + settingsAndSettingsMetadataJoined.setSettingsMetadata(settingsMetadata); + return Collections.singletonList(settingsAndSettingsMetadataJoined); + } } diff --git a/src/test/java/org/opensrp/service/IdentifierSourceServiceTest.java b/src/test/java/org/opensrp/service/IdentifierSourceServiceTest.java index fc2513c7a..9ed3322cc 100644 --- a/src/test/java/org/opensrp/service/IdentifierSourceServiceTest.java +++ b/src/test/java/org/opensrp/service/IdentifierSourceServiceTest.java @@ -8,6 +8,7 @@ import org.opensrp.util.IdentifierValidatorAlgorithm; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -15,114 +16,113 @@ import java.util.Set; - public class IdentifierSourceServiceTest extends BaseRepositoryTest { - - private IdentifierSourceService identifierSourceService; - - @Autowired - @Qualifier("identifierSourceRepositoryPostgres") - private IdentifierSourceRepository identifierSourceRepository; - - @Before - public void setUpPostgresRepository() { - identifierSourceService = new IdentifierSourceService(identifierSourceRepository); - } - - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("identifier_source.sql"); - return scripts; - } - - - @Test - public void testAddIdentifierSource() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setBaseCharacterSet("AB12"); - identifierSource.setMinLength(4); - identifierSource.setMaxLength(5); - identifierSource.setIdentifier("Test-Id-Source"); - identifierSourceService.add(identifierSource); - assertEquals(2,identifierSourceService.findAllIdentifierSources().size()); // 1 added through script - IdentifierSource savedIdentifierSource = identifierSourceService.findByIdentifier("Test-Id-Source"); - assertNotNull(savedIdentifierSource.getId()); - } - - @Test - public void testFindByIdentifier() { - IdentifierSource savedIdentifierSource = identifierSourceService.findByIdentifier("Test Identifier"); - assertNotNull(savedIdentifierSource.getId()); - assertEquals(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM, savedIdentifierSource.getIdentifierValidatorAlgorithm()); - } - - @Test - public void testUpdate() { - IdentifierSource updatedIdentifierSource = identifierSourceService.findByIdentifier("Test Identifier"); - updatedIdentifierSource.setDescription("Test Updated"); - identifierSourceService.update(updatedIdentifierSource); - IdentifierSource idSource = identifierSourceService.findByIdentifier("Test Identifier"); - assertNotNull(idSource.getId()); - assertEquals(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM.name(), idSource.getIdentifierValidatorAlgorithm().name()); - assertEquals("Test Updated", idSource.getDescription()); - } - - @Test(expected = IllegalArgumentException.class) - public void testAddIdentifierSourceWithBlankIdentifier() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setBaseCharacterSet("AB12"); - identifierSource.setMinLength(4); - identifierSource.setMaxLength(5); - identifierSource.setIdentifier(""); - identifierSourceService.add(identifierSource); - } - - @Test(expected = IllegalArgumentException.class) - public void testAddIdentifierSourceWithEmptyBaseCharacterSet() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setBaseCharacterSet(""); - identifierSource.setMinLength(4); - identifierSource.setMaxLength(5); - identifierSource.setIdentifier("Test-1"); - identifierSourceService.add(identifierSource); - } - - @Test(expected = IllegalArgumentException.class) - public void testAddIdentifierSourceWithEmptyMinLength() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setBaseCharacterSet("AB12"); - identifierSource.setMaxLength(5); - identifierSource.setIdentifier("Test-1"); - identifierSourceService.add(identifierSource); - } - - @Test(expected = IllegalArgumentException.class) - public void testAddIdentifierSourceWithEmptyMaxLength() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setBaseCharacterSet("AB12"); - identifierSource.setMinLength(4); - identifierSource.setIdentifier("Test-1"); - identifierSourceService.add(identifierSource); - } - - @Test(expected = IllegalArgumentException.class) - public void testAddIdentifierSourceWithInvalidMinLength() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setBaseCharacterSet("AB12"); - identifierSource.setMinLength(17); - identifierSource.setMaxLength(10); - identifierSource.setIdentifier("Test-1"); - identifierSourceService.add(identifierSource); - } - - @Test - public void testSaveSequenceValue() { - IdentifierSource identifierSource = identifierSourceService.findByIdentifier("Test Identifier"); - identifierSourceService.saveSequenceValue(identifierSource,1234l); - IdentifierSource updatedIdentifierSource = identifierSourceService.findByIdentifier("Test Identifier"); - assertEquals(new Long(1234),updatedIdentifierSource.getSequenceValue()); - } - + + private IdentifierSourceService identifierSourceService; + + @Autowired + @Qualifier("identifierSourceRepositoryPostgres") + private IdentifierSourceRepository identifierSourceRepository; + + @Before + public void setUpPostgresRepository() { + identifierSourceService = new IdentifierSourceService(identifierSourceRepository); + } + + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("identifier_source.sql"); + return scripts; + } + + + @Test + public void testAddIdentifierSource() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setBaseCharacterSet("AB12"); + identifierSource.setMinLength(4); + identifierSource.setMaxLength(5); + identifierSource.setIdentifier("Test-Id-Source"); + identifierSourceService.add(identifierSource); + assertEquals(2, identifierSourceService.findAllIdentifierSources().size()); // 1 added through script + IdentifierSource savedIdentifierSource = identifierSourceService.findByIdentifier("Test-Id-Source"); + assertNotNull(savedIdentifierSource.getId()); + } + + @Test + public void testFindByIdentifier() { + IdentifierSource savedIdentifierSource = identifierSourceService.findByIdentifier("Test Identifier"); + assertNotNull(savedIdentifierSource.getId()); + assertEquals(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM, savedIdentifierSource.getIdentifierValidatorAlgorithm()); + } + + @Test + public void testUpdate() { + IdentifierSource updatedIdentifierSource = identifierSourceService.findByIdentifier("Test Identifier"); + updatedIdentifierSource.setDescription("Test Updated"); + identifierSourceService.update(updatedIdentifierSource); + IdentifierSource idSource = identifierSourceService.findByIdentifier("Test Identifier"); + assertNotNull(idSource.getId()); + assertEquals(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM.name(), idSource.getIdentifierValidatorAlgorithm().name()); + assertEquals("Test Updated", idSource.getDescription()); + } + + @Test(expected = IllegalArgumentException.class) + public void testAddIdentifierSourceWithBlankIdentifier() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setBaseCharacterSet("AB12"); + identifierSource.setMinLength(4); + identifierSource.setMaxLength(5); + identifierSource.setIdentifier(""); + identifierSourceService.add(identifierSource); + } + + @Test(expected = IllegalArgumentException.class) + public void testAddIdentifierSourceWithEmptyBaseCharacterSet() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setBaseCharacterSet(""); + identifierSource.setMinLength(4); + identifierSource.setMaxLength(5); + identifierSource.setIdentifier("Test-1"); + identifierSourceService.add(identifierSource); + } + + @Test(expected = IllegalArgumentException.class) + public void testAddIdentifierSourceWithEmptyMinLength() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setBaseCharacterSet("AB12"); + identifierSource.setMaxLength(5); + identifierSource.setIdentifier("Test-1"); + identifierSourceService.add(identifierSource); + } + + @Test(expected = IllegalArgumentException.class) + public void testAddIdentifierSourceWithEmptyMaxLength() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setBaseCharacterSet("AB12"); + identifierSource.setMinLength(4); + identifierSource.setIdentifier("Test-1"); + identifierSourceService.add(identifierSource); + } + + @Test(expected = IllegalArgumentException.class) + public void testAddIdentifierSourceWithInvalidMinLength() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setBaseCharacterSet("AB12"); + identifierSource.setMinLength(17); + identifierSource.setMaxLength(10); + identifierSource.setIdentifier("Test-1"); + identifierSourceService.add(identifierSource); + } + + @Test + public void testSaveSequenceValue() { + IdentifierSource identifierSource = identifierSourceService.findByIdentifier("Test Identifier"); + identifierSourceService.saveSequenceValue(identifierSource, 1234l); + IdentifierSource updatedIdentifierSource = identifierSourceService.findByIdentifier("Test Identifier"); + assertEquals(new Long(1234), updatedIdentifierSource.getSequenceValue()); + } + } diff --git a/src/test/java/org/opensrp/service/ImportBulkDataServiceTest.java b/src/test/java/org/opensrp/service/ImportBulkDataServiceTest.java index 25a58f1c7..3e2a50df6 100644 --- a/src/test/java/org/opensrp/service/ImportBulkDataServiceTest.java +++ b/src/test/java/org/opensrp/service/ImportBulkDataServiceTest.java @@ -31,204 +31,188 @@ @ContextConfiguration("classpath:test-applicationContext-opensrp.xml") public class ImportBulkDataServiceTest { - @Mock - private OrganizationService organizationService; - - @Mock - private PractitionerService practitionerService; - - @Mock - private PractitionerRoleService practitionerRoleService; - - @Mock - private PhysicalLocationService physicalLocationService; - - @InjectMocks - private ImportBulkDataService importBulkDataService; - - private static final String LOCATION_ID_KEY = "Location Id"; - - private static final String LOCATION_NAME_KEY = "Location Name"; - - private static final String ORGANIZATION_NAME_KEY = "Organization Name"; - - private static final String PLAN_ID_KEY = "Plan Id"; - - private static final String ORGANIZATION_ID_KEY = "Organization Id"; - - private static final String USER_ID_KEY = "User Id"; - - private static final String USER_NAME_KEY = "User Name"; - - private static final String NAME_KEY = "Name"; - - private static final String ROLE_KEY = "Role"; - - private static final String LOCATION_VALIDATION_FAILED = "Validation failed, provided location name mismatches with the system"; - - private static final String ORGANIZATION_NOT_FOUND = "Failed to get organization against the given organization Id"; - - private static final String ORGANIZATION_NAME_MISMATCH_ERROR = "Validation failed, provided organization name mismatches with the system"; - - @Before - public void setUp() { - initMocks(this); - } - - @Test - public void testConvertandPersistOrganizationdata() { - List> csvOrganizations = new ArrayList<>(); - Map csvdata = new HashMap<>(); - csvdata.put(ORGANIZATION_NAME_KEY, "test-org-A"); - csvdata.put(LOCATION_ID_KEY, "1234"); - csvdata.put(LOCATION_NAME_KEY, "test-loc-A"); - csvdata.put(PLAN_ID_KEY, "test-plan-A"); - csvOrganizations.add(csvdata); - - PhysicalLocation physicalLocation = new PhysicalLocation(); - LocationProperty locationProperty = new LocationProperty(); - locationProperty.setName("test-loc-A"); - physicalLocation.setProperties(locationProperty); - - when(physicalLocationService.getLocation(anyString(), anyBoolean(), anyBoolean())).thenReturn(physicalLocation); - doNothing().when(organizationService).addOrganization(any(Organization.class)); - doNothing().when(organizationService).assignLocationAndPlan(anyString(), anyString(), anyString(), any(Date.class), - nullable(Date.class)); //handles update case as well - CsvBulkImportDataSummary csvBulkImportDataSummary = importBulkDataService - .convertandPersistOrganizationdata(csvOrganizations); - System.out.println(csvBulkImportDataSummary); - assertEquals(new Integer(1), csvBulkImportDataSummary.getNumberOfCsvRows()); - assertEquals(new Integer(1), csvBulkImportDataSummary.getNumberOfRowsProcessed()); - assertEquals(0, csvBulkImportDataSummary.getFailedRecordSummaryList().size()); - } - - @Test - public void testConvertandPersistOrganizationdataWithValidationFailed() { - List> csvOrganizations = new ArrayList<>(); - Map csvdata = new HashMap<>(); - csvdata.put(ORGANIZATION_NAME_KEY, "test-org-A"); - csvdata.put(LOCATION_ID_KEY, "1234"); - csvdata.put(LOCATION_NAME_KEY, "test-loc-A"); - csvdata.put(PLAN_ID_KEY, "test-plan-A"); - csvOrganizations.add(csvdata); - - PhysicalLocation physicalLocation = new PhysicalLocation(); - LocationProperty locationProperty = new LocationProperty(); - locationProperty.setName("test-loc-B"); - physicalLocation.setProperties(locationProperty); - - when(physicalLocationService.getLocation(anyString(), anyBoolean(), anyBoolean())).thenReturn(physicalLocation); - CsvBulkImportDataSummary csvBulkImportDataSummary = importBulkDataService - .convertandPersistOrganizationdata(csvOrganizations); - - assertEquals(new Integer(1), csvBulkImportDataSummary.getNumberOfCsvRows()); - assertEquals(new Integer(0), csvBulkImportDataSummary.getNumberOfRowsProcessed()); - assertEquals(1, csvBulkImportDataSummary.getFailedRecordSummaryList().size()); - assertEquals(new Integer(1), csvBulkImportDataSummary.getFailedRecordSummaryList().get(0).getRowNumber()); - assertEquals(LOCATION_VALIDATION_FAILED, - csvBulkImportDataSummary.getFailedRecordSummaryList().get(0).getReasonOfFailure().get(0)); - } - - @Test - public void testConvertandPersistPractitionerdata() { - List> csvPractitioners = new ArrayList<>(); - Map csvdata = new HashMap<>(); - csvdata.put(ORGANIZATION_ID_KEY, "1"); - csvdata.put(ORGANIZATION_NAME_KEY, "test-org-A"); - csvdata.put(USER_NAME_KEY, "John"); - csvdata.put(NAME_KEY, "Jack"); - csvdata.put(USER_ID_KEY, "test-123"); - csvdata.put(ROLE_KEY, "Health coach"); - csvPractitioners.add(csvdata); - - Practitioner practitioner = new Practitioner(); - practitioner.setIdentifier("a30f1e8b-ed9c-4e0c-a2fd-218c603fe5ec"); - - Organization organization = new Organization(); - organization.setName("test-org-A"); - organization.setIdentifier("a30f1e8b-ed9c-4e0c-a2fd-218c603fe523"); - - when(practitionerService.getPractionerByUsername(anyString())).thenReturn(practitioner); - when(organizationService.getOrganization(anyLong())).thenReturn(organization); - when(practitionerService.addOrUpdatePractitioner(any(Practitioner.class))).thenReturn(practitioner); - doNothing().when(practitionerRoleService).assignPractitionerRole(anyLong(), anyString(), anyString(), any( - PractitionerRole.class)); - - CsvBulkImportDataSummary csvBulkImportDataSummary = importBulkDataService - .convertandPersistPractitionerdata(csvPractitioners); - - assertEquals(new Integer(1), csvBulkImportDataSummary.getNumberOfCsvRows()); - assertEquals(new Integer(1), csvBulkImportDataSummary.getNumberOfRowsProcessed()); - assertEquals(0, csvBulkImportDataSummary.getFailedRecordSummaryList().size()); - - } - - @Test - public void testConvertandPersistPractitionerdataWithInvalidOrganizationId() { - List> csvPractitioners = new ArrayList<>(); - Map csvdata = new HashMap<>(); - csvdata.put(ORGANIZATION_ID_KEY, "1"); - csvdata.put(ORGANIZATION_NAME_KEY, "test-org-A"); - csvdata.put(USER_NAME_KEY, "John"); - csvdata.put(NAME_KEY, "Jack"); - csvdata.put(USER_ID_KEY, "test-123"); - csvdata.put(ROLE_KEY, "Health coach"); - csvPractitioners.add(csvdata); - - Practitioner practitioner = new Practitioner(); - practitioner.setIdentifier("a30f1e8b-ed9c-4e0c-a2fd-218c603fe5ec"); - - when(practitionerService.getPractionerByUsername(anyString())).thenReturn(practitioner); - when(organizationService.getOrganization(anyLong())).thenReturn(null); - when(practitionerService.addOrUpdatePractitioner(any(Practitioner.class))).thenReturn(practitioner); - doNothing().when(practitionerRoleService).assignPractitionerRole(anyLong(), anyString(), anyString(), any( - PractitionerRole.class)); - - CsvBulkImportDataSummary csvBulkImportDataSummary = importBulkDataService - .convertandPersistPractitionerdata(csvPractitioners); - - assertEquals(new Integer(1), csvBulkImportDataSummary.getNumberOfCsvRows()); - assertEquals(new Integer(0), csvBulkImportDataSummary.getNumberOfRowsProcessed()); - assertEquals(1, csvBulkImportDataSummary.getFailedRecordSummaryList().size()); - assertEquals(new Integer(1), csvBulkImportDataSummary.getFailedRecordSummaryList().get(0).getRowNumber()); - assertEquals(ORGANIZATION_NOT_FOUND, - csvBulkImportDataSummary.getFailedRecordSummaryList().get(0).getReasonOfFailure().get(0)); - } - - @Test - public void testConvertandPersistPractitionerdataWithInvalidOrganizationName() { - List> csvPractitioners = new ArrayList<>(); - Map csvdata = new HashMap<>(); - csvdata.put(ORGANIZATION_ID_KEY, "1"); - csvdata.put(ORGANIZATION_NAME_KEY, "test-org-A"); - csvdata.put(USER_NAME_KEY, "John"); - csvdata.put(NAME_KEY, "Jack"); - csvdata.put(USER_ID_KEY, "test-123"); - csvdata.put(ROLE_KEY, "Health coach"); - csvPractitioners.add(csvdata); - - Practitioner practitioner = new Practitioner(); - practitioner.setIdentifier("a30f1e8b-ed9c-4e0c-a2fd-218c603fe5ec"); - - Organization organization = new Organization(); - organization.setName("test-org-B"); - organization.setIdentifier("a30f1e8b-ed9c-4e0c-a2fd-218c603fe523"); - - when(practitionerService.getPractionerByUsername(anyString())).thenReturn(practitioner); - when(organizationService.getOrganization(anyLong())).thenReturn(organization); - when(practitionerService.addOrUpdatePractitioner(any(Practitioner.class))).thenReturn(practitioner); - doNothing().when(practitionerRoleService).assignPractitionerRole(anyLong(), anyString(), anyString(), any( - PractitionerRole.class)); - - CsvBulkImportDataSummary csvBulkImportDataSummary = importBulkDataService - .convertandPersistPractitionerdata(csvPractitioners); - - assertEquals(new Integer(1), csvBulkImportDataSummary.getNumberOfCsvRows()); - assertEquals(new Integer(0), csvBulkImportDataSummary.getNumberOfRowsProcessed()); - assertEquals(1, csvBulkImportDataSummary.getFailedRecordSummaryList().size()); - assertEquals(new Integer(1), csvBulkImportDataSummary.getFailedRecordSummaryList().get(0).getRowNumber()); - assertEquals(ORGANIZATION_NAME_MISMATCH_ERROR, - csvBulkImportDataSummary.getFailedRecordSummaryList().get(0).getReasonOfFailure().get(0)); - } + private static final String LOCATION_ID_KEY = "Location Id"; + private static final String LOCATION_NAME_KEY = "Location Name"; + private static final String ORGANIZATION_NAME_KEY = "Organization Name"; + private static final String PLAN_ID_KEY = "Plan Id"; + private static final String ORGANIZATION_ID_KEY = "Organization Id"; + private static final String USER_ID_KEY = "User Id"; + private static final String USER_NAME_KEY = "User Name"; + private static final String NAME_KEY = "Name"; + private static final String ROLE_KEY = "Role"; + private static final String LOCATION_VALIDATION_FAILED = "Validation failed, provided location name mismatches with the system"; + private static final String ORGANIZATION_NOT_FOUND = "Failed to get organization against the given organization Id"; + private static final String ORGANIZATION_NAME_MISMATCH_ERROR = "Validation failed, provided organization name mismatches with the system"; + @Mock + private OrganizationService organizationService; + @Mock + private PractitionerService practitionerService; + @Mock + private PractitionerRoleService practitionerRoleService; + @Mock + private PhysicalLocationService physicalLocationService; + @InjectMocks + private ImportBulkDataService importBulkDataService; + + @Before + public void setUp() { + initMocks(this); + } + + @Test + public void testConvertandPersistOrganizationdata() { + List> csvOrganizations = new ArrayList<>(); + Map csvdata = new HashMap<>(); + csvdata.put(ORGANIZATION_NAME_KEY, "test-org-A"); + csvdata.put(LOCATION_ID_KEY, "1234"); + csvdata.put(LOCATION_NAME_KEY, "test-loc-A"); + csvdata.put(PLAN_ID_KEY, "test-plan-A"); + csvOrganizations.add(csvdata); + + PhysicalLocation physicalLocation = new PhysicalLocation(); + LocationProperty locationProperty = new LocationProperty(); + locationProperty.setName("test-loc-A"); + physicalLocation.setProperties(locationProperty); + + when(physicalLocationService.getLocation(anyString(), anyBoolean(), anyBoolean())).thenReturn(physicalLocation); + doNothing().when(organizationService).addOrganization(any(Organization.class)); + doNothing().when(organizationService).assignLocationAndPlan(anyString(), anyString(), anyString(), any(Date.class), + nullable(Date.class)); //handles update case as well + CsvBulkImportDataSummary csvBulkImportDataSummary = importBulkDataService + .convertandPersistOrganizationdata(csvOrganizations); + System.out.println(csvBulkImportDataSummary); + assertEquals(new Integer(1), csvBulkImportDataSummary.getNumberOfCsvRows()); + assertEquals(new Integer(1), csvBulkImportDataSummary.getNumberOfRowsProcessed()); + assertEquals(0, csvBulkImportDataSummary.getFailedRecordSummaryList().size()); + } + + @Test + public void testConvertandPersistOrganizationdataWithValidationFailed() { + List> csvOrganizations = new ArrayList<>(); + Map csvdata = new HashMap<>(); + csvdata.put(ORGANIZATION_NAME_KEY, "test-org-A"); + csvdata.put(LOCATION_ID_KEY, "1234"); + csvdata.put(LOCATION_NAME_KEY, "test-loc-A"); + csvdata.put(PLAN_ID_KEY, "test-plan-A"); + csvOrganizations.add(csvdata); + + PhysicalLocation physicalLocation = new PhysicalLocation(); + LocationProperty locationProperty = new LocationProperty(); + locationProperty.setName("test-loc-B"); + physicalLocation.setProperties(locationProperty); + + when(physicalLocationService.getLocation(anyString(), anyBoolean(), anyBoolean())).thenReturn(physicalLocation); + CsvBulkImportDataSummary csvBulkImportDataSummary = importBulkDataService + .convertandPersistOrganizationdata(csvOrganizations); + + assertEquals(new Integer(1), csvBulkImportDataSummary.getNumberOfCsvRows()); + assertEquals(new Integer(0), csvBulkImportDataSummary.getNumberOfRowsProcessed()); + assertEquals(1, csvBulkImportDataSummary.getFailedRecordSummaryList().size()); + assertEquals(new Integer(1), csvBulkImportDataSummary.getFailedRecordSummaryList().get(0).getRowNumber()); + assertEquals(LOCATION_VALIDATION_FAILED, + csvBulkImportDataSummary.getFailedRecordSummaryList().get(0).getReasonOfFailure().get(0)); + } + + @Test + public void testConvertandPersistPractitionerdata() { + List> csvPractitioners = new ArrayList<>(); + Map csvdata = new HashMap<>(); + csvdata.put(ORGANIZATION_ID_KEY, "1"); + csvdata.put(ORGANIZATION_NAME_KEY, "test-org-A"); + csvdata.put(USER_NAME_KEY, "John"); + csvdata.put(NAME_KEY, "Jack"); + csvdata.put(USER_ID_KEY, "test-123"); + csvdata.put(ROLE_KEY, "Health coach"); + csvPractitioners.add(csvdata); + + Practitioner practitioner = new Practitioner(); + practitioner.setIdentifier("a30f1e8b-ed9c-4e0c-a2fd-218c603fe5ec"); + + Organization organization = new Organization(); + organization.setName("test-org-A"); + organization.setIdentifier("a30f1e8b-ed9c-4e0c-a2fd-218c603fe523"); + + when(practitionerService.getPractionerByUsername(anyString())).thenReturn(practitioner); + when(organizationService.getOrganization(anyLong())).thenReturn(organization); + when(practitionerService.addOrUpdatePractitioner(any(Practitioner.class))).thenReturn(practitioner); + doNothing().when(practitionerRoleService).assignPractitionerRole(anyLong(), anyString(), anyString(), any( + PractitionerRole.class)); + + CsvBulkImportDataSummary csvBulkImportDataSummary = importBulkDataService + .convertandPersistPractitionerdata(csvPractitioners); + + assertEquals(new Integer(1), csvBulkImportDataSummary.getNumberOfCsvRows()); + assertEquals(new Integer(1), csvBulkImportDataSummary.getNumberOfRowsProcessed()); + assertEquals(0, csvBulkImportDataSummary.getFailedRecordSummaryList().size()); + + } + + @Test + public void testConvertandPersistPractitionerdataWithInvalidOrganizationId() { + List> csvPractitioners = new ArrayList<>(); + Map csvdata = new HashMap<>(); + csvdata.put(ORGANIZATION_ID_KEY, "1"); + csvdata.put(ORGANIZATION_NAME_KEY, "test-org-A"); + csvdata.put(USER_NAME_KEY, "John"); + csvdata.put(NAME_KEY, "Jack"); + csvdata.put(USER_ID_KEY, "test-123"); + csvdata.put(ROLE_KEY, "Health coach"); + csvPractitioners.add(csvdata); + + Practitioner practitioner = new Practitioner(); + practitioner.setIdentifier("a30f1e8b-ed9c-4e0c-a2fd-218c603fe5ec"); + + when(practitionerService.getPractionerByUsername(anyString())).thenReturn(practitioner); + when(organizationService.getOrganization(anyLong())).thenReturn(null); + when(practitionerService.addOrUpdatePractitioner(any(Practitioner.class))).thenReturn(practitioner); + doNothing().when(practitionerRoleService).assignPractitionerRole(anyLong(), anyString(), anyString(), any( + PractitionerRole.class)); + + CsvBulkImportDataSummary csvBulkImportDataSummary = importBulkDataService + .convertandPersistPractitionerdata(csvPractitioners); + + assertEquals(new Integer(1), csvBulkImportDataSummary.getNumberOfCsvRows()); + assertEquals(new Integer(0), csvBulkImportDataSummary.getNumberOfRowsProcessed()); + assertEquals(1, csvBulkImportDataSummary.getFailedRecordSummaryList().size()); + assertEquals(new Integer(1), csvBulkImportDataSummary.getFailedRecordSummaryList().get(0).getRowNumber()); + assertEquals(ORGANIZATION_NOT_FOUND, + csvBulkImportDataSummary.getFailedRecordSummaryList().get(0).getReasonOfFailure().get(0)); + } + + @Test + public void testConvertandPersistPractitionerdataWithInvalidOrganizationName() { + List> csvPractitioners = new ArrayList<>(); + Map csvdata = new HashMap<>(); + csvdata.put(ORGANIZATION_ID_KEY, "1"); + csvdata.put(ORGANIZATION_NAME_KEY, "test-org-A"); + csvdata.put(USER_NAME_KEY, "John"); + csvdata.put(NAME_KEY, "Jack"); + csvdata.put(USER_ID_KEY, "test-123"); + csvdata.put(ROLE_KEY, "Health coach"); + csvPractitioners.add(csvdata); + + Practitioner practitioner = new Practitioner(); + practitioner.setIdentifier("a30f1e8b-ed9c-4e0c-a2fd-218c603fe5ec"); + + Organization organization = new Organization(); + organization.setName("test-org-B"); + organization.setIdentifier("a30f1e8b-ed9c-4e0c-a2fd-218c603fe523"); + + when(practitionerService.getPractionerByUsername(anyString())).thenReturn(practitioner); + when(organizationService.getOrganization(anyLong())).thenReturn(organization); + when(practitionerService.addOrUpdatePractitioner(any(Practitioner.class))).thenReturn(practitioner); + doNothing().when(practitionerRoleService).assignPractitionerRole(anyLong(), anyString(), anyString(), any( + PractitionerRole.class)); + + CsvBulkImportDataSummary csvBulkImportDataSummary = importBulkDataService + .convertandPersistPractitionerdata(csvPractitioners); + + assertEquals(new Integer(1), csvBulkImportDataSummary.getNumberOfCsvRows()); + assertEquals(new Integer(0), csvBulkImportDataSummary.getNumberOfRowsProcessed()); + assertEquals(1, csvBulkImportDataSummary.getFailedRecordSummaryList().size()); + assertEquals(new Integer(1), csvBulkImportDataSummary.getFailedRecordSummaryList().get(0).getRowNumber()); + assertEquals(ORGANIZATION_NAME_MISMATCH_ERROR, + csvBulkImportDataSummary.getFailedRecordSummaryList().get(0).getReasonOfFailure().get(0)); + } } diff --git a/src/test/java/org/opensrp/service/LocationTagServiceTest.java b/src/test/java/org/opensrp/service/LocationTagServiceTest.java index 9123e6ac3..2d1327d5a 100644 --- a/src/test/java/org/opensrp/service/LocationTagServiceTest.java +++ b/src/test/java/org/opensrp/service/LocationTagServiceTest.java @@ -22,180 +22,180 @@ @RunWith(PowerMockRunner.class) public class LocationTagServiceTest { - - private LocationTagService locationTagService; - - private LocationTagRepository locationTagRepository; - - @Before - public void setUp() { - locationTagRepository = mock(LocationTagRepository.class); - locationTagService = new LocationTagService(); - locationTagService.setLocationTagRepository(locationTagRepository); - - } - - @Test - public void testgetAllLocationTags() { - List expectedLocationTags = new ArrayList<>(); - expectedLocationTags.add(initTestLocationTag()); - when(locationTagRepository.getAll()).thenReturn(expectedLocationTags); - - List actutalLocationTags = locationTagService.getAllLocationTags(); - verify(locationTagRepository).getAll(); - assertEquals(1, actutalLocationTags.size()); - assertEquals("Country", actutalLocationTags.get(0).getName()); - } - - @Test - public void testGetLocationTagByLocationTagName() { - List expectedLocationTags = new ArrayList<>(); - expectedLocationTags.add(initTestLocationTag()); - LocationTagExample locationTagExample = new LocationTagExample(); - when(locationTagRepository.findByLocationTagExample(locationTagExample, 0, 1)).thenReturn(expectedLocationTags); - - locationTagExample.createCriteria().andNameLike("C"); - List actutalLocationTag = locationTagService.findByLocationTagExample(locationTagExample, 0, 1); - verify(locationTagRepository).findByLocationTagExample(locationTagExample, 0, 1); - assertEquals(1, actutalLocationTag.size()); - assertEquals("Country", actutalLocationTag.get(0).getName()); - - } - - @Test - public void testGetLocationTagByLocationTagIdWithoutTheLocationExample() { - when(locationTagRepository.getLocationTagByPrimaryKey(1L)).thenReturn(initTestLocationTag()); - - LocationTag actutalLocationTag = locationTagService.getLocationTagById("1"); - verify(locationTagRepository).getLocationTagByPrimaryKey(1L); - assertEquals("Country", actutalLocationTag.getName()); - assertEquals("1", actutalLocationTag.getId() + ""); - } - - @Test - public void testGetLocationTagByLocationTagId() { - List expectedLocationTags = new ArrayList<>(); - expectedLocationTags.add(initTestLocationTag()); - LocationTagExample locationTagExample = new LocationTagExample(); - when(locationTagRepository.findByLocationTagExample(locationTagExample, 0, 1)).thenReturn(expectedLocationTags); - - locationTagExample.createCriteria().andIdEqualTo(1l); - List actutalLocationTag = locationTagService.findByLocationTagExample(locationTagExample, 0, 1); - verify(locationTagRepository).findByLocationTagExample(locationTagExample, 0, 1); - assertEquals(1, actutalLocationTag.size()); - assertEquals("Country", actutalLocationTag.get(0).getName()); - assertEquals("1", actutalLocationTag.get(0).getId() + ""); - - } - - @Test - public void testGetLocationTagByLocationTagActive() { - List expectedLocationTags = new ArrayList<>(); - expectedLocationTags.add(initTestLocationTag()); - LocationTagExample locationTagExample = new LocationTagExample(); - when(locationTagRepository.findByLocationTagExample(locationTagExample, 0, 1)).thenReturn(expectedLocationTags); - - locationTagExample.createCriteria().andIdEqualTo(1l); - List actutalLocationTag = locationTagService.findByLocationTagExample(locationTagExample, 0, 1); - verify(locationTagRepository).findByLocationTagExample(locationTagExample, 0, 1); - assertEquals(1, actutalLocationTag.size()); - assertEquals("Country", actutalLocationTag.get(0).getName()); - assertEquals(true, actutalLocationTag.get(0).getActive()); - - } - - @Test - public void testAddOrUpdateShouldCallRepostoryAddMethod() { - LocationTag locationTag = initTestLocationTag1(); - locationTagService.addOrUpdateLocationTag(locationTag); - verify(locationTagRepository).add(eq(locationTag)); - } - - @Test - public void testAddOrUpdateShouldCallRepostoryUpdateMethod() { - LocationTag locationTag = initTestLocationTag(); - locationTagService.addOrUpdateLocationTag(locationTag); - verify(locationTagRepository).update(eq(locationTag)); - } - - @Test - public void testDeleteShouldCallRepostorySafeRemoveMethodByLocationTag() { - when(locationTagRepository.get(anyString())).thenReturn(initTestLocationTag()); - LocationTag locationTag = initTestLocationTag(); - locationTagService.deleteLocationTag(locationTag); - verify(locationTagRepository).safeRemove(eq(locationTag)); - } - - @Test(expected = IllegalArgumentException.class) - public void testAddOrUpdateLocationTagWithoutLocationTagName() { - LocationTag locationTag = initTestLocationTag(); - locationTag.setName(null); - locationTagService.addOrUpdateLocationTag(locationTag); - verify(locationTagRepository, never()).add(eq(locationTag)); - verify(locationTagRepository, never()).update(eq(locationTag)); - - } - - @Test(expected = IllegalArgumentException.class) - public void testDeleteWithoutLocationTagName() { - LocationTag locationTag = initTestLocationTag(); - locationTag.setName(null); - locationTagService.deleteLocationTag(locationTag); - verify(locationTagRepository, never()).safeRemove(eq(locationTag)); - } - - private LocationTag initTestLocationTag() { - LocationTag locationTag = new LocationTag(); - locationTag.setName("Country"); - locationTag.setDescription("first label tag name"); - locationTag.setActive(true); - locationTag.setId(1l); - return locationTag; - } - - private LocationTag initTestLocationTag1() { - LocationTag locationTag = new LocationTag(); - locationTag.setName("Country"); - locationTag.setDescription("first label tag name"); - locationTag.setActive(true); - locationTag.setId(0l); - return locationTag; - } - - private LocationTagMap initTestLocationTagMap() { - LocationTagMap locationTagMap = new LocationTagMap(); - locationTagMap.setLocationId(1l); - locationTagMap.setLocationTagId(1l); - return locationTagMap; - } - - @Test - public void testShouldCallRepostoryAddLocationTagMapMethod() { - when(locationTagRepository.get(anyString())).thenReturn(null); - LocationTagMap locationTagMap = initTestLocationTagMap(); - - locationTagService.addLocationTagMap(locationTagMap); - verify(locationTagRepository).addLocationTagMap(eq(locationTagMap)); - } - - @Test - public void testShouldFindLocationTagMapByExample() { - List expectedLocationTagMaps = new ArrayList<>(); - expectedLocationTagMaps.add(initTestLocationTagMap()); - - when(locationTagRepository.getLocationTagMapByExample(1l, 1l)).thenReturn(expectedLocationTagMaps); - - List actutalLocationTag = locationTagService.findLocationTagMapByCriteria(1l, 1l); - verify(locationTagRepository).getLocationTagMapByExample(1l, 1l); - assertEquals(1, actutalLocationTag.size()); - assertEquals(1, actutalLocationTag.get(0).getLocationId().longValue()); - assertEquals(1, actutalLocationTag.get(0).getLocationTagId().longValue()); - - } - - @Test - public void testDeleteShouldCallRepostoryDeleteLocationTagMapByLocationIdAndLocationTagId() { - locationTagService.deleteLocationTagMapByLocationIdAndLocationTagId(1l, 1l); - verify(locationTagRepository).deleteLocationTagMapByLocationIdAndLocationTagId(1l, 1l); - } + + private LocationTagService locationTagService; + + private LocationTagRepository locationTagRepository; + + @Before + public void setUp() { + locationTagRepository = mock(LocationTagRepository.class); + locationTagService = new LocationTagService(); + locationTagService.setLocationTagRepository(locationTagRepository); + + } + + @Test + public void testgetAllLocationTags() { + List expectedLocationTags = new ArrayList<>(); + expectedLocationTags.add(initTestLocationTag()); + when(locationTagRepository.getAll()).thenReturn(expectedLocationTags); + + List actutalLocationTags = locationTagService.getAllLocationTags(); + verify(locationTagRepository).getAll(); + assertEquals(1, actutalLocationTags.size()); + assertEquals("Country", actutalLocationTags.get(0).getName()); + } + + @Test + public void testGetLocationTagByLocationTagName() { + List expectedLocationTags = new ArrayList<>(); + expectedLocationTags.add(initTestLocationTag()); + LocationTagExample locationTagExample = new LocationTagExample(); + when(locationTagRepository.findByLocationTagExample(locationTagExample, 0, 1)).thenReturn(expectedLocationTags); + + locationTagExample.createCriteria().andNameLike("C"); + List actutalLocationTag = locationTagService.findByLocationTagExample(locationTagExample, 0, 1); + verify(locationTagRepository).findByLocationTagExample(locationTagExample, 0, 1); + assertEquals(1, actutalLocationTag.size()); + assertEquals("Country", actutalLocationTag.get(0).getName()); + + } + + @Test + public void testGetLocationTagByLocationTagIdWithoutTheLocationExample() { + when(locationTagRepository.getLocationTagByPrimaryKey(1L)).thenReturn(initTestLocationTag()); + + LocationTag actutalLocationTag = locationTagService.getLocationTagById("1"); + verify(locationTagRepository).getLocationTagByPrimaryKey(1L); + assertEquals("Country", actutalLocationTag.getName()); + assertEquals("1", actutalLocationTag.getId() + ""); + } + + @Test + public void testGetLocationTagByLocationTagId() { + List expectedLocationTags = new ArrayList<>(); + expectedLocationTags.add(initTestLocationTag()); + LocationTagExample locationTagExample = new LocationTagExample(); + when(locationTagRepository.findByLocationTagExample(locationTagExample, 0, 1)).thenReturn(expectedLocationTags); + + locationTagExample.createCriteria().andIdEqualTo(1l); + List actutalLocationTag = locationTagService.findByLocationTagExample(locationTagExample, 0, 1); + verify(locationTagRepository).findByLocationTagExample(locationTagExample, 0, 1); + assertEquals(1, actutalLocationTag.size()); + assertEquals("Country", actutalLocationTag.get(0).getName()); + assertEquals("1", actutalLocationTag.get(0).getId() + ""); + + } + + @Test + public void testGetLocationTagByLocationTagActive() { + List expectedLocationTags = new ArrayList<>(); + expectedLocationTags.add(initTestLocationTag()); + LocationTagExample locationTagExample = new LocationTagExample(); + when(locationTagRepository.findByLocationTagExample(locationTagExample, 0, 1)).thenReturn(expectedLocationTags); + + locationTagExample.createCriteria().andIdEqualTo(1l); + List actutalLocationTag = locationTagService.findByLocationTagExample(locationTagExample, 0, 1); + verify(locationTagRepository).findByLocationTagExample(locationTagExample, 0, 1); + assertEquals(1, actutalLocationTag.size()); + assertEquals("Country", actutalLocationTag.get(0).getName()); + assertEquals(true, actutalLocationTag.get(0).getActive()); + + } + + @Test + public void testAddOrUpdateShouldCallRepostoryAddMethod() { + LocationTag locationTag = initTestLocationTag1(); + locationTagService.addOrUpdateLocationTag(locationTag); + verify(locationTagRepository).add(eq(locationTag)); + } + + @Test + public void testAddOrUpdateShouldCallRepostoryUpdateMethod() { + LocationTag locationTag = initTestLocationTag(); + locationTagService.addOrUpdateLocationTag(locationTag); + verify(locationTagRepository).update(eq(locationTag)); + } + + @Test + public void testDeleteShouldCallRepostorySafeRemoveMethodByLocationTag() { + when(locationTagRepository.get(anyString())).thenReturn(initTestLocationTag()); + LocationTag locationTag = initTestLocationTag(); + locationTagService.deleteLocationTag(locationTag); + verify(locationTagRepository).safeRemove(eq(locationTag)); + } + + @Test(expected = IllegalArgumentException.class) + public void testAddOrUpdateLocationTagWithoutLocationTagName() { + LocationTag locationTag = initTestLocationTag(); + locationTag.setName(null); + locationTagService.addOrUpdateLocationTag(locationTag); + verify(locationTagRepository, never()).add(eq(locationTag)); + verify(locationTagRepository, never()).update(eq(locationTag)); + + } + + @Test(expected = IllegalArgumentException.class) + public void testDeleteWithoutLocationTagName() { + LocationTag locationTag = initTestLocationTag(); + locationTag.setName(null); + locationTagService.deleteLocationTag(locationTag); + verify(locationTagRepository, never()).safeRemove(eq(locationTag)); + } + + private LocationTag initTestLocationTag() { + LocationTag locationTag = new LocationTag(); + locationTag.setName("Country"); + locationTag.setDescription("first label tag name"); + locationTag.setActive(true); + locationTag.setId(1l); + return locationTag; + } + + private LocationTag initTestLocationTag1() { + LocationTag locationTag = new LocationTag(); + locationTag.setName("Country"); + locationTag.setDescription("first label tag name"); + locationTag.setActive(true); + locationTag.setId(0l); + return locationTag; + } + + private LocationTagMap initTestLocationTagMap() { + LocationTagMap locationTagMap = new LocationTagMap(); + locationTagMap.setLocationId(1l); + locationTagMap.setLocationTagId(1l); + return locationTagMap; + } + + @Test + public void testShouldCallRepostoryAddLocationTagMapMethod() { + when(locationTagRepository.get(anyString())).thenReturn(null); + LocationTagMap locationTagMap = initTestLocationTagMap(); + + locationTagService.addLocationTagMap(locationTagMap); + verify(locationTagRepository).addLocationTagMap(eq(locationTagMap)); + } + + @Test + public void testShouldFindLocationTagMapByExample() { + List expectedLocationTagMaps = new ArrayList<>(); + expectedLocationTagMaps.add(initTestLocationTagMap()); + + when(locationTagRepository.getLocationTagMapByExample(1l, 1l)).thenReturn(expectedLocationTagMaps); + + List actutalLocationTag = locationTagService.findLocationTagMapByCriteria(1l, 1l); + verify(locationTagRepository).getLocationTagMapByExample(1l, 1l); + assertEquals(1, actutalLocationTag.size()); + assertEquals(1, actutalLocationTag.get(0).getLocationId().longValue()); + assertEquals(1, actutalLocationTag.get(0).getLocationTagId().longValue()); + + } + + @Test + public void testDeleteShouldCallRepostoryDeleteLocationTagMapByLocationIdAndLocationTagId() { + locationTagService.deleteLocationTagMapByLocationIdAndLocationTagId(1l, 1l); + verify(locationTagRepository).deleteLocationTagMapByLocationIdAndLocationTagId(1l, 1l); + } } diff --git a/src/test/java/org/opensrp/service/ManifestServiceTest.java b/src/test/java/org/opensrp/service/ManifestServiceTest.java index e38d943ce..9e17d2db9 100644 --- a/src/test/java/org/opensrp/service/ManifestServiceTest.java +++ b/src/test/java/org/opensrp/service/ManifestServiceTest.java @@ -26,21 +26,14 @@ @RunWith(PowerMockRunner.class) @PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*", "org.slf4j.*", - "org.apache.logging.log4j.*"}) + "org.apache.logging.log4j.*"}) public class ManifestServiceTest { private ManifestService manifestService; private ManifestRepository manifestRepository; - @Before - public void setUp() { - manifestRepository = mock(ManifestRepository.class); - manifestService = new ManifestService(); - manifestService.setManifestRepository(manifestRepository); - } - - private static Manifest initTestManifest(){ + private static Manifest initTestManifest() { Manifest manifest = new Manifest(); String identifier = "mani1234"; String appVersion = "1234234"; @@ -54,7 +47,14 @@ private static Manifest initTestManifest(){ return manifest; } - @Test + @Before + public void setUp() { + manifestRepository = mock(ManifestRepository.class); + manifestService = new ManifestService(); + manifestService.setManifestRepository(manifestRepository); + } + + @Test public void testGetManifest() { List expectedManifest = new ArrayList<>(); expectedManifest.add(initTestManifest()); @@ -93,38 +93,38 @@ public void testGetManifestByIdentifier() { public void testAddOrUpdateManifest() { when(manifestRepository.get(anyString())).thenReturn(null); Manifest manifest = initTestManifest(); - assertNotNull(manifest); + assertNotNull(manifest); manifestService.addOrUpdateManifest(manifest); - verify(manifestRepository).add(eq(manifest)); + verify(manifestRepository).add(eq(manifest)); } @Test public void testAddManifest() { - when(manifestRepository.get(anyString())).thenReturn(null); - Manifest manifest = initTestManifest(); - assertNotNull(manifest); - manifestService.addManifest(manifest); - verify(manifestRepository).add(eq(manifest)); + when(manifestRepository.get(anyString())).thenReturn(null); + Manifest manifest = initTestManifest(); + assertNotNull(manifest); + manifestService.addManifest(manifest); + verify(manifestRepository).add(eq(manifest)); } @Test public void testUpdateManifest() { - when(manifestRepository.get(anyString())).thenReturn(null); - Manifest manifest = initTestManifest(); - assertNotNull(manifest); - manifestService.updateManifest(manifest); - verify(manifestRepository).update(eq(manifest)); + when(manifestRepository.get(anyString())).thenReturn(null); + Manifest manifest = initTestManifest(); + assertNotNull(manifest); + manifestService.updateManifest(manifest); + verify(manifestRepository).update(eq(manifest)); } @Test public void testSaveManifest() { - when(manifestRepository.get(anyString())).thenReturn(null); - List manifestList = new ArrayList<>(); - Manifest manifest = initTestManifest(); - assertNotNull(manifest); - manifestList.add(manifest); - manifestService.saveManifests(manifestList); - verify(manifestRepository).add(eq(manifest)); + when(manifestRepository.get(anyString())).thenReturn(null); + List manifestList = new ArrayList<>(); + Manifest manifest = initTestManifest(); + assertNotNull(manifest); + manifestList.add(manifest); + manifestService.saveManifests(manifestList); + verify(manifestRepository).add(eq(manifest)); } @Test diff --git a/src/test/java/org/opensrp/service/MultiMediaServiceTest.java b/src/test/java/org/opensrp/service/MultiMediaServiceTest.java index b005e4966..cb06fa4c6 100644 --- a/src/test/java/org/opensrp/service/MultiMediaServiceTest.java +++ b/src/test/java/org/opensrp/service/MultiMediaServiceTest.java @@ -28,94 +28,94 @@ import org.springframework.beans.factory.annotation.Value; public class MultiMediaServiceTest extends BaseRepositoryTest { - - private MultimediaService multimediaService; - - private ClientService clientService; - - @Autowired - @Qualifier("multimediaRepositoryPostgres") - private MultimediaRepository multimediaRepository; - - @Autowired - @Qualifier("clientsRepositoryPostgres") - private ClientsRepository clientsRepository; - - @Value("#{opensrp['multimedia.directory.name']}") - private String baseMultimediaDirPath; - - @Autowired - @Qualifier("FileSystemMultimediaFileManager") - private BaseMultimediaFileManager fileManager; - - @Before - public void setUp() { - clientService = new ClientService(clientsRepository); - multimediaService = new MultimediaService(multimediaRepository, clientService); - Whitebox.setInternalState(fileManager, "baseMultimediaDirPath", baseMultimediaDirPath); - Whitebox.setInternalState(fileManager, "clientService", clientService); - } - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("multimedia.sql"); - scripts.add("client.sql"); - return scripts; - } - - @Test - public void testUploadFile() throws IOException { - String content = "876nsfsdfs-sdfsfsdf"; - String baseEntityId = "67007c17-97bb-4732-a1b8-3a0c292b5432"; - byte[] contentBytes = content.getBytes(); - //MultipartFile multimediaFile = new MockMultipartFile("mockFile", "test.jpg", "image/jpeg", content.getBytes()); - MultimediaDTO multimediaDTO = new MultimediaDTO(baseEntityId, "biddemo", "image/jpeg", "", - "profilepic"); - - assertTrue(fileManager.uploadFile(multimediaDTO, contentBytes, "test.jpg")); - - //assertEquals(multimediaFile, multimediaService.findByCaseId("469597f0-eefe-4171-afef-f7234cbb2859")); - - File file = new File(baseMultimediaDirPath + File.separator + IMAGES_DIR + File.separator - + baseEntityId + ".jpg"); - System.out.println(file.getAbsolutePath()); - assertTrue(file.exists()); - assertTrue(file.canRead()); - - assertEquals(content, new String(Files.readAllBytes(Paths.get(file.getAbsolutePath())))); - } - - @Test - public void testSaveMultimediaFile() throws IOException { - assertEquals(5, multimediaRepository.getAll().size()); - String baseEntityId = "040d4f18-8140-479c-aa21-725612073490"; - String content = "876nsfsdfs-sdfsfsdf"; - - byte[] contentBytes = content.getBytes(); - //MultipartFile multimediaFile = new MockMultipartFile("mockFile", "test1.jpg", "image/jpeg", content.getBytes()); - MultimediaDTO multimediaDTO = new MultimediaDTO(baseEntityId, "biddemo2", "image/jpeg", "", - "profilepic"); - - assertEquals("success", fileManager.saveMultimediaFile(multimediaDTO, contentBytes, "test1.jpg")); - - File file = new File(baseMultimediaDirPath + File.separator + IMAGES_DIR + File.separator - + baseEntityId + ".jpg"); - System.out.println(file.getAbsolutePath()); - assertTrue(file.exists()); - assertTrue(file.canRead()); - - assertEquals(content, new String(Files.readAllBytes(Paths.get(file.getAbsolutePath())))); - Client client = clientService.find(baseEntityId); - Multimedia savedMultimedia = multimediaService.findByCaseId(baseEntityId); - assertEquals(multimediaDTO.getFilePath(), savedMultimedia.getFilePath()); - assertEquals(file.getAbsolutePath(), savedMultimedia.getFilePath()); - assertEquals(multimediaDTO.getContentType(), savedMultimedia.getContentType()); - assertEquals(multimediaDTO.getFileCategory(), savedMultimedia.getFileCategory()); - - assertEquals(4, multimediaService.getMultimediaFiles("biddemo").size()); - assertEquals(6, multimediaRepository.getAll().size()); - assertEquals(baseEntityId + ".jpg", client.getAttribute("Patient Image")); - assertEquals(0, Minutes.minutesBetween(client.getDateEdited(), DateTime.now()).getMinutes()); - } + + private MultimediaService multimediaService; + + private ClientService clientService; + + @Autowired + @Qualifier("multimediaRepositoryPostgres") + private MultimediaRepository multimediaRepository; + + @Autowired + @Qualifier("clientsRepositoryPostgres") + private ClientsRepository clientsRepository; + + @Value("#{opensrp['multimedia.directory.name']}") + private String baseMultimediaDirPath; + + @Autowired + @Qualifier("FileSystemMultimediaFileManager") + private BaseMultimediaFileManager fileManager; + + @Before + public void setUp() { + clientService = new ClientService(clientsRepository); + multimediaService = new MultimediaService(multimediaRepository, clientService); + Whitebox.setInternalState(fileManager, "baseMultimediaDirPath", baseMultimediaDirPath); + Whitebox.setInternalState(fileManager, "clientService", clientService); + } + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("multimedia.sql"); + scripts.add("client.sql"); + return scripts; + } + + @Test + public void testUploadFile() throws IOException { + String content = "876nsfsdfs-sdfsfsdf"; + String baseEntityId = "67007c17-97bb-4732-a1b8-3a0c292b5432"; + byte[] contentBytes = content.getBytes(); + //MultipartFile multimediaFile = new MockMultipartFile("mockFile", "test.jpg", "image/jpeg", content.getBytes()); + MultimediaDTO multimediaDTO = new MultimediaDTO(baseEntityId, "biddemo", "image/jpeg", "", + "profilepic"); + + assertTrue(fileManager.uploadFile(multimediaDTO, contentBytes, "test.jpg")); + + //assertEquals(multimediaFile, multimediaService.findByCaseId("469597f0-eefe-4171-afef-f7234cbb2859")); + + File file = new File(baseMultimediaDirPath + File.separator + IMAGES_DIR + File.separator + + baseEntityId + ".jpg"); + System.out.println(file.getAbsolutePath()); + assertTrue(file.exists()); + assertTrue(file.canRead()); + + assertEquals(content, new String(Files.readAllBytes(Paths.get(file.getAbsolutePath())))); + } + + @Test + public void testSaveMultimediaFile() throws IOException { + assertEquals(5, multimediaRepository.getAll().size()); + String baseEntityId = "040d4f18-8140-479c-aa21-725612073490"; + String content = "876nsfsdfs-sdfsfsdf"; + + byte[] contentBytes = content.getBytes(); + //MultipartFile multimediaFile = new MockMultipartFile("mockFile", "test1.jpg", "image/jpeg", content.getBytes()); + MultimediaDTO multimediaDTO = new MultimediaDTO(baseEntityId, "biddemo2", "image/jpeg", "", + "profilepic"); + + assertEquals("success", fileManager.saveMultimediaFile(multimediaDTO, contentBytes, "test1.jpg")); + + File file = new File(baseMultimediaDirPath + File.separator + IMAGES_DIR + File.separator + + baseEntityId + ".jpg"); + System.out.println(file.getAbsolutePath()); + assertTrue(file.exists()); + assertTrue(file.canRead()); + + assertEquals(content, new String(Files.readAllBytes(Paths.get(file.getAbsolutePath())))); + Client client = clientService.find(baseEntityId); + Multimedia savedMultimedia = multimediaService.findByCaseId(baseEntityId); + assertEquals(multimediaDTO.getFilePath(), savedMultimedia.getFilePath()); + assertEquals(file.getAbsolutePath(), savedMultimedia.getFilePath()); + assertEquals(multimediaDTO.getContentType(), savedMultimedia.getContentType()); + assertEquals(multimediaDTO.getFileCategory(), savedMultimedia.getFileCategory()); + + assertEquals(4, multimediaService.getMultimediaFiles("biddemo").size()); + assertEquals(6, multimediaRepository.getAll().size()); + assertEquals(baseEntityId + ".jpg", client.getAttribute("Patient Image")); + assertEquals(0, Minutes.minutesBetween(client.getDateEdited(), DateTime.now()).getMinutes()); + } } diff --git a/src/test/java/org/opensrp/service/OpenmrsIDServiceTest.java b/src/test/java/org/opensrp/service/OpenmrsIDServiceTest.java index 65ea13569..1ae7c7720 100644 --- a/src/test/java/org/opensrp/service/OpenmrsIDServiceTest.java +++ b/src/test/java/org/opensrp/service/OpenmrsIDServiceTest.java @@ -22,6 +22,7 @@ import java.util.Map; import java.util.Set; + import org.joda.time.DateTime; import org.junit.Test; import org.smartregister.domain.Address; @@ -33,208 +34,208 @@ public class OpenmrsIDServiceTest extends BaseRepositoryTest { - @Autowired - private OpenmrsIDService openmrsIDService; - - @Autowired - private UniqueIdRepository uniqueIdRepository; - - private Set scripts = new HashSet(); - - @Override - protected Set getDatabaseScripts() { - scripts.add("unique_ids.sql"); - return scripts; - } - - public Client createClient(String baseEntityId, String firstName, String lastName, String gender, - String childRegisterCardNumber) { - DateTime dateOfBirth = new DateTime(); - Map addressFields = new HashMap<>(); - addressFields.put("address4", "birthFacilityName"); - addressFields.put("address3", "resolvedResidentialAddress"); - addressFields.put("address2", "residentialAddress"); - addressFields.put("address1", "physicalLandmark"); - - Address address = new Address("usual_residence", new DateTime(), new DateTime(), addressFields, null, null, null, - "homeFacility", null); - ArrayList
addressList = new ArrayList
(); - addressList.add(address); - - Client client = new Client(baseEntityId, firstName, "", lastName, dateOfBirth, null, false, false, gender, - addressList, null, null); - client.addAttribute(CHILD_REGISTER_CARD_NUMBER, childRegisterCardNumber); - return client; - } - - @Test - public void testAssignOpenmrsIdToClient() throws SQLException { - Client client = this.createClient("12345", "First", "Last", "Male", "454/16"); - - openmrsIDService.assignOpenmrsIdToClient("12345-1", client); - assertNotNull(client.getIdentifier(OpenmrsIDService.ZEIR_IDENTIFIER)); - } - - @Test - public void testExistingClientsDoNotReceiveNewOpenmrsId() throws Exception { - Client client = this.createClient("45678", "Jane", "Doe", "Female", "102/17"); - Client duplicateClient = this.createClient("45677", "Jane", "Doe", "Female", "102/17"); - - openmrsIDService.assignOpenmrsIdToClient("12345-1", client); - assertNotNull(client.getIdentifier(OpenmrsIDService.ZEIR_IDENTIFIER)); - - openmrsIDService.assignOpenmrsIdToClient("12345-1", duplicateClient); - assertTrue(openmrsIDService.checkIfClientExists(duplicateClient)); - assertNull(duplicateClient.getIdentifier(OpenmrsIDService.ZEIR_IDENTIFIER)); - } - - @Test - public void testCheckClient() throws SQLException { - Client client = this.createClient("45678", "Jane", "Doe", "Female", "102/17"); - openmrsIDService.assignOpenmrsIdToClient("12345-1", client); - assertTrue(openmrsIDService.checkIfClientExists(client)); - } - - @Test - public void testCheckClientWithFalseData() throws SQLException { - Client client = this.createClient("45678", "Jane", "Doe", "Female", "102/17"); - assertFalse(openmrsIDService.checkIfClientExists(client)); - } - - @Test - public void testCheckClientWithInvalidData() throws SQLException { - Client client = this.createClient("*", "Jane", "Doe", "Female", "*"); - assertNull(openmrsIDService.checkIfClientExists(null)); - } - - @Test - public void testDownloadAndSaveIds() { - List downloadedIds = new ArrayList<>(); - downloadedIds.add("1"); - downloadedIds.add("2"); - OpenmrsIDService openmrsIDServiceSpy = spy(openmrsIDService); - doReturn(downloadedIds).when(openmrsIDServiceSpy).downloadOpenmrsIds(anyLong()); - - openmrsIDServiceSpy.downloadAndSaveIds(2, "test"); - - List uniqueIds = uniqueIdRepository.getNotUsedIds(2); - List actualList = new ArrayList<>(); - for (UniqueId uniqueId : uniqueIds) { - assertEquals("test", uniqueId.getUsedBy()); - actualList.add(uniqueId.getOpenmrsId()); - } - - assertEquals(2, (long) uniqueIdRepository.totalUnUsedIds()); - assertEquals(downloadedIds, actualList); - } - - @Test - public void testClearRecord() throws SQLException { - Client client = this.createClient("12345", "First", "Last", "Male", "454/16"); - openmrsIDService.assignOpenmrsIdToClient("12345-1", client); - - assertTrue(openmrsIDService.checkIfClientExists(client)); - - openmrsIDService.clearRecords(); - - assertFalse(openmrsIDService.checkIfClientExists(client)); - } - - @Test - public void testGetNotUsedId() throws Exception { - int size = 10; - List expectedList = createNotUsedUniqIdEntries(size); - List actualList = openmrsIDService.getNotUsedIds(100); - assertEquals(size, actualList.size()); - - for (int i = 0; i < size; i++) { - UniqueId expected = expectedList.get(i); - UniqueId actual = actualList.get(i); - assertUniqueId(expected, actual); - } - - } - - @Test - public void testGetNotUsedIdAsString() throws Exception { - int size = 10; - List ids = createNotUsedUniqIdEntries(size); - List expectedList = new ArrayList<>(); - List actualList = openmrsIDService.getNotUsedIdsAsString(100); - for (int i = 0; i < size; i++) { - expectedList.add(ids.get(i).getOpenmrsId()); - } - - assertEquals(size, actualList.size()); - assertEquals(expectedList, actualList); - } - - @Test - public void testMarkIdAsUsed() throws Exception { - int size = 10; - List ids = createNotUsedUniqIdEntries(size); - List idListAsString = new ArrayList<>(); - - for (int i = 0; i < size; i++) { - idListAsString.add(ids.get(i).getOpenmrsId()); - } - - Long[] actualIds = openmrsIDService.markIdsAsUsed(idListAsString); - List actualList = openmrsIDService.getNotUsedIdsAsString(100); - - assertEquals(size, actualIds.length); - assertEquals(0, actualList.size()); - - } - - private List createNotUsedUniqIdEntries(int size) throws Exception { - List notUsedUniqueIds = new ArrayList<>(); - long id = 6; - for (int i = 0; i < size; i++) { - UniqueId uniqueId = new UniqueId(); - uniqueId.setId(Long.valueOf(id)); - uniqueId.setOpenmrsId(String.valueOf(i)); - uniqueId.setStatus(UniqueId.STATUS_NOT_USED); - uniqueId.setUsedBy("test" + i); - uniqueId.setCreatedAt(new Date()); - uniqueId.setLocation("test"); - notUsedUniqueIds.add(uniqueId); - uniqueIdRepository.add(uniqueId); - id++; - } - return notUsedUniqueIds; - } - - private void assertUniqueId(UniqueId expected, UniqueId actual) { - SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-mm-hh hh:MM"); - assertEquals(dateFormat.format(expected.getCreatedAt()), dateFormat.format(actual.getCreatedAt())); - assertEquals(expected.getLocation(), actual.getLocation()); - assertEquals(expected.getId(), actual.getId()); - assertEquals(expected.getOpenmrsId(), actual.getOpenmrsId()); - assertEquals(expected.getStatus(), actual.getStatus()); - assertEquals(expected.getUsedBy(), actual.getUsedBy()); - } - - @Test - public void testGetOpenMRSIdentifiersShouldReturnOpenmrsIds() throws IOException { - String source = "1"; - String numberToGenerate = "2"; - OpenmrsIDService spyOpenmrsIDService = spy(openmrsIDService); - String openmrsUrl = "http://localhost:8080/openmrs/module/idgen/exportIdentifiers.form?source="+source+"&numberToGenerate="+numberToGenerate+"&username=admin&password=Admin123"; - doReturn("{\"identifiers\":[\"100399-5\",\"100400-1\"]}").when(spyOpenmrsIDService).getHttpResponse(eq(openmrsUrl)); - List identifies = spyOpenmrsIDService.getOpenMRSIdentifiers(source, numberToGenerate); - assertFalse(identifies.isEmpty()); - assertEquals(2, identifies.size()); - } - - @Test - public void testDownloadOpenmrsIdsShouldReturnOpenmrsIds() throws IOException { - long numberToGenerate = 2L; - OpenmrsIDService spyOpenmrsIDService = spy(OpenmrsIDService.createInstanceWithOpenMrsUrl("http://localhost:8080/openmrs/")); - String openmrsUrl = "http://localhost:8080/openmrs/module/idgen/exportIdentifiers.form?source=0&numberToGenerate=" + numberToGenerate + "&username=null&password=null"; - doReturn("{\"identifiers\":[\"100399-5\",\"100400-1\"]}").when(spyOpenmrsIDService).getHttpResponse(eq(openmrsUrl)); - List identifies = spyOpenmrsIDService.downloadOpenmrsIds(numberToGenerate); - assertFalse(identifies.isEmpty()); - assertEquals(2, identifies.size()); - } + @Autowired + private OpenmrsIDService openmrsIDService; + + @Autowired + private UniqueIdRepository uniqueIdRepository; + + private Set scripts = new HashSet(); + + @Override + protected Set getDatabaseScripts() { + scripts.add("unique_ids.sql"); + return scripts; + } + + public Client createClient(String baseEntityId, String firstName, String lastName, String gender, + String childRegisterCardNumber) { + DateTime dateOfBirth = new DateTime(); + Map addressFields = new HashMap<>(); + addressFields.put("address4", "birthFacilityName"); + addressFields.put("address3", "resolvedResidentialAddress"); + addressFields.put("address2", "residentialAddress"); + addressFields.put("address1", "physicalLandmark"); + + Address address = new Address("usual_residence", new DateTime(), new DateTime(), addressFields, null, null, null, + "homeFacility", null); + ArrayList
addressList = new ArrayList
(); + addressList.add(address); + + Client client = new Client(baseEntityId, firstName, "", lastName, dateOfBirth, null, false, false, gender, + addressList, null, null); + client.addAttribute(CHILD_REGISTER_CARD_NUMBER, childRegisterCardNumber); + return client; + } + + @Test + public void testAssignOpenmrsIdToClient() throws SQLException { + Client client = this.createClient("12345", "First", "Last", "Male", "454/16"); + + openmrsIDService.assignOpenmrsIdToClient("12345-1", client); + assertNotNull(client.getIdentifier(OpenmrsIDService.ZEIR_IDENTIFIER)); + } + + @Test + public void testExistingClientsDoNotReceiveNewOpenmrsId() throws Exception { + Client client = this.createClient("45678", "Jane", "Doe", "Female", "102/17"); + Client duplicateClient = this.createClient("45677", "Jane", "Doe", "Female", "102/17"); + + openmrsIDService.assignOpenmrsIdToClient("12345-1", client); + assertNotNull(client.getIdentifier(OpenmrsIDService.ZEIR_IDENTIFIER)); + + openmrsIDService.assignOpenmrsIdToClient("12345-1", duplicateClient); + assertTrue(openmrsIDService.checkIfClientExists(duplicateClient)); + assertNull(duplicateClient.getIdentifier(OpenmrsIDService.ZEIR_IDENTIFIER)); + } + + @Test + public void testCheckClient() throws SQLException { + Client client = this.createClient("45678", "Jane", "Doe", "Female", "102/17"); + openmrsIDService.assignOpenmrsIdToClient("12345-1", client); + assertTrue(openmrsIDService.checkIfClientExists(client)); + } + + @Test + public void testCheckClientWithFalseData() throws SQLException { + Client client = this.createClient("45678", "Jane", "Doe", "Female", "102/17"); + assertFalse(openmrsIDService.checkIfClientExists(client)); + } + + @Test + public void testCheckClientWithInvalidData() throws SQLException { + Client client = this.createClient("*", "Jane", "Doe", "Female", "*"); + assertNull(openmrsIDService.checkIfClientExists(null)); + } + + @Test + public void testDownloadAndSaveIds() { + List downloadedIds = new ArrayList<>(); + downloadedIds.add("1"); + downloadedIds.add("2"); + OpenmrsIDService openmrsIDServiceSpy = spy(openmrsIDService); + doReturn(downloadedIds).when(openmrsIDServiceSpy).downloadOpenmrsIds(anyLong()); + + openmrsIDServiceSpy.downloadAndSaveIds(2, "test"); + + List uniqueIds = uniqueIdRepository.getNotUsedIds(2); + List actualList = new ArrayList<>(); + for (UniqueId uniqueId : uniqueIds) { + assertEquals("test", uniqueId.getUsedBy()); + actualList.add(uniqueId.getOpenmrsId()); + } + + assertEquals(2, (long) uniqueIdRepository.totalUnUsedIds()); + assertEquals(downloadedIds, actualList); + } + + @Test + public void testClearRecord() throws SQLException { + Client client = this.createClient("12345", "First", "Last", "Male", "454/16"); + openmrsIDService.assignOpenmrsIdToClient("12345-1", client); + + assertTrue(openmrsIDService.checkIfClientExists(client)); + + openmrsIDService.clearRecords(); + + assertFalse(openmrsIDService.checkIfClientExists(client)); + } + + @Test + public void testGetNotUsedId() throws Exception { + int size = 10; + List expectedList = createNotUsedUniqIdEntries(size); + List actualList = openmrsIDService.getNotUsedIds(100); + assertEquals(size, actualList.size()); + + for (int i = 0; i < size; i++) { + UniqueId expected = expectedList.get(i); + UniqueId actual = actualList.get(i); + assertUniqueId(expected, actual); + } + + } + + @Test + public void testGetNotUsedIdAsString() throws Exception { + int size = 10; + List ids = createNotUsedUniqIdEntries(size); + List expectedList = new ArrayList<>(); + List actualList = openmrsIDService.getNotUsedIdsAsString(100); + for (int i = 0; i < size; i++) { + expectedList.add(ids.get(i).getOpenmrsId()); + } + + assertEquals(size, actualList.size()); + assertEquals(expectedList, actualList); + } + + @Test + public void testMarkIdAsUsed() throws Exception { + int size = 10; + List ids = createNotUsedUniqIdEntries(size); + List idListAsString = new ArrayList<>(); + + for (int i = 0; i < size; i++) { + idListAsString.add(ids.get(i).getOpenmrsId()); + } + + Long[] actualIds = openmrsIDService.markIdsAsUsed(idListAsString); + List actualList = openmrsIDService.getNotUsedIdsAsString(100); + + assertEquals(size, actualIds.length); + assertEquals(0, actualList.size()); + + } + + private List createNotUsedUniqIdEntries(int size) throws Exception { + List notUsedUniqueIds = new ArrayList<>(); + long id = 6; + for (int i = 0; i < size; i++) { + UniqueId uniqueId = new UniqueId(); + uniqueId.setId(Long.valueOf(id)); + uniqueId.setOpenmrsId(String.valueOf(i)); + uniqueId.setStatus(UniqueId.STATUS_NOT_USED); + uniqueId.setUsedBy("test" + i); + uniqueId.setCreatedAt(new Date()); + uniqueId.setLocation("test"); + notUsedUniqueIds.add(uniqueId); + uniqueIdRepository.add(uniqueId); + id++; + } + return notUsedUniqueIds; + } + + private void assertUniqueId(UniqueId expected, UniqueId actual) { + SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-mm-hh hh:MM"); + assertEquals(dateFormat.format(expected.getCreatedAt()), dateFormat.format(actual.getCreatedAt())); + assertEquals(expected.getLocation(), actual.getLocation()); + assertEquals(expected.getId(), actual.getId()); + assertEquals(expected.getOpenmrsId(), actual.getOpenmrsId()); + assertEquals(expected.getStatus(), actual.getStatus()); + assertEquals(expected.getUsedBy(), actual.getUsedBy()); + } + + @Test + public void testGetOpenMRSIdentifiersShouldReturnOpenmrsIds() throws IOException { + String source = "1"; + String numberToGenerate = "2"; + OpenmrsIDService spyOpenmrsIDService = spy(openmrsIDService); + String openmrsUrl = "http://localhost:8080/openmrs/module/idgen/exportIdentifiers.form?source=" + source + "&numberToGenerate=" + numberToGenerate + "&username=admin&password=Admin123"; + doReturn("{\"identifiers\":[\"100399-5\",\"100400-1\"]}").when(spyOpenmrsIDService).getHttpResponse(eq(openmrsUrl)); + List identifies = spyOpenmrsIDService.getOpenMRSIdentifiers(source, numberToGenerate); + assertFalse(identifies.isEmpty()); + assertEquals(2, identifies.size()); + } + + @Test + public void testDownloadOpenmrsIdsShouldReturnOpenmrsIds() throws IOException { + long numberToGenerate = 2L; + OpenmrsIDService spyOpenmrsIDService = spy(OpenmrsIDService.createInstanceWithOpenMrsUrl("http://localhost:8080/openmrs/")); + String openmrsUrl = "http://localhost:8080/openmrs/module/idgen/exportIdentifiers.form?source=0&numberToGenerate=" + numberToGenerate + "&username=null&password=null"; + doReturn("{\"identifiers\":[\"100399-5\",\"100400-1\"]}").when(spyOpenmrsIDService).getHttpResponse(eq(openmrsUrl)); + List identifies = spyOpenmrsIDService.downloadOpenmrsIds(numberToGenerate); + assertFalse(identifies.isEmpty()); + assertEquals(2, identifies.size()); + } } diff --git a/src/test/java/org/opensrp/service/OpenmrsIDServiceUsingMockTest.java b/src/test/java/org/opensrp/service/OpenmrsIDServiceUsingMockTest.java index d52c48a75..56426e984 100644 --- a/src/test/java/org/opensrp/service/OpenmrsIDServiceUsingMockTest.java +++ b/src/test/java/org/opensrp/service/OpenmrsIDServiceUsingMockTest.java @@ -23,35 +23,35 @@ @RunWith(PowerMockRunner.class) @PrepareForTest(EntityUtils.class) -@PowerMockIgnore({ "org.apache.http.ssl.*", "javax.net.ssl.*", "org.apache.http.conn.ssl.*" }) +@PowerMockIgnore({"org.apache.http.ssl.*", "javax.net.ssl.*", "org.apache.http.conn.ssl.*"}) public class OpenmrsIDServiceUsingMockTest { - - OpenmrsIDService openmrsIDService; - - @Before - public void setUp() { - PowerMockito.mockStatic(EntityUtils.class); - - } - - @Ignore - @Test - public void testDownloadsOpenmrsIds() throws IOException { - openmrsIDService = OpenmrsIDService.createInstanceWithOpenMrsUrl("http://localhost/"); - String jsonResponse = "{\"identifiers\":[\"1\",\"2\"]}"; - BDDMockito.when(EntityUtils.toString(any(HttpEntity.class))).thenReturn(jsonResponse); - List ids = openmrsIDService.downloadOpenmrsIds(2); - assertEquals(2, ids.size()); - assertTrue(ids.contains("1")); - assertTrue(ids.contains("2")); - assertFalse(ids.contains("3")); - } - - @Ignore - @Test - public void testDownloadOpenmrsIdsWithInvalidUrl() { - openmrsIDService = OpenmrsIDService.createInstanceWithOpenMrsUrl(""); - List ids = openmrsIDService.downloadOpenmrsIds(2); - assertNull(ids); - } + + OpenmrsIDService openmrsIDService; + + @Before + public void setUp() { + PowerMockito.mockStatic(EntityUtils.class); + + } + + @Ignore + @Test + public void testDownloadsOpenmrsIds() throws IOException { + openmrsIDService = OpenmrsIDService.createInstanceWithOpenMrsUrl("http://localhost/"); + String jsonResponse = "{\"identifiers\":[\"1\",\"2\"]}"; + BDDMockito.when(EntityUtils.toString(any(HttpEntity.class))).thenReturn(jsonResponse); + List ids = openmrsIDService.downloadOpenmrsIds(2); + assertEquals(2, ids.size()); + assertTrue(ids.contains("1")); + assertTrue(ids.contains("2")); + assertFalse(ids.contains("3")); + } + + @Ignore + @Test + public void testDownloadOpenmrsIdsWithInvalidUrl() { + openmrsIDService = OpenmrsIDService.createInstanceWithOpenMrsUrl(""); + List ids = openmrsIDService.downloadOpenmrsIds(2); + assertNull(ids); + } } diff --git a/src/test/java/org/opensrp/service/OrganizationServiceTest.java b/src/test/java/org/opensrp/service/OrganizationServiceTest.java index af802d6d4..043bdc44a 100644 --- a/src/test/java/org/opensrp/service/OrganizationServiceTest.java +++ b/src/test/java/org/opensrp/service/OrganizationServiceTest.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.service; @@ -45,317 +45,317 @@ @RunWith(PowerMockRunner.class) public class OrganizationServiceTest { - private OrganizationService organizationService; - - @Mock - private OrganizationRepository organizationRepository; - - @Mock - private PlanRepository planRepository; - - @Mock - private LocationRepository locationRepository; - - @Mock - private PractitionerService practitionerService; - - private Organization organization; - - private String identifier = UUID.randomUUID().toString(); - - private ArgumentCaptor dateCaptor = ArgumentCaptor.forClass(Date.class); - - @Before - public void setUp() { - organizationService = new OrganizationService(organizationRepository, locationRepository, planRepository); - organization = new Organization(); - organization.setIdentifier(identifier); - organizationService.setPractitionerService(practitionerService); - HashOperations> hashOps = mock(HashOperations.class); - Whitebox.setInternalState(organizationService,"hashOps",hashOps); - - } - - @Test - public void testGetAllOrganizations() { - List expected = Collections.singletonList(organization); - OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); - when(organizationRepository.getAllOrganizations(any(OrganizationSearchBean.class))).thenReturn(expected); - List organizations = organizationService.getAllOrganizations(organizationSearchBean); - verify(organizationRepository).getAllOrganizations(organizationSearchBean); - assertEquals(expected, organizations); - } - - @Test - public void testSelectOrganizationsEncompassLocations(){ - String locationID = "12345_location"; - organizationService.selectOrganizationsEncompassLocations(locationID); - verify(organizationRepository).selectOrganizationsEncompassLocations(Mockito.eq(locationID), Mockito.any(Date.class)); - } - - @Test - public void testGetOrganization() { - when(organizationRepository.get(identifier)).thenReturn(organization); - Organization actual = organizationService.getOrganization(identifier); - verify(organizationRepository).get(identifier); - assertEquals(organization, actual); - } - - @Test - public void testGetOrganizationById() { - when(organizationRepository.getByPrimaryKey(1l)).thenReturn(organization); - Organization actual = organizationService.getOrganization(1l); - verify(organizationRepository).getByPrimaryKey(1l); - assertEquals(organization, actual); - } - - @Test - public void testAddOrUpdateOrganizationShouldAdd() { - organizationService.addOrUpdateOrganization(organization); - verify(organizationRepository).add(organization); - } - - @Test - public void testAddOrUpdateOrganizationShouldUpdate() { - when(organizationRepository.get(identifier)).thenReturn(organization); - organizationService.addOrUpdateOrganization(organization); - verify(organizationRepository).update(organization); - } - - @Test - public void testAddOrganization() { - organizationService.addOrganization(organization); - verify(organizationRepository).add(organization); - } - - @Test - public void testUpdateOrganization() { - organizationService.updateOrganization(organization); - verify(organizationRepository).update(organization); - } - - @Test(expected = IllegalArgumentException.class) - public void testUpdateOrganizationWithoutIdnetifier() { - organizationService.updateOrganization(new Organization()); - verify(organizationRepository, never()).update(organization); - } - - @Test(expected = IllegalArgumentException.class) - public void testAssignLocationAndPlanWithoutOrgId() { - organizationService.assignLocationAndPlan(null, "jurisdictionId", "planId", null, null); - verify(organizationRepository, never()).assignLocationAndPlan(anyLong(), anyString(), anyLong(), anyString(), - anyLong(), any(Date.class), any(Date.class)); - } - - @Test(expected = IllegalArgumentException.class) - public void testAssignLocationAndPlanWithoutJurisdictionAndPlan() { - organizationService.assignLocationAndPlan(identifier, null, null, null, null); - verify(organizationRepository, never()).assignLocationAndPlan(anyLong(), anyString(), anyLong(), anyString(), - anyLong(), any(Date.class), any(Date.class)); - } - - @Test - public void testAssignLocationAndPlan() { - when(organizationRepository.get(identifier)).thenReturn(organization); - organization.setId(1233l); - String planIdentifier = UUID.randomUUID().toString(); - String jurisdictionIdentifier = UUID.randomUUID().toString(); - Long planId = 54311l; - Long locationId = 123l; - PhysicalLocation location = new PhysicalLocation(); - location.setId(jurisdictionIdentifier); - - List practitioners = new ArrayList<>(); - practitioners.add(initTestPractitioner()); - when(locationRepository.retrievePrimaryKey(jurisdictionIdentifier, true)).thenReturn(locationId); - when(planRepository.retrievePrimaryKey(planIdentifier)).thenReturn(planId); - organizationService.assignLocationAndPlan(identifier, jurisdictionIdentifier, planIdentifier, null, null); - //when(practitionerService.getPractitionersByOrgIdentifier(anyString())).thenReturn(practitioners); - Date date = new Date(); - verify(organizationRepository).assignLocationAndPlan(eq(1233l), eq(jurisdictionIdentifier), eq(locationId), - eq(planIdentifier), eq(planId), dateCaptor.capture(), dateCaptor.capture()); - - assertEquals(date.toInstant().getEpochSecond(), dateCaptor.getAllValues().get(0).toInstant().getEpochSecond()); - - assertNull(dateCaptor.getAllValues().get(1)); - - Date dateFrom = new Date(); - Date dateTo = new Date(); - organizationService.assignLocationAndPlan(identifier, jurisdictionIdentifier, planIdentifier, dateFrom, dateTo); - verify(organizationRepository).assignLocationAndPlan(eq(1233l), eq(jurisdictionIdentifier), eq(locationId), - eq(planIdentifier), eq(planId), eq(dateFrom), eq(dateTo)); - - } - - @Test - public void testAssignLocationAndPlanWithoutPlan() { - when(organizationRepository.get(identifier)).thenReturn(organization); - organization.setId(1233l); - String planIdentifier = null; - String jurisdictionIdentifier = UUID.randomUUID().toString(); - Long locationId = 123l; - Long planId = null; - PhysicalLocation location = new PhysicalLocation(); - location.setId(jurisdictionIdentifier); - List practitioners = new ArrayList<>(); - practitioners.add(initTestPractitioner()); - when(locationRepository.retrievePrimaryKey(jurisdictionIdentifier, true)).thenReturn(locationId); - when(planRepository.retrievePrimaryKey(planIdentifier)).thenReturn(planId); - //when(practitionerService.getPractitionersByOrgIdentifier(anyString())).thenReturn(practitioners); - Date dateFrom = new Date(); - Date dateTo = null; - organizationService.assignLocationAndPlan(identifier, jurisdictionIdentifier, planIdentifier, dateFrom, dateTo); - verify(organizationRepository).assignLocationAndPlan(eq(1233l), eq(jurisdictionIdentifier), eq(locationId), - eq(planIdentifier), eq(planId), eq(dateFrom), eq(dateTo)); - } - - @Test - public void testAssignLocationAndPlanWithoutJurisdiction() { - when(organizationRepository.get(identifier)).thenReturn(organization); - organization.setId(1233l); - String planIdentifier = UUID.randomUUID().toString(); - String jurisdictionIdentifier = null; - Long locationId = null; - Long planId = 19871l; - PhysicalLocation location = new PhysicalLocation(); - location.setId(jurisdictionIdentifier); - List practitioners = new ArrayList<>(); - practitioners.add(initTestPractitioner()); - when(locationRepository.retrievePrimaryKey(jurisdictionIdentifier, true)).thenReturn(locationId); - when(planRepository.retrievePrimaryKey(planIdentifier)).thenReturn(planId); - //when(practitionerService.getPractitionersByOrgIdentifier(anyString())).thenReturn(practitioners); - Date dateFrom = new Date(); - Date dateTo = null; - organizationService.assignLocationAndPlan(identifier, jurisdictionIdentifier, planIdentifier, dateFrom, dateTo); - verify(organizationRepository).assignLocationAndPlan(eq(1233l), eq(jurisdictionIdentifier), eq(locationId), - eq(planIdentifier), eq(planId), eq(dateFrom), eq(dateTo)); - } - - @Test(expected = IllegalArgumentException.class) - public void testAssignLocationAndPlanWithoutIdentifier() { - String planIdentifier = UUID.randomUUID().toString(); - String jurisdictionIdentifier = null; - organizationService.assignLocationAndPlan(null, jurisdictionIdentifier, planIdentifier, null, null); - verify(organizationRepository, never()).assignLocationAndPlan(anyLong(), eq(jurisdictionIdentifier), anyLong(), - eq(planIdentifier), anyLong(), any(Date.class), any(Date.class)); - } - - @Test(expected = IllegalArgumentException.class) - public void testAssignLocationAndMissingOrganization() { - String planIdentifier = UUID.randomUUID().toString(); - String jurisdictionIdentifier = UUID.randomUUID().toString(); - when(organizationRepository.get(identifier)).thenReturn(null); - organizationService.assignLocationAndPlan(identifier, jurisdictionIdentifier, planIdentifier, null, null); - verify(organizationRepository, never()).assignLocationAndPlan(anyLong(), eq(jurisdictionIdentifier), anyLong(), - eq(planIdentifier), anyLong(), any(Date.class), any(Date.class)); - } - - @Test - public void testFindAssignedLocationsAndPlans() { - organization.setId(12l); - AssignedLocations assigment = new AssignedLocations("loc1", "plan1"); - List expected = Collections.singletonList(assigment); - when(organizationRepository.findAssignedLocations(any(AssignedLocationAndPlanSearchBean.class))).thenReturn(expected); - when(organizationRepository.get(identifier)).thenReturn(organization); - List assigned = organizationService.findAssignedLocationsAndPlans(identifier,false,null,null,null,null); - assertEquals(expected, assigned); - verify(organizationRepository).findAssignedLocations(any(AssignedLocationAndPlanSearchBean.class)); - } - - @Test(expected = IllegalArgumentException.class) - public void testFindAssignedLocationsAndPlansOrganitionMissing() { - organization.setId(12l); - organizationService.findAssignedLocationsAndPlans(identifier,false,null,null,null,null); - verify(organizationRepository, never()).findAssignedLocations(any(AssignedLocationAndPlanSearchBean.class)); - - } - - @Test - public void testFindAssignedLocationsAndPlansWithMultipleIds() { - List organizationIds = Arrays.asList(12l, 34l, 45l); - AssignedLocations assigment = new AssignedLocations("loc1", "plan1"); - List expected = Collections.singletonList(assigment); - when(organizationRepository.findAssignedLocations(organizationIds,false)).thenReturn(expected); - List assigned = organizationService.findAssignedLocationsAndPlans(organizationIds); - assertEquals(expected, assigned); - verify(organizationRepository).findAssignedLocations(organizationIds,false); - } - - @Test - public void testFindAssignedLocationsAndPlansByPlanIdentifier() { - AssignedLocations assigment = new AssignedLocations("loc1", "plan1"); - List expected = Collections.singletonList(assigment); - when(planRepository.retrievePrimaryKey(anyString())).thenReturn(1l); - when(organizationRepository.findAssignedLocations(any(AssignedLocationAndPlanSearchBean.class))).thenReturn(expected); - List assigned = organizationService.findAssignedLocationsAndPlansByPlanIdentifier(identifier,null,null,null,null); - assertEquals(expected, assigned); - verify(organizationRepository).findAssignedLocations(any(AssignedLocationAndPlanSearchBean.class)); - } - - @Test(expected = IllegalArgumentException.class) - public void testFindAssignedLocationsAndPlansByPlanIdentifierWithNullParam() { - organizationService.findAssignedLocationsAndPlansByPlanIdentifier(null,null,null,null,null); - verify(organizationRepository, never()).findAssignedLocations(any(AssignedLocationAndPlanSearchBean.class)); - } - - @Test(expected = IllegalArgumentException.class) - public void testFindAssignedLocationsAndPlansByPlanIdentifierMissingPlan() { - when(planRepository.retrievePrimaryKey(anyString())).thenReturn(null); + private OrganizationService organizationService; + + @Mock + private OrganizationRepository organizationRepository; + + @Mock + private PlanRepository planRepository; + + @Mock + private LocationRepository locationRepository; + + @Mock + private PractitionerService practitionerService; + + private Organization organization; + + private String identifier = UUID.randomUUID().toString(); + + private ArgumentCaptor dateCaptor = ArgumentCaptor.forClass(Date.class); + + @Before + public void setUp() { + organizationService = new OrganizationService(organizationRepository, locationRepository, planRepository); + organization = new Organization(); + organization.setIdentifier(identifier); + organizationService.setPractitionerService(practitionerService); + HashOperations> hashOps = mock(HashOperations.class); + Whitebox.setInternalState(organizationService, "hashOps", hashOps); + + } + + @Test + public void testGetAllOrganizations() { + List expected = Collections.singletonList(organization); + OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); + when(organizationRepository.getAllOrganizations(any(OrganizationSearchBean.class))).thenReturn(expected); + List organizations = organizationService.getAllOrganizations(organizationSearchBean); + verify(organizationRepository).getAllOrganizations(organizationSearchBean); + assertEquals(expected, organizations); + } + + @Test + public void testSelectOrganizationsEncompassLocations() { + String locationID = "12345_location"; + organizationService.selectOrganizationsEncompassLocations(locationID); + verify(organizationRepository).selectOrganizationsEncompassLocations(Mockito.eq(locationID), Mockito.any(Date.class)); + } + + @Test + public void testGetOrganization() { + when(organizationRepository.get(identifier)).thenReturn(organization); + Organization actual = organizationService.getOrganization(identifier); + verify(organizationRepository).get(identifier); + assertEquals(organization, actual); + } + + @Test + public void testGetOrganizationById() { + when(organizationRepository.getByPrimaryKey(1l)).thenReturn(organization); + Organization actual = organizationService.getOrganization(1l); + verify(organizationRepository).getByPrimaryKey(1l); + assertEquals(organization, actual); + } + + @Test + public void testAddOrUpdateOrganizationShouldAdd() { + organizationService.addOrUpdateOrganization(organization); + verify(organizationRepository).add(organization); + } + + @Test + public void testAddOrUpdateOrganizationShouldUpdate() { + when(organizationRepository.get(identifier)).thenReturn(organization); + organizationService.addOrUpdateOrganization(organization); + verify(organizationRepository).update(organization); + } + + @Test + public void testAddOrganization() { + organizationService.addOrganization(organization); + verify(organizationRepository).add(organization); + } + + @Test + public void testUpdateOrganization() { + organizationService.updateOrganization(organization); + verify(organizationRepository).update(organization); + } + + @Test(expected = IllegalArgumentException.class) + public void testUpdateOrganizationWithoutIdnetifier() { + organizationService.updateOrganization(new Organization()); + verify(organizationRepository, never()).update(organization); + } + + @Test(expected = IllegalArgumentException.class) + public void testAssignLocationAndPlanWithoutOrgId() { + organizationService.assignLocationAndPlan(null, "jurisdictionId", "planId", null, null); + verify(organizationRepository, never()).assignLocationAndPlan(anyLong(), anyString(), anyLong(), anyString(), + anyLong(), any(Date.class), any(Date.class)); + } + + @Test(expected = IllegalArgumentException.class) + public void testAssignLocationAndPlanWithoutJurisdictionAndPlan() { + organizationService.assignLocationAndPlan(identifier, null, null, null, null); + verify(organizationRepository, never()).assignLocationAndPlan(anyLong(), anyString(), anyLong(), anyString(), + anyLong(), any(Date.class), any(Date.class)); + } + + @Test + public void testAssignLocationAndPlan() { + when(organizationRepository.get(identifier)).thenReturn(organization); + organization.setId(1233l); + String planIdentifier = UUID.randomUUID().toString(); + String jurisdictionIdentifier = UUID.randomUUID().toString(); + Long planId = 54311l; + Long locationId = 123l; + PhysicalLocation location = new PhysicalLocation(); + location.setId(jurisdictionIdentifier); + + List practitioners = new ArrayList<>(); + practitioners.add(initTestPractitioner()); + when(locationRepository.retrievePrimaryKey(jurisdictionIdentifier, true)).thenReturn(locationId); + when(planRepository.retrievePrimaryKey(planIdentifier)).thenReturn(planId); + organizationService.assignLocationAndPlan(identifier, jurisdictionIdentifier, planIdentifier, null, null); + //when(practitionerService.getPractitionersByOrgIdentifier(anyString())).thenReturn(practitioners); + Date date = new Date(); + verify(organizationRepository).assignLocationAndPlan(eq(1233l), eq(jurisdictionIdentifier), eq(locationId), + eq(planIdentifier), eq(planId), dateCaptor.capture(), dateCaptor.capture()); + + assertEquals(date.toInstant().getEpochSecond(), dateCaptor.getAllValues().get(0).toInstant().getEpochSecond()); + + assertNull(dateCaptor.getAllValues().get(1)); + + Date dateFrom = new Date(); + Date dateTo = new Date(); + organizationService.assignLocationAndPlan(identifier, jurisdictionIdentifier, planIdentifier, dateFrom, dateTo); + verify(organizationRepository).assignLocationAndPlan(eq(1233l), eq(jurisdictionIdentifier), eq(locationId), + eq(planIdentifier), eq(planId), eq(dateFrom), eq(dateTo)); + + } + + @Test + public void testAssignLocationAndPlanWithoutPlan() { + when(organizationRepository.get(identifier)).thenReturn(organization); + organization.setId(1233l); + String planIdentifier = null; + String jurisdictionIdentifier = UUID.randomUUID().toString(); + Long locationId = 123l; + Long planId = null; + PhysicalLocation location = new PhysicalLocation(); + location.setId(jurisdictionIdentifier); + List practitioners = new ArrayList<>(); + practitioners.add(initTestPractitioner()); + when(locationRepository.retrievePrimaryKey(jurisdictionIdentifier, true)).thenReturn(locationId); + when(planRepository.retrievePrimaryKey(planIdentifier)).thenReturn(planId); + //when(practitionerService.getPractitionersByOrgIdentifier(anyString())).thenReturn(practitioners); + Date dateFrom = new Date(); + Date dateTo = null; + organizationService.assignLocationAndPlan(identifier, jurisdictionIdentifier, planIdentifier, dateFrom, dateTo); + verify(organizationRepository).assignLocationAndPlan(eq(1233l), eq(jurisdictionIdentifier), eq(locationId), + eq(planIdentifier), eq(planId), eq(dateFrom), eq(dateTo)); + } + + @Test + public void testAssignLocationAndPlanWithoutJurisdiction() { + when(organizationRepository.get(identifier)).thenReturn(organization); + organization.setId(1233l); + String planIdentifier = UUID.randomUUID().toString(); + String jurisdictionIdentifier = null; + Long locationId = null; + Long planId = 19871l; + PhysicalLocation location = new PhysicalLocation(); + location.setId(jurisdictionIdentifier); + List practitioners = new ArrayList<>(); + practitioners.add(initTestPractitioner()); + when(locationRepository.retrievePrimaryKey(jurisdictionIdentifier, true)).thenReturn(locationId); + when(planRepository.retrievePrimaryKey(planIdentifier)).thenReturn(planId); + //when(practitionerService.getPractitionersByOrgIdentifier(anyString())).thenReturn(practitioners); + Date dateFrom = new Date(); + Date dateTo = null; + organizationService.assignLocationAndPlan(identifier, jurisdictionIdentifier, planIdentifier, dateFrom, dateTo); + verify(organizationRepository).assignLocationAndPlan(eq(1233l), eq(jurisdictionIdentifier), eq(locationId), + eq(planIdentifier), eq(planId), eq(dateFrom), eq(dateTo)); + } + + @Test(expected = IllegalArgumentException.class) + public void testAssignLocationAndPlanWithoutIdentifier() { + String planIdentifier = UUID.randomUUID().toString(); + String jurisdictionIdentifier = null; + organizationService.assignLocationAndPlan(null, jurisdictionIdentifier, planIdentifier, null, null); + verify(organizationRepository, never()).assignLocationAndPlan(anyLong(), eq(jurisdictionIdentifier), anyLong(), + eq(planIdentifier), anyLong(), any(Date.class), any(Date.class)); + } + + @Test(expected = IllegalArgumentException.class) + public void testAssignLocationAndMissingOrganization() { + String planIdentifier = UUID.randomUUID().toString(); + String jurisdictionIdentifier = UUID.randomUUID().toString(); + when(organizationRepository.get(identifier)).thenReturn(null); + organizationService.assignLocationAndPlan(identifier, jurisdictionIdentifier, planIdentifier, null, null); + verify(organizationRepository, never()).assignLocationAndPlan(anyLong(), eq(jurisdictionIdentifier), anyLong(), + eq(planIdentifier), anyLong(), any(Date.class), any(Date.class)); + } + + @Test + public void testFindAssignedLocationsAndPlans() { + organization.setId(12l); + AssignedLocations assigment = new AssignedLocations("loc1", "plan1"); + List expected = Collections.singletonList(assigment); + when(organizationRepository.findAssignedLocations(any(AssignedLocationAndPlanSearchBean.class))).thenReturn(expected); + when(organizationRepository.get(identifier)).thenReturn(organization); + List assigned = organizationService.findAssignedLocationsAndPlans(identifier, false, null, null, null, null); + assertEquals(expected, assigned); + verify(organizationRepository).findAssignedLocations(any(AssignedLocationAndPlanSearchBean.class)); + } + + @Test(expected = IllegalArgumentException.class) + public void testFindAssignedLocationsAndPlansOrganitionMissing() { + organization.setId(12l); + organizationService.findAssignedLocationsAndPlans(identifier, false, null, null, null, null); + verify(organizationRepository, never()).findAssignedLocations(any(AssignedLocationAndPlanSearchBean.class)); + + } + + @Test + public void testFindAssignedLocationsAndPlansWithMultipleIds() { + List organizationIds = Arrays.asList(12l, 34l, 45l); + AssignedLocations assigment = new AssignedLocations("loc1", "plan1"); + List expected = Collections.singletonList(assigment); + when(organizationRepository.findAssignedLocations(organizationIds, false)).thenReturn(expected); + List assigned = organizationService.findAssignedLocationsAndPlans(organizationIds); + assertEquals(expected, assigned); + verify(organizationRepository).findAssignedLocations(organizationIds, false); + } + + @Test + public void testFindAssignedLocationsAndPlansByPlanIdentifier() { + AssignedLocations assigment = new AssignedLocations("loc1", "plan1"); + List expected = Collections.singletonList(assigment); + when(planRepository.retrievePrimaryKey(anyString())).thenReturn(1l); + when(organizationRepository.findAssignedLocations(any(AssignedLocationAndPlanSearchBean.class))).thenReturn(expected); + List assigned = organizationService.findAssignedLocationsAndPlansByPlanIdentifier(identifier, null, null, null, null); + assertEquals(expected, assigned); + verify(organizationRepository).findAssignedLocations(any(AssignedLocationAndPlanSearchBean.class)); + } + + @Test(expected = IllegalArgumentException.class) + public void testFindAssignedLocationsAndPlansByPlanIdentifierWithNullParam() { + organizationService.findAssignedLocationsAndPlansByPlanIdentifier(null, null, null, null, null); + verify(organizationRepository, never()).findAssignedLocations(any(AssignedLocationAndPlanSearchBean.class)); + } + + @Test(expected = IllegalArgumentException.class) + public void testFindAssignedLocationsAndPlansByPlanIdentifierMissingPlan() { + when(planRepository.retrievePrimaryKey(anyString())).thenReturn(null); AssignedLocationAndPlanSearchBean assignedLocationAndPlanSearchBean = new AssignedLocationAndPlanSearchBean(); assignedLocationAndPlanSearchBean.setPlanIdentifier("plan-id-1"); - organizationService.findAssignedLocationsAndPlansByPlanIdentifier("plan-id-1",null,null,null,null); - verify(organizationRepository, never()).findAssignedLocations(any(AssignedLocationAndPlanSearchBean.class)); - } - - @Test - public void testSearchOrganizationsBySearchParam() { - organization.setActive(true); - organization.setMemberCount(1); - List expected = Collections.singletonList(organization); - OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); - organizationSearchBean.setPageNumber(0); - organizationSearchBean.setPageSize(10); - when(organizationRepository.findSearchOrganizations(organizationSearchBean)).thenReturn(expected); - List organizations = organizationService.getSearchOrganizations(organizationSearchBean); - verify(organizationRepository).findSearchOrganizations(organizationSearchBean); - assertEquals(expected, organizations); - } - - - private Practitioner initTestPractitioner() { - Practitioner practitioner = new Practitioner(); - practitioner.setIdentifier("practitoner-1-identifier"); - practitioner.setActive(true); - practitioner.setName("Practitioner"); - practitioner.setUsername("Practioner1"); - practitioner.setUserId("user1"); - return practitioner; - } - - @Test - public void testCountAllOrganizations() { - doReturn(2L).when(organizationRepository).countAllOrganizations(); - assertEquals(2L, organizationService.countAllOrganizations()); - } - - @Test - public void testGetOrganizationsByPractitionerIdentifier() { - Practitioner practitioner = initTestPractitioner(); - List organizationIds = new ArrayList<>(); - organizationIds.add(1l); - organizationIds.add(2l); - organizationIds.add(3l); - - List organizationList = new ArrayList<>(); - Organization organization = new Organization(); - organization.setIdentifier("test-identifier"); - organizationList.add(organization); - ImmutablePair> practitionerOrganizationIds = new ImmutablePair<>(practitioner,organizationIds); - when(practitionerService.getOrganizationsByPractitionerIdentifier(anyString())).thenReturn(practitionerOrganizationIds); - when(organizationRepository.getOrganizationsByIds(anyList())).thenReturn(organizationList); - List organizations = organizationService.getOrganizationsByPractitionerIdentifier("practitioner-1-identifier"); - assertEquals(1, organizations.size()); - assertEquals("test-identifier", organizations.get(0).getIdentifier()); - } + organizationService.findAssignedLocationsAndPlansByPlanIdentifier("plan-id-1", null, null, null, null); + verify(organizationRepository, never()).findAssignedLocations(any(AssignedLocationAndPlanSearchBean.class)); + } + + @Test + public void testSearchOrganizationsBySearchParam() { + organization.setActive(true); + organization.setMemberCount(1); + List expected = Collections.singletonList(organization); + OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); + organizationSearchBean.setPageNumber(0); + organizationSearchBean.setPageSize(10); + when(organizationRepository.findSearchOrganizations(organizationSearchBean)).thenReturn(expected); + List organizations = organizationService.getSearchOrganizations(organizationSearchBean); + verify(organizationRepository).findSearchOrganizations(organizationSearchBean); + assertEquals(expected, organizations); + } + + + private Practitioner initTestPractitioner() { + Practitioner practitioner = new Practitioner(); + practitioner.setIdentifier("practitoner-1-identifier"); + practitioner.setActive(true); + practitioner.setName("Practitioner"); + practitioner.setUsername("Practioner1"); + practitioner.setUserId("user1"); + return practitioner; + } + + @Test + public void testCountAllOrganizations() { + doReturn(2L).when(organizationRepository).countAllOrganizations(); + assertEquals(2L, organizationService.countAllOrganizations()); + } + + @Test + public void testGetOrganizationsByPractitionerIdentifier() { + Practitioner practitioner = initTestPractitioner(); + List organizationIds = new ArrayList<>(); + organizationIds.add(1l); + organizationIds.add(2l); + organizationIds.add(3l); + + List organizationList = new ArrayList<>(); + Organization organization = new Organization(); + organization.setIdentifier("test-identifier"); + organizationList.add(organization); + ImmutablePair> practitionerOrganizationIds = new ImmutablePair<>(practitioner, organizationIds); + when(practitionerService.getOrganizationsByPractitionerIdentifier(anyString())).thenReturn(practitionerOrganizationIds); + when(organizationRepository.getOrganizationsByIds(anyList())).thenReturn(organizationList); + List organizations = organizationService.getOrganizationsByPractitionerIdentifier("practitioner-1-identifier"); + assertEquals(1, organizations.size()); + assertEquals("test-identifier", organizations.get(0).getIdentifier()); + } } diff --git a/src/test/java/org/opensrp/service/PhysicalLocationServiceTest.java b/src/test/java/org/opensrp/service/PhysicalLocationServiceTest.java index 059f48b06..f98cda98e 100755 --- a/src/test/java/org/opensrp/service/PhysicalLocationServiceTest.java +++ b/src/test/java/org/opensrp/service/PhysicalLocationServiceTest.java @@ -31,10 +31,12 @@ import org.opensrp.api.domain.Location; import org.opensrp.api.util.LocationTree; import org.opensrp.api.util.TreeNode; + import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyInt; + import org.opensrp.domain.AssignedLocations; import org.opensrp.domain.StructureDetails; import org.opensrp.domain.LocationDetail; @@ -56,1097 +58,1089 @@ import org.springframework.data.redis.core.RedisTemplate; @RunWith(PowerMockRunner.class) -@PowerMockIgnore({ "com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*", "org.w3c.*" }) +@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*", "org.w3c.*"}) public class PhysicalLocationServiceTest { - - private PhysicalLocationService locationService; - - private LocationRepository locationRepository; - - private HashOperations> hashOps; - - private RedisTemplate redisTemplate; - - private PractitionerService practitionerService; - - private OrganizationService organizationService; - - private ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(PhysicalLocation.class); - - public static Gson gson = new GsonBuilder().registerTypeAdapter(LocationProperty.class, new PropertiesConverter()) - .setDateFormat("yyyy-MM-dd'T'HHmm").create(); - - public static String structureJson = "{\"type\":\"Feature\",\"id\":\"90397\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[32.5978597,-14.1699446],[32.5978956,-14.1699609],[32.5978794,-14.1699947],[32.5978434,-14.1699784],[32.5978597,-14.1699446]]]},\"properties\":{\"uid\":\"41587456-b7c8-4c4e-b433-23a786f742fc\",\"code\":\"21384443\",\"type\":\"Residential Structure\",\"status\":\"Active\",\"parentId\":\"3734\",\"geographicLevel\":5,\"effectiveStartDate\":\"2017-01-10T0000\",\"version\":0}}"; - - public static String parentJson = "{\"type\":\"Feature\",\"id\":\"3734\",\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[32.59989007736522,-14.167432040756012],[32.599899215376524,-14.167521429770147],[32.59990104639621,-14.167611244163538],[32.599895558733124,-14.16770091736339],[32.59989008366051,-14.167739053114758],[32.59993602462787,-14.16775581827636],[32.600019423257834,-14.167793873088726],[32.60009945932262,-14.167838272618155],[32.60017562650404,-14.167888735376776],[32.60024744456398,-14.16794494480331],[32.60031445844555,-14.168006542967532],[32.60037624546743,-14.168073141362354],[32.60043241352514,-14.168144319105009],[32.6004826082858,-14.168219626534494],[32.60052651318807,-14.168298587010156],[32.60056384854283,-14.168380700508862],[32.60059438052627,-14.168465449920518],[32.600617914884936,-14.168552297450503],[32.60062693688366,-14.16860096246438],[32.600629671722004,-14.168608553641775],[32.600653206080665,-14.16869540117176],[32.60066959442628,-14.168783799132996],[32.600678733336906,-14.168873188147074],[32.60068056435659,-14.168963002540465],[32.600675075794186,-14.169052674840998],[32.60066230362247,-14.169141638475764],[32.60064232698187,-14.169229331368513],[32.60061527357607,-14.169315197738115],[32.60058131337695,-14.169398695293522],[32.6005406613225,-14.169479297031899],[32.60049357461884,-14.169556492138383],[32.600440351840795,-14.169629793180375],[32.60038132753629,-14.169698736107762],[32.60031687672256,-14.169762885648595],[32.60024740499381,-14.169821836208712],[32.60017335391722,-14.169875214569458],[32.600095189341566,-14.169922684384344],[32.600073628095515,-14.169933562583822],[32.60007671007219,-14.169963706060116],[32.600078541091875,-14.170053520453562],[32.60007305252941,-14.170143193653415],[32.600060280357695,-14.170232157288183],[32.600040303717094,-14.170319849281555],[32.60001324941197,-14.170405715651212],[32.599979289212854,-14.170489214105885],[32.59993897080693,-14.170569153943234],[32.599943946755786,-14.170617831547645],[32.599945777775474,-14.170707646840356],[32.59994028921301,-14.170797319140943],[32.59992751704135,-14.170886282775712],[32.59990754040069,-14.170973974769083],[32.59988048609562,-14.171059841138685],[32.5998465258965,-14.171143339593414],[32.59980587384205,-14.17122394043247],[32.59975878713834,-14.171301135538954],[32.59970556346104,-14.171374436580948],[32.59964653915648,-14.171443379508332],[32.59958208744342,-14.171507529049165],[32.59951261571467,-14.171566479609282],[32.59943856373877,-14.171619858869349],[32.59936039916312,-14.171667327784915],[32.599278615715605,-14.17170858778104],[32.59919373140565,-14.17174337715511],[32.599106283128485,-14.171771477371749],[32.59901682216866,-14.171792708566613],[32.59892591599828,-14.171806937640042],[32.5988341383848,-14.171814074659776],[32.59874206939105,-14.171814074659776],[32.598650291777574,-14.171806937640042],[32.59855938470787,-14.171792708566613],[32.59846992464736,-14.171771477371749],[32.59838247547094,-14.17174337715511],[32.5983273353383,-14.17172077809141],[32.59831050992216,-14.17173505572822],[32.59823645704688,-14.17178843408891],[32.59815829247128,-14.171835903903796],[32.59807650992303,-14.171877163899921],[32.597991625613076,-14.17191195327399],[32.59790417643665,-14.17194005259131],[32.597814715476765,-14.171961283786173],[32.59772380930639,-14.171975513758923],[32.59763203169297,-14.171982650778657],[32.59753996269916,-14.171982650778657],[32.59744818508574,-14.171975513758923],[32.597357278016034,-14.171961283786173],[32.59726781795547,-14.17194005259131],[32.59718036877905,-14.17191195327399],[32.597125046084045,-14.171889279566528],[32.59711651511515,-14.171899244054828],[32.59705206340203,-14.171963393595718],[32.59698259167334,-14.172022344155835],[32.59690853879806,-14.172075722516524],[32.59683037422246,-14.172123192331412],[32.596748590774894,-14.172164452327593],[32.596669124880236,-14.172197021275451],[32.59666535402294,-14.172199310949395],[32.596583571474696,-14.172240570945519],[32.59649868716474,-14.172275360319588],[32.59641123798832,-14.172303459636908],[32.596321777028436,-14.172324691731092],[32.59623087085805,-14.172338920804519],[32.59613909234531,-14.172346057824257],[32.5960470233515,-14.172346057824257],[32.595955245738025,-14.172338920804519],[32.59586433866832,-14.172324691731092],[32.595803283694636,-14.172310200954938],[32.59573533092083,-14.172367862786585],[32.59566127804561,-14.172421241147333],[32.59558311346996,-14.172468710062901],[32.59551500691208,-14.172503069560946],[32.59545514174147,-14.172546221730727],[32.59537697626649,-14.172593691545558],[32.59529519371824,-14.172634951541738],[32.59521030850897,-14.17266974091575],[32.59512285933255,-14.17269784023307],[32.59503339927198,-14.172719072327254],[32.59494249220228,-14.172733301400683],[32.59485071368954,-14.172740438420476],[32.59475864469573,-14.172740438420476],[32.59466686618299,-14.172733301400683],[32.594575960012605,-14.172719072327254],[32.59448649905272,-14.17269784023307],[32.59445585105675,-14.172687992656677],[32.59442677507565,-14.172690253552332],[32.59433470518257,-14.172690253552332],[32.5942429275691,-14.17268311653254],[32.59415202049939,-14.172668887459167],[32.594062559539566,-14.172647656264303],[32.59397511036309,-14.172619556946927],[32.593890226053134,-14.172584766673594],[32.59380844260562,-14.17254350667747],[32.593730278029966,-14.172496037761903],[32.593656225154746,-14.172442658501836],[32.593586753425996,-14.17238370794172],[32.593567544806376,-14.172364589254355],[32.59351203505241,-14.172317486362884],[32.593447582440035,-14.172253336821994],[32.59338855813547,-14.17218439389461],[32.593335334458175,-14.172111092852617],[32.59328824685514,-14.172033897746132],[32.59324759480069,-14.171953296907077],[32.593213634601625,-14.171869799351725],[32.5931865802965,-14.171783932082747],[32.5931666036559,-14.171696240089375],[32.59315383148419,-14.171607276454608],[32.59314834292172,-14.171517604154076],[32.5931501739414,-14.171427788861308],[32.59315931285203,-14.17133840074655],[32.59317570119771,-14.17125000278537],[32.59319923555631,-14.171163155255385],[32.59322976753981,-14.17107840584373],[32.593267104693155,-14.170996292344967],[32.59331100869616,-14.170917331869305],[32.59336120435614,-14.170842024439821],[32.59341737331317,-14.170770846697167],[32.59347916123437,-14.170704248302341],[32.59354617601525,-14.17064265013812],[32.593617994075196,-14.170586440711643],[32.593694163055204,-14.170535977952964],[32.59377420001937,-14.170491578423535],[32.593857599548635,-14.170453523611172],[32.59394383374098,-14.170422054534129],[32.594032357607254,-14.170397369942634],[32.594122611769194,-14.170379625419342],[32.594214026056534,-14.170368934278827],[32.5943060213059,-14.170365362171708],[32.59439801655525,-14.170368934278827],[32.594402085987554,-14.170369410020214],[32.59439156302028,-14.170336010998085],[32.594371587279,-14.170248319004656],[32.594358814207965,-14.17015935536989],[32.59435618369099,-14.170116383963887],[32.594347703084054,-14.170089466355762],[32.59432772734277,-14.170001773463014],[32.594314954271795,-14.169912809828245],[32.59430946660865,-14.169823137527715],[32.59431129672901,-14.169733323134324],[32.594320435639645,-14.169643934120245],[32.594336823985316,-14.16955553615901],[32.59436035834392,-14.169468688629022],[32.59439089032736,-14.169383940116688],[32.59442822658144,-14.16930182571866],[32.59447213148371,-14.169222865243],[32.59452232624443,-14.169147557813517],[32.59457849520146,-14.169076380070862],[32.59464028132396,-14.169009781676039],[32.5947072961049,-14.168948183511816],[32.59477911416485,-14.168891974984604],[32.59485528224553,-14.168841511326661],[32.59493531831032,-14.168797111797232],[32.595018716940274,-14.168759056984868],[32.59510495113261,-14.168727587907824],[32.595193474099574,-14.168702903316273],[32.5952837282615,-14.168685158792982],[32.59537514075021,-14.168674467652522],[32.59545842696491,-14.168671234589736],[32.5954623282239,-14.168656837343121],[32.5954928602074,-14.168572088830786],[32.595530195562105,-14.168489974432703],[32.59557410046443,-14.168411013957098],[32.595624295225086,-14.168335707426932],[32.595680463282804,-14.168264529684278],[32.59574225030468,-14.168197930390136],[32.595809264186244,-14.168136332225913],[32.59588108224619,-14.1680801236987],[32.59595725032687,-14.168029660040759],[32.596033266422175,-14.16798749083],[32.59606430112666,-14.167931676205853],[32.59611449588732,-14.16785636877637],[32.59617066394503,-14.167785191033715],[32.59623245006759,-14.167718592638892],[32.59629946394915,-14.167656993575347],[32.596371282009095,-14.167600785048137],[32.596447450089784,-14.167550322289514],[32.59652748525531,-14.167505922760085],[32.59661088388526,-14.167467867947721],[32.59669711717828,-14.167436398870677],[32.59678564014524,-14.167411714279126],[32.59687589340779,-14.167393969755835],[32.5969673058965,-14.167383278615375],[32.59705930024654,-14.1673797065082],[32.597151294596635,-14.167383278615375],[32.59724270708534,-14.167393969755835],[32.5973329603479,-14.167411714279126],[32.59742148331486,-14.167436398870677],[32.59746305357709,-14.16745156953425],[32.59747073828402,-14.167423210312847],[32.59750126936814,-14.167338461800512],[32.597508451353974,-14.167322665208815],[32.59752348801862,-14.167280928571927],[32.59752577679319,-14.16727248213931],[32.59755630787737,-14.167187732727655],[32.59759364413145,-14.16710561832957],[32.5976375481344,-14.16702665875323],[32.59768774289506,-14.166951351323744],[32.59774391095277,-14.16688017358109],[32.59780569707533,-14.166813574287005],[32.59787271005757,-14.166751976122782],[32.59794452811752,-14.16669576759557],[32.598020695298885,-14.166645303937571],[32.59810073136373,-14.166600904408142],[32.59818412909431,-14.166562850495096],[32.598270361488055,-14.166531381418054],[32.598358884455024,-14.166506696826557],[32.59844913681826,-14.166488952303268],[32.59852580672065,-14.166479984263844],[32.598559981857704,-14.166473265428806],[32.598651394346405,-14.166462574288346],[32.598743387797185,-14.166459002181169],[32.59883538214722,-14.166462574288346],[32.59892679373661,-14.166473265428806],[32.599017046999165,-14.166491009952097],[32.59910556996613,-14.166515694543648],[32.599191802359826,-14.166547163620635],[32.59927520009046,-14.166585218433056],[32.599355236155304,-14.166629617962426],[32.599431403336666,-14.166680081620425],[32.5995032204973,-14.16673629014764],[32.59957023437886,-14.166797888311862],[32.59963202050142,-14.16686448670663],[32.59968818855913,-14.166935664449284],[32.59973838331979,-14.167010971878824],[32.59978228732274,-14.167089932354429],[32.5998196226775,-14.167172046752512],[32.59985015466094,-14.167256795264848],[32.5998736890196,-14.167343642794833],[32.59989007736522,-14.167432040756012]]]]},\"properties\":{\"uid\":\"41587456-b7c8-4c4e-b433-23a786f742fc\",\"code\":\"3734\",\"type\":\"Intervention Unit\",\"status\":\"Active\",\"parentId\":\"21\",\"name\":\"01_5\",\"geographicLevel\":4,\"effectiveStartDate\":\"2015-01-01T0000\",\"version\":0}}"; - - @Before - public void setUp() { - locationRepository = mock(LocationRepository.class); - practitionerService = mock(PractitionerService.class); - organizationService = mock(OrganizationService.class); - locationService = new PhysicalLocationService(); - locationService.setLocationRepository(locationRepository); - locationService.setOrganizationService(organizationService); - locationService.setPractitionerService(practitionerService); - hashOps = mock(HashOperations.class); - redisTemplate = mock(RedisTemplate.class); - Whitebox.setInternalState(locationService,"hashOps",hashOps); - Whitebox.setInternalState(locationService,"redisTemplate",redisTemplate); - } - - @Test - public void testGetLocation() { - when(locationRepository.get("3734", true, false)).thenReturn(createLocation()); - PhysicalLocation parentLocation = locationService.getLocation("3734", true, false); - verify(locationRepository).get("3734", true, false); - verifyLocationData(parentLocation); - - } - - @Test - public void testGetLocationWithVersion() { - when(locationRepository.get("3734", true, 0)).thenReturn(createLocation()); - PhysicalLocation parentLocation = locationService.getLocation("3734", true, 0); - verify(locationRepository).get("3734", true, 0); - verifyLocationData(parentLocation); - } - - private void verifyLocationData(PhysicalLocation parentLocation) { - verifyNoMoreInteractions(locationRepository); - assertEquals("3734", parentLocation.getId()); - assertEquals("Feature", parentLocation.getType()); - assertEquals(GeometryType.MULTI_POLYGON, parentLocation.getGeometry().getType()); - - assertEquals("21", parentLocation.getProperties().getParentId()); - assertEquals("01_5", parentLocation.getProperties().getName()); - assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", parentLocation.getProperties().getUid()); - assertEquals("3734", parentLocation.getProperties().getCode()); - - assertFalse(parentLocation.getGeometry().getCoordinates().isJsonNull()); - JsonArray coordinates = parentLocation.getGeometry().getCoordinates().get(0).getAsJsonArray().get(0) - .getAsJsonArray(); - assertEquals(267, coordinates.size()); - - JsonArray coordinate1 = coordinates.get(0).getAsJsonArray(); - assertEquals(32.59989007736522, coordinate1.get(0).getAsDouble(), 0); - assertEquals(-14.167432040756012, coordinate1.get(1).getAsDouble(), 0); - - JsonArray coordinate67 = coordinates.get(66).getAsJsonArray(); - assertEquals(32.5988341383848, coordinate67.get(0).getAsDouble(), 0); - assertEquals(-14.171814074659776, coordinate67.get(1).getAsDouble(), 0); - } - - @Test - public void testGetStructure() throws ParseException { - - when(locationRepository.getStructure("90397", true)).thenReturn(createStructure()); - PhysicalLocation structure = locationService.getStructure("90397", true); - verify(locationRepository).getStructure("90397", true); - verifyNoMoreInteractions(locationRepository); - - assertEquals("Feature", structure.getType()); - assertEquals("90397", structure.getId()); - - assertEquals(GeometryType.POLYGON, structure.getGeometry().getType()); - assertFalse(structure.getGeometry().getCoordinates().isJsonNull()); - - assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", structure.getProperties().getUid()); - assertEquals("21384443", structure.getProperties().getCode()); - assertEquals("Residential Structure", structure.getProperties().getType()); - assertEquals(PropertyStatus.ACTIVE, structure.getProperties().getStatus()); - assertEquals("3734", structure.getProperties().getParentId()); - assertNull(structure.getProperties().getName()); - assertEquals(5, structure.getProperties().getGeographicLevel()); - assertEquals(new SimpleDateFormat("yyyy-MM-dd").parse("2017-01-10"), - structure.getProperties().getEffectiveStartDate()); - assertNull(structure.getProperties().getEffectiveEndDate()); - assertEquals(0, structure.getProperties().getVersion()); - } - - @Test - public void testGetAllLocations() { - List expected = new ArrayList<>(); - expected.add(createLocation()); - when(locationRepository.getAll()).thenReturn(expected); - List locations = locationService.getAllLocations(); - verify(locationRepository).getAll(); - verifyNoMoreInteractions(locationRepository); - - assertEquals(1, locations.size()); - PhysicalLocation parentLocation = locations.get(0); - assertEquals("3734", parentLocation.getId()); - assertEquals("Feature", parentLocation.getType()); - assertEquals(GeometryType.MULTI_POLYGON, parentLocation.getGeometry().getType()); - - assertEquals("21", parentLocation.getProperties().getParentId()); - assertEquals("01_5", parentLocation.getProperties().getName()); - assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", parentLocation.getProperties().getUid()); - assertEquals("3734", parentLocation.getProperties().getCode()); - } - - @Test - public void testAddOrUpdateShouldAddLocation() { - when(locationRepository.get("3734")).thenReturn(null); - locationService.addOrUpdate(createLocation()); - verify(locationRepository).add(argumentCaptor.capture()); - - PhysicalLocation parentLocation = argumentCaptor.getValue(); - assertEquals("3734", parentLocation.getId()); - assertEquals("Feature", parentLocation.getType()); - assertEquals(GeometryType.MULTI_POLYGON, parentLocation.getGeometry().getType()); - - assertEquals("21", parentLocation.getProperties().getParentId()); - assertEquals("01_5", parentLocation.getProperties().getName()); - assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", parentLocation.getProperties().getUid()); - assertEquals("3734", parentLocation.getProperties().getCode()); - - } - - @Test - public void testAddOrUpdateShouldUpdateLocation() { - PhysicalLocation physicalLocation = createLocation(); - when(locationRepository.get("3734", true, false)).thenReturn(physicalLocation); - when(locationRepository.findLocationByIdentifierAndStatus("3734",Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name()), true)).thenReturn(physicalLocation); - locationService.addOrUpdate(createLocation()); - verify(locationRepository).update(argumentCaptor.capture()); - - PhysicalLocation parentLocation = argumentCaptor.getValue(); - assertEquals("3734", parentLocation.getId()); - assertEquals("Feature", parentLocation.getType()); - assertEquals(GeometryType.MULTI_POLYGON, parentLocation.getGeometry().getType()); - - assertEquals("21", parentLocation.getProperties().getParentId()); - assertEquals("01_5", parentLocation.getProperties().getName()); - assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", parentLocation.getProperties().getUid()); - assertEquals("3734", parentLocation.getProperties().getCode()); - - } - - @Test(expected = IllegalArgumentException.class) - public void testAddOrUpdateWithNullId() { - PhysicalLocation physicalLocation = createLocation(); - physicalLocation.setId(null); - locationService.addOrUpdate(physicalLocation); - - } - - @Test - public void testAddOrUpdateShouldAddStructure() throws ParseException { - when(locationRepository.getStructure("90397", true)).thenReturn(null); - locationService.addOrUpdate(createStructure()); - verify(locationRepository).add(argumentCaptor.capture()); - - PhysicalLocation structure = argumentCaptor.getValue(); - - assertEquals(GeometryType.POLYGON, structure.getGeometry().getType()); - assertFalse(structure.getGeometry().getCoordinates().isJsonNull()); - - assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", structure.getProperties().getUid()); - assertEquals("21384443", structure.getProperties().getCode()); - assertEquals("Residential Structure", structure.getProperties().getType()); - assertEquals(PropertyStatus.ACTIVE, structure.getProperties().getStatus()); - assertEquals("3734", structure.getProperties().getParentId()); - assertNull(structure.getProperties().getName()); - assertEquals(5, structure.getProperties().getGeographicLevel()); - assertEquals(new SimpleDateFormat("yyyy-MM-dd").parse("2017-01-10"), - structure.getProperties().getEffectiveStartDate()); - assertNull(structure.getProperties().getEffectiveEndDate()); - assertEquals(0, structure.getProperties().getVersion()); - } - - @Test - public void testAddOrUpdateShouldUpdateStructure() throws ParseException { - PhysicalLocation physicalLocation = createStructure(); - when(locationRepository.getStructure("90397", true)).thenReturn(physicalLocation); - locationService.addOrUpdate(physicalLocation); - verify(locationRepository).update(argumentCaptor.capture()); - - PhysicalLocation structure = argumentCaptor.getValue(); - - assertEquals(GeometryType.POLYGON, structure.getGeometry().getType()); - assertFalse(structure.getGeometry().getCoordinates().isJsonNull()); - - assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", structure.getProperties().getUid()); - assertEquals("21384443", structure.getProperties().getCode()); - assertEquals("Residential Structure", structure.getProperties().getType()); - assertEquals(PropertyStatus.ACTIVE, structure.getProperties().getStatus()); - assertEquals("3734", structure.getProperties().getParentId()); - assertNull(structure.getProperties().getName()); - assertEquals(5, structure.getProperties().getGeographicLevel()); - assertEquals(new SimpleDateFormat("yyyy-MM-dd").parse("2017-01-10"), - structure.getProperties().getEffectiveStartDate()); - assertNull(structure.getProperties().getEffectiveEndDate()); - assertEquals(0, structure.getProperties().getVersion()); - - } - - @Test - public void testAdd() { - PhysicalLocation expected = createStructure(); - locationService.add(expected); - verify(locationRepository).add(argumentCaptor.capture()); - - PhysicalLocation structure = argumentCaptor.getValue(); - - assertEquals(GeometryType.POLYGON, structure.getGeometry().getType()); - assertFalse(structure.getGeometry().getCoordinates().isJsonNull()); - - assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", structure.getProperties().getUid()); - assertEquals("21384443", structure.getProperties().getCode()); - assertEquals("Residential Structure", structure.getProperties().getType()); - - } - - @Test(expected = IllegalArgumentException.class) - public void testAddWithNullId() { - PhysicalLocation physicalLocation = new PhysicalLocation(); - locationService.add(physicalLocation); - } - - @Test - public void testUpdate() { - PhysicalLocation expected = createLocation(); - locationService.update(expected); - verify(locationRepository).update(argumentCaptor.capture()); - - PhysicalLocation parentLocation = argumentCaptor.getValue(); - assertEquals("3734", parentLocation.getId()); - assertEquals("Feature", parentLocation.getType()); - assertEquals(GeometryType.MULTI_POLYGON, parentLocation.getGeometry().getType()); - - assertEquals("21", parentLocation.getProperties().getParentId()); - assertEquals("01_5", parentLocation.getProperties().getName()); - assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", parentLocation.getProperties().getUid()); - assertEquals("3734", parentLocation.getProperties().getCode()); - - } - - @Test(expected = IllegalArgumentException.class) - public void testUpdateWithNullId() { - PhysicalLocation physicalLocation = new PhysicalLocation(); - locationService.update(physicalLocation); - } - - @Test - public void testFindLocationsByServerVersion() { - List expected = new ArrayList<>(); - expected.add(createLocation()); - when(locationRepository.findLocationsByServerVersion(123l)).thenReturn(expected); - - List locations = locationService.findLocationsByServerVersion(123l); - verify(locationRepository).findLocationsByServerVersion(123l); - verifyNoMoreInteractions(locationRepository); - - assertEquals(1, locations.size()); - PhysicalLocation parentLocation = locations.get(0); - assertEquals("3734", parentLocation.getId()); - assertEquals("Feature", parentLocation.getType()); - assertEquals(GeometryType.MULTI_POLYGON, parentLocation.getGeometry().getType()); - - assertEquals("21", parentLocation.getProperties().getParentId()); - assertEquals("01_5", parentLocation.getProperties().getName()); - assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", parentLocation.getProperties().getUid()); - assertEquals("3734", parentLocation.getProperties().getCode()); - - } - - @Test - public void testFindLocationsByNames() { - String locationNames = "01_5"; - List expected = new ArrayList<>(); - List locations; - - locations = locationService.findLocationsByNames(locationNames, 0l); - assertEquals(0, locations.size()); - - expected.add(createLocation()); - when(locationService.findLocationsByNames(locationNames, 0l)).thenReturn(expected); - locations = locationService.findLocationsByNames(locationNames, 0l); - assertEquals(1, locations.size()); - PhysicalLocation location = locations.get(0); - assertEquals("01_5", location.getProperties().getName()); - assertEquals("Feature", location.getType()); - assertEquals("3734", location.getId()); - assertEquals(GeometryType.MULTI_POLYGON, location.getGeometry().getType()); - - // search with more than one name - locationNames = "01_5,other_location_name"; - when(locationService.findLocationsByNames(locationNames, 0l)).thenReturn(expected); - locations = locationService.findLocationsByNames(locationNames, 0l); - assertEquals(1, locations.size()); - location = locations.get(0); - assertEquals("01_5", location.getProperties().getName()); - assertEquals("Feature", location.getType()); - assertEquals("3734", location.getId()); - assertEquals(GeometryType.MULTI_POLYGON, location.getGeometry().getType()); - - } - - @Test - public void testFindStructuresByParentAndServerVersion() { - - List expected = new ArrayList<>(); - expected.add(createStructure()); - - when(locationRepository.findStructuresByParentAndServerVersion("3734", 15622112121L)).thenReturn(expected); - - List locations = locationService.findStructuresByParentAndServerVersion("3734", 15622112121L); - verify(locationRepository).findStructuresByParentAndServerVersion("3734", 15622112121L); - verifyNoMoreInteractions(locationRepository); - - assertEquals(1, locations.size()); - PhysicalLocation structure = locations.get(0); - - assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", structure.getProperties().getUid()); - assertEquals("21384443", structure.getProperties().getCode()); - assertEquals("Residential Structure", structure.getProperties().getType()); - - when(locationRepository.findStructuresByParentAndServerVersion("3734,001", 15622112121L)).thenReturn(expected); - locations = locationService.findStructuresByParentAndServerVersion("3734,001", 15622112121L); - verify(locationRepository).findStructuresByParentAndServerVersion("3734,001", 15622112121L); - verifyNoMoreInteractions(locationRepository); - assertEquals(1, locations.size()); - structure = locations.get(0); - assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", structure.getProperties().getUid()); - assertEquals("21384443", structure.getProperties().getCode()); - assertEquals("Residential Structure", structure.getProperties().getType()); - - } - - @Test(expected = IllegalArgumentException.class) - public void testFindStructuresByParentAndServerVersionWithoutParentID() { - - locationService.findStructuresByParentAndServerVersion("", 15622112121L); - - } - - @Test - public void testSaveLocations() { - List expectedLocations = new ArrayList<>(); - PhysicalLocation physicalLocation = createStructure(); - physicalLocation.setId("12323"); - expectedLocations.add(physicalLocation); - expectedLocations.add(createStructure()); - expectedLocations.add(createStructure()); - - when(locationRepository.get("12323", true, false)).thenReturn(physicalLocation); - locationService.saveLocations(expectedLocations, true); - - verify(locationRepository, times(2)).add(argumentCaptor.capture()); - verify(locationRepository, times(1)).update(argumentCaptor.capture()); - for (PhysicalLocation location : argumentCaptor.getAllValues()) { - assertTrue(location.isJurisdiction()); - } - - } - - @Test - public void testFindStructuresWithinRadius() { - - double latitude = -14.1619809; - double longitude = 32.5978597; - - Collection expectedDetails = new ArrayList<>(); - - StructureDetails structure = new StructureDetails(UUID.randomUUID().toString(), "3221", "Mosquito Point"); - expectedDetails.add(structure); - - when(locationRepository.findStructureAndFamilyDetails(Mockito.anyDouble(), Mockito.anyDouble(), Mockito.anyDouble())) - .thenReturn(expectedDetails); - Collection detailsFromService = locationService.findStructuresWithinRadius(latitude, longitude, - 1000); - - assertEquals(expectedDetails, detailsFromService); - verify(locationRepository).findStructureAndFamilyDetails(latitude, longitude, 1000); - - } - - @Test - public void testFindLocationsByProperties() { - List expectedLocations = Collections.singletonList(createLocation()); - - String parentId = UUID.randomUUID().toString(); - Map properties = new HashMap<>(); - when(locationRepository.findLocationsByProperties(true, parentId, properties)).thenReturn(expectedLocations); - List locations = locationService.findLocationsByProperties(true, parentId, properties); - verify(locationRepository).findLocationsByProperties(true, parentId, properties); - assertEquals(1, locations.size()); - assertEquals(expectedLocations, locations); - - } - - @Test - public void testFindStructuresByProperties() { - List expectedLocations = Collections.singletonList(createStructure()); - String parentId = UUID.randomUUID().toString(); - Map properties = new HashMap<>(); - when(locationRepository.findStructuresByProperties(false, parentId, properties)).thenReturn(expectedLocations); - List locations = locationService.findStructuresByProperties(false, parentId, properties); - verify(locationRepository).findStructuresByProperties(false, parentId, properties); - assertEquals(1, locations.size()); - assertEquals(expectedLocations, locations); - } - - @Test - public void testFindLocationsById() { - List expectedLocations = Collections.singletonList(createLocation()); - - List locationIds = new ArrayList<>(); - when(locationRepository.findLocationsByIds(true, locationIds,null)).thenReturn(expectedLocations); - List locations = locationService.findLocationsByIds(true, locationIds); - verify(locationRepository).findLocationsByIds(true, locationIds,null); - assertEquals(1, locations.size()); - assertEquals(expectedLocations, locations); - - } - @Test - public void testFindLocationsByIdWithServerVersion() { - List expectedLocations = Collections.singletonList(createLocation()); - - List locationIds = Arrays.asList("id1","Id2"); - long serverVersion=1234; - when(locationRepository.findLocationsByIds(true, locationIds,serverVersion)).thenReturn(expectedLocations); - List locations = locationService.findLocationsByIds(true, locationIds,serverVersion); - verify(locationRepository).findLocationsByIds(true, locationIds,serverVersion); - assertEquals(1, locations.size()); - assertEquals(expectedLocations, locations); - - } - - @Test - public void testFindAllStructureIds() { - List expectedStructureIds = new ArrayList<>(); - expectedStructureIds.add("Structure-1"); - expectedStructureIds.add("Structure-2"); - Pair, Long> idsModel = Pair.of(expectedStructureIds, 1234l); - - when(locationRepository.findAllStructureIds(anyLong(), anyInt())).thenReturn(idsModel); - Pair, Long> actualIdModels = locationService.findAllStructureIds(0l, 2); - - List actualStructureIds = actualIdModels.getLeft(); - - verify(locationRepository).findAllStructureIds(0l, 2); - assertEquals(2, actualStructureIds.size()); - assertEquals(expectedStructureIds.get(0), actualStructureIds.get(0)); - assertEquals(expectedStructureIds.get(1), actualStructureIds.get(1)); - - } - - @Test - public void testFindLocationDetailsByPlanId() { - Set expectedLocationDetails = new HashSet<>(); - LocationDetail locationDetail = LocationDetail.builder().identifier("identifier-1").name("location-one").build(); - expectedLocationDetails.add(locationDetail); - - when(locationRepository.findLocationDetailsByPlanId("identifier-1")).thenReturn(expectedLocationDetails); - Set actualLocationDetails = locationService.findLocationDetailsByPlanId("identifier-1"); - - verify(locationRepository).findLocationDetailsByPlanId(anyString()); - assertEquals(1, actualLocationDetails.size()); - LocationDetail actuallocationDetail = actualLocationDetails.iterator().next(); - assertEquals(actuallocationDetail.getIdentifier(), "identifier-1"); - assertEquals(actuallocationDetail.getName(), "location-one"); - - } - - @Test - public void testFindAllLocationIds() { - List expectedLocationIds = new ArrayList<>(); - expectedLocationIds.add("Location-1"); - expectedLocationIds.add("Location-2"); - Pair, Long> idsModel = Pair.of(expectedLocationIds, 1234l); - - when(locationRepository.findAllLocationIds(anyLong(), anyInt())).thenReturn(idsModel); - Pair, Long> actualIdsModelList = locationService.findAllLocationIds(0l, 10); - - List actualLocationIds = actualIdsModelList.getLeft(); - verify(locationRepository).findAllLocationIds(0l, 10); - assertEquals(2, actualLocationIds.size()); - assertEquals(expectedLocationIds.get(0), actualLocationIds.get(0)); - assertEquals(expectedLocationIds.get(1), actualLocationIds.get(1)); - assertEquals(1234l, actualIdsModelList.getRight().longValue()); - - } - - private PhysicalLocation createLocation() { - PhysicalLocation parentLocation = gson.fromJson(parentJson, PhysicalLocation.class); - parentLocation.setJurisdiction(true); - return parentLocation; - } - - private PhysicalLocation createStructure() { - return gson.fromJson(structureJson, PhysicalLocation.class); - } - - @Test - public void testSearchlLocationsWithFilters() { - LocationSearchBean locationSearchBean = new LocationSearchBean(); - locationSearchBean.setName("a"); - locationSearchBean.setLocationTagId(2l); - locationSearchBean.setPageSize(20); - List expectedLocations = new ArrayList<>(); - expectedLocations.add(createLocation()); - when(locationRepository.searchLocations(locationSearchBean)).thenReturn(expectedLocations); - List actutalLocations = locationService.searchLocations(locationSearchBean); - verify(locationRepository).searchLocations(locationSearchBean); - assertEquals(1, actutalLocations.size()); - assertEquals("Feature", actutalLocations.get(0).getType()); - } - - @Test - public void testShouldSearchCountLocation() { - LocationSearchBean locationSearchBean = new LocationSearchBean(); - when(locationRepository.countSearchLocations(locationSearchBean)).thenReturn(1); - int actutalLocations = locationService.countSearchLocations(locationSearchBean); - verify(locationRepository).countSearchLocations(locationSearchBean); - assertEquals(1, actutalLocations); - } - - @Test - public void testbuildLocationHierachy() { - Set identifiers = new HashSet<>(Arrays.asList("1234", "21")); - Set locationDetails = new HashSet<>(); - LocationDetail kenya = LocationDetail.builder().name("Kenya").id(1l).identifier("254").tags("Country").build(); - LocationDetail nairobi = LocationDetail.builder().name("Nairobi").id(2l).identifier("252-020").parentId("254") - .tags("City,Zone").build(); - locationDetails.add(kenya); - locationDetails.add(nairobi); - when(locationRepository.findParentLocationsInclusive(identifiers, false)).thenReturn(locationDetails); - LocationTree tree = locationService.buildLocationHierachy(identifiers, false, false); - verify(locationRepository).findParentLocationsInclusive(identifiers, false); - assertNotNull(tree); - assertEquals(1, tree.getLocationsHierarchy().size()); - TreeNode countryNode = tree.getLocationsHierarchy().get(kenya.getIdentifier()); - assertNotNull(countryNode); - assertEquals(kenya.getIdentifier(), countryNode.getId()); - assertEquals(kenya.getName(), countryNode.getLabel()); - assertNull(countryNode.getParent()); - assertEquals(kenya.getTags(), countryNode.getNode().getTags().iterator().next()); - assertEquals(1, countryNode.getChildren().size()); - - TreeNode cityNode = countryNode.getChildren().get(nairobi.getIdentifier()); - assertNotNull(cityNode); - assertEquals(nairobi.getIdentifier(), cityNode.getId()); - assertEquals(nairobi.getName(), cityNode.getLabel()); - assertNull(cityNode.getChildren()); - assertEquals(kenya.getIdentifier(), cityNode.getParent()); - - Set tags = cityNode.getNode().getTags(); - assertEquals(2, tags.size()); - assertTrue(tags.contains("City")); - assertTrue(tags.contains("Zone")); - - } - - @Test - public void testCountStructuresByParentAndServerVersion() { - - when(locationRepository.countStructuresByParentAndServerVersion("3734", 15622112121L)).thenReturn(12l); - - Long locations = locationService.countStructuresByParentAndServerVersion("3734", 15622112121L); - verify(locationRepository).countStructuresByParentAndServerVersion("3734", 15622112121L); - verifyNoMoreInteractions(locationRepository); - - assertEquals(12, locations.longValue()); - - when(locationRepository.countStructuresByParentAndServerVersion("3734,001", 15622112121L)).thenReturn(15l); - locations = locationService.countStructuresByParentAndServerVersion("3734,001", 15622112121L); - verify(locationRepository).countStructuresByParentAndServerVersion("3734,001", 15622112121L); - verifyNoMoreInteractions(locationRepository); - assertEquals(15, locations.longValue()); - } - - @Test - public void testCountFindLocationsByServerVersion() { - when(locationRepository.countLocationsByServerVersion(123l)).thenReturn(4l); - - Long locations = locationService.countLocationsByServerVersion(123l); - verify(locationRepository).countLocationsByServerVersion(123l); - verifyNoMoreInteractions(locationRepository); - - assertEquals(4, locations.longValue()); - - } - - @Test - public void testCountLocationsByNames() { - String locationNames = "01_5"; - Long locations = locationService.countLocationsByNames(locationNames, 0l); - assertEquals(0, locations.longValue()); - - when(locationService.countLocationsByNames(locationNames, 0l)).thenReturn(3l); - locations = locationService.countLocationsByNames(locationNames, 0l); - assertEquals(3, locations.longValue()); - - // search with more than one name - locationNames = "01_5,other_location_name"; - when(locationService.countLocationsByNames(locationNames, 0l)).thenReturn(2l); - locations = locationService.countLocationsByNames(locationNames, 0l); - assertEquals(2, locations.longValue()); - - } - - @Test - public void testBuildLocationHierachyFromLocation() { - String locationId = "1"; - - Set locationDetails = new HashSet<>(); - - LocationDetail country = LocationDetail.builder().name("Country 1").id(2l).identifier("1").tags("Country").build(); - LocationDetail province1 = LocationDetail.builder().name("Province 1").id(3l).identifier("11").parentId("1") - .tags("Province").build(); - LocationDetail province2 = LocationDetail.builder().name("Province 2").id(4l).identifier("12").parentId("1") - .tags("Province").build(); - LocationDetail district1 = LocationDetail.builder().name("District 1").id(5l).identifier("111").parentId("11") - .tags("District").build(); - LocationDetail district2 = LocationDetail.builder().name("District 2").id(6l).identifier("121").parentId("12") - .tags("District").build(); - LocationDetail district3 = LocationDetail.builder().name("District 3").id(7l).identifier("122").parentId("12") - .tags("District").build(); - - locationDetails.add(country); - locationDetails.add(province1); - locationDetails.add(province2); - locationDetails.add(district1); - locationDetails.add(district2); - locationDetails.add(district3); - - Boolean returnTags = false; - - when(locationRepository.findLocationWithDescendants(locationId, returnTags)).thenReturn(locationDetails); - - LocationTree tree = locationService.buildLocationHierachyFromLocation(locationId, false); - - verify(locationRepository).findLocationWithDescendants(locationId, returnTags); - assertNotNull(tree); - assertEquals(1, tree.getLocationsHierarchy().size()); - - TreeNode level0Node = tree.getLocationsHierarchy().get(country.getIdentifier()); - assertNotNull(level0Node); - assertEquals(country.getIdentifier(), level0Node.getId()); - assertEquals(country.getName(), level0Node.getLabel()); - assertNull(level0Node.getParent()); - assertEquals(country.getTags(), level0Node.getNode().getTags().iterator().next()); - assertEquals(2, level0Node.getChildren().size()); - - TreeNode level1Node = level0Node.getChildren().get(province2.getIdentifier()); - assertNotNull(level1Node); - assertEquals(province2.getIdentifier(), level1Node.getId()); - assertEquals(province2.getName(), level1Node.getLabel()); - assertEquals(2, level1Node.getChildren().size()); - assertEquals(country.getIdentifier(), level1Node.getParent()); - - TreeNode level2Node = level1Node.getChildren().get(district2.getIdentifier()); - assertNotNull(level2Node); - assertEquals(district2.getIdentifier(), level2Node.getId()); - assertEquals(district2.getName(), level2Node.getLabel()); - assertNull(level2Node.getChildren()); - assertEquals(province2.getIdentifier(), level2Node.getParent()); - - Set tags = level2Node.getNode().getTags(); - assertEquals(1, tags.size()); - assertTrue(tags.contains("District")); - } - - @Test - public void testBuildLocationHierachyFromLocationWithStructureCounts() { - String locationId = "1"; - Set locationDetails = new LinkedHashSet<>(); - - LocationDetail country = LocationDetail.builder().name("Country 1").id(2l).identifier("1").tags("Country") - .geographicLevel(0).build(); - LocationDetail province1 = LocationDetail.builder().name("Province 1").id(3l).identifier("11").parentId("1") - .tags("Province").geographicLevel(1).build(); - LocationDetail province2 = LocationDetail.builder().name("Province 2").id(4l).identifier("12").parentId("1") - .tags("Province").geographicLevel(1).build(); - LocationDetail district1 = LocationDetail.builder().name("District 1").id(5l).identifier("111").parentId("11") - .tags("District").geographicLevel(2).build(); - LocationDetail district2 = LocationDetail.builder().name("District 2").id(6l).identifier("121").parentId("12") - .tags("District").geographicLevel(2).build(); - LocationDetail district3 = LocationDetail.builder().name("District 3").id(7l).identifier("122").parentId("12") - .tags("District").geographicLevel(2).build(); - LocationDetail district4 = LocationDetail.builder().name("District 4").id(8l).identifier("123").parentId("12") - .tags("District").geographicLevel(2).build(); // Test what happens when child location has no structures - - // records are ordered by level in the db query - locationDetails.add(district4); - locationDetails.add(district3); - locationDetails.add(district2); - locationDetails.add(district1); - locationDetails.add(province2); - locationDetails.add(province1); - locationDetails.add(country); - - Set locationIdentifiers = new HashSet<>(); - locationIdentifiers.add(country.getIdentifier()); - locationIdentifiers.add(province1.getIdentifier()); - locationIdentifiers.add(province2.getIdentifier()); - locationIdentifiers.add(district1.getIdentifier()); - locationIdentifiers.add(district2.getIdentifier()); - locationIdentifiers.add(district3.getIdentifier()); - locationIdentifiers.add(district4.getIdentifier()); - - when(locationRepository.findLocationWithDescendants(locationId, false)).thenReturn(locationDetails); - - List structureCounts = new ArrayList<>(); - StructureCount structureCountD1 = StructureCount.builder().parentId(district1.getIdentifier()).count(10).build(); - StructureCount structureCountD2 = StructureCount.builder().parentId(district2.getIdentifier()).count(5).build(); - StructureCount structureCountD3 = StructureCount.builder().parentId(district3.getIdentifier()).count(8).build(); - structureCounts.add(structureCountD1); - structureCounts.add(structureCountD2); - structureCounts.add(structureCountD3); - - when(locationRepository.findStructureCountsForLocation(locationIdentifiers)).thenReturn(structureCounts); - - LocationTree tree = locationService.buildLocationHierachyFromLocation(locationId, true); - - TreeNode countryNode = tree.getLocationsHierarchy().get(country.getIdentifier()); - assertNotNull(countryNode); - assertEquals(country.getIdentifier(), countryNode.getId()); - assertEquals(country.getName(), countryNode.getLabel()); - assertNull(countryNode.getParent()); - assertEquals(country.getTags(), countryNode.getNode().getTags().iterator().next()); - assertEquals(2, countryNode.getChildren().size()); - assertEquals(0, countryNode.getNode().getAttribute("geographicLevel")); - assertEquals(23, countryNode.getNode().getAttribute(STRUCTURE_COUNT)); - - TreeNode province1Node = countryNode.getChildren().get(province1.getIdentifier()); - assertNotNull(province1Node); - verifyLocationData(province1Node, province1, country, 1, true); - assertEquals(10, province1Node.getNode().getAttribute(STRUCTURE_COUNT)); - - TreeNode province2Node = countryNode.getChildren().get(province2.getIdentifier()); - verifyLocationData(province2Node, province2, country, 1, true); - assertEquals(13, province2Node.getNode().getAttribute(STRUCTURE_COUNT)); - - TreeNode district1Node = province1Node.getChildren().get(district1.getIdentifier()); - verifyLocationData(district1Node, district1, province1, 2, false); - assertEquals(10, district1Node.getNode().getAttribute(STRUCTURE_COUNT)); - - TreeNode district2Node = province2Node.getChildren().get(district2.getIdentifier()); - verifyLocationData(district2Node, district2, province2, 2, false); - assertEquals(5, district2Node.getNode().getAttribute(STRUCTURE_COUNT)); - - TreeNode district3Node = province2Node.getChildren().get(district3.getIdentifier()); - verifyLocationData(district3Node, district3, province2, 2, false); - assertEquals(8, district3Node.getNode().getAttribute(STRUCTURE_COUNT)); - } - - @Test - public void testBuildLocationHierarchy() { - Set locationDetails = new HashSet<>(); - - LocationDetail country = LocationDetail.builder().name("Country 1").id(2l).identifier("1").tags("Country") - .geographicLevel(0).build(); - LocationDetail province1 = LocationDetail.builder().name("Province 1").id(3l).identifier("11").parentId("1") - .tags("Province").geographicLevel(1).build(); - LocationDetail province2 = LocationDetail.builder().name("Province 2").id(4l).identifier("12").parentId("1") - .tags("Province").geographicLevel(1).build(); - LocationDetail district1 = LocationDetail.builder().name("District 1").id(5l).identifier("111").parentId("11") - .tags("District").geographicLevel(2).build(); - LocationDetail district2 = LocationDetail.builder().name("District 2").id(6l).identifier("121").parentId("12") - .tags("District").geographicLevel(2).build(); - LocationDetail district3 = LocationDetail.builder().name("District 3").id(7l).identifier("122").parentId("12") - .tags("District").geographicLevel(2).build(); - - locationDetails.add(country); - locationDetails.add(province1); - locationDetails.add(province2); - locationDetails.add(district1); - locationDetails.add(district2); - locationDetails.add(district3); - - Set locationIdentifiers = new HashSet<>(); - locationIdentifiers.add(district1.getIdentifier()); - locationIdentifiers.add(district2.getIdentifier()); - locationIdentifiers.add(district2.getIdentifier()); - - when(locationRepository.findParentLocationsInclusive(locationIdentifiers, true)).thenReturn(locationDetails); - - LocationTree tree = locationService.buildLocationHierachy(locationIdentifiers, false, true); - - TreeNode countryNode = tree.getLocationsHierarchy().get(country.getIdentifier()); - assertNotNull(countryNode); - assertEquals(country.getIdentifier(), countryNode.getId()); - assertEquals(country.getName(), countryNode.getLabel()); - assertNull(countryNode.getParent()); - assertEquals(country.getTags(), countryNode.getNode().getTags().iterator().next()); - assertEquals(2, countryNode.getChildren().size()); - assertNull(countryNode.getNode().getAttribute(STRUCTURE_COUNT)); - assertEquals(0, countryNode.getNode().getAttribute("geographicLevel")); - - TreeNode province1Node = countryNode.getChildren().get(province1.getIdentifier()); - assertNotNull(province1Node); - verifyLocationData(province1Node, province1, country, 1, true); - assertNull(province1Node.getNode().getAttribute(STRUCTURE_COUNT)); - - TreeNode province2Node = countryNode.getChildren().get(province2.getIdentifier()); - verifyLocationData(province2Node, province2, country, 1, true); - assertNull(province2Node.getNode().getAttribute(STRUCTURE_COUNT)); - - TreeNode district1Node = province1Node.getChildren().get(district1.getIdentifier()); - verifyLocationData(district1Node, district1, province1, 2, false); - assertNull(district1Node.getNode().getAttribute(STRUCTURE_COUNT)); - - TreeNode district2Node = province2Node.getChildren().get(district2.getIdentifier()); - verifyLocationData(district2Node, district2, province2, 2, false); - assertNull(district2Node.getNode().getAttribute(STRUCTURE_COUNT)); - - TreeNode district3Node = province2Node.getChildren().get(district3.getIdentifier()); - verifyLocationData(district3Node, district3, province2, 2, false); - assertNull(district3Node.getNode().getAttribute(STRUCTURE_COUNT)); - } - - @Test - public void testBuildLocationHierarchyWithStructureCounts() { - Set locationDetails = new LinkedHashSet<>(); - - LocationDetail country = LocationDetail.builder().name("Country 1").id(2l).identifier("1").tags("Country") - .geographicLevel(0).build(); - LocationDetail province1 = LocationDetail.builder().name("Province 1").id(3l).identifier("11").parentId("1") - .tags("Province").geographicLevel(1).build(); - LocationDetail province2 = LocationDetail.builder().name("Province 2").id(4l).identifier("12").parentId("1") - .tags("Province").geographicLevel(1).build(); - LocationDetail district1 = LocationDetail.builder().name("District 1").id(5l).identifier("111").parentId("11") - .tags("District").geographicLevel(2).build(); - LocationDetail district2 = LocationDetail.builder().name("District 2").id(6l).identifier("121").parentId("12") - .tags("District").geographicLevel(2).build(); - LocationDetail district3 = LocationDetail.builder().name("District 3").id(7l).identifier("122").parentId("12") - .tags("District").geographicLevel(2).build(); - LocationDetail district4 = LocationDetail.builder().name("District 4").id(8l).identifier("123").parentId("12") - .tags("District").geographicLevel(2).build(); // Test what happens when child not has no structures - - // records are ordered by level in the db query - locationDetails.add(district4); - locationDetails.add(district3); - locationDetails.add(district2); - locationDetails.add(district1); - locationDetails.add(province2); - locationDetails.add(province1); - locationDetails.add(country); - - Set locationIdentifiers = new HashSet<>(); - locationIdentifiers.add(country.getIdentifier()); - locationIdentifiers.add(province1.getIdentifier()); - locationIdentifiers.add(province2.getIdentifier()); - locationIdentifiers.add(district1.getIdentifier()); - locationIdentifiers.add(district2.getIdentifier()); - locationIdentifiers.add(district3.getIdentifier()); - locationIdentifiers.add(district4.getIdentifier()); - - when(locationRepository.findParentLocationsInclusive(locationIdentifiers, false)).thenReturn(locationDetails); - - List structureCounts = new ArrayList<>(); - StructureCount structureCountD1 = StructureCount.builder().parentId(district1.getIdentifier()).count(10).build(); - StructureCount structureCountD2 = StructureCount.builder().parentId(district2.getIdentifier()).count(5).build(); - StructureCount structureCountD3 = StructureCount.builder().parentId(district3.getIdentifier()).count(8).build(); - structureCounts.add(structureCountD1); - structureCounts.add(structureCountD2); - structureCounts.add(structureCountD3); - - when(locationRepository.findStructureCountsForLocation(locationIdentifiers)).thenReturn(structureCounts); - - LocationTree tree = locationService.buildLocationHierachy(locationIdentifiers, true, false); - - TreeNode countryNode = tree.getLocationsHierarchy().get(country.getIdentifier()); - assertNotNull(countryNode); - assertEquals(country.getIdentifier(), countryNode.getId()); - assertEquals(country.getName(), countryNode.getLabel()); - assertNull(countryNode.getParent()); - assertEquals(country.getTags(), countryNode.getNode().getTags().iterator().next()); - assertEquals(2, countryNode.getChildren().size()); - assertEquals(0, countryNode.getNode().getAttribute("geographicLevel")); - assertEquals(23, countryNode.getNode().getAttribute(STRUCTURE_COUNT)); - - TreeNode province1Node = countryNode.getChildren().get(province1.getIdentifier()); - assertNotNull(province1Node); - verifyLocationData(province1Node, province1, country, 1, true); - assertEquals(10, province1Node.getNode().getAttribute(STRUCTURE_COUNT)); - - TreeNode province2Node = countryNode.getChildren().get(province2.getIdentifier()); - verifyLocationData(province2Node, province2, country, 1, true); - assertEquals(13, province2Node.getNode().getAttribute(STRUCTURE_COUNT)); - - TreeNode district1Node = province1Node.getChildren().get(district1.getIdentifier()); - verifyLocationData(district1Node, district1, province1, 2, false); - assertEquals(10, district1Node.getNode().getAttribute(STRUCTURE_COUNT)); - - TreeNode district2Node = province2Node.getChildren().get(district2.getIdentifier()); - verifyLocationData(district2Node, district2, province2, 2, false); - assertEquals(5, district2Node.getNode().getAttribute(STRUCTURE_COUNT)); - - TreeNode district3Node = province2Node.getChildren().get(district3.getIdentifier()); - verifyLocationData(district3Node, district3, province2, 2, false); - assertEquals(8, district3Node.getNode().getAttribute(STRUCTURE_COUNT)); - } - - private void verifyLocationData(TreeNode node, LocationDetail locationDetail, LocationDetail parentLD, - int geographicLevel, boolean hasChildren) { - assertNotNull(node); - assertEquals(locationDetail.getIdentifier(), node.getId()); - assertEquals(locationDetail.getName(), node.getLabel()); - if (!hasChildren) { - assertNull(node.getChildren()); - } - assertEquals(parentLD.getIdentifier(), node.getParent()); - assertEquals(geographicLevel, node.getNode().getAttribute("geographicLevel")); - } - - @Test - public void testGetAssignedLocationsFromCache() { - AssignedLocations assigment = new AssignedLocations("loc1", "plan1"); - List expected = Collections.singletonList(assigment); - when(hashOps.hasKey(anyString(), any(Object.class))).thenReturn(Boolean.TRUE); - when(hashOps.get(anyString(), any(Object.class))).thenReturn(expected); - List actual = locationService.getAssignedLocations("testUser"); - assertEquals(expected.size(),actual.size()); - assertEquals(expected.get(0).getPlanId(),"plan1"); - assertEquals(expected.get(0).getJurisdictionId(),"loc1"); - } - - @Test - public void testGetAssignedLocationsFromDb() { - AssignedLocations assigment1 = new AssignedLocations("loc1", "plan1"); - assigment1.setToDate(new Date()); - AssignedLocations assigment2 = new AssignedLocations("loc2", "plan2"); - assigment2.setToDate(new Date()); - List expected = new ArrayList<>(); - expected.add(assigment1); - expected.add(assigment2); - List expectedOrganizationIds = Collections.singletonList(1234l); - Practitioner practitioner = new Practitioner(); - ImmutablePair> practitionerListImmutablePair = new ImmutablePair<>(practitioner,expectedOrganizationIds); - when(hashOps.hasKey(anyString(), any(Object.class))).thenReturn(Boolean.FALSE); - when(practitionerService.getOrganizationsByUserId(anyString())).thenReturn(practitionerListImmutablePair); - when(organizationService.findAssignedLocationsAndPlans(any(List.class))).thenReturn(expected); - when(redisTemplate.expire(anyString(),any(long.class),any(TimeUnit.class))).thenReturn(Boolean.TRUE); - - List actual = locationService.getAssignedLocations("testUser"); - assertEquals(expected.size(),actual.size()); - assertEquals(expected.get(0).getPlanId(),"plan1"); - assertEquals(expected.get(1).getPlanId(),"plan2"); - assertEquals(expected.get(0).getJurisdictionId(),"loc1"); - assertEquals(expected.get(1).getJurisdictionId(),"loc2"); - } - - @Test - public void testfindLocationByIdWithChildren() { - List expected = new ArrayList<>(); - expected.add(createLocation()); - when(locationRepository.findLocationByIdWithChildren(false, "1332232", 1000)).thenReturn(expected); - assertEquals(expected, locationService.findLocationByIdWithChildren(false, "1332232", 1000)); - verify(locationRepository).findLocationByIdWithChildren(false, "1332232", 1000); - } - - @Test - public void testfindLocationByIdsWithChildren() { - List expected = new ArrayList<>(); - expected.add(createLocation()); - Set ids = new HashSet<>(Arrays.asList("123","23435463","9888787")); - when(locationRepository.findLocationByIdsWithChildren(false, ids, 1000)).thenReturn(expected); - assertEquals(expected, locationService.findLocationByIdsWithChildren(false, ids, 1000)); - verify(locationRepository).findLocationByIdsWithChildren(false, ids, 1000); - } - - @Test - public void testBuildLocationHeirarchyWithAncestors() { - Set locationIds = new HashSet<>(); - String locationId = "1"; - locationIds.add(locationId); - - Set locationDetails = new HashSet<>(); - - LocationDetail country = LocationDetail.builder().name("Country 1").id(2l).identifier("1").tags("Country").build(); - LocationDetail province1 = LocationDetail.builder().name("Province 1").id(3l).identifier("11").parentId("1") - .tags("Province").build(); - LocationDetail province2 = LocationDetail.builder().name("Province 2").id(4l).identifier("12").parentId("1") - .tags("Province").build(); - LocationDetail district1 = LocationDetail.builder().name("District 1").id(5l).identifier("111").parentId("11") - .tags("District").build(); - LocationDetail district2 = LocationDetail.builder().name("District 2").id(6l).identifier("121").parentId("12") - .tags("District").build(); - LocationDetail district3 = LocationDetail.builder().name("District 3").id(7l).identifier("122").parentId("12") - .tags("District").build(); - - locationDetails.add(country); - locationDetails.add(province1); - locationDetails.add(province2); - locationDetails.add(district1); - locationDetails.add(district2); - locationDetails.add(district3); - - when(locationRepository.findParentLocationsInclusive(locationIds)).thenReturn(locationDetails); - - Set locationDetailsSet = locationService.buildLocationHeirarchyWithAncestors(locationId); - - verify(locationRepository).findParentLocationsInclusive(locationIds); - assertNotNull(locationDetailsSet); - assertEquals(6, locationDetailsSet.size()); - LocationDetail actuallocationDetail = locationDetailsSet.iterator().next(); - assertEquals("Province 1", actuallocationDetail.getName()); - assertEquals("Province", actuallocationDetail.getTags()); - } - - @Test - public void testBuildLocationTreeHierachyWithAncestors() { - Set locationIds = new HashSet<>(); - String locationId = "1"; - locationIds.add(locationId); - - Set locationDetails = new HashSet<>(); - - LocationDetail country = LocationDetail.builder().name("Country 1").id(2l).identifier("1").tags("Country").build(); - LocationDetail province1 = LocationDetail.builder().name("Province 1").id(3l).identifier("11").parentId("1") - .tags("Province").build(); - LocationDetail province2 = LocationDetail.builder().name("Province 2").id(4l).identifier("12").parentId("1") - .tags("Province").build(); - LocationDetail district1 = LocationDetail.builder().name("District 1").id(5l).identifier("111").parentId("11") - .tags("District").build(); - LocationDetail district2 = LocationDetail.builder().name("District 2").id(6l).identifier("121").parentId("12") - .tags("District").build(); - LocationDetail district3 = LocationDetail.builder().name("District 3").id(7l).identifier("122").parentId("12") - .tags("District").build(); - - locationDetails.add(country); - locationDetails.add(province1); - locationDetails.add(province2); - locationDetails.add(district1); - locationDetails.add(district2); - locationDetails.add(district3); - - when(locationRepository.findParentLocationsInclusive(locationIds)).thenReturn(locationDetails); - - LocationTree locationTree = locationService.buildLocationTreeHierachyWithAncestors(locationId, false); - - verify(locationRepository).findParentLocationsInclusive(locationIds); - assertNotNull(locationTree); - assertEquals(1, locationTree.getLocationsHierarchy().size()); - - TreeNode level0Node = locationTree.getLocationsHierarchy().get(country.getIdentifier()); - assertNotNull(level0Node); - assertEquals(country.getIdentifier(), level0Node.getId()); - assertEquals(country.getName(), level0Node.getLabel()); - assertNull(level0Node.getParent()); - assertEquals(country.getTags(), level0Node.getNode().getTags().iterator().next()); - assertEquals(2, level0Node.getChildren().size()); - - TreeNode level1Node = level0Node.getChildren().get(province2.getIdentifier()); - assertNotNull(level1Node); - assertEquals(province2.getIdentifier(), level1Node.getId()); - assertEquals(province2.getName(), level1Node.getLabel()); - assertEquals(2, level1Node.getChildren().size()); - assertEquals(country.getIdentifier(), level1Node.getParent()); - - TreeNode level2Node = level1Node.getChildren().get(district2.getIdentifier()); - assertNotNull(level2Node); - assertEquals(district2.getIdentifier(), level2Node.getId()); - assertEquals(district2.getName(), level2Node.getLabel()); - assertNull(level2Node.getChildren()); - assertEquals(province2.getIdentifier(), level2Node.getParent()); - - Set tags = level2Node.getNode().getTags(); - assertEquals(1, tags.size()); - assertTrue(tags.contains("District")); - } + + public static Gson gson = new GsonBuilder().registerTypeAdapter(LocationProperty.class, new PropertiesConverter()) + .setDateFormat("yyyy-MM-dd'T'HHmm").create(); + public static String structureJson = "{\"type\":\"Feature\",\"id\":\"90397\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[32.5978597,-14.1699446],[32.5978956,-14.1699609],[32.5978794,-14.1699947],[32.5978434,-14.1699784],[32.5978597,-14.1699446]]]},\"properties\":{\"uid\":\"41587456-b7c8-4c4e-b433-23a786f742fc\",\"code\":\"21384443\",\"type\":\"Residential Structure\",\"status\":\"Active\",\"parentId\":\"3734\",\"geographicLevel\":5,\"effectiveStartDate\":\"2017-01-10T0000\",\"version\":0}}"; + public static String parentJson = "{\"type\":\"Feature\",\"id\":\"3734\",\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[32.59989007736522,-14.167432040756012],[32.599899215376524,-14.167521429770147],[32.59990104639621,-14.167611244163538],[32.599895558733124,-14.16770091736339],[32.59989008366051,-14.167739053114758],[32.59993602462787,-14.16775581827636],[32.600019423257834,-14.167793873088726],[32.60009945932262,-14.167838272618155],[32.60017562650404,-14.167888735376776],[32.60024744456398,-14.16794494480331],[32.60031445844555,-14.168006542967532],[32.60037624546743,-14.168073141362354],[32.60043241352514,-14.168144319105009],[32.6004826082858,-14.168219626534494],[32.60052651318807,-14.168298587010156],[32.60056384854283,-14.168380700508862],[32.60059438052627,-14.168465449920518],[32.600617914884936,-14.168552297450503],[32.60062693688366,-14.16860096246438],[32.600629671722004,-14.168608553641775],[32.600653206080665,-14.16869540117176],[32.60066959442628,-14.168783799132996],[32.600678733336906,-14.168873188147074],[32.60068056435659,-14.168963002540465],[32.600675075794186,-14.169052674840998],[32.60066230362247,-14.169141638475764],[32.60064232698187,-14.169229331368513],[32.60061527357607,-14.169315197738115],[32.60058131337695,-14.169398695293522],[32.6005406613225,-14.169479297031899],[32.60049357461884,-14.169556492138383],[32.600440351840795,-14.169629793180375],[32.60038132753629,-14.169698736107762],[32.60031687672256,-14.169762885648595],[32.60024740499381,-14.169821836208712],[32.60017335391722,-14.169875214569458],[32.600095189341566,-14.169922684384344],[32.600073628095515,-14.169933562583822],[32.60007671007219,-14.169963706060116],[32.600078541091875,-14.170053520453562],[32.60007305252941,-14.170143193653415],[32.600060280357695,-14.170232157288183],[32.600040303717094,-14.170319849281555],[32.60001324941197,-14.170405715651212],[32.599979289212854,-14.170489214105885],[32.59993897080693,-14.170569153943234],[32.599943946755786,-14.170617831547645],[32.599945777775474,-14.170707646840356],[32.59994028921301,-14.170797319140943],[32.59992751704135,-14.170886282775712],[32.59990754040069,-14.170973974769083],[32.59988048609562,-14.171059841138685],[32.5998465258965,-14.171143339593414],[32.59980587384205,-14.17122394043247],[32.59975878713834,-14.171301135538954],[32.59970556346104,-14.171374436580948],[32.59964653915648,-14.171443379508332],[32.59958208744342,-14.171507529049165],[32.59951261571467,-14.171566479609282],[32.59943856373877,-14.171619858869349],[32.59936039916312,-14.171667327784915],[32.599278615715605,-14.17170858778104],[32.59919373140565,-14.17174337715511],[32.599106283128485,-14.171771477371749],[32.59901682216866,-14.171792708566613],[32.59892591599828,-14.171806937640042],[32.5988341383848,-14.171814074659776],[32.59874206939105,-14.171814074659776],[32.598650291777574,-14.171806937640042],[32.59855938470787,-14.171792708566613],[32.59846992464736,-14.171771477371749],[32.59838247547094,-14.17174337715511],[32.5983273353383,-14.17172077809141],[32.59831050992216,-14.17173505572822],[32.59823645704688,-14.17178843408891],[32.59815829247128,-14.171835903903796],[32.59807650992303,-14.171877163899921],[32.597991625613076,-14.17191195327399],[32.59790417643665,-14.17194005259131],[32.597814715476765,-14.171961283786173],[32.59772380930639,-14.171975513758923],[32.59763203169297,-14.171982650778657],[32.59753996269916,-14.171982650778657],[32.59744818508574,-14.171975513758923],[32.597357278016034,-14.171961283786173],[32.59726781795547,-14.17194005259131],[32.59718036877905,-14.17191195327399],[32.597125046084045,-14.171889279566528],[32.59711651511515,-14.171899244054828],[32.59705206340203,-14.171963393595718],[32.59698259167334,-14.172022344155835],[32.59690853879806,-14.172075722516524],[32.59683037422246,-14.172123192331412],[32.596748590774894,-14.172164452327593],[32.596669124880236,-14.172197021275451],[32.59666535402294,-14.172199310949395],[32.596583571474696,-14.172240570945519],[32.59649868716474,-14.172275360319588],[32.59641123798832,-14.172303459636908],[32.596321777028436,-14.172324691731092],[32.59623087085805,-14.172338920804519],[32.59613909234531,-14.172346057824257],[32.5960470233515,-14.172346057824257],[32.595955245738025,-14.172338920804519],[32.59586433866832,-14.172324691731092],[32.595803283694636,-14.172310200954938],[32.59573533092083,-14.172367862786585],[32.59566127804561,-14.172421241147333],[32.59558311346996,-14.172468710062901],[32.59551500691208,-14.172503069560946],[32.59545514174147,-14.172546221730727],[32.59537697626649,-14.172593691545558],[32.59529519371824,-14.172634951541738],[32.59521030850897,-14.17266974091575],[32.59512285933255,-14.17269784023307],[32.59503339927198,-14.172719072327254],[32.59494249220228,-14.172733301400683],[32.59485071368954,-14.172740438420476],[32.59475864469573,-14.172740438420476],[32.59466686618299,-14.172733301400683],[32.594575960012605,-14.172719072327254],[32.59448649905272,-14.17269784023307],[32.59445585105675,-14.172687992656677],[32.59442677507565,-14.172690253552332],[32.59433470518257,-14.172690253552332],[32.5942429275691,-14.17268311653254],[32.59415202049939,-14.172668887459167],[32.594062559539566,-14.172647656264303],[32.59397511036309,-14.172619556946927],[32.593890226053134,-14.172584766673594],[32.59380844260562,-14.17254350667747],[32.593730278029966,-14.172496037761903],[32.593656225154746,-14.172442658501836],[32.593586753425996,-14.17238370794172],[32.593567544806376,-14.172364589254355],[32.59351203505241,-14.172317486362884],[32.593447582440035,-14.172253336821994],[32.59338855813547,-14.17218439389461],[32.593335334458175,-14.172111092852617],[32.59328824685514,-14.172033897746132],[32.59324759480069,-14.171953296907077],[32.593213634601625,-14.171869799351725],[32.5931865802965,-14.171783932082747],[32.5931666036559,-14.171696240089375],[32.59315383148419,-14.171607276454608],[32.59314834292172,-14.171517604154076],[32.5931501739414,-14.171427788861308],[32.59315931285203,-14.17133840074655],[32.59317570119771,-14.17125000278537],[32.59319923555631,-14.171163155255385],[32.59322976753981,-14.17107840584373],[32.593267104693155,-14.170996292344967],[32.59331100869616,-14.170917331869305],[32.59336120435614,-14.170842024439821],[32.59341737331317,-14.170770846697167],[32.59347916123437,-14.170704248302341],[32.59354617601525,-14.17064265013812],[32.593617994075196,-14.170586440711643],[32.593694163055204,-14.170535977952964],[32.59377420001937,-14.170491578423535],[32.593857599548635,-14.170453523611172],[32.59394383374098,-14.170422054534129],[32.594032357607254,-14.170397369942634],[32.594122611769194,-14.170379625419342],[32.594214026056534,-14.170368934278827],[32.5943060213059,-14.170365362171708],[32.59439801655525,-14.170368934278827],[32.594402085987554,-14.170369410020214],[32.59439156302028,-14.170336010998085],[32.594371587279,-14.170248319004656],[32.594358814207965,-14.17015935536989],[32.59435618369099,-14.170116383963887],[32.594347703084054,-14.170089466355762],[32.59432772734277,-14.170001773463014],[32.594314954271795,-14.169912809828245],[32.59430946660865,-14.169823137527715],[32.59431129672901,-14.169733323134324],[32.594320435639645,-14.169643934120245],[32.594336823985316,-14.16955553615901],[32.59436035834392,-14.169468688629022],[32.59439089032736,-14.169383940116688],[32.59442822658144,-14.16930182571866],[32.59447213148371,-14.169222865243],[32.59452232624443,-14.169147557813517],[32.59457849520146,-14.169076380070862],[32.59464028132396,-14.169009781676039],[32.5947072961049,-14.168948183511816],[32.59477911416485,-14.168891974984604],[32.59485528224553,-14.168841511326661],[32.59493531831032,-14.168797111797232],[32.595018716940274,-14.168759056984868],[32.59510495113261,-14.168727587907824],[32.595193474099574,-14.168702903316273],[32.5952837282615,-14.168685158792982],[32.59537514075021,-14.168674467652522],[32.59545842696491,-14.168671234589736],[32.5954623282239,-14.168656837343121],[32.5954928602074,-14.168572088830786],[32.595530195562105,-14.168489974432703],[32.59557410046443,-14.168411013957098],[32.595624295225086,-14.168335707426932],[32.595680463282804,-14.168264529684278],[32.59574225030468,-14.168197930390136],[32.595809264186244,-14.168136332225913],[32.59588108224619,-14.1680801236987],[32.59595725032687,-14.168029660040759],[32.596033266422175,-14.16798749083],[32.59606430112666,-14.167931676205853],[32.59611449588732,-14.16785636877637],[32.59617066394503,-14.167785191033715],[32.59623245006759,-14.167718592638892],[32.59629946394915,-14.167656993575347],[32.596371282009095,-14.167600785048137],[32.596447450089784,-14.167550322289514],[32.59652748525531,-14.167505922760085],[32.59661088388526,-14.167467867947721],[32.59669711717828,-14.167436398870677],[32.59678564014524,-14.167411714279126],[32.59687589340779,-14.167393969755835],[32.5969673058965,-14.167383278615375],[32.59705930024654,-14.1673797065082],[32.597151294596635,-14.167383278615375],[32.59724270708534,-14.167393969755835],[32.5973329603479,-14.167411714279126],[32.59742148331486,-14.167436398870677],[32.59746305357709,-14.16745156953425],[32.59747073828402,-14.167423210312847],[32.59750126936814,-14.167338461800512],[32.597508451353974,-14.167322665208815],[32.59752348801862,-14.167280928571927],[32.59752577679319,-14.16727248213931],[32.59755630787737,-14.167187732727655],[32.59759364413145,-14.16710561832957],[32.5976375481344,-14.16702665875323],[32.59768774289506,-14.166951351323744],[32.59774391095277,-14.16688017358109],[32.59780569707533,-14.166813574287005],[32.59787271005757,-14.166751976122782],[32.59794452811752,-14.16669576759557],[32.598020695298885,-14.166645303937571],[32.59810073136373,-14.166600904408142],[32.59818412909431,-14.166562850495096],[32.598270361488055,-14.166531381418054],[32.598358884455024,-14.166506696826557],[32.59844913681826,-14.166488952303268],[32.59852580672065,-14.166479984263844],[32.598559981857704,-14.166473265428806],[32.598651394346405,-14.166462574288346],[32.598743387797185,-14.166459002181169],[32.59883538214722,-14.166462574288346],[32.59892679373661,-14.166473265428806],[32.599017046999165,-14.166491009952097],[32.59910556996613,-14.166515694543648],[32.599191802359826,-14.166547163620635],[32.59927520009046,-14.166585218433056],[32.599355236155304,-14.166629617962426],[32.599431403336666,-14.166680081620425],[32.5995032204973,-14.16673629014764],[32.59957023437886,-14.166797888311862],[32.59963202050142,-14.16686448670663],[32.59968818855913,-14.166935664449284],[32.59973838331979,-14.167010971878824],[32.59978228732274,-14.167089932354429],[32.5998196226775,-14.167172046752512],[32.59985015466094,-14.167256795264848],[32.5998736890196,-14.167343642794833],[32.59989007736522,-14.167432040756012]]]]},\"properties\":{\"uid\":\"41587456-b7c8-4c4e-b433-23a786f742fc\",\"code\":\"3734\",\"type\":\"Intervention Unit\",\"status\":\"Active\",\"parentId\":\"21\",\"name\":\"01_5\",\"geographicLevel\":4,\"effectiveStartDate\":\"2015-01-01T0000\",\"version\":0}}"; + private PhysicalLocationService locationService; + private LocationRepository locationRepository; + private HashOperations> hashOps; + private RedisTemplate redisTemplate; + private PractitionerService practitionerService; + private OrganizationService organizationService; + private ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(PhysicalLocation.class); + + @Before + public void setUp() { + locationRepository = mock(LocationRepository.class); + practitionerService = mock(PractitionerService.class); + organizationService = mock(OrganizationService.class); + locationService = new PhysicalLocationService(); + locationService.setLocationRepository(locationRepository); + locationService.setOrganizationService(organizationService); + locationService.setPractitionerService(practitionerService); + hashOps = mock(HashOperations.class); + redisTemplate = mock(RedisTemplate.class); + Whitebox.setInternalState(locationService, "hashOps", hashOps); + Whitebox.setInternalState(locationService, "redisTemplate", redisTemplate); + } + + @Test + public void testGetLocation() { + when(locationRepository.get("3734", true, false)).thenReturn(createLocation()); + PhysicalLocation parentLocation = locationService.getLocation("3734", true, false); + verify(locationRepository).get("3734", true, false); + verifyLocationData(parentLocation); + + } + + @Test + public void testGetLocationWithVersion() { + when(locationRepository.get("3734", true, 0)).thenReturn(createLocation()); + PhysicalLocation parentLocation = locationService.getLocation("3734", true, 0); + verify(locationRepository).get("3734", true, 0); + verifyLocationData(parentLocation); + } + + private void verifyLocationData(PhysicalLocation parentLocation) { + verifyNoMoreInteractions(locationRepository); + assertEquals("3734", parentLocation.getId()); + assertEquals("Feature", parentLocation.getType()); + assertEquals(GeometryType.MULTI_POLYGON, parentLocation.getGeometry().getType()); + + assertEquals("21", parentLocation.getProperties().getParentId()); + assertEquals("01_5", parentLocation.getProperties().getName()); + assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", parentLocation.getProperties().getUid()); + assertEquals("3734", parentLocation.getProperties().getCode()); + + assertFalse(parentLocation.getGeometry().getCoordinates().isJsonNull()); + JsonArray coordinates = parentLocation.getGeometry().getCoordinates().get(0).getAsJsonArray().get(0) + .getAsJsonArray(); + assertEquals(267, coordinates.size()); + + JsonArray coordinate1 = coordinates.get(0).getAsJsonArray(); + assertEquals(32.59989007736522, coordinate1.get(0).getAsDouble(), 0); + assertEquals(-14.167432040756012, coordinate1.get(1).getAsDouble(), 0); + + JsonArray coordinate67 = coordinates.get(66).getAsJsonArray(); + assertEquals(32.5988341383848, coordinate67.get(0).getAsDouble(), 0); + assertEquals(-14.171814074659776, coordinate67.get(1).getAsDouble(), 0); + } + + @Test + public void testGetStructure() throws ParseException { + + when(locationRepository.getStructure("90397", true)).thenReturn(createStructure()); + PhysicalLocation structure = locationService.getStructure("90397", true); + verify(locationRepository).getStructure("90397", true); + verifyNoMoreInteractions(locationRepository); + + assertEquals("Feature", structure.getType()); + assertEquals("90397", structure.getId()); + + assertEquals(GeometryType.POLYGON, structure.getGeometry().getType()); + assertFalse(structure.getGeometry().getCoordinates().isJsonNull()); + + assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", structure.getProperties().getUid()); + assertEquals("21384443", structure.getProperties().getCode()); + assertEquals("Residential Structure", structure.getProperties().getType()); + assertEquals(PropertyStatus.ACTIVE, structure.getProperties().getStatus()); + assertEquals("3734", structure.getProperties().getParentId()); + assertNull(structure.getProperties().getName()); + assertEquals(5, structure.getProperties().getGeographicLevel()); + assertEquals(new SimpleDateFormat("yyyy-MM-dd").parse("2017-01-10"), + structure.getProperties().getEffectiveStartDate()); + assertNull(structure.getProperties().getEffectiveEndDate()); + assertEquals(0, structure.getProperties().getVersion()); + } + + @Test + public void testGetAllLocations() { + List expected = new ArrayList<>(); + expected.add(createLocation()); + when(locationRepository.getAll()).thenReturn(expected); + List locations = locationService.getAllLocations(); + verify(locationRepository).getAll(); + verifyNoMoreInteractions(locationRepository); + + assertEquals(1, locations.size()); + PhysicalLocation parentLocation = locations.get(0); + assertEquals("3734", parentLocation.getId()); + assertEquals("Feature", parentLocation.getType()); + assertEquals(GeometryType.MULTI_POLYGON, parentLocation.getGeometry().getType()); + + assertEquals("21", parentLocation.getProperties().getParentId()); + assertEquals("01_5", parentLocation.getProperties().getName()); + assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", parentLocation.getProperties().getUid()); + assertEquals("3734", parentLocation.getProperties().getCode()); + } + + @Test + public void testAddOrUpdateShouldAddLocation() { + when(locationRepository.get("3734")).thenReturn(null); + locationService.addOrUpdate(createLocation()); + verify(locationRepository).add(argumentCaptor.capture()); + + PhysicalLocation parentLocation = argumentCaptor.getValue(); + assertEquals("3734", parentLocation.getId()); + assertEquals("Feature", parentLocation.getType()); + assertEquals(GeometryType.MULTI_POLYGON, parentLocation.getGeometry().getType()); + + assertEquals("21", parentLocation.getProperties().getParentId()); + assertEquals("01_5", parentLocation.getProperties().getName()); + assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", parentLocation.getProperties().getUid()); + assertEquals("3734", parentLocation.getProperties().getCode()); + + } + + @Test + public void testAddOrUpdateShouldUpdateLocation() { + PhysicalLocation physicalLocation = createLocation(); + when(locationRepository.get("3734", true, false)).thenReturn(physicalLocation); + when(locationRepository.findLocationByIdentifierAndStatus("3734", Arrays.asList(ACTIVE.name(), PENDING_REVIEW.name()), true)).thenReturn(physicalLocation); + locationService.addOrUpdate(createLocation()); + verify(locationRepository).update(argumentCaptor.capture()); + + PhysicalLocation parentLocation = argumentCaptor.getValue(); + assertEquals("3734", parentLocation.getId()); + assertEquals("Feature", parentLocation.getType()); + assertEquals(GeometryType.MULTI_POLYGON, parentLocation.getGeometry().getType()); + + assertEquals("21", parentLocation.getProperties().getParentId()); + assertEquals("01_5", parentLocation.getProperties().getName()); + assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", parentLocation.getProperties().getUid()); + assertEquals("3734", parentLocation.getProperties().getCode()); + + } + + @Test(expected = IllegalArgumentException.class) + public void testAddOrUpdateWithNullId() { + PhysicalLocation physicalLocation = createLocation(); + physicalLocation.setId(null); + locationService.addOrUpdate(physicalLocation); + + } + + @Test + public void testAddOrUpdateShouldAddStructure() throws ParseException { + when(locationRepository.getStructure("90397", true)).thenReturn(null); + locationService.addOrUpdate(createStructure()); + verify(locationRepository).add(argumentCaptor.capture()); + + PhysicalLocation structure = argumentCaptor.getValue(); + + assertEquals(GeometryType.POLYGON, structure.getGeometry().getType()); + assertFalse(structure.getGeometry().getCoordinates().isJsonNull()); + + assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", structure.getProperties().getUid()); + assertEquals("21384443", structure.getProperties().getCode()); + assertEquals("Residential Structure", structure.getProperties().getType()); + assertEquals(PropertyStatus.ACTIVE, structure.getProperties().getStatus()); + assertEquals("3734", structure.getProperties().getParentId()); + assertNull(structure.getProperties().getName()); + assertEquals(5, structure.getProperties().getGeographicLevel()); + assertEquals(new SimpleDateFormat("yyyy-MM-dd").parse("2017-01-10"), + structure.getProperties().getEffectiveStartDate()); + assertNull(structure.getProperties().getEffectiveEndDate()); + assertEquals(0, structure.getProperties().getVersion()); + } + + @Test + public void testAddOrUpdateShouldUpdateStructure() throws ParseException { + PhysicalLocation physicalLocation = createStructure(); + when(locationRepository.getStructure("90397", true)).thenReturn(physicalLocation); + locationService.addOrUpdate(physicalLocation); + verify(locationRepository).update(argumentCaptor.capture()); + + PhysicalLocation structure = argumentCaptor.getValue(); + + assertEquals(GeometryType.POLYGON, structure.getGeometry().getType()); + assertFalse(structure.getGeometry().getCoordinates().isJsonNull()); + + assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", structure.getProperties().getUid()); + assertEquals("21384443", structure.getProperties().getCode()); + assertEquals("Residential Structure", structure.getProperties().getType()); + assertEquals(PropertyStatus.ACTIVE, structure.getProperties().getStatus()); + assertEquals("3734", structure.getProperties().getParentId()); + assertNull(structure.getProperties().getName()); + assertEquals(5, structure.getProperties().getGeographicLevel()); + assertEquals(new SimpleDateFormat("yyyy-MM-dd").parse("2017-01-10"), + structure.getProperties().getEffectiveStartDate()); + assertNull(structure.getProperties().getEffectiveEndDate()); + assertEquals(0, structure.getProperties().getVersion()); + + } + + @Test + public void testAdd() { + PhysicalLocation expected = createStructure(); + locationService.add(expected); + verify(locationRepository).add(argumentCaptor.capture()); + + PhysicalLocation structure = argumentCaptor.getValue(); + + assertEquals(GeometryType.POLYGON, structure.getGeometry().getType()); + assertFalse(structure.getGeometry().getCoordinates().isJsonNull()); + + assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", structure.getProperties().getUid()); + assertEquals("21384443", structure.getProperties().getCode()); + assertEquals("Residential Structure", structure.getProperties().getType()); + + } + + @Test(expected = IllegalArgumentException.class) + public void testAddWithNullId() { + PhysicalLocation physicalLocation = new PhysicalLocation(); + locationService.add(physicalLocation); + } + + @Test + public void testUpdate() { + PhysicalLocation expected = createLocation(); + locationService.update(expected); + verify(locationRepository).update(argumentCaptor.capture()); + + PhysicalLocation parentLocation = argumentCaptor.getValue(); + assertEquals("3734", parentLocation.getId()); + assertEquals("Feature", parentLocation.getType()); + assertEquals(GeometryType.MULTI_POLYGON, parentLocation.getGeometry().getType()); + + assertEquals("21", parentLocation.getProperties().getParentId()); + assertEquals("01_5", parentLocation.getProperties().getName()); + assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", parentLocation.getProperties().getUid()); + assertEquals("3734", parentLocation.getProperties().getCode()); + + } + + @Test(expected = IllegalArgumentException.class) + public void testUpdateWithNullId() { + PhysicalLocation physicalLocation = new PhysicalLocation(); + locationService.update(physicalLocation); + } + + @Test + public void testFindLocationsByServerVersion() { + List expected = new ArrayList<>(); + expected.add(createLocation()); + when(locationRepository.findLocationsByServerVersion(123l)).thenReturn(expected); + + List locations = locationService.findLocationsByServerVersion(123l); + verify(locationRepository).findLocationsByServerVersion(123l); + verifyNoMoreInteractions(locationRepository); + + assertEquals(1, locations.size()); + PhysicalLocation parentLocation = locations.get(0); + assertEquals("3734", parentLocation.getId()); + assertEquals("Feature", parentLocation.getType()); + assertEquals(GeometryType.MULTI_POLYGON, parentLocation.getGeometry().getType()); + + assertEquals("21", parentLocation.getProperties().getParentId()); + assertEquals("01_5", parentLocation.getProperties().getName()); + assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", parentLocation.getProperties().getUid()); + assertEquals("3734", parentLocation.getProperties().getCode()); + + } + + @Test + public void testFindLocationsByNames() { + String locationNames = "01_5"; + List expected = new ArrayList<>(); + List locations; + + locations = locationService.findLocationsByNames(locationNames, 0l); + assertEquals(0, locations.size()); + + expected.add(createLocation()); + when(locationService.findLocationsByNames(locationNames, 0l)).thenReturn(expected); + locations = locationService.findLocationsByNames(locationNames, 0l); + assertEquals(1, locations.size()); + PhysicalLocation location = locations.get(0); + assertEquals("01_5", location.getProperties().getName()); + assertEquals("Feature", location.getType()); + assertEquals("3734", location.getId()); + assertEquals(GeometryType.MULTI_POLYGON, location.getGeometry().getType()); + + // search with more than one name + locationNames = "01_5,other_location_name"; + when(locationService.findLocationsByNames(locationNames, 0l)).thenReturn(expected); + locations = locationService.findLocationsByNames(locationNames, 0l); + assertEquals(1, locations.size()); + location = locations.get(0); + assertEquals("01_5", location.getProperties().getName()); + assertEquals("Feature", location.getType()); + assertEquals("3734", location.getId()); + assertEquals(GeometryType.MULTI_POLYGON, location.getGeometry().getType()); + + } + + @Test + public void testFindStructuresByParentAndServerVersion() { + + List expected = new ArrayList<>(); + expected.add(createStructure()); + + when(locationRepository.findStructuresByParentAndServerVersion("3734", 15622112121L)).thenReturn(expected); + + List locations = locationService.findStructuresByParentAndServerVersion("3734", 15622112121L); + verify(locationRepository).findStructuresByParentAndServerVersion("3734", 15622112121L); + verifyNoMoreInteractions(locationRepository); + + assertEquals(1, locations.size()); + PhysicalLocation structure = locations.get(0); + + assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", structure.getProperties().getUid()); + assertEquals("21384443", structure.getProperties().getCode()); + assertEquals("Residential Structure", structure.getProperties().getType()); + + when(locationRepository.findStructuresByParentAndServerVersion("3734,001", 15622112121L)).thenReturn(expected); + locations = locationService.findStructuresByParentAndServerVersion("3734,001", 15622112121L); + verify(locationRepository).findStructuresByParentAndServerVersion("3734,001", 15622112121L); + verifyNoMoreInteractions(locationRepository); + assertEquals(1, locations.size()); + structure = locations.get(0); + assertEquals("41587456-b7c8-4c4e-b433-23a786f742fc", structure.getProperties().getUid()); + assertEquals("21384443", structure.getProperties().getCode()); + assertEquals("Residential Structure", structure.getProperties().getType()); + + } + + @Test(expected = IllegalArgumentException.class) + public void testFindStructuresByParentAndServerVersionWithoutParentID() { + + locationService.findStructuresByParentAndServerVersion("", 15622112121L); + + } + + @Test + public void testSaveLocations() { + List expectedLocations = new ArrayList<>(); + PhysicalLocation physicalLocation = createStructure(); + physicalLocation.setId("12323"); + expectedLocations.add(physicalLocation); + expectedLocations.add(createStructure()); + expectedLocations.add(createStructure()); + + when(locationRepository.get("12323", true, false)).thenReturn(physicalLocation); + locationService.saveLocations(expectedLocations, true); + + verify(locationRepository, times(2)).add(argumentCaptor.capture()); + verify(locationRepository, times(1)).update(argumentCaptor.capture()); + for (PhysicalLocation location : argumentCaptor.getAllValues()) { + assertTrue(location.isJurisdiction()); + } + + } + + @Test + public void testFindStructuresWithinRadius() { + + double latitude = -14.1619809; + double longitude = 32.5978597; + + Collection expectedDetails = new ArrayList<>(); + + StructureDetails structure = new StructureDetails(UUID.randomUUID().toString(), "3221", "Mosquito Point"); + expectedDetails.add(structure); + + when(locationRepository.findStructureAndFamilyDetails(Mockito.anyDouble(), Mockito.anyDouble(), Mockito.anyDouble())) + .thenReturn(expectedDetails); + Collection detailsFromService = locationService.findStructuresWithinRadius(latitude, longitude, + 1000); + + assertEquals(expectedDetails, detailsFromService); + verify(locationRepository).findStructureAndFamilyDetails(latitude, longitude, 1000); + + } + + @Test + public void testFindLocationsByProperties() { + List expectedLocations = Collections.singletonList(createLocation()); + + String parentId = UUID.randomUUID().toString(); + Map properties = new HashMap<>(); + when(locationRepository.findLocationsByProperties(true, parentId, properties)).thenReturn(expectedLocations); + List locations = locationService.findLocationsByProperties(true, parentId, properties); + verify(locationRepository).findLocationsByProperties(true, parentId, properties); + assertEquals(1, locations.size()); + assertEquals(expectedLocations, locations); + + } + + @Test + public void testFindStructuresByProperties() { + List expectedLocations = Collections.singletonList(createStructure()); + String parentId = UUID.randomUUID().toString(); + Map properties = new HashMap<>(); + when(locationRepository.findStructuresByProperties(false, parentId, properties)).thenReturn(expectedLocations); + List locations = locationService.findStructuresByProperties(false, parentId, properties); + verify(locationRepository).findStructuresByProperties(false, parentId, properties); + assertEquals(1, locations.size()); + assertEquals(expectedLocations, locations); + } + + @Test + public void testFindLocationsById() { + List expectedLocations = Collections.singletonList(createLocation()); + + List locationIds = new ArrayList<>(); + when(locationRepository.findLocationsByIds(true, locationIds, null)).thenReturn(expectedLocations); + List locations = locationService.findLocationsByIds(true, locationIds); + verify(locationRepository).findLocationsByIds(true, locationIds, null); + assertEquals(1, locations.size()); + assertEquals(expectedLocations, locations); + + } + + @Test + public void testFindLocationsByIdWithServerVersion() { + List expectedLocations = Collections.singletonList(createLocation()); + + List locationIds = Arrays.asList("id1", "Id2"); + long serverVersion = 1234; + when(locationRepository.findLocationsByIds(true, locationIds, serverVersion)).thenReturn(expectedLocations); + List locations = locationService.findLocationsByIds(true, locationIds, serverVersion); + verify(locationRepository).findLocationsByIds(true, locationIds, serverVersion); + assertEquals(1, locations.size()); + assertEquals(expectedLocations, locations); + + } + + @Test + public void testFindAllStructureIds() { + List expectedStructureIds = new ArrayList<>(); + expectedStructureIds.add("Structure-1"); + expectedStructureIds.add("Structure-2"); + Pair, Long> idsModel = Pair.of(expectedStructureIds, 1234l); + + when(locationRepository.findAllStructureIds(anyLong(), anyInt())).thenReturn(idsModel); + Pair, Long> actualIdModels = locationService.findAllStructureIds(0l, 2); + + List actualStructureIds = actualIdModels.getLeft(); + + verify(locationRepository).findAllStructureIds(0l, 2); + assertEquals(2, actualStructureIds.size()); + assertEquals(expectedStructureIds.get(0), actualStructureIds.get(0)); + assertEquals(expectedStructureIds.get(1), actualStructureIds.get(1)); + + } + + @Test + public void testFindLocationDetailsByPlanId() { + Set expectedLocationDetails = new HashSet<>(); + LocationDetail locationDetail = LocationDetail.builder().identifier("identifier-1").name("location-one").build(); + expectedLocationDetails.add(locationDetail); + + when(locationRepository.findLocationDetailsByPlanId("identifier-1")).thenReturn(expectedLocationDetails); + Set actualLocationDetails = locationService.findLocationDetailsByPlanId("identifier-1"); + + verify(locationRepository).findLocationDetailsByPlanId(anyString()); + assertEquals(1, actualLocationDetails.size()); + LocationDetail actuallocationDetail = actualLocationDetails.iterator().next(); + assertEquals(actuallocationDetail.getIdentifier(), "identifier-1"); + assertEquals(actuallocationDetail.getName(), "location-one"); + + } + + @Test + public void testFindAllLocationIds() { + List expectedLocationIds = new ArrayList<>(); + expectedLocationIds.add("Location-1"); + expectedLocationIds.add("Location-2"); + Pair, Long> idsModel = Pair.of(expectedLocationIds, 1234l); + + when(locationRepository.findAllLocationIds(anyLong(), anyInt())).thenReturn(idsModel); + Pair, Long> actualIdsModelList = locationService.findAllLocationIds(0l, 10); + + List actualLocationIds = actualIdsModelList.getLeft(); + verify(locationRepository).findAllLocationIds(0l, 10); + assertEquals(2, actualLocationIds.size()); + assertEquals(expectedLocationIds.get(0), actualLocationIds.get(0)); + assertEquals(expectedLocationIds.get(1), actualLocationIds.get(1)); + assertEquals(1234l, actualIdsModelList.getRight().longValue()); + + } + + private PhysicalLocation createLocation() { + PhysicalLocation parentLocation = gson.fromJson(parentJson, PhysicalLocation.class); + parentLocation.setJurisdiction(true); + return parentLocation; + } + + private PhysicalLocation createStructure() { + return gson.fromJson(structureJson, PhysicalLocation.class); + } + + @Test + public void testSearchlLocationsWithFilters() { + LocationSearchBean locationSearchBean = new LocationSearchBean(); + locationSearchBean.setName("a"); + locationSearchBean.setLocationTagId(2l); + locationSearchBean.setPageSize(20); + List expectedLocations = new ArrayList<>(); + expectedLocations.add(createLocation()); + when(locationRepository.searchLocations(locationSearchBean)).thenReturn(expectedLocations); + List actutalLocations = locationService.searchLocations(locationSearchBean); + verify(locationRepository).searchLocations(locationSearchBean); + assertEquals(1, actutalLocations.size()); + assertEquals("Feature", actutalLocations.get(0).getType()); + } + + @Test + public void testShouldSearchCountLocation() { + LocationSearchBean locationSearchBean = new LocationSearchBean(); + when(locationRepository.countSearchLocations(locationSearchBean)).thenReturn(1); + int actutalLocations = locationService.countSearchLocations(locationSearchBean); + verify(locationRepository).countSearchLocations(locationSearchBean); + assertEquals(1, actutalLocations); + } + + @Test + public void testbuildLocationHierachy() { + Set identifiers = new HashSet<>(Arrays.asList("1234", "21")); + Set locationDetails = new HashSet<>(); + LocationDetail kenya = LocationDetail.builder().name("Kenya").id(1l).identifier("254").tags("Country").build(); + LocationDetail nairobi = LocationDetail.builder().name("Nairobi").id(2l).identifier("252-020").parentId("254") + .tags("City,Zone").build(); + locationDetails.add(kenya); + locationDetails.add(nairobi); + when(locationRepository.findParentLocationsInclusive(identifiers, false)).thenReturn(locationDetails); + LocationTree tree = locationService.buildLocationHierachy(identifiers, false, false); + verify(locationRepository).findParentLocationsInclusive(identifiers, false); + assertNotNull(tree); + assertEquals(1, tree.getLocationsHierarchy().size()); + TreeNode countryNode = tree.getLocationsHierarchy().get(kenya.getIdentifier()); + assertNotNull(countryNode); + assertEquals(kenya.getIdentifier(), countryNode.getId()); + assertEquals(kenya.getName(), countryNode.getLabel()); + assertNull(countryNode.getParent()); + assertEquals(kenya.getTags(), countryNode.getNode().getTags().iterator().next()); + assertEquals(1, countryNode.getChildren().size()); + + TreeNode cityNode = countryNode.getChildren().get(nairobi.getIdentifier()); + assertNotNull(cityNode); + assertEquals(nairobi.getIdentifier(), cityNode.getId()); + assertEquals(nairobi.getName(), cityNode.getLabel()); + assertNull(cityNode.getChildren()); + assertEquals(kenya.getIdentifier(), cityNode.getParent()); + + Set tags = cityNode.getNode().getTags(); + assertEquals(2, tags.size()); + assertTrue(tags.contains("City")); + assertTrue(tags.contains("Zone")); + + } + + @Test + public void testCountStructuresByParentAndServerVersion() { + + when(locationRepository.countStructuresByParentAndServerVersion("3734", 15622112121L)).thenReturn(12l); + + Long locations = locationService.countStructuresByParentAndServerVersion("3734", 15622112121L); + verify(locationRepository).countStructuresByParentAndServerVersion("3734", 15622112121L); + verifyNoMoreInteractions(locationRepository); + + assertEquals(12, locations.longValue()); + + when(locationRepository.countStructuresByParentAndServerVersion("3734,001", 15622112121L)).thenReturn(15l); + locations = locationService.countStructuresByParentAndServerVersion("3734,001", 15622112121L); + verify(locationRepository).countStructuresByParentAndServerVersion("3734,001", 15622112121L); + verifyNoMoreInteractions(locationRepository); + assertEquals(15, locations.longValue()); + } + + @Test + public void testCountFindLocationsByServerVersion() { + when(locationRepository.countLocationsByServerVersion(123l)).thenReturn(4l); + + Long locations = locationService.countLocationsByServerVersion(123l); + verify(locationRepository).countLocationsByServerVersion(123l); + verifyNoMoreInteractions(locationRepository); + + assertEquals(4, locations.longValue()); + + } + + @Test + public void testCountLocationsByNames() { + String locationNames = "01_5"; + Long locations = locationService.countLocationsByNames(locationNames, 0l); + assertEquals(0, locations.longValue()); + + when(locationService.countLocationsByNames(locationNames, 0l)).thenReturn(3l); + locations = locationService.countLocationsByNames(locationNames, 0l); + assertEquals(3, locations.longValue()); + + // search with more than one name + locationNames = "01_5,other_location_name"; + when(locationService.countLocationsByNames(locationNames, 0l)).thenReturn(2l); + locations = locationService.countLocationsByNames(locationNames, 0l); + assertEquals(2, locations.longValue()); + + } + + @Test + public void testBuildLocationHierachyFromLocation() { + String locationId = "1"; + + Set locationDetails = new HashSet<>(); + + LocationDetail country = LocationDetail.builder().name("Country 1").id(2l).identifier("1").tags("Country").build(); + LocationDetail province1 = LocationDetail.builder().name("Province 1").id(3l).identifier("11").parentId("1") + .tags("Province").build(); + LocationDetail province2 = LocationDetail.builder().name("Province 2").id(4l).identifier("12").parentId("1") + .tags("Province").build(); + LocationDetail district1 = LocationDetail.builder().name("District 1").id(5l).identifier("111").parentId("11") + .tags("District").build(); + LocationDetail district2 = LocationDetail.builder().name("District 2").id(6l).identifier("121").parentId("12") + .tags("District").build(); + LocationDetail district3 = LocationDetail.builder().name("District 3").id(7l).identifier("122").parentId("12") + .tags("District").build(); + + locationDetails.add(country); + locationDetails.add(province1); + locationDetails.add(province2); + locationDetails.add(district1); + locationDetails.add(district2); + locationDetails.add(district3); + + Boolean returnTags = false; + + when(locationRepository.findLocationWithDescendants(locationId, returnTags)).thenReturn(locationDetails); + + LocationTree tree = locationService.buildLocationHierachyFromLocation(locationId, false); + + verify(locationRepository).findLocationWithDescendants(locationId, returnTags); + assertNotNull(tree); + assertEquals(1, tree.getLocationsHierarchy().size()); + + TreeNode level0Node = tree.getLocationsHierarchy().get(country.getIdentifier()); + assertNotNull(level0Node); + assertEquals(country.getIdentifier(), level0Node.getId()); + assertEquals(country.getName(), level0Node.getLabel()); + assertNull(level0Node.getParent()); + assertEquals(country.getTags(), level0Node.getNode().getTags().iterator().next()); + assertEquals(2, level0Node.getChildren().size()); + + TreeNode level1Node = level0Node.getChildren().get(province2.getIdentifier()); + assertNotNull(level1Node); + assertEquals(province2.getIdentifier(), level1Node.getId()); + assertEquals(province2.getName(), level1Node.getLabel()); + assertEquals(2, level1Node.getChildren().size()); + assertEquals(country.getIdentifier(), level1Node.getParent()); + + TreeNode level2Node = level1Node.getChildren().get(district2.getIdentifier()); + assertNotNull(level2Node); + assertEquals(district2.getIdentifier(), level2Node.getId()); + assertEquals(district2.getName(), level2Node.getLabel()); + assertNull(level2Node.getChildren()); + assertEquals(province2.getIdentifier(), level2Node.getParent()); + + Set tags = level2Node.getNode().getTags(); + assertEquals(1, tags.size()); + assertTrue(tags.contains("District")); + } + + @Test + public void testBuildLocationHierachyFromLocationWithStructureCounts() { + String locationId = "1"; + Set locationDetails = new LinkedHashSet<>(); + + LocationDetail country = LocationDetail.builder().name("Country 1").id(2l).identifier("1").tags("Country") + .geographicLevel(0).build(); + LocationDetail province1 = LocationDetail.builder().name("Province 1").id(3l).identifier("11").parentId("1") + .tags("Province").geographicLevel(1).build(); + LocationDetail province2 = LocationDetail.builder().name("Province 2").id(4l).identifier("12").parentId("1") + .tags("Province").geographicLevel(1).build(); + LocationDetail district1 = LocationDetail.builder().name("District 1").id(5l).identifier("111").parentId("11") + .tags("District").geographicLevel(2).build(); + LocationDetail district2 = LocationDetail.builder().name("District 2").id(6l).identifier("121").parentId("12") + .tags("District").geographicLevel(2).build(); + LocationDetail district3 = LocationDetail.builder().name("District 3").id(7l).identifier("122").parentId("12") + .tags("District").geographicLevel(2).build(); + LocationDetail district4 = LocationDetail.builder().name("District 4").id(8l).identifier("123").parentId("12") + .tags("District").geographicLevel(2).build(); // Test what happens when child location has no structures + + // records are ordered by level in the db query + locationDetails.add(district4); + locationDetails.add(district3); + locationDetails.add(district2); + locationDetails.add(district1); + locationDetails.add(province2); + locationDetails.add(province1); + locationDetails.add(country); + + Set locationIdentifiers = new HashSet<>(); + locationIdentifiers.add(country.getIdentifier()); + locationIdentifiers.add(province1.getIdentifier()); + locationIdentifiers.add(province2.getIdentifier()); + locationIdentifiers.add(district1.getIdentifier()); + locationIdentifiers.add(district2.getIdentifier()); + locationIdentifiers.add(district3.getIdentifier()); + locationIdentifiers.add(district4.getIdentifier()); + + when(locationRepository.findLocationWithDescendants(locationId, false)).thenReturn(locationDetails); + + List structureCounts = new ArrayList<>(); + StructureCount structureCountD1 = StructureCount.builder().parentId(district1.getIdentifier()).count(10).build(); + StructureCount structureCountD2 = StructureCount.builder().parentId(district2.getIdentifier()).count(5).build(); + StructureCount structureCountD3 = StructureCount.builder().parentId(district3.getIdentifier()).count(8).build(); + structureCounts.add(structureCountD1); + structureCounts.add(structureCountD2); + structureCounts.add(structureCountD3); + + when(locationRepository.findStructureCountsForLocation(locationIdentifiers)).thenReturn(structureCounts); + + LocationTree tree = locationService.buildLocationHierachyFromLocation(locationId, true); + + TreeNode countryNode = tree.getLocationsHierarchy().get(country.getIdentifier()); + assertNotNull(countryNode); + assertEquals(country.getIdentifier(), countryNode.getId()); + assertEquals(country.getName(), countryNode.getLabel()); + assertNull(countryNode.getParent()); + assertEquals(country.getTags(), countryNode.getNode().getTags().iterator().next()); + assertEquals(2, countryNode.getChildren().size()); + assertEquals(0, countryNode.getNode().getAttribute("geographicLevel")); + assertEquals(23, countryNode.getNode().getAttribute(STRUCTURE_COUNT)); + + TreeNode province1Node = countryNode.getChildren().get(province1.getIdentifier()); + assertNotNull(province1Node); + verifyLocationData(province1Node, province1, country, 1, true); + assertEquals(10, province1Node.getNode().getAttribute(STRUCTURE_COUNT)); + + TreeNode province2Node = countryNode.getChildren().get(province2.getIdentifier()); + verifyLocationData(province2Node, province2, country, 1, true); + assertEquals(13, province2Node.getNode().getAttribute(STRUCTURE_COUNT)); + + TreeNode district1Node = province1Node.getChildren().get(district1.getIdentifier()); + verifyLocationData(district1Node, district1, province1, 2, false); + assertEquals(10, district1Node.getNode().getAttribute(STRUCTURE_COUNT)); + + TreeNode district2Node = province2Node.getChildren().get(district2.getIdentifier()); + verifyLocationData(district2Node, district2, province2, 2, false); + assertEquals(5, district2Node.getNode().getAttribute(STRUCTURE_COUNT)); + + TreeNode district3Node = province2Node.getChildren().get(district3.getIdentifier()); + verifyLocationData(district3Node, district3, province2, 2, false); + assertEquals(8, district3Node.getNode().getAttribute(STRUCTURE_COUNT)); + } + + @Test + public void testBuildLocationHierarchy() { + Set locationDetails = new HashSet<>(); + + LocationDetail country = LocationDetail.builder().name("Country 1").id(2l).identifier("1").tags("Country") + .geographicLevel(0).build(); + LocationDetail province1 = LocationDetail.builder().name("Province 1").id(3l).identifier("11").parentId("1") + .tags("Province").geographicLevel(1).build(); + LocationDetail province2 = LocationDetail.builder().name("Province 2").id(4l).identifier("12").parentId("1") + .tags("Province").geographicLevel(1).build(); + LocationDetail district1 = LocationDetail.builder().name("District 1").id(5l).identifier("111").parentId("11") + .tags("District").geographicLevel(2).build(); + LocationDetail district2 = LocationDetail.builder().name("District 2").id(6l).identifier("121").parentId("12") + .tags("District").geographicLevel(2).build(); + LocationDetail district3 = LocationDetail.builder().name("District 3").id(7l).identifier("122").parentId("12") + .tags("District").geographicLevel(2).build(); + + locationDetails.add(country); + locationDetails.add(province1); + locationDetails.add(province2); + locationDetails.add(district1); + locationDetails.add(district2); + locationDetails.add(district3); + + Set locationIdentifiers = new HashSet<>(); + locationIdentifiers.add(district1.getIdentifier()); + locationIdentifiers.add(district2.getIdentifier()); + locationIdentifiers.add(district2.getIdentifier()); + + when(locationRepository.findParentLocationsInclusive(locationIdentifiers, true)).thenReturn(locationDetails); + + LocationTree tree = locationService.buildLocationHierachy(locationIdentifiers, false, true); + + TreeNode countryNode = tree.getLocationsHierarchy().get(country.getIdentifier()); + assertNotNull(countryNode); + assertEquals(country.getIdentifier(), countryNode.getId()); + assertEquals(country.getName(), countryNode.getLabel()); + assertNull(countryNode.getParent()); + assertEquals(country.getTags(), countryNode.getNode().getTags().iterator().next()); + assertEquals(2, countryNode.getChildren().size()); + assertNull(countryNode.getNode().getAttribute(STRUCTURE_COUNT)); + assertEquals(0, countryNode.getNode().getAttribute("geographicLevel")); + + TreeNode province1Node = countryNode.getChildren().get(province1.getIdentifier()); + assertNotNull(province1Node); + verifyLocationData(province1Node, province1, country, 1, true); + assertNull(province1Node.getNode().getAttribute(STRUCTURE_COUNT)); + + TreeNode province2Node = countryNode.getChildren().get(province2.getIdentifier()); + verifyLocationData(province2Node, province2, country, 1, true); + assertNull(province2Node.getNode().getAttribute(STRUCTURE_COUNT)); + + TreeNode district1Node = province1Node.getChildren().get(district1.getIdentifier()); + verifyLocationData(district1Node, district1, province1, 2, false); + assertNull(district1Node.getNode().getAttribute(STRUCTURE_COUNT)); + + TreeNode district2Node = province2Node.getChildren().get(district2.getIdentifier()); + verifyLocationData(district2Node, district2, province2, 2, false); + assertNull(district2Node.getNode().getAttribute(STRUCTURE_COUNT)); + + TreeNode district3Node = province2Node.getChildren().get(district3.getIdentifier()); + verifyLocationData(district3Node, district3, province2, 2, false); + assertNull(district3Node.getNode().getAttribute(STRUCTURE_COUNT)); + } + + @Test + public void testBuildLocationHierarchyWithStructureCounts() { + Set locationDetails = new LinkedHashSet<>(); + + LocationDetail country = LocationDetail.builder().name("Country 1").id(2l).identifier("1").tags("Country") + .geographicLevel(0).build(); + LocationDetail province1 = LocationDetail.builder().name("Province 1").id(3l).identifier("11").parentId("1") + .tags("Province").geographicLevel(1).build(); + LocationDetail province2 = LocationDetail.builder().name("Province 2").id(4l).identifier("12").parentId("1") + .tags("Province").geographicLevel(1).build(); + LocationDetail district1 = LocationDetail.builder().name("District 1").id(5l).identifier("111").parentId("11") + .tags("District").geographicLevel(2).build(); + LocationDetail district2 = LocationDetail.builder().name("District 2").id(6l).identifier("121").parentId("12") + .tags("District").geographicLevel(2).build(); + LocationDetail district3 = LocationDetail.builder().name("District 3").id(7l).identifier("122").parentId("12") + .tags("District").geographicLevel(2).build(); + LocationDetail district4 = LocationDetail.builder().name("District 4").id(8l).identifier("123").parentId("12") + .tags("District").geographicLevel(2).build(); // Test what happens when child not has no structures + + // records are ordered by level in the db query + locationDetails.add(district4); + locationDetails.add(district3); + locationDetails.add(district2); + locationDetails.add(district1); + locationDetails.add(province2); + locationDetails.add(province1); + locationDetails.add(country); + + Set locationIdentifiers = new HashSet<>(); + locationIdentifiers.add(country.getIdentifier()); + locationIdentifiers.add(province1.getIdentifier()); + locationIdentifiers.add(province2.getIdentifier()); + locationIdentifiers.add(district1.getIdentifier()); + locationIdentifiers.add(district2.getIdentifier()); + locationIdentifiers.add(district3.getIdentifier()); + locationIdentifiers.add(district4.getIdentifier()); + + when(locationRepository.findParentLocationsInclusive(locationIdentifiers, false)).thenReturn(locationDetails); + + List structureCounts = new ArrayList<>(); + StructureCount structureCountD1 = StructureCount.builder().parentId(district1.getIdentifier()).count(10).build(); + StructureCount structureCountD2 = StructureCount.builder().parentId(district2.getIdentifier()).count(5).build(); + StructureCount structureCountD3 = StructureCount.builder().parentId(district3.getIdentifier()).count(8).build(); + structureCounts.add(structureCountD1); + structureCounts.add(structureCountD2); + structureCounts.add(structureCountD3); + + when(locationRepository.findStructureCountsForLocation(locationIdentifiers)).thenReturn(structureCounts); + + LocationTree tree = locationService.buildLocationHierachy(locationIdentifiers, true, false); + + TreeNode countryNode = tree.getLocationsHierarchy().get(country.getIdentifier()); + assertNotNull(countryNode); + assertEquals(country.getIdentifier(), countryNode.getId()); + assertEquals(country.getName(), countryNode.getLabel()); + assertNull(countryNode.getParent()); + assertEquals(country.getTags(), countryNode.getNode().getTags().iterator().next()); + assertEquals(2, countryNode.getChildren().size()); + assertEquals(0, countryNode.getNode().getAttribute("geographicLevel")); + assertEquals(23, countryNode.getNode().getAttribute(STRUCTURE_COUNT)); + + TreeNode province1Node = countryNode.getChildren().get(province1.getIdentifier()); + assertNotNull(province1Node); + verifyLocationData(province1Node, province1, country, 1, true); + assertEquals(10, province1Node.getNode().getAttribute(STRUCTURE_COUNT)); + + TreeNode province2Node = countryNode.getChildren().get(province2.getIdentifier()); + verifyLocationData(province2Node, province2, country, 1, true); + assertEquals(13, province2Node.getNode().getAttribute(STRUCTURE_COUNT)); + + TreeNode district1Node = province1Node.getChildren().get(district1.getIdentifier()); + verifyLocationData(district1Node, district1, province1, 2, false); + assertEquals(10, district1Node.getNode().getAttribute(STRUCTURE_COUNT)); + + TreeNode district2Node = province2Node.getChildren().get(district2.getIdentifier()); + verifyLocationData(district2Node, district2, province2, 2, false); + assertEquals(5, district2Node.getNode().getAttribute(STRUCTURE_COUNT)); + + TreeNode district3Node = province2Node.getChildren().get(district3.getIdentifier()); + verifyLocationData(district3Node, district3, province2, 2, false); + assertEquals(8, district3Node.getNode().getAttribute(STRUCTURE_COUNT)); + } + + private void verifyLocationData(TreeNode node, LocationDetail locationDetail, LocationDetail parentLD, + int geographicLevel, boolean hasChildren) { + assertNotNull(node); + assertEquals(locationDetail.getIdentifier(), node.getId()); + assertEquals(locationDetail.getName(), node.getLabel()); + if (!hasChildren) { + assertNull(node.getChildren()); + } + assertEquals(parentLD.getIdentifier(), node.getParent()); + assertEquals(geographicLevel, node.getNode().getAttribute("geographicLevel")); + } + + @Test + public void testGetAssignedLocationsFromCache() { + AssignedLocations assigment = new AssignedLocations("loc1", "plan1"); + List expected = Collections.singletonList(assigment); + when(hashOps.hasKey(anyString(), any(Object.class))).thenReturn(Boolean.TRUE); + when(hashOps.get(anyString(), any(Object.class))).thenReturn(expected); + List actual = locationService.getAssignedLocations("testUser"); + assertEquals(expected.size(), actual.size()); + assertEquals(expected.get(0).getPlanId(), "plan1"); + assertEquals(expected.get(0).getJurisdictionId(), "loc1"); + } + + @Test + public void testGetAssignedLocationsFromDb() { + AssignedLocations assigment1 = new AssignedLocations("loc1", "plan1"); + assigment1.setToDate(new Date()); + AssignedLocations assigment2 = new AssignedLocations("loc2", "plan2"); + assigment2.setToDate(new Date()); + List expected = new ArrayList<>(); + expected.add(assigment1); + expected.add(assigment2); + List expectedOrganizationIds = Collections.singletonList(1234l); + Practitioner practitioner = new Practitioner(); + ImmutablePair> practitionerListImmutablePair = new ImmutablePair<>(practitioner, expectedOrganizationIds); + when(hashOps.hasKey(anyString(), any(Object.class))).thenReturn(Boolean.FALSE); + when(practitionerService.getOrganizationsByUserId(anyString())).thenReturn(practitionerListImmutablePair); + when(organizationService.findAssignedLocationsAndPlans(any(List.class))).thenReturn(expected); + when(redisTemplate.expire(anyString(), any(long.class), any(TimeUnit.class))).thenReturn(Boolean.TRUE); + + List actual = locationService.getAssignedLocations("testUser"); + assertEquals(expected.size(), actual.size()); + assertEquals(expected.get(0).getPlanId(), "plan1"); + assertEquals(expected.get(1).getPlanId(), "plan2"); + assertEquals(expected.get(0).getJurisdictionId(), "loc1"); + assertEquals(expected.get(1).getJurisdictionId(), "loc2"); + } + + @Test + public void testfindLocationByIdWithChildren() { + List expected = new ArrayList<>(); + expected.add(createLocation()); + when(locationRepository.findLocationByIdWithChildren(false, "1332232", 1000)).thenReturn(expected); + assertEquals(expected, locationService.findLocationByIdWithChildren(false, "1332232", 1000)); + verify(locationRepository).findLocationByIdWithChildren(false, "1332232", 1000); + } + + @Test + public void testfindLocationByIdsWithChildren() { + List expected = new ArrayList<>(); + expected.add(createLocation()); + Set ids = new HashSet<>(Arrays.asList("123", "23435463", "9888787")); + when(locationRepository.findLocationByIdsWithChildren(false, ids, 1000)).thenReturn(expected); + assertEquals(expected, locationService.findLocationByIdsWithChildren(false, ids, 1000)); + verify(locationRepository).findLocationByIdsWithChildren(false, ids, 1000); + } + + @Test + public void testBuildLocationHeirarchyWithAncestors() { + Set locationIds = new HashSet<>(); + String locationId = "1"; + locationIds.add(locationId); + + Set locationDetails = new HashSet<>(); + + LocationDetail country = LocationDetail.builder().name("Country 1").id(2l).identifier("1").tags("Country").build(); + LocationDetail province1 = LocationDetail.builder().name("Province 1").id(3l).identifier("11").parentId("1") + .tags("Province").build(); + LocationDetail province2 = LocationDetail.builder().name("Province 2").id(4l).identifier("12").parentId("1") + .tags("Province").build(); + LocationDetail district1 = LocationDetail.builder().name("District 1").id(5l).identifier("111").parentId("11") + .tags("District").build(); + LocationDetail district2 = LocationDetail.builder().name("District 2").id(6l).identifier("121").parentId("12") + .tags("District").build(); + LocationDetail district3 = LocationDetail.builder().name("District 3").id(7l).identifier("122").parentId("12") + .tags("District").build(); + + locationDetails.add(country); + locationDetails.add(province1); + locationDetails.add(province2); + locationDetails.add(district1); + locationDetails.add(district2); + locationDetails.add(district3); + + when(locationRepository.findParentLocationsInclusive(locationIds)).thenReturn(locationDetails); + + Set locationDetailsSet = locationService.buildLocationHeirarchyWithAncestors(locationId); + + verify(locationRepository).findParentLocationsInclusive(locationIds); + assertNotNull(locationDetailsSet); + assertEquals(6, locationDetailsSet.size()); + LocationDetail actuallocationDetail = locationDetailsSet.iterator().next(); + assertEquals("Province 1", actuallocationDetail.getName()); + assertEquals("Province", actuallocationDetail.getTags()); + } + + @Test + public void testBuildLocationTreeHierachyWithAncestors() { + Set locationIds = new HashSet<>(); + String locationId = "1"; + locationIds.add(locationId); + + Set locationDetails = new HashSet<>(); + + LocationDetail country = LocationDetail.builder().name("Country 1").id(2l).identifier("1").tags("Country").build(); + LocationDetail province1 = LocationDetail.builder().name("Province 1").id(3l).identifier("11").parentId("1") + .tags("Province").build(); + LocationDetail province2 = LocationDetail.builder().name("Province 2").id(4l).identifier("12").parentId("1") + .tags("Province").build(); + LocationDetail district1 = LocationDetail.builder().name("District 1").id(5l).identifier("111").parentId("11") + .tags("District").build(); + LocationDetail district2 = LocationDetail.builder().name("District 2").id(6l).identifier("121").parentId("12") + .tags("District").build(); + LocationDetail district3 = LocationDetail.builder().name("District 3").id(7l).identifier("122").parentId("12") + .tags("District").build(); + + locationDetails.add(country); + locationDetails.add(province1); + locationDetails.add(province2); + locationDetails.add(district1); + locationDetails.add(district2); + locationDetails.add(district3); + + when(locationRepository.findParentLocationsInclusive(locationIds)).thenReturn(locationDetails); + + LocationTree locationTree = locationService.buildLocationTreeHierachyWithAncestors(locationId, false); + + verify(locationRepository).findParentLocationsInclusive(locationIds); + assertNotNull(locationTree); + assertEquals(1, locationTree.getLocationsHierarchy().size()); + + TreeNode level0Node = locationTree.getLocationsHierarchy().get(country.getIdentifier()); + assertNotNull(level0Node); + assertEquals(country.getIdentifier(), level0Node.getId()); + assertEquals(country.getName(), level0Node.getLabel()); + assertNull(level0Node.getParent()); + assertEquals(country.getTags(), level0Node.getNode().getTags().iterator().next()); + assertEquals(2, level0Node.getChildren().size()); + + TreeNode level1Node = level0Node.getChildren().get(province2.getIdentifier()); + assertNotNull(level1Node); + assertEquals(province2.getIdentifier(), level1Node.getId()); + assertEquals(province2.getName(), level1Node.getLabel()); + assertEquals(2, level1Node.getChildren().size()); + assertEquals(country.getIdentifier(), level1Node.getParent()); + + TreeNode level2Node = level1Node.getChildren().get(district2.getIdentifier()); + assertNotNull(level2Node); + assertEquals(district2.getIdentifier(), level2Node.getId()); + assertEquals(district2.getName(), level2Node.getLabel()); + assertNull(level2Node.getChildren()); + assertEquals(province2.getIdentifier(), level2Node.getParent()); + + Set tags = level2Node.getNode().getTags(); + assertEquals(1, tags.size()); + assertTrue(tags.contains("District")); + } } diff --git a/src/test/java/org/opensrp/service/PlanServiceTest.java b/src/test/java/org/opensrp/service/PlanServiceTest.java index 3ab9049cc..ec30dec67 100755 --- a/src/test/java/org/opensrp/service/PlanServiceTest.java +++ b/src/test/java/org/opensrp/service/PlanServiceTest.java @@ -35,299 +35,298 @@ * Created by Vincent Karuri on 06/05/2019 */ public class PlanServiceTest { - - @Rule - public MockitoRule rule = MockitoJUnit.rule(); - - private PlanService planService; - - @Mock - private PlanRepository planRepository; - - @Mock - private PractitionerService practitionerService; - - @Mock - private PractitionerRoleService practitionerRoleService; - - @Mock - private OrganizationService organizationService; - - @Mock - private TaskGenerator taskGenerator; - - private String user="johndoe"; - - @Before - public void setUp() { - planService = new PlanService(planRepository, practitionerService,practitionerRoleService, organizationService,taskGenerator); - } - - @Test - public void testGetAllPlansShouldCallRepositoryGetAllMethod() { - PlanSearchBean planSearchBean = new PlanSearchBean(); - planService.getAllPlans(planSearchBean); - verify(planRepository).getAllPlans(planSearchBean); - } - - @Test - public void testAddOrUpdatePlanShouldCallRepositoryAddMethod() { - when(planRepository.get(anyString())).thenReturn(null); - PlanDefinition plan = new PlanDefinition(); - plan.setIdentifier("identifier"); - planService.addOrUpdatePlan(plan,user); - verify(planRepository).add(eq(plan)); - } - - @Test - public void testAddOrUpdatePlanShouldCallRepositoryUpdateMethod() { - when(planRepository.get(anyString())).thenReturn(new PlanDefinition()); - doNothing().when(organizationService).unassignLocationAndPlan(anyString()); - PlanDefinition plan = new PlanDefinition(); - plan.setIdentifier("identifier"); - planService.addOrUpdatePlan(plan,user); - verify(planRepository).update(eq(plan)); - } - - @Test - public void testAddPlanShouldCallRepositoryAddMethod() { - when(planRepository.get(anyString())).thenReturn(null); - PlanDefinition plan = new PlanDefinition(); - plan.setIdentifier("identifier"); - planService.addPlan(plan,user); - verify(planRepository).add(eq(plan)); - } - - @Test - public void updatePlanShouldCallRepositoryUpdateMethod() { - when(planRepository.get(anyString())).thenReturn(new PlanDefinition()); - doNothing().when(organizationService).unassignLocationAndPlan(anyString()); - PlanDefinition plan = new PlanDefinition(); - plan.setIdentifier("identifier"); - planService.updatePlan(plan,user); - verify(planRepository).update(eq(plan)); - } - - @Test - public void testGetPlanShouldCallRepositoryGetMethod() { - when(planRepository.get(anyString())).thenReturn(new PlanDefinition()); - planService.getPlan("identifier"); - verify(planRepository).get(eq("identifier")); - } - - @Test - public void testGetPlansByServerVersionAndOperationalAreaShouldCallRepositoryGetPlansByServerVersionAndOperationalAreaMethod() { - when(planRepository.getPlansByServerVersionAndOperationalAreas(anyLong(), any(), anyBoolean())) - .thenReturn(new ArrayList()); - List operationalAreaIds = new ArrayList<>(); - operationalAreaIds.add("operation_area_1"); - planService.getPlansByServerVersionAndOperationalArea(0l, operationalAreaIds,false); - verify(planRepository).getPlansByServerVersionAndOperationalAreas(eq(0l), eq(operationalAreaIds),eq(false)); - } - - @Test - public void testGetPlansByIdsReturnOptionalFields() { - List ids = Arrays.asList("plan1", "plan2"); - List fields = Arrays.asList("name", "action"); - List expected = Collections.singletonList(new PlanDefinition()); - when(planRepository.getPlansByIdsReturnOptionalFields(ids, fields,false)).thenReturn(expected); - List plans = planService.getPlansByIdsReturnOptionalFields(ids, fields,false); - verify(planRepository).getPlansByIdsReturnOptionalFields(ids, fields,false); - assertEquals(expected, plans); - } - - @Test - public void testGetPlansByOrganizationsAndServerVersion() { - - List planIdentifiers = Arrays.asList("plan1", "plan2"); - List assignedLocations = new ArrayList(); - for (String id : planIdentifiers) { - AssignedLocations assignedLocation = new AssignedLocations(); - assignedLocation.setPlanId(id); - assignedLocations.add(assignedLocation); - } - List organizationIds = Arrays.asList(1l, 40l); - long serverVersion = 1234l; - List expected = Collections.singletonList(new PlanDefinition()); - when(organizationService.findAssignedLocationsAndPlans(organizationIds)) - .thenReturn(assignedLocations); - when(planRepository.getPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion, false)) - .thenReturn(expected); - List plans = planService.getPlansByOrganizationsAndServerVersion(organizationIds, serverVersion, false); - verify(planRepository).getPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion, false); - verify(organizationService).findAssignedLocationsAndPlans(organizationIds); - assertEquals(expected, plans); - } - - - - @Test - public void testGetPlansByUsernameAndServerVersion() { - - List planIdentifiers = Arrays.asList("plan1", "plan2"); - List assignedLocations = new ArrayList(); - for (String id : planIdentifiers) { - AssignedLocations assignedLocation = new AssignedLocations(); - assignedLocation.setPlanId(id); - assignedLocations.add(assignedLocation); - } - List organizationIds = Arrays.asList(11l, 40l,7667l); - long serverVersion = 1234l; - - org.smartregister.domain.Practitioner practitioner = new org.smartregister.domain.Practitioner(); - practitioner.setIdentifier("practioner-1"); - - List roles = new ArrayList<>(); - for(long id:organizationIds) { - PractitionerRole role = new PractitionerRole(); - role.setOrganizationId(id); - roles.add(role); - } - - List expected = Collections.singletonList(new PlanDefinition()); - when(practitionerService.getOrganizationIdsByUserName("janedoe")).thenReturn(organizationIds); - when(organizationService.findAssignedLocationsAndPlans(organizationIds)) - .thenReturn(assignedLocations); - when(planRepository.getPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion, false)) - .thenReturn(expected); - when(practitionerService.getPractionerByUsername("janedoe")).thenReturn(practitioner); - when(practitionerRoleService.getPgRolesForPractitioner(practitioner.getIdentifier())).thenReturn(roles); - List plans = planService.getPlansByUsernameAndServerVersion("janedoe", serverVersion, false); - verify(planRepository).getPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion, false); - verify(organizationService).findAssignedLocationsAndPlans(organizationIds); - assertEquals(expected, plans); - } - - @Test - public void testFindAllPlanIds() { - List expectedPlanIds = new ArrayList<>(); - expectedPlanIds.add("Location-1"); - expectedPlanIds.add("Location-2"); - Pair, Long> idsModel = Pair.of(expectedPlanIds, 0l); - - when(planRepository.findAllIds(anyLong(), anyInt(), anyBoolean())).thenReturn(idsModel); - Pair, Long> planIdsObject = planService.findAllIds(0l, 10, false); - List actualPlanIds = planIdsObject.getLeft(); - - verify(planRepository).findAllIds(0l, 10, false); - assertEquals(2, actualPlanIds.size()); - assertEquals(expectedPlanIds.get(0), actualPlanIds.get(0)); - assertEquals(expectedPlanIds.get(1), actualPlanIds.get(1)); - assertEquals(0l, planIdsObject.getRight().longValue()); - - } - - @Test - public void testGetPlanIdentifiersByOrganizations() { - - List planIdentifiers = Arrays.asList("plan1", "plan2"); - List assignedLocations = new ArrayList(); - for (String id : planIdentifiers) { - AssignedLocations assignedLocation = new AssignedLocations(); - assignedLocation.setPlanId(id); - assignedLocations.add(assignedLocation); - } - List organizationIds = Arrays.asList(1l, 40l); - when(organizationService.findAssignedLocationsAndPlans(organizationIds)) - .thenReturn(assignedLocations); - List actualPlanIdentifiers = planService.getPlanIdentifiersByOrganizations(organizationIds); - - verify(organizationService).findAssignedLocationsAndPlans(organizationIds); - assertEquals(planIdentifiers, actualPlanIdentifiers); - } - - @Test - public void testGetPlanIdentifiersByUserName() { - - List planIdentifiers = Arrays.asList("plan1", "plan2"); - List assignedLocations = new ArrayList(); - for (String id : planIdentifiers) { - AssignedLocations assignedLocation = new AssignedLocations(); - assignedLocation.setPlanId(id); - assignedLocations.add(assignedLocation); - } - org.smartregister.domain.Practitioner practitioner = new org.smartregister.domain.Practitioner(); - practitioner.setIdentifier("practioner-1"); - List organizationIds = Arrays.asList(1l, 40l); - List roles = new ArrayList<>(); - for(long id:organizationIds) { - PractitionerRole role = new PractitionerRole(); - role.setOrganizationId(id); - roles.add(role); - } - when(practitionerService.getPractionerByUsername("janedoe")).thenReturn(practitioner); - when(practitionerRoleService.getPgRolesForPractitioner(practitioner.getIdentifier())).thenReturn(roles); - - when(organizationService.findAssignedLocationsAndPlans(organizationIds)) - .thenReturn(assignedLocations); - List actualPlanIdentifiers = planService.getPlanIdentifiersByOrganizations(organizationIds); - - verify(organizationService).findAssignedLocationsAndPlans(organizationIds); - assertEquals(planIdentifiers, actualPlanIdentifiers); - } - - @Test - public void testCountPlansByOrganizationsAndServerVersion() { - - List planIdentifiers = Arrays.asList("plan1", "plan2"); - List assignedLocations = new ArrayList(); - for (String id : planIdentifiers) { - AssignedLocations assignedLocation = new AssignedLocations(); - assignedLocation.setPlanId(id); - assignedLocations.add(assignedLocation); - } - List organizationIds = Arrays.asList(1l, 40l); - long serverVersion = 1234l; - when(organizationService.findAssignedLocationsAndPlans(organizationIds)) - .thenReturn(assignedLocations); - when(planRepository.countPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion)) - .thenReturn(1l); - Long plans = planService.countPlansByOrganizationsAndServerVersion(organizationIds, serverVersion); - verify(planRepository).countPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion); - verify(organizationService).findAssignedLocationsAndPlans(organizationIds); - assertEquals(1, plans.longValue()); - } - - @Test - public void testCountPlansByUsernameAndServerVersion() { - - List planIdentifiers = Arrays.asList("plan1", "plan2"); - List assignedLocations = new ArrayList(); - for (String id : planIdentifiers) { - AssignedLocations assignedLocation = new AssignedLocations(); - assignedLocation.setPlanId(id); - assignedLocations.add(assignedLocation); - } - List organizationIds = Arrays.asList(11l, 40l,7667l); - long serverVersion = 1234l; - - org.smartregister.domain.Practitioner practitioner = new org.smartregister.domain.Practitioner(); - practitioner.setIdentifier("practioner-1"); - - List roles = new ArrayList<>(); - for(long id:organizationIds) { - PractitionerRole role = new PractitionerRole(); - role.setOrganizationId(id); - roles.add(role); - } - when(practitionerService.getOrganizationIdsByUserName("janedoe")).thenReturn(organizationIds); - when(organizationService.findAssignedLocationsAndPlans(organizationIds)) - .thenReturn(assignedLocations); - when(planRepository.countPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion)) - .thenReturn(2l); - when(practitionerService.getPractionerByUsername("janedoe")).thenReturn(practitioner); - when(practitionerRoleService.getPgRolesForPractitioner(practitioner.getIdentifier())).thenReturn(roles); - Long plans = planService.countPlansByUsernameAndServerVersion("janedoe", serverVersion); - //verify(planRepository).countPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion); - verify(organizationService).findAssignedLocationsAndPlans(organizationIds); - assertEquals(2, plans.longValue()); - } - - @Test - public void testCountAllShouldInvokeCorrectMethod() { - doReturn(1l).when(planRepository).countAllPlans(anyLong(), eq(true)); - planService.countAllPlans(0l, true); - verify(planRepository, times(1)).countAllPlans(eq(0l), eq(true)); - } + + @Rule + public MockitoRule rule = MockitoJUnit.rule(); + + private PlanService planService; + + @Mock + private PlanRepository planRepository; + + @Mock + private PractitionerService practitionerService; + + @Mock + private PractitionerRoleService practitionerRoleService; + + @Mock + private OrganizationService organizationService; + + @Mock + private TaskGenerator taskGenerator; + + private String user = "johndoe"; + + @Before + public void setUp() { + planService = new PlanService(planRepository, practitionerService, practitionerRoleService, organizationService, taskGenerator); + } + + @Test + public void testGetAllPlansShouldCallRepositoryGetAllMethod() { + PlanSearchBean planSearchBean = new PlanSearchBean(); + planService.getAllPlans(planSearchBean); + verify(planRepository).getAllPlans(planSearchBean); + } + + @Test + public void testAddOrUpdatePlanShouldCallRepositoryAddMethod() { + when(planRepository.get(anyString())).thenReturn(null); + PlanDefinition plan = new PlanDefinition(); + plan.setIdentifier("identifier"); + planService.addOrUpdatePlan(plan, user); + verify(planRepository).add(eq(plan)); + } + + @Test + public void testAddOrUpdatePlanShouldCallRepositoryUpdateMethod() { + when(planRepository.get(anyString())).thenReturn(new PlanDefinition()); + doNothing().when(organizationService).unassignLocationAndPlan(anyString()); + PlanDefinition plan = new PlanDefinition(); + plan.setIdentifier("identifier"); + planService.addOrUpdatePlan(plan, user); + verify(planRepository).update(eq(plan)); + } + + @Test + public void testAddPlanShouldCallRepositoryAddMethod() { + when(planRepository.get(anyString())).thenReturn(null); + PlanDefinition plan = new PlanDefinition(); + plan.setIdentifier("identifier"); + planService.addPlan(plan, user); + verify(planRepository).add(eq(plan)); + } + + @Test + public void updatePlanShouldCallRepositoryUpdateMethod() { + when(planRepository.get(anyString())).thenReturn(new PlanDefinition()); + doNothing().when(organizationService).unassignLocationAndPlan(anyString()); + PlanDefinition plan = new PlanDefinition(); + plan.setIdentifier("identifier"); + planService.updatePlan(plan, user); + verify(planRepository).update(eq(plan)); + } + + @Test + public void testGetPlanShouldCallRepositoryGetMethod() { + when(planRepository.get(anyString())).thenReturn(new PlanDefinition()); + planService.getPlan("identifier"); + verify(planRepository).get(eq("identifier")); + } + + @Test + public void testGetPlansByServerVersionAndOperationalAreaShouldCallRepositoryGetPlansByServerVersionAndOperationalAreaMethod() { + when(planRepository.getPlansByServerVersionAndOperationalAreas(anyLong(), any(), anyBoolean())) + .thenReturn(new ArrayList()); + List operationalAreaIds = new ArrayList<>(); + operationalAreaIds.add("operation_area_1"); + planService.getPlansByServerVersionAndOperationalArea(0l, operationalAreaIds, false); + verify(planRepository).getPlansByServerVersionAndOperationalAreas(eq(0l), eq(operationalAreaIds), eq(false)); + } + + @Test + public void testGetPlansByIdsReturnOptionalFields() { + List ids = Arrays.asList("plan1", "plan2"); + List fields = Arrays.asList("name", "action"); + List expected = Collections.singletonList(new PlanDefinition()); + when(planRepository.getPlansByIdsReturnOptionalFields(ids, fields, false)).thenReturn(expected); + List plans = planService.getPlansByIdsReturnOptionalFields(ids, fields, false); + verify(planRepository).getPlansByIdsReturnOptionalFields(ids, fields, false); + assertEquals(expected, plans); + } + + @Test + public void testGetPlansByOrganizationsAndServerVersion() { + + List planIdentifiers = Arrays.asList("plan1", "plan2"); + List assignedLocations = new ArrayList(); + for (String id : planIdentifiers) { + AssignedLocations assignedLocation = new AssignedLocations(); + assignedLocation.setPlanId(id); + assignedLocations.add(assignedLocation); + } + List organizationIds = Arrays.asList(1l, 40l); + long serverVersion = 1234l; + List expected = Collections.singletonList(new PlanDefinition()); + when(organizationService.findAssignedLocationsAndPlans(organizationIds)) + .thenReturn(assignedLocations); + when(planRepository.getPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion, false)) + .thenReturn(expected); + List plans = planService.getPlansByOrganizationsAndServerVersion(organizationIds, serverVersion, false); + verify(planRepository).getPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion, false); + verify(organizationService).findAssignedLocationsAndPlans(organizationIds); + assertEquals(expected, plans); + } + + + @Test + public void testGetPlansByUsernameAndServerVersion() { + + List planIdentifiers = Arrays.asList("plan1", "plan2"); + List assignedLocations = new ArrayList(); + for (String id : planIdentifiers) { + AssignedLocations assignedLocation = new AssignedLocations(); + assignedLocation.setPlanId(id); + assignedLocations.add(assignedLocation); + } + List organizationIds = Arrays.asList(11l, 40l, 7667l); + long serverVersion = 1234l; + + org.smartregister.domain.Practitioner practitioner = new org.smartregister.domain.Practitioner(); + practitioner.setIdentifier("practioner-1"); + + List roles = new ArrayList<>(); + for (long id : organizationIds) { + PractitionerRole role = new PractitionerRole(); + role.setOrganizationId(id); + roles.add(role); + } + + List expected = Collections.singletonList(new PlanDefinition()); + when(practitionerService.getOrganizationIdsByUserName("janedoe")).thenReturn(organizationIds); + when(organizationService.findAssignedLocationsAndPlans(organizationIds)) + .thenReturn(assignedLocations); + when(planRepository.getPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion, false)) + .thenReturn(expected); + when(practitionerService.getPractionerByUsername("janedoe")).thenReturn(practitioner); + when(practitionerRoleService.getPgRolesForPractitioner(practitioner.getIdentifier())).thenReturn(roles); + List plans = planService.getPlansByUsernameAndServerVersion("janedoe", serverVersion, false); + verify(planRepository).getPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion, false); + verify(organizationService).findAssignedLocationsAndPlans(organizationIds); + assertEquals(expected, plans); + } + + @Test + public void testFindAllPlanIds() { + List expectedPlanIds = new ArrayList<>(); + expectedPlanIds.add("Location-1"); + expectedPlanIds.add("Location-2"); + Pair, Long> idsModel = Pair.of(expectedPlanIds, 0l); + + when(planRepository.findAllIds(anyLong(), anyInt(), anyBoolean())).thenReturn(idsModel); + Pair, Long> planIdsObject = planService.findAllIds(0l, 10, false); + List actualPlanIds = planIdsObject.getLeft(); + + verify(planRepository).findAllIds(0l, 10, false); + assertEquals(2, actualPlanIds.size()); + assertEquals(expectedPlanIds.get(0), actualPlanIds.get(0)); + assertEquals(expectedPlanIds.get(1), actualPlanIds.get(1)); + assertEquals(0l, planIdsObject.getRight().longValue()); + + } + + @Test + public void testGetPlanIdentifiersByOrganizations() { + + List planIdentifiers = Arrays.asList("plan1", "plan2"); + List assignedLocations = new ArrayList(); + for (String id : planIdentifiers) { + AssignedLocations assignedLocation = new AssignedLocations(); + assignedLocation.setPlanId(id); + assignedLocations.add(assignedLocation); + } + List organizationIds = Arrays.asList(1l, 40l); + when(organizationService.findAssignedLocationsAndPlans(organizationIds)) + .thenReturn(assignedLocations); + List actualPlanIdentifiers = planService.getPlanIdentifiersByOrganizations(organizationIds); + + verify(organizationService).findAssignedLocationsAndPlans(organizationIds); + assertEquals(planIdentifiers, actualPlanIdentifiers); + } + + @Test + public void testGetPlanIdentifiersByUserName() { + + List planIdentifiers = Arrays.asList("plan1", "plan2"); + List assignedLocations = new ArrayList(); + for (String id : planIdentifiers) { + AssignedLocations assignedLocation = new AssignedLocations(); + assignedLocation.setPlanId(id); + assignedLocations.add(assignedLocation); + } + org.smartregister.domain.Practitioner practitioner = new org.smartregister.domain.Practitioner(); + practitioner.setIdentifier("practioner-1"); + List organizationIds = Arrays.asList(1l, 40l); + List roles = new ArrayList<>(); + for (long id : organizationIds) { + PractitionerRole role = new PractitionerRole(); + role.setOrganizationId(id); + roles.add(role); + } + when(practitionerService.getPractionerByUsername("janedoe")).thenReturn(practitioner); + when(practitionerRoleService.getPgRolesForPractitioner(practitioner.getIdentifier())).thenReturn(roles); + + when(organizationService.findAssignedLocationsAndPlans(organizationIds)) + .thenReturn(assignedLocations); + List actualPlanIdentifiers = planService.getPlanIdentifiersByOrganizations(organizationIds); + + verify(organizationService).findAssignedLocationsAndPlans(organizationIds); + assertEquals(planIdentifiers, actualPlanIdentifiers); + } + + @Test + public void testCountPlansByOrganizationsAndServerVersion() { + + List planIdentifiers = Arrays.asList("plan1", "plan2"); + List assignedLocations = new ArrayList(); + for (String id : planIdentifiers) { + AssignedLocations assignedLocation = new AssignedLocations(); + assignedLocation.setPlanId(id); + assignedLocations.add(assignedLocation); + } + List organizationIds = Arrays.asList(1l, 40l); + long serverVersion = 1234l; + when(organizationService.findAssignedLocationsAndPlans(organizationIds)) + .thenReturn(assignedLocations); + when(planRepository.countPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion)) + .thenReturn(1l); + Long plans = planService.countPlansByOrganizationsAndServerVersion(organizationIds, serverVersion); + verify(planRepository).countPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion); + verify(organizationService).findAssignedLocationsAndPlans(organizationIds); + assertEquals(1, plans.longValue()); + } + + @Test + public void testCountPlansByUsernameAndServerVersion() { + + List planIdentifiers = Arrays.asList("plan1", "plan2"); + List assignedLocations = new ArrayList(); + for (String id : planIdentifiers) { + AssignedLocations assignedLocation = new AssignedLocations(); + assignedLocation.setPlanId(id); + assignedLocations.add(assignedLocation); + } + List organizationIds = Arrays.asList(11l, 40l, 7667l); + long serverVersion = 1234l; + + org.smartregister.domain.Practitioner practitioner = new org.smartregister.domain.Practitioner(); + practitioner.setIdentifier("practioner-1"); + + List roles = new ArrayList<>(); + for (long id : organizationIds) { + PractitionerRole role = new PractitionerRole(); + role.setOrganizationId(id); + roles.add(role); + } + when(practitionerService.getOrganizationIdsByUserName("janedoe")).thenReturn(organizationIds); + when(organizationService.findAssignedLocationsAndPlans(organizationIds)) + .thenReturn(assignedLocations); + when(planRepository.countPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion)) + .thenReturn(2l); + when(practitionerService.getPractionerByUsername("janedoe")).thenReturn(practitioner); + when(practitionerRoleService.getPgRolesForPractitioner(practitioner.getIdentifier())).thenReturn(roles); + Long plans = planService.countPlansByUsernameAndServerVersion("janedoe", serverVersion); + //verify(planRepository).countPlansByIdentifiersAndServerVersion(planIdentifiers, serverVersion); + verify(organizationService).findAssignedLocationsAndPlans(organizationIds); + assertEquals(2, plans.longValue()); + } + + @Test + public void testCountAllShouldInvokeCorrectMethod() { + doReturn(1l).when(planRepository).countAllPlans(anyLong(), eq(true)); + planService.countAllPlans(0l, true); + verify(planRepository, times(1)).countAllPlans(eq(0l), eq(true)); + } } diff --git a/src/test/java/org/opensrp/service/PractitionerRoleServiceTest.java b/src/test/java/org/opensrp/service/PractitionerRoleServiceTest.java index e227c0210..b4a053221 100755 --- a/src/test/java/org/opensrp/service/PractitionerRoleServiceTest.java +++ b/src/test/java/org/opensrp/service/PractitionerRoleServiceTest.java @@ -31,19 +31,42 @@ @RunWith(PowerMockRunner.class) public class PractitionerRoleServiceTest { - @InjectMocks + @InjectMocks private PractitionerRoleService practitionerRoleService; - @Mock + @Mock private PractitionerRoleRepository practitionerRoleRepository; - @Mock + @Mock private OrganizationService organizationService; - @Mock + @Mock private PractitionerService practitionerService; - + private static PractitionerRole initTestPractitionerRole() { + PractitionerRole practitionerRole = new PractitionerRole(); + practitionerRole.setIdentifier("pr1-identifier"); + practitionerRole.setActive(true); + practitionerRole.setOrganizationIdentifier("org-identifier"); + practitionerRole.setPractitionerIdentifier("p1-identifier"); + PractitionerRoleCode code = new PractitionerRoleCode(); + code.setText("pr1Code"); + practitionerRole.setCode(code); + return practitionerRole; + } + + private static PractitionerRole initTestPractitionerRole2() { + PractitionerRole practitionerRole = new PractitionerRole(); + practitionerRole.setIdentifier("pr2-identifier"); + practitionerRole.setActive(true); + practitionerRole.setOrganizationIdentifier("org1"); + practitionerRole.setPractitionerIdentifier("p2-identifier"); + PractitionerRoleCode code = new PractitionerRoleCode(); + code.setText("pr2Code"); + practitionerRole.setCode(code); + return practitionerRole; + } + @Test public void testGetAllPractitionerRoles() { List expectedPractitionerRoles = new ArrayList<>(); @@ -136,9 +159,9 @@ public void testDeleteByOrganizationAndPractitionerShouldCallRepostorySafeRemove organization.setId(1l); when(organizationService.getOrganization(anyString())).thenReturn(organization); - org.opensrp.domain.postgres.Practitioner pgPractitioner = new org.opensrp.domain.postgres.Practitioner(); - pgPractitioner.setId(1l); - + org.opensrp.domain.postgres.Practitioner pgPractitioner = new org.opensrp.domain.postgres.Practitioner(); + pgPractitioner.setId(1l); + when(practitionerService.getPgPractitioner(anyString())).thenReturn(pgPractitioner); PractitionerRole practitionerRole = initTestPractitionerRole(); @@ -146,7 +169,6 @@ public void testDeleteByOrganizationAndPractitionerShouldCallRepostorySafeRemove verify(practitionerRoleRepository).safeRemove(anyLong(), anyLong()); } - @Test public void testGetRolesForPractitionerShouldCallGetRolesForPractitionerMethod() { List expectedPractitionerRoles = new ArrayList<>(); @@ -211,14 +233,14 @@ public void testGetPractitionerRolesByOrgIdAndCode() { } - @Test - public void testCountAllPractitionerRoles() { - PractitionerRole practitionerRole = initTestPractitionerRole(); - doReturn((long) Collections.singletonList(practitionerRole).size()).when(practitionerRoleRepository).countAllPractitionerRoles(); - assertEquals(1, practitionerRoleService.countAllPractitionerRoles()); - } + @Test + public void testCountAllPractitionerRoles() { + PractitionerRole practitionerRole = initTestPractitionerRole(); + doReturn((long) Collections.singletonList(practitionerRole).size()).when(practitionerRoleRepository).countAllPractitionerRoles(); + assertEquals(1, practitionerRoleService.countAllPractitionerRoles()); + } - @Test + @Test public void testAssignPractitionerRole() { String practitionerIdentifier = "p1-identifier"; org.opensrp.domain.postgres.Practitioner practitioner = new org.opensrp.domain.postgres.Practitioner(); @@ -248,28 +270,4 @@ public void testAssignPractitionerRoleWithException() { PractitionerRole practitionerRole = initTestPractitionerRole(); practitionerRoleService.assignPractitionerRole(organizationId, practitionerIdentifier, code, practitionerRole); } - - private static PractitionerRole initTestPractitionerRole(){ - PractitionerRole practitionerRole = new PractitionerRole(); - practitionerRole.setIdentifier("pr1-identifier"); - practitionerRole.setActive(true); - practitionerRole.setOrganizationIdentifier("org-identifier"); - practitionerRole.setPractitionerIdentifier("p1-identifier"); - PractitionerRoleCode code = new PractitionerRoleCode(); - code.setText("pr1Code"); - practitionerRole.setCode(code); - return practitionerRole; - } - - private static PractitionerRole initTestPractitionerRole2(){ - PractitionerRole practitionerRole = new PractitionerRole(); - practitionerRole.setIdentifier("pr2-identifier"); - practitionerRole.setActive(true); - practitionerRole.setOrganizationIdentifier("org1"); - practitionerRole.setPractitionerIdentifier("p2-identifier"); - PractitionerRoleCode code = new PractitionerRoleCode(); - code.setText("pr2Code"); - practitionerRole.setCode(code); - return practitionerRole; - } } diff --git a/src/test/java/org/opensrp/service/PractitionerServiceTest.java b/src/test/java/org/opensrp/service/PractitionerServiceTest.java index 6072ad37e..eee22dace 100755 --- a/src/test/java/org/opensrp/service/PractitionerServiceTest.java +++ b/src/test/java/org/opensrp/service/PractitionerServiceTest.java @@ -39,6 +39,30 @@ public class PractitionerServiceTest { @Mock private OrganizationService organizationService; + private static PractitionerRole initTestPractitionerRole1() { + PractitionerRole practitionerRole = new PractitionerRole(); + practitionerRole.setIdentifier("pr1-identifier"); + practitionerRole.setActive(true); + practitionerRole.setOrganizationIdentifier("org1"); + practitionerRole.setPractitionerIdentifier("p1-identifier"); + PractitionerRoleCode code = new PractitionerRoleCode(); + code.setText("pr1Code"); + practitionerRole.setCode(code); + return practitionerRole; + } + + private static PractitionerRole initTestPractitionerRole2() { + PractitionerRole practitionerRole = new PractitionerRole(); + practitionerRole.setIdentifier("pr2-identifier"); + practitionerRole.setActive(true); + practitionerRole.setOrganizationIdentifier("org1"); + practitionerRole.setPractitionerIdentifier("p2-identifier"); + PractitionerRoleCode code = new PractitionerRoleCode(); + code.setText("pr2Code"); + practitionerRole.setCode(code); + return practitionerRole; + } + @Before public void setUp() { practitionerService = new PractitionerService(); //new PractitionerService(practitionerRepository,practitionerRoleService, organizationService); @@ -106,7 +130,6 @@ public void testAddOrUpdateWithoutPractitionerIdentifier() { verify(practitionerRepository, never()).update(eq(practitioner)); } - @Test public void testDeleteShouldCallRepositorySafeRemoveMethod() { when(practitionerRepository.get(anyString())).thenReturn(initTestPractitioner()); @@ -146,104 +169,104 @@ public void testGetPractitionersByOrgId() { } - @Test - public void testGetPractitionerByUsername() { - String username = "janedoe"; - Practitioner practitioner = initTestPractitioner(); - when(practitionerRepository.getPractitionerByUsername(username)).thenReturn(practitioner); - - Practitioner actual = practitionerService.getPractionerByUsername("janedoe"); - - verify(practitionerRepository).getPractitionerByUsername(username); - assertEquals(practitioner, actual); - - } - - @Test - public void testGetPractitionersByIdentifiers() { - Practitioner practitioner1 = initTestPractitioner(); - Practitioner practitioner2 = initTestPractitioner2(); - List practitioners = new ArrayList<>(); - practitioners.add(practitioner1); - practitioners.add(practitioner2); - - when(practitionerRepository.getAllPractitionersByIdentifiers(any(List.class))).thenReturn(practitioners); - - List identifiers = new ArrayList<>(); - identifiers.add("practitoner-1-identifier"); - identifiers.add("practitoner-2-identifier"); - List actual = practitionerService.getPractitionersByIdentifiers(identifiers); - - verify(practitionerRepository).getAllPractitionersByIdentifiers(identifiers); - assertEquals(practitioners.size(), actual.size()); - assertEquals(practitioners.get(0).getName(), actual.get(0).getName()); - assertEquals(practitioners.get(1).getName(), actual.get(1).getName()); - } - - @Test - public void testGetAssignedPractitionersByIdentifierAndCode() { - PractitionerRole practitionerRole = initTestPractitionerRole1(); - PractitionerRole practitionerRole2 = initTestPractitionerRole2(); - - List practitionerRoles = new ArrayList<>(); - practitionerRoles.add(practitionerRole); - practitionerRoles.add(practitionerRole2); - - List roles = new ArrayList<>(); - List organizationIds = Arrays.asList(11l, 40l,7667l); - for(long id:organizationIds) { - org.opensrp.domain.postgres.PractitionerRole role = new org.opensrp.domain.postgres.PractitionerRole(); - role.setOrganizationId(id); - roles.add(role); - } - - Practitioner practitioner1 = initTestPractitioner(); - Practitioner practitioner2 = initTestPractitioner2(); - List practitioners = new ArrayList<>(); - practitioners.add(practitioner1); - practitioners.add(practitioner2); - when(practitionerRoleService.getPgRolesForPractitioner(anyString())).thenReturn(roles); - when(practitionerRoleService.getPractitionerRolesByOrgIdAndCode(anyLong(),anyString())).thenReturn(practitionerRoles); - when(practitionerRepository.getAllPractitionersByIdentifiers(any(List.class))).thenReturn(practitioners); - - List actual = practitionerService.getAssignedPractitionersByIdentifierAndCode("test-identifier","pr1Code"); - - assertEquals(practitioners.size(), actual.size()); - assertEquals(practitioners.get(0).getName(), actual.get(0).getName()); - assertEquals(practitioners.get(1).getName(), actual.get(1).getName()); - } - - @Test - public void testCountAllPractitioners() { - Practitioner practitioner1 = initTestPractitioner(); - Practitioner practitioner2 = initTestPractitioner2(); - List practitioners = new ArrayList<>(); - practitioners.add(practitioner1); - practitioners.add(practitioner2); - doReturn((long)practitioners.size()).when(practitionerRepository).countAllPractitioners(); - assertEquals(2, practitionerService.countAllPractitioners()); - } - - @Test - public void testGetOrganizationsByPractitionerIdentifier() { - Practitioner practitioner = initTestPractitioner(); - List roles = new ArrayList<>(); - List organizationIds = Arrays.asList(11l, 40l,7667l); - for(long id:organizationIds) { - org.opensrp.domain.postgres.PractitionerRole role = new org.opensrp.domain.postgres.PractitionerRole(); - role.setOrganizationId(id); - roles.add(role); - } - when(practitionerRepository.getPractitionerByIdentifier(anyString())).thenReturn(practitioner); - when(practitionerRoleService.getPgRolesForPractitioner(anyString())).thenReturn(roles); - ImmutablePair> practitioneroOrganizationIds = practitionerService.getOrganizationsByPractitionerIdentifier("test-practitioner"); - assertNotNull(practitioneroOrganizationIds); - assertEquals(practitioner, practitioneroOrganizationIds.getLeft()); - assertEquals("practitoner-1-identifier", practitioneroOrganizationIds.getLeft().getIdentifier()); - assertEquals(3, practitioneroOrganizationIds.getRight().size()); - } - - private Practitioner initTestPractitioner(){ + @Test + public void testGetPractitionerByUsername() { + String username = "janedoe"; + Practitioner practitioner = initTestPractitioner(); + when(practitionerRepository.getPractitionerByUsername(username)).thenReturn(practitioner); + + Practitioner actual = practitionerService.getPractionerByUsername("janedoe"); + + verify(practitionerRepository).getPractitionerByUsername(username); + assertEquals(practitioner, actual); + + } + + @Test + public void testGetPractitionersByIdentifiers() { + Practitioner practitioner1 = initTestPractitioner(); + Practitioner practitioner2 = initTestPractitioner2(); + List practitioners = new ArrayList<>(); + practitioners.add(practitioner1); + practitioners.add(practitioner2); + + when(practitionerRepository.getAllPractitionersByIdentifiers(any(List.class))).thenReturn(practitioners); + + List identifiers = new ArrayList<>(); + identifiers.add("practitoner-1-identifier"); + identifiers.add("practitoner-2-identifier"); + List actual = practitionerService.getPractitionersByIdentifiers(identifiers); + + verify(practitionerRepository).getAllPractitionersByIdentifiers(identifiers); + assertEquals(practitioners.size(), actual.size()); + assertEquals(practitioners.get(0).getName(), actual.get(0).getName()); + assertEquals(practitioners.get(1).getName(), actual.get(1).getName()); + } + + @Test + public void testGetAssignedPractitionersByIdentifierAndCode() { + PractitionerRole practitionerRole = initTestPractitionerRole1(); + PractitionerRole practitionerRole2 = initTestPractitionerRole2(); + + List practitionerRoles = new ArrayList<>(); + practitionerRoles.add(practitionerRole); + practitionerRoles.add(practitionerRole2); + + List roles = new ArrayList<>(); + List organizationIds = Arrays.asList(11l, 40l, 7667l); + for (long id : organizationIds) { + org.opensrp.domain.postgres.PractitionerRole role = new org.opensrp.domain.postgres.PractitionerRole(); + role.setOrganizationId(id); + roles.add(role); + } + + Practitioner practitioner1 = initTestPractitioner(); + Practitioner practitioner2 = initTestPractitioner2(); + List practitioners = new ArrayList<>(); + practitioners.add(practitioner1); + practitioners.add(practitioner2); + when(practitionerRoleService.getPgRolesForPractitioner(anyString())).thenReturn(roles); + when(practitionerRoleService.getPractitionerRolesByOrgIdAndCode(anyLong(), anyString())).thenReturn(practitionerRoles); + when(practitionerRepository.getAllPractitionersByIdentifiers(any(List.class))).thenReturn(practitioners); + + List actual = practitionerService.getAssignedPractitionersByIdentifierAndCode("test-identifier", "pr1Code"); + + assertEquals(practitioners.size(), actual.size()); + assertEquals(practitioners.get(0).getName(), actual.get(0).getName()); + assertEquals(practitioners.get(1).getName(), actual.get(1).getName()); + } + + @Test + public void testCountAllPractitioners() { + Practitioner practitioner1 = initTestPractitioner(); + Practitioner practitioner2 = initTestPractitioner2(); + List practitioners = new ArrayList<>(); + practitioners.add(practitioner1); + practitioners.add(practitioner2); + doReturn((long) practitioners.size()).when(practitionerRepository).countAllPractitioners(); + assertEquals(2, practitionerService.countAllPractitioners()); + } + + @Test + public void testGetOrganizationsByPractitionerIdentifier() { + Practitioner practitioner = initTestPractitioner(); + List roles = new ArrayList<>(); + List organizationIds = Arrays.asList(11l, 40l, 7667l); + for (long id : organizationIds) { + org.opensrp.domain.postgres.PractitionerRole role = new org.opensrp.domain.postgres.PractitionerRole(); + role.setOrganizationId(id); + roles.add(role); + } + when(practitionerRepository.getPractitionerByIdentifier(anyString())).thenReturn(practitioner); + when(practitionerRoleService.getPgRolesForPractitioner(anyString())).thenReturn(roles); + ImmutablePair> practitioneroOrganizationIds = practitionerService.getOrganizationsByPractitionerIdentifier("test-practitioner"); + assertNotNull(practitioneroOrganizationIds); + assertEquals(practitioner, practitioneroOrganizationIds.getLeft()); + assertEquals("practitoner-1-identifier", practitioneroOrganizationIds.getLeft().getIdentifier()); + assertEquals(3, practitioneroOrganizationIds.getRight().size()); + } + + private Practitioner initTestPractitioner() { Practitioner practitioner = new Practitioner(); practitioner.setIdentifier("practitoner-1-identifier"); practitioner.setActive(true); @@ -253,37 +276,13 @@ private Practitioner initTestPractitioner(){ return practitioner; } - private Practitioner initTestPractitioner2(){ - Practitioner practitioner = new Practitioner(); - practitioner.setIdentifier("practitoner-2-identifier"); - practitioner.setActive(true); - practitioner.setName("Practitioner 2"); - practitioner.setUsername("Practioner2"); - practitioner.setUserId("user2"); - return practitioner; - } - - private static PractitionerRole initTestPractitionerRole1(){ - PractitionerRole practitionerRole = new PractitionerRole(); - practitionerRole.setIdentifier("pr1-identifier"); - practitionerRole.setActive(true); - practitionerRole.setOrganizationIdentifier("org1"); - practitionerRole.setPractitionerIdentifier("p1-identifier"); - PractitionerRoleCode code = new PractitionerRoleCode(); - code.setText("pr1Code"); - practitionerRole.setCode(code); - return practitionerRole; - } - - private static PractitionerRole initTestPractitionerRole2(){ - PractitionerRole practitionerRole = new PractitionerRole(); - practitionerRole.setIdentifier("pr2-identifier"); - practitionerRole.setActive(true); - practitionerRole.setOrganizationIdentifier("org1"); - practitionerRole.setPractitionerIdentifier("p2-identifier"); - PractitionerRoleCode code = new PractitionerRoleCode(); - code.setText("pr2Code"); - practitionerRole.setCode(code); - return practitionerRole; - } + private Practitioner initTestPractitioner2() { + Practitioner practitioner = new Practitioner(); + practitioner.setIdentifier("practitoner-2-identifier"); + practitioner.setActive(true); + practitioner.setName("Practitioner 2"); + practitioner.setUsername("Practioner2"); + practitioner.setUserId("user2"); + return practitioner; + } } diff --git a/src/test/java/org/opensrp/service/ProductCatalogueServiceTest.java b/src/test/java/org/opensrp/service/ProductCatalogueServiceTest.java index f1973c771..25bd03b6d 100644 --- a/src/test/java/org/opensrp/service/ProductCatalogueServiceTest.java +++ b/src/test/java/org/opensrp/service/ProductCatalogueServiceTest.java @@ -17,95 +17,95 @@ public class ProductCatalogueServiceTest extends BaseRepositoryTest { - private ProductCatalogueService productCatalogueService; - - @Autowired - @Qualifier("productCatalogueRepositoryPostgres") - private ProductCatalogueRepository productCatalogueRepository; - - @Before - public void setUpPostgresRepository() { - productCatalogueService = new ProductCatalogueService(productCatalogueRepository); - } - - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet(); - scripts.add("product_catalogue.sql"); - return scripts; - } - - @Test - public void testFindAllProductCatalogsWithLimitSet() { - ProductCatalogueSearchBean productCatalogueSearchBean = new ProductCatalogueSearchBean(); - productCatalogueSearchBean.setProductName(""); - productCatalogueSearchBean.setUniqueId(0l); - int limit = Integer.MAX_VALUE; - List productCatalogueList = productCatalogueService - .getProductCatalogues(productCatalogueSearchBean, limit, "http://localhost:8080/opensrp"); - assertEquals(1, productCatalogueList.size()); - } - - @Test - public void testFindAllProductCatalogsWithNoLimitSet() { - ProductCatalogueSearchBean productCatalogueSearchBean = new ProductCatalogueSearchBean(); - productCatalogueSearchBean.setProductName(""); - productCatalogueSearchBean.setUniqueId(0l); - List productCatalogueList = productCatalogueService - .getProductCatalogues(productCatalogueSearchBean, "http://localhost:8080/opensrp"); - assertEquals(1, productCatalogueList.size()); - } - - @Test - public void testAdd() { - ProductCatalogue productCatalogue = createProductCatalogue(); - productCatalogueService.add(productCatalogue); - List productCatalogues = productCatalogueService.findAllProductCatalogues("http://localhost:8080/opensrp"); - assertEquals(2, productCatalogues.size()); - } - - @Test - public void testUpdate() { - ProductCatalogue productCatalogue = productCatalogueService.getProductCatalogue(1l, "http://localhost:8080/opensrp"); - productCatalogue.setProductName("Updated Product Name"); - productCatalogue.setPhotoURL("/multimedia/media/1"); - productCatalogueService.update(productCatalogue); - ProductCatalogue updatedProductCatalogue = productCatalogueService.getProductCatalogue(1l, "http://localhost:8080/opensrp"); - assertEquals("Updated Product Name", updatedProductCatalogue.getProductName()); - assertEquals("http://localhost:8080/opensrp/multimedia/media/1", updatedProductCatalogue.getPhotoURL()); - } - - @Test - public void testGetProductCatalogueByName() { - ProductCatalogue productCatalogue = productCatalogueService.getProductCatalogueByName("Midwifery Kit"); - assertEquals(new Long(1l), productCatalogue.getUniqueId()); - assertEquals(true, productCatalogue.getIsAttractiveItem()); - assertEquals("AX-123", productCatalogue.getMaterialNumber()); - } - - @Test - public void testDeleteProductCatalogueById() { - productCatalogueService.deleteProductCatalogueById(1l); - List productCatalogues = productCatalogueService.findAllProductCatalogues("http://localhost:8080/opensrp"); - assertEquals(0, productCatalogues.size()); - } - - @Test(expected = IllegalArgumentException.class) - public void testDeleteProductCatalogueByInvalidId() { - productCatalogueService.deleteProductCatalogueById(0l); - } - - private ProductCatalogue createProductCatalogue() { - ProductCatalogue productCatalogue = new ProductCatalogue(); - productCatalogue.setProductName("Product A"); - productCatalogue.setIsAttractiveItem(Boolean.TRUE); - productCatalogue.setMaterialNumber("MT-123"); - productCatalogue.setAvailability("available"); - productCatalogue.setCondition("good condition"); - productCatalogue.setAppropriateUsage("staff is trained to use it appropriately"); - productCatalogue.setAccountabilityPeriod(1); - productCatalogue.setServerVersion(123456l); - return productCatalogue; - } + private ProductCatalogueService productCatalogueService; + + @Autowired + @Qualifier("productCatalogueRepositoryPostgres") + private ProductCatalogueRepository productCatalogueRepository; + + @Before + public void setUpPostgresRepository() { + productCatalogueService = new ProductCatalogueService(productCatalogueRepository); + } + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet(); + scripts.add("product_catalogue.sql"); + return scripts; + } + + @Test + public void testFindAllProductCatalogsWithLimitSet() { + ProductCatalogueSearchBean productCatalogueSearchBean = new ProductCatalogueSearchBean(); + productCatalogueSearchBean.setProductName(""); + productCatalogueSearchBean.setUniqueId(0l); + int limit = Integer.MAX_VALUE; + List productCatalogueList = productCatalogueService + .getProductCatalogues(productCatalogueSearchBean, limit, "http://localhost:8080/opensrp"); + assertEquals(1, productCatalogueList.size()); + } + + @Test + public void testFindAllProductCatalogsWithNoLimitSet() { + ProductCatalogueSearchBean productCatalogueSearchBean = new ProductCatalogueSearchBean(); + productCatalogueSearchBean.setProductName(""); + productCatalogueSearchBean.setUniqueId(0l); + List productCatalogueList = productCatalogueService + .getProductCatalogues(productCatalogueSearchBean, "http://localhost:8080/opensrp"); + assertEquals(1, productCatalogueList.size()); + } + + @Test + public void testAdd() { + ProductCatalogue productCatalogue = createProductCatalogue(); + productCatalogueService.add(productCatalogue); + List productCatalogues = productCatalogueService.findAllProductCatalogues("http://localhost:8080/opensrp"); + assertEquals(2, productCatalogues.size()); + } + + @Test + public void testUpdate() { + ProductCatalogue productCatalogue = productCatalogueService.getProductCatalogue(1l, "http://localhost:8080/opensrp"); + productCatalogue.setProductName("Updated Product Name"); + productCatalogue.setPhotoURL("/multimedia/media/1"); + productCatalogueService.update(productCatalogue); + ProductCatalogue updatedProductCatalogue = productCatalogueService.getProductCatalogue(1l, "http://localhost:8080/opensrp"); + assertEquals("Updated Product Name", updatedProductCatalogue.getProductName()); + assertEquals("http://localhost:8080/opensrp/multimedia/media/1", updatedProductCatalogue.getPhotoURL()); + } + + @Test + public void testGetProductCatalogueByName() { + ProductCatalogue productCatalogue = productCatalogueService.getProductCatalogueByName("Midwifery Kit"); + assertEquals(new Long(1l), productCatalogue.getUniqueId()); + assertEquals(true, productCatalogue.getIsAttractiveItem()); + assertEquals("AX-123", productCatalogue.getMaterialNumber()); + } + + @Test + public void testDeleteProductCatalogueById() { + productCatalogueService.deleteProductCatalogueById(1l); + List productCatalogues = productCatalogueService.findAllProductCatalogues("http://localhost:8080/opensrp"); + assertEquals(0, productCatalogues.size()); + } + + @Test(expected = IllegalArgumentException.class) + public void testDeleteProductCatalogueByInvalidId() { + productCatalogueService.deleteProductCatalogueById(0l); + } + + private ProductCatalogue createProductCatalogue() { + ProductCatalogue productCatalogue = new ProductCatalogue(); + productCatalogue.setProductName("Product A"); + productCatalogue.setIsAttractiveItem(Boolean.TRUE); + productCatalogue.setMaterialNumber("MT-123"); + productCatalogue.setAvailability("available"); + productCatalogue.setCondition("good condition"); + productCatalogue.setAppropriateUsage("staff is trained to use it appropriately"); + productCatalogue.setAccountabilityPeriod(1); + productCatalogue.setServerVersion(123456l); + return productCatalogue; + } } diff --git a/src/test/java/org/opensrp/service/StockServiceTest.java b/src/test/java/org/opensrp/service/StockServiceTest.java index 8c570d9ae..ca11fc53a 100755 --- a/src/test/java/org/opensrp/service/StockServiceTest.java +++ b/src/test/java/org/opensrp/service/StockServiceTest.java @@ -50,351 +50,346 @@ */ public class StockServiceTest extends BaseRepositoryTest { - @InjectMocks - private StockService stockService; - - @Autowired - @Qualifier("stocksRepositoryPostgres") - private StocksRepository stocksRepository; - - @Mock - private ProductCatalogueService productCatalogueService; - - @Mock - private PhysicalLocationService physicalLocationService; - - @Mock - private InventoryDataValidator inventoryDataValidator; - - public static Gson gson = new GsonBuilder().registerTypeAdapter(LocationProperty.class, new PropertiesConverter()) - .setDateFormat("yyyy-MM-dd'T'HHmm").create(); - - public static String parentJson = "{\"type\":\"Feature\",\"id\":\"3734\",\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[32.59989007736522,-14.167432040756012],[32.599899215376524,-14.167521429770147],[32.59990104639621,-14.167611244163538],[32.599895558733124,-14.16770091736339],[32.59989008366051,-14.167739053114758],[32.59993602462787,-14.16775581827636],[32.600019423257834,-14.167793873088726],[32.60009945932262,-14.167838272618155],[32.60017562650404,-14.167888735376776],[32.60024744456398,-14.16794494480331],[32.60031445844555,-14.168006542967532],[32.60037624546743,-14.168073141362354],[32.60043241352514,-14.168144319105009],[32.6004826082858,-14.168219626534494],[32.60052651318807,-14.168298587010156],[32.60056384854283,-14.168380700508862],[32.60059438052627,-14.168465449920518],[32.600617914884936,-14.168552297450503],[32.60062693688366,-14.16860096246438],[32.600629671722004,-14.168608553641775],[32.600653206080665,-14.16869540117176],[32.60066959442628,-14.168783799132996],[32.600678733336906,-14.168873188147074],[32.60068056435659,-14.168963002540465],[32.600675075794186,-14.169052674840998],[32.60066230362247,-14.169141638475764],[32.60064232698187,-14.169229331368513],[32.60061527357607,-14.169315197738115],[32.60058131337695,-14.169398695293522],[32.6005406613225,-14.169479297031899],[32.60049357461884,-14.169556492138383],[32.600440351840795,-14.169629793180375],[32.60038132753629,-14.169698736107762],[32.60031687672256,-14.169762885648595],[32.60024740499381,-14.169821836208712],[32.60017335391722,-14.169875214569458],[32.600095189341566,-14.169922684384344],[32.600073628095515,-14.169933562583822],[32.60007671007219,-14.169963706060116],[32.600078541091875,-14.170053520453562],[32.60007305252941,-14.170143193653415],[32.600060280357695,-14.170232157288183],[32.600040303717094,-14.170319849281555],[32.60001324941197,-14.170405715651212],[32.599979289212854,-14.170489214105885],[32.59993897080693,-14.170569153943234],[32.599943946755786,-14.170617831547645],[32.599945777775474,-14.170707646840356],[32.59994028921301,-14.170797319140943],[32.59992751704135,-14.170886282775712],[32.59990754040069,-14.170973974769083],[32.59988048609562,-14.171059841138685],[32.5998465258965,-14.171143339593414],[32.59980587384205,-14.17122394043247],[32.59975878713834,-14.171301135538954],[32.59970556346104,-14.171374436580948],[32.59964653915648,-14.171443379508332],[32.59958208744342,-14.171507529049165],[32.59951261571467,-14.171566479609282],[32.59943856373877,-14.171619858869349],[32.59936039916312,-14.171667327784915],[32.599278615715605,-14.17170858778104],[32.59919373140565,-14.17174337715511],[32.599106283128485,-14.171771477371749],[32.59901682216866,-14.171792708566613],[32.59892591599828,-14.171806937640042],[32.5988341383848,-14.171814074659776],[32.59874206939105,-14.171814074659776],[32.598650291777574,-14.171806937640042],[32.59855938470787,-14.171792708566613],[32.59846992464736,-14.171771477371749],[32.59838247547094,-14.17174337715511],[32.5983273353383,-14.17172077809141],[32.59831050992216,-14.17173505572822],[32.59823645704688,-14.17178843408891],[32.59815829247128,-14.171835903903796],[32.59807650992303,-14.171877163899921],[32.597991625613076,-14.17191195327399],[32.59790417643665,-14.17194005259131],[32.597814715476765,-14.171961283786173],[32.59772380930639,-14.171975513758923],[32.59763203169297,-14.171982650778657],[32.59753996269916,-14.171982650778657],[32.59744818508574,-14.171975513758923],[32.597357278016034,-14.171961283786173],[32.59726781795547,-14.17194005259131],[32.59718036877905,-14.17191195327399],[32.597125046084045,-14.171889279566528],[32.59711651511515,-14.171899244054828],[32.59705206340203,-14.171963393595718],[32.59698259167334,-14.172022344155835],[32.59690853879806,-14.172075722516524],[32.59683037422246,-14.172123192331412],[32.596748590774894,-14.172164452327593],[32.596669124880236,-14.172197021275451],[32.59666535402294,-14.172199310949395],[32.596583571474696,-14.172240570945519],[32.59649868716474,-14.172275360319588],[32.59641123798832,-14.172303459636908],[32.596321777028436,-14.172324691731092],[32.59623087085805,-14.172338920804519],[32.59613909234531,-14.172346057824257],[32.5960470233515,-14.172346057824257],[32.595955245738025,-14.172338920804519],[32.59586433866832,-14.172324691731092],[32.595803283694636,-14.172310200954938],[32.59573533092083,-14.172367862786585],[32.59566127804561,-14.172421241147333],[32.59558311346996,-14.172468710062901],[32.59551500691208,-14.172503069560946],[32.59545514174147,-14.172546221730727],[32.59537697626649,-14.172593691545558],[32.59529519371824,-14.172634951541738],[32.59521030850897,-14.17266974091575],[32.59512285933255,-14.17269784023307],[32.59503339927198,-14.172719072327254],[32.59494249220228,-14.172733301400683],[32.59485071368954,-14.172740438420476],[32.59475864469573,-14.172740438420476],[32.59466686618299,-14.172733301400683],[32.594575960012605,-14.172719072327254],[32.59448649905272,-14.17269784023307],[32.59445585105675,-14.172687992656677],[32.59442677507565,-14.172690253552332],[32.59433470518257,-14.172690253552332],[32.5942429275691,-14.17268311653254],[32.59415202049939,-14.172668887459167],[32.594062559539566,-14.172647656264303],[32.59397511036309,-14.172619556946927],[32.593890226053134,-14.172584766673594],[32.59380844260562,-14.17254350667747],[32.593730278029966,-14.172496037761903],[32.593656225154746,-14.172442658501836],[32.593586753425996,-14.17238370794172],[32.593567544806376,-14.172364589254355],[32.59351203505241,-14.172317486362884],[32.593447582440035,-14.172253336821994],[32.59338855813547,-14.17218439389461],[32.593335334458175,-14.172111092852617],[32.59328824685514,-14.172033897746132],[32.59324759480069,-14.171953296907077],[32.593213634601625,-14.171869799351725],[32.5931865802965,-14.171783932082747],[32.5931666036559,-14.171696240089375],[32.59315383148419,-14.171607276454608],[32.59314834292172,-14.171517604154076],[32.5931501739414,-14.171427788861308],[32.59315931285203,-14.17133840074655],[32.59317570119771,-14.17125000278537],[32.59319923555631,-14.171163155255385],[32.59322976753981,-14.17107840584373],[32.593267104693155,-14.170996292344967],[32.59331100869616,-14.170917331869305],[32.59336120435614,-14.170842024439821],[32.59341737331317,-14.170770846697167],[32.59347916123437,-14.170704248302341],[32.59354617601525,-14.17064265013812],[32.593617994075196,-14.170586440711643],[32.593694163055204,-14.170535977952964],[32.59377420001937,-14.170491578423535],[32.593857599548635,-14.170453523611172],[32.59394383374098,-14.170422054534129],[32.594032357607254,-14.170397369942634],[32.594122611769194,-14.170379625419342],[32.594214026056534,-14.170368934278827],[32.5943060213059,-14.170365362171708],[32.59439801655525,-14.170368934278827],[32.594402085987554,-14.170369410020214],[32.59439156302028,-14.170336010998085],[32.594371587279,-14.170248319004656],[32.594358814207965,-14.17015935536989],[32.59435618369099,-14.170116383963887],[32.594347703084054,-14.170089466355762],[32.59432772734277,-14.170001773463014],[32.594314954271795,-14.169912809828245],[32.59430946660865,-14.169823137527715],[32.59431129672901,-14.169733323134324],[32.594320435639645,-14.169643934120245],[32.594336823985316,-14.16955553615901],[32.59436035834392,-14.169468688629022],[32.59439089032736,-14.169383940116688],[32.59442822658144,-14.16930182571866],[32.59447213148371,-14.169222865243],[32.59452232624443,-14.169147557813517],[32.59457849520146,-14.169076380070862],[32.59464028132396,-14.169009781676039],[32.5947072961049,-14.168948183511816],[32.59477911416485,-14.168891974984604],[32.59485528224553,-14.168841511326661],[32.59493531831032,-14.168797111797232],[32.595018716940274,-14.168759056984868],[32.59510495113261,-14.168727587907824],[32.595193474099574,-14.168702903316273],[32.5952837282615,-14.168685158792982],[32.59537514075021,-14.168674467652522],[32.59545842696491,-14.168671234589736],[32.5954623282239,-14.168656837343121],[32.5954928602074,-14.168572088830786],[32.595530195562105,-14.168489974432703],[32.59557410046443,-14.168411013957098],[32.595624295225086,-14.168335707426932],[32.595680463282804,-14.168264529684278],[32.59574225030468,-14.168197930390136],[32.595809264186244,-14.168136332225913],[32.59588108224619,-14.1680801236987],[32.59595725032687,-14.168029660040759],[32.596033266422175,-14.16798749083],[32.59606430112666,-14.167931676205853],[32.59611449588732,-14.16785636877637],[32.59617066394503,-14.167785191033715],[32.59623245006759,-14.167718592638892],[32.59629946394915,-14.167656993575347],[32.596371282009095,-14.167600785048137],[32.596447450089784,-14.167550322289514],[32.59652748525531,-14.167505922760085],[32.59661088388526,-14.167467867947721],[32.59669711717828,-14.167436398870677],[32.59678564014524,-14.167411714279126],[32.59687589340779,-14.167393969755835],[32.5969673058965,-14.167383278615375],[32.59705930024654,-14.1673797065082],[32.597151294596635,-14.167383278615375],[32.59724270708534,-14.167393969755835],[32.5973329603479,-14.167411714279126],[32.59742148331486,-14.167436398870677],[32.59746305357709,-14.16745156953425],[32.59747073828402,-14.167423210312847],[32.59750126936814,-14.167338461800512],[32.597508451353974,-14.167322665208815],[32.59752348801862,-14.167280928571927],[32.59752577679319,-14.16727248213931],[32.59755630787737,-14.167187732727655],[32.59759364413145,-14.16710561832957],[32.5976375481344,-14.16702665875323],[32.59768774289506,-14.166951351323744],[32.59774391095277,-14.16688017358109],[32.59780569707533,-14.166813574287005],[32.59787271005757,-14.166751976122782],[32.59794452811752,-14.16669576759557],[32.598020695298885,-14.166645303937571],[32.59810073136373,-14.166600904408142],[32.59818412909431,-14.166562850495096],[32.598270361488055,-14.166531381418054],[32.598358884455024,-14.166506696826557],[32.59844913681826,-14.166488952303268],[32.59852580672065,-14.166479984263844],[32.598559981857704,-14.166473265428806],[32.598651394346405,-14.166462574288346],[32.598743387797185,-14.166459002181169],[32.59883538214722,-14.166462574288346],[32.59892679373661,-14.166473265428806],[32.599017046999165,-14.166491009952097],[32.59910556996613,-14.166515694543648],[32.599191802359826,-14.166547163620635],[32.59927520009046,-14.166585218433056],[32.599355236155304,-14.166629617962426],[32.599431403336666,-14.166680081620425],[32.5995032204973,-14.16673629014764],[32.59957023437886,-14.166797888311862],[32.59963202050142,-14.16686448670663],[32.59968818855913,-14.166935664449284],[32.59973838331979,-14.167010971878824],[32.59978228732274,-14.167089932354429],[32.5998196226775,-14.167172046752512],[32.59985015466094,-14.167256795264848],[32.5998736890196,-14.167343642794833],[32.59989007736522,-14.167432040756012]]]]},\"properties\":{\"uid\":\"41587456-b7c8-4c4e-b433-23a786f742fc\",\"code\":\"3734\",\"type\":\"Intervention Unit\",\"status\":\"Active\",\"parentId\":\"21\",\"name\":\"01_5\",\"geographicLevel\":4,\"effectiveStartDate\":\"2015-01-01T0000\",\"version\":0}}"; - - @Before - public void setup() { - initMocks(this); - - } - @Override - protected Set getDatabaseScripts() { - Set scripts = new HashSet<>(); - scripts.add("stock.sql"); - scripts.add("product_catalogue.sql"); - return scripts; - } - - @Override - public void populateDatabase() throws SQLException { - super.populateDatabase(); - stockService = new StockService(stocksRepository, productCatalogueService, physicalLocationService, inventoryDataValidator); - Stock stock1 = new Stock("123", "VT", "TT", "4-2", 10, Long.parseLong("20062017"), "TF", - Long.parseLong("20062017"), Long.parseLong("12345")); - Stock stock2 = new Stock("123", "VT", "TT", "4-2", 10, Long.parseLong("20062017"), "TF", - Long.parseLong("20062017"), Long.parseLong("12345")); - stockService.addStock(stock1); - stockService.addStock(stock2); - } - - @Test - public void shouldSaveStock() { - Stock stock = new Stock("124", "VT1", "TT1", "4-2", 10, Long.parseLong("20062017"), " TF", - Long.parseLong("20062017"), Long.parseLong("12345")); - - Stock savedStock = stockService.addorUpdateStock(stock); - Assert.assertNotNull(savedStock.getServerVersion()); - Assert.assertEquals(savedStock.getProviderid(), stock.getProviderid()); - - } - - @Test - public void shouldUpdateStockWithSaveorUpdate() { - List stocks = stockService.findAllByProviderid("4-2"); - for (Stock stock : stocks) { - stock.setVaccineTypeId("12334"); - stock.setTransactionType("Restocking_1"); - stock.setValue(stock.getValue() * 2); - stockService.addorUpdateStock(stock); - } - stocks = stockService.findAllByProviderid("4-2"); - for (Stock savedStock : stocks) { - Assert.assertEquals(0, Minutes.minutesBetween(savedStock.getDateEdited(), DateTime.now()).getMinutes()); - Assert.assertEquals("12334", savedStock.getVaccineTypeId()); - Assert.assertEquals("Restocking_1", savedStock.getTransactionType()); - Assert.assertEquals(20, savedStock.getValue()); - } - } - - @Test - public void shouldUpdateStock() { - List stocks = stockService.findAllByProviderid("4-2"); - for (Stock stock : stocks) { - stock.setVaccineTypeId("12334"); - stock.setTransactionType("Restocking_1"); - stock.setValue(stock.getValue() * 2); - stockService.updateStock(stock); - } - stocks = stockService.findAllByProviderid("4-2"); - for (Stock savedStock : stocks) { - Assert.assertEquals(0, Minutes.minutesBetween(savedStock.getDateEdited(), DateTime.now()).getMinutes()); - Assert.assertEquals("12334", savedStock.getVaccineTypeId()); - Assert.assertEquals("Restocking_1", savedStock.getTransactionType()); - Assert.assertEquals(20, savedStock.getValue()); - } - } - - @Test(expected = IllegalArgumentException.class) - public void shouldNotUpdateStockForNewStock() { - Stock stock = new Stock("124", "VT1", "TT1", "4-2", 10, Long.parseLong("20062017"), " TF", - Long.parseLong("20062017"), Long.parseLong("12345")); - stockService.updateStock(stock); - } - - @Test - public void shouldFetchStocksByProcider() throws Exception { - List fecthedListByProviderid = stockService.findAllByProviderid("4-2"); - for (Stock stock : fecthedListByProviderid) - Assert.assertEquals("4-2", stock.getProviderid()); - } - - @Test - public void shouldFetchAll() throws Exception { - List fecthedListAll = stockService.getAll(); - Assert.assertEquals(17, fecthedListAll.size()); - } - - @Test - public void testAddInventory() { - Inventory inventory = createInventory(); - List donorsList = createDonorList(); - List sectionsList = createSectionsList(); - when(productCatalogueService.getProductCatalogueByName(anyString())).thenReturn(createProductCatalogue()); - when(inventoryDataValidator.getValidDonors()).thenReturn(donorsList); - when(inventoryDataValidator.getValidUnicefSections()).thenReturn(sectionsList); - when(physicalLocationService.getStructure(anyString(), anyBoolean())).thenReturn(createLocation()); - stockService.addInventory(inventory, "John"); - StockSearchBean stockSearchBean = new StockSearchBean(); - List locations = new ArrayList<>(); - locations.add("loc-1"); - stockSearchBean.setLocations(locations); - stockSearchBean.setPageNumber(1); - List stockList = stockService.getStocksByServicePointId(stockSearchBean); - Assert.assertEquals(1, stockList.size()); - } - - @Test - public void testAddInventoryWithProviderId() { - Inventory inventory = createInventory(); - inventory.setProviderId("test provider"); - List donorsList = createDonorList(); - List sectionsList = createSectionsList(); - when(productCatalogueService.getProductCatalogueByName(anyString())).thenReturn(createProductCatalogue()); - when(inventoryDataValidator.getValidDonors()).thenReturn(donorsList); - when(inventoryDataValidator.getValidUnicefSections()).thenReturn(sectionsList); - when(physicalLocationService.getStructure(anyString(), anyBoolean())).thenReturn(createLocation()); - stockService.addInventory(inventory, "John"); - StockSearchBean stockSearchBean = new StockSearchBean(); - List locations = new ArrayList<>(); - locations.add("loc-1"); - stockSearchBean.setLocations(locations); - stockSearchBean.setPageNumber(1); - List stockList = stockService.getStocksByServicePointId(stockSearchBean); - Assert.assertEquals(1, stockList.size()); - Assert.assertEquals("test provider", stockList.get(0).getProviderid()); - } - - @Test - public void testAddInventoryWithQuantityAsNull() { - Inventory inventory = createInventory(); - inventory.setQuantity(null); - List donorsList = createDonorList(); - List sectionsList = createSectionsList(); - when(productCatalogueService.getProductCatalogueByName(anyString())).thenReturn(createProductCatalogue()); - when(inventoryDataValidator.getValidDonors()).thenReturn(donorsList); - when(inventoryDataValidator.getValidUnicefSections()).thenReturn(sectionsList); - when(physicalLocationService.getStructure(anyString(), anyBoolean())).thenReturn(createLocation()); - stockService.addInventory(inventory, "John"); - StockSearchBean stockSearchBean = new StockSearchBean(); - List locations = new ArrayList<>(); - locations.add("loc-1"); - stockSearchBean.setLocations(locations); - stockSearchBean.setPageNumber(1); - List stockList = stockService.getStocksByServicePointId(stockSearchBean); - Assert.assertEquals(1, stockList.size()); - Assert.assertEquals(1, stockList.get(0).getValue()); - } - - @Test - public void testUpdate() { - Inventory inventory = createInventory(); - List donorsList = createDonorList(); - List sectionsList = createSectionsList(); - when(inventoryDataValidator.getValidDonors()).thenReturn(donorsList); - when(inventoryDataValidator.getValidUnicefSections()).thenReturn(sectionsList); - when(productCatalogueService.getProductCatalogueByName(anyString())).thenReturn(createProductCatalogue()); - when(physicalLocationService.getStructure(anyString(), anyBoolean())).thenReturn(createLocation()); - stockService.addInventory(inventory, "John"); - inventory.setDonor("BMGF"); - Stock stock = stockService.findByIdentifierAndServicePointId("1", "loc-1"); - inventory.setStockId(stock.getId()); - stockService.updateInventory(inventory, "John"); - Stock updatedStock = stockService.findByIdentifierAndServicePointId("1", "loc-1"); - Assert.assertEquals("BMGF", updatedStock.getDonor()); - } - - @Test - public void testValidateBulkInventoryDataWithValidationErrors() throws ParseException { - List> csvStocks = new ArrayList<>(); - Map csvRow = new HashMap<>(); - csvRow.put(SERVICE_POINT_ID, "89879388"); - csvRow.put(PRODUCT_NAME, "Midwifery Kit"); - csvRow.put(PRODUCT_ID, "990222"); - csvRow.put(QUANTITY, "-1"); - csvRow.put(DELIVERY_DATE, "04/08/2020"); - csvRow.put(UNICEF_SECTION, "WASH"); - csvRow.put(DONOR, "Gates"); - csvRow.put(SERIAL_NUMBER, "12345"); - csvRow.put(PO_NUMBER, "897"); - csvStocks.add(csvRow); - - List validationErrors = new ArrayList<>(); - validationErrors.add(PRODUCT_CATALOG_DOES_NOT_EXISTS); - - when(productCatalogueService.getProductCatalogue(anyLong(), anyString())).thenReturn(createProductCatalogue()); - when(physicalLocationService.getLocation(anyString(), anyBoolean(), anyBoolean())).thenReturn(createLocation()); - when(inventoryDataValidator.getValidationErrors(anyString(),anyString(),anyString(),anyString(),anyString(), - anyString(),anyString(),anyString())).thenReturn(validationErrors); - CsvBulkImportDataSummary csvBulkImportDataSummary = stockService.validateBulkInventoryData(csvStocks); - Assert.assertEquals(1,csvBulkImportDataSummary.getFailedRecordSummaryList().size()); - } - - @Test - public void testConvertandPersistInventorydata() throws ParseException { - List> csvStocks = new ArrayList<>(); - Map csvRow = new HashMap<>(); - csvRow.put(SERVICE_POINT_ID, "89879388"); - csvRow.put(PRODUCT_NAME, "Midwifery Kit"); - csvRow.put(PRODUCT_ID, "990222"); - csvRow.put(QUANTITY, "1"); - csvRow.put(DELIVERY_DATE, "04/08/2020"); - csvRow.put(UNICEF_SECTION, "WASH"); - csvRow.put(DONOR, "ADB"); - csvRow.put(SERIAL_NUMBER, "12345"); - csvRow.put(PO_NUMBER, "897"); - csvStocks.add(csvRow); - - when(productCatalogueService.getProductCatalogue(anyLong(), anyString())).thenReturn(createProductCatalogue()); - when(physicalLocationService.getStructure(anyString(), anyBoolean())).thenReturn(createLocation()); - when(inventoryDataValidator.getValidDonors()).thenReturn(createDonors()); - when(inventoryDataValidator.getValidUnicefSections()).thenReturn(createUnicefSections()); - when(productCatalogueService.getProductCatalogueByName(anyString())).thenReturn(createProductCatalogue()); - CsvBulkImportDataSummary csvBulkImportDataSummary = stockService.convertandPersistInventorydata(csvStocks, "Test user"); - Assert.assertEquals(0,csvBulkImportDataSummary.getFailedRecordSummaryList().size()); - Assert.assertEquals(csvBulkImportDataSummary.getNumberOfRowsProcessed(), csvBulkImportDataSummary.getNumberOfCsvRows()); - } - - private Inventory createInventory() { - Date deliveryDate = new Date(); - Inventory inventory = new Inventory(); - inventory.setProductName("Midwifery Kit"); - inventory.setUnicefSection("Health"); - inventory.setDeliveryDate(deliveryDate); - inventory.setDonor("ADB"); - inventory.setPoNumber(123); - inventory.setSerialNumber("AX-12"); - inventory.setServicePointId("loc-1"); - inventory.setQuantity(4); - return inventory; - } - - private List createDonors() { - List donors = new ArrayList<>(); - donors.add("ADB"); - return donors; - } - - private List createUnicefSections() { - List sections = new ArrayList<>(); - sections.add("WASH"); - return sections; - } - - private ProductCatalogue createProductCatalogue() { - ProductCatalogue productCatalogue = new ProductCatalogue(); - productCatalogue.setUniqueId(1l); - productCatalogue.setProductName("Product A"); - productCatalogue.setIsAttractiveItem(Boolean.TRUE); - productCatalogue.setMaterialNumber("MT-123"); - productCatalogue.setAvailability("available"); - productCatalogue.setCondition("good condition"); - productCatalogue.setAppropriateUsage("staff is trained to use it appropriately"); - productCatalogue.setAccountabilityPeriod(1); - productCatalogue.setServerVersion(123456l); - return productCatalogue; - } - - private PhysicalLocation createLocation() { - PhysicalLocation parentLocation = gson.fromJson(parentJson, PhysicalLocation.class); - parentLocation.setJurisdiction(true); - return parentLocation; - } - - private List createDonorList() { - List donors = new ArrayList<>(); - donors.add("ADB"); - donors.add("NatCom Belgium"); - donors.add("BMGF"); - donors.add("Govt of Canada"); - donors.add("NatCom Canada"); - donors.add("NatCom Denmark"); - donors.add("ECW"); - donors.add("End Violence Fund"); - donors.add("ECHO "); - donors.add("EC "); - donors.add("NatCom Finland "); - donors.add("Govt of France "); - donors.add("NatCom France "); - donors.add("GAVI "); - donors.add("NatCom Germany "); - donors.add("Govt of Germany"); - donors.add("NatCom Iceland"); - donors.add("NatCom Italy"); - donors.add("Govt of Japan"); - donors.add("NatCom Japan"); - donors.add("NatCom Luxembourg"); - donors.add("Monaco"); - donors.add("NatCom Netherlands"); - donors.add("Govt of Norway"); - donors.add("NatCom Norway"); - donors.add("Nutrition Intl"); - donors.add("NatCom Poland"); - donors.add("Govt of Korea"); - donors.add("NatCom Spain"); - donors.add("NatCom Sweden"); - donors.add("NatCom Switzerland"); - donors.add("Govt of UK"); - donors.add("NatCom UK"); - donors.add("NatCom USA"); - donors.add("OFDA"); - donors.add("CDC"); - donors.add("USAID"); - donors.add("USAID FFP"); - donors.add("World Bank"); - return donors; - } - - private List createSectionsList() { - List sections = new ArrayList<>(); - sections.add("Health"); - sections.add("WASH"); - sections.add("Nutrition"); - sections.add("Education"); - sections.add("Child Protection"); - sections.add("Social Policy"); - sections.add("C4D"); - sections.add("DRR"); - return sections; - } + public static Gson gson = new GsonBuilder().registerTypeAdapter(LocationProperty.class, new PropertiesConverter()) + .setDateFormat("yyyy-MM-dd'T'HHmm").create(); + public static String parentJson = "{\"type\":\"Feature\",\"id\":\"3734\",\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[32.59989007736522,-14.167432040756012],[32.599899215376524,-14.167521429770147],[32.59990104639621,-14.167611244163538],[32.599895558733124,-14.16770091736339],[32.59989008366051,-14.167739053114758],[32.59993602462787,-14.16775581827636],[32.600019423257834,-14.167793873088726],[32.60009945932262,-14.167838272618155],[32.60017562650404,-14.167888735376776],[32.60024744456398,-14.16794494480331],[32.60031445844555,-14.168006542967532],[32.60037624546743,-14.168073141362354],[32.60043241352514,-14.168144319105009],[32.6004826082858,-14.168219626534494],[32.60052651318807,-14.168298587010156],[32.60056384854283,-14.168380700508862],[32.60059438052627,-14.168465449920518],[32.600617914884936,-14.168552297450503],[32.60062693688366,-14.16860096246438],[32.600629671722004,-14.168608553641775],[32.600653206080665,-14.16869540117176],[32.60066959442628,-14.168783799132996],[32.600678733336906,-14.168873188147074],[32.60068056435659,-14.168963002540465],[32.600675075794186,-14.169052674840998],[32.60066230362247,-14.169141638475764],[32.60064232698187,-14.169229331368513],[32.60061527357607,-14.169315197738115],[32.60058131337695,-14.169398695293522],[32.6005406613225,-14.169479297031899],[32.60049357461884,-14.169556492138383],[32.600440351840795,-14.169629793180375],[32.60038132753629,-14.169698736107762],[32.60031687672256,-14.169762885648595],[32.60024740499381,-14.169821836208712],[32.60017335391722,-14.169875214569458],[32.600095189341566,-14.169922684384344],[32.600073628095515,-14.169933562583822],[32.60007671007219,-14.169963706060116],[32.600078541091875,-14.170053520453562],[32.60007305252941,-14.170143193653415],[32.600060280357695,-14.170232157288183],[32.600040303717094,-14.170319849281555],[32.60001324941197,-14.170405715651212],[32.599979289212854,-14.170489214105885],[32.59993897080693,-14.170569153943234],[32.599943946755786,-14.170617831547645],[32.599945777775474,-14.170707646840356],[32.59994028921301,-14.170797319140943],[32.59992751704135,-14.170886282775712],[32.59990754040069,-14.170973974769083],[32.59988048609562,-14.171059841138685],[32.5998465258965,-14.171143339593414],[32.59980587384205,-14.17122394043247],[32.59975878713834,-14.171301135538954],[32.59970556346104,-14.171374436580948],[32.59964653915648,-14.171443379508332],[32.59958208744342,-14.171507529049165],[32.59951261571467,-14.171566479609282],[32.59943856373877,-14.171619858869349],[32.59936039916312,-14.171667327784915],[32.599278615715605,-14.17170858778104],[32.59919373140565,-14.17174337715511],[32.599106283128485,-14.171771477371749],[32.59901682216866,-14.171792708566613],[32.59892591599828,-14.171806937640042],[32.5988341383848,-14.171814074659776],[32.59874206939105,-14.171814074659776],[32.598650291777574,-14.171806937640042],[32.59855938470787,-14.171792708566613],[32.59846992464736,-14.171771477371749],[32.59838247547094,-14.17174337715511],[32.5983273353383,-14.17172077809141],[32.59831050992216,-14.17173505572822],[32.59823645704688,-14.17178843408891],[32.59815829247128,-14.171835903903796],[32.59807650992303,-14.171877163899921],[32.597991625613076,-14.17191195327399],[32.59790417643665,-14.17194005259131],[32.597814715476765,-14.171961283786173],[32.59772380930639,-14.171975513758923],[32.59763203169297,-14.171982650778657],[32.59753996269916,-14.171982650778657],[32.59744818508574,-14.171975513758923],[32.597357278016034,-14.171961283786173],[32.59726781795547,-14.17194005259131],[32.59718036877905,-14.17191195327399],[32.597125046084045,-14.171889279566528],[32.59711651511515,-14.171899244054828],[32.59705206340203,-14.171963393595718],[32.59698259167334,-14.172022344155835],[32.59690853879806,-14.172075722516524],[32.59683037422246,-14.172123192331412],[32.596748590774894,-14.172164452327593],[32.596669124880236,-14.172197021275451],[32.59666535402294,-14.172199310949395],[32.596583571474696,-14.172240570945519],[32.59649868716474,-14.172275360319588],[32.59641123798832,-14.172303459636908],[32.596321777028436,-14.172324691731092],[32.59623087085805,-14.172338920804519],[32.59613909234531,-14.172346057824257],[32.5960470233515,-14.172346057824257],[32.595955245738025,-14.172338920804519],[32.59586433866832,-14.172324691731092],[32.595803283694636,-14.172310200954938],[32.59573533092083,-14.172367862786585],[32.59566127804561,-14.172421241147333],[32.59558311346996,-14.172468710062901],[32.59551500691208,-14.172503069560946],[32.59545514174147,-14.172546221730727],[32.59537697626649,-14.172593691545558],[32.59529519371824,-14.172634951541738],[32.59521030850897,-14.17266974091575],[32.59512285933255,-14.17269784023307],[32.59503339927198,-14.172719072327254],[32.59494249220228,-14.172733301400683],[32.59485071368954,-14.172740438420476],[32.59475864469573,-14.172740438420476],[32.59466686618299,-14.172733301400683],[32.594575960012605,-14.172719072327254],[32.59448649905272,-14.17269784023307],[32.59445585105675,-14.172687992656677],[32.59442677507565,-14.172690253552332],[32.59433470518257,-14.172690253552332],[32.5942429275691,-14.17268311653254],[32.59415202049939,-14.172668887459167],[32.594062559539566,-14.172647656264303],[32.59397511036309,-14.172619556946927],[32.593890226053134,-14.172584766673594],[32.59380844260562,-14.17254350667747],[32.593730278029966,-14.172496037761903],[32.593656225154746,-14.172442658501836],[32.593586753425996,-14.17238370794172],[32.593567544806376,-14.172364589254355],[32.59351203505241,-14.172317486362884],[32.593447582440035,-14.172253336821994],[32.59338855813547,-14.17218439389461],[32.593335334458175,-14.172111092852617],[32.59328824685514,-14.172033897746132],[32.59324759480069,-14.171953296907077],[32.593213634601625,-14.171869799351725],[32.5931865802965,-14.171783932082747],[32.5931666036559,-14.171696240089375],[32.59315383148419,-14.171607276454608],[32.59314834292172,-14.171517604154076],[32.5931501739414,-14.171427788861308],[32.59315931285203,-14.17133840074655],[32.59317570119771,-14.17125000278537],[32.59319923555631,-14.171163155255385],[32.59322976753981,-14.17107840584373],[32.593267104693155,-14.170996292344967],[32.59331100869616,-14.170917331869305],[32.59336120435614,-14.170842024439821],[32.59341737331317,-14.170770846697167],[32.59347916123437,-14.170704248302341],[32.59354617601525,-14.17064265013812],[32.593617994075196,-14.170586440711643],[32.593694163055204,-14.170535977952964],[32.59377420001937,-14.170491578423535],[32.593857599548635,-14.170453523611172],[32.59394383374098,-14.170422054534129],[32.594032357607254,-14.170397369942634],[32.594122611769194,-14.170379625419342],[32.594214026056534,-14.170368934278827],[32.5943060213059,-14.170365362171708],[32.59439801655525,-14.170368934278827],[32.594402085987554,-14.170369410020214],[32.59439156302028,-14.170336010998085],[32.594371587279,-14.170248319004656],[32.594358814207965,-14.17015935536989],[32.59435618369099,-14.170116383963887],[32.594347703084054,-14.170089466355762],[32.59432772734277,-14.170001773463014],[32.594314954271795,-14.169912809828245],[32.59430946660865,-14.169823137527715],[32.59431129672901,-14.169733323134324],[32.594320435639645,-14.169643934120245],[32.594336823985316,-14.16955553615901],[32.59436035834392,-14.169468688629022],[32.59439089032736,-14.169383940116688],[32.59442822658144,-14.16930182571866],[32.59447213148371,-14.169222865243],[32.59452232624443,-14.169147557813517],[32.59457849520146,-14.169076380070862],[32.59464028132396,-14.169009781676039],[32.5947072961049,-14.168948183511816],[32.59477911416485,-14.168891974984604],[32.59485528224553,-14.168841511326661],[32.59493531831032,-14.168797111797232],[32.595018716940274,-14.168759056984868],[32.59510495113261,-14.168727587907824],[32.595193474099574,-14.168702903316273],[32.5952837282615,-14.168685158792982],[32.59537514075021,-14.168674467652522],[32.59545842696491,-14.168671234589736],[32.5954623282239,-14.168656837343121],[32.5954928602074,-14.168572088830786],[32.595530195562105,-14.168489974432703],[32.59557410046443,-14.168411013957098],[32.595624295225086,-14.168335707426932],[32.595680463282804,-14.168264529684278],[32.59574225030468,-14.168197930390136],[32.595809264186244,-14.168136332225913],[32.59588108224619,-14.1680801236987],[32.59595725032687,-14.168029660040759],[32.596033266422175,-14.16798749083],[32.59606430112666,-14.167931676205853],[32.59611449588732,-14.16785636877637],[32.59617066394503,-14.167785191033715],[32.59623245006759,-14.167718592638892],[32.59629946394915,-14.167656993575347],[32.596371282009095,-14.167600785048137],[32.596447450089784,-14.167550322289514],[32.59652748525531,-14.167505922760085],[32.59661088388526,-14.167467867947721],[32.59669711717828,-14.167436398870677],[32.59678564014524,-14.167411714279126],[32.59687589340779,-14.167393969755835],[32.5969673058965,-14.167383278615375],[32.59705930024654,-14.1673797065082],[32.597151294596635,-14.167383278615375],[32.59724270708534,-14.167393969755835],[32.5973329603479,-14.167411714279126],[32.59742148331486,-14.167436398870677],[32.59746305357709,-14.16745156953425],[32.59747073828402,-14.167423210312847],[32.59750126936814,-14.167338461800512],[32.597508451353974,-14.167322665208815],[32.59752348801862,-14.167280928571927],[32.59752577679319,-14.16727248213931],[32.59755630787737,-14.167187732727655],[32.59759364413145,-14.16710561832957],[32.5976375481344,-14.16702665875323],[32.59768774289506,-14.166951351323744],[32.59774391095277,-14.16688017358109],[32.59780569707533,-14.166813574287005],[32.59787271005757,-14.166751976122782],[32.59794452811752,-14.16669576759557],[32.598020695298885,-14.166645303937571],[32.59810073136373,-14.166600904408142],[32.59818412909431,-14.166562850495096],[32.598270361488055,-14.166531381418054],[32.598358884455024,-14.166506696826557],[32.59844913681826,-14.166488952303268],[32.59852580672065,-14.166479984263844],[32.598559981857704,-14.166473265428806],[32.598651394346405,-14.166462574288346],[32.598743387797185,-14.166459002181169],[32.59883538214722,-14.166462574288346],[32.59892679373661,-14.166473265428806],[32.599017046999165,-14.166491009952097],[32.59910556996613,-14.166515694543648],[32.599191802359826,-14.166547163620635],[32.59927520009046,-14.166585218433056],[32.599355236155304,-14.166629617962426],[32.599431403336666,-14.166680081620425],[32.5995032204973,-14.16673629014764],[32.59957023437886,-14.166797888311862],[32.59963202050142,-14.16686448670663],[32.59968818855913,-14.166935664449284],[32.59973838331979,-14.167010971878824],[32.59978228732274,-14.167089932354429],[32.5998196226775,-14.167172046752512],[32.59985015466094,-14.167256795264848],[32.5998736890196,-14.167343642794833],[32.59989007736522,-14.167432040756012]]]]},\"properties\":{\"uid\":\"41587456-b7c8-4c4e-b433-23a786f742fc\",\"code\":\"3734\",\"type\":\"Intervention Unit\",\"status\":\"Active\",\"parentId\":\"21\",\"name\":\"01_5\",\"geographicLevel\":4,\"effectiveStartDate\":\"2015-01-01T0000\",\"version\":0}}"; + @InjectMocks + private StockService stockService; + @Autowired + @Qualifier("stocksRepositoryPostgres") + private StocksRepository stocksRepository; + @Mock + private ProductCatalogueService productCatalogueService; + @Mock + private PhysicalLocationService physicalLocationService; + @Mock + private InventoryDataValidator inventoryDataValidator; + + @Before + public void setup() { + initMocks(this); + + } + + @Override + protected Set getDatabaseScripts() { + Set scripts = new HashSet<>(); + scripts.add("stock.sql"); + scripts.add("product_catalogue.sql"); + return scripts; + } + + @Override + public void populateDatabase() throws SQLException { + super.populateDatabase(); + stockService = new StockService(stocksRepository, productCatalogueService, physicalLocationService, inventoryDataValidator); + Stock stock1 = new Stock("123", "VT", "TT", "4-2", 10, Long.parseLong("20062017"), "TF", + Long.parseLong("20062017"), Long.parseLong("12345")); + Stock stock2 = new Stock("123", "VT", "TT", "4-2", 10, Long.parseLong("20062017"), "TF", + Long.parseLong("20062017"), Long.parseLong("12345")); + stockService.addStock(stock1); + stockService.addStock(stock2); + } + + @Test + public void shouldSaveStock() { + Stock stock = new Stock("124", "VT1", "TT1", "4-2", 10, Long.parseLong("20062017"), " TF", + Long.parseLong("20062017"), Long.parseLong("12345")); + + Stock savedStock = stockService.addorUpdateStock(stock); + Assert.assertNotNull(savedStock.getServerVersion()); + Assert.assertEquals(savedStock.getProviderid(), stock.getProviderid()); + + } + + @Test + public void shouldUpdateStockWithSaveorUpdate() { + List stocks = stockService.findAllByProviderid("4-2"); + for (Stock stock : stocks) { + stock.setVaccineTypeId("12334"); + stock.setTransactionType("Restocking_1"); + stock.setValue(stock.getValue() * 2); + stockService.addorUpdateStock(stock); + } + stocks = stockService.findAllByProviderid("4-2"); + for (Stock savedStock : stocks) { + Assert.assertEquals(0, Minutes.minutesBetween(savedStock.getDateEdited(), DateTime.now()).getMinutes()); + Assert.assertEquals("12334", savedStock.getVaccineTypeId()); + Assert.assertEquals("Restocking_1", savedStock.getTransactionType()); + Assert.assertEquals(20, savedStock.getValue()); + } + } + + @Test + public void shouldUpdateStock() { + List stocks = stockService.findAllByProviderid("4-2"); + for (Stock stock : stocks) { + stock.setVaccineTypeId("12334"); + stock.setTransactionType("Restocking_1"); + stock.setValue(stock.getValue() * 2); + stockService.updateStock(stock); + } + stocks = stockService.findAllByProviderid("4-2"); + for (Stock savedStock : stocks) { + Assert.assertEquals(0, Minutes.minutesBetween(savedStock.getDateEdited(), DateTime.now()).getMinutes()); + Assert.assertEquals("12334", savedStock.getVaccineTypeId()); + Assert.assertEquals("Restocking_1", savedStock.getTransactionType()); + Assert.assertEquals(20, savedStock.getValue()); + } + } + + @Test(expected = IllegalArgumentException.class) + public void shouldNotUpdateStockForNewStock() { + Stock stock = new Stock("124", "VT1", "TT1", "4-2", 10, Long.parseLong("20062017"), " TF", + Long.parseLong("20062017"), Long.parseLong("12345")); + stockService.updateStock(stock); + } + + @Test + public void shouldFetchStocksByProcider() throws Exception { + List fecthedListByProviderid = stockService.findAllByProviderid("4-2"); + for (Stock stock : fecthedListByProviderid) + Assert.assertEquals("4-2", stock.getProviderid()); + } + + @Test + public void shouldFetchAll() throws Exception { + List fecthedListAll = stockService.getAll(); + Assert.assertEquals(17, fecthedListAll.size()); + } + + @Test + public void testAddInventory() { + Inventory inventory = createInventory(); + List donorsList = createDonorList(); + List sectionsList = createSectionsList(); + when(productCatalogueService.getProductCatalogueByName(anyString())).thenReturn(createProductCatalogue()); + when(inventoryDataValidator.getValidDonors()).thenReturn(donorsList); + when(inventoryDataValidator.getValidUnicefSections()).thenReturn(sectionsList); + when(physicalLocationService.getStructure(anyString(), anyBoolean())).thenReturn(createLocation()); + stockService.addInventory(inventory, "John"); + StockSearchBean stockSearchBean = new StockSearchBean(); + List locations = new ArrayList<>(); + locations.add("loc-1"); + stockSearchBean.setLocations(locations); + stockSearchBean.setPageNumber(1); + List stockList = stockService.getStocksByServicePointId(stockSearchBean); + Assert.assertEquals(1, stockList.size()); + } + + @Test + public void testAddInventoryWithProviderId() { + Inventory inventory = createInventory(); + inventory.setProviderId("test provider"); + List donorsList = createDonorList(); + List sectionsList = createSectionsList(); + when(productCatalogueService.getProductCatalogueByName(anyString())).thenReturn(createProductCatalogue()); + when(inventoryDataValidator.getValidDonors()).thenReturn(donorsList); + when(inventoryDataValidator.getValidUnicefSections()).thenReturn(sectionsList); + when(physicalLocationService.getStructure(anyString(), anyBoolean())).thenReturn(createLocation()); + stockService.addInventory(inventory, "John"); + StockSearchBean stockSearchBean = new StockSearchBean(); + List locations = new ArrayList<>(); + locations.add("loc-1"); + stockSearchBean.setLocations(locations); + stockSearchBean.setPageNumber(1); + List stockList = stockService.getStocksByServicePointId(stockSearchBean); + Assert.assertEquals(1, stockList.size()); + Assert.assertEquals("test provider", stockList.get(0).getProviderid()); + } + + @Test + public void testAddInventoryWithQuantityAsNull() { + Inventory inventory = createInventory(); + inventory.setQuantity(null); + List donorsList = createDonorList(); + List sectionsList = createSectionsList(); + when(productCatalogueService.getProductCatalogueByName(anyString())).thenReturn(createProductCatalogue()); + when(inventoryDataValidator.getValidDonors()).thenReturn(donorsList); + when(inventoryDataValidator.getValidUnicefSections()).thenReturn(sectionsList); + when(physicalLocationService.getStructure(anyString(), anyBoolean())).thenReturn(createLocation()); + stockService.addInventory(inventory, "John"); + StockSearchBean stockSearchBean = new StockSearchBean(); + List locations = new ArrayList<>(); + locations.add("loc-1"); + stockSearchBean.setLocations(locations); + stockSearchBean.setPageNumber(1); + List stockList = stockService.getStocksByServicePointId(stockSearchBean); + Assert.assertEquals(1, stockList.size()); + Assert.assertEquals(1, stockList.get(0).getValue()); + } + + @Test + public void testUpdate() { + Inventory inventory = createInventory(); + List donorsList = createDonorList(); + List sectionsList = createSectionsList(); + when(inventoryDataValidator.getValidDonors()).thenReturn(donorsList); + when(inventoryDataValidator.getValidUnicefSections()).thenReturn(sectionsList); + when(productCatalogueService.getProductCatalogueByName(anyString())).thenReturn(createProductCatalogue()); + when(physicalLocationService.getStructure(anyString(), anyBoolean())).thenReturn(createLocation()); + stockService.addInventory(inventory, "John"); + inventory.setDonor("BMGF"); + Stock stock = stockService.findByIdentifierAndServicePointId("1", "loc-1"); + inventory.setStockId(stock.getId()); + stockService.updateInventory(inventory, "John"); + Stock updatedStock = stockService.findByIdentifierAndServicePointId("1", "loc-1"); + Assert.assertEquals("BMGF", updatedStock.getDonor()); + } + + @Test + public void testValidateBulkInventoryDataWithValidationErrors() throws ParseException { + List> csvStocks = new ArrayList<>(); + Map csvRow = new HashMap<>(); + csvRow.put(SERVICE_POINT_ID, "89879388"); + csvRow.put(PRODUCT_NAME, "Midwifery Kit"); + csvRow.put(PRODUCT_ID, "990222"); + csvRow.put(QUANTITY, "-1"); + csvRow.put(DELIVERY_DATE, "04/08/2020"); + csvRow.put(UNICEF_SECTION, "WASH"); + csvRow.put(DONOR, "Gates"); + csvRow.put(SERIAL_NUMBER, "12345"); + csvRow.put(PO_NUMBER, "897"); + csvStocks.add(csvRow); + + List validationErrors = new ArrayList<>(); + validationErrors.add(PRODUCT_CATALOG_DOES_NOT_EXISTS); + + when(productCatalogueService.getProductCatalogue(anyLong(), anyString())).thenReturn(createProductCatalogue()); + when(physicalLocationService.getLocation(anyString(), anyBoolean(), anyBoolean())).thenReturn(createLocation()); + when(inventoryDataValidator.getValidationErrors(anyString(), anyString(), anyString(), anyString(), anyString(), + anyString(), anyString(), anyString())).thenReturn(validationErrors); + CsvBulkImportDataSummary csvBulkImportDataSummary = stockService.validateBulkInventoryData(csvStocks); + Assert.assertEquals(1, csvBulkImportDataSummary.getFailedRecordSummaryList().size()); + } + + @Test + public void testConvertandPersistInventorydata() throws ParseException { + List> csvStocks = new ArrayList<>(); + Map csvRow = new HashMap<>(); + csvRow.put(SERVICE_POINT_ID, "89879388"); + csvRow.put(PRODUCT_NAME, "Midwifery Kit"); + csvRow.put(PRODUCT_ID, "990222"); + csvRow.put(QUANTITY, "1"); + csvRow.put(DELIVERY_DATE, "04/08/2020"); + csvRow.put(UNICEF_SECTION, "WASH"); + csvRow.put(DONOR, "ADB"); + csvRow.put(SERIAL_NUMBER, "12345"); + csvRow.put(PO_NUMBER, "897"); + csvStocks.add(csvRow); + + when(productCatalogueService.getProductCatalogue(anyLong(), anyString())).thenReturn(createProductCatalogue()); + when(physicalLocationService.getStructure(anyString(), anyBoolean())).thenReturn(createLocation()); + when(inventoryDataValidator.getValidDonors()).thenReturn(createDonors()); + when(inventoryDataValidator.getValidUnicefSections()).thenReturn(createUnicefSections()); + when(productCatalogueService.getProductCatalogueByName(anyString())).thenReturn(createProductCatalogue()); + CsvBulkImportDataSummary csvBulkImportDataSummary = stockService.convertandPersistInventorydata(csvStocks, "Test user"); + Assert.assertEquals(0, csvBulkImportDataSummary.getFailedRecordSummaryList().size()); + Assert.assertEquals(csvBulkImportDataSummary.getNumberOfRowsProcessed(), csvBulkImportDataSummary.getNumberOfCsvRows()); + } + + private Inventory createInventory() { + Date deliveryDate = new Date(); + Inventory inventory = new Inventory(); + inventory.setProductName("Midwifery Kit"); + inventory.setUnicefSection("Health"); + inventory.setDeliveryDate(deliveryDate); + inventory.setDonor("ADB"); + inventory.setPoNumber(123); + inventory.setSerialNumber("AX-12"); + inventory.setServicePointId("loc-1"); + inventory.setQuantity(4); + return inventory; + } + + private List createDonors() { + List donors = new ArrayList<>(); + donors.add("ADB"); + return donors; + } + + private List createUnicefSections() { + List sections = new ArrayList<>(); + sections.add("WASH"); + return sections; + } + + private ProductCatalogue createProductCatalogue() { + ProductCatalogue productCatalogue = new ProductCatalogue(); + productCatalogue.setUniqueId(1l); + productCatalogue.setProductName("Product A"); + productCatalogue.setIsAttractiveItem(Boolean.TRUE); + productCatalogue.setMaterialNumber("MT-123"); + productCatalogue.setAvailability("available"); + productCatalogue.setCondition("good condition"); + productCatalogue.setAppropriateUsage("staff is trained to use it appropriately"); + productCatalogue.setAccountabilityPeriod(1); + productCatalogue.setServerVersion(123456l); + return productCatalogue; + } + + private PhysicalLocation createLocation() { + PhysicalLocation parentLocation = gson.fromJson(parentJson, PhysicalLocation.class); + parentLocation.setJurisdiction(true); + return parentLocation; + } + + private List createDonorList() { + List donors = new ArrayList<>(); + donors.add("ADB"); + donors.add("NatCom Belgium"); + donors.add("BMGF"); + donors.add("Govt of Canada"); + donors.add("NatCom Canada"); + donors.add("NatCom Denmark"); + donors.add("ECW"); + donors.add("End Violence Fund"); + donors.add("ECHO "); + donors.add("EC "); + donors.add("NatCom Finland "); + donors.add("Govt of France "); + donors.add("NatCom France "); + donors.add("GAVI "); + donors.add("NatCom Germany "); + donors.add("Govt of Germany"); + donors.add("NatCom Iceland"); + donors.add("NatCom Italy"); + donors.add("Govt of Japan"); + donors.add("NatCom Japan"); + donors.add("NatCom Luxembourg"); + donors.add("Monaco"); + donors.add("NatCom Netherlands"); + donors.add("Govt of Norway"); + donors.add("NatCom Norway"); + donors.add("Nutrition Intl"); + donors.add("NatCom Poland"); + donors.add("Govt of Korea"); + donors.add("NatCom Spain"); + donors.add("NatCom Sweden"); + donors.add("NatCom Switzerland"); + donors.add("Govt of UK"); + donors.add("NatCom UK"); + donors.add("NatCom USA"); + donors.add("OFDA"); + donors.add("CDC"); + donors.add("USAID"); + donors.add("USAID FFP"); + donors.add("World Bank"); + return donors; + } + + private List createSectionsList() { + List sections = new ArrayList<>(); + sections.add("Health"); + sections.add("WASH"); + sections.add("Nutrition"); + sections.add("Education"); + sections.add("Child Protection"); + sections.add("Social Policy"); + sections.add("C4D"); + sections.add("DRR"); + return sections; + } } diff --git a/src/test/java/org/opensrp/service/TaskGeneratorTest.java b/src/test/java/org/opensrp/service/TaskGeneratorTest.java index 18200c1df..7af5cec21 100644 --- a/src/test/java/org/opensrp/service/TaskGeneratorTest.java +++ b/src/test/java/org/opensrp/service/TaskGeneratorTest.java @@ -15,55 +15,55 @@ public class TaskGeneratorTest { - @Rule - public MockitoRule rule = MockitoJUnit.rule(); + @Rule + public MockitoRule rule = MockitoJUnit.rule(); - private TaskGenerator taskGenerator; + private TaskGenerator taskGenerator; - @Before - public void setUp() { - MockitoAnnotations.initMocks(this); - taskGenerator = new TaskGenerator(); - } + @Before + public void setUp() { + MockitoAnnotations.initMocks(this); + taskGenerator = new TaskGenerator(); + } - @Test - public void testIsInternalTaskGenerationPlanWithInternalTaskGenerationStatusReturnsTrue() { + @Test + public void testIsInternalTaskGenerationPlanWithInternalTaskGenerationStatusReturnsTrue() { - PlanDefinition plan = new PlanDefinition(); - plan.setIdentifier("plan-id-1"); - plan.setStatus(PlanDefinition.PlanStatus.ACTIVE); - Period executionPeriod = new Period(); - executionPeriod.setEnd(new LocalDate().plusYears(2).toDateTimeAtStartOfDay()); - plan.setEffectivePeriod(executionPeriod); - PlanDefinition.UseContext useContext = new PlanDefinition.UseContext(); - useContext.setCode("taskGenerationStatus"); - useContext.setValueCodableConcept("internal"); - plan.setUseContext(Collections.singletonList(useContext)); + PlanDefinition plan = new PlanDefinition(); + plan.setIdentifier("plan-id-1"); + plan.setStatus(PlanDefinition.PlanStatus.ACTIVE); + Period executionPeriod = new Period(); + executionPeriod.setEnd(new LocalDate().plusYears(2).toDateTimeAtStartOfDay()); + plan.setEffectivePeriod(executionPeriod); + PlanDefinition.UseContext useContext = new PlanDefinition.UseContext(); + useContext.setCode("taskGenerationStatus"); + useContext.setValueCodableConcept("internal"); + plan.setUseContext(Collections.singletonList(useContext)); - boolean isInternalTaskGeneration = taskGenerator.isInternalTaskGeneration(plan); + boolean isInternalTaskGeneration = taskGenerator.isInternalTaskGeneration(plan); - Assert.assertTrue(isInternalTaskGeneration); + Assert.assertTrue(isInternalTaskGeneration); - } + } - @Test - public void testIsInternalTaskGenerationPlanWithoutInternalTaskGenerationStatusReturnsTrue() { + @Test + public void testIsInternalTaskGenerationPlanWithoutInternalTaskGenerationStatusReturnsTrue() { - PlanDefinition plan = new PlanDefinition(); - plan.setIdentifier("plan-id-1"); - plan.setStatus(PlanDefinition.PlanStatus.ACTIVE); - Period executionPeriod = new Period(); - executionPeriod.setEnd(new LocalDate().plusYears(2).toDateTimeAtStartOfDay()); - plan.setEffectivePeriod(executionPeriod); - PlanDefinition.UseContext useContext = new PlanDefinition.UseContext(); - useContext.setCode("taskGenerationStatus"); - useContext.setValueCodableConcept("True"); - plan.setUseContext(Collections.singletonList(useContext)); + PlanDefinition plan = new PlanDefinition(); + plan.setIdentifier("plan-id-1"); + plan.setStatus(PlanDefinition.PlanStatus.ACTIVE); + Period executionPeriod = new Period(); + executionPeriod.setEnd(new LocalDate().plusYears(2).toDateTimeAtStartOfDay()); + plan.setEffectivePeriod(executionPeriod); + PlanDefinition.UseContext useContext = new PlanDefinition.UseContext(); + useContext.setCode("taskGenerationStatus"); + useContext.setValueCodableConcept("True"); + plan.setUseContext(Collections.singletonList(useContext)); - boolean isInternalTaskGeneration = taskGenerator.isInternalTaskGeneration(plan); + boolean isInternalTaskGeneration = taskGenerator.isInternalTaskGeneration(plan); - Assert.assertFalse(isInternalTaskGeneration); + Assert.assertFalse(isInternalTaskGeneration); - } + } } diff --git a/src/test/java/org/opensrp/service/TaskServiceTest.java b/src/test/java/org/opensrp/service/TaskServiceTest.java index 4b116f972..da717d92f 100644 --- a/src/test/java/org/opensrp/service/TaskServiceTest.java +++ b/src/test/java/org/opensrp/service/TaskServiceTest.java @@ -26,282 +26,282 @@ import static org.mockito.Mockito.*; @RunWith(PowerMockRunner.class) -@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*","org.w3c.*"}) +@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*", "org.w3c.*"}) public class TaskServiceTest { - private static String dateFormat = "yyyy-MM-dd'T'HHmm"; - - private TaskService taskService; - - private TaskRepository taskRepository; - - @Before - public void setUp() { - taskRepository = mock(TaskRepository.class); - taskService = new TaskService(); - taskService.setTaskRepository(taskRepository); - } - - @Test - public void testGetAllTasks() { - List expected = new ArrayList<>(); - expected.add(initializeTask()); - when(taskRepository.getAll()).thenReturn(expected); - List tasks = taskService.getAllTasks(); - verify(taskRepository).getAll(); - assertEquals(1, tasks.size()); - assertEquals("tsk11231jh22", tasks.get(0).getIdentifier()); - } - - @Test - public void testAddOrUpdateTaskShouldUpdate() { - Task task = initializeTask(); - when(taskRepository.get("tsk11231jh22")).thenReturn(task); - taskService.addOrUpdateTask(task); - verify(taskRepository).update(task); - } - - @Test - public void testAddOrUpdateTaskShouldAdd() { - Task task = initializeTask(); - when(taskRepository.get("tsk11231jh22")).thenReturn(null); - taskService.addOrUpdateTask(task); - verify(taskRepository).add(task); - - } - - @Test(expected = IllegalArgumentException.class) - public void testAddOrUpdateTaskWithoutIdentifier() { - Task task = new Task(); - taskService.addOrUpdateTask(task); - - } - - @Test - public void testTaskExistsChecksRepo(){ - Task task = initializeTask(); - taskService.taskExists(task); - verify(taskRepository).checkIfTaskExists(eq(task.getForEntity()), eq(task.getGroupIdentifier()), eq(task.getPlanIdentifier()), eq(task.getCode())); - } - - @Test - public void testTaskExistsReturnsExpected(){ - Task task = initializeTask(); - when(taskRepository.checkIfTaskExists(eq(task.getForEntity()), eq(task.getGroupIdentifier()), eq(task.getPlanIdentifier()), eq(task.getCode()))) - .thenReturn(true); - assertTrue(taskService.taskExists(task)); - } - - @Test - public void testAddTaskChecksIfTaskExists(){ - Task task = initializeTask(); - taskService = spy(taskService); - taskService.addTask(task); - verify(taskService).taskExists(eq(task)); - } - - @Test - public void testAddTask() { - Task task = initializeTask(); - taskService.addTask(task); - verify(taskRepository).add(task); - } - - @Test - public void testAddTaskDoesNotDuplicate(){ - taskService = spy(taskService); - - doReturn(false, true, true, true, true) - .when(taskService) - .taskExists(any(Task.class)); - - Task task = initializeTask(); - taskService.addTask(task); - verify(taskRepository).add(task); - taskService.addTask(task); - taskService.addTask(task); - taskService.addTask(task); - verify(taskRepository, times(1)).add(task); - } - - @Test(expected = IllegalArgumentException.class) - public void testAddTaskWithoutIdentifier() { - Task task = new Task(); - taskService.addTask(task); - } - - @Test - public void testUpdateTask() { - Task task = initializeTask(); - taskService.updateTask(task); - verify(taskRepository).update(task); - } - - @Test(expected = IllegalArgumentException.class) - public void testUpdateTaskWithoutIdentifier() { - Task task = new Task(); - taskService.updateTask(task); - } - - @Test - public void testGetTask() { - Task expected = initializeTask(); - when(taskRepository.get("tsk11231jh22")).thenReturn(expected); - Task task = taskService.getTask("tsk11231jh22"); - - assertEquals("tsk11231jh22", task.getIdentifier()); - assertEquals("2018_IRS-3734{", task.getGroupIdentifier()); - assertEquals(TaskStatus.READY, task.getStatus()); - assertEquals("Not Visited", task.getBusinessStatus()); - assertEquals(TaskPriority.ROUTINE, task.getPriority()); - assertEquals("IRS", task.getCode()); - assertEquals("Spray House", task.getDescription()); - assertEquals("IRS Visit", task.getFocus()); - assertEquals("location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fc", task.getForEntity()); - assertEquals("2018-11-10T2200", task.getExecutionPeriod().getStart().toString(dateFormat)); - assertNull(task.getExecutionPeriod().getEnd()); - assertEquals("2018-10-31T0700", task.getAuthoredOn().toString(dateFormat)); - assertEquals("2018-10-31T0700", task.getLastModified().toString(dateFormat)); - assertEquals("demouser", task.getOwner()); - assertEquals(1, task.getNotes().size()); - assertEquals("demouser", task.getNotes().get(0).getAuthorString()); - assertEquals("2018-01-01T0800", task.getNotes().get(0).getTime().toString(dateFormat)); - assertEquals("This should be assigned to patrick.", task.getNotes().get(0).getText()); - } - - @Test - public void testGetTaskWithoutIdentifier() { - Task task = taskService.getTask(""); - verify(taskRepository, never()).get(anyString()); - assertNull(task); - } - - @Test - public void testGetTasksByCampaignAndGroup() { - Task task = initializeTask(); - List expected = new ArrayList<>(); - expected.add(task); - when(taskRepository.getTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 15421904649873l)) - .thenReturn(expected); - List tasks = taskService.getTasksByTaskAndGroup("IRS_2018_S1", "2018_IRS-3734", 15421904649873l); - verify(taskRepository).getTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 15421904649873l); - assertEquals(task, tasks.get(0)); - } - - private Task initializeTask() { - Gson gson = new GsonBuilder().registerTypeAdapter(DateTime.class, new TaskDateTimeTypeConverter()) - .serializeNulls().create(); - return gson.fromJson( - "{\"identifier\":\"tsk11231jh22\",\"campaignIdentifier\":\"IRS_2018_S1\",\"groupIdentifier\":\"2018_IRS-3734{\",\"status\":\"Ready\",\"businessStatus\":\"Not Visited\",\"priority\":\"routine\",\"code\":\"IRS\",\"description\":\"Spray House\",\"focus\":\"IRS Visit\",\"for\":\"location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fc\",\"executionPeriod\":{\"start\":\"2018-11-10T2200\",\"end\":null},\"authoredOn\":\"2018-10-31T0700\",\"lastModified\":\"2018-10-31T0700\",\"owner\":\"demouser\",\"note\":[{\"authorString\":\"demouser\",\"time\":\"2018-01-01T0800\",\"text\":\"This should be assigned to patrick.\"}],\"serverVersion\":0}", - Task.class); - - } - - @Test - public void updateTaskStatus() { - - long now = System.currentTimeMillis(); - Task task = initializeTask(); - List updates = new ArrayList<>(); - TaskUpdate taskUpdate = new TaskUpdate(); - taskUpdate.setIdentifier("tsk11231jh22"); - taskUpdate.setBusinessStatus("Not Sprayable"); - taskUpdate.setServerVersion(now); - taskUpdate.setStatus(TaskStatus.COMPLETED.name()); - updates.add(taskUpdate); - when(taskRepository.get("tsk11231jh22")).thenReturn(task); - taskService.updateTaskStatus(updates); - assertEquals(now, taskUpdate.getServerVersion().longValue()); - - ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(Task.class); - verify(taskRepository).update(argumentCaptor.capture()); - assertEquals(0l,argumentCaptor.getValue().getServerVersion().longValue()); - assertEquals("Not Sprayable", argumentCaptor.getValue().getBusinessStatus()); - - assertEquals("tsk11231jh22", task.getIdentifier()); - assertEquals("2018_IRS-3734{", task.getGroupIdentifier()); - assertEquals(TaskPriority.ROUTINE, task.getPriority()); - assertEquals("IRS", task.getCode()); - assertEquals("Spray House", task.getDescription()); - assertEquals("IRS Visit", task.getFocus()); - assertEquals("location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fc", task.getForEntity()); - assertEquals("2018-11-10T2200", task.getExecutionPeriod().getStart().toString(dateFormat)); - assertNull(task.getExecutionPeriod().getEnd()); - assertEquals("2018-10-31T0700", task.getAuthoredOn().toString(dateFormat)); - assertEquals("demouser", task.getOwner()); - assertEquals(1, task.getNotes().size()); - assertEquals("demouser", task.getNotes().get(0).getAuthorString()); - assertEquals("2018-01-01T0800", task.getNotes().get(0).getTime().toString(dateFormat)); - assertEquals("This should be assigned to patrick.", task.getNotes().get(0).getText()); - } - - @Test - public void testFindAllTaskIds() { - List expectedTaskIds = new ArrayList<>(); - expectedTaskIds.add("task1"); - expectedTaskIds.add("task2"); - Pair, Long> idsModel = Pair.of(expectedTaskIds, 1234l); - - when(taskRepository.findAllIds(anyLong(), anyInt())).thenReturn(idsModel); - Pair, Long> actualIdsModels = taskService.findAllTaskIds(0l, 10); - List actualTaskIds = actualIdsModels.getLeft(); - - verify(taskRepository).findAllIds(0l, 10); - assertEquals(2, actualTaskIds.size()); - assertEquals(expectedTaskIds.get(0), actualTaskIds.get(0)); - assertEquals(expectedTaskIds.get(1), actualTaskIds.get(1)); - } - - @Test - public void testGetTasksByPlanAndOwner() { - Task task = initializeTask(); - List expected = new ArrayList<>(); - expected.add(task); - when(taskRepository.getTasksByPlanAndOwner("IRS_2018_S1", "demouser", 15421904649873l)) - .thenReturn(expected); - List tasks = taskService.getTasksByPlanAndOwner("IRS_2018_S1", "demouser", 15421904649873l); - verify(taskRepository).getTasksByPlanAndOwner("IRS_2018_S1", "demouser", 15421904649873l); - assertEquals(task, tasks.get(0)); - } - - @Test - public void testCountTasksByPlanAndOwner() { - when(taskRepository.countTasksByPlanAndOwner("IRS_2018_S1", "demouser", 15421904649873l)) - .thenReturn(4l); - Long tasks = taskService.countTasksByPlanAndOwner("IRS_2018_S1", "demouser", 15421904649873l); - verify(taskRepository).countTasksByPlanAndOwner("IRS_2018_S1", "demouser", 15421904649873l); - assertEquals(4, tasks.longValue()); - } - - @Test - public void testCountTasksByPlanAndGroup() { - when(taskRepository.countTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 15421904649873l)) - .thenReturn(7l); - Long tasks = taskService.countTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 15421904649873l); - verify(taskRepository).countTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 15421904649873l); - assertEquals(7, tasks.longValue()); - } - - @Test - public void testGetTasksBySearchBean() { - List tasks = new ArrayList<>(); - tasks.add(initializeTask()); - TaskSearchBean taskSearchBean = new TaskSearchBean(); - taskSearchBean.setPlanIdentifier("IRS_2018_S1"); - when(taskRepository.getTasksBySearchBean(any(TaskSearchBean.class))).thenReturn(tasks); - List result = taskService.getTasksBySearchBean(taskSearchBean); - verify(taskRepository).getTasksBySearchBean(taskSearchBean); - assertEquals(1, result.size()); - } - - @Test - public void testFindTaskCountBySearchBean() { - TaskSearchBean taskSearchBean = new TaskSearchBean(); - taskSearchBean.setPlanIdentifier("IRS_2018_S1"); - when(taskRepository.getTaskCount(any(TaskSearchBean.class))).thenReturn(1); - int count = taskService.findTaskCountBySearchBean(taskSearchBean); - verify(taskRepository).getTaskCount(taskSearchBean); - assertEquals(1, count); - } + private static String dateFormat = "yyyy-MM-dd'T'HHmm"; + + private TaskService taskService; + + private TaskRepository taskRepository; + + @Before + public void setUp() { + taskRepository = mock(TaskRepository.class); + taskService = new TaskService(); + taskService.setTaskRepository(taskRepository); + } + + @Test + public void testGetAllTasks() { + List expected = new ArrayList<>(); + expected.add(initializeTask()); + when(taskRepository.getAll()).thenReturn(expected); + List tasks = taskService.getAllTasks(); + verify(taskRepository).getAll(); + assertEquals(1, tasks.size()); + assertEquals("tsk11231jh22", tasks.get(0).getIdentifier()); + } + + @Test + public void testAddOrUpdateTaskShouldUpdate() { + Task task = initializeTask(); + when(taskRepository.get("tsk11231jh22")).thenReturn(task); + taskService.addOrUpdateTask(task); + verify(taskRepository).update(task); + } + + @Test + public void testAddOrUpdateTaskShouldAdd() { + Task task = initializeTask(); + when(taskRepository.get("tsk11231jh22")).thenReturn(null); + taskService.addOrUpdateTask(task); + verify(taskRepository).add(task); + + } + + @Test(expected = IllegalArgumentException.class) + public void testAddOrUpdateTaskWithoutIdentifier() { + Task task = new Task(); + taskService.addOrUpdateTask(task); + + } + + @Test + public void testTaskExistsChecksRepo() { + Task task = initializeTask(); + taskService.taskExists(task); + verify(taskRepository).checkIfTaskExists(eq(task.getForEntity()), eq(task.getGroupIdentifier()), eq(task.getPlanIdentifier()), eq(task.getCode())); + } + + @Test + public void testTaskExistsReturnsExpected() { + Task task = initializeTask(); + when(taskRepository.checkIfTaskExists(eq(task.getForEntity()), eq(task.getGroupIdentifier()), eq(task.getPlanIdentifier()), eq(task.getCode()))) + .thenReturn(true); + assertTrue(taskService.taskExists(task)); + } + + @Test + public void testAddTaskChecksIfTaskExists() { + Task task = initializeTask(); + taskService = spy(taskService); + taskService.addTask(task); + verify(taskService).taskExists(eq(task)); + } + + @Test + public void testAddTask() { + Task task = initializeTask(); + taskService.addTask(task); + verify(taskRepository).add(task); + } + + @Test + public void testAddTaskDoesNotDuplicate() { + taskService = spy(taskService); + + doReturn(false, true, true, true, true) + .when(taskService) + .taskExists(any(Task.class)); + + Task task = initializeTask(); + taskService.addTask(task); + verify(taskRepository).add(task); + taskService.addTask(task); + taskService.addTask(task); + taskService.addTask(task); + verify(taskRepository, times(1)).add(task); + } + + @Test(expected = IllegalArgumentException.class) + public void testAddTaskWithoutIdentifier() { + Task task = new Task(); + taskService.addTask(task); + } + + @Test + public void testUpdateTask() { + Task task = initializeTask(); + taskService.updateTask(task); + verify(taskRepository).update(task); + } + + @Test(expected = IllegalArgumentException.class) + public void testUpdateTaskWithoutIdentifier() { + Task task = new Task(); + taskService.updateTask(task); + } + + @Test + public void testGetTask() { + Task expected = initializeTask(); + when(taskRepository.get("tsk11231jh22")).thenReturn(expected); + Task task = taskService.getTask("tsk11231jh22"); + + assertEquals("tsk11231jh22", task.getIdentifier()); + assertEquals("2018_IRS-3734{", task.getGroupIdentifier()); + assertEquals(TaskStatus.READY, task.getStatus()); + assertEquals("Not Visited", task.getBusinessStatus()); + assertEquals(TaskPriority.ROUTINE, task.getPriority()); + assertEquals("IRS", task.getCode()); + assertEquals("Spray House", task.getDescription()); + assertEquals("IRS Visit", task.getFocus()); + assertEquals("location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fc", task.getForEntity()); + assertEquals("2018-11-10T2200", task.getExecutionPeriod().getStart().toString(dateFormat)); + assertNull(task.getExecutionPeriod().getEnd()); + assertEquals("2018-10-31T0700", task.getAuthoredOn().toString(dateFormat)); + assertEquals("2018-10-31T0700", task.getLastModified().toString(dateFormat)); + assertEquals("demouser", task.getOwner()); + assertEquals(1, task.getNotes().size()); + assertEquals("demouser", task.getNotes().get(0).getAuthorString()); + assertEquals("2018-01-01T0800", task.getNotes().get(0).getTime().toString(dateFormat)); + assertEquals("This should be assigned to patrick.", task.getNotes().get(0).getText()); + } + + @Test + public void testGetTaskWithoutIdentifier() { + Task task = taskService.getTask(""); + verify(taskRepository, never()).get(anyString()); + assertNull(task); + } + + @Test + public void testGetTasksByCampaignAndGroup() { + Task task = initializeTask(); + List expected = new ArrayList<>(); + expected.add(task); + when(taskRepository.getTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 15421904649873l)) + .thenReturn(expected); + List tasks = taskService.getTasksByTaskAndGroup("IRS_2018_S1", "2018_IRS-3734", 15421904649873l); + verify(taskRepository).getTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 15421904649873l); + assertEquals(task, tasks.get(0)); + } + + private Task initializeTask() { + Gson gson = new GsonBuilder().registerTypeAdapter(DateTime.class, new TaskDateTimeTypeConverter()) + .serializeNulls().create(); + return gson.fromJson( + "{\"identifier\":\"tsk11231jh22\",\"campaignIdentifier\":\"IRS_2018_S1\",\"groupIdentifier\":\"2018_IRS-3734{\",\"status\":\"Ready\",\"businessStatus\":\"Not Visited\",\"priority\":\"routine\",\"code\":\"IRS\",\"description\":\"Spray House\",\"focus\":\"IRS Visit\",\"for\":\"location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fc\",\"executionPeriod\":{\"start\":\"2018-11-10T2200\",\"end\":null},\"authoredOn\":\"2018-10-31T0700\",\"lastModified\":\"2018-10-31T0700\",\"owner\":\"demouser\",\"note\":[{\"authorString\":\"demouser\",\"time\":\"2018-01-01T0800\",\"text\":\"This should be assigned to patrick.\"}],\"serverVersion\":0}", + Task.class); + + } + + @Test + public void updateTaskStatus() { + + long now = System.currentTimeMillis(); + Task task = initializeTask(); + List updates = new ArrayList<>(); + TaskUpdate taskUpdate = new TaskUpdate(); + taskUpdate.setIdentifier("tsk11231jh22"); + taskUpdate.setBusinessStatus("Not Sprayable"); + taskUpdate.setServerVersion(now); + taskUpdate.setStatus(TaskStatus.COMPLETED.name()); + updates.add(taskUpdate); + when(taskRepository.get("tsk11231jh22")).thenReturn(task); + taskService.updateTaskStatus(updates); + assertEquals(now, taskUpdate.getServerVersion().longValue()); + + ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(Task.class); + verify(taskRepository).update(argumentCaptor.capture()); + assertEquals(0l, argumentCaptor.getValue().getServerVersion().longValue()); + assertEquals("Not Sprayable", argumentCaptor.getValue().getBusinessStatus()); + + assertEquals("tsk11231jh22", task.getIdentifier()); + assertEquals("2018_IRS-3734{", task.getGroupIdentifier()); + assertEquals(TaskPriority.ROUTINE, task.getPriority()); + assertEquals("IRS", task.getCode()); + assertEquals("Spray House", task.getDescription()); + assertEquals("IRS Visit", task.getFocus()); + assertEquals("location.properties.uid:41587456-b7c8-4c4e-b433-23a786f742fc", task.getForEntity()); + assertEquals("2018-11-10T2200", task.getExecutionPeriod().getStart().toString(dateFormat)); + assertNull(task.getExecutionPeriod().getEnd()); + assertEquals("2018-10-31T0700", task.getAuthoredOn().toString(dateFormat)); + assertEquals("demouser", task.getOwner()); + assertEquals(1, task.getNotes().size()); + assertEquals("demouser", task.getNotes().get(0).getAuthorString()); + assertEquals("2018-01-01T0800", task.getNotes().get(0).getTime().toString(dateFormat)); + assertEquals("This should be assigned to patrick.", task.getNotes().get(0).getText()); + } + + @Test + public void testFindAllTaskIds() { + List expectedTaskIds = new ArrayList<>(); + expectedTaskIds.add("task1"); + expectedTaskIds.add("task2"); + Pair, Long> idsModel = Pair.of(expectedTaskIds, 1234l); + + when(taskRepository.findAllIds(anyLong(), anyInt())).thenReturn(idsModel); + Pair, Long> actualIdsModels = taskService.findAllTaskIds(0l, 10); + List actualTaskIds = actualIdsModels.getLeft(); + + verify(taskRepository).findAllIds(0l, 10); + assertEquals(2, actualTaskIds.size()); + assertEquals(expectedTaskIds.get(0), actualTaskIds.get(0)); + assertEquals(expectedTaskIds.get(1), actualTaskIds.get(1)); + } + + @Test + public void testGetTasksByPlanAndOwner() { + Task task = initializeTask(); + List expected = new ArrayList<>(); + expected.add(task); + when(taskRepository.getTasksByPlanAndOwner("IRS_2018_S1", "demouser", 15421904649873l)) + .thenReturn(expected); + List tasks = taskService.getTasksByPlanAndOwner("IRS_2018_S1", "demouser", 15421904649873l); + verify(taskRepository).getTasksByPlanAndOwner("IRS_2018_S1", "demouser", 15421904649873l); + assertEquals(task, tasks.get(0)); + } + + @Test + public void testCountTasksByPlanAndOwner() { + when(taskRepository.countTasksByPlanAndOwner("IRS_2018_S1", "demouser", 15421904649873l)) + .thenReturn(4l); + Long tasks = taskService.countTasksByPlanAndOwner("IRS_2018_S1", "demouser", 15421904649873l); + verify(taskRepository).countTasksByPlanAndOwner("IRS_2018_S1", "demouser", 15421904649873l); + assertEquals(4, tasks.longValue()); + } + + @Test + public void testCountTasksByPlanAndGroup() { + when(taskRepository.countTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 15421904649873l)) + .thenReturn(7l); + Long tasks = taskService.countTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 15421904649873l); + verify(taskRepository).countTasksByPlanAndGroup("IRS_2018_S1", "2018_IRS-3734", 15421904649873l); + assertEquals(7, tasks.longValue()); + } + + @Test + public void testGetTasksBySearchBean() { + List tasks = new ArrayList<>(); + tasks.add(initializeTask()); + TaskSearchBean taskSearchBean = new TaskSearchBean(); + taskSearchBean.setPlanIdentifier("IRS_2018_S1"); + when(taskRepository.getTasksBySearchBean(any(TaskSearchBean.class))).thenReturn(tasks); + List result = taskService.getTasksBySearchBean(taskSearchBean); + verify(taskRepository).getTasksBySearchBean(taskSearchBean); + assertEquals(1, result.size()); + } + + @Test + public void testFindTaskCountBySearchBean() { + TaskSearchBean taskSearchBean = new TaskSearchBean(); + taskSearchBean.setPlanIdentifier("IRS_2018_S1"); + when(taskRepository.getTaskCount(any(TaskSearchBean.class))).thenReturn(1); + int count = taskService.findTaskCountBySearchBean(taskSearchBean); + verify(taskRepository).getTaskCount(taskSearchBean); + assertEquals(1, count); + } } diff --git a/src/test/java/org/opensrp/service/UniqueIdentifierServiceTest.java b/src/test/java/org/opensrp/service/UniqueIdentifierServiceTest.java index 53575fdc6..fab1d7143 100644 --- a/src/test/java/org/opensrp/service/UniqueIdentifierServiceTest.java +++ b/src/test/java/org/opensrp/service/UniqueIdentifierServiceTest.java @@ -4,11 +4,14 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; + import static org.mockito.MockitoAnnotations.initMocks; + import org.opensrp.domain.IdentifierSource; import org.opensrp.domain.UniqueId; import org.opensrp.repository.UniqueIdRepository; import org.opensrp.generator.UniqueIdGeneratorProcessor; + import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyString; @@ -28,62 +31,62 @@ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:test-applicationContext-opensrp.xml") -@ActiveProfiles(profiles = { "jedis"}) +@ActiveProfiles(profiles = {"jedis"}) public class UniqueIdentifierServiceTest { - @Mock - private UniqueIdGeneratorProcessor uniqueIdGeneratorProcessor; - - @Mock - private UniqueIdRepository uniqueIdRepository; - - private UniqueIdentifierService uniqueIdentifierService; - - @Before - public void setUp() { - initMocks(this); - uniqueIdentifierService = new UniqueIdentifierService(uniqueIdGeneratorProcessor); - } - - @Test - public void testGenerateIdentifiers() { - List expectedIds = new ArrayList<>(); - expectedIds.add("B2A1-4"); - Set reservedIds = new HashSet<>(); - IdentifierSource identifierSource = createIdentifierSource(); - when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); - when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); - when(uniqueIdGeneratorProcessor.getIdentifiers(any(IdentifierSource.class),anyInt(),anyString())).thenReturn(expectedIds); - List actualIds = uniqueIdentifierService.generateIdentifiers(identifierSource,1,"test"); - assertEquals(actualIds.size(),expectedIds.size()); - assertEquals(actualIds.get(0),expectedIds.get(0)); - } - - @Test(expected = Exception.class) - public void testGenerateIdentifiersThrowsException() { - List expectedIds = new ArrayList<>(); - expectedIds.add("B2A1-4"); - Set reservedIds = new HashSet<>(); - IdentifierSource identifierSource = createIdentifierSource(); - when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); - when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); - when(uniqueIdGeneratorProcessor.getIdentifiers(any(IdentifierSource.class),anyInt(),anyString())).thenThrow(new Exception("Exception")); - uniqueIdentifierService.generateIdentifiers(identifierSource,1,"test"); - } - - private IdentifierSource createIdentifierSource() { - IdentifierSource identifierSource = new IdentifierSource(); - identifierSource.setId(1l); - identifierSource.setIdentifier("Test-1"); - identifierSource.setBaseCharacterSet("AB12"); - identifierSource.setMinLength(4); - identifierSource.setMaxLength(4); - return identifierSource; - } - - private UniqueId createUniqueId() { - UniqueId uniqueId = new UniqueId(); - uniqueId.setId(120l); - return uniqueId; - } + @Mock + private UniqueIdGeneratorProcessor uniqueIdGeneratorProcessor; + + @Mock + private UniqueIdRepository uniqueIdRepository; + + private UniqueIdentifierService uniqueIdentifierService; + + @Before + public void setUp() { + initMocks(this); + uniqueIdentifierService = new UniqueIdentifierService(uniqueIdGeneratorProcessor); + } + + @Test + public void testGenerateIdentifiers() { + List expectedIds = new ArrayList<>(); + expectedIds.add("B2A1-4"); + Set reservedIds = new HashSet<>(); + IdentifierSource identifierSource = createIdentifierSource(); + when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); + when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); + when(uniqueIdGeneratorProcessor.getIdentifiers(any(IdentifierSource.class), anyInt(), anyString())).thenReturn(expectedIds); + List actualIds = uniqueIdentifierService.generateIdentifiers(identifierSource, 1, "test"); + assertEquals(actualIds.size(), expectedIds.size()); + assertEquals(actualIds.get(0), expectedIds.get(0)); + } + + @Test(expected = Exception.class) + public void testGenerateIdentifiersThrowsException() { + List expectedIds = new ArrayList<>(); + expectedIds.add("B2A1-4"); + Set reservedIds = new HashSet<>(); + IdentifierSource identifierSource = createIdentifierSource(); + when(uniqueIdRepository.findByIdentifierSourceOrderByIdDesc(anyLong())).thenReturn(createUniqueId()); + when(uniqueIdRepository.findReservedIdentifiers()).thenReturn(reservedIds); + when(uniqueIdGeneratorProcessor.getIdentifiers(any(IdentifierSource.class), anyInt(), anyString())).thenThrow(new Exception("Exception")); + uniqueIdentifierService.generateIdentifiers(identifierSource, 1, "test"); + } + + private IdentifierSource createIdentifierSource() { + IdentifierSource identifierSource = new IdentifierSource(); + identifierSource.setId(1l); + identifierSource.setIdentifier("Test-1"); + identifierSource.setBaseCharacterSet("AB12"); + identifierSource.setMinLength(4); + identifierSource.setMaxLength(4); + return identifierSource; + } + + private UniqueId createUniqueId() { + UniqueId uniqueId = new UniqueId(); + uniqueId.setId(120l); + return uniqueId; + } } diff --git a/src/test/java/org/opensrp/service/UploadServiceTest.java b/src/test/java/org/opensrp/service/UploadServiceTest.java index f4b9b2532..a33ec5481 100644 --- a/src/test/java/org/opensrp/service/UploadServiceTest.java +++ b/src/test/java/org/opensrp/service/UploadServiceTest.java @@ -67,7 +67,7 @@ public void testValidateFieldValues() { LocationProperty locationProperty = new LocationProperty(); locationProperty.setParentId("e6007660-ef0a-4dd9-b8f2-1bc9e21c4ab2"); structure.setProperties(locationProperty); - Mockito.doReturn(structure).when(locationRepository).getStructure("school_id_1",false); + Mockito.doReturn(structure).when(locationRepository).getStructure("school_id_1", false); List> csvClients = new ArrayList<>(); diff --git a/src/test/java/org/opensrp/service/formSubmission/EventListenerTest.java b/src/test/java/org/opensrp/service/formSubmission/EventListenerTest.java index 3bd38e399..c6a14a071 100644 --- a/src/test/java/org/opensrp/service/formSubmission/EventListenerTest.java +++ b/src/test/java/org/opensrp/service/formSubmission/EventListenerTest.java @@ -38,87 +38,87 @@ import org.smartregister.domain.Event; public class EventListenerTest { - - @Rule - public MockitoRule rule = MockitoJUnit.rule(); - - @Mock - private ConfigService configService; - - @Mock - private EventsRepository allEvents; - - @Mock - private ClientsRepository allClients; - - @Mock - private ErrorTraceService errorTraceService; - - @Mock - private ClientService clientService; - - @Mock - private IHandlerMapper handlerMapper; - - @Mock - private PlanRepository planRepository; - - @Mock - private ExportEventDataMapper exportEventDataMapper; - - @Mock - private TaskGenerator taskGenerator; - - private EventService eventService; - - private EventsRouter eventsRouter; - - private EventsListener eventsListener; - - @Before - public void setUp() { - when(configService.registerAppStateToken(any(AllConstants.Config.class), any(), anyString(), - anyBoolean())).thenReturn(new AppStateToken("token", 01l, 02l)); - eventsRouter = spy(new EventsRouter(handlerMapper, "/schedules/schedule-configs")); - eventService = spy(new EventService(allEvents, clientService, taskGenerator, planRepository, exportEventDataMapper)); - eventsListener = new EventsListener(eventsRouter, configService, eventService, errorTraceService); - } - - @Test - public void shouldHandleNewEvent() throws Exception { - EventsHandler eventHandler = mock(EventsHandler.class); - Map handlerMap = new HashMap<>(); - handlerMap.put("VaccinesScheduleHandler", eventHandler); - - List clients = asList(new Client("2222")); - List events = asList( - new Event().withIdentifier(AllConstants.Client.ZEIR_ID.toUpperCase(), "2").withEventType("Vaccination"), - new Event()); - - when(configService.getAppStateTokenByName(AllConstants.Config.EVENTS_PARSER_LAST_PROCESSED_EVENT)) - .thenReturn(new AppStateToken("token", 1l, 0l)); - when(allEvents.findByServerVersion(1l)).thenReturn(events); - when(clientService.findAllByIdentifier(AllConstants.Client.ZEIR_ID.toUpperCase(), "2")).thenReturn(clients); - when(allEvents.findByBaseEntityAndType("222", "Birth Registration")).thenReturn(events); - - when(handlerMapper.handlerMap()).thenReturn(handlerMap); - - EventsListener spyEventListener = spy(eventsListener); - when(spyEventListener.getCurrentMilliseconds()).thenReturn(0l); - - spyEventListener.processEvent(); - - InOrder inOrder = inOrder(eventService, eventsRouter, eventHandler); - clients.get(0).setServerVersion(System.currentTimeMillis()); - events.get(0).setServerVersion(System.currentTimeMillis()); - inOrder.verify(eventService).processOutOfArea(events.get(0)); - inOrder.verify(eventsRouter).route(events.get(0)); - - } - - @Test - public void testComparator() { - - } - + + @Rule + public MockitoRule rule = MockitoJUnit.rule(); + + @Mock + private ConfigService configService; + + @Mock + private EventsRepository allEvents; + + @Mock + private ClientsRepository allClients; + + @Mock + private ErrorTraceService errorTraceService; + + @Mock + private ClientService clientService; + + @Mock + private IHandlerMapper handlerMapper; + + @Mock + private PlanRepository planRepository; + + @Mock + private ExportEventDataMapper exportEventDataMapper; + + @Mock + private TaskGenerator taskGenerator; + + private EventService eventService; + + private EventsRouter eventsRouter; + + private EventsListener eventsListener; + + @Before + public void setUp() { + when(configService.registerAppStateToken(any(AllConstants.Config.class), any(), anyString(), + anyBoolean())).thenReturn(new AppStateToken("token", 01l, 02l)); + eventsRouter = spy(new EventsRouter(handlerMapper, "/schedules/schedule-configs")); + eventService = spy(new EventService(allEvents, clientService, taskGenerator, planRepository, exportEventDataMapper)); + eventsListener = new EventsListener(eventsRouter, configService, eventService, errorTraceService); + } + + @Test + public void shouldHandleNewEvent() throws Exception { + EventsHandler eventHandler = mock(EventsHandler.class); + Map handlerMap = new HashMap<>(); + handlerMap.put("VaccinesScheduleHandler", eventHandler); + + List clients = asList(new Client("2222")); + List events = asList( + new Event().withIdentifier(AllConstants.Client.ZEIR_ID.toUpperCase(), "2").withEventType("Vaccination"), + new Event()); + + when(configService.getAppStateTokenByName(AllConstants.Config.EVENTS_PARSER_LAST_PROCESSED_EVENT)) + .thenReturn(new AppStateToken("token", 1l, 0l)); + when(allEvents.findByServerVersion(1l)).thenReturn(events); + when(clientService.findAllByIdentifier(AllConstants.Client.ZEIR_ID.toUpperCase(), "2")).thenReturn(clients); + when(allEvents.findByBaseEntityAndType("222", "Birth Registration")).thenReturn(events); + + when(handlerMapper.handlerMap()).thenReturn(handlerMap); + + EventsListener spyEventListener = spy(eventsListener); + when(spyEventListener.getCurrentMilliseconds()).thenReturn(0l); + + spyEventListener.processEvent(); + + InOrder inOrder = inOrder(eventService, eventsRouter, eventHandler); + clients.get(0).setServerVersion(System.currentTimeMillis()); + events.get(0).setServerVersion(System.currentTimeMillis()); + inOrder.verify(eventService).processOutOfArea(events.get(0)); + inOrder.verify(eventsRouter).route(events.get(0)); + + } + + @Test + public void testComparator() { + + } + } diff --git a/src/test/java/org/opensrp/service/it/ClientServiceTest.java b/src/test/java/org/opensrp/service/it/ClientServiceTest.java index f55991282..9ce453020 100644 --- a/src/test/java/org/opensrp/service/it/ClientServiceTest.java +++ b/src/test/java/org/opensrp/service/it/ClientServiceTest.java @@ -41,508 +41,508 @@ //TODO: Write couch-lucene related method test cases e.g: findByCriteria public class ClientServiceTest extends BaseIntegrationTest { - - @Autowired - private ClientsRepositoryImpl allClients; - - @Autowired - private ClientService clientService; - - @Before - public void setUp() { - allClients.removeAll(); - } - - @After - public void cleanUp() { - allClients.removeAll(); - } - - @Test - public void shouldFindByBaeEntityId() { - String baseEntityId = "baseEntityId"; - Client expectedClient = new Client(baseEntityId); - Client invalidClient = new Client("b2"); - Client invalidClientSecond = new Client("b3"); - List clientList = asList(expectedClient, invalidClient, invalidClientSecond); - addObjectToRepository(clientList, allClients); - - Client actualClient = clientService.getByBaseEntityId(baseEntityId); - - assertEquals(expectedClient, actualClient); - } - - @Test - public void shouldFindAllClient() { - Client expectedClient = new Client("b1"); - Client expectedClient2 = new Client("b2"); - Client expectedClient3 = new Client("b3"); - List expectedClientList = asList(expectedClient, expectedClient2, expectedClient3); - addObjectToRepository(expectedClientList, allClients); - - List actualClientList = clientService.findAllClients(); - - assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); - - } - - @Test - public void shouldFindAllClientsByIdentifierValue() { - Client expectedClient = new Client("b1"); - expectedClient.addIdentifier("type", "value"); - Client expectedClient2 = new Client("b2"); - expectedClient2.addIdentifier("type", "value"); - Client invalidClient = new Client("b3"); - invalidClient.addIdentifier("type2", "value2"); - addObjectToRepository(asList(expectedClient, expectedClient2, invalidClient), allClients); - List expectedClientList = asList(expectedClient, expectedClient2); - - List actualClientList = clientService.findAllByIdentifier("value"); - - assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); - } - - @Test - public void shouldFindAllClientsByIdentifierTypeAndValue() { - Client expectedClient = new Client("b1"); - expectedClient.addIdentifier("type", "value"); - Client expectedClient2 = new Client("b2"); - expectedClient2.addIdentifier("type", "value"); - Client invalidClient = new Client("b3"); - invalidClient.addIdentifier("type2", "value2"); - addObjectToRepository(asList(expectedClient, expectedClient2, invalidClient), allClients); - List expectedClientList = asList(expectedClient, expectedClient2); - - List actualClientList = clientService.findAllByIdentifier("type", "value"); - assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); - } - - @Test - public void shouldFindAllClientsByRelationIdAndDateCreated() { - Client expectedClient = new Client("b1"); - expectedClient.addRelationship("mother", "id"); - expectedClient.setDateCreated(new DateTime(100L, DateTimeZone.UTC)); - Client expectedClient2 = new Client("b2"); - expectedClient2.addRelationship("mother", "id"); - expectedClient2.setDateCreated(new DateTime(200L, DateTimeZone.UTC)); - Client invalidClient = new Client("b3"); - invalidClient.addRelationship("mother", "id2"); - expectedClient.setDateCreated(new DateTime(300L, DateTimeZone.UTC)); - addObjectToRepository(asList(expectedClient, expectedClient2, invalidClient), allClients); - List expectedClientList = asList(expectedClient, expectedClient2); - - List actualClientList = clientService.findByRelationshipIdAndDateCreated("id", new DateTime(100L, - DateTimeZone.UTC).toLocalDate().toString(), new DateTime(200L, DateTimeZone.UTC).toLocalDate().toString()); - - assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); - } - - //TODO: Couch-lucene query error - @Test - @Ignore - public void shouldFindByRelationShip() { - Client expectedClient = getClient(); - expectedClient.addRelationship("mother", "id"); - expectedClient.setDateCreated(new DateTime(DateTimeZone.UTC)); - Client expectedClient2 = getClient(); - expectedClient2.setBaseEntityId("dd"); - expectedClient2.addRelationship("mother", "id"); - expectedClient2.setDateCreated(new DateTime(DateTimeZone.UTC)); - Client invalidClient = getClient(); - invalidClient.setBaseEntityId("ddss"); - invalidClient.addRelationship("mother", "id2"); - expectedClient.setDateCreated(new DateTime(DateTimeZone.UTC)); - addObjectToRepository(asList(expectedClient, expectedClient2, invalidClient), allClients); - List expectedClientList = asList(expectedClient, expectedClient2); - - List actualClientList = clientService.findByRelationship("id"); - - assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); - } - - @Test - public void shouldFindByAttributeTypeAndValue() { - Client expectedClient = new Client("b1"); - expectedClient.addAttribute("type", "value"); - Client expectedClient2 = new Client("b2"); - expectedClient2.addAttribute("type", "value"); - Client invalidClient = new Client("b3"); - invalidClient.addAttribute("type2", "value2"); - addObjectToRepository(asList(expectedClient, expectedClient2, invalidClient), allClients); - List expectedClientList = asList(expectedClient, expectedClient2); - - List actualClientList = clientService.findAllByAttribute("type", "value"); - assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); - } - - @Test - public void shouldFindByAttributeTypesAndValue() { - Client expectedClient = new Client("b1"); - expectedClient.addAttribute("type", "value"); - Client expectedClient2 = new Client("b2"); - expectedClient2.addAttribute("type", "value"); - Client invalidClient = new Client("b3"); - invalidClient.addAttribute("type2", "value2"); - addObjectToRepository(asList(expectedClient, expectedClient2, invalidClient), allClients); - List expectedClientList = asList(expectedClient, expectedClient2, invalidClient); - - List actualClientList = clientService.findAllByAttributes("type", - new ArrayList<>(asList("value", "value2"))); - assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); - } - - @Test - public void shouldFindAllMatchingName() { - Client expectedClient = new Client("b1"); - expectedClient.setFirstName("first"); - expectedClient.setLastName("last"); - Client expectedClient2 = new Client("b2"); - expectedClient2.setFirstName("first"); - expectedClient2.setLastName("last"); - Client invalidClient = new Client("b3"); - invalidClient.setFirstName("invalid"); - invalidClient.setLastName("invalid"); - addObjectToRepository(asList(expectedClient, expectedClient2, invalidClient), allClients); - List expectedClientList = asList(expectedClient, expectedClient2); - - List actualClientList = clientService.findAllByMatchingName("first"); - assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); - } - - /*@Test - @Ignore - public void shouldFindByAllCriteria() { - Client expectedClient = SampleFullDomainObject.client; - Client invalidClient = new Client(SampleFullDomainObject.BASE_ENTITY_ID); - invalidClient.setFirstName("invalid"); - invalidClient.setLastName("invalid"); - addObjectToRepository(asList(expectedClient, invalidClient), allClients); - List expectedClientList = asList(expectedClient); - - List actualClientList = clientService.findByCriteria(FIRST_NAME, ); - assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); - }*/ - //TODO: Repository is returning time in UTC format. - //TODO: TEST value of Date created field. - @Test - public void shouldAdd() { - Client expectedClient = getClient(); - - Client actualClient = clientService.addClient(expectedClient); - - List dbClients = allClients.getAll(); - assertEquals(1, dbClients.size()); - - assertEquals(expectedClient, actualClient); - assertNewObjectCreation(expectedClient, dbClients.get(0)); - } - - @Test(expected = RuntimeException.class) - public void shouldThrowRuntimeExceptionWhileAddIfNoBaseEntityIdFound() { - Client expectedClient = getClient(); - expectedClient.setBaseEntityId(null); - - clientService.addClient(expectedClient); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowIllegalArgumentExceptionIfAClientAlreadyExistWithSameIdentifier() { - - addObjectToRepository(Collections.singletonList(getClient()), allClients); - Client expectedClient = allClients.getAll().get(0); - expectedClient.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - - clientService.addClient(expectedClient); - } - - //TODO: Repository is returning time in UTC format. - //TODO: TEST value of Date created field. - @Test - public void shouldAddWithCouchDbConnector() throws IOException { - Client expectedClient = getClient(); - - Client actualClient = clientService.addClient(expectedClient); - - List dbClients = allClients.getAll(); - assertEquals(1, dbClients.size()); - assertNewObjectCreation(expectedClient, dbClients.get(0)); - assertEquals(expectedClient, actualClient); - - } - - @Test(expected = RuntimeException.class) - public void shouldThrowRuntimeExceptionWhileAddIfNoBaseEntityIdFoundWithCouchDbConnector() throws IOException { - Client expectedClient = getClient(); - expectedClient.setBaseEntityId(null); - clientService.addClient(expectedClient); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowIllegalArgumentExceptionIfAClientAlreadyExistWithSameIdentifierWithCouchDbConnector() - throws IOException { - Client expectedClient = getClient(); - addObjectToRepository(Collections.singletonList(expectedClient), allClients); - expectedClient.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - clientService.addClient(expectedClient); - } - - @Test - public void shouldFindFromClientObjectWithBaseIdentifier() { - Client expectedClient = getClient(); - addObjectToRepository(Collections.singletonList(expectedClient), allClients); - - Client actualClient = clientService.findClient(expectedClient); - - assertEquals(expectedClient, actualClient); - } - - @Test - public void shouldFindFromClientWithIdentifiers() { - Client expectedClient = getClient(); - expectedClient.setBaseEntityId(null); - addObjectToRepository(Collections.singletonList(expectedClient), allClients); - - Client actualClient = clientService.findClient(expectedClient); - - assertEquals(expectedClient, actualClient); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionIfMultipleClientFoundWithSameIdentifier() { - Client expectedClient = getClient(); - Client sameClient = getClient(); - sameClient.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - addObjectToRepository(asList(expectedClient, sameClient), allClients); - expectedClient.setBaseEntityId(null); - - clientService.findClient(expectedClient); - - } - - @Test - public void shouldReturnNullIfNoClientFound() { - Client expectedClient = getClient(); - - Client actualClient = clientService.findClient(expectedClient); - - assertNull(actualClient); - } - - @Test - public void shouldFindFromClientObjectWithBaseIdentifierWithCouchDbConnector() throws IOException { - Client expectedClient = getClient(); - addObjectToRepository(Collections.singletonList(expectedClient), allClients); - - Client actualClient = clientService.findClient(expectedClient); - - assertEquals(expectedClient, actualClient); - } - - @Test - public void shouldFindFromClientWithIdentifiersWithCouchDbConnector() throws IOException { - Client expectedClient = getClient(); - expectedClient.setBaseEntityId(null); - addObjectToRepository(Collections.singletonList(expectedClient), allClients); - - Client actualClient = clientService.findClient(expectedClient); - - assertEquals(expectedClient, actualClient); - } - - public void shouldReturnNullIfMultipleClientFoundWithSameIdentifierWithCouchDbConnector() throws IOException { - Client expectedClient = getClient(); - Client sameClient = getClient(); - sameClient.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - addObjectToRepository(asList(expectedClient, sameClient), allClients); - expectedClient.setBaseEntityId(null); - - Client client = clientService.findClient(expectedClient); - - assertNull(client); - - } - - @Test - public void shouldReturnNullIfNoClientFoundWithCouchDbConnector() throws IOException { - Client expectedClient = getClient(); - - Client actualClient = clientService.findClient(expectedClient); - - assertNull(actualClient); - } - - @Test - public void shouldFindByUniqueIdBaseEntityId() { - Client expectedClient = getClient(); - Client invalidClient = getClient(); - invalidClient.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - addObjectToRepository(asList(expectedClient, invalidClient), allClients); - - Client actualClient = clientService.find(BASE_ENTITY_ID); - - assertEquals(expectedClient, actualClient); - - } - - @Test - public void shouldFindByUniqueIdIdentifier() { - Client expectedClient = getClient(); - Client invalidClient = getClient(); - Map differentIdentifiers = new HashMap<>(identifier); - differentIdentifiers.put(IDENTIFIER_TYPE, "differentValue"); - invalidClient.setIdentifiers(differentIdentifiers); - addObjectToRepository(asList(expectedClient, invalidClient), allClients); - - Client actualClient = clientService.find(IDENTIFIER_VALUE); - - assertEquals(expectedClient, actualClient); - - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionIfMultipleClientFoundWithSameIdentifierUsingUniqueId() { - Client expectedClient = getClient(); - Client sameClient = getClient(); - sameClient.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - addObjectToRepository(asList(expectedClient, sameClient), allClients); - - clientService.find(IDENTIFIER_VALUE); - - } - - @Test - public void shouldReturnNullIfNoClientFoundUsingUniqueId() { - Client expectedClient = getClient(); - addObjectToRepository(Collections.singletonList(expectedClient), allClients); - Client actualClient = clientService.find(DIFFERENT_BASE_ENTITY_ID); - - assertNull(actualClient); - } - - //TODO: Repository is returning time in UTC format. - //TODO: TEST value of Date edited field. - @Test - public void shouldUpdateClient() throws JSONException { - Client client = getClient(); - addObjectToRepository(Collections.singletonList(client), allClients); - Client updatedClient = allClients.getAll().get(0); - updatedClient.setFirstName(LAST_NAME); - - clientService.updateClient(updatedClient); - - List actualClientList = allClients.getAll(); - assertEquals(1, actualClientList.size()); - assertObjectUpdate(updatedClient, actualClientList.get(0)); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionWhileUpdateIfNewClient() throws JSONException { - Client client = getClient(); - - clientService.updateClient(client); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionWhileUpdateIfClientIsNotFound() throws JSONException { - addObjectToRepository(Collections.singletonList(getClient()), allClients); - Client updatedClient = allClients.getAll().get(0); - allClients.removeAll(); - - clientService.updateClient(updatedClient); - } - - @Test - public void shouldFindByServerVersion() { - addObjectToRepository(Collections.singletonList(getClient()), allClients); - Client expectedClient = allClients.getAll().get(0); - - List actualClientList = clientService.findByServerVersion(expectedClient.getServerVersion(), null); - - assertEquals(1, actualClientList.size()); - assertEquals(expectedClient, actualClientList.get(0)); - } - - @Test - public void shouldAddIfNewEntityInAddOrUpdateMethod() { - Client expectedClient = getClient(); - - Client actualClient = clientService.addorUpdate(expectedClient); - - List dbClients = allClients.getAll(); - assertEquals(1, dbClients.size()); - - assertEquals(expectedClient, actualClient); - assertNewObjectCreation(expectedClient, dbClients.get(0)); - - } - - @Test - public void shouldUpdateIfExistingEntityInAddOrUpdateMethodRes() { - addObjectToRepository(Collections.singletonList(getClient()), allClients); - Client expectedClient = allClients.getAll().get(0); - expectedClient.setFirstName(LAST_NAME); - Long expectedServerVersion = expectedClient.getServerVersion(); - - Client actualClient = clientService.addorUpdate(expectedClient); - - List dbClients = allClients.getAll(); - assertEquals(1, dbClients.size()); - assertEquals(expectedClient, actualClient); - - actualClient = dbClients.get(0); - assertNotEquals(expectedServerVersion, actualClient.getServerVersion()); - assertEquals(expectedClient.getFirstName(), actualClient.getFirstName()); - assertEquals(expectedClient.getLastName(), actualClient.getLastName()); - assertEquals(expectedClient.getMiddleName(), actualClient.getMiddleName()); - assertEquals(expectedClient.getBirthdate(), actualClient.getBirthdate()); - assertEquals(expectedClient.getDeathdate(), actualClient.getDeathdate()); - assertEquals(expectedClient.getFirstName(), actualClient.getFirstName()); - assertEquals(expectedClient.getBaseEntityId(), actualClient.getBaseEntityId()); - } - - @Test(expected = RuntimeException.class) - public void shouldThrowErrorIfBaseEntityIdNotFound() { - addObjectToRepository(Collections.singletonList(getClient()), allClients); - Client expectedClient = allClients.getAll().get(0); - expectedClient.setBaseEntityId(null); - clientService.addorUpdate(expectedClient); - } - - @Test - public void shouldUpdateIfExistingEntityInAddOrUpdateMethodWithOutResettingServerVersion() { - addObjectToRepository(Collections.singletonList(getClient()), allClients); - Client expectedClient = allClients.getAll().get(0); - expectedClient.setFirstName(LAST_NAME); - Client actualClient = clientService.addorUpdate(expectedClient, false); - - List dbClients = allClients.getAll(); - assertEquals(1, dbClients.size()); - - assertEquals(expectedClient, actualClient); - assertObjectUpdate(expectedClient, dbClients.get(0)); - } - - @Test - public void shouldFindMembersByRelationshipId() { - List expectedClient = clientService.findMembersByRelationshipId("0154839f-8766-4eda-b729-89067c7a8c5d"); - assertNull(expectedClient); - } - - @Test - public void shouldGetHouseholdList() { - List ids = new ArrayList(); - ids.add("0154839f-8766-4eda-b729-89067c7a8c5d"); - List clients = new ArrayList(); - List expectedClients = clientService.getHouseholdList(ids, "ec_member", new AddressSearchBean(), - new ClientSearchBean(), clients); - assertEquals(expectedClients.size(), 0); - } - - @Test - public void shouldGetMemberCountHouseholdHeadProviderByClients() { - List id = new ArrayList(); - id.add("28caef27-d1b3-497b-8a55-954f2f0f6e24"); - Map results = clientService.getMemberCountHouseholdHeadProviderByClients(id, "ec_member"); - assertEquals(results.size(), 0); - } + + @Autowired + private ClientsRepositoryImpl allClients; + + @Autowired + private ClientService clientService; + + @Before + public void setUp() { + allClients.removeAll(); + } + + @After + public void cleanUp() { + allClients.removeAll(); + } + + @Test + public void shouldFindByBaeEntityId() { + String baseEntityId = "baseEntityId"; + Client expectedClient = new Client(baseEntityId); + Client invalidClient = new Client("b2"); + Client invalidClientSecond = new Client("b3"); + List clientList = asList(expectedClient, invalidClient, invalidClientSecond); + addObjectToRepository(clientList, allClients); + + Client actualClient = clientService.getByBaseEntityId(baseEntityId); + + assertEquals(expectedClient, actualClient); + } + + @Test + public void shouldFindAllClient() { + Client expectedClient = new Client("b1"); + Client expectedClient2 = new Client("b2"); + Client expectedClient3 = new Client("b3"); + List expectedClientList = asList(expectedClient, expectedClient2, expectedClient3); + addObjectToRepository(expectedClientList, allClients); + + List actualClientList = clientService.findAllClients(); + + assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); + + } + + @Test + public void shouldFindAllClientsByIdentifierValue() { + Client expectedClient = new Client("b1"); + expectedClient.addIdentifier("type", "value"); + Client expectedClient2 = new Client("b2"); + expectedClient2.addIdentifier("type", "value"); + Client invalidClient = new Client("b3"); + invalidClient.addIdentifier("type2", "value2"); + addObjectToRepository(asList(expectedClient, expectedClient2, invalidClient), allClients); + List expectedClientList = asList(expectedClient, expectedClient2); + + List actualClientList = clientService.findAllByIdentifier("value"); + + assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); + } + + @Test + public void shouldFindAllClientsByIdentifierTypeAndValue() { + Client expectedClient = new Client("b1"); + expectedClient.addIdentifier("type", "value"); + Client expectedClient2 = new Client("b2"); + expectedClient2.addIdentifier("type", "value"); + Client invalidClient = new Client("b3"); + invalidClient.addIdentifier("type2", "value2"); + addObjectToRepository(asList(expectedClient, expectedClient2, invalidClient), allClients); + List expectedClientList = asList(expectedClient, expectedClient2); + + List actualClientList = clientService.findAllByIdentifier("type", "value"); + assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); + } + + @Test + public void shouldFindAllClientsByRelationIdAndDateCreated() { + Client expectedClient = new Client("b1"); + expectedClient.addRelationship("mother", "id"); + expectedClient.setDateCreated(new DateTime(100L, DateTimeZone.UTC)); + Client expectedClient2 = new Client("b2"); + expectedClient2.addRelationship("mother", "id"); + expectedClient2.setDateCreated(new DateTime(200L, DateTimeZone.UTC)); + Client invalidClient = new Client("b3"); + invalidClient.addRelationship("mother", "id2"); + expectedClient.setDateCreated(new DateTime(300L, DateTimeZone.UTC)); + addObjectToRepository(asList(expectedClient, expectedClient2, invalidClient), allClients); + List expectedClientList = asList(expectedClient, expectedClient2); + + List actualClientList = clientService.findByRelationshipIdAndDateCreated("id", new DateTime(100L, + DateTimeZone.UTC).toLocalDate().toString(), new DateTime(200L, DateTimeZone.UTC).toLocalDate().toString()); + + assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); + } + + //TODO: Couch-lucene query error + @Test + @Ignore + public void shouldFindByRelationShip() { + Client expectedClient = getClient(); + expectedClient.addRelationship("mother", "id"); + expectedClient.setDateCreated(new DateTime(DateTimeZone.UTC)); + Client expectedClient2 = getClient(); + expectedClient2.setBaseEntityId("dd"); + expectedClient2.addRelationship("mother", "id"); + expectedClient2.setDateCreated(new DateTime(DateTimeZone.UTC)); + Client invalidClient = getClient(); + invalidClient.setBaseEntityId("ddss"); + invalidClient.addRelationship("mother", "id2"); + expectedClient.setDateCreated(new DateTime(DateTimeZone.UTC)); + addObjectToRepository(asList(expectedClient, expectedClient2, invalidClient), allClients); + List expectedClientList = asList(expectedClient, expectedClient2); + + List actualClientList = clientService.findByRelationship("id"); + + assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); + } + + @Test + public void shouldFindByAttributeTypeAndValue() { + Client expectedClient = new Client("b1"); + expectedClient.addAttribute("type", "value"); + Client expectedClient2 = new Client("b2"); + expectedClient2.addAttribute("type", "value"); + Client invalidClient = new Client("b3"); + invalidClient.addAttribute("type2", "value2"); + addObjectToRepository(asList(expectedClient, expectedClient2, invalidClient), allClients); + List expectedClientList = asList(expectedClient, expectedClient2); + + List actualClientList = clientService.findAllByAttribute("type", "value"); + assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); + } + + @Test + public void shouldFindByAttributeTypesAndValue() { + Client expectedClient = new Client("b1"); + expectedClient.addAttribute("type", "value"); + Client expectedClient2 = new Client("b2"); + expectedClient2.addAttribute("type", "value"); + Client invalidClient = new Client("b3"); + invalidClient.addAttribute("type2", "value2"); + addObjectToRepository(asList(expectedClient, expectedClient2, invalidClient), allClients); + List expectedClientList = asList(expectedClient, expectedClient2, invalidClient); + + List actualClientList = clientService.findAllByAttributes("type", + new ArrayList<>(asList("value", "value2"))); + assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); + } + + @Test + public void shouldFindAllMatchingName() { + Client expectedClient = new Client("b1"); + expectedClient.setFirstName("first"); + expectedClient.setLastName("last"); + Client expectedClient2 = new Client("b2"); + expectedClient2.setFirstName("first"); + expectedClient2.setLastName("last"); + Client invalidClient = new Client("b3"); + invalidClient.setFirstName("invalid"); + invalidClient.setLastName("invalid"); + addObjectToRepository(asList(expectedClient, expectedClient2, invalidClient), allClients); + List expectedClientList = asList(expectedClient, expectedClient2); + + List actualClientList = clientService.findAllByMatchingName("first"); + assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); + } + + /*@Test + @Ignore + public void shouldFindByAllCriteria() { + Client expectedClient = SampleFullDomainObject.client; + Client invalidClient = new Client(SampleFullDomainObject.BASE_ENTITY_ID); + invalidClient.setFirstName("invalid"); + invalidClient.setLastName("invalid"); + addObjectToRepository(asList(expectedClient, invalidClient), allClients); + List expectedClientList = asList(expectedClient); + + List actualClientList = clientService.findByCriteria(FIRST_NAME, ); + assertTwoListAreSameIgnoringOrder(expectedClientList, actualClientList); + }*/ + //TODO: Repository is returning time in UTC format. + //TODO: TEST value of Date created field. + @Test + public void shouldAdd() { + Client expectedClient = getClient(); + + Client actualClient = clientService.addClient(expectedClient); + + List dbClients = allClients.getAll(); + assertEquals(1, dbClients.size()); + + assertEquals(expectedClient, actualClient); + assertNewObjectCreation(expectedClient, dbClients.get(0)); + } + + @Test(expected = RuntimeException.class) + public void shouldThrowRuntimeExceptionWhileAddIfNoBaseEntityIdFound() { + Client expectedClient = getClient(); + expectedClient.setBaseEntityId(null); + + clientService.addClient(expectedClient); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowIllegalArgumentExceptionIfAClientAlreadyExistWithSameIdentifier() { + + addObjectToRepository(Collections.singletonList(getClient()), allClients); + Client expectedClient = allClients.getAll().get(0); + expectedClient.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + + clientService.addClient(expectedClient); + } + + //TODO: Repository is returning time in UTC format. + //TODO: TEST value of Date created field. + @Test + public void shouldAddWithCouchDbConnector() throws IOException { + Client expectedClient = getClient(); + + Client actualClient = clientService.addClient(expectedClient); + + List dbClients = allClients.getAll(); + assertEquals(1, dbClients.size()); + assertNewObjectCreation(expectedClient, dbClients.get(0)); + assertEquals(expectedClient, actualClient); + + } + + @Test(expected = RuntimeException.class) + public void shouldThrowRuntimeExceptionWhileAddIfNoBaseEntityIdFoundWithCouchDbConnector() throws IOException { + Client expectedClient = getClient(); + expectedClient.setBaseEntityId(null); + clientService.addClient(expectedClient); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowIllegalArgumentExceptionIfAClientAlreadyExistWithSameIdentifierWithCouchDbConnector() + throws IOException { + Client expectedClient = getClient(); + addObjectToRepository(Collections.singletonList(expectedClient), allClients); + expectedClient.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + clientService.addClient(expectedClient); + } + + @Test + public void shouldFindFromClientObjectWithBaseIdentifier() { + Client expectedClient = getClient(); + addObjectToRepository(Collections.singletonList(expectedClient), allClients); + + Client actualClient = clientService.findClient(expectedClient); + + assertEquals(expectedClient, actualClient); + } + + @Test + public void shouldFindFromClientWithIdentifiers() { + Client expectedClient = getClient(); + expectedClient.setBaseEntityId(null); + addObjectToRepository(Collections.singletonList(expectedClient), allClients); + + Client actualClient = clientService.findClient(expectedClient); + + assertEquals(expectedClient, actualClient); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionIfMultipleClientFoundWithSameIdentifier() { + Client expectedClient = getClient(); + Client sameClient = getClient(); + sameClient.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + addObjectToRepository(asList(expectedClient, sameClient), allClients); + expectedClient.setBaseEntityId(null); + + clientService.findClient(expectedClient); + + } + + @Test + public void shouldReturnNullIfNoClientFound() { + Client expectedClient = getClient(); + + Client actualClient = clientService.findClient(expectedClient); + + assertNull(actualClient); + } + + @Test + public void shouldFindFromClientObjectWithBaseIdentifierWithCouchDbConnector() throws IOException { + Client expectedClient = getClient(); + addObjectToRepository(Collections.singletonList(expectedClient), allClients); + + Client actualClient = clientService.findClient(expectedClient); + + assertEquals(expectedClient, actualClient); + } + + @Test + public void shouldFindFromClientWithIdentifiersWithCouchDbConnector() throws IOException { + Client expectedClient = getClient(); + expectedClient.setBaseEntityId(null); + addObjectToRepository(Collections.singletonList(expectedClient), allClients); + + Client actualClient = clientService.findClient(expectedClient); + + assertEquals(expectedClient, actualClient); + } + + public void shouldReturnNullIfMultipleClientFoundWithSameIdentifierWithCouchDbConnector() throws IOException { + Client expectedClient = getClient(); + Client sameClient = getClient(); + sameClient.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + addObjectToRepository(asList(expectedClient, sameClient), allClients); + expectedClient.setBaseEntityId(null); + + Client client = clientService.findClient(expectedClient); + + assertNull(client); + + } + + @Test + public void shouldReturnNullIfNoClientFoundWithCouchDbConnector() throws IOException { + Client expectedClient = getClient(); + + Client actualClient = clientService.findClient(expectedClient); + + assertNull(actualClient); + } + + @Test + public void shouldFindByUniqueIdBaseEntityId() { + Client expectedClient = getClient(); + Client invalidClient = getClient(); + invalidClient.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + addObjectToRepository(asList(expectedClient, invalidClient), allClients); + + Client actualClient = clientService.find(BASE_ENTITY_ID); + + assertEquals(expectedClient, actualClient); + + } + + @Test + public void shouldFindByUniqueIdIdentifier() { + Client expectedClient = getClient(); + Client invalidClient = getClient(); + Map differentIdentifiers = new HashMap<>(identifier); + differentIdentifiers.put(IDENTIFIER_TYPE, "differentValue"); + invalidClient.setIdentifiers(differentIdentifiers); + addObjectToRepository(asList(expectedClient, invalidClient), allClients); + + Client actualClient = clientService.find(IDENTIFIER_VALUE); + + assertEquals(expectedClient, actualClient); + + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionIfMultipleClientFoundWithSameIdentifierUsingUniqueId() { + Client expectedClient = getClient(); + Client sameClient = getClient(); + sameClient.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + addObjectToRepository(asList(expectedClient, sameClient), allClients); + + clientService.find(IDENTIFIER_VALUE); + + } + + @Test + public void shouldReturnNullIfNoClientFoundUsingUniqueId() { + Client expectedClient = getClient(); + addObjectToRepository(Collections.singletonList(expectedClient), allClients); + Client actualClient = clientService.find(DIFFERENT_BASE_ENTITY_ID); + + assertNull(actualClient); + } + + //TODO: Repository is returning time in UTC format. + //TODO: TEST value of Date edited field. + @Test + public void shouldUpdateClient() throws JSONException { + Client client = getClient(); + addObjectToRepository(Collections.singletonList(client), allClients); + Client updatedClient = allClients.getAll().get(0); + updatedClient.setFirstName(LAST_NAME); + + clientService.updateClient(updatedClient); + + List actualClientList = allClients.getAll(); + assertEquals(1, actualClientList.size()); + assertObjectUpdate(updatedClient, actualClientList.get(0)); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionWhileUpdateIfNewClient() throws JSONException { + Client client = getClient(); + + clientService.updateClient(client); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionWhileUpdateIfClientIsNotFound() throws JSONException { + addObjectToRepository(Collections.singletonList(getClient()), allClients); + Client updatedClient = allClients.getAll().get(0); + allClients.removeAll(); + + clientService.updateClient(updatedClient); + } + + @Test + public void shouldFindByServerVersion() { + addObjectToRepository(Collections.singletonList(getClient()), allClients); + Client expectedClient = allClients.getAll().get(0); + + List actualClientList = clientService.findByServerVersion(expectedClient.getServerVersion(), null); + + assertEquals(1, actualClientList.size()); + assertEquals(expectedClient, actualClientList.get(0)); + } + + @Test + public void shouldAddIfNewEntityInAddOrUpdateMethod() { + Client expectedClient = getClient(); + + Client actualClient = clientService.addorUpdate(expectedClient); + + List dbClients = allClients.getAll(); + assertEquals(1, dbClients.size()); + + assertEquals(expectedClient, actualClient); + assertNewObjectCreation(expectedClient, dbClients.get(0)); + + } + + @Test + public void shouldUpdateIfExistingEntityInAddOrUpdateMethodRes() { + addObjectToRepository(Collections.singletonList(getClient()), allClients); + Client expectedClient = allClients.getAll().get(0); + expectedClient.setFirstName(LAST_NAME); + Long expectedServerVersion = expectedClient.getServerVersion(); + + Client actualClient = clientService.addorUpdate(expectedClient); + + List dbClients = allClients.getAll(); + assertEquals(1, dbClients.size()); + assertEquals(expectedClient, actualClient); + + actualClient = dbClients.get(0); + assertNotEquals(expectedServerVersion, actualClient.getServerVersion()); + assertEquals(expectedClient.getFirstName(), actualClient.getFirstName()); + assertEquals(expectedClient.getLastName(), actualClient.getLastName()); + assertEquals(expectedClient.getMiddleName(), actualClient.getMiddleName()); + assertEquals(expectedClient.getBirthdate(), actualClient.getBirthdate()); + assertEquals(expectedClient.getDeathdate(), actualClient.getDeathdate()); + assertEquals(expectedClient.getFirstName(), actualClient.getFirstName()); + assertEquals(expectedClient.getBaseEntityId(), actualClient.getBaseEntityId()); + } + + @Test(expected = RuntimeException.class) + public void shouldThrowErrorIfBaseEntityIdNotFound() { + addObjectToRepository(Collections.singletonList(getClient()), allClients); + Client expectedClient = allClients.getAll().get(0); + expectedClient.setBaseEntityId(null); + clientService.addorUpdate(expectedClient); + } + + @Test + public void shouldUpdateIfExistingEntityInAddOrUpdateMethodWithOutResettingServerVersion() { + addObjectToRepository(Collections.singletonList(getClient()), allClients); + Client expectedClient = allClients.getAll().get(0); + expectedClient.setFirstName(LAST_NAME); + Client actualClient = clientService.addorUpdate(expectedClient, false); + + List dbClients = allClients.getAll(); + assertEquals(1, dbClients.size()); + + assertEquals(expectedClient, actualClient); + assertObjectUpdate(expectedClient, dbClients.get(0)); + } + + @Test + public void shouldFindMembersByRelationshipId() { + List expectedClient = clientService.findMembersByRelationshipId("0154839f-8766-4eda-b729-89067c7a8c5d"); + assertNull(expectedClient); + } + + @Test + public void shouldGetHouseholdList() { + List ids = new ArrayList(); + ids.add("0154839f-8766-4eda-b729-89067c7a8c5d"); + List clients = new ArrayList(); + List expectedClients = clientService.getHouseholdList(ids, "ec_member", new AddressSearchBean(), + new ClientSearchBean(), clients); + assertEquals(expectedClients.size(), 0); + } + + @Test + public void shouldGetMemberCountHouseholdHeadProviderByClients() { + List id = new ArrayList(); + id.add("28caef27-d1b3-497b-8a55-954f2f0f6e24"); + Map results = clientService.getMemberCountHouseholdHeadProviderByClients(id, "ec_member"); + assertEquals(results.size(), 0); + } } diff --git a/src/test/java/org/opensrp/service/it/ConfigServiceTest.java b/src/test/java/org/opensrp/service/it/ConfigServiceTest.java index ecda1d367..ef8fbc85c 100644 --- a/src/test/java/org/opensrp/service/it/ConfigServiceTest.java +++ b/src/test/java/org/opensrp/service/it/ConfigServiceTest.java @@ -27,163 +27,163 @@ import org.springframework.beans.factory.annotation.Autowired; public class ConfigServiceTest extends BaseIntegrationTest { - - @Autowired - AppStateTokensRepositoryImpl allAppStateTokens; - - @Autowired - ConfigService configService; - - @Before - public void setUp() { - allAppStateTokens.removeAll(); - } - - @After - public void cleanUp() { - allAppStateTokens.removeAll(); - } - - @Test - public void shouldFindAppStateTokenByName() { - AppStateToken expectedAppStateToken = getAppStateToken(); - AppStateToken invalidAppStateToken = getAppStateToken(); - invalidAppStateToken.setName(DIFFERENT_APP_STATE_TOKEN_NAME.name()); - addObjectToRepository(asList(expectedAppStateToken, invalidAppStateToken), allAppStateTokens); - - AppStateToken actualAppStateToken = configService.getAppStateTokenByName(APP_STATE_TOKEN_NAME); - - assertEquals(expectedAppStateToken, actualAppStateToken); - } - - @Test(expected = IllegalStateException.class) - public void shouldThrowExceptionIfMultipleAppStateTokenWithSameNameFound() { - AppStateToken expectedAppStateToken = getAppStateToken(); - AppStateToken invalidAppStateToken = getAppStateToken(); - addObjectToRepository(asList(expectedAppStateToken, invalidAppStateToken), allAppStateTokens); - - configService.getAppStateTokenByName(APP_STATE_TOKEN_NAME); - - } - - @Test - public void shouldReturnNullIfNoTokenFound() { - assertNull(configService.getAppStateTokenByName(APP_STATE_TOKEN_NAME)); - } - - @Test - public void shouldFindAppStateTokenByNameUsingCouchdbConnector() throws IOException { - AppStateToken expectedAppStateToken = getAppStateToken(); - AppStateToken invalidAppStateToken = getAppStateToken(); - invalidAppStateToken.setName(DIFFERENT_APP_STATE_TOKEN_NAME.name()); - addObjectToRepository(asList(expectedAppStateToken, invalidAppStateToken), allAppStateTokens); - - AppStateToken actualAppStateToken = allAppStateTokens.findByName(APP_STATE_TOKEN_NAME.name()).get(0); - - assertEquals(expectedAppStateToken, actualAppStateToken); - } - - @Test - public void shouldUpdate() { - AppStateToken expectedAppStateToken = getAppStateToken(); - addObjectToRepository(Collections.singletonList(expectedAppStateToken), allAppStateTokens); - - expectedAppStateToken.setValue(DIFFERENT_BASE_ENTITY_ID); - - configService.updateAppStateToken(APP_STATE_TOKEN_NAME, DIFFERENT_BASE_ENTITY_ID); - - List allTokens = allAppStateTokens.getAll(); - assertEquals(1, allTokens.size()); - assertNotEquals(expectedAppStateToken.getLastEditDate(), allTokens.get(0).getLastEditDate()); - - allTokens.get(0).setLastEditDate(LAST_EDIT_DATE); - assertEquals(expectedAppStateToken, allTokens.get(0)); - } - - @Test(expected = IllegalStateException.class) - public void shouldThrowExceptionIfMultipleTokenFoundWithSameNameWhileUpdate() { - AppStateToken expectedAppStateToken = getAppStateToken(); - AppStateToken invalidAppStateToken = getAppStateToken(); - addObjectToRepository(asList(expectedAppStateToken, invalidAppStateToken), allAppStateTokens); - - configService.updateAppStateToken(APP_STATE_TOKEN_NAME, DIFFERENT_BASE_ENTITY_ID); - } - - @Test - public void shouldThrowExceptionIfTokenNotFound() { - - } - - @Test - public void shouldUpdateWithCouchDbConnector() throws IOException { - AppStateToken expectedAppStateToken = getAppStateToken(); - addObjectToRepository(Collections.singletonList(expectedAppStateToken), allAppStateTokens); - - expectedAppStateToken.setValue(DIFFERENT_BASE_ENTITY_ID); - - allAppStateTokens.update( expectedAppStateToken); - - List allTokens = allAppStateTokens.getAll(); - assertEquals(1, allTokens.size()); - assertNotEquals(expectedAppStateToken.getLastEditDate(), allTokens.get(0).getLastEditDate()); - - allTokens.get(0).setLastEditDate(LAST_EDIT_DATE); - assertEquals(expectedAppStateToken, allTokens.get(0)); - } - - @Test - public void shouldRegisterNewAppStateToken() { - AppStateToken expectedAppStateToken = getAppStateToken(); - expectedAppStateToken.setLastEditDate(0L); - - AppStateToken actualAppStateToken = configService.registerAppStateToken(APP_STATE_TOKEN_NAME, VALUE, - APP_STATE_TOKEN_DESCRIPTION, true); - - List allTokens = allAppStateTokens.getAll(); - assertEquals(1, allTokens.size()); - assertEquals(expectedAppStateToken, allTokens.get(0)); - assertEquals(expectedAppStateToken, actualAppStateToken); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionInRegisterIfNameIsNull() { - configService.registerAppStateToken(null, VALUE, APP_STATE_TOKEN_DESCRIPTION, true); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionInRegisterIfDescriptionIsEmpty() { - configService.registerAppStateToken(APP_STATE_TOKEN_NAME, VALUE, "", true); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionInRegisterIfTokenAlreadyExistAndSuppressWaringIsOff() { - AppStateToken expectedAppStateToken = getAppStateToken(); - addObjectToRepository(Collections.singletonList(expectedAppStateToken), allAppStateTokens); - - configService.registerAppStateToken(APP_STATE_TOKEN_NAME, VALUE, APP_STATE_TOKEN_DESCRIPTION, false); - } - - @Test - public void shouldReturnExistingTokenIfSuppressWarningIsOn() { - AppStateToken expectedAppStateToken = getAppStateToken(); - addObjectToRepository(Collections.singletonList(expectedAppStateToken), allAppStateTokens); - - AppStateToken actualAppStateToken = configService.registerAppStateToken(APP_STATE_TOKEN_NAME, VALUE, - APP_STATE_TOKEN_DESCRIPTION, true); - - assertEquals(expectedAppStateToken, actualAppStateToken); - } - - @Test - public void shouldRegisterNewTokenWithCouchdbConnector() throws IOException { - AppStateToken expectedAppStateToken = getAppStateToken(); - expectedAppStateToken.setLastEditDate(0L); - - allAppStateTokens.add(expectedAppStateToken); - - List allTokens = allAppStateTokens.getAll(); - assertEquals(1, allTokens.size()); - assertEquals(expectedAppStateToken, allTokens.get(0)); - assertEquals(expectedAppStateToken, allTokens.get(0)); - } + + @Autowired + AppStateTokensRepositoryImpl allAppStateTokens; + + @Autowired + ConfigService configService; + + @Before + public void setUp() { + allAppStateTokens.removeAll(); + } + + @After + public void cleanUp() { + allAppStateTokens.removeAll(); + } + + @Test + public void shouldFindAppStateTokenByName() { + AppStateToken expectedAppStateToken = getAppStateToken(); + AppStateToken invalidAppStateToken = getAppStateToken(); + invalidAppStateToken.setName(DIFFERENT_APP_STATE_TOKEN_NAME.name()); + addObjectToRepository(asList(expectedAppStateToken, invalidAppStateToken), allAppStateTokens); + + AppStateToken actualAppStateToken = configService.getAppStateTokenByName(APP_STATE_TOKEN_NAME); + + assertEquals(expectedAppStateToken, actualAppStateToken); + } + + @Test(expected = IllegalStateException.class) + public void shouldThrowExceptionIfMultipleAppStateTokenWithSameNameFound() { + AppStateToken expectedAppStateToken = getAppStateToken(); + AppStateToken invalidAppStateToken = getAppStateToken(); + addObjectToRepository(asList(expectedAppStateToken, invalidAppStateToken), allAppStateTokens); + + configService.getAppStateTokenByName(APP_STATE_TOKEN_NAME); + + } + + @Test + public void shouldReturnNullIfNoTokenFound() { + assertNull(configService.getAppStateTokenByName(APP_STATE_TOKEN_NAME)); + } + + @Test + public void shouldFindAppStateTokenByNameUsingCouchdbConnector() throws IOException { + AppStateToken expectedAppStateToken = getAppStateToken(); + AppStateToken invalidAppStateToken = getAppStateToken(); + invalidAppStateToken.setName(DIFFERENT_APP_STATE_TOKEN_NAME.name()); + addObjectToRepository(asList(expectedAppStateToken, invalidAppStateToken), allAppStateTokens); + + AppStateToken actualAppStateToken = allAppStateTokens.findByName(APP_STATE_TOKEN_NAME.name()).get(0); + + assertEquals(expectedAppStateToken, actualAppStateToken); + } + + @Test + public void shouldUpdate() { + AppStateToken expectedAppStateToken = getAppStateToken(); + addObjectToRepository(Collections.singletonList(expectedAppStateToken), allAppStateTokens); + + expectedAppStateToken.setValue(DIFFERENT_BASE_ENTITY_ID); + + configService.updateAppStateToken(APP_STATE_TOKEN_NAME, DIFFERENT_BASE_ENTITY_ID); + + List allTokens = allAppStateTokens.getAll(); + assertEquals(1, allTokens.size()); + assertNotEquals(expectedAppStateToken.getLastEditDate(), allTokens.get(0).getLastEditDate()); + + allTokens.get(0).setLastEditDate(LAST_EDIT_DATE); + assertEquals(expectedAppStateToken, allTokens.get(0)); + } + + @Test(expected = IllegalStateException.class) + public void shouldThrowExceptionIfMultipleTokenFoundWithSameNameWhileUpdate() { + AppStateToken expectedAppStateToken = getAppStateToken(); + AppStateToken invalidAppStateToken = getAppStateToken(); + addObjectToRepository(asList(expectedAppStateToken, invalidAppStateToken), allAppStateTokens); + + configService.updateAppStateToken(APP_STATE_TOKEN_NAME, DIFFERENT_BASE_ENTITY_ID); + } + + @Test + public void shouldThrowExceptionIfTokenNotFound() { + + } + + @Test + public void shouldUpdateWithCouchDbConnector() throws IOException { + AppStateToken expectedAppStateToken = getAppStateToken(); + addObjectToRepository(Collections.singletonList(expectedAppStateToken), allAppStateTokens); + + expectedAppStateToken.setValue(DIFFERENT_BASE_ENTITY_ID); + + allAppStateTokens.update(expectedAppStateToken); + + List allTokens = allAppStateTokens.getAll(); + assertEquals(1, allTokens.size()); + assertNotEquals(expectedAppStateToken.getLastEditDate(), allTokens.get(0).getLastEditDate()); + + allTokens.get(0).setLastEditDate(LAST_EDIT_DATE); + assertEquals(expectedAppStateToken, allTokens.get(0)); + } + + @Test + public void shouldRegisterNewAppStateToken() { + AppStateToken expectedAppStateToken = getAppStateToken(); + expectedAppStateToken.setLastEditDate(0L); + + AppStateToken actualAppStateToken = configService.registerAppStateToken(APP_STATE_TOKEN_NAME, VALUE, + APP_STATE_TOKEN_DESCRIPTION, true); + + List allTokens = allAppStateTokens.getAll(); + assertEquals(1, allTokens.size()); + assertEquals(expectedAppStateToken, allTokens.get(0)); + assertEquals(expectedAppStateToken, actualAppStateToken); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionInRegisterIfNameIsNull() { + configService.registerAppStateToken(null, VALUE, APP_STATE_TOKEN_DESCRIPTION, true); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionInRegisterIfDescriptionIsEmpty() { + configService.registerAppStateToken(APP_STATE_TOKEN_NAME, VALUE, "", true); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionInRegisterIfTokenAlreadyExistAndSuppressWaringIsOff() { + AppStateToken expectedAppStateToken = getAppStateToken(); + addObjectToRepository(Collections.singletonList(expectedAppStateToken), allAppStateTokens); + + configService.registerAppStateToken(APP_STATE_TOKEN_NAME, VALUE, APP_STATE_TOKEN_DESCRIPTION, false); + } + + @Test + public void shouldReturnExistingTokenIfSuppressWarningIsOn() { + AppStateToken expectedAppStateToken = getAppStateToken(); + addObjectToRepository(Collections.singletonList(expectedAppStateToken), allAppStateTokens); + + AppStateToken actualAppStateToken = configService.registerAppStateToken(APP_STATE_TOKEN_NAME, VALUE, + APP_STATE_TOKEN_DESCRIPTION, true); + + assertEquals(expectedAppStateToken, actualAppStateToken); + } + + @Test + public void shouldRegisterNewTokenWithCouchdbConnector() throws IOException { + AppStateToken expectedAppStateToken = getAppStateToken(); + expectedAppStateToken.setLastEditDate(0L); + + allAppStateTokens.add(expectedAppStateToken); + + List allTokens = allAppStateTokens.getAll(); + assertEquals(1, allTokens.size()); + assertEquals(expectedAppStateToken, allTokens.get(0)); + assertEquals(expectedAppStateToken, allTokens.get(0)); + } } diff --git a/src/test/java/org/opensrp/service/it/ErrorTraceTest.java b/src/test/java/org/opensrp/service/it/ErrorTraceTest.java index 7deb624f4..b60ac9f97 100644 --- a/src/test/java/org/opensrp/service/it/ErrorTraceTest.java +++ b/src/test/java/org/opensrp/service/it/ErrorTraceTest.java @@ -22,140 +22,140 @@ import org.springframework.beans.factory.annotation.Autowired; public class ErrorTraceTest extends BaseIntegrationTest { - - @Autowired - public ErrorTraceRepositoryImpl allErrorTrace; - - @Autowired - public ErrorTraceService errorTraceService; - - @Before - public void setUp() { - allErrorTrace.removeAll(); - } - - @After - public void cleanUp() { - allErrorTrace.removeAll(); - } - - @Test - public void shouldGetErrorTraceById() { - addObjectToRepository(Collections.singletonList(getErrorTrace()), allErrorTrace); - ErrorTrace expectedErrorTrace = allErrorTrace.getAll().get(0); - - ErrorTrace actualErrorTrace = errorTraceService.getError(expectedErrorTrace.getId()); - - assertEquals(expectedErrorTrace, actualErrorTrace); - } - - @Test - public void shouldGetAllUnsolvedErrors() { - ErrorTrace errorTrace = getErrorTrace(); - errorTrace.setStatus("unsolved"); - ErrorTrace errorTrace1 = getErrorTrace(); - errorTrace1.setStatus("unsolved"); - ErrorTrace invalidErrorTrace = getErrorTrace(); - invalidErrorTrace.setStatus("solved"); - addObjectToRepository(asList(errorTrace, errorTrace1, invalidErrorTrace), allErrorTrace); - List expectedErrorTraces = asList(errorTrace, errorTrace1); - - List actualErrorTraces = errorTraceService.getAllUnsolvedErrors(); - - assertTwoListAreSameIgnoringOrder(expectedErrorTraces, actualErrorTraces); - } - - @Test - public void shouldReturnNullIfNoUnsolvedErrorFound() { - assertNull(errorTraceService.getAllUnsolvedErrors()); - } - - @Test - public void shouldGetAllSolvedErrors() { - ErrorTrace errorTrace = getErrorTrace(); - errorTrace.setStatus("solved"); - ErrorTrace errorTrace1 = getErrorTrace(); - errorTrace1.setStatus("solved"); - ErrorTrace invalidErrorTrace = getErrorTrace(); - invalidErrorTrace.setStatus("unsolved"); - addObjectToRepository(asList(errorTrace, errorTrace1, invalidErrorTrace), allErrorTrace); - List expectedErrorTraces = asList(errorTrace, errorTrace1); - - List actualErrorTraces = errorTraceService.getAllSolvedErrors(); - - assertTwoListAreSameIgnoringOrder(expectedErrorTraces, actualErrorTraces); - } - - @Test - public void shouldReturnNullIfNoSolvedErrorFound() { - assertNull(errorTraceService.getAllSolvedErrors()); - } - - @Test - public void shouldGetAllAllErrors() { - ErrorTrace errorTrace = getErrorTrace(); - errorTrace.setStatus("unsolved"); - ErrorTrace errorTrace1 = getErrorTrace(); - errorTrace1.setStatus("unsolved"); - ErrorTrace errorTrace2 = getErrorTrace(); - errorTrace2.setStatus("solved"); - List expectedErrorTraces = asList(errorTrace, errorTrace1, errorTrace2); - - assertEquals(0, allErrorTrace.getAll().size()); - addObjectToRepository(expectedErrorTraces, allErrorTrace); - List actualErrorTraces = errorTraceService.getAllErrors(); - - assertTwoListAreSameIgnoringOrder(expectedErrorTraces, actualErrorTraces); - } - - @Test - public void shouldReturnNullIfNoErrorFound() { - assertNull(errorTraceService.getAllErrors()); - } - - @Test - public void shouldAddErrorTrace() { - ErrorTrace expectedErrorTrace = getErrorTrace(); - - errorTraceService.addError(expectedErrorTrace); - - List actualErrorTraces = allErrorTrace.getAll(); - - assertEquals(1, actualErrorTraces.size()); - assertEquals(expectedErrorTrace, actualErrorTraces.get(0)); - } - - @Test - public void shouldLogError() { - ErrorTrace expectedErrorTrace = getErrorTrace(); - expectedErrorTrace.setOccurredAt(null); - expectedErrorTrace.setStatus(null); - expectedErrorTrace.setRetryUrl("retryUrl"); - - errorTraceService.log(expectedErrorTrace.getErrorType(), expectedErrorTrace.getDocumentType(), - expectedErrorTrace.getRecordId(), expectedErrorTrace.getStackTrace(), "retryUrl"); - - List actualErrorTraces = allErrorTrace.getAll(); - - assertEquals(1, actualErrorTraces.size()); - assertNotNull(actualErrorTraces.get(0).getDateOccurred()); - actualErrorTraces.get(0).setDateOccurred(EPOCH_DATE_TIME); - assertEquals(expectedErrorTrace, actualErrorTraces.get(0)); - - } - - @Test - public void shouldUpdateError() { - addObjectToRepository(Collections.singletonList(getErrorTrace()), allErrorTrace); - ErrorTrace updatedErrorTrace = allErrorTrace.getAll().get(0); - updatedErrorTrace.setRetryUrl("retryUrl"); - updatedErrorTrace.setStatus("solved"); - - errorTraceService.updateError(updatedErrorTrace); - - List actualErrorTraces = allErrorTrace.getAll(); - - assertEquals(1, actualErrorTraces.size()); - assertEquals(updatedErrorTrace, actualErrorTraces.get(0)); - } + + @Autowired + public ErrorTraceRepositoryImpl allErrorTrace; + + @Autowired + public ErrorTraceService errorTraceService; + + @Before + public void setUp() { + allErrorTrace.removeAll(); + } + + @After + public void cleanUp() { + allErrorTrace.removeAll(); + } + + @Test + public void shouldGetErrorTraceById() { + addObjectToRepository(Collections.singletonList(getErrorTrace()), allErrorTrace); + ErrorTrace expectedErrorTrace = allErrorTrace.getAll().get(0); + + ErrorTrace actualErrorTrace = errorTraceService.getError(expectedErrorTrace.getId()); + + assertEquals(expectedErrorTrace, actualErrorTrace); + } + + @Test + public void shouldGetAllUnsolvedErrors() { + ErrorTrace errorTrace = getErrorTrace(); + errorTrace.setStatus("unsolved"); + ErrorTrace errorTrace1 = getErrorTrace(); + errorTrace1.setStatus("unsolved"); + ErrorTrace invalidErrorTrace = getErrorTrace(); + invalidErrorTrace.setStatus("solved"); + addObjectToRepository(asList(errorTrace, errorTrace1, invalidErrorTrace), allErrorTrace); + List expectedErrorTraces = asList(errorTrace, errorTrace1); + + List actualErrorTraces = errorTraceService.getAllUnsolvedErrors(); + + assertTwoListAreSameIgnoringOrder(expectedErrorTraces, actualErrorTraces); + } + + @Test + public void shouldReturnNullIfNoUnsolvedErrorFound() { + assertNull(errorTraceService.getAllUnsolvedErrors()); + } + + @Test + public void shouldGetAllSolvedErrors() { + ErrorTrace errorTrace = getErrorTrace(); + errorTrace.setStatus("solved"); + ErrorTrace errorTrace1 = getErrorTrace(); + errorTrace1.setStatus("solved"); + ErrorTrace invalidErrorTrace = getErrorTrace(); + invalidErrorTrace.setStatus("unsolved"); + addObjectToRepository(asList(errorTrace, errorTrace1, invalidErrorTrace), allErrorTrace); + List expectedErrorTraces = asList(errorTrace, errorTrace1); + + List actualErrorTraces = errorTraceService.getAllSolvedErrors(); + + assertTwoListAreSameIgnoringOrder(expectedErrorTraces, actualErrorTraces); + } + + @Test + public void shouldReturnNullIfNoSolvedErrorFound() { + assertNull(errorTraceService.getAllSolvedErrors()); + } + + @Test + public void shouldGetAllAllErrors() { + ErrorTrace errorTrace = getErrorTrace(); + errorTrace.setStatus("unsolved"); + ErrorTrace errorTrace1 = getErrorTrace(); + errorTrace1.setStatus("unsolved"); + ErrorTrace errorTrace2 = getErrorTrace(); + errorTrace2.setStatus("solved"); + List expectedErrorTraces = asList(errorTrace, errorTrace1, errorTrace2); + + assertEquals(0, allErrorTrace.getAll().size()); + addObjectToRepository(expectedErrorTraces, allErrorTrace); + List actualErrorTraces = errorTraceService.getAllErrors(); + + assertTwoListAreSameIgnoringOrder(expectedErrorTraces, actualErrorTraces); + } + + @Test + public void shouldReturnNullIfNoErrorFound() { + assertNull(errorTraceService.getAllErrors()); + } + + @Test + public void shouldAddErrorTrace() { + ErrorTrace expectedErrorTrace = getErrorTrace(); + + errorTraceService.addError(expectedErrorTrace); + + List actualErrorTraces = allErrorTrace.getAll(); + + assertEquals(1, actualErrorTraces.size()); + assertEquals(expectedErrorTrace, actualErrorTraces.get(0)); + } + + @Test + public void shouldLogError() { + ErrorTrace expectedErrorTrace = getErrorTrace(); + expectedErrorTrace.setOccurredAt(null); + expectedErrorTrace.setStatus(null); + expectedErrorTrace.setRetryUrl("retryUrl"); + + errorTraceService.log(expectedErrorTrace.getErrorType(), expectedErrorTrace.getDocumentType(), + expectedErrorTrace.getRecordId(), expectedErrorTrace.getStackTrace(), "retryUrl"); + + List actualErrorTraces = allErrorTrace.getAll(); + + assertEquals(1, actualErrorTraces.size()); + assertNotNull(actualErrorTraces.get(0).getDateOccurred()); + actualErrorTraces.get(0).setDateOccurred(EPOCH_DATE_TIME); + assertEquals(expectedErrorTrace, actualErrorTraces.get(0)); + + } + + @Test + public void shouldUpdateError() { + addObjectToRepository(Collections.singletonList(getErrorTrace()), allErrorTrace); + ErrorTrace updatedErrorTrace = allErrorTrace.getAll().get(0); + updatedErrorTrace.setRetryUrl("retryUrl"); + updatedErrorTrace.setStatus("solved"); + + errorTraceService.updateError(updatedErrorTrace); + + List actualErrorTraces = allErrorTrace.getAll(); + + assertEquals(1, actualErrorTraces.size()); + assertEquals(updatedErrorTrace, actualErrorTraces.get(0)); + } } diff --git a/src/test/java/org/opensrp/service/it/EventServiceTest.java b/src/test/java/org/opensrp/service/it/EventServiceTest.java index edaa81917..338339b68 100644 --- a/src/test/java/org/opensrp/service/it/EventServiceTest.java +++ b/src/test/java/org/opensrp/service/it/EventServiceTest.java @@ -40,557 +40,557 @@ import org.springframework.beans.factory.annotation.Autowired; public class EventServiceTest extends BaseIntegrationTest { - - @Autowired - private EventsRepositoryImpl allEvents; - - @Autowired - private ClientsRepositoryImpl allClients; - - @Autowired - private EventService eventService; - - private String username ="johndoe"; - - @Before - public void setUp() { - allClients.removeAll(); - allEvents.removeAll(); - } - - @Before - public void cleanUp() { - allClients.removeAll(); - allEvents.removeAll(); - } - - @Test - public void shouldFindAllByIdentifier() { - Event expectedEvent = getEvent(); - Event expectedEvent2 = getEvent(); - expectedEvent2.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - Event invalidEvent = getEvent(); - Map identifiers = new HashMap<>(identifier); - identifiers.put(IDENTIFIER_TYPE, "invalidValue"); - invalidEvent.setIdentifiers(identifiers); - List expectedEventList = asList(expectedEvent, expectedEvent2); - - addObjectToRepository(asList(expectedEvent, expectedEvent2, invalidEvent), allEvents); - - List actualEventList = eventService.findAllByIdentifier(IDENTIFIER_VALUE); - - assertTwoListAreSameIgnoringOrder(expectedEventList, actualEventList); - } - - @Test - public void shouldFindAllByIdentifierTypeAndValue() { - Event expectedEvent = getEvent(); - Event expectedEvent2 = getEvent(); - expectedEvent2.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - Event invalidEvent = getEvent(); - Map identifiers = new HashMap<>(identifier); - identifiers.put(IDENTIFIER_TYPE, "invalidValue"); - invalidEvent.setIdentifiers(identifiers); - List expectedEventList = asList(expectedEvent, expectedEvent2); - - addObjectToRepository(asList(expectedEvent, expectedEvent2, invalidEvent), allEvents); - - List actualEventList = eventService.findAllByIdentifier(IDENTIFIER_TYPE, IDENTIFIER_VALUE); - - assertTwoListAreSameIgnoringOrder(expectedEventList, actualEventList); - } - - @Test - public void shouldFindByDocumentId() { - addObjectToRepository(asList(getEvent()), allEvents); - Event expectedEvent = allEvents.getAll().get(0); - - Event actualEvent = eventService.getById(expectedEvent.getId()); - - assertEquals(expectedEvent, actualEvent); - } - - @Test - public void shouldFindByBaseEntityAndFormSubmissionId() { - Event expectedEvent = getEvent(); - Event invalidEvent = getEvent(); - invalidEvent.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - - addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); - - Event actualEvent = eventService.getByBaseEntityAndFormSubmissionId(BASE_ENTITY_ID, FORM_SUBMISSION_ID); - - assertEquals(expectedEvent, actualEvent); - } - - @Test(expected = IllegalStateException.class) - public void shouldThrowExceptionIfMultipleFound() { - addObjectToRepository(asList(getEvent(), getEvent()), allEvents); - - eventService.getByBaseEntityAndFormSubmissionId(BASE_ENTITY_ID, FORM_SUBMISSION_ID); - } - - @Test - public void shouldReturnNullIfNoEventFound() { - Event actualEvent = eventService.getByBaseEntityAndFormSubmissionId(BASE_ENTITY_ID, FORM_SUBMISSION_ID); - - assertNull(actualEvent); - } - - @Test - public void shouldFindByBaseEntityIdAndFormSubmissionIdUsingCouchDbConnector() throws IOException { - Event expectedEvent = getEvent(); - Event invalidEvent = getEvent(); - invalidEvent.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - - addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); - Event actualEvent = allEvents.findByBaseEntityAndFormSubmissionId( BASE_ENTITY_ID, - FORM_SUBMISSION_ID); - - assertEquals(expectedEvent, actualEvent); - } - - @Test - public void shouldFindByBaseEntityId() { - Event expectedEvent = getEvent(); - Event expectedEvent2 = getEvent(); - Event invalidEvent = getEvent(); - invalidEvent.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - List expectedEvents = asList(expectedEvent, expectedEvent2); - - addObjectToRepository(asList(expectedEvent, expectedEvent2, invalidEvent), allEvents); - - List actualEvents = eventService.findByBaseEntityId(BASE_ENTITY_ID); - - assertTwoListAreSameIgnoringOrder(expectedEvents, actualEvents); - } - - @Test - public void shouldFindByFormSubmissionId() { - Event expectedEvent = getEvent(); - - addObjectToRepository(asList(expectedEvent), allEvents); - - Event actualEvent = eventService.findByFormSubmissionId(FORM_SUBMISSION_ID); - - assertEquals(expectedEvent, actualEvent); - } - - @Test - public void shouldFindByUniqueIdIdentifier() { - Event expectedEvent = getEvent(); - Event invalidEvent = getEvent(); - Map identifiers = new HashMap<>(identifier); - identifiers.put(IDENTIFIER_TYPE, "invalidValue"); - invalidEvent.setIdentifiers(identifiers); - - addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); - - Event actualEvent = eventService.find(IDENTIFIER_VALUE); - - assertEquals(expectedEvent, actualEvent); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionIfMultipleFoundWithSameIdentifierValue() { - Event expectedEvent = getEvent(); - Event expectedEvent2 = getEvent(); - expectedEvent2.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - Event invalidEvent = getEvent(); - Map identifiers = new HashMap<>(identifier); - identifiers.put(IDENTIFIER_TYPE, "invalidValue"); - invalidEvent.setIdentifiers(identifiers); - - addObjectToRepository(asList(expectedEvent, expectedEvent2, invalidEvent), allEvents); - - eventService.find(IDENTIFIER_VALUE); - } - - @Test - public void shouldReturnNullIfNothingFoundWithIdentifier() { - assertNull(eventService.find(IDENTIFIER_VALUE)); - } - - @Test - public void shouldFindByEventObject() { - Event expectedEvent = getEvent(); - - Event invalidEvent = getEvent(); - Map identifiers = new HashMap<>(identifier); - identifiers.put(IDENTIFIER_TYPE, "invalidValue"); - invalidEvent.setIdentifiers(identifiers); - - addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); - - Event actualEvent = eventService.find(expectedEvent); - - assertEquals(expectedEvent, actualEvent); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionIfMultipleFoundWithSameEvent() { - Event expectedEvent = getEvent(); - Event expectedEvent2 = getEvent(); - expectedEvent2.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - Event invalidEvent = getEvent(); - Map identifiers = new HashMap<>(identifier); - identifiers.put(IDENTIFIER_TYPE, "invalidValue"); - invalidEvent.setIdentifiers(identifiers); - - addObjectToRepository(asList(expectedEvent, expectedEvent2, invalidEvent), allEvents); - - eventService.find(expectedEvent); - } - - @Test - public void shouldReturnNullIfNothingFoundWithSameEvent() { - Event expectedEvent = getEvent(); - assertNull(eventService.find(expectedEvent)); - } - - @Test - public void shouldFindByEventOrDocumentId() { - addObjectToRepository(asList(getEvent()), allEvents); - Event expectedEvent = allEvents.getAll().get(0); - - Event actualEvent = eventService.findById(expectedEvent.getId()); - - assertEquals(expectedEvent, actualEvent); - } - - @Test - public void shouldReturnNullForNullOrEmptyIdInFindById() { - Event actualEvent = eventService.findById(""); - assertNull(actualEvent); - actualEvent = eventService.findById(null); - assertNull(actualEvent); - } - - @Test - public void shouldReturnNullIfEventNotFound() { - addObjectToRepository(asList(getEvent()), allEvents); - - Event actualEvent = eventService.findById(DIFFERENT_BASE_ENTITY_ID); - - assertNull(actualEvent); - } - - @Test - public void shouldAddEvent() { - Event expectedEvent = getEvent(); - - Event actualEvent = eventService.addEvent(expectedEvent, username); - - List dbEvents = allEvents.getAll(); - assertEquals(1, dbEvents.size()); - assertEquals(expectedEvent, actualEvent); - assertNewObjectCreation(expectedEvent, dbEvents.get(0)); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionIfAnEventAlreadyExistWithSameIdentifier() { - Event expectedEvent = getEvent(); - Event expectedEvent2 = getEvent(); - expectedEvent2.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - Event invalidEvent = getEvent(); - Map identifiers = new HashMap<>(identifier); - identifiers.put(IDENTIFIER_TYPE, "invalidValue"); - invalidEvent.setIdentifiers(identifiers); - - addObjectToRepository(asList(expectedEvent, expectedEvent2, invalidEvent), allEvents); - - eventService.addEvent(expectedEvent,username); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionIfAnEventAlreadyExistWithSameBaseEntityIdAndFormSumbissionId() { - Event expectedEvent = getEvent(); - Event invalidEvent = getEvent(); - Map identifiers = new HashMap<>(identifier); - identifiers.put(IDENTIFIER_TYPE, "invalidValue"); - invalidEvent.setIdentifiers(identifiers); - - addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); - - eventService.addEvent(expectedEvent,username); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionIfNullFormSubmissionId() { - Event expectedEvent = getEvent(); - Event invalidEvent = getEvent(); - Map identifiers = new HashMap<>(identifier); - identifiers.put(IDENTIFIER_TYPE, "invalidValue"); - invalidEvent.setIdentifiers(identifiers); - - addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); - - expectedEvent.setFormSubmissionId(null); - eventService.addEvent(expectedEvent,username); - } - - @Test - public void shouldAddEventWithCouchDbConnector() throws IOException { - Event expectedEvent = getEvent(); - - allEvents.add(expectedEvent); - - List dbEvents = allEvents.getAll(); - assertEquals(1, dbEvents.size()); - assertEquals(expectedEvent, dbEvents.get(0)); - assertNewObjectCreation(expectedEvent, dbEvents.get(0)); - } - - @Test(expected = IllegalStateException.class) - public void shouldThrowExceptionIfAnEventAlreadyExistWithSameBaseEntityIdAndFormSumbissionIdWithCouchDbConector() - throws IOException { - Event expectedEvent = getEvent(); - Event invalidEvent = getEvent(); - Map identifiers = new HashMap<>(identifier); - identifiers.put(IDENTIFIER_TYPE, "invalidValue"); - invalidEvent.setIdentifiers(identifiers); - - addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); - - allEvents.add( expectedEvent); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionIfNullFormSubmissionIdWithCouchDbConnector() throws IOException { - Event expectedEvent = getEvent(); - Event invalidEvent = getEvent(); - Map identifiers = new HashMap<>(identifier); - identifiers.put(IDENTIFIER_TYPE, "invalidValue"); - invalidEvent.setIdentifiers(identifiers); - - addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); - - expectedEvent.setFormSubmissionId(null); - allEvents.add(expectedEvent); - } - - @Test - public void shouldAddIfNewEntityInAddOrUpdate() { - Event expectedEvent = getEvent(); - - Event actualEvent = eventService.addorUpdateEvent(expectedEvent, username); - - List dbEvents = eventService.getAll(); - assertEquals(1, dbEvents.size()); - assertEquals(expectedEvent, actualEvent); - - assertNewObjectCreation(expectedEvent, dbEvents.get(0)); - } - - @Test - public void shouldUpdateIfExistingEntityInAddOrUpdate() { - addObjectToRepository(Collections.singletonList(getEvent()), allEvents); - Event expectedEvent = allEvents.getAll().get(0); - - Event actualEvent = eventService.addorUpdateEvent(expectedEvent, username); - - List dbEvents = eventService.getAll(); - assertEquals(1, dbEvents.size()); - assertEquals(expectedEvent, actualEvent); - - dbEvents.get(0).setServerVersion(0l); - assertObjectUpdate(expectedEvent, dbEvents.get(0)); - } - - @Test - public void shouldUpdateEvent() { - addObjectToRepository(Collections.singletonList(getEvent()), allEvents); - Event expectedEvent = allEvents.getAll().get(0); - - eventService.updateEvent(expectedEvent, username); - - List dbEvents = eventService.getAll(); - assertEquals(1, dbEvents.size()); - assertObjectUpdate(expectedEvent, dbEvents.get(0)); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionIfNewEventInUpdate() { - Event event = getEvent(); - - eventService.updateEvent(event, username); - } - - @Test - public void shouldFindBySeverVersion() { - addObjectToRepository(Collections.singletonList(getEvent()), allEvents); - - Event expectedEvent = allEvents.getAll().get(0); - - List actualEvents = allEvents.findByServerVersion(expectedEvent.getServerVersion() - 1); - - assertEquals(1, actualEvents.size()); - assertEquals(expectedEvent, actualEvents.get(0)); - } - - @Test - public void shouldGeAllEvents() { - Event expectedEvent = getEvent(); - Event expectedEvent2 = getEvent(); - expectedEvent2.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - Map identifiers = new HashMap<>(identifier); - identifiers.put(IDENTIFIER_TYPE, "invalidValue"); - expectedEvent2.setIdentifiers(identifiers); - List expectedEvents = asList(expectedEvent, expectedEvent2); - - addObjectToRepository(expectedEvents, allEvents); - - List actualEvents = eventService.getAll(); - - assertTwoListAreSameIgnoringOrder(expectedEvents, actualEvents); - } - - @Test - public void shouldFindByObsFieldCodeKeyAndValue() { - Event expectedEvent = getEvent(); - - addObjectToRepository(Collections.singletonList(expectedEvent), allEvents); - - List actualEvents = eventService.findEventsByConceptAndValue(FIELD_CODE, VALUE); - - assertEquals(1, actualEvents.size()); - assertEquals(expectedEvent, actualEvents.get(0)); - } - - @Test - public void shouldFindByBaseEntityAndEventType() { - Event expectedEvent = getEvent(); - Event invalidEvent = getEvent(); - invalidEvent.setEventType("diff"); - - addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); - - List actualEvents = eventService.findByBaseEntityAndType(BASE_ENTITY_ID, EVENT_TYPE); - - assertEquals(1, actualEvents.size()); - assertEquals(expectedEvent, actualEvents.get(0)); - } - - @Test - public void shouldProcessOutOfArea() { - Client client = getClient(); - client.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); - addObjectToRepository(Collections.singletonList(client), allClients); - Event existingEvent = getEvent(); - existingEvent.setBaseEntityId(client.getBaseEntityId()); - existingEvent.setEventType("Birth Registration"); - addObjectToRepository(Collections.singletonList(existingEvent), allEvents); - - //For null baseEntityId - Event expectedEvent = getEvent(); - expectedEvent.setBaseEntityId(null); - expectedEvent.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); - Event actualEvent = eventService.processOutOfArea(expectedEvent); - - assertNull(actualEvent.getIdentifier(ZEIR_ID.toUpperCase())); - assertEquals(BASE_ENTITY_ID, actualEvent.getBaseEntityId()); - assertEquals(PROVIDER_ID, actualEvent.getDetails().get("out_of_catchment_provider_id")); - assertEquals(expectedEvent, actualEvent); - - //For empty baseEntityId - expectedEvent = getEvent(); - expectedEvent.setBaseEntityId(""); - expectedEvent.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); - actualEvent = eventService.processOutOfArea(expectedEvent); - - assertNull(actualEvent.getIdentifier(ZEIR_ID.toUpperCase())); - assertEquals(BASE_ENTITY_ID, actualEvent.getBaseEntityId()); - assertEquals(PROVIDER_ID, actualEvent.getDetails().get("out_of_catchment_provider_id")); - assertEquals(expectedEvent, actualEvent); - } - - @Test - public void shouldNotProcessOutOfAreaIfEventHasBaseEntityId() { - Client client = getClient(); - client.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); - addObjectToRepository(Collections.singletonList(client), allClients); - Event existingEvent = getEvent(); - existingEvent.setBaseEntityId(client.getBaseEntityId()); - existingEvent.setEventType("Birth Registration"); - addObjectToRepository(Collections.singletonList(existingEvent), allEvents); - - Event expectedEvent = getEvent(); - expectedEvent.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - expectedEvent.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); - - Event actualEvent = eventService.processOutOfArea(expectedEvent); - - assertEquals("zeirId", actualEvent.getIdentifier(ZEIR_ID.toUpperCase())); - assertEquals(DIFFERENT_BASE_ENTITY_ID, actualEvent.getBaseEntityId()); - assertNull(actualEvent.getDetails().get("out_of_catchment_provider_id")); - assertEquals(expectedEvent, actualEvent); - } - - @Test - public void shouldNotProcessOutAreaIfNoClientFound() { - Event existingEvent = getEvent(); - existingEvent.setBaseEntityId(BASE_ENTITY_ID); - existingEvent.setEventType("Birth Registration"); - addObjectToRepository(Collections.singletonList(existingEvent), allEvents); - - Event expectedEvent = getEvent(); - expectedEvent.setBaseEntityId(null); - expectedEvent.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); - - Event actualEvent = eventService.processOutOfArea(expectedEvent); - - assertEquals("zeirId", actualEvent.getIdentifier(ZEIR_ID.toUpperCase())); - assertNull(actualEvent.getBaseEntityId()); - assertNull(actualEvent.getDetails().get("out_of_catchment_provider_id")); - assertEquals(expectedEvent, actualEvent); - } - - @Test - public void shouldNotProcessOutOfAreaIfNoExistingBirthRegistrationEventFound() { - Client client = getClient(); - client.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); - addObjectToRepository(Collections.singletonList(client), allClients); - Event existingEvent = getEvent(); - existingEvent.setBaseEntityId(client.getBaseEntityId()); - addObjectToRepository(Collections.singletonList(existingEvent), allEvents); - - //For null baseEntityId - Event expectedEvent = getEvent(); - expectedEvent.setBaseEntityId(null); - expectedEvent.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); - Event actualEvent = eventService.processOutOfArea(expectedEvent); - - assertEquals("zeirId", actualEvent.getIdentifier(ZEIR_ID.toUpperCase())); - assertNull(actualEvent.getBaseEntityId()); - assertNull(actualEvent.getDetails().get("out_of_catchment_provider_id")); - assertEquals(expectedEvent, actualEvent); - } - - @Test - public void shouldMergeAndUpdateExistingEvent() { - addObjectToRepository(Collections.singletonList(getEvent()), allEvents); - Event updatedEvent = allEvents.getAll().get(0); - - updatedEvent.addIdentifier("Second_Identifier", DIFFERENT_BASE_ENTITY_ID); - updatedEvent.addObs(getObs().withComments("comments").withFieldCode(DIFFERENT_BASE_ENTITY_ID)); - - Event actualEvent = eventService.mergeEvent(updatedEvent); - List dbEvents = allEvents.getAll(); - - DateTime updatedEventDate = updatedEvent.getEventDate(); - updatedEvent.setEventDate(null); - actualEvent.setEventDate(null); - actualEvent.setDateEdited(null); - assertEquals(1, dbEvents.size()); - assertEquals(updatedEvent, actualEvent); - updatedEvent.setEventDate(updatedEventDate); - assertObjectUpdate(updatedEvent, dbEvents.get(0)); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionIfExistingClientNotFound() { - Event updatedEvent = getEvent(); - - eventService.mergeEvent(updatedEvent); - } + + @Autowired + private EventsRepositoryImpl allEvents; + + @Autowired + private ClientsRepositoryImpl allClients; + + @Autowired + private EventService eventService; + + private String username = "johndoe"; + + @Before + public void setUp() { + allClients.removeAll(); + allEvents.removeAll(); + } + + @Before + public void cleanUp() { + allClients.removeAll(); + allEvents.removeAll(); + } + + @Test + public void shouldFindAllByIdentifier() { + Event expectedEvent = getEvent(); + Event expectedEvent2 = getEvent(); + expectedEvent2.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + Event invalidEvent = getEvent(); + Map identifiers = new HashMap<>(identifier); + identifiers.put(IDENTIFIER_TYPE, "invalidValue"); + invalidEvent.setIdentifiers(identifiers); + List expectedEventList = asList(expectedEvent, expectedEvent2); + + addObjectToRepository(asList(expectedEvent, expectedEvent2, invalidEvent), allEvents); + + List actualEventList = eventService.findAllByIdentifier(IDENTIFIER_VALUE); + + assertTwoListAreSameIgnoringOrder(expectedEventList, actualEventList); + } + + @Test + public void shouldFindAllByIdentifierTypeAndValue() { + Event expectedEvent = getEvent(); + Event expectedEvent2 = getEvent(); + expectedEvent2.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + Event invalidEvent = getEvent(); + Map identifiers = new HashMap<>(identifier); + identifiers.put(IDENTIFIER_TYPE, "invalidValue"); + invalidEvent.setIdentifiers(identifiers); + List expectedEventList = asList(expectedEvent, expectedEvent2); + + addObjectToRepository(asList(expectedEvent, expectedEvent2, invalidEvent), allEvents); + + List actualEventList = eventService.findAllByIdentifier(IDENTIFIER_TYPE, IDENTIFIER_VALUE); + + assertTwoListAreSameIgnoringOrder(expectedEventList, actualEventList); + } + + @Test + public void shouldFindByDocumentId() { + addObjectToRepository(asList(getEvent()), allEvents); + Event expectedEvent = allEvents.getAll().get(0); + + Event actualEvent = eventService.getById(expectedEvent.getId()); + + assertEquals(expectedEvent, actualEvent); + } + + @Test + public void shouldFindByBaseEntityAndFormSubmissionId() { + Event expectedEvent = getEvent(); + Event invalidEvent = getEvent(); + invalidEvent.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + + addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); + + Event actualEvent = eventService.getByBaseEntityAndFormSubmissionId(BASE_ENTITY_ID, FORM_SUBMISSION_ID); + + assertEquals(expectedEvent, actualEvent); + } + + @Test(expected = IllegalStateException.class) + public void shouldThrowExceptionIfMultipleFound() { + addObjectToRepository(asList(getEvent(), getEvent()), allEvents); + + eventService.getByBaseEntityAndFormSubmissionId(BASE_ENTITY_ID, FORM_SUBMISSION_ID); + } + + @Test + public void shouldReturnNullIfNoEventFound() { + Event actualEvent = eventService.getByBaseEntityAndFormSubmissionId(BASE_ENTITY_ID, FORM_SUBMISSION_ID); + + assertNull(actualEvent); + } + + @Test + public void shouldFindByBaseEntityIdAndFormSubmissionIdUsingCouchDbConnector() throws IOException { + Event expectedEvent = getEvent(); + Event invalidEvent = getEvent(); + invalidEvent.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + + addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); + Event actualEvent = allEvents.findByBaseEntityAndFormSubmissionId(BASE_ENTITY_ID, + FORM_SUBMISSION_ID); + + assertEquals(expectedEvent, actualEvent); + } + + @Test + public void shouldFindByBaseEntityId() { + Event expectedEvent = getEvent(); + Event expectedEvent2 = getEvent(); + Event invalidEvent = getEvent(); + invalidEvent.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + List expectedEvents = asList(expectedEvent, expectedEvent2); + + addObjectToRepository(asList(expectedEvent, expectedEvent2, invalidEvent), allEvents); + + List actualEvents = eventService.findByBaseEntityId(BASE_ENTITY_ID); + + assertTwoListAreSameIgnoringOrder(expectedEvents, actualEvents); + } + + @Test + public void shouldFindByFormSubmissionId() { + Event expectedEvent = getEvent(); + + addObjectToRepository(asList(expectedEvent), allEvents); + + Event actualEvent = eventService.findByFormSubmissionId(FORM_SUBMISSION_ID); + + assertEquals(expectedEvent, actualEvent); + } + + @Test + public void shouldFindByUniqueIdIdentifier() { + Event expectedEvent = getEvent(); + Event invalidEvent = getEvent(); + Map identifiers = new HashMap<>(identifier); + identifiers.put(IDENTIFIER_TYPE, "invalidValue"); + invalidEvent.setIdentifiers(identifiers); + + addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); + + Event actualEvent = eventService.find(IDENTIFIER_VALUE); + + assertEquals(expectedEvent, actualEvent); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionIfMultipleFoundWithSameIdentifierValue() { + Event expectedEvent = getEvent(); + Event expectedEvent2 = getEvent(); + expectedEvent2.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + Event invalidEvent = getEvent(); + Map identifiers = new HashMap<>(identifier); + identifiers.put(IDENTIFIER_TYPE, "invalidValue"); + invalidEvent.setIdentifiers(identifiers); + + addObjectToRepository(asList(expectedEvent, expectedEvent2, invalidEvent), allEvents); + + eventService.find(IDENTIFIER_VALUE); + } + + @Test + public void shouldReturnNullIfNothingFoundWithIdentifier() { + assertNull(eventService.find(IDENTIFIER_VALUE)); + } + + @Test + public void shouldFindByEventObject() { + Event expectedEvent = getEvent(); + + Event invalidEvent = getEvent(); + Map identifiers = new HashMap<>(identifier); + identifiers.put(IDENTIFIER_TYPE, "invalidValue"); + invalidEvent.setIdentifiers(identifiers); + + addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); + + Event actualEvent = eventService.find(expectedEvent); + + assertEquals(expectedEvent, actualEvent); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionIfMultipleFoundWithSameEvent() { + Event expectedEvent = getEvent(); + Event expectedEvent2 = getEvent(); + expectedEvent2.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + Event invalidEvent = getEvent(); + Map identifiers = new HashMap<>(identifier); + identifiers.put(IDENTIFIER_TYPE, "invalidValue"); + invalidEvent.setIdentifiers(identifiers); + + addObjectToRepository(asList(expectedEvent, expectedEvent2, invalidEvent), allEvents); + + eventService.find(expectedEvent); + } + + @Test + public void shouldReturnNullIfNothingFoundWithSameEvent() { + Event expectedEvent = getEvent(); + assertNull(eventService.find(expectedEvent)); + } + + @Test + public void shouldFindByEventOrDocumentId() { + addObjectToRepository(asList(getEvent()), allEvents); + Event expectedEvent = allEvents.getAll().get(0); + + Event actualEvent = eventService.findById(expectedEvent.getId()); + + assertEquals(expectedEvent, actualEvent); + } + + @Test + public void shouldReturnNullForNullOrEmptyIdInFindById() { + Event actualEvent = eventService.findById(""); + assertNull(actualEvent); + actualEvent = eventService.findById(null); + assertNull(actualEvent); + } + + @Test + public void shouldReturnNullIfEventNotFound() { + addObjectToRepository(asList(getEvent()), allEvents); + + Event actualEvent = eventService.findById(DIFFERENT_BASE_ENTITY_ID); + + assertNull(actualEvent); + } + + @Test + public void shouldAddEvent() { + Event expectedEvent = getEvent(); + + Event actualEvent = eventService.addEvent(expectedEvent, username); + + List dbEvents = allEvents.getAll(); + assertEquals(1, dbEvents.size()); + assertEquals(expectedEvent, actualEvent); + assertNewObjectCreation(expectedEvent, dbEvents.get(0)); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionIfAnEventAlreadyExistWithSameIdentifier() { + Event expectedEvent = getEvent(); + Event expectedEvent2 = getEvent(); + expectedEvent2.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + Event invalidEvent = getEvent(); + Map identifiers = new HashMap<>(identifier); + identifiers.put(IDENTIFIER_TYPE, "invalidValue"); + invalidEvent.setIdentifiers(identifiers); + + addObjectToRepository(asList(expectedEvent, expectedEvent2, invalidEvent), allEvents); + + eventService.addEvent(expectedEvent, username); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionIfAnEventAlreadyExistWithSameBaseEntityIdAndFormSumbissionId() { + Event expectedEvent = getEvent(); + Event invalidEvent = getEvent(); + Map identifiers = new HashMap<>(identifier); + identifiers.put(IDENTIFIER_TYPE, "invalidValue"); + invalidEvent.setIdentifiers(identifiers); + + addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); + + eventService.addEvent(expectedEvent, username); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionIfNullFormSubmissionId() { + Event expectedEvent = getEvent(); + Event invalidEvent = getEvent(); + Map identifiers = new HashMap<>(identifier); + identifiers.put(IDENTIFIER_TYPE, "invalidValue"); + invalidEvent.setIdentifiers(identifiers); + + addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); + + expectedEvent.setFormSubmissionId(null); + eventService.addEvent(expectedEvent, username); + } + + @Test + public void shouldAddEventWithCouchDbConnector() throws IOException { + Event expectedEvent = getEvent(); + + allEvents.add(expectedEvent); + + List dbEvents = allEvents.getAll(); + assertEquals(1, dbEvents.size()); + assertEquals(expectedEvent, dbEvents.get(0)); + assertNewObjectCreation(expectedEvent, dbEvents.get(0)); + } + + @Test(expected = IllegalStateException.class) + public void shouldThrowExceptionIfAnEventAlreadyExistWithSameBaseEntityIdAndFormSumbissionIdWithCouchDbConector() + throws IOException { + Event expectedEvent = getEvent(); + Event invalidEvent = getEvent(); + Map identifiers = new HashMap<>(identifier); + identifiers.put(IDENTIFIER_TYPE, "invalidValue"); + invalidEvent.setIdentifiers(identifiers); + + addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); + + allEvents.add(expectedEvent); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionIfNullFormSubmissionIdWithCouchDbConnector() throws IOException { + Event expectedEvent = getEvent(); + Event invalidEvent = getEvent(); + Map identifiers = new HashMap<>(identifier); + identifiers.put(IDENTIFIER_TYPE, "invalidValue"); + invalidEvent.setIdentifiers(identifiers); + + addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); + + expectedEvent.setFormSubmissionId(null); + allEvents.add(expectedEvent); + } + + @Test + public void shouldAddIfNewEntityInAddOrUpdate() { + Event expectedEvent = getEvent(); + + Event actualEvent = eventService.addorUpdateEvent(expectedEvent, username); + + List dbEvents = eventService.getAll(); + assertEquals(1, dbEvents.size()); + assertEquals(expectedEvent, actualEvent); + + assertNewObjectCreation(expectedEvent, dbEvents.get(0)); + } + + @Test + public void shouldUpdateIfExistingEntityInAddOrUpdate() { + addObjectToRepository(Collections.singletonList(getEvent()), allEvents); + Event expectedEvent = allEvents.getAll().get(0); + + Event actualEvent = eventService.addorUpdateEvent(expectedEvent, username); + + List dbEvents = eventService.getAll(); + assertEquals(1, dbEvents.size()); + assertEquals(expectedEvent, actualEvent); + + dbEvents.get(0).setServerVersion(0l); + assertObjectUpdate(expectedEvent, dbEvents.get(0)); + } + + @Test + public void shouldUpdateEvent() { + addObjectToRepository(Collections.singletonList(getEvent()), allEvents); + Event expectedEvent = allEvents.getAll().get(0); + + eventService.updateEvent(expectedEvent, username); + + List dbEvents = eventService.getAll(); + assertEquals(1, dbEvents.size()); + assertObjectUpdate(expectedEvent, dbEvents.get(0)); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionIfNewEventInUpdate() { + Event event = getEvent(); + + eventService.updateEvent(event, username); + } + + @Test + public void shouldFindBySeverVersion() { + addObjectToRepository(Collections.singletonList(getEvent()), allEvents); + + Event expectedEvent = allEvents.getAll().get(0); + + List actualEvents = allEvents.findByServerVersion(expectedEvent.getServerVersion() - 1); + + assertEquals(1, actualEvents.size()); + assertEquals(expectedEvent, actualEvents.get(0)); + } + + @Test + public void shouldGeAllEvents() { + Event expectedEvent = getEvent(); + Event expectedEvent2 = getEvent(); + expectedEvent2.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + Map identifiers = new HashMap<>(identifier); + identifiers.put(IDENTIFIER_TYPE, "invalidValue"); + expectedEvent2.setIdentifiers(identifiers); + List expectedEvents = asList(expectedEvent, expectedEvent2); + + addObjectToRepository(expectedEvents, allEvents); + + List actualEvents = eventService.getAll(); + + assertTwoListAreSameIgnoringOrder(expectedEvents, actualEvents); + } + + @Test + public void shouldFindByObsFieldCodeKeyAndValue() { + Event expectedEvent = getEvent(); + + addObjectToRepository(Collections.singletonList(expectedEvent), allEvents); + + List actualEvents = eventService.findEventsByConceptAndValue(FIELD_CODE, VALUE); + + assertEquals(1, actualEvents.size()); + assertEquals(expectedEvent, actualEvents.get(0)); + } + + @Test + public void shouldFindByBaseEntityAndEventType() { + Event expectedEvent = getEvent(); + Event invalidEvent = getEvent(); + invalidEvent.setEventType("diff"); + + addObjectToRepository(asList(expectedEvent, invalidEvent), allEvents); + + List actualEvents = eventService.findByBaseEntityAndType(BASE_ENTITY_ID, EVENT_TYPE); + + assertEquals(1, actualEvents.size()); + assertEquals(expectedEvent, actualEvents.get(0)); + } + + @Test + public void shouldProcessOutOfArea() { + Client client = getClient(); + client.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); + addObjectToRepository(Collections.singletonList(client), allClients); + Event existingEvent = getEvent(); + existingEvent.setBaseEntityId(client.getBaseEntityId()); + existingEvent.setEventType("Birth Registration"); + addObjectToRepository(Collections.singletonList(existingEvent), allEvents); + + //For null baseEntityId + Event expectedEvent = getEvent(); + expectedEvent.setBaseEntityId(null); + expectedEvent.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); + Event actualEvent = eventService.processOutOfArea(expectedEvent); + + assertNull(actualEvent.getIdentifier(ZEIR_ID.toUpperCase())); + assertEquals(BASE_ENTITY_ID, actualEvent.getBaseEntityId()); + assertEquals(PROVIDER_ID, actualEvent.getDetails().get("out_of_catchment_provider_id")); + assertEquals(expectedEvent, actualEvent); + + //For empty baseEntityId + expectedEvent = getEvent(); + expectedEvent.setBaseEntityId(""); + expectedEvent.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); + actualEvent = eventService.processOutOfArea(expectedEvent); + + assertNull(actualEvent.getIdentifier(ZEIR_ID.toUpperCase())); + assertEquals(BASE_ENTITY_ID, actualEvent.getBaseEntityId()); + assertEquals(PROVIDER_ID, actualEvent.getDetails().get("out_of_catchment_provider_id")); + assertEquals(expectedEvent, actualEvent); + } + + @Test + public void shouldNotProcessOutOfAreaIfEventHasBaseEntityId() { + Client client = getClient(); + client.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); + addObjectToRepository(Collections.singletonList(client), allClients); + Event existingEvent = getEvent(); + existingEvent.setBaseEntityId(client.getBaseEntityId()); + existingEvent.setEventType("Birth Registration"); + addObjectToRepository(Collections.singletonList(existingEvent), allEvents); + + Event expectedEvent = getEvent(); + expectedEvent.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + expectedEvent.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); + + Event actualEvent = eventService.processOutOfArea(expectedEvent); + + assertEquals("zeirId", actualEvent.getIdentifier(ZEIR_ID.toUpperCase())); + assertEquals(DIFFERENT_BASE_ENTITY_ID, actualEvent.getBaseEntityId()); + assertNull(actualEvent.getDetails().get("out_of_catchment_provider_id")); + assertEquals(expectedEvent, actualEvent); + } + + @Test + public void shouldNotProcessOutAreaIfNoClientFound() { + Event existingEvent = getEvent(); + existingEvent.setBaseEntityId(BASE_ENTITY_ID); + existingEvent.setEventType("Birth Registration"); + addObjectToRepository(Collections.singletonList(existingEvent), allEvents); + + Event expectedEvent = getEvent(); + expectedEvent.setBaseEntityId(null); + expectedEvent.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); + + Event actualEvent = eventService.processOutOfArea(expectedEvent); + + assertEquals("zeirId", actualEvent.getIdentifier(ZEIR_ID.toUpperCase())); + assertNull(actualEvent.getBaseEntityId()); + assertNull(actualEvent.getDetails().get("out_of_catchment_provider_id")); + assertEquals(expectedEvent, actualEvent); + } + + @Test + public void shouldNotProcessOutOfAreaIfNoExistingBirthRegistrationEventFound() { + Client client = getClient(); + client.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); + addObjectToRepository(Collections.singletonList(client), allClients); + Event existingEvent = getEvent(); + existingEvent.setBaseEntityId(client.getBaseEntityId()); + addObjectToRepository(Collections.singletonList(existingEvent), allEvents); + + //For null baseEntityId + Event expectedEvent = getEvent(); + expectedEvent.setBaseEntityId(null); + expectedEvent.addIdentifier(ZEIR_ID.toUpperCase(), "zeirId"); + Event actualEvent = eventService.processOutOfArea(expectedEvent); + + assertEquals("zeirId", actualEvent.getIdentifier(ZEIR_ID.toUpperCase())); + assertNull(actualEvent.getBaseEntityId()); + assertNull(actualEvent.getDetails().get("out_of_catchment_provider_id")); + assertEquals(expectedEvent, actualEvent); + } + + @Test + public void shouldMergeAndUpdateExistingEvent() { + addObjectToRepository(Collections.singletonList(getEvent()), allEvents); + Event updatedEvent = allEvents.getAll().get(0); + + updatedEvent.addIdentifier("Second_Identifier", DIFFERENT_BASE_ENTITY_ID); + updatedEvent.addObs(getObs().withComments("comments").withFieldCode(DIFFERENT_BASE_ENTITY_ID)); + + Event actualEvent = eventService.mergeEvent(updatedEvent); + List dbEvents = allEvents.getAll(); + + DateTime updatedEventDate = updatedEvent.getEventDate(); + updatedEvent.setEventDate(null); + actualEvent.setEventDate(null); + actualEvent.setDateEdited(null); + assertEquals(1, dbEvents.size()); + assertEquals(updatedEvent, actualEvent); + updatedEvent.setEventDate(updatedEventDate); + assertObjectUpdate(updatedEvent, dbEvents.get(0)); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionIfExistingClientNotFound() { + Event updatedEvent = getEvent(); + + eventService.mergeEvent(updatedEvent); + } } diff --git a/src/test/java/org/opensrp/service/it/MultimediaServiceTest.java b/src/test/java/org/opensrp/service/it/MultimediaServiceTest.java index a3e6b1bcf..7a8ca8eda 100644 --- a/src/test/java/org/opensrp/service/it/MultimediaServiceTest.java +++ b/src/test/java/org/opensrp/service/it/MultimediaServiceTest.java @@ -40,194 +40,194 @@ * If tests fail check property `'multimedia.directory.name` in `opensrp.properties`. */ public class MultimediaServiceTest extends BaseIntegrationTest { - - @Autowired - private MultimediaRepositoryImpl multimediaRepository; - - @Autowired - private MultimediaService multimediaService; - - @Value("#{opensrp['multimedia.directory.name']}") - private String baseMultimediaDirPath; - - private String BASE_IMAGE_PATH = baseMultimediaDirPath + File.separator + IMAGES_DIR+ File.separator; - - @Autowired - @Qualifier("multimedia.file.manager") - private BaseMultimediaFileManager fileManager; - - @Before - public void setUp() { - multimediaRepository.removeAll(); - deleteFolders("../multimedia"); - fileManager = (BaseMultimediaFileManager) multimediaService.getFileManager(); - BASE_IMAGE_PATH = baseMultimediaDirPath + File.separator + IMAGES_DIR+ File.separator; - } - - @After - public void cleanUp() { - multimediaRepository.removeAll(); - deleteFolders("../multimedia"); - } - - public void deleteFolders(String path) { - File multimediaFile = new File(path); - if (multimediaFile.exists()) { - String[] entries = multimediaFile.list(); - for (String s : entries) { - File currentFile = new File(multimediaFile.getPath(), s); - if (currentFile.isDirectory()) { - deleteFolders(currentFile.getPath()); - } - } - multimediaFile.delete(); - } - } - - @Test - public void shouldFindByCaseId() { - Multimedia expectedMultimedia = getMultimedia(); - Multimedia invalidMultimedia = getMultimedia(); - invalidMultimedia.setCaseId(DIFFERENT_BASE_ENTITY_ID); - addObjectToRepository(asList(expectedMultimedia, invalidMultimedia), multimediaRepository); - - Multimedia actualMultimedia = multimediaService.findByCaseId(CASE_ID); - - assertEquals(expectedMultimedia, actualMultimedia); - } - - @Test - public void shouldFindAllByProviderId() { - Multimedia expectedMultimedia = getMultimedia(); - Multimedia expectedMultimedia1 = getMultimedia(); - List expectedMultimedias = asList(expectedMultimedia, expectedMultimedia1); - Multimedia invalidMultimedia = getMultimedia(); - invalidMultimedia.setProviderId(DIFFERENT_BASE_ENTITY_ID); - addObjectToRepository(asList(expectedMultimedia, expectedMultimedia1, invalidMultimedia), multimediaRepository); - - List actualMultimedias = multimediaService.getMultimediaFiles(PROVIDER_ID); - - assertTwoListAreSameIgnoringOrder(expectedMultimedias, actualMultimedias); - } - - @Test - public void shouldUploadJpegFile() throws IOException { - String pathname = BASE_IMAGE_PATH + File.separator + CASE_ID + ".jpg"; - MultimediaDTO multimediaDTO = getMultimediaDTO("image/jpeg"); - byte[] testBytes = new byte[10]; - - boolean result = fileManager.uploadFile(multimediaDTO, testBytes, "original_name.jpg"); - - assertTrue(result); - assertTrue(new File(BASE_IMAGE_PATH).exists()); - verify(fileManager, times(1)).copyBytesToFile(new File(pathname), testBytes); - } - - @Test - public void shouldUploadGifFile() throws IOException { - String pathname = BASE_IMAGE_PATH + File.separator + CASE_ID + ".gif"; - MultimediaDTO multimediaDTO = getMultimediaDTO("image/gif"); - byte[] testBytes = new byte[10]; - - boolean result = fileManager.uploadFile(multimediaDTO, testBytes, "original_name.gif"); - - assertTrue(result); - assertTrue(new File(BASE_IMAGE_PATH).exists()); - verify(fileManager, times(1)).copyBytesToFile(new File(pathname), testBytes); - } - - @Test - public void shouldUploadPngFile() throws IOException { - String pathname = BASE_IMAGE_PATH + CASE_ID + ".png"; - MultimediaDTO multimediaDTO = getMultimediaDTO("image/png"); - byte[] testBytes = new byte[10]; - - boolean result = fileManager.uploadFile(multimediaDTO, testBytes, "original_name.jpg"); - - assertTrue(result); - assertTrue(new File(BASE_IMAGE_PATH).exists()); - verify(fileManager, times(1)).copyBytesToFile(new File(pathname), testBytes); - } - - @Test - public void shouldUploadVideoOctetStreamFile() throws IOException { - String BASE_IMAGE_PATH = baseMultimediaDirPath + "/" + "videos/"; - String pathname = BASE_IMAGE_PATH + CASE_ID + ".mp4"; - MultimediaDTO multimediaDTO = getMultimediaDTO("application/octet-stream"); - byte[] testBytes = new byte[10]; - - boolean result = fileManager.uploadFile(multimediaDTO, testBytes, "original_name.mp4"); - - assertTrue(result); - assertTrue(new File(BASE_IMAGE_PATH).exists()); - verify(fileManager, times(1)).copyBytesToFile(new File(pathname), testBytes); - } - - @Test - public void shouldReturnFalseUnknownContentType() throws IOException { - MultimediaDTO multimediaDTO = getMultimediaDTO("unknown"); - byte[] testBytes = new byte[10]; - - assertFalse(fileManager.uploadFile(multimediaDTO, testBytes, null)); - } - - @Test - public void shouldReturnFalseFormEmptyMultiPartFile() { - MultimediaDTO multimediaDTO = getMultimediaDTO("image/jpeg"); - - assertFalse(fileManager.uploadFile(multimediaDTO, null, null)); - } - - @Test - public void shouldSaveMultimediaForSuccessfulUpdate() { - MultimediaDTO multimediaDTO = getMultimediaDTO("image/png"); - byte[] testBytes = new byte[10]; - Multimedia expectedMultimedia = getMultimedia(); - expectedMultimedia.setContentType("image/png"); - expectedMultimedia.setFilePath(BASE_IMAGE_PATH + CASE_ID + ".png"); - - String result = fileManager.saveMultimediaFile(multimediaDTO, testBytes, "original_name.png"); - - assertEquals("success", result); - List dbFiles = multimediaRepository.getAll(); - assertEquals(1, dbFiles.size()); - - Multimedia actualMultimedia = dbFiles.get(0); - assertEquals(expectedMultimedia.getFilePath(), actualMultimedia.getFilePath()); - assertEquals(expectedMultimedia.getProviderId(), actualMultimedia.getProviderId()); - assertEquals(expectedMultimedia.getContentType(), actualMultimedia.getContentType()); - assertEquals(expectedMultimedia.getFileCategory(), actualMultimedia.getFileCategory()); - assertEquals(expectedMultimedia.getCaseId(), actualMultimedia.getCaseId()); - } - - @Test - public void shouldReturnFailForUnsuccessfulUpdate() { - MultimediaDTO multimediaDTO = getMultimediaDTO("unknown"); - byte[] testBytes = new byte[10]; - - String result = fileManager.saveMultimediaFile(multimediaDTO, testBytes, "original_name"); - - assertEquals("fail", result); - List dbFiles = multimediaRepository.getAll(); - assertEquals(0, dbFiles.size()); - } - - @Test - public void testRetrieveFileShouldCallFileManager() { - MultimediaFileManager fileManager = mock(FileSystemMultimediaFileManager.class); - multimediaService.setFileManager(fileManager); - multimediaService.retrieveFile("file_path"); - verify(fileManager).retrieveFile(eq("file_path")); - } - - @Test - public void testSaveFileShouldCallFileManager() { - MultimediaFileManager fileManager = mock(FileSystemMultimediaFileManager.class); - multimediaService.setFileManager(fileManager); - - byte[] testBytes = new byte[10]; - MultimediaDTO multimediaDTO = mock(MultimediaDTO.class); - multimediaService.saveFile(multimediaDTO, testBytes, null); - verify(fileManager).saveFile(eq(multimediaDTO), eq(testBytes), eq(null)); - } + + @Autowired + private MultimediaRepositoryImpl multimediaRepository; + + @Autowired + private MultimediaService multimediaService; + + @Value("#{opensrp['multimedia.directory.name']}") + private String baseMultimediaDirPath; + + private String BASE_IMAGE_PATH = baseMultimediaDirPath + File.separator + IMAGES_DIR + File.separator; + + @Autowired + @Qualifier("multimedia.file.manager") + private BaseMultimediaFileManager fileManager; + + @Before + public void setUp() { + multimediaRepository.removeAll(); + deleteFolders("../multimedia"); + fileManager = (BaseMultimediaFileManager) multimediaService.getFileManager(); + BASE_IMAGE_PATH = baseMultimediaDirPath + File.separator + IMAGES_DIR + File.separator; + } + + @After + public void cleanUp() { + multimediaRepository.removeAll(); + deleteFolders("../multimedia"); + } + + public void deleteFolders(String path) { + File multimediaFile = new File(path); + if (multimediaFile.exists()) { + String[] entries = multimediaFile.list(); + for (String s : entries) { + File currentFile = new File(multimediaFile.getPath(), s); + if (currentFile.isDirectory()) { + deleteFolders(currentFile.getPath()); + } + } + multimediaFile.delete(); + } + } + + @Test + public void shouldFindByCaseId() { + Multimedia expectedMultimedia = getMultimedia(); + Multimedia invalidMultimedia = getMultimedia(); + invalidMultimedia.setCaseId(DIFFERENT_BASE_ENTITY_ID); + addObjectToRepository(asList(expectedMultimedia, invalidMultimedia), multimediaRepository); + + Multimedia actualMultimedia = multimediaService.findByCaseId(CASE_ID); + + assertEquals(expectedMultimedia, actualMultimedia); + } + + @Test + public void shouldFindAllByProviderId() { + Multimedia expectedMultimedia = getMultimedia(); + Multimedia expectedMultimedia1 = getMultimedia(); + List expectedMultimedias = asList(expectedMultimedia, expectedMultimedia1); + Multimedia invalidMultimedia = getMultimedia(); + invalidMultimedia.setProviderId(DIFFERENT_BASE_ENTITY_ID); + addObjectToRepository(asList(expectedMultimedia, expectedMultimedia1, invalidMultimedia), multimediaRepository); + + List actualMultimedias = multimediaService.getMultimediaFiles(PROVIDER_ID); + + assertTwoListAreSameIgnoringOrder(expectedMultimedias, actualMultimedias); + } + + @Test + public void shouldUploadJpegFile() throws IOException { + String pathname = BASE_IMAGE_PATH + File.separator + CASE_ID + ".jpg"; + MultimediaDTO multimediaDTO = getMultimediaDTO("image/jpeg"); + byte[] testBytes = new byte[10]; + + boolean result = fileManager.uploadFile(multimediaDTO, testBytes, "original_name.jpg"); + + assertTrue(result); + assertTrue(new File(BASE_IMAGE_PATH).exists()); + verify(fileManager, times(1)).copyBytesToFile(new File(pathname), testBytes); + } + + @Test + public void shouldUploadGifFile() throws IOException { + String pathname = BASE_IMAGE_PATH + File.separator + CASE_ID + ".gif"; + MultimediaDTO multimediaDTO = getMultimediaDTO("image/gif"); + byte[] testBytes = new byte[10]; + + boolean result = fileManager.uploadFile(multimediaDTO, testBytes, "original_name.gif"); + + assertTrue(result); + assertTrue(new File(BASE_IMAGE_PATH).exists()); + verify(fileManager, times(1)).copyBytesToFile(new File(pathname), testBytes); + } + + @Test + public void shouldUploadPngFile() throws IOException { + String pathname = BASE_IMAGE_PATH + CASE_ID + ".png"; + MultimediaDTO multimediaDTO = getMultimediaDTO("image/png"); + byte[] testBytes = new byte[10]; + + boolean result = fileManager.uploadFile(multimediaDTO, testBytes, "original_name.jpg"); + + assertTrue(result); + assertTrue(new File(BASE_IMAGE_PATH).exists()); + verify(fileManager, times(1)).copyBytesToFile(new File(pathname), testBytes); + } + + @Test + public void shouldUploadVideoOctetStreamFile() throws IOException { + String BASE_IMAGE_PATH = baseMultimediaDirPath + "/" + "videos/"; + String pathname = BASE_IMAGE_PATH + CASE_ID + ".mp4"; + MultimediaDTO multimediaDTO = getMultimediaDTO("application/octet-stream"); + byte[] testBytes = new byte[10]; + + boolean result = fileManager.uploadFile(multimediaDTO, testBytes, "original_name.mp4"); + + assertTrue(result); + assertTrue(new File(BASE_IMAGE_PATH).exists()); + verify(fileManager, times(1)).copyBytesToFile(new File(pathname), testBytes); + } + + @Test + public void shouldReturnFalseUnknownContentType() throws IOException { + MultimediaDTO multimediaDTO = getMultimediaDTO("unknown"); + byte[] testBytes = new byte[10]; + + assertFalse(fileManager.uploadFile(multimediaDTO, testBytes, null)); + } + + @Test + public void shouldReturnFalseFormEmptyMultiPartFile() { + MultimediaDTO multimediaDTO = getMultimediaDTO("image/jpeg"); + + assertFalse(fileManager.uploadFile(multimediaDTO, null, null)); + } + + @Test + public void shouldSaveMultimediaForSuccessfulUpdate() { + MultimediaDTO multimediaDTO = getMultimediaDTO("image/png"); + byte[] testBytes = new byte[10]; + Multimedia expectedMultimedia = getMultimedia(); + expectedMultimedia.setContentType("image/png"); + expectedMultimedia.setFilePath(BASE_IMAGE_PATH + CASE_ID + ".png"); + + String result = fileManager.saveMultimediaFile(multimediaDTO, testBytes, "original_name.png"); + + assertEquals("success", result); + List dbFiles = multimediaRepository.getAll(); + assertEquals(1, dbFiles.size()); + + Multimedia actualMultimedia = dbFiles.get(0); + assertEquals(expectedMultimedia.getFilePath(), actualMultimedia.getFilePath()); + assertEquals(expectedMultimedia.getProviderId(), actualMultimedia.getProviderId()); + assertEquals(expectedMultimedia.getContentType(), actualMultimedia.getContentType()); + assertEquals(expectedMultimedia.getFileCategory(), actualMultimedia.getFileCategory()); + assertEquals(expectedMultimedia.getCaseId(), actualMultimedia.getCaseId()); + } + + @Test + public void shouldReturnFailForUnsuccessfulUpdate() { + MultimediaDTO multimediaDTO = getMultimediaDTO("unknown"); + byte[] testBytes = new byte[10]; + + String result = fileManager.saveMultimediaFile(multimediaDTO, testBytes, "original_name"); + + assertEquals("fail", result); + List dbFiles = multimediaRepository.getAll(); + assertEquals(0, dbFiles.size()); + } + + @Test + public void testRetrieveFileShouldCallFileManager() { + MultimediaFileManager fileManager = mock(FileSystemMultimediaFileManager.class); + multimediaService.setFileManager(fileManager); + multimediaService.retrieveFile("file_path"); + verify(fileManager).retrieveFile(eq("file_path")); + } + + @Test + public void testSaveFileShouldCallFileManager() { + MultimediaFileManager fileManager = mock(FileSystemMultimediaFileManager.class); + multimediaService.setFileManager(fileManager); + + byte[] testBytes = new byte[10]; + MultimediaDTO multimediaDTO = mock(MultimediaDTO.class); + multimediaService.saveFile(multimediaDTO, testBytes, null); + verify(fileManager).saveFile(eq(multimediaDTO), eq(testBytes), eq(null)); + } } diff --git a/src/test/java/org/opensrp/service/it/ReportServiceTest.java b/src/test/java/org/opensrp/service/it/ReportServiceTest.java index 74699ab69..ecfc33d5e 100644 --- a/src/test/java/org/opensrp/service/it/ReportServiceTest.java +++ b/src/test/java/org/opensrp/service/it/ReportServiceTest.java @@ -31,277 +31,277 @@ import org.springframework.beans.factory.annotation.Autowired; public class ReportServiceTest extends BaseIntegrationTest { - - @Autowired - private ReportsRepositoryImpl allReports; - - @Autowired - private ReportService reportService; - - @Before - public void setUp() { - allReports.removeAll(); - } - - @After - public void cleanUp() { - allReports.removeAll(); - } - - @Test - public void shouldFindById() { - addObjectToRepository(Collections.singletonList(getReport()), allReports); - Report expectedReport = allReports.getAll().get(0); - - Report actualReport = reportService.getById(expectedReport.getId()); - - assertEquals(expectedReport, actualReport); - } - - @Test - public void shouldFindByBaseEntityIdAndFormSubmissionId() { - Report expectedReport = getReport(); - Report invalidReport = getReport(); - invalidReport.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - addObjectToRepository(asList(expectedReport, invalidReport), allReports); - - Report actualReport = reportService.getByBaseEntityAndFormSubmissionId(BASE_ENTITY_ID, FORM_SUBMISSION_ID); - - assertEquals(expectedReport, actualReport); - } - - @Test - public void shouldFindByBaseEntityId() { - Report report = getReport(); - Report report1 = getReport(); - List expectedReports = asList(report, report1); - Report invalidReport = getReport(); - invalidReport.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - addObjectToRepository(asList(report, report1, invalidReport), allReports); - - List actualReports = reportService.findByBaseEntityId(BASE_ENTITY_ID); - - assertTwoListAreSameIgnoringOrder(expectedReports, actualReports); - } - - @Test(expected = IllegalStateException.class) - public void shouldThrowExceptionIfMultipleFound() { - Report report = getReport(); - Report report1 = getReport(); - addObjectToRepository(asList(report, report1), allReports); - - reportService.getByBaseEntityAndFormSubmissionId(BASE_ENTITY_ID, FORM_SUBMISSION_ID); - } - - @Test - public void shouldReturnNullIfNoneFound() { - assertNull(reportService.getByBaseEntityAndFormSubmissionId(BASE_ENTITY_ID, FORM_SUBMISSION_ID)); - } - - @Test - public void shouldFindByUniqueIdentifier() { - Report expectedReport = getReport(); - Report invalidReport = getReport(); - Map differentIdentifiers = new HashMap<>(identifier); - differentIdentifiers.put(IDENTIFIER_TYPE, DIFFERENT_BASE_ENTITY_ID); - invalidReport.setIdentifiers(differentIdentifiers); - addObjectToRepository(asList(expectedReport, invalidReport), allReports); - - Report actualReport = reportService.find(IDENTIFIER_VALUE); - - assertEquals(expectedReport, actualReport); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionIfMultipleFoundWhileFindByUniqueId() { - Report report = getReport(); - Report report1 = getReport(); - addObjectToRepository(asList(report, report1), allReports); - - reportService.find(IDENTIFIER_VALUE); - } - - @Test - public void shouldReturnNullIfNoneFoundWhileFindByIdentifier() { - assertNull(reportService.find(IDENTIFIER_VALUE)); - } - - @Test - public void shouldFindByReportObject() { - Report expectedReport = getReport(); - Report invalidReport = getReport(); - Map differentIdentifiers = new HashMap<>(identifier); - differentIdentifiers.put(IDENTIFIER_TYPE, DIFFERENT_BASE_ENTITY_ID); - invalidReport.setIdentifiers(differentIdentifiers); - addObjectToRepository(asList(expectedReport, invalidReport), allReports); - - Report actualReport = reportService.find(expectedReport); - - assertEquals(expectedReport, actualReport); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionIfMultipleFoundWhileFindByReportObject() { - Report report = getReport(); - Report report1 = getReport(); - addObjectToRepository(asList(report, report1), allReports); - - reportService.find(report); - } - - @Test - public void shouldReturnNullIfNoneFoundWhileFindByReportObject() { - assertNull(reportService.find(getReport())); - } - - @Test - public void shouldFindByReportId() { - addObjectToRepository(Collections.singletonList(getReport()), allReports); - Report expectedReport = allReports.getAll().get(0); - - Report actualReport = reportService.findById(expectedReport.getId()); - - assertEquals(expectedReport, actualReport); - } - - @Test(expected = Exception.class) - public void shouldThrowErrorIfMultipleRecordFoundWhileFindById() { - addObjectToRepository(Collections.singletonList(getReport()), allReports); - Report expectedReport = allReports.getAll().get(0); - addObjectToRepository(Collections.singletonList(expectedReport), allReports); - - reportService.findById(expectedReport.getId()); - - } - - @Test - public void shouldReturnNullIfNoneFoundUsingDocumentId() { - addObjectToRepository(Collections.singletonList(getReport()), allReports); - assertNull(reportService.findById(DIFFERENT_BASE_ENTITY_ID)); - } - - @Test - public void shouldReturnNullForNullOrEmptyId() { - assertNull(reportService.findById(null)); - assertNull(reportService.findById("")); - } - - @Test - public void shouldGetAllReport() { - Report report = getReport(); - Report report1 = getReport(); - List expectedReports = asList(report, report1); - addObjectToRepository(expectedReports, allReports); - - List actualReports = reportService.getAll(); - - assertTwoListAreSameIgnoringOrder(expectedReports, actualReports); - } - - @Test - public void shouldFindByServerVersion() { - Report report = getReport(); - Report report1 = getReport(); - List expectedReports = asList(report, report1); - addObjectToRepository(expectedReports, allReports); - - List actualReports = reportService.findByServerVersion(0); - - assertTwoListAreSameIgnoringOrder(expectedReports, actualReports); - } - - @Test - public void shouldFindByIdentifier() { - Report report1 = getReport(); - Report report = getReport(); - Report invalidReport = getReport(); - Map differentIdentifiers = new HashMap<>(identifier); - differentIdentifiers.put(IDENTIFIER_TYPE, DIFFERENT_BASE_ENTITY_ID); - invalidReport.setIdentifiers(differentIdentifiers); - List expectedReports = asList(report1, report); - addObjectToRepository(asList(report1, report, invalidReport), allReports); - - List actualReports = reportService.findAllByIdentifier(IDENTIFIER_VALUE); - - assertTwoListAreSameIgnoringOrder(expectedReports, actualReports); - } - - @Test - public void shouldAddReport() { - Report expectedReport = getReport(); - - Report actualReport = reportService.addReport(expectedReport); - List dbReports = allReports.getAll(); - - assertEquals(1, dbReports.size()); - assertEquals(expectedReport, actualReport); - assertNewObjectCreation(expectedReport, dbReports.get(0)); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionWhileAddingExistingReport() { - Report report = getReport(); - - addObjectToRepository(Collections.singletonList(report), allReports); - - reportService.addReport(report); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionIfExistingReportFoundByBaseEntityIdAndFormSubmissionId() { - Report report = getReport(); - addObjectToRepository(Collections.singletonList(report), allReports); - report.setIdentifiers(null); - reportService.addReport(report); - } - - @Test - public void shouldUpdateExistingReport() { - addObjectToRepository(Collections.singletonList(getReport()), allReports); - Report updatedReport = allReports.getAll().get(0); - updatedReport.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - - reportService.updateReport(updatedReport); - - List actualReports = allReports.getAll(); - - assertEquals(1, actualReports.size()); - assertObjectUpdate(updatedReport, actualReports.get(0)); - } - - @Test(expected = IllegalArgumentException.class) - public void shouldThrowExceptionIfNewObjectWhileUpdate() { - reportService.updateReport(getReport()); - } - - @Test - public void shouldAddIfNewInAddOrUpdate() { - Report expectedReport = getReport(); - - Report actualReport = reportService.addorUpdateReport(expectedReport); - List dbReports = allReports.getAll(); - - assertEquals(1, dbReports.size()); - assertEquals(expectedReport, actualReport); - assertNewObjectCreation(expectedReport, dbReports.get(0)); - } - - @Test - public void shouldUpdateReportIfExistInAddOrUpdate() { - addObjectToRepository(Collections.singletonList(getReport()), allReports); - Report updatedReport = allReports.getAll().get(0); - updatedReport.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); - - Report actualReport = reportService.addorUpdateReport(updatedReport); - List dbReports = allReports.getAll(); - - assertEquals(1, dbReports.size()); - assertEquals(updatedReport, actualReport); - - assertNotNull(dbReports.get(0).getServerVersion()); - updatedReport.setServerVersion(0l); - dbReports.get(0).setServerVersion(0l); - - assertObjectUpdate(updatedReport, dbReports.get(0)); - } + + @Autowired + private ReportsRepositoryImpl allReports; + + @Autowired + private ReportService reportService; + + @Before + public void setUp() { + allReports.removeAll(); + } + + @After + public void cleanUp() { + allReports.removeAll(); + } + + @Test + public void shouldFindById() { + addObjectToRepository(Collections.singletonList(getReport()), allReports); + Report expectedReport = allReports.getAll().get(0); + + Report actualReport = reportService.getById(expectedReport.getId()); + + assertEquals(expectedReport, actualReport); + } + + @Test + public void shouldFindByBaseEntityIdAndFormSubmissionId() { + Report expectedReport = getReport(); + Report invalidReport = getReport(); + invalidReport.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + addObjectToRepository(asList(expectedReport, invalidReport), allReports); + + Report actualReport = reportService.getByBaseEntityAndFormSubmissionId(BASE_ENTITY_ID, FORM_SUBMISSION_ID); + + assertEquals(expectedReport, actualReport); + } + + @Test + public void shouldFindByBaseEntityId() { + Report report = getReport(); + Report report1 = getReport(); + List expectedReports = asList(report, report1); + Report invalidReport = getReport(); + invalidReport.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + addObjectToRepository(asList(report, report1, invalidReport), allReports); + + List actualReports = reportService.findByBaseEntityId(BASE_ENTITY_ID); + + assertTwoListAreSameIgnoringOrder(expectedReports, actualReports); + } + + @Test(expected = IllegalStateException.class) + public void shouldThrowExceptionIfMultipleFound() { + Report report = getReport(); + Report report1 = getReport(); + addObjectToRepository(asList(report, report1), allReports); + + reportService.getByBaseEntityAndFormSubmissionId(BASE_ENTITY_ID, FORM_SUBMISSION_ID); + } + + @Test + public void shouldReturnNullIfNoneFound() { + assertNull(reportService.getByBaseEntityAndFormSubmissionId(BASE_ENTITY_ID, FORM_SUBMISSION_ID)); + } + + @Test + public void shouldFindByUniqueIdentifier() { + Report expectedReport = getReport(); + Report invalidReport = getReport(); + Map differentIdentifiers = new HashMap<>(identifier); + differentIdentifiers.put(IDENTIFIER_TYPE, DIFFERENT_BASE_ENTITY_ID); + invalidReport.setIdentifiers(differentIdentifiers); + addObjectToRepository(asList(expectedReport, invalidReport), allReports); + + Report actualReport = reportService.find(IDENTIFIER_VALUE); + + assertEquals(expectedReport, actualReport); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionIfMultipleFoundWhileFindByUniqueId() { + Report report = getReport(); + Report report1 = getReport(); + addObjectToRepository(asList(report, report1), allReports); + + reportService.find(IDENTIFIER_VALUE); + } + + @Test + public void shouldReturnNullIfNoneFoundWhileFindByIdentifier() { + assertNull(reportService.find(IDENTIFIER_VALUE)); + } + + @Test + public void shouldFindByReportObject() { + Report expectedReport = getReport(); + Report invalidReport = getReport(); + Map differentIdentifiers = new HashMap<>(identifier); + differentIdentifiers.put(IDENTIFIER_TYPE, DIFFERENT_BASE_ENTITY_ID); + invalidReport.setIdentifiers(differentIdentifiers); + addObjectToRepository(asList(expectedReport, invalidReport), allReports); + + Report actualReport = reportService.find(expectedReport); + + assertEquals(expectedReport, actualReport); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionIfMultipleFoundWhileFindByReportObject() { + Report report = getReport(); + Report report1 = getReport(); + addObjectToRepository(asList(report, report1), allReports); + + reportService.find(report); + } + + @Test + public void shouldReturnNullIfNoneFoundWhileFindByReportObject() { + assertNull(reportService.find(getReport())); + } + + @Test + public void shouldFindByReportId() { + addObjectToRepository(Collections.singletonList(getReport()), allReports); + Report expectedReport = allReports.getAll().get(0); + + Report actualReport = reportService.findById(expectedReport.getId()); + + assertEquals(expectedReport, actualReport); + } + + @Test(expected = Exception.class) + public void shouldThrowErrorIfMultipleRecordFoundWhileFindById() { + addObjectToRepository(Collections.singletonList(getReport()), allReports); + Report expectedReport = allReports.getAll().get(0); + addObjectToRepository(Collections.singletonList(expectedReport), allReports); + + reportService.findById(expectedReport.getId()); + + } + + @Test + public void shouldReturnNullIfNoneFoundUsingDocumentId() { + addObjectToRepository(Collections.singletonList(getReport()), allReports); + assertNull(reportService.findById(DIFFERENT_BASE_ENTITY_ID)); + } + + @Test + public void shouldReturnNullForNullOrEmptyId() { + assertNull(reportService.findById(null)); + assertNull(reportService.findById("")); + } + + @Test + public void shouldGetAllReport() { + Report report = getReport(); + Report report1 = getReport(); + List expectedReports = asList(report, report1); + addObjectToRepository(expectedReports, allReports); + + List actualReports = reportService.getAll(); + + assertTwoListAreSameIgnoringOrder(expectedReports, actualReports); + } + + @Test + public void shouldFindByServerVersion() { + Report report = getReport(); + Report report1 = getReport(); + List expectedReports = asList(report, report1); + addObjectToRepository(expectedReports, allReports); + + List actualReports = reportService.findByServerVersion(0); + + assertTwoListAreSameIgnoringOrder(expectedReports, actualReports); + } + + @Test + public void shouldFindByIdentifier() { + Report report1 = getReport(); + Report report = getReport(); + Report invalidReport = getReport(); + Map differentIdentifiers = new HashMap<>(identifier); + differentIdentifiers.put(IDENTIFIER_TYPE, DIFFERENT_BASE_ENTITY_ID); + invalidReport.setIdentifiers(differentIdentifiers); + List expectedReports = asList(report1, report); + addObjectToRepository(asList(report1, report, invalidReport), allReports); + + List actualReports = reportService.findAllByIdentifier(IDENTIFIER_VALUE); + + assertTwoListAreSameIgnoringOrder(expectedReports, actualReports); + } + + @Test + public void shouldAddReport() { + Report expectedReport = getReport(); + + Report actualReport = reportService.addReport(expectedReport); + List dbReports = allReports.getAll(); + + assertEquals(1, dbReports.size()); + assertEquals(expectedReport, actualReport); + assertNewObjectCreation(expectedReport, dbReports.get(0)); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionWhileAddingExistingReport() { + Report report = getReport(); + + addObjectToRepository(Collections.singletonList(report), allReports); + + reportService.addReport(report); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionIfExistingReportFoundByBaseEntityIdAndFormSubmissionId() { + Report report = getReport(); + addObjectToRepository(Collections.singletonList(report), allReports); + report.setIdentifiers(null); + reportService.addReport(report); + } + + @Test + public void shouldUpdateExistingReport() { + addObjectToRepository(Collections.singletonList(getReport()), allReports); + Report updatedReport = allReports.getAll().get(0); + updatedReport.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + + reportService.updateReport(updatedReport); + + List actualReports = allReports.getAll(); + + assertEquals(1, actualReports.size()); + assertObjectUpdate(updatedReport, actualReports.get(0)); + } + + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionIfNewObjectWhileUpdate() { + reportService.updateReport(getReport()); + } + + @Test + public void shouldAddIfNewInAddOrUpdate() { + Report expectedReport = getReport(); + + Report actualReport = reportService.addorUpdateReport(expectedReport); + List dbReports = allReports.getAll(); + + assertEquals(1, dbReports.size()); + assertEquals(expectedReport, actualReport); + assertNewObjectCreation(expectedReport, dbReports.get(0)); + } + + @Test + public void shouldUpdateReportIfExistInAddOrUpdate() { + addObjectToRepository(Collections.singletonList(getReport()), allReports); + Report updatedReport = allReports.getAll().get(0); + updatedReport.setBaseEntityId(DIFFERENT_BASE_ENTITY_ID); + + Report actualReport = reportService.addorUpdateReport(updatedReport); + List dbReports = allReports.getAll(); + + assertEquals(1, dbReports.size()); + assertEquals(updatedReport, actualReport); + + assertNotNull(dbReports.get(0).getServerVersion()); + updatedReport.setServerVersion(0l); + dbReports.get(0).setServerVersion(0l); + + assertObjectUpdate(updatedReport, dbReports.get(0)); + } } diff --git a/src/test/java/org/opensrp/service/it/SearchServiceTest.java b/src/test/java/org/opensrp/service/it/SearchServiceTest.java index 4e766bdea..133060516 100644 --- a/src/test/java/org/opensrp/service/it/SearchServiceTest.java +++ b/src/test/java/org/opensrp/service/it/SearchServiceTest.java @@ -32,65 +32,65 @@ import org.springframework.beans.factory.annotation.Autowired; public class SearchServiceTest extends BaseIntegrationTest { - - @Autowired - public ClientsRepositoryImpl allClients; - - @Autowired - public SearchService searchService; - - @Before - public void setUp() { - allClients.removeAll(); - } - - @After - public void cleanUp() { - allClients.removeAll(); - } - - @Test - public void shouldSearchClient() { - Client expectedClient = createExpectedClient(); - expectedClient.setAttributes(attributes); - Client expectedClient2 = createExpectedClient(); - expectedClient2.addAttribute("inactive", true); - Client expectedClient3 = createExpectedClient(); - expectedClient3.addAttribute("lost_to_follow_up", true); - Client expectedClient4 = createExpectedClient(); - expectedClient4.addAttribute("inactive", false); - List expectedClients = asList(expectedClient, expectedClient2, expectedClient3, expectedClient4); - addObjectToRepository(expectedClients, allClients); - - Map queryAttributes = new HashMap<>(); - queryAttributes.put(ATTRIBUTES_TYPE, ATTRIBUTES_VALUE); - queryAttributes.put("inactive", "true"); - queryAttributes.put("inactive", "false"); - queryAttributes.put("lost_to_follow_up", "true"); - - ClientSearchBean clientSearchBean = new ClientSearchBean(); - clientSearchBean.setNameLike("first"); - clientSearchBean.setGender(expectedClient.getGender()); - clientSearchBean.setBirthdateFrom(EPOCH_DATE_TIME); - clientSearchBean.setBirthdateTo(new DateTime(DateTimeZone.UTC)); - clientSearchBean.setLastEditFrom(EPOCH_DATE_TIME); - clientSearchBean.setLastEditTo(new DateTime(DateTimeZone.UTC)); - List actualClients = searchService.searchClient(clientSearchBean, "first", "middle", "last", 10); - assertTwoListAreSameIgnoringOrder(expectedClients, actualClients); - } - - private Client createExpectedClient() { - Client expectedClient = new Client(BASE_ENTITY_ID); - expectedClient.setFirstName(FIRST_NAME); - expectedClient.setMiddleName(MIDDLE_NAME); - expectedClient.setLastName(LAST_NAME); - expectedClient.setBirthdate(EPOCH_DATE_TIME); - expectedClient.setAddresses(asList(getAddress())); - expectedClient.setDateCreated(EPOCH_DATE_TIME); - expectedClient.setGender(FEMALE); - expectedClient.setDateEdited(EPOCH_DATE_TIME); - expectedClient.setIdentifiers(identifier); - return expectedClient; - } - + + @Autowired + public ClientsRepositoryImpl allClients; + + @Autowired + public SearchService searchService; + + @Before + public void setUp() { + allClients.removeAll(); + } + + @After + public void cleanUp() { + allClients.removeAll(); + } + + @Test + public void shouldSearchClient() { + Client expectedClient = createExpectedClient(); + expectedClient.setAttributes(attributes); + Client expectedClient2 = createExpectedClient(); + expectedClient2.addAttribute("inactive", true); + Client expectedClient3 = createExpectedClient(); + expectedClient3.addAttribute("lost_to_follow_up", true); + Client expectedClient4 = createExpectedClient(); + expectedClient4.addAttribute("inactive", false); + List expectedClients = asList(expectedClient, expectedClient2, expectedClient3, expectedClient4); + addObjectToRepository(expectedClients, allClients); + + Map queryAttributes = new HashMap<>(); + queryAttributes.put(ATTRIBUTES_TYPE, ATTRIBUTES_VALUE); + queryAttributes.put("inactive", "true"); + queryAttributes.put("inactive", "false"); + queryAttributes.put("lost_to_follow_up", "true"); + + ClientSearchBean clientSearchBean = new ClientSearchBean(); + clientSearchBean.setNameLike("first"); + clientSearchBean.setGender(expectedClient.getGender()); + clientSearchBean.setBirthdateFrom(EPOCH_DATE_TIME); + clientSearchBean.setBirthdateTo(new DateTime(DateTimeZone.UTC)); + clientSearchBean.setLastEditFrom(EPOCH_DATE_TIME); + clientSearchBean.setLastEditTo(new DateTime(DateTimeZone.UTC)); + List actualClients = searchService.searchClient(clientSearchBean, "first", "middle", "last", 10); + assertTwoListAreSameIgnoringOrder(expectedClients, actualClients); + } + + private Client createExpectedClient() { + Client expectedClient = new Client(BASE_ENTITY_ID); + expectedClient.setFirstName(FIRST_NAME); + expectedClient.setMiddleName(MIDDLE_NAME); + expectedClient.setLastName(LAST_NAME); + expectedClient.setBirthdate(EPOCH_DATE_TIME); + expectedClient.setAddresses(asList(getAddress())); + expectedClient.setDateCreated(EPOCH_DATE_TIME); + expectedClient.setGender(FEMALE); + expectedClient.setDateEdited(EPOCH_DATE_TIME); + expectedClient.setIdentifiers(identifier); + return expectedClient; + } + } diff --git a/src/test/java/org/opensrp/service/it/TaskServiceIntegrationTest.java b/src/test/java/org/opensrp/service/it/TaskServiceIntegrationTest.java index 7a2bab22d..a63a8bb05 100644 --- a/src/test/java/org/opensrp/service/it/TaskServiceIntegrationTest.java +++ b/src/test/java/org/opensrp/service/it/TaskServiceIntegrationTest.java @@ -1,5 +1,5 @@ /** - * + * */ package org.opensrp.service.it; @@ -25,54 +25,56 @@ * @author Samuel Githengi created on 11/23/20 */ public class TaskServiceIntegrationTest extends BaseIntegrationTest { - - @Autowired - private TaskService taskService; - - @Autowired - private TaskRepository taskRepository; - - - @Autowired - private DataSource openSRPDataSource; - - @Test - public void testCreateBatchShouldGenerateServerVersionWithCorrectOrder() throws Exception { - DbAccessUtils.truncateTable("core.task", openSRPDataSource); - List taskList = getTasks(500); - taskList.parallelStream().forEach(task -> taskService.addOrUpdateTask(task)); - Thread.sleep(500); - List savedTasks = taskRepository.getTasksByPlanAndGroup("plan1", "oa1", 0l,true); - savedTasks.sort(new Comparator() { - - public int compare(Task arg0, Task arg1) { - return arg0.getRowid().compareTo(arg1.getRowid()); - }; - }); - long previousServerVersion = savedTasks.get(0).getServerVersion(); - for (Task task : savedTasks) { - if (previousServerVersion > task.getServerVersion()) { - fail(String.format("Server version generated in the wrong Order. id:%d, Sv: %d, Previous Sv: %d ", - task.getRowid(), task.getServerVersion(), previousServerVersion)); - } - - previousServerVersion = task.getServerVersion(); - - } - } - - private List getTasks(int count) { - List tasks = new ArrayList<>(); - for (int i = 0; i < count; i++) { - Task task = new Task(); - task.setGroupIdentifier("oa1"); - task.setPlanIdentifier("plan1"); - task.setStatus(TaskStatus.READY); - task.setPriority(TaskPriority.ROUTINE); - task.setIdentifier("id" + i); - tasks.add(task); - } - return tasks; - } - + + @Autowired + private TaskService taskService; + + @Autowired + private TaskRepository taskRepository; + + + @Autowired + private DataSource openSRPDataSource; + + @Test + public void testCreateBatchShouldGenerateServerVersionWithCorrectOrder() throws Exception { + DbAccessUtils.truncateTable("core.task", openSRPDataSource); + List taskList = getTasks(500); + taskList.parallelStream().forEach(task -> taskService.addOrUpdateTask(task)); + Thread.sleep(500); + List savedTasks = taskRepository.getTasksByPlanAndGroup("plan1", "oa1", 0l, true); + savedTasks.sort(new Comparator() { + + public int compare(Task arg0, Task arg1) { + return arg0.getRowid().compareTo(arg1.getRowid()); + } + + ; + }); + long previousServerVersion = savedTasks.get(0).getServerVersion(); + for (Task task : savedTasks) { + if (previousServerVersion > task.getServerVersion()) { + fail(String.format("Server version generated in the wrong Order. id:%d, Sv: %d, Previous Sv: %d ", + task.getRowid(), task.getServerVersion(), previousServerVersion)); + } + + previousServerVersion = task.getServerVersion(); + + } + } + + private List getTasks(int count) { + List tasks = new ArrayList<>(); + for (int i = 0; i < count; i++) { + Task task = new Task(); + task.setGroupIdentifier("oa1"); + task.setPlanIdentifier("plan1"); + task.setStatus(TaskStatus.READY); + task.setPriority(TaskPriority.ROUTINE); + task.setIdentifier("id" + i); + tasks.add(task); + } + return tasks; + } + } diff --git a/src/test/java/org/opensrp/service/multimedia/BaseMultimediaFileManagerTest.java b/src/test/java/org/opensrp/service/multimedia/BaseMultimediaFileManagerTest.java index f4116bb89..729e0e5b0 100644 --- a/src/test/java/org/opensrp/service/multimedia/BaseMultimediaFileManagerTest.java +++ b/src/test/java/org/opensrp/service/multimedia/BaseMultimediaFileManagerTest.java @@ -15,39 +15,39 @@ @ContextConfiguration("classpath:test-applicationContext-opensrp.xml") public abstract class BaseMultimediaFileManagerTest { - public void setUp() throws Exception { - deleteTestFile(); - createTestFile(); - } - - protected void createTestFile() throws IOException { - if (!testFileExists()) { - PrintWriter writer = new PrintWriter(getTestFilePath(), "UTF-8"); - writer.println("The first line"); - writer.close(); - } - } - - private boolean testFileExists() { - return new File(getTestFilePath()).exists(); - } - - protected String getTestFilePath() { - return getTestFileFolder() + File.separator + "test_file"; - } - - protected String getDataFilePath() { - return getTestFileFolder() + File.separator + "data_file"; - } - - protected String getTestFileFolder() { - return getBasePackageFilePath() + "/src/test/java/org/opensrp/service/multimedia"; - } - - protected void deleteTestFile() { - File testFile = new File(getTestFilePath()); - if (testFile.exists()) { - testFile.delete(); - } - } + public void setUp() throws Exception { + deleteTestFile(); + createTestFile(); + } + + protected void createTestFile() throws IOException { + if (!testFileExists()) { + PrintWriter writer = new PrintWriter(getTestFilePath(), "UTF-8"); + writer.println("The first line"); + writer.close(); + } + } + + private boolean testFileExists() { + return new File(getTestFilePath()).exists(); + } + + protected String getTestFilePath() { + return getTestFileFolder() + File.separator + "test_file"; + } + + protected String getDataFilePath() { + return getTestFileFolder() + File.separator + "data_file"; + } + + protected String getTestFileFolder() { + return getBasePackageFilePath() + "/src/test/java/org/opensrp/service/multimedia"; + } + + protected void deleteTestFile() { + File testFile = new File(getTestFilePath()); + if (testFile.exists()) { + testFile.delete(); + } + } } diff --git a/src/test/java/org/opensrp/service/multimedia/FileSystemMultimediaFileManagerTest.java b/src/test/java/org/opensrp/service/multimedia/FileSystemMultimediaFileManagerTest.java index 0034cab8c..5f34265d5 100644 --- a/src/test/java/org/opensrp/service/multimedia/FileSystemMultimediaFileManagerTest.java +++ b/src/test/java/org/opensrp/service/multimedia/FileSystemMultimediaFileManagerTest.java @@ -25,52 +25,52 @@ */ public class FileSystemMultimediaFileManagerTest extends BaseMultimediaFileManagerTest { - private FileSystemMultimediaFileManager fileSystemMultimediaFileManager; + private FileSystemMultimediaFileManager fileSystemMultimediaFileManager; - @Value("#{opensrp['multimedia.directory.name']}") - private String baseMultimediaDirPath; + @Value("#{opensrp['multimedia.directory.name']}") + private String baseMultimediaDirPath; - @Captor - private ArgumentCaptor fileArgumentCaptor = ArgumentCaptor.forClass(File.class); + @Captor + private ArgumentCaptor fileArgumentCaptor = ArgumentCaptor.forClass(File.class); - @Mock - private ClientService clientService; + @Mock + private ClientService clientService; - @Mock - private MultimediaRepository multimediaRepository; + @Mock + private MultimediaRepository multimediaRepository; - @Before - public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); - super.setUp(); - fileSystemMultimediaFileManager = new FileSystemMultimediaFileManager(multimediaRepository, clientService); - } + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + super.setUp(); + fileSystemMultimediaFileManager = new FileSystemMultimediaFileManager(multimediaRepository, clientService); + } - @Test - public void testPersistFileToStorageShouldPersistFileToFileSystem() throws IOException { - byte[] testBytes = new byte[10]; - fileSystemMultimediaFileManager = Mockito.spy(fileSystemMultimediaFileManager); - fileSystemMultimediaFileManager.persistFileToStorage("file_name", testBytes); - verify(fileSystemMultimediaFileManager).copyBytesToFile(fileArgumentCaptor.capture(), Mockito.eq(testBytes)); + @Test + public void testPersistFileToStorageShouldPersistFileToFileSystem() throws IOException { + byte[] testBytes = new byte[10]; + fileSystemMultimediaFileManager = Mockito.spy(fileSystemMultimediaFileManager); + fileSystemMultimediaFileManager.persistFileToStorage("file_name", testBytes); + verify(fileSystemMultimediaFileManager).copyBytesToFile(fileArgumentCaptor.capture(), Mockito.eq(testBytes)); - File file = fileArgumentCaptor.getValue(); - assertNotNull(file); - assertEquals(file.getPath(), "file_name"); - } + File file = fileArgumentCaptor.getValue(); + assertNotNull(file); + assertEquals(file.getPath(), "file_name"); + } - @Test - public void testRetrieveFileShouldRetrieveFileFromFileSystem() { - String testFilePath = getBasePackageFilePath() + "/src/test/java/org/opensrp/service/multimedia/test_file"; - assertNotNull(fileSystemMultimediaFileManager.retrieveFile(testFilePath)); - } + @Test + public void testRetrieveFileShouldRetrieveFileFromFileSystem() { + String testFilePath = getBasePackageFilePath() + "/src/test/java/org/opensrp/service/multimedia/test_file"; + assertNotNull(fileSystemMultimediaFileManager.retrieveFile(testFilePath)); + } - @Test - public void testRetrieveFileShouldReturnNullForNonExistentFile() { - assertNull(fileSystemMultimediaFileManager.retrieveFile("non_existent_file")); - } + @Test + public void testRetrieveFileShouldReturnNullForNonExistentFile() { + assertNull(fileSystemMultimediaFileManager.retrieveFile("non_existent_file")); + } - @Test - public void testGetMultiMediaDirShouldReturnCorrectFilePath() { - assertEquals(baseMultimediaDirPath + File.separator, fileSystemMultimediaFileManager.getBaseMultiMediaDir()); - } + @Test + public void testGetMultiMediaDirShouldReturnCorrectFilePath() { + assertEquals(baseMultimediaDirPath + File.separator, fileSystemMultimediaFileManager.getBaseMultiMediaDir()); + } } diff --git a/src/test/java/org/opensrp/service/multimedia/OSSMultimediaFileManagerTest.java b/src/test/java/org/opensrp/service/multimedia/OSSMultimediaFileManagerTest.java index ccff63075..34916ec8b 100644 --- a/src/test/java/org/opensrp/service/multimedia/OSSMultimediaFileManagerTest.java +++ b/src/test/java/org/opensrp/service/multimedia/OSSMultimediaFileManagerTest.java @@ -37,99 +37,99 @@ * Created by Vincent Karuri on 20/05/2020 */ public class OSSMultimediaFileManagerTest extends BaseMultimediaFileManagerTest { - - private OSSMultimediaFileManager ossMultimediaFileManager; - - @Captor - private ArgumentCaptor byteStreamArgumentCaptor = ArgumentCaptor.forClass(ByteArrayInputStream.class); - - @Captor - private ArgumentCaptor stringArgumentCaptor = ArgumentCaptor.forClass(String.class); - - @Mock - private ClientService clientService; - - @Mock - private MultimediaRepository multimediaRepository; - - @Mock - private OSSClient ossClient; - - @Before - public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); - super.setUp(); - ossMultimediaFileManager = new OSSMultimediaFileManager(multimediaRepository, clientService); - OSSClientBuilder ossClientBuilder = mock(OSSClientBuilder.class); - doReturn(new URI("http://region")).when(ossClient).getEndpoint(); - doReturn(ossClient).when(ossClientBuilder).getOssClient(); - Whitebox.setInternalState(ossMultimediaFileManager, "ossClientBuilder", ossClientBuilder); - } - - @Test - public void testPersistFileToStorageShouldPersistFileToOSS() throws IOException { - Whitebox.setInternalState(ossMultimediaFileManager, "multimediaDirPath", "multimedia/directory/path"); - - Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageBucketName", "oss-bucket"); - Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageBucketFolderPath", getTestFileFolder()); - - byte[] data = "data".getBytes(); - ossMultimediaFileManager.persistFileToStorage("path/to/file", data); - verify(ossClient).putObject(eq("oss-bucket"), stringArgumentCaptor.capture(), byteStreamArgumentCaptor.capture()); - assertEquals(ossMultimediaFileManager.getOSSObjectStorageFilePath("path/to/file"), stringArgumentCaptor.getValue()); - assertEquals(new String(data, "UTF-8"), IOUtils.toString(byteStreamArgumentCaptor.getValue(), StandardCharsets.UTF_8)); - verify(ossClient).shutdown(); - } - - @Test - public void testRetrieveFileShouldRetrieveFileFromOSS() throws Exception { - String testFilePath = getTestFilePath(); - Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageBucketName", "oss-bucket"); - doReturn(true).when(ossClient).doesObjectExist(eq("oss-bucket"), eq(ossMultimediaFileManager.getOSSObjectStorageFilePath(testFilePath))); - - OSSObject ossObject = mock(OSSObject.class); - InputStream inputStream = new FileInputStream(new File(getDataFilePath())); - doReturn(inputStream).when(ossObject).getObjectContent(); - doReturn(ossObject).when(ossClient).getObject(stringArgumentCaptor.capture(), stringArgumentCaptor.capture()); - - assertNotNull(ossMultimediaFileManager.retrieveFile(testFilePath)); - assertEquals(stringArgumentCaptor.getAllValues().get(0), "oss-bucket"); - assertEquals(stringArgumentCaptor.getAllValues().get(1), ossMultimediaFileManager.getOSSObjectStorageFilePath(testFilePath)); - assertFalse(isFileEmpty(testFilePath)); - } - - private boolean isFileEmpty(String path) throws IOException { - BufferedReader br = new BufferedReader(new FileReader(path)); - return br.readLine() == null ? true : false; - } - - @Test - public void testRetrieveFileShouldReturnNullForNonExistentOSSFile() { - Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageBucketName", "oss-bucket"); - doReturn(false).when(ossClient).doesObjectExist("oss-bucket", "non_existent_file"); - assertNull(ossMultimediaFileManager.retrieveFile("non_existent_file")); - } - - @Test - public void testGetOSSClientShouldReturnNonNullOSSClient() throws Exception { - Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageRegion", "region"); - Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageAccessKeyId", "region"); - Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageSecretAccessKey", "awsSecretAccessKey"); - OSSClient ossClient = Whitebox.invokeMethod(ossMultimediaFileManager, "getOssClient"); - assertNotNull(ossClient); - assertEquals("http://region", ossClient.getEndpoint().toString()); - } - - @Test - public void testGetMultiMediaDirShouldReturnCorrectFilePath() { - assertEquals(File.separator + "tmp" + File.separator, ossMultimediaFileManager.getBaseMultiMediaDir()); - } - - @Test - public void testGetOSSFilePathShouldReturnCorrectFilePath() throws Exception { - Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageBucketFolderPath", "bucket_folder_path"); - Whitebox.setInternalState(ossMultimediaFileManager, "baseMultimediaDirPath", "base/directory/path"); - String truncatedFilePath = Whitebox.invokeMethod(ossMultimediaFileManager, "getObjectStorageFilePath", ossMultimediaFileManager.getBaseMultiMediaDir() + "path/to/file"); - assertEquals("bucket_folder_path" + File.separator + "path/to/file", truncatedFilePath); - } + + private OSSMultimediaFileManager ossMultimediaFileManager; + + @Captor + private ArgumentCaptor byteStreamArgumentCaptor = ArgumentCaptor.forClass(ByteArrayInputStream.class); + + @Captor + private ArgumentCaptor stringArgumentCaptor = ArgumentCaptor.forClass(String.class); + + @Mock + private ClientService clientService; + + @Mock + private MultimediaRepository multimediaRepository; + + @Mock + private OSSClient ossClient; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + super.setUp(); + ossMultimediaFileManager = new OSSMultimediaFileManager(multimediaRepository, clientService); + OSSClientBuilder ossClientBuilder = mock(OSSClientBuilder.class); + doReturn(new URI("http://region")).when(ossClient).getEndpoint(); + doReturn(ossClient).when(ossClientBuilder).getOssClient(); + Whitebox.setInternalState(ossMultimediaFileManager, "ossClientBuilder", ossClientBuilder); + } + + @Test + public void testPersistFileToStorageShouldPersistFileToOSS() throws IOException { + Whitebox.setInternalState(ossMultimediaFileManager, "multimediaDirPath", "multimedia/directory/path"); + + Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageBucketName", "oss-bucket"); + Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageBucketFolderPath", getTestFileFolder()); + + byte[] data = "data".getBytes(); + ossMultimediaFileManager.persistFileToStorage("path/to/file", data); + verify(ossClient).putObject(eq("oss-bucket"), stringArgumentCaptor.capture(), byteStreamArgumentCaptor.capture()); + assertEquals(ossMultimediaFileManager.getOSSObjectStorageFilePath("path/to/file"), stringArgumentCaptor.getValue()); + assertEquals(new String(data, "UTF-8"), IOUtils.toString(byteStreamArgumentCaptor.getValue(), StandardCharsets.UTF_8)); + verify(ossClient).shutdown(); + } + + @Test + public void testRetrieveFileShouldRetrieveFileFromOSS() throws Exception { + String testFilePath = getTestFilePath(); + Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageBucketName", "oss-bucket"); + doReturn(true).when(ossClient).doesObjectExist(eq("oss-bucket"), eq(ossMultimediaFileManager.getOSSObjectStorageFilePath(testFilePath))); + + OSSObject ossObject = mock(OSSObject.class); + InputStream inputStream = new FileInputStream(new File(getDataFilePath())); + doReturn(inputStream).when(ossObject).getObjectContent(); + doReturn(ossObject).when(ossClient).getObject(stringArgumentCaptor.capture(), stringArgumentCaptor.capture()); + + assertNotNull(ossMultimediaFileManager.retrieveFile(testFilePath)); + assertEquals(stringArgumentCaptor.getAllValues().get(0), "oss-bucket"); + assertEquals(stringArgumentCaptor.getAllValues().get(1), ossMultimediaFileManager.getOSSObjectStorageFilePath(testFilePath)); + assertFalse(isFileEmpty(testFilePath)); + } + + private boolean isFileEmpty(String path) throws IOException { + BufferedReader br = new BufferedReader(new FileReader(path)); + return br.readLine() == null ? true : false; + } + + @Test + public void testRetrieveFileShouldReturnNullForNonExistentOSSFile() { + Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageBucketName", "oss-bucket"); + doReturn(false).when(ossClient).doesObjectExist("oss-bucket", "non_existent_file"); + assertNull(ossMultimediaFileManager.retrieveFile("non_existent_file")); + } + + @Test + public void testGetOSSClientShouldReturnNonNullOSSClient() throws Exception { + Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageRegion", "region"); + Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageAccessKeyId", "region"); + Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageSecretAccessKey", "awsSecretAccessKey"); + OSSClient ossClient = Whitebox.invokeMethod(ossMultimediaFileManager, "getOssClient"); + assertNotNull(ossClient); + assertEquals("http://region", ossClient.getEndpoint().toString()); + } + + @Test + public void testGetMultiMediaDirShouldReturnCorrectFilePath() { + assertEquals(File.separator + "tmp" + File.separator, ossMultimediaFileManager.getBaseMultiMediaDir()); + } + + @Test + public void testGetOSSFilePathShouldReturnCorrectFilePath() throws Exception { + Whitebox.setInternalState(ossMultimediaFileManager, "objectStorageBucketFolderPath", "bucket_folder_path"); + Whitebox.setInternalState(ossMultimediaFileManager, "baseMultimediaDirPath", "base/directory/path"); + String truncatedFilePath = Whitebox.invokeMethod(ossMultimediaFileManager, "getObjectStorageFilePath", ossMultimediaFileManager.getBaseMultiMediaDir() + "path/to/file"); + assertEquals("bucket_folder_path" + File.separator + "path/to/file", truncatedFilePath); + } } diff --git a/src/test/java/org/opensrp/service/multimedia/S3MultimediaFileManagerTest.java b/src/test/java/org/opensrp/service/multimedia/S3MultimediaFileManagerTest.java index 1a144f266..c77ce5fa2 100644 --- a/src/test/java/org/opensrp/service/multimedia/S3MultimediaFileManagerTest.java +++ b/src/test/java/org/opensrp/service/multimedia/S3MultimediaFileManagerTest.java @@ -32,107 +32,107 @@ */ public class S3MultimediaFileManagerTest extends BaseMultimediaFileManagerTest { - private S3MultimediaFileManager s3MultimediaFileManager; - - @Captor - private ArgumentCaptor fileArgumentCaptor = ArgumentCaptor.forClass(File.class); - - @Captor - private ArgumentCaptor getObjectRequestArgumentCaptor = ArgumentCaptor.forClass(GetObjectRequest.class); - - @Captor - private ArgumentCaptor putObjectRequestArgumentCaptor = ArgumentCaptor.forClass(PutObjectRequest.class); - - @Mock - private ClientService clientService; - - @Mock - private MultimediaRepository multimediaRepository; - - @Mock - private AmazonS3Client s3Client; - - @Before - public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); - super.setUp(); - s3MultimediaFileManager = new S3MultimediaFileManager(multimediaRepository, clientService); - Whitebox.setInternalState(s3MultimediaFileManager, "s3Client", s3Client); - } - - @Test - public void testPersistFileToStorageShouldPersistFileToS3() throws IOException { - Whitebox.setInternalState(s3MultimediaFileManager, "multimediaDirPath", "multimedia/directory/path"); - - Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageBucketName", "s3Bucket"); - Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageBucketFolderPath", getTestFileFolder()); - - byte[] testBytes = new byte[10]; - s3MultimediaFileManager = Mockito.spy(s3MultimediaFileManager); - s3MultimediaFileManager.persistFileToStorage(getTestFilePath(), testBytes); - - verify(s3MultimediaFileManager).copyBytesToFile(fileArgumentCaptor.capture(), Mockito.eq(testBytes)); - verify(s3Client).putObject(putObjectRequestArgumentCaptor.capture()); - - PutObjectRequest putObjectRequest = putObjectRequestArgumentCaptor.getValue(); - assertEquals(putObjectRequest.getBucketName(), "s3Bucket"); - assertEquals(putObjectRequest.getKey(), getTestFileFolder() + File.separator + getTestFilePath()); - - File file = fileArgumentCaptor.getValue(); - assertNotNull(file); - assertEquals(file.getPath(), getTestFilePath()); - - // ensure it cleans up temp file - assertFalse(new File(getTestFilePath()).exists()); - } - - @Test - public void testRetrieveFileShouldRetrieveFileFromS3() { - String testFilePath = getTestFilePath(); - Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageBucketFolderPath", "opensrp"); - Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageBucketName", "s3Bucket"); - doReturn(true).when(s3Client).doesObjectExist(eq("s3Bucket"), eq(s3MultimediaFileManager.getObjectStorageFilePath(testFilePath))); - doReturn(mock(ObjectMetadata.class)).when(s3Client).getObject(getObjectRequestArgumentCaptor.capture(), fileArgumentCaptor.capture()); - assertNotNull(s3MultimediaFileManager.retrieveFile(testFilePath)); - - File file = fileArgumentCaptor.getValue(); - assertNotNull(file); - assertEquals(testFilePath, file.getPath()); - - GetObjectRequest getObjectRequest = getObjectRequestArgumentCaptor.getValue(); - assertNotNull(getObjectRequest); - assertEquals(getObjectRequest.getBucketName(), "s3Bucket"); - assertEquals(getObjectRequest.getKey(), "opensrp/" + testFilePath); - } - - @Test - public void testRetrieveFileShouldReturnNullForNonExistentS3File() { - Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageBucketName", "s3Bucket"); - doReturn(false).when(s3Client).doesObjectExist("s3Bucket", "non_existent_file"); - assertNull(s3MultimediaFileManager.retrieveFile("non_existent_file")); - } - - @Test - public void testGetS3ClientShouldReturnNonNullS3Client() throws Exception { - Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageRegion", "region"); - Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageAccessKeyId", "region"); - Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageSecretAccessKey", "awsSecretAccessKey"); - Whitebox.setInternalState(s3MultimediaFileManager, "s3Client", (Object[]) null); - AmazonS3Client s3Client = Whitebox.invokeMethod(s3MultimediaFileManager, "getS3Client"); - assertNotNull(s3Client); - assertEquals("region", s3Client.getRegionName()); - } - - @Test - public void testGetMultiMediaDirShouldReturnCorrectFilePath() { - assertEquals(File.separator + "tmp" + File.separator, s3MultimediaFileManager.getBaseMultiMediaDir()); - } - - @Test - public void testGetS3FilePathShouldReturnCorrectFilePath() throws Exception { - Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageBucketFolderPath", "bucket_folder_path"); - Whitebox.setInternalState(s3MultimediaFileManager, "baseMultimediaDirPath", "base/directory/path"); - String truncatedFilePath = Whitebox.invokeMethod(s3MultimediaFileManager, "getObjectStorageFilePath", s3MultimediaFileManager.getBaseMultiMediaDir() + "path/to/file"); - assertEquals("bucket_folder_path" + File.separator + "path/to/file", truncatedFilePath); - } + private S3MultimediaFileManager s3MultimediaFileManager; + + @Captor + private ArgumentCaptor fileArgumentCaptor = ArgumentCaptor.forClass(File.class); + + @Captor + private ArgumentCaptor getObjectRequestArgumentCaptor = ArgumentCaptor.forClass(GetObjectRequest.class); + + @Captor + private ArgumentCaptor putObjectRequestArgumentCaptor = ArgumentCaptor.forClass(PutObjectRequest.class); + + @Mock + private ClientService clientService; + + @Mock + private MultimediaRepository multimediaRepository; + + @Mock + private AmazonS3Client s3Client; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + super.setUp(); + s3MultimediaFileManager = new S3MultimediaFileManager(multimediaRepository, clientService); + Whitebox.setInternalState(s3MultimediaFileManager, "s3Client", s3Client); + } + + @Test + public void testPersistFileToStorageShouldPersistFileToS3() throws IOException { + Whitebox.setInternalState(s3MultimediaFileManager, "multimediaDirPath", "multimedia/directory/path"); + + Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageBucketName", "s3Bucket"); + Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageBucketFolderPath", getTestFileFolder()); + + byte[] testBytes = new byte[10]; + s3MultimediaFileManager = Mockito.spy(s3MultimediaFileManager); + s3MultimediaFileManager.persistFileToStorage(getTestFilePath(), testBytes); + + verify(s3MultimediaFileManager).copyBytesToFile(fileArgumentCaptor.capture(), Mockito.eq(testBytes)); + verify(s3Client).putObject(putObjectRequestArgumentCaptor.capture()); + + PutObjectRequest putObjectRequest = putObjectRequestArgumentCaptor.getValue(); + assertEquals(putObjectRequest.getBucketName(), "s3Bucket"); + assertEquals(putObjectRequest.getKey(), getTestFileFolder() + File.separator + getTestFilePath()); + + File file = fileArgumentCaptor.getValue(); + assertNotNull(file); + assertEquals(file.getPath(), getTestFilePath()); + + // ensure it cleans up temp file + assertFalse(new File(getTestFilePath()).exists()); + } + + @Test + public void testRetrieveFileShouldRetrieveFileFromS3() { + String testFilePath = getTestFilePath(); + Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageBucketFolderPath", "opensrp"); + Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageBucketName", "s3Bucket"); + doReturn(true).when(s3Client).doesObjectExist(eq("s3Bucket"), eq(s3MultimediaFileManager.getObjectStorageFilePath(testFilePath))); + doReturn(mock(ObjectMetadata.class)).when(s3Client).getObject(getObjectRequestArgumentCaptor.capture(), fileArgumentCaptor.capture()); + assertNotNull(s3MultimediaFileManager.retrieveFile(testFilePath)); + + File file = fileArgumentCaptor.getValue(); + assertNotNull(file); + assertEquals(testFilePath, file.getPath()); + + GetObjectRequest getObjectRequest = getObjectRequestArgumentCaptor.getValue(); + assertNotNull(getObjectRequest); + assertEquals(getObjectRequest.getBucketName(), "s3Bucket"); + assertEquals(getObjectRequest.getKey(), "opensrp/" + testFilePath); + } + + @Test + public void testRetrieveFileShouldReturnNullForNonExistentS3File() { + Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageBucketName", "s3Bucket"); + doReturn(false).when(s3Client).doesObjectExist("s3Bucket", "non_existent_file"); + assertNull(s3MultimediaFileManager.retrieveFile("non_existent_file")); + } + + @Test + public void testGetS3ClientShouldReturnNonNullS3Client() throws Exception { + Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageRegion", "region"); + Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageAccessKeyId", "region"); + Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageSecretAccessKey", "awsSecretAccessKey"); + Whitebox.setInternalState(s3MultimediaFileManager, "s3Client", (Object[]) null); + AmazonS3Client s3Client = Whitebox.invokeMethod(s3MultimediaFileManager, "getS3Client"); + assertNotNull(s3Client); + assertEquals("region", s3Client.getRegionName()); + } + + @Test + public void testGetMultiMediaDirShouldReturnCorrectFilePath() { + assertEquals(File.separator + "tmp" + File.separator, s3MultimediaFileManager.getBaseMultiMediaDir()); + } + + @Test + public void testGetS3FilePathShouldReturnCorrectFilePath() throws Exception { + Whitebox.setInternalState(s3MultimediaFileManager, "objectStorageBucketFolderPath", "bucket_folder_path"); + Whitebox.setInternalState(s3MultimediaFileManager, "baseMultimediaDirPath", "base/directory/path"); + String truncatedFilePath = Whitebox.invokeMethod(s3MultimediaFileManager, "getObjectStorageFilePath", s3MultimediaFileManager.getBaseMultiMediaDir() + "path/to/file"); + assertEquals("bucket_folder_path" + File.separator + "path/to/file", truncatedFilePath); + } } diff --git a/src/test/java/org/opensrp/services/RapidProServiceTest.java b/src/test/java/org/opensrp/services/RapidProServiceTest.java index 815f00a82..b871f3a01 100644 --- a/src/test/java/org/opensrp/services/RapidProServiceTest.java +++ b/src/test/java/org/opensrp/services/RapidProServiceTest.java @@ -21,154 +21,154 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ActiveProfiles; -@ActiveProfiles(profiles = { "jedis"}) +@ActiveProfiles(profiles = {"jedis"}) public class RapidProServiceTest extends SpringApplicationContextProvider { - - @Autowired - RapidProService rapidproService; - - List urns; - - List contacts; - - List groups; - - Map contact; - - @Mock - RapidProService mockRapidProService; - - String addFieldResponse; - - String sendMessageResponse; - - String createContactResponse; - - @SuppressWarnings("unchecked") - @Before - public void setup() { - urns = new ArrayList(); - urns.add("tel:+250788123123"); - groups = new ArrayList(); - contacts = new ArrayList(); - contacts.add("09d23a05-47fe-11e4-bfe9-b8f6b119e9ab"); - contact = new HashMap(); - Map fields = new HashMap(); - fields.put("lmp", "2016-09-30"); - fields.put("anc1", "2016-10-10"); - fields.put("anc2", "2016-10-20"); - fields.put("anc3", "2016-10-30"); - fields.put("anc4", "2016-11-10"); - contact.put("name", "Woman Three"); - List urns = new ArrayList(); - List groups = new ArrayList(); - groups.add("Pregnant Women"); - urns.add("telegram:207355745"); - contact.put("urns", urns); - contact.put("groups", groups); - contact.put("fields", fields); - MockitoAnnotations.initMocks(this); - addFieldResponse = "{\"key\": \"anc3\",\"label\": \"anc3\",\"value_type\": \"T\"}"; - sendMessageResponse = "{\"id\": 21170,\"urns\": [\"telegram:207355745\"],\"contacts\": [],\"groups\": [],\"text\": \"rapidpro test text2\",\"created_on\": \"2016-11-01T12:46:28.107Z\",\"status\": \"I\"}"; - createContactResponse = "{\"uuid\": \"4686bf60-a241-4b42-8102-27d9221aad5b\",\"name\": \"Xcv\",\"language\": null,\"group_uuids\": [\"bc5ef0d0-ce9d-4b52-adee-649a99927c8b\"]\"urns\": [\"tel:+254727812024\"]," - + "\"fields\": {\"anc1\": \"2016-10-27\",\"anc2\": \"2017-02-16\",\"anc3\": \"2017-04-13\",\"anc4\": \"2017-05-11\",},\"blocked\": false,\"failed\": false,\"modified_on\": \"2016-11-03T07:36:41.494Z\"," - + "\"phone\": \"+254727812024\",\"groups\": [\"Pregnant Women\"]}"; - - when(mockRapidProService.addField("anc3", "T")).thenReturn(addFieldResponse); - when(mockRapidProService.sendMessage(Matchers.anyListOf(String.class), Matchers.anyListOf(String.class), - Matchers.anyListOf(String.class), anyString(), anyString())).thenReturn(sendMessageResponse); - when(mockRapidProService.createContact(anyMapOf(String.class, Object.class))).thenReturn(createContactResponse); - - } - - @After - public void tearDown() { - urns.clear(); - groups.clear(); - contacts.clear(); - contact.clear(); - } - - @Test - public void sendMessageShouldFailIfTextisNull() throws Exception { - String response = rapidproService.sendMessage(urns, contacts, groups, null, ""); - Assert.assertEquals("Empty text or text longer than 480 characters not allowed", response); - } - - @Test - public void sendMessageShouldFailIfTextisEmpty() throws Exception { - String response = rapidproService.sendMessage(urns, contacts, groups, "", ""); - Assert.assertEquals("Empty text or text longer than 480 characters not allowed", response); - } - - @Test - public void sendMessageShouldFailIfTextisTooLong() throws Exception { - String text = "When Aklima Begum was initially registered in OpenSRP during a census / enumeration round, her mobile phone (or family member’s phone) number was collected as part of her personal profile. Aklima Begum is found to be pregnant in week 20 of her pregnancy. As her pregnancy is recorded in OpenSRP, her health worker, Rokeya, receives a prompt asking whether Aklima would like to receive motivational messages and/or reminders. Aklima agrees, and this is recorded in the OpenSRP system. The server sends her a ‘test’ message to welcome her to the system and ensure the phone number is correct. Every week,"; - String response = rapidproService.sendMessage(urns, contacts, groups, text, ""); - Assert.assertEquals("Empty text or text longer than 480 characters not allowed", response); - } - - @Test - public void sendMessageShouldReturnJsonStringOnSuccess() throws Exception { - String response = mockRapidProService.sendMessage(urns, contacts, groups, "Test rapidpro text", ""); - Assert.assertEquals(sendMessageResponse, response); - - } - - @Test - public void sendMessageShouldFailIfEmptyUrnsAndContactsAndGroups() throws Exception { - tearDown(); - String response = rapidproService.sendMessage(urns, contacts, groups, "Test rapidpro text", ""); - Assert.assertEquals("No recipients specified", response); - } - - @Test - public void sendMessageShouldFailIfNullUrnsAndContactsAndGroups() throws Exception { - String response = rapidproService.sendMessage(null, null, null, "Test rapidpro text", ""); - Assert.assertEquals("No recipients specified", response); - } - - @Test - public void createContactShouldFailIfEmptyFieldValues() throws Exception { - tearDown(); - String response = rapidproService.createContact(contact); - Assert.assertEquals("Field values cannot be empty and must have urns", response); - } - - @Test - public void createContactShouldFailIfNullFieldValues() throws Exception { - String response = rapidproService.createContact(null); - Assert.assertEquals("Field values cannot be empty and must have urns", response); - } - - @Test - public void createContactShouldFailIfNullUrns() throws Exception { - contact.remove("urns"); - String response = rapidproService.createContact(contact); - Assert.assertEquals("Field values cannot be empty and must have urns", response); - } - - @Test - public void createContactShouldReturnJsonStringOnSuccess() throws Exception { - String response = mockRapidProService.createContact(contact); - Assert.assertEquals(createContactResponse, response); - } - - @Test - public void addFieldShouldFailIfNullLabel() throws Exception { - String response = rapidproService.addField(null, "T"); - Assert.assertEquals("Field label is required", response); - } - - @Test - public void addFieldShouldFailIfEmptyLabel() throws Exception { - String response = rapidproService.addField("", "T"); - Assert.assertEquals("Field label is required", response); - } - - @Test - public void addFieldShouldReturnJsonStringOnSuccess() throws Exception { - String response = mockRapidProService.addField("anc3", "T"); - Assert.assertEquals(addFieldResponse, response); - } + + @Autowired + RapidProService rapidproService; + + List urns; + + List contacts; + + List groups; + + Map contact; + + @Mock + RapidProService mockRapidProService; + + String addFieldResponse; + + String sendMessageResponse; + + String createContactResponse; + + @SuppressWarnings("unchecked") + @Before + public void setup() { + urns = new ArrayList(); + urns.add("tel:+250788123123"); + groups = new ArrayList(); + contacts = new ArrayList(); + contacts.add("09d23a05-47fe-11e4-bfe9-b8f6b119e9ab"); + contact = new HashMap(); + Map fields = new HashMap(); + fields.put("lmp", "2016-09-30"); + fields.put("anc1", "2016-10-10"); + fields.put("anc2", "2016-10-20"); + fields.put("anc3", "2016-10-30"); + fields.put("anc4", "2016-11-10"); + contact.put("name", "Woman Three"); + List urns = new ArrayList(); + List groups = new ArrayList(); + groups.add("Pregnant Women"); + urns.add("telegram:207355745"); + contact.put("urns", urns); + contact.put("groups", groups); + contact.put("fields", fields); + MockitoAnnotations.initMocks(this); + addFieldResponse = "{\"key\": \"anc3\",\"label\": \"anc3\",\"value_type\": \"T\"}"; + sendMessageResponse = "{\"id\": 21170,\"urns\": [\"telegram:207355745\"],\"contacts\": [],\"groups\": [],\"text\": \"rapidpro test text2\",\"created_on\": \"2016-11-01T12:46:28.107Z\",\"status\": \"I\"}"; + createContactResponse = "{\"uuid\": \"4686bf60-a241-4b42-8102-27d9221aad5b\",\"name\": \"Xcv\",\"language\": null,\"group_uuids\": [\"bc5ef0d0-ce9d-4b52-adee-649a99927c8b\"]\"urns\": [\"tel:+254727812024\"]," + + "\"fields\": {\"anc1\": \"2016-10-27\",\"anc2\": \"2017-02-16\",\"anc3\": \"2017-04-13\",\"anc4\": \"2017-05-11\",},\"blocked\": false,\"failed\": false,\"modified_on\": \"2016-11-03T07:36:41.494Z\"," + + "\"phone\": \"+254727812024\",\"groups\": [\"Pregnant Women\"]}"; + + when(mockRapidProService.addField("anc3", "T")).thenReturn(addFieldResponse); + when(mockRapidProService.sendMessage(Matchers.anyListOf(String.class), Matchers.anyListOf(String.class), + Matchers.anyListOf(String.class), anyString(), anyString())).thenReturn(sendMessageResponse); + when(mockRapidProService.createContact(anyMapOf(String.class, Object.class))).thenReturn(createContactResponse); + + } + + @After + public void tearDown() { + urns.clear(); + groups.clear(); + contacts.clear(); + contact.clear(); + } + + @Test + public void sendMessageShouldFailIfTextisNull() throws Exception { + String response = rapidproService.sendMessage(urns, contacts, groups, null, ""); + Assert.assertEquals("Empty text or text longer than 480 characters not allowed", response); + } + + @Test + public void sendMessageShouldFailIfTextisEmpty() throws Exception { + String response = rapidproService.sendMessage(urns, contacts, groups, "", ""); + Assert.assertEquals("Empty text or text longer than 480 characters not allowed", response); + } + + @Test + public void sendMessageShouldFailIfTextisTooLong() throws Exception { + String text = "When Aklima Begum was initially registered in OpenSRP during a census / enumeration round, her mobile phone (or family member’s phone) number was collected as part of her personal profile. Aklima Begum is found to be pregnant in week 20 of her pregnancy. As her pregnancy is recorded in OpenSRP, her health worker, Rokeya, receives a prompt asking whether Aklima would like to receive motivational messages and/or reminders. Aklima agrees, and this is recorded in the OpenSRP system. The server sends her a ‘test’ message to welcome her to the system and ensure the phone number is correct. Every week,"; + String response = rapidproService.sendMessage(urns, contacts, groups, text, ""); + Assert.assertEquals("Empty text or text longer than 480 characters not allowed", response); + } + + @Test + public void sendMessageShouldReturnJsonStringOnSuccess() throws Exception { + String response = mockRapidProService.sendMessage(urns, contacts, groups, "Test rapidpro text", ""); + Assert.assertEquals(sendMessageResponse, response); + + } + + @Test + public void sendMessageShouldFailIfEmptyUrnsAndContactsAndGroups() throws Exception { + tearDown(); + String response = rapidproService.sendMessage(urns, contacts, groups, "Test rapidpro text", ""); + Assert.assertEquals("No recipients specified", response); + } + + @Test + public void sendMessageShouldFailIfNullUrnsAndContactsAndGroups() throws Exception { + String response = rapidproService.sendMessage(null, null, null, "Test rapidpro text", ""); + Assert.assertEquals("No recipients specified", response); + } + + @Test + public void createContactShouldFailIfEmptyFieldValues() throws Exception { + tearDown(); + String response = rapidproService.createContact(contact); + Assert.assertEquals("Field values cannot be empty and must have urns", response); + } + + @Test + public void createContactShouldFailIfNullFieldValues() throws Exception { + String response = rapidproService.createContact(null); + Assert.assertEquals("Field values cannot be empty and must have urns", response); + } + + @Test + public void createContactShouldFailIfNullUrns() throws Exception { + contact.remove("urns"); + String response = rapidproService.createContact(contact); + Assert.assertEquals("Field values cannot be empty and must have urns", response); + } + + @Test + public void createContactShouldReturnJsonStringOnSuccess() throws Exception { + String response = mockRapidProService.createContact(contact); + Assert.assertEquals(createContactResponse, response); + } + + @Test + public void addFieldShouldFailIfNullLabel() throws Exception { + String response = rapidproService.addField(null, "T"); + Assert.assertEquals("Field label is required", response); + } + + @Test + public void addFieldShouldFailIfEmptyLabel() throws Exception { + String response = rapidproService.addField("", "T"); + Assert.assertEquals("Field label is required", response); + } + + @Test + public void addFieldShouldReturnJsonStringOnSuccess() throws Exception { + String response = mockRapidProService.addField("anc3", "T"); + Assert.assertEquals(addFieldResponse, response); + } } diff --git a/src/test/java/org/opensrp/services/it/RapidProServiceIntegrationTest.java b/src/test/java/org/opensrp/services/it/RapidProServiceIntegrationTest.java index cdbaf48b5..2500c7440 100644 --- a/src/test/java/org/opensrp/services/it/RapidProServiceIntegrationTest.java +++ b/src/test/java/org/opensrp/services/it/RapidProServiceIntegrationTest.java @@ -17,91 +17,91 @@ @Ignore public class RapidProServiceIntegrationTest extends SpringApplicationContextProvider { - - @Autowired - RapidProService rapidproService; - - Map contact = new HashMap(); - - List urns = new ArrayList(); - - List groups = new ArrayList(); - - @Before - public void setup() { - Map fields = new HashMap(); - fields.put("lmp", "2016-09-30"); - fields.put("anc1", "2016-10-10"); - fields.put("anc2", "2016-10-20"); - fields.put("anc3", "2016-10-30"); - fields.put("anc4", "2016-11-10"); - // set contact name - contact.put("name", "Test Woman"); - groups.add("Pregnant Women"); - urns.add("telegram:207355745"); - contact.put("urns", urns); - contact.put("groups", groups); - contact.put("fields", fields); - } - - @Test - public void shouldCreateContactAndReceiveContactObjectResponse() throws Exception { - String response = rapidproService.createContact(contact); - JSONObject jsonResponse = new JSONObject(response); - verify(jsonResponse); - Assert.assertEquals(204, rapidproService.deleteContact(jsonResponse.getString("uuid"))); - - } - - @Test - public void shouldUpdateContactAndReceiveContactObjectResponse() throws Exception { - String response = rapidproService.createContact(contact); - JSONObject jsonResponse = new JSONObject(response); - contact.put("uuid", jsonResponse.getString("uuid")); - contact.put("name", "Test Woman Updated"); - response = rapidproService.createContact(contact); - jsonResponse = new JSONObject(response); - Assert.assertEquals("Test Woman Updated", jsonResponse.getString("name")); - Assert.assertEquals(204, rapidproService.deleteContact(jsonResponse.getString("uuid"))); - - } - - @Test - public void shouldDeleteContactAndReceiveStatusResponse() throws Exception { - String response = rapidproService.createContact(contact); - JSONObject jsonResponse = new JSONObject(response); - Assert.assertEquals(204, rapidproService.deleteContact(jsonResponse.getString("uuid"))); - - } - - @Test - @Ignore // FIXME We might need a generic mobile no to test this one out - public void shouldSendMessageAndReceiveMessageBroadcastResponse() throws Exception { - // rapidproService.sendMessage(urns, contacts, groups, text, channel); - } - - @Test - public void shouldCreateFieldAndReceiveFieldKeyResponse() throws Exception { - String response = rapidproService.addField("Test Field", "T"); - JSONObject jsonResponse = new JSONObject(response); - Assert.assertEquals("test_field", jsonResponse.getString("key")); - Assert.assertEquals("Test Field", jsonResponse.getString("label")); - Assert.assertEquals("T", jsonResponse.getString("value_type")); - - } - - private void verify(JSONObject jsonResponse) throws JSONException { - Assert.assertTrue(jsonResponse.has("uuid")); - Assert.assertTrue(jsonResponse.has("name")); - Assert.assertTrue(jsonResponse.has("group_uuids")); - Assert.assertTrue(jsonResponse.has("urns")); - Assert.assertTrue(jsonResponse.has("fields")); - Assert.assertTrue(jsonResponse.has("groups")); - Assert.assertEquals("Test Woman", jsonResponse.getString("name")); - Assert.assertEquals("2016-10-10", jsonResponse.getJSONObject("fields").getString("anc1")); - Assert.assertEquals("2016-10-20", jsonResponse.getJSONObject("fields").getString("anc2")); - Assert.assertEquals("2016-10-30", jsonResponse.getJSONObject("fields").getString("anc3")); - Assert.assertEquals("2016-11-10", jsonResponse.getJSONObject("fields").getString("anc4")); - Assert.assertEquals("Pregnant Women", jsonResponse.getJSONArray("groups").getString(0)); - } + + @Autowired + RapidProService rapidproService; + + Map contact = new HashMap(); + + List urns = new ArrayList(); + + List groups = new ArrayList(); + + @Before + public void setup() { + Map fields = new HashMap(); + fields.put("lmp", "2016-09-30"); + fields.put("anc1", "2016-10-10"); + fields.put("anc2", "2016-10-20"); + fields.put("anc3", "2016-10-30"); + fields.put("anc4", "2016-11-10"); + // set contact name + contact.put("name", "Test Woman"); + groups.add("Pregnant Women"); + urns.add("telegram:207355745"); + contact.put("urns", urns); + contact.put("groups", groups); + contact.put("fields", fields); + } + + @Test + public void shouldCreateContactAndReceiveContactObjectResponse() throws Exception { + String response = rapidproService.createContact(contact); + JSONObject jsonResponse = new JSONObject(response); + verify(jsonResponse); + Assert.assertEquals(204, rapidproService.deleteContact(jsonResponse.getString("uuid"))); + + } + + @Test + public void shouldUpdateContactAndReceiveContactObjectResponse() throws Exception { + String response = rapidproService.createContact(contact); + JSONObject jsonResponse = new JSONObject(response); + contact.put("uuid", jsonResponse.getString("uuid")); + contact.put("name", "Test Woman Updated"); + response = rapidproService.createContact(contact); + jsonResponse = new JSONObject(response); + Assert.assertEquals("Test Woman Updated", jsonResponse.getString("name")); + Assert.assertEquals(204, rapidproService.deleteContact(jsonResponse.getString("uuid"))); + + } + + @Test + public void shouldDeleteContactAndReceiveStatusResponse() throws Exception { + String response = rapidproService.createContact(contact); + JSONObject jsonResponse = new JSONObject(response); + Assert.assertEquals(204, rapidproService.deleteContact(jsonResponse.getString("uuid"))); + + } + + @Test + @Ignore // FIXME We might need a generic mobile no to test this one out + public void shouldSendMessageAndReceiveMessageBroadcastResponse() throws Exception { + // rapidproService.sendMessage(urns, contacts, groups, text, channel); + } + + @Test + public void shouldCreateFieldAndReceiveFieldKeyResponse() throws Exception { + String response = rapidproService.addField("Test Field", "T"); + JSONObject jsonResponse = new JSONObject(response); + Assert.assertEquals("test_field", jsonResponse.getString("key")); + Assert.assertEquals("Test Field", jsonResponse.getString("label")); + Assert.assertEquals("T", jsonResponse.getString("value_type")); + + } + + private void verify(JSONObject jsonResponse) throws JSONException { + Assert.assertTrue(jsonResponse.has("uuid")); + Assert.assertTrue(jsonResponse.has("name")); + Assert.assertTrue(jsonResponse.has("group_uuids")); + Assert.assertTrue(jsonResponse.has("urns")); + Assert.assertTrue(jsonResponse.has("fields")); + Assert.assertTrue(jsonResponse.has("groups")); + Assert.assertEquals("Test Woman", jsonResponse.getString("name")); + Assert.assertEquals("2016-10-10", jsonResponse.getJSONObject("fields").getString("anc1")); + Assert.assertEquals("2016-10-20", jsonResponse.getJSONObject("fields").getString("anc2")); + Assert.assertEquals("2016-10-30", jsonResponse.getJSONObject("fields").getString("anc3")); + Assert.assertEquals("2016-11-10", jsonResponse.getJSONObject("fields").getString("anc4")); + Assert.assertEquals("Pregnant Women", jsonResponse.getJSONArray("groups").getString(0)); + } } diff --git a/src/test/java/org/opensrp/util/IdentifierValidatorAlgorithmTest.java b/src/test/java/org/opensrp/util/IdentifierValidatorAlgorithmTest.java index a045eb362..cb766b15b 100644 --- a/src/test/java/org/opensrp/util/IdentifierValidatorAlgorithmTest.java +++ b/src/test/java/org/opensrp/util/IdentifierValidatorAlgorithmTest.java @@ -7,15 +7,15 @@ public class IdentifierValidatorAlgorithmTest { - @Test - public void testGetName() { - assertEquals("LUHN_CHECK_DIGIT_ALGORITHM", IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM.name()); - } + @Test + public void testGetName() { + assertEquals("LUHN_CHECK_DIGIT_ALGORITHM", IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM.name()); + } - @Test - public void testGet() { - String algo = "LUHN_CHECK_DIGIT_ALGORITHM"; - assertEquals(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM, IdentifierValidatorAlgorithm.get(algo)); - } + @Test + public void testGet() { + String algo = "LUHN_CHECK_DIGIT_ALGORITHM"; + assertEquals(IdentifierValidatorAlgorithm.LUHN_CHECK_DIGIT_ALGORITHM, IdentifierValidatorAlgorithm.get(algo)); + } } diff --git a/src/test/java/org/opensrp/util/JSONCSVUtilTest.java b/src/test/java/org/opensrp/util/JSONCSVUtilTest.java index 774ad8044..c6677619b 100644 --- a/src/test/java/org/opensrp/util/JSONCSVUtilTest.java +++ b/src/test/java/org/opensrp/util/JSONCSVUtilTest.java @@ -24,110 +24,110 @@ public class JSONCSVUtilTest { - @Test - public void testCreateJSON() { - final Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") - .registerTypeAdapter(DateTime.class, new DateTimeTypeConverter()).create(); - - String jsonConfigs = "[{\"column_name\":\"opensrp_id\",\"field_mapping\":\"client.identifiers.opensrp_id\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"has_national_ID\",\"field_mapping\":\"client.attributes.has_no_id\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"national_ID\",\"field_mapping\":\"client.identifiers.national_id\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"surname\",\"field_mapping\":\"client.lastName\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"given_name\",\"field_mapping\":\"client.firstName\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"sex\",\"field_mapping\":\"client.gender\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"reveal_id\",\"field_mapping\":\"client.identifiers.reveal_id\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"grade\",\"field_mapping\":\"client.attributes.grade\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"grade_class\",\"field_mapping\":\"client.attributes.grade_class\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"school_enrolled\",\"field_mapping\":\"client.attributes.school_enrolled\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"school_name\",\"field_mapping\":\"client.attributes.school_name\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"school_ID\",\"field_mapping\":\"client.attributes.default_residence\",\"required\":true,\"regex\":\"\"},{\"column_name\":\"school_ID\",\"field_mapping\":\"event.locationId\",\"required\":true,\"regex\":\"\"},{\"column_name\":\"birthdate\",\"field_mapping\":\"client.birthdate\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"birthday_approximated\",\"field_mapping\":\"client.birthdateApprox\",\"required\":false,\"regex\":\"\"}]"; - - TypeToken> token = new TypeToken<>() { - - }; - List configList = gson.fromJson(jsonConfigs, token.getType()); - - Map> configGroup = configList - .stream() - .collect(Collectors.groupingBy(CSVRowConfig::getColumnName)); - - Map csvValues = new HashMap<>(); - csvValues.put("opensrp_id", ""); - csvValues.put("has_national_ID", "Yes"); - csvValues.put("national_ID", "234234234"); - csvValues.put("surname", "Dev"); - csvValues.put("given_name", "Ronald"); - csvValues.put("sex", "Male"); - csvValues.put("reveal_id", ""); - csvValues.put("grade", "Grade 2"); - csvValues.put("grade_class", ""); - csvValues.put("school_enrolled", "Yes"); - csvValues.put("school_name", "Makini"); - csvValues.put("school_ID", "f0de23e0-1e42-49e1-a60f-58d92040aaaa"); - csvValues.put("birthdate", "2020-01-01"); - csvValues.put("birthday_approximated", "true"); - - JSONObject jsonObject = JSONCSVUtil.toJSON(csvValues, configGroup); - - Client client = gson.fromJson(jsonObject.get(CLIENT).toString(), Client.class); - Assert.assertEquals(client.getFirstName(), "Ronald"); - Assert.assertEquals(client.getLastName(), "Dev"); - Assert.assertEquals(client.getGender(), "Male"); - Assert.assertTrue(client.getBirthdateApprox()); - Assert.assertEquals(client.getIdentifier("national_id"), "234234234"); - Assert.assertEquals(client.getAttributes().get("default_residence"), "f0de23e0-1e42-49e1-a60f-58d92040aaaa"); - Assert.assertEquals(client.getAttributes().get("grade"), "Grade 2"); - Assert.assertEquals(client.getAttributes().get("school_name"), "Makini"); - Assert.assertEquals(client.getAttributes().get("school_enrolled"), "Yes"); - Assert.assertEquals(client.getAttributes().get("has_no_id"), "Yes"); - - Event event = gson.fromJson(jsonObject.get(EVENT).toString(), Event.class); - Assert.assertEquals(event.getLocationId(), "f0de23e0-1e42-49e1-a60f-58d92040aaaa"); - } - - @Test - public void testExtractData() { - String expectedJSON = "{\"client\":{\"lastName\":\"Williams\",\"firstName\":\"Mark\",\"relationships\":{\"family\":[\"f785d89a-8c8c-4b92-91b4-f0a3bb160fed\"]},\"birthdate\":\"2013-05-15T00:00:00.000Z\",\"identifiers\":{\"opensrp_id\":\"2446768-0\",\"reveal_id\":\"2013051524467680\"},\"attributes\":{\"grade_class\":\"1\",\"grade\":\"Grade 2\",\"school_name\":\"St Christophers\",\"age_category\":\"\",\"school_enrolled\":\"Yes\",\"reveal_id\":\"12345\"},\"baseEntityId\":\"f785d89a-8c8c-4b92-91b4-f0a3bb160fed\",\"birthdateApprox\":\"false\"}}"; - JSONObject jsonObject = new JSONObject(expectedJSON); - - List mapping = getAttributes().stream() - .map(Pair::getLeft) - .collect(Collectors.toList()); - - List string = JSONCSVUtil.jsonToString(jsonObject, mapping); - - String[] expected = { "12345", "", "Grade 2", "1", "Yes", "St Christophers", "f785d89a-8c8c-4b92-91b4-f0a3bb160fed", - "2013-05-15T00:00:00.000Z", "false", "2446768-0", "2013051524467680", "Williams", "Mark", - "f785d89a-8c8c-4b92-91b4-f0a3bb160fed" }; - - for (String s : expected) { - Assert.assertTrue(string.contains(s)); - } - - Assert.assertEquals(expected.length, string.size()); - } - - @Test - public void testAddJsonNode() { - JSONObject jsonObject = new JSONObject(); - for (Pair pa : - getAttributes()) { - JSONCSVUtil.addNodeToJson(pa.getKey(), pa.getValue(), jsonObject); - } - - String expectedJSON = "{\"client\":{\"lastName\":\"Williams\",\"firstName\":\"Mark\",\"relationships\":{\"family\":[\"f785d89a-8c8c-4b92-91b4-f0a3bb160fed\"]},\"birthdate\":\"2013-05-15T00:00:00.000Z\",\"identifiers\":{\"opensrp_id\":\"2446768-0\",\"reveal_id\":\"2013051524467680\"},\"attributes\":{\"grade_class\":\"1\",\"grade\":\"Grade 2\",\"school_name\":\"St Christophers\",\"age_category\":\"6-10\",\"school_enrolled\":\"Yes\",\"reveal_id\":\"12345\"},\"baseEntityId\":\"f785d89a-8c8c-4b92-91b4-f0a3bb160fed\",\"birthdateApprox\":\"false\"}}"; - Assert.assertEquals(expectedJSON, jsonObject.toString()); - } - - private List> getAttributes() { - List> result = new ArrayList<>(); - - result.add(Pair.of("client.attributes.reveal_id", "12345")); - result.add(Pair.of("client.attributes.age_category", "6-10")); - result.add(Pair.of("client.attributes.grade", "Grade 2")); - result.add(Pair.of("client.attributes.grade_class", "1")); - result.add(Pair.of("client.attributes.school_enrolled", "Yes")); - result.add(Pair.of("client.attributes.school_name", "St Christophers")); - - result.add(Pair.of("client.baseEntityId", "f785d89a-8c8c-4b92-91b4-f0a3bb160fed")); - result.add(Pair.of("client.birthdate", "2013-05-15T00:00:00.000Z")); - result.add(Pair.of("client.birthdateApprox", "false")); - result.add(Pair.of("client.identifiers.opensrp_id", "2446768-0")); - result.add(Pair.of("client.identifiers.reveal_id", "2013051524467680")); - result.add(Pair.of("client.lastName", "Williams")); - result.add(Pair.of("client.firstName", "Mark")); - result.add(Pair.of("client.relationships.family[0]", "f785d89a-8c8c-4b92-91b4-f0a3bb160fed")); - - return result; - } + @Test + public void testCreateJSON() { + final Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") + .registerTypeAdapter(DateTime.class, new DateTimeTypeConverter()).create(); + + String jsonConfigs = "[{\"column_name\":\"opensrp_id\",\"field_mapping\":\"client.identifiers.opensrp_id\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"has_national_ID\",\"field_mapping\":\"client.attributes.has_no_id\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"national_ID\",\"field_mapping\":\"client.identifiers.national_id\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"surname\",\"field_mapping\":\"client.lastName\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"given_name\",\"field_mapping\":\"client.firstName\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"sex\",\"field_mapping\":\"client.gender\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"reveal_id\",\"field_mapping\":\"client.identifiers.reveal_id\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"grade\",\"field_mapping\":\"client.attributes.grade\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"grade_class\",\"field_mapping\":\"client.attributes.grade_class\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"school_enrolled\",\"field_mapping\":\"client.attributes.school_enrolled\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"school_name\",\"field_mapping\":\"client.attributes.school_name\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"school_ID\",\"field_mapping\":\"client.attributes.default_residence\",\"required\":true,\"regex\":\"\"},{\"column_name\":\"school_ID\",\"field_mapping\":\"event.locationId\",\"required\":true,\"regex\":\"\"},{\"column_name\":\"birthdate\",\"field_mapping\":\"client.birthdate\",\"required\":false,\"regex\":\"\"},{\"column_name\":\"birthday_approximated\",\"field_mapping\":\"client.birthdateApprox\",\"required\":false,\"regex\":\"\"}]"; + + TypeToken> token = new TypeToken<>() { + + }; + List configList = gson.fromJson(jsonConfigs, token.getType()); + + Map> configGroup = configList + .stream() + .collect(Collectors.groupingBy(CSVRowConfig::getColumnName)); + + Map csvValues = new HashMap<>(); + csvValues.put("opensrp_id", ""); + csvValues.put("has_national_ID", "Yes"); + csvValues.put("national_ID", "234234234"); + csvValues.put("surname", "Dev"); + csvValues.put("given_name", "Ronald"); + csvValues.put("sex", "Male"); + csvValues.put("reveal_id", ""); + csvValues.put("grade", "Grade 2"); + csvValues.put("grade_class", ""); + csvValues.put("school_enrolled", "Yes"); + csvValues.put("school_name", "Makini"); + csvValues.put("school_ID", "f0de23e0-1e42-49e1-a60f-58d92040aaaa"); + csvValues.put("birthdate", "2020-01-01"); + csvValues.put("birthday_approximated", "true"); + + JSONObject jsonObject = JSONCSVUtil.toJSON(csvValues, configGroup); + + Client client = gson.fromJson(jsonObject.get(CLIENT).toString(), Client.class); + Assert.assertEquals(client.getFirstName(), "Ronald"); + Assert.assertEquals(client.getLastName(), "Dev"); + Assert.assertEquals(client.getGender(), "Male"); + Assert.assertTrue(client.getBirthdateApprox()); + Assert.assertEquals(client.getIdentifier("national_id"), "234234234"); + Assert.assertEquals(client.getAttributes().get("default_residence"), "f0de23e0-1e42-49e1-a60f-58d92040aaaa"); + Assert.assertEquals(client.getAttributes().get("grade"), "Grade 2"); + Assert.assertEquals(client.getAttributes().get("school_name"), "Makini"); + Assert.assertEquals(client.getAttributes().get("school_enrolled"), "Yes"); + Assert.assertEquals(client.getAttributes().get("has_no_id"), "Yes"); + + Event event = gson.fromJson(jsonObject.get(EVENT).toString(), Event.class); + Assert.assertEquals(event.getLocationId(), "f0de23e0-1e42-49e1-a60f-58d92040aaaa"); + } + + @Test + public void testExtractData() { + String expectedJSON = "{\"client\":{\"lastName\":\"Williams\",\"firstName\":\"Mark\",\"relationships\":{\"family\":[\"f785d89a-8c8c-4b92-91b4-f0a3bb160fed\"]},\"birthdate\":\"2013-05-15T00:00:00.000Z\",\"identifiers\":{\"opensrp_id\":\"2446768-0\",\"reveal_id\":\"2013051524467680\"},\"attributes\":{\"grade_class\":\"1\",\"grade\":\"Grade 2\",\"school_name\":\"St Christophers\",\"age_category\":\"\",\"school_enrolled\":\"Yes\",\"reveal_id\":\"12345\"},\"baseEntityId\":\"f785d89a-8c8c-4b92-91b4-f0a3bb160fed\",\"birthdateApprox\":\"false\"}}"; + JSONObject jsonObject = new JSONObject(expectedJSON); + + List mapping = getAttributes().stream() + .map(Pair::getLeft) + .collect(Collectors.toList()); + + List string = JSONCSVUtil.jsonToString(jsonObject, mapping); + + String[] expected = {"12345", "", "Grade 2", "1", "Yes", "St Christophers", "f785d89a-8c8c-4b92-91b4-f0a3bb160fed", + "2013-05-15T00:00:00.000Z", "false", "2446768-0", "2013051524467680", "Williams", "Mark", + "f785d89a-8c8c-4b92-91b4-f0a3bb160fed"}; + + for (String s : expected) { + Assert.assertTrue(string.contains(s)); + } + + Assert.assertEquals(expected.length, string.size()); + } + + @Test + public void testAddJsonNode() { + JSONObject jsonObject = new JSONObject(); + for (Pair pa : + getAttributes()) { + JSONCSVUtil.addNodeToJson(pa.getKey(), pa.getValue(), jsonObject); + } + + String expectedJSON = "{\"client\":{\"lastName\":\"Williams\",\"firstName\":\"Mark\",\"relationships\":{\"family\":[\"f785d89a-8c8c-4b92-91b4-f0a3bb160fed\"]},\"birthdate\":\"2013-05-15T00:00:00.000Z\",\"identifiers\":{\"opensrp_id\":\"2446768-0\",\"reveal_id\":\"2013051524467680\"},\"attributes\":{\"grade_class\":\"1\",\"grade\":\"Grade 2\",\"school_name\":\"St Christophers\",\"age_category\":\"6-10\",\"school_enrolled\":\"Yes\",\"reveal_id\":\"12345\"},\"baseEntityId\":\"f785d89a-8c8c-4b92-91b4-f0a3bb160fed\",\"birthdateApprox\":\"false\"}}"; + Assert.assertEquals(expectedJSON, jsonObject.toString()); + } + + private List> getAttributes() { + List> result = new ArrayList<>(); + + result.add(Pair.of("client.attributes.reveal_id", "12345")); + result.add(Pair.of("client.attributes.age_category", "6-10")); + result.add(Pair.of("client.attributes.grade", "Grade 2")); + result.add(Pair.of("client.attributes.grade_class", "1")); + result.add(Pair.of("client.attributes.school_enrolled", "Yes")); + result.add(Pair.of("client.attributes.school_name", "St Christophers")); + + result.add(Pair.of("client.baseEntityId", "f785d89a-8c8c-4b92-91b4-f0a3bb160fed")); + result.add(Pair.of("client.birthdate", "2013-05-15T00:00:00.000Z")); + result.add(Pair.of("client.birthdateApprox", "false")); + result.add(Pair.of("client.identifiers.opensrp_id", "2446768-0")); + result.add(Pair.of("client.identifiers.reveal_id", "2013051524467680")); + result.add(Pair.of("client.lastName", "Williams")); + result.add(Pair.of("client.firstName", "Mark")); + result.add(Pair.of("client.relationships.family[0]", "f785d89a-8c8c-4b92-91b4-f0a3bb160fed")); + + return result; + } } diff --git a/src/test/java/org/opensrp/util/LocalDateDeserializerTest.java b/src/test/java/org/opensrp/util/LocalDateDeserializerTest.java index aa8ea1f33..6ae9c6972 100644 --- a/src/test/java/org/opensrp/util/LocalDateDeserializerTest.java +++ b/src/test/java/org/opensrp/util/LocalDateDeserializerTest.java @@ -11,16 +11,16 @@ public class LocalDateDeserializerTest { - @Test - public void testDeserializer() throws IOException { - LocalDateDeserializer localDateDeserializer = new LocalDateDeserializer(); - DeserializationContext context = Mockito.mock(DeserializationContext.class); - JsonParser jsonParser = Mockito.mock(JsonParser.class); - Mockito.doReturn(JsonToken.VALUE_STRING).when(jsonParser).getCurrentToken(); - Mockito.doReturn("2021-05-21").when(jsonParser).getText(); - Assert.assertNotNull(localDateDeserializer.deserialize(jsonParser, context)); - Mockito.doReturn(null).when(jsonParser).getCurrentToken(); - Assert.assertNull(localDateDeserializer.deserialize(jsonParser, context)); + @Test + public void testDeserializer() throws IOException { + LocalDateDeserializer localDateDeserializer = new LocalDateDeserializer(); + DeserializationContext context = Mockito.mock(DeserializationContext.class); + JsonParser jsonParser = Mockito.mock(JsonParser.class); + Mockito.doReturn(JsonToken.VALUE_STRING).when(jsonParser).getCurrentToken(); + Mockito.doReturn("2021-05-21").when(jsonParser).getText(); + Assert.assertNotNull(localDateDeserializer.deserialize(jsonParser, context)); + Mockito.doReturn(null).when(jsonParser).getCurrentToken(); + Assert.assertNull(localDateDeserializer.deserialize(jsonParser, context)); - } + } } diff --git a/src/test/java/org/opensrp/util/LocalDateSerializerTest.java b/src/test/java/org/opensrp/util/LocalDateSerializerTest.java index 718b07fb2..d4c5428fb 100644 --- a/src/test/java/org/opensrp/util/LocalDateSerializerTest.java +++ b/src/test/java/org/opensrp/util/LocalDateSerializerTest.java @@ -11,14 +11,14 @@ public class LocalDateSerializerTest { - @Test - public void testSerializer() throws IOException { - ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(String.class); - LocalDate localDate = new LocalDate(); - LocalDateSerializer localDateSerializer = new LocalDateSerializer(); - SerializerProvider provider = Mockito.mock(SerializerProvider.class); - JsonGenerator jsonGen = Mockito.mock(JsonGenerator.class); - localDateSerializer.serialize(localDate, jsonGen, provider); - Mockito.verify(jsonGen, Mockito.atLeastOnce()).writeString(argumentCaptor.capture()); - } + @Test + public void testSerializer() throws IOException { + ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(String.class); + LocalDate localDate = new LocalDate(); + LocalDateSerializer localDateSerializer = new LocalDateSerializer(); + SerializerProvider provider = Mockito.mock(SerializerProvider.class); + JsonGenerator jsonGen = Mockito.mock(JsonGenerator.class); + localDateSerializer.serialize(localDate, jsonGen, provider); + Mockito.verify(jsonGen, Mockito.atLeastOnce()).writeString(argumentCaptor.capture()); + } } diff --git a/src/test/java/org/opensrp/util/Matcher.java b/src/test/java/org/opensrp/util/Matcher.java index b29922ce2..43d72d597 100644 --- a/src/test/java/org/opensrp/util/Matcher.java +++ b/src/test/java/org/opensrp/util/Matcher.java @@ -6,19 +6,19 @@ import org.mockito.ArgumentMatcher; public class Matcher { - - public static T objectWithSameFieldsAs(final T other) { - return argThat(hasSameFieldsAs(other)); - } - - public static ArgumentMatcher hasSameFieldsAs(final T other) { - return new ArgumentMatcher() { - - @Override - public boolean matches(Object o) { - return EqualsBuilder.reflectionEquals(other, o); - } - - }; - } + + public static T objectWithSameFieldsAs(final T other) { + return argThat(hasSameFieldsAs(other)); + } + + public static ArgumentMatcher hasSameFieldsAs(final T other) { + return new ArgumentMatcher() { + + @Override + public boolean matches(Object o) { + return EqualsBuilder.reflectionEquals(other, o); + } + + }; + } } diff --git a/src/test/java/org/opensrp/util/PropertiesConverterTest.java b/src/test/java/org/opensrp/util/PropertiesConverterTest.java index 051bbe6bf..eefd4e867 100644 --- a/src/test/java/org/opensrp/util/PropertiesConverterTest.java +++ b/src/test/java/org/opensrp/util/PropertiesConverterTest.java @@ -18,8 +18,9 @@ public class PropertiesConverterTest { private String parentJson = "{\"name\":\"MKB_5\",\"status\":\"Active\",\"version\":0,\"parentId\":\"2953\",\"geographicLevel\":2}"; - private Gson gson = new GsonBuilder().registerTypeAdapter(LocalDate.class, new DateTypeConverter()).serializeNulls() + private Gson gson = new GsonBuilder().registerTypeAdapter(LocalDate.class, new DateTypeConverter()).serializeNulls() .registerTypeAdapter(LocationProperty.class, new PropertiesConverter()).create(); + @Test public void testSerializeCustomProperties() { @@ -38,8 +39,8 @@ public void testSerializeCustomProperties() { @Test public void testDeserializeCustomProperties() { - LocationProperty locationProperty = gson.fromJson("{\"status\":\"Active\",\"parentId\":\"2953\",\"name\":\"MKB_5\",\"geographicLevel\":2,\"version\":0,\"taskBusinessStatus\":\"Not Visited\",\"taskIdentifier\":\"0d15fcac-df64-4f53-b01a-b650d1e45252\",\"taskStatus\":\"In Progress\"}" - , LocationProperty.class); + LocationProperty locationProperty = gson.fromJson("{\"status\":\"Active\",\"parentId\":\"2953\",\"name\":\"MKB_5\",\"geographicLevel\":2,\"version\":0,\"taskBusinessStatus\":\"Not Visited\",\"taskIdentifier\":\"0d15fcac-df64-4f53-b01a-b650d1e45252\",\"taskStatus\":\"In Progress\"}" + , LocationProperty.class); Map customProperties = locationProperty.getCustomProperties(); assertEquals(3, customProperties.size()); assertEquals("0d15fcac-df64-4f53-b01a-b650d1e45252", customProperties.get("taskIdentifier")); diff --git a/src/test/java/org/opensrp/util/SampleFullDomainObject.java b/src/test/java/org/opensrp/util/SampleFullDomainObject.java index 9583e4a0a..08d63c4e0 100644 --- a/src/test/java/org/opensrp/util/SampleFullDomainObject.java +++ b/src/test/java/org/opensrp/util/SampleFullDomainObject.java @@ -27,279 +27,219 @@ import org.opensrp.dto.form.MultimediaDTO; public class SampleFullDomainObject { - - //*** ADDRESS RELATED - public static final String addressType = "addressType"; - - public static final String country = "country"; - - public static final String stateProvince = "stateProvince"; - - public static final String cityVillage = "cityVillage"; - - public static final String countryDistrict = "countryDistrict"; - - public static final String subDistrict = "subDistrict"; - - public static final String town = "town"; - //** - - public static final String name = "name"; - - public static final String male = "male"; - - public static final DateTime birthDate = new DateTime(0l, DateTimeZone.UTC); - - public static final DateTime deathDate = new DateTime(1l, DateTimeZone.UTC); - - public static final String FULL_NAME = "full name"; - - public static final String LOCATION_NAME = "locationName"; - - public static Map identifier = new HashMap<>(); - - public static final Map attributes = new HashMap<>(); - - public static final String IDENTIFIER_TYPE = "identifierType"; - - public static final String IDENTIFIER_VALUE = "identifierValue"; - - public static final String ATTRIBUTES_VALUE = "attributesValue"; - - public static final String ATTRIBUTES_TYPE = "attributesType"; - - static { - identifier.put(IDENTIFIER_TYPE, IDENTIFIER_VALUE); - attributes.put(ATTRIBUTES_TYPE, ATTRIBUTES_VALUE); - } - - public static final String BASE_ENTITY_ID = "baseEntityId"; - - public static final String DIFFERENT_BASE_ENTITY_ID = "differentBaseEntityId"; - - public static final String FIRST_NAME = "firstName"; - - public static final String MIDDLE_NAME = "middleName"; - - public static final String LAST_NAME = "lastName"; - - public static final boolean BIRTH_DATE_APPROX = true; - - public static final boolean DEATH_DATE_APPROX = false; - - public static final String FEMALE = "female"; - - //** EVENT RELATED - public static final String EVENT_TYPE = "eventType"; - - public static final DateTime EVENT_DATE = new DateTime(0l, DateTimeZone.UTC); - - public static final String ENTITY_TYPE = "entityType"; - - public static final String PROVIDER_ID = "providerId"; - - public static final String LOCATION_ID = "locationId"; - - public static final String FORM_SUBMISSION_ID = "formSubmissionId"; - - public static final Map DETAILS = new HashMap<>(); - - public static final String DETAIL_KEY = "detailKey"; - - public static final String DETAIL_VALUE = "detailValue"; - - static { - DETAILS.put(DETAIL_KEY, DETAIL_VALUE); - } - //** - - //** OBS RELATED - public static final String CONCEPT = "concept"; - - public static final String FIELD_DATA_TYPE = "fieldDataTyp"; - - public static final String FIELD_CODE = "fieldCode"; - - public static final String PARENT_CODE = null; - - public static final String VALUE = "value"; - - public static final String COMMENTS_TEST = "commentsTest"; - - public static final String FORM_SUBMISSION_FIELD = "formSubmissionField"; - //** - - //** ERROR TRACE RELATED - public static final String RECORD_ID = "recordId"; - - public static final DateTime EPOCH_DATE_TIME = new DateTime(0l, DateTimeZone.UTC); - - public static final String ERROR_NAME = "errorName"; - - public static final String OCCURED_AT = "occuredAt"; - - public static final String STACK_TRACE = "stackTrace"; - - public static final String SOLVED = "solved"; - - //** APP STATE TOKEN RELATED - public enum AppStateTokenName { - APP_STATE_TOKEN_NAME("appStateTokenName"), - DIFFERENT_APP_STATE_TOKEN_NAME("differentAppStateToken"); - - String value; - - AppStateTokenName(String value) { - this.value = value; - } - - } - - public static final int LAST_EDIT_DATE = 1222; - - public static final String APP_STATE_TOKEN_DESCRIPTION = "description"; - //** - - //** LOCATION RELATED - public static Set locationTags = new HashSet<>(asList("tags1", "tags2")); - //** - - //** HIA2 INDICATOR RELATED - public static final String INDICATOR_CODE = "indicatorCode"; - - public static final String HIA2_INDICATOR_LABEL = "hia2IndicatorLabel"; - - public static final String DHIS_ID = "dhisId"; - - public static final String HIA_2_DESCRIPTION = "hia2Description"; - - public static final String HIA2_CATEGORY = "hia2Category"; - - public static final String HIA2_VALUE = "hia2Value"; - - public static final String HIA2_UPDATED_AT = "hia2UpdatedAt"; - //** - - //** REPORT RELATED - public static final String REPORT_TYPE = "reportType"; - - public static final String REPORT_STATUS = "reportStatus"; - - public static final int REPORT_VERSION = 222; - - public static final int REPORT_DURATION = 3434; - //** - - //** USER RELATED - public static final String USER_NAME = "userName"; - - public static final String PASSWORD = "password"; - - public static final String SALT = "salt"; - - public static final String USER_STATUS = "userStatus"; - - public static final List ROLES = asList("role1", "role2"); - - public static final List PERMISSIONS = asList("permission1", "permission2"); - //** - - //** MULTIMEDIA RELATED - public static final String FILE_CATEGORY = "fileCategory"; - - public static final String FILE_PATH = "filePath"; - - public static final String CONTENT_TYPE = "contentType"; - - public static final String CASE_ID = "caseId"; - //** - - public static Address getAddress() { - Address address = new Address().withAddressType(addressType).withCountry(country).withStateProvince(stateProvince) - .withCityVillage(cityVillage).withCountyDistrict(countryDistrict).withSubDistrict(subDistrict) - .withTown(town); - return address; - } - - public static Client getClient() { - Client client = new Client(BASE_ENTITY_ID, FIRST_NAME, MIDDLE_NAME, LAST_NAME, birthDate, deathDate, - BIRTH_DATE_APPROX, DEATH_DATE_APPROX, FEMALE, Collections.singletonList(getAddress()), identifier, - attributes); - return client; - } - - public static Obs getObs() { - Obs obs = new Obs(CONCEPT, FIELD_DATA_TYPE, FIELD_CODE, PARENT_CODE, VALUE, COMMENTS_TEST, FORM_SUBMISSION_FIELD); - return obs; - } - - public static Event getEvent() { - Event event = new Event(BASE_ENTITY_ID, EVENT_TYPE, EVENT_DATE, ENTITY_TYPE, PROVIDER_ID, LOCATION_ID, - FORM_SUBMISSION_ID); - event.setIdentifiers(identifier); - event.setDetails(DETAILS); - event.addObs(getObs()); - return event; - } - - public static AppStateToken getAppStateToken() { - AppStateToken appStateToken = new AppStateToken(AppStateTokenName.APP_STATE_TOKEN_NAME.name(), VALUE, LAST_EDIT_DATE, - APP_STATE_TOKEN_DESCRIPTION); - return appStateToken; - } - - public static ErrorTrace getErrorTrace() { - ErrorTrace errorTrace = new ErrorTrace(RECORD_ID, EPOCH_DATE_TIME, ERROR_NAME, OCCURED_AT, STACK_TRACE, SOLVED); - return errorTrace; - } - - public static Provider getProvider() { - Provider provider = new Provider(BASE_ENTITY_ID, FULL_NAME); - return provider; - } - - public static Location getDomainLocation() { - Location location = new Location(LOCATION_ID, LOCATION_NAME, getAddress(), identifier, null, locationTags, - attributes); - return location; - } - - public static org.opensrp.api.domain.Location getApiLocation() { - org.opensrp.api.domain.Location location = new org.opensrp.api.domain.Location(LOCATION_ID, LOCATION_NAME, null, - identifier, null, locationTags, attributes); - return location; - } - - public static Hia2Indicator getHia2Indicator() { - Hia2Indicator hia2Indicator = new Hia2Indicator(INDICATOR_CODE, HIA2_INDICATOR_LABEL, DHIS_ID, HIA_2_DESCRIPTION, - HIA2_CATEGORY, HIA2_VALUE, PROVIDER_ID, HIA2_UPDATED_AT); - return hia2Indicator; - } - - public static Report getReport() { - Report report = new Report(BASE_ENTITY_ID, LOCATION_ID, EPOCH_DATE_TIME, REPORT_TYPE, FORM_SUBMISSION_ID, - PROVIDER_ID, REPORT_STATUS, REPORT_VERSION, REPORT_DURATION, asList(getHia2Indicator())); - report.setIdentifiers(identifier); - return report; - } - - public static User getUser() { - User user = new User(BASE_ENTITY_ID, USER_NAME, PASSWORD, SALT, USER_STATUS, ROLES, PERMISSIONS); - return user; - } - - public static BaseEntity getBaseEntity() { - BaseEntity baseEntity = new BaseEntity(BASE_ENTITY_ID, identifier, attributes, asList(getAddress())); - return baseEntity; - } - - public static Multimedia getMultimedia() { - Multimedia multimedia = new Multimedia(CASE_ID, PROVIDER_ID, CONTENT_TYPE, FILE_PATH, FILE_CATEGORY); - return multimedia; - } - - public static MultimediaDTO getMultimediaDTO(String contentType) { - MultimediaDTO multimediaDTO = new MultimediaDTO(CASE_ID, PROVIDER_ID, contentType, FILE_PATH, FILE_CATEGORY); - return multimediaDTO; - } + + //*** ADDRESS RELATED + public static final String addressType = "addressType"; + + public static final String country = "country"; + + public static final String stateProvince = "stateProvince"; + + public static final String cityVillage = "cityVillage"; + + public static final String countryDistrict = "countryDistrict"; + + public static final String subDistrict = "subDistrict"; + + public static final String town = "town"; + //** + + public static final String name = "name"; + + public static final String male = "male"; + + public static final DateTime birthDate = new DateTime(0l, DateTimeZone.UTC); + + public static final DateTime deathDate = new DateTime(1l, DateTimeZone.UTC); + + public static final String FULL_NAME = "full name"; + + public static final String LOCATION_NAME = "locationName"; + public static final Map attributes = new HashMap<>(); + public static final String IDENTIFIER_TYPE = "identifierType"; + public static final String IDENTIFIER_VALUE = "identifierValue"; + public static final String ATTRIBUTES_VALUE = "attributesValue"; + public static final String ATTRIBUTES_TYPE = "attributesType"; + public static final String BASE_ENTITY_ID = "baseEntityId"; + public static final String DIFFERENT_BASE_ENTITY_ID = "differentBaseEntityId"; + public static final String FIRST_NAME = "firstName"; + public static final String MIDDLE_NAME = "middleName"; + public static final String LAST_NAME = "lastName"; + public static final boolean BIRTH_DATE_APPROX = true; + public static final boolean DEATH_DATE_APPROX = false; + public static final String FEMALE = "female"; + //** EVENT RELATED + public static final String EVENT_TYPE = "eventType"; + public static final DateTime EVENT_DATE = new DateTime(0l, DateTimeZone.UTC); + public static final String ENTITY_TYPE = "entityType"; + public static final String PROVIDER_ID = "providerId"; + public static final String LOCATION_ID = "locationId"; + public static final String FORM_SUBMISSION_ID = "formSubmissionId"; + public static final Map DETAILS = new HashMap<>(); + public static final String DETAIL_KEY = "detailKey"; + public static final String DETAIL_VALUE = "detailValue"; + //** OBS RELATED + public static final String CONCEPT = "concept"; + public static final String FIELD_DATA_TYPE = "fieldDataTyp"; + public static final String FIELD_CODE = "fieldCode"; + //** + public static final String PARENT_CODE = null; + public static final String VALUE = "value"; + public static final String COMMENTS_TEST = "commentsTest"; + public static final String FORM_SUBMISSION_FIELD = "formSubmissionField"; + //** ERROR TRACE RELATED + public static final String RECORD_ID = "recordId"; + public static final DateTime EPOCH_DATE_TIME = new DateTime(0l, DateTimeZone.UTC); + public static final String ERROR_NAME = "errorName"; + //** + public static final String OCCURED_AT = "occuredAt"; + public static final String STACK_TRACE = "stackTrace"; + public static final String SOLVED = "solved"; + public static final int LAST_EDIT_DATE = 1222; + public static final String APP_STATE_TOKEN_DESCRIPTION = "description"; + //** HIA2 INDICATOR RELATED + public static final String INDICATOR_CODE = "indicatorCode"; + public static final String HIA2_INDICATOR_LABEL = "hia2IndicatorLabel"; + public static final String DHIS_ID = "dhisId"; + public static final String HIA_2_DESCRIPTION = "hia2Description"; + //** + public static final String HIA2_CATEGORY = "hia2Category"; + //** + public static final String HIA2_VALUE = "hia2Value"; + public static final String HIA2_UPDATED_AT = "hia2UpdatedAt"; + //** REPORT RELATED + public static final String REPORT_TYPE = "reportType"; + public static final String REPORT_STATUS = "reportStatus"; + public static final int REPORT_VERSION = 222; + public static final int REPORT_DURATION = 3434; + //** USER RELATED + public static final String USER_NAME = "userName"; + //** + public static final String PASSWORD = "password"; + public static final String SALT = "salt"; + public static final String USER_STATUS = "userStatus"; + public static final List ROLES = asList("role1", "role2"); + //** + public static final List PERMISSIONS = asList("permission1", "permission2"); + //** MULTIMEDIA RELATED + public static final String FILE_CATEGORY = "fileCategory"; + public static final String FILE_PATH = "filePath"; + public static final String CONTENT_TYPE = "contentType"; + public static final String CASE_ID = "caseId"; + public static Map identifier = new HashMap<>(); + //** + //** LOCATION RELATED + public static Set locationTags = new HashSet<>(asList("tags1", "tags2")); + + static { + identifier.put(IDENTIFIER_TYPE, IDENTIFIER_VALUE); + attributes.put(ATTRIBUTES_TYPE, ATTRIBUTES_VALUE); + } + + static { + DETAILS.put(DETAIL_KEY, DETAIL_VALUE); + } + + public static Address getAddress() { + Address address = new Address().withAddressType(addressType).withCountry(country).withStateProvince(stateProvince) + .withCityVillage(cityVillage).withCountyDistrict(countryDistrict).withSubDistrict(subDistrict) + .withTown(town); + return address; + } + //** + + public static Client getClient() { + Client client = new Client(BASE_ENTITY_ID, FIRST_NAME, MIDDLE_NAME, LAST_NAME, birthDate, deathDate, + BIRTH_DATE_APPROX, DEATH_DATE_APPROX, FEMALE, Collections.singletonList(getAddress()), identifier, + attributes); + return client; + } + + public static Obs getObs() { + Obs obs = new Obs(CONCEPT, FIELD_DATA_TYPE, FIELD_CODE, PARENT_CODE, VALUE, COMMENTS_TEST, FORM_SUBMISSION_FIELD); + return obs; + } + + public static Event getEvent() { + Event event = new Event(BASE_ENTITY_ID, EVENT_TYPE, EVENT_DATE, ENTITY_TYPE, PROVIDER_ID, LOCATION_ID, + FORM_SUBMISSION_ID); + event.setIdentifiers(identifier); + event.setDetails(DETAILS); + event.addObs(getObs()); + return event; + } + + public static AppStateToken getAppStateToken() { + AppStateToken appStateToken = new AppStateToken(AppStateTokenName.APP_STATE_TOKEN_NAME.name(), VALUE, LAST_EDIT_DATE, + APP_STATE_TOKEN_DESCRIPTION); + return appStateToken; + } + + public static ErrorTrace getErrorTrace() { + ErrorTrace errorTrace = new ErrorTrace(RECORD_ID, EPOCH_DATE_TIME, ERROR_NAME, OCCURED_AT, STACK_TRACE, SOLVED); + return errorTrace; + } + + public static Provider getProvider() { + Provider provider = new Provider(BASE_ENTITY_ID, FULL_NAME); + return provider; + } + + public static Location getDomainLocation() { + Location location = new Location(LOCATION_ID, LOCATION_NAME, getAddress(), identifier, null, locationTags, + attributes); + return location; + } + + public static org.opensrp.api.domain.Location getApiLocation() { + org.opensrp.api.domain.Location location = new org.opensrp.api.domain.Location(LOCATION_ID, LOCATION_NAME, null, + identifier, null, locationTags, attributes); + return location; + } + + public static Hia2Indicator getHia2Indicator() { + Hia2Indicator hia2Indicator = new Hia2Indicator(INDICATOR_CODE, HIA2_INDICATOR_LABEL, DHIS_ID, HIA_2_DESCRIPTION, + HIA2_CATEGORY, HIA2_VALUE, PROVIDER_ID, HIA2_UPDATED_AT); + return hia2Indicator; + } + + public static Report getReport() { + Report report = new Report(BASE_ENTITY_ID, LOCATION_ID, EPOCH_DATE_TIME, REPORT_TYPE, FORM_SUBMISSION_ID, + PROVIDER_ID, REPORT_STATUS, REPORT_VERSION, REPORT_DURATION, asList(getHia2Indicator())); + report.setIdentifiers(identifier); + return report; + } + + public static User getUser() { + User user = new User(BASE_ENTITY_ID, USER_NAME, PASSWORD, SALT, USER_STATUS, ROLES, PERMISSIONS); + return user; + } + + public static BaseEntity getBaseEntity() { + BaseEntity baseEntity = new BaseEntity(BASE_ENTITY_ID, identifier, attributes, asList(getAddress())); + return baseEntity; + } + + public static Multimedia getMultimedia() { + Multimedia multimedia = new Multimedia(CASE_ID, PROVIDER_ID, CONTENT_TYPE, FILE_PATH, FILE_CATEGORY); + return multimedia; + } + + public static MultimediaDTO getMultimediaDTO(String contentType) { + MultimediaDTO multimediaDTO = new MultimediaDTO(CASE_ID, PROVIDER_ID, contentType, FILE_PATH, FILE_CATEGORY); + return multimediaDTO; + } + + //** APP STATE TOKEN RELATED + public enum AppStateTokenName { + APP_STATE_TOKEN_NAME("appStateTokenName"), + DIFFERENT_APP_STATE_TOKEN_NAME("differentAppStateToken"); + + String value; + + AppStateTokenName(String value) { + this.value = value; + } + + } } diff --git a/src/test/java/org/opensrp/util/TestResourceLoader.java b/src/test/java/org/opensrp/util/TestResourceLoader.java index 0cf9b016c..e1ab2a929 100644 --- a/src/test/java/org/opensrp/util/TestResourceLoader.java +++ b/src/test/java/org/opensrp/util/TestResourceLoader.java @@ -14,40 +14,39 @@ import org.springframework.core.io.support.PropertiesLoaderUtils; public class TestResourceLoader { - - protected String openmrsOpenmrsUrl; - - protected String openmrsUsername; - - protected String openmrsPassword; - - protected String formDirPath; - - protected boolean pushToOpenmrsForTest; - - public TestResourceLoader() { - try { - Resource resource = new ClassPathResource("opensrp.properties"); - Properties props = PropertiesLoaderUtils.loadProperties(resource); - formDirPath = props.getProperty("form.directory.name"); - } - catch (IOException e) { - Assert.fail(e.getMessage()); - } - - } - - protected JSONObject getJsonFormSubmissionFor(String formName, Integer number) throws IOException { - ResourceLoader loader = new DefaultResourceLoader(); - String path = loader.getResource(formDirPath).getURI().getPath(); - File fsfile = new File(path + "/" + formName + "/form_submission" + (number == null ? "" : number) + ".json"); - return new JSONObject(new FileReader(fsfile)); - } - - protected String getFullPath(String fileName) throws IOException { - ResourceLoader loader = new DefaultResourceLoader(); - String path = loader.getResource(fileName).getURI().getPath(); - return path; - } - + + protected String openmrsOpenmrsUrl; + + protected String openmrsUsername; + + protected String openmrsPassword; + + protected String formDirPath; + + protected boolean pushToOpenmrsForTest; + + public TestResourceLoader() { + try { + Resource resource = new ClassPathResource("opensrp.properties"); + Properties props = PropertiesLoaderUtils.loadProperties(resource); + formDirPath = props.getProperty("form.directory.name"); + } catch (IOException e) { + Assert.fail(e.getMessage()); + } + + } + + protected JSONObject getJsonFormSubmissionFor(String formName, Integer number) throws IOException { + ResourceLoader loader = new DefaultResourceLoader(); + String path = loader.getResource(formDirPath).getURI().getPath(); + File fsfile = new File(path + "/" + formName + "/form_submission" + (number == null ? "" : number) + ".json"); + return new JSONObject(new FileReader(fsfile)); + } + + protected String getFullPath(String fileName) throws IOException { + ResourceLoader loader = new DefaultResourceLoader(); + String path = loader.getResource(fileName).getURI().getPath(); + return path; + } + } diff --git a/src/test/java/org/opensrp/util/UtilTest.java b/src/test/java/org/opensrp/util/UtilTest.java index e77dee530..23cb52594 100644 --- a/src/test/java/org/opensrp/util/UtilTest.java +++ b/src/test/java/org/opensrp/util/UtilTest.java @@ -14,60 +14,60 @@ import org.junit.Test; public class UtilTest extends TestResourceLoader { - - public String declaredFieldOne; - - public int declaredFieldTwo; - - @Test - public void testGetStringFromJson() throws IOException { - String formSubmission = "{\"_id\": \"1\",\n" + " \"_rev\": \"2\"}"; - Map map = Utils.getStringMapFromJSON(formSubmission); - assertFalse(map.isEmpty()); - assertEquals(map.size(), 2); - assertEquals(map.get("_id"), "1"); - assertEquals(map.get("_rev"), "2"); - assertNull(map.get("sdf")); - } - - @Test(expected = Exception.class) - public void testErrorForInvalidJsonInGetStringFromJson() { - String formSubmission = "Invalid JSON"; - Utils.getStringMapFromJSON(formSubmission); - } - - @Test - public void testGetFieldsAsList() { - List fieldList = Utils.getFieldsAsList(UtilTest.class); - assertEquals(2, fieldList.size()); - assertEquals("declaredFieldOne", fieldList.get(0)); - assertEquals("declaredFieldTwo", fieldList.get(1)); - } - - - @Test - public void testGetXlsToJson() throws IOException, JSONException { - String path = getFullPath("sampleXLS/validXLS.xls"); - JSONArray jsonArray = Utils.getXlsToJson(path); - JSONObject jsonObject = jsonArray.getJSONObject(0); - assertEquals(2, jsonArray.length()); - assertEquals("f", jsonObject.get("first")); - assertEquals("s", jsonObject.get("second")); - assertEquals("t", jsonObject.get("third")); - - } - - @Test - public void testGetXlsToJsonForEmptyXls() throws IOException, JSONException { - String path = getFullPath("sampleXLS/emptyXLS.xls"); - JSONArray jsonArray = Utils.getXlsToJson(path); - assertEquals(0, jsonArray.length()); - } - - @Test(expected = Exception.class) - public void testGetXlsToJsonForInvalidXls() throws IOException, JSONException { - String path = getFullPath("sampleXLS/invalidXLS.xls"); - Utils.getXlsToJson(path); - } - + + public String declaredFieldOne; + + public int declaredFieldTwo; + + @Test + public void testGetStringFromJson() throws IOException { + String formSubmission = "{\"_id\": \"1\",\n" + " \"_rev\": \"2\"}"; + Map map = Utils.getStringMapFromJSON(formSubmission); + assertFalse(map.isEmpty()); + assertEquals(map.size(), 2); + assertEquals(map.get("_id"), "1"); + assertEquals(map.get("_rev"), "2"); + assertNull(map.get("sdf")); + } + + @Test(expected = Exception.class) + public void testErrorForInvalidJsonInGetStringFromJson() { + String formSubmission = "Invalid JSON"; + Utils.getStringMapFromJSON(formSubmission); + } + + @Test + public void testGetFieldsAsList() { + List fieldList = Utils.getFieldsAsList(UtilTest.class); + assertEquals(2, fieldList.size()); + assertEquals("declaredFieldOne", fieldList.get(0)); + assertEquals("declaredFieldTwo", fieldList.get(1)); + } + + + @Test + public void testGetXlsToJson() throws IOException, JSONException { + String path = getFullPath("sampleXLS/validXLS.xls"); + JSONArray jsonArray = Utils.getXlsToJson(path); + JSONObject jsonObject = jsonArray.getJSONObject(0); + assertEquals(2, jsonArray.length()); + assertEquals("f", jsonObject.get("first")); + assertEquals("s", jsonObject.get("second")); + assertEquals("t", jsonObject.get("third")); + + } + + @Test + public void testGetXlsToJsonForEmptyXls() throws IOException, JSONException { + String path = getFullPath("sampleXLS/emptyXLS.xls"); + JSONArray jsonArray = Utils.getXlsToJson(path); + assertEquals(0, jsonArray.length()); + } + + @Test(expected = Exception.class) + public void testGetXlsToJsonForInvalidXls() throws IOException, JSONException { + String path = getFullPath("sampleXLS/invalidXLS.xls"); + Utils.getXlsToJson(path); + } + } diff --git a/src/test/java/org/opensrp/validator/InventoryDataValidatorTest.java b/src/test/java/org/opensrp/validator/InventoryDataValidatorTest.java index db9c8a4ea..aa4039da8 100755 --- a/src/test/java/org/opensrp/validator/InventoryDataValidatorTest.java +++ b/src/test/java/org/opensrp/validator/InventoryDataValidatorTest.java @@ -31,94 +31,94 @@ public class InventoryDataValidatorTest { - @Mock - private PhysicalLocationService physicalLocationService; + @Mock + private PhysicalLocationService physicalLocationService; - @Mock - private ProductCatalogueService productCatalogueService; + @Mock + private ProductCatalogueService productCatalogueService; - @Mock - private SettingService settingService; + @Mock + private SettingService settingService; - private InventoryDataValidator inventoryDataValidator; + private InventoryDataValidator inventoryDataValidator; - @Before - public void setUp() { - initMocks(this); - inventoryDataValidator = new InventoryDataValidator(physicalLocationService,productCatalogueService,settingService); - } + @Before + public void setUp() { + initMocks(this); + inventoryDataValidator = new InventoryDataValidator(physicalLocationService, productCatalogueService, settingService); + } - @Test - public void testGetValidationErrors() throws ParseException { - when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_DONOR_IDENTIFIER)).thenReturn(createSettingsDonors()); - when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_SECTIONS_IDENTIFIER)).thenReturn(createSettingsSections()); - when(productCatalogueService.getProductCatalogue(anyLong(), anyString())).thenReturn(null); - when(physicalLocationService.getStructure(anyString(),anyBoolean())).thenReturn(null); - List validationErrors = inventoryDataValidator.getValidationErrors("90398","1","04-08-2020", - "WASH", null, null, "1.8", "test Donor"); - assertEquals(7, validationErrors.size()); - assertEquals(MISSING_REQUIRED_FIELDS, validationErrors.get(0)); - assertEquals(PRODUCT_CATALOG_DOES_NOT_EXISTS, validationErrors.get(1)); - assertEquals(SERVICE_POINT_DOES_NOT_EXISTS, validationErrors.get(2)); - assertEquals(INVALID_FORMAT_OF_DELIVERY_DATE, validationErrors.get(3)); - assertEquals(INVALID_QUANTITY, validationErrors.get(4)); - assertEquals(INVALID_UNICEF_SECTION, validationErrors.get(5)); - assertEquals(INVALID_DONOR, validationErrors.get(6)); - } + @Test + public void testGetValidationErrors() throws ParseException { + when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_DONOR_IDENTIFIER)).thenReturn(createSettingsDonors()); + when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_SECTIONS_IDENTIFIER)).thenReturn(createSettingsSections()); + when(productCatalogueService.getProductCatalogue(anyLong(), anyString())).thenReturn(null); + when(physicalLocationService.getStructure(anyString(), anyBoolean())).thenReturn(null); + List validationErrors = inventoryDataValidator.getValidationErrors("90398", "1", "04-08-2020", + "WASH", null, null, "1.8", "test Donor"); + assertEquals(7, validationErrors.size()); + assertEquals(MISSING_REQUIRED_FIELDS, validationErrors.get(0)); + assertEquals(PRODUCT_CATALOG_DOES_NOT_EXISTS, validationErrors.get(1)); + assertEquals(SERVICE_POINT_DOES_NOT_EXISTS, validationErrors.get(2)); + assertEquals(INVALID_FORMAT_OF_DELIVERY_DATE, validationErrors.get(3)); + assertEquals(INVALID_QUANTITY, validationErrors.get(4)); + assertEquals(INVALID_UNICEF_SECTION, validationErrors.get(5)); + assertEquals(INVALID_DONOR, validationErrors.get(6)); + } - @Test - public void testGetValidationErrorsV2() throws ParseException { - when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_DONOR_IDENTIFIER)).thenReturn(createSettingsDonors()); - when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_SECTIONS_IDENTIFIER)).thenReturn(createSettingsSections()); - when(productCatalogueService.getProductCatalogue(anyLong(), anyString())).thenReturn(null); - when(physicalLocationService.getStructure(anyString(),anyBoolean())).thenReturn(null); - List validationErrors = inventoryDataValidator.getValidationErrors("90398","1","04/08/20", - "WASH", null, null, "1.8", "test Donor"); - assertEquals(7, validationErrors.size()); - assertEquals(MISSING_REQUIRED_FIELDS, validationErrors.get(0)); - assertEquals(PRODUCT_CATALOG_DOES_NOT_EXISTS, validationErrors.get(1)); - assertEquals(SERVICE_POINT_DOES_NOT_EXISTS, validationErrors.get(2)); - assertEquals(INVALID_FORMAT_OF_DELIVERY_DATE, validationErrors.get(3)); - assertEquals(INVALID_QUANTITY, validationErrors.get(4)); - assertEquals(INVALID_UNICEF_SECTION, validationErrors.get(5)); - assertEquals(INVALID_DONOR, validationErrors.get(6)); - } + @Test + public void testGetValidationErrorsV2() throws ParseException { + when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_DONOR_IDENTIFIER)).thenReturn(createSettingsDonors()); + when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_SECTIONS_IDENTIFIER)).thenReturn(createSettingsSections()); + when(productCatalogueService.getProductCatalogue(anyLong(), anyString())).thenReturn(null); + when(physicalLocationService.getStructure(anyString(), anyBoolean())).thenReturn(null); + List validationErrors = inventoryDataValidator.getValidationErrors("90398", "1", "04/08/20", + "WASH", null, null, "1.8", "test Donor"); + assertEquals(7, validationErrors.size()); + assertEquals(MISSING_REQUIRED_FIELDS, validationErrors.get(0)); + assertEquals(PRODUCT_CATALOG_DOES_NOT_EXISTS, validationErrors.get(1)); + assertEquals(SERVICE_POINT_DOES_NOT_EXISTS, validationErrors.get(2)); + assertEquals(INVALID_FORMAT_OF_DELIVERY_DATE, validationErrors.get(3)); + assertEquals(INVALID_QUANTITY, validationErrors.get(4)); + assertEquals(INVALID_UNICEF_SECTION, validationErrors.get(5)); + assertEquals(INVALID_DONOR, validationErrors.get(6)); + } - @Test - public void testGetValidationErrorsV3() throws ParseException { - when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_DONOR_IDENTIFIER)).thenReturn(createSettingsDonors()); - when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_SECTIONS_IDENTIFIER)).thenReturn(createSettingsSections()); - when(productCatalogueService.getProductCatalogue(anyLong(), anyString())).thenReturn(null); - when(physicalLocationService.getStructure(anyString(),anyBoolean())).thenReturn(null); - List validationErrors = inventoryDataValidator.getValidationErrors("90398","1","04/08/2020", - "WASH", null, null, "1.8", "test Donor"); - assertEquals(6, validationErrors.size()); - assertEquals(MISSING_REQUIRED_FIELDS, validationErrors.get(0)); - assertEquals(PRODUCT_CATALOG_DOES_NOT_EXISTS, validationErrors.get(1)); - assertEquals(SERVICE_POINT_DOES_NOT_EXISTS, validationErrors.get(2)); - assertEquals(INVALID_QUANTITY, validationErrors.get(3)); - assertEquals(INVALID_UNICEF_SECTION, validationErrors.get(4)); - assertEquals(INVALID_DONOR, validationErrors.get(5)); - } + @Test + public void testGetValidationErrorsV3() throws ParseException { + when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_DONOR_IDENTIFIER)).thenReturn(createSettingsDonors()); + when(settingService.findSettingsByIdentifier(SETTINGS_CONFIGURATION_SECTIONS_IDENTIFIER)).thenReturn(createSettingsSections()); + when(productCatalogueService.getProductCatalogue(anyLong(), anyString())).thenReturn(null); + when(physicalLocationService.getStructure(anyString(), anyBoolean())).thenReturn(null); + List validationErrors = inventoryDataValidator.getValidationErrors("90398", "1", "04/08/2020", + "WASH", null, null, "1.8", "test Donor"); + assertEquals(6, validationErrors.size()); + assertEquals(MISSING_REQUIRED_FIELDS, validationErrors.get(0)); + assertEquals(PRODUCT_CATALOG_DOES_NOT_EXISTS, validationErrors.get(1)); + assertEquals(SERVICE_POINT_DOES_NOT_EXISTS, validationErrors.get(2)); + assertEquals(INVALID_QUANTITY, validationErrors.get(3)); + assertEquals(INVALID_UNICEF_SECTION, validationErrors.get(4)); + assertEquals(INVALID_DONOR, validationErrors.get(5)); + } - private List createSettingsDonors() { - SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined = new SettingsAndSettingsMetadataJoined(); - SettingsMetadata settingsMetadata = new SettingsMetadata(); - settingsMetadata.setSettingKey("ADB"); - settingsMetadata.setSettingValue("ADB"); - settingsMetadata.setSettingLabel("ADB"); - settingsAndSettingsMetadataJoined.setSettingsMetadata(settingsMetadata); - return Collections.singletonList(settingsAndSettingsMetadataJoined); - } + private List createSettingsDonors() { + SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined = new SettingsAndSettingsMetadataJoined(); + SettingsMetadata settingsMetadata = new SettingsMetadata(); + settingsMetadata.setSettingKey("ADB"); + settingsMetadata.setSettingValue("ADB"); + settingsMetadata.setSettingLabel("ADB"); + settingsAndSettingsMetadataJoined.setSettingsMetadata(settingsMetadata); + return Collections.singletonList(settingsAndSettingsMetadataJoined); + } - private List createSettingsSections() { - SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined = new SettingsAndSettingsMetadataJoined(); - SettingsMetadata settingsMetadata = new SettingsMetadata(); - settingsMetadata.setSettingKey("HEALTH"); - settingsMetadata.setSettingValue("Health"); - settingsMetadata.setSettingLabel("Health"); - settingsAndSettingsMetadataJoined.setSettingsMetadata(settingsMetadata); - return Collections.singletonList(settingsAndSettingsMetadataJoined); - } + private List createSettingsSections() { + SettingsAndSettingsMetadataJoined settingsAndSettingsMetadataJoined = new SettingsAndSettingsMetadataJoined(); + SettingsMetadata settingsMetadata = new SettingsMetadata(); + settingsMetadata.setSettingKey("HEALTH"); + settingsMetadata.setSettingValue("Health"); + settingsMetadata.setSettingLabel("Health"); + settingsAndSettingsMetadataJoined.setSettingsMetadata(settingsMetadata); + return Collections.singletonList(settingsAndSettingsMetadataJoined); + } } diff --git a/src/test/java/org/utils/AssertionUtil.java b/src/test/java/org/utils/AssertionUtil.java index c8053655f..b16a58d88 100644 --- a/src/test/java/org/utils/AssertionUtil.java +++ b/src/test/java/org/utils/AssertionUtil.java @@ -10,43 +10,43 @@ import org.smartregister.domain.BaseDataObject; public final class AssertionUtil { - - private AssertionUtil() { - - } - - public static void assertTwoListAreSameIgnoringOrder(List expectedList, List actualList) { - assertEquals(expectedList.size(), actualList.size()); - assertTrue("expected: " + expectedList.toString() + "\n" + "actual: " + actualList.toString(), - expectedList.containsAll(actualList) && actualList.containsAll(expectedList)); - } - - public static void assertNewObjectCreation(T expectedObject, T actualObject) { - assertNotNull(actualObject.getDateCreated()); - - assertEquals(expectedObject, actualObject); - - } - - public static void assertObjectUpdate(T expectedObject, T actualObject) { - assertNotNull(actualObject.getDateEdited()); - - assertEquals(expectedObject, actualObject); - - } - - public static void assertTwoDifferentTypeLocationSame(Location expectedLocation, - org.opensrp.api.domain.Location actualLocation) { - assertEquals(expectedLocation.getLocationId(), actualLocation.getLocationId()); - assertEquals(expectedLocation.getTags(), actualLocation.getTags()); - assertEquals(expectedLocation.getAttributes(), actualLocation.getAttributes()); - //assertEquals(expectedLocation.getAddress(), actualLocation.getAddress()); - assertEquals(expectedLocation.getName(), actualLocation.getName()); - assertEquals(expectedLocation.getIdentifiers(), actualLocation.getIdentifiers()); - if (expectedLocation.getParentLocation() != null) { - assertNotNull(actualLocation.getParentLocation()); - assertTwoDifferentTypeLocationSame(expectedLocation.getParentLocation(), actualLocation.getParentLocation()); - } - } - + + private AssertionUtil() { + + } + + public static void assertTwoListAreSameIgnoringOrder(List expectedList, List actualList) { + assertEquals(expectedList.size(), actualList.size()); + assertTrue("expected: " + expectedList.toString() + "\n" + "actual: " + actualList.toString(), + expectedList.containsAll(actualList) && actualList.containsAll(expectedList)); + } + + public static void assertNewObjectCreation(T expectedObject, T actualObject) { + assertNotNull(actualObject.getDateCreated()); + + assertEquals(expectedObject, actualObject); + + } + + public static void assertObjectUpdate(T expectedObject, T actualObject) { + assertNotNull(actualObject.getDateEdited()); + + assertEquals(expectedObject, actualObject); + + } + + public static void assertTwoDifferentTypeLocationSame(Location expectedLocation, + org.opensrp.api.domain.Location actualLocation) { + assertEquals(expectedLocation.getLocationId(), actualLocation.getLocationId()); + assertEquals(expectedLocation.getTags(), actualLocation.getTags()); + assertEquals(expectedLocation.getAttributes(), actualLocation.getAttributes()); + //assertEquals(expectedLocation.getAddress(), actualLocation.getAddress()); + assertEquals(expectedLocation.getName(), actualLocation.getName()); + assertEquals(expectedLocation.getIdentifiers(), actualLocation.getIdentifiers()); + if (expectedLocation.getParentLocation() != null) { + assertNotNull(actualLocation.getParentLocation()); + assertTwoDifferentTypeLocationSame(expectedLocation.getParentLocation(), actualLocation.getParentLocation()); + } + } + } diff --git a/src/test/java/org/utils/DbAccessUtils.java b/src/test/java/org/utils/DbAccessUtils.java index 17d85b258..b3cd4ae77 100644 --- a/src/test/java/org/utils/DbAccessUtils.java +++ b/src/test/java/org/utils/DbAccessUtils.java @@ -11,29 +11,28 @@ import org.springframework.jdbc.datasource.DataSourceUtils; public final class DbAccessUtils { - - private DbAccessUtils() { - - } - - public static > void addObjectToRepository(List objectList, - R repository) { - for (T object : objectList) { - repository.add(object); - } - } - - public static void truncateTable(String tableName, DataSource openSRPDataSource) { - try { - - Connection connection = DataSourceUtils.getConnection(openSRPDataSource); - Statement statement = connection.createStatement(); - statement.executeUpdate("TRUNCATE " + tableName + " CASCADE"); - connection.close(); - - } - catch (Exception e) { - e.printStackTrace(); - } - } + + private DbAccessUtils() { + + } + + public static > void addObjectToRepository(List objectList, + R repository) { + for (T object : objectList) { + repository.add(object); + } + } + + public static void truncateTable(String tableName, DataSource openSRPDataSource) { + try { + + Connection connection = DataSourceUtils.getConnection(openSRPDataSource); + Statement statement = connection.createStatement(); + statement.executeUpdate("TRUNCATE " + tableName + " CASCADE"); + connection.close(); + + } catch (Exception e) { + e.printStackTrace(); + } + } } diff --git a/src/test/java/org/utils/TestUtils.java b/src/test/java/org/utils/TestUtils.java index 5b92277e3..7a51592a8 100644 --- a/src/test/java/org/utils/TestUtils.java +++ b/src/test/java/org/utils/TestUtils.java @@ -6,7 +6,7 @@ * Created by Vincent Karuri on 30/10/2019 */ public class TestUtils { - public static String getBasePackageFilePath() { - return Paths.get(".").toAbsolutePath().normalize().toString(); - } + public static String getBasePackageFilePath() { + return Paths.get(".").toAbsolutePath().normalize().toString(); + } } diff --git a/src/test/resources/form/basic_reg/form.json b/src/test/resources/form/basic_reg/form.json index 1dcfa303d..2a22e4aff 100644 --- a/src/test/resources/form/basic_reg/form.json +++ b/src/test/resources/form/basic_reg/form.json @@ -1,653 +1,653 @@ { - "default_language": "default", - "id_string": "patient_basic_reg", - "children": [ - { - "name": "woman_name", - "label": "First name", - "instance": { - "openmrs_entity_id": "first_name", - "openmrs_entity": "person" - }, - "type": "text" - }, - { - "name": "last_name", - "label": "Last name", - "instance": { - "openmrs_entity_id": "last_name", - "openmrs_entity": "person" - }, - "type": "text" - }, - { - "name": "gender", - "default": "female", - "label": "Gender", - "instance": { - "openmrs_entity_id": "gender", - "openmrs_entity": "person" - }, - "type": "text" - }, - { - "name": "birthdate", - "label": "DOB", - "instance": { - "openmrs_entity_id": "birthdate", - "openmrs_entity": "person" - }, - "type": "date" - }, - { - "children": [ - { - "name": "karachi", - "label": "Karachi", - "instance": { - "openmrs_code": "karachi" - } - }, - { - "name": "lahore", - "label": "Lahore", - "instance": { - "openmrs_code": "lahore" - } - } - ], - "name": "location", - "bind": { - "required": "yes" - }, - "label": "Location of ANC", - "instance": { - "openmrs_entity_id": "location_id", - "openmrs_entity": "encounter" - }, - "type": "select one" - }, - { - "name": "anc_visit_date", - "bind": { - "required": "yes", - "constraint": ".<=${today}" - }, - "label": "ANC visit date?", - "instance": { - "openmrs_entity_id": "encounter_date", - "openmrs_entity": "encounter" - }, - "type": "date" - }, - { - "name": "pulse_rate", - "bind": { - "constraint": ".>0" - }, - "label": "Pulse rate", - "instance": { - "openmrs_entity_id": "5087AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "integer" - }, - { - "name": "temperature", - "bind": { - "constraint": ".>0" - }, - "label": "Temperature (C)", - "instance": { - "openmrs_entity_id": "5088AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "decimal" - }, - { - "children": [ - { - "name": "birthplace_lat", - "label": "Latitude", - "instance": { - "openmrs_entity_parent": "birthplace", - "openmrs_entity_id": "latitude", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "birthplace_lon", - "label": "Longitude", - "instance": { - "openmrs_entity_parent": "birthplace", - "openmrs_entity_id": "longitute", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "birthplace_postcode", - "label": "postalCode / postal_code", - "instance": { - "openmrs_entity_parent": "birthplace", - "openmrs_entity_id": "postalcode", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "birthplace_house", - "label": "HOUSE_NUMBER / HOUSE / HOUSE_NO / UNIT / UNIT_NUMBER / UNIT_NO", - "instance": { - "openmrs_entity_parent": "birthplace", - "openmrs_entity_id": "house_number", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "birthplace_street", - "label": "STREET / STREET_NUMBER / LANE", - "instance": { - "openmrs_entity_parent": "birthplace", - "openmrs_entity_id": "street", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "birthplace_area", - "label": "SECTOR / AREA", - "instance": { - "openmrs_entity_parent": "birthplace", - "openmrs_entity_id": "area", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "birthplace_town", - "label": "MUNICIPALITY / TOWN / LOCALITY / REGION", - "instance": { - "openmrs_entity_parent": "birthplace", - "openmrs_entity_id": "town", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "birthplace_busroute", - "label": "Bus route custom field", - "instance": { - "openmrs_entity_parent": "birthplace", - "openmrs_entity_id": "bus_route", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "birthplace_district", - "label": "COUNTY / DISTRICT", - "instance": { - "openmrs_entity_parent": "birthplace", - "openmrs_entity_id": "district", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "birthplace_city", - "label": "CITY / VILLAGE", - "instance": { - "openmrs_entity_parent": "birthplace", - "openmrs_entity_id": "city", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "birthplace_state", - "label": "state / state_province / stateProvince/ province", - "instance": { - "openmrs_entity_parent": "birthplace", - "openmrs_entity_id": "state", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "birthplace_country", - "label": "country", - "instance": { - "openmrs_entity_parent": "birthplace", - "openmrs_entity_id": "country", - "openmrs_entity": "person_address" - }, - "type": "text" - } - ], - "name": "birthplace_address", - "label": "Birthplace", - "type": "group" - }, - { - "children": [ - { - "name": "usual_residence_start", - "label": "When started (startDate / start_date)", - "instance": { - "openmrs_entity_parent": "usual_residence", - "openmrs_entity_id": "startdate", - "openmrs_entity": "person_address" - }, - "type": "date" - }, - { - "name": "usual_residence_lat", - "label": "Latitude", - "instance": { - "openmrs_entity_parent": "usual_residence", - "openmrs_entity_id": "latitude", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "usual_residence_lon", - "label": "Longitude", - "instance": { - "openmrs_entity_parent": "usual_residence", - "openmrs_entity_id": "longitute", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "usual_residence_postcode", - "label": "postalCode / postal_code", - "instance": { - "openmrs_entity_parent": "usual_residence", - "openmrs_entity_id": "postalcode", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "usual_residence_house", - "label": "HOUSE_NUMBER / HOUSE / HOUSE_NO / UNIT / UNIT_NUMBER / UNIT_NO", - "instance": { - "openmrs_entity_parent": "usual_residence", - "openmrs_entity_id": "uniit", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "usual_residence_street", - "label": "STREET / STREET_NUMBER / LANE", - "instance": { - "openmrs_entity_parent": "usual_residence", - "openmrs_entity_id": "lane", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "usual_residence_area", - "label": "SECTOR / AREA", - "instance": { - "openmrs_entity_parent": "usual_residence", - "openmrs_entity_id": "sector", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "usual_residence_town", - "label": "MUNICIPALITY / TOWN / LOCALITY / REGION", - "instance": { - "openmrs_entity_parent": "usual_residence", - "openmrs_entity_id": "municipality", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "usual_residence_district", - "label": "COUNTY / DISTRICT", - "instance": { - "openmrs_entity_parent": "usual_residence", - "openmrs_entity_id": "district", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "usual_residence_city", - "label": "CITY / VILLAGE", - "instance": { - "openmrs_entity_parent": "usual_residence", - "openmrs_entity_id": "city", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "usual_residence_state", - "label": "state / state_province / stateProvince/ province", - "instance": { - "openmrs_entity_parent": "usual_residence", - "openmrs_entity_id": "province", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "usual_residence_country", - "label": "country", - "instance": { - "openmrs_entity_parent": "usual_residence", - "openmrs_entity_id": "country", - "openmrs_entity": "person_address" - }, - "type": "text" - } - ], - "name": "usual_residence_address", - "label": "Usual Residence", - "type": "group" - }, - { - "children": [ - { - "name": "previous_residence_start", - "label": "When started (startDate / start_date)", - "instance": { - "openmrs_entity_parent": "previous_residence", - "openmrs_entity_id": "startdate", - "openmrs_entity": "person_address" - }, - "type": "date" - }, - { - "name": "previous_residence_end", - "label": "When ended (endDate/end_date)", - "instance": { - "openmrs_entity_parent": "previous_residence", - "openmrs_entity_id": "enddate", - "openmrs_entity": "person_address" - }, - "type": "date" - }, - { - "name": "previous_residence_lat", - "label": "Latitude", - "instance": { - "openmrs_entity_parent": "previous_residence", - "openmrs_entity_id": "latitude", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "previous_residence_lon", - "label": "Longitude", - "instance": { - "openmrs_entity_parent": "previous_residence", - "openmrs_entity_id": "longitute", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "previous_residence_postcode", - "label": "postalCode / postal_code", - "instance": { - "openmrs_entity_parent": "previous_residence", - "openmrs_entity_id": "postalcode", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "previous_residence_house", - "label": "HOUSE_NUMBER / HOUSE / HOUSE_NO / UNIT / UNIT_NUMBER / UNIT_NO", - "instance": { - "openmrs_entity_parent": "previous_residence", - "openmrs_entity_id": "house", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "previous_residence_street", - "label": "STREET / STREET_NUMBER / LANE", - "instance": { - "openmrs_entity_parent": "previous_residence", - "openmrs_entity_id": "street", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "previous_residence_area", - "label": "SECTOR / AREA", - "instance": { - "openmrs_entity_parent": "previous_residence", - "openmrs_entity_id": "area", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "previous_residence_town", - "label": "MUNICIPALITY / TOWN / LOCALITY / REGION", - "instance": { - "openmrs_entity_parent": "previous_residence", - "openmrs_entity_id": "region", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "previous_residence_district", - "label": "COUNTY / DISTRICT", - "instance": { - "openmrs_entity_parent": "previous_residence", - "openmrs_entity_id": "county", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "previous_residence_city", - "label": "CITY / VILLAGE", - "instance": { - "openmrs_entity_parent": "previous_residence", - "openmrs_entity_id": "village", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "previous_residence_state", - "label": "state / state_province / stateProvince/ province", - "instance": { - "openmrs_entity_parent": "previous_residence", - "openmrs_entity_id": "state", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "previous_residence_country", - "label": "country", - "instance": { - "openmrs_entity_parent": "previous_residence", - "openmrs_entity_id": "country", - "openmrs_entity": "person_address" - }, - "type": "text" - } - ], - "name": "previous_residence_address", - "label": "Previous Residence", - "type": "group" - }, - { - "children": [ - { - "name": "deathplace_lat", - "label": "Latitude", - "instance": { - "openmrs_entity_parent": "deathplace", - "openmrs_entity_id": "latitude", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "deathplace_lon", - "label": "Longitude", - "instance": { - "openmrs_entity_parent": "deathplace", - "openmrs_entity_id": "longitute", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "deathplace_postcode", - "label": "postalCode / postal_code", - "instance": { - "openmrs_entity_parent": "deathplace", - "openmrs_entity_id": "postal_code", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "deathplace_house", - "label": "HOUSE_NUMBER / HOUSE / HOUSE_NO / UNIT / UNIT_NUMBER / UNIT_NO", - "instance": { - "openmrs_entity_parent": "deathplace", - "openmrs_entity_id": "unit", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "deathplace_street", - "label": "STREET / STREET_NUMBER / LANE", - "instance": { - "openmrs_entity_parent": "deathplace", - "openmrs_entity_id": "lane", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "deathplace_area", - "label": "SECTOR / AREA", - "instance": { - "openmrs_entity_parent": "deathplace", - "openmrs_entity_id": "area", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "deathplace_town", - "label": "MUNICIPALITY / TOWN / LOCALITY / REGION", - "instance": { - "openmrs_entity_parent": "deathplace", - "openmrs_entity_id": "region", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "deathplace_district", - "label": "COUNTY / DISTRICT", - "instance": { - "openmrs_entity_parent": "deathplace", - "openmrs_entity_id": "district", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "deathplace_city", - "label": "CITY / VILLAGE", - "instance": { - "openmrs_entity_parent": "deathplace", - "openmrs_entity_id": "city", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "deathplace_state", - "label": "state / state_province / stateProvince/ province", - "instance": { - "openmrs_entity_parent": "deathplace", - "openmrs_entity_id": "state_province", - "openmrs_entity": "person_address" - }, - "type": "text" - }, - { - "name": "deathplace_country", - "label": "country", - "instance": { - "openmrs_entity_parent": "deathplace", - "openmrs_entity_id": "country", - "openmrs_entity": "person_address" - }, - "type": "text" - } - ], - "name": "deathplace_address", - "label": "Death Place", - "type": "group" - }, - { - "name": "today", - "type": "today" - }, - { - "name": "start", - "type": "start" - }, - { - "name": "end", - "type": "end" - }, - { - "control": { - "bodyless": true - }, - "children": [ - { - "name": "instanceID", - "bind": { - "readonly": "true()", - "calculate": "concat('uuid:', uuid())" - }, - "type": "calculate" - } - ], - "name": "meta", - "type": "group" + "default_language": "default", + "id_string": "patient_basic_reg", + "children": [ + { + "name": "woman_name", + "label": "First name", + "instance": { + "openmrs_entity_id": "first_name", + "openmrs_entity": "person" + }, + "type": "text" + }, + { + "name": "last_name", + "label": "Last name", + "instance": { + "openmrs_entity_id": "last_name", + "openmrs_entity": "person" + }, + "type": "text" + }, + { + "name": "gender", + "default": "female", + "label": "Gender", + "instance": { + "openmrs_entity_id": "gender", + "openmrs_entity": "person" + }, + "type": "text" + }, + { + "name": "birthdate", + "label": "DOB", + "instance": { + "openmrs_entity_id": "birthdate", + "openmrs_entity": "person" + }, + "type": "date" + }, + { + "children": [ + { + "name": "karachi", + "label": "Karachi", + "instance": { + "openmrs_code": "karachi" + } + }, + { + "name": "lahore", + "label": "Lahore", + "instance": { + "openmrs_code": "lahore" + } + } + ], + "name": "location", + "bind": { + "required": "yes" + }, + "label": "Location of ANC", + "instance": { + "openmrs_entity_id": "location_id", + "openmrs_entity": "encounter" + }, + "type": "select one" + }, + { + "name": "anc_visit_date", + "bind": { + "required": "yes", + "constraint": ".<=${today}" + }, + "label": "ANC visit date?", + "instance": { + "openmrs_entity_id": "encounter_date", + "openmrs_entity": "encounter" + }, + "type": "date" + }, + { + "name": "pulse_rate", + "bind": { + "constraint": ".>0" + }, + "label": "Pulse rate", + "instance": { + "openmrs_entity_id": "5087AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "integer" + }, + { + "name": "temperature", + "bind": { + "constraint": ".>0" + }, + "label": "Temperature (C)", + "instance": { + "openmrs_entity_id": "5088AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "decimal" + }, + { + "children": [ + { + "name": "birthplace_lat", + "label": "Latitude", + "instance": { + "openmrs_entity_parent": "birthplace", + "openmrs_entity_id": "latitude", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "birthplace_lon", + "label": "Longitude", + "instance": { + "openmrs_entity_parent": "birthplace", + "openmrs_entity_id": "longitute", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "birthplace_postcode", + "label": "postalCode / postal_code", + "instance": { + "openmrs_entity_parent": "birthplace", + "openmrs_entity_id": "postalcode", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "birthplace_house", + "label": "HOUSE_NUMBER / HOUSE / HOUSE_NO / UNIT / UNIT_NUMBER / UNIT_NO", + "instance": { + "openmrs_entity_parent": "birthplace", + "openmrs_entity_id": "house_number", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "birthplace_street", + "label": "STREET / STREET_NUMBER / LANE", + "instance": { + "openmrs_entity_parent": "birthplace", + "openmrs_entity_id": "street", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "birthplace_area", + "label": "SECTOR / AREA", + "instance": { + "openmrs_entity_parent": "birthplace", + "openmrs_entity_id": "area", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "birthplace_town", + "label": "MUNICIPALITY / TOWN / LOCALITY / REGION", + "instance": { + "openmrs_entity_parent": "birthplace", + "openmrs_entity_id": "town", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "birthplace_busroute", + "label": "Bus route custom field", + "instance": { + "openmrs_entity_parent": "birthplace", + "openmrs_entity_id": "bus_route", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "birthplace_district", + "label": "COUNTY / DISTRICT", + "instance": { + "openmrs_entity_parent": "birthplace", + "openmrs_entity_id": "district", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "birthplace_city", + "label": "CITY / VILLAGE", + "instance": { + "openmrs_entity_parent": "birthplace", + "openmrs_entity_id": "city", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "birthplace_state", + "label": "state / state_province / stateProvince/ province", + "instance": { + "openmrs_entity_parent": "birthplace", + "openmrs_entity_id": "state", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "birthplace_country", + "label": "country", + "instance": { + "openmrs_entity_parent": "birthplace", + "openmrs_entity_id": "country", + "openmrs_entity": "person_address" + }, + "type": "text" } - ], - "instance": { - "encounter_type": "patient_register" + ], + "name": "birthplace_address", + "label": "Birthplace", + "type": "group" }, - "version": "201504030905", - "type": "survey", - "name": "register_with_address", - "sms_keyword": "patient_basic_reg", - "title": "Patient Registration" + { + "children": [ + { + "name": "usual_residence_start", + "label": "When started (startDate / start_date)", + "instance": { + "openmrs_entity_parent": "usual_residence", + "openmrs_entity_id": "startdate", + "openmrs_entity": "person_address" + }, + "type": "date" + }, + { + "name": "usual_residence_lat", + "label": "Latitude", + "instance": { + "openmrs_entity_parent": "usual_residence", + "openmrs_entity_id": "latitude", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "usual_residence_lon", + "label": "Longitude", + "instance": { + "openmrs_entity_parent": "usual_residence", + "openmrs_entity_id": "longitute", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "usual_residence_postcode", + "label": "postalCode / postal_code", + "instance": { + "openmrs_entity_parent": "usual_residence", + "openmrs_entity_id": "postalcode", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "usual_residence_house", + "label": "HOUSE_NUMBER / HOUSE / HOUSE_NO / UNIT / UNIT_NUMBER / UNIT_NO", + "instance": { + "openmrs_entity_parent": "usual_residence", + "openmrs_entity_id": "uniit", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "usual_residence_street", + "label": "STREET / STREET_NUMBER / LANE", + "instance": { + "openmrs_entity_parent": "usual_residence", + "openmrs_entity_id": "lane", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "usual_residence_area", + "label": "SECTOR / AREA", + "instance": { + "openmrs_entity_parent": "usual_residence", + "openmrs_entity_id": "sector", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "usual_residence_town", + "label": "MUNICIPALITY / TOWN / LOCALITY / REGION", + "instance": { + "openmrs_entity_parent": "usual_residence", + "openmrs_entity_id": "municipality", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "usual_residence_district", + "label": "COUNTY / DISTRICT", + "instance": { + "openmrs_entity_parent": "usual_residence", + "openmrs_entity_id": "district", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "usual_residence_city", + "label": "CITY / VILLAGE", + "instance": { + "openmrs_entity_parent": "usual_residence", + "openmrs_entity_id": "city", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "usual_residence_state", + "label": "state / state_province / stateProvince/ province", + "instance": { + "openmrs_entity_parent": "usual_residence", + "openmrs_entity_id": "province", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "usual_residence_country", + "label": "country", + "instance": { + "openmrs_entity_parent": "usual_residence", + "openmrs_entity_id": "country", + "openmrs_entity": "person_address" + }, + "type": "text" + } + ], + "name": "usual_residence_address", + "label": "Usual Residence", + "type": "group" + }, + { + "children": [ + { + "name": "previous_residence_start", + "label": "When started (startDate / start_date)", + "instance": { + "openmrs_entity_parent": "previous_residence", + "openmrs_entity_id": "startdate", + "openmrs_entity": "person_address" + }, + "type": "date" + }, + { + "name": "previous_residence_end", + "label": "When ended (endDate/end_date)", + "instance": { + "openmrs_entity_parent": "previous_residence", + "openmrs_entity_id": "enddate", + "openmrs_entity": "person_address" + }, + "type": "date" + }, + { + "name": "previous_residence_lat", + "label": "Latitude", + "instance": { + "openmrs_entity_parent": "previous_residence", + "openmrs_entity_id": "latitude", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "previous_residence_lon", + "label": "Longitude", + "instance": { + "openmrs_entity_parent": "previous_residence", + "openmrs_entity_id": "longitute", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "previous_residence_postcode", + "label": "postalCode / postal_code", + "instance": { + "openmrs_entity_parent": "previous_residence", + "openmrs_entity_id": "postalcode", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "previous_residence_house", + "label": "HOUSE_NUMBER / HOUSE / HOUSE_NO / UNIT / UNIT_NUMBER / UNIT_NO", + "instance": { + "openmrs_entity_parent": "previous_residence", + "openmrs_entity_id": "house", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "previous_residence_street", + "label": "STREET / STREET_NUMBER / LANE", + "instance": { + "openmrs_entity_parent": "previous_residence", + "openmrs_entity_id": "street", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "previous_residence_area", + "label": "SECTOR / AREA", + "instance": { + "openmrs_entity_parent": "previous_residence", + "openmrs_entity_id": "area", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "previous_residence_town", + "label": "MUNICIPALITY / TOWN / LOCALITY / REGION", + "instance": { + "openmrs_entity_parent": "previous_residence", + "openmrs_entity_id": "region", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "previous_residence_district", + "label": "COUNTY / DISTRICT", + "instance": { + "openmrs_entity_parent": "previous_residence", + "openmrs_entity_id": "county", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "previous_residence_city", + "label": "CITY / VILLAGE", + "instance": { + "openmrs_entity_parent": "previous_residence", + "openmrs_entity_id": "village", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "previous_residence_state", + "label": "state / state_province / stateProvince/ province", + "instance": { + "openmrs_entity_parent": "previous_residence", + "openmrs_entity_id": "state", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "previous_residence_country", + "label": "country", + "instance": { + "openmrs_entity_parent": "previous_residence", + "openmrs_entity_id": "country", + "openmrs_entity": "person_address" + }, + "type": "text" + } + ], + "name": "previous_residence_address", + "label": "Previous Residence", + "type": "group" + }, + { + "children": [ + { + "name": "deathplace_lat", + "label": "Latitude", + "instance": { + "openmrs_entity_parent": "deathplace", + "openmrs_entity_id": "latitude", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "deathplace_lon", + "label": "Longitude", + "instance": { + "openmrs_entity_parent": "deathplace", + "openmrs_entity_id": "longitute", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "deathplace_postcode", + "label": "postalCode / postal_code", + "instance": { + "openmrs_entity_parent": "deathplace", + "openmrs_entity_id": "postal_code", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "deathplace_house", + "label": "HOUSE_NUMBER / HOUSE / HOUSE_NO / UNIT / UNIT_NUMBER / UNIT_NO", + "instance": { + "openmrs_entity_parent": "deathplace", + "openmrs_entity_id": "unit", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "deathplace_street", + "label": "STREET / STREET_NUMBER / LANE", + "instance": { + "openmrs_entity_parent": "deathplace", + "openmrs_entity_id": "lane", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "deathplace_area", + "label": "SECTOR / AREA", + "instance": { + "openmrs_entity_parent": "deathplace", + "openmrs_entity_id": "area", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "deathplace_town", + "label": "MUNICIPALITY / TOWN / LOCALITY / REGION", + "instance": { + "openmrs_entity_parent": "deathplace", + "openmrs_entity_id": "region", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "deathplace_district", + "label": "COUNTY / DISTRICT", + "instance": { + "openmrs_entity_parent": "deathplace", + "openmrs_entity_id": "district", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "deathplace_city", + "label": "CITY / VILLAGE", + "instance": { + "openmrs_entity_parent": "deathplace", + "openmrs_entity_id": "city", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "deathplace_state", + "label": "state / state_province / stateProvince/ province", + "instance": { + "openmrs_entity_parent": "deathplace", + "openmrs_entity_id": "state_province", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "deathplace_country", + "label": "country", + "instance": { + "openmrs_entity_parent": "deathplace", + "openmrs_entity_id": "country", + "openmrs_entity": "person_address" + }, + "type": "text" + } + ], + "name": "deathplace_address", + "label": "Death Place", + "type": "group" + }, + { + "name": "today", + "type": "today" + }, + { + "name": "start", + "type": "start" + }, + { + "name": "end", + "type": "end" + }, + { + "control": { + "bodyless": true + }, + "children": [ + { + "name": "instanceID", + "bind": { + "readonly": "true()", + "calculate": "concat('uuid:', uuid())" + }, + "type": "calculate" + } + ], + "name": "meta", + "type": "group" + } + ], + "instance": { + "encounter_type": "patient_register" + }, + "version": "201504030905", + "type": "survey", + "name": "register_with_address", + "sms_keyword": "patient_basic_reg", + "title": "Patient Registration" } \ No newline at end of file diff --git a/src/test/resources/form/basic_reg/form.xml b/src/test/resources/form/basic_reg/form.xml index 8926f192e..4840271b2 100644 --- a/src/test/resources/form/basic_reg/form.xml +++ b/src/test/resources/form/basic_reg/form.xml @@ -26,11 +26,15 @@
@@ -39,7 +43,8 @@

@@ -63,15 +69,19 @@

@@ -109,51 +123,64 @@ @@ -163,55 +190,69 @@ @@ -229,15 +270,19 @@ \ No newline at end of file diff --git a/src/test/resources/form/basic_reg/form_definition.json b/src/test/resources/form/basic_reg/form_definition.json index c6be057f9..5f507ce37 100644 --- a/src/test/resources/form/basic_reg/form_definition.json +++ b/src/test/resources/form/basic_reg/form_definition.json @@ -1,245 +1,245 @@ { - "form_data_definition_version": "1", - "form": { - "bind_type": "register_with_address", - "default_bind_path": "/model/instance/register_with_address/", - "fields": [ - { - "name": "woman_name", - "bind": "/model/instance/register_with_address/woman_name" - }, - { - "name": "last_name", - "bind": "/model/instance/register_with_address/last_name" - }, - { - "name": "gender", - "bind": "/model/instance/register_with_address/gender" - }, - { - "name": "birthdate", - "bind": "/model/instance/register_with_address/birthdate" - }, - { - "name": "location", - "bind": "/model/instance/register_with_address/location" - }, - { - "name": "anc_visit_date", - "bind": "/model/instance/register_with_address/anc_visit_date" - }, - { - "name": "pulse_rate", - "bind": "/model/instance/register_with_address/pulse_rate" - }, - { - "name": "temperature", - "bind": "/model/instance/register_with_address/temperature" - }, - { - "name": "birthplace_lat", - "bind": "/model/instance/register_with_address/birthplace_address/birthplace_lat" - }, - { - "name": "birthplace_lon", - "bind": "/model/instance/register_with_address/birthplace_address/birthplace_lon" - }, - { - "name": "birthplace_postcode", - "bind": "/model/instance/register_with_address/birthplace_address/birthplace_postcode" - }, - { - "name": "birthplace_house", - "bind": "/model/instance/register_with_address/birthplace_address/birthplace_house" - }, - { - "name": "birthplace_street", - "bind": "/model/instance/register_with_address/birthplace_address/birthplace_street" - }, - { - "name": "birthplace_area", - "bind": "/model/instance/register_with_address/birthplace_address/birthplace_area" - }, - { - "name": "birthplace_town", - "bind": "/model/instance/register_with_address/birthplace_address/birthplace_town" - }, - { - "name": "birthplace_busroute", - "bind": "/model/instance/register_with_address/birthplace_address/birthplace_busroute" - }, - { - "name": "birthplace_district", - "bind": "/model/instance/register_with_address/birthplace_address/birthplace_district" - }, - { - "name": "birthplace_city", - "bind": "/model/instance/register_with_address/birthplace_address/birthplace_city" - }, - { - "name": "birthplace_state", - "bind": "/model/instance/register_with_address/birthplace_address/birthplace_state" - }, - { - "name": "birthplace_country", - "bind": "/model/instance/register_with_address/birthplace_address/birthplace_country" - }, - { - "name": "usual_residence_start", - "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_start" - }, - { - "name": "usual_residence_lat", - "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_lat" - }, - { - "name": "usual_residence_lon", - "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_lon" - }, - { - "name": "usual_residence_postcode", - "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_postcode" - }, - { - "name": "usual_residence_house", - "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_house" - }, - { - "name": "usual_residence_street", - "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_street" - }, - { - "name": "usual_residence_area", - "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_area" - }, - { - "name": "usual_residence_town", - "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_town" - }, - { - "name": "usual_residence_district", - "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_district" - }, - { - "name": "usual_residence_city", - "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_city" - }, - { - "name": "usual_residence_state", - "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_state" - }, - { - "name": "usual_residence_country", - "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_country" - }, - { - "name": "previous_residence_start", - "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_start" - }, - { - "name": "previous_residence_end", - "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_end" - }, - { - "name": "previous_residence_lat", - "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_lat" - }, - { - "name": "previous_residence_lon", - "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_lon" - }, - { - "name": "previous_residence_postcode", - "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_postcode" - }, - { - "name": "previous_residence_house", - "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_house" - }, - { - "name": "previous_residence_street", - "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_street" - }, - { - "name": "previous_residence_area", - "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_area" - }, - { - "name": "previous_residence_town", - "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_town" - }, - { - "name": "previous_residence_district", - "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_district" - }, - { - "name": "previous_residence_city", - "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_city" - }, - { - "name": "previous_residence_state", - "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_state" - }, - { - "name": "previous_residence_country", - "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_country" - }, - { - "name": "deathplace_lat", - "bind": "/model/instance/register_with_address/deathplace_address/deathplace_lat" - }, - { - "name": "deathplace_lon", - "bind": "/model/instance/register_with_address/deathplace_address/deathplace_lon" - }, - { - "name": "deathplace_postcode", - "bind": "/model/instance/register_with_address/deathplace_address/deathplace_postcode" - }, - { - "name": "deathplace_house", - "bind": "/model/instance/register_with_address/deathplace_address/deathplace_house" - }, - { - "name": "deathplace_street", - "bind": "/model/instance/register_with_address/deathplace_address/deathplace_street" - }, - { - "name": "deathplace_area", - "bind": "/model/instance/register_with_address/deathplace_address/deathplace_area" - }, - { - "name": "deathplace_town", - "bind": "/model/instance/register_with_address/deathplace_address/deathplace_town" - }, - { - "name": "deathplace_district", - "bind": "/model/instance/register_with_address/deathplace_address/deathplace_district" - }, - { - "name": "deathplace_city", - "bind": "/model/instance/register_with_address/deathplace_address/deathplace_city" - }, - { - "name": "deathplace_state", - "bind": "/model/instance/register_with_address/deathplace_address/deathplace_state" - }, - { - "name": "deathplace_country", - "bind": "/model/instance/register_with_address/deathplace_address/deathplace_country" - }, - { - "name": "today", - "bind": "/model/instance/register_with_address/today" - }, - { - "name": "start", - "bind": "/model/instance/register_with_address/start" - }, - { - "name": "end", - "bind": "/model/instance/register_with_address/end" - } - ] - } + "form_data_definition_version": "1", + "form": { + "bind_type": "register_with_address", + "default_bind_path": "/model/instance/register_with_address/", + "fields": [ + { + "name": "woman_name", + "bind": "/model/instance/register_with_address/woman_name" + }, + { + "name": "last_name", + "bind": "/model/instance/register_with_address/last_name" + }, + { + "name": "gender", + "bind": "/model/instance/register_with_address/gender" + }, + { + "name": "birthdate", + "bind": "/model/instance/register_with_address/birthdate" + }, + { + "name": "location", + "bind": "/model/instance/register_with_address/location" + }, + { + "name": "anc_visit_date", + "bind": "/model/instance/register_with_address/anc_visit_date" + }, + { + "name": "pulse_rate", + "bind": "/model/instance/register_with_address/pulse_rate" + }, + { + "name": "temperature", + "bind": "/model/instance/register_with_address/temperature" + }, + { + "name": "birthplace_lat", + "bind": "/model/instance/register_with_address/birthplace_address/birthplace_lat" + }, + { + "name": "birthplace_lon", + "bind": "/model/instance/register_with_address/birthplace_address/birthplace_lon" + }, + { + "name": "birthplace_postcode", + "bind": "/model/instance/register_with_address/birthplace_address/birthplace_postcode" + }, + { + "name": "birthplace_house", + "bind": "/model/instance/register_with_address/birthplace_address/birthplace_house" + }, + { + "name": "birthplace_street", + "bind": "/model/instance/register_with_address/birthplace_address/birthplace_street" + }, + { + "name": "birthplace_area", + "bind": "/model/instance/register_with_address/birthplace_address/birthplace_area" + }, + { + "name": "birthplace_town", + "bind": "/model/instance/register_with_address/birthplace_address/birthplace_town" + }, + { + "name": "birthplace_busroute", + "bind": "/model/instance/register_with_address/birthplace_address/birthplace_busroute" + }, + { + "name": "birthplace_district", + "bind": "/model/instance/register_with_address/birthplace_address/birthplace_district" + }, + { + "name": "birthplace_city", + "bind": "/model/instance/register_with_address/birthplace_address/birthplace_city" + }, + { + "name": "birthplace_state", + "bind": "/model/instance/register_with_address/birthplace_address/birthplace_state" + }, + { + "name": "birthplace_country", + "bind": "/model/instance/register_with_address/birthplace_address/birthplace_country" + }, + { + "name": "usual_residence_start", + "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_start" + }, + { + "name": "usual_residence_lat", + "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_lat" + }, + { + "name": "usual_residence_lon", + "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_lon" + }, + { + "name": "usual_residence_postcode", + "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_postcode" + }, + { + "name": "usual_residence_house", + "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_house" + }, + { + "name": "usual_residence_street", + "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_street" + }, + { + "name": "usual_residence_area", + "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_area" + }, + { + "name": "usual_residence_town", + "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_town" + }, + { + "name": "usual_residence_district", + "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_district" + }, + { + "name": "usual_residence_city", + "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_city" + }, + { + "name": "usual_residence_state", + "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_state" + }, + { + "name": "usual_residence_country", + "bind": "/model/instance/register_with_address/usual_residence_address/usual_residence_country" + }, + { + "name": "previous_residence_start", + "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_start" + }, + { + "name": "previous_residence_end", + "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_end" + }, + { + "name": "previous_residence_lat", + "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_lat" + }, + { + "name": "previous_residence_lon", + "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_lon" + }, + { + "name": "previous_residence_postcode", + "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_postcode" + }, + { + "name": "previous_residence_house", + "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_house" + }, + { + "name": "previous_residence_street", + "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_street" + }, + { + "name": "previous_residence_area", + "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_area" + }, + { + "name": "previous_residence_town", + "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_town" + }, + { + "name": "previous_residence_district", + "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_district" + }, + { + "name": "previous_residence_city", + "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_city" + }, + { + "name": "previous_residence_state", + "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_state" + }, + { + "name": "previous_residence_country", + "bind": "/model/instance/register_with_address/previous_residence_address/previous_residence_country" + }, + { + "name": "deathplace_lat", + "bind": "/model/instance/register_with_address/deathplace_address/deathplace_lat" + }, + { + "name": "deathplace_lon", + "bind": "/model/instance/register_with_address/deathplace_address/deathplace_lon" + }, + { + "name": "deathplace_postcode", + "bind": "/model/instance/register_with_address/deathplace_address/deathplace_postcode" + }, + { + "name": "deathplace_house", + "bind": "/model/instance/register_with_address/deathplace_address/deathplace_house" + }, + { + "name": "deathplace_street", + "bind": "/model/instance/register_with_address/deathplace_address/deathplace_street" + }, + { + "name": "deathplace_area", + "bind": "/model/instance/register_with_address/deathplace_address/deathplace_area" + }, + { + "name": "deathplace_town", + "bind": "/model/instance/register_with_address/deathplace_address/deathplace_town" + }, + { + "name": "deathplace_district", + "bind": "/model/instance/register_with_address/deathplace_address/deathplace_district" + }, + { + "name": "deathplace_city", + "bind": "/model/instance/register_with_address/deathplace_address/deathplace_city" + }, + { + "name": "deathplace_state", + "bind": "/model/instance/register_with_address/deathplace_address/deathplace_state" + }, + { + "name": "deathplace_country", + "bind": "/model/instance/register_with_address/deathplace_address/deathplace_country" + }, + { + "name": "today", + "bind": "/model/instance/register_with_address/today" + }, + { + "name": "start", + "bind": "/model/instance/register_with_address/start" + }, + { + "name": "end", + "bind": "/model/instance/register_with_address/end" + } + ] + } } \ No newline at end of file diff --git a/src/test/resources/form/basic_reg/form_submission.json b/src/test/resources/form/basic_reg/form_submission.json index 84c463821..1c4376a1a 100644 --- a/src/test/resources/form/basic_reg/form_submission.json +++ b/src/test/resources/form/basic_reg/form_submission.json @@ -1,254 +1,254 @@ { - "anmId": "admin", - "instanceId": "88ceee24-10b4-44c2-9429-754b8d823776", - "clientVersion": "1426830449320", - "entityId": "b716d938-1aea-40ae-a081-9ddddddcccc9", - "formDataDefinitionVersion": "1", - "formName": "basic_reg", - "formInstance": { - "form_data_definition_version": "1", - "form": { - "bind_type": "register_with_address", - "default_bind_path": "/model/instance/register_with_address/", - "fields": [ - { - "name": "woman_name", - "value": "test woman_name" - }, - { - "name": "last_name", - "value": "test last_name" - }, - { - "name": "gender", - "value": "FEMALE" - }, - { - "name": "birthdate", - "value": "2015-02-01" - }, - { - "name": "location", - "value": "unknown location" - }, - { - "name": "anc_visit_date", - "value": "2015-02-01" - }, - { - "name": "pulse_rate", - "value": "55" - }, - { - "name": "temperature", - "value": "37" - }, - { - "name": "birthplace_lat", - "value": "test birthplace_lat" - }, - { - "name": "birthplace_lon", - "value": "test birthplace_lon" - }, - { - "name": "birthplace_postcode", - "value": "test birthplace_postcode" - }, - { - "name": "birthplace_house", - "value": "test birthplace_house" - }, - { - "name": "birthplace_street", - "value": "test birthplace_street" - }, - { - "name": "birthplace_area", - "value": "test birthplace_area" - }, - { - "name": "birthplace_town", - "value": "test birthplace_town" - }, - { - "name": "birthplace_busroute", - "value": "test birthplace_busroute" - }, - { - "name": "birthplace_district", - "value": "test birthplace_district" - }, - { - "name": "birthplace_city", - "value": "test birthplace_city" - }, - { - "name": "birthplace_state", - "value": "test birthplace_state" - }, - { - "name": "birthplace_country", - "value": "test birthplace_country" - }, - { - "name": "usual_residence_start", - "value": "2015-02-01" - }, - { - "name": "usual_residence_lat", - "value": "test usual_residence_lat" - }, - { - "name": "usual_residence_lon", - "value": "test usual_residence_lon" - }, - { - "name": "usual_residence_postcode", - "value": "test usual_residence_postcode" - }, - { - "name": "usual_residence_house", - "value": "test usual_residence_house" - }, - { - "name": "usual_residence_street", - "value": "test usual_residence_street" - }, - { - "name": "usual_residence_area", - "value": "test usual_residence_area" - }, - { - "name": "usual_residence_town", - "value": "test usual_residence_town" - }, - { - "name": "usual_residence_district", - "value": "test usual_residence_district" - }, - { - "name": "usual_residence_city", - "value": "test usual_residence_city" - }, - { - "name": "usual_residence_state", - "value": "test usual_residence_state" - }, - { - "name": "usual_residence_country", - "value": "test usual_residence_country" - }, - { - "name": "previous_residence_start", - "value": "2015-02-01" - }, - { - "name": "previous_residence_end", - "value": "2015-02-01" - }, - { - "name": "previous_residence_lat", - "value": "test previous_residence_lat" - }, - { - "name": "previous_residence_lon", - "value": "test previous_residence_lon" - }, - { - "name": "previous_residence_postcode", - "value": "test previous_residence_postcode" - }, - { - "name": "previous_residence_house", - "value": "test previous_residence_house" - }, - { - "name": "previous_residence_street", - "value": "test previous_residence_street" - }, - { - "name": "previous_residence_area", - "value": "test previous_residence_area" - }, - { - "name": "previous_residence_town", - "value": "test previous_residence_town" - }, - { - "name": "previous_residence_district", - "value": "test previous_residence_district" - }, - { - "name": "previous_residence_city", - "value": "test previous_residence_city" - }, - { - "name": "previous_residence_state", - "value": "test previous_residence_state" - }, - { - "name": "previous_residence_country", - "value": "test previous_residence_country" - }, - { - "name": "deathplace_lat", - "value": "test deathplace_lat" - }, - { - "name": "deathplace_lon", - "value": "test deathplace_lon" - }, - { - "name": "deathplace_postcode", - "value": "test deathplace_postcode" - }, - { - "name": "deathplace_house", - "value": "test deathplace_house" - }, - { - "name": "deathplace_street", - "value": "test deathplace_street" - }, - { - "name": "deathplace_area", - "value": "test deathplace_area" - }, - { - "name": "deathplace_town", - "value": "test deathplace_town" - }, - { - "name": "deathplace_district", - "value": "test deathplace_district" - }, - { - "name": "deathplace_city", - "value": "test deathplace_city" - }, - { - "name": "deathplace_state", - "value": "test deathplace_state" - }, - { - "name": "deathplace_country", - "value": "test deathplace_country" - }, - { - "name": "today", - "value": "2015-02-01" - }, - { - "name": "start", - "value": "2015-02-01" - }, - { - "name": "end", - "value": "2015-02-01" - } - ] + "anmId": "admin", + "instanceId": "88ceee24-10b4-44c2-9429-754b8d823776", + "clientVersion": "1426830449320", + "entityId": "b716d938-1aea-40ae-a081-9ddddddcccc9", + "formDataDefinitionVersion": "1", + "formName": "basic_reg", + "formInstance": { + "form_data_definition_version": "1", + "form": { + "bind_type": "register_with_address", + "default_bind_path": "/model/instance/register_with_address/", + "fields": [ + { + "name": "woman_name", + "value": "test woman_name" + }, + { + "name": "last_name", + "value": "test last_name" + }, + { + "name": "gender", + "value": "FEMALE" + }, + { + "name": "birthdate", + "value": "2015-02-01" + }, + { + "name": "location", + "value": "unknown location" + }, + { + "name": "anc_visit_date", + "value": "2015-02-01" + }, + { + "name": "pulse_rate", + "value": "55" + }, + { + "name": "temperature", + "value": "37" + }, + { + "name": "birthplace_lat", + "value": "test birthplace_lat" + }, + { + "name": "birthplace_lon", + "value": "test birthplace_lon" + }, + { + "name": "birthplace_postcode", + "value": "test birthplace_postcode" + }, + { + "name": "birthplace_house", + "value": "test birthplace_house" + }, + { + "name": "birthplace_street", + "value": "test birthplace_street" + }, + { + "name": "birthplace_area", + "value": "test birthplace_area" + }, + { + "name": "birthplace_town", + "value": "test birthplace_town" + }, + { + "name": "birthplace_busroute", + "value": "test birthplace_busroute" + }, + { + "name": "birthplace_district", + "value": "test birthplace_district" + }, + { + "name": "birthplace_city", + "value": "test birthplace_city" + }, + { + "name": "birthplace_state", + "value": "test birthplace_state" + }, + { + "name": "birthplace_country", + "value": "test birthplace_country" + }, + { + "name": "usual_residence_start", + "value": "2015-02-01" + }, + { + "name": "usual_residence_lat", + "value": "test usual_residence_lat" + }, + { + "name": "usual_residence_lon", + "value": "test usual_residence_lon" + }, + { + "name": "usual_residence_postcode", + "value": "test usual_residence_postcode" + }, + { + "name": "usual_residence_house", + "value": "test usual_residence_house" + }, + { + "name": "usual_residence_street", + "value": "test usual_residence_street" + }, + { + "name": "usual_residence_area", + "value": "test usual_residence_area" + }, + { + "name": "usual_residence_town", + "value": "test usual_residence_town" + }, + { + "name": "usual_residence_district", + "value": "test usual_residence_district" + }, + { + "name": "usual_residence_city", + "value": "test usual_residence_city" + }, + { + "name": "usual_residence_state", + "value": "test usual_residence_state" + }, + { + "name": "usual_residence_country", + "value": "test usual_residence_country" + }, + { + "name": "previous_residence_start", + "value": "2015-02-01" + }, + { + "name": "previous_residence_end", + "value": "2015-02-01" + }, + { + "name": "previous_residence_lat", + "value": "test previous_residence_lat" + }, + { + "name": "previous_residence_lon", + "value": "test previous_residence_lon" + }, + { + "name": "previous_residence_postcode", + "value": "test previous_residence_postcode" + }, + { + "name": "previous_residence_house", + "value": "test previous_residence_house" + }, + { + "name": "previous_residence_street", + "value": "test previous_residence_street" + }, + { + "name": "previous_residence_area", + "value": "test previous_residence_area" + }, + { + "name": "previous_residence_town", + "value": "test previous_residence_town" + }, + { + "name": "previous_residence_district", + "value": "test previous_residence_district" + }, + { + "name": "previous_residence_city", + "value": "test previous_residence_city" + }, + { + "name": "previous_residence_state", + "value": "test previous_residence_state" + }, + { + "name": "previous_residence_country", + "value": "test previous_residence_country" + }, + { + "name": "deathplace_lat", + "value": "test deathplace_lat" + }, + { + "name": "deathplace_lon", + "value": "test deathplace_lon" + }, + { + "name": "deathplace_postcode", + "value": "test deathplace_postcode" + }, + { + "name": "deathplace_house", + "value": "test deathplace_house" + }, + { + "name": "deathplace_street", + "value": "test deathplace_street" + }, + { + "name": "deathplace_area", + "value": "test deathplace_area" + }, + { + "name": "deathplace_town", + "value": "test deathplace_town" + }, + { + "name": "deathplace_district", + "value": "test deathplace_district" + }, + { + "name": "deathplace_city", + "value": "test deathplace_city" + }, + { + "name": "deathplace_state", + "value": "test deathplace_state" + }, + { + "name": "deathplace_country", + "value": "test deathplace_country" + }, + { + "name": "today", + "value": "2015-02-01" + }, + { + "name": "start", + "value": "2015-02-01" + }, + { + "name": "end", + "value": "2015-02-01" } - }, - "serverVersion": 1430998001293 + ] + } + }, + "serverVersion": 1430998001293 } \ No newline at end of file diff --git a/src/test/resources/form/basic_reg/model.xml b/src/test/resources/form/basic_reg/model.xml index 06822afad..d47542028 100644 --- a/src/test/resources/form/basic_reg/model.xml +++ b/src/test/resources/form/basic_reg/model.xml @@ -13,60 +13,108 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/src/test/resources/form/child_enrollment/form.json b/src/test/resources/form/child_enrollment/form.json index 98878c7e0..0dabada06 100644 --- a/src/test/resources/form/child_enrollment/form.json +++ b/src/test/resources/form/child_enrollment/form.json @@ -1 +1,4547 @@ -{"name":"Child_Vaccination_Enrollment","title":"بچّوں کا انرولمنٹ رجسٹر برائے ٹیکاجات - Child Enrollment Vaccination Register","sms_keyword":"child_vaccination_enrollment","default_language":"English","choices":{"provinces":[{"name":"kpk","label":{"Urdu":"خیبر پختون خواہ","English":"Khyber Pakhtunkhwa","Roman Urdu":"Khyber Pakhtunkhwa"}},{"name":"sindh","label":{"Urdu":"سندھ","English":"Sindh","Roman Urdu":"Sindh"}},{"name":"balochistan","label":{"Urdu":"بلوچستان","English":"Balochistan","Roman Urdu":"Balochistan"}},{"name":"punjab","label":{"Urdu":"پنجاب","English":"Punjab","Roman Urdu":"Punjab"}},{"name":"gilgit_baltistan","label":{"Urdu":"گلگت بلتستان","English":"Gilgit Baltistan","Roman Urdu":"Gilgit Baltistan"}},{"name":"kashmir","label":{"Urdu":"کشمیر","English":"Kashmir","Roman Urdu":"Kashmir"}},{"name":"fata","label":{"Urdu":"فاٹا","English":"FATA","Roman Urdu":"FATA"}},{"name":"out_of_country","label":{"Urdu":"ملک سے باہر","English":"Out of Country","Roman Urdu":"Mulk se baahir"}}],"ucs":[{"province":"sindh","city":"karachi","town":"korangi","name":"bilal_colony","label":{"Urdu":"بلال کالونی","Roman Urdu":"Bilal Colony","English":"Bilal Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"nasir_colony","label":{"Urdu":"ناصر کالونی","Roman Urdu":"Nasir Colony","English":"Nasir Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"chakra_goth","label":{"Urdu":"چکرا گوٹھ","Roman Urdu":"Chakra Goth","English":"Chakra Goth"}},{"province":"sindh","city":"karachi","town":"korangi","name":"mustafa_taj_colony","label":{"Urdu":"مصطفی تاج کالونی","Roman Urdu":"Mustafa Taj Colony","English":"Mustafa Taj Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"hundred_quarters","label":{"Urdu":"ہنڈریڈ کوارٹر","Roman Urdu":"Hundred Quarters","English":"Hundred Quarters"}},{"province":"sindh","city":"karachi","town":"korangi","name":"gulzar_colony","label":{"Urdu":"گلزار کالونی","Roman Urdu":"Gulzar Colony","English":"Gulzar Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"korangi_sector_33","label":{"Urdu":"کورنگی سیکٹر 33","Roman Urdu":"Korangi Sector 33","English":"Korangi Sector 33"}},{"province":"sindh","city":"karachi","town":"korangi","name":"zaman_town","label":{"Urdu":"زمان ٹاوَن","Roman Urdu":"Zaman Town","English":"Zaman Town"}},{"province":"sindh","city":"karachi","town":"korangi","name":"hasrat_mohani_colony","label":{"Urdu":"حسرت موہانی کالونی","Roman Urdu":"Hasrat Mohani Colony","English":"Hasrat Mohani Colony"}},{"province":"sindh","city":"karachi","town":"baldia","name":"gulshan_e_ghazi","label":{"Urdu":"گلشن غازی","Roman Urdu":"Gulshan-e-Ghazi","English":"Gulshan-e-Ghazi"}},{"province":"sindh","city":"karachi","town":"baldia","name":"ittehad_town","label":{"Urdu":"اتحاد ٹاوَن","Roman Urdu":"Ittehad Town","English":"Ittehad Town"}},{"province":"sindh","city":"karachi","town":"baldia","name":"islam_nagar","label":{"Urdu":"اسلام نگر","Roman Urdu":"Islam Nagar","English":"Islam Nagar"}},{"province":"sindh","city":"karachi","town":"baldia","name":"nai_abadi","label":{"Urdu":"نئی آبادی","Roman Urdu":"Nai Abadi","English":"Nai Abadi"}},{"province":"sindh","city":"karachi","town":"baldia","name":"saeedabad","label":{"Urdu":"سعید آباد","Roman Urdu":"Saeedabad","English":"Saeedabad"}},{"province":"sindh","city":"karachi","town":"baldia","name":"muslim_mujahid_colony","label":{"Urdu":"مسلم مجاہد کالونی","Roman Urdu":"Muslim Mujahid Colony","English":"Muslim Mujahid Colony"}},{"province":"sindh","city":"karachi","town":"baldia","name":"muhajir_camp","label":{"Urdu":"مہاجر کیمپ","Roman Urdu":"Muhajir Camp","English":"Muhajir Camp"}},{"province":"sindh","city":"karachi","town":"baldia","name":"rasheedabad","label":{"Urdu":"رشید آباد","Roman Urdu":"Rasheedabad","English":"Rasheedabad"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"ibrahim_hyderi","label":{"Urdu":"ابراہیم حیدری","Roman Urdu":"Ibrahim Hyderi","English":"Ibrahim Hyderi"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"rehri","label":{"Urdu":"رہڑی","Roman Urdu":"Rehri","English":"Rehri"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"cattle_colony","label":{"Urdu":"کیٹل کالونی","Roman Urdu":"Cattle Colony","English":"Cattle Colony"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"qaidabad","label":{"Urdu":"قائدآباد","Roman Urdu":"Qaidabad","English":"Qaidabad"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"landhi_colony","label":{"Urdu":"لانڈھی کالونی","Roman Urdu":"Landhi Colony","English":"Landhi Colony"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"gulshan_e_hadeed","label":{"Urdu":"گلشن حدید","Roman Urdu":"Gulshan-e-Hadeed","English":"Gulshan-e-Hadeed"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"gaghar","label":{"Urdu":"گگر","Roman Urdu":"Gaghar","English":"Gaghar"}},{"province":"sindh","city":"karachi","town":"gadap","name":"murad_memon_goth","label":{"Urdu":"مراد میمن گوٹھ","Roman Urdu":"Murad Memon Goth","English":"Murad Memon Goth"}},{"province":"sindh","city":"karachi","town":"gadap","name":"darsano_chana","label":{"Urdu":"درشانو شنو","Roman Urdu":"Darsano Chana","English":"Darsano Chana"}},{"province":"sindh","city":"karachi","town":"gadap","name":"gujro","label":{"Urdu":"گجرو","Roman Urdu":"Gujro","English":"Gujro"}},{"province":"sindh","city":"karachi","town":"gadap","name":"songal","label":{"Urdu":"سنگل","Roman Urdu":"Songal","English":"Songal"}},{"province":"sindh","city":"karachi","town":"gadap","name":"maymarabad","label":{"Urdu":"معمار آباد","Roman Urdu":"Maymarabad","English":"Maymarabad"}},{"province":"sindh","city":"karachi","town":"gadap","name":"yousuf_goth","label":{"Urdu":"یوسف گوٹھ","Roman Urdu":"Yousuf Goth","English":"Yousuf Goth"}},{"province":"sindh","city":"karachi","town":"gadap","name":"manghopir","label":{"Urdu":"منگھوپیر","Roman Urdu":"Manghopir","English":"Manghopir"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"azizabad","label":{"Urdu":"عزیز آباد","Roman Urdu":"Azizabad","English":"Azizabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"karimabad","label":{"Urdu":"کریم آباد","Roman Urdu":"Karimabad","English":"Karimabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"aisha_manzil","label":{"Urdu":"عائشہ منزل","Roman Urdu":"Aisha Manzil","English":"Aisha Manzil"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"ancholi","label":{"Urdu":"انچولی","Roman Urdu":"Ancholi","English":"Ancholi"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"naseerabad","label":{"Urdu":"نصیرآباد","Roman Urdu":"Naseerabad","English":"Naseerabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"yaseenabad","label":{"Urdu":"یاسین آباد","Roman Urdu":"Yaseenabad","English":"Yaseenabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"water_pump","label":{"Urdu":"واٹرپمپ","Roman Urdu":"Water Pump","English":"Water Pump"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"shafiq_mill_colony","label":{"Urdu":"شفیق مل کالونی","Roman Urdu":"Shafiq Mill Colony","English":"Shafiq Mill Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"delhi_mercantile_society","label":{"Urdu":"دہلی مرچنٹائل سوسائٹی","Roman Urdu":"Delhi Mercantile Society","English":"Delhi Mercantile Society"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"civic_centre","label":{"Urdu":"سوک سینٹر","Roman Urdu":"Civic Centre","English":"Civic Centre"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"pir_ilahi_buksh_colony","label":{"Urdu":"پیر الہی بخش کالونی","Roman Urdu":"Pir Ilahi Buksh Colony","English":"Pir Ilahi Buksh Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"essa_nagri","label":{"Urdu":"عیسی نگری","Roman Urdu":"Essa Nagri","English":"Essa Nagri"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulshan_e_iqbal","label":{"Urdu":"گلشن اقبال","Roman Urdu":"Gulshan-e-Iqbal","English":"Gulshan-e-Iqbal"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gillani_railway_station","label":{"Urdu":"گیلانی ریلوے اسٹیشن","Roman Urdu":"Gillani Railway Station","English":"Gillani Railway Station"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"shanti_nagar","label":{"Urdu":"شانتی نگر","Roman Urdu":"Shanti Nagar","English":"Shanti Nagar"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"jamali_colony","label":{"Urdu":"جمالی کالونی","Roman Urdu":"Jamali Colony","English":"Jamali Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulshan_e_iqbal_ii","label":{"Urdu":"گلشن اقبال 2","Roman Urdu":"Gulshan-e-Iqbal II","English":"Gulshan-e-Iqbal II"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"pehlwan_goth","label":{"Urdu":"پہلوان گوٹھ","Roman Urdu":"Pehlwan Goth","English":"Pehlwan Goth"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"matrovil_colony","label":{"Urdu":"میٹروویل کالونی","Roman Urdu":"Matrovil Colony","English":"Matrovil Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulzar_e_hijri","label":{"Urdu":"گلزار ہجری","Roman Urdu":"Gulzar-e-Hijri","English":"Gulzar-e-Hijri"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"safooran_goth","label":{"Urdu":"صفورا گوٹھ","Roman Urdu":"Safooran Goth","English":"Safooran Goth"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"akhtar_colony","label":{"Urdu":"اختر کالونی","Roman Urdu":"Akhtar Colony","English":"Akhtar Colony"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"manzoor_colony","label":{"Urdu":"منظور کالونی","Roman Urdu":"Manzoor Colony","English":"Manzoor Colony"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"azam_basti","label":{"Urdu":"اعظم بستی","Roman Urdu":"Azam Basti","English":"Azam Basti"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"chanesar_goth","label":{"Urdu":"چنیسر گوٹھ","Roman Urdu":"Chanesar Goth","English":"Chanesar Goth"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"mahmudabad","label":{"Urdu":"محمودآباد","Roman Urdu":"Mahmudabad","English":"Mahmudabad"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pechs","label":{"Urdu":"پی۔ای۔سی۔ایچ۔ایس","Roman Urdu":"P.E.C.H.S.","English":"P.E.C.H.S."}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pechs_ii","label":{"Urdu":"پی۔ای۔سی۔ایچ۔ایس 2","Roman Urdu":"P.E.C.H.S. II","English":"P.E.C.H.S. II"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"jut_line","label":{"Urdu":"جٹ لائن","Roman Urdu":"Jut Line","English":"Jut Line"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"central_jacob_lines","label":{"Urdu":"سینٹرل جیکب لائن","Roman Urdu":"Central Jacob Lines","English":"Central Jacob Lines"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"jamshed_quarters","label":{"Urdu":"جمشید کوارٹر","Roman Urdu":"Jamshed Quarters","English":"Jamshed Quarters"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"garden_east","label":{"Urdu":"گارڈن ایسٹ","Roman Urdu":"Garden East","English":"Garden East"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"soldier_bazar","label":{"Urdu":"سولجر بازار","Roman Urdu":"Soldier Bazar","English":"Soldier Bazar"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pakistan_quarters","label":{"Urdu":"پاکستان کوارٹر","Roman Urdu":"Pakistan Quarters","English":"Pakistan Quarters"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"bhutta_village","label":{"Urdu":"بھٹا ولیج","Roman Urdu":"Bhutta Village","English":"Bhutta Village"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"sultanabad","label":{"Urdu":"سلطان آباد","Roman Urdu":"Sultanabad","English":"Sultanabad"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"kiamari_uc","label":{"Urdu":"کیماری یو- سی","Roman Urdu":"Kiamari UC","English":"Kiamari UC"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"baba_bhit","label":{"Urdu":"بابا بھٹ","Roman Urdu":"Baba Bhit","English":"Baba Bhit"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"machar_colony","label":{"Urdu":"مچھر کالونی","Roman Urdu":"Machar Colony","English":"Machar Colony"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"maripur","label":{"Urdu":"ماڑی پور","Roman Urdu":"Maripur","English":"Maripur"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"shershah","label":{"Urdu":"شیرشاہ","Roman Urdu":"SherShah","English":"SherShah"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"gabo_pat","label":{"Urdu":"گابو پٹ","Roman Urdu":"Gabo Pat","English":"Gabo Pat"}},{"province":"sindh","city":"karachi","town":"landhi","name":"muzafarabad","label":{"Urdu":"مظفرآباد","Roman Urdu":"Muzafarabad","English":"Muzafarabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"muslimabad","label":{"Urdu":"مسلم آباد","Roman Urdu":"Muslimabad","English":"Muslimabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"dawood_chowrangi","label":{"Urdu":"داوَد چورنگی","Roman Urdu":"Dawood Chowrangi","English":"Dawood Chowrangi"}},{"province":"sindh","city":"karachi","town":"landhi","name":"moinabad","label":{"Urdu":"معین آباد","Roman Urdu":"Moinabad","English":"Moinabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"sharafi_goth","label":{"Urdu":"شرافی گوٹھ","Roman Urdu":"Sharafi Goth","English":"Sharafi Goth"}},{"province":"sindh","city":"karachi","town":"landhi","name":"bhutto_nagar","label":{"Urdu":"بھٹو نگر","Roman Urdu":"Bhutto Nagar","English":"Bhutto Nagar"}},{"province":"sindh","city":"karachi","town":"landhi","name":"khawaja_ajmeer_colony","label":{"Urdu":"خواجہ اجمیر کالونی","Roman Urdu":"Khawaja Ajmeer Colony","English":"Khawaja Ajmeer Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"landhi_uc","label":{"Urdu":"لانڈھی یوسی","Roman Urdu":"Landhi UC","English":"Landhi UC"}},{"province":"sindh","city":"karachi","town":"landhi","name":"awami_colony","label":{"Urdu":"عوامی کالونی","Roman Urdu":"Awami Colony","English":"Awami Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"burmee_colony","label":{"Urdu":"برمی کالونی","Roman Urdu":"Burmee Colony","English":"Burmee Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"korangi_uc","label":{"Urdu":"کورنگی یوسی","Roman Urdu":"Korangi UC","English":"Korangi UC"}},{"province":"sindh","city":"karachi","town":"landhi","name":"sherabad","label":{"Urdu":"شیرآباد","Roman Urdu":"Sherabad","English":"Sherabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"rizvia_society","label":{"Urdu":"رضویہ سوسائٹی","Roman Urdu":"Rizvia Society","English":"Rizvia Society"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"firdous_colony","label":{"Urdu":"فردوس کالونی","Roman Urdu":"Firdous Colony","English":"Firdous Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"super_market","label":{"Urdu":"سپر مارکیٹ","Roman Urdu":"Super Market","English":"Super Market"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"dak_khana","label":{"Urdu":"دک کھانہ","Roman Urdu":"Dak Khana","English":"Dak Khana"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"qasimabad","label":{"Urdu":"قاسم آباد","Roman Urdu":"Qasimabad","English":"Qasimabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"bandhani_colony","label":{"Urdu":"بندھانی کالونی","Roman Urdu":"Bandhani Colony","English":"Bandhani Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"sharifabad","label":{"Urdu":"شریف آباد","Roman Urdu":"Sharifabad","English":"Sharifabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"commercial_area","label":{"Urdu":"کمرشل ایریا","Roman Urdu":"Commercial Area","English":"Commercial Area"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"mujahid_colony","label":{"Urdu":"مجاہد کالونی","Roman Urdu":"Mujahid Colony","English":"Mujahid Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"nazimabad","label":{"Urdu":"ناظم آباد","Roman Urdu":"Nazimabad","English":"Nazimabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"abbasi_shaheed","label":{"Urdu":"عباسی شہید","Roman Urdu":"Abbasi Shaheed","English":"Abbasi Shaheed"}},{"province":"sindh","city":"karachi","town":"lyari","name":"agra_taj_colony","label":{"Urdu":"آگرہ تاج کالونی","Roman Urdu":"Agra Taj Colony","English":"Agra Taj Colony"}},{"province":"sindh","city":"karachi","town":"lyari","name":"daryaabad","label":{"Urdu":"دریاآباد","Roman Urdu":"Daryaabad","English":"Daryaabad"}},{"province":"sindh","city":"karachi","town":"lyari","name":"nawabad","label":{"Urdu":"نواآباد","Roman Urdu":"Nawabad","English":"Nawabad"}},{"province":"sindh","city":"karachi","town":"lyari","name":"khada_memon_society","label":{"Urdu":"خدا- میمن- سوساَٹی","Roman Urdu":"Khada Memon Society","English":"Khada Memon Society"}},{"province":"sindh","city":"karachi","town":"lyari","name":"baghdadi","label":{"Urdu":"بغدادی","Roman Urdu":"Baghdadi","English":"Baghdadi"}},{"province":"sindh","city":"karachi","town":"lyari","name":"shah_baig_line","label":{"Urdu":"شاھ باغ لائن","Roman Urdu":"Shah Baig Line","English":"Shah Baig Line"}},{"province":"sindh","city":"karachi","town":"lyari","name":"bihar_colony","label":{"Urdu":"بہار کالونی","Roman Urdu":"Bihar Colony","English":"Bihar Colony"}},{"province":"sindh","city":"karachi","town":"lyari","name":"ragiwara","label":{"Urdu":"راگی واڑا","Roman Urdu":"Ragiwara","English":"Ragiwara"}},{"province":"sindh","city":"karachi","town":"lyari","name":"singo_line","label":{"Urdu":"سنگولائن","Roman Urdu":"Singo Line","English":"Singo Line"}},{"province":"sindh","city":"karachi","town":"lyari","name":"chakiwara","label":{"Urdu":"چاکی واڑا","Roman Urdu":"Chakiwara","English":"Chakiwara"}},{"province":"sindh","city":"karachi","town":"lyari","name":"allama_iqbal_colony","label":{"Urdu":"علامہ اقبال کالونی","Roman Urdu":"Allama Iqbal Colony","English":"Allama Iqbal Colony"}},{"province":"sindh","city":"karachi","town":"malir","name":"model_colony","label":{"Urdu":"موڈل کالونی","Roman Urdu":"Model Colony","English":"Model Colony"}},{"province":"sindh","city":"karachi","town":"malir","name":"kala_board","label":{"Urdu":"کالا بورڈ","Roman Urdu":"Kala Board","English":"Kala Board"}},{"province":"sindh","city":"karachi","town":"malir","name":"saudabad","label":{"Urdu":"سعودآباد","Roman Urdu":"Saudabad","English":"Saudabad"}},{"province":"sindh","city":"karachi","town":"malir","name":"khokhra_par","label":{"Urdu":"کھوکھرا پار","Roman Urdu":"Khokhra Par","English":"Khokhra Par"}},{"province":"sindh","city":"karachi","town":"malir","name":"jafar_e_tayyar","label":{"Urdu":"جعفر تیار","Roman Urdu":"Jafar-e-Tayyar","English":"Jafar-e-Tayyar"}},{"province":"sindh","city":"karachi","town":"malir","name":"gharibabad","label":{"Urdu":"غریب آباد","Roman Urdu":"Gharibabad","English":"Gharibabad"}},{"province":"sindh","city":"karachi","town":"malir","name":"ghazi_brohi_goth","label":{"Urdu":"غازی بروہی گوٹھ","Roman Urdu":"Ghazi Brohi Goth","English":"Ghazi Brohi Goth"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"kalyana","label":{"Urdu":"کالیانہ","Roman Urdu":"Kalyana","English":"Kalyana"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"sir_syed_colony","label":{"Urdu":"سر سید کالونی","Roman Urdu":"Sir Syed Colony","English":"Sir Syed Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"fatima_jinnah_colony","label":{"Urdu":"فاطمہ جناح کالونی","Roman Urdu":"Fatima Jinnah Colony","English":"Fatima Jinnah Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"godhra","label":{"Urdu":"گودھرا","Roman Urdu":"Godhra","English":"Godhra"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"abu_zar_ghaffari","label":{"Urdu":"ابو زر غفاری","Roman Urdu":"Abu Zar Ghaffari","English":"Abu Zar Ghaffari"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"hakim_ahsan","label":{"Urdu":"حاکم احسان","Roman Urdu":"Hakim Ahsan","English":"Hakim Ahsan"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"madina_colony","label":{"Urdu":"مدینہ کالونی","Roman Urdu":"Madina Colony","English":"Madina Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"faisal_colony","label":{"Urdu":"فیصل کالونی","Roman Urdu":"Faisal Colony","English":"Faisal Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"khamiso_goth","label":{"Urdu":"خمیسو گوٹھ","Roman Urdu":"Khamiso Goth","English":"Khamiso Goth"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"mustufa_colony","label":{"Urdu":"مصطفی کالونی","Roman Urdu":"Mustufa Colony","English":"Mustufa Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"khawaja_ajmeer_nagri","label":{"Urdu":"خواجہ اجمیر نگری","Roman Urdu":"Khawaja Ajmeer Nagri","English":"Khawaja Ajmeer Nagri"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"gulshan_e_saeed","label":{"Urdu":"گلشن سعید","Roman Urdu":"Gulshan-e-Saeed","English":"Gulshan-e-Saeed"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"shah_nawaz_bhutto_colony","label":{"Urdu":"شاہ نواز بھٹو کالونی","Roman Urdu":"Shah Nawaz Bhutto Colony","English":"Shah Nawaz Bhutto Colony"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"paposh_nagar","label":{"Urdu":"پاپوش نگر","Roman Urdu":"Paposh Nagar","English":"Paposh Nagar"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"pahar_ganj","label":{"Urdu":"پہاڑ گنج","Roman Urdu":"Pahar Ganj","English":"Pahar Ganj"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"khandu_goth","label":{"Urdu":"کھنڑو گوٹھ","Roman Urdu":"Khandu Goth","English":"Khandu Goth"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"hyderi","label":{"Urdu":"حیدری","Roman Urdu":"Hyderi","English":"Hyderi"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"sakhi_hassan","label":{"Urdu":"سخی حسن","Roman Urdu":"Sakhi Hassan","English":"Sakhi Hassan"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"farooq_e_azam","label":{"Urdu":"فاروق اعظم","Roman Urdu":"Farooq-e-Azam","English":"Farooq-e-Azam"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"nusrat_bhutto_colony","label":{"Urdu":"نصرت بھٹو کالونی","Roman Urdu":"Nusrat Bhutto Colony","English":"Nusrat Bhutto Colony"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"shadman_town","label":{"Urdu":"شادمان ٹاوَن","Roman Urdu":"Shadman Town","English":"Shadman Town"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"buffer_zone","label":{"Urdu":"بفرزون","Roman Urdu":"Buffer Zone","English":"Buffer Zone"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"buffer_zone_ii","label":{"Urdu":"بفرزون 2","Roman Urdu":"Buffer Zone II","English":"Buffer Zone II"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mominabad","label":{"Urdu":"مومن آباد","Roman Urdu":"Mominabad","English":"Mominabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"haryana_colony","label":{"Urdu":"حریانہ کالونی","Roman Urdu":"Haryana Colony","English":"Haryana Colony"}},{"province":"sindh","city":"karachi","town":"orangi","name":"hanifabad","label":{"Urdu":"حنیف آباد","Roman Urdu":"Hanifabad","English":"Hanifabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mohammad_nagar","label":{"Urdu":"محمد نگر","Roman Urdu":"Mohammad Nagar","English":"Mohammad Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"madina_colony_orangi","label":{"Urdu":"مدینہ کالونی اورنگی","Roman Urdu":"Madina Colony Orangi","English":"Madina Colony Orangi"}},{"province":"sindh","city":"karachi","town":"orangi","name":"ghaziabad","label":{"Urdu":"غازی آباد","Roman Urdu":"Ghaziabad","English":"Ghaziabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"chisti_nagar","label":{"Urdu":"چشتی نگر","Roman Urdu":"Chisti Nagar","English":"Chisti Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"bilal_colony_orangi","label":{"Urdu":"بلال کالونی اورنگی","Roman Urdu":"Bilal Colony Orangi","English":"Bilal Colony Orangi"}},{"province":"sindh","city":"karachi","town":"orangi","name":"iqbal_baloch_colony","label":{"Urdu":"اقبال بلوچ کالونی","Roman Urdu":"Iqbal Baloch Colony","English":"Iqbal Baloch Colony"}},{"province":"sindh","city":"karachi","town":"orangi","name":"ghabool_town","label":{"Urdu":"گبول ٹاوَن","Roman Urdu":"Ghabool Town","English":"Ghabool Town"}},{"province":"sindh","city":"karachi","town":"orangi","name":"data_nagar","label":{"Urdu":"داتا نگر","Roman Urdu":"Data Nagar","English":"Data Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mujahidabad","label":{"Urdu":"مجاہد آباد","Roman Urdu":"Mujahidabad","English":"Mujahidabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"baloch_goth","label":{"Urdu":"بلوچ گوٹھ","Roman Urdu":"Baloch Goth","English":"Baloch Goth"}},{"province":"sindh","city":"karachi","town":"saddar","name":"old_haji_camp","label":{"Urdu":"پرانہ حاجی کیمپ","Roman Urdu":"Old Haji Camp","English":"Old Haji Camp"}},{"province":"sindh","city":"karachi","town":"saddar","name":"garden","label":{"Urdu":"گارڈن","Roman Urdu":"Garden","English":"Garden"}},{"province":"sindh","city":"karachi","town":"saddar","name":"kharadar","label":{"Urdu":"کھارادر","Roman Urdu":"Kharadar","English":"Kharadar"}},{"province":"sindh","city":"karachi","town":"saddar","name":"city_railway_colony","label":{"Urdu":"سٹی ریلوے کالونی","Roman Urdu":"City Railway Colony","English":"City Railway Colony"}},{"province":"sindh","city":"karachi","town":"saddar","name":"nanak_wara","label":{"Urdu":"ناناک واڑا","Roman Urdu":"Nanak Wara","English":"Nanak Wara"}},{"province":"sindh","city":"karachi","town":"saddar","name":"gazdarabad","label":{"Urdu":"گزدرآباد","Roman Urdu":"Gazdarabad","English":"Gazdarabad"}},{"province":"sindh","city":"karachi","town":"saddar","name":"millat_nagar_islam_pura","label":{"Urdu":"ملت نگر اسلام پورا","Roman Urdu":"Millat Nagar/Islam Pura","English":"Millat Nagar/Islam Pura"}},{"province":"sindh","city":"karachi","town":"saddar","name":"saddar_uc","label":{"Urdu":"صدر یو سی","Roman Urdu":"Saddar UC","English":"Saddar UC"}},{"province":"sindh","city":"karachi","town":"saddar","name":"civil_line","label":{"Urdu":"سول لائن","Roman Urdu":"Civil Line","English":"Civil Line"}},{"province":"sindh","city":"karachi","town":"saddar","name":"clifton","label":{"Urdu":"کلفٹن","Roman Urdu":"Clifton","English":"Clifton"}},{"province":"sindh","city":"karachi","town":"saddar","name":"kehkashan","label":{"Urdu":"کہکشان","Roman Urdu":"Kehkashan","English":"Kehkashan"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"natha_khan_goth","label":{"Urdu":"ناتھا خان گوٹھ","Roman Urdu":"Natha Khan Goth","English":"Natha Khan Goth"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"pak_sadat_colony","label":{"Urdu":"پاک صدر کالونی","Roman Urdu":"Pak Sadat Colony","English":"Pak Sadat Colony"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"drigh_colony","label":{"Urdu":"ڈرگ کالونی","Roman Urdu":"Drigh Colony","English":"Drigh Colony"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"raita_plot","label":{"Urdu":"رائتا پلاٹ","Roman Urdu":"Raita Plot","English":"Raita Plot"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"moria_khan_goth","label":{"Urdu":"موریا خان گوٹھ","Roman Urdu":"Moria Khan Goth","English":"Moria Khan Goth"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"rafa_e_aam_society","label":{"Urdu":"رفا عام سوسا ئٹی","Roman Urdu":"Rafa-e-Aam Society","English":"Rafa-e-Aam Society"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"al_falah_society","label":{"Urdu":"الفلاح سوسا ئٹی","Roman Urdu":"Al-Falah Society","English":"Al-Falah Society"}},{"province":"sindh","city":"karachi","town":"site","name":"pak_colony","label":{"Urdu":"پاک کالونی","Roman Urdu":"Pak Colony","English":"Pak Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"old_golimar","label":{"Urdu":"پرانہ گولی مار","Roman Urdu":"Old Golimar","English":"Old Golimar"}},{"province":"sindh","city":"karachi","town":"site","name":"jahanabad","label":{"Urdu":"جہان آباد","Roman Urdu":"Jahanabad","English":"Jahanabad"}},{"province":"sindh","city":"karachi","town":"site","name":"metrovil","label":{"Urdu":"میٹروویل","Roman Urdu":"Metrovil","English":"Metrovil"}},{"province":"sindh","city":"karachi","town":"site","name":"bhawani_chali","label":{"Urdu":"بہوانی چالی","Roman Urdu":"Bhawani Chali","English":"Bhawani Chali"}},{"province":"sindh","city":"karachi","town":"site","name":"frontier_colony","label":{"Urdu":"فرونٹر کالونی","Roman Urdu":"Frontier Colony","English":"Frontier Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"banaras_colony","label":{"Urdu":"بنارس کالونی","Roman Urdu":"Banaras Colony","English":"Banaras Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"qasba_colony","label":{"Urdu":"قصبہ کالونی","Roman Urdu":"Qasba Colony","English":"Qasba Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"islamia_colony","label":{"Urdu":"اسلامیہ کالونی","Roman Urdu":"Islamia Colony","English":"Islamia Colony"}},{"province":"na","city":"na","town":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","city":"na","town":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Qaabil-e-atlaaq nahi","English":"Not Applicable"}}],"gender":[{"instance":{"openmrs_code":"1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"male","label":{"Urdu":"مرد/ لڑکا","Roman Urdu":"Mard/larka","English":"Male"}},{"instance":{"openmrs_code":"1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"female","label":{"Urdu":"عورت/لڑکی","Roman Urdu":"Aurat/larki","English":"Female"}},{"instance":{"openmrs_code":"163163AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"transgender","label":{"Urdu":"خواجہ سرہ","Roman Urdu":"Khwaja sira","English":"Transgender"}}],"vaccines":[{"instance":{"openmrs_code":"1570AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"bcg","label":{"Urdu":"بی سی جی","Roman Urdu":"BCG","English":"BCG"}},{"instance":{"openmrs_code":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv0","label":{"Urdu":"او پی وی 0","Roman Urdu":"OPV 0","English":"OPV 0"}},{"instance":{"openmrs_code":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pcv1","label":{"Urdu":"پی سی وی 1","Roman Urdu":"PCV 1","English":"PCV 1"}},{"instance":{"openmrs_code":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv1","label":{"Urdu":"او پی وی 1","Roman Urdu":"OPV 1","English":"OPV 1"}},{"instance":{"openmrs_code":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"penta1","label":{"Urdu":"پینٹا ویلنٹ 1","Roman Urdu":"Pentavalent 1","English":"Pentavalent 1"}},{"instance":{"openmrs_code":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pcv2","label":{"Urdu":"پی سی وی 2","Roman Urdu":"PCV 2","English":"PCV 2"}},{"instance":{"openmrs_code":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv2","label":{"Urdu":"او پی وی 2","Roman Urdu":"OPV 2","English":"OPV 2"}},{"instance":{"openmrs_code":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"penta2","label":{"Urdu":"پینٹا ویلنٹ 2","Roman Urdu":"Pentavalent 2","English":"Pentavalent 2"}},{"instance":{"openmrs_code":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pcv3","label":{"Urdu":"پی سی وی 3","Roman Urdu":"PCV 3","English":"PCV 3"}},{"instance":{"openmrs_code":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv3","label":{"Urdu":"او پی وی 3","Roman Urdu":"OPV 3","English":"OPV 3"}},{"instance":{"openmrs_code":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"penta3","label":{"Urdu":"پینٹا ویلنٹ 3","Roman Urdu":"Pentavalent 3","English":"Pentavalent 3"}},{"instance":{"openmrs_code":"82242AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ipv","label":{"Urdu":"آئی پی وی","Roman Urdu":"IPV","English":"IPV"}},{"instance":{"openmrs_code":"79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"measles1","label":{"Urdu":"خسرہ 1","Roman Urdu":"Khasra 1","English":"Measles 1"}},{"instance":{"openmrs_code":"79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"measles2","label":{"Urdu":"خسرہ 2","Roman Urdu":"Khasra 2","English":"Measles 2"}}],"towns":[{"province":"sindh","city":"karachi","name":"korangi","label":{"Urdu":"کورنگی","Roman Urdu":"Korangi","English":"Korangi"}},{"province":"sindh","city":"karachi","name":"landhi","label":{"Urdu":"لانڈھی","Roman Urdu":"Landhi","English":"Landhi"}},{"province":"sindh","city":"karachi","name":"baldia","label":{"Urdu":"بلدیہ","Roman Urdu":"Baldia","English":"Baldia"}},{"province":"sindh","city":"karachi","name":"bin_qasim","label":{"Urdu":"بن قاسم","Roman Urdu":"Bin Qasim","English":"Bin Qasim"}},{"province":"sindh","city":"karachi","name":"gadap","label":{"Urdu":"گڈاپ","Roman Urdu":"Gadap","English":"Gadap"}},{"province":"sindh","city":"karachi","name":"gulberg","label":{"Urdu":"گلبرگ","Roman Urdu":"Gulberg","English":"Gulberg"}},{"province":"sindh","city":"karachi","name":"gulshan","label":{"Urdu":"گلشن","Roman Urdu":"Gulshan","English":"Gulshan"}},{"province":"sindh","city":"karachi","name":"jamshed","label":{"Urdu":"جمشید","Roman Urdu":"Jamshed","English":"Jamshed"}},{"province":"sindh","city":"karachi","name":"kiamari","label":{"Urdu":"کیماری","Roman Urdu":"Kiamari","English":"Kiamari"}},{"province":"sindh","city":"karachi","name":"liaquatabad","label":{"Urdu":"لیاقت آباد","Roman Urdu":"Liaquatabad","English":"Liaquatabad"}},{"province":"sindh","city":"karachi","name":"lyari","label":{"Urdu":"لیاری","Roman Urdu":"Lyari","English":"Lyari"}},{"province":"sindh","city":"karachi","name":"malir","label":{"Urdu":"ملیر","Roman Urdu":"Malir","English":"Malir"}},{"province":"sindh","city":"karachi","name":"new_karachi","label":{"Urdu":"نیو کراچی","Roman Urdu":"New Karachi","English":"New Karachi"}},{"province":"sindh","city":"karachi","name":"north_nazimabad","label":{"Urdu":"نارتھ ناظم آباد","Roman Urdu":"North Nazimabad","English":"North Nazimabad"}},{"province":"sindh","city":"karachi","name":"orangi","label":{"Urdu":"اورنگی","Roman Urdu":"Orangi","English":"Orangi"}},{"province":"sindh","city":"karachi","name":"saddar","label":{"Urdu":"صدر","Roman Urdu":"Saddar","English":"Saddar"}},{"province":"sindh","city":"karachi","name":"shah_faisal","label":{"Urdu":"شاہ فیصل","Roman Urdu":"Shah Faisal","English":"Shah Faisal"}},{"province":"sindh","city":"karachi","name":"site","label":{"Urdu":"سائٹ","Roman Urdu":"S.I.T.E.","English":"S.I.T.E."}},{"province":"na","city":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","city":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Qaabil-e-atlaaq nahi","English":"Not Applicable"}}],"cities":[{"province":"sindh","name":"karachi","label":{"Urdu":"کراچی","Roman Urdu":"Karachi","English":"Karachi"}},{"province":"punjab","name":"hafizabad","label":{"Urdu":"حافظ آباد","Roman Urdu":"Hafizabad","English":"Hafizabad"}},{"province":"punjab","name":"muzaffargarh","label":{"Urdu":"مظفر گڑھ","Roman Urdu":"Muzaffargarh","English":"Muzaffargarh"}},{"province":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Not Applicable","English":"Not Applicable"}}],"ethnicity":[{"instance":{"openmrs_code":"163215AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"punjabi","label":{"Urdu":"پنجابی","Roman Urdu":"Punjabi","English":"Punjabi"}},{"instance":{"openmrs_code":"163216AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pushtuns","label":{"Urdu":"پشتون","Roman Urdu":"Pushtun","English":"Pushtun"}},{"instance":{"openmrs_code":"163217AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"sindhi","label":{"Urdu":"سندھی","Roman Urdu":"Sindhi","English":"Sindhi"}},{"instance":{"openmrs_code":"163218AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"saraiki","label":{"Urdu":"سرائیکی","Roman Urdu":"Saraiki","English":"Saraiki"}},{"instance":{"openmrs_code":"163219AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"muhajir","label":{"Urdu":"مہاجر","Roman Urdu":"Muhajir","English":"Muhajir"}},{"instance":{"openmrs_code":"163220AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"balochi","label":{"Urdu":"بلوچی","Roman Urdu":"Balochi","English":"Balochi"}},{"instance":{"openmrs_code":"5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}}],"yes_no":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}]},"instance":{"encounter_type":"Child Vaccination Enrollment"},"version":"201604080617","id_string":"child_vaccination_enrollment","type":"survey","children":[{"type":"hidden","name":"provider_uc"},{"type":"hidden","name":"provider_town"},{"type":"hidden","name":"provider_city"},{"type":"hidden","name":"provider_province"},{"type":"hidden","name":"provider_id"},{"instance":{"openmrs_entity_id":"location_id","openmrs_entity":"encounter"},"type":"hidden","name":"provider_location_id"},{"instance":{"openmrs_entity_id":"Program Client ID","openmrs_entity":"person_identifier"},"type":"hidden","name":"existing_program_client_id"},{"type":"hidden","name":"provider_location_name"},{"type":"note","name":"provider_location_note","label":{"Urdu":"شہر: ${provider_city} ; ٹائون: ${provider_town} ; یوسی: ${provider_uc} ; سینٹرکا نام: ${provider_location_name}","English":"City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}","Roman Urdu":"Shehr: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center ka naam: ${provider_location_name}"}},{"instance":{"openmrs_entity_id":"163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"start","name":"start"},{"instance":{"openmrs_entity_id":"163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"end","name":"end"},{"instance":{"openmrs_entity_id":"163286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"today","name":"today"},{"instance":{"openmrs_entity_id":"163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"deviceid","name":"deviceid"},{"instance":{"openmrs_entity_id":"163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"subscriberid","name":"subscriberid"},{"instance":{"openmrs_entity_id":"163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"simserial","name":"simserial"},{"instance":{"openmrs_entity_id":"163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"phonenumber","name":"phonenumber"},{"name":"client_reg_date","hint":{"Urdu":"بچے کو ویکسین لگنے کی تاریخ","English":"Date on which child was vaccinated","Roman Urdu":"Bachay ko vaccine lagnay ki tareekh"},"bind":{"jr:constraintMsg":{"Urdu":"بچے کی پروگرام میں اندراج کی تاریخ مستقبل کی نہیں ہوسکتی","English":"Child registration date cannot be in the future","Roman Urdu":"Bachay ki program mai andraaj ki tareekh mustaqbil ki nahi hosakti"},"required":"yes","constraint":".<=${today}"},"label":{"Urdu":"بچے کی پروگرام میں اندراج کی تاریخ","English":"Child Registration date","Roman Urdu":"Bachay ki Program mai andraj ki tareekh"},"instance":{"openmrs_entity_id":"encounter_date","openmrs_entity":"encounter"},"type":"date"},{"bind":{"required":"yes"},"type":"note","name":"program_client_id","label":{"Urdu":"کلائنٹ کی پروگرام آئی ڈی {existing_program_client_id}$","Roman Urdu":"Client ki program ID ${existing_program_client_id}","English":"Program Client ID ${existing_program_client_id}"}},{"bind":{"jr:constraintMsg":{"Urdu":"نمبر آٹھ ہندسوں پر مشتمل ہونا چاہئے","English":"Number should be 8 digits","Roman Urdu":"Number 8 hindason par mushtamil hona chahiye"},"required":"yes","constraint":"string-length(.) = 8"},"type":"integer","instance":{"openmrs_entity_id":"EPI Card Number","openmrs_entity":"person_attribute"},"name":"epi_card_number","label":{"Urdu":"کارڈ نمبر","English":"EPI Card Number","Roman Urdu":"EPI Card Number"}},{"bind":{"jr:constraintMsg":{"Urdu":"نام تین سے پچیس حروف پر مشتمل ہونا چاہئے","English":"Name should be 3 to 25 characters long","Roman Urdu":"Naam 3 say 25 huroof par mushtamil hona chahiye"},"required":"yes","constraint":"regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')"},"type":"text","instance":{"openmrs_entity_id":"first_name","openmrs_entity":"person"},"name":"first_name","label":{"Urdu":"نام","English":"First Name","Roman Urdu":"Naam"}},{"bind":{"jr:constraintMsg":{"Urdu":"نام تین سے پچیس حروف پر مشتمل ہونا چاہئے","English":"Name should be 3 to 25 characters long","Roman Urdu":"Naam 3 say 25 huroof par mushtamil hona chahiye"},"required":"yes","constraint":"regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')"},"type":"text","instance":{"openmrs_entity_id":"last_name","openmrs_entity":"person"},"name":"last_name","label":{"Urdu":"والد کا نام","English":"Last name","Roman Urdu":"Waalid ka naam"}},{"default":"yes","label":{"Urdu":"کیا تاریخ پیدائش معلوم ہے؟","Roman Urdu":"Kya tareekh-e-pedaaish maloom hai?","English":"Is birthdate known?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}],"name":"member_birth_date_known"},{"bind":{"jr:constraintMsg":{"Urdu":"یہ تاریخ مستقبل کی نہیں ہو سکتی۔\nاندراج کے لیے بچے کی عمر پانچ سال سے کم ہونی چاہئے۔","Roman Urdu":"Ye tareekh mustaqbil ki nahi ho sakti.\nAndraaj ke liye bachay ki umar paanch saal se kam honi chahiye.","English":"This cannot be a date in the future.\nChild's age must be less than five years for enrollment."},"relevant":"selected(${member_birth_date_known}, 'yes')","constraint":".<=${today} and (int((${today} - ${member_birth_date}) div 365) < 5)"},"type":"date","name":"member_birth_date","label":{"Urdu":"تاریخ پیدائش","Roman Urdu":"Tareekh-e-pedaaish","English":"Birth date"}},{"bind":{"jr:constraintMsg":{"Urdu":"اندراج کے لیے بچے کی عمر پانچ سال سے کم ہونی چاہئے","Roman Urdu":"Andraaj ke liye bachay ki umar paanch saal se kam honi chahiye","English":"Child's age must be less than five years for enrollment"},"relevant":"selected(${member_birth_date_known}, 'no')","constraint":".<=60"},"type":"integer","name":"age","label":{"Urdu":"عمر (مہینوں میں)","Roman Urdu":"Umar (mahinon main)","English":"Age (months)"}},{"bind":{"calculate":"int((${today} - ${member_birth_date}) div 30.44)"},"type":"calculate","name":"calc_age"},{"bind":{"calculate":"date(${today} - int(${age} * 30.44))"},"type":"calculate","name":"calc_dob"},{"bind":{"calculate":"if(${member_birth_date_known}='yes', ${member_birth_date}, ${calc_dob})"},"type":"calculate","name":"calc_dob_confirm","instance":{"openmrs_entity_id":"birthdate","openmrs_entity":"person"}},{"bind":{"calculate":"if(${member_birth_date_known} = 'yes', '0', '1')"},"type":"calculate","name":"calc_dob_estimated","instance":{"openmrs_entity_id":"birthdate_estimated","openmrs_entity":"person"}},{"bind":{"calculate":"if(${member_birth_date_known}='yes', ${calc_age}, ${age})"},"type":"calculate","name":"calc_age_confirm","instance":{"openmrs_entity_id":"154384AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"type":"note","name":"member_birth_date_note","label":{"Urdu":"کلائنٹ کی تاریخ پیدائش:${calc_dob_confirm}","English":"Member Date of Birth: ${calc_dob_confirm}","Roman Urdu":"Member ki Tareekh-e-pedaaish: ${calc_dob_confirm}"}},{"type":"note","name":"note_age","label":{"Urdu":"عمر :{calc_age_confirm}$ مہینے","English":"Age: ${calc_age_confirm} months","Roman Urdu":"Umar: ${calc_age_confirm} mahinay"}},{"control":{"appearance":"minimal"},"name":"gender","bind":{"required":"yes"},"label":{"Urdu":"جنس","English":"Gender","Roman Urdu":"Jins"},"instance":{"openmrs_entity_id":"gender","openmrs_entity":"person"},"type":"select one","children":[{"instance":{"openmrs_code":"1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"male","label":{"Urdu":"مرد/ لڑکا","Roman Urdu":"Mard/larka","English":"Male"}},{"instance":{"openmrs_code":"1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"female","label":{"Urdu":"عورت/لڑکی","Roman Urdu":"Aurat/larki","English":"Female"}},{"instance":{"openmrs_code":"163163AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"transgender","label":{"Urdu":"خواجہ سرہ","Roman Urdu":"Khwaja sira","English":"Transgender"}}]},{"bind":{"jr:constraintMsg":{"Urdu":"نام تین سے پچیس حروف پر مشتمل ہونا چاہئے","English":"Name should be 3 to 25 characters long","Roman Urdu":"Naam 3 say 25 huroof par mushtamil hona chahiye"},"constraint":"regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')"},"type":"text","instance":{"openmrs_entity_id":"1593AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"mother_name","label":{"Urdu":"والدہ کا نام","English":"Mother's Name","Roman Urdu":"Waaldah ka naam"}},{"control":{"appearance":"minimal"},"name":"ethnicity","bind":{"required":"yes"},"label":{"Urdu":"قومیت","English":"Ethnicity","Roman Urdu":"Qomiat"},"instance":{"openmrs_entity_id":"163153AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"163215AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"punjabi","label":{"Urdu":"پنجابی","Roman Urdu":"Punjabi","English":"Punjabi"}},{"instance":{"openmrs_code":"163216AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pushtuns","label":{"Urdu":"پشتون","Roman Urdu":"Pushtun","English":"Pushtun"}},{"instance":{"openmrs_code":"163217AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"sindhi","label":{"Urdu":"سندھی","Roman Urdu":"Sindhi","English":"Sindhi"}},{"instance":{"openmrs_code":"163218AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"saraiki","label":{"Urdu":"سرائیکی","Roman Urdu":"Saraiki","English":"Saraiki"}},{"instance":{"openmrs_code":"163219AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"muhajir","label":{"Urdu":"مہاجر","Roman Urdu":"Muhajir","English":"Muhajir"}},{"instance":{"openmrs_code":"163220AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"balochi","label":{"Urdu":"بلوچی","Roman Urdu":"Balochi","English":"Balochi"}},{"instance":{"openmrs_code":"5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}}]},{"bind":{"relevant":"selected(${ethnicity}, 'other')"},"type":"text","instance":{"openmrs_entity":"concept","openmrs_entity_id":"160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"163330AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ethnicity_other","label":{"Urdu":"وضاحت کریں","Roman Urdu":"Wazaahat karain","English":"Please specify:"}},{"control":{"appearance":"minimal"},"name":"province","default":"${provider_province}","bind":{"required":"yes"},"label":{"Urdu":"صوبہ","Roman Urdu":"Suba","English":"Province"},"instance":{"openmrs_entity":"person_address","openmrs_entity_id":"stateProvince","openmrs_entity_parent":"usual_residence"},"type":"select one","children":[{"name":"kpk","label":{"Urdu":"خیبر پختون خواہ","English":"Khyber Pakhtunkhwa","Roman Urdu":"Khyber Pakhtunkhwa"}},{"name":"sindh","label":{"Urdu":"سندھ","English":"Sindh","Roman Urdu":"Sindh"}},{"name":"balochistan","label":{"Urdu":"بلوچستان","English":"Balochistan","Roman Urdu":"Balochistan"}},{"name":"punjab","label":{"Urdu":"پنجاب","English":"Punjab","Roman Urdu":"Punjab"}},{"name":"gilgit_baltistan","label":{"Urdu":"گلگت بلتستان","English":"Gilgit Baltistan","Roman Urdu":"Gilgit Baltistan"}},{"name":"kashmir","label":{"Urdu":"کشمیر","English":"Kashmir","Roman Urdu":"Kashmir"}},{"name":"fata","label":{"Urdu":"فاٹا","English":"FATA","Roman Urdu":"FATA"}},{"name":"out_of_country","label":{"Urdu":"ملک سے باہر","English":"Out of Country","Roman Urdu":"Mulk se baahir"}}]},{"control":{"appearance":"minimal"},"name":"city_village","choice_filter":"province=${province} or province='na'","default":"${provider_city}","bind":{"required":"yes"},"label":{"Urdu":"شہر","Roman Urdu":"Shehr","English":"City"},"itemset":"cities","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"cityVillage","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"control":{"appearance":"minimal"},"name":"town","choice_filter":"(province=${province} and city=${city_village} ) or city='na'","bind":{"required":"yes"},"label":{"Urdu":"ٹاٰئون/ قصبہ/ بستی","Roman Urdu":"Town / Qasbah / Basti","English":"Town"},"itemset":"towns","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"town","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"control":{"appearance":"minimal"},"name":"union_council","choice_filter":"(province=${province} and city=${city_village} and town=${town}) or town='na'","bind":{"required":"yes"},"label":{"Urdu":"یونین کونسل","Roman Urdu":"Union Council","English":"Union Council"},"itemset":"ucs","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"subTown","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"bind":{"required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"house","openmrs_entity_parent":"usual_residence"},"name":"house_number","label":{"Urdu":"گھر کا نمبر","Roman Urdu":"Ghar ka number","English":"House Number"}},{"bind":{"required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"street","openmrs_entity_parent":"usual_residence"},"name":"street","label":{"Urdu":"گلی/کالونی/محلہ","Roman Urdu":"Gali/Colony/Mohalla","English":"Street"}},{"bind":{"required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"landmark","openmrs_entity_parent":"usual_residence"},"name":"landmark","label":{"Urdu":"گھر کے قریب کوئی مشہور جگہ","Roman Urdu":"Ghar ke qareeb koi mashoor jagah","English":"Land Mark"}},{"bind":{"calculate":"jr:choice-name(${province}, '${province}')"},"type":"calculate","name":"provincename"},{"bind":{"calculate":"jr:choice-name(${city_village}, '${city_village}')"},"type":"calculate","name":"city_villagename"},{"bind":{"calculate":"jr:choice-name(${town}, '${town}')"},"type":"calculate","name":"townname"},{"bind":{"calculate":"jr:choice-name(${union_council}, '${union_council}')"},"type":"calculate","name":"union_councilname"},{"type":"note","name":"address","label":{"Urdu":"پتہ: ${house_number}, ${street}, ${landmark}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}","English":"Address: ${house_number}, ${street}, ${landmark}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}","Roman Urdu":"Pata: ${house_number}, ${street}, ${landmark}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}"}},{"instance":{"openmrs_entity_id":"163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"geopoint","name":"centre_gps","label":{"Urdu":"حاصل کردہ معلومات کی جگہ کے GPS کارڈینیٹس درج کریں","English":"Collect GPS coordinates of data entry location","Roman Urdu":"Hasil karda malomaat ki jaga ke GPS coordinates darj karain"}},{"control":{"appearance":"minimal"},"name":"child_was_suffering_from_a_disease_at_birth","bind":{"required":"yes"},"label":{"Urdu":"کیا بچہ پیدائش کے وقت کسی مرض میں مبتلا تھا؟","English":"Was the child suffering from a disease at birth?","Roman Urdu":"Kya bacha pedaaish ke waqt kissi marz mai mubtila tha?"},"instance":{"openmrs_entity_id":"159926AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}]},{"name":"reminders_approval","bind":{"required":"yes"},"label":{"Urdu":"کیا آپ اپنے بچے کی اگلی ویکسین کی تاریخ کے لیے SMS موصول کرنا چاہتے ہیں؟","English":"Are you willing to receive SMS reminders for your next visit?","Roman Urdu":"Kya aap apnay bachay ki agli vaccine ki tareekh ke liye SMS mausool karna chahtay hain?"},"instance":{"openmrs_entity_id":"163089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}]},{"bind":{"jr:constraintMsg":{"Urdu":"فون نمبر گیارہ ہندسوں پر مشتمل اور مندرجہ ذیل شکل میں ہونا چاہئے: *********03","English":"Phone number should be 11 digits in the following format: 03*********","Roman Urdu":"Phone number 11 hindason par mushtamil aur mundarja zail shakal main hona chahiey: 03*********"},"relevant":"${reminders_approval}='yes'","constraint":"regex(., '^03[0-9]{9}$')"},"type":"text","instance":{"openmrs_entity_id":"159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"contact_phone_number","label":{"Urdu":"موبائل نمبر:","English":"Mobile Number:","Roman Urdu":"Mobile number:"}},{"bind":{"calculate":"${calc_dob_confirm} + 42"},"type":"calculate","name":"six_weeks"},{"bind":{"calculate":"${calc_dob_confirm} + 70"},"type":"calculate","name":"ten_weeks"},{"bind":{"calculate":"${calc_dob_confirm} + 98"},"type":"calculate","name":"forteen_weeks"},{"bind":{"calculate":"${calc_dob_confirm} + 245"},"type":"calculate","name":"nine_months"},{"bind":{"calculate":"${calc_dob_confirm} + 458"},"type":"calculate","name":"fifteen_months"},{"control":{"appearance":"minimal"},"name":"vaccines","label":{"Urdu":"پچھلی تاریخ جب کسی اور سینٹر پر ٹیکے لگواِے گیے یا قطرے پلائے گئے","Roman Urdu":"Pichli tareekh jab kissi aur center par teekay lagwaye gaye ya katray pilaey gaye","English":"Retro vaccines"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1421AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"select all that apply","children":[{"instance":{"openmrs_code":"1570AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"bcg","label":{"Urdu":"بی سی جی","Roman Urdu":"BCG","English":"BCG"}},{"instance":{"openmrs_code":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv0","label":{"Urdu":"او پی وی 0","Roman Urdu":"OPV 0","English":"OPV 0"}},{"instance":{"openmrs_code":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pcv1","label":{"Urdu":"پی سی وی 1","Roman Urdu":"PCV 1","English":"PCV 1"}},{"instance":{"openmrs_code":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv1","label":{"Urdu":"او پی وی 1","Roman Urdu":"OPV 1","English":"OPV 1"}},{"instance":{"openmrs_code":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"penta1","label":{"Urdu":"پینٹا ویلنٹ 1","Roman Urdu":"Pentavalent 1","English":"Pentavalent 1"}},{"instance":{"openmrs_code":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pcv2","label":{"Urdu":"پی سی وی 2","Roman Urdu":"PCV 2","English":"PCV 2"}},{"instance":{"openmrs_code":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv2","label":{"Urdu":"او پی وی 2","Roman Urdu":"OPV 2","English":"OPV 2"}},{"instance":{"openmrs_code":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"penta2","label":{"Urdu":"پینٹا ویلنٹ 2","Roman Urdu":"Pentavalent 2","English":"Pentavalent 2"}},{"instance":{"openmrs_code":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pcv3","label":{"Urdu":"پی سی وی 3","Roman Urdu":"PCV 3","English":"PCV 3"}},{"instance":{"openmrs_code":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv3","label":{"Urdu":"او پی وی 3","Roman Urdu":"OPV 3","English":"OPV 3"}},{"instance":{"openmrs_code":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"penta3","label":{"Urdu":"پینٹا ویلنٹ 3","Roman Urdu":"Pentavalent 3","English":"Pentavalent 3"}},{"instance":{"openmrs_code":"82242AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ipv","label":{"Urdu":"آئی پی وی","Roman Urdu":"IPV","English":"IPV"}},{"instance":{"openmrs_code":"79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"measles1","label":{"Urdu":"خسرہ 1","Roman Urdu":"Khasra 1","English":"Measles 1"}},{"instance":{"openmrs_code":"79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"measles2","label":{"Urdu":"خسرہ 2","Roman Urdu":"Khasra 2","English":"Measles 2"}}]},{"bind":{"relevant":"${vaccines} != ''"},"type":"group","children":[{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'bcg')","constraint":".>= ${calc_dob_confirm} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"bcg_retro","label":{"Urdu":"بی سی جی","Roman Urdu":"BCG","English":"BCG"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'opv0')","constraint":".>= ${calc_dob_confirm} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv0_retro","label":{"Urdu":"او پی وی 0","Roman Urdu":"OPV 0","English":"OPV 0"}},{"bind":{"relevant":"selected(${vaccines}, 'opv0')","calculate":"0"},"type":"calculate","name":"opv0_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'pcv1')","constraint":".>= ${calc_dob_confirm} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pcv1_retro","label":{"Urdu":"پی سی وی 1","Roman Urdu":"PCV1","English":"PCV1"}},{"bind":{"relevant":"selected(${vaccines}, 'pcv1')","calculate":"1"},"type":"calculate","name":"pcv1_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'opv1')","constraint":".>= ${calc_dob_confirm} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv1_retro","label":{"Urdu":"او پی وی1","Roman Urdu":"OPV 1","English":"OPV 1"}},{"bind":{"relevant":"selected(${vaccines}, 'opv1')","calculate":"1"},"type":"calculate","name":"opv1_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'penta1')","constraint":".>= ${calc_dob_confirm} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"penta1_retro","label":{"Urdu":"پینٹا ویلنٹ 1","Roman Urdu":"Pentavalent 1","English":"Pentavalent 1"}},{"bind":{"relevant":"selected(${vaccines}, 'penta1')","calculate":"1"},"type":"calculate","name":"penta1_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'pcv2')","constraint":".>= ${calc_dob_confirm} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pcv2_retro","label":{"Urdu":"پی سی وی 2","Roman Urdu":"PCV2","English":"PCV2"}},{"bind":{"relevant":"selected(${vaccines}, 'pcv2')","calculate":"2"},"type":"calculate","name":"pcv2_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'opv2')","constraint":".>= ${calc_dob_confirm} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv2_retro","label":{"Urdu":"او پی وی 2","Roman Urdu":"OPV 2","English":"OPV 2"}},{"bind":{"relevant":"selected(${vaccines}, 'opv2')","calculate":"2"},"type":"calculate","name":"opv2_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'penta2')","constraint":".>= ${calc_dob_confirm} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"penta2_retro","label":{"Urdu":"پینٹا ویلنٹ 2","Roman Urdu":"Pentavalent 2","English":"Pentavalent 2"}},{"bind":{"relevant":"selected(${vaccines}, 'penta2')","calculate":"2"},"type":"calculate","name":"penta2_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'pcv3')","constraint":".>= ${calc_dob_confirm} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pcv3_retro","label":{"Urdu":"پی سی وی 3","Roman Urdu":"PCV3","English":"PCV3"}},{"bind":{"relevant":"selected(${vaccines}, 'pcv3')","calculate":"3"},"type":"calculate","name":"pcv3_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'opv3')","constraint":".>= ${calc_dob_confirm} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv3_retro","label":{"Urdu":"او پی وی3","Roman Urdu":"OPV 3","English":"OPV 3"}},{"bind":{"relevant":"selected(${vaccines}, 'opv3')","calculate":"3"},"type":"calculate","name":"opv3_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'penta3')","constraint":".>= ${calc_dob_confirm} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"penta3_retro","label":{"Urdu":"پینٹا ویلنٹ 3","Roman Urdu":"Pentavalent 3","English":"Pentavalent 3"}},{"bind":{"relevant":"selected(${vaccines}, 'penta3')","calculate":"3"},"type":"calculate","name":"penta3_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'ipv')","constraint":".>= ${calc_dob_confirm} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1422AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ipv_retro","label":{"Urdu":"آئی پی وی","Roman Urdu":"IPV","English":"IPV"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'measles1')","constraint":".>= ${calc_dob_confirm} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"measles1_retro","label":{"Urdu":"خسرہ 1","Roman Urdu":"Measles 1","English":"Measles 1"}},{"bind":{"relevant":"selected(${vaccines}, 'measles1')","calculate":"1"},"type":"calculate","name":"measles1_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'measles2')","constraint":".>= ${calc_dob_confirm} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"measles2_retro","label":{"Urdu":"خسرہ 2","Roman Urdu":"Measles2","English":"Measles2"}},{"bind":{"relevant":"selected(${vaccines}, 'measles2')","calculate":"2"},"type":"calculate","name":"measles2_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}}],"name":"vaccines_group"},{"name":"vaccines_2","choice_filter":"name = if(selected(${vaccines}, 'bcg'), '', 'bcg') or \nname = if(selected(${vaccines}, 'opv0'), '', 'opv0') or \nname = if(selected(${vaccines}, 'penta1'), '', 'penta1') or \nname = if(selected(${vaccines}, 'opv1'), '', 'opv1') or \nname = if(selected(${vaccines}, 'pcv1'), '', 'pcv1') or \nname = if(selected(${vaccines}, 'penta2'), '', 'penta2') or \nname = if(selected(${vaccines}, 'opv2'), '', 'opv2') or \nname = if(selected(${vaccines}, 'pcv2'), '', 'pcv2') or \nname = if(selected(${vaccines}, 'penta3'), '', 'penta3') or \nname = if(selected(${vaccines}, 'pcv3'), '', 'pcv3') or \nname = if(selected(${vaccines}, 'opv3'), '', 'opv3') or \nname = if(selected(${vaccines}, 'ipv'), '', 'ipv') or \nname = if(selected(${vaccines}, 'measles1'), '', 'measles1') or \nname = if(selected(${vaccines}, 'measles2'), '', 'measles2')","bind":{"required":"yes"},"label":{"Urdu":"آج کون کون سی ویکسین دی گئی ہیں؟","Roman Urdu":"Aaj kon kon si vaccine di gai hain?","English":"Vaccines administered today"},"itemset":"vaccines","instance":{"openmrs_entity":"concept","openmrs_entity_id":"984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1441AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"select all that apply"},{"bind":{"calculate":"if(selected(${vaccines_2}, 'bcg'),${client_reg_date},'')"},"type":"calculate","name":"bcg","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'opv0'),${client_reg_date},'')"},"type":"calculate","name":"opv0","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'opv0')","calculate":"0"},"type":"calculate","name":"opv0_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'pcv1'),${client_reg_date},'')"},"type":"calculate","name":"pcv1","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'pcv1')","calculate":"1"},"type":"calculate","name":"pcv1_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'opv1'),${client_reg_date},'')"},"type":"calculate","name":"opv1","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'opv1')","calculate":"1"},"type":"calculate","name":"opv1_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'penta1'),${client_reg_date},'')"},"type":"calculate","name":"penta1","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'penta1')","calculate":"1"},"type":"calculate","name":"penta1_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'pcv2'),${client_reg_date},'')"},"type":"calculate","name":"pcv2","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'pcv2')","calculate":"2"},"type":"calculate","name":"pcv2_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'opv2'),${client_reg_date},'')"},"type":"calculate","name":"opv2","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'opv2')","calculate":"2"},"type":"calculate","name":"opv2_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'penta2'),${client_reg_date},'')"},"type":"calculate","name":"penta2","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'penta2')","calculate":"2"},"type":"calculate","name":"penta2_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'pcv3'),${client_reg_date},'')"},"type":"calculate","name":"pcv3","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'pcv3')","calculate":"3"},"type":"calculate","name":"pcv3_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'opv3'),${client_reg_date},'')"},"type":"calculate","name":"opv3","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'opv3')","calculate":"3"},"type":"calculate","name":"opv3_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'penta3'),${client_reg_date},'')"},"type":"calculate","name":"penta3","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'penta3')","calculate":"3"},"type":"calculate","name":"penta3_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines}, 'ipv')","calculate":"if(selected(${vaccines_2}, 'ipv'),${client_reg_date},'')"},"type":"calculate","name":"ipv","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1422AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'measles1'),${client_reg_date},'')"},"type":"calculate","name":"measles1","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'measles1')","calculate":"1"},"type":"calculate","name":"measles1_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'measles2'),${client_reg_date},'')"},"type":"calculate","name":"measles2","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'measles2')","calculate":"2"},"type":"calculate","name":"measles2_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"control":{"bodyless":true},"type":"group","children":[{"bind":{"readonly":"true()","calculate":"concat('uuid:', uuid())"},"type":"calculate","name":"instanceID"}],"name":"meta"}]} \ No newline at end of file +{ + "name": "Child_Vaccination_Enrollment", + "title": "بچّوں کا انرولمنٹ رجسٹر برائے ٹیکاجات - Child Enrollment Vaccination Register", + "sms_keyword": "child_vaccination_enrollment", + "default_language": "English", + "choices": { + "provinces": [ + { + "name": "kpk", + "label": { + "Urdu": "خیبر پختون خواہ", + "English": "Khyber Pakhtunkhwa", + "Roman Urdu": "Khyber Pakhtunkhwa" + } + }, + { + "name": "sindh", + "label": { + "Urdu": "سندھ", + "English": "Sindh", + "Roman Urdu": "Sindh" + } + }, + { + "name": "balochistan", + "label": { + "Urdu": "بلوچستان", + "English": "Balochistan", + "Roman Urdu": "Balochistan" + } + }, + { + "name": "punjab", + "label": { + "Urdu": "پنجاب", + "English": "Punjab", + "Roman Urdu": "Punjab" + } + }, + { + "name": "gilgit_baltistan", + "label": { + "Urdu": "گلگت بلتستان", + "English": "Gilgit Baltistan", + "Roman Urdu": "Gilgit Baltistan" + } + }, + { + "name": "kashmir", + "label": { + "Urdu": "کشمیر", + "English": "Kashmir", + "Roman Urdu": "Kashmir" + } + }, + { + "name": "fata", + "label": { + "Urdu": "فاٹا", + "English": "FATA", + "Roman Urdu": "FATA" + } + }, + { + "name": "out_of_country", + "label": { + "Urdu": "ملک سے باہر", + "English": "Out of Country", + "Roman Urdu": "Mulk se baahir" + } + } + ], + "ucs": [ + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "bilal_colony", + "label": { + "Urdu": "بلال کالونی", + "Roman Urdu": "Bilal Colony", + "English": "Bilal Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "nasir_colony", + "label": { + "Urdu": "ناصر کالونی", + "Roman Urdu": "Nasir Colony", + "English": "Nasir Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "chakra_goth", + "label": { + "Urdu": "چکرا گوٹھ", + "Roman Urdu": "Chakra Goth", + "English": "Chakra Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "mustafa_taj_colony", + "label": { + "Urdu": "مصطفی تاج کالونی", + "Roman Urdu": "Mustafa Taj Colony", + "English": "Mustafa Taj Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "hundred_quarters", + "label": { + "Urdu": "ہنڈریڈ کوارٹر", + "Roman Urdu": "Hundred Quarters", + "English": "Hundred Quarters" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "gulzar_colony", + "label": { + "Urdu": "گلزار کالونی", + "Roman Urdu": "Gulzar Colony", + "English": "Gulzar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "korangi_sector_33", + "label": { + "Urdu": "کورنگی سیکٹر 33", + "Roman Urdu": "Korangi Sector 33", + "English": "Korangi Sector 33" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "zaman_town", + "label": { + "Urdu": "زمان ٹاوَن", + "Roman Urdu": "Zaman Town", + "English": "Zaman Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "hasrat_mohani_colony", + "label": { + "Urdu": "حسرت موہانی کالونی", + "Roman Urdu": "Hasrat Mohani Colony", + "English": "Hasrat Mohani Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "gulshan_e_ghazi", + "label": { + "Urdu": "گلشن غازی", + "Roman Urdu": "Gulshan-e-Ghazi", + "English": "Gulshan-e-Ghazi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "ittehad_town", + "label": { + "Urdu": "اتحاد ٹاوَن", + "Roman Urdu": "Ittehad Town", + "English": "Ittehad Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "islam_nagar", + "label": { + "Urdu": "اسلام نگر", + "Roman Urdu": "Islam Nagar", + "English": "Islam Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "nai_abadi", + "label": { + "Urdu": "نئی آبادی", + "Roman Urdu": "Nai Abadi", + "English": "Nai Abadi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "saeedabad", + "label": { + "Urdu": "سعید آباد", + "Roman Urdu": "Saeedabad", + "English": "Saeedabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "muslim_mujahid_colony", + "label": { + "Urdu": "مسلم مجاہد کالونی", + "Roman Urdu": "Muslim Mujahid Colony", + "English": "Muslim Mujahid Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "muhajir_camp", + "label": { + "Urdu": "مہاجر کیمپ", + "Roman Urdu": "Muhajir Camp", + "English": "Muhajir Camp" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "rasheedabad", + "label": { + "Urdu": "رشید آباد", + "Roman Urdu": "Rasheedabad", + "English": "Rasheedabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "ibrahim_hyderi", + "label": { + "Urdu": "ابراہیم حیدری", + "Roman Urdu": "Ibrahim Hyderi", + "English": "Ibrahim Hyderi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "rehri", + "label": { + "Urdu": "رہڑی", + "Roman Urdu": "Rehri", + "English": "Rehri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "cattle_colony", + "label": { + "Urdu": "کیٹل کالونی", + "Roman Urdu": "Cattle Colony", + "English": "Cattle Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "qaidabad", + "label": { + "Urdu": "قائدآباد", + "Roman Urdu": "Qaidabad", + "English": "Qaidabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "landhi_colony", + "label": { + "Urdu": "لانڈھی کالونی", + "Roman Urdu": "Landhi Colony", + "English": "Landhi Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "gulshan_e_hadeed", + "label": { + "Urdu": "گلشن حدید", + "Roman Urdu": "Gulshan-e-Hadeed", + "English": "Gulshan-e-Hadeed" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "gaghar", + "label": { + "Urdu": "گگر", + "Roman Urdu": "Gaghar", + "English": "Gaghar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "murad_memon_goth", + "label": { + "Urdu": "مراد میمن گوٹھ", + "Roman Urdu": "Murad Memon Goth", + "English": "Murad Memon Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "darsano_chana", + "label": { + "Urdu": "درشانو شنو", + "Roman Urdu": "Darsano Chana", + "English": "Darsano Chana" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "gujro", + "label": { + "Urdu": "گجرو", + "Roman Urdu": "Gujro", + "English": "Gujro" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "songal", + "label": { + "Urdu": "سنگل", + "Roman Urdu": "Songal", + "English": "Songal" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "maymarabad", + "label": { + "Urdu": "معمار آباد", + "Roman Urdu": "Maymarabad", + "English": "Maymarabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "yousuf_goth", + "label": { + "Urdu": "یوسف گوٹھ", + "Roman Urdu": "Yousuf Goth", + "English": "Yousuf Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "manghopir", + "label": { + "Urdu": "منگھوپیر", + "Roman Urdu": "Manghopir", + "English": "Manghopir" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "azizabad", + "label": { + "Urdu": "عزیز آباد", + "Roman Urdu": "Azizabad", + "English": "Azizabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "karimabad", + "label": { + "Urdu": "کریم آباد", + "Roman Urdu": "Karimabad", + "English": "Karimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "aisha_manzil", + "label": { + "Urdu": "عائشہ منزل", + "Roman Urdu": "Aisha Manzil", + "English": "Aisha Manzil" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "ancholi", + "label": { + "Urdu": "انچولی", + "Roman Urdu": "Ancholi", + "English": "Ancholi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "naseerabad", + "label": { + "Urdu": "نصیرآباد", + "Roman Urdu": "Naseerabad", + "English": "Naseerabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "yaseenabad", + "label": { + "Urdu": "یاسین آباد", + "Roman Urdu": "Yaseenabad", + "English": "Yaseenabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "water_pump", + "label": { + "Urdu": "واٹرپمپ", + "Roman Urdu": "Water Pump", + "English": "Water Pump" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "shafiq_mill_colony", + "label": { + "Urdu": "شفیق مل کالونی", + "Roman Urdu": "Shafiq Mill Colony", + "English": "Shafiq Mill Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "delhi_mercantile_society", + "label": { + "Urdu": "دہلی مرچنٹائل سوسائٹی", + "Roman Urdu": "Delhi Mercantile Society", + "English": "Delhi Mercantile Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "civic_centre", + "label": { + "Urdu": "سوک سینٹر", + "Roman Urdu": "Civic Centre", + "English": "Civic Centre" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "pir_ilahi_buksh_colony", + "label": { + "Urdu": "پیر الہی بخش کالونی", + "Roman Urdu": "Pir Ilahi Buksh Colony", + "English": "Pir Ilahi Buksh Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "essa_nagri", + "label": { + "Urdu": "عیسی نگری", + "Roman Urdu": "Essa Nagri", + "English": "Essa Nagri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gulshan_e_iqbal", + "label": { + "Urdu": "گلشن اقبال", + "Roman Urdu": "Gulshan-e-Iqbal", + "English": "Gulshan-e-Iqbal" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gillani_railway_station", + "label": { + "Urdu": "گیلانی ریلوے اسٹیشن", + "Roman Urdu": "Gillani Railway Station", + "English": "Gillani Railway Station" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "shanti_nagar", + "label": { + "Urdu": "شانتی نگر", + "Roman Urdu": "Shanti Nagar", + "English": "Shanti Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "jamali_colony", + "label": { + "Urdu": "جمالی کالونی", + "Roman Urdu": "Jamali Colony", + "English": "Jamali Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gulshan_e_iqbal_ii", + "label": { + "Urdu": "گلشن اقبال 2", + "Roman Urdu": "Gulshan-e-Iqbal II", + "English": "Gulshan-e-Iqbal II" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "pehlwan_goth", + "label": { + "Urdu": "پہلوان گوٹھ", + "Roman Urdu": "Pehlwan Goth", + "English": "Pehlwan Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "matrovil_colony", + "label": { + "Urdu": "میٹروویل کالونی", + "Roman Urdu": "Matrovil Colony", + "English": "Matrovil Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gulzar_e_hijri", + "label": { + "Urdu": "گلزار ہجری", + "Roman Urdu": "Gulzar-e-Hijri", + "English": "Gulzar-e-Hijri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "safooran_goth", + "label": { + "Urdu": "صفورا گوٹھ", + "Roman Urdu": "Safooran Goth", + "English": "Safooran Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "akhtar_colony", + "label": { + "Urdu": "اختر کالونی", + "Roman Urdu": "Akhtar Colony", + "English": "Akhtar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "manzoor_colony", + "label": { + "Urdu": "منظور کالونی", + "Roman Urdu": "Manzoor Colony", + "English": "Manzoor Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "azam_basti", + "label": { + "Urdu": "اعظم بستی", + "Roman Urdu": "Azam Basti", + "English": "Azam Basti" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "chanesar_goth", + "label": { + "Urdu": "چنیسر گوٹھ", + "Roman Urdu": "Chanesar Goth", + "English": "Chanesar Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "mahmudabad", + "label": { + "Urdu": "محمودآباد", + "Roman Urdu": "Mahmudabad", + "English": "Mahmudabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "pechs", + "label": { + "Urdu": "پی۔ای۔سی۔ایچ۔ایس", + "Roman Urdu": "P.E.C.H.S.", + "English": "P.E.C.H.S." + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "pechs_ii", + "label": { + "Urdu": "پی۔ای۔سی۔ایچ۔ایس 2", + "Roman Urdu": "P.E.C.H.S. II", + "English": "P.E.C.H.S. II" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "jut_line", + "label": { + "Urdu": "جٹ لائن", + "Roman Urdu": "Jut Line", + "English": "Jut Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "central_jacob_lines", + "label": { + "Urdu": "سینٹرل جیکب لائن", + "Roman Urdu": "Central Jacob Lines", + "English": "Central Jacob Lines" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "jamshed_quarters", + "label": { + "Urdu": "جمشید کوارٹر", + "Roman Urdu": "Jamshed Quarters", + "English": "Jamshed Quarters" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "garden_east", + "label": { + "Urdu": "گارڈن ایسٹ", + "Roman Urdu": "Garden East", + "English": "Garden East" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "soldier_bazar", + "label": { + "Urdu": "سولجر بازار", + "Roman Urdu": "Soldier Bazar", + "English": "Soldier Bazar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "pakistan_quarters", + "label": { + "Urdu": "پاکستان کوارٹر", + "Roman Urdu": "Pakistan Quarters", + "English": "Pakistan Quarters" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "bhutta_village", + "label": { + "Urdu": "بھٹا ولیج", + "Roman Urdu": "Bhutta Village", + "English": "Bhutta Village" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "sultanabad", + "label": { + "Urdu": "سلطان آباد", + "Roman Urdu": "Sultanabad", + "English": "Sultanabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "kiamari_uc", + "label": { + "Urdu": "کیماری یو- سی", + "Roman Urdu": "Kiamari UC", + "English": "Kiamari UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "baba_bhit", + "label": { + "Urdu": "بابا بھٹ", + "Roman Urdu": "Baba Bhit", + "English": "Baba Bhit" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "machar_colony", + "label": { + "Urdu": "مچھر کالونی", + "Roman Urdu": "Machar Colony", + "English": "Machar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "maripur", + "label": { + "Urdu": "ماڑی پور", + "Roman Urdu": "Maripur", + "English": "Maripur" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "shershah", + "label": { + "Urdu": "شیرشاہ", + "Roman Urdu": "SherShah", + "English": "SherShah" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "gabo_pat", + "label": { + "Urdu": "گابو پٹ", + "Roman Urdu": "Gabo Pat", + "English": "Gabo Pat" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "muzafarabad", + "label": { + "Urdu": "مظفرآباد", + "Roman Urdu": "Muzafarabad", + "English": "Muzafarabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "muslimabad", + "label": { + "Urdu": "مسلم آباد", + "Roman Urdu": "Muslimabad", + "English": "Muslimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "dawood_chowrangi", + "label": { + "Urdu": "داوَد چورنگی", + "Roman Urdu": "Dawood Chowrangi", + "English": "Dawood Chowrangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "moinabad", + "label": { + "Urdu": "معین آباد", + "Roman Urdu": "Moinabad", + "English": "Moinabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "sharafi_goth", + "label": { + "Urdu": "شرافی گوٹھ", + "Roman Urdu": "Sharafi Goth", + "English": "Sharafi Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "bhutto_nagar", + "label": { + "Urdu": "بھٹو نگر", + "Roman Urdu": "Bhutto Nagar", + "English": "Bhutto Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "khawaja_ajmeer_colony", + "label": { + "Urdu": "خواجہ اجمیر کالونی", + "Roman Urdu": "Khawaja Ajmeer Colony", + "English": "Khawaja Ajmeer Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "landhi_uc", + "label": { + "Urdu": "لانڈھی یوسی", + "Roman Urdu": "Landhi UC", + "English": "Landhi UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "awami_colony", + "label": { + "Urdu": "عوامی کالونی", + "Roman Urdu": "Awami Colony", + "English": "Awami Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "burmee_colony", + "label": { + "Urdu": "برمی کالونی", + "Roman Urdu": "Burmee Colony", + "English": "Burmee Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "korangi_uc", + "label": { + "Urdu": "کورنگی یوسی", + "Roman Urdu": "Korangi UC", + "English": "Korangi UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "sherabad", + "label": { + "Urdu": "شیرآباد", + "Roman Urdu": "Sherabad", + "English": "Sherabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "rizvia_society", + "label": { + "Urdu": "رضویہ سوسائٹی", + "Roman Urdu": "Rizvia Society", + "English": "Rizvia Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "firdous_colony", + "label": { + "Urdu": "فردوس کالونی", + "Roman Urdu": "Firdous Colony", + "English": "Firdous Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "super_market", + "label": { + "Urdu": "سپر مارکیٹ", + "Roman Urdu": "Super Market", + "English": "Super Market" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "dak_khana", + "label": { + "Urdu": "دک کھانہ", + "Roman Urdu": "Dak Khana", + "English": "Dak Khana" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "qasimabad", + "label": { + "Urdu": "قاسم آباد", + "Roman Urdu": "Qasimabad", + "English": "Qasimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "bandhani_colony", + "label": { + "Urdu": "بندھانی کالونی", + "Roman Urdu": "Bandhani Colony", + "English": "Bandhani Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "sharifabad", + "label": { + "Urdu": "شریف آباد", + "Roman Urdu": "Sharifabad", + "English": "Sharifabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "commercial_area", + "label": { + "Urdu": "کمرشل ایریا", + "Roman Urdu": "Commercial Area", + "English": "Commercial Area" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "mujahid_colony", + "label": { + "Urdu": "مجاہد کالونی", + "Roman Urdu": "Mujahid Colony", + "English": "Mujahid Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "nazimabad", + "label": { + "Urdu": "ناظم آباد", + "Roman Urdu": "Nazimabad", + "English": "Nazimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "abbasi_shaheed", + "label": { + "Urdu": "عباسی شہید", + "Roman Urdu": "Abbasi Shaheed", + "English": "Abbasi Shaheed" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "agra_taj_colony", + "label": { + "Urdu": "آگرہ تاج کالونی", + "Roman Urdu": "Agra Taj Colony", + "English": "Agra Taj Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "daryaabad", + "label": { + "Urdu": "دریاآباد", + "Roman Urdu": "Daryaabad", + "English": "Daryaabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "nawabad", + "label": { + "Urdu": "نواآباد", + "Roman Urdu": "Nawabad", + "English": "Nawabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "khada_memon_society", + "label": { + "Urdu": "خدا- میمن- سوساَٹی", + "Roman Urdu": "Khada Memon Society", + "English": "Khada Memon Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "baghdadi", + "label": { + "Urdu": "بغدادی", + "Roman Urdu": "Baghdadi", + "English": "Baghdadi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "shah_baig_line", + "label": { + "Urdu": "شاھ باغ لائن", + "Roman Urdu": "Shah Baig Line", + "English": "Shah Baig Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "bihar_colony", + "label": { + "Urdu": "بہار کالونی", + "Roman Urdu": "Bihar Colony", + "English": "Bihar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "ragiwara", + "label": { + "Urdu": "راگی واڑا", + "Roman Urdu": "Ragiwara", + "English": "Ragiwara" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "singo_line", + "label": { + "Urdu": "سنگولائن", + "Roman Urdu": "Singo Line", + "English": "Singo Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "chakiwara", + "label": { + "Urdu": "چاکی واڑا", + "Roman Urdu": "Chakiwara", + "English": "Chakiwara" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "allama_iqbal_colony", + "label": { + "Urdu": "علامہ اقبال کالونی", + "Roman Urdu": "Allama Iqbal Colony", + "English": "Allama Iqbal Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "model_colony", + "label": { + "Urdu": "موڈل کالونی", + "Roman Urdu": "Model Colony", + "English": "Model Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "kala_board", + "label": { + "Urdu": "کالا بورڈ", + "Roman Urdu": "Kala Board", + "English": "Kala Board" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "saudabad", + "label": { + "Urdu": "سعودآباد", + "Roman Urdu": "Saudabad", + "English": "Saudabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "khokhra_par", + "label": { + "Urdu": "کھوکھرا پار", + "Roman Urdu": "Khokhra Par", + "English": "Khokhra Par" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "jafar_e_tayyar", + "label": { + "Urdu": "جعفر تیار", + "Roman Urdu": "Jafar-e-Tayyar", + "English": "Jafar-e-Tayyar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "gharibabad", + "label": { + "Urdu": "غریب آباد", + "Roman Urdu": "Gharibabad", + "English": "Gharibabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "ghazi_brohi_goth", + "label": { + "Urdu": "غازی بروہی گوٹھ", + "Roman Urdu": "Ghazi Brohi Goth", + "English": "Ghazi Brohi Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "kalyana", + "label": { + "Urdu": "کالیانہ", + "Roman Urdu": "Kalyana", + "English": "Kalyana" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "sir_syed_colony", + "label": { + "Urdu": "سر سید کالونی", + "Roman Urdu": "Sir Syed Colony", + "English": "Sir Syed Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "fatima_jinnah_colony", + "label": { + "Urdu": "فاطمہ جناح کالونی", + "Roman Urdu": "Fatima Jinnah Colony", + "English": "Fatima Jinnah Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "godhra", + "label": { + "Urdu": "گودھرا", + "Roman Urdu": "Godhra", + "English": "Godhra" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "abu_zar_ghaffari", + "label": { + "Urdu": "ابو زر غفاری", + "Roman Urdu": "Abu Zar Ghaffari", + "English": "Abu Zar Ghaffari" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "hakim_ahsan", + "label": { + "Urdu": "حاکم احسان", + "Roman Urdu": "Hakim Ahsan", + "English": "Hakim Ahsan" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "madina_colony", + "label": { + "Urdu": "مدینہ کالونی", + "Roman Urdu": "Madina Colony", + "English": "Madina Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "faisal_colony", + "label": { + "Urdu": "فیصل کالونی", + "Roman Urdu": "Faisal Colony", + "English": "Faisal Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "khamiso_goth", + "label": { + "Urdu": "خمیسو گوٹھ", + "Roman Urdu": "Khamiso Goth", + "English": "Khamiso Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "mustufa_colony", + "label": { + "Urdu": "مصطفی کالونی", + "Roman Urdu": "Mustufa Colony", + "English": "Mustufa Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "khawaja_ajmeer_nagri", + "label": { + "Urdu": "خواجہ اجمیر نگری", + "Roman Urdu": "Khawaja Ajmeer Nagri", + "English": "Khawaja Ajmeer Nagri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "gulshan_e_saeed", + "label": { + "Urdu": "گلشن سعید", + "Roman Urdu": "Gulshan-e-Saeed", + "English": "Gulshan-e-Saeed" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "shah_nawaz_bhutto_colony", + "label": { + "Urdu": "شاہ نواز بھٹو کالونی", + "Roman Urdu": "Shah Nawaz Bhutto Colony", + "English": "Shah Nawaz Bhutto Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "paposh_nagar", + "label": { + "Urdu": "پاپوش نگر", + "Roman Urdu": "Paposh Nagar", + "English": "Paposh Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "pahar_ganj", + "label": { + "Urdu": "پہاڑ گنج", + "Roman Urdu": "Pahar Ganj", + "English": "Pahar Ganj" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "khandu_goth", + "label": { + "Urdu": "کھنڑو گوٹھ", + "Roman Urdu": "Khandu Goth", + "English": "Khandu Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "hyderi", + "label": { + "Urdu": "حیدری", + "Roman Urdu": "Hyderi", + "English": "Hyderi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "sakhi_hassan", + "label": { + "Urdu": "سخی حسن", + "Roman Urdu": "Sakhi Hassan", + "English": "Sakhi Hassan" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "farooq_e_azam", + "label": { + "Urdu": "فاروق اعظم", + "Roman Urdu": "Farooq-e-Azam", + "English": "Farooq-e-Azam" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "nusrat_bhutto_colony", + "label": { + "Urdu": "نصرت بھٹو کالونی", + "Roman Urdu": "Nusrat Bhutto Colony", + "English": "Nusrat Bhutto Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "shadman_town", + "label": { + "Urdu": "شادمان ٹاوَن", + "Roman Urdu": "Shadman Town", + "English": "Shadman Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "buffer_zone", + "label": { + "Urdu": "بفرزون", + "Roman Urdu": "Buffer Zone", + "English": "Buffer Zone" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "buffer_zone_ii", + "label": { + "Urdu": "بفرزون 2", + "Roman Urdu": "Buffer Zone II", + "English": "Buffer Zone II" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "mominabad", + "label": { + "Urdu": "مومن آباد", + "Roman Urdu": "Mominabad", + "English": "Mominabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "haryana_colony", + "label": { + "Urdu": "حریانہ کالونی", + "Roman Urdu": "Haryana Colony", + "English": "Haryana Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "hanifabad", + "label": { + "Urdu": "حنیف آباد", + "Roman Urdu": "Hanifabad", + "English": "Hanifabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "mohammad_nagar", + "label": { + "Urdu": "محمد نگر", + "Roman Urdu": "Mohammad Nagar", + "English": "Mohammad Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "madina_colony_orangi", + "label": { + "Urdu": "مدینہ کالونی اورنگی", + "Roman Urdu": "Madina Colony Orangi", + "English": "Madina Colony Orangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "ghaziabad", + "label": { + "Urdu": "غازی آباد", + "Roman Urdu": "Ghaziabad", + "English": "Ghaziabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "chisti_nagar", + "label": { + "Urdu": "چشتی نگر", + "Roman Urdu": "Chisti Nagar", + "English": "Chisti Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "bilal_colony_orangi", + "label": { + "Urdu": "بلال کالونی اورنگی", + "Roman Urdu": "Bilal Colony Orangi", + "English": "Bilal Colony Orangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "iqbal_baloch_colony", + "label": { + "Urdu": "اقبال بلوچ کالونی", + "Roman Urdu": "Iqbal Baloch Colony", + "English": "Iqbal Baloch Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "ghabool_town", + "label": { + "Urdu": "گبول ٹاوَن", + "Roman Urdu": "Ghabool Town", + "English": "Ghabool Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "data_nagar", + "label": { + "Urdu": "داتا نگر", + "Roman Urdu": "Data Nagar", + "English": "Data Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "mujahidabad", + "label": { + "Urdu": "مجاہد آباد", + "Roman Urdu": "Mujahidabad", + "English": "Mujahidabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "baloch_goth", + "label": { + "Urdu": "بلوچ گوٹھ", + "Roman Urdu": "Baloch Goth", + "English": "Baloch Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "old_haji_camp", + "label": { + "Urdu": "پرانہ حاجی کیمپ", + "Roman Urdu": "Old Haji Camp", + "English": "Old Haji Camp" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "garden", + "label": { + "Urdu": "گارڈن", + "Roman Urdu": "Garden", + "English": "Garden" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "kharadar", + "label": { + "Urdu": "کھارادر", + "Roman Urdu": "Kharadar", + "English": "Kharadar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "city_railway_colony", + "label": { + "Urdu": "سٹی ریلوے کالونی", + "Roman Urdu": "City Railway Colony", + "English": "City Railway Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "nanak_wara", + "label": { + "Urdu": "ناناک واڑا", + "Roman Urdu": "Nanak Wara", + "English": "Nanak Wara" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "gazdarabad", + "label": { + "Urdu": "گزدرآباد", + "Roman Urdu": "Gazdarabad", + "English": "Gazdarabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "millat_nagar_islam_pura", + "label": { + "Urdu": "ملت نگر اسلام پورا", + "Roman Urdu": "Millat Nagar/Islam Pura", + "English": "Millat Nagar/Islam Pura" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "saddar_uc", + "label": { + "Urdu": "صدر یو سی", + "Roman Urdu": "Saddar UC", + "English": "Saddar UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "civil_line", + "label": { + "Urdu": "سول لائن", + "Roman Urdu": "Civil Line", + "English": "Civil Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "clifton", + "label": { + "Urdu": "کلفٹن", + "Roman Urdu": "Clifton", + "English": "Clifton" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "kehkashan", + "label": { + "Urdu": "کہکشان", + "Roman Urdu": "Kehkashan", + "English": "Kehkashan" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "natha_khan_goth", + "label": { + "Urdu": "ناتھا خان گوٹھ", + "Roman Urdu": "Natha Khan Goth", + "English": "Natha Khan Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "pak_sadat_colony", + "label": { + "Urdu": "پاک صدر کالونی", + "Roman Urdu": "Pak Sadat Colony", + "English": "Pak Sadat Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "drigh_colony", + "label": { + "Urdu": "ڈرگ کالونی", + "Roman Urdu": "Drigh Colony", + "English": "Drigh Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "raita_plot", + "label": { + "Urdu": "رائتا پلاٹ", + "Roman Urdu": "Raita Plot", + "English": "Raita Plot" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "moria_khan_goth", + "label": { + "Urdu": "موریا خان گوٹھ", + "Roman Urdu": "Moria Khan Goth", + "English": "Moria Khan Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "rafa_e_aam_society", + "label": { + "Urdu": "رفا عام سوسا ئٹی", + "Roman Urdu": "Rafa-e-Aam Society", + "English": "Rafa-e-Aam Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "al_falah_society", + "label": { + "Urdu": "الفلاح سوسا ئٹی", + "Roman Urdu": "Al-Falah Society", + "English": "Al-Falah Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "pak_colony", + "label": { + "Urdu": "پاک کالونی", + "Roman Urdu": "Pak Colony", + "English": "Pak Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "old_golimar", + "label": { + "Urdu": "پرانہ گولی مار", + "Roman Urdu": "Old Golimar", + "English": "Old Golimar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "jahanabad", + "label": { + "Urdu": "جہان آباد", + "Roman Urdu": "Jahanabad", + "English": "Jahanabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "metrovil", + "label": { + "Urdu": "میٹروویل", + "Roman Urdu": "Metrovil", + "English": "Metrovil" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "bhawani_chali", + "label": { + "Urdu": "بہوانی چالی", + "Roman Urdu": "Bhawani Chali", + "English": "Bhawani Chali" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "frontier_colony", + "label": { + "Urdu": "فرونٹر کالونی", + "Roman Urdu": "Frontier Colony", + "English": "Frontier Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "banaras_colony", + "label": { + "Urdu": "بنارس کالونی", + "Roman Urdu": "Banaras Colony", + "English": "Banaras Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "qasba_colony", + "label": { + "Urdu": "قصبہ کالونی", + "Roman Urdu": "Qasba Colony", + "English": "Qasba Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "islamia_colony", + "label": { + "Urdu": "اسلامیہ کالونی", + "Roman Urdu": "Islamia Colony", + "English": "Islamia Colony" + } + }, + { + "province": "na", + "city": "na", + "town": "na", + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + }, + { + "province": "na", + "city": "na", + "town": "na", + "name": "not_applicable", + "label": { + "Urdu": "قابل اطلاق نہیں", + "Roman Urdu": "Qaabil-e-atlaaq nahi", + "English": "Not Applicable" + } + } + ], + "gender": [ + { + "instance": { + "openmrs_code": "1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "male", + "label": { + "Urdu": "مرد/ لڑکا", + "Roman Urdu": "Mard/larka", + "English": "Male" + } + }, + { + "instance": { + "openmrs_code": "1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "female", + "label": { + "Urdu": "عورت/لڑکی", + "Roman Urdu": "Aurat/larki", + "English": "Female" + } + }, + { + "instance": { + "openmrs_code": "163163AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "transgender", + "label": { + "Urdu": "خواجہ سرہ", + "Roman Urdu": "Khwaja sira", + "English": "Transgender" + } + } + ], + "vaccines": [ + { + "instance": { + "openmrs_code": "1570AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "bcg", + "label": { + "Urdu": "بی سی جی", + "Roman Urdu": "BCG", + "English": "BCG" + } + }, + { + "instance": { + "openmrs_code": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv0", + "label": { + "Urdu": "او پی وی 0", + "Roman Urdu": "OPV 0", + "English": "OPV 0" + } + }, + { + "instance": { + "openmrs_code": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pcv1", + "label": { + "Urdu": "پی سی وی 1", + "Roman Urdu": "PCV 1", + "English": "PCV 1" + } + }, + { + "instance": { + "openmrs_code": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv1", + "label": { + "Urdu": "او پی وی 1", + "Roman Urdu": "OPV 1", + "English": "OPV 1" + } + }, + { + "instance": { + "openmrs_code": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "penta1", + "label": { + "Urdu": "پینٹا ویلنٹ 1", + "Roman Urdu": "Pentavalent 1", + "English": "Pentavalent 1" + } + }, + { + "instance": { + "openmrs_code": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pcv2", + "label": { + "Urdu": "پی سی وی 2", + "Roman Urdu": "PCV 2", + "English": "PCV 2" + } + }, + { + "instance": { + "openmrs_code": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv2", + "label": { + "Urdu": "او پی وی 2", + "Roman Urdu": "OPV 2", + "English": "OPV 2" + } + }, + { + "instance": { + "openmrs_code": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "penta2", + "label": { + "Urdu": "پینٹا ویلنٹ 2", + "Roman Urdu": "Pentavalent 2", + "English": "Pentavalent 2" + } + }, + { + "instance": { + "openmrs_code": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pcv3", + "label": { + "Urdu": "پی سی وی 3", + "Roman Urdu": "PCV 3", + "English": "PCV 3" + } + }, + { + "instance": { + "openmrs_code": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv3", + "label": { + "Urdu": "او پی وی 3", + "Roman Urdu": "OPV 3", + "English": "OPV 3" + } + }, + { + "instance": { + "openmrs_code": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "penta3", + "label": { + "Urdu": "پینٹا ویلنٹ 3", + "Roman Urdu": "Pentavalent 3", + "English": "Pentavalent 3" + } + }, + { + "instance": { + "openmrs_code": "82242AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "ipv", + "label": { + "Urdu": "آئی پی وی", + "Roman Urdu": "IPV", + "English": "IPV" + } + }, + { + "instance": { + "openmrs_code": "79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "measles1", + "label": { + "Urdu": "خسرہ 1", + "Roman Urdu": "Khasra 1", + "English": "Measles 1" + } + }, + { + "instance": { + "openmrs_code": "79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "measles2", + "label": { + "Urdu": "خسرہ 2", + "Roman Urdu": "Khasra 2", + "English": "Measles 2" + } + } + ], + "towns": [ + { + "province": "sindh", + "city": "karachi", + "name": "korangi", + "label": { + "Urdu": "کورنگی", + "Roman Urdu": "Korangi", + "English": "Korangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "landhi", + "label": { + "Urdu": "لانڈھی", + "Roman Urdu": "Landhi", + "English": "Landhi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "baldia", + "label": { + "Urdu": "بلدیہ", + "Roman Urdu": "Baldia", + "English": "Baldia" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "bin_qasim", + "label": { + "Urdu": "بن قاسم", + "Roman Urdu": "Bin Qasim", + "English": "Bin Qasim" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "gadap", + "label": { + "Urdu": "گڈاپ", + "Roman Urdu": "Gadap", + "English": "Gadap" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "gulberg", + "label": { + "Urdu": "گلبرگ", + "Roman Urdu": "Gulberg", + "English": "Gulberg" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "gulshan", + "label": { + "Urdu": "گلشن", + "Roman Urdu": "Gulshan", + "English": "Gulshan" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "jamshed", + "label": { + "Urdu": "جمشید", + "Roman Urdu": "Jamshed", + "English": "Jamshed" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "kiamari", + "label": { + "Urdu": "کیماری", + "Roman Urdu": "Kiamari", + "English": "Kiamari" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "liaquatabad", + "label": { + "Urdu": "لیاقت آباد", + "Roman Urdu": "Liaquatabad", + "English": "Liaquatabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "lyari", + "label": { + "Urdu": "لیاری", + "Roman Urdu": "Lyari", + "English": "Lyari" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "malir", + "label": { + "Urdu": "ملیر", + "Roman Urdu": "Malir", + "English": "Malir" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "new_karachi", + "label": { + "Urdu": "نیو کراچی", + "Roman Urdu": "New Karachi", + "English": "New Karachi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "north_nazimabad", + "label": { + "Urdu": "نارتھ ناظم آباد", + "Roman Urdu": "North Nazimabad", + "English": "North Nazimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "orangi", + "label": { + "Urdu": "اورنگی", + "Roman Urdu": "Orangi", + "English": "Orangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "saddar", + "label": { + "Urdu": "صدر", + "Roman Urdu": "Saddar", + "English": "Saddar" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "shah_faisal", + "label": { + "Urdu": "شاہ فیصل", + "Roman Urdu": "Shah Faisal", + "English": "Shah Faisal" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "site", + "label": { + "Urdu": "سائٹ", + "Roman Urdu": "S.I.T.E.", + "English": "S.I.T.E." + } + }, + { + "province": "na", + "city": "na", + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + }, + { + "province": "na", + "city": "na", + "name": "not_applicable", + "label": { + "Urdu": "قابل اطلاق نہیں", + "Roman Urdu": "Qaabil-e-atlaaq nahi", + "English": "Not Applicable" + } + } + ], + "cities": [ + { + "province": "sindh", + "name": "karachi", + "label": { + "Urdu": "کراچی", + "Roman Urdu": "Karachi", + "English": "Karachi" + } + }, + { + "province": "punjab", + "name": "hafizabad", + "label": { + "Urdu": "حافظ آباد", + "Roman Urdu": "Hafizabad", + "English": "Hafizabad" + } + }, + { + "province": "punjab", + "name": "muzaffargarh", + "label": { + "Urdu": "مظفر گڑھ", + "Roman Urdu": "Muzaffargarh", + "English": "Muzaffargarh" + } + }, + { + "province": "na", + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + }, + { + "province": "na", + "name": "not_applicable", + "label": { + "Urdu": "قابل اطلاق نہیں", + "Roman Urdu": "Not Applicable", + "English": "Not Applicable" + } + } + ], + "ethnicity": [ + { + "instance": { + "openmrs_code": "163215AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "punjabi", + "label": { + "Urdu": "پنجابی", + "Roman Urdu": "Punjabi", + "English": "Punjabi" + } + }, + { + "instance": { + "openmrs_code": "163216AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pushtuns", + "label": { + "Urdu": "پشتون", + "Roman Urdu": "Pushtun", + "English": "Pushtun" + } + }, + { + "instance": { + "openmrs_code": "163217AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "sindhi", + "label": { + "Urdu": "سندھی", + "Roman Urdu": "Sindhi", + "English": "Sindhi" + } + }, + { + "instance": { + "openmrs_code": "163218AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "saraiki", + "label": { + "Urdu": "سرائیکی", + "Roman Urdu": "Saraiki", + "English": "Saraiki" + } + }, + { + "instance": { + "openmrs_code": "163219AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "muhajir", + "label": { + "Urdu": "مہاجر", + "Roman Urdu": "Muhajir", + "English": "Muhajir" + } + }, + { + "instance": { + "openmrs_code": "163220AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "balochi", + "label": { + "Urdu": "بلوچی", + "Roman Urdu": "Balochi", + "English": "Balochi" + } + }, + { + "instance": { + "openmrs_code": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + } + ], + "yes_no": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ] + }, + "instance": { + "encounter_type": "Child Vaccination Enrollment" + }, + "version": "201604080617", + "id_string": "child_vaccination_enrollment", + "type": "survey", + "children": [ + { + "type": "hidden", + "name": "provider_uc" + }, + { + "type": "hidden", + "name": "provider_town" + }, + { + "type": "hidden", + "name": "provider_city" + }, + { + "type": "hidden", + "name": "provider_province" + }, + { + "type": "hidden", + "name": "provider_id" + }, + { + "instance": { + "openmrs_entity_id": "location_id", + "openmrs_entity": "encounter" + }, + "type": "hidden", + "name": "provider_location_id" + }, + { + "instance": { + "openmrs_entity_id": "Program Client ID", + "openmrs_entity": "person_identifier" + }, + "type": "hidden", + "name": "existing_program_client_id" + }, + { + "type": "hidden", + "name": "provider_location_name" + }, + { + "type": "note", + "name": "provider_location_note", + "label": { + "Urdu": "شہر: ${provider_city} ; ٹائون: ${provider_town} ; یوسی: ${provider_uc} ; سینٹرکا نام: ${provider_location_name}", + "English": "City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}", + "Roman Urdu": "Shehr: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center ka naam: ${provider_location_name}" + } + }, + { + "instance": { + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "start", + "name": "start" + }, + { + "instance": { + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "end", + "name": "end" + }, + { + "instance": { + "openmrs_entity_id": "163286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "today", + "name": "today" + }, + { + "instance": { + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "deviceid", + "name": "deviceid" + }, + { + "instance": { + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "subscriberid", + "name": "subscriberid" + }, + { + "instance": { + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "simserial", + "name": "simserial" + }, + { + "instance": { + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "phonenumber", + "name": "phonenumber" + }, + { + "name": "client_reg_date", + "hint": { + "Urdu": "بچے کو ویکسین لگنے کی تاریخ", + "English": "Date on which child was vaccinated", + "Roman Urdu": "Bachay ko vaccine lagnay ki tareekh" + }, + "bind": { + "jr:constraintMsg": { + "Urdu": "بچے کی پروگرام میں اندراج کی تاریخ مستقبل کی نہیں ہوسکتی", + "English": "Child registration date cannot be in the future", + "Roman Urdu": "Bachay ki program mai andraaj ki tareekh mustaqbil ki nahi hosakti" + }, + "required": "yes", + "constraint": ".<=${today}" + }, + "label": { + "Urdu": "بچے کی پروگرام میں اندراج کی تاریخ", + "English": "Child Registration date", + "Roman Urdu": "Bachay ki Program mai andraj ki tareekh" + }, + "instance": { + "openmrs_entity_id": "encounter_date", + "openmrs_entity": "encounter" + }, + "type": "date" + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "program_client_id", + "label": { + "Urdu": "کلائنٹ کی پروگرام آئی ڈی {existing_program_client_id}$", + "Roman Urdu": "Client ki program ID ${existing_program_client_id}", + "English": "Program Client ID ${existing_program_client_id}" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "نمبر آٹھ ہندسوں پر مشتمل ہونا چاہئے", + "English": "Number should be 8 digits", + "Roman Urdu": "Number 8 hindason par mushtamil hona chahiye" + }, + "required": "yes", + "constraint": "string-length(.) = 8" + }, + "type": "integer", + "instance": { + "openmrs_entity_id": "EPI Card Number", + "openmrs_entity": "person_attribute" + }, + "name": "epi_card_number", + "label": { + "Urdu": "کارڈ نمبر", + "English": "EPI Card Number", + "Roman Urdu": "EPI Card Number" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "نام تین سے پچیس حروف پر مشتمل ہونا چاہئے", + "English": "Name should be 3 to 25 characters long", + "Roman Urdu": "Naam 3 say 25 huroof par mushtamil hona chahiye" + }, + "required": "yes", + "constraint": "regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')" + }, + "type": "text", + "instance": { + "openmrs_entity_id": "first_name", + "openmrs_entity": "person" + }, + "name": "first_name", + "label": { + "Urdu": "نام", + "English": "First Name", + "Roman Urdu": "Naam" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "نام تین سے پچیس حروف پر مشتمل ہونا چاہئے", + "English": "Name should be 3 to 25 characters long", + "Roman Urdu": "Naam 3 say 25 huroof par mushtamil hona chahiye" + }, + "required": "yes", + "constraint": "regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')" + }, + "type": "text", + "instance": { + "openmrs_entity_id": "last_name", + "openmrs_entity": "person" + }, + "name": "last_name", + "label": { + "Urdu": "والد کا نام", + "English": "Last name", + "Roman Urdu": "Waalid ka naam" + } + }, + { + "default": "yes", + "label": { + "Urdu": "کیا تاریخ پیدائش معلوم ہے؟", + "Roman Urdu": "Kya tareekh-e-pedaaish maloom hai?", + "English": "Is birthdate known?" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ], + "name": "member_birth_date_known" + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "یہ تاریخ مستقبل کی نہیں ہو سکتی۔\nاندراج کے لیے بچے کی عمر پانچ سال سے کم ہونی چاہئے۔", + "Roman Urdu": "Ye tareekh mustaqbil ki nahi ho sakti.\nAndraaj ke liye bachay ki umar paanch saal se kam honi chahiye.", + "English": "This cannot be a date in the future.\nChild's age must be less than five years for enrollment." + }, + "relevant": "selected(${member_birth_date_known}, 'yes')", + "constraint": ".<=${today} and (int((${today} - ${member_birth_date}) div 365) < 5)" + }, + "type": "date", + "name": "member_birth_date", + "label": { + "Urdu": "تاریخ پیدائش", + "Roman Urdu": "Tareekh-e-pedaaish", + "English": "Birth date" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "اندراج کے لیے بچے کی عمر پانچ سال سے کم ہونی چاہئے", + "Roman Urdu": "Andraaj ke liye bachay ki umar paanch saal se kam honi chahiye", + "English": "Child's age must be less than five years for enrollment" + }, + "relevant": "selected(${member_birth_date_known}, 'no')", + "constraint": ".<=60" + }, + "type": "integer", + "name": "age", + "label": { + "Urdu": "عمر (مہینوں میں)", + "Roman Urdu": "Umar (mahinon main)", + "English": "Age (months)" + } + }, + { + "bind": { + "calculate": "int((${today} - ${member_birth_date}) div 30.44)" + }, + "type": "calculate", + "name": "calc_age" + }, + { + "bind": { + "calculate": "date(${today} - int(${age} * 30.44))" + }, + "type": "calculate", + "name": "calc_dob" + }, + { + "bind": { + "calculate": "if(${member_birth_date_known}='yes', ${member_birth_date}, ${calc_dob})" + }, + "type": "calculate", + "name": "calc_dob_confirm", + "instance": { + "openmrs_entity_id": "birthdate", + "openmrs_entity": "person" + } + }, + { + "bind": { + "calculate": "if(${member_birth_date_known} = 'yes', '0', '1')" + }, + "type": "calculate", + "name": "calc_dob_estimated", + "instance": { + "openmrs_entity_id": "birthdate_estimated", + "openmrs_entity": "person" + } + }, + { + "bind": { + "calculate": "if(${member_birth_date_known}='yes', ${calc_age}, ${age})" + }, + "type": "calculate", + "name": "calc_age_confirm", + "instance": { + "openmrs_entity_id": "154384AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } + }, + { + "type": "note", + "name": "member_birth_date_note", + "label": { + "Urdu": "کلائنٹ کی تاریخ پیدائش:${calc_dob_confirm}", + "English": "Member Date of Birth: ${calc_dob_confirm}", + "Roman Urdu": "Member ki Tareekh-e-pedaaish: ${calc_dob_confirm}" + } + }, + { + "type": "note", + "name": "note_age", + "label": { + "Urdu": "عمر :{calc_age_confirm}$ مہینے", + "English": "Age: ${calc_age_confirm} months", + "Roman Urdu": "Umar: ${calc_age_confirm} mahinay" + } + }, + { + "control": { + "appearance": "minimal" + }, + "name": "gender", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "جنس", + "English": "Gender", + "Roman Urdu": "Jins" + }, + "instance": { + "openmrs_entity_id": "gender", + "openmrs_entity": "person" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "male", + "label": { + "Urdu": "مرد/ لڑکا", + "Roman Urdu": "Mard/larka", + "English": "Male" + } + }, + { + "instance": { + "openmrs_code": "1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "female", + "label": { + "Urdu": "عورت/لڑکی", + "Roman Urdu": "Aurat/larki", + "English": "Female" + } + }, + { + "instance": { + "openmrs_code": "163163AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "transgender", + "label": { + "Urdu": "خواجہ سرہ", + "Roman Urdu": "Khwaja sira", + "English": "Transgender" + } + } + ] + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "نام تین سے پچیس حروف پر مشتمل ہونا چاہئے", + "English": "Name should be 3 to 25 characters long", + "Roman Urdu": "Naam 3 say 25 huroof par mushtamil hona chahiye" + }, + "constraint": "regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')" + }, + "type": "text", + "instance": { + "openmrs_entity_id": "1593AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "mother_name", + "label": { + "Urdu": "والدہ کا نام", + "English": "Mother's Name", + "Roman Urdu": "Waaldah ka naam" + } + }, + { + "control": { + "appearance": "minimal" + }, + "name": "ethnicity", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "قومیت", + "English": "Ethnicity", + "Roman Urdu": "Qomiat" + }, + "instance": { + "openmrs_entity_id": "163153AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "163215AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "punjabi", + "label": { + "Urdu": "پنجابی", + "Roman Urdu": "Punjabi", + "English": "Punjabi" + } + }, + { + "instance": { + "openmrs_code": "163216AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pushtuns", + "label": { + "Urdu": "پشتون", + "Roman Urdu": "Pushtun", + "English": "Pushtun" + } + }, + { + "instance": { + "openmrs_code": "163217AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "sindhi", + "label": { + "Urdu": "سندھی", + "Roman Urdu": "Sindhi", + "English": "Sindhi" + } + }, + { + "instance": { + "openmrs_code": "163218AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "saraiki", + "label": { + "Urdu": "سرائیکی", + "Roman Urdu": "Saraiki", + "English": "Saraiki" + } + }, + { + "instance": { + "openmrs_code": "163219AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "muhajir", + "label": { + "Urdu": "مہاجر", + "Roman Urdu": "Muhajir", + "English": "Muhajir" + } + }, + { + "instance": { + "openmrs_code": "163220AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "balochi", + "label": { + "Urdu": "بلوچی", + "Roman Urdu": "Balochi", + "English": "Balochi" + } + }, + { + "instance": { + "openmrs_code": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + } + ] + }, + { + "bind": { + "relevant": "selected(${ethnicity}, 'other')" + }, + "type": "text", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "163330AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "ethnicity_other", + "label": { + "Urdu": "وضاحت کریں", + "Roman Urdu": "Wazaahat karain", + "English": "Please specify:" + } + }, + { + "control": { + "appearance": "minimal" + }, + "name": "province", + "default": "${provider_province}", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "صوبہ", + "Roman Urdu": "Suba", + "English": "Province" + }, + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "stateProvince", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one", + "children": [ + { + "name": "kpk", + "label": { + "Urdu": "خیبر پختون خواہ", + "English": "Khyber Pakhtunkhwa", + "Roman Urdu": "Khyber Pakhtunkhwa" + } + }, + { + "name": "sindh", + "label": { + "Urdu": "سندھ", + "English": "Sindh", + "Roman Urdu": "Sindh" + } + }, + { + "name": "balochistan", + "label": { + "Urdu": "بلوچستان", + "English": "Balochistan", + "Roman Urdu": "Balochistan" + } + }, + { + "name": "punjab", + "label": { + "Urdu": "پنجاب", + "English": "Punjab", + "Roman Urdu": "Punjab" + } + }, + { + "name": "gilgit_baltistan", + "label": { + "Urdu": "گلگت بلتستان", + "English": "Gilgit Baltistan", + "Roman Urdu": "Gilgit Baltistan" + } + }, + { + "name": "kashmir", + "label": { + "Urdu": "کشمیر", + "English": "Kashmir", + "Roman Urdu": "Kashmir" + } + }, + { + "name": "fata", + "label": { + "Urdu": "فاٹا", + "English": "FATA", + "Roman Urdu": "FATA" + } + }, + { + "name": "out_of_country", + "label": { + "Urdu": "ملک سے باہر", + "English": "Out of Country", + "Roman Urdu": "Mulk se baahir" + } + } + ] + }, + { + "control": { + "appearance": "minimal" + }, + "name": "city_village", + "choice_filter": "province=${province} or province='na'", + "default": "${provider_city}", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "شہر", + "Roman Urdu": "Shehr", + "English": "City" + }, + "itemset": "cities", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "cityVillage", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "town", + "choice_filter": "(province=${province} and city=${city_village} ) or city='na'", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "ٹاٰئون/ قصبہ/ بستی", + "Roman Urdu": "Town / Qasbah / Basti", + "English": "Town" + }, + "itemset": "towns", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "town", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "union_council", + "choice_filter": "(province=${province} and city=${city_village} and town=${town}) or town='na'", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "یونین کونسل", + "Roman Urdu": "Union Council", + "English": "Union Council" + }, + "itemset": "ucs", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "subTown", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one" + }, + { + "bind": { + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "house", + "openmrs_entity_parent": "usual_residence" + }, + "name": "house_number", + "label": { + "Urdu": "گھر کا نمبر", + "Roman Urdu": "Ghar ka number", + "English": "House Number" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "street", + "openmrs_entity_parent": "usual_residence" + }, + "name": "street", + "label": { + "Urdu": "گلی/کالونی/محلہ", + "Roman Urdu": "Gali/Colony/Mohalla", + "English": "Street" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "landmark", + "openmrs_entity_parent": "usual_residence" + }, + "name": "landmark", + "label": { + "Urdu": "گھر کے قریب کوئی مشہور جگہ", + "Roman Urdu": "Ghar ke qareeb koi mashoor jagah", + "English": "Land Mark" + } + }, + { + "bind": { + "calculate": "jr:choice-name(${province}, '${province}')" + }, + "type": "calculate", + "name": "provincename" + }, + { + "bind": { + "calculate": "jr:choice-name(${city_village}, '${city_village}')" + }, + "type": "calculate", + "name": "city_villagename" + }, + { + "bind": { + "calculate": "jr:choice-name(${town}, '${town}')" + }, + "type": "calculate", + "name": "townname" + }, + { + "bind": { + "calculate": "jr:choice-name(${union_council}, '${union_council}')" + }, + "type": "calculate", + "name": "union_councilname" + }, + { + "type": "note", + "name": "address", + "label": { + "Urdu": "پتہ: ${house_number}, ${street}, ${landmark}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}", + "English": "Address: ${house_number}, ${street}, ${landmark}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}", + "Roman Urdu": "Pata: ${house_number}, ${street}, ${landmark}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}" + } + }, + { + "instance": { + "openmrs_entity_id": "163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "geopoint", + "name": "centre_gps", + "label": { + "Urdu": "حاصل کردہ معلومات کی جگہ کے GPS کارڈینیٹس درج کریں", + "English": "Collect GPS coordinates of data entry location", + "Roman Urdu": "Hasil karda malomaat ki jaga ke GPS coordinates darj karain" + } + }, + { + "control": { + "appearance": "minimal" + }, + "name": "child_was_suffering_from_a_disease_at_birth", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "کیا بچہ پیدائش کے وقت کسی مرض میں مبتلا تھا؟", + "English": "Was the child suffering from a disease at birth?", + "Roman Urdu": "Kya bacha pedaaish ke waqt kissi marz mai mubtila tha?" + }, + "instance": { + "openmrs_entity_id": "159926AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ] + }, + { + "name": "reminders_approval", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "کیا آپ اپنے بچے کی اگلی ویکسین کی تاریخ کے لیے SMS موصول کرنا چاہتے ہیں؟", + "English": "Are you willing to receive SMS reminders for your next visit?", + "Roman Urdu": "Kya aap apnay bachay ki agli vaccine ki tareekh ke liye SMS mausool karna chahtay hain?" + }, + "instance": { + "openmrs_entity_id": "163089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ] + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "فون نمبر گیارہ ہندسوں پر مشتمل اور مندرجہ ذیل شکل میں ہونا چاہئے: *********03", + "English": "Phone number should be 11 digits in the following format: 03*********", + "Roman Urdu": "Phone number 11 hindason par mushtamil aur mundarja zail shakal main hona chahiey: 03*********" + }, + "relevant": "${reminders_approval}='yes'", + "constraint": "regex(., '^03[0-9]{9}$')" + }, + "type": "text", + "instance": { + "openmrs_entity_id": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "contact_phone_number", + "label": { + "Urdu": "موبائل نمبر:", + "English": "Mobile Number:", + "Roman Urdu": "Mobile number:" + } + }, + { + "bind": { + "calculate": "${calc_dob_confirm} + 42" + }, + "type": "calculate", + "name": "six_weeks" + }, + { + "bind": { + "calculate": "${calc_dob_confirm} + 70" + }, + "type": "calculate", + "name": "ten_weeks" + }, + { + "bind": { + "calculate": "${calc_dob_confirm} + 98" + }, + "type": "calculate", + "name": "forteen_weeks" + }, + { + "bind": { + "calculate": "${calc_dob_confirm} + 245" + }, + "type": "calculate", + "name": "nine_months" + }, + { + "bind": { + "calculate": "${calc_dob_confirm} + 458" + }, + "type": "calculate", + "name": "fifteen_months" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "vaccines", + "label": { + "Urdu": "پچھلی تاریخ جب کسی اور سینٹر پر ٹیکے لگواِے گیے یا قطرے پلائے گئے", + "Roman Urdu": "Pichli tareekh jab kissi aur center par teekay lagwaye gaye ya katray pilaey gaye", + "English": "Retro vaccines" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1421AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "select all that apply", + "children": [ + { + "instance": { + "openmrs_code": "1570AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "bcg", + "label": { + "Urdu": "بی سی جی", + "Roman Urdu": "BCG", + "English": "BCG" + } + }, + { + "instance": { + "openmrs_code": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv0", + "label": { + "Urdu": "او پی وی 0", + "Roman Urdu": "OPV 0", + "English": "OPV 0" + } + }, + { + "instance": { + "openmrs_code": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pcv1", + "label": { + "Urdu": "پی سی وی 1", + "Roman Urdu": "PCV 1", + "English": "PCV 1" + } + }, + { + "instance": { + "openmrs_code": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv1", + "label": { + "Urdu": "او پی وی 1", + "Roman Urdu": "OPV 1", + "English": "OPV 1" + } + }, + { + "instance": { + "openmrs_code": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "penta1", + "label": { + "Urdu": "پینٹا ویلنٹ 1", + "Roman Urdu": "Pentavalent 1", + "English": "Pentavalent 1" + } + }, + { + "instance": { + "openmrs_code": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pcv2", + "label": { + "Urdu": "پی سی وی 2", + "Roman Urdu": "PCV 2", + "English": "PCV 2" + } + }, + { + "instance": { + "openmrs_code": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv2", + "label": { + "Urdu": "او پی وی 2", + "Roman Urdu": "OPV 2", + "English": "OPV 2" + } + }, + { + "instance": { + "openmrs_code": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "penta2", + "label": { + "Urdu": "پینٹا ویلنٹ 2", + "Roman Urdu": "Pentavalent 2", + "English": "Pentavalent 2" + } + }, + { + "instance": { + "openmrs_code": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pcv3", + "label": { + "Urdu": "پی سی وی 3", + "Roman Urdu": "PCV 3", + "English": "PCV 3" + } + }, + { + "instance": { + "openmrs_code": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv3", + "label": { + "Urdu": "او پی وی 3", + "Roman Urdu": "OPV 3", + "English": "OPV 3" + } + }, + { + "instance": { + "openmrs_code": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "penta3", + "label": { + "Urdu": "پینٹا ویلنٹ 3", + "Roman Urdu": "Pentavalent 3", + "English": "Pentavalent 3" + } + }, + { + "instance": { + "openmrs_code": "82242AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "ipv", + "label": { + "Urdu": "آئی پی وی", + "Roman Urdu": "IPV", + "English": "IPV" + } + }, + { + "instance": { + "openmrs_code": "79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "measles1", + "label": { + "Urdu": "خسرہ 1", + "Roman Urdu": "Khasra 1", + "English": "Measles 1" + } + }, + { + "instance": { + "openmrs_code": "79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "measles2", + "label": { + "Urdu": "خسرہ 2", + "Roman Urdu": "Khasra 2", + "English": "Measles 2" + } + } + ] + }, + { + "bind": { + "relevant": "${vaccines} != ''" + }, + "type": "group", + "children": [ + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'bcg')", + "constraint": ".>= ${calc_dob_confirm} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "bcg_retro", + "label": { + "Urdu": "بی سی جی", + "Roman Urdu": "BCG", + "English": "BCG" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'opv0')", + "constraint": ".>= ${calc_dob_confirm} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv0_retro", + "label": { + "Urdu": "او پی وی 0", + "Roman Urdu": "OPV 0", + "English": "OPV 0" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'opv0')", + "calculate": "0" + }, + "type": "calculate", + "name": "opv0_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'pcv1')", + "constraint": ".>= ${calc_dob_confirm} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pcv1_retro", + "label": { + "Urdu": "پی سی وی 1", + "Roman Urdu": "PCV1", + "English": "PCV1" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'pcv1')", + "calculate": "1" + }, + "type": "calculate", + "name": "pcv1_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'opv1')", + "constraint": ".>= ${calc_dob_confirm} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv1_retro", + "label": { + "Urdu": "او پی وی1", + "Roman Urdu": "OPV 1", + "English": "OPV 1" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'opv1')", + "calculate": "1" + }, + "type": "calculate", + "name": "opv1_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'penta1')", + "constraint": ".>= ${calc_dob_confirm} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "penta1_retro", + "label": { + "Urdu": "پینٹا ویلنٹ 1", + "Roman Urdu": "Pentavalent 1", + "English": "Pentavalent 1" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'penta1')", + "calculate": "1" + }, + "type": "calculate", + "name": "penta1_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'pcv2')", + "constraint": ".>= ${calc_dob_confirm} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pcv2_retro", + "label": { + "Urdu": "پی سی وی 2", + "Roman Urdu": "PCV2", + "English": "PCV2" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'pcv2')", + "calculate": "2" + }, + "type": "calculate", + "name": "pcv2_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'opv2')", + "constraint": ".>= ${calc_dob_confirm} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv2_retro", + "label": { + "Urdu": "او پی وی 2", + "Roman Urdu": "OPV 2", + "English": "OPV 2" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'opv2')", + "calculate": "2" + }, + "type": "calculate", + "name": "opv2_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'penta2')", + "constraint": ".>= ${calc_dob_confirm} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "penta2_retro", + "label": { + "Urdu": "پینٹا ویلنٹ 2", + "Roman Urdu": "Pentavalent 2", + "English": "Pentavalent 2" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'penta2')", + "calculate": "2" + }, + "type": "calculate", + "name": "penta2_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'pcv3')", + "constraint": ".>= ${calc_dob_confirm} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pcv3_retro", + "label": { + "Urdu": "پی سی وی 3", + "Roman Urdu": "PCV3", + "English": "PCV3" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'pcv3')", + "calculate": "3" + }, + "type": "calculate", + "name": "pcv3_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'opv3')", + "constraint": ".>= ${calc_dob_confirm} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv3_retro", + "label": { + "Urdu": "او پی وی3", + "Roman Urdu": "OPV 3", + "English": "OPV 3" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'opv3')", + "calculate": "3" + }, + "type": "calculate", + "name": "opv3_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'penta3')", + "constraint": ".>= ${calc_dob_confirm} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "penta3_retro", + "label": { + "Urdu": "پینٹا ویلنٹ 3", + "Roman Urdu": "Pentavalent 3", + "English": "Pentavalent 3" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'penta3')", + "calculate": "3" + }, + "type": "calculate", + "name": "penta3_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'ipv')", + "constraint": ".>= ${calc_dob_confirm} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1422AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "ipv_retro", + "label": { + "Urdu": "آئی پی وی", + "Roman Urdu": "IPV", + "English": "IPV" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'measles1')", + "constraint": ".>= ${calc_dob_confirm} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "measles1_retro", + "label": { + "Urdu": "خسرہ 1", + "Roman Urdu": "Measles 1", + "English": "Measles 1" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'measles1')", + "calculate": "1" + }, + "type": "calculate", + "name": "measles1_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'measles2')", + "constraint": ".>= ${calc_dob_confirm} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "measles2_retro", + "label": { + "Urdu": "خسرہ 2", + "Roman Urdu": "Measles2", + "English": "Measles2" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'measles2')", + "calculate": "2" + }, + "type": "calculate", + "name": "measles2_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + } + ], + "name": "vaccines_group" + }, + { + "name": "vaccines_2", + "choice_filter": "name = if(selected(${vaccines}, 'bcg'), '', 'bcg') or \nname = if(selected(${vaccines}, 'opv0'), '', 'opv0') or \nname = if(selected(${vaccines}, 'penta1'), '', 'penta1') or \nname = if(selected(${vaccines}, 'opv1'), '', 'opv1') or \nname = if(selected(${vaccines}, 'pcv1'), '', 'pcv1') or \nname = if(selected(${vaccines}, 'penta2'), '', 'penta2') or \nname = if(selected(${vaccines}, 'opv2'), '', 'opv2') or \nname = if(selected(${vaccines}, 'pcv2'), '', 'pcv2') or \nname = if(selected(${vaccines}, 'penta3'), '', 'penta3') or \nname = if(selected(${vaccines}, 'pcv3'), '', 'pcv3') or \nname = if(selected(${vaccines}, 'opv3'), '', 'opv3') or \nname = if(selected(${vaccines}, 'ipv'), '', 'ipv') or \nname = if(selected(${vaccines}, 'measles1'), '', 'measles1') or \nname = if(selected(${vaccines}, 'measles2'), '', 'measles2')", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "آج کون کون سی ویکسین دی گئی ہیں؟", + "Roman Urdu": "Aaj kon kon si vaccine di gai hain?", + "English": "Vaccines administered today" + }, + "itemset": "vaccines", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1441AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "select all that apply" + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'bcg'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "bcg", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'opv0'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "opv0", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'opv0')", + "calculate": "0" + }, + "type": "calculate", + "name": "opv0_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'pcv1'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "pcv1", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'pcv1')", + "calculate": "1" + }, + "type": "calculate", + "name": "pcv1_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'opv1'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "opv1", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'opv1')", + "calculate": "1" + }, + "type": "calculate", + "name": "opv1_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'penta1'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "penta1", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'penta1')", + "calculate": "1" + }, + "type": "calculate", + "name": "penta1_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'pcv2'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "pcv2", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'pcv2')", + "calculate": "2" + }, + "type": "calculate", + "name": "pcv2_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'opv2'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "opv2", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'opv2')", + "calculate": "2" + }, + "type": "calculate", + "name": "opv2_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'penta2'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "penta2", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'penta2')", + "calculate": "2" + }, + "type": "calculate", + "name": "penta2_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'pcv3'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "pcv3", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'pcv3')", + "calculate": "3" + }, + "type": "calculate", + "name": "pcv3_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'opv3'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "opv3", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'opv3')", + "calculate": "3" + }, + "type": "calculate", + "name": "opv3_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'penta3'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "penta3", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'penta3')", + "calculate": "3" + }, + "type": "calculate", + "name": "penta3_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'ipv')", + "calculate": "if(selected(${vaccines_2}, 'ipv'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "ipv", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1422AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'measles1'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "measles1", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'measles1')", + "calculate": "1" + }, + "type": "calculate", + "name": "measles1_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'measles2'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "measles2", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'measles2')", + "calculate": "2" + }, + "type": "calculate", + "name": "measles2_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "control": { + "bodyless": true + }, + "type": "group", + "children": [ + { + "bind": { + "readonly": "true()", + "calculate": "concat('uuid:', uuid())" + }, + "type": "calculate", + "name": "instanceID" + } + ], + "name": "meta" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/form/child_enrollment/form.xml b/src/test/resources/form/child_enrollment/form.xml index f2bf53869..f369cde14 100644 --- a/src/test/resources/form/child_enrollment/form.xml +++ b/src/test/resources/form/child_enrollment/form.xml @@ -1,1699 +1,2536 @@ -
+ + - +

بچّوں کا انرولمنٹ رجسٹر برائے ٹیکاجات - Child Enrollment Vaccination Register

-
- - کیا تاریخ پیدائش معلوم ہے؟ - Is birthdate known? - - Kya tareekh-e-pedaaish maloom hai? -
- - -
-
-
-
- - کیا آپ اپنے بچے کی اگلی ویکسین کی تاریخ کے لیے SMS موصول کرنا چاہتے ہیں؟ - Are you willing to receive SMS reminders for your next visit? - - Kya aap apnay bachay ki agli vaccine ki tareekh ke liye SMS mausool karna chahtay hain? - * -
- - -
+ + + + + + +
+
+ + کیا تاریخ پیدائش معلوم + ہے؟ + + Is birthdate known? + + + Kya tareekh-e-pedaaish + maloom hai? + + +
+ + +
+
-
-
-
-
- - آج کون کون سی ویکسین دی گئی ہیں؟ - Vaccines administered today - - Aaj kon kon si vaccine di gai hain? - * -
- - - بی سی جی - BCG - - BCG - او پی وی 0 - OPV 0 - - OPV 0 - پی سی وی 1 - PCV 1 - - PCV 1 - او پی وی 1 - OPV 1 - - OPV 1 - پینٹا ویلنٹ 1 - Pentavalent 1 - - Pentavalent 1 - پی سی وی 2 - PCV 2 - - PCV 2 - او پی وی 2 - OPV 2 - - OPV 2 - پینٹا ویلنٹ 2 - Pentavalent 2 - - Pentavalent 2 - پی سی وی 3 - PCV 3 - - PCV 3 - او پی وی 3 - OPV 3 - - OPV 3 - پینٹا ویلنٹ 3 - Pentavalent 3 - - Pentavalent 3 - آئی پی وی - IPV - - IPV - خسرہ 1 - Measles 1 - - Khasra 1 - خسرہ 2 - Measles 2 - - Khasra 2 -
-
-
+
+ + + + + + + + + + + + + + +
+ +
+
+ + + آج کون کون سی ویکسین دی گئی ہیں؟ + + Vaccines administered today + + + Aaj kon kon si vaccine di gai hain? + + * + +
+ + + بی سی جی + BCG + + BCG + او پی وی 0 + OPV 0 + + OPV 0 + + پی سی وی 1 + PCV 1 + + PCV 1 + + او پی وی 1 + OPV 1 + + OPV 1 + + پینٹا ویلنٹ 1 + + Pentavalent + 1 + + + Pentavalent + 1 + + پی سی وی 2 + PCV 2 + + PCV 2 + + او پی وی 2 + OPV 2 + + OPV 2 + + پینٹا ویلنٹ 2 + + Pentavalent + 2 + + + Pentavalent + 2 + + پی سی وی 3 + PCV 3 + + PCV 3 + + او پی وی 3 + OPV 3 + + OPV 3 + + پینٹا ویلنٹ 3 + + Pentavalent + 3 + + + + Pentavalent 3 + + آئی پی وی + IPV + + IPV + خسرہ 1 + Measles 1 + + + Khasra 1 + + خسرہ 2 + Measles 2 + + + Khasra 2 + + +
+
+
+ diff --git a/src/test/resources/form/child_enrollment/form_definition.json b/src/test/resources/form/child_enrollment/form_definition.json index 1ce99a2b6..a012a9057 100644 --- a/src/test/resources/form/child_enrollment/form_definition.json +++ b/src/test/resources/form/child_enrollment/form_definition.json @@ -1,346 +1,457 @@ { - "form_data_definition_version" : "1", - "form" : { - "bind_type" : "pkchild", - "default_bind_path" : "/model/instance/Child_Vaccination_Enrollment/", - "fields" : [ { - "name" : "id", - "shouldLoadValue" : true - }, { - "name" : "provider_uc", - "bind" : "/model/instance/Child_Vaccination_Enrollment/provider_uc", - "shouldLoadValue" : true - }, { - "name" : "provider_town", - "bind" : "/model/instance/Child_Vaccination_Enrollment/provider_town", - "shouldLoadValue" : true - }, { - "name" : "provider_city", - "bind" : "/model/instance/Child_Vaccination_Enrollment/provider_city", - "shouldLoadValue" : true - }, { - "name" : "provider_province", - "bind" : "/model/instance/Child_Vaccination_Enrollment/provider_province", - "shouldLoadValue" : true - }, { - "name" : "provider_id", - "bind" : "/model/instance/Child_Vaccination_Enrollment/provider_id", - "shouldLoadValue" : true - }, { - "name" : "provider_location_id", - "bind" : "/model/instance/Child_Vaccination_Enrollment/provider_location_id", - "shouldLoadValue" : true - }, { - "name" : "existing_program_client_id", - "bind" : "/model/instance/Child_Vaccination_Enrollment/existing_program_client_id", - "shouldLoadValue" : true - }, { - "name" : "provider_location_name", - "bind" : "/model/instance/Child_Vaccination_Enrollment/provider_location_name", - "shouldLoadValue" : true - }, { - "name" : "provider_location_note", - "bind" : "/model/instance/Child_Vaccination_Enrollment/provider_location_note" - }, { - "name" : "start", - "bind" : "/model/instance/Child_Vaccination_Enrollment/start" - }, { - "name" : "end", - "bind" : "/model/instance/Child_Vaccination_Enrollment/end" - }, { - "name" : "today", - "bind" : "/model/instance/Child_Vaccination_Enrollment/today" - }, { - "name" : "deviceid", - "bind" : "/model/instance/Child_Vaccination_Enrollment/deviceid" - }, { - "name" : "subscriberid", - "bind" : "/model/instance/Child_Vaccination_Enrollment/subscriberid" - }, { - "name" : "simserial", - "bind" : "/model/instance/Child_Vaccination_Enrollment/simserial" - }, { - "name" : "phonenumber", - "bind" : "/model/instance/Child_Vaccination_Enrollment/phonenumber" - }, { - "name" : "client_reg_date", - "bind" : "/model/instance/Child_Vaccination_Enrollment/client_reg_date" - }, { - "name" : "program_client_id", - "bind" : "/model/instance/Child_Vaccination_Enrollment/program_client_id" - }, { - "name" : "epi_card_number", - "bind" : "/model/instance/Child_Vaccination_Enrollment/epi_card_number" - }, { - "name" : "first_name", - "bind" : "/model/instance/Child_Vaccination_Enrollment/first_name" - }, { - "name" : "last_name", - "bind" : "/model/instance/Child_Vaccination_Enrollment/last_name" - }, { - "name" : "birth_date_known", - "bind" : "/model/instance/Child_Vaccination_Enrollment/member_birth_date_known" - }, { - "name" : "birth_date", - "bind" : "/model/instance/Child_Vaccination_Enrollment/member_birth_date" - }, { - "name" : "age", - "bind" : "/model/instance/Child_Vaccination_Enrollment/age" - }, { - "name" : "calc_age", - "bind" : "/model/instance/Child_Vaccination_Enrollment/calc_age" - }, { - "name" : "calc_dob", - "bind" : "/model/instance/Child_Vaccination_Enrollment/calc_dob" - }, { - "name" : "dob", - "bind" : "/model/instance/Child_Vaccination_Enrollment/calc_dob_confirm" - }, { - "name" : "calc_dob_estimated", - "bind" : "/model/instance/Child_Vaccination_Enrollment/calc_dob_estimated" - }, { - "name" : "calc_age_confirm", - "bind" : "/model/instance/Child_Vaccination_Enrollment/calc_age_confirm" - }, { - "name" : "gender", - "bind" : "/model/instance/Child_Vaccination_Enrollment/gender" - }, { - "name" : "mother_name", - "bind" : "/model/instance/Child_Vaccination_Enrollment/mother_name" - }, { - "name" : "ethnicity", - "bind" : "/model/instance/Child_Vaccination_Enrollment/ethnicity" - }, { - "name" : "ethnicity_other", - "bind" : "/model/instance/Child_Vaccination_Enrollment/ethnicity_other" - }, { - "name" : "province", - "bind" : "/model/instance/Child_Vaccination_Enrollment/province" - }, { - "name" : "city_village", - "bind" : "/model/instance/Child_Vaccination_Enrollment/city_village" - }, { - "name" : "town", - "bind" : "/model/instance/Child_Vaccination_Enrollment/town" - }, { - "name" : "union_council", - "bind" : "/model/instance/Child_Vaccination_Enrollment/union_council" - }, { - "name" : "house_number", - "bind" : "/model/instance/Child_Vaccination_Enrollment/house_number" - }, { - "name" : "street", - "bind" : "/model/instance/Child_Vaccination_Enrollment/street" - }, { - "name" : "landmark", - "bind" : "/model/instance/Child_Vaccination_Enrollment/landmark" - }, { - "name" : "provincename", - "bind" : "/model/instance/Child_Vaccination_Enrollment/provincename" - }, { - "name" : "city_villagename", - "bind" : "/model/instance/Child_Vaccination_Enrollment/city_villagename" - }, { - "name" : "townname", - "bind" : "/model/instance/Child_Vaccination_Enrollment/townname" - }, { - "name" : "union_councilname", - "bind" : "/model/instance/Child_Vaccination_Enrollment/union_councilname" - }, { - "name" : "address", - "bind" : "/model/instance/Child_Vaccination_Enrollment/address" - }, { - "name" : "centre_gps", - "bind" : "/model/instance/Child_Vaccination_Enrollment/centre_gps" - }, { - "name" : "child_was_suffering_from_a_disease_at_birth", - "bind" : "/model/instance/Child_Vaccination_Enrollment/child_was_suffering_from_a_disease_at_birth" - }, { - "name" : "reminders_approval", - "bind" : "/model/instance/Child_Vaccination_Enrollment/reminders_approval" - }, { - "name" : "contact_phone_number", - "bind" : "/model/instance/Child_Vaccination_Enrollment/contact_phone_number" - }, { - "name" : "six_weeks", - "bind" : "/model/instance/Child_Vaccination_Enrollment/six_weeks" - }, { - "name" : "ten_weeks", - "bind" : "/model/instance/Child_Vaccination_Enrollment/ten_weeks" - }, { - "name" : "forteen_weeks", - "bind" : "/model/instance/Child_Vaccination_Enrollment/forteen_weeks" - }, { - "name" : "nine_months", - "bind" : "/model/instance/Child_Vaccination_Enrollment/nine_months" - }, { - "name" : "fifteen_months", - "bind" : "/model/instance/Child_Vaccination_Enrollment/fifteen_months" - }, { - "name" : "vaccines", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines" - }, { - "name" : "bcg_retro", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/bcg_retro" - }, { - "name" : "opv0_retro", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv0_retro" - }, { - "name" : "opv0_dose", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv0_dose" - }, { - "name" : "pcv1_retro", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/pcv1_retro" - }, { - "name" : "pcv1_dose", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/pcv1_dose" - }, { - "name" : "opv1_retro", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv1_retro" - }, { - "name" : "opv1_dose", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv1_dose" - }, { - "name" : "penta1_retro", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/penta1_retro" - }, { - "name" : "penta1_dose", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/penta1_dose" - }, { - "name" : "pcv2_retro", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/pcv2_retro" - }, { - "name" : "pcv2_dose", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/pcv2_dose" - }, { - "name" : "opv2_retro", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv2_retro" - }, { - "name" : "opv2_dose", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv2_dose" - }, { - "name" : "penta2_retro", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/penta2_retro" - }, { - "name" : "penta2_dose", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/penta2_dose" - }, { - "name" : "pcv3_retro", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/pcv3_retro" - }, { - "name" : "pcv3_dose", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/pcv3_dose" - }, { - "name" : "opv3_retro", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv3_retro" - }, { - "name" : "opv3_dose", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv3_dose" - }, { - "name" : "penta3_retro", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/penta3_retro" - }, { - "name" : "penta3_dose", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/penta3_dose" - }, { - "name" : "ipv_retro", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/ipv_retro" - }, { - "name" : "measles1_retro", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/measles1_retro" - }, { - "name" : "measles1_dose", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/measles1_dose" - }, { - "name" : "measles2_retro", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/measles2_retro" - }, { - "name" : "measles2_dose", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_group/measles2_dose" - }, { - "name" : "vaccines_2", - "bind" : "/model/instance/Child_Vaccination_Enrollment/vaccines_2" - }, { - "name" : "bcg", - "bind" : "/model/instance/Child_Vaccination_Enrollment/bcg" - }, { - "name" : "opv0", - "bind" : "/model/instance/Child_Vaccination_Enrollment/opv0" - }, { - "name" : "opv0_dose_today", - "bind" : "/model/instance/Child_Vaccination_Enrollment/opv0_dose_today" - }, { - "name" : "pcv1", - "bind" : "/model/instance/Child_Vaccination_Enrollment/pcv1" - }, { - "name" : "pcv1_dose_today", - "bind" : "/model/instance/Child_Vaccination_Enrollment/pcv1_dose_today" - }, { - "name" : "opv1", - "bind" : "/model/instance/Child_Vaccination_Enrollment/opv1" - }, { - "name" : "opv1_dose_today", - "bind" : "/model/instance/Child_Vaccination_Enrollment/opv1_dose_today" - }, { - "name" : "penta1", - "bind" : "/model/instance/Child_Vaccination_Enrollment/penta1" - }, { - "name" : "penta1_dose_today", - "bind" : "/model/instance/Child_Vaccination_Enrollment/penta1_dose_today" - }, { - "name" : "pcv2", - "bind" : "/model/instance/Child_Vaccination_Enrollment/pcv2" - }, { - "name" : "pcv2_dose_today", - "bind" : "/model/instance/Child_Vaccination_Enrollment/pcv2_dose_today" - }, { - "name" : "opv2", - "bind" : "/model/instance/Child_Vaccination_Enrollment/opv2" - }, { - "name" : "opv2_dose_today", - "bind" : "/model/instance/Child_Vaccination_Enrollment/opv2_dose_today" - }, { - "name" : "penta2", - "bind" : "/model/instance/Child_Vaccination_Enrollment/penta2" - }, { - "name" : "penta2_dose_today", - "bind" : "/model/instance/Child_Vaccination_Enrollment/penta2_dose_today" - }, { - "name" : "pcv3", - "bind" : "/model/instance/Child_Vaccination_Enrollment/pcv3" - }, { - "name" : "pcv3_dose_today", - "bind" : "/model/instance/Child_Vaccination_Enrollment/pcv3_dose_today" - }, { - "name" : "opv3", - "bind" : "/model/instance/Child_Vaccination_Enrollment/opv3" - }, { - "name" : "opv3_dose_today", - "bind" : "/model/instance/Child_Vaccination_Enrollment/opv3_dose_today" - }, { - "name" : "penta3", - "bind" : "/model/instance/Child_Vaccination_Enrollment/penta3" - }, { - "name" : "penta3_dose_today", - "bind" : "/model/instance/Child_Vaccination_Enrollment/penta3_dose_today" - }, { - "name" : "ipv", - "bind" : "/model/instance/Child_Vaccination_Enrollment/ipv" - }, { - "name" : "measles1", - "bind" : "/model/instance/Child_Vaccination_Enrollment/measles1" - }, { - "name" : "measles1_dose_today", - "bind" : "/model/instance/Child_Vaccination_Enrollment/measles1_dose_today" - }, { - "name" : "measles2", - "bind" : "/model/instance/Child_Vaccination_Enrollment/measles2" - }, { - "name" : "measles2_dose_today", - "bind" : "/model/instance/Child_Vaccination_Enrollment/measles2_dose_today" - }, { - "name" : "instanceID", - "bind" : "/model/instance/Child_Vaccination_Enrollment/meta/instanceID" - } ] + "form_data_definition_version": "1", + "form": { + "bind_type": "pkchild", + "default_bind_path": "/model/instance/Child_Vaccination_Enrollment/", + "fields": [ + { + "name": "id", + "shouldLoadValue": true + }, + { + "name": "provider_uc", + "bind": "/model/instance/Child_Vaccination_Enrollment/provider_uc", + "shouldLoadValue": true + }, + { + "name": "provider_town", + "bind": "/model/instance/Child_Vaccination_Enrollment/provider_town", + "shouldLoadValue": true + }, + { + "name": "provider_city", + "bind": "/model/instance/Child_Vaccination_Enrollment/provider_city", + "shouldLoadValue": true + }, + { + "name": "provider_province", + "bind": "/model/instance/Child_Vaccination_Enrollment/provider_province", + "shouldLoadValue": true + }, + { + "name": "provider_id", + "bind": "/model/instance/Child_Vaccination_Enrollment/provider_id", + "shouldLoadValue": true + }, + { + "name": "provider_location_id", + "bind": "/model/instance/Child_Vaccination_Enrollment/provider_location_id", + "shouldLoadValue": true + }, + { + "name": "existing_program_client_id", + "bind": "/model/instance/Child_Vaccination_Enrollment/existing_program_client_id", + "shouldLoadValue": true + }, + { + "name": "provider_location_name", + "bind": "/model/instance/Child_Vaccination_Enrollment/provider_location_name", + "shouldLoadValue": true + }, + { + "name": "provider_location_note", + "bind": "/model/instance/Child_Vaccination_Enrollment/provider_location_note" + }, + { + "name": "start", + "bind": "/model/instance/Child_Vaccination_Enrollment/start" + }, + { + "name": "end", + "bind": "/model/instance/Child_Vaccination_Enrollment/end" + }, + { + "name": "today", + "bind": "/model/instance/Child_Vaccination_Enrollment/today" + }, + { + "name": "deviceid", + "bind": "/model/instance/Child_Vaccination_Enrollment/deviceid" + }, + { + "name": "subscriberid", + "bind": "/model/instance/Child_Vaccination_Enrollment/subscriberid" + }, + { + "name": "simserial", + "bind": "/model/instance/Child_Vaccination_Enrollment/simserial" + }, + { + "name": "phonenumber", + "bind": "/model/instance/Child_Vaccination_Enrollment/phonenumber" + }, + { + "name": "client_reg_date", + "bind": "/model/instance/Child_Vaccination_Enrollment/client_reg_date" + }, + { + "name": "program_client_id", + "bind": "/model/instance/Child_Vaccination_Enrollment/program_client_id" + }, + { + "name": "epi_card_number", + "bind": "/model/instance/Child_Vaccination_Enrollment/epi_card_number" + }, + { + "name": "first_name", + "bind": "/model/instance/Child_Vaccination_Enrollment/first_name" + }, + { + "name": "last_name", + "bind": "/model/instance/Child_Vaccination_Enrollment/last_name" + }, + { + "name": "birth_date_known", + "bind": "/model/instance/Child_Vaccination_Enrollment/member_birth_date_known" + }, + { + "name": "birth_date", + "bind": "/model/instance/Child_Vaccination_Enrollment/member_birth_date" + }, + { + "name": "age", + "bind": "/model/instance/Child_Vaccination_Enrollment/age" + }, + { + "name": "calc_age", + "bind": "/model/instance/Child_Vaccination_Enrollment/calc_age" + }, + { + "name": "calc_dob", + "bind": "/model/instance/Child_Vaccination_Enrollment/calc_dob" + }, + { + "name": "dob", + "bind": "/model/instance/Child_Vaccination_Enrollment/calc_dob_confirm" + }, + { + "name": "calc_dob_estimated", + "bind": "/model/instance/Child_Vaccination_Enrollment/calc_dob_estimated" + }, + { + "name": "calc_age_confirm", + "bind": "/model/instance/Child_Vaccination_Enrollment/calc_age_confirm" + }, + { + "name": "gender", + "bind": "/model/instance/Child_Vaccination_Enrollment/gender" + }, + { + "name": "mother_name", + "bind": "/model/instance/Child_Vaccination_Enrollment/mother_name" + }, + { + "name": "ethnicity", + "bind": "/model/instance/Child_Vaccination_Enrollment/ethnicity" + }, + { + "name": "ethnicity_other", + "bind": "/model/instance/Child_Vaccination_Enrollment/ethnicity_other" + }, + { + "name": "province", + "bind": "/model/instance/Child_Vaccination_Enrollment/province" + }, + { + "name": "city_village", + "bind": "/model/instance/Child_Vaccination_Enrollment/city_village" + }, + { + "name": "town", + "bind": "/model/instance/Child_Vaccination_Enrollment/town" + }, + { + "name": "union_council", + "bind": "/model/instance/Child_Vaccination_Enrollment/union_council" + }, + { + "name": "house_number", + "bind": "/model/instance/Child_Vaccination_Enrollment/house_number" + }, + { + "name": "street", + "bind": "/model/instance/Child_Vaccination_Enrollment/street" + }, + { + "name": "landmark", + "bind": "/model/instance/Child_Vaccination_Enrollment/landmark" + }, + { + "name": "provincename", + "bind": "/model/instance/Child_Vaccination_Enrollment/provincename" + }, + { + "name": "city_villagename", + "bind": "/model/instance/Child_Vaccination_Enrollment/city_villagename" + }, + { + "name": "townname", + "bind": "/model/instance/Child_Vaccination_Enrollment/townname" + }, + { + "name": "union_councilname", + "bind": "/model/instance/Child_Vaccination_Enrollment/union_councilname" + }, + { + "name": "address", + "bind": "/model/instance/Child_Vaccination_Enrollment/address" + }, + { + "name": "centre_gps", + "bind": "/model/instance/Child_Vaccination_Enrollment/centre_gps" + }, + { + "name": "child_was_suffering_from_a_disease_at_birth", + "bind": "/model/instance/Child_Vaccination_Enrollment/child_was_suffering_from_a_disease_at_birth" + }, + { + "name": "reminders_approval", + "bind": "/model/instance/Child_Vaccination_Enrollment/reminders_approval" + }, + { + "name": "contact_phone_number", + "bind": "/model/instance/Child_Vaccination_Enrollment/contact_phone_number" + }, + { + "name": "six_weeks", + "bind": "/model/instance/Child_Vaccination_Enrollment/six_weeks" + }, + { + "name": "ten_weeks", + "bind": "/model/instance/Child_Vaccination_Enrollment/ten_weeks" + }, + { + "name": "forteen_weeks", + "bind": "/model/instance/Child_Vaccination_Enrollment/forteen_weeks" + }, + { + "name": "nine_months", + "bind": "/model/instance/Child_Vaccination_Enrollment/nine_months" + }, + { + "name": "fifteen_months", + "bind": "/model/instance/Child_Vaccination_Enrollment/fifteen_months" + }, + { + "name": "vaccines", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines" + }, + { + "name": "bcg_retro", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/bcg_retro" + }, + { + "name": "opv0_retro", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv0_retro" + }, + { + "name": "opv0_dose", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv0_dose" + }, + { + "name": "pcv1_retro", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/pcv1_retro" + }, + { + "name": "pcv1_dose", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/pcv1_dose" + }, + { + "name": "opv1_retro", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv1_retro" + }, + { + "name": "opv1_dose", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv1_dose" + }, + { + "name": "penta1_retro", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/penta1_retro" + }, + { + "name": "penta1_dose", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/penta1_dose" + }, + { + "name": "pcv2_retro", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/pcv2_retro" + }, + { + "name": "pcv2_dose", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/pcv2_dose" + }, + { + "name": "opv2_retro", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv2_retro" + }, + { + "name": "opv2_dose", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv2_dose" + }, + { + "name": "penta2_retro", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/penta2_retro" + }, + { + "name": "penta2_dose", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/penta2_dose" + }, + { + "name": "pcv3_retro", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/pcv3_retro" + }, + { + "name": "pcv3_dose", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/pcv3_dose" + }, + { + "name": "opv3_retro", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv3_retro" + }, + { + "name": "opv3_dose", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/opv3_dose" + }, + { + "name": "penta3_retro", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/penta3_retro" + }, + { + "name": "penta3_dose", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/penta3_dose" + }, + { + "name": "ipv_retro", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/ipv_retro" + }, + { + "name": "measles1_retro", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/measles1_retro" + }, + { + "name": "measles1_dose", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/measles1_dose" + }, + { + "name": "measles2_retro", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/measles2_retro" + }, + { + "name": "measles2_dose", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_group/measles2_dose" + }, + { + "name": "vaccines_2", + "bind": "/model/instance/Child_Vaccination_Enrollment/vaccines_2" + }, + { + "name": "bcg", + "bind": "/model/instance/Child_Vaccination_Enrollment/bcg" + }, + { + "name": "opv0", + "bind": "/model/instance/Child_Vaccination_Enrollment/opv0" + }, + { + "name": "opv0_dose_today", + "bind": "/model/instance/Child_Vaccination_Enrollment/opv0_dose_today" + }, + { + "name": "pcv1", + "bind": "/model/instance/Child_Vaccination_Enrollment/pcv1" + }, + { + "name": "pcv1_dose_today", + "bind": "/model/instance/Child_Vaccination_Enrollment/pcv1_dose_today" + }, + { + "name": "opv1", + "bind": "/model/instance/Child_Vaccination_Enrollment/opv1" + }, + { + "name": "opv1_dose_today", + "bind": "/model/instance/Child_Vaccination_Enrollment/opv1_dose_today" + }, + { + "name": "penta1", + "bind": "/model/instance/Child_Vaccination_Enrollment/penta1" + }, + { + "name": "penta1_dose_today", + "bind": "/model/instance/Child_Vaccination_Enrollment/penta1_dose_today" + }, + { + "name": "pcv2", + "bind": "/model/instance/Child_Vaccination_Enrollment/pcv2" + }, + { + "name": "pcv2_dose_today", + "bind": "/model/instance/Child_Vaccination_Enrollment/pcv2_dose_today" + }, + { + "name": "opv2", + "bind": "/model/instance/Child_Vaccination_Enrollment/opv2" + }, + { + "name": "opv2_dose_today", + "bind": "/model/instance/Child_Vaccination_Enrollment/opv2_dose_today" + }, + { + "name": "penta2", + "bind": "/model/instance/Child_Vaccination_Enrollment/penta2" + }, + { + "name": "penta2_dose_today", + "bind": "/model/instance/Child_Vaccination_Enrollment/penta2_dose_today" + }, + { + "name": "pcv3", + "bind": "/model/instance/Child_Vaccination_Enrollment/pcv3" + }, + { + "name": "pcv3_dose_today", + "bind": "/model/instance/Child_Vaccination_Enrollment/pcv3_dose_today" + }, + { + "name": "opv3", + "bind": "/model/instance/Child_Vaccination_Enrollment/opv3" + }, + { + "name": "opv3_dose_today", + "bind": "/model/instance/Child_Vaccination_Enrollment/opv3_dose_today" + }, + { + "name": "penta3", + "bind": "/model/instance/Child_Vaccination_Enrollment/penta3" + }, + { + "name": "penta3_dose_today", + "bind": "/model/instance/Child_Vaccination_Enrollment/penta3_dose_today" + }, + { + "name": "ipv", + "bind": "/model/instance/Child_Vaccination_Enrollment/ipv" + }, + { + "name": "measles1", + "bind": "/model/instance/Child_Vaccination_Enrollment/measles1" + }, + { + "name": "measles1_dose_today", + "bind": "/model/instance/Child_Vaccination_Enrollment/measles1_dose_today" + }, + { + "name": "measles2", + "bind": "/model/instance/Child_Vaccination_Enrollment/measles2" + }, + { + "name": "measles2_dose_today", + "bind": "/model/instance/Child_Vaccination_Enrollment/measles2_dose_today" + }, + { + "name": "instanceID", + "bind": "/model/instance/Child_Vaccination_Enrollment/meta/instanceID" + } + ] } } \ No newline at end of file diff --git a/src/test/resources/form/child_enrollment/form_submission1.json b/src/test/resources/form/child_enrollment/form_submission1.json index bb4e03776..45ba4899d 100644 --- a/src/test/resources/form/child_enrollment/form_submission1.json +++ b/src/test/resources/form/child_enrollment/form_submission1.json @@ -1,427 +1,427 @@ { - "_id": "ff5311680dfc931b443c435e1703d8a8", - "_rev": "1-f0e0db153894af4d10be9b0217ac8c68", - "type": "FormSubmission", - "anmId": "demotest", - "instanceId": "bb9a9683-018a-41b7-9dc6-af2fa88aba12", - "formName": "child_enrollment", - "entityId": "7976dc69-d749-4ec7-82ce-bda37f466f59", - "clientVersion": 1447133829039, - "formDataDefinitionVersion": "1", - "formInstance": { - "form_data_definition_version": "1", - "form": { - "bind_type": "pkchild", - "default_bind_path": "/model/instance/Child_Enrollment_Vaccination_Register", - "fields": [ - { - "name": "id", - "value": "7976dc69-d749-4ec7-82ce-bda37f466f59", - "source": "vaccine_child.id" - }, - { - "name": "provider_uc", - "value": "korangi", - "source": "vaccine_child.provider_uc" - }, - { - "name": "provider_town", - "value": "korangi", - "source": "vaccine_child.provider_town" - }, - { - "name": "provider_city", - "value": "karachi", - "source": "vaccine_child.provider_city" - }, - { - "name": "provider_province", - "value": "sindh", - "source": "vaccine_child.provider_province" - }, - { - "name": "existing_location", - "source": "vaccine_child.existing_location" - }, - { - "name": "location_name", - "source": "vaccine_child.location_name" - }, - { - "name": "provider_location_note", - "source": "vaccine_child.provider_location_note" - }, - { - "name": "child_reg_date", - "value": "2015-11-10", - "source": "vaccine_child.child_reg_date" - }, - { - "name": "existing_program_client_id", - "value": "0149-5", - "source": "vaccine_child.existing_program_client_id" - }, - { - "name": "epi_card_number", - "value": "12345", - "source": "vaccine_child.epi_card_number" - }, - { - "name": "first_name", - "value": "syed saad", - "source": "vaccine_child.first_name" - }, - { - "name": "last_name", - "value": "dddd", - "source": "vaccine_child.last_name" - }, - { - "name": "child_birth_date_known", - "value": "yes", - "source": "vaccine_child.child_birth_date_known" - }, - { - "name": "dob", - "value": "2015-11-10", - "source": "vaccine_child.child_birth_date" - }, - { - "name": "age", - "source": "vaccine_child.age" - }, - { - "name": "child_age", - "value": "0", - "source": "vaccine_child.child_age" - }, - { - "name": "child_dob", - "value": "2015-10-10", - "source": "vaccine_child.child_dob" - }, - { - "name": "chid_dob_confirm", - "value": "2015-10-10", - "source": "vaccine_child.chid_dob_confirm" - }, - { - "name": "child_dob_estimated", - "value": "0", - "source": "vaccine_child.child_dob_estimated" - }, - { - "name": "child_birth_date_note", - "source": "vaccine_child.child_birth_date_note" - }, - { - "name": "gender", - "value": "male", - "source": "vaccine_child.gender" - }, - { - "name": "father_name", - "value": "shamsher", - "source": "vaccine_child.father_name" - }, - { - "name": "mother_name", - "value": "ghbn", - "source": "vaccine_child.mother_name" - }, - { - "name": "ethnicity", - "value": "hhggg", - "source": "vaccine_child.ethnicity" - }, - { - "name": "province", - "value": "sindh", - "source": "vaccine_child.province" - }, - { - "name": "city_village", - "source": "vaccine_child.city_village" - }, - { - "name": "town", - "source": "vaccine_child.town" - }, - { - "name": "union_council", - "source": "vaccine_child.union_council" - }, - { - "name": "house_number", - "value": "152", - "source": "vaccine_child.house_number" - }, - { - "name": "street", - "value": "uhhh", - "source": "vaccine_child.street" - }, - { - "name": "landmark", - "source": "vaccine_child.landmark" - }, - { - "name": "center_gps", - "value": "24.8637 67.0757 0 30", - "source": "vaccine_child.center_gps" - }, - { - "name": "vaccines", - "source": "vaccine_child.vaccines" - }, - { - "name": "bcg", - "source": "vaccine_child.bcg" - }, - { - "name": "opv_0_retro", - "source": "vaccine_child.opv_0_retro" - }, - { - "name": "opv_0_dose", - "value": "0", - "source": "vaccine_child.opv_0_dose" - }, - { - "name": "pcv_1_retro", - "source": "vaccine_child.pcv_1_retro" - }, - { - "name": "pcv_1_dose", - "value": "1", - "source": "vaccine_child.pcv_1_dose" - }, - { - "name": "opv_1_retro", - "source": "vaccine_child.opv_1_retro" - }, - { - "name": "opv_1_dose", - "value": "1", - "source": "vaccine_child.opv_1_dose" - }, - { - "name": "pentavalent_1_retro", - "source": "vaccine_child.pentavalent_1_retro" - }, - { - "name": "pentavalent_1_dose", - "value": "1", - "source": "vaccine_child.pentavalent_1_dose" - }, - { - "name": "pcv_2_retro", - "source": "vaccine_child.pcv_2_retro" - }, - { - "name": "pcv_2_dose", - "value": "2", - "source": "vaccine_child.pcv_2_dose" - }, - { - "name": "opv_2_retro", - "source": "vaccine_child.opv_2_retro" - }, - { - "name": "opv_2_dose", - "value": "2", - "source": "vaccine_child.opv_2_dose" - }, - { - "name": "pentavalent_2_retro", - "source": "vaccine_child.pentavalent_2_retro" - }, - { - "name": "pentavalent_2_dose", - "value": "2", - "source": "vaccine_child.pentavalent_2_dose" - }, - { - "name": "pcv_3_retro", - "source": "vaccine_child.pcv_3_retro" - }, - { - "name": "pcv_3_dose", - "value": "3", - "source": "vaccine_child.pcv_3_dose" - }, - { - "name": "opv_3_retro", - "source": "vaccine_child.opv_3_retro" - }, - { - "name": "opv_3_dose", - "value": "3", - "source": "vaccine_child.opv_3_dose" - }, - { - "name": "pentavalent_3_retro", - "source": "vaccine_child.pentavalent_3_retro" - }, - { - "name": "pentavalent_3_dose", - "value": "3", - "source": "vaccine_child.pentavalent_3_dose" - }, - { - "name": "measles_1_retro", - "source": "vaccine_child.measles_1_retro" - }, - { - "name": "measles_1_dose", - "value": "1", - "source": "vaccine_child.measles_1_dose" - }, - { - "name": "measles_2_retro", - "source": "vaccine_child.measles_2_retro" - }, - { - "name": "measles_2_dose", - "value": "2", - "source": "vaccine_child.measles_2_dose" - }, - { - "name": "vaccines_2", - "value": "opv_0 pcv_1", - "source": "vaccine_child.vaccines_2" - }, - { - "name": "child_was_suffering_from_a_disease_at_birth", - "value": "no", - "source": "vaccine_child.child_was_suffering_from_a_disease_at_birth" - }, - { - "name": "reminders_approval", - "value": "no", - "source": "vaccine_child.reminders_approval" - }, - { - "name": "contact_phone_number", - "source": "vaccine_child.contact_phone_number" - }, - { - "name": "bcg_today", - "source": "vaccine_child.bcg_today" - }, - { - "name": "opv_0", - "value": "2015-11-10", - "source": "vaccine_child.opv_0" - }, - { - "name": "opv_0_dose_today", - "value": "0", - "source": "vaccine_child.opv_0_dose_today" - }, - { - "name": "pcv_1", - "value": "2015-11-10", - "source": "vaccine_child.pcv_1" - }, - { - "name": "pcv_1_dose_today", - "value": "1", - "source": "vaccine_child.pcv_1_dose_today" - }, - { - "name": "opv_1", - "source": "vaccine_child.opv_1" - }, - { - "name": "opv_1_dose_today", - "value": "1", - "source": "vaccine_child.opv_1_dose_today" - }, - { - "name": "pentavalent_1", - "source": "vaccine_child.pentavalent_1" - }, - { - "name": "pentavalent_1_dose_today", - "value": "1", - "source": "vaccine_child.pentavalent_1_dose_today" - }, - { - "name": "pcv_2", - "source": "vaccine_child.pcv_2" - }, - { - "name": "pcv_2_dose_today", - "value": "2", - "source": "vaccine_child.pcv_2_dose_today" - }, - { - "name": "opv_2", - "source": "vaccine_child.opv_2" - }, - { - "name": "opv_2_dose_today", - "value": "2", - "source": "vaccine_child.opv_2_dose_today" - }, - { - "name": "pentavalent_2", - "source": "vaccine_child.pentavalent_2" - }, - { - "name": "pentavalent_2_dose_today", - "value": "2", - "source": "vaccine_child.pentavalent_2_dose_today" - }, - { - "name": "pcv_3", - "source": "vaccine_child.pcv_3" - }, - { - "name": "pcv_3_dose_today", - "value": "3", - "source": "vaccine_child.pcv_3_dose_today" - }, - { - "name": "opv_3", - "source": "vaccine_child.opv_3" - }, - { - "name": "opv_3_dose_today", - "value": "3", - "source": "vaccine_child.opv_3_dose_today" - }, - { - "name": "pentavalent_3", - "source": "vaccine_child.pentavalent_3" - }, - { - "name": "pentavalent_3_dose_today", - "value": "3", - "source": "vaccine_child.pentavalent_3_dose_today" - }, - { - "name": "measles_1", - "source": "vaccine_child.measles_1" - }, - { - "name": "measles_1_dose_today", - "value": "1", - "source": "vaccine_child.measles_1_dose_today" - }, - { - "name": "measles_2", - "source": "vaccine_child.measles_2" - }, - { - "name": "measles_2_dose_today", - "value": "2", - "source": "vaccine_child.measles_2_dose_today" - } - ] - } - }, - "serverVersion": 1447133792547 + "_id": "ff5311680dfc931b443c435e1703d8a8", + "_rev": "1-f0e0db153894af4d10be9b0217ac8c68", + "type": "FormSubmission", + "anmId": "demotest", + "instanceId": "bb9a9683-018a-41b7-9dc6-af2fa88aba12", + "formName": "child_enrollment", + "entityId": "7976dc69-d749-4ec7-82ce-bda37f466f59", + "clientVersion": 1447133829039, + "formDataDefinitionVersion": "1", + "formInstance": { + "form_data_definition_version": "1", + "form": { + "bind_type": "pkchild", + "default_bind_path": "/model/instance/Child_Enrollment_Vaccination_Register", + "fields": [ + { + "name": "id", + "value": "7976dc69-d749-4ec7-82ce-bda37f466f59", + "source": "vaccine_child.id" + }, + { + "name": "provider_uc", + "value": "korangi", + "source": "vaccine_child.provider_uc" + }, + { + "name": "provider_town", + "value": "korangi", + "source": "vaccine_child.provider_town" + }, + { + "name": "provider_city", + "value": "karachi", + "source": "vaccine_child.provider_city" + }, + { + "name": "provider_province", + "value": "sindh", + "source": "vaccine_child.provider_province" + }, + { + "name": "existing_location", + "source": "vaccine_child.existing_location" + }, + { + "name": "location_name", + "source": "vaccine_child.location_name" + }, + { + "name": "provider_location_note", + "source": "vaccine_child.provider_location_note" + }, + { + "name": "child_reg_date", + "value": "2015-11-10", + "source": "vaccine_child.child_reg_date" + }, + { + "name": "existing_program_client_id", + "value": "0149-5", + "source": "vaccine_child.existing_program_client_id" + }, + { + "name": "epi_card_number", + "value": "12345", + "source": "vaccine_child.epi_card_number" + }, + { + "name": "first_name", + "value": "syed saad", + "source": "vaccine_child.first_name" + }, + { + "name": "last_name", + "value": "dddd", + "source": "vaccine_child.last_name" + }, + { + "name": "child_birth_date_known", + "value": "yes", + "source": "vaccine_child.child_birth_date_known" + }, + { + "name": "dob", + "value": "2015-11-10", + "source": "vaccine_child.child_birth_date" + }, + { + "name": "age", + "source": "vaccine_child.age" + }, + { + "name": "child_age", + "value": "0", + "source": "vaccine_child.child_age" + }, + { + "name": "child_dob", + "value": "2015-10-10", + "source": "vaccine_child.child_dob" + }, + { + "name": "chid_dob_confirm", + "value": "2015-10-10", + "source": "vaccine_child.chid_dob_confirm" + }, + { + "name": "child_dob_estimated", + "value": "0", + "source": "vaccine_child.child_dob_estimated" + }, + { + "name": "child_birth_date_note", + "source": "vaccine_child.child_birth_date_note" + }, + { + "name": "gender", + "value": "male", + "source": "vaccine_child.gender" + }, + { + "name": "father_name", + "value": "shamsher", + "source": "vaccine_child.father_name" + }, + { + "name": "mother_name", + "value": "ghbn", + "source": "vaccine_child.mother_name" + }, + { + "name": "ethnicity", + "value": "hhggg", + "source": "vaccine_child.ethnicity" + }, + { + "name": "province", + "value": "sindh", + "source": "vaccine_child.province" + }, + { + "name": "city_village", + "source": "vaccine_child.city_village" + }, + { + "name": "town", + "source": "vaccine_child.town" + }, + { + "name": "union_council", + "source": "vaccine_child.union_council" + }, + { + "name": "house_number", + "value": "152", + "source": "vaccine_child.house_number" + }, + { + "name": "street", + "value": "uhhh", + "source": "vaccine_child.street" + }, + { + "name": "landmark", + "source": "vaccine_child.landmark" + }, + { + "name": "center_gps", + "value": "24.8637 67.0757 0 30", + "source": "vaccine_child.center_gps" + }, + { + "name": "vaccines", + "source": "vaccine_child.vaccines" + }, + { + "name": "bcg", + "source": "vaccine_child.bcg" + }, + { + "name": "opv_0_retro", + "source": "vaccine_child.opv_0_retro" + }, + { + "name": "opv_0_dose", + "value": "0", + "source": "vaccine_child.opv_0_dose" + }, + { + "name": "pcv_1_retro", + "source": "vaccine_child.pcv_1_retro" + }, + { + "name": "pcv_1_dose", + "value": "1", + "source": "vaccine_child.pcv_1_dose" + }, + { + "name": "opv_1_retro", + "source": "vaccine_child.opv_1_retro" + }, + { + "name": "opv_1_dose", + "value": "1", + "source": "vaccine_child.opv_1_dose" + }, + { + "name": "pentavalent_1_retro", + "source": "vaccine_child.pentavalent_1_retro" + }, + { + "name": "pentavalent_1_dose", + "value": "1", + "source": "vaccine_child.pentavalent_1_dose" + }, + { + "name": "pcv_2_retro", + "source": "vaccine_child.pcv_2_retro" + }, + { + "name": "pcv_2_dose", + "value": "2", + "source": "vaccine_child.pcv_2_dose" + }, + { + "name": "opv_2_retro", + "source": "vaccine_child.opv_2_retro" + }, + { + "name": "opv_2_dose", + "value": "2", + "source": "vaccine_child.opv_2_dose" + }, + { + "name": "pentavalent_2_retro", + "source": "vaccine_child.pentavalent_2_retro" + }, + { + "name": "pentavalent_2_dose", + "value": "2", + "source": "vaccine_child.pentavalent_2_dose" + }, + { + "name": "pcv_3_retro", + "source": "vaccine_child.pcv_3_retro" + }, + { + "name": "pcv_3_dose", + "value": "3", + "source": "vaccine_child.pcv_3_dose" + }, + { + "name": "opv_3_retro", + "source": "vaccine_child.opv_3_retro" + }, + { + "name": "opv_3_dose", + "value": "3", + "source": "vaccine_child.opv_3_dose" + }, + { + "name": "pentavalent_3_retro", + "source": "vaccine_child.pentavalent_3_retro" + }, + { + "name": "pentavalent_3_dose", + "value": "3", + "source": "vaccine_child.pentavalent_3_dose" + }, + { + "name": "measles_1_retro", + "source": "vaccine_child.measles_1_retro" + }, + { + "name": "measles_1_dose", + "value": "1", + "source": "vaccine_child.measles_1_dose" + }, + { + "name": "measles_2_retro", + "source": "vaccine_child.measles_2_retro" + }, + { + "name": "measles_2_dose", + "value": "2", + "source": "vaccine_child.measles_2_dose" + }, + { + "name": "vaccines_2", + "value": "opv_0 pcv_1", + "source": "vaccine_child.vaccines_2" + }, + { + "name": "child_was_suffering_from_a_disease_at_birth", + "value": "no", + "source": "vaccine_child.child_was_suffering_from_a_disease_at_birth" + }, + { + "name": "reminders_approval", + "value": "no", + "source": "vaccine_child.reminders_approval" + }, + { + "name": "contact_phone_number", + "source": "vaccine_child.contact_phone_number" + }, + { + "name": "bcg_today", + "source": "vaccine_child.bcg_today" + }, + { + "name": "opv_0", + "value": "2015-11-10", + "source": "vaccine_child.opv_0" + }, + { + "name": "opv_0_dose_today", + "value": "0", + "source": "vaccine_child.opv_0_dose_today" + }, + { + "name": "pcv_1", + "value": "2015-11-10", + "source": "vaccine_child.pcv_1" + }, + { + "name": "pcv_1_dose_today", + "value": "1", + "source": "vaccine_child.pcv_1_dose_today" + }, + { + "name": "opv_1", + "source": "vaccine_child.opv_1" + }, + { + "name": "opv_1_dose_today", + "value": "1", + "source": "vaccine_child.opv_1_dose_today" + }, + { + "name": "pentavalent_1", + "source": "vaccine_child.pentavalent_1" + }, + { + "name": "pentavalent_1_dose_today", + "value": "1", + "source": "vaccine_child.pentavalent_1_dose_today" + }, + { + "name": "pcv_2", + "source": "vaccine_child.pcv_2" + }, + { + "name": "pcv_2_dose_today", + "value": "2", + "source": "vaccine_child.pcv_2_dose_today" + }, + { + "name": "opv_2", + "source": "vaccine_child.opv_2" + }, + { + "name": "opv_2_dose_today", + "value": "2", + "source": "vaccine_child.opv_2_dose_today" + }, + { + "name": "pentavalent_2", + "source": "vaccine_child.pentavalent_2" + }, + { + "name": "pentavalent_2_dose_today", + "value": "2", + "source": "vaccine_child.pentavalent_2_dose_today" + }, + { + "name": "pcv_3", + "source": "vaccine_child.pcv_3" + }, + { + "name": "pcv_3_dose_today", + "value": "3", + "source": "vaccine_child.pcv_3_dose_today" + }, + { + "name": "opv_3", + "source": "vaccine_child.opv_3" + }, + { + "name": "opv_3_dose_today", + "value": "3", + "source": "vaccine_child.opv_3_dose_today" + }, + { + "name": "pentavalent_3", + "source": "vaccine_child.pentavalent_3" + }, + { + "name": "pentavalent_3_dose_today", + "value": "3", + "source": "vaccine_child.pentavalent_3_dose_today" + }, + { + "name": "measles_1", + "source": "vaccine_child.measles_1" + }, + { + "name": "measles_1_dose_today", + "value": "1", + "source": "vaccine_child.measles_1_dose_today" + }, + { + "name": "measles_2", + "source": "vaccine_child.measles_2" + }, + { + "name": "measles_2_dose_today", + "value": "2", + "source": "vaccine_child.measles_2_dose_today" + } + ] + } + }, + "serverVersion": 1447133792547 } diff --git a/src/test/resources/form/child_enrollment/form_submission2.json b/src/test/resources/form/child_enrollment/form_submission2.json index f4bd30636..1fd8dc6b2 100644 --- a/src/test/resources/form/child_enrollment/form_submission2.json +++ b/src/test/resources/form/child_enrollment/form_submission2.json @@ -1,428 +1,428 @@ { - "_id": "ff5311680dfc931b443c435e1703d8a8", - "_rev": "1-f0e0db153894af4d10be9b0217ac8c68", - "type": "FormSubmission", - "anmId": "demotest", - "instanceId": "bb9a9683-018a-41b7-9dc6-af2fa88aba12", - "formName": "child_enrollment", - "entityId": "7976dc69-d749-4ec7-82ce-bda37f466f59", - "clientVersion": 1447133829039, - "formDataDefinitionVersion": "1", - "formInstance": { - "form_data_definition_version": "1", - "form": { - "bind_type": "pkchild", - "default_bind_path": "/model/instance/Child_Enrollment_Vaccination_Register", - "fields": [ - { - "name": "id", - "value": "7976dc69-d749-4ec7-82ce-bda37f466f59", - "source": "vaccine_child.id" - }, - { - "name": "provider_uc", - "value": "korangi", - "source": "vaccine_child.provider_uc" - }, - { - "name": "provider_town", - "value": "korangi", - "source": "vaccine_child.provider_town" - }, - { - "name": "provider_city", - "value": "karachi", - "source": "vaccine_child.provider_city" - }, - { - "name": "provider_province", - "value": "sindh", - "source": "vaccine_child.provider_province" - }, - { - "name": "existing_location", - "source": "vaccine_child.existing_location" - }, - { - "name": "location_name", - "source": "vaccine_child.location_name" - }, - { - "name": "provider_location_note", - "source": "vaccine_child.provider_location_note" - }, - { - "name": "child_reg_date", - "value": "2015-11-10", - "source": "vaccine_child.child_reg_date" - }, - { - "name": "existing_program_client_id", - "value": "0149-5", - "source": "vaccine_child.existing_program_client_id" - }, - { - "name": "epi_card_number", - "value": "12345", - "source": "vaccine_child.epi_card_number" - }, - { - "name": "first_name", - "value": "syed saad", - "source": "vaccine_child.first_name" - }, - { - "name": "last_name", - "value": "dddd", - "source": "vaccine_child.last_name" - }, - { - "name": "child_birth_date_known", - "value": "yes", - "source": "vaccine_child.child_birth_date_known" - }, - { - "name": "dob", - "value": "2015-11-10", - "source": "vaccine_child.child_birth_date" - }, - { - "name": "age", - "source": "vaccine_child.age" - }, - { - "name": "child_age", - "value": "0", - "source": "vaccine_child.child_age" - }, - { - "name": "child_dob", - "value": "2015-10-10", - "source": "vaccine_child.child_dob" - }, - { - "name": "chid_dob_confirm", - "value": "2015-10-10", - "source": "vaccine_child.chid_dob_confirm" - }, - { - "name": "child_dob_estimated", - "value": "0", - "source": "vaccine_child.child_dob_estimated" - }, - { - "name": "child_birth_date_note", - "source": "vaccine_child.child_birth_date_note" - }, - { - "name": "gender", - "value": "male", - "source": "vaccine_child.gender" - }, - { - "name": "father_name", - "value": "shamsher", - "source": "vaccine_child.father_name" - }, - { - "name": "mother_name", - "value": "ghbn", - "source": "vaccine_child.mother_name" - }, - { - "name": "ethnicity", - "value": "hhggg", - "source": "vaccine_child.ethnicity" - }, - { - "name": "province", - "value": "sindh", - "source": "vaccine_child.province" - }, - { - "name": "city_village", - "source": "vaccine_child.city_village" - }, - { - "name": "town", - "source": "vaccine_child.town" - }, - { - "name": "union_council", - "source": "vaccine_child.union_council" - }, - { - "name": "house_number", - "value": "152", - "source": "vaccine_child.house_number" - }, - { - "name": "street", - "value": "uhhh", - "source": "vaccine_child.street" - }, - { - "name": "landmark", - "source": "vaccine_child.landmark" - }, - { - "name": "center_gps", - "value": "24.8637 67.0757 0 30", - "source": "vaccine_child.center_gps" - }, - { - "name": "vaccines", - "source": "vaccine_child.vaccines" - }, - { - "name": "bcg", - "source": "vaccine_child.bcg" - }, - { - "name": "opv_0_retro", - "source": "vaccine_child.opv_0_retro" - }, - { - "name": "opv_0_dose", - "value": "0", - "source": "vaccine_child.opv_0_dose" - }, - { - "name": "pcv_1_retro", - "source": "vaccine_child.pcv_1_retro" - }, - { - "name": "pcv_1_dose", - "value": "1", - "source": "vaccine_child.pcv_1_dose" - }, - { - "name": "opv_1_retro", - "source": "vaccine_child.opv_1_retro" - }, - { - "name": "opv_1_dose", - "value": "1", - "source": "vaccine_child.opv_1_dose" - }, - { - "name": "pentavalent_1_retro", - "value": "2015-11-09", - "source": "vaccine_child.pentavalent_1_retro" - }, - { - "name": "pentavalent_1_dose", - "value": "1", - "source": "vaccine_child.pentavalent_1_dose" - }, - { - "name": "pcv_2_retro", - "source": "vaccine_child.pcv_2_retro" - }, - { - "name": "pcv_2_dose", - "value": "2", - "source": "vaccine_child.pcv_2_dose" - }, - { - "name": "opv_2_retro", - "source": "vaccine_child.opv_2_retro" - }, - { - "name": "opv_2_dose", - "value": "2", - "source": "vaccine_child.opv_2_dose" - }, - { - "name": "pentavalent_2_retro", - "source": "vaccine_child.pentavalent_2_retro" - }, - { - "name": "pentavalent_2_dose", - "value": "2", - "source": "vaccine_child.pentavalent_2_dose" - }, - { - "name": "pcv_3_retro", - "source": "vaccine_child.pcv_3_retro" - }, - { - "name": "pcv_3_dose", - "value": "3", - "source": "vaccine_child.pcv_3_dose" - }, - { - "name": "opv_3_retro", - "source": "vaccine_child.opv_3_retro" - }, - { - "name": "opv_3_dose", - "value": "3", - "source": "vaccine_child.opv_3_dose" - }, - { - "name": "pentavalent_3_retro", - "source": "vaccine_child.pentavalent_3_retro" - }, - { - "name": "pentavalent_3_dose", - "value": "3", - "source": "vaccine_child.pentavalent_3_dose" - }, - { - "name": "measles_1_retro", - "source": "vaccine_child.measles_1_retro" - }, - { - "name": "measles_1_dose", - "value": "1", - "source": "vaccine_child.measles_1_dose" - }, - { - "name": "measles_2_retro", - "source": "vaccine_child.measles_2_retro" - }, - { - "name": "measles_2_dose", - "value": "2", - "source": "vaccine_child.measles_2_dose" - }, - { - "name": "vaccines_2", - "value": "opv_0 pcv_1", - "source": "vaccine_child.vaccines_2" - }, - { - "name": "child_was_suffering_from_a_disease_at_birth", - "value": "no", - "source": "vaccine_child.child_was_suffering_from_a_disease_at_birth" - }, - { - "name": "reminders_approval", - "value": "no", - "source": "vaccine_child.reminders_approval" - }, - { - "name": "contact_phone_number", - "source": "vaccine_child.contact_phone_number" - }, - { - "name": "bcg_today", - "source": "vaccine_child.bcg_today" - }, - { - "name": "opv_0", - "value": "2015-11-10", - "source": "vaccine_child.opv_0" - }, - { - "name": "opv_0_dose_today", - "value": "0", - "source": "vaccine_child.opv_0_dose_today" - }, - { - "name": "pcv_1", - "value": "2015-11-10", - "source": "vaccine_child.pcv_1" - }, - { - "name": "pcv_1_dose_today", - "value": "1", - "source": "vaccine_child.pcv_1_dose_today" - }, - { - "name": "opv_1", - "source": "vaccine_child.opv_1" - }, - { - "name": "opv_1_dose_today", - "value": "1", - "source": "vaccine_child.opv_1_dose_today" - }, - { - "name": "pentavalent_1", - "source": "vaccine_child.pentavalent_1" - }, - { - "name": "pentavalent_1_dose_today", - "value": "1", - "source": "vaccine_child.pentavalent_1_dose_today" - }, - { - "name": "pcv_2", - "source": "vaccine_child.pcv_2" - }, - { - "name": "pcv_2_dose_today", - "value": "2", - "source": "vaccine_child.pcv_2_dose_today" - }, - { - "name": "opv_2", - "source": "vaccine_child.opv_2" - }, - { - "name": "opv_2_dose_today", - "value": "2", - "source": "vaccine_child.opv_2_dose_today" - }, - { - "name": "pentavalent_2", - "source": "vaccine_child.pentavalent_2" - }, - { - "name": "pentavalent_2_dose_today", - "value": "2", - "source": "vaccine_child.pentavalent_2_dose_today" - }, - { - "name": "pcv_3", - "source": "vaccine_child.pcv_3" - }, - { - "name": "pcv_3_dose_today", - "value": "3", - "source": "vaccine_child.pcv_3_dose_today" - }, - { - "name": "opv_3", - "source": "vaccine_child.opv_3" - }, - { - "name": "opv_3_dose_today", - "value": "3", - "source": "vaccine_child.opv_3_dose_today" - }, - { - "name": "pentavalent_3", - "source": "vaccine_child.pentavalent_3" - }, - { - "name": "pentavalent_3_dose_today", - "value": "3", - "source": "vaccine_child.pentavalent_3_dose_today" - }, - { - "name": "measles_1", - "source": "vaccine_child.measles_1" - }, - { - "name": "measles_1_dose_today", - "value": "1", - "source": "vaccine_child.measles_1_dose_today" - }, - { - "name": "measles_2", - "source": "vaccine_child.measles_2" - }, - { - "name": "measles_2_dose_today", - "value": "2", - "source": "vaccine_child.measles_2_dose_today" - } - ] - } - }, - "serverVersion": 1447133792547 + "_id": "ff5311680dfc931b443c435e1703d8a8", + "_rev": "1-f0e0db153894af4d10be9b0217ac8c68", + "type": "FormSubmission", + "anmId": "demotest", + "instanceId": "bb9a9683-018a-41b7-9dc6-af2fa88aba12", + "formName": "child_enrollment", + "entityId": "7976dc69-d749-4ec7-82ce-bda37f466f59", + "clientVersion": 1447133829039, + "formDataDefinitionVersion": "1", + "formInstance": { + "form_data_definition_version": "1", + "form": { + "bind_type": "pkchild", + "default_bind_path": "/model/instance/Child_Enrollment_Vaccination_Register", + "fields": [ + { + "name": "id", + "value": "7976dc69-d749-4ec7-82ce-bda37f466f59", + "source": "vaccine_child.id" + }, + { + "name": "provider_uc", + "value": "korangi", + "source": "vaccine_child.provider_uc" + }, + { + "name": "provider_town", + "value": "korangi", + "source": "vaccine_child.provider_town" + }, + { + "name": "provider_city", + "value": "karachi", + "source": "vaccine_child.provider_city" + }, + { + "name": "provider_province", + "value": "sindh", + "source": "vaccine_child.provider_province" + }, + { + "name": "existing_location", + "source": "vaccine_child.existing_location" + }, + { + "name": "location_name", + "source": "vaccine_child.location_name" + }, + { + "name": "provider_location_note", + "source": "vaccine_child.provider_location_note" + }, + { + "name": "child_reg_date", + "value": "2015-11-10", + "source": "vaccine_child.child_reg_date" + }, + { + "name": "existing_program_client_id", + "value": "0149-5", + "source": "vaccine_child.existing_program_client_id" + }, + { + "name": "epi_card_number", + "value": "12345", + "source": "vaccine_child.epi_card_number" + }, + { + "name": "first_name", + "value": "syed saad", + "source": "vaccine_child.first_name" + }, + { + "name": "last_name", + "value": "dddd", + "source": "vaccine_child.last_name" + }, + { + "name": "child_birth_date_known", + "value": "yes", + "source": "vaccine_child.child_birth_date_known" + }, + { + "name": "dob", + "value": "2015-11-10", + "source": "vaccine_child.child_birth_date" + }, + { + "name": "age", + "source": "vaccine_child.age" + }, + { + "name": "child_age", + "value": "0", + "source": "vaccine_child.child_age" + }, + { + "name": "child_dob", + "value": "2015-10-10", + "source": "vaccine_child.child_dob" + }, + { + "name": "chid_dob_confirm", + "value": "2015-10-10", + "source": "vaccine_child.chid_dob_confirm" + }, + { + "name": "child_dob_estimated", + "value": "0", + "source": "vaccine_child.child_dob_estimated" + }, + { + "name": "child_birth_date_note", + "source": "vaccine_child.child_birth_date_note" + }, + { + "name": "gender", + "value": "male", + "source": "vaccine_child.gender" + }, + { + "name": "father_name", + "value": "shamsher", + "source": "vaccine_child.father_name" + }, + { + "name": "mother_name", + "value": "ghbn", + "source": "vaccine_child.mother_name" + }, + { + "name": "ethnicity", + "value": "hhggg", + "source": "vaccine_child.ethnicity" + }, + { + "name": "province", + "value": "sindh", + "source": "vaccine_child.province" + }, + { + "name": "city_village", + "source": "vaccine_child.city_village" + }, + { + "name": "town", + "source": "vaccine_child.town" + }, + { + "name": "union_council", + "source": "vaccine_child.union_council" + }, + { + "name": "house_number", + "value": "152", + "source": "vaccine_child.house_number" + }, + { + "name": "street", + "value": "uhhh", + "source": "vaccine_child.street" + }, + { + "name": "landmark", + "source": "vaccine_child.landmark" + }, + { + "name": "center_gps", + "value": "24.8637 67.0757 0 30", + "source": "vaccine_child.center_gps" + }, + { + "name": "vaccines", + "source": "vaccine_child.vaccines" + }, + { + "name": "bcg", + "source": "vaccine_child.bcg" + }, + { + "name": "opv_0_retro", + "source": "vaccine_child.opv_0_retro" + }, + { + "name": "opv_0_dose", + "value": "0", + "source": "vaccine_child.opv_0_dose" + }, + { + "name": "pcv_1_retro", + "source": "vaccine_child.pcv_1_retro" + }, + { + "name": "pcv_1_dose", + "value": "1", + "source": "vaccine_child.pcv_1_dose" + }, + { + "name": "opv_1_retro", + "source": "vaccine_child.opv_1_retro" + }, + { + "name": "opv_1_dose", + "value": "1", + "source": "vaccine_child.opv_1_dose" + }, + { + "name": "pentavalent_1_retro", + "value": "2015-11-09", + "source": "vaccine_child.pentavalent_1_retro" + }, + { + "name": "pentavalent_1_dose", + "value": "1", + "source": "vaccine_child.pentavalent_1_dose" + }, + { + "name": "pcv_2_retro", + "source": "vaccine_child.pcv_2_retro" + }, + { + "name": "pcv_2_dose", + "value": "2", + "source": "vaccine_child.pcv_2_dose" + }, + { + "name": "opv_2_retro", + "source": "vaccine_child.opv_2_retro" + }, + { + "name": "opv_2_dose", + "value": "2", + "source": "vaccine_child.opv_2_dose" + }, + { + "name": "pentavalent_2_retro", + "source": "vaccine_child.pentavalent_2_retro" + }, + { + "name": "pentavalent_2_dose", + "value": "2", + "source": "vaccine_child.pentavalent_2_dose" + }, + { + "name": "pcv_3_retro", + "source": "vaccine_child.pcv_3_retro" + }, + { + "name": "pcv_3_dose", + "value": "3", + "source": "vaccine_child.pcv_3_dose" + }, + { + "name": "opv_3_retro", + "source": "vaccine_child.opv_3_retro" + }, + { + "name": "opv_3_dose", + "value": "3", + "source": "vaccine_child.opv_3_dose" + }, + { + "name": "pentavalent_3_retro", + "source": "vaccine_child.pentavalent_3_retro" + }, + { + "name": "pentavalent_3_dose", + "value": "3", + "source": "vaccine_child.pentavalent_3_dose" + }, + { + "name": "measles_1_retro", + "source": "vaccine_child.measles_1_retro" + }, + { + "name": "measles_1_dose", + "value": "1", + "source": "vaccine_child.measles_1_dose" + }, + { + "name": "measles_2_retro", + "source": "vaccine_child.measles_2_retro" + }, + { + "name": "measles_2_dose", + "value": "2", + "source": "vaccine_child.measles_2_dose" + }, + { + "name": "vaccines_2", + "value": "opv_0 pcv_1", + "source": "vaccine_child.vaccines_2" + }, + { + "name": "child_was_suffering_from_a_disease_at_birth", + "value": "no", + "source": "vaccine_child.child_was_suffering_from_a_disease_at_birth" + }, + { + "name": "reminders_approval", + "value": "no", + "source": "vaccine_child.reminders_approval" + }, + { + "name": "contact_phone_number", + "source": "vaccine_child.contact_phone_number" + }, + { + "name": "bcg_today", + "source": "vaccine_child.bcg_today" + }, + { + "name": "opv_0", + "value": "2015-11-10", + "source": "vaccine_child.opv_0" + }, + { + "name": "opv_0_dose_today", + "value": "0", + "source": "vaccine_child.opv_0_dose_today" + }, + { + "name": "pcv_1", + "value": "2015-11-10", + "source": "vaccine_child.pcv_1" + }, + { + "name": "pcv_1_dose_today", + "value": "1", + "source": "vaccine_child.pcv_1_dose_today" + }, + { + "name": "opv_1", + "source": "vaccine_child.opv_1" + }, + { + "name": "opv_1_dose_today", + "value": "1", + "source": "vaccine_child.opv_1_dose_today" + }, + { + "name": "pentavalent_1", + "source": "vaccine_child.pentavalent_1" + }, + { + "name": "pentavalent_1_dose_today", + "value": "1", + "source": "vaccine_child.pentavalent_1_dose_today" + }, + { + "name": "pcv_2", + "source": "vaccine_child.pcv_2" + }, + { + "name": "pcv_2_dose_today", + "value": "2", + "source": "vaccine_child.pcv_2_dose_today" + }, + { + "name": "opv_2", + "source": "vaccine_child.opv_2" + }, + { + "name": "opv_2_dose_today", + "value": "2", + "source": "vaccine_child.opv_2_dose_today" + }, + { + "name": "pentavalent_2", + "source": "vaccine_child.pentavalent_2" + }, + { + "name": "pentavalent_2_dose_today", + "value": "2", + "source": "vaccine_child.pentavalent_2_dose_today" + }, + { + "name": "pcv_3", + "source": "vaccine_child.pcv_3" + }, + { + "name": "pcv_3_dose_today", + "value": "3", + "source": "vaccine_child.pcv_3_dose_today" + }, + { + "name": "opv_3", + "source": "vaccine_child.opv_3" + }, + { + "name": "opv_3_dose_today", + "value": "3", + "source": "vaccine_child.opv_3_dose_today" + }, + { + "name": "pentavalent_3", + "source": "vaccine_child.pentavalent_3" + }, + { + "name": "pentavalent_3_dose_today", + "value": "3", + "source": "vaccine_child.pentavalent_3_dose_today" + }, + { + "name": "measles_1", + "source": "vaccine_child.measles_1" + }, + { + "name": "measles_1_dose_today", + "value": "1", + "source": "vaccine_child.measles_1_dose_today" + }, + { + "name": "measles_2", + "source": "vaccine_child.measles_2" + }, + { + "name": "measles_2_dose_today", + "value": "2", + "source": "vaccine_child.measles_2_dose_today" + } + ] + } + }, + "serverVersion": 1447133792547 } diff --git a/src/test/resources/form/child_enrollment/form_submission3.json b/src/test/resources/form/child_enrollment/form_submission3.json index 495ef2b1c..c7e3382f4 100644 --- a/src/test/resources/form/child_enrollment/form_submission3.json +++ b/src/test/resources/form/child_enrollment/form_submission3.json @@ -1,261 +1,261 @@ { - "type": "FormSubmission", - "anmId": "demotest", - "instanceId": "1996b940-181e-46d5-bf8f-630bef2880a9", - "formName": "child_enrollment", - "entityId": "8cc8cbca-7c39-4c57-b8c7-5ccd5cf88af7", - "clientVersion": 1449572774009, - "formDataDefinitionVersion": "1", - "formInstance": { - "form_data_definition_version": "1", - "form": { - "bind_type": "pkchild", - "default_bind_path": "/model/instance/Child_Enrollment_Vaccination_Register", - "fields": [ - { - "name": "id", - "value": "8cc8cbca-7c39-4c57-b8c7-5ccd5cf88af7", - "source": "pkchild.id" - }, - { - "name": "child_reg_date", - "value": "2015-11-02", - "source": "pkchild.child_reg_date" - }, - { - "name": "dob", - "value": "2014-12-13", - "source": "pkchild.child_birth_date" - }, - { - "name": "age", - "value": "12", - "source": "pkchild.age" - }, - { - "name": "child_dob_estimated", - "value": "1", - "source": "pkchild.child_dob_estimated" - }, - { - "name": "vaccines", - "source": "pkchild.vaccines" - }, - { - "name": "bcg_retro", - "source": "pkchild.bcg_retro" - }, - { - "name": "opv_0_retro", - "source": "pkchild.opv_0_retro" - }, - { - "name": "opv_0_dose", - "source": "pkchild.opv_0_dose" - }, - { - "name": "pcv_1_retro", - "source": "pkchild.pcv_1_retro" - }, - { - "name": "pcv_1_dose", - "source": "pkchild.pcv_1_dose" - }, - { - "name": "opv_1_retro", - "source": "pkchild.opv_1_retro" - }, - { - "name": "opv_1_dose", - "source": "pkchild.opv_1_dose" - }, - { - "name": "pentavalent_1_retro", - "source": "pkchild.pentavalent_1_retro" - }, - { - "name": "pentavalent_1_dose", - "source": "pkchild.pentavalent_1_dose" - }, - { - "name": "pcv_2_retro", - "source": "pkchild.pcv_2_retro" - }, - { - "name": "pcv_2_dose", - "source": "pkchild.pcv_2_dose" - }, - { - "name": "opv_2_retro", - "source": "pkchild.opv_2_retro" - }, - { - "name": "opv_2_dose", - "source": "pkchild.opv_2_dose" - }, - { - "name": "pentavalent_2_retro", - "source": "pkchild.pentavalent_2_retro" - }, - { - "name": "pentavalent_2_dose", - "source": "pkchild.pentavalent_2_dose" - }, - { - "name": "pcv_3_retro", - "source": "pkchild.pcv_3_retro" - }, - { - "name": "pcv_3_dose", - "source": "pkchild.pcv_3_dose" - }, - { - "name": "opv_3_retro", - "source": "pkchild.opv_3_retro" - }, - { - "name": "opv_3_dose", - "source": "pkchild.opv_3_dose" - }, - { - "name": "pentavalent_3_retro", - "source": "pkchild.pentavalent_3_retro" - }, - { - "name": "pentavalent_3_dose", - "source": "pkchild.pentavalent_3_dose" - }, - { - "name": "measles_1_retro", - "source": "pkchild.measles_1_retro" - }, - { - "name": "measles_1_dose", - "source": "pkchild.measles_1_dose" - }, - { - "name": "measles_2_retro", - "source": "pkchild.measles_2_retro" - }, - { - "name": "measles_2_dose", - "source": "pkchild.measles_2_dose" - }, - { - "name": "vaccines2", - "value": "bcg opv_0", - "source": "pkchild.vaccines2" - }, - { - "name": "contact_phone_number", - "value": "3332525252", - "source": "pkchild.contact_phone_number" - }, - { - "name": "bcg", - "value": "2015-11-02", - "source": "pkchild.bcg" - }, - { - "name": "opv_0", - "value": "2015-11-02", - "source": "pkchild.opv_0" - }, - { - "name": "opv_0_dose_today", - "value": "0", - "source": "pkchild.opv_0_dose_today" - }, - { - "name": "pcv_1", - "source": "pkchild.pcv_1" - }, - { - "name": "pcv_1_dose_today", - "source": "pkchild.pcv_1_dose_today" - }, - { - "name": "opv_1", - "source": "pkchild.opv_1" - }, - { - "name": "opv_1_dose_today", - "source": "pkchild.opv_1_dose_today" - }, - { - "name": "pentavalent_1", - "source": "pkchild.pentavalent_1" - }, - { - "name": "pentavalent_1_dose_today", - "source": "pkchild.pentavalent_1_dose_today" - }, - { - "name": "pcv_2", - "source": "pkchild.pcv_2" - }, - { - "name": "pcv_2_dose_today", - "source": "pkchild.pcv_2_dose_today" - }, - { - "name": "opv_2", - "source": "pkchild.opv_2" - }, - { - "name": "opv_2_dose_today", - "source": "pkchild.opv_2_dose_today" - }, - { - "name": "pentavalent_2", - "source": "pkchild.pentavalent_2" - }, - { - "name": "pentavalent_2_dose_today", - "source": "pkchild.pentavalent_2_dose_today" - }, - { - "name": "pcv_3", - "source": "pkchild.pcv_3" - }, - { - "name": "pcv_3_dose_today", - "source": "pkchild.pcv_3_dose_today" - }, - { - "name": "opv_3", - "source": "pkchild.opv_3" - }, - { - "name": "opv_3_dose_today", - "source": "pkchild.opv_3_dose_today" - }, - { - "name": "pentavalent_3", - "source": "pkchild.pentavalent_3" - }, - { - "name": "pentavalent_3_dose_today", - "source": "pkchild.pentavalent_3_dose_today" - }, - { - "name": "measles_1", - "source": "pkchild.measles_1" - }, - { - "name": "measles_1_dose_today", - "source": "pkchild.measles_1_dose_today" - }, - { - "name": "measles_2", - "source": "pkchild.measles_2" - }, - { - "name": "measles_2_dose_today", - "source": "pkchild.measles_2_dose_today" - } - ] - } - }, - "serverVersion": 1449572944907 + "type": "FormSubmission", + "anmId": "demotest", + "instanceId": "1996b940-181e-46d5-bf8f-630bef2880a9", + "formName": "child_enrollment", + "entityId": "8cc8cbca-7c39-4c57-b8c7-5ccd5cf88af7", + "clientVersion": 1449572774009, + "formDataDefinitionVersion": "1", + "formInstance": { + "form_data_definition_version": "1", + "form": { + "bind_type": "pkchild", + "default_bind_path": "/model/instance/Child_Enrollment_Vaccination_Register", + "fields": [ + { + "name": "id", + "value": "8cc8cbca-7c39-4c57-b8c7-5ccd5cf88af7", + "source": "pkchild.id" + }, + { + "name": "child_reg_date", + "value": "2015-11-02", + "source": "pkchild.child_reg_date" + }, + { + "name": "dob", + "value": "2014-12-13", + "source": "pkchild.child_birth_date" + }, + { + "name": "age", + "value": "12", + "source": "pkchild.age" + }, + { + "name": "child_dob_estimated", + "value": "1", + "source": "pkchild.child_dob_estimated" + }, + { + "name": "vaccines", + "source": "pkchild.vaccines" + }, + { + "name": "bcg_retro", + "source": "pkchild.bcg_retro" + }, + { + "name": "opv_0_retro", + "source": "pkchild.opv_0_retro" + }, + { + "name": "opv_0_dose", + "source": "pkchild.opv_0_dose" + }, + { + "name": "pcv_1_retro", + "source": "pkchild.pcv_1_retro" + }, + { + "name": "pcv_1_dose", + "source": "pkchild.pcv_1_dose" + }, + { + "name": "opv_1_retro", + "source": "pkchild.opv_1_retro" + }, + { + "name": "opv_1_dose", + "source": "pkchild.opv_1_dose" + }, + { + "name": "pentavalent_1_retro", + "source": "pkchild.pentavalent_1_retro" + }, + { + "name": "pentavalent_1_dose", + "source": "pkchild.pentavalent_1_dose" + }, + { + "name": "pcv_2_retro", + "source": "pkchild.pcv_2_retro" + }, + { + "name": "pcv_2_dose", + "source": "pkchild.pcv_2_dose" + }, + { + "name": "opv_2_retro", + "source": "pkchild.opv_2_retro" + }, + { + "name": "opv_2_dose", + "source": "pkchild.opv_2_dose" + }, + { + "name": "pentavalent_2_retro", + "source": "pkchild.pentavalent_2_retro" + }, + { + "name": "pentavalent_2_dose", + "source": "pkchild.pentavalent_2_dose" + }, + { + "name": "pcv_3_retro", + "source": "pkchild.pcv_3_retro" + }, + { + "name": "pcv_3_dose", + "source": "pkchild.pcv_3_dose" + }, + { + "name": "opv_3_retro", + "source": "pkchild.opv_3_retro" + }, + { + "name": "opv_3_dose", + "source": "pkchild.opv_3_dose" + }, + { + "name": "pentavalent_3_retro", + "source": "pkchild.pentavalent_3_retro" + }, + { + "name": "pentavalent_3_dose", + "source": "pkchild.pentavalent_3_dose" + }, + { + "name": "measles_1_retro", + "source": "pkchild.measles_1_retro" + }, + { + "name": "measles_1_dose", + "source": "pkchild.measles_1_dose" + }, + { + "name": "measles_2_retro", + "source": "pkchild.measles_2_retro" + }, + { + "name": "measles_2_dose", + "source": "pkchild.measles_2_dose" + }, + { + "name": "vaccines2", + "value": "bcg opv_0", + "source": "pkchild.vaccines2" + }, + { + "name": "contact_phone_number", + "value": "3332525252", + "source": "pkchild.contact_phone_number" + }, + { + "name": "bcg", + "value": "2015-11-02", + "source": "pkchild.bcg" + }, + { + "name": "opv_0", + "value": "2015-11-02", + "source": "pkchild.opv_0" + }, + { + "name": "opv_0_dose_today", + "value": "0", + "source": "pkchild.opv_0_dose_today" + }, + { + "name": "pcv_1", + "source": "pkchild.pcv_1" + }, + { + "name": "pcv_1_dose_today", + "source": "pkchild.pcv_1_dose_today" + }, + { + "name": "opv_1", + "source": "pkchild.opv_1" + }, + { + "name": "opv_1_dose_today", + "source": "pkchild.opv_1_dose_today" + }, + { + "name": "pentavalent_1", + "source": "pkchild.pentavalent_1" + }, + { + "name": "pentavalent_1_dose_today", + "source": "pkchild.pentavalent_1_dose_today" + }, + { + "name": "pcv_2", + "source": "pkchild.pcv_2" + }, + { + "name": "pcv_2_dose_today", + "source": "pkchild.pcv_2_dose_today" + }, + { + "name": "opv_2", + "source": "pkchild.opv_2" + }, + { + "name": "opv_2_dose_today", + "source": "pkchild.opv_2_dose_today" + }, + { + "name": "pentavalent_2", + "source": "pkchild.pentavalent_2" + }, + { + "name": "pentavalent_2_dose_today", + "source": "pkchild.pentavalent_2_dose_today" + }, + { + "name": "pcv_3", + "source": "pkchild.pcv_3" + }, + { + "name": "pcv_3_dose_today", + "source": "pkchild.pcv_3_dose_today" + }, + { + "name": "opv_3", + "source": "pkchild.opv_3" + }, + { + "name": "opv_3_dose_today", + "source": "pkchild.opv_3_dose_today" + }, + { + "name": "pentavalent_3", + "source": "pkchild.pentavalent_3" + }, + { + "name": "pentavalent_3_dose_today", + "source": "pkchild.pentavalent_3_dose_today" + }, + { + "name": "measles_1", + "source": "pkchild.measles_1" + }, + { + "name": "measles_1_dose_today", + "source": "pkchild.measles_1_dose_today" + }, + { + "name": "measles_2", + "source": "pkchild.measles_2" + }, + { + "name": "measles_2_dose_today", + "source": "pkchild.measles_2_dose_today" + } + ] + } + }, + "serverVersion": 1449572944907 } \ No newline at end of file diff --git a/src/test/resources/form/child_enrollment/model.xml b/src/test/resources/form/child_enrollment/model.xml index 8a0f23a83..edefc42d2 100644 --- a/src/test/resources/form/child_enrollment/model.xml +++ b/src/test/resources/form/child_enrollment/model.xml @@ -1,7 +1,8 @@ - + @@ -39,21 +40,30 @@ - - ${provider_province} - ${provider_city} + + ${provider_province} + + ${provider_city} + - - + + - +
- + @@ -61,62 +71,116 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/form/child_followup/form_definition.json b/src/test/resources/form/child_followup/form_definition.json index 38d578690..426bbbdff 100644 --- a/src/test/resources/form/child_followup/form_definition.json +++ b/src/test/resources/form/child_followup/form_definition.json @@ -1,466 +1,605 @@ { - "form_data_definition_version" : "1", - "form" : { - "bind_type" : "pkchild", - "default_bind_path" : "/model/instance/Child_Vaccination_Followup/", - "fields" : [ { - "name" : "id", - "shouldLoadValue" : true - }, { - "name" : "provider_uc", - "bind" : "/model/instance/Child_Vaccination_Followup/provider_uc", - "shouldLoadValue" : true - }, { - "name" : "provider_town", - "bind" : "/model/instance/Child_Vaccination_Followup/provider_town", - "shouldLoadValue" : true - }, { - "name" : "provider_city", - "bind" : "/model/instance/Child_Vaccination_Followup/provider_city", - "shouldLoadValue" : true - }, { - "name" : "provider_province", - "bind" : "/model/instance/Child_Vaccination_Followup/provider_province", - "shouldLoadValue" : true - }, { - "name" : "existing_first_name", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_first_name", - "shouldLoadValue" : true - }, { - "name" : "existing_last_name", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_last_name", - "shouldLoadValue" : true - }, { - "name" : "existing_mother_name", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_mother_name", - "shouldLoadValue" : true - }, { - "name" : "existing_gender", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_gender", - "shouldLoadValue" : true - }, { - "name" : "existing_birth_date", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_client_birth_date", - "shouldLoadValue" : true - }, { - "name" : "existing_client_reg_date", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_client_reg_date", - "shouldLoadValue" : true - }, { - "name" : "existing_landmark", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_landmark", - "shouldLoadValue" : true - }, { - "name" : "existing_house_number", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_house_number", - "shouldLoadValue" : true - }, { - "name" : "existing_street", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_street", - "shouldLoadValue" : true - }, { - "name" : "existing_union_council", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_union_council", - "shouldLoadValue" : true - }, { - "name" : "existing_town", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_town", - "shouldLoadValue" : true - }, { - "name" : "existing_city_village", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_city_village", - "shouldLoadValue" : true - }, { - "name" : "existing_province", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_province", - "shouldLoadValue" : true - }, { - "name" : "existing_union_councilname", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_union_councilname", - "shouldLoadValue" : true - }, { - "name" : "existing_townname", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_townname", - "shouldLoadValue" : true - }, { - "name" : "existing_city_villagename", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_city_villagename", - "shouldLoadValue" : true - }, { - "name" : "existing_provincename", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_provincename", - "shouldLoadValue" : true - }, { - "name" : "existing_ethnicity", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_ethnicity", - "shouldLoadValue" : true - }, { - "name" : "existing_program_client_id", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_program_client_id", - "shouldLoadValue" : true - }, { - "name" : "existing_epi_card_number", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_epi_card_number", - "shouldLoadValue" : true - }, { - "name" : "existing_child_was_suffering_from_a_disease_at_birth", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_child_was_suffering_from_a_disease_at_birth", - "shouldLoadValue" : true - }, { - "name" : "existing_reminders_approval", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_reminders_approval", - "shouldLoadValue" : true - }, { - "name" : "existing_contact_phone_number", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_contact_phone_number", - "shouldLoadValue" : true - }, { - "name" : "e_bcg", - "bind" : "/model/instance/Child_Vaccination_Followup/e_bcg", - "shouldLoadValue" : true - }, { - "name" : "e_opv0", - "bind" : "/model/instance/Child_Vaccination_Followup/e_opv0", - "shouldLoadValue" : true - }, { - "name" : "e_penta2", - "bind" : "/model/instance/Child_Vaccination_Followup/e_penta2", - "shouldLoadValue" : true - }, { - "name" : "e_penta1", - "bind" : "/model/instance/Child_Vaccination_Followup/e_penta1", - "shouldLoadValue" : true - }, { - "name" : "e_penta3", - "bind" : "/model/instance/Child_Vaccination_Followup/e_penta3", - "shouldLoadValue" : true - }, { - "name" : "e_opv1", - "bind" : "/model/instance/Child_Vaccination_Followup/e_opv1", - "shouldLoadValue" : true - }, { - "name" : "e_opv2", - "bind" : "/model/instance/Child_Vaccination_Followup/e_opv2", - "shouldLoadValue" : true - }, { - "name" : "e_opv3", - "bind" : "/model/instance/Child_Vaccination_Followup/e_opv3", - "shouldLoadValue" : true - }, { - "name" : "e_pcv1", - "bind" : "/model/instance/Child_Vaccination_Followup/e_pcv1", - "shouldLoadValue" : true - }, { - "name" : "e_pcv2", - "bind" : "/model/instance/Child_Vaccination_Followup/e_pcv2", - "shouldLoadValue" : true - }, { - "name" : "e_pcv3", - "bind" : "/model/instance/Child_Vaccination_Followup/e_pcv3", - "shouldLoadValue" : true - }, { - "name" : "e_ipv", - "bind" : "/model/instance/Child_Vaccination_Followup/e_ipv", - "shouldLoadValue" : true - }, { - "name" : "e_measles1", - "bind" : "/model/instance/Child_Vaccination_Followup/e_measles1", - "shouldLoadValue" : true - }, { - "name" : "e_measles2", - "bind" : "/model/instance/Child_Vaccination_Followup/e_measles2", - "shouldLoadValue" : true - }, { - "name" : "provider_id", - "bind" : "/model/instance/Child_Vaccination_Followup/provider_id", - "shouldLoadValue" : true - }, { - "name" : "provider_location_id", - "bind" : "/model/instance/Child_Vaccination_Followup/provider_location_id", - "shouldLoadValue" : true - }, { - "name" : "provider_location_name", - "bind" : "/model/instance/Child_Vaccination_Followup/provider_location_name", - "shouldLoadValue" : true - }, { - "name" : "provider_location_note", - "bind" : "/model/instance/Child_Vaccination_Followup/provider_location_note" - }, { - "name" : "start", - "bind" : "/model/instance/Child_Vaccination_Followup/start" - }, { - "name" : "end", - "bind" : "/model/instance/Child_Vaccination_Followup/end" - }, { - "name" : "today", - "bind" : "/model/instance/Child_Vaccination_Followup/today" - }, { - "name" : "deviceid", - "bind" : "/model/instance/Child_Vaccination_Followup/deviceid" - }, { - "name" : "subscriberid", - "bind" : "/model/instance/Child_Vaccination_Followup/subscriberid" - }, { - "name" : "simserial", - "bind" : "/model/instance/Child_Vaccination_Followup/simserial" - }, { - "name" : "phonenumber", - "bind" : "/model/instance/Child_Vaccination_Followup/phonenumber" - }, { - "name" : "existing_client_reg_date_note", - "bind" : "/model/instance/Child_Vaccination_Followup/existing_client_reg_date_note" - }, { - "name" : "program_client_id_note", - "bind" : "/model/instance/Child_Vaccination_Followup/program_client_id_note" - }, { - "name" : "epi_card_number_note", - "bind" : "/model/instance/Child_Vaccination_Followup/epi_card_number_note" - }, { - "name" : "first_name_note", - "bind" : "/model/instance/Child_Vaccination_Followup/first_name_note" - }, { - "name" : "last_name_note", - "bind" : "/model/instance/Child_Vaccination_Followup/last_name_note" - }, { - "name" : "child_age", - "bind" : "/model/instance/Child_Vaccination_Followup/child_age" - }, { - "name" : "calc_dob_note", - "bind" : "/model/instance/Child_Vaccination_Followup/calc_dob_note" - }, { - "name" : "gender_note", - "bind" : "/model/instance/Child_Vaccination_Followup/gender_note" - }, { - "name" : "mother_name_note", - "bind" : "/model/instance/Child_Vaccination_Followup/mother_name_note" - }, { - "name" : "exisiting_ethnicity_note", - "bind" : "/model/instance/Child_Vaccination_Followup/exisiting_ethnicity_note" - }, { - "name" : "address", - "bind" : "/model/instance/Child_Vaccination_Followup/address" - }, { - "name" : "address_change", - "bind" : "/model/instance/Child_Vaccination_Followup/address_change" - }, { - "name" : "province", - "bind" : "/model/instance/Child_Vaccination_Followup/province" - }, { - "name" : "city_village", - "bind" : "/model/instance/Child_Vaccination_Followup/city_village" - }, { - "name" : "town", - "bind" : "/model/instance/Child_Vaccination_Followup/town" - }, { - "name" : "union_council", - "bind" : "/model/instance/Child_Vaccination_Followup/union_council" - }, { - "name" : "house_number", - "bind" : "/model/instance/Child_Vaccination_Followup/house_number" - }, { - "name" : "street", - "bind" : "/model/instance/Child_Vaccination_Followup/street" - }, { - "name" : "landmark", - "bind" : "/model/instance/Child_Vaccination_Followup/landmark" - }, { - "name" : "center_gps", - "bind" : "/model/instance/Child_Vaccination_Followup/center_gps" - }, { - "name" : "child_was_suffering_from_a_disease_at_birth_note", - "bind" : "/model/instance/Child_Vaccination_Followup/child_was_suffering_from_a_disease_at_birth_note" - }, { - "name" : "aefi", - "bind" : "/model/instance/Child_Vaccination_Followup/aefi" - }, { - "name" : "reminders_approval", - "bind" : "/model/instance/Child_Vaccination_Followup/reminders_approval" - }, { - "name" : "contact_phone_number", - "bind" : "/model/instance/Child_Vaccination_Followup/contact_phone_number" - }, { - "name" : "six_weeks", - "bind" : "/model/instance/Child_Vaccination_Followup/six_weeks" - }, { - "name" : "ten_weeks", - "bind" : "/model/instance/Child_Vaccination_Followup/ten_weeks" - }, { - "name" : "forteen_weeks", - "bind" : "/model/instance/Child_Vaccination_Followup/forteen_weeks" - }, { - "name" : "nine_months", - "bind" : "/model/instance/Child_Vaccination_Followup/nine_months" - }, { - "name" : "fifteen_months", - "bind" : "/model/instance/Child_Vaccination_Followup/fifteen_months" - }, { - "name" : "vaccines", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines" - }, { - "name" : "bcg_retro", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/bcg_retro" - }, { - "name" : "opv0_retro", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/opv0_retro" - }, { - "name" : "opv0_dose", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/opv0_dose" - }, { - "name" : "pcv1_retro", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/pcv1_retro" - }, { - "name" : "pcv1_dose", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/pcv1_dose" - }, { - "name" : "opv1_retro", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/opv1_retro" - }, { - "name" : "opv1_dose", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/opv1_dose" - }, { - "name" : "penta1_retro", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/penta1_retro" - }, { - "name" : "penta1_dose", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/penta1_dose" - }, { - "name" : "pcv2_retro", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/pcv2_retro" - }, { - "name" : "pcv2_dose", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/pcv2_dose" - }, { - "name" : "opv2_retro", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/opv2_retro" - }, { - "name" : "opv2_dose", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/opv2_dose" - }, { - "name" : "penta2_retro", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/penta2_retro" - }, { - "name" : "penta2_dose", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/penta2_dose" - }, { - "name" : "pcv3_retro", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/pcv3_retro" - }, { - "name" : "pcv3_dose", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/pcv3_dose" - }, { - "name" : "opv3_retro", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/opv3_retro" - }, { - "name" : "opv3_dose", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/opv3_dose" - }, { - "name" : "penta3_retro", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/penta3_retro" - }, { - "name" : "penta3_dose", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/penta3_dose" - }, { - "name" : "ipv_retro", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/ipv_retro" - }, { - "name" : "measles1_retro", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/measles1_retro" - }, { - "name" : "measles1_dose", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/measles1_dose" - }, { - "name" : "measles2_retro", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/measles2_retro" - }, { - "name" : "measles2_dose", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_group/measles2_dose" - }, { - "name" : "vaccines_2", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccines_2" - }, { - "name" : "vaccination_date", - "bind" : "/model/instance/Child_Vaccination_Followup/vaccination_date" - }, { - "name" : "bcg", - "bind" : "/model/instance/Child_Vaccination_Followup/bcg" - }, { - "name" : "opv0", - "bind" : "/model/instance/Child_Vaccination_Followup/opv0" - }, { - "name" : "opv0_dose_today", - "bind" : "/model/instance/Child_Vaccination_Followup/opv0_dose_today" - }, { - "name" : "pcv1", - "bind" : "/model/instance/Child_Vaccination_Followup/pcv1" - }, { - "name" : "pcv1_dose_today", - "bind" : "/model/instance/Child_Vaccination_Followup/pcv1_dose_today" - }, { - "name" : "opv1", - "bind" : "/model/instance/Child_Vaccination_Followup/opv1" - }, { - "name" : "opv1_dose_today", - "bind" : "/model/instance/Child_Vaccination_Followup/opv1_dose_today" - }, { - "name" : "penta1", - "bind" : "/model/instance/Child_Vaccination_Followup/penta1" - }, { - "name" : "penta1_dose_today", - "bind" : "/model/instance/Child_Vaccination_Followup/penta1_dose_today" - }, { - "name" : "pcv2", - "bind" : "/model/instance/Child_Vaccination_Followup/pcv2" - }, { - "name" : "pcv2_dose_today", - "bind" : "/model/instance/Child_Vaccination_Followup/pcv2_dose_today" - }, { - "name" : "opv2", - "bind" : "/model/instance/Child_Vaccination_Followup/opv2" - }, { - "name" : "opv2_dose_today", - "bind" : "/model/instance/Child_Vaccination_Followup/opv2_dose_today" - }, { - "name" : "penta2", - "bind" : "/model/instance/Child_Vaccination_Followup/penta2" - }, { - "name" : "penta2_dose_today", - "bind" : "/model/instance/Child_Vaccination_Followup/penta2_dose_today" - }, { - "name" : "pcv3", - "bind" : "/model/instance/Child_Vaccination_Followup/pcv3" - }, { - "name" : "pcv3_dose_today", - "bind" : "/model/instance/Child_Vaccination_Followup/pcv3_dose_today" - }, { - "name" : "opv3", - "bind" : "/model/instance/Child_Vaccination_Followup/opv3" - }, { - "name" : "opv3_dose_today", - "bind" : "/model/instance/Child_Vaccination_Followup/opv3_dose_today" - }, { - "name" : "penta3", - "bind" : "/model/instance/Child_Vaccination_Followup/penta3" - }, { - "name" : "penta3_dose_today", - "bind" : "/model/instance/Child_Vaccination_Followup/penta3_dose_today" - }, { - "name" : "ipv", - "bind" : "/model/instance/Child_Vaccination_Followup/ipv" - }, { - "name" : "measles1", - "bind" : "/model/instance/Child_Vaccination_Followup/measles1" - }, { - "name" : "measles1_dose_today", - "bind" : "/model/instance/Child_Vaccination_Followup/measles1_dose_today" - }, { - "name" : "measles2", - "bind" : "/model/instance/Child_Vaccination_Followup/measles2" - }, { - "name" : "measles2_dose_today", - "bind" : "/model/instance/Child_Vaccination_Followup/measles2_dose_today" - }, { - "name" : "instanceID", - "bind" : "/model/instance/Child_Vaccination_Followup/meta/instanceID" - } ] + "form_data_definition_version": "1", + "form": { + "bind_type": "pkchild", + "default_bind_path": "/model/instance/Child_Vaccination_Followup/", + "fields": [ + { + "name": "id", + "shouldLoadValue": true + }, + { + "name": "provider_uc", + "bind": "/model/instance/Child_Vaccination_Followup/provider_uc", + "shouldLoadValue": true + }, + { + "name": "provider_town", + "bind": "/model/instance/Child_Vaccination_Followup/provider_town", + "shouldLoadValue": true + }, + { + "name": "provider_city", + "bind": "/model/instance/Child_Vaccination_Followup/provider_city", + "shouldLoadValue": true + }, + { + "name": "provider_province", + "bind": "/model/instance/Child_Vaccination_Followup/provider_province", + "shouldLoadValue": true + }, + { + "name": "existing_first_name", + "bind": "/model/instance/Child_Vaccination_Followup/existing_first_name", + "shouldLoadValue": true + }, + { + "name": "existing_last_name", + "bind": "/model/instance/Child_Vaccination_Followup/existing_last_name", + "shouldLoadValue": true + }, + { + "name": "existing_mother_name", + "bind": "/model/instance/Child_Vaccination_Followup/existing_mother_name", + "shouldLoadValue": true + }, + { + "name": "existing_gender", + "bind": "/model/instance/Child_Vaccination_Followup/existing_gender", + "shouldLoadValue": true + }, + { + "name": "existing_birth_date", + "bind": "/model/instance/Child_Vaccination_Followup/existing_client_birth_date", + "shouldLoadValue": true + }, + { + "name": "existing_client_reg_date", + "bind": "/model/instance/Child_Vaccination_Followup/existing_client_reg_date", + "shouldLoadValue": true + }, + { + "name": "existing_landmark", + "bind": "/model/instance/Child_Vaccination_Followup/existing_landmark", + "shouldLoadValue": true + }, + { + "name": "existing_house_number", + "bind": "/model/instance/Child_Vaccination_Followup/existing_house_number", + "shouldLoadValue": true + }, + { + "name": "existing_street", + "bind": "/model/instance/Child_Vaccination_Followup/existing_street", + "shouldLoadValue": true + }, + { + "name": "existing_union_council", + "bind": "/model/instance/Child_Vaccination_Followup/existing_union_council", + "shouldLoadValue": true + }, + { + "name": "existing_town", + "bind": "/model/instance/Child_Vaccination_Followup/existing_town", + "shouldLoadValue": true + }, + { + "name": "existing_city_village", + "bind": "/model/instance/Child_Vaccination_Followup/existing_city_village", + "shouldLoadValue": true + }, + { + "name": "existing_province", + "bind": "/model/instance/Child_Vaccination_Followup/existing_province", + "shouldLoadValue": true + }, + { + "name": "existing_union_councilname", + "bind": "/model/instance/Child_Vaccination_Followup/existing_union_councilname", + "shouldLoadValue": true + }, + { + "name": "existing_townname", + "bind": "/model/instance/Child_Vaccination_Followup/existing_townname", + "shouldLoadValue": true + }, + { + "name": "existing_city_villagename", + "bind": "/model/instance/Child_Vaccination_Followup/existing_city_villagename", + "shouldLoadValue": true + }, + { + "name": "existing_provincename", + "bind": "/model/instance/Child_Vaccination_Followup/existing_provincename", + "shouldLoadValue": true + }, + { + "name": "existing_ethnicity", + "bind": "/model/instance/Child_Vaccination_Followup/existing_ethnicity", + "shouldLoadValue": true + }, + { + "name": "existing_program_client_id", + "bind": "/model/instance/Child_Vaccination_Followup/existing_program_client_id", + "shouldLoadValue": true + }, + { + "name": "existing_epi_card_number", + "bind": "/model/instance/Child_Vaccination_Followup/existing_epi_card_number", + "shouldLoadValue": true + }, + { + "name": "existing_child_was_suffering_from_a_disease_at_birth", + "bind": "/model/instance/Child_Vaccination_Followup/existing_child_was_suffering_from_a_disease_at_birth", + "shouldLoadValue": true + }, + { + "name": "existing_reminders_approval", + "bind": "/model/instance/Child_Vaccination_Followup/existing_reminders_approval", + "shouldLoadValue": true + }, + { + "name": "existing_contact_phone_number", + "bind": "/model/instance/Child_Vaccination_Followup/existing_contact_phone_number", + "shouldLoadValue": true + }, + { + "name": "e_bcg", + "bind": "/model/instance/Child_Vaccination_Followup/e_bcg", + "shouldLoadValue": true + }, + { + "name": "e_opv0", + "bind": "/model/instance/Child_Vaccination_Followup/e_opv0", + "shouldLoadValue": true + }, + { + "name": "e_penta2", + "bind": "/model/instance/Child_Vaccination_Followup/e_penta2", + "shouldLoadValue": true + }, + { + "name": "e_penta1", + "bind": "/model/instance/Child_Vaccination_Followup/e_penta1", + "shouldLoadValue": true + }, + { + "name": "e_penta3", + "bind": "/model/instance/Child_Vaccination_Followup/e_penta3", + "shouldLoadValue": true + }, + { + "name": "e_opv1", + "bind": "/model/instance/Child_Vaccination_Followup/e_opv1", + "shouldLoadValue": true + }, + { + "name": "e_opv2", + "bind": "/model/instance/Child_Vaccination_Followup/e_opv2", + "shouldLoadValue": true + }, + { + "name": "e_opv3", + "bind": "/model/instance/Child_Vaccination_Followup/e_opv3", + "shouldLoadValue": true + }, + { + "name": "e_pcv1", + "bind": "/model/instance/Child_Vaccination_Followup/e_pcv1", + "shouldLoadValue": true + }, + { + "name": "e_pcv2", + "bind": "/model/instance/Child_Vaccination_Followup/e_pcv2", + "shouldLoadValue": true + }, + { + "name": "e_pcv3", + "bind": "/model/instance/Child_Vaccination_Followup/e_pcv3", + "shouldLoadValue": true + }, + { + "name": "e_ipv", + "bind": "/model/instance/Child_Vaccination_Followup/e_ipv", + "shouldLoadValue": true + }, + { + "name": "e_measles1", + "bind": "/model/instance/Child_Vaccination_Followup/e_measles1", + "shouldLoadValue": true + }, + { + "name": "e_measles2", + "bind": "/model/instance/Child_Vaccination_Followup/e_measles2", + "shouldLoadValue": true + }, + { + "name": "provider_id", + "bind": "/model/instance/Child_Vaccination_Followup/provider_id", + "shouldLoadValue": true + }, + { + "name": "provider_location_id", + "bind": "/model/instance/Child_Vaccination_Followup/provider_location_id", + "shouldLoadValue": true + }, + { + "name": "provider_location_name", + "bind": "/model/instance/Child_Vaccination_Followup/provider_location_name", + "shouldLoadValue": true + }, + { + "name": "provider_location_note", + "bind": "/model/instance/Child_Vaccination_Followup/provider_location_note" + }, + { + "name": "start", + "bind": "/model/instance/Child_Vaccination_Followup/start" + }, + { + "name": "end", + "bind": "/model/instance/Child_Vaccination_Followup/end" + }, + { + "name": "today", + "bind": "/model/instance/Child_Vaccination_Followup/today" + }, + { + "name": "deviceid", + "bind": "/model/instance/Child_Vaccination_Followup/deviceid" + }, + { + "name": "subscriberid", + "bind": "/model/instance/Child_Vaccination_Followup/subscriberid" + }, + { + "name": "simserial", + "bind": "/model/instance/Child_Vaccination_Followup/simserial" + }, + { + "name": "phonenumber", + "bind": "/model/instance/Child_Vaccination_Followup/phonenumber" + }, + { + "name": "existing_client_reg_date_note", + "bind": "/model/instance/Child_Vaccination_Followup/existing_client_reg_date_note" + }, + { + "name": "program_client_id_note", + "bind": "/model/instance/Child_Vaccination_Followup/program_client_id_note" + }, + { + "name": "epi_card_number_note", + "bind": "/model/instance/Child_Vaccination_Followup/epi_card_number_note" + }, + { + "name": "first_name_note", + "bind": "/model/instance/Child_Vaccination_Followup/first_name_note" + }, + { + "name": "last_name_note", + "bind": "/model/instance/Child_Vaccination_Followup/last_name_note" + }, + { + "name": "child_age", + "bind": "/model/instance/Child_Vaccination_Followup/child_age" + }, + { + "name": "calc_dob_note", + "bind": "/model/instance/Child_Vaccination_Followup/calc_dob_note" + }, + { + "name": "gender_note", + "bind": "/model/instance/Child_Vaccination_Followup/gender_note" + }, + { + "name": "mother_name_note", + "bind": "/model/instance/Child_Vaccination_Followup/mother_name_note" + }, + { + "name": "exisiting_ethnicity_note", + "bind": "/model/instance/Child_Vaccination_Followup/exisiting_ethnicity_note" + }, + { + "name": "address", + "bind": "/model/instance/Child_Vaccination_Followup/address" + }, + { + "name": "address_change", + "bind": "/model/instance/Child_Vaccination_Followup/address_change" + }, + { + "name": "province", + "bind": "/model/instance/Child_Vaccination_Followup/province" + }, + { + "name": "city_village", + "bind": "/model/instance/Child_Vaccination_Followup/city_village" + }, + { + "name": "town", + "bind": "/model/instance/Child_Vaccination_Followup/town" + }, + { + "name": "union_council", + "bind": "/model/instance/Child_Vaccination_Followup/union_council" + }, + { + "name": "house_number", + "bind": "/model/instance/Child_Vaccination_Followup/house_number" + }, + { + "name": "street", + "bind": "/model/instance/Child_Vaccination_Followup/street" + }, + { + "name": "landmark", + "bind": "/model/instance/Child_Vaccination_Followup/landmark" + }, + { + "name": "center_gps", + "bind": "/model/instance/Child_Vaccination_Followup/center_gps" + }, + { + "name": "child_was_suffering_from_a_disease_at_birth_note", + "bind": "/model/instance/Child_Vaccination_Followup/child_was_suffering_from_a_disease_at_birth_note" + }, + { + "name": "aefi", + "bind": "/model/instance/Child_Vaccination_Followup/aefi" + }, + { + "name": "reminders_approval", + "bind": "/model/instance/Child_Vaccination_Followup/reminders_approval" + }, + { + "name": "contact_phone_number", + "bind": "/model/instance/Child_Vaccination_Followup/contact_phone_number" + }, + { + "name": "six_weeks", + "bind": "/model/instance/Child_Vaccination_Followup/six_weeks" + }, + { + "name": "ten_weeks", + "bind": "/model/instance/Child_Vaccination_Followup/ten_weeks" + }, + { + "name": "forteen_weeks", + "bind": "/model/instance/Child_Vaccination_Followup/forteen_weeks" + }, + { + "name": "nine_months", + "bind": "/model/instance/Child_Vaccination_Followup/nine_months" + }, + { + "name": "fifteen_months", + "bind": "/model/instance/Child_Vaccination_Followup/fifteen_months" + }, + { + "name": "vaccines", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines" + }, + { + "name": "bcg_retro", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/bcg_retro" + }, + { + "name": "opv0_retro", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/opv0_retro" + }, + { + "name": "opv0_dose", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/opv0_dose" + }, + { + "name": "pcv1_retro", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/pcv1_retro" + }, + { + "name": "pcv1_dose", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/pcv1_dose" + }, + { + "name": "opv1_retro", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/opv1_retro" + }, + { + "name": "opv1_dose", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/opv1_dose" + }, + { + "name": "penta1_retro", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/penta1_retro" + }, + { + "name": "penta1_dose", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/penta1_dose" + }, + { + "name": "pcv2_retro", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/pcv2_retro" + }, + { + "name": "pcv2_dose", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/pcv2_dose" + }, + { + "name": "opv2_retro", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/opv2_retro" + }, + { + "name": "opv2_dose", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/opv2_dose" + }, + { + "name": "penta2_retro", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/penta2_retro" + }, + { + "name": "penta2_dose", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/penta2_dose" + }, + { + "name": "pcv3_retro", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/pcv3_retro" + }, + { + "name": "pcv3_dose", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/pcv3_dose" + }, + { + "name": "opv3_retro", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/opv3_retro" + }, + { + "name": "opv3_dose", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/opv3_dose" + }, + { + "name": "penta3_retro", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/penta3_retro" + }, + { + "name": "penta3_dose", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/penta3_dose" + }, + { + "name": "ipv_retro", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/ipv_retro" + }, + { + "name": "measles1_retro", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/measles1_retro" + }, + { + "name": "measles1_dose", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/measles1_dose" + }, + { + "name": "measles2_retro", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/measles2_retro" + }, + { + "name": "measles2_dose", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_group/measles2_dose" + }, + { + "name": "vaccines_2", + "bind": "/model/instance/Child_Vaccination_Followup/vaccines_2" + }, + { + "name": "vaccination_date", + "bind": "/model/instance/Child_Vaccination_Followup/vaccination_date" + }, + { + "name": "bcg", + "bind": "/model/instance/Child_Vaccination_Followup/bcg" + }, + { + "name": "opv0", + "bind": "/model/instance/Child_Vaccination_Followup/opv0" + }, + { + "name": "opv0_dose_today", + "bind": "/model/instance/Child_Vaccination_Followup/opv0_dose_today" + }, + { + "name": "pcv1", + "bind": "/model/instance/Child_Vaccination_Followup/pcv1" + }, + { + "name": "pcv1_dose_today", + "bind": "/model/instance/Child_Vaccination_Followup/pcv1_dose_today" + }, + { + "name": "opv1", + "bind": "/model/instance/Child_Vaccination_Followup/opv1" + }, + { + "name": "opv1_dose_today", + "bind": "/model/instance/Child_Vaccination_Followup/opv1_dose_today" + }, + { + "name": "penta1", + "bind": "/model/instance/Child_Vaccination_Followup/penta1" + }, + { + "name": "penta1_dose_today", + "bind": "/model/instance/Child_Vaccination_Followup/penta1_dose_today" + }, + { + "name": "pcv2", + "bind": "/model/instance/Child_Vaccination_Followup/pcv2" + }, + { + "name": "pcv2_dose_today", + "bind": "/model/instance/Child_Vaccination_Followup/pcv2_dose_today" + }, + { + "name": "opv2", + "bind": "/model/instance/Child_Vaccination_Followup/opv2" + }, + { + "name": "opv2_dose_today", + "bind": "/model/instance/Child_Vaccination_Followup/opv2_dose_today" + }, + { + "name": "penta2", + "bind": "/model/instance/Child_Vaccination_Followup/penta2" + }, + { + "name": "penta2_dose_today", + "bind": "/model/instance/Child_Vaccination_Followup/penta2_dose_today" + }, + { + "name": "pcv3", + "bind": "/model/instance/Child_Vaccination_Followup/pcv3" + }, + { + "name": "pcv3_dose_today", + "bind": "/model/instance/Child_Vaccination_Followup/pcv3_dose_today" + }, + { + "name": "opv3", + "bind": "/model/instance/Child_Vaccination_Followup/opv3" + }, + { + "name": "opv3_dose_today", + "bind": "/model/instance/Child_Vaccination_Followup/opv3_dose_today" + }, + { + "name": "penta3", + "bind": "/model/instance/Child_Vaccination_Followup/penta3" + }, + { + "name": "penta3_dose_today", + "bind": "/model/instance/Child_Vaccination_Followup/penta3_dose_today" + }, + { + "name": "ipv", + "bind": "/model/instance/Child_Vaccination_Followup/ipv" + }, + { + "name": "measles1", + "bind": "/model/instance/Child_Vaccination_Followup/measles1" + }, + { + "name": "measles1_dose_today", + "bind": "/model/instance/Child_Vaccination_Followup/measles1_dose_today" + }, + { + "name": "measles2", + "bind": "/model/instance/Child_Vaccination_Followup/measles2" + }, + { + "name": "measles2_dose_today", + "bind": "/model/instance/Child_Vaccination_Followup/measles2_dose_today" + }, + { + "name": "instanceID", + "bind": "/model/instance/Child_Vaccination_Followup/meta/instanceID" + } + ] } } \ No newline at end of file diff --git a/src/test/resources/form/child_followup/model.xml b/src/test/resources/form/child_followup/model.xml index b8d42cd6b..baff43768 100644 --- a/src/test/resources/form/child_followup/model.xml +++ b/src/test/resources/form/child_followup/model.xml @@ -1,7 +1,8 @@ - + @@ -69,13 +70,20 @@
- ${provider_province} - ${provider_city} + ${provider_province} + + ${provider_city} + - - + + - + @@ -86,63 +94,117 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + ${today} - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/form/new_household_registration/form.json b/src/test/resources/form/new_household_registration/form.json index 0288ac30d..d75d3cf6d 100644 --- a/src/test/resources/form/new_household_registration/form.json +++ b/src/test/resources/form/new_household_registration/form.json @@ -1,655 +1,655 @@ { - "default_language": "Bengali", - "id_string": "FWNewHH_1", - "children": [ - { - "name": "existing_location", - "instance": { - "openmrs_entity_id": "location_id", - "openmrs_entity": "encounter" - }, - "type": "hidden" + "default_language": "Bengali", + "id_string": "FWNewHH_1", + "children": [ + { + "name": "existing_location", + "instance": { + "openmrs_entity_id": "location_id", + "openmrs_entity": "encounter" + }, + "type": "hidden" + }, + { + "name": "today", + "instance": { + "openmrs_entity_id": "encounter_date", + "openmrs_entity": "encounter" + }, + "type": "today" + }, + { + "name": "start", + "instance": { + "openmrs_entity_id": "encounter_start", + "openmrs_entity": "encounter" + }, + "type": "start" + }, + { + "name": "end", + "instance": { + "openmrs_entity_id": "encounter_end", + "openmrs_entity": "encounter" + }, + "type": "end" + }, + { + "name": "FWNHREGDATE", + "hint": { + "Bengali": "আজকের তারিখ দিন", + "English": "Confirm Today’s date is correct" + }, + "bind": { + "jr:constraintMsg": { + "Bengali": "তারিখ আজকের তারিখের চেয়ে বেশী হতে পারবেনা", + "English": "Date cannot be greater than current date." }, - { - "name": "today", - "instance": { - "openmrs_entity_id": "encounter_date", - "openmrs_entity": "encounter" - }, - "type": "today" + "required": "yes", + "constraint": ".<=${today}" + }, + "label": { + "Bengali": "তথ্য সংগ্রহের তারিখ", + "English": "Date of Interview" + }, + "instance": { + "openmrs_entity_id": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "date" + }, + { + "control": { + "appearance": "numbers" + }, + "name": "FWGOBHHID", + "hint": { + "Bengali": "অনুগ্রহ করে খানার দরজাতে লেখা কালো রঙের JiVitA/Study household ID (HHID) টি টাইপ করুন", + "English": "Please input the Black – painted Government household ID (HHID) as displayed on the door/wall of the HH." + }, + "bind": { + "jr:constraintMsg": { + "Bengali": "অনুগ্রহ করে ০০০১ থেকে ৯৯৯৯ এর মধ্যে ৪ ডিজিটের GoB HHID টাইপ করুন", + "English": "Please enter 4 digits of GoB HHID from 0001 to 9999" }, + "required": "yes", + "constraint": "regex(., '^(?!0{4})[0-9]{4}$')" + }, + "label": { + "Bengali": "GoB HHID", + "English": "GoB HHID" + }, + "instance": { + "openmrs_entity_id": "GOB HHID", + "openmrs_entity": "person_identifier" + }, + "type": "text" + }, + { + "control": { + "appearance": "numbers" + }, + "name": "FWJIVHHID", + "hint": { + "Bengali": "অনুগ্রহ করে খানার দরজাতে লেখা লাল রঙের JiVitA/Study household ID (HHID) টি টাইপ করুন", + "English": "Please input the RED – painted JiVitA / Study household ID (HHID) as displayed on the door/wall of the HH." + }, + "bind": { + "jr:constraintMsg": { + "Bengali": "অনুগ্রহ করে ০০০১ থেকে ৯৯৯৯ এর মধ্যে ৪ ডিজিটের JiVitA HHID টাইপ করুন", + "English": "Please enter 4 digits of JiVitA HHID from 0001 to 9999" + }, + "required": "yes", + "constraint": "regex(., '^(?!0{4})[0-9]{4}$')" + }, + "label": { + "Bengali": "JiVitA HHID", + "English": "JiVitA HHID" + }, + "instance": { + "openmrs_entity_id": "JiVitA HHID", + "openmrs_entity": "person_identifier" + }, + "type": "text" + }, + { + "name": "FWNHNEARTO", + "label": { + "Bengali": "নিকটবর্তী স্থান", + "English": "Near to" + }, + "instance": { + "openmrs_entity_parent": "usual_residence", + "openmrs_entity_id": "landmark", + "openmrs_entity": "person_address" + }, + "type": "text" + }, + { + "name": "FWNHHHGPS", + "bind": { + "required": "yes" + }, + "label": { + "Bengali": "জি পি এস", + "English": "Collect GPS Location of HH" + }, + "instance": { + "openmrs_entity_parent": "usual_residence", + "openmrs_entity_id": "geopoint", + "openmrs_entity": "person_address" + }, + "type": "geopoint" + }, + { + "name": "FWHOHFNAME", + "bind": { + "required": "yes" + }, + "label": { + "Bengali": "খানা প্রধানের নাম-", + "English": "Head of Household Name" + }, + "instance": { + "openmrs_entity_id": "first_name", + "openmrs_entity": "person" + }, + "type": "text" + }, + { + "name": "FWHOHLNAME", + "bind": { + "calculate": "\".\"" + }, + "instance": { + "openmrs_entity_id": "last_name", + "openmrs_entity": "person" + }, + "type": "calculate" + }, + { + "name": "FWHOHBIRTHDATE", + "bind": { + "calculate": "\"1900-01-01\"" + }, + "instance": { + "openmrs_entity_id": "birthdate", + "openmrs_entity": "person" + }, + "type": "calculate" + }, + { + "name": "FWHOHGENDER", + "bind": { + "calculate": "\"male\"" + }, + "instance": { + "openmrs_entity_id": "gender", + "openmrs_entity": "person" + }, + "type": "calculate" + }, + { + "name": "FWNHHMBRNUM", + "label": { + "Bengali": "খানা সদস্যের সংখ্যা কত?", + "English": "How many people are currently living in this household?" + }, + "instance": { + "openmrs_entity_id": "5611AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "integer" + }, + { + "children": [ { - "name": "start", - "instance": { - "openmrs_entity_id": "encounter_start", - "openmrs_entity": "encounter" - }, - "type": "start" + "name": "0", + "label": { + "Bengali": "না", + "English": "No" + }, + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } }, { - "name": "end", - "instance": { - "openmrs_entity_id": "encounter_end", - "openmrs_entity": "encounter" - }, - "type": "end" + "name": "1", + "label": { + "Bengali": "হ্যাঁ", + "English": "Yes" + }, + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } }, { - "name": "FWNHREGDATE", - "hint": { - "Bengali": "আজকের তারিখ দিন", - "English": "Confirm Today’s date is correct" - }, - "bind": { - "jr:constraintMsg": { - "Bengali": "তারিখ আজকের তারিখের চেয়ে বেশী হতে পারবেনা", - "English": "Date cannot be greater than current date." - }, - "required": "yes", - "constraint": ".<=${today}" - }, - "label": { - "Bengali": "তথ্য সংগ্রহের তারিখ", - "English": "Date of Interview" - }, - "instance": { - "openmrs_entity_id": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "date" + "name": "9", + "label": { + "Bengali": "জানিনা", + "English": "Don't know" + }, + "instance": { + "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + } + ], + "name": "FWNHHMWRA", + "label": { + "Bengali": "এই খানায় কি প্রজনন বয়সী বিবাহিত মহিলা আছেন?", + "English": "Are there any MWRAs in this Household?" + }, + "type": "select one" + }, + { + "children": [ + { + "name": "FWWOMFNAME", + "hint": { + "Bengali": "অনুগ্রহ করে মহিলার নাম টাইপ করুন", + "English": "Please type woman's name" + }, + "bind": { + "required": "yes" + }, + "label": { + "Bengali": "মহিলার নাম-", + "English": "Woman Name" + }, + "instance": { + "openmrs_entity_id": "first_name", + "openmrs_entity": "person" + }, + "type": "text" }, { - "control": { - "appearance": "numbers" - }, - "name": "FWGOBHHID", - "hint": { - "Bengali": "অনুগ্রহ করে খানার দরজাতে লেখা কালো রঙের JiVitA/Study household ID (HHID) টি টাইপ করুন", - "English": "Please input the Black – painted Government household ID (HHID) as displayed on the door/wall of the HH." - }, - "bind": { - "jr:constraintMsg": { - "Bengali": "অনুগ্রহ করে ০০০১ থেকে ৯৯৯৯ এর মধ্যে ৪ ডিজিটের GoB HHID টাইপ করুন", - "English": "Please enter 4 digits of GoB HHID from 0001 to 9999" - }, - "required": "yes", - "constraint": "regex(., '^(?!0{4})[0-9]{4}$')" - }, - "label": { - "Bengali": "GoB HHID", - "English": "GoB HHID" - }, - "instance": { - "openmrs_entity_id": "GOB HHID", - "openmrs_entity": "person_identifier" - }, - "type": "text" + "name": "FWWOMLNAME", + "bind": { + "calculate": "\".\"" + }, + "instance": { + "openmrs_entity_id": "last_name", + "openmrs_entity": "person" + }, + "type": "calculate" }, { - "control": { - "appearance": "numbers" - }, - "name": "FWJIVHHID", - "hint": { - "Bengali": "অনুগ্রহ করে খানার দরজাতে লেখা লাল রঙের JiVitA/Study household ID (HHID) টি টাইপ করুন", - "English": "Please input the RED – painted JiVitA / Study household ID (HHID) as displayed on the door/wall of the HH." - }, - "bind": { - "jr:constraintMsg": { - "Bengali": "অনুগ্রহ করে ০০০১ থেকে ৯৯৯৯ এর মধ্যে ৪ ডিজিটের JiVitA HHID টাইপ করুন", - "English": "Please enter 4 digits of JiVitA HHID from 0001 to 9999" - }, - "required": "yes", - "constraint": "regex(., '^(?!0{4})[0-9]{4}$')" - }, - "label": { - "Bengali": "JiVitA HHID", - "English": "JiVitA HHID" - }, - "instance": { - "openmrs_entity_id": "JiVitA HHID", - "openmrs_entity": "person_identifier" - }, - "type": "text" + "control": { + "appearance": "numbers" + }, + "name": "FWWOMNID", + "hint": { + "Bengali": "অনুগ্রহ করে জাতীয় পরিচয়পত্র কার্ড দেখে সরকার প্রদত্ত আইডি টাইপ করুন", + "English": "Please input the Government ID as displayed on the national ID card" + }, + "bind": { + "jr:constraintMsg": { + "Bengali": "জাতীয় পরিচয়পত্র নং ১৩ অথবা ১৭ ডিজিটের হবে", + "English": "National ID should be 13 or 17 digits" + }, + "constraint": "regex(., '^(?!0{13})[0-9]{13}$') or regex(., '^(?!0{17})[0-9]{17}$')" + }, + "label": { + "Bengali": "মহিলার জাতীয় পরিচয়পত্র নং-", + "English": "Woman's National ID Number" + }, + "instance": { + "openmrs_entity_id": "NID", + "openmrs_entity": "person_identifier" + }, + "type": "text" }, { - "name": "FWNHNEARTO", - "label": { - "Bengali": "নিকটবর্তী স্থান", - "English": "Near to" - }, - "instance": { - "openmrs_entity_parent": "usual_residence", - "openmrs_entity_id": "landmark", - "openmrs_entity": "person_address" - }, - "type": "text" + "control": { + "appearance": "numbers" + }, + "name": "FWWOMBID", + "hint": { + "Bengali": "অনুগ্রহ করে জন্ম নিবন্ধন সনদ দেখে সরকার প্রদত্ত আইডি টাইপ করুন", + "English": "Please input the Government ID as displayed on the birth certificate" + }, + "bind": { + "jr:constraintMsg": { + "Bengali": "জন্ম নিবন্ধন সনদ নং ১৭ ডিজিটের হবে", + "English": "Birth Registration ID should be 17 digits" + }, + "required": "yes", + "constraint": "regex(., '^(?!0{17})[0-9]{17}$')" + }, + "label": { + "Bengali": "মহিলার জন্ম নিবন্ধন সনদ নং-", + "English": "Woman's Birth Registration ID" + }, + "instance": { + "openmrs_entity_id": "Birth Registration ID", + "openmrs_entity": "person_identifier" + }, + "type": "text" }, { - "name": "FWNHHHGPS", - "bind": { - "required": "yes" - }, - "label": { - "Bengali": "জি পি এস", - "English": "Collect GPS Location of HH" - }, - "instance": { - "openmrs_entity_parent": "usual_residence", - "openmrs_entity_id": "geopoint", - "openmrs_entity": "person_address" - }, - "type": "geopoint" + "name": "FWHUSNAME", + "hint": { + "Bengali": "অনুগ্রহ করে স্বামীর নাম টাইপ করুন", + "English": "Please type husband's name" + }, + "bind": { + "required": "yes" + }, + "label": { + "Bengali": "স্বামীর নাম-", + "English": "Husband Name" + }, + "instance": { + "openmrs_entity_id": "161135AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "text" }, { - "name": "FWHOHFNAME", - "bind": { - "required": "yes" - }, - "label": { - "Bengali": "খানা প্রধানের নাম-", - "English": "Head of Household Name" - }, - "instance": { - "openmrs_entity_id": "first_name", - "openmrs_entity": "person" - }, - "type": "text" + "name": "FWBIRTHDATE", + "hint": { + "Bengali": "মহিলার জন্ম নিবন্ধন পত্র থাকলে সেখান থেকে জন্ম তারিখটি লিখে নিন। যদি জন্ম তারিখ জানা না থাকে তবে তারিখ ১৫ সিলেক্ট করুন, যদি মাস জানা না থাকে তবে মাস ৬ (জুন) সিলেক্ট করুন", + "English": "If birth certificate is available, take date of birth from the birth certificate. \nIf date of birth is unknown, choose 15th as the date of birth. If month is unknown, choose month 06 (June) as month of birth." + }, + "bind": { + "jr:constraintMsg": { + "Bengali": "মহিলার বয়স অবশ্যই ১৩ বছরের বেশী হবে", + "English": "Woman must be older than 13 years of age" + }, + "required": "yes", + "constraint": "((${FWBIRTHDATE})+4745) <= today()" + }, + "label": { + "Bengali": "মহিলার জন্ম তারিখ", + "English": "Woman's Date of Birth" + }, + "instance": { + "openmrs_entity_id": "birthdate", + "openmrs_entity": "person" + }, + "type": "date" }, { - "name": "FWHOHLNAME", - "bind": { - "calculate": "\".\"" - }, - "instance": { - "openmrs_entity_id": "last_name", - "openmrs_entity": "person" - }, - "type": "calculate" + "name": "FWGENDER", + "bind": { + "calculate": "\"female\"" + }, + "instance": { + "openmrs_entity_id": "gender", + "openmrs_entity": "person" + }, + "type": "calculate" }, { - "name": "FWHOHBIRTHDATE", - "bind": { - "calculate": "\"1900-01-01\"" - }, - "instance": { - "openmrs_entity_id": "birthdate", - "openmrs_entity": "person" - }, - "type": "calculate" + "name": "FWWOMAGE", + "bind": { + "calculate": "round(((${today} - ${FWBIRTHDATE}) div 365.25),0)" + }, + "type": "calculate" }, { - "name": "FWHOHGENDER", - "bind": { - "calculate": "\"male\"" - }, - "instance": { - "openmrs_entity_id": "gender", - "openmrs_entity": "person" - }, - "type": "calculate" + "name": "display_age", + "label": { + "Bengali": "মহিলার বয়স ${FWWOMAGE}", + "English": "The woman's age is ${FWWOMAGE}." + }, + "type": "note" }, { - "name": "FWNHHMBRNUM", - "label": { - "Bengali": "খানা সদস্যের সংখ্যা কত?", - "English": "How many people are currently living in this household?" - }, - "instance": { - "openmrs_entity_id": "5611AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "integer" + "children": [ + { + "name": "0", + "label": { + "Bengali": "না", + "English": "No" + }, + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "name": "1", + "label": { + "Bengali": "হ্যাঁ", + "English": "Yes" + }, + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "name": "9", + "label": { + "Bengali": "জানিনা", + "English": "Don't know" + }, + "instance": { + "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + } + ], + "name": "FWNHWOMSTRMEN", + "bind": { + "required": "yes" + }, + "label": { + "Bengali": "আপনার কি মাসিক একেবারে উঠে গেছে/আপনি কি স্থায়ী জন্মনিয়ন্ত্রন পদ্ধতি গ্রহণ করেছেন?", + "English": "Are you currently menopausal or sterilized?" + }, + "type": "select one" }, { - "children": [ - { - "name": "0", - "label": { - "Bengali": "না", - "English": "No" - }, - "instance": { - "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - }, - { - "name": "1", - "label": { - "Bengali": "হ্যাঁ", - "English": "Yes" - }, - "instance": { - "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - }, - { - "name": "9", - "label": { - "Bengali": "জানিনা", - "English": "Don't know" - }, - "instance": { - "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - } - ], - "name": "FWNHHMWRA", - "label": { - "Bengali": "এই খানায় কি প্রজনন বয়সী বিবাহিত মহিলা আছেন?", - "English": "Are there any MWRAs in this Household?" - }, - "type": "select one" + "children": [ + { + "name": "0", + "label": { + "Bengali": "মারা গেছেন", + "English": "Deceased" + }, + "instance": { + "openmrs_code": "159AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "name": "1", + "label": { + "Bengali": "বেঁচে আছেন", + "English": "Alive" + }, + "instance": { + "openmrs_code": "160429AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "name": "9", + "label": { + "Bengali": "জানিনা", + "English": "Don't know" + }, + "instance": { + "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + } + ], + "name": "FWNHWOMHUSALV", + "bind": { + "relevant": "${FWNHWOMSTRMEN}='0'", + "required": "yes" + }, + "label": { + "Bengali": "আপনার স্বামী কি বেঁচে আছেন?", + "English": "Is the husband alive?" + }, + "instance": { + "openmrs_entity_id": "5561AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one" }, { - "children": [ - { - "name": "FWWOMFNAME", - "hint": { - "Bengali": "অনুগ্রহ করে মহিলার নাম টাইপ করুন", - "English": "Please type woman's name" - }, - "bind": { - "required": "yes" - }, - "label": { - "Bengali": "মহিলার নাম-", - "English": "Woman Name" - }, - "instance": { - "openmrs_entity_id": "first_name", - "openmrs_entity": "person" - }, - "type": "text" - }, - { - "name": "FWWOMLNAME", - "bind": { - "calculate": "\".\"" - }, - "instance": { - "openmrs_entity_id": "last_name", - "openmrs_entity": "person" - }, - "type": "calculate" - }, - { - "control": { - "appearance": "numbers" - }, - "name": "FWWOMNID", - "hint": { - "Bengali": "অনুগ্রহ করে জাতীয় পরিচয়পত্র কার্ড দেখে সরকার প্রদত্ত আইডি টাইপ করুন", - "English": "Please input the Government ID as displayed on the national ID card" - }, - "bind": { - "jr:constraintMsg": { - "Bengali": "জাতীয় পরিচয়পত্র নং ১৩ অথবা ১৭ ডিজিটের হবে", - "English": "National ID should be 13 or 17 digits" - }, - "constraint": "regex(., '^(?!0{13})[0-9]{13}$') or regex(., '^(?!0{17})[0-9]{17}$')" - }, - "label": { - "Bengali": "মহিলার জাতীয় পরিচয়পত্র নং-", - "English": "Woman's National ID Number" - }, - "instance": { - "openmrs_entity_id": "NID", - "openmrs_entity": "person_identifier" - }, - "type": "text" - }, - { - "control": { - "appearance": "numbers" - }, - "name": "FWWOMBID", - "hint": { - "Bengali": "অনুগ্রহ করে জন্ম নিবন্ধন সনদ দেখে সরকার প্রদত্ত আইডি টাইপ করুন", - "English": "Please input the Government ID as displayed on the birth certificate" - }, - "bind": { - "jr:constraintMsg": { - "Bengali": "জন্ম নিবন্ধন সনদ নং ১৭ ডিজিটের হবে", - "English": "Birth Registration ID should be 17 digits" - }, - "required": "yes", - "constraint": "regex(., '^(?!0{17})[0-9]{17}$')" - }, - "label": { - "Bengali": "মহিলার জন্ম নিবন্ধন সনদ নং-", - "English": "Woman's Birth Registration ID" - }, - "instance": { - "openmrs_entity_id": "Birth Registration ID", - "openmrs_entity": "person_identifier" - }, - "type": "text" - }, - { - "name": "FWHUSNAME", - "hint": { - "Bengali": "অনুগ্রহ করে স্বামীর নাম টাইপ করুন", - "English": "Please type husband's name" - }, - "bind": { - "required": "yes" - }, - "label": { - "Bengali": "স্বামীর নাম-", - "English": "Husband Name" - }, - "instance": { - "openmrs_entity_id": "161135AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "text" - }, - { - "name": "FWBIRTHDATE", - "hint": { - "Bengali": "মহিলার জন্ম নিবন্ধন পত্র থাকলে সেখান থেকে জন্ম তারিখটি লিখে নিন। যদি জন্ম তারিখ জানা না থাকে তবে তারিখ ১৫ সিলেক্ট করুন, যদি মাস জানা না থাকে তবে মাস ৬ (জুন) সিলেক্ট করুন", - "English": "If birth certificate is available, take date of birth from the birth certificate. \nIf date of birth is unknown, choose 15th as the date of birth. If month is unknown, choose month 06 (June) as month of birth." - }, - "bind": { - "jr:constraintMsg": { - "Bengali": "মহিলার বয়স অবশ্যই ১৩ বছরের বেশী হবে", - "English": "Woman must be older than 13 years of age" - }, - "required": "yes", - "constraint": "((${FWBIRTHDATE})+4745) <= today()" - }, - "label": { - "Bengali": "মহিলার জন্ম তারিখ", - "English": "Woman's Date of Birth" - }, - "instance": { - "openmrs_entity_id": "birthdate", - "openmrs_entity": "person" - }, - "type": "date" - }, - { - "name": "FWGENDER", - "bind": { - "calculate": "\"female\"" - }, - "instance": { - "openmrs_entity_id": "gender", - "openmrs_entity": "person" - }, - "type": "calculate" - }, - { - "name": "FWWOMAGE", - "bind": { - "calculate": "round(((${today} - ${FWBIRTHDATE}) div 365.25),0)" - }, - "type": "calculate" - }, - { - "name": "display_age", - "label": { - "Bengali": "মহিলার বয়স ${FWWOMAGE}", - "English": "The woman's age is ${FWWOMAGE}." - }, - "type": "note" - }, - { - "children": [ - { - "name": "0", - "label": { - "Bengali": "না", - "English": "No" - }, - "instance": { - "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - }, - { - "name": "1", - "label": { - "Bengali": "হ্যাঁ", - "English": "Yes" - }, - "instance": { - "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - }, - { - "name": "9", - "label": { - "Bengali": "জানিনা", - "English": "Don't know" - }, - "instance": { - "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - } - ], - "name": "FWNHWOMSTRMEN", - "bind": { - "required": "yes" - }, - "label": { - "Bengali": "আপনার কি মাসিক একেবারে উঠে গেছে/আপনি কি স্থায়ী জন্মনিয়ন্ত্রন পদ্ধতি গ্রহণ করেছেন?", - "English": "Are you currently menopausal or sterilized?" - }, - "type": "select one" - }, - { - "children": [ - { - "name": "0", - "label": { - "Bengali": "মারা গেছেন", - "English": "Deceased" - }, - "instance": { - "openmrs_code": "159AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - }, - { - "name": "1", - "label": { - "Bengali": "বেঁচে আছেন", - "English": "Alive" - }, - "instance": { - "openmrs_code": "160429AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - }, - { - "name": "9", - "label": { - "Bengali": "জানিনা", - "English": "Don't know" - }, - "instance": { - "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - } - ], - "name": "FWNHWOMHUSALV", - "bind": { - "relevant": "${FWNHWOMSTRMEN}='0'", - "required": "yes" - }, - "label": { - "Bengali": "আপনার স্বামী কি বেঁচে আছেন?", - "English": "Is the husband alive?" - }, - "instance": { - "openmrs_entity_id": "5561AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "select one" - }, - { - "children": [ - { - "name": "0", - "label": { - "Bengali": "না", - "English": "No" - }, - "instance": { - "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - }, - { - "name": "1", - "label": { - "Bengali": "হ্যাঁ", - "English": "Yes" - }, - "instance": { - "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - }, - { - "name": "9", - "label": { - "Bengali": "জানিনা", - "English": "Don't know" - }, - "instance": { - "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - } - ], - "name": "FWNHWOMHUSLIV", - "bind": { - "relevant": "${FWNHWOMSTRMEN}='0' and ${FWNHWOMHUSALV}='1'", - "required": "yes" - }, - "label": { - "Bengali": "আপনি কি বর্তমানে আপনার স্বামীর সাথে বসবাস করছেন?", - "English": "Are you currently living with your husband?" - }, - "instance": { - "openmrs_entity_id": "1060AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "select one" - }, - { - "children": [ - { - "name": "0", - "label": { - "Bengali": "না", - "English": "No" - }, - "instance": { - "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - }, - { - "name": "1", - "label": { - "Bengali": "হ্যাঁ", - "English": "Yes" - }, - "instance": { - "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - }, - { - "name": "9", - "label": { - "Bengali": "জানিনা", - "English": "Don't know" - }, - "instance": { - "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - } - ], - "name": "FWNHWOMHUSSTR", - "bind": { - "relevant": "${FWNHWOMSTRMEN}='0' and ${FWNHWOMHUSLIV}='1'", - "required": "yes" - }, - "label": { - "Bengali": "আপনার স্বামী কি স্থায়ী জন্মনিয়ন্ত্রন পদ্ধতি গ্রহণ করেছেন?", - "English": "Is the husband sterilized?" - }, - "type": "select one" - }, - { - "name": "FWELIGIBLE", - "bind": { - "calculate": "if(${FWNHWOMSTRMEN}='0' and ${FWNHWOMHUSLIV}='1' and ${FWNHWOMHUSSTR}='0',1,0)" - }, - "type": "calculate" - }, - { - "name": "add_women", - "label": { - "Bengali": "এই খানায় যদি আরও কোন মহিলা থাকে যাকে রেজিস্ট্রেশন করা হয়নি, তাহলে '+' অপশনটি বাছুন এবং একই প্রক্রিয়ায় পরবর্তী মহিলাকে রেজিস্ট্রেশন করুন", - "English": "If there are any additional unregistered women in this household, select the '+' to add them now." - }, - "type": "note" - } - ], - "name": "woman", - "hint": { - "Bengali": "আমরা এখন মহিলাটির রেজিস্ট্রেশন প্রক্রিয়া শুরু করতে যাচ্ছি। অনুগ্রহ করে মহিলাটিরে তার জন্ম নিবন্ধন স ও জাতীয় পরিচয়পত্র নিয়ে আসতে বলুন।", - "English": "We will now register the woman. Please ask her to bring her National ID Card and Birth Certificate." - }, - "bind": { - "relevant": "${FWNHHMWRA}='1'" - }, - "label": { - "Bengali": "মহিলা তথ্যঃ", - "English": "New Woman Registration" - }, - "instance": { - "openmrs_entity_id": "Census and New Woman Registration", - "openmrs_entity": "person" - }, - "type": "repeat" + "children": [ + { + "name": "0", + "label": { + "Bengali": "না", + "English": "No" + }, + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "name": "1", + "label": { + "Bengali": "হ্যাঁ", + "English": "Yes" + }, + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "name": "9", + "label": { + "Bengali": "জানিনা", + "English": "Don't know" + }, + "instance": { + "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + } + ], + "name": "FWNHWOMHUSLIV", + "bind": { + "relevant": "${FWNHWOMSTRMEN}='0' and ${FWNHWOMHUSALV}='1'", + "required": "yes" + }, + "label": { + "Bengali": "আপনি কি বর্তমানে আপনার স্বামীর সাথে বসবাস করছেন?", + "English": "Are you currently living with your husband?" + }, + "instance": { + "openmrs_entity_id": "1060AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one" }, { - "name": "join_names", - "bind": { - "calculate": "join(' ', ${FWWOMFNAME})" - }, - "type": "calculate" + "children": [ + { + "name": "0", + "label": { + "Bengali": "না", + "English": "No" + }, + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "name": "1", + "label": { + "Bengali": "হ্যাঁ", + "English": "Yes" + }, + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "name": "9", + "label": { + "Bengali": "জানিনা", + "English": "Don't know" + }, + "instance": { + "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + } + ], + "name": "FWNHWOMHUSSTR", + "bind": { + "relevant": "${FWNHWOMSTRMEN}='0' and ${FWNHWOMHUSLIV}='1'", + "required": "yes" + }, + "label": { + "Bengali": "আপনার স্বামী কি স্থায়ী জন্মনিয়ন্ত্রন পদ্ধতি গ্রহণ করেছেন?", + "English": "Is the husband sterilized?" + }, + "type": "select one" }, { - "name": "MWRA", - "bind": { - "calculate": "if(${join_names} = '', 0, count(${woman}))" - }, - "type": "calculate" + "name": "FWELIGIBLE", + "bind": { + "calculate": "if(${FWNHWOMSTRMEN}='0' and ${FWNHWOMHUSLIV}='1' and ${FWNHWOMHUSSTR}='0',1,0)" + }, + "type": "calculate" }, { - "control": { - "bodyless": true - }, - "children": [ - { - "name": "instanceID", - "bind": { - "readonly": "true()", - "calculate": "concat('uuid:', uuid())" - }, - "type": "calculate" - } - ], - "name": "meta", - "type": "group" + "name": "add_women", + "label": { + "Bengali": "এই খানায় যদি আরও কোন মহিলা থাকে যাকে রেজিস্ট্রেশন করা হয়নি, তাহলে '+' অপশনটি বাছুন এবং একই প্রক্রিয়ায় পরবর্তী মহিলাকে রেজিস্ট্রেশন করুন", + "English": "If there are any additional unregistered women in this household, select the '+' to add them now." + }, + "type": "note" } - ], - "instance": { - "encounter_type": "New Household Registration" + ], + "name": "woman", + "hint": { + "Bengali": "আমরা এখন মহিলাটির রেজিস্ট্রেশন প্রক্রিয়া শুরু করতে যাচ্ছি। অনুগ্রহ করে মহিলাটিরে তার জন্ম নিবন্ধন স ও জাতীয় পরিচয়পত্র নিয়ে আসতে বলুন।", + "English": "We will now register the woman. Please ask her to bring her National ID Card and Birth Certificate." + }, + "bind": { + "relevant": "${FWNHHMWRA}='1'" + }, + "label": { + "Bengali": "মহিলা তথ্যঃ", + "English": "New Woman Registration" + }, + "instance": { + "openmrs_entity_id": "Census and New Woman Registration", + "openmrs_entity": "person" + }, + "type": "repeat" }, - "version": "201505070930", - "type": "survey", - "name": "FWNewHH", - "sms_keyword": "FWNewHH", - "title": "FW new HH Reg" + { + "name": "join_names", + "bind": { + "calculate": "join(' ', ${FWWOMFNAME})" + }, + "type": "calculate" + }, + { + "name": "MWRA", + "bind": { + "calculate": "if(${join_names} = '', 0, count(${woman}))" + }, + "type": "calculate" + }, + { + "control": { + "bodyless": true + }, + "children": [ + { + "name": "instanceID", + "bind": { + "readonly": "true()", + "calculate": "concat('uuid:', uuid())" + }, + "type": "calculate" + } + ], + "name": "meta", + "type": "group" + } + ], + "instance": { + "encounter_type": "New Household Registration" + }, + "version": "201505070930", + "type": "survey", + "name": "FWNewHH", + "sms_keyword": "FWNewHH", + "title": "FW new HH Reg" } \ No newline at end of file diff --git a/src/test/resources/form/new_household_registration/form.xml b/src/test/resources/form/new_household_registration/form.xml index 85089deaa..6f7c5ebff 100644 --- a/src/test/resources/form/new_household_registration/form.xml +++ b/src/test/resources/form/new_household_registration/form.xml @@ -1,26 +1,612 @@ -
-

নতুন খানা রেজিস্ট্রেশন ফর্ম

+ + + + +

নতুন খানা রেজিস্ট্রেশন + ফর্ম +

+ - - - - - - - -
এই খানায় কি প্রজনন বয়সী বিবাহিত মহিলা আছেন?Are there any MWRAs in this Household? -
-

মহিলা তথ্যঃNew Woman Registration

আপনার কি মাসিক একেবারে উঠে গেছে/আপনি কি স্থায়ী জন্মনিয়ন্ত্রন পদ্ধতি গ্রহণ করেছেন?Are you currently menopausal or sterilized?* -
আপনার স্বামী কি বেঁচে আছেন?Is the husband alive?* -
আপনি কি বর্তমানে আপনার স্বামীর সাথে বসবাস করছেন?Are you currently living with your husband?* -
আপনার স্বামী কি স্থায়ী জন্মনিয়ন্ত্রন পদ্ধতি গ্রহণ করেছেন?Is the husband sterilized?* -
-
-
+ + + + + + + +
+
+ + এই + খানায় কি প্রজনন + বয়সী বিবাহিত মহিলা + আছেন? + + Are there any MWRAs + in this Household? + + +
+ + + +
+
+
+
+

+ মহিলা + তথ্যঃ + + New Woman Registration + +

+
+ + + + + + +
+
+ + আপনার + কি মাসিক একেবারে + উঠে গেছে/আপনি কি + স্থায়ী জন্মনিয়ন্ত্রন + পদ্ধতি গ্রহণ করেছেন? + + + Are you currently menopausal or sterilized? + + * + +
+ + + +
+
+
+
+
+ + আপনার + স্বামী কি বেঁচে + আছেন? + + + Is the husband alive? + + * + +
+ + + +
+
+
+
+
+ + আপনি + কি বর্তমানে আপনার + স্বামীর সাথে বসবাস + করছেন? + + + Are you currently living with your husband? + + * + +
+ + + +
+
+
+
+
+ + আপনার + স্বামী কি স্থায়ী + জন্মনিয়ন্ত্রন + পদ্ধতি গ্রহণ করেছেন? + + + Is the husband sterilized? + + * + +
+ + + +
+
+
+ +
+
- XML to HTML transformation for form took 0.03 secondsThis validation is yet not functional.
+ + + + + XML to HTML transformation for form took 0.03 seconds + + + This validation is yet not functional. + + + + +
diff --git a/src/test/resources/form/new_household_registration/form_submission1.json b/src/test/resources/form/new_household_registration/form_submission1.json index a6a2f189a..7fa323514 100644 --- a/src/test/resources/form/new_household_registration/form_submission1.json +++ b/src/test/resources/form/new_household_registration/form_submission1.json @@ -1,228 +1,228 @@ { - "_id": "251ca0ef09df9af88f0e9d5f180115a3", - "_rev": "1-e73e1d93acdcdaeb1d41a738da5d9284", - "type": "FormSubmission", - "anmId": "demotest", - "instanceId": "88c0e824-10b4-44c2-9429-754b8d823776", - "formName": "new_household_registration", - "entityId": "a3f2abf4-2699-4761-819a-cea739224164", - "clientVersion": 1430997074596, - "formDataDefinitionVersion": "1", - "formInstance": { - "form_data_definition_version": "1", - "form": { - "bind_type": "household", - "default_bind_path": "/model/instance/FWNewHH", - "fields": [ - { - "name": "id", - "value": "a3f2abf4-2699-4761-819a-cea739224164", - "source": "household.id" - }, - { - "name": "existing_location", - "value": "KUPTALA", - "source": "household.existing_location" - }, - { - "name": "today", - "value": "2015-05-07", - "source": "household.today" - }, - { - "name": "start", - "value": "2015-05-07T17:07:21.000+06:00", - "source": "household.start" - }, - { - "name": "end", - "value": "2015-05-07T17:07:21.000+06:00", - "source": "household.end" - }, - { - "name": "FWNHREGDATE", - "value": "2015-05-07", - "source": "household.FWNHREGDATE" - }, - { - "name": "FWGOBHHID", - "value": "1234", - "source": "household.FWGOBHHID" - }, - { - "name": "FWJIVHHID", - "value": "1234", - "source": "household.FWJIVHHID" - }, - { - "name": "FWNHNEARTO", - "value": "nothing", - "source": "household.FWNHNEARTO" - }, - { - "name": "FWNHHHGPS", - "value": "34 34 0 0", - "source": "household.FWNHHHGPS" - }, - { - "name": "FWHOHFNAME", - "value": "test", - "source": "household.FWHOHFNAME" - }, - { - "name": "FWHOHLNAME", - "value": ".", - "source": "household.FWHOHLNAME" - }, - { - "name": "FWHOHBIRTHDATE", - "value": "1900-01-01", - "source": "household.FWHOHBIRTHDATE" - }, - { - "name": "FWHOHGENDER", - "value": "male", - "source": "household.FWHOHGENDER" - }, - { - "name": "FWNHHMBRNUM", - "value": "2", - "source": "household.FWNHHMBRNUM" - }, - { - "name": "FWNHHMWRA", - "value": "1", - "source": "household.FWNHHMWRA" - }, - { - "name": "join_names", - "value": "shumi sumaita", - "source": "household.join_names" - }, - { - "name": "MWRA", - "value": "2", - "source": "household.MWRA" - } - ], - "sub_forms": [ - { - "name": "elco_registration", - "bind_type": "elco", - "default_bind_path": "/model/instance/FWNewHH/woman", - "fields": [ - { - "name": "id", - "source": "elco.id" - }, - { - "name": "GOBHHID", - "source": "elco.GOBHHID" - }, - { - "name": "JiVitAHHID", - "source": "elco.JiVitAHHID" - }, - { - "name": "FWWOMFNAME", - "source": "elco.FWWOMFNAME" - }, - { - "name": "FWWOMLNAME", - "source": "elco.FWWOMLNAME" - }, - { - "name": "FWWOMNID", - "source": "elco.FWWOMNID" - }, - { - "name": "FWWOMBID", - "source": "elco.FWWOMBID" - }, - { - "name": "FWHUSNAME", - "source": "elco.FWHUSNAME" - }, - { - "name": "FWBIRTHDATE", - "source": "elco.FWBIRTHDATE" - }, - { - "name": "FWGENDER", - "source": "elco.FWGENDER" - }, - { - "name": "FWWOMAGE", - "source": "elco.FWWOMAGE" - }, - { - "name": "display_age", - "source": "elco.display_age" - }, - { - "name": "FWNHWOMSTRMEN", - "source": "elco.FWNHWOMSTRMEN" - }, - { - "name": "FWNHWOMHUSALV", - "source": "elco.FWNHWOMHUSALV" - }, - { - "name": "FWNHWOMHUSLIV", - "source": "elco.FWNHWOMHUSLIV" - }, - { - "name": "FWNHWOMHUSSTR", - "source": "elco.FWNHWOMHUSSTR" - }, - { - "name": "FWELIGIBLE", - "source": "elco.FWELIGIBLE" - } - ], - "instances": [ - { - "GOBHHID": "1234323", - "JiVitAHHID": "123465656", - "FWWOMFNAME": "shumi", - "FWWOMLNAME": ".", - "FWWOMNID": "", - "FWWOMBID": "54676545676787876", - "FWHUSNAME": "selim", - "FWBIRTHDATE": "1998-02-04", - "FWGENDER": "female", - "FWWOMAGE": "17", - "display_age": "", - "FWNHWOMSTRMEN": "1", - "FWNHWOMHUSALV": "", - "FWNHWOMHUSLIV": "", - "FWNHWOMHUSSTR": "", - "FWELIGIBLE": "0", - "id": "babcd9d2-b3e9-4f6d-8a06-2df8f5fbf01f" - }, - { - "GOBHHID": "1234121", - "JiVitAHHID": "12348787", - "FWWOMFNAME": "sumaita", - "FWWOMLNAME": ".", - "FWWOMNID": "", - "FWWOMBID": "56543456567654567", - "FWHUSNAME": "razzak", - "FWBIRTHDATE": "1989-08-18", - "FWGENDER": "female", - "FWWOMAGE": "26", - "display_age": "", - "FWNHWOMSTRMEN": "0", - "FWNHWOMHUSALV": "1", - "FWNHWOMHUSLIV": "1", - "FWNHWOMHUSSTR": "1", - "FWELIGIBLE": "0", - "id": "74eebb60-a1b9-4691-81a4-5c04ecce7ae9" - } - ] - } - ] - } - }, - "serverVersion": 1430998001293 + "_id": "251ca0ef09df9af88f0e9d5f180115a3", + "_rev": "1-e73e1d93acdcdaeb1d41a738da5d9284", + "type": "FormSubmission", + "anmId": "demotest", + "instanceId": "88c0e824-10b4-44c2-9429-754b8d823776", + "formName": "new_household_registration", + "entityId": "a3f2abf4-2699-4761-819a-cea739224164", + "clientVersion": 1430997074596, + "formDataDefinitionVersion": "1", + "formInstance": { + "form_data_definition_version": "1", + "form": { + "bind_type": "household", + "default_bind_path": "/model/instance/FWNewHH", + "fields": [ + { + "name": "id", + "value": "a3f2abf4-2699-4761-819a-cea739224164", + "source": "household.id" + }, + { + "name": "existing_location", + "value": "KUPTALA", + "source": "household.existing_location" + }, + { + "name": "today", + "value": "2015-05-07", + "source": "household.today" + }, + { + "name": "start", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "household.start" + }, + { + "name": "end", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "household.end" + }, + { + "name": "FWNHREGDATE", + "value": "2015-05-07", + "source": "household.FWNHREGDATE" + }, + { + "name": "FWGOBHHID", + "value": "1234", + "source": "household.FWGOBHHID" + }, + { + "name": "FWJIVHHID", + "value": "1234", + "source": "household.FWJIVHHID" + }, + { + "name": "FWNHNEARTO", + "value": "nothing", + "source": "household.FWNHNEARTO" + }, + { + "name": "FWNHHHGPS", + "value": "34 34 0 0", + "source": "household.FWNHHHGPS" + }, + { + "name": "FWHOHFNAME", + "value": "test", + "source": "household.FWHOHFNAME" + }, + { + "name": "FWHOHLNAME", + "value": ".", + "source": "household.FWHOHLNAME" + }, + { + "name": "FWHOHBIRTHDATE", + "value": "1900-01-01", + "source": "household.FWHOHBIRTHDATE" + }, + { + "name": "FWHOHGENDER", + "value": "male", + "source": "household.FWHOHGENDER" + }, + { + "name": "FWNHHMBRNUM", + "value": "2", + "source": "household.FWNHHMBRNUM" + }, + { + "name": "FWNHHMWRA", + "value": "1", + "source": "household.FWNHHMWRA" + }, + { + "name": "join_names", + "value": "shumi sumaita", + "source": "household.join_names" + }, + { + "name": "MWRA", + "value": "2", + "source": "household.MWRA" + } + ], + "sub_forms": [ + { + "name": "elco_registration", + "bind_type": "elco", + "default_bind_path": "/model/instance/FWNewHH/woman", + "fields": [ + { + "name": "id", + "source": "elco.id" + }, + { + "name": "GOBHHID", + "source": "elco.GOBHHID" + }, + { + "name": "JiVitAHHID", + "source": "elco.JiVitAHHID" + }, + { + "name": "FWWOMFNAME", + "source": "elco.FWWOMFNAME" + }, + { + "name": "FWWOMLNAME", + "source": "elco.FWWOMLNAME" + }, + { + "name": "FWWOMNID", + "source": "elco.FWWOMNID" + }, + { + "name": "FWWOMBID", + "source": "elco.FWWOMBID" + }, + { + "name": "FWHUSNAME", + "source": "elco.FWHUSNAME" + }, + { + "name": "FWBIRTHDATE", + "source": "elco.FWBIRTHDATE" + }, + { + "name": "FWGENDER", + "source": "elco.FWGENDER" + }, + { + "name": "FWWOMAGE", + "source": "elco.FWWOMAGE" + }, + { + "name": "display_age", + "source": "elco.display_age" + }, + { + "name": "FWNHWOMSTRMEN", + "source": "elco.FWNHWOMSTRMEN" + }, + { + "name": "FWNHWOMHUSALV", + "source": "elco.FWNHWOMHUSALV" + }, + { + "name": "FWNHWOMHUSLIV", + "source": "elco.FWNHWOMHUSLIV" + }, + { + "name": "FWNHWOMHUSSTR", + "source": "elco.FWNHWOMHUSSTR" + }, + { + "name": "FWELIGIBLE", + "source": "elco.FWELIGIBLE" + } + ], + "instances": [ + { + "GOBHHID": "1234323", + "JiVitAHHID": "123465656", + "FWWOMFNAME": "shumi", + "FWWOMLNAME": ".", + "FWWOMNID": "", + "FWWOMBID": "54676545676787876", + "FWHUSNAME": "selim", + "FWBIRTHDATE": "1998-02-04", + "FWGENDER": "female", + "FWWOMAGE": "17", + "display_age": "", + "FWNHWOMSTRMEN": "1", + "FWNHWOMHUSALV": "", + "FWNHWOMHUSLIV": "", + "FWNHWOMHUSSTR": "", + "FWELIGIBLE": "0", + "id": "babcd9d2-b3e9-4f6d-8a06-2df8f5fbf01f" + }, + { + "GOBHHID": "1234121", + "JiVitAHHID": "12348787", + "FWWOMFNAME": "sumaita", + "FWWOMLNAME": ".", + "FWWOMNID": "", + "FWWOMBID": "56543456567654567", + "FWHUSNAME": "razzak", + "FWBIRTHDATE": "1989-08-18", + "FWGENDER": "female", + "FWWOMAGE": "26", + "display_age": "", + "FWNHWOMSTRMEN": "0", + "FWNHWOMHUSALV": "1", + "FWNHWOMHUSLIV": "1", + "FWNHWOMHUSSTR": "1", + "FWELIGIBLE": "0", + "id": "74eebb60-a1b9-4691-81a4-5c04ecce7ae9" + } + ] + } + ] + } + }, + "serverVersion": 1430998001293 } \ No newline at end of file diff --git a/src/test/resources/form/new_household_registration/form_submission3.json b/src/test/resources/form/new_household_registration/form_submission3.json index 113c3c082..48f39333f 100644 --- a/src/test/resources/form/new_household_registration/form_submission3.json +++ b/src/test/resources/form/new_household_registration/form_submission3.json @@ -1,208 +1,208 @@ { - "_id": "251ca0ef09df9af88f0e9d5f1800160d", - "_rev": "1-89988ca8cc2db0cd67afc292263137fe", - "type": "FormSubmission", - "anmId": "demotest", - "instanceId": "1cdf1628-86f2-440b-b5b0-4bc612d2fd2f", - "formName": "new_household_registration", - "entityId": "baf59aa4-64e9-46fc-99e6-8cd8f01618ff", - "clientVersion": 1430925173098, - "formDataDefinitionVersion": "1", - "formInstance": { - "form_data_definition_version": "1", - "form": { - "bind_type": "household", - "default_bind_path": "/model/instance/FWNewHH", - "fields": [ - { - "name": "id", - "value": "baf59aa4-64e9-46fc-99e6-8cd8f01618ff", - "source": "household.id" - }, - { - "name": "existing_location", - "value": "LAKSHMIPUR", - "source": "household.existing_location" - }, - { - "name": "today", - "value": "2015-05-06", - "source": "household.today" - }, - { - "name": "start", - "value": "2015-05-06T21:09:22.000+06:00", - "source": "household.start" - }, - { - "name": "end", - "value": "2015-05-06T21:09:22.000+06:00", - "source": "household.end" - }, - { - "name": "FWNHREGDATE", - "value": "2015-05-06", - "source": "household.FWNHREGDATE" - }, - { - "name": "FWGOBHHID", - "value": "0091", - "source": "household.FWGOBHHID" - }, - { - "name": "FWJIVHHID", - "value": "0091", - "source": "household.FWJIVHHID" - }, - { - "name": "FWNHNEARTO", - "source": "household.FWNHNEARTO" - }, - { - "name": "FWNHHHGPS", - "value": "23.7984 90.402 0 40", - "source": "household.FWNHHHGPS" - }, - { - "name": "FWHOHFNAME", - "value": "hasan ferox", - "source": "household.FWHOHFNAME" - }, - { - "name": "FWHOHLNAME", - "value": ".", - "source": "household.FWHOHLNAME" - }, - { - "name": "FWHOHBIRTHDATE", - "value": "1900-01-01", - "source": "household.FWHOHBIRTHDATE" - }, - { - "name": "FWHOHGENDER", - "value": "male", - "source": "household.FWHOHGENDER" - }, - { - "name": "FWNHHMBRNUM", - "value": "1", - "source": "household.FWNHHMBRNUM" - }, - { - "name": "FWNHHMWRA", - "value": "1", - "source": "household.FWNHHMWRA" - }, - { - "name": "join_names", - "value": "mithila", - "source": "household.join_names" - }, - { - "name": "MWRA", - "value": "1", - "source": "household.MWRA" - } - ], - "sub_forms": [ - { - "name": "elco_registration", - "bind_type": "elco", - "default_bind_path": "/model/instance/FWNewHH/woman", - "fields": [ - { - "name": "id", - "source": "elco.id" - }, - { - "name": "GOBHHID", - "source": "elco.GOBHHID" - }, - { - "name": "JiVitAHHID", - "source": "elco.JiVitAHHID" - }, - { - "name": "FWWOMFNAME", - "source": "elco.FWWOMFNAME" - }, - { - "name": "FWWOMLNAME", - "source": "elco.FWWOMLNAME" - }, - { - "name": "FWWOMNID", - "source": "elco.FWWOMNID" - }, - { - "name": "FWWOMBID", - "source": "elco.FWWOMBID" - }, - { - "name": "FWHUSNAME", - "source": "elco.FWHUSNAME" - }, - { - "name": "FWBIRTHDATE", - "source": "elco.FWBIRTHDATE" - }, - { - "name": "FWGENDER", - "source": "elco.FWGENDER" - }, - { - "name": "FWWOMAGE", - "source": "elco.FWWOMAGE" - }, - { - "name": "display_age", - "source": "elco.display_age" - }, - { - "name": "FWNHWOMSTRMEN", - "source": "elco.FWNHWOMSTRMEN" - }, - { - "name": "FWNHWOMHUSALV", - "source": "elco.FWNHWOMHUSALV" - }, - { - "name": "FWNHWOMHUSLIV", - "source": "elco.FWNHWOMHUSLIV" - }, - { - "name": "FWNHWOMHUSSTR", - "source": "elco.FWNHWOMHUSSTR" - }, - { - "name": "FWELIGIBLE", - "source": "elco.FWELIGIBLE" - } - ], - "instances": [ - { - "GOBHHID": "0091", - "JiVitAHHID": "0524091", - "FWWOMFNAME": "mithila", - "FWWOMLNAME": ".", - "FWWOMNID": "1111111111111", - "FWWOMBID": "12345678912345678", - "FWHUSNAME": "hasan feroz", - "FWBIRTHDATE": "1989-01-01", - "FWGENDER": "female", - "FWWOMAGE": "26", - "display_age": "", - "FWNHWOMSTRMEN": "0", - "FWNHWOMHUSALV": "1", - "FWNHWOMHUSLIV": "1", - "FWNHWOMHUSSTR": "1", - "FWELIGIBLE": "0", - "id": "409b44c4-262a-40b8-ad7d-748c480c7c13" - } - ] - } - ] - } - }, - "serverVersion": 1430925176060 + "_id": "251ca0ef09df9af88f0e9d5f1800160d", + "_rev": "1-89988ca8cc2db0cd67afc292263137fe", + "type": "FormSubmission", + "anmId": "demotest", + "instanceId": "1cdf1628-86f2-440b-b5b0-4bc612d2fd2f", + "formName": "new_household_registration", + "entityId": "baf59aa4-64e9-46fc-99e6-8cd8f01618ff", + "clientVersion": 1430925173098, + "formDataDefinitionVersion": "1", + "formInstance": { + "form_data_definition_version": "1", + "form": { + "bind_type": "household", + "default_bind_path": "/model/instance/FWNewHH", + "fields": [ + { + "name": "id", + "value": "baf59aa4-64e9-46fc-99e6-8cd8f01618ff", + "source": "household.id" + }, + { + "name": "existing_location", + "value": "LAKSHMIPUR", + "source": "household.existing_location" + }, + { + "name": "today", + "value": "2015-05-06", + "source": "household.today" + }, + { + "name": "start", + "value": "2015-05-06T21:09:22.000+06:00", + "source": "household.start" + }, + { + "name": "end", + "value": "2015-05-06T21:09:22.000+06:00", + "source": "household.end" + }, + { + "name": "FWNHREGDATE", + "value": "2015-05-06", + "source": "household.FWNHREGDATE" + }, + { + "name": "FWGOBHHID", + "value": "0091", + "source": "household.FWGOBHHID" + }, + { + "name": "FWJIVHHID", + "value": "0091", + "source": "household.FWJIVHHID" + }, + { + "name": "FWNHNEARTO", + "source": "household.FWNHNEARTO" + }, + { + "name": "FWNHHHGPS", + "value": "23.7984 90.402 0 40", + "source": "household.FWNHHHGPS" + }, + { + "name": "FWHOHFNAME", + "value": "hasan ferox", + "source": "household.FWHOHFNAME" + }, + { + "name": "FWHOHLNAME", + "value": ".", + "source": "household.FWHOHLNAME" + }, + { + "name": "FWHOHBIRTHDATE", + "value": "1900-01-01", + "source": "household.FWHOHBIRTHDATE" + }, + { + "name": "FWHOHGENDER", + "value": "male", + "source": "household.FWHOHGENDER" + }, + { + "name": "FWNHHMBRNUM", + "value": "1", + "source": "household.FWNHHMBRNUM" + }, + { + "name": "FWNHHMWRA", + "value": "1", + "source": "household.FWNHHMWRA" + }, + { + "name": "join_names", + "value": "mithila", + "source": "household.join_names" + }, + { + "name": "MWRA", + "value": "1", + "source": "household.MWRA" + } + ], + "sub_forms": [ + { + "name": "elco_registration", + "bind_type": "elco", + "default_bind_path": "/model/instance/FWNewHH/woman", + "fields": [ + { + "name": "id", + "source": "elco.id" + }, + { + "name": "GOBHHID", + "source": "elco.GOBHHID" + }, + { + "name": "JiVitAHHID", + "source": "elco.JiVitAHHID" + }, + { + "name": "FWWOMFNAME", + "source": "elco.FWWOMFNAME" + }, + { + "name": "FWWOMLNAME", + "source": "elco.FWWOMLNAME" + }, + { + "name": "FWWOMNID", + "source": "elco.FWWOMNID" + }, + { + "name": "FWWOMBID", + "source": "elco.FWWOMBID" + }, + { + "name": "FWHUSNAME", + "source": "elco.FWHUSNAME" + }, + { + "name": "FWBIRTHDATE", + "source": "elco.FWBIRTHDATE" + }, + { + "name": "FWGENDER", + "source": "elco.FWGENDER" + }, + { + "name": "FWWOMAGE", + "source": "elco.FWWOMAGE" + }, + { + "name": "display_age", + "source": "elco.display_age" + }, + { + "name": "FWNHWOMSTRMEN", + "source": "elco.FWNHWOMSTRMEN" + }, + { + "name": "FWNHWOMHUSALV", + "source": "elco.FWNHWOMHUSALV" + }, + { + "name": "FWNHWOMHUSLIV", + "source": "elco.FWNHWOMHUSLIV" + }, + { + "name": "FWNHWOMHUSSTR", + "source": "elco.FWNHWOMHUSSTR" + }, + { + "name": "FWELIGIBLE", + "source": "elco.FWELIGIBLE" + } + ], + "instances": [ + { + "GOBHHID": "0091", + "JiVitAHHID": "0524091", + "FWWOMFNAME": "mithila", + "FWWOMLNAME": ".", + "FWWOMNID": "1111111111111", + "FWWOMBID": "12345678912345678", + "FWHUSNAME": "hasan feroz", + "FWBIRTHDATE": "1989-01-01", + "FWGENDER": "female", + "FWWOMAGE": "26", + "display_age": "", + "FWNHWOMSTRMEN": "0", + "FWNHWOMHUSALV": "1", + "FWNHWOMHUSLIV": "1", + "FWNHWOMHUSSTR": "1", + "FWELIGIBLE": "0", + "id": "409b44c4-262a-40b8-ad7d-748c480c7c13" + } + ] + } + ] + } + }, + "serverVersion": 1430925176060 } \ No newline at end of file diff --git a/src/test/resources/form/new_household_registration/form_submission4.json b/src/test/resources/form/new_household_registration/form_submission4.json index 7665de241..5e7bcf07a 100644 --- a/src/test/resources/form/new_household_registration/form_submission4.json +++ b/src/test/resources/form/new_household_registration/form_submission4.json @@ -1,208 +1,208 @@ { - "_id": "251ca0ef09df9af88f0e9d5f18001e50", - "_rev": "1-3a413b7428ae33aafd08898dc2c974d4", - "type": "FormSubmission", - "anmId": "demotest", - "instanceId": "cad01d9c-9f7f-4e0b-a66a-2d1121bf8b8d", - "formName": "new_household_registration", - "entityId": "f92ee1b5-c3ce-42fb-bbc8-e01f474acc5a", - "clientVersion": 1430926871912, - "formDataDefinitionVersion": "1", - "formInstance": { - "form_data_definition_version": "1", - "form": { - "bind_type": "household", - "default_bind_path": "/model/instance/FWNewHH", - "fields": [ - { - "name": "id", - "value": "f92ee1b5-c3ce-42fb-bbc8-e01f474acc5a", - "source": "household.id" - }, - { - "name": "existing_location", - "value": "KUPTALA", - "source": "household.existing_location" - }, - { - "name": "today", - "value": "2015-05-06", - "source": "household.today" - }, - { - "name": "start", - "value": "2015-05-06T21:38:52.000+06:00", - "source": "household.start" - }, - { - "name": "end", - "value": "2015-05-06T21:38:52.000+06:00", - "source": "household.end" - }, - { - "name": "FWNHREGDATE", - "value": "2015-05-06", - "source": "household.FWNHREGDATE" - }, - { - "name": "FWGOBHHID", - "value": "4567", - "source": "household.FWGOBHHID" - }, - { - "name": "FWJIVHHID", - "value": "5678", - "source": "household.FWJIVHHID" - }, - { - "name": "FWNHNEARTO", - "source": "household.FWNHNEARTO" - }, - { - "name": "FWNHHHGPS", - "value": "23.7984 90.4021 0 37", - "source": "household.FWNHHHGPS" - }, - { - "name": "FWHOHFNAME", - "value": "jashim mia", - "source": "household.FWHOHFNAME" - }, - { - "name": "FWHOHLNAME", - "value": ".", - "source": "household.FWHOHLNAME" - }, - { - "name": "FWHOHBIRTHDATE", - "value": "1900-01-01", - "source": "household.FWHOHBIRTHDATE" - }, - { - "name": "FWHOHGENDER", - "value": "male", - "source": "household.FWHOHGENDER" - }, - { - "name": "FWNHHMBRNUM", - "value": "5", - "source": "household.FWNHHMBRNUM" - }, - { - "name": "FWNHHMWRA", - "value": "1", - "source": "household.FWNHHMWRA" - }, - { - "name": "join_names", - "value": "razia sultana", - "source": "household.join_names" - }, - { - "name": "MWRA", - "value": "1", - "source": "household.MWRA" - } - ], - "sub_forms": [ - { - "name": "elco_registration", - "bind_type": "elco", - "default_bind_path": "/model/instance/FWNewHH/woman", - "fields": [ - { - "name": "id", - "source": "elco.id" - }, - { - "name": "GOBHHID", - "source": "elco.GOBHHID" - }, - { - "name": "JiVitAHHID", - "source": "elco.JiVitAHHID" - }, - { - "name": "FWWOMFNAME", - "source": "elco.FWWOMFNAME" - }, - { - "name": "FWWOMLNAME", - "source": "elco.FWWOMLNAME" - }, - { - "name": "FWWOMNID", - "source": "elco.FWWOMNID" - }, - { - "name": "FWWOMBID", - "source": "elco.FWWOMBID" - }, - { - "name": "FWHUSNAME", - "source": "elco.FWHUSNAME" - }, - { - "name": "FWBIRTHDATE", - "source": "elco.FWBIRTHDATE" - }, - { - "name": "FWGENDER", - "source": "elco.FWGENDER" - }, - { - "name": "FWWOMAGE", - "source": "elco.FWWOMAGE" - }, - { - "name": "display_age", - "source": "elco.display_age" - }, - { - "name": "FWNHWOMSTRMEN", - "source": "elco.FWNHWOMSTRMEN" - }, - { - "name": "FWNHWOMHUSALV", - "source": "elco.FWNHWOMHUSALV" - }, - { - "name": "FWNHWOMHUSLIV", - "source": "elco.FWNHWOMHUSLIV" - }, - { - "name": "FWNHWOMHUSSTR", - "source": "elco.FWNHWOMHUSSTR" - }, - { - "name": "FWELIGIBLE", - "source": "elco.FWELIGIBLE" - } - ], - "instances": [ - { - "GOBHHID": "4567", - "JiVitAHHID": "5678", - "FWWOMFNAME": "razia sultana", - "FWWOMLNAME": ".", - "FWWOMNID": "0987654321123", - "FWWOMBID": "09876543211234567", - "FWHUSNAME": "jashim mia", - "FWBIRTHDATE": "1991-02-27", - "FWGENDER": "female", - "FWWOMAGE": "24", - "display_age": "", - "FWNHWOMSTRMEN": "0", - "FWNHWOMHUSALV": "1", - "FWNHWOMHUSLIV": "1", - "FWNHWOMHUSSTR": "0", - "FWELIGIBLE": "1", - "id": "0036b7ca-36ec-4242-9885-a0a03a666cda" - } - ] - } - ] - } - }, - "serverVersion": 1430926886181 + "_id": "251ca0ef09df9af88f0e9d5f18001e50", + "_rev": "1-3a413b7428ae33aafd08898dc2c974d4", + "type": "FormSubmission", + "anmId": "demotest", + "instanceId": "cad01d9c-9f7f-4e0b-a66a-2d1121bf8b8d", + "formName": "new_household_registration", + "entityId": "f92ee1b5-c3ce-42fb-bbc8-e01f474acc5a", + "clientVersion": 1430926871912, + "formDataDefinitionVersion": "1", + "formInstance": { + "form_data_definition_version": "1", + "form": { + "bind_type": "household", + "default_bind_path": "/model/instance/FWNewHH", + "fields": [ + { + "name": "id", + "value": "f92ee1b5-c3ce-42fb-bbc8-e01f474acc5a", + "source": "household.id" + }, + { + "name": "existing_location", + "value": "KUPTALA", + "source": "household.existing_location" + }, + { + "name": "today", + "value": "2015-05-06", + "source": "household.today" + }, + { + "name": "start", + "value": "2015-05-06T21:38:52.000+06:00", + "source": "household.start" + }, + { + "name": "end", + "value": "2015-05-06T21:38:52.000+06:00", + "source": "household.end" + }, + { + "name": "FWNHREGDATE", + "value": "2015-05-06", + "source": "household.FWNHREGDATE" + }, + { + "name": "FWGOBHHID", + "value": "4567", + "source": "household.FWGOBHHID" + }, + { + "name": "FWJIVHHID", + "value": "5678", + "source": "household.FWJIVHHID" + }, + { + "name": "FWNHNEARTO", + "source": "household.FWNHNEARTO" + }, + { + "name": "FWNHHHGPS", + "value": "23.7984 90.4021 0 37", + "source": "household.FWNHHHGPS" + }, + { + "name": "FWHOHFNAME", + "value": "jashim mia", + "source": "household.FWHOHFNAME" + }, + { + "name": "FWHOHLNAME", + "value": ".", + "source": "household.FWHOHLNAME" + }, + { + "name": "FWHOHBIRTHDATE", + "value": "1900-01-01", + "source": "household.FWHOHBIRTHDATE" + }, + { + "name": "FWHOHGENDER", + "value": "male", + "source": "household.FWHOHGENDER" + }, + { + "name": "FWNHHMBRNUM", + "value": "5", + "source": "household.FWNHHMBRNUM" + }, + { + "name": "FWNHHMWRA", + "value": "1", + "source": "household.FWNHHMWRA" + }, + { + "name": "join_names", + "value": "razia sultana", + "source": "household.join_names" + }, + { + "name": "MWRA", + "value": "1", + "source": "household.MWRA" + } + ], + "sub_forms": [ + { + "name": "elco_registration", + "bind_type": "elco", + "default_bind_path": "/model/instance/FWNewHH/woman", + "fields": [ + { + "name": "id", + "source": "elco.id" + }, + { + "name": "GOBHHID", + "source": "elco.GOBHHID" + }, + { + "name": "JiVitAHHID", + "source": "elco.JiVitAHHID" + }, + { + "name": "FWWOMFNAME", + "source": "elco.FWWOMFNAME" + }, + { + "name": "FWWOMLNAME", + "source": "elco.FWWOMLNAME" + }, + { + "name": "FWWOMNID", + "source": "elco.FWWOMNID" + }, + { + "name": "FWWOMBID", + "source": "elco.FWWOMBID" + }, + { + "name": "FWHUSNAME", + "source": "elco.FWHUSNAME" + }, + { + "name": "FWBIRTHDATE", + "source": "elco.FWBIRTHDATE" + }, + { + "name": "FWGENDER", + "source": "elco.FWGENDER" + }, + { + "name": "FWWOMAGE", + "source": "elco.FWWOMAGE" + }, + { + "name": "display_age", + "source": "elco.display_age" + }, + { + "name": "FWNHWOMSTRMEN", + "source": "elco.FWNHWOMSTRMEN" + }, + { + "name": "FWNHWOMHUSALV", + "source": "elco.FWNHWOMHUSALV" + }, + { + "name": "FWNHWOMHUSLIV", + "source": "elco.FWNHWOMHUSLIV" + }, + { + "name": "FWNHWOMHUSSTR", + "source": "elco.FWNHWOMHUSSTR" + }, + { + "name": "FWELIGIBLE", + "source": "elco.FWELIGIBLE" + } + ], + "instances": [ + { + "GOBHHID": "4567", + "JiVitAHHID": "5678", + "FWWOMFNAME": "razia sultana", + "FWWOMLNAME": ".", + "FWWOMNID": "0987654321123", + "FWWOMBID": "09876543211234567", + "FWHUSNAME": "jashim mia", + "FWBIRTHDATE": "1991-02-27", + "FWGENDER": "female", + "FWWOMAGE": "24", + "display_age": "", + "FWNHWOMSTRMEN": "0", + "FWNHWOMHUSALV": "1", + "FWNHWOMHUSLIV": "1", + "FWNHWOMHUSSTR": "0", + "FWELIGIBLE": "1", + "id": "0036b7ca-36ec-4242-9885-a0a03a666cda" + } + ] + } + ] + } + }, + "serverVersion": 1430926886181 } \ No newline at end of file diff --git a/src/test/resources/form/new_household_registration/form_submission5.json b/src/test/resources/form/new_household_registration/form_submission5.json index 8447c0ff4..ed7fc80a3 100644 --- a/src/test/resources/form/new_household_registration/form_submission5.json +++ b/src/test/resources/form/new_household_registration/form_submission5.json @@ -1,209 +1,209 @@ { - "_id": "251ca0ef09df9af88f0e9d5f180115a3", - "_rev": "1-e73e1d93acdcdaeb1d41a738da5d9284", - "type": "FormSubmission", - "anmId": "demotest", - "instanceId": "88c0e824-10b4-44c2-9429-754b8d823776", - "formName": "new_household_registration", - "entityId": "a3f2abf4-2699-4761-819a-cea739224164", - "clientVersion": 1430997074596, - "formDataDefinitionVersion": "1", - "formInstance": { - "form_data_definition_version": "1", - "form": { - "bind_type": "household", - "default_bind_path": "/model/instance/FWNewHH", - "fields": [ - { - "name": "id", - "value": "a3f2abf4-2699-4761-819a-cea739224164", - "source": "household.id" - }, - { - "name": "existing_location", - "value": "KUPTALA", - "source": "household.existing_location" - }, - { - "name": "today", - "value": "2015-05-07", - "source": "household.today" - }, - { - "name": "start", - "value": "2015-05-07T17:07:21.000+06:00", - "source": "household.start" - }, - { - "name": "end", - "value": "2015-05-07T17:07:21.000+06:00", - "source": "household.end" - }, - { - "name": "FWNHREGDATE", - "value": "2015-05-07", - "source": "household.FWNHREGDATE" - }, - { - "name": "FWGOBHHID", - "value": "1234", - "source": "household.FWGOBHHID" - }, - { - "name": "FWJIVHHID", - "value": "1234", - "source": "household.FWJIVHHID" - }, - { - "name": "FWNHNEARTO", - "value": "nothing", - "source": "household.FWNHNEARTO" - }, - { - "name": "FWNHHHGPS", - "value": "34 34 0 0", - "source": "household.FWNHHHGPS" - }, - { - "name": "FWHOHFNAME", - "value": "test", - "source": "household.FWHOHFNAME" - }, - { - "name": "FWHOHLNAME", - "value": ".", - "source": "household.FWHOHLNAME" - }, - { - "name": "FWHOHBIRTHDATE", - "value": "1900-01-01", - "source": "household.FWHOHBIRTHDATE" - }, - { - "name": "FWHOHGENDER", - "value": "male", - "source": "household.FWHOHGENDER" - }, - { - "name": "FWNHHMBRNUM", - "value": "2", - "source": "household.FWNHHMBRNUM" - }, - { - "name": "FWNHHMWRA", - "value": "1", - "source": "household.FWNHHMWRA" - }, - { - "name": "join_names", - "value": "shumi sumaita", - "source": "household.join_names" - }, - { - "name": "MWRA", - "value": "2", - "source": "household.MWRA" - } - ], - "sub_forms": [ - { - "name": "elco_registration", - "bind_type": "elco", - "default_bind_path": "/model/instance/FWNewHH/woman", - "fields": [ - { - "name": "id", - "source": "elco.id" - }, - { - "name": "GOBHHID", - "source": "elco.GOBHHID" - }, - { - "name": "JiVitAHHID", - "source": "elco.JiVitAHHID" - }, - { - "name": "FWWOMFNAME", - "source": "elco.FWWOMFNAME" - }, - { - "name": "FWWOMLNAME", - "source": "elco.FWWOMLNAME" - }, - { - "name": "FWWOMNID", - "source": "elco.FWWOMNID" - }, - { - "name": "FWWOMBID", - "source": "elco.FWWOMBID" - }, - { - "name": "FWHUSNAME", - "source": "elco.FWHUSNAME" - }, - { - "name": "FWBIRTHDATE", - "source": "elco.FWBIRTHDATE" - }, - { - "name": "FWGENDER", - "source": "elco.FWGENDER" - }, - { - "name": "FWWOMAGE", - "source": "elco.FWWOMAGE" - }, - { - "name": "display_age", - "source": "elco.display_age" - }, - { - "name": "FWNHWOMSTRMEN", - "source": "elco.FWNHWOMSTRMEN" - }, - { - "name": "FWNHWOMHUSALV", - "source": "elco.FWNHWOMHUSALV" - }, - { - "name": "FWNHWOMHUSLIV", - "source": "elco.FWNHWOMHUSLIV" - }, - { - "name": "FWNHWOMHUSSTR", - "source": "elco.FWNHWOMHUSSTR" - }, - { - "name": "FWELIGIBLE", - "source": "elco.FWELIGIBLE" - } - ], - "instances": [ - { - "GOBHHID": "", - "JiVitAHHID": "", - "FWWOMFNAME": "", - "FWWOMLNAME": "", - "FWWOMNID": "", - "FWWOMBID": "", - "FWHUSNAME": "", - "FWBIRTHDATE": "", - "FWGENDER": "", - "FWWOMAGE": "", - "display_age": "", - "FWNHWOMSTRMEN": "", - "FWNHWOMHUSALV": "", - "FWNHWOMHUSLIV": "", - "FWNHWOMHUSSTR": "", - "FWELIGIBLE": "", - "id": "babcd9d2-b3e9-4f6d-8a06-2df8f5fbf01f" - } - ] - } - ] - } - }, - "serverVersion": 1430998001293 + "_id": "251ca0ef09df9af88f0e9d5f180115a3", + "_rev": "1-e73e1d93acdcdaeb1d41a738da5d9284", + "type": "FormSubmission", + "anmId": "demotest", + "instanceId": "88c0e824-10b4-44c2-9429-754b8d823776", + "formName": "new_household_registration", + "entityId": "a3f2abf4-2699-4761-819a-cea739224164", + "clientVersion": 1430997074596, + "formDataDefinitionVersion": "1", + "formInstance": { + "form_data_definition_version": "1", + "form": { + "bind_type": "household", + "default_bind_path": "/model/instance/FWNewHH", + "fields": [ + { + "name": "id", + "value": "a3f2abf4-2699-4761-819a-cea739224164", + "source": "household.id" + }, + { + "name": "existing_location", + "value": "KUPTALA", + "source": "household.existing_location" + }, + { + "name": "today", + "value": "2015-05-07", + "source": "household.today" + }, + { + "name": "start", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "household.start" + }, + { + "name": "end", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "household.end" + }, + { + "name": "FWNHREGDATE", + "value": "2015-05-07", + "source": "household.FWNHREGDATE" + }, + { + "name": "FWGOBHHID", + "value": "1234", + "source": "household.FWGOBHHID" + }, + { + "name": "FWJIVHHID", + "value": "1234", + "source": "household.FWJIVHHID" + }, + { + "name": "FWNHNEARTO", + "value": "nothing", + "source": "household.FWNHNEARTO" + }, + { + "name": "FWNHHHGPS", + "value": "34 34 0 0", + "source": "household.FWNHHHGPS" + }, + { + "name": "FWHOHFNAME", + "value": "test", + "source": "household.FWHOHFNAME" + }, + { + "name": "FWHOHLNAME", + "value": ".", + "source": "household.FWHOHLNAME" + }, + { + "name": "FWHOHBIRTHDATE", + "value": "1900-01-01", + "source": "household.FWHOHBIRTHDATE" + }, + { + "name": "FWHOHGENDER", + "value": "male", + "source": "household.FWHOHGENDER" + }, + { + "name": "FWNHHMBRNUM", + "value": "2", + "source": "household.FWNHHMBRNUM" + }, + { + "name": "FWNHHMWRA", + "value": "1", + "source": "household.FWNHHMWRA" + }, + { + "name": "join_names", + "value": "shumi sumaita", + "source": "household.join_names" + }, + { + "name": "MWRA", + "value": "2", + "source": "household.MWRA" + } + ], + "sub_forms": [ + { + "name": "elco_registration", + "bind_type": "elco", + "default_bind_path": "/model/instance/FWNewHH/woman", + "fields": [ + { + "name": "id", + "source": "elco.id" + }, + { + "name": "GOBHHID", + "source": "elco.GOBHHID" + }, + { + "name": "JiVitAHHID", + "source": "elco.JiVitAHHID" + }, + { + "name": "FWWOMFNAME", + "source": "elco.FWWOMFNAME" + }, + { + "name": "FWWOMLNAME", + "source": "elco.FWWOMLNAME" + }, + { + "name": "FWWOMNID", + "source": "elco.FWWOMNID" + }, + { + "name": "FWWOMBID", + "source": "elco.FWWOMBID" + }, + { + "name": "FWHUSNAME", + "source": "elco.FWHUSNAME" + }, + { + "name": "FWBIRTHDATE", + "source": "elco.FWBIRTHDATE" + }, + { + "name": "FWGENDER", + "source": "elco.FWGENDER" + }, + { + "name": "FWWOMAGE", + "source": "elco.FWWOMAGE" + }, + { + "name": "display_age", + "source": "elco.display_age" + }, + { + "name": "FWNHWOMSTRMEN", + "source": "elco.FWNHWOMSTRMEN" + }, + { + "name": "FWNHWOMHUSALV", + "source": "elco.FWNHWOMHUSALV" + }, + { + "name": "FWNHWOMHUSLIV", + "source": "elco.FWNHWOMHUSLIV" + }, + { + "name": "FWNHWOMHUSSTR", + "source": "elco.FWNHWOMHUSSTR" + }, + { + "name": "FWELIGIBLE", + "source": "elco.FWELIGIBLE" + } + ], + "instances": [ + { + "GOBHHID": "", + "JiVitAHHID": "", + "FWWOMFNAME": "", + "FWWOMLNAME": "", + "FWWOMNID": "", + "FWWOMBID": "", + "FWHUSNAME": "", + "FWBIRTHDATE": "", + "FWGENDER": "", + "FWWOMAGE": "", + "display_age": "", + "FWNHWOMSTRMEN": "", + "FWNHWOMHUSALV": "", + "FWNHWOMHUSLIV": "", + "FWNHWOMHUSSTR": "", + "FWELIGIBLE": "", + "id": "babcd9d2-b3e9-4f6d-8a06-2df8f5fbf01f" + } + ] + } + ] + } + }, + "serverVersion": 1430998001293 } \ No newline at end of file diff --git a/src/test/resources/form/new_household_registration/form_submission6.json b/src/test/resources/form/new_household_registration/form_submission6.json index 8f3ec6c5a..3c23c7b90 100644 --- a/src/test/resources/form/new_household_registration/form_submission6.json +++ b/src/test/resources/form/new_household_registration/form_submission6.json @@ -1,216 +1,216 @@ { - "_id": "251ca0ef09df9af88f0e9d5f180115a3", - "_rev": "1-e73e1d93acdcdaeb1d41a738da5d9284", - "type": "FormSubmission", - "anmId": "admin", - "instanceId": "88c0e824-10b4-44c2-9429-754b8d823776", - "formName": "new_household_registration", - "entityId": "a3f2abf4-2699-4761-819a-cea739224164", - "clientVersion": 1430997074596, - "formDataDefinitionVersion": "1", - "formInstance": { - "form_data_definition_version": "1", - "form": { - "bind_type": "household", - "default_bind_path": "/model/instance/FWNewHH", - "fields": [ - { - "name": "id", - "value": "a3f2abf4-2699-4761-819a-cea739224164", - "source": "household.id" - }, - { - "name": "existing_location", - "value": "KUPTALA", - "source": "household.existing_location" - }, - { - "name": "today", - "value": "2015-05-07", - "source": "household.today" - }, - { - "name": "start", - "value": "2015-05-07T17:07:21.000+06:00", - "source": "household.start" - }, - { - "name": "end", - "value": "2015-05-07T17:07:21.000+06:00", - "source": "household.end" - }, - { - "name": "FWNHREGDATE", - "value": "2015-05-07", - "source": "household.FWNHREGDATE" - }, - { - "name": "FWGOBHHID", - "value": "1234", - "source": "household.FWGOBHHID" - }, - { - "name": "FWJIVHHID", - "value": "1234", - "source": "household.FWJIVHHID" - }, - { - "name": "FWNHNEARTO", - "value": "nothing", - "source": "household.FWNHNEARTO" - }, - { - "name": "FWNHHHGPS", - "value": "34 34 0 0", - "source": "household.FWNHHHGPS" - }, - { - "name": "FWHOHFNAME", - "value": "test", - "source": "household.FWHOHFNAME" - }, - { - "name": "FWHOHLNAME", - "value": ".", - "source": "household.FWHOHLNAME" - }, - { - "name": "FWHOHBIRTHDATE", - "value": "1900-01-01", - "source": "household.FWHOHBIRTHDATE" - }, - { - "name": "FWHOHBIRTHDATEAPPROX", - "value": "1", - "source": "household.FWHOHBIRTHDATEAPPROX" - }, - { - "name": "FWHOHGENDER", - "value": "male", - "source": "household.FWHOHGENDER" - }, - { - "name": "FWNHHMBRNUM", - "source": "household.FWNHHMBRNUM" - }, - { - "name": "FWNHHMWRA", - "source": "household.FWNHHMWRA" - }, - { - "name": "join_names", - "value": "shumi sumaita", - "source": "household.join_names" - }, - { - "name": "MWRA", - "source": "household.MWRA" - } - ], - "sub_forms": [ - { - "name": "elco_registration", - "bind_type": "elco", - "default_bind_path": "/model/instance/FWNewHH/woman", - "fields": [ - { - "name": "id", - "source": "elco.id" - }, - { - "name": "GOBHHID", - "source": "elco.GOBHHID" - }, - { - "name": "JiVitAHHID", - "source": "elco.JiVitAHHID" - }, - { - "name": "FWWOMFNAME", - "source": "elco.FWWOMFNAME" - }, - { - "name": "FWWOMLNAME", - "source": "elco.FWWOMLNAME" - }, - { - "name": "FWWOMNID", - "source": "elco.FWWOMNID" - }, - { - "name": "FWWOMBID", - "source": "elco.FWWOMBID" - }, - { - "name": "FWHUSNAME", - "source": "elco.FWHUSNAME" - }, - { - "name": "FWBIRTHDATE", - "source": "elco.FWBIRTHDATE" - }, - { - "name": "FWBIRTHDATEAPPROX", - "source": "elco.FWBIRTHDATEAPPROX" - }, - { - "name": "FWGENDER", - "source": "elco.FWGENDER" - }, - { - "name": "FWWOMAGE", - "source": "elco.FWWOMAGE" - }, - { - "name": "display_age", - "source": "elco.display_age" - }, - { - "name": "FWNHWOMSTRMEN", - "source": "elco.FWNHWOMSTRMEN" - }, - { - "name": "FWNHWOMHUSALV", - "source": "elco.FWNHWOMHUSALV" - }, - { - "name": "FWNHWOMHUSLIV", - "source": "elco.FWNHWOMHUSLIV" - }, - { - "name": "FWNHWOMHUSSTR", - "source": "elco.FWNHWOMHUSSTR" - }, - { - "name": "FWELIGIBLE", - "source": "elco.FWELIGIBLE" - } - ], - "instances": [ - { - "GOBHHID": "48374", - "JiVitAHHID": "78748", - "FWWOMFNAME": "tEST First", - "FWWOMLNAME": " lastname", - "FWWOMNID": "", - "FWWOMBID": "", - "FWHUSNAME": "", - "FWBIRTHDATE": "2000-05-07", - "FWBIRTHDATEAPPROX":"1", - "FWGENDER": "Female", - "FWWOMAGE": "", - "display_age": "", - "FWNHWOMSTRMEN": "", - "FWNHWOMHUSALV": "", - "FWNHWOMHUSLIV": "", - "FWNHWOMHUSSTR": "", - "FWELIGIBLE": "", - "id": "babcd9d2-b3e9-4f6d-8a06-2df8f5fbf01f" - } - ] - } - ] - } - }, - "serverVersion": 1430998001293 + "_id": "251ca0ef09df9af88f0e9d5f180115a3", + "_rev": "1-e73e1d93acdcdaeb1d41a738da5d9284", + "type": "FormSubmission", + "anmId": "admin", + "instanceId": "88c0e824-10b4-44c2-9429-754b8d823776", + "formName": "new_household_registration", + "entityId": "a3f2abf4-2699-4761-819a-cea739224164", + "clientVersion": 1430997074596, + "formDataDefinitionVersion": "1", + "formInstance": { + "form_data_definition_version": "1", + "form": { + "bind_type": "household", + "default_bind_path": "/model/instance/FWNewHH", + "fields": [ + { + "name": "id", + "value": "a3f2abf4-2699-4761-819a-cea739224164", + "source": "household.id" + }, + { + "name": "existing_location", + "value": "KUPTALA", + "source": "household.existing_location" + }, + { + "name": "today", + "value": "2015-05-07", + "source": "household.today" + }, + { + "name": "start", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "household.start" + }, + { + "name": "end", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "household.end" + }, + { + "name": "FWNHREGDATE", + "value": "2015-05-07", + "source": "household.FWNHREGDATE" + }, + { + "name": "FWGOBHHID", + "value": "1234", + "source": "household.FWGOBHHID" + }, + { + "name": "FWJIVHHID", + "value": "1234", + "source": "household.FWJIVHHID" + }, + { + "name": "FWNHNEARTO", + "value": "nothing", + "source": "household.FWNHNEARTO" + }, + { + "name": "FWNHHHGPS", + "value": "34 34 0 0", + "source": "household.FWNHHHGPS" + }, + { + "name": "FWHOHFNAME", + "value": "test", + "source": "household.FWHOHFNAME" + }, + { + "name": "FWHOHLNAME", + "value": ".", + "source": "household.FWHOHLNAME" + }, + { + "name": "FWHOHBIRTHDATE", + "value": "1900-01-01", + "source": "household.FWHOHBIRTHDATE" + }, + { + "name": "FWHOHBIRTHDATEAPPROX", + "value": "1", + "source": "household.FWHOHBIRTHDATEAPPROX" + }, + { + "name": "FWHOHGENDER", + "value": "male", + "source": "household.FWHOHGENDER" + }, + { + "name": "FWNHHMBRNUM", + "source": "household.FWNHHMBRNUM" + }, + { + "name": "FWNHHMWRA", + "source": "household.FWNHHMWRA" + }, + { + "name": "join_names", + "value": "shumi sumaita", + "source": "household.join_names" + }, + { + "name": "MWRA", + "source": "household.MWRA" + } + ], + "sub_forms": [ + { + "name": "elco_registration", + "bind_type": "elco", + "default_bind_path": "/model/instance/FWNewHH/woman", + "fields": [ + { + "name": "id", + "source": "elco.id" + }, + { + "name": "GOBHHID", + "source": "elco.GOBHHID" + }, + { + "name": "JiVitAHHID", + "source": "elco.JiVitAHHID" + }, + { + "name": "FWWOMFNAME", + "source": "elco.FWWOMFNAME" + }, + { + "name": "FWWOMLNAME", + "source": "elco.FWWOMLNAME" + }, + { + "name": "FWWOMNID", + "source": "elco.FWWOMNID" + }, + { + "name": "FWWOMBID", + "source": "elco.FWWOMBID" + }, + { + "name": "FWHUSNAME", + "source": "elco.FWHUSNAME" + }, + { + "name": "FWBIRTHDATE", + "source": "elco.FWBIRTHDATE" + }, + { + "name": "FWBIRTHDATEAPPROX", + "source": "elco.FWBIRTHDATEAPPROX" + }, + { + "name": "FWGENDER", + "source": "elco.FWGENDER" + }, + { + "name": "FWWOMAGE", + "source": "elco.FWWOMAGE" + }, + { + "name": "display_age", + "source": "elco.display_age" + }, + { + "name": "FWNHWOMSTRMEN", + "source": "elco.FWNHWOMSTRMEN" + }, + { + "name": "FWNHWOMHUSALV", + "source": "elco.FWNHWOMHUSALV" + }, + { + "name": "FWNHWOMHUSLIV", + "source": "elco.FWNHWOMHUSLIV" + }, + { + "name": "FWNHWOMHUSSTR", + "source": "elco.FWNHWOMHUSSTR" + }, + { + "name": "FWELIGIBLE", + "source": "elco.FWELIGIBLE" + } + ], + "instances": [ + { + "GOBHHID": "48374", + "JiVitAHHID": "78748", + "FWWOMFNAME": "tEST First", + "FWWOMLNAME": " lastname", + "FWWOMNID": "", + "FWWOMBID": "", + "FWHUSNAME": "", + "FWBIRTHDATE": "2000-05-07", + "FWBIRTHDATEAPPROX": "1", + "FWGENDER": "Female", + "FWWOMAGE": "", + "display_age": "", + "FWNHWOMSTRMEN": "", + "FWNHWOMHUSALV": "", + "FWNHWOMHUSLIV": "", + "FWNHWOMHUSSTR": "", + "FWELIGIBLE": "", + "id": "babcd9d2-b3e9-4f6d-8a06-2df8f5fbf01f" + } + ] + } + ] + } + }, + "serverVersion": 1430998001293 } \ No newline at end of file diff --git a/src/test/resources/form/new_household_registration/form_submission7.json b/src/test/resources/form/new_household_registration/form_submission7.json index 443ced238..d3ba17420 100644 --- a/src/test/resources/form/new_household_registration/form_submission7.json +++ b/src/test/resources/form/new_household_registration/form_submission7.json @@ -1,216 +1,216 @@ { - "_id": "251ca0ef09df9af88f0e9d5f180115a3", - "_rev": "1-e73e1d93acdcdaeb1d41a738da5d9284", - "type": "FormSubmission", - "anmId": "admin", - "instanceId": "88c0e824-10b4-44c2-9429-754b8d823776", - "formName": "new_household_registration", - "entityId": "a3f2abf4-2699-4761-819a-cea739224164", - "clientVersion": 1430997074596, - "formDataDefinitionVersion": "1", - "formInstance": { - "form_data_definition_version": "1", - "form": { - "bind_type": "household", - "default_bind_path": "/model/instance/FWNewHH", - "fields": [ - { - "name": "id", - "value": "a3f2abf4-2699-4761-819a-cea739224164", - "source": "household.id" - }, - { - "name": "existing_location", - "value": "KUPTALA", - "source": "household.existing_location" - }, - { - "name": "today", - "value": "2015-05-07", - "source": "household.today" - }, - { - "name": "start", - "value": "2015-05-07T17:07:21.000+06:00", - "source": "household.start" - }, - { - "name": "end", - "value": "2015-05-07T17:07:21.000+06:00", - "source": "household.end" - }, - { - "name": "FWNHREGDATE", - "value": "2015-05-07", - "source": "household.FWNHREGDATE" - }, - { - "name": "FWGOBHHID", - "value": "1234", - "source": "household.FWGOBHHID" - }, - { - "name": "FWJIVHHID", - "value": "1234", - "source": "household.FWJIVHHID" - }, - { - "name": "FWNHNEARTO", - "value": "nothing", - "source": "household.FWNHNEARTO" - }, - { - "name": "FWNHHHGPS", - "value": "34 34 0 0", - "source": "household.FWNHHHGPS" - }, - { - "name": "FWHOHFNAME", - "value": "test", - "source": "household.FWHOHFNAME" - }, - { - "name": "FWHOHLNAME", - "value": ".", - "source": "household.FWHOHLNAME" - }, - { - "name": "FWHOHBIRTHDATE", - "value": "1900-01-01", - "source": "household.FWHOHBIRTHDATE" - }, - { - "name": "FWHOHBIRTHDATEAPPROX", - "value": "1", - "source": "household.FWHOHBIRTHDATEAPPROX" - }, - { - "name": "FWHOHGENDER", - "value": "male", - "source": "household.FWHOHGENDER" - }, - { - "name": "FWNHHMBRNUM", - "source": "household.FWNHHMBRNUM" - }, - { - "name": "FWNHHMWRA", - "source": "household.FWNHHMWRA" - }, - { - "name": "join_names", - "value": "shumi sumaita", - "source": "household.join_names" - }, - { - "name": "MWRA", - "source": "household.MWRA" - } - ], - "sub_forms": [ - { - "name": "elco_registration", - "bind_type": "elco", - "default_bind_path": "/model/instance/FWNewHH/woman", - "fields": [ - { - "name": "id", - "source": "elco.id" - }, - { - "name": "GOBHHID", - "source": "elco.GOBHHID" - }, - { - "name": "JiVitAHHID", - "source": "elco.JiVitAHHID" - }, - { - "name": "FWWOMFNAME", - "source": "elco.FWWOMFNAME" - }, - { - "name": "FWWOMLNAME", - "source": "elco.FWWOMLNAME" - }, - { - "name": "FWWOMNID", - "source": "elco.FWWOMNID" - }, - { - "name": "FWWOMBID", - "source": "elco.FWWOMBID" - }, - { - "name": "FWHUSNAME", - "source": "elco.FWHUSNAME" - }, - { - "name": "FWBIRTHDATE", - "source": "elco.FWBIRTHDATE" - }, - { - "name": "FWBIRTHDATEAPPROX", - "source": "elco.FWBIRTHDATEAPPROX" - }, - { - "name": "FWGENDER", - "source": "elco.FWGENDER" - }, - { - "name": "FWWOMAGE", - "source": "elco.FWWOMAGE" - }, - { - "name": "display_age", - "source": "elco.display_age" - }, - { - "name": "FWNHWOMSTRMEN", - "source": "elco.FWNHWOMSTRMEN" - }, - { - "name": "FWNHWOMHUSALV", - "source": "elco.FWNHWOMHUSALV" - }, - { - "name": "FWNHWOMHUSLIV", - "source": "elco.FWNHWOMHUSLIV" - }, - { - "name": "FWNHWOMHUSSTR", - "source": "elco.FWNHWOMHUSSTR" - }, - { - "name": "FWELIGIBLE", - "source": "elco.FWELIGIBLE" - } - ], - "instances": [ - { - "GOBHHID": "48374", - "JiVitAHHID": "78748", - "FWWOMFNAME": "tEST First", - "FWWOMLNAME": " lastname", - "FWWOMNID": "5478549854895", - "FWWOMBID": "43030293029323", - "FWHUSNAME": "husb", - "FWBIRTHDATE": "2000-05-07", - "FWBIRTHDATEAPPROX":"0", - "FWGENDER": "Female", - "FWWOMAGE": "21", - "display_age": "", - "FWNHWOMSTRMEN": "", - "FWNHWOMHUSALV": "", - "FWNHWOMHUSLIV": "", - "FWNHWOMHUSSTR": "", - "FWELIGIBLE": "", - "id": "babcd9d2-b3e9-4f6d-8a06-2df8f5fbf01f" - } - ] - } - ] - } - }, - "serverVersion": 1430998001293 + "_id": "251ca0ef09df9af88f0e9d5f180115a3", + "_rev": "1-e73e1d93acdcdaeb1d41a738da5d9284", + "type": "FormSubmission", + "anmId": "admin", + "instanceId": "88c0e824-10b4-44c2-9429-754b8d823776", + "formName": "new_household_registration", + "entityId": "a3f2abf4-2699-4761-819a-cea739224164", + "clientVersion": 1430997074596, + "formDataDefinitionVersion": "1", + "formInstance": { + "form_data_definition_version": "1", + "form": { + "bind_type": "household", + "default_bind_path": "/model/instance/FWNewHH", + "fields": [ + { + "name": "id", + "value": "a3f2abf4-2699-4761-819a-cea739224164", + "source": "household.id" + }, + { + "name": "existing_location", + "value": "KUPTALA", + "source": "household.existing_location" + }, + { + "name": "today", + "value": "2015-05-07", + "source": "household.today" + }, + { + "name": "start", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "household.start" + }, + { + "name": "end", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "household.end" + }, + { + "name": "FWNHREGDATE", + "value": "2015-05-07", + "source": "household.FWNHREGDATE" + }, + { + "name": "FWGOBHHID", + "value": "1234", + "source": "household.FWGOBHHID" + }, + { + "name": "FWJIVHHID", + "value": "1234", + "source": "household.FWJIVHHID" + }, + { + "name": "FWNHNEARTO", + "value": "nothing", + "source": "household.FWNHNEARTO" + }, + { + "name": "FWNHHHGPS", + "value": "34 34 0 0", + "source": "household.FWNHHHGPS" + }, + { + "name": "FWHOHFNAME", + "value": "test", + "source": "household.FWHOHFNAME" + }, + { + "name": "FWHOHLNAME", + "value": ".", + "source": "household.FWHOHLNAME" + }, + { + "name": "FWHOHBIRTHDATE", + "value": "1900-01-01", + "source": "household.FWHOHBIRTHDATE" + }, + { + "name": "FWHOHBIRTHDATEAPPROX", + "value": "1", + "source": "household.FWHOHBIRTHDATEAPPROX" + }, + { + "name": "FWHOHGENDER", + "value": "male", + "source": "household.FWHOHGENDER" + }, + { + "name": "FWNHHMBRNUM", + "source": "household.FWNHHMBRNUM" + }, + { + "name": "FWNHHMWRA", + "source": "household.FWNHHMWRA" + }, + { + "name": "join_names", + "value": "shumi sumaita", + "source": "household.join_names" + }, + { + "name": "MWRA", + "source": "household.MWRA" + } + ], + "sub_forms": [ + { + "name": "elco_registration", + "bind_type": "elco", + "default_bind_path": "/model/instance/FWNewHH/woman", + "fields": [ + { + "name": "id", + "source": "elco.id" + }, + { + "name": "GOBHHID", + "source": "elco.GOBHHID" + }, + { + "name": "JiVitAHHID", + "source": "elco.JiVitAHHID" + }, + { + "name": "FWWOMFNAME", + "source": "elco.FWWOMFNAME" + }, + { + "name": "FWWOMLNAME", + "source": "elco.FWWOMLNAME" + }, + { + "name": "FWWOMNID", + "source": "elco.FWWOMNID" + }, + { + "name": "FWWOMBID", + "source": "elco.FWWOMBID" + }, + { + "name": "FWHUSNAME", + "source": "elco.FWHUSNAME" + }, + { + "name": "FWBIRTHDATE", + "source": "elco.FWBIRTHDATE" + }, + { + "name": "FWBIRTHDATEAPPROX", + "source": "elco.FWBIRTHDATEAPPROX" + }, + { + "name": "FWGENDER", + "source": "elco.FWGENDER" + }, + { + "name": "FWWOMAGE", + "source": "elco.FWWOMAGE" + }, + { + "name": "display_age", + "source": "elco.display_age" + }, + { + "name": "FWNHWOMSTRMEN", + "source": "elco.FWNHWOMSTRMEN" + }, + { + "name": "FWNHWOMHUSALV", + "source": "elco.FWNHWOMHUSALV" + }, + { + "name": "FWNHWOMHUSLIV", + "source": "elco.FWNHWOMHUSLIV" + }, + { + "name": "FWNHWOMHUSSTR", + "source": "elco.FWNHWOMHUSSTR" + }, + { + "name": "FWELIGIBLE", + "source": "elco.FWELIGIBLE" + } + ], + "instances": [ + { + "GOBHHID": "48374", + "JiVitAHHID": "78748", + "FWWOMFNAME": "tEST First", + "FWWOMLNAME": " lastname", + "FWWOMNID": "5478549854895", + "FWWOMBID": "43030293029323", + "FWHUSNAME": "husb", + "FWBIRTHDATE": "2000-05-07", + "FWBIRTHDATEAPPROX": "0", + "FWGENDER": "Female", + "FWWOMAGE": "21", + "display_age": "", + "FWNHWOMSTRMEN": "", + "FWNHWOMHUSALV": "", + "FWNHWOMHUSLIV": "", + "FWNHWOMHUSSTR": "", + "FWELIGIBLE": "", + "id": "babcd9d2-b3e9-4f6d-8a06-2df8f5fbf01f" + } + ] + } + ] + } + }, + "serverVersion": 1430998001293 } \ No newline at end of file diff --git a/src/test/resources/form/new_household_registration/form_submission8.json b/src/test/resources/form/new_household_registration/form_submission8.json index 0c1850d4e..aa278b7b1 100644 --- a/src/test/resources/form/new_household_registration/form_submission8.json +++ b/src/test/resources/form/new_household_registration/form_submission8.json @@ -1,211 +1,211 @@ { - "_id": "251ca0ef09df9af88f0e9d5f180115a3", - "_rev": "1-e73e1d93acdcdaeb1d41a738da5d9284", - "type": "FormSubmission", - "anmId": "admin", - "instanceId": "88c0e824-10b4-44c2-9429-754b8d823776", - "formName": "new_household_registration", - "entityId": "a3f2abf4-2699-4761-819a-cea739224164", - "clientVersion": 1430997074596, - "formDataDefinitionVersion": "1", - "formInstance": { - "form_data_definition_version": "1", - "form": { - "bind_type": "household", - "default_bind_path": "/model/instance/FWNewHH", - "fields": [ - { - "name": "id", - "value": "a3f2abf4-2699-4761-819a-cea739224164", - "source": "household.id" - }, - { - "name": "existing_location", - "value": "KUPTALA", - "source": "household.existing_location" - }, - { - "name": "today", - "value": "2015-05-07", - "source": "household.today" - }, - { - "name": "start", - "value": "2015-05-07T17:07:21.000+06:00", - "source": "household.start" - }, - { - "name": "end", - "value": "2015-05-07T17:07:21.000+06:00", - "source": "household.end" - }, - { - "name": "FWNHREGDATE", - "value": "2015-05-07", - "source": "household.FWNHREGDATE" - }, - { - "name": "FWGOBHHID", - "value": "1234", - "source": "household.FWGOBHHID" - }, - { - "name": "FWJIVHHID", - "value": "1234", - "source": "household.FWJIVHHID" - }, - { - "name": "FWNHNEARTO", - "value": "nothing", - "source": "household.FWNHNEARTO" - }, - { - "name": "FWNHHHGPS", - "value": "34 34 0 0", - "source": "household.FWNHHHGPS" - }, - { - "name": "FWHOHFNAME", - "value": "test", - "source": "household.FWHOHFNAME" - }, - { - "name": "FWHOHLNAME", - "value": ".", - "source": "household.FWHOHLNAME" - }, - { - "name": "FWHOHBIRTHDATE", - "value": "1900-01-01", - "source": "household.FWHOHBIRTHDATE" - }, - { - "name": "FWHOHGENDER", - "value": "male", - "source": "household.FWHOHGENDER" - }, - { - "name": "FWNHHMBRNUM", - "source": "household.FWNHHMBRNUM" - }, - { - "name": "FWNHHMWRA", - "source": "household.FWNHHMWRA" - }, - { - "name": "join_names", - "value": "shumi sumaita", - "source": "household.join_names" - }, - { - "name": "MWRA", - "source": "household.MWRA" - } - ], - "sub_forms": [ - { - "name": "elco_registration", - "bind_type": "elco", - "default_bind_path": "/model/instance/FWNewHH/woman", - "fields": [ - { - "name": "id", - "source": "elco.id" - }, - { - "name": "GOBHHID", - "source": "elco.GOBHHID" - }, - { - "name": "JiVitAHHID", - "source": "elco.JiVitAHHID" - }, - { - "name": "FWWOMFNAME", - "source": "elco.FWWOMFNAME" - }, - { - "name": "FWWOMLNAME", - "source": "elco.FWWOMLNAME" - }, - { - "name": "FWWOMNID", - "source": "elco.FWWOMNID" - }, - { - "name": "FWWOMBID", - "source": "elco.FWWOMBID" - }, - { - "name": "FWHUSNAME", - "source": "elco.FWHUSNAME" - }, - { - "name": "FWBIRTHDATE", - "source": "elco.FWBIRTHDATE" - }, - { - "name": "FWBIRTHDATEAPPROX", - "source": "elco.FWBIRTHDATEAPPROX" - }, - { - "name": "FWGENDER", - "source": "elco.FWGENDER" - }, - { - "name": "FWWOMAGE", - "source": "elco.FWWOMAGE" - }, - { - "name": "display_age", - "source": "elco.display_age" - }, - { - "name": "FWNHWOMSTRMEN", - "source": "elco.FWNHWOMSTRMEN" - }, - { - "name": "FWNHWOMHUSALV", - "source": "elco.FWNHWOMHUSALV" - }, - { - "name": "FWNHWOMHUSLIV", - "source": "elco.FWNHWOMHUSLIV" - }, - { - "name": "FWNHWOMHUSSTR", - "source": "elco.FWNHWOMHUSSTR" - }, - { - "name": "FWELIGIBLE", - "source": "elco.FWELIGIBLE" - } - ], - "instances": [ - { - "GOBHHID": "48374", - "JiVitAHHID": "78748", - "FWWOMFNAME": "tEST First", - "FWWOMLNAME": " lastname", - "FWWOMNID": "", - "FWWOMBID": "", - "FWHUSNAME": "", - "FWBIRTHDATE": "2000-05-07", - "FWBIRTHDATEAPPROX":"", - "FWGENDER": "Female", - "FWWOMAGE": "", - "display_age": "", - "FWNHWOMSTRMEN": "", - "FWNHWOMHUSALV": "", - "FWNHWOMHUSLIV": "", - "FWNHWOMHUSSTR": "", - "FWELIGIBLE": "", - "id": "babcd9d2-b3e9-4f6d-8a06-2df8f5fbf01f" - } - ] - } - ] - } - }, - "serverVersion": 1430998001293 + "_id": "251ca0ef09df9af88f0e9d5f180115a3", + "_rev": "1-e73e1d93acdcdaeb1d41a738da5d9284", + "type": "FormSubmission", + "anmId": "admin", + "instanceId": "88c0e824-10b4-44c2-9429-754b8d823776", + "formName": "new_household_registration", + "entityId": "a3f2abf4-2699-4761-819a-cea739224164", + "clientVersion": 1430997074596, + "formDataDefinitionVersion": "1", + "formInstance": { + "form_data_definition_version": "1", + "form": { + "bind_type": "household", + "default_bind_path": "/model/instance/FWNewHH", + "fields": [ + { + "name": "id", + "value": "a3f2abf4-2699-4761-819a-cea739224164", + "source": "household.id" + }, + { + "name": "existing_location", + "value": "KUPTALA", + "source": "household.existing_location" + }, + { + "name": "today", + "value": "2015-05-07", + "source": "household.today" + }, + { + "name": "start", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "household.start" + }, + { + "name": "end", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "household.end" + }, + { + "name": "FWNHREGDATE", + "value": "2015-05-07", + "source": "household.FWNHREGDATE" + }, + { + "name": "FWGOBHHID", + "value": "1234", + "source": "household.FWGOBHHID" + }, + { + "name": "FWJIVHHID", + "value": "1234", + "source": "household.FWJIVHHID" + }, + { + "name": "FWNHNEARTO", + "value": "nothing", + "source": "household.FWNHNEARTO" + }, + { + "name": "FWNHHHGPS", + "value": "34 34 0 0", + "source": "household.FWNHHHGPS" + }, + { + "name": "FWHOHFNAME", + "value": "test", + "source": "household.FWHOHFNAME" + }, + { + "name": "FWHOHLNAME", + "value": ".", + "source": "household.FWHOHLNAME" + }, + { + "name": "FWHOHBIRTHDATE", + "value": "1900-01-01", + "source": "household.FWHOHBIRTHDATE" + }, + { + "name": "FWHOHGENDER", + "value": "male", + "source": "household.FWHOHGENDER" + }, + { + "name": "FWNHHMBRNUM", + "source": "household.FWNHHMBRNUM" + }, + { + "name": "FWNHHMWRA", + "source": "household.FWNHHMWRA" + }, + { + "name": "join_names", + "value": "shumi sumaita", + "source": "household.join_names" + }, + { + "name": "MWRA", + "source": "household.MWRA" + } + ], + "sub_forms": [ + { + "name": "elco_registration", + "bind_type": "elco", + "default_bind_path": "/model/instance/FWNewHH/woman", + "fields": [ + { + "name": "id", + "source": "elco.id" + }, + { + "name": "GOBHHID", + "source": "elco.GOBHHID" + }, + { + "name": "JiVitAHHID", + "source": "elco.JiVitAHHID" + }, + { + "name": "FWWOMFNAME", + "source": "elco.FWWOMFNAME" + }, + { + "name": "FWWOMLNAME", + "source": "elco.FWWOMLNAME" + }, + { + "name": "FWWOMNID", + "source": "elco.FWWOMNID" + }, + { + "name": "FWWOMBID", + "source": "elco.FWWOMBID" + }, + { + "name": "FWHUSNAME", + "source": "elco.FWHUSNAME" + }, + { + "name": "FWBIRTHDATE", + "source": "elco.FWBIRTHDATE" + }, + { + "name": "FWBIRTHDATEAPPROX", + "source": "elco.FWBIRTHDATEAPPROX" + }, + { + "name": "FWGENDER", + "source": "elco.FWGENDER" + }, + { + "name": "FWWOMAGE", + "source": "elco.FWWOMAGE" + }, + { + "name": "display_age", + "source": "elco.display_age" + }, + { + "name": "FWNHWOMSTRMEN", + "source": "elco.FWNHWOMSTRMEN" + }, + { + "name": "FWNHWOMHUSALV", + "source": "elco.FWNHWOMHUSALV" + }, + { + "name": "FWNHWOMHUSLIV", + "source": "elco.FWNHWOMHUSLIV" + }, + { + "name": "FWNHWOMHUSSTR", + "source": "elco.FWNHWOMHUSSTR" + }, + { + "name": "FWELIGIBLE", + "source": "elco.FWELIGIBLE" + } + ], + "instances": [ + { + "GOBHHID": "48374", + "JiVitAHHID": "78748", + "FWWOMFNAME": "tEST First", + "FWWOMLNAME": " lastname", + "FWWOMNID": "", + "FWWOMBID": "", + "FWHUSNAME": "", + "FWBIRTHDATE": "2000-05-07", + "FWBIRTHDATEAPPROX": "", + "FWGENDER": "Female", + "FWWOMAGE": "", + "display_age": "", + "FWNHWOMSTRMEN": "", + "FWNHWOMHUSALV": "", + "FWNHWOMHUSLIV": "", + "FWNHWOMHUSSTR": "", + "FWELIGIBLE": "", + "id": "babcd9d2-b3e9-4f6d-8a06-2df8f5fbf01f" + } + ] + } + ] + } + }, + "serverVersion": 1430998001293 } \ No newline at end of file diff --git a/src/test/resources/form/new_household_registration/form_submission9.json b/src/test/resources/form/new_household_registration/form_submission9.json index b1dd5bcb9..b2619adbe 100644 --- a/src/test/resources/form/new_household_registration/form_submission9.json +++ b/src/test/resources/form/new_household_registration/form_submission9.json @@ -1,206 +1,206 @@ { - "_id": "251ca0ef09df9af88f0e9d5f180115a3", - "_rev": "1-e73e1d93acdcdaeb1d41a738da5d9284", - "type": "FormSubmission", - "anmId": "admin", - "instanceId": "88c0e824-10b4-44c2-9429-754b8d823776", - "formName": "new_household_registration", - "entityId": "a3f2abf4-2699-4761-819a-cea739224164", - "clientVersion": 1430997074596, - "formDataDefinitionVersion": "1", - "formInstance": { - "form_data_definition_version": "1", - "form": { - "bind_type": "household", - "default_bind_path": "/model/instance/FWNewHH", - "fields": [ - { - "name": "id", - "value": "a3f2abf4-2699-4761-819a-cea739224164", - "source": "household.id" - }, - { - "name": "existing_location", - "value": "KUPTALA", - "source": "household.existing_location" - }, - { - "name": "today", - "value": "2015-05-07", - "source": "household.today" - }, - { - "name": "start", - "value": "2015-05-07T17:07:21.000+06:00", - "source": "household.start" - }, - { - "name": "end", - "value": "2015-05-07T17:07:21.000+06:00", - "source": "household.end" - }, - { - "name": "FWNHREGDATE", - "value": "2015-05-07", - "source": "household.FWNHREGDATE" - }, - { - "name": "FWGOBHHID", - "value": "1234", - "source": "household.FWGOBHHID" - }, - { - "name": "FWJIVHHID", - "value": "1234", - "source": "household.FWJIVHHID" - }, - { - "name": "FWNHNEARTO", - "value": "nothing", - "source": "household.FWNHNEARTO" - }, - { - "name": "FWNHHHGPS", - "value": "34 34 0 0", - "source": "household.FWNHHHGPS" - }, - { - "name": "FWHOHLNAME", - "value": ".", - "source": "household.FWHOHLNAME" - }, - { - "name": "FWHOHBIRTHDATE", - "value": "1900-01-01", - "source": "household.FWHOHBIRTHDATE" - }, - { - "name": "FWHOHGENDER", - "value": "male", - "source": "household.FWHOHGENDER" - }, - { - "name": "FWNHHMBRNUM", - "source": "household.FWNHHMBRNUM" - }, - { - "name": "FWNHHMWRA", - "source": "household.FWNHHMWRA" - }, - { - "name": "join_names", - "value": "shumi sumaita", - "source": "household.join_names" - }, - { - "name": "MWRA", - "source": "household.MWRA" - } - ], - "sub_forms": [ - { - "name": "elco_registration", - "bind_type": "elco", - "default_bind_path": "/model/instance/FWNewHH/woman", - "fields": [ - { - "name": "id", - "source": "elco.id" - }, - { - "name": "GOBHHID", - "source": "elco.GOBHHID" - }, - { - "name": "JiVitAHHID", - "source": "elco.JiVitAHHID" - }, - { - "name": "FWWOMFNAME", - "source": "elco.FWWOMFNAME" - }, - { - "name": "FWWOMLNAME", - "source": "elco.FWWOMLNAME" - }, - { - "name": "FWWOMNID", - "source": "elco.FWWOMNID" - }, - { - "name": "FWWOMBID", - "source": "elco.FWWOMBID" - }, - { - "name": "FWHUSNAME", - "source": "elco.FWHUSNAME" - }, - { - "name": "FWBIRTHDATE", - "source": "elco.FWBIRTHDATE" - }, - { - "name": "FWBIRTHDATEAPPROX", - "source": "elco.FWBIRTHDATEAPPROX" - }, - { - "name": "FWGENDER", - "source": "elco.FWGENDER" - }, - { - "name": "FWWOMAGE", - "source": "elco.FWWOMAGE" - }, - { - "name": "display_age", - "source": "elco.display_age" - }, - { - "name": "FWNHWOMSTRMEN", - "source": "elco.FWNHWOMSTRMEN" - }, - { - "name": "FWNHWOMHUSALV", - "source": "elco.FWNHWOMHUSALV" - }, - { - "name": "FWNHWOMHUSLIV", - "source": "elco.FWNHWOMHUSLIV" - }, - { - "name": "FWNHWOMHUSSTR", - "source": "elco.FWNHWOMHUSSTR" - }, - { - "name": "FWELIGIBLE", - "source": "elco.FWELIGIBLE" - } - ], - "instances": [ - { - "GOBHHID": "48374", - "JiVitAHHID": "78748", - "FWWOMFNAME": "tEST First", - "FWWOMLNAME": " lastname", - "FWWOMNID": "", - "FWWOMBID": "", - "FWHUSNAME": "", - "FWBIRTHDATE": "2000-05-07", - "FWBIRTHDATEAPPROX":"", - "FWGENDER": "Female", - "FWWOMAGE": "", - "display_age": "", - "FWNHWOMSTRMEN": "", - "FWNHWOMHUSALV": "", - "FWNHWOMHUSLIV": "", - "FWNHWOMHUSSTR": "", - "FWELIGIBLE": "", - "id": "babcd9d2-b3e9-4f6d-8a06-2df8f5fbf01f" - } - ] - } - ] - } - }, - "serverVersion": 1430998001293 + "_id": "251ca0ef09df9af88f0e9d5f180115a3", + "_rev": "1-e73e1d93acdcdaeb1d41a738da5d9284", + "type": "FormSubmission", + "anmId": "admin", + "instanceId": "88c0e824-10b4-44c2-9429-754b8d823776", + "formName": "new_household_registration", + "entityId": "a3f2abf4-2699-4761-819a-cea739224164", + "clientVersion": 1430997074596, + "formDataDefinitionVersion": "1", + "formInstance": { + "form_data_definition_version": "1", + "form": { + "bind_type": "household", + "default_bind_path": "/model/instance/FWNewHH", + "fields": [ + { + "name": "id", + "value": "a3f2abf4-2699-4761-819a-cea739224164", + "source": "household.id" + }, + { + "name": "existing_location", + "value": "KUPTALA", + "source": "household.existing_location" + }, + { + "name": "today", + "value": "2015-05-07", + "source": "household.today" + }, + { + "name": "start", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "household.start" + }, + { + "name": "end", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "household.end" + }, + { + "name": "FWNHREGDATE", + "value": "2015-05-07", + "source": "household.FWNHREGDATE" + }, + { + "name": "FWGOBHHID", + "value": "1234", + "source": "household.FWGOBHHID" + }, + { + "name": "FWJIVHHID", + "value": "1234", + "source": "household.FWJIVHHID" + }, + { + "name": "FWNHNEARTO", + "value": "nothing", + "source": "household.FWNHNEARTO" + }, + { + "name": "FWNHHHGPS", + "value": "34 34 0 0", + "source": "household.FWNHHHGPS" + }, + { + "name": "FWHOHLNAME", + "value": ".", + "source": "household.FWHOHLNAME" + }, + { + "name": "FWHOHBIRTHDATE", + "value": "1900-01-01", + "source": "household.FWHOHBIRTHDATE" + }, + { + "name": "FWHOHGENDER", + "value": "male", + "source": "household.FWHOHGENDER" + }, + { + "name": "FWNHHMBRNUM", + "source": "household.FWNHHMBRNUM" + }, + { + "name": "FWNHHMWRA", + "source": "household.FWNHHMWRA" + }, + { + "name": "join_names", + "value": "shumi sumaita", + "source": "household.join_names" + }, + { + "name": "MWRA", + "source": "household.MWRA" + } + ], + "sub_forms": [ + { + "name": "elco_registration", + "bind_type": "elco", + "default_bind_path": "/model/instance/FWNewHH/woman", + "fields": [ + { + "name": "id", + "source": "elco.id" + }, + { + "name": "GOBHHID", + "source": "elco.GOBHHID" + }, + { + "name": "JiVitAHHID", + "source": "elco.JiVitAHHID" + }, + { + "name": "FWWOMFNAME", + "source": "elco.FWWOMFNAME" + }, + { + "name": "FWWOMLNAME", + "source": "elco.FWWOMLNAME" + }, + { + "name": "FWWOMNID", + "source": "elco.FWWOMNID" + }, + { + "name": "FWWOMBID", + "source": "elco.FWWOMBID" + }, + { + "name": "FWHUSNAME", + "source": "elco.FWHUSNAME" + }, + { + "name": "FWBIRTHDATE", + "source": "elco.FWBIRTHDATE" + }, + { + "name": "FWBIRTHDATEAPPROX", + "source": "elco.FWBIRTHDATEAPPROX" + }, + { + "name": "FWGENDER", + "source": "elco.FWGENDER" + }, + { + "name": "FWWOMAGE", + "source": "elco.FWWOMAGE" + }, + { + "name": "display_age", + "source": "elco.display_age" + }, + { + "name": "FWNHWOMSTRMEN", + "source": "elco.FWNHWOMSTRMEN" + }, + { + "name": "FWNHWOMHUSALV", + "source": "elco.FWNHWOMHUSALV" + }, + { + "name": "FWNHWOMHUSLIV", + "source": "elco.FWNHWOMHUSLIV" + }, + { + "name": "FWNHWOMHUSSTR", + "source": "elco.FWNHWOMHUSSTR" + }, + { + "name": "FWELIGIBLE", + "source": "elco.FWELIGIBLE" + } + ], + "instances": [ + { + "GOBHHID": "48374", + "JiVitAHHID": "78748", + "FWWOMFNAME": "tEST First", + "FWWOMLNAME": " lastname", + "FWWOMNID": "", + "FWWOMBID": "", + "FWHUSNAME": "", + "FWBIRTHDATE": "2000-05-07", + "FWBIRTHDATEAPPROX": "", + "FWGENDER": "Female", + "FWWOMAGE": "", + "display_age": "", + "FWNHWOMSTRMEN": "", + "FWNHWOMHUSALV": "", + "FWNHWOMHUSLIV": "", + "FWNHWOMHUSSTR": "", + "FWELIGIBLE": "", + "id": "babcd9d2-b3e9-4f6d-8a06-2df8f5fbf01f" + } + ] + } + ] + } + }, + "serverVersion": 1430998001293 } \ No newline at end of file diff --git a/src/test/resources/form/new_household_registration/model.xml b/src/test/resources/form/new_household_registration/model.xml index a0cabcad2..6d0769e21 100644 --- a/src/test/resources/form/new_household_registration/model.xml +++ b/src/test/resources/form/new_household_registration/model.xml @@ -11,8 +11,10 @@ - - + + @@ -29,7 +31,7 @@ - + diff --git a/src/test/resources/form/new_household_registration_with_grouped_subform_data/form.json b/src/test/resources/form/new_household_registration_with_grouped_subform_data/form.json index 99dadab7a..a68d3d573 100644 --- a/src/test/resources/form/new_household_registration_with_grouped_subform_data/form.json +++ b/src/test/resources/form/new_household_registration_with_grouped_subform_data/form.json @@ -1,1100 +1,1100 @@ { - "name": "FWNewHH", - "title": "নতুন খানা নিবন্ধন ফর্ম", - "sms_keyword": "FWNewHH", - "default_language": "Bengali", - "instance": { - "encounter_type": "New Household Registration" + "name": "FWNewHH", + "title": "নতুন খানা নিবন্ধন ফর্ম", + "sms_keyword": "FWNewHH", + "default_language": "Bengali", + "instance": { + "encounter_type": "New Household Registration" + }, + "version": "201510181114", + "id_string": "FWNewHH", + "type": "survey", + "children": [ + { + "type": "hidden", + "name": "version", + "label": { + "English": "TechVersion: v1.4 Aug 26, 2015\nFormVersion: v1.0" + } }, - "version": "201510181114", - "id_string": "FWNewHH", - "type": "survey", - "children": [ + { + "type": "hidden", + "name": "changes", + "label": { + "English": "NN: \n1. Added a calculation field 'REGDATE' under 'woman' group\n2. Removed the conceptIDs which have Datatype N/A\n3. Define NID as person_attribute\nKZ: Dropped 9=DK from Vitsts choices\nCG: Added person_address mappings and NN added Variable Names for these address fields\nCG: Change NID back to person_identifier\nCG: Delete location_name field - need to communicate this change to Raihan - mauzapara name coming from existing_Mauzapara instead.\nCG: Added concept IDs for woman and husband unable to have children.\nKZ: 9/9\n1. Added photo capture of ID cards\n2. Added double entry of both IDs\n3. Added the which ID? screening question\n4. Changed the number of MWRAs in HH question to integer.\n5. Moved eligibility screening questions above ID questions, as in Census.\nCG: Updated address mappings so address5 is mapped to HHID\nCG: Added id_type to choices sheet.\n15/9\nKZ: Added Bangla to id_type choices, What type of ID and Re-Type National ID.\nKZ: Made FWWOMANYID field hidden until we come to a final decision on how to do this image capture.\nKZ: Removed leading zero from the '01' on the labels in HH Inhabitant number question.\nNN: Updated the constraint of 'How many member....' from \"regex(., '^(?!0{2})[0-9]{2}$')\" to \" .< 31 or .=99\"\nNN: Updated the 'relevant' logic of NID/BRID questions. added 'selected' logic\nKH: 16/9\n1. Added datatype / leading zeroes question as comment for FWNHHMBRNUM\n2. Changed constraint for FWNHHMBRNUM to exclude 0 as option\n3. Added \"Respondent Age\" concept UID to FWWOMAGE for data collection/analysis.\n4. Added \"Meets eligibility criteria for clinical trial or study\" concept UID to FWELIGIBLE to match FD form\nNN: 22/9\n1. Added entity:concept for FWELIGIBLE\n---\nKZ: 27/9\n1. Changed HHNUMB to text, still need to update the constraint to match with text.\nNN: 28/9\nUpdated the constraint of 'How many member....' from \".< 3 1 or .=99\" to \"regex(., '^(?!0{2})[0-9]{2}$')\"\nKZ (28/9):\n1. Change NUMMWRA to select one with yesno responses. Removed hints and constraints\n2. Updated hints and constraints for HH INhabitants to include leading zeros\nNN (8/10):\nAdd DoB, Gender questions before 'eligible' group\nMade FWNHHMBRNUM and FWNHHMWRA required field\nUpdated the constraing of 'how many member....' --> (regex(., '^(?!0{2})[0-9]{2}$') and .<31) or .=99\nUpdated the logic of Age (should not accept less than 12 years\nUpdated the hint/constraint message with english numeric input e.g 13 instead of ১৩\nCG (15/10):\nAdd ELCO count calculation; strike-through MWRA calculation\nNN (18/10): \nRemoved the Strikethrough fields.\nAdded two hidden variables for developers use- user_type and external_user_ID" + } + }, + { + "instance": { + "openmrs_entity_id": "location_id", + "openmrs_entity": "encounter" + }, + "type": "hidden", + "name": "existing_location" + }, + { + "type": "hidden", + "name": "existing_Country" + }, + { + "type": "hidden", + "name": "existing_Division" + }, + { + "type": "hidden", + "name": "existing_District" + }, + { + "type": "hidden", + "name": "existing_Upazilla" + }, + { + "type": "hidden", + "name": "existing_Union" + }, + { + "type": "hidden", + "name": "existing_Ward" + }, + { + "type": "hidden", + "name": "existing_Subunit" + }, + { + "type": "hidden", + "name": "existing_Mauzapara" + }, + { + "instance": { + "openmrs_entity_id": "encounter_date", + "openmrs_entity": "encounter" + }, + "type": "today", + "name": "today" + }, + { + "instance": { + "openmrs_entity_id": "encounter_start", + "openmrs_entity": "encounter" + }, + "type": "start", + "name": "start" + }, + { + "instance": { + "openmrs_entity_id": "encounter_end", + "openmrs_entity": "encounter" + }, + "type": "end", + "name": "end" + }, + { + "name": "FWNHREGDATE", + "hint": { + "Bengali": "আজকের তারিখ দিন", + "English": "Please enter today's date." + }, + "bind": { + "jr:constraintMsg": { + "Bengali": "আজকের তারিখের পরের কোন তারিখ\nহতে পারবে না", + "English": "Date cannot be greater than current date." + }, + "required": "yes", + "constraint": ".<=${today}" + }, + "label": { + "Bengali": "সাক্ষাৎকারের তারিখ", + "English": "Date of Interview" + }, + "instance": { + "openmrs_entity_id": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "date" + }, + { + "control": { + "appearance": "numbers" + }, + "name": "FWGOBHHID", + "hint": { + "Bengali": "কালো কালিতে লেখা সরকারী খানা নম্বর (HHID) যেভাবে ঘরের দেয়াল বা দরজায় দেওয়া আছে সেভাবেই ইনপুট দিন।\nসরকারী খানা নম্বর (HHID) পাওয়া না গেলে ৯৯৯৯ ইনপুট দিন", + "English": "Please input the Black – painted Government household ID (HHID) as displayed on the door/wall of the HH. If there is no Government HHID, enter 9999." + }, + "bind": { + "jr:constraintMsg": { + "Bengali": "অনুগ্রহ করে ০০০১ থেকে ৯৯৯৯ এর মধ্যে ৪ ডিজিটের GoB HHID টাইপ করুন", + "English": "Please enter 4 digits of GoB HHID from 0001 to 9999" + }, + "required": "yes", + "constraint": "regex(., '^(?!0{4})[0-9]{4}$')" + }, + "label": { + "Bengali": "GoB HHID", + "English": "GoB HHID" + }, + "instance": { + "openmrs_entity_id": "GoB_HHID", + "openmrs_entity": "person_attribute" + }, + "type": "text" + }, + { + "control": { + "appearance": "numbers" + }, + "name": "FWJIVHHID", + "hint": { + "Bengali": "লাল কালিতে দেয়া জীবিতা খানা নম্বর (HHID) যেভাবে দেয়ালে বা দরজায় দেওয়া আছে সেভাবেই ইনপুট দিন ।\nজীবিতা খানা নম্বর (HHID) পাওয়া না গেলে ৯৯৯৯ ইনপুট দিন", + "English": "Please input the RED – painted JiVitA / Study household ID (HHID) as displayed on the door/wall of the HH. Enter 9999 if JiVitA HHID is not found." + }, + "bind": { + "jr:constraintMsg": { + "Bengali": "অনুগ্রহ করে ০০০১ থেকে ৯৯৯৯ এর মধ্যে ৪ ডিজিটের JiVitA HHID টাইপ করুন", + "English": "Please enter 4 digits of JiVitA HHID from 0001 to 9999" + }, + "required": "yes", + "constraint": "regex(., '^(?!0{4})[0-9]{4}$')" + }, + "label": { + "Bengali": "JiVitA HHID", + "English": "JiVitA HHID" + }, + "instance": { + "openmrs_entity_id": "JiVitA_HHID", + "openmrs_entity": "person_attribute" + }, + "type": "text" + }, + { + "bind": { + "calculate": "${existing_Country}" + }, + "type": "calculate", + "name": "FWCOUNTRY", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "country", + "openmrs_entity_parent": "usual_residence" + } + }, + { + "bind": { + "calculate": "${existing_Division}" + }, + "type": "calculate", + "name": "FWDIVISION", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "stateProvince", + "openmrs_entity_parent": "usual_residence" + } + }, + { + "bind": { + "calculate": "${existing_District}" + }, + "type": "calculate", + "name": "FWDISTRICT", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "countyDistrict", + "openmrs_entity_parent": "usual_residence" + } + }, + { + "bind": { + "calculate": "${existing_Upazilla}" + }, + "type": "calculate", + "name": "FWUPAZILLA", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "cityVillage", + "openmrs_entity_parent": "usual_residence" + } + }, + { + "bind": { + "calculate": "${existing_Union}" + }, + "type": "calculate", + "name": "FWUNION", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "address1", + "openmrs_entity_parent": "usual_residence" + } + }, + { + "bind": { + "calculate": "${existing_Ward}" + }, + "type": "calculate", + "name": "FWWARD", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "address2", + "openmrs_entity_parent": "usual_residence" + } + }, + { + "bind": { + "calculate": "${existing_Subunit}" + }, + "type": "calculate", + "name": "FWSUBUNIT", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "address3", + "openmrs_entity_parent": "usual_residence" + } + }, + { + "bind": { + "calculate": "${existing_Mauzapara}" + }, + "type": "calculate", + "name": "FWMAUZA_PARA", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "address4", + "openmrs_entity_parent": "usual_residence" + } + }, + { + "bind": { + "calculate": "${FWGOBHHID}" + }, + "type": "calculate", + "name": "FWGOB_HHID", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "address5", + "openmrs_entity_parent": "usual_residence" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "geopoint", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "geopoint", + "openmrs_entity_parent": "usual_residence" + }, + "name": "FWNHHHGPS", + "label": { + "Bengali": "জি পি এস", + "English": "Collect GPS Location of HH" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity_id": "first_name", + "openmrs_entity": "person" + }, + "name": "FWHOHFNAME", + "label": { + "Bengali": "খানা প্রধানের নাম-", + "English": "Head of Household Name" + } + }, + { + "bind": { + "calculate": "\".\"" + }, + "type": "calculate", + "name": "FWHOHLNAME", + "instance": { + "openmrs_entity_id": "last_name", + "openmrs_entity": "person" + } + }, + { + "bind": { + "calculate": "\"1900-01-01\"" + }, + "type": "calculate", + "name": "FWHOHBIRTHDATE", + "instance": { + "openmrs_entity_id": "birthdate", + "openmrs_entity": "person" + } + }, + { + "name": "FWHOHGENDER", + "bind": { + "required": "yes" + }, + "label": { + "Bengali": "খানা প্রধানের লিঙ্গ", + "English": "Head of Household Gender" + }, + "instance": { + "openmrs_entity_id": "gender", + "openmrs_entity": "person" + }, + "type": "select one", + "children": [ { - "type": "hidden", - "name": "version", - "label": { - "English": "TechVersion: v1.4 Aug 26, 2015\nFormVersion: v1.0" - } + "name": "1", + "label": { + "Bengali": "ছেলে", + "English": "Male" + } }, { - "type": "hidden", - "name": "changes", - "label": { - "English": "NN: \n1. Added a calculation field 'REGDATE' under 'woman' group\n2. Removed the conceptIDs which have Datatype N/A\n3. Define NID as person_attribute\nKZ: Dropped 9=DK from Vitsts choices\nCG: Added person_address mappings and NN added Variable Names for these address fields\nCG: Change NID back to person_identifier\nCG: Delete location_name field - need to communicate this change to Raihan - mauzapara name coming from existing_Mauzapara instead.\nCG: Added concept IDs for woman and husband unable to have children.\nKZ: 9/9\n1. Added photo capture of ID cards\n2. Added double entry of both IDs\n3. Added the which ID? screening question\n4. Changed the number of MWRAs in HH question to integer.\n5. Moved eligibility screening questions above ID questions, as in Census.\nCG: Updated address mappings so address5 is mapped to HHID\nCG: Added id_type to choices sheet.\n15/9\nKZ: Added Bangla to id_type choices, What type of ID and Re-Type National ID.\nKZ: Made FWWOMANYID field hidden until we come to a final decision on how to do this image capture.\nKZ: Removed leading zero from the '01' on the labels in HH Inhabitant number question.\nNN: Updated the constraint of 'How many member....' from \"regex(., '^(?!0{2})[0-9]{2}$')\" to \" .< 31 or .=99\"\nNN: Updated the 'relevant' logic of NID/BRID questions. added 'selected' logic\nKH: 16/9\n1. Added datatype / leading zeroes question as comment for FWNHHMBRNUM\n2. Changed constraint for FWNHHMBRNUM to exclude 0 as option\n3. Added \"Respondent Age\" concept UID to FWWOMAGE for data collection/analysis.\n4. Added \"Meets eligibility criteria for clinical trial or study\" concept UID to FWELIGIBLE to match FD form\nNN: 22/9\n1. Added entity:concept for FWELIGIBLE\n---\nKZ: 27/9\n1. Changed HHNUMB to text, still need to update the constraint to match with text.\nNN: 28/9\nUpdated the constraint of 'How many member....' from \".< 3 1 or .=99\" to \"regex(., '^(?!0{2})[0-9]{2}$')\"\nKZ (28/9):\n1. Change NUMMWRA to select one with yesno responses. Removed hints and constraints\n2. Updated hints and constraints for HH INhabitants to include leading zeros\nNN (8/10):\nAdd DoB, Gender questions before 'eligible' group\nMade FWNHHMBRNUM and FWNHHMWRA required field\nUpdated the constraing of 'how many member....' --> (regex(., '^(?!0{2})[0-9]{2}$') and .<31) or .=99\nUpdated the logic of Age (should not accept less than 12 years\nUpdated the hint/constraint message with english numeric input e.g 13 instead of ১৩\nCG (15/10):\nAdd ELCO count calculation; strike-through MWRA calculation\nNN (18/10): \nRemoved the Strikethrough fields.\nAdded two hidden variables for developers use- user_type and external_user_ID" - } + "name": "2", + "label": { + "Bengali": "মেয়ে", + "English": "Female" + } + } + ] + }, + { + "control": { + "appearance": "numbers" + }, + "name": "FWNHHMBRNUM", + "hint": { + "Bengali": "খানার সদস্য সংখ্যা লিখতে 01-29 লিখুন । 30 বা তার বেশী হলে 30 লিখুন। খানার সদস্যের সংখ্যা জানা না থাকলে 99 লিখুন ।", + "English": "Enter 01-29 for the number of household members. Enter 30 if 30 or more. Enter 99 if the total number is unknown." + }, + "bind": { + "jr:constraintMsg": { + "Bengali": "খানার সদস্য সংখ্যাকে দুই ডিজিট হিসেবে এন্ট্রি করতে হবে। খানার সদস্য সংখ্যা লিখতে 01- 29 লিখুন । খানার সদস্যের সংখ্যা 30 বা তার বেশি হলে 30 লিখুন। খানার সদস্যের সংখ্যা জানা না থাকলে 99 লিখুন ।", + "English": "Number should be entered as two digits. Enter 01-29 for the number of household members. Enter 30 if there are 30 or more household members. Enter 99 if the total number is unknown." }, + "required": "yes", + "constraint": "(regex(., '^(?!0{2})[0-9]{2}$') and .<31) or .=99" + }, + "label": { + "Bengali": "এই খানায় বর্তমানে কতজন মানুষ বসবাস করছে?", + "English": "How many people are currently living in this household?" + }, + "instance": { + "openmrs_entity_id": "5611AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "text" + }, + { + "name": "FWNHHMWRA", + "bind": { + "required": "yes" + }, + "label": { + "Bengali": "এই খানায় কি ১৫ থেকে ৪৯ বছর বয়সের কোন বিবাহিত মহিলা আছেন?", + "English": "Are there any married women between the ages of 15 - 49 live in this household?" + }, + "instance": { + "openmrs_entity_id": "1901AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ { - "instance": { - "openmrs_entity_id": "location_id", - "openmrs_entity": "encounter" - }, - "type": "hidden", - "name": "existing_location" + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "0", + "label": { + "Bengali": "না", + "English": "No" + } }, { - "type": "hidden", - "name": "existing_Country" + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "1", + "label": { + "Bengali": "হ্যাঁ", + "English": "Yes" + } }, { - "type": "hidden", - "name": "existing_Division" + "instance": { + "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "9", + "label": { + "Bengali": "জানি না", + "English": "Don't know" + } + } + ] + }, + { + "name": "woman", + "hint": { + "Bengali": "আমরা এখন মহিলাকে নিবন্ধন করব। তাকে জাতীয় পরিচয়পত্র এবং জন্ম নিবন্ধন সনদপত্র নিয়ে আসতে অনুরোধ করুন।", + "English": "We will now register the woman. Please ask her to bring her National ID Card and Birth Certificate." + }, + "bind": { + "relevant": "${FWNHHMWRA}='1'" + }, + "label": { + "Bengali": "মহিলার তথ্যঃ", + "English": "New Woman Registration" + }, + "instance": { + "openmrs_entity_id": "New Woman Registration", + "openmrs_entity": "person" + }, + "type": "repeat", + "children": [ + { + "bind": { + "calculate": "${FWGOBHHID}" + }, + "type": "calculate", + "name": "GOBHHID", + "instance": { + "openmrs_entity_id": "GoB_HHID", + "openmrs_entity": "person_attribute" + } }, { - "type": "hidden", - "name": "existing_District" + "bind": { + "calculate": "${FWJIVHHID}" + }, + "type": "calculate", + "name": "JiVitAHHID", + "instance": { + "openmrs_entity_id": "JiVitA_HHID", + "openmrs_entity": "person_attribute" + } }, { - "type": "hidden", - "name": "existing_Upazilla" + "bind": { + "calculate": "${FWNHREGDATE}" + }, + "type": "calculate", + "name": "REGDATE" }, { - "type": "hidden", - "name": "existing_Union" + "name": "FWWOMFNAME", + "hint": { + "Bengali": "মহিলার নাম টাইপ করুন", + "English": "Please type woman's name" + }, + "bind": { + "required": "yes" + }, + "label": { + "Bengali": "মহিলার নাম-", + "English": "Woman Name" + }, + "instance": { + "openmrs_entity_id": "first_name", + "openmrs_entity": "person" + }, + "type": "text" }, { - "type": "hidden", - "name": "existing_Ward" + "bind": { + "calculate": "\".\"" + }, + "type": "calculate", + "name": "FWWOMLNAME", + "instance": { + "openmrs_entity_id": "last_name", + "openmrs_entity": "person" + } }, { - "type": "hidden", - "name": "existing_Subunit" + "name": "FWBIRTHDATE", + "hint": { + "Bengali": "“যদি জন্মনিবন্ধন সনদপত্র থাকে তাহলে জন্মতারিখ সেখান থেকেই সংগ্রহ করুন। যদি জন্মতারিখ বলতে না পারে তাহলে মাসের ১৫ তারিখকে জন্মতারিখ হিসেবে বেছে নিন। যদি জন্মমাস বলতে না পারে তাহলে ৬ বা জুনকে মাস হিসেবে বেছে নিন এবং মহিলা যে বছরটিতে তার জন্ম বলবে সেটি এন্ট্রি করুন।”", + "English": "If birth certificate is available take date of birth from birth certificate. If date of birth is unknown choose 15 as the date of birth, if month is unknown choose 06 (June) as month of birth and enter the year of birth as mentioned by the woman." + }, + "default": "2000-01-02 00:00:00", + "bind": { + "jr:constraintMsg": { + "Bengali": "মহিলার বয়স অবশ্যই ১২ বছরের বেশী হবে", + "English": "Woman must be older than 12 years of age" + }, + "required": "yes", + "constraint": "((${FWBIRTHDATE})+4380) <= today()" + }, + "label": { + "Bengali": "মহিলার জন্ম তারিখ", + "English": "Woman's Date of Birth" + }, + "instance": { + "openmrs_entity_id": "birthdate", + "openmrs_entity": "person" + }, + "type": "date" }, { - "type": "hidden", - "name": "existing_Mauzapara" + "bind": { + "calculate": "\"female\"" + }, + "type": "calculate", + "name": "FWGENDER", + "instance": { + "openmrs_entity_id": "gender", + "openmrs_entity": "person" + } }, { - "instance": { - "openmrs_entity_id": "encounter_date", - "openmrs_entity": "encounter" - }, - "type": "today", - "name": "today" + "bind": { + "calculate": "round(((${today} - ${FWBIRTHDATE}) div 365.25),0)" + }, + "type": "calculate", + "name": "FWWOMAGE", + "instance": { + "openmrs_entity_id": "1532AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } }, { - "instance": { - "openmrs_entity_id": "encounter_start", - "openmrs_entity": "encounter" - }, - "type": "start", - "name": "start" + "type": "note", + "name": "display_age", + "label": { + "Bengali": "মহিলার বয়স ${FWWOMAGE}", + "English": "The woman's age is ${FWWOMAGE}." + } }, { - "instance": { - "openmrs_entity_id": "encounter_end", - "openmrs_entity": "encounter" + "control": { + "appearance": "yes" + }, + "name": "FWNHWOMSTRMEN", + "label": { + "Bengali": "আপনার কি বর্তমানে মাসিক একেবারে উঠে গেছে বা আপনি কি বর্তমানে স্থায়ী জন্মনিয়ন্ত্রন পদ্ধতি গ্রহণ করেছেন?", + "English": "Are you currently menopausal or sterilized?" + }, + "instance": { + "openmrs_entity_id": "163006AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "0", + "label": { + "Bengali": "না", + "English": "No" + } }, - "type": "end", - "name": "end" + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "1", + "label": { + "Bengali": "হ্যাঁ", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "9", + "label": { + "Bengali": "জানি না", + "English": "Don't know" + } + } + ] }, { - "name": "FWNHREGDATE", - "hint": { - "Bengali": "আজকের তারিখ দিন", - "English": "Please enter today's date." + "control": { + "appearance": "yes" + }, + "name": "FWNHWOMHUSLIV", + "bind": { + "relevant": "selected(${FWNHWOMSTRMEN}, '0') or selected(${FWNHWOMSTRMEN}, '9')" + }, + "label": { + "Bengali": "আপনি কি বর্তমানে আপনার স্বামীর সাথে বসবাস করছেন?", + "English": "Are you currently living with your husband?" + }, + "instance": { + "openmrs_entity_id": "162994AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "0", + "label": { + "Bengali": "না", + "English": "No" + } }, - "bind": { - "jr:constraintMsg": { - "Bengali": "আজকের তারিখের পরের কোন তারিখ\nহতে পারবে না", - "English": "Date cannot be greater than current date." - }, - "required": "yes", - "constraint": ".<=${today}" - }, - "label": { - "Bengali": "সাক্ষাৎকারের তারিখ", - "English": "Date of Interview" + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "1", + "label": { + "Bengali": "হ্যাঁ", + "English": "Yes" + } }, - "instance": { - "openmrs_entity_id": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" + { + "instance": { + "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "9", + "label": { + "Bengali": "জানি না", + "English": "Don't know" + } + } + ] + }, + { + "control": { + "appearance": "yes" + }, + "name": "FWNHWOMHUSALV", + "bind": { + "relevant": "selected(${FWNHWOMHUSLIV}, '0') or selected(${FWNHWOMHUSLIV}, '9')" + }, + "label": { + "Bengali": "আপনার স্বামী কি জীবিত আছেন?", + "English": "Is the husband alive?" + }, + "instance": { + "openmrs_entity_id": "5561AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "0", + "label": { + "Bengali": "না", + "English": "No" + } }, - "type": "date" + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "1", + "label": { + "Bengali": "হ্যাঁ", + "English": "Yes" + } + } + ] }, { - "control": { - "appearance": "numbers" + "control": { + "appearance": "yes" + }, + "name": "FWNHWOMHUSSTR", + "bind": { + "relevant": "selected(${FWNHWOMHUSLIV}, '1') or (selected(${FWNHWOMHUSLIV}, '9') and selected(${FWNHWOMHUSALV}, '1'))" + }, + "label": { + "Bengali": "আপনার স্বামী কি স্থায়ী জন্মনিয়ন্ত্রন পদ্ধতি গ্রহণ করেছেন?", + "English": "Is the husband sterilized?" + }, + "instance": { + "openmrs_entity_id": "162959AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "0", + "label": { + "Bengali": "না", + "English": "No" + } + }, + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "1", + "label": { + "Bengali": "হ্যাঁ", + "English": "Yes" + } }, - "name": "FWGOBHHID", - "hint": { - "Bengali": "কালো কালিতে লেখা সরকারী খানা নম্বর (HHID) যেভাবে ঘরের দেয়াল বা দরজায় দেওয়া আছে সেভাবেই ইনপুট দিন।\nসরকারী খানা নম্বর (HHID) পাওয়া না গেলে ৯৯৯৯ ইনপুট দিন", - "English": "Please input the Black – painted Government household ID (HHID) as displayed on the door/wall of the HH. If there is no Government HHID, enter 9999." + { + "instance": { + "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "9", + "label": { + "Bengali": "জানি না", + "English": "Don't know" + } + } + ] + }, + { + "bind": { + "calculate": "if(${FWNHWOMSTRMEN}='0' and ${FWNHWOMHUSLIV}='1' and ${FWNHWOMHUSSTR}='0','1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA','1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')" + }, + "type": "calculate", + "name": "FWELIGIBLE", + "instance": { + "openmrs_entity_id": "162699AAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } + }, + { + "bind": { + "relevant": "${FWELIGIBLE}='1'" + }, + "type": "group", + "children": [ + { + "name": "FWWOMANYID", + "hint": { + "Bengali": "প্রযোজ্য সবগুলো উত্তর নির্বাচন করুন", + "English": "Select all that apply." + }, + "label": { + "Bengali": "নিচের কোন পরিচয় পত্রটি মহিলার কাছে আছে?", + "English": "Which of the following IDs does the woman have?" + }, + "instance": { + "openmrs_entity_id": "163087AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select all that apply", + "children": [ + { + "instance": { + "openmrs_code": "163084AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "1", + "label": { + "Bengali": "জাতীয় পরিচয়পত্র নম্বর", + "English": "National ID Number" + } + }, + { + "instance": { + "openmrs_code": "163083AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "2", + "label": { + "Bengali": "জন্ম নিবন্ধন সনদপত্র নম্বর", + "English": "Birth Registration ID Number" + } + } + ] }, - "bind": { + { + "control": { + "appearance": "numbers" + }, + "name": "FWWOMNID", + "hint": { + "Bengali": "জাতীয় পরিচয়পত্রে দেওয়া সরকারী নম্বর যেভাবে দেওয়া আছে সেভাবেই প্রবেশ করান", + "English": "Please input the Government ID as displayed on the national ID card" + }, + "bind": { + "relevant": "selected(${FWWOMANYID},'1')", "jr:constraintMsg": { - "Bengali": "অনুগ্রহ করে ০০০১ থেকে ৯৯৯৯ এর মধ্যে ৪ ডিজিটের GoB HHID টাইপ করুন", - "English": "Please enter 4 digits of GoB HHID from 0001 to 9999" + "Bengali": "জাতীয় পরিচয়পত্র নং ১৩ অথবা ১৭ ডিজিটের হবে", + "English": "National ID should be 13 or 17 digits" }, "required": "yes", - "constraint": "regex(., '^(?!0{4})[0-9]{4}$')" - }, - "label": { - "Bengali": "GoB HHID", - "English": "GoB HHID" - }, - "instance": { - "openmrs_entity_id": "GoB_HHID", - "openmrs_entity": "person_attribute" + "constraint": "regex(., '^(?!0{13})[0-9]{13}$') or regex(., '^(?!0{17})[0-9]{17}$')" + }, + "label": { + "Bengali": "মহিলার জাতীয় পরিচয়পত্র নং-", + "English": "Woman's National ID Number" + }, + "type": "text" }, - "type": "text" - }, - { - "control": { + { + "control": { "appearance": "numbers" + }, + "name": "FWWOMRETYPENID", + "hint": { + "Bengali": "জাতীয় পরিচয়পত্রের নম্বরটি পুনরায় প্রবেশ করান", + "English": "Please re-input the National ID number" + }, + "bind": { + "relevant": "selected(${FWWOMANYID},'1')", + "jr:constraintMsg": { + "Bengali": "এই নম্বরটি ও পূর্বের স্ক্রিনে দেওয়া জন্ম নিবন্ধন নম্বরটি একই হতে হবে", + "English": "This number and the one in the previous screen should be same" + }, + "required": "yes", + "constraint": ".=${FWWOMNID}" + }, + "label": { + "Bengali": "মহিলার জাতীয় পরিচয়পত্র নম্বরটি পুনরায় লিখুন", + "English": "Re-Type Woman's National ID Number" + }, + "instance": { + "openmrs_entity_id": "NID", + "openmrs_entity": "person_identifier" + }, + "type": "text" }, - "name": "FWJIVHHID", - "hint": { - "Bengali": "লাল কালিতে দেয়া জীবিতা খানা নম্বর (HHID) যেভাবে দেয়ালে বা দরজায় দেওয়া আছে সেভাবেই ইনপুট দিন ।\nজীবিতা খানা নম্বর (HHID) পাওয়া না গেলে ৯৯৯৯ ইনপুট দিন", - "English": "Please input the RED – painted JiVitA / Study household ID (HHID) as displayed on the door/wall of the HH. Enter 9999 if JiVitA HHID is not found." - }, - "bind": { + { + "control": { + "appearance": "numbers" + }, + "name": "FWWOMBID", + "hint": { + "Bengali": "জন্ম নিবন্ধন সনদপত্রের সরকারী নম্বর যেভাবে দেওয়া আছে সেভাবেই ইনপুট দিন।", + "English": "Please input the Government ID as displayed on the birth certificate" + }, + "bind": { + "relevant": "selected(${FWWOMANYID},'2')", "jr:constraintMsg": { - "Bengali": "অনুগ্রহ করে ০০০১ থেকে ৯৯৯৯ এর মধ্যে ৪ ডিজিটের JiVitA HHID টাইপ করুন", - "English": "Please enter 4 digits of JiVitA HHID from 0001 to 9999" + "Bengali": "জন্ম নিবন্ধন সনদ নং ১৭ ডিজিটের হবে", + "English": "Birth Registration ID should be 17 digits" }, "required": "yes", - "constraint": "regex(., '^(?!0{4})[0-9]{4}$')" + "constraint": "regex(., '^(?!0{17})[0-9]{17}$')" + }, + "label": { + "Bengali": "মহিলার জন্ম নিবন্ধন সনদ নং-", + "English": "Woman's Birth Registration ID" + }, + "type": "text" }, - "label": { - "Bengali": "JiVitA HHID", - "English": "JiVitA HHID" + { + "control": { + "appearance": "numbers" + }, + "name": "FWWOMRETYPEBID", + "hint": { + "Bengali": "জন্ম নিবন্ধন নম্বরটি পূনরায় প্রবেশ করান", + "English": "Please re-input the Birth Registration Number" + }, + "bind": { + "relevant": "selected(${FWWOMANYID},'2')", + "jr:constraintMsg": { + "Bengali": "এই নম্বরটি ও পূর্বের স্ক্রিনে দেওয়া জন্ম নিবন্ধন নম্বরটি একই হতে হবে", + "English": "This number and the one in the previous screen should be same" + }, + "required": "yes", + "constraint": ".=${FWWOMBID}" + }, + "label": { + "Bengali": "মহিলার জন্ম নিবন্ধন সনদ নং-", + "English": "Woman's Birth Registration ID" + }, + "instance": { + "openmrs_entity_id": "Birth Registration ID", + "openmrs_entity": "person_identifier" + }, + "type": "text" }, - "instance": { - "openmrs_entity_id": "JiVitA_HHID", - "openmrs_entity": "person_attribute" + { + "name": "FWHUSNAME", + "hint": { + "Bengali": "স্বামীর নাম টাইপ করুন", + "English": "Please type husband's name" + }, + "bind": { + "required": "yes" + }, + "label": { + "Bengali": "স্বামীর নাম-", + "English": "Husband's Name" + }, + "instance": { + "openmrs_entity_id": "161135AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "text" }, - "type": "text" - }, - { - "bind": { + { + "bind": { "calculate": "${existing_Country}" - }, - "type": "calculate", - "name": "FWCOUNTRY", - "instance": { + }, + "type": "calculate", + "name": "FWWOMCOUNTRY", + "instance": { "openmrs_entity": "person_address", "openmrs_entity_id": "country", "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${existing_Division}" + } }, - "type": "calculate", - "name": "FWDIVISION", - "instance": { + { + "bind": { + "calculate": "${existing_Division}" + }, + "type": "calculate", + "name": "FWWOMDIVISION", + "instance": { "openmrs_entity": "person_address", "openmrs_entity_id": "stateProvince", "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${existing_District}" + } }, - "type": "calculate", - "name": "FWDISTRICT", - "instance": { + { + "bind": { + "calculate": "${existing_District}" + }, + "type": "calculate", + "name": "FWWOMDISTRICT", + "instance": { "openmrs_entity": "person_address", "openmrs_entity_id": "countyDistrict", "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${existing_Upazilla}" + } }, - "type": "calculate", - "name": "FWUPAZILLA", - "instance": { + { + "bind": { + "calculate": "${existing_Upazilla}" + }, + "type": "calculate", + "name": "FWWOMUPAZILLA", + "instance": { "openmrs_entity": "person_address", "openmrs_entity_id": "cityVillage", "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${existing_Union}" + } }, - "type": "calculate", - "name": "FWUNION", - "instance": { + { + "bind": { + "calculate": "${existing_Union}" + }, + "type": "calculate", + "name": "FWWOMUNION", + "instance": { "openmrs_entity": "person_address", "openmrs_entity_id": "address1", "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${existing_Ward}" + } }, - "type": "calculate", - "name": "FWWARD", - "instance": { + { + "bind": { + "calculate": "${existing_Ward}" + }, + "type": "calculate", + "name": "FWWOMWARD", + "instance": { "openmrs_entity": "person_address", "openmrs_entity_id": "address2", "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${existing_Subunit}" + } }, - "type": "calculate", - "name": "FWSUBUNIT", - "instance": { + { + "bind": { + "calculate": "${existing_Subunit}" + }, + "type": "calculate", + "name": "FWWOMSUBUNIT", + "instance": { "openmrs_entity": "person_address", "openmrs_entity_id": "address3", "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${existing_Mauzapara}" + } }, - "type": "calculate", - "name": "FWMAUZA_PARA", - "instance": { + { + "bind": { + "calculate": "${existing_Mauzapara}" + }, + "type": "calculate", + "name": "FWWOMMAUZA_PARA", + "instance": { "openmrs_entity": "person_address", "openmrs_entity_id": "address4", "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${FWGOBHHID}" + } }, - "type": "calculate", - "name": "FWGOB_HHID", - "instance": { + { + "bind": { + "calculate": "${FWGOBHHID}" + }, + "type": "calculate", + "name": "FWWOMGOBHHID", + "instance": { "openmrs_entity": "person_address", "openmrs_entity_id": "address5", "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "required": "yes" + } }, - "type": "geopoint", - "instance": { + { + "bind": { + "calculate": "${FWNHHHGPS}" + }, + "type": "calculate", + "name": "FWWOMGPS", + "instance": { "openmrs_entity": "person_address", "openmrs_entity_id": "geopoint", "openmrs_entity_parent": "usual_residence" - }, - "name": "FWNHHHGPS", - "label": { - "Bengali": "জি পি এস", - "English": "Collect GPS Location of HH" - } - }, - { - "bind": { - "required": "yes" - }, - "type": "text", - "instance": { - "openmrs_entity_id": "first_name", - "openmrs_entity": "person" - }, - "name": "FWHOHFNAME", - "label": { - "Bengali": "খানা প্রধানের নাম-", - "English": "Head of Household Name" - } - }, - { - "bind": { - "calculate": "\".\"" - }, - "type": "calculate", - "name": "FWHOHLNAME", - "instance": { - "openmrs_entity_id": "last_name", - "openmrs_entity": "person" - } - }, - { - "bind": { - "calculate": "\"1900-01-01\"" - }, - "type": "calculate", - "name": "FWHOHBIRTHDATE", - "instance": { - "openmrs_entity_id": "birthdate", - "openmrs_entity": "person" + } } + ], + "name": "eligible" }, { - "name": "FWHOHGENDER", - "bind": { - "required": "yes" - }, - "label": { - "Bengali": "খানা প্রধানের লিঙ্গ", - "English": "Head of Household Gender" - }, - "instance": { - "openmrs_entity_id": "gender", - "openmrs_entity": "person" - }, - "type": "select one", - "children": [ - { - "name": "1", - "label": { - "Bengali": "ছেলে", - "English": "Male" - } - }, - { - "name": "2", - "label": { - "Bengali": "মেয়ে", - "English": "Female" - } - } - ] - }, - { - "control": { - "appearance": "numbers" - }, - "name": "FWNHHMBRNUM", - "hint": { - "Bengali": "খানার সদস্য সংখ্যা লিখতে 01-29 লিখুন । 30 বা তার বেশী হলে 30 লিখুন। খানার সদস্যের সংখ্যা জানা না থাকলে 99 লিখুন ।", - "English": "Enter 01-29 for the number of household members. Enter 30 if 30 or more. Enter 99 if the total number is unknown." - }, - "bind": { - "jr:constraintMsg": { - "Bengali": "খানার সদস্য সংখ্যাকে দুই ডিজিট হিসেবে এন্ট্রি করতে হবে। খানার সদস্য সংখ্যা লিখতে 01- 29 লিখুন । খানার সদস্যের সংখ্যা 30 বা তার বেশি হলে 30 লিখুন। খানার সদস্যের সংখ্যা জানা না থাকলে 99 লিখুন ।", - "English": "Number should be entered as two digits. Enter 01-29 for the number of household members. Enter 30 if there are 30 or more household members. Enter 99 if the total number is unknown." - }, - "required": "yes", - "constraint": "(regex(., '^(?!0{2})[0-9]{2}$') and .<31) or .=99" - }, - "label": { - "Bengali": "এই খানায় বর্তমানে কতজন মানুষ বসবাস করছে?", - "English": "How many people are currently living in this household?" - }, - "instance": { - "openmrs_entity_id": "5611AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "text" - }, - { - "name": "FWNHHMWRA", - "bind": { - "required": "yes" - }, - "label": { - "Bengali": "এই খানায় কি ১৫ থেকে ৪৯ বছর বয়সের কোন বিবাহিত মহিলা আছেন?", - "English": "Are there any married women between the ages of 15 - 49 live in this household?" - }, - "instance": { - "openmrs_entity_id": "1901AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "select one", - "children": [ - { - "instance": { - "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "0", - "label": { - "Bengali": "না", - "English": "No" - } - }, - { - "instance": { - "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "1", - "label": { - "Bengali": "হ্যাঁ", - "English": "Yes" - } - }, - { - "instance": { - "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "9", - "label": { - "Bengali": "জানি না", - "English": "Don't know" - } - } - ] - }, - { - "name": "woman", - "hint": { - "Bengali": "আমরা এখন মহিলাকে নিবন্ধন করব। তাকে জাতীয় পরিচয়পত্র এবং জন্ম নিবন্ধন সনদপত্র নিয়ে আসতে অনুরোধ করুন।", - "English": "We will now register the woman. Please ask her to bring her National ID Card and Birth Certificate." - }, - "bind": { - "relevant": "${FWNHHMWRA}='1'" - }, - "label": { - "Bengali": "মহিলার তথ্যঃ", - "English": "New Woman Registration" - }, - "instance": { - "openmrs_entity_id": "New Woman Registration", - "openmrs_entity": "person" - }, - "type": "repeat", - "children": [ - { - "bind": { - "calculate": "${FWGOBHHID}" - }, - "type": "calculate", - "name": "GOBHHID", - "instance": { - "openmrs_entity_id": "GoB_HHID", - "openmrs_entity": "person_attribute" - } - }, - { - "bind": { - "calculate": "${FWJIVHHID}" - }, - "type": "calculate", - "name": "JiVitAHHID", - "instance": { - "openmrs_entity_id": "JiVitA_HHID", - "openmrs_entity": "person_attribute" - } - }, - { - "bind": { - "calculate": "${FWNHREGDATE}" - }, - "type": "calculate", - "name": "REGDATE" - }, - { - "name": "FWWOMFNAME", - "hint": { - "Bengali": "মহিলার নাম টাইপ করুন", - "English": "Please type woman's name" - }, - "bind": { - "required": "yes" - }, - "label": { - "Bengali": "মহিলার নাম-", - "English": "Woman Name" - }, - "instance": { - "openmrs_entity_id": "first_name", - "openmrs_entity": "person" - }, - "type": "text" - }, - { - "bind": { - "calculate": "\".\"" - }, - "type": "calculate", - "name": "FWWOMLNAME", - "instance": { - "openmrs_entity_id": "last_name", - "openmrs_entity": "person" - } - }, - { - "name": "FWBIRTHDATE", - "hint": { - "Bengali": "“যদি জন্মনিবন্ধন সনদপত্র থাকে তাহলে জন্মতারিখ সেখান থেকেই সংগ্রহ করুন। যদি জন্মতারিখ বলতে না পারে তাহলে মাসের ১৫ তারিখকে জন্মতারিখ হিসেবে বেছে নিন। যদি জন্মমাস বলতে না পারে তাহলে ৬ বা জুনকে মাস হিসেবে বেছে নিন এবং মহিলা যে বছরটিতে তার জন্ম বলবে সেটি এন্ট্রি করুন।”", - "English": "If birth certificate is available take date of birth from birth certificate. If date of birth is unknown choose 15 as the date of birth, if month is unknown choose 06 (June) as month of birth and enter the year of birth as mentioned by the woman." - }, - "default": "2000-01-02 00:00:00", - "bind": { - "jr:constraintMsg": { - "Bengali": "মহিলার বয়স অবশ্যই ১২ বছরের বেশী হবে", - "English": "Woman must be older than 12 years of age" - }, - "required": "yes", - "constraint": "((${FWBIRTHDATE})+4380) <= today()" - }, - "label": { - "Bengali": "মহিলার জন্ম তারিখ", - "English": "Woman's Date of Birth" - }, - "instance": { - "openmrs_entity_id": "birthdate", - "openmrs_entity": "person" - }, - "type": "date" - }, - { - "bind": { - "calculate": "\"female\"" - }, - "type": "calculate", - "name": "FWGENDER", - "instance": { - "openmrs_entity_id": "gender", - "openmrs_entity": "person" - } - }, - { - "bind": { - "calculate": "round(((${today} - ${FWBIRTHDATE}) div 365.25),0)" - }, - "type": "calculate", - "name": "FWWOMAGE", - "instance": { - "openmrs_entity_id": "1532AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - } - }, - { - "type": "note", - "name": "display_age", - "label": { - "Bengali": "মহিলার বয়স ${FWWOMAGE}", - "English": "The woman's age is ${FWWOMAGE}." - } - }, - { - "control": { - "appearance": "yes" - }, - "name": "FWNHWOMSTRMEN", - "label": { - "Bengali": "আপনার কি বর্তমানে মাসিক একেবারে উঠে গেছে বা আপনি কি বর্তমানে স্থায়ী জন্মনিয়ন্ত্রন পদ্ধতি গ্রহণ করেছেন?", - "English": "Are you currently menopausal or sterilized?" - }, - "instance": { - "openmrs_entity_id": "163006AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "select one", - "children": [ - { - "instance": { - "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "0", - "label": { - "Bengali": "না", - "English": "No" - } - }, - { - "instance": { - "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "1", - "label": { - "Bengali": "হ্যাঁ", - "English": "Yes" - } - }, - { - "instance": { - "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "9", - "label": { - "Bengali": "জানি না", - "English": "Don't know" - } - } - ] - }, - { - "control": { - "appearance": "yes" - }, - "name": "FWNHWOMHUSLIV", - "bind": { - "relevant": "selected(${FWNHWOMSTRMEN}, '0') or selected(${FWNHWOMSTRMEN}, '9')" - }, - "label": { - "Bengali": "আপনি কি বর্তমানে আপনার স্বামীর সাথে বসবাস করছেন?", - "English": "Are you currently living with your husband?" - }, - "instance": { - "openmrs_entity_id": "162994AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "select one", - "children": [ - { - "instance": { - "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "0", - "label": { - "Bengali": "না", - "English": "No" - } - }, - { - "instance": { - "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "1", - "label": { - "Bengali": "হ্যাঁ", - "English": "Yes" - } - }, - { - "instance": { - "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "9", - "label": { - "Bengali": "জানি না", - "English": "Don't know" - } - } - ] - }, - { - "control": { - "appearance": "yes" - }, - "name": "FWNHWOMHUSALV", - "bind": { - "relevant": "selected(${FWNHWOMHUSLIV}, '0') or selected(${FWNHWOMHUSLIV}, '9')" - }, - "label": { - "Bengali": "আপনার স্বামী কি জীবিত আছেন?", - "English": "Is the husband alive?" - }, - "instance": { - "openmrs_entity_id": "5561AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "select one", - "children": [ - { - "instance": { - "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "0", - "label": { - "Bengali": "না", - "English": "No" - } - }, - { - "instance": { - "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "1", - "label": { - "Bengali": "হ্যাঁ", - "English": "Yes" - } - } - ] - }, - { - "control": { - "appearance": "yes" - }, - "name": "FWNHWOMHUSSTR", - "bind": { - "relevant": "selected(${FWNHWOMHUSLIV}, '1') or (selected(${FWNHWOMHUSLIV}, '9') and selected(${FWNHWOMHUSALV}, '1'))" - }, - "label": { - "Bengali": "আপনার স্বামী কি স্থায়ী জন্মনিয়ন্ত্রন পদ্ধতি গ্রহণ করেছেন?", - "English": "Is the husband sterilized?" - }, - "instance": { - "openmrs_entity_id": "162959AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "select one", - "children": [ - { - "instance": { - "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "0", - "label": { - "Bengali": "না", - "English": "No" - } - }, - { - "instance": { - "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "1", - "label": { - "Bengali": "হ্যাঁ", - "English": "Yes" - } - }, - { - "instance": { - "openmrs_code": "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "9", - "label": { - "Bengali": "জানি না", - "English": "Don't know" - } - } - ] - }, - { - "bind": { - "calculate": "if(${FWNHWOMSTRMEN}='0' and ${FWNHWOMHUSLIV}='1' and ${FWNHWOMHUSSTR}='0','1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA','1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')" - }, - "type": "calculate", - "name": "FWELIGIBLE", - "instance": { - "openmrs_entity_id": "162699AAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - } - }, - { - "bind": { - "relevant": "${FWELIGIBLE}='1'" - }, - "type": "group", - "children": [ - { - "name": "FWWOMANYID", - "hint": { - "Bengali": "প্রযোজ্য সবগুলো উত্তর নির্বাচন করুন", - "English": "Select all that apply." - }, - "label": { - "Bengali": "নিচের কোন পরিচয় পত্রটি মহিলার কাছে আছে?", - "English": "Which of the following IDs does the woman have?" - }, - "instance": { - "openmrs_entity_id": "163087AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "select all that apply", - "children": [ - { - "instance": { - "openmrs_code": "163084AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "1", - "label": { - "Bengali": "জাতীয় পরিচয়পত্র নম্বর", - "English": "National ID Number" - } - }, - { - "instance": { - "openmrs_code": "163083AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "2", - "label": { - "Bengali": "জন্ম নিবন্ধন সনদপত্র নম্বর", - "English": "Birth Registration ID Number" - } - } - ] - }, - { - "control": { - "appearance": "numbers" - }, - "name": "FWWOMNID", - "hint": { - "Bengali": "জাতীয় পরিচয়পত্রে দেওয়া সরকারী নম্বর যেভাবে দেওয়া আছে সেভাবেই প্রবেশ করান", - "English": "Please input the Government ID as displayed on the national ID card" - }, - "bind": { - "relevant": "selected(${FWWOMANYID},'1')", - "jr:constraintMsg": { - "Bengali": "জাতীয় পরিচয়পত্র নং ১৩ অথবা ১৭ ডিজিটের হবে", - "English": "National ID should be 13 or 17 digits" - }, - "required": "yes", - "constraint": "regex(., '^(?!0{13})[0-9]{13}$') or regex(., '^(?!0{17})[0-9]{17}$')" - }, - "label": { - "Bengali": "মহিলার জাতীয় পরিচয়পত্র নং-", - "English": "Woman's National ID Number" - }, - "type": "text" - }, - { - "control": { - "appearance": "numbers" - }, - "name": "FWWOMRETYPENID", - "hint": { - "Bengali": "জাতীয় পরিচয়পত্রের নম্বরটি পুনরায় প্রবেশ করান", - "English": "Please re-input the National ID number" - }, - "bind": { - "relevant": "selected(${FWWOMANYID},'1')", - "jr:constraintMsg": { - "Bengali": "এই নম্বরটি ও পূর্বের স্ক্রিনে দেওয়া জন্ম নিবন্ধন নম্বরটি একই হতে হবে", - "English": "This number and the one in the previous screen should be same" - }, - "required": "yes", - "constraint": ".=${FWWOMNID}" - }, - "label": { - "Bengali": "মহিলার জাতীয় পরিচয়পত্র নম্বরটি পুনরায় লিখুন", - "English": "Re-Type Woman's National ID Number" - }, - "instance": { - "openmrs_entity_id": "NID", - "openmrs_entity": "person_identifier" - }, - "type": "text" - }, - { - "control": { - "appearance": "numbers" - }, - "name": "FWWOMBID", - "hint": { - "Bengali": "জন্ম নিবন্ধন সনদপত্রের সরকারী নম্বর যেভাবে দেওয়া আছে সেভাবেই ইনপুট দিন।", - "English": "Please input the Government ID as displayed on the birth certificate" - }, - "bind": { - "relevant": "selected(${FWWOMANYID},'2')", - "jr:constraintMsg": { - "Bengali": "জন্ম নিবন্ধন সনদ নং ১৭ ডিজিটের হবে", - "English": "Birth Registration ID should be 17 digits" - }, - "required": "yes", - "constraint": "regex(., '^(?!0{17})[0-9]{17}$')" - }, - "label": { - "Bengali": "মহিলার জন্ম নিবন্ধন সনদ নং-", - "English": "Woman's Birth Registration ID" - }, - "type": "text" - }, - { - "control": { - "appearance": "numbers" - }, - "name": "FWWOMRETYPEBID", - "hint": { - "Bengali": "জন্ম নিবন্ধন নম্বরটি পূনরায় প্রবেশ করান", - "English": "Please re-input the Birth Registration Number" - }, - "bind": { - "relevant": "selected(${FWWOMANYID},'2')", - "jr:constraintMsg": { - "Bengali": "এই নম্বরটি ও পূর্বের স্ক্রিনে দেওয়া জন্ম নিবন্ধন নম্বরটি একই হতে হবে", - "English": "This number and the one in the previous screen should be same" - }, - "required": "yes", - "constraint": ".=${FWWOMBID}" - }, - "label": { - "Bengali": "মহিলার জন্ম নিবন্ধন সনদ নং-", - "English": "Woman's Birth Registration ID" - }, - "instance": { - "openmrs_entity_id": "Birth Registration ID", - "openmrs_entity": "person_identifier" - }, - "type": "text" - }, - { - "name": "FWHUSNAME", - "hint": { - "Bengali": "স্বামীর নাম টাইপ করুন", - "English": "Please type husband's name" - }, - "bind": { - "required": "yes" - }, - "label": { - "Bengali": "স্বামীর নাম-", - "English": "Husband's Name" - }, - "instance": { - "openmrs_entity_id": "161135AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "text" - }, - { - "bind": { - "calculate": "${existing_Country}" - }, - "type": "calculate", - "name": "FWWOMCOUNTRY", - "instance": { - "openmrs_entity": "person_address", - "openmrs_entity_id": "country", - "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${existing_Division}" - }, - "type": "calculate", - "name": "FWWOMDIVISION", - "instance": { - "openmrs_entity": "person_address", - "openmrs_entity_id": "stateProvince", - "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${existing_District}" - }, - "type": "calculate", - "name": "FWWOMDISTRICT", - "instance": { - "openmrs_entity": "person_address", - "openmrs_entity_id": "countyDistrict", - "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${existing_Upazilla}" - }, - "type": "calculate", - "name": "FWWOMUPAZILLA", - "instance": { - "openmrs_entity": "person_address", - "openmrs_entity_id": "cityVillage", - "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${existing_Union}" - }, - "type": "calculate", - "name": "FWWOMUNION", - "instance": { - "openmrs_entity": "person_address", - "openmrs_entity_id": "address1", - "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${existing_Ward}" - }, - "type": "calculate", - "name": "FWWOMWARD", - "instance": { - "openmrs_entity": "person_address", - "openmrs_entity_id": "address2", - "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${existing_Subunit}" - }, - "type": "calculate", - "name": "FWWOMSUBUNIT", - "instance": { - "openmrs_entity": "person_address", - "openmrs_entity_id": "address3", - "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${existing_Mauzapara}" - }, - "type": "calculate", - "name": "FWWOMMAUZA_PARA", - "instance": { - "openmrs_entity": "person_address", - "openmrs_entity_id": "address4", - "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${FWGOBHHID}" - }, - "type": "calculate", - "name": "FWWOMGOBHHID", - "instance": { - "openmrs_entity": "person_address", - "openmrs_entity_id": "address5", - "openmrs_entity_parent": "usual_residence" - } - }, - { - "bind": { - "calculate": "${FWNHHHGPS}" - }, - "type": "calculate", - "name": "FWWOMGPS", - "instance": { - "openmrs_entity": "person_address", - "openmrs_entity_id": "geopoint", - "openmrs_entity_parent": "usual_residence" - } - } - ], - "name": "eligible" - }, - { - "type": "note", - "name": "add_women", - "label": { - "Bengali": "নির্দেশনাঃ এই খানায় যদি আরও কোন মহিলা থাকে যাকে রেজিস্ট্রেশন করা হয়নি, তাহলে '+' এ ক্লিক করুন এবং একই প্রক্রিয়ায় পরবর্তী মহিলাকে রেজিস্ট্রেশন করুন", - "English": "If there are any additional unregistered women in this household, select the '+' to add them now." - } - } - ] - }, - { - "bind": { - "calculate": "sum(${FWELIGIBLE})" - }, - "type": "calculate", - "name": "ELCO" - }, - { - "default": "FWA", - "type": "hidden", - "name": "user_type" - }, - { - "type": "hidden", - "name": "external_user_ID" - }, + "type": "note", + "name": "add_women", + "label": { + "Bengali": "নির্দেশনাঃ এই খানায় যদি আরও কোন মহিলা থাকে যাকে রেজিস্ট্রেশন করা হয়নি, তাহলে '+' এ ক্লিক করুন এবং একই প্রক্রিয়ায় পরবর্তী মহিলাকে রেজিস্ট্রেশন করুন", + "English": "If there are any additional unregistered women in this household, select the '+' to add them now." + } + } + ] + }, + { + "bind": { + "calculate": "sum(${FWELIGIBLE})" + }, + "type": "calculate", + "name": "ELCO" + }, + { + "default": "FWA", + "type": "hidden", + "name": "user_type" + }, + { + "type": "hidden", + "name": "external_user_ID" + }, + { + "control": { + "bodyless": true + }, + "type": "group", + "children": [ { - "control": { - "bodyless": true - }, - "type": "group", - "children": [ - { - "bind": { - "readonly": "true()", - "calculate": "concat('uuid:', uuid())" - }, - "type": "calculate", - "name": "instanceID" - } - ], - "name": "meta" + "bind": { + "readonly": "true()", + "calculate": "concat('uuid:', uuid())" + }, + "type": "calculate", + "name": "instanceID" } - ] + ], + "name": "meta" + } + ] } \ No newline at end of file diff --git a/src/test/resources/form/new_household_registration_with_grouped_subform_data/form.xml b/src/test/resources/form/new_household_registration_with_grouped_subform_data/form.xml index bda24f905..136af7901 100644 --- a/src/test/resources/form/new_household_registration_with_grouped_subform_data/form.xml +++ b/src/test/resources/form/new_household_registration_with_grouped_subform_data/form.xml @@ -1,31 +1,872 @@ -
-

নতুন খানা নিবন্ধন ফর্ম

- - - - - - - -
খানা প্রধানের লিঙ্গHead of Household Gender* -
- -
এই খানায় কি ১৫ থেকে ৪৯ বছর বয়সের কোন বিবাহিত মহিলা আছেন?Are there any married women between the ages of 15 - 49 live in this household?* -
-

মহিলার তথ্যঃNew Woman Registration

আপনার কি বর্তমানে মাসিক একেবারে উঠে গেছে বা আপনি কি বর্তমানে স্থায়ী জন্মনিয়ন্ত্রন পদ্ধতি গ্রহণ করেছেন?Are you currently menopausal or sterilized? -
আপনি কি বর্তমানে আপনার স্বামীর সাথে বসবাস করছেন?Are you currently living with your husband? -
আপনার স্বামী কি জীবিত আছেন?Is the husband alive? -
আপনার স্বামী কি স্থায়ী জন্মনিয়ন্ত্রন পদ্ধতি গ্রহণ করেছেন?Is the husband sterilized? -
নিচের কোন পরিচয় পত্রটি মহিলার কাছে আছে?Which of the following IDs does the woman have?প্রযোজ্য সবগুলো উত্তর নির্বাচন করুনSelect all that apply. -
-
+ + + + +

নতুন খানা নিবন্ধন + ফর্ম +

+ + + + + + + + +
+
+ + খানা + প্রধানের লিঙ্গ + + Head of Household + Gender + + * + +
+ + +
+
+
+ +
+
+ + এই + খানায় কি ১৫ থেকে + ৪৯ বছর বয়সের কোন + বিবাহিত মহিলা আছেন? + + Are there any + married women between the ages of 15 - 49 live in this household? + + * + +
+ + + +
+
+
+
+

+ মহিলার + তথ্যঃ + + New Woman Registration + +

+
+ + + +
+
+ + আপনার + কি বর্তমানে মাসিক + একেবারে উঠে গেছে + বা আপনি কি বর্তমানে + স্থায়ী জন্মনিয়ন্ত্রন + পদ্ধতি গ্রহণ করেছেন? + + + Are you currently menopausal or sterilized? + + +
+ + + +
+
+
+
+
+ + আপনি + কি বর্তমানে আপনার + স্বামীর সাথে বসবাস + করছেন? + + + Are you currently living with your husband? + + +
+ + + +
+
+
+
+
+ + আপনার + স্বামী কি জীবিত + আছেন? + + + Is the husband alive? + + +
+ + +
+
+
+
+
+ + আপনার + স্বামী কি স্থায়ী + জন্মনিয়ন্ত্রন + পদ্ধতি গ্রহণ করেছেন? + + + Is the husband sterilized? + + +
+ + + +
+
+
+
+
+
+ + নিচের + কোন পরিচয় পত্রটি + মহিলার কাছে আছে? + + Which of the following + IDs does the woman have? + + প্রযোজ্য + সবগুলো উত্তর + নির্বাচন করুন + + Select all that apply. + + +
+ + +
+
+
+ + + + + +
+
-
- -XML to HTML transformation for form took 0.05 secondsThis validation is yet not functional.
+
+ + + + + + XML to HTML transformation for form took 0.05 seconds + + + This validation is yet not functional. + + + + + diff --git a/src/test/resources/form/new_household_registration_with_grouped_subform_data/form_submission1.json b/src/test/resources/form/new_household_registration_with_grouped_subform_data/form_submission1.json index 75775ca8c..fce71a0dc 100644 --- a/src/test/resources/form/new_household_registration_with_grouped_subform_data/form_submission1.json +++ b/src/test/resources/form/new_household_registration_with_grouped_subform_data/form_submission1.json @@ -1,363 +1,363 @@ { - "id": "5ec11f03071ef0929839079530028992", - "_rev": "2-ddf675dd499e017538671b94843aeefc", - "type": "FormSubmission", - "anmId": "opensrp", - "instanceId": "d304dbr7-3998-434f-8c5b-55d6f5fa4252", - "formName": "new_household_registration_with_grouped_subform_data", - "entityId": "4237d267-d438-49f2-7822-8968t555447c", - "clientVersion": 1444562091545, - "formDataDefinitionVersion": "12", - "formInstance": { - "form_data_definition_version": "12", - "form": { - "bind_type": "household", - "default_bind_path": "/model/instance/FWNewHH", - "fields": [ - { - "name": "id", - "value": "4237d267-d438-49f2-7822-8968t555447c", - "source": "household.id" - }, - { - "name": "location_name", - "value": "DASLIA-_ALL_PARAS", - "source": "household.location_name" - }, - { - "name": "existing_location", - "value": "2fc43738-ace5-g961-8e8f-ab7dg0e5bc63", - "source": "household.existing_location" - }, - { - "name": "existing_Country", - "value": "Bangladesh", - "source": "household.existing_Country" - }, - { - "name": "existing_Division", - "value": "RANGPUR", - "source": "household.existing_Division" - }, - { - "name": "existing_District", - "value": "GAIBANDHA", - "source": "household.existing_District" - }, - { - "name": "existing_Upazilla", - "value": "SADULLAPUR", - "source": "household.existing_Upazilla" - }, - { - "name": "existing_Union", - "value": "NALDANGA", - "source": "household.existing_Union" - }, - { - "name": "existing_Ward", - "value": "Ward-3", - "source": "household.existing_Ward" - }, - { - "name": "existing_Subunit", - "value": "3-KHA", - "source": "household.existing_Subunit" - }, - { - "name": "existing_Mauzapara", - "value": "DASLIA+-+ALL+PARAS", - "source": "household.existing_Mauzapara" - }, - { - "name": "today", - "value": "2015-10-11", - "source": "household.today" - }, - { - "name": "start", - "value": "2015-10-11T17:12:34.000+06:00", - "source": "household.start" - }, - { - "name": "end", - "value": "2015-10-11T17:12:34.000+06:00", - "source": "household.end" - }, - { - "name": "FWNHREGDATE", - "value": "2015-10-11", - "source": "household.FWNHREGDATE" - }, - { - "name": "FWGOBHHID", - "value": "2322", - "source": "household.FWGOBHHID" - }, - { - "name": "FWJIVHHID", - "value": "9889", - "source": "household.FWJIVHHID" - }, - { - "name": "FWCOUNTRY", - "value": "Bangladesh", - "source": "household.FWCOUNTRY" - }, - { - "name": "FWDIVISION", - "value": "RANGPUR", - "source": "household.FWDIVISION" - }, - { - "name": "FWDISTRICT", - "value": "GAIBANDHA", - "source": "household.FWDISTRICT" - }, - { - "name": "FWUPAZILLA", - "value": "SADULLAPUR", - "source": "household.FWUPAZILLA" - }, - { - "name": "FWUNION", - "value": "NALDANGA", - "source": "household.FWUNION" - }, - { - "name": "FWWARD", - "value": "Ward-3", - "source": "household.FWWARD" - }, - { - "name": "FWSUBUNIT", - "value": "3-KHA", - "source": "household.FWSUBUNIT" - }, - { - "name": "FWMAUZA_PARA", - "value": "DASLIA+-+ALL+PARAS", - "source": "household.FWMAUZA_PARA" - }, - { - "name": "FWNHHHGPS", - "value": "23.8002 90.4068 0 10", - "source": "household.FWNHHHGPS" - }, - { - "name": "FWHOHFNAME", - "value": "mango", - "source": "household.FWHOHFNAME" - }, - { - "name": "FWHOHLNAME", - "value": ".", - "source": "household.FWHOHLNAME" - }, - { - "name": "FWHOHBIRTHDATE", - "value": "1900-01-01", - "source": "household.FWHOHBIRTHDATE" - }, - { - "name": "FWHOHGENDER", - "value": "2", - "source": "household.FWHOHGENDER" - }, - { - "name": "FWNHHMBRNUM", - "value": "23", - "source": "household.FWNHHMBRNUM" - }, - { - "name": "FWNHHMWRA", - "value": "1", - "source": "household.FWNHHMWRA" - }, - { - "name": "join_names", - "value": "hoby", - "source": "household.join_names" - }, - { - "name": "MWRA", - "value": "1", - "source": "household.MWRA" - } - ], - "sub_forms": [ - { - "name": "elco_registration", - "bind_type": "elco", - "default_bind_path": "/model/instance/FWNewHH/woman", - "fields": [ - { - "name": "id", - "source": "elco.id" - }, - { - "name": "relationalid", - "source": "elco.relationalid" - }, - { - "name": "WomanREGDATE", - "source": "elco.WomanREGDATE" - }, - { - "name": "GOBHHID", - "source": "elco.GOBHHID" - }, - { - "name": "JiVitAHHID", - "source": "elco.JiVitAHHID" - }, - { - "name": "FWWOMFNAME", - "source": "elco.FWWOMFNAME" - }, - { - "name": "FWWOMLNAME", - "source": "elco.FWWOMLNAME" - }, - { - "name": "FWBIRTHDATE", - "source": "elco.FWBIRTHDATE" - }, - { - "name": "FWGENDER", - "source": "elco.FWGENDER" - }, - { - "name": "FWWOMAGE", - "source": "elco.FWWOMAGE" - }, - { - "name": "display_age", - "source": "elco.display_age" - }, - { - "name": "FWNHWOMSTRMEN", - "source": "elco.FWNHWOMSTRMEN" - }, - { - "name": "FWNHWOMHUSALV", - "source": "elco.FWNHWOMHUSALV" - }, - { - "name": "FWNHWOMHUSLIV", - "source": "elco.FWNHWOMHUSLIV" - }, - { - "name": "FWNHWOMHUSSTR", - "source": "elco.FWNHWOMHUSSTR" - }, - { - "name": "FWELIGIBLE", - "source": "elco.FWELIGIBLE" - }, - { - "name": "FWWOMANYID", - "source": "elco.FWWOMANYID" - }, - { - "name": "FWWOMNID", - "source": "elco.FWWOMNID" - }, - { - "name": "FWWOMRETYPENID", - "source": "elco.FWWOMRETYPENID" - }, - { - "name": "FWWOMBID", - "source": "elco.FWWOMBID" - }, - { - "name": "FWWOMRETYPEBID", - "source": "elco.FWWOMRETYPEBID" - }, - { - "name": "FWHUSNAME", - "source": "elco.FWHUSNAME" - }, - { - "name": "FWWOMCOUNTRY", - "source": "elco.FWWOMCOUNTRY" - }, - { - "name": "FWWOMDIVISION", - "source": "elco.FWWOMDIVISION" - }, - { - "name": "FWWOMDISTRICT", - "source": "elco.FWWOMDISTRICT" - }, - { - "name": "FWWOMUPAZILLA", - "source": "elco.FWWOMUPAZILLA" - }, - { - "name": "FWWOMUNION", - "source": "elco.FWWOMUNION" - }, - { - "name": "FWWOMWARD", - "source": "elco.FWWOMWARD" - }, - { - "name": "FWWOMSUBUNIT", - "source": "elco.FWWOMSUBUNIT" - }, - { - "name": "FWWOMMAUZA_PARA", - "source": "elco.FWWOMMAUZA_PARA" - }, - { - "name": "FWWOMGOBHHID", - "source": "elco.FWWOMGOBHHID" - }, - { - "name": "FWWOMGPS", - "source": "elco.FWWOMGPS" - } - ], - "instances": [ - { - "GOBHHID": "2322", - "JiVitAHHID": "9889", - "WomanREGDATE": "2015-10-11", - "FWWOMFNAME": "jackfruit", - "FWWOMLNAME": ".", - "FWBIRTHDATE": "1988-10-08", - "FWGENDER": "female", - "FWWOMAGE": "27", - "display_age": "", - "FWNHWOMSTRMEN": "0", - "FWNHWOMHUSLIV": "1", - "FWNHWOMHUSALV": "", - "FWNHWOMHUSSTR": "0", - "FWELIGIBLE": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "FWWOMANYID": "1 2", - "FWWOMNID": "7675788777775", - "FWWOMRETYPENID": "7675788777775", - "FWWOMBID": "98899998888888888", - "FWWOMRETYPEBID": "98899998888888888", - "FWHUSNAME": "zoom", - "FWWOMCOUNTRY": "Bangladesh", - "FWWOMDIVISION": "RANGPUR", - "FWWOMDISTRICT": "GAIBANDHA", - "FWWOMUPAZILLA": "SADULLAPUR", - "FWWOMUNION": "NALDANGA", - "FWWOMWARD": "Ward-3", - "FWWOMSUBUNIT": "3-KHA", - "FWWOMMAUZA_PARA": "DASLIA+-+ALL+PARAS", - "FWWOMGOBHHID": "2322", - "FWWOMGPS": "23.8002 90.4068 0 10", - "id": "ce71572a-8oc5-u32f-9d3b-4a6b568d5g77" - } - ] - } - ] + "id": "5ec11f03071ef0929839079530028992", + "_rev": "2-ddf675dd499e017538671b94843aeefc", + "type": "FormSubmission", + "anmId": "opensrp", + "instanceId": "d304dbr7-3998-434f-8c5b-55d6f5fa4252", + "formName": "new_household_registration_with_grouped_subform_data", + "entityId": "4237d267-d438-49f2-7822-8968t555447c", + "clientVersion": 1444562091545, + "formDataDefinitionVersion": "12", + "formInstance": { + "form_data_definition_version": "12", + "form": { + "bind_type": "household", + "default_bind_path": "/model/instance/FWNewHH", + "fields": [ + { + "name": "id", + "value": "4237d267-d438-49f2-7822-8968t555447c", + "source": "household.id" + }, + { + "name": "location_name", + "value": "DASLIA-_ALL_PARAS", + "source": "household.location_name" + }, + { + "name": "existing_location", + "value": "2fc43738-ace5-g961-8e8f-ab7dg0e5bc63", + "source": "household.existing_location" + }, + { + "name": "existing_Country", + "value": "Bangladesh", + "source": "household.existing_Country" + }, + { + "name": "existing_Division", + "value": "RANGPUR", + "source": "household.existing_Division" + }, + { + "name": "existing_District", + "value": "GAIBANDHA", + "source": "household.existing_District" + }, + { + "name": "existing_Upazilla", + "value": "SADULLAPUR", + "source": "household.existing_Upazilla" + }, + { + "name": "existing_Union", + "value": "NALDANGA", + "source": "household.existing_Union" + }, + { + "name": "existing_Ward", + "value": "Ward-3", + "source": "household.existing_Ward" + }, + { + "name": "existing_Subunit", + "value": "3-KHA", + "source": "household.existing_Subunit" + }, + { + "name": "existing_Mauzapara", + "value": "DASLIA+-+ALL+PARAS", + "source": "household.existing_Mauzapara" + }, + { + "name": "today", + "value": "2015-10-11", + "source": "household.today" + }, + { + "name": "start", + "value": "2015-10-11T17:12:34.000+06:00", + "source": "household.start" + }, + { + "name": "end", + "value": "2015-10-11T17:12:34.000+06:00", + "source": "household.end" + }, + { + "name": "FWNHREGDATE", + "value": "2015-10-11", + "source": "household.FWNHREGDATE" + }, + { + "name": "FWGOBHHID", + "value": "2322", + "source": "household.FWGOBHHID" + }, + { + "name": "FWJIVHHID", + "value": "9889", + "source": "household.FWJIVHHID" + }, + { + "name": "FWCOUNTRY", + "value": "Bangladesh", + "source": "household.FWCOUNTRY" + }, + { + "name": "FWDIVISION", + "value": "RANGPUR", + "source": "household.FWDIVISION" + }, + { + "name": "FWDISTRICT", + "value": "GAIBANDHA", + "source": "household.FWDISTRICT" + }, + { + "name": "FWUPAZILLA", + "value": "SADULLAPUR", + "source": "household.FWUPAZILLA" + }, + { + "name": "FWUNION", + "value": "NALDANGA", + "source": "household.FWUNION" + }, + { + "name": "FWWARD", + "value": "Ward-3", + "source": "household.FWWARD" + }, + { + "name": "FWSUBUNIT", + "value": "3-KHA", + "source": "household.FWSUBUNIT" + }, + { + "name": "FWMAUZA_PARA", + "value": "DASLIA+-+ALL+PARAS", + "source": "household.FWMAUZA_PARA" + }, + { + "name": "FWNHHHGPS", + "value": "23.8002 90.4068 0 10", + "source": "household.FWNHHHGPS" + }, + { + "name": "FWHOHFNAME", + "value": "mango", + "source": "household.FWHOHFNAME" + }, + { + "name": "FWHOHLNAME", + "value": ".", + "source": "household.FWHOHLNAME" + }, + { + "name": "FWHOHBIRTHDATE", + "value": "1900-01-01", + "source": "household.FWHOHBIRTHDATE" + }, + { + "name": "FWHOHGENDER", + "value": "2", + "source": "household.FWHOHGENDER" + }, + { + "name": "FWNHHMBRNUM", + "value": "23", + "source": "household.FWNHHMBRNUM" + }, + { + "name": "FWNHHMWRA", + "value": "1", + "source": "household.FWNHHMWRA" + }, + { + "name": "join_names", + "value": "hoby", + "source": "household.join_names" + }, + { + "name": "MWRA", + "value": "1", + "source": "household.MWRA" } - }, - "serverVersion": 1444734863350 + ], + "sub_forms": [ + { + "name": "elco_registration", + "bind_type": "elco", + "default_bind_path": "/model/instance/FWNewHH/woman", + "fields": [ + { + "name": "id", + "source": "elco.id" + }, + { + "name": "relationalid", + "source": "elco.relationalid" + }, + { + "name": "WomanREGDATE", + "source": "elco.WomanREGDATE" + }, + { + "name": "GOBHHID", + "source": "elco.GOBHHID" + }, + { + "name": "JiVitAHHID", + "source": "elco.JiVitAHHID" + }, + { + "name": "FWWOMFNAME", + "source": "elco.FWWOMFNAME" + }, + { + "name": "FWWOMLNAME", + "source": "elco.FWWOMLNAME" + }, + { + "name": "FWBIRTHDATE", + "source": "elco.FWBIRTHDATE" + }, + { + "name": "FWGENDER", + "source": "elco.FWGENDER" + }, + { + "name": "FWWOMAGE", + "source": "elco.FWWOMAGE" + }, + { + "name": "display_age", + "source": "elco.display_age" + }, + { + "name": "FWNHWOMSTRMEN", + "source": "elco.FWNHWOMSTRMEN" + }, + { + "name": "FWNHWOMHUSALV", + "source": "elco.FWNHWOMHUSALV" + }, + { + "name": "FWNHWOMHUSLIV", + "source": "elco.FWNHWOMHUSLIV" + }, + { + "name": "FWNHWOMHUSSTR", + "source": "elco.FWNHWOMHUSSTR" + }, + { + "name": "FWELIGIBLE", + "source": "elco.FWELIGIBLE" + }, + { + "name": "FWWOMANYID", + "source": "elco.FWWOMANYID" + }, + { + "name": "FWWOMNID", + "source": "elco.FWWOMNID" + }, + { + "name": "FWWOMRETYPENID", + "source": "elco.FWWOMRETYPENID" + }, + { + "name": "FWWOMBID", + "source": "elco.FWWOMBID" + }, + { + "name": "FWWOMRETYPEBID", + "source": "elco.FWWOMRETYPEBID" + }, + { + "name": "FWHUSNAME", + "source": "elco.FWHUSNAME" + }, + { + "name": "FWWOMCOUNTRY", + "source": "elco.FWWOMCOUNTRY" + }, + { + "name": "FWWOMDIVISION", + "source": "elco.FWWOMDIVISION" + }, + { + "name": "FWWOMDISTRICT", + "source": "elco.FWWOMDISTRICT" + }, + { + "name": "FWWOMUPAZILLA", + "source": "elco.FWWOMUPAZILLA" + }, + { + "name": "FWWOMUNION", + "source": "elco.FWWOMUNION" + }, + { + "name": "FWWOMWARD", + "source": "elco.FWWOMWARD" + }, + { + "name": "FWWOMSUBUNIT", + "source": "elco.FWWOMSUBUNIT" + }, + { + "name": "FWWOMMAUZA_PARA", + "source": "elco.FWWOMMAUZA_PARA" + }, + { + "name": "FWWOMGOBHHID", + "source": "elco.FWWOMGOBHHID" + }, + { + "name": "FWWOMGPS", + "source": "elco.FWWOMGPS" + } + ], + "instances": [ + { + "GOBHHID": "2322", + "JiVitAHHID": "9889", + "WomanREGDATE": "2015-10-11", + "FWWOMFNAME": "jackfruit", + "FWWOMLNAME": ".", + "FWBIRTHDATE": "1988-10-08", + "FWGENDER": "female", + "FWWOMAGE": "27", + "display_age": "", + "FWNHWOMSTRMEN": "0", + "FWNHWOMHUSLIV": "1", + "FWNHWOMHUSALV": "", + "FWNHWOMHUSSTR": "0", + "FWELIGIBLE": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "FWWOMANYID": "1 2", + "FWWOMNID": "7675788777775", + "FWWOMRETYPENID": "7675788777775", + "FWWOMBID": "98899998888888888", + "FWWOMRETYPEBID": "98899998888888888", + "FWHUSNAME": "zoom", + "FWWOMCOUNTRY": "Bangladesh", + "FWWOMDIVISION": "RANGPUR", + "FWWOMDISTRICT": "GAIBANDHA", + "FWWOMUPAZILLA": "SADULLAPUR", + "FWWOMUNION": "NALDANGA", + "FWWOMWARD": "Ward-3", + "FWWOMSUBUNIT": "3-KHA", + "FWWOMMAUZA_PARA": "DASLIA+-+ALL+PARAS", + "FWWOMGOBHHID": "2322", + "FWWOMGPS": "23.8002 90.4068 0 10", + "id": "ce71572a-8oc5-u32f-9d3b-4a6b568d5g77" + } + ] + } + ] + } + }, + "serverVersion": 1444734863350 } \ No newline at end of file diff --git a/src/test/resources/form/new_household_registration_with_grouped_subform_data/model.xml b/src/test/resources/form/new_household_registration_with_grouped_subform_data/model.xml index 49e8d0508..df99899b2 100644 --- a/src/test/resources/form/new_household_registration_with_grouped_subform_data/model.xml +++ b/src/test/resources/form/new_household_registration_with_grouped_subform_data/model.xml @@ -1,83 +1,103 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2000-01-02 00:00:00 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FWA - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2000-01-02 00:00:00 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FWA + + + + - - \ No newline at end of file + + \ No newline at end of file diff --git a/src/test/resources/form/offsite_child_followup/form.json b/src/test/resources/form/offsite_child_followup/form.json index 03c91a805..f298e47ba 100644 --- a/src/test/resources/form/offsite_child_followup/form.json +++ b/src/test/resources/form/offsite_child_followup/form.json @@ -1 +1,4171 @@ -{"name":"Offsite_Child_Vaccination_Followup","title":"دوسرے سینٹر میں رجسٹرڈ بچّوں کا فالو اپ رجسٹر برائے ٹیکاجات - Off Site Child Follow Up Vaccination Register","sms_keyword":"offsite_child_vaccination_followup","default_language":"English","choices":{"provinces":[{"name":"kpk","label":{"Urdu":"خیبر پختون خواہ","English":"Khyber Pakhtunkhwa","Roman Urdu":"Khyber Pakhtunkhwa"}},{"name":"sindh","label":{"Urdu":"سندھ","English":"Sindh","Roman Urdu":"Sindh"}},{"name":"balochistan","label":{"Urdu":"بلوچستان","English":"Balochistan","Roman Urdu":"Balochistan"}},{"name":"punjab","label":{"Urdu":"پنجاب","English":"Punjab","Roman Urdu":"Punjab"}},{"name":"gilgit_baltistan","label":{"Urdu":"گلگت بلتستان","English":"Gilgit Baltistan","Roman Urdu":"Gilgit Baltistan"}},{"name":"kashmir","label":{"Urdu":"کشمیر","English":"Kashmir","Roman Urdu":"Kashmir"}},{"name":"fata","label":{"Urdu":"فاٹا","English":"FATA","Roman Urdu":"FATA"}},{"name":"out_of_country","label":{"Urdu":"ملک سے باہر","English":"Out of Country","Roman Urdu":"Out of Country"}}],"ucs":[{"province":"sindh","city":"karachi","town":"korangi","name":"bilal_colony","label":{"Urdu":"بلال کالونی","Roman Urdu":"Bilal Colony","English":"Bilal Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"nasir_colony","label":{"Urdu":"ناصر کالونی","Roman Urdu":"Nasir Colony","English":"Nasir Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"chakra_goth","label":{"Urdu":"چکرا گوٹھ","Roman Urdu":"Chakra Goth","English":"Chakra Goth"}},{"province":"sindh","city":"karachi","town":"korangi","name":"mustafa_taj_colony","label":{"Urdu":"مصطفی تاج کالونی","Roman Urdu":"Mustafa Taj Colony","English":"Mustafa Taj Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"hundred_quarters","label":{"Urdu":"ہنڈریڈ کوارٹر","Roman Urdu":"Hundred Quarters","English":"Hundred Quarters"}},{"province":"sindh","city":"karachi","town":"korangi","name":"gulzar_colony","label":{"Urdu":"گلزار کالونی","Roman Urdu":"Gulzar Colony","English":"Gulzar Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"korangi_sector_33","label":{"Urdu":"کورنگی سیکٹر 33","Roman Urdu":"Korangi Sector 33","English":"Korangi Sector 33"}},{"province":"sindh","city":"karachi","town":"korangi","name":"zaman_town","label":{"Urdu":"زمان ٹاوَن","Roman Urdu":"Zaman Town","English":"Zaman Town"}},{"province":"sindh","city":"karachi","town":"korangi","name":"hasrat_mohani_colony","label":{"Urdu":"حسرت موہانی کالونی","Roman Urdu":"Hasrat Mohani Colony","English":"Hasrat Mohani Colony"}},{"province":"sindh","city":"karachi","town":"baldia","name":"gulshan_e_ghazi","label":{"Urdu":"گلشن غازی","Roman Urdu":"Gulshan-e-Ghazi","English":"Gulshan-e-Ghazi"}},{"province":"sindh","city":"karachi","town":"baldia","name":"ittehad_town","label":{"Urdu":"اتحاد ٹاوَن","Roman Urdu":"Ittehad Town","English":"Ittehad Town"}},{"province":"sindh","city":"karachi","town":"baldia","name":"islam_nagar","label":{"Urdu":"اسلام نگر","Roman Urdu":"Islam Nagar","English":"Islam Nagar"}},{"province":"sindh","city":"karachi","town":"baldia","name":"nai_abadi","label":{"Urdu":"نئی آبادی","Roman Urdu":"Nai Abadi","English":"Nai Abadi"}},{"province":"sindh","city":"karachi","town":"baldia","name":"saeedabad","label":{"Urdu":"سعید آباد","Roman Urdu":"Saeedabad","English":"Saeedabad"}},{"province":"sindh","city":"karachi","town":"baldia","name":"muslim_mujahid_colony","label":{"Urdu":"مسلم مجاہد کالونی","Roman Urdu":"Muslim Mujahid Colony","English":"Muslim Mujahid Colony"}},{"province":"sindh","city":"karachi","town":"baldia","name":"muhajir_camp","label":{"Urdu":"مہاجر کیمپ","Roman Urdu":"Muhajir Camp","English":"Muhajir Camp"}},{"province":"sindh","city":"karachi","town":"baldia","name":"rasheedabad","label":{"Urdu":"رشید آباد","Roman Urdu":"Rasheedabad","English":"Rasheedabad"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"ibrahim_hyderi","label":{"Urdu":"ابراہیم حیدری","Roman Urdu":"Ibrahim Hyderi","English":"Ibrahim Hyderi"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"rehri","label":{"Urdu":"رہڑی","Roman Urdu":"Rehri","English":"Rehri"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"cattle_colony","label":{"Urdu":"کیٹل کالونی","Roman Urdu":"Cattle Colony","English":"Cattle Colony"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"qaidabad","label":{"Urdu":"قائدآباد","Roman Urdu":"Qaidabad","English":"Qaidabad"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"landhi_colony","label":{"Urdu":"لانڈھی کالونی","Roman Urdu":"Landhi Colony","English":"Landhi Colony"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"gulshan_e_hadeed","label":{"Urdu":"گلشن حدید","Roman Urdu":"Gulshan-e-Hadeed","English":"Gulshan-e-Hadeed"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"gaghar","label":{"Urdu":"گگر","Roman Urdu":"Gaghar","English":"Gaghar"}},{"province":"sindh","city":"karachi","town":"gadap","name":"murad_memon_goth","label":{"Urdu":"مراد میمن گوٹھ","Roman Urdu":"Murad Memon Goth","English":"Murad Memon Goth"}},{"province":"sindh","city":"karachi","town":"gadap","name":"darsano_chana","label":{"Urdu":"درشانو شنو","Roman Urdu":"Darsano Chana","English":"Darsano Chana"}},{"province":"sindh","city":"karachi","town":"gadap","name":"gujro","label":{"Urdu":"گجرو","Roman Urdu":"Gujro","English":"Gujro"}},{"province":"sindh","city":"karachi","town":"gadap","name":"songal","label":{"Urdu":"سنگل","Roman Urdu":"Songal","English":"Songal"}},{"province":"sindh","city":"karachi","town":"gadap","name":"maymarabad","label":{"Urdu":"معمار آباد","Roman Urdu":"Maymarabad","English":"Maymarabad"}},{"province":"sindh","city":"karachi","town":"gadap","name":"yousuf_goth","label":{"Urdu":"یوسف گوٹھ","Roman Urdu":"Yousuf Goth","English":"Yousuf Goth"}},{"province":"sindh","city":"karachi","town":"gadap","name":"manghopir","label":{"Urdu":"منگھوپیر","Roman Urdu":"Manghopir","English":"Manghopir"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"azizabad","label":{"Urdu":"عزیز آباد","Roman Urdu":"Azizabad","English":"Azizabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"karimabad","label":{"Urdu":"کریم آباد","Roman Urdu":"Karimabad","English":"Karimabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"aisha_manzil","label":{"Urdu":"عائشہ منزل","Roman Urdu":"Aisha Manzil","English":"Aisha Manzil"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"ancholi","label":{"Urdu":"انچولی","Roman Urdu":"Ancholi","English":"Ancholi"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"naseerabad","label":{"Urdu":"نصیرآباد","Roman Urdu":"Naseerabad","English":"Naseerabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"yaseenabad","label":{"Urdu":"یاسین آباد","Roman Urdu":"Yaseenabad","English":"Yaseenabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"water_pump","label":{"Urdu":"واٹرپمپ","Roman Urdu":"Water Pump","English":"Water Pump"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"shafiq_mill_colony","label":{"Urdu":"شفیق مل کالونی","Roman Urdu":"Shafiq Mill Colony","English":"Shafiq Mill Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"delhi_mercantile_society","label":{"Urdu":"دہلی مرچنٹائل سوسائٹی","Roman Urdu":"Delhi Mercantile Society","English":"Delhi Mercantile Society"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"civic_centre","label":{"Urdu":"سوک سینٹر","Roman Urdu":"Civic Centre","English":"Civic Centre"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"pir_ilahi_buksh_colony","label":{"Urdu":"پیر الہی بخش کالونی","Roman Urdu":"Pir Ilahi Buksh Colony","English":"Pir Ilahi Buksh Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"essa_nagri","label":{"Urdu":"عیسی نگری","Roman Urdu":"Essa Nagri","English":"Essa Nagri"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulshan_e_iqbal","label":{"Urdu":"گلشن اقبال","Roman Urdu":"Gulshan-e-Iqbal","English":"Gulshan-e-Iqbal"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gillani_railway_station","label":{"Urdu":"گیلانی ریلوے اسٹیشن","Roman Urdu":"Gillani Railway Station","English":"Gillani Railway Station"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"shanti_nagar","label":{"Urdu":"شانتی نگر","Roman Urdu":"Shanti Nagar","English":"Shanti Nagar"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"jamali_colony","label":{"Urdu":"جمالی کالونی","Roman Urdu":"Jamali Colony","English":"Jamali Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulshan_e_iqbal_ii","label":{"Urdu":"گلشن اقبال 2","Roman Urdu":"Gulshan-e-Iqbal II","English":"Gulshan-e-Iqbal II"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"pehlwan_goth","label":{"Urdu":"پہلوان گوٹھ","Roman Urdu":"Pehlwan Goth","English":"Pehlwan Goth"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"matrovil_colony","label":{"Urdu":"میٹروویل کالونی","Roman Urdu":"Matrovil Colony","English":"Matrovil Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulzar_e_hijri","label":{"Urdu":"گلزار ہجری","Roman Urdu":"Gulzar-e-Hijri","English":"Gulzar-e-Hijri"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"safooran_goth","label":{"Urdu":"صفورا گوٹھ","Roman Urdu":"Safooran Goth","English":"Safooran Goth"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"akhtar_colony","label":{"Urdu":"اختر کالونی","Roman Urdu":"Akhtar Colony","English":"Akhtar Colony"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"manzoor_colony","label":{"Urdu":"منظور کالونی","Roman Urdu":"Manzoor Colony","English":"Manzoor Colony"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"azam_basti","label":{"Urdu":"اعظم بستی","Roman Urdu":"Azam Basti","English":"Azam Basti"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"chanesar_goth","label":{"Urdu":"چنیسر گوٹھ","Roman Urdu":"Chanesar Goth","English":"Chanesar Goth"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"mahmudabad","label":{"Urdu":"محمودآباد","Roman Urdu":"Mahmudabad","English":"Mahmudabad"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pechs","label":{"Urdu":"پی۔ای۔سی۔ایچ۔ایس","Roman Urdu":"P.E.C.H.S.","English":"P.E.C.H.S."}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pechs_ii","label":{"Urdu":"پی۔ای۔سی۔ایچ۔ایس 2","Roman Urdu":"P.E.C.H.S. II","English":"P.E.C.H.S. II"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"jut_line","label":{"Urdu":"جٹ لائن","Roman Urdu":"Jut Line","English":"Jut Line"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"central_jacob_lines","label":{"Urdu":"سینٹرل جیکب لائن","Roman Urdu":"Central Jacob Lines","English":"Central Jacob Lines"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"jamshed_quarters","label":{"Urdu":"جمشید کوارٹر","Roman Urdu":"Jamshed Quarters","English":"Jamshed Quarters"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"garden_east","label":{"Urdu":"گارڈن ایسٹ","Roman Urdu":"Garden East","English":"Garden East"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"soldier_bazar","label":{"Urdu":"سولجر بازار","Roman Urdu":"Soldier Bazar","English":"Soldier Bazar"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pakistan_quarters","label":{"Urdu":"پاکستان کوارٹر","Roman Urdu":"Pakistan Quarters","English":"Pakistan Quarters"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"bhutta_village","label":{"Urdu":"بھٹا ولیج","Roman Urdu":"Bhutta Village","English":"Bhutta Village"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"sultanabad","label":{"Urdu":"سلطان آباد","Roman Urdu":"Sultanabad","English":"Sultanabad"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"kiamari_uc","label":{"Urdu":"کیماری یو- سی","Roman Urdu":"Kiamari UC","English":"Kiamari UC"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"baba_bhit","label":{"Urdu":"بابا بھٹ","Roman Urdu":"Baba Bhit","English":"Baba Bhit"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"machar_colony","label":{"Urdu":"مچھر کالونی","Roman Urdu":"Machar Colony","English":"Machar Colony"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"maripur","label":{"Urdu":"ماڑی پور","Roman Urdu":"Maripur","English":"Maripur"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"shershah","label":{"Urdu":"شیرشاہ","Roman Urdu":"SherShah","English":"SherShah"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"gabo_pat","label":{"Urdu":"گابو پٹ","Roman Urdu":"Gabo Pat","English":"Gabo Pat"}},{"province":"sindh","city":"karachi","town":"landhi","name":"muzafarabad","label":{"Urdu":"مظفرآباد","Roman Urdu":"Muzafarabad","English":"Muzafarabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"muslimabad","label":{"Urdu":"مسلم آباد","Roman Urdu":"Muslimabad","English":"Muslimabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"dawood_chowrangi","label":{"Urdu":"داوَد چورنگی","Roman Urdu":"Dawood Chowrangi","English":"Dawood Chowrangi"}},{"province":"sindh","city":"karachi","town":"landhi","name":"moinabad","label":{"Urdu":"معین آباد","Roman Urdu":"Moinabad","English":"Moinabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"sharafi_goth","label":{"Urdu":"شرافی گوٹھ","Roman Urdu":"Sharafi Goth","English":"Sharafi Goth"}},{"province":"sindh","city":"karachi","town":"landhi","name":"bhutto_nagar","label":{"Urdu":"بھٹو نگر","Roman Urdu":"Bhutto Nagar","English":"Bhutto Nagar"}},{"province":"sindh","city":"karachi","town":"landhi","name":"khawaja_ajmeer_colony","label":{"Urdu":"خواجہ اجمیر کالونی","Roman Urdu":"Khawaja Ajmeer Colony","English":"Khawaja Ajmeer Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"landhi_uc","label":{"Urdu":"لانڈھی یوسی","Roman Urdu":"Landhi UC","English":"Landhi UC"}},{"province":"sindh","city":"karachi","town":"landhi","name":"awami_colony","label":{"Urdu":"عوامی کالونی","Roman Urdu":"Awami Colony","English":"Awami Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"burmee_colony","label":{"Urdu":"برمی کالونی","Roman Urdu":"Burmee Colony","English":"Burmee Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"korangi_uc","label":{"Urdu":"کورنگی یوسی","Roman Urdu":"Korangi UC","English":"Korangi UC"}},{"province":"sindh","city":"karachi","town":"landhi","name":"sherabad","label":{"Urdu":"شیرآباد","Roman Urdu":"Sherabad","English":"Sherabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"rizvia_society","label":{"Urdu":"رضویہ سوسائٹی","Roman Urdu":"Rizvia Society","English":"Rizvia Society"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"firdous_colony","label":{"Urdu":"فردوس کالونی","Roman Urdu":"Firdous Colony","English":"Firdous Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"super_market","label":{"Urdu":"سپر مارکیٹ","Roman Urdu":"Super Market","English":"Super Market"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"dak_khana","label":{"Urdu":"دک کھانہ","Roman Urdu":"Dak Khana","English":"Dak Khana"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"qasimabad","label":{"Urdu":"قاسم آباد","Roman Urdu":"Qasimabad","English":"Qasimabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"bandhani_colony","label":{"Urdu":"بندھانی کالونی","Roman Urdu":"Bandhani Colony","English":"Bandhani Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"sharifabad","label":{"Urdu":"شریف آباد","Roman Urdu":"Sharifabad","English":"Sharifabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"commercial_area","label":{"Urdu":"کمرشل ایریا","Roman Urdu":"Commercial Area","English":"Commercial Area"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"mujahid_colony","label":{"Urdu":"مجاہد کالونی","Roman Urdu":"Mujahid Colony","English":"Mujahid Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"nazimabad","label":{"Urdu":"ناظم آباد","Roman Urdu":"Nazimabad","English":"Nazimabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"abbasi_shaheed","label":{"Urdu":"عباسی شہید","Roman Urdu":"Abbasi Shaheed","English":"Abbasi Shaheed"}},{"province":"sindh","city":"karachi","town":"lyari","name":"agra_taj_colony","label":{"Urdu":"آگرہ تاج کالونی","Roman Urdu":"Agra Taj Colony","English":"Agra Taj Colony"}},{"province":"sindh","city":"karachi","town":"lyari","name":"daryaabad","label":{"Urdu":"دریاآباد","Roman Urdu":"Daryaabad","English":"Daryaabad"}},{"province":"sindh","city":"karachi","town":"lyari","name":"nawabad","label":{"Urdu":"نواآباد","Roman Urdu":"Nawabad","English":"Nawabad"}},{"province":"sindh","city":"karachi","town":"lyari","name":"khada_memon_society","label":{"Urdu":"خدا- میمن- سوساَٹی","Roman Urdu":"Khada Memon Society","English":"Khada Memon Society"}},{"province":"sindh","city":"karachi","town":"lyari","name":"baghdadi","label":{"Urdu":"بغدادی","Roman Urdu":"Baghdadi","English":"Baghdadi"}},{"province":"sindh","city":"karachi","town":"lyari","name":"shah_baig_line","label":{"Urdu":"شاھ باغ لائن","Roman Urdu":"Shah Baig Line","English":"Shah Baig Line"}},{"province":"sindh","city":"karachi","town":"lyari","name":"bihar_colony","label":{"Urdu":"بہار کالونی","Roman Urdu":"Bihar Colony","English":"Bihar Colony"}},{"province":"sindh","city":"karachi","town":"lyari","name":"ragiwara","label":{"Urdu":"راگی واڑا","Roman Urdu":"Ragiwara","English":"Ragiwara"}},{"province":"sindh","city":"karachi","town":"lyari","name":"singo_line","label":{"Urdu":"سنگولائن","Roman Urdu":"Singo Line","English":"Singo Line"}},{"province":"sindh","city":"karachi","town":"lyari","name":"chakiwara","label":{"Urdu":"چاکی واڑا","Roman Urdu":"Chakiwara","English":"Chakiwara"}},{"province":"sindh","city":"karachi","town":"lyari","name":"allama_iqbal_colony","label":{"Urdu":"علامہ اقبال کالونی","Roman Urdu":"Allama Iqbal Colony","English":"Allama Iqbal Colony"}},{"province":"sindh","city":"karachi","town":"malir","name":"model_colony","label":{"Urdu":"موڈل کالونی","Roman Urdu":"Model Colony","English":"Model Colony"}},{"province":"sindh","city":"karachi","town":"malir","name":"kala_board","label":{"Urdu":"کالا بورڈ","Roman Urdu":"Kala Board","English":"Kala Board"}},{"province":"sindh","city":"karachi","town":"malir","name":"saudabad","label":{"Urdu":"سعودآباد","Roman Urdu":"Saudabad","English":"Saudabad"}},{"province":"sindh","city":"karachi","town":"malir","name":"khokhra_par","label":{"Urdu":"کھوکھرا پار","Roman Urdu":"Khokhra Par","English":"Khokhra Par"}},{"province":"sindh","city":"karachi","town":"malir","name":"jafar_e_tayyar","label":{"Urdu":"جعفر تیار","Roman Urdu":"Jafar-e-Tayyar","English":"Jafar-e-Tayyar"}},{"province":"sindh","city":"karachi","town":"malir","name":"gharibabad","label":{"Urdu":"غریب آباد","Roman Urdu":"Gharibabad","English":"Gharibabad"}},{"province":"sindh","city":"karachi","town":"malir","name":"ghazi_brohi_goth","label":{"Urdu":"غازی بروہی گوٹھ","Roman Urdu":"Ghazi Brohi Goth","English":"Ghazi Brohi Goth"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"kalyana","label":{"Urdu":"کالیانہ","Roman Urdu":"Kalyana","English":"Kalyana"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"sir_syed_colony","label":{"Urdu":"سر سید کالونی","Roman Urdu":"Sir Syed Colony","English":"Sir Syed Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"fatima_jinnah_colony","label":{"Urdu":"فاطمہ جناح کالونی","Roman Urdu":"Fatima Jinnah Colony","English":"Fatima Jinnah Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"godhra","label":{"Urdu":"گودھرا","Roman Urdu":"Godhra","English":"Godhra"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"abu_zar_ghaffari","label":{"Urdu":"ابو زر غفاری","Roman Urdu":"Abu Zar Ghaffari","English":"Abu Zar Ghaffari"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"hakim_ahsan","label":{"Urdu":"حاکم احسان","Roman Urdu":"Hakim Ahsan","English":"Hakim Ahsan"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"madina_colony","label":{"Urdu":"مدینہ کالونی","Roman Urdu":"Madina Colony","English":"Madina Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"faisal_colony","label":{"Urdu":"فیصل کالونی","Roman Urdu":"Faisal Colony","English":"Faisal Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"khamiso_goth","label":{"Urdu":"خمیسو گوٹھ","Roman Urdu":"Khamiso Goth","English":"Khamiso Goth"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"mustufa_colony","label":{"Urdu":"مصطفی کالونی","Roman Urdu":"Mustufa Colony","English":"Mustufa Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"khawaja_ajmeer_nagri","label":{"Urdu":"خواجہ اجمیر نگری","Roman Urdu":"Khawaja Ajmeer Nagri","English":"Khawaja Ajmeer Nagri"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"gulshan_e_saeed","label":{"Urdu":"گلشن سعید","Roman Urdu":"Gulshan-e-Saeed","English":"Gulshan-e-Saeed"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"shah_nawaz_bhutto_colony","label":{"Urdu":"شاہ نواز بھٹو کالونی","Roman Urdu":"Shah Nawaz Bhutto Colony","English":"Shah Nawaz Bhutto Colony"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"paposh_nagar","label":{"Urdu":"پاپوش نگر","Roman Urdu":"Paposh Nagar","English":"Paposh Nagar"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"pahar_ganj","label":{"Urdu":"پہاڑ گنج","Roman Urdu":"Pahar Ganj","English":"Pahar Ganj"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"khandu_goth","label":{"Urdu":"کھنڑو گوٹھ","Roman Urdu":"Khandu Goth","English":"Khandu Goth"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"hyderi","label":{"Urdu":"حیدری","Roman Urdu":"Hyderi","English":"Hyderi"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"sakhi_hassan","label":{"Urdu":"سخی حسن","Roman Urdu":"Sakhi Hassan","English":"Sakhi Hassan"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"farooq_e_azam","label":{"Urdu":"فاروق اعظم","Roman Urdu":"Farooq-e-Azam","English":"Farooq-e-Azam"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"nusrat_bhutto_colony","label":{"Urdu":"نصرت بھٹو کالونی","Roman Urdu":"Nusrat Bhutto Colony","English":"Nusrat Bhutto Colony"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"shadman_town","label":{"Urdu":"شادمان ٹاوَن","Roman Urdu":"Shadman Town","English":"Shadman Town"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"buffer_zone","label":{"Urdu":"بفرزون","Roman Urdu":"Buffer Zone","English":"Buffer Zone"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"buffer_zone_ii","label":{"Urdu":"بفرزون 2","Roman Urdu":"Buffer Zone II","English":"Buffer Zone II"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mominabad","label":{"Urdu":"مومن آباد","Roman Urdu":"Mominabad","English":"Mominabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"haryana_colony","label":{"Urdu":"حریانہ کالونی","Roman Urdu":"Haryana Colony","English":"Haryana Colony"}},{"province":"sindh","city":"karachi","town":"orangi","name":"hanifabad","label":{"Urdu":"حنیف آباد","Roman Urdu":"Hanifabad","English":"Hanifabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mohammad_nagar","label":{"Urdu":"محمد نگر","Roman Urdu":"Mohammad Nagar","English":"Mohammad Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"madina_colony_orangi","label":{"Urdu":"مدینہ کالونی اورنگی","Roman Urdu":"Madina Colony Orangi","English":"Madina Colony Orangi"}},{"province":"sindh","city":"karachi","town":"orangi","name":"ghaziabad","label":{"Urdu":"غازی آباد","Roman Urdu":"Ghaziabad","English":"Ghaziabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"chisti_nagar","label":{"Urdu":"چشتی نگر","Roman Urdu":"Chisti Nagar","English":"Chisti Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"bilal_colony_orangi","label":{"Urdu":"بلال کالونی اورنگی","Roman Urdu":"Bilal Colony Orangi","English":"Bilal Colony Orangi"}},{"province":"sindh","city":"karachi","town":"orangi","name":"iqbal_baloch_colony","label":{"Urdu":"اقبال بلوچ کالونی","Roman Urdu":"Iqbal Baloch Colony","English":"Iqbal Baloch Colony"}},{"province":"sindh","city":"karachi","town":"orangi","name":"ghabool_town","label":{"Urdu":"گبول ٹاوَن","Roman Urdu":"Ghabool Town","English":"Ghabool Town"}},{"province":"sindh","city":"karachi","town":"orangi","name":"data_nagar","label":{"Urdu":"داتا نگر","Roman Urdu":"Data Nagar","English":"Data Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mujahidabad","label":{"Urdu":"مجاہد آباد","Roman Urdu":"Mujahidabad","English":"Mujahidabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"baloch_goth","label":{"Urdu":"بلوچ گوٹھ","Roman Urdu":"Baloch Goth","English":"Baloch Goth"}},{"province":"sindh","city":"karachi","town":"saddar","name":"old_haji_camp","label":{"Urdu":"پرانہ حاجی کیمپ","Roman Urdu":"Old Haji Camp","English":"Old Haji Camp"}},{"province":"sindh","city":"karachi","town":"saddar","name":"garden","label":{"Urdu":"گارڈن","Roman Urdu":"Garden","English":"Garden"}},{"province":"sindh","city":"karachi","town":"saddar","name":"kharadar","label":{"Urdu":"کھارادر","Roman Urdu":"Kharadar","English":"Kharadar"}},{"province":"sindh","city":"karachi","town":"saddar","name":"city_railway_colony","label":{"Urdu":"سٹی ریلوے کالونی","Roman Urdu":"City Railway Colony","English":"City Railway Colony"}},{"province":"sindh","city":"karachi","town":"saddar","name":"nanak_wara","label":{"Urdu":"ناناک واڑا","Roman Urdu":"Nanak Wara","English":"Nanak Wara"}},{"province":"sindh","city":"karachi","town":"saddar","name":"gazdarabad","label":{"Urdu":"گزدرآباد","Roman Urdu":"Gazdarabad","English":"Gazdarabad"}},{"province":"sindh","city":"karachi","town":"saddar","name":"millat_nagar_islam_pura","label":{"Urdu":"ملت نگر اسلام پورا","Roman Urdu":"Millat Nagar/Islam Pura","English":"Millat Nagar/Islam Pura"}},{"province":"sindh","city":"karachi","town":"saddar","name":"saddar_uc","label":{"Urdu":"صدر یو سی","Roman Urdu":"Saddar UC","English":"Saddar UC"}},{"province":"sindh","city":"karachi","town":"saddar","name":"civil_line","label":{"Urdu":"سول لائن","Roman Urdu":"Civil Line","English":"Civil Line"}},{"province":"sindh","city":"karachi","town":"saddar","name":"clifton","label":{"Urdu":"کلفٹن","Roman Urdu":"Clifton","English":"Clifton"}},{"province":"sindh","city":"karachi","town":"saddar","name":"kehkashan","label":{"Urdu":"کہکشان","Roman Urdu":"Kehkashan","English":"Kehkashan"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"natha_khan_goth","label":{"Urdu":"ناتھا خان گوٹھ","Roman Urdu":"Natha Khan Goth","English":"Natha Khan Goth"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"pak_sadat_colony","label":{"Urdu":"پاک صدر کالونی","Roman Urdu":"Pak Sadat Colony","English":"Pak Sadat Colony"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"drigh_colony","label":{"Urdu":"ڈرگ کالونی","Roman Urdu":"Drigh Colony","English":"Drigh Colony"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"raita_plot","label":{"Urdu":"رائتا پلاٹ","Roman Urdu":"Raita Plot","English":"Raita Plot"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"moria_khan_goth","label":{"Urdu":"موریا خان گوٹھ","Roman Urdu":"Moria Khan Goth","English":"Moria Khan Goth"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"rafa_e_aam_society","label":{"Urdu":"رفا عام سوسا ئٹی","Roman Urdu":"Rafa-e-Aam Society","English":"Rafa-e-Aam Society"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"al_falah_society","label":{"Urdu":"الفلاح سوسا ئٹی","Roman Urdu":"Al-Falah Society","English":"Al-Falah Society"}},{"province":"sindh","city":"karachi","town":"site","name":"pak_colony","label":{"Urdu":"پاک کالونی","Roman Urdu":"Pak Colony","English":"Pak Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"old_golimar","label":{"Urdu":"پرانہ گولی مار","Roman Urdu":"Old Golimar","English":"Old Golimar"}},{"province":"sindh","city":"karachi","town":"site","name":"jahanabad","label":{"Urdu":"جہان آباد","Roman Urdu":"Jahanabad","English":"Jahanabad"}},{"province":"sindh","city":"karachi","town":"site","name":"metrovil","label":{"Urdu":"میٹروویل","Roman Urdu":"Metrovil","English":"Metrovil"}},{"province":"sindh","city":"karachi","town":"site","name":"bhawani_chali","label":{"Urdu":"بہوانی چالی","Roman Urdu":"Bhawani Chali","English":"Bhawani Chali"}},{"province":"sindh","city":"karachi","town":"site","name":"frontier_colony","label":{"Urdu":"فرونٹر کالونی","Roman Urdu":"Frontier Colony","English":"Frontier Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"banaras_colony","label":{"Urdu":"بنارس کالونی","Roman Urdu":"Banaras Colony","English":"Banaras Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"qasba_colony","label":{"Urdu":"قصبہ کالونی","Roman Urdu":"Qasba Colony","English":"Qasba Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"islamia_colony","label":{"Urdu":"اسلامیہ کالونی","Roman Urdu":"Islamia Colony","English":"Islamia Colony"}},{"province":"na","city":"na","town":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","city":"na","town":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Qaabil-e-atlaaq nahi","English":"Not Applicable"}}],"gender":[{"instance":{"openmrs_code":"1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"male","label":{"Urdu":"مرد/ لڑکا","Roman Urdu":"Mard/larka","English":"Male"}},{"instance":{"openmrs_code":"1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"female","label":{"Urdu":"عورت/لڑکی","Roman Urdu":"Aurat/larki","English":"Female"}},{"instance":{"openmrs_code":"163163AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"transgender","label":{"Urdu":"خواجہ سرہ","Roman Urdu":"Khwaja sira","English":"Transgender"}}],"vaccines":[{"instance":{"openmrs_code":"1570AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"bcg","label":{"Urdu":"بی سی جی","Roman Urdu":"BCG","English":"BCG"}},{"instance":{"openmrs_code":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv0","label":{"Urdu":"او پی وی 0","Roman Urdu":"OPV 0","English":"OPV 0"}},{"instance":{"openmrs_code":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pcv1","label":{"Urdu":"پی سی وی 1","Roman Urdu":"PCV 1","English":"PCV 1"}},{"instance":{"openmrs_code":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv1","label":{"Urdu":"او پی وی 1","Roman Urdu":"OPV 1","English":"OPV 1"}},{"instance":{"openmrs_code":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"penta11","label":{"Urdu":"پینٹا ویلنٹ 1","Roman Urdu":"Pentavalent 1","English":"Pentavalent 1"}},{"instance":{"openmrs_code":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pcv2","label":{"Urdu":"پی سی وی 2","Roman Urdu":"PCV 2","English":"PCV 2"}},{"instance":{"openmrs_code":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv2","label":{"Urdu":"او پی وی 2","Roman Urdu":"OPV 2","English":"OPV 2"}},{"instance":{"openmrs_code":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"penta12","label":{"Urdu":"پینٹا ویلنٹ 2","Roman Urdu":"Pentavalent 2","English":"Pentavalent 2"}},{"instance":{"openmrs_code":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pcv3","label":{"Urdu":"پی سی وی 3","Roman Urdu":"PCV 3","English":"PCV 3"}},{"instance":{"openmrs_code":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv3","label":{"Urdu":"او پی وی 3","Roman Urdu":"OPV 3","English":"OPV 3"}},{"instance":{"openmrs_code":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"penta13","label":{"Urdu":"پینٹا ویلنٹ 3","Roman Urdu":"Pentavalent 3","English":"Pentavalent 3"}},{"instance":{"openmrs_code":"82242AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ipv","label":{"Urdu":"آئی پی وی","Roman Urdu":"IPV","English":"IPV"}},{"instance":{"openmrs_code":"79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"measles1","label":{"Urdu":"خسرہ 1","Roman Urdu":"Khasra 1","English":"Measles 1"}},{"instance":{"openmrs_code":"79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"measles2","label":{"Urdu":"خسرہ 2","Roman Urdu":"Khasra 2","English":"Measles 2"}}],"towns":[{"province":"sindh","city":"karachi","name":"korangi","label":{"Urdu":"کورنگی","Roman Urdu":"Korangi","English":"Korangi"}},{"province":"sindh","city":"karachi","name":"landhi","label":{"Urdu":"لانڈھی","Roman Urdu":"Landhi","English":"Landhi"}},{"province":"sindh","city":"karachi","name":"baldia","label":{"Urdu":"بلدیہ","Roman Urdu":"Baldia","English":"Baldia"}},{"province":"sindh","city":"karachi","name":"bin_qasim","label":{"Urdu":"بن قاسم","Roman Urdu":"Bin Qasim","English":"Bin Qasim"}},{"province":"sindh","city":"karachi","name":"gadap","label":{"Urdu":"گڈاپ","Roman Urdu":"Gadap","English":"Gadap"}},{"province":"sindh","city":"karachi","name":"gulberg","label":{"Urdu":"گلبرگ","Roman Urdu":"Gulberg","English":"Gulberg"}},{"province":"sindh","city":"karachi","name":"gulshan","label":{"Urdu":"گلشن","Roman Urdu":"Gulshan","English":"Gulshan"}},{"province":"sindh","city":"karachi","name":"jamshed","label":{"Urdu":"جمشید","Roman Urdu":"Jamshed","English":"Jamshed"}},{"province":"sindh","city":"karachi","name":"kiamari","label":{"Urdu":"کیماری","Roman Urdu":"Kiamari","English":"Kiamari"}},{"province":"sindh","city":"karachi","name":"liaquatabad","label":{"Urdu":"لیاقت آباد","Roman Urdu":"Liaquatabad","English":"Liaquatabad"}},{"province":"sindh","city":"karachi","name":"lyari","label":{"Urdu":"لیاری","Roman Urdu":"Lyari","English":"Lyari"}},{"province":"sindh","city":"karachi","name":"malir","label":{"Urdu":"ملیر","Roman Urdu":"Malir","English":"Malir"}},{"province":"sindh","city":"karachi","name":"new_karachi","label":{"Urdu":"نیو کراچی","Roman Urdu":"New Karachi","English":"New Karachi"}},{"province":"sindh","city":"karachi","name":"north_nazimabad","label":{"Urdu":"نارتھ ناظم آباد","Roman Urdu":"North Nazimabad","English":"North Nazimabad"}},{"province":"sindh","city":"karachi","name":"orangi","label":{"Urdu":"اورنگی","Roman Urdu":"Orangi","English":"Orangi"}},{"province":"sindh","city":"karachi","name":"saddar","label":{"Urdu":"صدر","Roman Urdu":"Saddar","English":"Saddar"}},{"province":"sindh","city":"karachi","name":"shah_faisal","label":{"Urdu":"شاہ فیصل","Roman Urdu":"Shah Faisal","English":"Shah Faisal"}},{"province":"sindh","city":"karachi","name":"site","label":{"Urdu":"سائٹ","Roman Urdu":"S.I.T.E.","English":"S.I.T.E."}},{"province":"na","city":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","city":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Qaabil-e-atlaaq nahi","English":"Not Applicable"}}],"cities":[{"province":"sindh","name":"karachi","label":{"Urdu":"کراچی","Roman Urdu":"Karachi","English":"Karachi"}},{"province":"punjab","name":"hafizabad","label":{"Urdu":"حافظ آباد","Roman Urdu":"Hafizabad","English":"Hafizabad"}},{"province":"punjab","name":"muzaffargarh","label":{"Urdu":"مظفر گڑھ","Roman Urdu":"Muzaffargarh","English":"Muzaffargarh"}},{"province":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Qaabil-e-atlaaq nahi","English":"Not Applicable"}}],"yes_no":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}]},"instance":{"encounter_type":"Off Site Child Vaccination Follow Up"},"version":"201604080501","id_string":"offsite_child_vaccination_followup","type":"survey","children":[{"type":"hidden","name":"provider_uc"},{"type":"hidden","name":"provider_town"},{"type":"hidden","name":"provider_city"},{"type":"hidden","name":"provider_province"},{"type":"hidden","name":"existing_first_name"},{"type":"hidden","name":"existing_last_name"},{"type":"hidden","name":"existing_mother_name"},{"type":"hidden","name":"existing_gender"},{"type":"hidden","name":"existing_client_birth_date"},{"type":"hidden","name":"existing_client_reg_date"},{"type":"hidden","name":"existing_landmark"},{"type":"hidden","name":"existing_house_number"},{"type":"hidden","name":"existing_street"},{"type":"hidden","name":"existing_union_council"},{"type":"hidden","name":"existing_town"},{"type":"hidden","name":"existing_city_village"},{"type":"hidden","name":"existing_province"},{"type":"hidden","name":"existing_union_councilname"},{"type":"hidden","name":"existing_townname"},{"type":"hidden","name":"existing_city_villagename"},{"type":"hidden","name":"existing_provincename"},{"type":"hidden","name":"existing_ethnicity"},{"type":"hidden","name":"existing_program_client_id"},{"type":"hidden","name":"existing_epi_card_number"},{"type":"hidden","name":"existing_child_was_suffering_from_a_disease_at_birth"},{"type":"hidden","name":"existing_reminders_approval"},{"type":"hidden","name":"existing_contact_phone_number"},{"type":"hidden","name":"e_bcg"},{"type":"hidden","name":"e_opv0"},{"type":"hidden","name":"e_penta2"},{"type":"hidden","name":"e_penta1"},{"type":"hidden","name":"e_penta3"},{"type":"hidden","name":"e_opv1"},{"type":"hidden","name":"e_opv2"},{"type":"hidden","name":"e_opv3"},{"type":"hidden","name":"e_pcv1"},{"type":"hidden","name":"e_pcv2"},{"type":"hidden","name":"e_pcv3"},{"type":"hidden","name":"e_measles1"},{"type":"hidden","name":"e_measles2"},{"type":"hidden","name":"e_ipv"},{"type":"hidden","name":"provider_id"},{"instance":{"openmrs_entity_id":"location_id","openmrs_entity":"encounter"},"type":"hidden","name":"provider_location_id"},{"type":"hidden","name":"provider_location_name"},{"type":"note","name":"provider_location_note","label":{"Urdu":"شہر: ${provider_city} ; ٹائون: ${provider_town} ; یوسی: ${provider_uc} ; سینٹرکا نام: ${provider_location_name}","English":"City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}","Roman Urdu":"Shehr: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center ka Naam: ${provider_location_name}"}},{"instance":{"openmrs_entity_id":"163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"start","name":"start"},{"instance":{"openmrs_entity_id":"163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"end","name":"end"},{"instance":{"openmrs_entity_id":"163286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"today","name":"today"},{"instance":{"openmrs_entity_id":"163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"deviceid","name":"deviceid"},{"instance":{"openmrs_entity_id":"163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"subscriberid","name":"subscriberid"},{"instance":{"openmrs_entity_id":"163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"simserial","name":"simserial"},{"instance":{"openmrs_entity_id":"163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"phonenumber","name":"phonenumber"},{"bind":{"required":"yes"},"label":{"Urdu":"بچے کی پروگرام میں اندراج کی تاریخ: {existing_client_reg_date}$","Roman Urdu":"Bachay ki Program mai andraj ki tareekh: ${existing_client_reg_date}","English":"Child Registration date: ${existing_client_reg_date}"},"type":"note","name":"existing_client_reg_date_note","hint":{"Urdu":"بچے کو ویکسین لگنے کی تاریخ","Roman Urdu":"Bachay ko vaccine lagnay ki tareekh","English":"Date on which child was vaccinated"}},{"bind":{"required":"yes"},"type":"note","name":"program_client_id_note","label":{"Urdu":"کلائنٹ کی پروگرام ائی ڈی: {existing_program_client_id}$","Roman Urdu":"Client ki program ID: ${existing_program_client_id}","English":"Program Client ID: ${existing_program_client_id}"}},{"bind":{"jr:constraintMsg":{"Urdu":"نمبر آٹھ ہندسوں پر مشتمل ہونا چاہئے","English":"Number should be 8 digits","Roman Urdu":"Number 8 hindason par mushtamil hona chahiye"},"required":"yes","constraint":"string-length(.) = 8"},"type":"integer","instance":{"openmrs_entity_id":"EPI Card Number","openmrs_entity":"person_attribute"},"name":"epi_card_number","label":{"Urdu":"ای پی آئی کارڈ نمبر: {existing_epi_card_number}$","English":"EPI Card Number: ${existing_epi_card_number}","Roman Urdu":"EPI Card Number: ${existing_epi_card_number}"}},{"bind":{"required":"yes"},"type":"note","name":"first_name_note","label":{"Urdu":"نام: {existing_first_name}$","Roman Urdu":"Naam: ${existing_first_name}","English":"First Name: ${existing_first_name}"}},{"bind":{"required":"yes"},"type":"note","name":"last_name_note","label":{"Urdu":"والد کا نام: {existing_last_name}$","Roman Urdu":"Waalid ka naam: ${existing_last_name}","English":"Last name: ${existing_last_name}"}},{"bind":{"calculate":"int((${today} - ${existing_client_birth_date}) div 30.42)"},"type":"calculate","name":"child_age","instance":{"openmrs_entity_id":"154384AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"type":"note","name":"calc_dob_note","label":{"Urdu":"بچے کی تاریخ پیدائش: {existing_client_birth_date}$ ({child_age}$) مہینے","English":"Child dob: ${existing_client_birth_date} (${child_age}) months","Roman Urdu":"Bachay ki tareekh-e-paidaish: ${existing_client_birth_date} (${child_age}) mahinay"}},{"bind":{"required":"yes"},"type":"note","name":"gender_note","label":{"Urdu":"جنس: {existing_gender}$","Roman Urdu":"Jins:${existing_gender}","English":"Gender: ${existing_gender}"}},{"type":"note","name":"mother_name_note","label":{"Urdu":"ماں کا نام: {existing_mother_name}$","English":"Mother's Name: ${existing_mother_name}","Roman Urdu":"Maa ka naam: ${existing_mother_name}"}},{"bind":{"required":"yes"},"type":"note","name":"exisiting_ethnicity_note","label":{"Urdu":"قومیت: {existing_ethnicity}$","Roman Urdu":"Qomiat: ${existing_ethnicity}","English":"Ethnicity: ${existing_ethnicity}"}},{"type":"note","name":"address","label":{"Urdu":"موجودہ پتہ: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}","English":"Current Address: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}","Roman Urdu":"Mojooda Address: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}"}},{"label":{"Urdu":"کیا آپ کا گھر کا پتہ بدلا ہے؟","English":"Has your home address changed?","Roman Urdu":"Kya aap ka ghar ka pata badla hai?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}],"name":"address_change"},{"control":{"appearance":"minimal"},"name":"province","default":"${provider_province}","bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"label":{"Urdu":"صوبہ","Roman Urdu":"Suba","English":"Province"},"instance":{"openmrs_entity":"person_address","openmrs_entity_id":"stateProvince","openmrs_entity_parent":"usual_residence"},"type":"select one","children":[{"name":"kpk","label":{"Urdu":"خیبر پختون خواہ","English":"Khyber Pakhtunkhwa","Roman Urdu":"Khyber Pakhtunkhwa"}},{"name":"sindh","label":{"Urdu":"سندھ","English":"Sindh","Roman Urdu":"Sindh"}},{"name":"balochistan","label":{"Urdu":"بلوچستان","English":"Balochistan","Roman Urdu":"Balochistan"}},{"name":"punjab","label":{"Urdu":"پنجاب","English":"Punjab","Roman Urdu":"Punjab"}},{"name":"gilgit_baltistan","label":{"Urdu":"گلگت بلتستان","English":"Gilgit Baltistan","Roman Urdu":"Gilgit Baltistan"}},{"name":"kashmir","label":{"Urdu":"کشمیر","English":"Kashmir","Roman Urdu":"Kashmir"}},{"name":"fata","label":{"Urdu":"فاٹا","English":"FATA","Roman Urdu":"FATA"}},{"name":"out_of_country","label":{"Urdu":"ملک سے باہر","English":"Out of Country","Roman Urdu":"Out of Country"}}]},{"control":{"appearance":"minimal"},"name":"city_village","choice_filter":"province=${province} or province='na'","default":"${provider_city}","bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"label":{"Urdu":"شہر","Roman Urdu":"Shehr","English":"City"},"itemset":"cities","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"cityVillage","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"control":{"appearance":"minimal"},"name":"town","choice_filter":"(province=${province} and city=${city_village} ) or city='na'","bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"label":{"Urdu":"ٹاٰئون/ قصبہ/ بستی","Roman Urdu":"Town / Qasbah / Basti","English":"Town"},"itemset":"towns","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"town","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"control":{"appearance":"minimal"},"name":"union_council","choice_filter":"(province=${province} and city=${city_village} and town=${town}) or town='na'","bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"label":{"Urdu":"یونین کونسل","Roman Urdu":"Union Council","English":"Union Council"},"itemset":"ucs","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"subTown","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"house","openmrs_entity_parent":"usual_residence"},"name":"house_number","label":{"Urdu":"گھر کا نمبر","Roman Urdu":"Ghar ka number","English":"House Number"}},{"bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"street","openmrs_entity_parent":"usual_residence"},"name":"street","label":{"Urdu":"گلی/کالونی/محلہ","Roman Urdu":"Gali/Colony/Mohalla","English":"Street"}},{"bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"landmark","openmrs_entity_parent":"usual_residence"},"name":"landmark","label":{"Urdu":"گھر کے قریب کوئی مشہور جگہ","Roman Urdu":"Ghar ke qareeb koi mashoor jagah","English":"Land Mark"}},{"instance":{"openmrs_entity_id":"163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"geopoint","name":"center_gps","label":{"Urdu":"حاصل کردہ معلومات کی جگہ کے GPS کارڈینیٹس درج کریں","English":"Collect GPS coordinates of data entry location:","Roman Urdu":"Hasil karda malomaat ki jaga ke GPS coordinates darj karain"}},{"control":{"appearance":"minimal"},"bind":{"required":"yes"},"type":"note","name":"child_was_suffering_from_a_disease_at_birth_note","label":{"Urdu":"کیا بچہ پیدائش کے وقت کسی مرض میں مبتلا تھا؟ {existing_child_was_suffering_from_a_disease_at_birth}$","Roman Urdu":"Kya bacha pedaaish k waqt kissi marz mai mubtila tha? ${existing_child_was_suffering_from_a_disease_at_birth}","English":"Child was suffering from a disease at birth: ${existing_child_was_suffering_from_a_disease_at_birth}"}},{"instance":{"openmrs_entity_id":"163162AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"text","name":"aefi","label":{"Urdu":"حفاظتی ٹیکوں کے مضر اثرات","English":"The temporary side-effects of immunization shots","Roman Urdu":"Hifazati teekon ke muzr asraat"}},{"control":{"appearance":"minimal"},"name":"reminders_approval","bind":{"required":"yes"},"label":{"Urdu":"کیا آپ اپنے بچے کی اگلی ویکسین کی تاریخ کے لیے SMS موصول کرنا چاہتے ہیں؟ {existing_reminders_approval}$","English":"Are you willing to receive SMS reminders for your next visit? ${existing_reminders_approval}","Roman Urdu":"Kya aap apnay bachay ki agli vaccine ki tareekh ke liye SMS mausool karna chahtay hain? ${existing_reminders_approval}"},"instance":{"openmrs_entity_id":"163089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}]},{"bind":{"jr:constraintMsg":{"Urdu":"فون نمبر گیارہ ہندسوں پر مشتمل اور مندرجہ ذیل شکل میں ہونا چاہئے: *********03","English":"Phone number should be 11 digits in the following format: 03*********","Roman Urdu":"Phone number 11 hindason par mushtamil aur mundarja zail shakal main hona chahiey: 03*********"},"relevant":"${existing_reminders_approval}='yes'","constraint":"regex(., '^03[0-9]{9}$')"},"type":"text","instance":{"openmrs_entity_id":"159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"contact_phone_number","label":{"Urdu":"موبائل نمبر:{existing_contact_phone_number}$","English":"Mobile Number: ${existing_contact_phone_number}","Roman Urdu":"Mobile Number: ${existing_contact_phone_number}"}},{"bind":{"calculate":"${existing_client_birth_date} + 42"},"type":"calculate","name":"six_weeks"},{"bind":{"calculate":"${existing_client_birth_date} + 70"},"type":"calculate","name":"ten_weeks"},{"bind":{"calculate":"${existing_client_birth_date} + 98"},"type":"calculate","name":"forteen_weeks"},{"bind":{"calculate":"${existing_client_birth_date} + 245"},"type":"calculate","name":"nine_months"},{"bind":{"calculate":"${existing_client_birth_date} + 458"},"type":"calculate","name":"fifteen_months"},{"control":{"appearance":"minimal"},"name":"vaccines","choice_filter":"name != if( ${e_bcg} != '', 'bcg' , '') and \nname != if( ${e_opv0} != '', 'opv0' , '') and \nname != if( ${e_penta1} != '', 'penta1' , '') and \nname != if( ${e_penta2} != '', 'penta2' , '') and \nname != if( ${e_penta3} != '', 'penta3' , '') and \nname != if( ${e_opv1} != '', 'opv1' , '') and \nname != if( ${e_opv2} != '', 'opv2' , '') and \nname != if( ${e_opv3} != '', 'opv3' , '') and \nname != if( ${e_pcv1} != '', 'pcv1' , '') and \nname != if( ${e_pcv2} != '', 'pcv2' , '') and \nname != if( ${e_pcv3} != '', 'pcv3' , '') and \nname != if( ${e_ipv} != '', 'ipv' , '') and \nname != if( ${e_measles1} != '', 'measles1' , '') and \nname != if( ${e_measles2} != '', 'measles2' , '')","label":{"Urdu":"پچھلی تاریخ جب کسی اور سینٹر پر ٹیکے لگواِے گیے یا قطرے پلائے گئے","Roman Urdu":"Pichli tareekh jab kissi aur center par teekay lagwaye gaye ya katray pilaey gaye","English":"Retro vaccines"},"itemset":"vaccines","instance":{"openmrs_entity":"concept","openmrs_entity_id":"984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1421AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"select all that apply"},{"type":"group","children":[{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'bcg')","constraint":".>= ${existing_client_birth_date} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"bcg_retro","label":{"Urdu":"بی سی جی","Roman Urdu":"BCG","English":"BCG"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'opv0')","constraint":".>= ${existing_client_birth_date} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv0_retro","label":{"Urdu":"او پی وی 0","Roman Urdu":"OPV 0","English":"OPV 0"}},{"bind":{"relevant":"selected(${vaccines}, 'opv0')","calculate":"0"},"type":"calculate","name":"opv0_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'pcv1')","constraint":".>= ${existing_client_birth_date} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pcv1_retro","label":{"Urdu":"پی سی وی 1","Roman Urdu":"PCV1","English":"PCV1"}},{"bind":{"relevant":"selected(${vaccines}, 'pcv1')","calculate":"1"},"type":"calculate","name":"pcv1_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'opv1')","constraint":".>= ${existing_client_birth_date} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv1_retro","label":{"Urdu":"او پی وی1","Roman Urdu":"OPV 1","English":"OPV 1"}},{"bind":{"relevant":"selected(${vaccines}, 'opv1')","calculate":"1"},"type":"calculate","name":"opv1_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'penta11')","constraint":".>= ${existing_client_birth_date} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"penta11_retro","label":{"Urdu":"پینٹا ویلنٹ 1","Roman Urdu":"Pentavalent 1","English":"Pentavalent 1"}},{"bind":{"relevant":"selected(${vaccines}, 'penta11')","calculate":"1"},"type":"calculate","name":"penta11_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'pcv2')","constraint":".>= ${existing_client_birth_date} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pcv2_retro","label":{"Urdu":"پی سی وی 2","Roman Urdu":"PCV2","English":"PCV2"}},{"bind":{"relevant":"selected(${vaccines}, 'pcv2')","calculate":"2"},"type":"calculate","name":"pcv2_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'opv2')","constraint":".>= ${existing_client_birth_date} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv2_retro","label":{"Urdu":"او پی وی 2","Roman Urdu":"OPV 2","English":"OPV 2"}},{"bind":{"relevant":"selected(${vaccines}, 'opv2')","calculate":"2"},"type":"calculate","name":"opv2_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'penta12')","constraint":".>= ${existing_client_birth_date} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"penta12_retro","label":{"Urdu":"پینٹا ویلنٹ 2","Roman Urdu":"Pentavalent 2","English":"Pentavalent 2"}},{"bind":{"relevant":"selected(${vaccines}, 'penta12')","calculate":"2"},"type":"calculate","name":"penta12_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'pcv3')","constraint":".>= ${existing_client_birth_date} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pcv3_retro","label":{"Urdu":"پی سی وی 3","Roman Urdu":"PCV3","English":"PCV3"}},{"bind":{"relevant":"selected(${vaccines}, 'penta12')","calculate":"3"},"type":"calculate","name":"pcv3_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'opv3')","constraint":".>= ${existing_client_birth_date} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"opv3_retro","label":{"Urdu":"او پی وی3","Roman Urdu":"OPV 3","English":"OPV 3"}},{"bind":{"relevant":"selected(${vaccines}, 'opv3')","calculate":"3"},"type":"calculate","name":"opv3_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'penta13')","constraint":".>= ${existing_client_birth_date} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"penta13_retro","label":{"Urdu":"پینٹا ویلنٹ 3","Roman Urdu":"Pentavalent 3","English":"Pentavalent 3"}},{"bind":{"relevant":"selected(${vaccines}, 'penta13')","calculate":"3"},"type":"calculate","name":"penta13_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'ipv')","constraint":".>= ${existing_client_birth_date} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1422AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ipv_retro","label":{"Urdu":"آئی پی وی","Roman Urdu":"IPV","English":"IPV"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'measles1')","constraint":".>= ${existing_client_birth_date} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"measles1_retro","label":{"Urdu":"خسرہ 1","Roman Urdu":"Measles 1","English":"Measles 1"}},{"bind":{"relevant":"selected(${vaccines}, 'measles1')","calculate":"1"},"type":"calculate","name":"measles1_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"jr:constraintMsg":{"Urdu":"حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے","English":"The date of vaccination must be greater than the child's birthdate and less than today.","Roman Urdu":"Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye."},"relevant":"selected(${vaccines}, 'measles2')","constraint":".>= ${existing_client_birth_date} and .<=${today}"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"measles2_retro","label":{"Urdu":"خسرہ 2","Roman Urdu":"Measles2","English":"Measles2"}},{"bind":{"relevant":"selected(${vaccines}, 'measles2')","calculate":"2"},"type":"calculate","name":"measles2_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}}],"name":"vaccines_group"},{"control":{"appearance":"minimal"},"name":"vaccines_2","choice_filter":"name != if( ${e_bcg} != '', 'bcg' , '') and \nname != if( ${e_opv0} != '', 'opv0' , '') and \nname != if( ${e_penta2} != '', 'penta2' , '') and \nname != if( ${e_penta1} != '', 'penta1' , '') and \nname != if( ${e_penta3} != '', 'penta3' , '') and \nname != if( ${e_opv1} != '', 'opv1' , '') and \nname != if( ${e_opv2} != '', 'opv2' , '') and \nname != if( ${e_opv3} != '', 'opv3' , '') and \nname != if( ${e_pcv1} != '', 'pcv1' , '') and \nname != if( ${e_pcv2} != '', 'pcv2' , '') and \nname != if( ${e_pcv3} != '', 'pcv3' , '') and \nname != if( ${e_measles1} != '', 'measles1' , '') and \nname != if( ${e_measles2} != '', 'measles2' , '') and \nname != if(selected(${vaccines}, 'bcg'), 'bcg', '') and \nname != if(selected(${vaccines}, 'opv0'), 'opv0', '') and \nname != if(selected(${vaccines}, 'penta1'), 'penta1', '') and \nname != if(selected(${vaccines}, 'opv1'), 'opv1', '') and \nname != if(selected(${vaccines}, 'pcv1'), 'pcv1', '') and \nname != if(selected(${vaccines}, 'penta2'), 'penta2', '') and \nname != if(selected(${vaccines}, 'opv2'), 'opv2', '') and \nname != if(selected(${vaccines}, 'pcv2'), 'pcv2', '') and \nname != if(selected(${vaccines}, 'penta3'), 'penta3', '') and \nname != if(selected(${vaccines}, 'opv3'), 'opv3', '') and \nname != if(selected(${vaccines}, 'ipv'), 'ipv', '') and \nname != if(selected(${vaccines}, 'measles1'), 'measles1', '') and \nname != if(selected(${vaccines}, 'measles2'), 'measles2', '')","bind":{"required":"yes","constraint":"if(selected(${vaccines_2}, 'bcg') or selected(${vaccines_2}, 'opv0') , .>= ${existing_client_birth_date} and .<=${today}, if(selected(${vaccines_2}, 'opv1') or selected(${vaccines_2}, 'penta11'), .>= ${six_weeks} and .<=${today}, if(selected(${vaccines_2}, 'opv2') or selected(${vaccines_2}, 'penta12'), .>=${ten_weeks} and .<=${today}, if(selected(${vaccines_2}, 'opv3') or selected(${vaccines_2}, 'penta13'), .>=${forteen_weeks} and .<=${today}, if(selected(${vaccines_2}, 'measles1'), .>=${nine_months} and .<=${today}, if(selected(${vaccines_2}, 'measles2'), .>= ${fifteen_months} and .<=${today}))))))"},"label":{"Urdu":"آج کون کون سی ویکسین دی گئی ہیں؟","Roman Urdu":"Aaj kon kon si vaccine di gai hain?","English":"Vaccines administered"},"itemset":"vaccines","instance":{"openmrs_entity":"concept","openmrs_entity_id":"984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1441AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"select all that apply"},{"name":"vaccination_date","default":"${today}","bind":{"required":"yes","constraint":"if(selected(${vaccines_2}, 'bcg') or selected(${vaccines_2}, 'opv0') , .>= ${existing_client_birth_date} and .<=${today}, if(selected(${vaccines_2}, 'opv1') or selected(${vaccines_2}, 'penta11'), .>= ${six_weeks} and .<=${today}, if(selected(${vaccines_2}, 'opv2') or selected(${vaccines_2}, 'penta12'), .>=${ten_weeks} and .<=${today}, if(selected(${vaccines_2}, 'opv3') or selected(${vaccines_2}, 'penta13'), .>=${forteen_weeks} and .<=${today}, if(selected(${vaccines_2}, 'measles1'), .>=${nine_months} and .<=${today}, if(selected(${vaccines_2}, 'measles2'), .>= ${fifteen_months} and .<=${today}))))))"},"label":{"Urdu":"تاریخ","English":"Vaccination date","Roman Urdu":"Tareekh"},"instance":{"openmrs_entity_id":"encounter_date","openmrs_entity":"encounter"},"type":"date"},{"bind":{"calculate":"if(selected(${vaccines_2}, 'bcg'),${vaccination_date},'')"},"type":"calculate","name":"bcg","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'opv0'),${vaccination_date},'')"},"type":"calculate","name":"opv0","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'opv0')","calculate":"0"},"type":"calculate","name":"opv0_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'pcv1'),${vaccination_date},'')"},"type":"calculate","name":"pcv1","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'pcv1')","calculate":"1"},"type":"calculate","name":"pcv1_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'opv1'),${vaccination_date},'')"},"type":"calculate","name":"opv1","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'opv1')","calculate":"1"},"type":"calculate","name":"opv1_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'penta11'),${vaccination_date},'')"},"type":"calculate","name":"penta11","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'penta11')","calculate":"1"},"type":"calculate","name":"penta11_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'pcv2'),${vaccination_date},'')"},"type":"calculate","name":"pcv2","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'pcv2')","calculate":"2"},"type":"calculate","name":"pcv2_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'opv2'),${vaccination_date},'')"},"type":"calculate","name":"opv2","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'opv2')","calculate":"2"},"type":"calculate","name":"opv2_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'penta12'),${vaccination_date},'')"},"type":"calculate","name":"penta12","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'penta12')","calculate":"2"},"type":"calculate","name":"penta12_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'pcv3'),${vaccination_date},'')"},"type":"calculate","name":"pcv3","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'pcv3')","calculate":"3"},"type":"calculate","name":"pcv3_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'opv3'),${vaccination_date},'')"},"type":"calculate","name":"opv3","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'opv3')","calculate":"3"},"type":"calculate","name":"opv3_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'penta13'),${vaccination_date},'')"},"type":"calculate","name":"penta13","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'penta13')","calculate":"3"},"type":"calculate","name":"penta13_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines}, 'ipv')","calculate":"if(selected(${vaccines_2}, 'ipv'),${vaccination_date},'')"},"type":"calculate","name":"ipv","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1422AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'measles1'),${vaccination_date},'')"},"type":"calculate","name":"measles1","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'measles1')","calculate":"1"},"type":"calculate","name":"measles1_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'measles2'),${vaccination_date},'')"},"type":"calculate","name":"measles2","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2}, 'measles2')","calculate":"2"},"type":"calculate","name":"measles2_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"control":{"bodyless":true},"type":"group","children":[{"bind":{"readonly":"true()","calculate":"concat('uuid:', uuid())"},"type":"calculate","name":"instanceID"}],"name":"meta"}]} \ No newline at end of file +{ + "name": "Offsite_Child_Vaccination_Followup", + "title": "دوسرے سینٹر میں رجسٹرڈ بچّوں کا فالو اپ رجسٹر برائے ٹیکاجات - Off Site Child Follow Up Vaccination Register", + "sms_keyword": "offsite_child_vaccination_followup", + "default_language": "English", + "choices": { + "provinces": [ + { + "name": "kpk", + "label": { + "Urdu": "خیبر پختون خواہ", + "English": "Khyber Pakhtunkhwa", + "Roman Urdu": "Khyber Pakhtunkhwa" + } + }, + { + "name": "sindh", + "label": { + "Urdu": "سندھ", + "English": "Sindh", + "Roman Urdu": "Sindh" + } + }, + { + "name": "balochistan", + "label": { + "Urdu": "بلوچستان", + "English": "Balochistan", + "Roman Urdu": "Balochistan" + } + }, + { + "name": "punjab", + "label": { + "Urdu": "پنجاب", + "English": "Punjab", + "Roman Urdu": "Punjab" + } + }, + { + "name": "gilgit_baltistan", + "label": { + "Urdu": "گلگت بلتستان", + "English": "Gilgit Baltistan", + "Roman Urdu": "Gilgit Baltistan" + } + }, + { + "name": "kashmir", + "label": { + "Urdu": "کشمیر", + "English": "Kashmir", + "Roman Urdu": "Kashmir" + } + }, + { + "name": "fata", + "label": { + "Urdu": "فاٹا", + "English": "FATA", + "Roman Urdu": "FATA" + } + }, + { + "name": "out_of_country", + "label": { + "Urdu": "ملک سے باہر", + "English": "Out of Country", + "Roman Urdu": "Out of Country" + } + } + ], + "ucs": [ + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "bilal_colony", + "label": { + "Urdu": "بلال کالونی", + "Roman Urdu": "Bilal Colony", + "English": "Bilal Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "nasir_colony", + "label": { + "Urdu": "ناصر کالونی", + "Roman Urdu": "Nasir Colony", + "English": "Nasir Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "chakra_goth", + "label": { + "Urdu": "چکرا گوٹھ", + "Roman Urdu": "Chakra Goth", + "English": "Chakra Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "mustafa_taj_colony", + "label": { + "Urdu": "مصطفی تاج کالونی", + "Roman Urdu": "Mustafa Taj Colony", + "English": "Mustafa Taj Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "hundred_quarters", + "label": { + "Urdu": "ہنڈریڈ کوارٹر", + "Roman Urdu": "Hundred Quarters", + "English": "Hundred Quarters" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "gulzar_colony", + "label": { + "Urdu": "گلزار کالونی", + "Roman Urdu": "Gulzar Colony", + "English": "Gulzar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "korangi_sector_33", + "label": { + "Urdu": "کورنگی سیکٹر 33", + "Roman Urdu": "Korangi Sector 33", + "English": "Korangi Sector 33" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "zaman_town", + "label": { + "Urdu": "زمان ٹاوَن", + "Roman Urdu": "Zaman Town", + "English": "Zaman Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "hasrat_mohani_colony", + "label": { + "Urdu": "حسرت موہانی کالونی", + "Roman Urdu": "Hasrat Mohani Colony", + "English": "Hasrat Mohani Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "gulshan_e_ghazi", + "label": { + "Urdu": "گلشن غازی", + "Roman Urdu": "Gulshan-e-Ghazi", + "English": "Gulshan-e-Ghazi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "ittehad_town", + "label": { + "Urdu": "اتحاد ٹاوَن", + "Roman Urdu": "Ittehad Town", + "English": "Ittehad Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "islam_nagar", + "label": { + "Urdu": "اسلام نگر", + "Roman Urdu": "Islam Nagar", + "English": "Islam Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "nai_abadi", + "label": { + "Urdu": "نئی آبادی", + "Roman Urdu": "Nai Abadi", + "English": "Nai Abadi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "saeedabad", + "label": { + "Urdu": "سعید آباد", + "Roman Urdu": "Saeedabad", + "English": "Saeedabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "muslim_mujahid_colony", + "label": { + "Urdu": "مسلم مجاہد کالونی", + "Roman Urdu": "Muslim Mujahid Colony", + "English": "Muslim Mujahid Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "muhajir_camp", + "label": { + "Urdu": "مہاجر کیمپ", + "Roman Urdu": "Muhajir Camp", + "English": "Muhajir Camp" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "rasheedabad", + "label": { + "Urdu": "رشید آباد", + "Roman Urdu": "Rasheedabad", + "English": "Rasheedabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "ibrahim_hyderi", + "label": { + "Urdu": "ابراہیم حیدری", + "Roman Urdu": "Ibrahim Hyderi", + "English": "Ibrahim Hyderi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "rehri", + "label": { + "Urdu": "رہڑی", + "Roman Urdu": "Rehri", + "English": "Rehri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "cattle_colony", + "label": { + "Urdu": "کیٹل کالونی", + "Roman Urdu": "Cattle Colony", + "English": "Cattle Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "qaidabad", + "label": { + "Urdu": "قائدآباد", + "Roman Urdu": "Qaidabad", + "English": "Qaidabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "landhi_colony", + "label": { + "Urdu": "لانڈھی کالونی", + "Roman Urdu": "Landhi Colony", + "English": "Landhi Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "gulshan_e_hadeed", + "label": { + "Urdu": "گلشن حدید", + "Roman Urdu": "Gulshan-e-Hadeed", + "English": "Gulshan-e-Hadeed" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "gaghar", + "label": { + "Urdu": "گگر", + "Roman Urdu": "Gaghar", + "English": "Gaghar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "murad_memon_goth", + "label": { + "Urdu": "مراد میمن گوٹھ", + "Roman Urdu": "Murad Memon Goth", + "English": "Murad Memon Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "darsano_chana", + "label": { + "Urdu": "درشانو شنو", + "Roman Urdu": "Darsano Chana", + "English": "Darsano Chana" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "gujro", + "label": { + "Urdu": "گجرو", + "Roman Urdu": "Gujro", + "English": "Gujro" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "songal", + "label": { + "Urdu": "سنگل", + "Roman Urdu": "Songal", + "English": "Songal" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "maymarabad", + "label": { + "Urdu": "معمار آباد", + "Roman Urdu": "Maymarabad", + "English": "Maymarabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "yousuf_goth", + "label": { + "Urdu": "یوسف گوٹھ", + "Roman Urdu": "Yousuf Goth", + "English": "Yousuf Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "manghopir", + "label": { + "Urdu": "منگھوپیر", + "Roman Urdu": "Manghopir", + "English": "Manghopir" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "azizabad", + "label": { + "Urdu": "عزیز آباد", + "Roman Urdu": "Azizabad", + "English": "Azizabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "karimabad", + "label": { + "Urdu": "کریم آباد", + "Roman Urdu": "Karimabad", + "English": "Karimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "aisha_manzil", + "label": { + "Urdu": "عائشہ منزل", + "Roman Urdu": "Aisha Manzil", + "English": "Aisha Manzil" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "ancholi", + "label": { + "Urdu": "انچولی", + "Roman Urdu": "Ancholi", + "English": "Ancholi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "naseerabad", + "label": { + "Urdu": "نصیرآباد", + "Roman Urdu": "Naseerabad", + "English": "Naseerabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "yaseenabad", + "label": { + "Urdu": "یاسین آباد", + "Roman Urdu": "Yaseenabad", + "English": "Yaseenabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "water_pump", + "label": { + "Urdu": "واٹرپمپ", + "Roman Urdu": "Water Pump", + "English": "Water Pump" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "shafiq_mill_colony", + "label": { + "Urdu": "شفیق مل کالونی", + "Roman Urdu": "Shafiq Mill Colony", + "English": "Shafiq Mill Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "delhi_mercantile_society", + "label": { + "Urdu": "دہلی مرچنٹائل سوسائٹی", + "Roman Urdu": "Delhi Mercantile Society", + "English": "Delhi Mercantile Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "civic_centre", + "label": { + "Urdu": "سوک سینٹر", + "Roman Urdu": "Civic Centre", + "English": "Civic Centre" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "pir_ilahi_buksh_colony", + "label": { + "Urdu": "پیر الہی بخش کالونی", + "Roman Urdu": "Pir Ilahi Buksh Colony", + "English": "Pir Ilahi Buksh Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "essa_nagri", + "label": { + "Urdu": "عیسی نگری", + "Roman Urdu": "Essa Nagri", + "English": "Essa Nagri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gulshan_e_iqbal", + "label": { + "Urdu": "گلشن اقبال", + "Roman Urdu": "Gulshan-e-Iqbal", + "English": "Gulshan-e-Iqbal" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gillani_railway_station", + "label": { + "Urdu": "گیلانی ریلوے اسٹیشن", + "Roman Urdu": "Gillani Railway Station", + "English": "Gillani Railway Station" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "shanti_nagar", + "label": { + "Urdu": "شانتی نگر", + "Roman Urdu": "Shanti Nagar", + "English": "Shanti Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "jamali_colony", + "label": { + "Urdu": "جمالی کالونی", + "Roman Urdu": "Jamali Colony", + "English": "Jamali Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gulshan_e_iqbal_ii", + "label": { + "Urdu": "گلشن اقبال 2", + "Roman Urdu": "Gulshan-e-Iqbal II", + "English": "Gulshan-e-Iqbal II" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "pehlwan_goth", + "label": { + "Urdu": "پہلوان گوٹھ", + "Roman Urdu": "Pehlwan Goth", + "English": "Pehlwan Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "matrovil_colony", + "label": { + "Urdu": "میٹروویل کالونی", + "Roman Urdu": "Matrovil Colony", + "English": "Matrovil Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gulzar_e_hijri", + "label": { + "Urdu": "گلزار ہجری", + "Roman Urdu": "Gulzar-e-Hijri", + "English": "Gulzar-e-Hijri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "safooran_goth", + "label": { + "Urdu": "صفورا گوٹھ", + "Roman Urdu": "Safooran Goth", + "English": "Safooran Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "akhtar_colony", + "label": { + "Urdu": "اختر کالونی", + "Roman Urdu": "Akhtar Colony", + "English": "Akhtar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "manzoor_colony", + "label": { + "Urdu": "منظور کالونی", + "Roman Urdu": "Manzoor Colony", + "English": "Manzoor Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "azam_basti", + "label": { + "Urdu": "اعظم بستی", + "Roman Urdu": "Azam Basti", + "English": "Azam Basti" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "chanesar_goth", + "label": { + "Urdu": "چنیسر گوٹھ", + "Roman Urdu": "Chanesar Goth", + "English": "Chanesar Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "mahmudabad", + "label": { + "Urdu": "محمودآباد", + "Roman Urdu": "Mahmudabad", + "English": "Mahmudabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "pechs", + "label": { + "Urdu": "پی۔ای۔سی۔ایچ۔ایس", + "Roman Urdu": "P.E.C.H.S.", + "English": "P.E.C.H.S." + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "pechs_ii", + "label": { + "Urdu": "پی۔ای۔سی۔ایچ۔ایس 2", + "Roman Urdu": "P.E.C.H.S. II", + "English": "P.E.C.H.S. II" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "jut_line", + "label": { + "Urdu": "جٹ لائن", + "Roman Urdu": "Jut Line", + "English": "Jut Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "central_jacob_lines", + "label": { + "Urdu": "سینٹرل جیکب لائن", + "Roman Urdu": "Central Jacob Lines", + "English": "Central Jacob Lines" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "jamshed_quarters", + "label": { + "Urdu": "جمشید کوارٹر", + "Roman Urdu": "Jamshed Quarters", + "English": "Jamshed Quarters" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "garden_east", + "label": { + "Urdu": "گارڈن ایسٹ", + "Roman Urdu": "Garden East", + "English": "Garden East" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "soldier_bazar", + "label": { + "Urdu": "سولجر بازار", + "Roman Urdu": "Soldier Bazar", + "English": "Soldier Bazar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "pakistan_quarters", + "label": { + "Urdu": "پاکستان کوارٹر", + "Roman Urdu": "Pakistan Quarters", + "English": "Pakistan Quarters" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "bhutta_village", + "label": { + "Urdu": "بھٹا ولیج", + "Roman Urdu": "Bhutta Village", + "English": "Bhutta Village" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "sultanabad", + "label": { + "Urdu": "سلطان آباد", + "Roman Urdu": "Sultanabad", + "English": "Sultanabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "kiamari_uc", + "label": { + "Urdu": "کیماری یو- سی", + "Roman Urdu": "Kiamari UC", + "English": "Kiamari UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "baba_bhit", + "label": { + "Urdu": "بابا بھٹ", + "Roman Urdu": "Baba Bhit", + "English": "Baba Bhit" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "machar_colony", + "label": { + "Urdu": "مچھر کالونی", + "Roman Urdu": "Machar Colony", + "English": "Machar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "maripur", + "label": { + "Urdu": "ماڑی پور", + "Roman Urdu": "Maripur", + "English": "Maripur" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "shershah", + "label": { + "Urdu": "شیرشاہ", + "Roman Urdu": "SherShah", + "English": "SherShah" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "gabo_pat", + "label": { + "Urdu": "گابو پٹ", + "Roman Urdu": "Gabo Pat", + "English": "Gabo Pat" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "muzafarabad", + "label": { + "Urdu": "مظفرآباد", + "Roman Urdu": "Muzafarabad", + "English": "Muzafarabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "muslimabad", + "label": { + "Urdu": "مسلم آباد", + "Roman Urdu": "Muslimabad", + "English": "Muslimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "dawood_chowrangi", + "label": { + "Urdu": "داوَد چورنگی", + "Roman Urdu": "Dawood Chowrangi", + "English": "Dawood Chowrangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "moinabad", + "label": { + "Urdu": "معین آباد", + "Roman Urdu": "Moinabad", + "English": "Moinabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "sharafi_goth", + "label": { + "Urdu": "شرافی گوٹھ", + "Roman Urdu": "Sharafi Goth", + "English": "Sharafi Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "bhutto_nagar", + "label": { + "Urdu": "بھٹو نگر", + "Roman Urdu": "Bhutto Nagar", + "English": "Bhutto Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "khawaja_ajmeer_colony", + "label": { + "Urdu": "خواجہ اجمیر کالونی", + "Roman Urdu": "Khawaja Ajmeer Colony", + "English": "Khawaja Ajmeer Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "landhi_uc", + "label": { + "Urdu": "لانڈھی یوسی", + "Roman Urdu": "Landhi UC", + "English": "Landhi UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "awami_colony", + "label": { + "Urdu": "عوامی کالونی", + "Roman Urdu": "Awami Colony", + "English": "Awami Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "burmee_colony", + "label": { + "Urdu": "برمی کالونی", + "Roman Urdu": "Burmee Colony", + "English": "Burmee Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "korangi_uc", + "label": { + "Urdu": "کورنگی یوسی", + "Roman Urdu": "Korangi UC", + "English": "Korangi UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "sherabad", + "label": { + "Urdu": "شیرآباد", + "Roman Urdu": "Sherabad", + "English": "Sherabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "rizvia_society", + "label": { + "Urdu": "رضویہ سوسائٹی", + "Roman Urdu": "Rizvia Society", + "English": "Rizvia Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "firdous_colony", + "label": { + "Urdu": "فردوس کالونی", + "Roman Urdu": "Firdous Colony", + "English": "Firdous Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "super_market", + "label": { + "Urdu": "سپر مارکیٹ", + "Roman Urdu": "Super Market", + "English": "Super Market" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "dak_khana", + "label": { + "Urdu": "دک کھانہ", + "Roman Urdu": "Dak Khana", + "English": "Dak Khana" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "qasimabad", + "label": { + "Urdu": "قاسم آباد", + "Roman Urdu": "Qasimabad", + "English": "Qasimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "bandhani_colony", + "label": { + "Urdu": "بندھانی کالونی", + "Roman Urdu": "Bandhani Colony", + "English": "Bandhani Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "sharifabad", + "label": { + "Urdu": "شریف آباد", + "Roman Urdu": "Sharifabad", + "English": "Sharifabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "commercial_area", + "label": { + "Urdu": "کمرشل ایریا", + "Roman Urdu": "Commercial Area", + "English": "Commercial Area" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "mujahid_colony", + "label": { + "Urdu": "مجاہد کالونی", + "Roman Urdu": "Mujahid Colony", + "English": "Mujahid Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "nazimabad", + "label": { + "Urdu": "ناظم آباد", + "Roman Urdu": "Nazimabad", + "English": "Nazimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "abbasi_shaheed", + "label": { + "Urdu": "عباسی شہید", + "Roman Urdu": "Abbasi Shaheed", + "English": "Abbasi Shaheed" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "agra_taj_colony", + "label": { + "Urdu": "آگرہ تاج کالونی", + "Roman Urdu": "Agra Taj Colony", + "English": "Agra Taj Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "daryaabad", + "label": { + "Urdu": "دریاآباد", + "Roman Urdu": "Daryaabad", + "English": "Daryaabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "nawabad", + "label": { + "Urdu": "نواآباد", + "Roman Urdu": "Nawabad", + "English": "Nawabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "khada_memon_society", + "label": { + "Urdu": "خدا- میمن- سوساَٹی", + "Roman Urdu": "Khada Memon Society", + "English": "Khada Memon Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "baghdadi", + "label": { + "Urdu": "بغدادی", + "Roman Urdu": "Baghdadi", + "English": "Baghdadi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "shah_baig_line", + "label": { + "Urdu": "شاھ باغ لائن", + "Roman Urdu": "Shah Baig Line", + "English": "Shah Baig Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "bihar_colony", + "label": { + "Urdu": "بہار کالونی", + "Roman Urdu": "Bihar Colony", + "English": "Bihar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "ragiwara", + "label": { + "Urdu": "راگی واڑا", + "Roman Urdu": "Ragiwara", + "English": "Ragiwara" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "singo_line", + "label": { + "Urdu": "سنگولائن", + "Roman Urdu": "Singo Line", + "English": "Singo Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "chakiwara", + "label": { + "Urdu": "چاکی واڑا", + "Roman Urdu": "Chakiwara", + "English": "Chakiwara" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "allama_iqbal_colony", + "label": { + "Urdu": "علامہ اقبال کالونی", + "Roman Urdu": "Allama Iqbal Colony", + "English": "Allama Iqbal Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "model_colony", + "label": { + "Urdu": "موڈل کالونی", + "Roman Urdu": "Model Colony", + "English": "Model Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "kala_board", + "label": { + "Urdu": "کالا بورڈ", + "Roman Urdu": "Kala Board", + "English": "Kala Board" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "saudabad", + "label": { + "Urdu": "سعودآباد", + "Roman Urdu": "Saudabad", + "English": "Saudabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "khokhra_par", + "label": { + "Urdu": "کھوکھرا پار", + "Roman Urdu": "Khokhra Par", + "English": "Khokhra Par" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "jafar_e_tayyar", + "label": { + "Urdu": "جعفر تیار", + "Roman Urdu": "Jafar-e-Tayyar", + "English": "Jafar-e-Tayyar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "gharibabad", + "label": { + "Urdu": "غریب آباد", + "Roman Urdu": "Gharibabad", + "English": "Gharibabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "ghazi_brohi_goth", + "label": { + "Urdu": "غازی بروہی گوٹھ", + "Roman Urdu": "Ghazi Brohi Goth", + "English": "Ghazi Brohi Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "kalyana", + "label": { + "Urdu": "کالیانہ", + "Roman Urdu": "Kalyana", + "English": "Kalyana" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "sir_syed_colony", + "label": { + "Urdu": "سر سید کالونی", + "Roman Urdu": "Sir Syed Colony", + "English": "Sir Syed Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "fatima_jinnah_colony", + "label": { + "Urdu": "فاطمہ جناح کالونی", + "Roman Urdu": "Fatima Jinnah Colony", + "English": "Fatima Jinnah Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "godhra", + "label": { + "Urdu": "گودھرا", + "Roman Urdu": "Godhra", + "English": "Godhra" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "abu_zar_ghaffari", + "label": { + "Urdu": "ابو زر غفاری", + "Roman Urdu": "Abu Zar Ghaffari", + "English": "Abu Zar Ghaffari" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "hakim_ahsan", + "label": { + "Urdu": "حاکم احسان", + "Roman Urdu": "Hakim Ahsan", + "English": "Hakim Ahsan" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "madina_colony", + "label": { + "Urdu": "مدینہ کالونی", + "Roman Urdu": "Madina Colony", + "English": "Madina Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "faisal_colony", + "label": { + "Urdu": "فیصل کالونی", + "Roman Urdu": "Faisal Colony", + "English": "Faisal Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "khamiso_goth", + "label": { + "Urdu": "خمیسو گوٹھ", + "Roman Urdu": "Khamiso Goth", + "English": "Khamiso Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "mustufa_colony", + "label": { + "Urdu": "مصطفی کالونی", + "Roman Urdu": "Mustufa Colony", + "English": "Mustufa Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "khawaja_ajmeer_nagri", + "label": { + "Urdu": "خواجہ اجمیر نگری", + "Roman Urdu": "Khawaja Ajmeer Nagri", + "English": "Khawaja Ajmeer Nagri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "gulshan_e_saeed", + "label": { + "Urdu": "گلشن سعید", + "Roman Urdu": "Gulshan-e-Saeed", + "English": "Gulshan-e-Saeed" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "shah_nawaz_bhutto_colony", + "label": { + "Urdu": "شاہ نواز بھٹو کالونی", + "Roman Urdu": "Shah Nawaz Bhutto Colony", + "English": "Shah Nawaz Bhutto Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "paposh_nagar", + "label": { + "Urdu": "پاپوش نگر", + "Roman Urdu": "Paposh Nagar", + "English": "Paposh Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "pahar_ganj", + "label": { + "Urdu": "پہاڑ گنج", + "Roman Urdu": "Pahar Ganj", + "English": "Pahar Ganj" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "khandu_goth", + "label": { + "Urdu": "کھنڑو گوٹھ", + "Roman Urdu": "Khandu Goth", + "English": "Khandu Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "hyderi", + "label": { + "Urdu": "حیدری", + "Roman Urdu": "Hyderi", + "English": "Hyderi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "sakhi_hassan", + "label": { + "Urdu": "سخی حسن", + "Roman Urdu": "Sakhi Hassan", + "English": "Sakhi Hassan" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "farooq_e_azam", + "label": { + "Urdu": "فاروق اعظم", + "Roman Urdu": "Farooq-e-Azam", + "English": "Farooq-e-Azam" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "nusrat_bhutto_colony", + "label": { + "Urdu": "نصرت بھٹو کالونی", + "Roman Urdu": "Nusrat Bhutto Colony", + "English": "Nusrat Bhutto Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "shadman_town", + "label": { + "Urdu": "شادمان ٹاوَن", + "Roman Urdu": "Shadman Town", + "English": "Shadman Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "buffer_zone", + "label": { + "Urdu": "بفرزون", + "Roman Urdu": "Buffer Zone", + "English": "Buffer Zone" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "buffer_zone_ii", + "label": { + "Urdu": "بفرزون 2", + "Roman Urdu": "Buffer Zone II", + "English": "Buffer Zone II" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "mominabad", + "label": { + "Urdu": "مومن آباد", + "Roman Urdu": "Mominabad", + "English": "Mominabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "haryana_colony", + "label": { + "Urdu": "حریانہ کالونی", + "Roman Urdu": "Haryana Colony", + "English": "Haryana Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "hanifabad", + "label": { + "Urdu": "حنیف آباد", + "Roman Urdu": "Hanifabad", + "English": "Hanifabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "mohammad_nagar", + "label": { + "Urdu": "محمد نگر", + "Roman Urdu": "Mohammad Nagar", + "English": "Mohammad Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "madina_colony_orangi", + "label": { + "Urdu": "مدینہ کالونی اورنگی", + "Roman Urdu": "Madina Colony Orangi", + "English": "Madina Colony Orangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "ghaziabad", + "label": { + "Urdu": "غازی آباد", + "Roman Urdu": "Ghaziabad", + "English": "Ghaziabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "chisti_nagar", + "label": { + "Urdu": "چشتی نگر", + "Roman Urdu": "Chisti Nagar", + "English": "Chisti Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "bilal_colony_orangi", + "label": { + "Urdu": "بلال کالونی اورنگی", + "Roman Urdu": "Bilal Colony Orangi", + "English": "Bilal Colony Orangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "iqbal_baloch_colony", + "label": { + "Urdu": "اقبال بلوچ کالونی", + "Roman Urdu": "Iqbal Baloch Colony", + "English": "Iqbal Baloch Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "ghabool_town", + "label": { + "Urdu": "گبول ٹاوَن", + "Roman Urdu": "Ghabool Town", + "English": "Ghabool Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "data_nagar", + "label": { + "Urdu": "داتا نگر", + "Roman Urdu": "Data Nagar", + "English": "Data Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "mujahidabad", + "label": { + "Urdu": "مجاہد آباد", + "Roman Urdu": "Mujahidabad", + "English": "Mujahidabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "baloch_goth", + "label": { + "Urdu": "بلوچ گوٹھ", + "Roman Urdu": "Baloch Goth", + "English": "Baloch Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "old_haji_camp", + "label": { + "Urdu": "پرانہ حاجی کیمپ", + "Roman Urdu": "Old Haji Camp", + "English": "Old Haji Camp" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "garden", + "label": { + "Urdu": "گارڈن", + "Roman Urdu": "Garden", + "English": "Garden" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "kharadar", + "label": { + "Urdu": "کھارادر", + "Roman Urdu": "Kharadar", + "English": "Kharadar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "city_railway_colony", + "label": { + "Urdu": "سٹی ریلوے کالونی", + "Roman Urdu": "City Railway Colony", + "English": "City Railway Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "nanak_wara", + "label": { + "Urdu": "ناناک واڑا", + "Roman Urdu": "Nanak Wara", + "English": "Nanak Wara" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "gazdarabad", + "label": { + "Urdu": "گزدرآباد", + "Roman Urdu": "Gazdarabad", + "English": "Gazdarabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "millat_nagar_islam_pura", + "label": { + "Urdu": "ملت نگر اسلام پورا", + "Roman Urdu": "Millat Nagar/Islam Pura", + "English": "Millat Nagar/Islam Pura" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "saddar_uc", + "label": { + "Urdu": "صدر یو سی", + "Roman Urdu": "Saddar UC", + "English": "Saddar UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "civil_line", + "label": { + "Urdu": "سول لائن", + "Roman Urdu": "Civil Line", + "English": "Civil Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "clifton", + "label": { + "Urdu": "کلفٹن", + "Roman Urdu": "Clifton", + "English": "Clifton" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "kehkashan", + "label": { + "Urdu": "کہکشان", + "Roman Urdu": "Kehkashan", + "English": "Kehkashan" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "natha_khan_goth", + "label": { + "Urdu": "ناتھا خان گوٹھ", + "Roman Urdu": "Natha Khan Goth", + "English": "Natha Khan Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "pak_sadat_colony", + "label": { + "Urdu": "پاک صدر کالونی", + "Roman Urdu": "Pak Sadat Colony", + "English": "Pak Sadat Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "drigh_colony", + "label": { + "Urdu": "ڈرگ کالونی", + "Roman Urdu": "Drigh Colony", + "English": "Drigh Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "raita_plot", + "label": { + "Urdu": "رائتا پلاٹ", + "Roman Urdu": "Raita Plot", + "English": "Raita Plot" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "moria_khan_goth", + "label": { + "Urdu": "موریا خان گوٹھ", + "Roman Urdu": "Moria Khan Goth", + "English": "Moria Khan Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "rafa_e_aam_society", + "label": { + "Urdu": "رفا عام سوسا ئٹی", + "Roman Urdu": "Rafa-e-Aam Society", + "English": "Rafa-e-Aam Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "al_falah_society", + "label": { + "Urdu": "الفلاح سوسا ئٹی", + "Roman Urdu": "Al-Falah Society", + "English": "Al-Falah Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "pak_colony", + "label": { + "Urdu": "پاک کالونی", + "Roman Urdu": "Pak Colony", + "English": "Pak Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "old_golimar", + "label": { + "Urdu": "پرانہ گولی مار", + "Roman Urdu": "Old Golimar", + "English": "Old Golimar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "jahanabad", + "label": { + "Urdu": "جہان آباد", + "Roman Urdu": "Jahanabad", + "English": "Jahanabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "metrovil", + "label": { + "Urdu": "میٹروویل", + "Roman Urdu": "Metrovil", + "English": "Metrovil" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "bhawani_chali", + "label": { + "Urdu": "بہوانی چالی", + "Roman Urdu": "Bhawani Chali", + "English": "Bhawani Chali" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "frontier_colony", + "label": { + "Urdu": "فرونٹر کالونی", + "Roman Urdu": "Frontier Colony", + "English": "Frontier Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "banaras_colony", + "label": { + "Urdu": "بنارس کالونی", + "Roman Urdu": "Banaras Colony", + "English": "Banaras Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "qasba_colony", + "label": { + "Urdu": "قصبہ کالونی", + "Roman Urdu": "Qasba Colony", + "English": "Qasba Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "islamia_colony", + "label": { + "Urdu": "اسلامیہ کالونی", + "Roman Urdu": "Islamia Colony", + "English": "Islamia Colony" + } + }, + { + "province": "na", + "city": "na", + "town": "na", + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + }, + { + "province": "na", + "city": "na", + "town": "na", + "name": "not_applicable", + "label": { + "Urdu": "قابل اطلاق نہیں", + "Roman Urdu": "Qaabil-e-atlaaq nahi", + "English": "Not Applicable" + } + } + ], + "gender": [ + { + "instance": { + "openmrs_code": "1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "male", + "label": { + "Urdu": "مرد/ لڑکا", + "Roman Urdu": "Mard/larka", + "English": "Male" + } + }, + { + "instance": { + "openmrs_code": "1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "female", + "label": { + "Urdu": "عورت/لڑکی", + "Roman Urdu": "Aurat/larki", + "English": "Female" + } + }, + { + "instance": { + "openmrs_code": "163163AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "transgender", + "label": { + "Urdu": "خواجہ سرہ", + "Roman Urdu": "Khwaja sira", + "English": "Transgender" + } + } + ], + "vaccines": [ + { + "instance": { + "openmrs_code": "1570AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "bcg", + "label": { + "Urdu": "بی سی جی", + "Roman Urdu": "BCG", + "English": "BCG" + } + }, + { + "instance": { + "openmrs_code": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv0", + "label": { + "Urdu": "او پی وی 0", + "Roman Urdu": "OPV 0", + "English": "OPV 0" + } + }, + { + "instance": { + "openmrs_code": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pcv1", + "label": { + "Urdu": "پی سی وی 1", + "Roman Urdu": "PCV 1", + "English": "PCV 1" + } + }, + { + "instance": { + "openmrs_code": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv1", + "label": { + "Urdu": "او پی وی 1", + "Roman Urdu": "OPV 1", + "English": "OPV 1" + } + }, + { + "instance": { + "openmrs_code": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "penta11", + "label": { + "Urdu": "پینٹا ویلنٹ 1", + "Roman Urdu": "Pentavalent 1", + "English": "Pentavalent 1" + } + }, + { + "instance": { + "openmrs_code": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pcv2", + "label": { + "Urdu": "پی سی وی 2", + "Roman Urdu": "PCV 2", + "English": "PCV 2" + } + }, + { + "instance": { + "openmrs_code": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv2", + "label": { + "Urdu": "او پی وی 2", + "Roman Urdu": "OPV 2", + "English": "OPV 2" + } + }, + { + "instance": { + "openmrs_code": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "penta12", + "label": { + "Urdu": "پینٹا ویلنٹ 2", + "Roman Urdu": "Pentavalent 2", + "English": "Pentavalent 2" + } + }, + { + "instance": { + "openmrs_code": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pcv3", + "label": { + "Urdu": "پی سی وی 3", + "Roman Urdu": "PCV 3", + "English": "PCV 3" + } + }, + { + "instance": { + "openmrs_code": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv3", + "label": { + "Urdu": "او پی وی 3", + "Roman Urdu": "OPV 3", + "English": "OPV 3" + } + }, + { + "instance": { + "openmrs_code": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "penta13", + "label": { + "Urdu": "پینٹا ویلنٹ 3", + "Roman Urdu": "Pentavalent 3", + "English": "Pentavalent 3" + } + }, + { + "instance": { + "openmrs_code": "82242AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "ipv", + "label": { + "Urdu": "آئی پی وی", + "Roman Urdu": "IPV", + "English": "IPV" + } + }, + { + "instance": { + "openmrs_code": "79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "measles1", + "label": { + "Urdu": "خسرہ 1", + "Roman Urdu": "Khasra 1", + "English": "Measles 1" + } + }, + { + "instance": { + "openmrs_code": "79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "measles2", + "label": { + "Urdu": "خسرہ 2", + "Roman Urdu": "Khasra 2", + "English": "Measles 2" + } + } + ], + "towns": [ + { + "province": "sindh", + "city": "karachi", + "name": "korangi", + "label": { + "Urdu": "کورنگی", + "Roman Urdu": "Korangi", + "English": "Korangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "landhi", + "label": { + "Urdu": "لانڈھی", + "Roman Urdu": "Landhi", + "English": "Landhi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "baldia", + "label": { + "Urdu": "بلدیہ", + "Roman Urdu": "Baldia", + "English": "Baldia" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "bin_qasim", + "label": { + "Urdu": "بن قاسم", + "Roman Urdu": "Bin Qasim", + "English": "Bin Qasim" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "gadap", + "label": { + "Urdu": "گڈاپ", + "Roman Urdu": "Gadap", + "English": "Gadap" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "gulberg", + "label": { + "Urdu": "گلبرگ", + "Roman Urdu": "Gulberg", + "English": "Gulberg" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "gulshan", + "label": { + "Urdu": "گلشن", + "Roman Urdu": "Gulshan", + "English": "Gulshan" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "jamshed", + "label": { + "Urdu": "جمشید", + "Roman Urdu": "Jamshed", + "English": "Jamshed" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "kiamari", + "label": { + "Urdu": "کیماری", + "Roman Urdu": "Kiamari", + "English": "Kiamari" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "liaquatabad", + "label": { + "Urdu": "لیاقت آباد", + "Roman Urdu": "Liaquatabad", + "English": "Liaquatabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "lyari", + "label": { + "Urdu": "لیاری", + "Roman Urdu": "Lyari", + "English": "Lyari" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "malir", + "label": { + "Urdu": "ملیر", + "Roman Urdu": "Malir", + "English": "Malir" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "new_karachi", + "label": { + "Urdu": "نیو کراچی", + "Roman Urdu": "New Karachi", + "English": "New Karachi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "north_nazimabad", + "label": { + "Urdu": "نارتھ ناظم آباد", + "Roman Urdu": "North Nazimabad", + "English": "North Nazimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "orangi", + "label": { + "Urdu": "اورنگی", + "Roman Urdu": "Orangi", + "English": "Orangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "saddar", + "label": { + "Urdu": "صدر", + "Roman Urdu": "Saddar", + "English": "Saddar" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "shah_faisal", + "label": { + "Urdu": "شاہ فیصل", + "Roman Urdu": "Shah Faisal", + "English": "Shah Faisal" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "site", + "label": { + "Urdu": "سائٹ", + "Roman Urdu": "S.I.T.E.", + "English": "S.I.T.E." + } + }, + { + "province": "na", + "city": "na", + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + }, + { + "province": "na", + "city": "na", + "name": "not_applicable", + "label": { + "Urdu": "قابل اطلاق نہیں", + "Roman Urdu": "Qaabil-e-atlaaq nahi", + "English": "Not Applicable" + } + } + ], + "cities": [ + { + "province": "sindh", + "name": "karachi", + "label": { + "Urdu": "کراچی", + "Roman Urdu": "Karachi", + "English": "Karachi" + } + }, + { + "province": "punjab", + "name": "hafizabad", + "label": { + "Urdu": "حافظ آباد", + "Roman Urdu": "Hafizabad", + "English": "Hafizabad" + } + }, + { + "province": "punjab", + "name": "muzaffargarh", + "label": { + "Urdu": "مظفر گڑھ", + "Roman Urdu": "Muzaffargarh", + "English": "Muzaffargarh" + } + }, + { + "province": "na", + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + }, + { + "province": "na", + "name": "not_applicable", + "label": { + "Urdu": "قابل اطلاق نہیں", + "Roman Urdu": "Qaabil-e-atlaaq nahi", + "English": "Not Applicable" + } + } + ], + "yes_no": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ] + }, + "instance": { + "encounter_type": "Off Site Child Vaccination Follow Up" + }, + "version": "201604080501", + "id_string": "offsite_child_vaccination_followup", + "type": "survey", + "children": [ + { + "type": "hidden", + "name": "provider_uc" + }, + { + "type": "hidden", + "name": "provider_town" + }, + { + "type": "hidden", + "name": "provider_city" + }, + { + "type": "hidden", + "name": "provider_province" + }, + { + "type": "hidden", + "name": "existing_first_name" + }, + { + "type": "hidden", + "name": "existing_last_name" + }, + { + "type": "hidden", + "name": "existing_mother_name" + }, + { + "type": "hidden", + "name": "existing_gender" + }, + { + "type": "hidden", + "name": "existing_client_birth_date" + }, + { + "type": "hidden", + "name": "existing_client_reg_date" + }, + { + "type": "hidden", + "name": "existing_landmark" + }, + { + "type": "hidden", + "name": "existing_house_number" + }, + { + "type": "hidden", + "name": "existing_street" + }, + { + "type": "hidden", + "name": "existing_union_council" + }, + { + "type": "hidden", + "name": "existing_town" + }, + { + "type": "hidden", + "name": "existing_city_village" + }, + { + "type": "hidden", + "name": "existing_province" + }, + { + "type": "hidden", + "name": "existing_union_councilname" + }, + { + "type": "hidden", + "name": "existing_townname" + }, + { + "type": "hidden", + "name": "existing_city_villagename" + }, + { + "type": "hidden", + "name": "existing_provincename" + }, + { + "type": "hidden", + "name": "existing_ethnicity" + }, + { + "type": "hidden", + "name": "existing_program_client_id" + }, + { + "type": "hidden", + "name": "existing_epi_card_number" + }, + { + "type": "hidden", + "name": "existing_child_was_suffering_from_a_disease_at_birth" + }, + { + "type": "hidden", + "name": "existing_reminders_approval" + }, + { + "type": "hidden", + "name": "existing_contact_phone_number" + }, + { + "type": "hidden", + "name": "e_bcg" + }, + { + "type": "hidden", + "name": "e_opv0" + }, + { + "type": "hidden", + "name": "e_penta2" + }, + { + "type": "hidden", + "name": "e_penta1" + }, + { + "type": "hidden", + "name": "e_penta3" + }, + { + "type": "hidden", + "name": "e_opv1" + }, + { + "type": "hidden", + "name": "e_opv2" + }, + { + "type": "hidden", + "name": "e_opv3" + }, + { + "type": "hidden", + "name": "e_pcv1" + }, + { + "type": "hidden", + "name": "e_pcv2" + }, + { + "type": "hidden", + "name": "e_pcv3" + }, + { + "type": "hidden", + "name": "e_measles1" + }, + { + "type": "hidden", + "name": "e_measles2" + }, + { + "type": "hidden", + "name": "e_ipv" + }, + { + "type": "hidden", + "name": "provider_id" + }, + { + "instance": { + "openmrs_entity_id": "location_id", + "openmrs_entity": "encounter" + }, + "type": "hidden", + "name": "provider_location_id" + }, + { + "type": "hidden", + "name": "provider_location_name" + }, + { + "type": "note", + "name": "provider_location_note", + "label": { + "Urdu": "شہر: ${provider_city} ; ٹائون: ${provider_town} ; یوسی: ${provider_uc} ; سینٹرکا نام: ${provider_location_name}", + "English": "City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}", + "Roman Urdu": "Shehr: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center ka Naam: ${provider_location_name}" + } + }, + { + "instance": { + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "start", + "name": "start" + }, + { + "instance": { + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "end", + "name": "end" + }, + { + "instance": { + "openmrs_entity_id": "163286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "today", + "name": "today" + }, + { + "instance": { + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "deviceid", + "name": "deviceid" + }, + { + "instance": { + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "subscriberid", + "name": "subscriberid" + }, + { + "instance": { + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "simserial", + "name": "simserial" + }, + { + "instance": { + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "phonenumber", + "name": "phonenumber" + }, + { + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "بچے کی پروگرام میں اندراج کی تاریخ: {existing_client_reg_date}$", + "Roman Urdu": "Bachay ki Program mai andraj ki tareekh: ${existing_client_reg_date}", + "English": "Child Registration date: ${existing_client_reg_date}" + }, + "type": "note", + "name": "existing_client_reg_date_note", + "hint": { + "Urdu": "بچے کو ویکسین لگنے کی تاریخ", + "Roman Urdu": "Bachay ko vaccine lagnay ki tareekh", + "English": "Date on which child was vaccinated" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "program_client_id_note", + "label": { + "Urdu": "کلائنٹ کی پروگرام ائی ڈی: {existing_program_client_id}$", + "Roman Urdu": "Client ki program ID: ${existing_program_client_id}", + "English": "Program Client ID: ${existing_program_client_id}" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "نمبر آٹھ ہندسوں پر مشتمل ہونا چاہئے", + "English": "Number should be 8 digits", + "Roman Urdu": "Number 8 hindason par mushtamil hona chahiye" + }, + "required": "yes", + "constraint": "string-length(.) = 8" + }, + "type": "integer", + "instance": { + "openmrs_entity_id": "EPI Card Number", + "openmrs_entity": "person_attribute" + }, + "name": "epi_card_number", + "label": { + "Urdu": "ای پی آئی کارڈ نمبر: {existing_epi_card_number}$", + "English": "EPI Card Number: ${existing_epi_card_number}", + "Roman Urdu": "EPI Card Number: ${existing_epi_card_number}" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "first_name_note", + "label": { + "Urdu": "نام: {existing_first_name}$", + "Roman Urdu": "Naam: ${existing_first_name}", + "English": "First Name: ${existing_first_name}" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "last_name_note", + "label": { + "Urdu": "والد کا نام: {existing_last_name}$", + "Roman Urdu": "Waalid ka naam: ${existing_last_name}", + "English": "Last name: ${existing_last_name}" + } + }, + { + "bind": { + "calculate": "int((${today} - ${existing_client_birth_date}) div 30.42)" + }, + "type": "calculate", + "name": "child_age", + "instance": { + "openmrs_entity_id": "154384AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } + }, + { + "type": "note", + "name": "calc_dob_note", + "label": { + "Urdu": "بچے کی تاریخ پیدائش: {existing_client_birth_date}$ ({child_age}$) مہینے", + "English": "Child dob: ${existing_client_birth_date} (${child_age}) months", + "Roman Urdu": "Bachay ki tareekh-e-paidaish: ${existing_client_birth_date} (${child_age}) mahinay" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "gender_note", + "label": { + "Urdu": "جنس: {existing_gender}$", + "Roman Urdu": "Jins:${existing_gender}", + "English": "Gender: ${existing_gender}" + } + }, + { + "type": "note", + "name": "mother_name_note", + "label": { + "Urdu": "ماں کا نام: {existing_mother_name}$", + "English": "Mother's Name: ${existing_mother_name}", + "Roman Urdu": "Maa ka naam: ${existing_mother_name}" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "exisiting_ethnicity_note", + "label": { + "Urdu": "قومیت: {existing_ethnicity}$", + "Roman Urdu": "Qomiat: ${existing_ethnicity}", + "English": "Ethnicity: ${existing_ethnicity}" + } + }, + { + "type": "note", + "name": "address", + "label": { + "Urdu": "موجودہ پتہ: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}", + "English": "Current Address: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}", + "Roman Urdu": "Mojooda Address: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}" + } + }, + { + "label": { + "Urdu": "کیا آپ کا گھر کا پتہ بدلا ہے؟", + "English": "Has your home address changed?", + "Roman Urdu": "Kya aap ka ghar ka pata badla hai?" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ], + "name": "address_change" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "province", + "default": "${provider_province}", + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "label": { + "Urdu": "صوبہ", + "Roman Urdu": "Suba", + "English": "Province" + }, + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "stateProvince", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one", + "children": [ + { + "name": "kpk", + "label": { + "Urdu": "خیبر پختون خواہ", + "English": "Khyber Pakhtunkhwa", + "Roman Urdu": "Khyber Pakhtunkhwa" + } + }, + { + "name": "sindh", + "label": { + "Urdu": "سندھ", + "English": "Sindh", + "Roman Urdu": "Sindh" + } + }, + { + "name": "balochistan", + "label": { + "Urdu": "بلوچستان", + "English": "Balochistan", + "Roman Urdu": "Balochistan" + } + }, + { + "name": "punjab", + "label": { + "Urdu": "پنجاب", + "English": "Punjab", + "Roman Urdu": "Punjab" + } + }, + { + "name": "gilgit_baltistan", + "label": { + "Urdu": "گلگت بلتستان", + "English": "Gilgit Baltistan", + "Roman Urdu": "Gilgit Baltistan" + } + }, + { + "name": "kashmir", + "label": { + "Urdu": "کشمیر", + "English": "Kashmir", + "Roman Urdu": "Kashmir" + } + }, + { + "name": "fata", + "label": { + "Urdu": "فاٹا", + "English": "FATA", + "Roman Urdu": "FATA" + } + }, + { + "name": "out_of_country", + "label": { + "Urdu": "ملک سے باہر", + "English": "Out of Country", + "Roman Urdu": "Out of Country" + } + } + ] + }, + { + "control": { + "appearance": "minimal" + }, + "name": "city_village", + "choice_filter": "province=${province} or province='na'", + "default": "${provider_city}", + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "label": { + "Urdu": "شہر", + "Roman Urdu": "Shehr", + "English": "City" + }, + "itemset": "cities", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "cityVillage", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "town", + "choice_filter": "(province=${province} and city=${city_village} ) or city='na'", + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "label": { + "Urdu": "ٹاٰئون/ قصبہ/ بستی", + "Roman Urdu": "Town / Qasbah / Basti", + "English": "Town" + }, + "itemset": "towns", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "town", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "union_council", + "choice_filter": "(province=${province} and city=${city_village} and town=${town}) or town='na'", + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "label": { + "Urdu": "یونین کونسل", + "Roman Urdu": "Union Council", + "English": "Union Council" + }, + "itemset": "ucs", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "subTown", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one" + }, + { + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "house", + "openmrs_entity_parent": "usual_residence" + }, + "name": "house_number", + "label": { + "Urdu": "گھر کا نمبر", + "Roman Urdu": "Ghar ka number", + "English": "House Number" + } + }, + { + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "street", + "openmrs_entity_parent": "usual_residence" + }, + "name": "street", + "label": { + "Urdu": "گلی/کالونی/محلہ", + "Roman Urdu": "Gali/Colony/Mohalla", + "English": "Street" + } + }, + { + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "landmark", + "openmrs_entity_parent": "usual_residence" + }, + "name": "landmark", + "label": { + "Urdu": "گھر کے قریب کوئی مشہور جگہ", + "Roman Urdu": "Ghar ke qareeb koi mashoor jagah", + "English": "Land Mark" + } + }, + { + "instance": { + "openmrs_entity_id": "163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "geopoint", + "name": "center_gps", + "label": { + "Urdu": "حاصل کردہ معلومات کی جگہ کے GPS کارڈینیٹس درج کریں", + "English": "Collect GPS coordinates of data entry location:", + "Roman Urdu": "Hasil karda malomaat ki jaga ke GPS coordinates darj karain" + } + }, + { + "control": { + "appearance": "minimal" + }, + "bind": { + "required": "yes" + }, + "type": "note", + "name": "child_was_suffering_from_a_disease_at_birth_note", + "label": { + "Urdu": "کیا بچہ پیدائش کے وقت کسی مرض میں مبتلا تھا؟ {existing_child_was_suffering_from_a_disease_at_birth}$", + "Roman Urdu": "Kya bacha pedaaish k waqt kissi marz mai mubtila tha? ${existing_child_was_suffering_from_a_disease_at_birth}", + "English": "Child was suffering from a disease at birth: ${existing_child_was_suffering_from_a_disease_at_birth}" + } + }, + { + "instance": { + "openmrs_entity_id": "163162AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "text", + "name": "aefi", + "label": { + "Urdu": "حفاظتی ٹیکوں کے مضر اثرات", + "English": "The temporary side-effects of immunization shots", + "Roman Urdu": "Hifazati teekon ke muzr asraat" + } + }, + { + "control": { + "appearance": "minimal" + }, + "name": "reminders_approval", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "کیا آپ اپنے بچے کی اگلی ویکسین کی تاریخ کے لیے SMS موصول کرنا چاہتے ہیں؟ {existing_reminders_approval}$", + "English": "Are you willing to receive SMS reminders for your next visit? ${existing_reminders_approval}", + "Roman Urdu": "Kya aap apnay bachay ki agli vaccine ki tareekh ke liye SMS mausool karna chahtay hain? ${existing_reminders_approval}" + }, + "instance": { + "openmrs_entity_id": "163089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ] + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "فون نمبر گیارہ ہندسوں پر مشتمل اور مندرجہ ذیل شکل میں ہونا چاہئے: *********03", + "English": "Phone number should be 11 digits in the following format: 03*********", + "Roman Urdu": "Phone number 11 hindason par mushtamil aur mundarja zail shakal main hona chahiey: 03*********" + }, + "relevant": "${existing_reminders_approval}='yes'", + "constraint": "regex(., '^03[0-9]{9}$')" + }, + "type": "text", + "instance": { + "openmrs_entity_id": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "contact_phone_number", + "label": { + "Urdu": "موبائل نمبر:{existing_contact_phone_number}$", + "English": "Mobile Number: ${existing_contact_phone_number}", + "Roman Urdu": "Mobile Number: ${existing_contact_phone_number}" + } + }, + { + "bind": { + "calculate": "${existing_client_birth_date} + 42" + }, + "type": "calculate", + "name": "six_weeks" + }, + { + "bind": { + "calculate": "${existing_client_birth_date} + 70" + }, + "type": "calculate", + "name": "ten_weeks" + }, + { + "bind": { + "calculate": "${existing_client_birth_date} + 98" + }, + "type": "calculate", + "name": "forteen_weeks" + }, + { + "bind": { + "calculate": "${existing_client_birth_date} + 245" + }, + "type": "calculate", + "name": "nine_months" + }, + { + "bind": { + "calculate": "${existing_client_birth_date} + 458" + }, + "type": "calculate", + "name": "fifteen_months" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "vaccines", + "choice_filter": "name != if( ${e_bcg} != '', 'bcg' , '') and \nname != if( ${e_opv0} != '', 'opv0' , '') and \nname != if( ${e_penta1} != '', 'penta1' , '') and \nname != if( ${e_penta2} != '', 'penta2' , '') and \nname != if( ${e_penta3} != '', 'penta3' , '') and \nname != if( ${e_opv1} != '', 'opv1' , '') and \nname != if( ${e_opv2} != '', 'opv2' , '') and \nname != if( ${e_opv3} != '', 'opv3' , '') and \nname != if( ${e_pcv1} != '', 'pcv1' , '') and \nname != if( ${e_pcv2} != '', 'pcv2' , '') and \nname != if( ${e_pcv3} != '', 'pcv3' , '') and \nname != if( ${e_ipv} != '', 'ipv' , '') and \nname != if( ${e_measles1} != '', 'measles1' , '') and \nname != if( ${e_measles2} != '', 'measles2' , '')", + "label": { + "Urdu": "پچھلی تاریخ جب کسی اور سینٹر پر ٹیکے لگواِے گیے یا قطرے پلائے گئے", + "Roman Urdu": "Pichli tareekh jab kissi aur center par teekay lagwaye gaye ya katray pilaey gaye", + "English": "Retro vaccines" + }, + "itemset": "vaccines", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1421AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "select all that apply" + }, + { + "type": "group", + "children": [ + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'bcg')", + "constraint": ".>= ${existing_client_birth_date} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "bcg_retro", + "label": { + "Urdu": "بی سی جی", + "Roman Urdu": "BCG", + "English": "BCG" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'opv0')", + "constraint": ".>= ${existing_client_birth_date} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv0_retro", + "label": { + "Urdu": "او پی وی 0", + "Roman Urdu": "OPV 0", + "English": "OPV 0" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'opv0')", + "calculate": "0" + }, + "type": "calculate", + "name": "opv0_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'pcv1')", + "constraint": ".>= ${existing_client_birth_date} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pcv1_retro", + "label": { + "Urdu": "پی سی وی 1", + "Roman Urdu": "PCV1", + "English": "PCV1" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'pcv1')", + "calculate": "1" + }, + "type": "calculate", + "name": "pcv1_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'opv1')", + "constraint": ".>= ${existing_client_birth_date} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv1_retro", + "label": { + "Urdu": "او پی وی1", + "Roman Urdu": "OPV 1", + "English": "OPV 1" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'opv1')", + "calculate": "1" + }, + "type": "calculate", + "name": "opv1_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'penta11')", + "constraint": ".>= ${existing_client_birth_date} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "penta11_retro", + "label": { + "Urdu": "پینٹا ویلنٹ 1", + "Roman Urdu": "Pentavalent 1", + "English": "Pentavalent 1" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'penta11')", + "calculate": "1" + }, + "type": "calculate", + "name": "penta11_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'pcv2')", + "constraint": ".>= ${existing_client_birth_date} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pcv2_retro", + "label": { + "Urdu": "پی سی وی 2", + "Roman Urdu": "PCV2", + "English": "PCV2" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'pcv2')", + "calculate": "2" + }, + "type": "calculate", + "name": "pcv2_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'opv2')", + "constraint": ".>= ${existing_client_birth_date} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv2_retro", + "label": { + "Urdu": "او پی وی 2", + "Roman Urdu": "OPV 2", + "English": "OPV 2" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'opv2')", + "calculate": "2" + }, + "type": "calculate", + "name": "opv2_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'penta12')", + "constraint": ".>= ${existing_client_birth_date} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "penta12_retro", + "label": { + "Urdu": "پینٹا ویلنٹ 2", + "Roman Urdu": "Pentavalent 2", + "English": "Pentavalent 2" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'penta12')", + "calculate": "2" + }, + "type": "calculate", + "name": "penta12_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'pcv3')", + "constraint": ".>= ${existing_client_birth_date} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pcv3_retro", + "label": { + "Urdu": "پی سی وی 3", + "Roman Urdu": "PCV3", + "English": "PCV3" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'penta12')", + "calculate": "3" + }, + "type": "calculate", + "name": "pcv3_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'opv3')", + "constraint": ".>= ${existing_client_birth_date} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "opv3_retro", + "label": { + "Urdu": "او پی وی3", + "Roman Urdu": "OPV 3", + "English": "OPV 3" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'opv3')", + "calculate": "3" + }, + "type": "calculate", + "name": "opv3_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'penta13')", + "constraint": ".>= ${existing_client_birth_date} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "penta13_retro", + "label": { + "Urdu": "پینٹا ویلنٹ 3", + "Roman Urdu": "Pentavalent 3", + "English": "Pentavalent 3" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'penta13')", + "calculate": "3" + }, + "type": "calculate", + "name": "penta13_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'ipv')", + "constraint": ".>= ${existing_client_birth_date} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1422AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "ipv_retro", + "label": { + "Urdu": "آئی پی وی", + "Roman Urdu": "IPV", + "English": "IPV" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'measles1')", + "constraint": ".>= ${existing_client_birth_date} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "measles1_retro", + "label": { + "Urdu": "خسرہ 1", + "Roman Urdu": "Measles 1", + "English": "Measles 1" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'measles1')", + "calculate": "1" + }, + "type": "calculate", + "name": "measles1_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "حفاظتی ٹیکا ملنے کی تاریخ، بچے کی تاریخ پیدائش کے بعد اور آج کی تاریخ سے پہلے کی ہونی چاہیے", + "English": "The date of vaccination must be greater than the child's birthdate and less than today.", + "Roman Urdu": "Hifaazati teeka milnay ki tareekh, bachay ki tareekh-e-pedaaish ke baad aur aaj ki tareekh se phlay ki honi chahiye." + }, + "relevant": "selected(${vaccines}, 'measles2')", + "constraint": ".>= ${existing_client_birth_date} and .<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "measles2_retro", + "label": { + "Urdu": "خسرہ 2", + "Roman Urdu": "Measles2", + "English": "Measles2" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'measles2')", + "calculate": "2" + }, + "type": "calculate", + "name": "measles2_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + } + ], + "name": "vaccines_group" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "vaccines_2", + "choice_filter": "name != if( ${e_bcg} != '', 'bcg' , '') and \nname != if( ${e_opv0} != '', 'opv0' , '') and \nname != if( ${e_penta2} != '', 'penta2' , '') and \nname != if( ${e_penta1} != '', 'penta1' , '') and \nname != if( ${e_penta3} != '', 'penta3' , '') and \nname != if( ${e_opv1} != '', 'opv1' , '') and \nname != if( ${e_opv2} != '', 'opv2' , '') and \nname != if( ${e_opv3} != '', 'opv3' , '') and \nname != if( ${e_pcv1} != '', 'pcv1' , '') and \nname != if( ${e_pcv2} != '', 'pcv2' , '') and \nname != if( ${e_pcv3} != '', 'pcv3' , '') and \nname != if( ${e_measles1} != '', 'measles1' , '') and \nname != if( ${e_measles2} != '', 'measles2' , '') and \nname != if(selected(${vaccines}, 'bcg'), 'bcg', '') and \nname != if(selected(${vaccines}, 'opv0'), 'opv0', '') and \nname != if(selected(${vaccines}, 'penta1'), 'penta1', '') and \nname != if(selected(${vaccines}, 'opv1'), 'opv1', '') and \nname != if(selected(${vaccines}, 'pcv1'), 'pcv1', '') and \nname != if(selected(${vaccines}, 'penta2'), 'penta2', '') and \nname != if(selected(${vaccines}, 'opv2'), 'opv2', '') and \nname != if(selected(${vaccines}, 'pcv2'), 'pcv2', '') and \nname != if(selected(${vaccines}, 'penta3'), 'penta3', '') and \nname != if(selected(${vaccines}, 'opv3'), 'opv3', '') and \nname != if(selected(${vaccines}, 'ipv'), 'ipv', '') and \nname != if(selected(${vaccines}, 'measles1'), 'measles1', '') and \nname != if(selected(${vaccines}, 'measles2'), 'measles2', '')", + "bind": { + "required": "yes", + "constraint": "if(selected(${vaccines_2}, 'bcg') or selected(${vaccines_2}, 'opv0') , .>= ${existing_client_birth_date} and .<=${today}, if(selected(${vaccines_2}, 'opv1') or selected(${vaccines_2}, 'penta11'), .>= ${six_weeks} and .<=${today}, if(selected(${vaccines_2}, 'opv2') or selected(${vaccines_2}, 'penta12'), .>=${ten_weeks} and .<=${today}, if(selected(${vaccines_2}, 'opv3') or selected(${vaccines_2}, 'penta13'), .>=${forteen_weeks} and .<=${today}, if(selected(${vaccines_2}, 'measles1'), .>=${nine_months} and .<=${today}, if(selected(${vaccines_2}, 'measles2'), .>= ${fifteen_months} and .<=${today}))))))" + }, + "label": { + "Urdu": "آج کون کون سی ویکسین دی گئی ہیں؟", + "Roman Urdu": "Aaj kon kon si vaccine di gai hain?", + "English": "Vaccines administered" + }, + "itemset": "vaccines", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1441AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "select all that apply" + }, + { + "name": "vaccination_date", + "default": "${today}", + "bind": { + "required": "yes", + "constraint": "if(selected(${vaccines_2}, 'bcg') or selected(${vaccines_2}, 'opv0') , .>= ${existing_client_birth_date} and .<=${today}, if(selected(${vaccines_2}, 'opv1') or selected(${vaccines_2}, 'penta11'), .>= ${six_weeks} and .<=${today}, if(selected(${vaccines_2}, 'opv2') or selected(${vaccines_2}, 'penta12'), .>=${ten_weeks} and .<=${today}, if(selected(${vaccines_2}, 'opv3') or selected(${vaccines_2}, 'penta13'), .>=${forteen_weeks} and .<=${today}, if(selected(${vaccines_2}, 'measles1'), .>=${nine_months} and .<=${today}, if(selected(${vaccines_2}, 'measles2'), .>= ${fifteen_months} and .<=${today}))))))" + }, + "label": { + "Urdu": "تاریخ", + "English": "Vaccination date", + "Roman Urdu": "Tareekh" + }, + "instance": { + "openmrs_entity_id": "encounter_date", + "openmrs_entity": "encounter" + }, + "type": "date" + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'bcg'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "bcg", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'opv0'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "opv0", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'opv0')", + "calculate": "0" + }, + "type": "calculate", + "name": "opv0_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'pcv1'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "pcv1", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'pcv1')", + "calculate": "1" + }, + "type": "calculate", + "name": "pcv1_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'opv1'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "opv1", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'opv1')", + "calculate": "1" + }, + "type": "calculate", + "name": "opv1_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'penta11'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "penta11", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'penta11')", + "calculate": "1" + }, + "type": "calculate", + "name": "penta11_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'pcv2'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "pcv2", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'pcv2')", + "calculate": "2" + }, + "type": "calculate", + "name": "pcv2_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'opv2'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "opv2", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'opv2')", + "calculate": "2" + }, + "type": "calculate", + "name": "opv2_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'penta12'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "penta12", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'penta12')", + "calculate": "2" + }, + "type": "calculate", + "name": "penta12_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'pcv3'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "pcv3", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'pcv3')", + "calculate": "3" + }, + "type": "calculate", + "name": "pcv3_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'opv3'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "opv3", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'opv3')", + "calculate": "3" + }, + "type": "calculate", + "name": "opv3_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'penta13'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "penta13", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'penta13')", + "calculate": "3" + }, + "type": "calculate", + "name": "penta13_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines}, 'ipv')", + "calculate": "if(selected(${vaccines_2}, 'ipv'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "ipv", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1422AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'measles1'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "measles1", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'measles1')", + "calculate": "1" + }, + "type": "calculate", + "name": "measles1_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'measles2'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "measles2", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2}, 'measles2')", + "calculate": "2" + }, + "type": "calculate", + "name": "measles2_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "control": { + "bodyless": true + }, + "type": "group", + "children": [ + { + "bind": { + "readonly": "true()", + "calculate": "concat('uuid:', uuid())" + }, + "type": "calculate", + "name": "instanceID" + } + ], + "name": "meta" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/form/offsite_child_followup/form.xml b/src/test/resources/form/offsite_child_followup/form.xml index 2042695a1..bdbd0d3b8 100644 --- a/src/test/resources/form/offsite_child_followup/form.xml +++ b/src/test/resources/form/offsite_child_followup/form.xml @@ -1,1560 +1,2358 @@ -
+ + - -

دوسرے سینٹر میں رجسٹرڈ بچّوں کا فالو اپ رجسٹر برائے ٹیکاجات - Off Site Child Follow Up Vaccination Register

+ +

دوسرے سینٹر میں رجسٹرڈ بچّوں کا فالو اپ رجسٹر برائے ٹیکاجات - Off Site Child Follow Up + Vaccination Register +

-
- - کیا آپ کا گھر کا پتہ بدلا ہے؟ - Has your home address changed? - - Kya aap ka ghar ka pata badla hai? -
- - -
-
-
-
- +
+ + + + + + + + + + + + + + +
+ + + +
diff --git a/src/test/resources/form/offsite_child_followup/form_definition.json b/src/test/resources/form/offsite_child_followup/form_definition.json index 04a8d9a53..711e06a87 100644 --- a/src/test/resources/form/offsite_child_followup/form_definition.json +++ b/src/test/resources/form/offsite_child_followup/form_definition.json @@ -1,466 +1,605 @@ { - "form_data_definition_version" : "1", - "form" : { - "bind_type" : "pkchild", - "default_bind_path" : "/model/instance/Offsite_Child_Vaccination_Followup/", - "fields" : [ { - "name" : "id", - "shouldLoadValue" : true - }, { - "name" : "provider_uc", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/provider_uc", - "shouldLoadValue" : true - }, { - "name" : "provider_town", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/provider_town", - "shouldLoadValue" : true - }, { - "name" : "provider_city", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/provider_city", - "shouldLoadValue" : true - }, { - "name" : "provider_province", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/provider_province", - "shouldLoadValue" : true - }, { - "name" : "existing_first_name", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_first_name", - "shouldLoadValue" : true - }, { - "name" : "existing_last_name", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_last_name", - "shouldLoadValue" : true - }, { - "name" : "existing_mother_name", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_mother_name", - "shouldLoadValue" : true - }, { - "name" : "existing_gender", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_gender", - "shouldLoadValue" : true - }, { - "name" : "existing_birth_date", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_client_birth_date", - "shouldLoadValue" : true - }, { - "name" : "existing_client_reg_date", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_client_reg_date", - "shouldLoadValue" : true - }, { - "name" : "existing_landmark", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_landmark", - "shouldLoadValue" : true - }, { - "name" : "existing_house_number", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_house_number", - "shouldLoadValue" : true - }, { - "name" : "existing_street", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_street", - "shouldLoadValue" : true - }, { - "name" : "existing_union_council", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_union_council", - "shouldLoadValue" : true - }, { - "name" : "existing_town", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_town", - "shouldLoadValue" : true - }, { - "name" : "existing_city_village", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_city_village", - "shouldLoadValue" : true - }, { - "name" : "existing_province", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_province", - "shouldLoadValue" : true - }, { - "name" : "existing_union_councilname", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_union_councilname", - "shouldLoadValue" : true - }, { - "name" : "existing_townname", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_townname", - "shouldLoadValue" : true - }, { - "name" : "existing_city_villagename", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_city_villagename", - "shouldLoadValue" : true - }, { - "name" : "existing_provincename", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_provincename", - "shouldLoadValue" : true - }, { - "name" : "existing_ethnicity", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_ethnicity", - "shouldLoadValue" : true - }, { - "name" : "existing_program_client_id", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_program_client_id", - "shouldLoadValue" : true - }, { - "name" : "existing_epi_card_number", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_epi_card_number", - "shouldLoadValue" : true - }, { - "name" : "existing_child_was_suffering_from_a_disease_at_birth", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_child_was_suffering_from_a_disease_at_birth", - "shouldLoadValue" : true - }, { - "name" : "existing_reminders_approval", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_reminders_approval", - "shouldLoadValue" : true - }, { - "name" : "existing_contact_phone_number", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_contact_phone_number", - "shouldLoadValue" : true - }, { - "name" : "e_bcg", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/e_bcg", - "shouldLoadValue" : true - }, { - "name" : "e_opv0", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/e_opv0", - "shouldLoadValue" : true - }, { - "name" : "e_penta2", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/e_penta2", - "shouldLoadValue" : true - }, { - "name" : "e_penta1", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/e_penta1", - "shouldLoadValue" : true - }, { - "name" : "e_penta3", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/e_penta3", - "shouldLoadValue" : true - }, { - "name" : "e_opv1", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/e_opv1", - "shouldLoadValue" : true - }, { - "name" : "e_opv2", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/e_opv2", - "shouldLoadValue" : true - }, { - "name" : "e_opv3", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/e_opv3", - "shouldLoadValue" : true - }, { - "name" : "e_pcv1", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/e_pcv1", - "shouldLoadValue" : true - }, { - "name" : "e_pcv2", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/e_pcv2", - "shouldLoadValue" : true - }, { - "name" : "e_pcv3", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/e_pcv3", - "shouldLoadValue" : true - }, { - "name" : "e_measles1", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/e_measles1", - "shouldLoadValue" : true - }, { - "name" : "e_measles2", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/e_measles2", - "shouldLoadValue" : true - }, { - "name" : "e_ipv", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/e_ipv", - "shouldLoadValue" : true - }, { - "name" : "provider_id", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/provider_id", - "shouldLoadValue" : true - }, { - "name" : "provider_location_id", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/provider_location_id", - "shouldLoadValue" : true - }, { - "name" : "provider_location_name", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/provider_location_name", - "shouldLoadValue" : true - }, { - "name" : "provider_location_note", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/provider_location_note" - }, { - "name" : "start", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/start" - }, { - "name" : "end", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/end" - }, { - "name" : "today", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/today" - }, { - "name" : "deviceid", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/deviceid" - }, { - "name" : "subscriberid", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/subscriberid" - }, { - "name" : "simserial", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/simserial" - }, { - "name" : "phonenumber", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/phonenumber" - }, { - "name" : "existing_client_reg_date_note", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/existing_client_reg_date_note" - }, { - "name" : "program_client_id_note", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/program_client_id_note" - }, { - "name" : "epi_card_number", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/epi_card_number" - }, { - "name" : "first_name_note", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/first_name_note" - }, { - "name" : "last_name_note", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/last_name_note" - }, { - "name" : "child_age", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/child_age" - }, { - "name" : "calc_dob_note", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/calc_dob_note" - }, { - "name" : "gender_note", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/gender_note" - }, { - "name" : "mother_name_note", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/mother_name_note" - }, { - "name" : "exisiting_ethnicity_note", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/exisiting_ethnicity_note" - }, { - "name" : "address", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/address" - }, { - "name" : "address_change", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/address_change" - }, { - "name" : "province", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/province" - }, { - "name" : "city_village", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/city_village" - }, { - "name" : "town", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/town" - }, { - "name" : "union_council", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/union_council" - }, { - "name" : "house_number", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/house_number" - }, { - "name" : "street", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/street" - }, { - "name" : "landmark", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/landmark" - }, { - "name" : "center_gps", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/center_gps" - }, { - "name" : "child_was_suffering_from_a_disease_at_birth_note", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/child_was_suffering_from_a_disease_at_birth_note" - }, { - "name" : "aefi", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/aefi" - }, { - "name" : "reminders_approval", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/reminders_approval" - }, { - "name" : "contact_phone_number", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/contact_phone_number" - }, { - "name" : "six_weeks", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/six_weeks" - }, { - "name" : "ten_weeks", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/ten_weeks" - }, { - "name" : "forteen_weeks", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/forteen_weeks" - }, { - "name" : "nine_months", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/nine_months" - }, { - "name" : "fifteen_months", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/fifteen_months" - }, { - "name" : "vaccines", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines" - }, { - "name" : "bcg_retro", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/bcg_retro" - }, { - "name" : "opv0_retro", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv0_retro" - }, { - "name" : "opv0_dose", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv0_dose" - }, { - "name" : "pcv1_retro", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/pcv1_retro" - }, { - "name" : "pcv1_dose", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/pcv1_dose" - }, { - "name" : "opv1_retro", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv1_retro" - }, { - "name" : "opv1_dose", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv1_dose" - }, { - "name" : "penta11_retro", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/penta11_retro" - }, { - "name" : "penta11_dose", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/penta11_dose" - }, { - "name" : "pcv2_retro", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/pcv2_retro" - }, { - "name" : "pcv2_dose", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/pcv2_dose" - }, { - "name" : "opv2_retro", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv2_retro" - }, { - "name" : "opv2_dose", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv2_dose" - }, { - "name" : "penta12_retro", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/penta12_retro" - }, { - "name" : "penta12_dose", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/penta12_dose" - }, { - "name" : "pcv3_retro", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/pcv3_retro" - }, { - "name" : "pcv3_dose", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/pcv3_dose" - }, { - "name" : "opv3_retro", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv3_retro" - }, { - "name" : "opv3_dose", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv3_dose" - }, { - "name" : "penta13_retro", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/penta13_retro" - }, { - "name" : "penta13_dose", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/penta13_dose" - }, { - "name" : "ipv_retro", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/ipv_retro" - }, { - "name" : "measles1_retro", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/measles1_retro" - }, { - "name" : "measles1_dose", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/measles1_dose" - }, { - "name" : "measles2_retro", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/measles2_retro" - }, { - "name" : "measles2_dose", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/measles2_dose" - }, { - "name" : "vaccines_2", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_2" - }, { - "name" : "vaccination_date", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/vaccination_date" - }, { - "name" : "bcg", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/bcg" - }, { - "name" : "opv0", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/opv0" - }, { - "name" : "opv0_dose_today", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/opv0_dose_today" - }, { - "name" : "pcv1", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/pcv1" - }, { - "name" : "pcv1_dose_today", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/pcv1_dose_today" - }, { - "name" : "opv1", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/opv1" - }, { - "name" : "opv1_dose_today", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/opv1_dose_today" - }, { - "name" : "penta11", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/penta11" - }, { - "name" : "penta11_dose_today", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/penta11_dose_today" - }, { - "name" : "pcv2", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/pcv2" - }, { - "name" : "pcv2_dose_today", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/pcv2_dose_today" - }, { - "name" : "opv2", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/opv2" - }, { - "name" : "opv2_dose_today", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/opv2_dose_today" - }, { - "name" : "penta12", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/penta12" - }, { - "name" : "penta12_dose_today", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/penta12_dose_today" - }, { - "name" : "pcv3", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/pcv3" - }, { - "name" : "pcv3_dose_today", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/pcv3_dose_today" - }, { - "name" : "opv3", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/opv3" - }, { - "name" : "opv3_dose_today", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/opv3_dose_today" - }, { - "name" : "penta13", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/penta13" - }, { - "name" : "penta13_dose_today", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/penta13_dose_today" - }, { - "name" : "ipv", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/ipv" - }, { - "name" : "measles1", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/measles1" - }, { - "name" : "measles1_dose_today", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/measles1_dose_today" - }, { - "name" : "measles2", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/measles2" - }, { - "name" : "measles2_dose_today", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/measles2_dose_today" - }, { - "name" : "instanceID", - "bind" : "/model/instance/Offsite_Child_Vaccination_Followup/meta/instanceID" - } ] + "form_data_definition_version": "1", + "form": { + "bind_type": "pkchild", + "default_bind_path": "/model/instance/Offsite_Child_Vaccination_Followup/", + "fields": [ + { + "name": "id", + "shouldLoadValue": true + }, + { + "name": "provider_uc", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/provider_uc", + "shouldLoadValue": true + }, + { + "name": "provider_town", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/provider_town", + "shouldLoadValue": true + }, + { + "name": "provider_city", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/provider_city", + "shouldLoadValue": true + }, + { + "name": "provider_province", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/provider_province", + "shouldLoadValue": true + }, + { + "name": "existing_first_name", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_first_name", + "shouldLoadValue": true + }, + { + "name": "existing_last_name", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_last_name", + "shouldLoadValue": true + }, + { + "name": "existing_mother_name", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_mother_name", + "shouldLoadValue": true + }, + { + "name": "existing_gender", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_gender", + "shouldLoadValue": true + }, + { + "name": "existing_birth_date", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_client_birth_date", + "shouldLoadValue": true + }, + { + "name": "existing_client_reg_date", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_client_reg_date", + "shouldLoadValue": true + }, + { + "name": "existing_landmark", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_landmark", + "shouldLoadValue": true + }, + { + "name": "existing_house_number", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_house_number", + "shouldLoadValue": true + }, + { + "name": "existing_street", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_street", + "shouldLoadValue": true + }, + { + "name": "existing_union_council", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_union_council", + "shouldLoadValue": true + }, + { + "name": "existing_town", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_town", + "shouldLoadValue": true + }, + { + "name": "existing_city_village", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_city_village", + "shouldLoadValue": true + }, + { + "name": "existing_province", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_province", + "shouldLoadValue": true + }, + { + "name": "existing_union_councilname", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_union_councilname", + "shouldLoadValue": true + }, + { + "name": "existing_townname", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_townname", + "shouldLoadValue": true + }, + { + "name": "existing_city_villagename", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_city_villagename", + "shouldLoadValue": true + }, + { + "name": "existing_provincename", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_provincename", + "shouldLoadValue": true + }, + { + "name": "existing_ethnicity", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_ethnicity", + "shouldLoadValue": true + }, + { + "name": "existing_program_client_id", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_program_client_id", + "shouldLoadValue": true + }, + { + "name": "existing_epi_card_number", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_epi_card_number", + "shouldLoadValue": true + }, + { + "name": "existing_child_was_suffering_from_a_disease_at_birth", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_child_was_suffering_from_a_disease_at_birth", + "shouldLoadValue": true + }, + { + "name": "existing_reminders_approval", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_reminders_approval", + "shouldLoadValue": true + }, + { + "name": "existing_contact_phone_number", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_contact_phone_number", + "shouldLoadValue": true + }, + { + "name": "e_bcg", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/e_bcg", + "shouldLoadValue": true + }, + { + "name": "e_opv0", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/e_opv0", + "shouldLoadValue": true + }, + { + "name": "e_penta2", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/e_penta2", + "shouldLoadValue": true + }, + { + "name": "e_penta1", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/e_penta1", + "shouldLoadValue": true + }, + { + "name": "e_penta3", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/e_penta3", + "shouldLoadValue": true + }, + { + "name": "e_opv1", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/e_opv1", + "shouldLoadValue": true + }, + { + "name": "e_opv2", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/e_opv2", + "shouldLoadValue": true + }, + { + "name": "e_opv3", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/e_opv3", + "shouldLoadValue": true + }, + { + "name": "e_pcv1", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/e_pcv1", + "shouldLoadValue": true + }, + { + "name": "e_pcv2", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/e_pcv2", + "shouldLoadValue": true + }, + { + "name": "e_pcv3", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/e_pcv3", + "shouldLoadValue": true + }, + { + "name": "e_measles1", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/e_measles1", + "shouldLoadValue": true + }, + { + "name": "e_measles2", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/e_measles2", + "shouldLoadValue": true + }, + { + "name": "e_ipv", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/e_ipv", + "shouldLoadValue": true + }, + { + "name": "provider_id", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/provider_id", + "shouldLoadValue": true + }, + { + "name": "provider_location_id", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/provider_location_id", + "shouldLoadValue": true + }, + { + "name": "provider_location_name", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/provider_location_name", + "shouldLoadValue": true + }, + { + "name": "provider_location_note", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/provider_location_note" + }, + { + "name": "start", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/start" + }, + { + "name": "end", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/end" + }, + { + "name": "today", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/today" + }, + { + "name": "deviceid", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/deviceid" + }, + { + "name": "subscriberid", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/subscriberid" + }, + { + "name": "simserial", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/simserial" + }, + { + "name": "phonenumber", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/phonenumber" + }, + { + "name": "existing_client_reg_date_note", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/existing_client_reg_date_note" + }, + { + "name": "program_client_id_note", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/program_client_id_note" + }, + { + "name": "epi_card_number", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/epi_card_number" + }, + { + "name": "first_name_note", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/first_name_note" + }, + { + "name": "last_name_note", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/last_name_note" + }, + { + "name": "child_age", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/child_age" + }, + { + "name": "calc_dob_note", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/calc_dob_note" + }, + { + "name": "gender_note", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/gender_note" + }, + { + "name": "mother_name_note", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/mother_name_note" + }, + { + "name": "exisiting_ethnicity_note", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/exisiting_ethnicity_note" + }, + { + "name": "address", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/address" + }, + { + "name": "address_change", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/address_change" + }, + { + "name": "province", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/province" + }, + { + "name": "city_village", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/city_village" + }, + { + "name": "town", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/town" + }, + { + "name": "union_council", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/union_council" + }, + { + "name": "house_number", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/house_number" + }, + { + "name": "street", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/street" + }, + { + "name": "landmark", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/landmark" + }, + { + "name": "center_gps", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/center_gps" + }, + { + "name": "child_was_suffering_from_a_disease_at_birth_note", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/child_was_suffering_from_a_disease_at_birth_note" + }, + { + "name": "aefi", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/aefi" + }, + { + "name": "reminders_approval", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/reminders_approval" + }, + { + "name": "contact_phone_number", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/contact_phone_number" + }, + { + "name": "six_weeks", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/six_weeks" + }, + { + "name": "ten_weeks", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/ten_weeks" + }, + { + "name": "forteen_weeks", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/forteen_weeks" + }, + { + "name": "nine_months", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/nine_months" + }, + { + "name": "fifteen_months", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/fifteen_months" + }, + { + "name": "vaccines", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines" + }, + { + "name": "bcg_retro", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/bcg_retro" + }, + { + "name": "opv0_retro", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv0_retro" + }, + { + "name": "opv0_dose", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv0_dose" + }, + { + "name": "pcv1_retro", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/pcv1_retro" + }, + { + "name": "pcv1_dose", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/pcv1_dose" + }, + { + "name": "opv1_retro", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv1_retro" + }, + { + "name": "opv1_dose", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv1_dose" + }, + { + "name": "penta11_retro", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/penta11_retro" + }, + { + "name": "penta11_dose", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/penta11_dose" + }, + { + "name": "pcv2_retro", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/pcv2_retro" + }, + { + "name": "pcv2_dose", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/pcv2_dose" + }, + { + "name": "opv2_retro", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv2_retro" + }, + { + "name": "opv2_dose", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv2_dose" + }, + { + "name": "penta12_retro", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/penta12_retro" + }, + { + "name": "penta12_dose", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/penta12_dose" + }, + { + "name": "pcv3_retro", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/pcv3_retro" + }, + { + "name": "pcv3_dose", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/pcv3_dose" + }, + { + "name": "opv3_retro", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv3_retro" + }, + { + "name": "opv3_dose", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/opv3_dose" + }, + { + "name": "penta13_retro", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/penta13_retro" + }, + { + "name": "penta13_dose", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/penta13_dose" + }, + { + "name": "ipv_retro", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/ipv_retro" + }, + { + "name": "measles1_retro", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/measles1_retro" + }, + { + "name": "measles1_dose", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/measles1_dose" + }, + { + "name": "measles2_retro", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/measles2_retro" + }, + { + "name": "measles2_dose", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_group/measles2_dose" + }, + { + "name": "vaccines_2", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccines_2" + }, + { + "name": "vaccination_date", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/vaccination_date" + }, + { + "name": "bcg", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/bcg" + }, + { + "name": "opv0", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/opv0" + }, + { + "name": "opv0_dose_today", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/opv0_dose_today" + }, + { + "name": "pcv1", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/pcv1" + }, + { + "name": "pcv1_dose_today", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/pcv1_dose_today" + }, + { + "name": "opv1", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/opv1" + }, + { + "name": "opv1_dose_today", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/opv1_dose_today" + }, + { + "name": "penta11", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/penta11" + }, + { + "name": "penta11_dose_today", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/penta11_dose_today" + }, + { + "name": "pcv2", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/pcv2" + }, + { + "name": "pcv2_dose_today", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/pcv2_dose_today" + }, + { + "name": "opv2", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/opv2" + }, + { + "name": "opv2_dose_today", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/opv2_dose_today" + }, + { + "name": "penta12", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/penta12" + }, + { + "name": "penta12_dose_today", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/penta12_dose_today" + }, + { + "name": "pcv3", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/pcv3" + }, + { + "name": "pcv3_dose_today", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/pcv3_dose_today" + }, + { + "name": "opv3", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/opv3" + }, + { + "name": "opv3_dose_today", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/opv3_dose_today" + }, + { + "name": "penta13", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/penta13" + }, + { + "name": "penta13_dose_today", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/penta13_dose_today" + }, + { + "name": "ipv", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/ipv" + }, + { + "name": "measles1", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/measles1" + }, + { + "name": "measles1_dose_today", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/measles1_dose_today" + }, + { + "name": "measles2", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/measles2" + }, + { + "name": "measles2_dose_today", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/measles2_dose_today" + }, + { + "name": "instanceID", + "bind": "/model/instance/Offsite_Child_Vaccination_Followup/meta/instanceID" + } + ] } } \ No newline at end of file diff --git a/src/test/resources/form/offsite_child_followup/model.xml b/src/test/resources/form/offsite_child_followup/model.xml index 93436952d..033c329d2 100644 --- a/src/test/resources/form/offsite_child_followup/model.xml +++ b/src/test/resources/form/offsite_child_followup/model.xml @@ -1,7 +1,8 @@ - + @@ -69,13 +70,20 @@
- ${provider_province} - ${provider_city} + ${provider_province} + + ${provider_city} + - - + + - + @@ -86,63 +94,117 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + ${today} - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/form/offsite_woman_followup/form.json b/src/test/resources/form/offsite_woman_followup/form.json index c5c29a415..222fed828 100644 --- a/src/test/resources/form/offsite_woman_followup/form.json +++ b/src/test/resources/form/offsite_woman_followup/form.json @@ -1 +1,3776 @@ -{"name":"Offsite_Woman_Followup_Form","title":"دوسرے سینٹر میں رجسٹرڈ خواتین فالواپ رجسٹر - Off Site Woman Follow Up Form","sms_keyword":"offsite_woman_followup_form","default_language":"English","choices":{"provinces":[{"name":"kpk","label":{"Urdu":"خیبر پختون خواہ","English":"Khyber Pakhtunkhwa","Roman Urdu":"Khyber Pakhtunkhwa"}},{"name":"sindh","label":{"Urdu":"سندھ","English":"Sindh","Roman Urdu":"Sindh"}},{"name":"balochistan","label":{"Urdu":"بلوچستان","English":"Balochistan","Roman Urdu":"Balochistan"}},{"name":"punjab","label":{"Urdu":"پنجاب","English":"Punjab","Roman Urdu":"Punjab"}},{"name":"gilgit_baltistan","label":{"Urdu":"گلگت بلتستان","English":"Gilgit Baltistan","Roman Urdu":"Gilgit Baltistan"}},{"name":"kashmir","label":{"Urdu":"کشمیر","English":"Kashmir","Roman Urdu":"Kashmir"}},{"name":"fata","label":{"Urdu":"فاٹا","English":"FATA","Roman Urdu":"FATA"}},{"name":"out_of_country","label":{"Urdu":"ملک سے باہر","English":"Out of Country","Roman Urdu":"Mulk se baahir"}}],"ucs":[{"province":"sindh","city":"karachi","town":"korangi","name":"bilal_colony","label":{"Urdu":"بلال کالونی","Roman Urdu":"Bilal Colony","English":"Bilal Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"nasir_colony","label":{"Urdu":"ناصر کالونی","Roman Urdu":"Nasir Colony","English":"Nasir Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"chakra_goth","label":{"Urdu":"چکرا گوٹھ","Roman Urdu":"Chakra Goth","English":"Chakra Goth"}},{"province":"sindh","city":"karachi","town":"korangi","name":"mustafa_taj_colony","label":{"Urdu":"مصطفی تاج کالونی","Roman Urdu":"Mustafa Taj Colony","English":"Mustafa Taj Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"hundred_quarters","label":{"Urdu":"ہنڈریڈ کوارٹر","Roman Urdu":"Hundred Quarters","English":"Hundred Quarters"}},{"province":"sindh","city":"karachi","town":"korangi","name":"gulzar_colony","label":{"Urdu":"گلزار کالونی","Roman Urdu":"Gulzar Colony","English":"Gulzar Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"korangi_sector_33","label":{"Urdu":"کورنگی سیکٹر 33","Roman Urdu":"Korangi Sector 33","English":"Korangi Sector 33"}},{"province":"sindh","city":"karachi","town":"korangi","name":"zaman_town","label":{"Urdu":"زمان ٹاوَن","Roman Urdu":"Zaman Town","English":"Zaman Town"}},{"province":"sindh","city":"karachi","town":"korangi","name":"hasrat_mohani_colony","label":{"Urdu":"حسرت موہانی کالونی","Roman Urdu":"Hasrat Mohani Colony","English":"Hasrat Mohani Colony"}},{"province":"sindh","city":"karachi","town":"baldia","name":"gulshan_e_ghazi","label":{"Urdu":"گلشن غازی","Roman Urdu":"Gulshan-e-Ghazi","English":"Gulshan-e-Ghazi"}},{"province":"sindh","city":"karachi","town":"baldia","name":"ittehad_town","label":{"Urdu":"اتحاد ٹاوَن","Roman Urdu":"Ittehad Town","English":"Ittehad Town"}},{"province":"sindh","city":"karachi","town":"baldia","name":"islam_nagar","label":{"Urdu":"اسلام نگر","Roman Urdu":"Islam Nagar","English":"Islam Nagar"}},{"province":"sindh","city":"karachi","town":"baldia","name":"nai_abadi","label":{"Urdu":"نئی آبادی","Roman Urdu":"Nai Abadi","English":"Nai Abadi"}},{"province":"sindh","city":"karachi","town":"baldia","name":"saeedabad","label":{"Urdu":"سعید آباد","Roman Urdu":"Saeedabad","English":"Saeedabad"}},{"province":"sindh","city":"karachi","town":"baldia","name":"muslim_mujahid_colony","label":{"Urdu":"مسلم مجاہد کالونی","Roman Urdu":"Muslim Mujahid Colony","English":"Muslim Mujahid Colony"}},{"province":"sindh","city":"karachi","town":"baldia","name":"muhajir_camp","label":{"Urdu":"مہاجر کیمپ","Roman Urdu":"Muhajir Camp","English":"Muhajir Camp"}},{"province":"sindh","city":"karachi","town":"baldia","name":"rasheedabad","label":{"Urdu":"رشید آباد","Roman Urdu":"Rasheedabad","English":"Rasheedabad"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"ibrahim_hyderi","label":{"Urdu":"ابراہیم حیدری","Roman Urdu":"Ibrahim Hyderi","English":"Ibrahim Hyderi"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"rehri","label":{"Urdu":"رہڑی","Roman Urdu":"Rehri","English":"Rehri"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"cattle_colony","label":{"Urdu":"کیٹل کالونی","Roman Urdu":"Cattle Colony","English":"Cattle Colony"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"qaidabad","label":{"Urdu":"قائدآباد","Roman Urdu":"Qaidabad","English":"Qaidabad"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"landhi_colony","label":{"Urdu":"لانڈھی کالونی","Roman Urdu":"Landhi Colony","English":"Landhi Colony"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"gulshan_e_hadeed","label":{"Urdu":"گلشن حدید","Roman Urdu":"Gulshan-e-Hadeed","English":"Gulshan-e-Hadeed"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"gaghar","label":{"Urdu":"گگر","Roman Urdu":"Gaghar","English":"Gaghar"}},{"province":"sindh","city":"karachi","town":"gadap","name":"murad_memon_goth","label":{"Urdu":"مراد میمن گوٹھ","Roman Urdu":"Murad Memon Goth","English":"Murad Memon Goth"}},{"province":"sindh","city":"karachi","town":"gadap","name":"darsano_chana","label":{"Urdu":"درشانو شنو","Roman Urdu":"Darsano Chana","English":"Darsano Chana"}},{"province":"sindh","city":"karachi","town":"gadap","name":"gujro","label":{"Urdu":"گجرو","Roman Urdu":"Gujro","English":"Gujro"}},{"province":"sindh","city":"karachi","town":"gadap","name":"songal","label":{"Urdu":"سنگل","Roman Urdu":"Songal","English":"Songal"}},{"province":"sindh","city":"karachi","town":"gadap","name":"maymarabad","label":{"Urdu":"معمار آباد","Roman Urdu":"Maymarabad","English":"Maymarabad"}},{"province":"sindh","city":"karachi","town":"gadap","name":"yousuf_goth","label":{"Urdu":"یوسف گوٹھ","Roman Urdu":"Yousuf Goth","English":"Yousuf Goth"}},{"province":"sindh","city":"karachi","town":"gadap","name":"manghopir","label":{"Urdu":"منگھوپیر","Roman Urdu":"Manghopir","English":"Manghopir"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"azizabad","label":{"Urdu":"عزیز آباد","Roman Urdu":"Azizabad","English":"Azizabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"karimabad","label":{"Urdu":"کریم آباد","Roman Urdu":"Karimabad","English":"Karimabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"aisha_manzil","label":{"Urdu":"عائشہ منزل","Roman Urdu":"Aisha Manzil","English":"Aisha Manzil"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"ancholi","label":{"Urdu":"انچولی","Roman Urdu":"Ancholi","English":"Ancholi"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"naseerabad","label":{"Urdu":"نصیرآباد","Roman Urdu":"Naseerabad","English":"Naseerabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"yaseenabad","label":{"Urdu":"یاسین آباد","Roman Urdu":"Yaseenabad","English":"Yaseenabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"water_pump","label":{"Urdu":"واٹرپمپ","Roman Urdu":"Water Pump","English":"Water Pump"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"shafiq_mill_colony","label":{"Urdu":"شفیق مل کالونی","Roman Urdu":"Shafiq Mill Colony","English":"Shafiq Mill Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"delhi_mercantile_society","label":{"Urdu":"دہلی مرچنٹائل سوسائٹی","Roman Urdu":"Delhi Mercantile Society","English":"Delhi Mercantile Society"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"civic_centre","label":{"Urdu":"سوک سینٹر","Roman Urdu":"Civic Centre","English":"Civic Centre"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"pir_ilahi_buksh_colony","label":{"Urdu":"پیر الہی بخش کالونی","Roman Urdu":"Pir Ilahi Buksh Colony","English":"Pir Ilahi Buksh Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"essa_nagri","label":{"Urdu":"عیسی نگری","Roman Urdu":"Essa Nagri","English":"Essa Nagri"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulshan_e_iqbal","label":{"Urdu":"گلشن اقبال","Roman Urdu":"Gulshan-e-Iqbal","English":"Gulshan-e-Iqbal"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gillani_railway_station","label":{"Urdu":"گیلانی ریلوے اسٹیشن","Roman Urdu":"Gillani Railway Station","English":"Gillani Railway Station"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"shanti_nagar","label":{"Urdu":"شانتی نگر","Roman Urdu":"Shanti Nagar","English":"Shanti Nagar"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"jamali_colony","label":{"Urdu":"جمالی کالونی","Roman Urdu":"Jamali Colony","English":"Jamali Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulshan_e_iqbal_ii","label":{"Urdu":"گلشن اقبال 2","Roman Urdu":"Gulshan-e-Iqbal II","English":"Gulshan-e-Iqbal II"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"pehlwan_goth","label":{"Urdu":"پہلوان گوٹھ","Roman Urdu":"Pehlwan Goth","English":"Pehlwan Goth"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"matrovil_colony","label":{"Urdu":"میٹروویل کالونی","Roman Urdu":"Matrovil Colony","English":"Matrovil Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulzar_e_hijri","label":{"Urdu":"گلزار ہجری","Roman Urdu":"Gulzar-e-Hijri","English":"Gulzar-e-Hijri"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"safooran_goth","label":{"Urdu":"صفورا گوٹھ","Roman Urdu":"Safooran Goth","English":"Safooran Goth"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"akhtar_colony","label":{"Urdu":"اختر کالونی","Roman Urdu":"Akhtar Colony","English":"Akhtar Colony"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"manzoor_colony","label":{"Urdu":"منظور کالونی","Roman Urdu":"Manzoor Colony","English":"Manzoor Colony"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"azam_basti","label":{"Urdu":"اعظم بستی","Roman Urdu":"Azam Basti","English":"Azam Basti"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"chanesar_goth","label":{"Urdu":"چنیسر گوٹھ","Roman Urdu":"Chanesar Goth","English":"Chanesar Goth"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"mahmudabad","label":{"Urdu":"محمودآباد","Roman Urdu":"Mahmudabad","English":"Mahmudabad"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pechs","label":{"Urdu":"پی۔ای۔سی۔ایچ۔ایس","Roman Urdu":"P.E.C.H.S.","English":"P.E.C.H.S."}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pechs_ii","label":{"Urdu":"پی۔ای۔سی۔ایچ۔ایس 2","Roman Urdu":"P.E.C.H.S. II","English":"P.E.C.H.S. II"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"jut_line","label":{"Urdu":"جٹ لائن","Roman Urdu":"Jut Line","English":"Jut Line"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"central_jacob_lines","label":{"Urdu":"سینٹرل جیکب لائن","Roman Urdu":"Central Jacob Lines","English":"Central Jacob Lines"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"jamshed_quarters","label":{"Urdu":"جمشید کوارٹر","Roman Urdu":"Jamshed Quarters","English":"Jamshed Quarters"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"garden_east","label":{"Urdu":"گارڈن ایسٹ","Roman Urdu":"Garden East","English":"Garden East"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"soldier_bazar","label":{"Urdu":"سولجر بازار","Roman Urdu":"Soldier Bazar","English":"Soldier Bazar"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pakistan_quarters","label":{"Urdu":"پاکستان کوارٹر","Roman Urdu":"Pakistan Quarters","English":"Pakistan Quarters"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"bhutta_village","label":{"Urdu":"بھٹا ولیج","Roman Urdu":"Bhutta Village","English":"Bhutta Village"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"sultanabad","label":{"Urdu":"سلطان آباد","Roman Urdu":"Sultanabad","English":"Sultanabad"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"kiamari_uc","label":{"Urdu":"کیماری یوسی","Roman Urdu":"Kiamari UC","English":"Kiamari UC"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"baba_bhit","label":{"Urdu":"بابا بھٹ","Roman Urdu":"Baba Bhit","English":"Baba Bhit"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"machar_colony","label":{"Urdu":"مچھر کالونی","Roman Urdu":"Machar Colony","English":"Machar Colony"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"maripur","label":{"Urdu":"ماڑی پور","Roman Urdu":"Maripur","English":"Maripur"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"shershah","label":{"Urdu":"شیرشاہ","Roman Urdu":"SherShah","English":"SherShah"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"gabo_pat","label":{"Urdu":"گابو پٹ","Roman Urdu":"Gabo Pat","English":"Gabo Pat"}},{"province":"sindh","city":"karachi","town":"landhi","name":"muzafarabad","label":{"Urdu":"مظفرآباد","Roman Urdu":"Muzafarabad","English":"Muzafarabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"muslimabad","label":{"Urdu":"مسلم آباد","Roman Urdu":"Muslimabad","English":"Muslimabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"dawood_chowrangi","label":{"Urdu":"داوَد چورنگی","Roman Urdu":"Dawood Chowrangi","English":"Dawood Chowrangi"}},{"province":"sindh","city":"karachi","town":"landhi","name":"moinabad","label":{"Urdu":"معین آباد","Roman Urdu":"Moinabad","English":"Moinabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"sharafi_goth","label":{"Urdu":"شرافی گوٹھ","Roman Urdu":"Sharafi Goth","English":"Sharafi Goth"}},{"province":"sindh","city":"karachi","town":"landhi","name":"bhutto_nagar","label":{"Urdu":"بھٹو نگر","Roman Urdu":"Bhutto Nagar","English":"Bhutto Nagar"}},{"province":"sindh","city":"karachi","town":"landhi","name":"khawaja_ajmeer_colony","label":{"Urdu":"خواجہ اجمیر کالونی","Roman Urdu":"Khawaja Ajmeer Colony","English":"Khawaja Ajmeer Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"landhi_uc","label":{"Urdu":"لانڈھی یوسی","Roman Urdu":"Landhi UC","English":"Landhi UC"}},{"province":"sindh","city":"karachi","town":"landhi","name":"awami_colony","label":{"Urdu":"عوامی کالونی","Roman Urdu":"Awami Colony","English":"Awami Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"burmee_colony","label":{"Urdu":"برمی کالونی","Roman Urdu":"Burmee Colony","English":"Burmee Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"korangi_uc","label":{"Urdu":"کورنگی یوسی","Roman Urdu":"Korangi UC","English":"Korangi UC"}},{"province":"sindh","city":"karachi","town":"landhi","name":"sherabad","label":{"Urdu":"شیرآباد","Roman Urdu":"Sherabad","English":"Sherabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"rizvia_society","label":{"Urdu":"رضویہ سوسائٹی","Roman Urdu":"Rizvia Society","English":"Rizvia Society"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"firdous_colony","label":{"Urdu":"فردوس کالونی","Roman Urdu":"Firdous Colony","English":"Firdous Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"super_market","label":{"Urdu":"سپر مارکیٹ","Roman Urdu":"Super Market","English":"Super Market"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"dak_khana","label":{"Urdu":"دک کھانہ","Roman Urdu":"Dak Khana","English":"Dak Khana"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"qasimabad","label":{"Urdu":"قاسم آباد","Roman Urdu":"Qasimabad","English":"Qasimabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"bandhani_colony","label":{"Urdu":"بندھانی کالونی","Roman Urdu":"Bandhani Colony","English":"Bandhani Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"sharifabad","label":{"Urdu":"شریف آباد","Roman Urdu":"Sharifabad","English":"Sharifabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"commercial_area","label":{"Urdu":"کمرشل ایریا","Roman Urdu":"Commercial Area","English":"Commercial Area"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"mujahid_colony","label":{"Urdu":"مجاہد کالونی","Roman Urdu":"Mujahid Colony","English":"Mujahid Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"nazimabad","label":{"Urdu":"ناظم آباد","Roman Urdu":"Nazimabad","English":"Nazimabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"abbasi_shaheed","label":{"Urdu":"عباسی شہید","Roman Urdu":"Abbasi Shaheed","English":"Abbasi Shaheed"}},{"province":"sindh","city":"karachi","town":"lyari","name":"agra_taj_colony","label":{"Urdu":"آگرہ تاج کالونی","Roman Urdu":"Agra Taj Colony","English":"Agra Taj Colony"}},{"province":"sindh","city":"karachi","town":"lyari","name":"daryaabad","label":{"Urdu":"دریاآباد","Roman Urdu":"Daryaabad","English":"Daryaabad"}},{"province":"sindh","city":"karachi","town":"lyari","name":"nawabad","label":{"Urdu":"نواآباد","Roman Urdu":"Nawabad","English":"Nawabad"}},{"province":"sindh","city":"karachi","town":"lyari","name":"khada_memon_society","label":{"Urdu":"خدا- میمن- سوساَٹی","Roman Urdu":"Khada Memon Society","English":"Khada Memon Society"}},{"province":"sindh","city":"karachi","town":"lyari","name":"baghdadi","label":{"Urdu":"بغدادی","Roman Urdu":"Baghdadi","English":"Baghdadi"}},{"province":"sindh","city":"karachi","town":"lyari","name":"shah_baig_line","label":{"Urdu":"شاھ باغ لائن","Roman Urdu":"Shah Baig Line","English":"Shah Baig Line"}},{"province":"sindh","city":"karachi","town":"lyari","name":"bihar_colony","label":{"Urdu":"بہار کالونی","Roman Urdu":"Bihar Colony","English":"Bihar Colony"}},{"province":"sindh","city":"karachi","town":"lyari","name":"ragiwara","label":{"Urdu":"راگی واڑا","Roman Urdu":"Ragiwara","English":"Ragiwara"}},{"province":"sindh","city":"karachi","town":"lyari","name":"singo_line","label":{"Urdu":"سنگولائن","Roman Urdu":"Singo Line","English":"Singo Line"}},{"province":"sindh","city":"karachi","town":"lyari","name":"chakiwara","label":{"Urdu":"چاکی واڑا","Roman Urdu":"Chakiwara","English":"Chakiwara"}},{"province":"sindh","city":"karachi","town":"lyari","name":"allama_iqbal_colony","label":{"Urdu":"علامہ اقبال کالونی","Roman Urdu":"Allama Iqbal Colony","English":"Allama Iqbal Colony"}},{"province":"sindh","city":"karachi","town":"malir","name":"model_colony","label":{"Urdu":"موڈل کالونی","Roman Urdu":"Model Colony","English":"Model Colony"}},{"province":"sindh","city":"karachi","town":"malir","name":"kala_board","label":{"Urdu":"کالا بورڈ","Roman Urdu":"Kala Board","English":"Kala Board"}},{"province":"sindh","city":"karachi","town":"malir","name":"saudabad","label":{"Urdu":"سعودآباد","Roman Urdu":"Saudabad","English":"Saudabad"}},{"province":"sindh","city":"karachi","town":"malir","name":"khokhra_par","label":{"Urdu":"کھوکھرا پار","Roman Urdu":"Khokhra Par","English":"Khokhra Par"}},{"province":"sindh","city":"karachi","town":"malir","name":"jafar_e_tayyar","label":{"Urdu":"جعفر تیار","Roman Urdu":"Jafar-e-Tayyar","English":"Jafar-e-Tayyar"}},{"province":"sindh","city":"karachi","town":"malir","name":"gharibabad","label":{"Urdu":"غریب آباد","Roman Urdu":"Gharibabad","English":"Gharibabad"}},{"province":"sindh","city":"karachi","town":"malir","name":"ghazi_brohi_goth","label":{"Urdu":"غازی بروہی گوٹھ","Roman Urdu":"Ghazi Brohi Goth","English":"Ghazi Brohi Goth"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"kalyana","label":{"Urdu":"کالیانہ","Roman Urdu":"Kalyana","English":"Kalyana"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"sir_syed_colony","label":{"Urdu":"سر سید کالونی","Roman Urdu":"Sir Syed Colony","English":"Sir Syed Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"fatima_jinnah_colony","label":{"Urdu":"فاطمہ جناح کالونی","Roman Urdu":"Fatima Jinnah Colony","English":"Fatima Jinnah Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"godhra","label":{"Urdu":"گودھرا","Roman Urdu":"Godhra","English":"Godhra"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"abu_zar_ghaffari","label":{"Urdu":"ابو زر غفاری","Roman Urdu":"Abu Zar Ghaffari","English":"Abu Zar Ghaffari"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"hakim_ahsan","label":{"Urdu":"حاکم احسان","Roman Urdu":"Hakim Ahsan","English":"Hakim Ahsan"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"madina_colony","label":{"Urdu":"مدینہ کالونی","Roman Urdu":"Madina Colony","English":"Madina Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"faisal_colony","label":{"Urdu":"فیصل کالونی","Roman Urdu":"Faisal Colony","English":"Faisal Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"khamiso_goth","label":{"Urdu":"خمیسو گوٹھ","Roman Urdu":"Khamiso Goth","English":"Khamiso Goth"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"mustufa_colony","label":{"Urdu":"مصطفی کالونی","Roman Urdu":"Mustufa Colony","English":"Mustufa Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"khawaja_ajmeer_nagri","label":{"Urdu":"خواجہ اجمیر نگری","Roman Urdu":"Khawaja Ajmeer Nagri","English":"Khawaja Ajmeer Nagri"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"gulshan_e_saeed","label":{"Urdu":"گلشن سعید","Roman Urdu":"Gulshan-e-Saeed","English":"Gulshan-e-Saeed"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"shah_nawaz_bhutto_colony","label":{"Urdu":"شاہ نواز بھٹو کالونی","Roman Urdu":"Shah Nawaz Bhutto Colony","English":"Shah Nawaz Bhutto Colony"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"paposh_nagar","label":{"Urdu":"پاپوش نگر","Roman Urdu":"Paposh Nagar","English":"Paposh Nagar"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"pahar_ganj","label":{"Urdu":"پہاڑ گنج","Roman Urdu":"Pahar Ganj","English":"Pahar Ganj"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"khandu_goth","label":{"Urdu":"کھنڑو گوٹھ","Roman Urdu":"Khandu Goth","English":"Khandu Goth"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"hyderi","label":{"Urdu":"حیدری","Roman Urdu":"Hyderi","English":"Hyderi"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"sakhi_hassan","label":{"Urdu":"سخی حسن","Roman Urdu":"Sakhi Hassan","English":"Sakhi Hassan"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"farooq_e_azam","label":{"Urdu":"فاروق اعظم","Roman Urdu":"Farooq-e-Azam","English":"Farooq-e-Azam"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"nusrat_bhutto_colony","label":{"Urdu":"نصرت بھٹو کالونی","Roman Urdu":"Nusrat Bhutto Colony","English":"Nusrat Bhutto Colony"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"shadman_town","label":{"Urdu":"شادمان ٹاوَن","Roman Urdu":"Shadman Town","English":"Shadman Town"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"buffer_zone","label":{"Urdu":"بفرزون","Roman Urdu":"Buffer Zone","English":"Buffer Zone"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"buffer_zone_ii","label":{"Urdu":"بفرزون 2","Roman Urdu":"Buffer Zone II","English":"Buffer Zone II"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mominabad","label":{"Urdu":"مومن آباد","Roman Urdu":"Mominabad","English":"Mominabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"haryana_colony","label":{"Urdu":"حریانہ کالونی","Roman Urdu":"Haryana Colony","English":"Haryana Colony"}},{"province":"sindh","city":"karachi","town":"orangi","name":"hanifabad","label":{"Urdu":"حنیف آباد","Roman Urdu":"Hanifabad","English":"Hanifabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mohammad_nagar","label":{"Urdu":"محمد نگر","Roman Urdu":"Mohammad Nagar","English":"Mohammad Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"madina_colony_orangi","label":{"Urdu":"مدینہ کالونی اورنگی","Roman Urdu":"Madina Colony Orangi","English":"Madina Colony Orangi"}},{"province":"sindh","city":"karachi","town":"orangi","name":"ghaziabad","label":{"Urdu":"غازی آباد","Roman Urdu":"Ghaziabad","English":"Ghaziabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"chisti_nagar","label":{"Urdu":"چشتی نگر","Roman Urdu":"Chisti Nagar","English":"Chisti Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"bilal_colony_orangi","label":{"Urdu":"بلال کالونی اورنگی","Roman Urdu":"Bilal Colony Orangi","English":"Bilal Colony Orangi"}},{"province":"sindh","city":"karachi","town":"orangi","name":"iqbal_baloch_colony","label":{"Urdu":"اقبال بلوچ کالونی","Roman Urdu":"Iqbal Baloch Colony","English":"Iqbal Baloch Colony"}},{"province":"sindh","city":"karachi","town":"orangi","name":"ghabool_town","label":{"Urdu":"گبول ٹاوَن","Roman Urdu":"Ghabool Town","English":"Ghabool Town"}},{"province":"sindh","city":"karachi","town":"orangi","name":"data_nagar","label":{"Urdu":"داتا نگر","Roman Urdu":"Data Nagar","English":"Data Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mujahidabad","label":{"Urdu":"مجاہد آباد","Roman Urdu":"Mujahidabad","English":"Mujahidabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"baloch_goth","label":{"Urdu":"بلوچ گوٹھ","Roman Urdu":"Baloch Goth","English":"Baloch Goth"}},{"province":"sindh","city":"karachi","town":"saddar","name":"old_haji_camp","label":{"Urdu":"پرانہ حاجی کیمپ","Roman Urdu":"Old Haji Camp","English":"Old Haji Camp"}},{"province":"sindh","city":"karachi","town":"saddar","name":"garden","label":{"Urdu":"گارڈن","Roman Urdu":"Garden","English":"Garden"}},{"province":"sindh","city":"karachi","town":"saddar","name":"kharadar","label":{"Urdu":"کھارادر","Roman Urdu":"Kharadar","English":"Kharadar"}},{"province":"sindh","city":"karachi","town":"saddar","name":"city_railway_colony","label":{"Urdu":"سٹی ریلوے کالونی","Roman Urdu":"City Railway Colony","English":"City Railway Colony"}},{"province":"sindh","city":"karachi","town":"saddar","name":"nanak_wara","label":{"Urdu":"ناناک واڑا","Roman Urdu":"Nanak Wara","English":"Nanak Wara"}},{"province":"sindh","city":"karachi","town":"saddar","name":"gazdarabad","label":{"Urdu":"گزدرآباد","Roman Urdu":"Gazdarabad","English":"Gazdarabad"}},{"province":"sindh","city":"karachi","town":"saddar","name":"millat_nagar_islam_pura","label":{"Urdu":"ملت نگر اسلام پورا","Roman Urdu":"Millat Nagar/Islam Pura","English":"Millat Nagar/Islam Pura"}},{"province":"sindh","city":"karachi","town":"saddar","name":"saddar_uc","label":{"Urdu":"صدر یو سی","Roman Urdu":"Saddar UC","English":"Saddar UC"}},{"province":"sindh","city":"karachi","town":"saddar","name":"civil_line","label":{"Urdu":"سول لائن","Roman Urdu":"Civil Line","English":"Civil Line"}},{"province":"sindh","city":"karachi","town":"saddar","name":"clifton","label":{"Urdu":"کلفٹن","Roman Urdu":"Clifton","English":"Clifton"}},{"province":"sindh","city":"karachi","town":"saddar","name":"kehkashan","label":{"Urdu":"کہکشان","Roman Urdu":"Kehkashan","English":"Kehkashan"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"natha_khan_goth","label":{"Urdu":"ناتھا خان گوٹھ","Roman Urdu":"Natha Khan Goth","English":"Natha Khan Goth"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"pak_sadat_colony","label":{"Urdu":"پاک صدر کالونی","Roman Urdu":"Pak Sadat Colony","English":"Pak Sadat Colony"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"drigh_colony","label":{"Urdu":"ڈرگ کالونی","Roman Urdu":"Drigh Colony","English":"Drigh Colony"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"raita_plot","label":{"Urdu":"رائتا پلاٹ","Roman Urdu":"Raita Plot","English":"Raita Plot"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"moria_khan_goth","label":{"Urdu":"موریا خان گوٹھ","Roman Urdu":"Moria Khan Goth","English":"Moria Khan Goth"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"rafa_e_aam_society","label":{"Urdu":"رفا عام سوسا ئٹی","Roman Urdu":"Rafa-e-Aam Society","English":"Rafa-e-Aam Society"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"al_falah_society","label":{"Urdu":"الفلاح سوسا ئٹی","Roman Urdu":"Al-Falah Society","English":"Al-Falah Society"}},{"province":"sindh","city":"karachi","town":"site","name":"pak_colony","label":{"Urdu":"پاک کالونی","Roman Urdu":"Pak Colony","English":"Pak Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"old_golimar","label":{"Urdu":"پرانہ گولی مار","Roman Urdu":"Old Golimar","English":"Old Golimar"}},{"province":"sindh","city":"karachi","town":"site","name":"jahanabad","label":{"Urdu":"جہان آباد","Roman Urdu":"Jahanabad","English":"Jahanabad"}},{"province":"sindh","city":"karachi","town":"site","name":"metrovil","label":{"Urdu":"میٹروویل","Roman Urdu":"Metrovil","English":"Metrovil"}},{"province":"sindh","city":"karachi","town":"site","name":"bhawani_chali","label":{"Urdu":"بہوانی چالی","Roman Urdu":"Bhawani Chali","English":"Bhawani Chali"}},{"province":"sindh","city":"karachi","town":"site","name":"frontier_colony","label":{"Urdu":"فرونٹر کالونی","Roman Urdu":"Frontier Colony","English":"Frontier Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"banaras_colony","label":{"Urdu":"بنارس کالونی","Roman Urdu":"Banaras Colony","English":"Banaras Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"qasba_colony","label":{"Urdu":"قصبہ کالونی","Roman Urdu":"Qasba Colony","English":"Qasba Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"islamia_colony","label":{"Urdu":"اسلامیہ کالونی","Roman Urdu":"Islamia Colony","English":"Islamia Colony"}},{"province":"na","city":"na","town":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","city":"na","town":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Qaabil-e-atlaaq nahi","English":"Not Applicable"}}],"gender":[{"instance":{"openmrs_code":"1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"male","label":{"Urdu":"مرد/ لڑکا","Roman Urdu":"Mard/larka","English":"Male"}},{"instance":{"openmrs_code":"1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"female","label":{"Urdu":"عورت/لڑکی","Roman Urdu":"Aurat/larki","English":"Female"}},{"instance":{"openmrs_code":"163163AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"transgender","label":{"Urdu":"خواجہ سرہ","Roman Urdu":"Khwaja sira","English":"Transgender"}}],"vaccines":[{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT1","label":{"Urdu":"ٹی ٹی 1","Roman Urdu":"TT1","English":"TT1"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT2","label":{"Urdu":"ٹی ٹی 2","Roman Urdu":"TT2","English":"TT2"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT3","label":{"Urdu":"ٹی ٹی 3","Roman Urdu":"TT3","English":"TT3"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT4","label":{"Urdu":"ٹی ٹی 4","Roman Urdu":"TT4","English":"TT4"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT5","label":{"Urdu":"ٹی ٹی 5","Roman Urdu":"TT5","English":"TT5"}}],"towns":[{"province":"sindh","city":"karachi","name":"korangi","label":{"Urdu":"کورنگی","Roman Urdu":"Korangi","English":"Korangi"}},{"province":"sindh","city":"karachi","name":"landhi","label":{"Urdu":"لانڈھی","Roman Urdu":"Landhi","English":"Landhi"}},{"province":"sindh","city":"karachi","name":"baldia","label":{"Urdu":"بلدیہ","Roman Urdu":"Baldia","English":"Baldia"}},{"province":"sindh","city":"karachi","name":"bin_qasim","label":{"Urdu":"بن قاسم","Roman Urdu":"Bin Qasim","English":"Bin Qasim"}},{"province":"sindh","city":"karachi","name":"gadap","label":{"Urdu":"گڈاپ","Roman Urdu":"Gadap","English":"Gadap"}},{"province":"sindh","city":"karachi","name":"gulberg","label":{"Urdu":"گلبرگ","Roman Urdu":"Gulberg","English":"Gulberg"}},{"province":"sindh","city":"karachi","name":"gulshan","label":{"Urdu":"گلشن","Roman Urdu":"Gulshan","English":"Gulshan"}},{"province":"sindh","city":"karachi","name":"jamshed","label":{"Urdu":"جمشید","Roman Urdu":"Jamshed","English":"Jamshed"}},{"province":"sindh","city":"karachi","name":"kiamari","label":{"Urdu":"کیماری","Roman Urdu":"Kiamari","English":"Kiamari"}},{"province":"sindh","city":"karachi","name":"liaquatabad","label":{"Urdu":"لیاقت آباد","Roman Urdu":"Liaquatabad","English":"Liaquatabad"}},{"province":"sindh","city":"karachi","name":"lyari","label":{"Urdu":"لیاری","Roman Urdu":"Lyari","English":"Lyari"}},{"province":"sindh","city":"karachi","name":"malir","label":{"Urdu":"ملیر","Roman Urdu":"Malir","English":"Malir"}},{"province":"sindh","city":"karachi","name":"new_karachi","label":{"Urdu":"نیو کراچی","Roman Urdu":"New Karachi","English":"New Karachi"}},{"province":"sindh","city":"karachi","name":"north_nazimabad","label":{"Urdu":"نارتھ ناظم آباد","Roman Urdu":"North Nazimabad","English":"North Nazimabad"}},{"province":"sindh","city":"karachi","name":"orangi","label":{"Urdu":"اورنگی","Roman Urdu":"Orangi","English":"Orangi"}},{"province":"sindh","city":"karachi","name":"saddar","label":{"Urdu":"صدر","Roman Urdu":"Saddar","English":"Saddar"}},{"province":"sindh","city":"karachi","name":"shah_faisal","label":{"Urdu":"شاہ فیصل","Roman Urdu":"Shah Faisal","English":"Shah Faisal"}},{"province":"sindh","city":"karachi","name":"site","label":{"Urdu":"سائٹ","Roman Urdu":"S.I.T.E.","English":"S.I.T.E."}},{"province":"na","city":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","city":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Qaabil-e-atlaaq nahi","English":"Not Applicable"}}],"cities":[{"province":"sindh","name":"karachi","label":{"Urdu":"کراچی","Roman Urdu":"Karachi","English":"Karachi"}},{"province":"punjab","name":"hafizabad","label":{"Urdu":"حافظ آباد","Roman Urdu":"Hafizabad","English":"Hafizabad"}},{"province":"punjab","name":"muzaffargarh","label":{"Urdu":"مظفر گڑھ","Roman Urdu":"Muzaffargarh","English":"Muzaffargarh"}},{"province":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Not Applicable","English":"Not Applicable"}}],"edd_lmp":[{"instance":{"openmrs_code":"5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"edd","label":{"Urdu":"زچگی کی متوقع تاریخ","Roman Urdu":"EDD","English":"EDD"}},{"instance":{"openmrs_code":"1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"lmp","label":{"Urdu":"پچھلی مہواری کی تاریخ","Roman Urdu":"LMP","English":"LMP"}},{"instance":{"openmrs_code":"159617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ultrasound","label":{"Urdu":"الٹرا سائونڈ","Roman Urdu":"Ultrasound","English":"Ultrasound"}},{"instance":{"openmrs_code":"1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"none","label":{"Urdu":"کوئی بھی نہیں","Roman Urdu":"Koi bhi nahi","English":"None of the above"}}],"yes_no":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}]},"instance":{"encounter_type":"Off Site Woman Follow Up"},"version":"201604080459","id_string":"offsite_woman_followup_form","type":"survey","children":[{"type":"hidden","name":"provider_uc"},{"type":"hidden","name":"provider_town"},{"type":"hidden","name":"provider_city"},{"type":"hidden","name":"provider_province"},{"type":"hidden","name":"existing_landmark"},{"type":"hidden","name":"existing_house_number"},{"type":"hidden","name":"existing_street"},{"type":"hidden","name":"existing_union_council"},{"type":"hidden","name":"existing_town"},{"type":"hidden","name":"existing_city_village"},{"type":"hidden","name":"existing_province"},{"type":"hidden","name":"existing_union_councilname"},{"type":"hidden","name":"existing_townname"},{"type":"hidden","name":"existing_city_villagename"},{"type":"hidden","name":"existing_provincename"},{"type":"hidden","name":"existing_first_name"},{"type":"hidden","name":"existing_last_name"},{"type":"hidden","name":"existing_father_name"},{"type":"hidden","name":"existing_husband_name"},{"type":"hidden","name":"existing_marriage"},{"type":"hidden","name":"existing_calc_dob_confirm"},{"type":"hidden","name":"existing_gender"},{"type":"hidden","name":"existing_ethnicity"},{"type":"hidden","name":"existing_client_reg_date"},{"type":"hidden","name":"existing_program_client_id"},{"type":"hidden","name":"existing_epi_card_number"},{"type":"hidden","name":"existing_reminders_approval"},{"type":"hidden","name":"existing_contact_phone_number"},{"type":"hidden","name":"e_tt1"},{"type":"hidden","name":"e_tt2"},{"type":"hidden","name":"e_tt3"},{"type":"hidden","name":"e_tt4"},{"type":"hidden","name":"e_tt5"},{"type":"hidden","name":"provider_id"},{"instance":{"openmrs_entity_id":"location_id","openmrs_entity":"encounter"},"type":"hidden","name":"provider_location_id"},{"type":"hidden","name":"provider_location_name"},{"type":"note","name":"provider_location_note","label":{"Urdu":"شہر: ${provider_city} ; ٹائون: ${provider_town} ; یوسی: ${provider_uc} ; سینٹرکا نام: ${provider_location_name}","English":"City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}"}},{"instance":{"openmrs_entity_id":"163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"start","name":"start"},{"instance":{"openmrs_entity_id":"163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"end","name":"end"},{"instance":{"openmrs_entity_id":"163286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"today","name":"today"},{"instance":{"openmrs_entity_id":"163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"deviceid","name":"deviceid"},{"instance":{"openmrs_entity_id":"163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"subscriberid","name":"subscriberid"},{"instance":{"openmrs_entity_id":"163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"simserial","name":"simserial"},{"instance":{"openmrs_entity_id":"163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"phonenumber","name":"phonenumber"},{"bind":{"required":"yes"},"type":"note","name":"client_reg_date_note","label":{"Urdu":"${existing_client_reg_date} :پروگرام میں اندراج کی تاریخ","Roman Urdu":"Program main andraaj ki tareekh: ${existing_client_reg_date}","English":"Client Registration date: ${existing_client_reg_date}"}},{"bind":{"required":"yes"},"type":"note","name":"program_client_id_note","label":{"Urdu":"${existing_program_client_id}:کلائنٹ کی پروگرام ائی ڈی","Roman Urdu":"Client ki program ID: ${existing_program_client_id}","English":"Program Client ID: ${existing_program_client_id}"}},{"bind":{"jr:constraintMsg":{"Urdu":"نمبر آٹھ ہندسوں پر مشتمل ہونا چاہئے","English":"Number should be 8 digits","Roman Urdu":"Number 8 hindason par mushtamil hona chahiye"},"required":"yes","constraint":"string-length(.) = 8"},"type":"integer","instance":{"openmrs_entity_id":"EPI Card Number","openmrs_entity":"person_attribute"},"name":"epi_card_number","label":{"Urdu":"ای پی آئی کارڈ نمبر: {existing_epi_card_number}$","English":"EPI Card Number: ${existing_epi_card_number}","Roman Urdu":"EPI Card Number: ${existing_epi_card_number}"}},{"bind":{"required":"yes"},"type":"note","name":"first_name_note","label":{"Urdu":"${existing_first_name}: نام","Roman Urdu":"Naam: ${existing_first_name}","English":"First Name: ${existing_first_name}"}},{"bind":{"required":"yes"},"type":"note","name":"last_name_note","label":{"Urdu":"والد کا نام: ${existing_last_name}","Roman Urdu":"Waalid ka naam: ${existing_last_name}","English":"Last name: ${existing_last_name}"}},{"bind":{"calculate":"date( today() - (${existing_calc_dob_confirm} div 365))"},"type":"calculate","name":"client_age","instance":{"openmrs_entity_id":"154384AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"type":"note","name":"birth_date_note","label":{"Urdu":"تاریخِ پیدائش: {existing_calc_dob_confirm}$ ({client_age}$) سال","English":"Birth date: ${existing_calc_dob_confirm} (${client_age}) years","Roman Urdu":"Tareekh-e-pedaaish: ${existing_calc_dob_confirm} (${client_age}) years"}},{"bind":{"required":"yes"},"type":"note","name":"gender_note","label":{"Urdu":"${existing_gender}: جنس","Roman Urdu":"Jins:${existing_gender}","English":"Gender: ${existing_gender}"}},{"type":"note","name":"father_name_note","label":{"Urdu":"والد کا نام: {existing_father_name}$","English":"Father's Name: ${existing_father_name}","Roman Urdu":"Waalid ka naam: ${existing_father_name}"}},{"type":"note","name":"marriage_note","label":{"Urdu":"شادی شدہ: {existing_marriage}$","English":"Married: ${existing_marriage}","Roman Urdu":"Shaadi shuda: ${existing_marriage}"}},{"type":"note","name":"husband_name_note","label":{"Urdu":"شوہر کا نام: {existing_husband_name}$","English":"Husband's name: ${existing_husband_name}","Roman Urdu":"Shohar ka naam: ${existing_husband_name}"}},{"bind":{"required":"yes"},"type":"note","name":"ethnicity_note","label":{"Urdu":"قومیت: {existing_ethnicity}$","Roman Urdu":"Qomiat: ${existing_ethnicity}","English":"Ethnicity: ${existing_ethnicity}"}},{"type":"note","name":"address","label":{"Urdu":"موجودہ پتہ: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}","English":"Current Address: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}","Roman Urdu":"Mojooda Address: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}"}},{"label":{"Urdu":"کیا آپ کا گھر کا پتہ بدلا ہے؟","English":"Has your home address changed?","Roman Urdu":"Kya aap ka ghar ka pata badla hai?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}],"name":"address_change"},{"control":{"appearance":"minimal"},"name":"province","default":"${provider_province}","bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"label":{"Urdu":"صوبہ","Roman Urdu":"Suba","English":"Province"},"instance":{"openmrs_entity":"person_address","openmrs_entity_id":"stateProvince","openmrs_entity_parent":"usual_residence"},"type":"select one","children":[{"name":"kpk","label":{"Urdu":"خیبر پختون خواہ","English":"Khyber Pakhtunkhwa","Roman Urdu":"Khyber Pakhtunkhwa"}},{"name":"sindh","label":{"Urdu":"سندھ","English":"Sindh","Roman Urdu":"Sindh"}},{"name":"balochistan","label":{"Urdu":"بلوچستان","English":"Balochistan","Roman Urdu":"Balochistan"}},{"name":"punjab","label":{"Urdu":"پنجاب","English":"Punjab","Roman Urdu":"Punjab"}},{"name":"gilgit_baltistan","label":{"Urdu":"گلگت بلتستان","English":"Gilgit Baltistan","Roman Urdu":"Gilgit Baltistan"}},{"name":"kashmir","label":{"Urdu":"کشمیر","English":"Kashmir","Roman Urdu":"Kashmir"}},{"name":"fata","label":{"Urdu":"فاٹا","English":"FATA","Roman Urdu":"FATA"}},{"name":"out_of_country","label":{"Urdu":"ملک سے باہر","English":"Out of Country","Roman Urdu":"Mulk se baahir"}}]},{"control":{"appearance":"minimal"},"name":"city_village","choice_filter":"province=${province} or province='na'","default":"${provider_city}","bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"label":{"Urdu":"شہر","Roman Urdu":"Shehr","English":"City"},"itemset":"cities","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"cityVillage","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"control":{"appearance":"minimal"},"name":"town","choice_filter":"(province=${province} and city=${city_village} ) or city='na'","bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"label":{"Urdu":"ٹاٰئون/ قصبہ/ بستی","Roman Urdu":"Town / Qasbah / Basti","English":"Town"},"itemset":"towns","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"town","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"control":{"appearance":"minimal"},"name":"union_council","choice_filter":"(province=${province} and city=${city_village} and town=${town}) or town='na'","bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"label":{"Urdu":"یونین کونسل","Roman Urdu":"Union Council","English":"Union Council"},"itemset":"ucs","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"subTown","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"house","openmrs_entity_parent":"usual_residence"},"name":"house_number","label":{"Urdu":"گھر کا نمبر","Roman Urdu":"Ghar ka number","English":"House Number"}},{"bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"street","openmrs_entity_parent":"usual_residence"},"name":"street","label":{"Urdu":"گلی/کالونی/محلہ","Roman Urdu":"Gali/Colony/Mohalla","English":"Street"}},{"bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"landmark","openmrs_entity_parent":"usual_residence"},"name":"landmark","label":{"Urdu":"گھر کے قریب کوئی مشہور جگہ","Roman Urdu":"Ghar ke qareeb koi mashoor jagah","English":"Land Mark"}},{"instance":{"openmrs_entity_id":"163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"geopoint","name":"center_gps","label":{"Urdu":"حاصل کردہ معلومات کی جگہ کے GPS کارڈینیٹس درج کریں","English":"Collect GPS coordinates of data entry location:","Roman Urdu":"Hasil karda malomaat ki jaga ke GPS coordinates darj karain"}},{"control":{"appearance":"minimal"},"name":"reminders_approval","bind":{"required":"yes"},"label":{"Urdu":"کیا آپ اپنے بچے کی اگلی ویکسین کی تاریخ کے لیے SMS موصول کرنا چاہتے ہیں؟ {existing_reminders_approval}$","English":"Are you willing to receive SMS reminders for your next visit? ${existing_reminders_approval}","Roman Urdu":"Kya aap apnay bachay ki agli vaccine ki tareekh ke liye SMS mausool karna chahtay hain? ${existing_reminders_approval}"},"instance":{"openmrs_entity_id":"163089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}]},{"bind":{"jr:constraintMsg":{"Urdu":"فون نمبر گیارہ ہندسوں پر مشتمل اور مندرجہ ذیل شکل میں ہونا چاہئے: *********03","English":"Phone number should be 11 digits in the following format: 03*********","Roman Urdu":"Phone number 11 hindason par mushtamil aur mundarja zail shakal main hona chahiey: 03*********"},"relevant":"${existing_reminders_approval}='yes'","constraint":"regex(., '^03[0-9]{9}$')"},"type":"text","instance":{"openmrs_entity_id":"159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"contact_phone_number","label":{"Urdu":"موبائل نمبر:{existing_contact_phone_number}$","English":"Mobile Number: ${existing_contact_phone_number}","Roman Urdu":"Mobile Number: ${existing_contact_phone_number}"}},{"instance":{"openmrs_entity_id":"5272AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"label":{"Urdu":"کیا خا تون حاملہ ہیں؟","English":"Is female pregnant?","Roman Urdu":"Kia khatoon haamla hain?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}],"name":"pregnant"},{"name":"edd_lmp","bind":{"relevant":"selected (${pregnant}, 'yes')"},"label":{"Urdu":"کیا آپ کو اپنی پچھلی ماہواری کی تاریخ، زچگی کی متوقع تاریخ، یا الٹرا سائونڈ کا علم ہے؟","English":"Do you know your LMP, EDD or last Ultrasound information?","Roman Urdu":"Kya aap ko apni pichli mahwaari ki tareekh, zachgi ki mutawaqqa tareekh ya ultrasound ka ilm hai?"},"instance":{"openmrs_entity_id":"160697AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"edd","label":{"Urdu":"زچگی کی متوقع تاریخ","Roman Urdu":"EDD","English":"EDD"}},{"instance":{"openmrs_code":"1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"lmp","label":{"Urdu":"پچھلی مہواری کی تاریخ","Roman Urdu":"LMP","English":"LMP"}},{"instance":{"openmrs_code":"159617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ultrasound","label":{"Urdu":"الٹرا سائونڈ","Roman Urdu":"Ultrasound","English":"Ultrasound"}},{"instance":{"openmrs_code":"1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"none","label":{"Urdu":"کوئی بھی نہیں","Roman Urdu":"Koi bhi nahi","English":"None of the above"}}]},{"bind":{"jr:constraintMsg":{"Urdu":"زچگی کی متوقع تاریخ ماضی کی نہیں ہو سکتی","Roman Urdu":"Zachgi ki mutawaqqa tareekh maazi ki nahi hosakti","English":"EDD cannot be in the past"},"relevant":"selected (${edd_lmp}, 'edd')","constraint":".>=${today}"},"type":"date","name":"edd","label":{"Urdu":"زچگی کی متوقع تاریخ","Roman Urdu":"Zachgi ki mutawaqqa tareekh","English":"EDD"}},{"bind":{"jr:constraintMsg":{"Urdu":"پچھلی ماہواری کی تاریخ مستقبل کی نہیں ہوسکتی","Roman Urdu":"Pichli mahwaari ki tareekh mustaqbil ki nahi hosakti","English":"LMP cannot be in the future"},"relevant":"selected (${edd_lmp}, 'lmp')","constraint":".<=${today}"},"type":"date","name":"lmp","label":{"Urdu":"پچھلی ماہواری کی تاریخ","Roman Urdu":"Pichli mahwaari ki tareekh","English":"LMP"}},{"bind":{"relevant":"selected (${edd_lmp}, 'ultrasound')"},"type":"date","instance":{"openmrs_entity_id":"163165AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"ultrasound_date","label":{"Urdu":"الٹرا سائونڈ کی تاریخ","English":"Ultrasound Date","Roman Urdu":"Ultrasound ki tareekh"}},{"bind":{"relevant":"selected (${edd_lmp}, 'ultrasound')"},"type":"integer","name":"ultrasound_weeks","label":{"Urdu":"الٹرا سائونڈ کی مدد سے حمل کی مدت [ہفتوں میں]","Roman Urdu":"Ultrasound ki madad se hamal ki muddat (hafton me)","English":"Gestational age determined by ultrasound"}},{"bind":{"calculate":"date(${lmp}+280)"},"type":"calculate","name":"edd_calc_lmp"},{"bind":{"calculate":"date((280-(${ultrasound_weeks}*7)+${ultrasound_date} ))"},"type":"calculate","name":"edd_calc_ultrasound"},{"bind":{"calculate":"format-date(${edd_calc_lmp}, '%Y-%n-%e')"},"type":"calculate","name":"edd_calc_lmp_formatted"},{"bind":{"calculate":"format-date(${edd_calc_ultrasound}, '%Y-%n-%e')"},"type":"calculate","name":"edd_calc_ultrasound_formatted"},{"bind":{"calculate":"date(${edd}-280)"},"type":"calculate","name":"lmp_calc_edd"},{"bind":{"calculate":"date(${ultrasound_date}-(${ultrasound_weeks}*7))"},"type":"calculate","name":"lmp_calc_ultrasound"},{"bind":{"calculate":"format-date(${lmp_calc_edd}, '%Y-%n-%e')"},"type":"calculate","name":"lmp_calc_edd_formatted"},{"bind":{"calculate":"format-date(${lmp_calc_ultrasound}, '%Y-%n-%e')"},"type":"calculate","name":"lmp_calc_ultrasound_formatted"},{"bind":{"calculate":"if(${edd_lmp}='lmp',${edd_calc_lmp_formatted},if(${edd_lmp}='edd',${edd} ,if(${edd_lmp}='ultrasound',${edd_calc_ultrasound_formatted},'')))"},"type":"calculate","name":"final_edd","instance":{"openmrs_entity_id":"5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"bind":{"calculate":"if(${edd_lmp}='lmp',${lmp},if(${edd_lmp}='edd',${lmp_calc_edd_formatted} ,if(${edd_lmp}='ultrasound',${lmp_calc_ultrasound_formatted},'')))"},"type":"calculate","name":"final_lmp","instance":{"openmrs_entity_id":"1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"bind":{"calculate":"int((${vaccination_date} - (${edd}-280))div7)"},"type":"calculate","name":"ga_edd"},{"bind":{"calculate":"int((${vaccination_date} - ${lmp})div7)"},"type":"calculate","name":"ga_lmp"},{"bind":{"calculate":"int((${vaccination_date} -(${ultrasound_date}-(${ultrasound_weeks}*7)))div7)"},"type":"calculate","name":"ga_ult"},{"bind":{"relevant":"selected (${pregnant}, 'yes')"},"type":"note","name":"final_edd_note","label":{"Urdu":"${final_edd}: زچگی کی متوقع تاریخ","Roman Urdu":"Zachgi ki mutawaqqa tareekh: ${final_edd}","English":"EDD: ${final_edd}"}},{"bind":{"relevant":"selected (${pregnant}, 'yes')"},"type":"note","name":"final_lmp_note","label":{"Urdu":"پچھلی ماہواری کی تاریخ :{final_lmp}$","Roman Urdu":"Pichli mahwaari ki tareekh: ${final_lmp}","English":"LMP: ${final_lmp}"}},{"bind":{"calculate":"if(${edd_lmp}='lmp',${ga_lmp},if(${edd_lmp}='edd',${ga_edd} ,if(${edd_lmp}='ultrasound',${ga_ult},'')))"},"type":"calculate","name":"final_ga","instance":{"openmrs_entity_id":"163166AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"bind":{"relevant":"selected (${pregnant}, 'yes')"},"type":"note","name":"final_ga_note","label":{"Urdu":"حمل کی مُدّت: {final_ga}$ ہفتے","Roman Urdu":"Hamal ki muddat: ${final_ga} weeks","English":"GA: ${final_ga} weeks"}},{"name":"vaccines","choice_filter":"name != if( ${e_tt1} != '', 'TT1' , '') and \nname != if( ${e_tt2} != '', 'TT2' , '') and \nname != if( ${e_tt3} != '', 'TT3' , '') and \nname != if( ${e_tt4} != '', 'TT4' , '') and \nname != if( ${e_tt5} != '', 'TT5' , '')","default":"minimal","label":{"Urdu":"پچھلی تاریخ جب کسی اور سینٹر پر ٹیکہ لگوایا گیا یا قطرے پلائے گئے","Roman Urdu":"Pichli tareekh jab kissi aur center par teeka lagwaya gaya ya katray pilaey gaye","English":"Retro vaccines"},"itemset":"vaccines","instance":{"openmrs_entity":"concept","openmrs_entity_id":"984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1421AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"select all that apply"},{"bind":{"relevant":"selected(${vaccines},'TT1')","constraint":"(.<=${today} and .<=${existing_client_reg_date})"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt1_retro","label":{"Urdu":"ٹی ٹی 1","Roman Urdu":"TT1","English":"TT1"}},{"bind":{"relevant":"selected(${vaccines},'TT1')","calculate":"1"},"type":"calculate","name":"tt_1_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines},'TT2')","constraint":"(.<=${today} and .>=${tt1_retro} and ((selected(${vaccines}, 'TT1'))))"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt2_retro","label":{"Urdu":"ٹی ٹی 2","Roman Urdu":"TT2","English":"TT2"}},{"bind":{"relevant":"selected(${vaccines},'TT2')","calculate":"2"},"type":"calculate","name":"tt_2_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines},'TT3')","constraint":"(.<=${today} and .>=${tt2_retro} and ((selected(${vaccines}, 'TT2'))))"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt3_retro","label":{"Urdu":"ٹی ٹی 3","Roman Urdu":"TT3","English":"TT3"}},{"bind":{"relevant":"selected(${vaccines},'TT3')","calculate":"3"},"type":"calculate","name":"tt_3_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines},'TT4')","constraint":"(.<=${today} and .>=${tt3_retro} and ((selected(${vaccines}, 'TT3'))))"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt4_retro","label":{"Urdu":"ٹی ٹی 4","Roman Urdu":"TT4","English":"TT4"}},{"bind":{"relevant":"selected(${vaccines},'TT4')","calculate":"4"},"type":"calculate","name":"tt_4_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"name":"vaccines_2","choice_filter":"name != if( ${e_tt1} != '', 'TT1' , '') and \nname != if( ${e_tt2} != '', 'TT2' , '') and \nname != if( ${e_tt3} != '', 'TT3' , '') and \nname != if( ${e_tt4} != '', 'TT4' , '') and \nname != if( ${e_tt5} != '', 'TT5' , '') and \nname != if( selected(${vaccines}, 'TT1') , 'TT1', '') and \nname != if( selected(${vaccines}, 'TT2') , 'TT2', '') and \nname != if( selected(${vaccines}, 'TT3') , 'TT3', '') and \nname != if( selected(${vaccines}, 'TT4') , 'TT4', '') and \nname != if( selected(${vaccines}, 'TT5') , 'TT5', '')","bind":{"required":"yes"},"label":{"Urdu":"آج کون کون سی ویکسین دی گئی ہیں؟","Roman Urdu":"Aaj kon kon si vaccine di gai hain?","English":"Vaccine administered today"},"itemset":"vaccines","instance":{"openmrs_entity":"concept","openmrs_entity_id":"984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1441AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"select all that apply"},{"bind":{"required":"yes"},"type":"date","instance":{"openmrs_entity_id":"encounter_date","openmrs_entity":"encounter"},"name":"vaccination_date","label":{"Urdu":"تاریخ","English":"Vaccination date","Roman Urdu":"Tareekh"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT1'),${vaccination_date},'')"},"type":"calculate","name":"tt1","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT1')","calculate":"1"},"type":"calculate","name":"tt_1_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT2'),${vaccination_date},'')"},"type":"calculate","name":"tt2","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT2')","calculate":"2"},"type":"calculate","name":"tt_2_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT3'),${vaccination_date},'')"},"type":"calculate","name":"tt3","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT3')","calculate":"3"},"type":"calculate","name":"tt_3_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT4'),${vaccination_date},'')"},"type":"calculate","name":"tt4","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT4')","calculate":"4"},"type":"calculate","name":"tt_4_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT5'),${vaccination_date},'')"},"type":"calculate","name":"tt5","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT5')","calculate":"5"},"type":"calculate","name":"tt_5_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"control":{"bodyless":true},"type":"group","children":[{"bind":{"readonly":"true()","calculate":"concat('uuid:', uuid())"},"type":"calculate","name":"instanceID"}],"name":"meta"}]} \ No newline at end of file +{ + "name": "Offsite_Woman_Followup_Form", + "title": "دوسرے سینٹر میں رجسٹرڈ خواتین فالواپ رجسٹر - Off Site Woman Follow Up Form", + "sms_keyword": "offsite_woman_followup_form", + "default_language": "English", + "choices": { + "provinces": [ + { + "name": "kpk", + "label": { + "Urdu": "خیبر پختون خواہ", + "English": "Khyber Pakhtunkhwa", + "Roman Urdu": "Khyber Pakhtunkhwa" + } + }, + { + "name": "sindh", + "label": { + "Urdu": "سندھ", + "English": "Sindh", + "Roman Urdu": "Sindh" + } + }, + { + "name": "balochistan", + "label": { + "Urdu": "بلوچستان", + "English": "Balochistan", + "Roman Urdu": "Balochistan" + } + }, + { + "name": "punjab", + "label": { + "Urdu": "پنجاب", + "English": "Punjab", + "Roman Urdu": "Punjab" + } + }, + { + "name": "gilgit_baltistan", + "label": { + "Urdu": "گلگت بلتستان", + "English": "Gilgit Baltistan", + "Roman Urdu": "Gilgit Baltistan" + } + }, + { + "name": "kashmir", + "label": { + "Urdu": "کشمیر", + "English": "Kashmir", + "Roman Urdu": "Kashmir" + } + }, + { + "name": "fata", + "label": { + "Urdu": "فاٹا", + "English": "FATA", + "Roman Urdu": "FATA" + } + }, + { + "name": "out_of_country", + "label": { + "Urdu": "ملک سے باہر", + "English": "Out of Country", + "Roman Urdu": "Mulk se baahir" + } + } + ], + "ucs": [ + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "bilal_colony", + "label": { + "Urdu": "بلال کالونی", + "Roman Urdu": "Bilal Colony", + "English": "Bilal Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "nasir_colony", + "label": { + "Urdu": "ناصر کالونی", + "Roman Urdu": "Nasir Colony", + "English": "Nasir Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "chakra_goth", + "label": { + "Urdu": "چکرا گوٹھ", + "Roman Urdu": "Chakra Goth", + "English": "Chakra Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "mustafa_taj_colony", + "label": { + "Urdu": "مصطفی تاج کالونی", + "Roman Urdu": "Mustafa Taj Colony", + "English": "Mustafa Taj Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "hundred_quarters", + "label": { + "Urdu": "ہنڈریڈ کوارٹر", + "Roman Urdu": "Hundred Quarters", + "English": "Hundred Quarters" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "gulzar_colony", + "label": { + "Urdu": "گلزار کالونی", + "Roman Urdu": "Gulzar Colony", + "English": "Gulzar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "korangi_sector_33", + "label": { + "Urdu": "کورنگی سیکٹر 33", + "Roman Urdu": "Korangi Sector 33", + "English": "Korangi Sector 33" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "zaman_town", + "label": { + "Urdu": "زمان ٹاوَن", + "Roman Urdu": "Zaman Town", + "English": "Zaman Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "hasrat_mohani_colony", + "label": { + "Urdu": "حسرت موہانی کالونی", + "Roman Urdu": "Hasrat Mohani Colony", + "English": "Hasrat Mohani Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "gulshan_e_ghazi", + "label": { + "Urdu": "گلشن غازی", + "Roman Urdu": "Gulshan-e-Ghazi", + "English": "Gulshan-e-Ghazi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "ittehad_town", + "label": { + "Urdu": "اتحاد ٹاوَن", + "Roman Urdu": "Ittehad Town", + "English": "Ittehad Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "islam_nagar", + "label": { + "Urdu": "اسلام نگر", + "Roman Urdu": "Islam Nagar", + "English": "Islam Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "nai_abadi", + "label": { + "Urdu": "نئی آبادی", + "Roman Urdu": "Nai Abadi", + "English": "Nai Abadi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "saeedabad", + "label": { + "Urdu": "سعید آباد", + "Roman Urdu": "Saeedabad", + "English": "Saeedabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "muslim_mujahid_colony", + "label": { + "Urdu": "مسلم مجاہد کالونی", + "Roman Urdu": "Muslim Mujahid Colony", + "English": "Muslim Mujahid Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "muhajir_camp", + "label": { + "Urdu": "مہاجر کیمپ", + "Roman Urdu": "Muhajir Camp", + "English": "Muhajir Camp" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "rasheedabad", + "label": { + "Urdu": "رشید آباد", + "Roman Urdu": "Rasheedabad", + "English": "Rasheedabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "ibrahim_hyderi", + "label": { + "Urdu": "ابراہیم حیدری", + "Roman Urdu": "Ibrahim Hyderi", + "English": "Ibrahim Hyderi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "rehri", + "label": { + "Urdu": "رہڑی", + "Roman Urdu": "Rehri", + "English": "Rehri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "cattle_colony", + "label": { + "Urdu": "کیٹل کالونی", + "Roman Urdu": "Cattle Colony", + "English": "Cattle Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "qaidabad", + "label": { + "Urdu": "قائدآباد", + "Roman Urdu": "Qaidabad", + "English": "Qaidabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "landhi_colony", + "label": { + "Urdu": "لانڈھی کالونی", + "Roman Urdu": "Landhi Colony", + "English": "Landhi Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "gulshan_e_hadeed", + "label": { + "Urdu": "گلشن حدید", + "Roman Urdu": "Gulshan-e-Hadeed", + "English": "Gulshan-e-Hadeed" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "gaghar", + "label": { + "Urdu": "گگر", + "Roman Urdu": "Gaghar", + "English": "Gaghar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "murad_memon_goth", + "label": { + "Urdu": "مراد میمن گوٹھ", + "Roman Urdu": "Murad Memon Goth", + "English": "Murad Memon Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "darsano_chana", + "label": { + "Urdu": "درشانو شنو", + "Roman Urdu": "Darsano Chana", + "English": "Darsano Chana" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "gujro", + "label": { + "Urdu": "گجرو", + "Roman Urdu": "Gujro", + "English": "Gujro" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "songal", + "label": { + "Urdu": "سنگل", + "Roman Urdu": "Songal", + "English": "Songal" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "maymarabad", + "label": { + "Urdu": "معمار آباد", + "Roman Urdu": "Maymarabad", + "English": "Maymarabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "yousuf_goth", + "label": { + "Urdu": "یوسف گوٹھ", + "Roman Urdu": "Yousuf Goth", + "English": "Yousuf Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "manghopir", + "label": { + "Urdu": "منگھوپیر", + "Roman Urdu": "Manghopir", + "English": "Manghopir" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "azizabad", + "label": { + "Urdu": "عزیز آباد", + "Roman Urdu": "Azizabad", + "English": "Azizabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "karimabad", + "label": { + "Urdu": "کریم آباد", + "Roman Urdu": "Karimabad", + "English": "Karimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "aisha_manzil", + "label": { + "Urdu": "عائشہ منزل", + "Roman Urdu": "Aisha Manzil", + "English": "Aisha Manzil" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "ancholi", + "label": { + "Urdu": "انچولی", + "Roman Urdu": "Ancholi", + "English": "Ancholi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "naseerabad", + "label": { + "Urdu": "نصیرآباد", + "Roman Urdu": "Naseerabad", + "English": "Naseerabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "yaseenabad", + "label": { + "Urdu": "یاسین آباد", + "Roman Urdu": "Yaseenabad", + "English": "Yaseenabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "water_pump", + "label": { + "Urdu": "واٹرپمپ", + "Roman Urdu": "Water Pump", + "English": "Water Pump" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "shafiq_mill_colony", + "label": { + "Urdu": "شفیق مل کالونی", + "Roman Urdu": "Shafiq Mill Colony", + "English": "Shafiq Mill Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "delhi_mercantile_society", + "label": { + "Urdu": "دہلی مرچنٹائل سوسائٹی", + "Roman Urdu": "Delhi Mercantile Society", + "English": "Delhi Mercantile Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "civic_centre", + "label": { + "Urdu": "سوک سینٹر", + "Roman Urdu": "Civic Centre", + "English": "Civic Centre" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "pir_ilahi_buksh_colony", + "label": { + "Urdu": "پیر الہی بخش کالونی", + "Roman Urdu": "Pir Ilahi Buksh Colony", + "English": "Pir Ilahi Buksh Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "essa_nagri", + "label": { + "Urdu": "عیسی نگری", + "Roman Urdu": "Essa Nagri", + "English": "Essa Nagri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gulshan_e_iqbal", + "label": { + "Urdu": "گلشن اقبال", + "Roman Urdu": "Gulshan-e-Iqbal", + "English": "Gulshan-e-Iqbal" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gillani_railway_station", + "label": { + "Urdu": "گیلانی ریلوے اسٹیشن", + "Roman Urdu": "Gillani Railway Station", + "English": "Gillani Railway Station" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "shanti_nagar", + "label": { + "Urdu": "شانتی نگر", + "Roman Urdu": "Shanti Nagar", + "English": "Shanti Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "jamali_colony", + "label": { + "Urdu": "جمالی کالونی", + "Roman Urdu": "Jamali Colony", + "English": "Jamali Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gulshan_e_iqbal_ii", + "label": { + "Urdu": "گلشن اقبال 2", + "Roman Urdu": "Gulshan-e-Iqbal II", + "English": "Gulshan-e-Iqbal II" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "pehlwan_goth", + "label": { + "Urdu": "پہلوان گوٹھ", + "Roman Urdu": "Pehlwan Goth", + "English": "Pehlwan Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "matrovil_colony", + "label": { + "Urdu": "میٹروویل کالونی", + "Roman Urdu": "Matrovil Colony", + "English": "Matrovil Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gulzar_e_hijri", + "label": { + "Urdu": "گلزار ہجری", + "Roman Urdu": "Gulzar-e-Hijri", + "English": "Gulzar-e-Hijri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "safooran_goth", + "label": { + "Urdu": "صفورا گوٹھ", + "Roman Urdu": "Safooran Goth", + "English": "Safooran Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "akhtar_colony", + "label": { + "Urdu": "اختر کالونی", + "Roman Urdu": "Akhtar Colony", + "English": "Akhtar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "manzoor_colony", + "label": { + "Urdu": "منظور کالونی", + "Roman Urdu": "Manzoor Colony", + "English": "Manzoor Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "azam_basti", + "label": { + "Urdu": "اعظم بستی", + "Roman Urdu": "Azam Basti", + "English": "Azam Basti" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "chanesar_goth", + "label": { + "Urdu": "چنیسر گوٹھ", + "Roman Urdu": "Chanesar Goth", + "English": "Chanesar Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "mahmudabad", + "label": { + "Urdu": "محمودآباد", + "Roman Urdu": "Mahmudabad", + "English": "Mahmudabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "pechs", + "label": { + "Urdu": "پی۔ای۔سی۔ایچ۔ایس", + "Roman Urdu": "P.E.C.H.S.", + "English": "P.E.C.H.S." + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "pechs_ii", + "label": { + "Urdu": "پی۔ای۔سی۔ایچ۔ایس 2", + "Roman Urdu": "P.E.C.H.S. II", + "English": "P.E.C.H.S. II" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "jut_line", + "label": { + "Urdu": "جٹ لائن", + "Roman Urdu": "Jut Line", + "English": "Jut Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "central_jacob_lines", + "label": { + "Urdu": "سینٹرل جیکب لائن", + "Roman Urdu": "Central Jacob Lines", + "English": "Central Jacob Lines" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "jamshed_quarters", + "label": { + "Urdu": "جمشید کوارٹر", + "Roman Urdu": "Jamshed Quarters", + "English": "Jamshed Quarters" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "garden_east", + "label": { + "Urdu": "گارڈن ایسٹ", + "Roman Urdu": "Garden East", + "English": "Garden East" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "soldier_bazar", + "label": { + "Urdu": "سولجر بازار", + "Roman Urdu": "Soldier Bazar", + "English": "Soldier Bazar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "pakistan_quarters", + "label": { + "Urdu": "پاکستان کوارٹر", + "Roman Urdu": "Pakistan Quarters", + "English": "Pakistan Quarters" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "bhutta_village", + "label": { + "Urdu": "بھٹا ولیج", + "Roman Urdu": "Bhutta Village", + "English": "Bhutta Village" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "sultanabad", + "label": { + "Urdu": "سلطان آباد", + "Roman Urdu": "Sultanabad", + "English": "Sultanabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "kiamari_uc", + "label": { + "Urdu": "کیماری یوسی", + "Roman Urdu": "Kiamari UC", + "English": "Kiamari UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "baba_bhit", + "label": { + "Urdu": "بابا بھٹ", + "Roman Urdu": "Baba Bhit", + "English": "Baba Bhit" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "machar_colony", + "label": { + "Urdu": "مچھر کالونی", + "Roman Urdu": "Machar Colony", + "English": "Machar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "maripur", + "label": { + "Urdu": "ماڑی پور", + "Roman Urdu": "Maripur", + "English": "Maripur" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "shershah", + "label": { + "Urdu": "شیرشاہ", + "Roman Urdu": "SherShah", + "English": "SherShah" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "gabo_pat", + "label": { + "Urdu": "گابو پٹ", + "Roman Urdu": "Gabo Pat", + "English": "Gabo Pat" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "muzafarabad", + "label": { + "Urdu": "مظفرآباد", + "Roman Urdu": "Muzafarabad", + "English": "Muzafarabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "muslimabad", + "label": { + "Urdu": "مسلم آباد", + "Roman Urdu": "Muslimabad", + "English": "Muslimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "dawood_chowrangi", + "label": { + "Urdu": "داوَد چورنگی", + "Roman Urdu": "Dawood Chowrangi", + "English": "Dawood Chowrangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "moinabad", + "label": { + "Urdu": "معین آباد", + "Roman Urdu": "Moinabad", + "English": "Moinabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "sharafi_goth", + "label": { + "Urdu": "شرافی گوٹھ", + "Roman Urdu": "Sharafi Goth", + "English": "Sharafi Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "bhutto_nagar", + "label": { + "Urdu": "بھٹو نگر", + "Roman Urdu": "Bhutto Nagar", + "English": "Bhutto Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "khawaja_ajmeer_colony", + "label": { + "Urdu": "خواجہ اجمیر کالونی", + "Roman Urdu": "Khawaja Ajmeer Colony", + "English": "Khawaja Ajmeer Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "landhi_uc", + "label": { + "Urdu": "لانڈھی یوسی", + "Roman Urdu": "Landhi UC", + "English": "Landhi UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "awami_colony", + "label": { + "Urdu": "عوامی کالونی", + "Roman Urdu": "Awami Colony", + "English": "Awami Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "burmee_colony", + "label": { + "Urdu": "برمی کالونی", + "Roman Urdu": "Burmee Colony", + "English": "Burmee Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "korangi_uc", + "label": { + "Urdu": "کورنگی یوسی", + "Roman Urdu": "Korangi UC", + "English": "Korangi UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "sherabad", + "label": { + "Urdu": "شیرآباد", + "Roman Urdu": "Sherabad", + "English": "Sherabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "rizvia_society", + "label": { + "Urdu": "رضویہ سوسائٹی", + "Roman Urdu": "Rizvia Society", + "English": "Rizvia Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "firdous_colony", + "label": { + "Urdu": "فردوس کالونی", + "Roman Urdu": "Firdous Colony", + "English": "Firdous Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "super_market", + "label": { + "Urdu": "سپر مارکیٹ", + "Roman Urdu": "Super Market", + "English": "Super Market" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "dak_khana", + "label": { + "Urdu": "دک کھانہ", + "Roman Urdu": "Dak Khana", + "English": "Dak Khana" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "qasimabad", + "label": { + "Urdu": "قاسم آباد", + "Roman Urdu": "Qasimabad", + "English": "Qasimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "bandhani_colony", + "label": { + "Urdu": "بندھانی کالونی", + "Roman Urdu": "Bandhani Colony", + "English": "Bandhani Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "sharifabad", + "label": { + "Urdu": "شریف آباد", + "Roman Urdu": "Sharifabad", + "English": "Sharifabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "commercial_area", + "label": { + "Urdu": "کمرشل ایریا", + "Roman Urdu": "Commercial Area", + "English": "Commercial Area" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "mujahid_colony", + "label": { + "Urdu": "مجاہد کالونی", + "Roman Urdu": "Mujahid Colony", + "English": "Mujahid Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "nazimabad", + "label": { + "Urdu": "ناظم آباد", + "Roman Urdu": "Nazimabad", + "English": "Nazimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "abbasi_shaheed", + "label": { + "Urdu": "عباسی شہید", + "Roman Urdu": "Abbasi Shaheed", + "English": "Abbasi Shaheed" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "agra_taj_colony", + "label": { + "Urdu": "آگرہ تاج کالونی", + "Roman Urdu": "Agra Taj Colony", + "English": "Agra Taj Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "daryaabad", + "label": { + "Urdu": "دریاآباد", + "Roman Urdu": "Daryaabad", + "English": "Daryaabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "nawabad", + "label": { + "Urdu": "نواآباد", + "Roman Urdu": "Nawabad", + "English": "Nawabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "khada_memon_society", + "label": { + "Urdu": "خدا- میمن- سوساَٹی", + "Roman Urdu": "Khada Memon Society", + "English": "Khada Memon Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "baghdadi", + "label": { + "Urdu": "بغدادی", + "Roman Urdu": "Baghdadi", + "English": "Baghdadi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "shah_baig_line", + "label": { + "Urdu": "شاھ باغ لائن", + "Roman Urdu": "Shah Baig Line", + "English": "Shah Baig Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "bihar_colony", + "label": { + "Urdu": "بہار کالونی", + "Roman Urdu": "Bihar Colony", + "English": "Bihar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "ragiwara", + "label": { + "Urdu": "راگی واڑا", + "Roman Urdu": "Ragiwara", + "English": "Ragiwara" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "singo_line", + "label": { + "Urdu": "سنگولائن", + "Roman Urdu": "Singo Line", + "English": "Singo Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "chakiwara", + "label": { + "Urdu": "چاکی واڑا", + "Roman Urdu": "Chakiwara", + "English": "Chakiwara" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "allama_iqbal_colony", + "label": { + "Urdu": "علامہ اقبال کالونی", + "Roman Urdu": "Allama Iqbal Colony", + "English": "Allama Iqbal Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "model_colony", + "label": { + "Urdu": "موڈل کالونی", + "Roman Urdu": "Model Colony", + "English": "Model Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "kala_board", + "label": { + "Urdu": "کالا بورڈ", + "Roman Urdu": "Kala Board", + "English": "Kala Board" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "saudabad", + "label": { + "Urdu": "سعودآباد", + "Roman Urdu": "Saudabad", + "English": "Saudabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "khokhra_par", + "label": { + "Urdu": "کھوکھرا پار", + "Roman Urdu": "Khokhra Par", + "English": "Khokhra Par" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "jafar_e_tayyar", + "label": { + "Urdu": "جعفر تیار", + "Roman Urdu": "Jafar-e-Tayyar", + "English": "Jafar-e-Tayyar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "gharibabad", + "label": { + "Urdu": "غریب آباد", + "Roman Urdu": "Gharibabad", + "English": "Gharibabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "ghazi_brohi_goth", + "label": { + "Urdu": "غازی بروہی گوٹھ", + "Roman Urdu": "Ghazi Brohi Goth", + "English": "Ghazi Brohi Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "kalyana", + "label": { + "Urdu": "کالیانہ", + "Roman Urdu": "Kalyana", + "English": "Kalyana" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "sir_syed_colony", + "label": { + "Urdu": "سر سید کالونی", + "Roman Urdu": "Sir Syed Colony", + "English": "Sir Syed Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "fatima_jinnah_colony", + "label": { + "Urdu": "فاطمہ جناح کالونی", + "Roman Urdu": "Fatima Jinnah Colony", + "English": "Fatima Jinnah Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "godhra", + "label": { + "Urdu": "گودھرا", + "Roman Urdu": "Godhra", + "English": "Godhra" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "abu_zar_ghaffari", + "label": { + "Urdu": "ابو زر غفاری", + "Roman Urdu": "Abu Zar Ghaffari", + "English": "Abu Zar Ghaffari" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "hakim_ahsan", + "label": { + "Urdu": "حاکم احسان", + "Roman Urdu": "Hakim Ahsan", + "English": "Hakim Ahsan" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "madina_colony", + "label": { + "Urdu": "مدینہ کالونی", + "Roman Urdu": "Madina Colony", + "English": "Madina Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "faisal_colony", + "label": { + "Urdu": "فیصل کالونی", + "Roman Urdu": "Faisal Colony", + "English": "Faisal Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "khamiso_goth", + "label": { + "Urdu": "خمیسو گوٹھ", + "Roman Urdu": "Khamiso Goth", + "English": "Khamiso Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "mustufa_colony", + "label": { + "Urdu": "مصطفی کالونی", + "Roman Urdu": "Mustufa Colony", + "English": "Mustufa Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "khawaja_ajmeer_nagri", + "label": { + "Urdu": "خواجہ اجمیر نگری", + "Roman Urdu": "Khawaja Ajmeer Nagri", + "English": "Khawaja Ajmeer Nagri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "gulshan_e_saeed", + "label": { + "Urdu": "گلشن سعید", + "Roman Urdu": "Gulshan-e-Saeed", + "English": "Gulshan-e-Saeed" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "shah_nawaz_bhutto_colony", + "label": { + "Urdu": "شاہ نواز بھٹو کالونی", + "Roman Urdu": "Shah Nawaz Bhutto Colony", + "English": "Shah Nawaz Bhutto Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "paposh_nagar", + "label": { + "Urdu": "پاپوش نگر", + "Roman Urdu": "Paposh Nagar", + "English": "Paposh Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "pahar_ganj", + "label": { + "Urdu": "پہاڑ گنج", + "Roman Urdu": "Pahar Ganj", + "English": "Pahar Ganj" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "khandu_goth", + "label": { + "Urdu": "کھنڑو گوٹھ", + "Roman Urdu": "Khandu Goth", + "English": "Khandu Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "hyderi", + "label": { + "Urdu": "حیدری", + "Roman Urdu": "Hyderi", + "English": "Hyderi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "sakhi_hassan", + "label": { + "Urdu": "سخی حسن", + "Roman Urdu": "Sakhi Hassan", + "English": "Sakhi Hassan" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "farooq_e_azam", + "label": { + "Urdu": "فاروق اعظم", + "Roman Urdu": "Farooq-e-Azam", + "English": "Farooq-e-Azam" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "nusrat_bhutto_colony", + "label": { + "Urdu": "نصرت بھٹو کالونی", + "Roman Urdu": "Nusrat Bhutto Colony", + "English": "Nusrat Bhutto Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "shadman_town", + "label": { + "Urdu": "شادمان ٹاوَن", + "Roman Urdu": "Shadman Town", + "English": "Shadman Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "buffer_zone", + "label": { + "Urdu": "بفرزون", + "Roman Urdu": "Buffer Zone", + "English": "Buffer Zone" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "buffer_zone_ii", + "label": { + "Urdu": "بفرزون 2", + "Roman Urdu": "Buffer Zone II", + "English": "Buffer Zone II" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "mominabad", + "label": { + "Urdu": "مومن آباد", + "Roman Urdu": "Mominabad", + "English": "Mominabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "haryana_colony", + "label": { + "Urdu": "حریانہ کالونی", + "Roman Urdu": "Haryana Colony", + "English": "Haryana Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "hanifabad", + "label": { + "Urdu": "حنیف آباد", + "Roman Urdu": "Hanifabad", + "English": "Hanifabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "mohammad_nagar", + "label": { + "Urdu": "محمد نگر", + "Roman Urdu": "Mohammad Nagar", + "English": "Mohammad Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "madina_colony_orangi", + "label": { + "Urdu": "مدینہ کالونی اورنگی", + "Roman Urdu": "Madina Colony Orangi", + "English": "Madina Colony Orangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "ghaziabad", + "label": { + "Urdu": "غازی آباد", + "Roman Urdu": "Ghaziabad", + "English": "Ghaziabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "chisti_nagar", + "label": { + "Urdu": "چشتی نگر", + "Roman Urdu": "Chisti Nagar", + "English": "Chisti Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "bilal_colony_orangi", + "label": { + "Urdu": "بلال کالونی اورنگی", + "Roman Urdu": "Bilal Colony Orangi", + "English": "Bilal Colony Orangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "iqbal_baloch_colony", + "label": { + "Urdu": "اقبال بلوچ کالونی", + "Roman Urdu": "Iqbal Baloch Colony", + "English": "Iqbal Baloch Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "ghabool_town", + "label": { + "Urdu": "گبول ٹاوَن", + "Roman Urdu": "Ghabool Town", + "English": "Ghabool Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "data_nagar", + "label": { + "Urdu": "داتا نگر", + "Roman Urdu": "Data Nagar", + "English": "Data Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "mujahidabad", + "label": { + "Urdu": "مجاہد آباد", + "Roman Urdu": "Mujahidabad", + "English": "Mujahidabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "baloch_goth", + "label": { + "Urdu": "بلوچ گوٹھ", + "Roman Urdu": "Baloch Goth", + "English": "Baloch Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "old_haji_camp", + "label": { + "Urdu": "پرانہ حاجی کیمپ", + "Roman Urdu": "Old Haji Camp", + "English": "Old Haji Camp" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "garden", + "label": { + "Urdu": "گارڈن", + "Roman Urdu": "Garden", + "English": "Garden" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "kharadar", + "label": { + "Urdu": "کھارادر", + "Roman Urdu": "Kharadar", + "English": "Kharadar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "city_railway_colony", + "label": { + "Urdu": "سٹی ریلوے کالونی", + "Roman Urdu": "City Railway Colony", + "English": "City Railway Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "nanak_wara", + "label": { + "Urdu": "ناناک واڑا", + "Roman Urdu": "Nanak Wara", + "English": "Nanak Wara" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "gazdarabad", + "label": { + "Urdu": "گزدرآباد", + "Roman Urdu": "Gazdarabad", + "English": "Gazdarabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "millat_nagar_islam_pura", + "label": { + "Urdu": "ملت نگر اسلام پورا", + "Roman Urdu": "Millat Nagar/Islam Pura", + "English": "Millat Nagar/Islam Pura" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "saddar_uc", + "label": { + "Urdu": "صدر یو سی", + "Roman Urdu": "Saddar UC", + "English": "Saddar UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "civil_line", + "label": { + "Urdu": "سول لائن", + "Roman Urdu": "Civil Line", + "English": "Civil Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "clifton", + "label": { + "Urdu": "کلفٹن", + "Roman Urdu": "Clifton", + "English": "Clifton" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "kehkashan", + "label": { + "Urdu": "کہکشان", + "Roman Urdu": "Kehkashan", + "English": "Kehkashan" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "natha_khan_goth", + "label": { + "Urdu": "ناتھا خان گوٹھ", + "Roman Urdu": "Natha Khan Goth", + "English": "Natha Khan Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "pak_sadat_colony", + "label": { + "Urdu": "پاک صدر کالونی", + "Roman Urdu": "Pak Sadat Colony", + "English": "Pak Sadat Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "drigh_colony", + "label": { + "Urdu": "ڈرگ کالونی", + "Roman Urdu": "Drigh Colony", + "English": "Drigh Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "raita_plot", + "label": { + "Urdu": "رائتا پلاٹ", + "Roman Urdu": "Raita Plot", + "English": "Raita Plot" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "moria_khan_goth", + "label": { + "Urdu": "موریا خان گوٹھ", + "Roman Urdu": "Moria Khan Goth", + "English": "Moria Khan Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "rafa_e_aam_society", + "label": { + "Urdu": "رفا عام سوسا ئٹی", + "Roman Urdu": "Rafa-e-Aam Society", + "English": "Rafa-e-Aam Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "al_falah_society", + "label": { + "Urdu": "الفلاح سوسا ئٹی", + "Roman Urdu": "Al-Falah Society", + "English": "Al-Falah Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "pak_colony", + "label": { + "Urdu": "پاک کالونی", + "Roman Urdu": "Pak Colony", + "English": "Pak Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "old_golimar", + "label": { + "Urdu": "پرانہ گولی مار", + "Roman Urdu": "Old Golimar", + "English": "Old Golimar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "jahanabad", + "label": { + "Urdu": "جہان آباد", + "Roman Urdu": "Jahanabad", + "English": "Jahanabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "metrovil", + "label": { + "Urdu": "میٹروویل", + "Roman Urdu": "Metrovil", + "English": "Metrovil" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "bhawani_chali", + "label": { + "Urdu": "بہوانی چالی", + "Roman Urdu": "Bhawani Chali", + "English": "Bhawani Chali" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "frontier_colony", + "label": { + "Urdu": "فرونٹر کالونی", + "Roman Urdu": "Frontier Colony", + "English": "Frontier Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "banaras_colony", + "label": { + "Urdu": "بنارس کالونی", + "Roman Urdu": "Banaras Colony", + "English": "Banaras Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "qasba_colony", + "label": { + "Urdu": "قصبہ کالونی", + "Roman Urdu": "Qasba Colony", + "English": "Qasba Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "islamia_colony", + "label": { + "Urdu": "اسلامیہ کالونی", + "Roman Urdu": "Islamia Colony", + "English": "Islamia Colony" + } + }, + { + "province": "na", + "city": "na", + "town": "na", + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + }, + { + "province": "na", + "city": "na", + "town": "na", + "name": "not_applicable", + "label": { + "Urdu": "قابل اطلاق نہیں", + "Roman Urdu": "Qaabil-e-atlaaq nahi", + "English": "Not Applicable" + } + } + ], + "gender": [ + { + "instance": { + "openmrs_code": "1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "male", + "label": { + "Urdu": "مرد/ لڑکا", + "Roman Urdu": "Mard/larka", + "English": "Male" + } + }, + { + "instance": { + "openmrs_code": "1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "female", + "label": { + "Urdu": "عورت/لڑکی", + "Roman Urdu": "Aurat/larki", + "English": "Female" + } + }, + { + "instance": { + "openmrs_code": "163163AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "transgender", + "label": { + "Urdu": "خواجہ سرہ", + "Roman Urdu": "Khwaja sira", + "English": "Transgender" + } + } + ], + "vaccines": [ + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT1", + "label": { + "Urdu": "ٹی ٹی 1", + "Roman Urdu": "TT1", + "English": "TT1" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT2", + "label": { + "Urdu": "ٹی ٹی 2", + "Roman Urdu": "TT2", + "English": "TT2" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT3", + "label": { + "Urdu": "ٹی ٹی 3", + "Roman Urdu": "TT3", + "English": "TT3" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT4", + "label": { + "Urdu": "ٹی ٹی 4", + "Roman Urdu": "TT4", + "English": "TT4" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT5", + "label": { + "Urdu": "ٹی ٹی 5", + "Roman Urdu": "TT5", + "English": "TT5" + } + } + ], + "towns": [ + { + "province": "sindh", + "city": "karachi", + "name": "korangi", + "label": { + "Urdu": "کورنگی", + "Roman Urdu": "Korangi", + "English": "Korangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "landhi", + "label": { + "Urdu": "لانڈھی", + "Roman Urdu": "Landhi", + "English": "Landhi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "baldia", + "label": { + "Urdu": "بلدیہ", + "Roman Urdu": "Baldia", + "English": "Baldia" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "bin_qasim", + "label": { + "Urdu": "بن قاسم", + "Roman Urdu": "Bin Qasim", + "English": "Bin Qasim" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "gadap", + "label": { + "Urdu": "گڈاپ", + "Roman Urdu": "Gadap", + "English": "Gadap" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "gulberg", + "label": { + "Urdu": "گلبرگ", + "Roman Urdu": "Gulberg", + "English": "Gulberg" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "gulshan", + "label": { + "Urdu": "گلشن", + "Roman Urdu": "Gulshan", + "English": "Gulshan" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "jamshed", + "label": { + "Urdu": "جمشید", + "Roman Urdu": "Jamshed", + "English": "Jamshed" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "kiamari", + "label": { + "Urdu": "کیماری", + "Roman Urdu": "Kiamari", + "English": "Kiamari" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "liaquatabad", + "label": { + "Urdu": "لیاقت آباد", + "Roman Urdu": "Liaquatabad", + "English": "Liaquatabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "lyari", + "label": { + "Urdu": "لیاری", + "Roman Urdu": "Lyari", + "English": "Lyari" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "malir", + "label": { + "Urdu": "ملیر", + "Roman Urdu": "Malir", + "English": "Malir" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "new_karachi", + "label": { + "Urdu": "نیو کراچی", + "Roman Urdu": "New Karachi", + "English": "New Karachi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "north_nazimabad", + "label": { + "Urdu": "نارتھ ناظم آباد", + "Roman Urdu": "North Nazimabad", + "English": "North Nazimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "orangi", + "label": { + "Urdu": "اورنگی", + "Roman Urdu": "Orangi", + "English": "Orangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "saddar", + "label": { + "Urdu": "صدر", + "Roman Urdu": "Saddar", + "English": "Saddar" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "shah_faisal", + "label": { + "Urdu": "شاہ فیصل", + "Roman Urdu": "Shah Faisal", + "English": "Shah Faisal" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "site", + "label": { + "Urdu": "سائٹ", + "Roman Urdu": "S.I.T.E.", + "English": "S.I.T.E." + } + }, + { + "province": "na", + "city": "na", + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + }, + { + "province": "na", + "city": "na", + "name": "not_applicable", + "label": { + "Urdu": "قابل اطلاق نہیں", + "Roman Urdu": "Qaabil-e-atlaaq nahi", + "English": "Not Applicable" + } + } + ], + "cities": [ + { + "province": "sindh", + "name": "karachi", + "label": { + "Urdu": "کراچی", + "Roman Urdu": "Karachi", + "English": "Karachi" + } + }, + { + "province": "punjab", + "name": "hafizabad", + "label": { + "Urdu": "حافظ آباد", + "Roman Urdu": "Hafizabad", + "English": "Hafizabad" + } + }, + { + "province": "punjab", + "name": "muzaffargarh", + "label": { + "Urdu": "مظفر گڑھ", + "Roman Urdu": "Muzaffargarh", + "English": "Muzaffargarh" + } + }, + { + "province": "na", + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + }, + { + "province": "na", + "name": "not_applicable", + "label": { + "Urdu": "قابل اطلاق نہیں", + "Roman Urdu": "Not Applicable", + "English": "Not Applicable" + } + } + ], + "edd_lmp": [ + { + "instance": { + "openmrs_code": "5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "edd", + "label": { + "Urdu": "زچگی کی متوقع تاریخ", + "Roman Urdu": "EDD", + "English": "EDD" + } + }, + { + "instance": { + "openmrs_code": "1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "lmp", + "label": { + "Urdu": "پچھلی مہواری کی تاریخ", + "Roman Urdu": "LMP", + "English": "LMP" + } + }, + { + "instance": { + "openmrs_code": "159617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "ultrasound", + "label": { + "Urdu": "الٹرا سائونڈ", + "Roman Urdu": "Ultrasound", + "English": "Ultrasound" + } + }, + { + "instance": { + "openmrs_code": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "none", + "label": { + "Urdu": "کوئی بھی نہیں", + "Roman Urdu": "Koi bhi nahi", + "English": "None of the above" + } + } + ], + "yes_no": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ] + }, + "instance": { + "encounter_type": "Off Site Woman Follow Up" + }, + "version": "201604080459", + "id_string": "offsite_woman_followup_form", + "type": "survey", + "children": [ + { + "type": "hidden", + "name": "provider_uc" + }, + { + "type": "hidden", + "name": "provider_town" + }, + { + "type": "hidden", + "name": "provider_city" + }, + { + "type": "hidden", + "name": "provider_province" + }, + { + "type": "hidden", + "name": "existing_landmark" + }, + { + "type": "hidden", + "name": "existing_house_number" + }, + { + "type": "hidden", + "name": "existing_street" + }, + { + "type": "hidden", + "name": "existing_union_council" + }, + { + "type": "hidden", + "name": "existing_town" + }, + { + "type": "hidden", + "name": "existing_city_village" + }, + { + "type": "hidden", + "name": "existing_province" + }, + { + "type": "hidden", + "name": "existing_union_councilname" + }, + { + "type": "hidden", + "name": "existing_townname" + }, + { + "type": "hidden", + "name": "existing_city_villagename" + }, + { + "type": "hidden", + "name": "existing_provincename" + }, + { + "type": "hidden", + "name": "existing_first_name" + }, + { + "type": "hidden", + "name": "existing_last_name" + }, + { + "type": "hidden", + "name": "existing_father_name" + }, + { + "type": "hidden", + "name": "existing_husband_name" + }, + { + "type": "hidden", + "name": "existing_marriage" + }, + { + "type": "hidden", + "name": "existing_calc_dob_confirm" + }, + { + "type": "hidden", + "name": "existing_gender" + }, + { + "type": "hidden", + "name": "existing_ethnicity" + }, + { + "type": "hidden", + "name": "existing_client_reg_date" + }, + { + "type": "hidden", + "name": "existing_program_client_id" + }, + { + "type": "hidden", + "name": "existing_epi_card_number" + }, + { + "type": "hidden", + "name": "existing_reminders_approval" + }, + { + "type": "hidden", + "name": "existing_contact_phone_number" + }, + { + "type": "hidden", + "name": "e_tt1" + }, + { + "type": "hidden", + "name": "e_tt2" + }, + { + "type": "hidden", + "name": "e_tt3" + }, + { + "type": "hidden", + "name": "e_tt4" + }, + { + "type": "hidden", + "name": "e_tt5" + }, + { + "type": "hidden", + "name": "provider_id" + }, + { + "instance": { + "openmrs_entity_id": "location_id", + "openmrs_entity": "encounter" + }, + "type": "hidden", + "name": "provider_location_id" + }, + { + "type": "hidden", + "name": "provider_location_name" + }, + { + "type": "note", + "name": "provider_location_note", + "label": { + "Urdu": "شہر: ${provider_city} ; ٹائون: ${provider_town} ; یوسی: ${provider_uc} ; سینٹرکا نام: ${provider_location_name}", + "English": "City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}" + } + }, + { + "instance": { + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "start", + "name": "start" + }, + { + "instance": { + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "end", + "name": "end" + }, + { + "instance": { + "openmrs_entity_id": "163286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "today", + "name": "today" + }, + { + "instance": { + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "deviceid", + "name": "deviceid" + }, + { + "instance": { + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "subscriberid", + "name": "subscriberid" + }, + { + "instance": { + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "simserial", + "name": "simserial" + }, + { + "instance": { + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "phonenumber", + "name": "phonenumber" + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "client_reg_date_note", + "label": { + "Urdu": "${existing_client_reg_date} :پروگرام میں اندراج کی تاریخ", + "Roman Urdu": "Program main andraaj ki tareekh: ${existing_client_reg_date}", + "English": "Client Registration date: ${existing_client_reg_date}" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "program_client_id_note", + "label": { + "Urdu": "${existing_program_client_id}:کلائنٹ کی پروگرام ائی ڈی", + "Roman Urdu": "Client ki program ID: ${existing_program_client_id}", + "English": "Program Client ID: ${existing_program_client_id}" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "نمبر آٹھ ہندسوں پر مشتمل ہونا چاہئے", + "English": "Number should be 8 digits", + "Roman Urdu": "Number 8 hindason par mushtamil hona chahiye" + }, + "required": "yes", + "constraint": "string-length(.) = 8" + }, + "type": "integer", + "instance": { + "openmrs_entity_id": "EPI Card Number", + "openmrs_entity": "person_attribute" + }, + "name": "epi_card_number", + "label": { + "Urdu": "ای پی آئی کارڈ نمبر: {existing_epi_card_number}$", + "English": "EPI Card Number: ${existing_epi_card_number}", + "Roman Urdu": "EPI Card Number: ${existing_epi_card_number}" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "first_name_note", + "label": { + "Urdu": "${existing_first_name}: نام", + "Roman Urdu": "Naam: ${existing_first_name}", + "English": "First Name: ${existing_first_name}" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "last_name_note", + "label": { + "Urdu": "والد کا نام: ${existing_last_name}", + "Roman Urdu": "Waalid ka naam: ${existing_last_name}", + "English": "Last name: ${existing_last_name}" + } + }, + { + "bind": { + "calculate": "date( today() - (${existing_calc_dob_confirm} div 365))" + }, + "type": "calculate", + "name": "client_age", + "instance": { + "openmrs_entity_id": "154384AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } + }, + { + "type": "note", + "name": "birth_date_note", + "label": { + "Urdu": "تاریخِ پیدائش: {existing_calc_dob_confirm}$ ({client_age}$) سال", + "English": "Birth date: ${existing_calc_dob_confirm} (${client_age}) years", + "Roman Urdu": "Tareekh-e-pedaaish: ${existing_calc_dob_confirm} (${client_age}) years" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "gender_note", + "label": { + "Urdu": "${existing_gender}: جنس", + "Roman Urdu": "Jins:${existing_gender}", + "English": "Gender: ${existing_gender}" + } + }, + { + "type": "note", + "name": "father_name_note", + "label": { + "Urdu": "والد کا نام: {existing_father_name}$", + "English": "Father's Name: ${existing_father_name}", + "Roman Urdu": "Waalid ka naam: ${existing_father_name}" + } + }, + { + "type": "note", + "name": "marriage_note", + "label": { + "Urdu": "شادی شدہ: {existing_marriage}$", + "English": "Married: ${existing_marriage}", + "Roman Urdu": "Shaadi shuda: ${existing_marriage}" + } + }, + { + "type": "note", + "name": "husband_name_note", + "label": { + "Urdu": "شوہر کا نام: {existing_husband_name}$", + "English": "Husband's name: ${existing_husband_name}", + "Roman Urdu": "Shohar ka naam: ${existing_husband_name}" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "ethnicity_note", + "label": { + "Urdu": "قومیت: {existing_ethnicity}$", + "Roman Urdu": "Qomiat: ${existing_ethnicity}", + "English": "Ethnicity: ${existing_ethnicity}" + } + }, + { + "type": "note", + "name": "address", + "label": { + "Urdu": "موجودہ پتہ: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}", + "English": "Current Address: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}", + "Roman Urdu": "Mojooda Address: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}" + } + }, + { + "label": { + "Urdu": "کیا آپ کا گھر کا پتہ بدلا ہے؟", + "English": "Has your home address changed?", + "Roman Urdu": "Kya aap ka ghar ka pata badla hai?" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ], + "name": "address_change" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "province", + "default": "${provider_province}", + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "label": { + "Urdu": "صوبہ", + "Roman Urdu": "Suba", + "English": "Province" + }, + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "stateProvince", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one", + "children": [ + { + "name": "kpk", + "label": { + "Urdu": "خیبر پختون خواہ", + "English": "Khyber Pakhtunkhwa", + "Roman Urdu": "Khyber Pakhtunkhwa" + } + }, + { + "name": "sindh", + "label": { + "Urdu": "سندھ", + "English": "Sindh", + "Roman Urdu": "Sindh" + } + }, + { + "name": "balochistan", + "label": { + "Urdu": "بلوچستان", + "English": "Balochistan", + "Roman Urdu": "Balochistan" + } + }, + { + "name": "punjab", + "label": { + "Urdu": "پنجاب", + "English": "Punjab", + "Roman Urdu": "Punjab" + } + }, + { + "name": "gilgit_baltistan", + "label": { + "Urdu": "گلگت بلتستان", + "English": "Gilgit Baltistan", + "Roman Urdu": "Gilgit Baltistan" + } + }, + { + "name": "kashmir", + "label": { + "Urdu": "کشمیر", + "English": "Kashmir", + "Roman Urdu": "Kashmir" + } + }, + { + "name": "fata", + "label": { + "Urdu": "فاٹا", + "English": "FATA", + "Roman Urdu": "FATA" + } + }, + { + "name": "out_of_country", + "label": { + "Urdu": "ملک سے باہر", + "English": "Out of Country", + "Roman Urdu": "Mulk se baahir" + } + } + ] + }, + { + "control": { + "appearance": "minimal" + }, + "name": "city_village", + "choice_filter": "province=${province} or province='na'", + "default": "${provider_city}", + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "label": { + "Urdu": "شہر", + "Roman Urdu": "Shehr", + "English": "City" + }, + "itemset": "cities", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "cityVillage", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "town", + "choice_filter": "(province=${province} and city=${city_village} ) or city='na'", + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "label": { + "Urdu": "ٹاٰئون/ قصبہ/ بستی", + "Roman Urdu": "Town / Qasbah / Basti", + "English": "Town" + }, + "itemset": "towns", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "town", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "union_council", + "choice_filter": "(province=${province} and city=${city_village} and town=${town}) or town='na'", + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "label": { + "Urdu": "یونین کونسل", + "Roman Urdu": "Union Council", + "English": "Union Council" + }, + "itemset": "ucs", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "subTown", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one" + }, + { + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "house", + "openmrs_entity_parent": "usual_residence" + }, + "name": "house_number", + "label": { + "Urdu": "گھر کا نمبر", + "Roman Urdu": "Ghar ka number", + "English": "House Number" + } + }, + { + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "street", + "openmrs_entity_parent": "usual_residence" + }, + "name": "street", + "label": { + "Urdu": "گلی/کالونی/محلہ", + "Roman Urdu": "Gali/Colony/Mohalla", + "English": "Street" + } + }, + { + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "landmark", + "openmrs_entity_parent": "usual_residence" + }, + "name": "landmark", + "label": { + "Urdu": "گھر کے قریب کوئی مشہور جگہ", + "Roman Urdu": "Ghar ke qareeb koi mashoor jagah", + "English": "Land Mark" + } + }, + { + "instance": { + "openmrs_entity_id": "163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "geopoint", + "name": "center_gps", + "label": { + "Urdu": "حاصل کردہ معلومات کی جگہ کے GPS کارڈینیٹس درج کریں", + "English": "Collect GPS coordinates of data entry location:", + "Roman Urdu": "Hasil karda malomaat ki jaga ke GPS coordinates darj karain" + } + }, + { + "control": { + "appearance": "minimal" + }, + "name": "reminders_approval", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "کیا آپ اپنے بچے کی اگلی ویکسین کی تاریخ کے لیے SMS موصول کرنا چاہتے ہیں؟ {existing_reminders_approval}$", + "English": "Are you willing to receive SMS reminders for your next visit? ${existing_reminders_approval}", + "Roman Urdu": "Kya aap apnay bachay ki agli vaccine ki tareekh ke liye SMS mausool karna chahtay hain? ${existing_reminders_approval}" + }, + "instance": { + "openmrs_entity_id": "163089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ] + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "فون نمبر گیارہ ہندسوں پر مشتمل اور مندرجہ ذیل شکل میں ہونا چاہئے: *********03", + "English": "Phone number should be 11 digits in the following format: 03*********", + "Roman Urdu": "Phone number 11 hindason par mushtamil aur mundarja zail shakal main hona chahiey: 03*********" + }, + "relevant": "${existing_reminders_approval}='yes'", + "constraint": "regex(., '^03[0-9]{9}$')" + }, + "type": "text", + "instance": { + "openmrs_entity_id": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "contact_phone_number", + "label": { + "Urdu": "موبائل نمبر:{existing_contact_phone_number}$", + "English": "Mobile Number: ${existing_contact_phone_number}", + "Roman Urdu": "Mobile Number: ${existing_contact_phone_number}" + } + }, + { + "instance": { + "openmrs_entity_id": "5272AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "label": { + "Urdu": "کیا خا تون حاملہ ہیں؟", + "English": "Is female pregnant?", + "Roman Urdu": "Kia khatoon haamla hain?" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ], + "name": "pregnant" + }, + { + "name": "edd_lmp", + "bind": { + "relevant": "selected (${pregnant}, 'yes')" + }, + "label": { + "Urdu": "کیا آپ کو اپنی پچھلی ماہواری کی تاریخ، زچگی کی متوقع تاریخ، یا الٹرا سائونڈ کا علم ہے؟", + "English": "Do you know your LMP, EDD or last Ultrasound information?", + "Roman Urdu": "Kya aap ko apni pichli mahwaari ki tareekh, zachgi ki mutawaqqa tareekh ya ultrasound ka ilm hai?" + }, + "instance": { + "openmrs_entity_id": "160697AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "edd", + "label": { + "Urdu": "زچگی کی متوقع تاریخ", + "Roman Urdu": "EDD", + "English": "EDD" + } + }, + { + "instance": { + "openmrs_code": "1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "lmp", + "label": { + "Urdu": "پچھلی مہواری کی تاریخ", + "Roman Urdu": "LMP", + "English": "LMP" + } + }, + { + "instance": { + "openmrs_code": "159617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "ultrasound", + "label": { + "Urdu": "الٹرا سائونڈ", + "Roman Urdu": "Ultrasound", + "English": "Ultrasound" + } + }, + { + "instance": { + "openmrs_code": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "none", + "label": { + "Urdu": "کوئی بھی نہیں", + "Roman Urdu": "Koi bhi nahi", + "English": "None of the above" + } + } + ] + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "زچگی کی متوقع تاریخ ماضی کی نہیں ہو سکتی", + "Roman Urdu": "Zachgi ki mutawaqqa tareekh maazi ki nahi hosakti", + "English": "EDD cannot be in the past" + }, + "relevant": "selected (${edd_lmp}, 'edd')", + "constraint": ".>=${today}" + }, + "type": "date", + "name": "edd", + "label": { + "Urdu": "زچگی کی متوقع تاریخ", + "Roman Urdu": "Zachgi ki mutawaqqa tareekh", + "English": "EDD" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "پچھلی ماہواری کی تاریخ مستقبل کی نہیں ہوسکتی", + "Roman Urdu": "Pichli mahwaari ki tareekh mustaqbil ki nahi hosakti", + "English": "LMP cannot be in the future" + }, + "relevant": "selected (${edd_lmp}, 'lmp')", + "constraint": ".<=${today}" + }, + "type": "date", + "name": "lmp", + "label": { + "Urdu": "پچھلی ماہواری کی تاریخ", + "Roman Urdu": "Pichli mahwaari ki tareekh", + "English": "LMP" + } + }, + { + "bind": { + "relevant": "selected (${edd_lmp}, 'ultrasound')" + }, + "type": "date", + "instance": { + "openmrs_entity_id": "163165AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "ultrasound_date", + "label": { + "Urdu": "الٹرا سائونڈ کی تاریخ", + "English": "Ultrasound Date", + "Roman Urdu": "Ultrasound ki tareekh" + } + }, + { + "bind": { + "relevant": "selected (${edd_lmp}, 'ultrasound')" + }, + "type": "integer", + "name": "ultrasound_weeks", + "label": { + "Urdu": "الٹرا سائونڈ کی مدد سے حمل کی مدت [ہفتوں میں]", + "Roman Urdu": "Ultrasound ki madad se hamal ki muddat (hafton me)", + "English": "Gestational age determined by ultrasound" + } + }, + { + "bind": { + "calculate": "date(${lmp}+280)" + }, + "type": "calculate", + "name": "edd_calc_lmp" + }, + { + "bind": { + "calculate": "date((280-(${ultrasound_weeks}*7)+${ultrasound_date} ))" + }, + "type": "calculate", + "name": "edd_calc_ultrasound" + }, + { + "bind": { + "calculate": "format-date(${edd_calc_lmp}, '%Y-%n-%e')" + }, + "type": "calculate", + "name": "edd_calc_lmp_formatted" + }, + { + "bind": { + "calculate": "format-date(${edd_calc_ultrasound}, '%Y-%n-%e')" + }, + "type": "calculate", + "name": "edd_calc_ultrasound_formatted" + }, + { + "bind": { + "calculate": "date(${edd}-280)" + }, + "type": "calculate", + "name": "lmp_calc_edd" + }, + { + "bind": { + "calculate": "date(${ultrasound_date}-(${ultrasound_weeks}*7))" + }, + "type": "calculate", + "name": "lmp_calc_ultrasound" + }, + { + "bind": { + "calculate": "format-date(${lmp_calc_edd}, '%Y-%n-%e')" + }, + "type": "calculate", + "name": "lmp_calc_edd_formatted" + }, + { + "bind": { + "calculate": "format-date(${lmp_calc_ultrasound}, '%Y-%n-%e')" + }, + "type": "calculate", + "name": "lmp_calc_ultrasound_formatted" + }, + { + "bind": { + "calculate": "if(${edd_lmp}='lmp',${edd_calc_lmp_formatted},if(${edd_lmp}='edd',${edd} ,if(${edd_lmp}='ultrasound',${edd_calc_ultrasound_formatted},'')))" + }, + "type": "calculate", + "name": "final_edd", + "instance": { + "openmrs_entity_id": "5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } + }, + { + "bind": { + "calculate": "if(${edd_lmp}='lmp',${lmp},if(${edd_lmp}='edd',${lmp_calc_edd_formatted} ,if(${edd_lmp}='ultrasound',${lmp_calc_ultrasound_formatted},'')))" + }, + "type": "calculate", + "name": "final_lmp", + "instance": { + "openmrs_entity_id": "1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } + }, + { + "bind": { + "calculate": "int((${vaccination_date} - (${edd}-280))div7)" + }, + "type": "calculate", + "name": "ga_edd" + }, + { + "bind": { + "calculate": "int((${vaccination_date} - ${lmp})div7)" + }, + "type": "calculate", + "name": "ga_lmp" + }, + { + "bind": { + "calculate": "int((${vaccination_date} -(${ultrasound_date}-(${ultrasound_weeks}*7)))div7)" + }, + "type": "calculate", + "name": "ga_ult" + }, + { + "bind": { + "relevant": "selected (${pregnant}, 'yes')" + }, + "type": "note", + "name": "final_edd_note", + "label": { + "Urdu": "${final_edd}: زچگی کی متوقع تاریخ", + "Roman Urdu": "Zachgi ki mutawaqqa tareekh: ${final_edd}", + "English": "EDD: ${final_edd}" + } + }, + { + "bind": { + "relevant": "selected (${pregnant}, 'yes')" + }, + "type": "note", + "name": "final_lmp_note", + "label": { + "Urdu": "پچھلی ماہواری کی تاریخ :{final_lmp}$", + "Roman Urdu": "Pichli mahwaari ki tareekh: ${final_lmp}", + "English": "LMP: ${final_lmp}" + } + }, + { + "bind": { + "calculate": "if(${edd_lmp}='lmp',${ga_lmp},if(${edd_lmp}='edd',${ga_edd} ,if(${edd_lmp}='ultrasound',${ga_ult},'')))" + }, + "type": "calculate", + "name": "final_ga", + "instance": { + "openmrs_entity_id": "163166AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } + }, + { + "bind": { + "relevant": "selected (${pregnant}, 'yes')" + }, + "type": "note", + "name": "final_ga_note", + "label": { + "Urdu": "حمل کی مُدّت: {final_ga}$ ہفتے", + "Roman Urdu": "Hamal ki muddat: ${final_ga} weeks", + "English": "GA: ${final_ga} weeks" + } + }, + { + "name": "vaccines", + "choice_filter": "name != if( ${e_tt1} != '', 'TT1' , '') and \nname != if( ${e_tt2} != '', 'TT2' , '') and \nname != if( ${e_tt3} != '', 'TT3' , '') and \nname != if( ${e_tt4} != '', 'TT4' , '') and \nname != if( ${e_tt5} != '', 'TT5' , '')", + "default": "minimal", + "label": { + "Urdu": "پچھلی تاریخ جب کسی اور سینٹر پر ٹیکہ لگوایا گیا یا قطرے پلائے گئے", + "Roman Urdu": "Pichli tareekh jab kissi aur center par teeka lagwaya gaya ya katray pilaey gaye", + "English": "Retro vaccines" + }, + "itemset": "vaccines", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1421AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "select all that apply" + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT1')", + "constraint": "(.<=${today} and .<=${existing_client_reg_date})" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "tt1_retro", + "label": { + "Urdu": "ٹی ٹی 1", + "Roman Urdu": "TT1", + "English": "TT1" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT1')", + "calculate": "1" + }, + "type": "calculate", + "name": "tt_1_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT2')", + "constraint": "(.<=${today} and .>=${tt1_retro} and ((selected(${vaccines}, 'TT1'))))" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "tt2_retro", + "label": { + "Urdu": "ٹی ٹی 2", + "Roman Urdu": "TT2", + "English": "TT2" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT2')", + "calculate": "2" + }, + "type": "calculate", + "name": "tt_2_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT3')", + "constraint": "(.<=${today} and .>=${tt2_retro} and ((selected(${vaccines}, 'TT2'))))" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "tt3_retro", + "label": { + "Urdu": "ٹی ٹی 3", + "Roman Urdu": "TT3", + "English": "TT3" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT3')", + "calculate": "3" + }, + "type": "calculate", + "name": "tt_3_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT4')", + "constraint": "(.<=${today} and .>=${tt3_retro} and ((selected(${vaccines}, 'TT3'))))" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "tt4_retro", + "label": { + "Urdu": "ٹی ٹی 4", + "Roman Urdu": "TT4", + "English": "TT4" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT4')", + "calculate": "4" + }, + "type": "calculate", + "name": "tt_4_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "name": "vaccines_2", + "choice_filter": "name != if( ${e_tt1} != '', 'TT1' , '') and \nname != if( ${e_tt2} != '', 'TT2' , '') and \nname != if( ${e_tt3} != '', 'TT3' , '') and \nname != if( ${e_tt4} != '', 'TT4' , '') and \nname != if( ${e_tt5} != '', 'TT5' , '') and \nname != if( selected(${vaccines}, 'TT1') , 'TT1', '') and \nname != if( selected(${vaccines}, 'TT2') , 'TT2', '') and \nname != if( selected(${vaccines}, 'TT3') , 'TT3', '') and \nname != if( selected(${vaccines}, 'TT4') , 'TT4', '') and \nname != if( selected(${vaccines}, 'TT5') , 'TT5', '')", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "آج کون کون سی ویکسین دی گئی ہیں؟", + "Roman Urdu": "Aaj kon kon si vaccine di gai hain?", + "English": "Vaccine administered today" + }, + "itemset": "vaccines", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1441AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "select all that apply" + }, + { + "bind": { + "required": "yes" + }, + "type": "date", + "instance": { + "openmrs_entity_id": "encounter_date", + "openmrs_entity": "encounter" + }, + "name": "vaccination_date", + "label": { + "Urdu": "تاریخ", + "English": "Vaccination date", + "Roman Urdu": "Tareekh" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'TT1'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "tt1", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2},'TT1')", + "calculate": "1" + }, + "type": "calculate", + "name": "tt_1_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'TT2'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "tt2", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2},'TT2')", + "calculate": "2" + }, + "type": "calculate", + "name": "tt_2_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'TT3'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "tt3", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2},'TT3')", + "calculate": "3" + }, + "type": "calculate", + "name": "tt_3_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'TT4'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "tt4", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2},'TT4')", + "calculate": "4" + }, + "type": "calculate", + "name": "tt_4_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'TT5'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "tt5", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2},'TT5')", + "calculate": "5" + }, + "type": "calculate", + "name": "tt_5_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "control": { + "bodyless": true + }, + "type": "group", + "children": [ + { + "bind": { + "readonly": "true()", + "calculate": "concat('uuid:', uuid())" + }, + "type": "calculate", + "name": "instanceID" + } + ], + "name": "meta" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/form/offsite_woman_followup/form.xml b/src/test/resources/form/offsite_woman_followup/form.xml index a2f6cb48d..bcb4be332 100644 --- a/src/test/resources/form/offsite_woman_followup/form.xml +++ b/src/test/resources/form/offsite_woman_followup/form.xml @@ -1,1439 +1,2033 @@ -
+ + - +

دوسرے سینٹر میں رجسٹرڈ خواتین فالواپ رجسٹر - Off Site Woman Follow Up Form

-
- - کیا آپ کا گھر کا پتہ بدلا ہے؟ - Kya aap ka ghar ka pata badla hai? - - Has your home address changed? -
- - -
-
-
-
- - کیا خا تون حاملہ ہیں؟ - Kia khatoon haamla hain? - - Is female pregnant? -
- - -
-
-
-
- - کیا آپ کو اپنی پچھلی ماہواری کی تاریخ، زچگی کی متوقع تاریخ، یا الٹرا سائونڈ کا علم ہے؟ - Kya aap ko apni pichli mahwaari ki tareekh, zachgi ki mutawaqqa tareekh ya ultrasound ka ilm hai? - - Do you know your LMP, EDD or last Ultrasound information? -
- - - - -
+ + + + + + + + + + + + + +
+
+ + کیا آپ کا گھر کا پتہ بدلا ہے؟ + + Kya aap ka ghar ka pata badla + hai? + + + Has your home address changed? + + +
+ + +
+
-
-
- - پچھلی تاریخ جب کسی اور سینٹر پر ٹیکہ لگوایا گیا یا قطرے پلائے گئے - Pichli tareekh jab kissi aur center par teeka lagwaya gaya ya katray pilaey gaye - - Retro vaccines -
- - - ٹی ٹی 1 - TT1 - - TT1 - ٹی ٹی 2 - TT2 - - TT2 - ٹی ٹی 3 - TT3 - - TT3 - ٹی ٹی 4 - TT4 - - TT4 - ٹی ٹی 5 - TT5 - - TT5 -
+ + + + + + + + + + +
+
+ + کیا + خا تون حاملہ ہیں؟ + + Kia khatoon haamla hain? + + + Is female pregnant? + + +
+ + +
+
-
-
- - آج کون کون سی ویکسین دی گئی ہیں؟ - Aaj kon kon si vaccine di gai hain? - - Vaccine administered today - * -
- - - ٹی ٹی 1 - TT1 - - TT1 - ٹی ٹی 2 - TT2 - - TT2 - ٹی ٹی 3 - TT3 - - TT3 - ٹی ٹی 4 - TT4 - - TT4 - ٹی ٹی 5 - TT5 - - TT5 -
+
+
+ + کیا + آپ کو اپنی پچھلی ماہواری کی تاریخ، زچگی کی متوقع تاریخ، یا الٹرا سائونڈ کا علم ہے؟ + + Kya aap ko apni pichli mahwaari ki + tareekh, zachgi ki mutawaqqa tareekh ya ultrasound ka ilm hai? + + + Do you know your LMP, EDD or last + Ultrasound information? + + +
+ + + + +
+
-
+ + +
+
+ + آج + کون کون سی ویکسین دی گئی ہیں؟ + + Aaj kon kon si vaccine di gai hain? + + + Vaccine administered today + + * + +
+ + + ٹی ٹی 1 + TT1 + + TT1 + ٹی ٹی 2 + TT2 + + TT2 + ٹی ٹی 3 + TT3 + + TT3 + ٹی ٹی 4 + TT4 + + TT4 + ٹی ٹی 5 + TT5 + + TT5 + +
+
+
+ + diff --git a/src/test/resources/form/offsite_woman_followup/form_definition.json b/src/test/resources/form/offsite_woman_followup/form_definition.json index 4353ee25d..35ad391c7 100644 --- a/src/test/resources/form/offsite_woman_followup/form_definition.json +++ b/src/test/resources/form/offsite_woman_followup/form_definition.json @@ -1,372 +1,483 @@ { - "form_data_definition_version" : "1", - "form" : { - "bind_type" : "pkwoman", - "default_bind_path" : "/model/instance/Offsite_Woman_Followup_Form/", - "fields" : [ { - "name" : "id", - "shouldLoadValue" : true - }, { - "name" : "provider_uc", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/provider_uc", - "shouldLoadValue" : true - }, { - "name" : "provider_town", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/provider_town", - "shouldLoadValue" : true - }, { - "name" : "provider_city", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/provider_city", - "shouldLoadValue" : true - }, { - "name" : "provider_province", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/provider_province", - "shouldLoadValue" : true - }, { - "name" : "existing_landmark", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_landmark", - "shouldLoadValue" : true - }, { - "name" : "existing_house_number", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_house_number", - "shouldLoadValue" : true - }, { - "name" : "existing_street", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_street", - "shouldLoadValue" : true - }, { - "name" : "existing_union_council", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_union_council", - "shouldLoadValue" : true - }, { - "name" : "existing_town", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_town", - "shouldLoadValue" : true - }, { - "name" : "existing_city_village", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_city_village", - "shouldLoadValue" : true - }, { - "name" : "existing_province", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_province", - "shouldLoadValue" : true - }, { - "name" : "existing_union_councilname", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_union_councilname", - "shouldLoadValue" : true - }, { - "name" : "existing_townname", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_townname", - "shouldLoadValue" : true - }, { - "name" : "existing_city_villagename", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_city_villagename", - "shouldLoadValue" : true - }, { - "name" : "existing_provincename", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_provincename", - "shouldLoadValue" : true - }, { - "name" : "existing_first_name", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_first_name", - "shouldLoadValue" : true - }, { - "name" : "existing_last_name", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_last_name", - "shouldLoadValue" : true - }, { - "name" : "existing_father_name", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_father_name", - "shouldLoadValue" : true - }, { - "name" : "existing_husband_name", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_husband_name", - "shouldLoadValue" : true - }, { - "name" : "existing_marriage", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_marriage", - "shouldLoadValue" : true - }, { - "name" : "existing_birthdate", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_calc_dob_confirm", - "shouldLoadValue" : true - }, { - "name" : "existing_gender", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_gender", - "shouldLoadValue" : true - }, { - "name" : "existing_ethnicity", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_ethnicity", - "shouldLoadValue" : true - }, { - "name" : "existing_client_reg_date", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_client_reg_date", - "shouldLoadValue" : true - }, { - "name" : "existing_program_client_id", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_program_client_id", - "shouldLoadValue" : true - }, { - "name" : "existing_epi_card_number", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/existing_epi_card_number", - "shouldLoadValue" : true - }, { - "name" : "e_tt1", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/e_tt1", - "shouldLoadValue" : true - }, { - "name" : "e_tt2", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/e_tt2", - "shouldLoadValue" : true - }, { - "name" : "e_tt3", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/e_tt3", - "shouldLoadValue" : true - }, { - "name" : "e_tt4", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/e_tt4", - "shouldLoadValue" : true - }, { - "name" : "e_tt5", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/e_tt5", - "shouldLoadValue" : true - }, { - "name" : "provider_id", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/provider_id", - "shouldLoadValue" : true - }, { - "name" : "provider_location_id", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/provider_location_id", - "shouldLoadValue" : true - }, { - "name" : "provider_location_name", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/provider_location_name", - "shouldLoadValue" : true - }, { - "name" : "provider_location_note", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/provider_location_note" - }, { - "name" : "start", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/start" - }, { - "name" : "end", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/end" - }, { - "name" : "today", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/today" - }, { - "name" : "deviceid", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/deviceid" - }, { - "name" : "subscriberid", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/subscriberid" - }, { - "name" : "simserial", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/simserial" - }, { - "name" : "phonenumber", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/phonenumber" - }, { - "name" : "client_reg_date_note", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/client_reg_date_note" - }, { - "name" : "program_client_id_note", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/program_client_id_note" - }, { - "name" : "epi_card_number", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/epi_card_number" - }, { - "name" : "first_name_note", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/first_name_note" - }, { - "name" : "last_name_note", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/last_name_note" - }, { - "name" : "client_age", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/client_age" - }, { - "name" : "birth_date_note", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/birth_date_note" - }, { - "name" : "gender_note", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/gender_note" - }, { - "name" : "father_name_note", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/father_name_note" - }, { - "name" : "marriage_note", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/marriage_note" - }, { - "name" : "husband_name_note", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/husband_name_note" - }, { - "name" : "ethnicity_note", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/ethnicity_note" - }, { - "name" : "address", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/address" - }, { - "name" : "address_change", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/address_change" - }, { - "name" : "province", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/province" - }, { - "name" : "city_village", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/city_village" - }, { - "name" : "town", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/town" - }, { - "name" : "union_council", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/union_council" - }, { - "name" : "house_number", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/house_number" - }, { - "name" : "street", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/street" - }, { - "name" : "landmark", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/landmark" - }, { - "name" : "center_gps", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/center_gps" - }, { - "name" : "pregnant", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/pregnant" - }, { - "name" : "edd_lmp", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/edd_lmp" - }, { - "name" : "edd", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/edd" - }, { - "name" : "lmp", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/lmp" - }, { - "name" : "ultrasound_date", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/ultrasound_date" - }, { - "name" : "ultrasound_weeks", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/ultrasound_weeks" - }, { - "name" : "edd_calc_lmp", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/edd_calc_lmp" - }, { - "name" : "edd_calc_ultrasound", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/edd_calc_ultrasound" - }, { - "name" : "edd_calc_lmp_formatted", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/edd_calc_lmp_formatted" - }, { - "name" : "edd_calc_ultrasound_formatted", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/edd_calc_ultrasound_formatted" - }, { - "name" : "lmp_calc_edd", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/lmp_calc_edd" - }, { - "name" : "lmp_calc_ultrasound", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/lmp_calc_ultrasound" - }, { - "name" : "lmp_calc_edd_formatted", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/lmp_calc_edd_formatted" - }, { - "name" : "lmp_calc_ultrasound_formatted", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/lmp_calc_ultrasound_formatted" - }, { - "name" : "final_edd", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/final_edd" - }, { - "name" : "final_lmp", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/final_lmp" - }, { - "name" : "ga_edd", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/ga_edd" - }, { - "name" : "ga_lmp", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/ga_lmp" - }, { - "name" : "ga_ult", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/ga_ult" - }, { - "name" : "final_edd_note", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/final_edd_note" - }, { - "name" : "final_lmp_note", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/final_lmp_note" - }, { - "name" : "final_ga", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/final_ga" - }, { - "name" : "final_ga_note", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/final_ga_note" - }, { - "name" : "vaccines", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/vaccines" - }, { - "name" : "tt1_retro", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt1_retro" - }, { - "name" : "tt_1_dose", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt_1_dose" - }, { - "name" : "tt2_retro", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt2_retro" - }, { - "name" : "tt_2_dose", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt_2_dose" - }, { - "name" : "tt3_retro", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt3_retro" - }, { - "name" : "tt_3_dose", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt_3_dose" - }, { - "name" : "tt4_retro", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt4_retro" - }, { - "name" : "tt_4_dose", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt_4_dose" - }, { - "name" : "vaccines_2", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/vaccines_2" - }, { - "name" : "vaccination_date", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/vaccination_date" - }, { - "name" : "tt1", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt1" - }, { - "name" : "tt_1_dose_today", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt_1_dose_today" - }, { - "name" : "tt2", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt2" - }, { - "name" : "tt_2_dose_today", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt_2_dose_today" - }, { - "name" : "tt3", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt3" - }, { - "name" : "tt_3_dose_today", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt_3_dose_today" - }, { - "name" : "tt4", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt4" - }, { - "name" : "tt_4_dose_today", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt_4_dose_today" - }, { - "name" : "tt5", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt5" - }, { - "name" : "tt_5_dose_today", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/tt_5_dose_today" - }, { - "name" : "instanceID", - "bind" : "/model/instance/Offsite_Woman_Followup_Form/meta/instanceID" - } ] + "form_data_definition_version": "1", + "form": { + "bind_type": "pkwoman", + "default_bind_path": "/model/instance/Offsite_Woman_Followup_Form/", + "fields": [ + { + "name": "id", + "shouldLoadValue": true + }, + { + "name": "provider_uc", + "bind": "/model/instance/Offsite_Woman_Followup_Form/provider_uc", + "shouldLoadValue": true + }, + { + "name": "provider_town", + "bind": "/model/instance/Offsite_Woman_Followup_Form/provider_town", + "shouldLoadValue": true + }, + { + "name": "provider_city", + "bind": "/model/instance/Offsite_Woman_Followup_Form/provider_city", + "shouldLoadValue": true + }, + { + "name": "provider_province", + "bind": "/model/instance/Offsite_Woman_Followup_Form/provider_province", + "shouldLoadValue": true + }, + { + "name": "existing_landmark", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_landmark", + "shouldLoadValue": true + }, + { + "name": "existing_house_number", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_house_number", + "shouldLoadValue": true + }, + { + "name": "existing_street", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_street", + "shouldLoadValue": true + }, + { + "name": "existing_union_council", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_union_council", + "shouldLoadValue": true + }, + { + "name": "existing_town", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_town", + "shouldLoadValue": true + }, + { + "name": "existing_city_village", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_city_village", + "shouldLoadValue": true + }, + { + "name": "existing_province", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_province", + "shouldLoadValue": true + }, + { + "name": "existing_union_councilname", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_union_councilname", + "shouldLoadValue": true + }, + { + "name": "existing_townname", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_townname", + "shouldLoadValue": true + }, + { + "name": "existing_city_villagename", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_city_villagename", + "shouldLoadValue": true + }, + { + "name": "existing_provincename", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_provincename", + "shouldLoadValue": true + }, + { + "name": "existing_first_name", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_first_name", + "shouldLoadValue": true + }, + { + "name": "existing_last_name", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_last_name", + "shouldLoadValue": true + }, + { + "name": "existing_father_name", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_father_name", + "shouldLoadValue": true + }, + { + "name": "existing_husband_name", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_husband_name", + "shouldLoadValue": true + }, + { + "name": "existing_marriage", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_marriage", + "shouldLoadValue": true + }, + { + "name": "existing_birthdate", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_calc_dob_confirm", + "shouldLoadValue": true + }, + { + "name": "existing_gender", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_gender", + "shouldLoadValue": true + }, + { + "name": "existing_ethnicity", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_ethnicity", + "shouldLoadValue": true + }, + { + "name": "existing_client_reg_date", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_client_reg_date", + "shouldLoadValue": true + }, + { + "name": "existing_program_client_id", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_program_client_id", + "shouldLoadValue": true + }, + { + "name": "existing_epi_card_number", + "bind": "/model/instance/Offsite_Woman_Followup_Form/existing_epi_card_number", + "shouldLoadValue": true + }, + { + "name": "e_tt1", + "bind": "/model/instance/Offsite_Woman_Followup_Form/e_tt1", + "shouldLoadValue": true + }, + { + "name": "e_tt2", + "bind": "/model/instance/Offsite_Woman_Followup_Form/e_tt2", + "shouldLoadValue": true + }, + { + "name": "e_tt3", + "bind": "/model/instance/Offsite_Woman_Followup_Form/e_tt3", + "shouldLoadValue": true + }, + { + "name": "e_tt4", + "bind": "/model/instance/Offsite_Woman_Followup_Form/e_tt4", + "shouldLoadValue": true + }, + { + "name": "e_tt5", + "bind": "/model/instance/Offsite_Woman_Followup_Form/e_tt5", + "shouldLoadValue": true + }, + { + "name": "provider_id", + "bind": "/model/instance/Offsite_Woman_Followup_Form/provider_id", + "shouldLoadValue": true + }, + { + "name": "provider_location_id", + "bind": "/model/instance/Offsite_Woman_Followup_Form/provider_location_id", + "shouldLoadValue": true + }, + { + "name": "provider_location_name", + "bind": "/model/instance/Offsite_Woman_Followup_Form/provider_location_name", + "shouldLoadValue": true + }, + { + "name": "provider_location_note", + "bind": "/model/instance/Offsite_Woman_Followup_Form/provider_location_note" + }, + { + "name": "start", + "bind": "/model/instance/Offsite_Woman_Followup_Form/start" + }, + { + "name": "end", + "bind": "/model/instance/Offsite_Woman_Followup_Form/end" + }, + { + "name": "today", + "bind": "/model/instance/Offsite_Woman_Followup_Form/today" + }, + { + "name": "deviceid", + "bind": "/model/instance/Offsite_Woman_Followup_Form/deviceid" + }, + { + "name": "subscriberid", + "bind": "/model/instance/Offsite_Woman_Followup_Form/subscriberid" + }, + { + "name": "simserial", + "bind": "/model/instance/Offsite_Woman_Followup_Form/simserial" + }, + { + "name": "phonenumber", + "bind": "/model/instance/Offsite_Woman_Followup_Form/phonenumber" + }, + { + "name": "client_reg_date_note", + "bind": "/model/instance/Offsite_Woman_Followup_Form/client_reg_date_note" + }, + { + "name": "program_client_id_note", + "bind": "/model/instance/Offsite_Woman_Followup_Form/program_client_id_note" + }, + { + "name": "epi_card_number", + "bind": "/model/instance/Offsite_Woman_Followup_Form/epi_card_number" + }, + { + "name": "first_name_note", + "bind": "/model/instance/Offsite_Woman_Followup_Form/first_name_note" + }, + { + "name": "last_name_note", + "bind": "/model/instance/Offsite_Woman_Followup_Form/last_name_note" + }, + { + "name": "client_age", + "bind": "/model/instance/Offsite_Woman_Followup_Form/client_age" + }, + { + "name": "birth_date_note", + "bind": "/model/instance/Offsite_Woman_Followup_Form/birth_date_note" + }, + { + "name": "gender_note", + "bind": "/model/instance/Offsite_Woman_Followup_Form/gender_note" + }, + { + "name": "father_name_note", + "bind": "/model/instance/Offsite_Woman_Followup_Form/father_name_note" + }, + { + "name": "marriage_note", + "bind": "/model/instance/Offsite_Woman_Followup_Form/marriage_note" + }, + { + "name": "husband_name_note", + "bind": "/model/instance/Offsite_Woman_Followup_Form/husband_name_note" + }, + { + "name": "ethnicity_note", + "bind": "/model/instance/Offsite_Woman_Followup_Form/ethnicity_note" + }, + { + "name": "address", + "bind": "/model/instance/Offsite_Woman_Followup_Form/address" + }, + { + "name": "address_change", + "bind": "/model/instance/Offsite_Woman_Followup_Form/address_change" + }, + { + "name": "province", + "bind": "/model/instance/Offsite_Woman_Followup_Form/province" + }, + { + "name": "city_village", + "bind": "/model/instance/Offsite_Woman_Followup_Form/city_village" + }, + { + "name": "town", + "bind": "/model/instance/Offsite_Woman_Followup_Form/town" + }, + { + "name": "union_council", + "bind": "/model/instance/Offsite_Woman_Followup_Form/union_council" + }, + { + "name": "house_number", + "bind": "/model/instance/Offsite_Woman_Followup_Form/house_number" + }, + { + "name": "street", + "bind": "/model/instance/Offsite_Woman_Followup_Form/street" + }, + { + "name": "landmark", + "bind": "/model/instance/Offsite_Woman_Followup_Form/landmark" + }, + { + "name": "center_gps", + "bind": "/model/instance/Offsite_Woman_Followup_Form/center_gps" + }, + { + "name": "pregnant", + "bind": "/model/instance/Offsite_Woman_Followup_Form/pregnant" + }, + { + "name": "edd_lmp", + "bind": "/model/instance/Offsite_Woman_Followup_Form/edd_lmp" + }, + { + "name": "edd", + "bind": "/model/instance/Offsite_Woman_Followup_Form/edd" + }, + { + "name": "lmp", + "bind": "/model/instance/Offsite_Woman_Followup_Form/lmp" + }, + { + "name": "ultrasound_date", + "bind": "/model/instance/Offsite_Woman_Followup_Form/ultrasound_date" + }, + { + "name": "ultrasound_weeks", + "bind": "/model/instance/Offsite_Woman_Followup_Form/ultrasound_weeks" + }, + { + "name": "edd_calc_lmp", + "bind": "/model/instance/Offsite_Woman_Followup_Form/edd_calc_lmp" + }, + { + "name": "edd_calc_ultrasound", + "bind": "/model/instance/Offsite_Woman_Followup_Form/edd_calc_ultrasound" + }, + { + "name": "edd_calc_lmp_formatted", + "bind": "/model/instance/Offsite_Woman_Followup_Form/edd_calc_lmp_formatted" + }, + { + "name": "edd_calc_ultrasound_formatted", + "bind": "/model/instance/Offsite_Woman_Followup_Form/edd_calc_ultrasound_formatted" + }, + { + "name": "lmp_calc_edd", + "bind": "/model/instance/Offsite_Woman_Followup_Form/lmp_calc_edd" + }, + { + "name": "lmp_calc_ultrasound", + "bind": "/model/instance/Offsite_Woman_Followup_Form/lmp_calc_ultrasound" + }, + { + "name": "lmp_calc_edd_formatted", + "bind": "/model/instance/Offsite_Woman_Followup_Form/lmp_calc_edd_formatted" + }, + { + "name": "lmp_calc_ultrasound_formatted", + "bind": "/model/instance/Offsite_Woman_Followup_Form/lmp_calc_ultrasound_formatted" + }, + { + "name": "final_edd", + "bind": "/model/instance/Offsite_Woman_Followup_Form/final_edd" + }, + { + "name": "final_lmp", + "bind": "/model/instance/Offsite_Woman_Followup_Form/final_lmp" + }, + { + "name": "ga_edd", + "bind": "/model/instance/Offsite_Woman_Followup_Form/ga_edd" + }, + { + "name": "ga_lmp", + "bind": "/model/instance/Offsite_Woman_Followup_Form/ga_lmp" + }, + { + "name": "ga_ult", + "bind": "/model/instance/Offsite_Woman_Followup_Form/ga_ult" + }, + { + "name": "final_edd_note", + "bind": "/model/instance/Offsite_Woman_Followup_Form/final_edd_note" + }, + { + "name": "final_lmp_note", + "bind": "/model/instance/Offsite_Woman_Followup_Form/final_lmp_note" + }, + { + "name": "final_ga", + "bind": "/model/instance/Offsite_Woman_Followup_Form/final_ga" + }, + { + "name": "final_ga_note", + "bind": "/model/instance/Offsite_Woman_Followup_Form/final_ga_note" + }, + { + "name": "vaccines", + "bind": "/model/instance/Offsite_Woman_Followup_Form/vaccines" + }, + { + "name": "tt1_retro", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt1_retro" + }, + { + "name": "tt_1_dose", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt_1_dose" + }, + { + "name": "tt2_retro", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt2_retro" + }, + { + "name": "tt_2_dose", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt_2_dose" + }, + { + "name": "tt3_retro", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt3_retro" + }, + { + "name": "tt_3_dose", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt_3_dose" + }, + { + "name": "tt4_retro", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt4_retro" + }, + { + "name": "tt_4_dose", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt_4_dose" + }, + { + "name": "vaccines_2", + "bind": "/model/instance/Offsite_Woman_Followup_Form/vaccines_2" + }, + { + "name": "vaccination_date", + "bind": "/model/instance/Offsite_Woman_Followup_Form/vaccination_date" + }, + { + "name": "tt1", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt1" + }, + { + "name": "tt_1_dose_today", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt_1_dose_today" + }, + { + "name": "tt2", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt2" + }, + { + "name": "tt_2_dose_today", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt_2_dose_today" + }, + { + "name": "tt3", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt3" + }, + { + "name": "tt_3_dose_today", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt_3_dose_today" + }, + { + "name": "tt4", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt4" + }, + { + "name": "tt_4_dose_today", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt_4_dose_today" + }, + { + "name": "tt5", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt5" + }, + { + "name": "tt_5_dose_today", + "bind": "/model/instance/Offsite_Woman_Followup_Form/tt_5_dose_today" + }, + { + "name": "instanceID", + "bind": "/model/instance/Offsite_Woman_Followup_Form/meta/instanceID" + } + ] } } \ No newline at end of file diff --git a/src/test/resources/form/offsite_woman_followup/model.xml b/src/test/resources/form/offsite_woman_followup/model.xml index 2b5e6a2d8..b79c43abd 100644 --- a/src/test/resources/form/offsite_woman_followup/model.xml +++ b/src/test/resources/form/offsite_woman_followup/model.xml @@ -1,7 +1,8 @@ - + @@ -63,13 +64,20 @@
- ${provider_province} - ${provider_city} + ${provider_province} + + ${provider_city} + - - + + - + @@ -96,27 +104,48 @@ - minimal - - - - - - - - - + minimal + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + diff --git a/src/test/resources/form/pnc_1st_registration/form.json b/src/test/resources/form/pnc_1st_registration/form.json index ac61605e1..56222815f 100644 --- a/src/test/resources/form/pnc_1st_registration/form.json +++ b/src/test/resources/form/pnc_1st_registration/form.json @@ -1,373 +1,373 @@ { - "name": "pnc_first_registration_motherdetails", - "title": "PNC Registration", - "sms_keyword": "pnc_1st_registration", - "default_language": "default", - "instance": { - "encounter_type": "PNC Registration" + "name": "pnc_first_registration_motherdetails", + "title": "PNC Registration", + "sms_keyword": "pnc_1st_registration", + "default_language": "default", + "instance": { + "encounter_type": "PNC Registration" + }, + "version": "201504011203", + "id_string": "pnc_1st_registration", + "type": "survey", + "children": [ + { + "instance": { + "openmrs_entity_id": "location_id", + "openmrs_entity": "encounter" + }, + "type": "text", + "name": "location", + "label": "Location" }, - "version": "201504011203", - "id_string": "pnc_1st_registration", - "type": "survey", - "children": [ + { + "instance": { + "openmrs_entity_id": "encounter_date", + "openmrs_entity": "encounter" + }, + "type": "today", + "name": "today" + }, + { + "instance": { + "openmrs_entity_id": "encounter_start", + "openmrs_entity": "encounter" + }, + "type": "start", + "name": "start" + }, + { + "instance": { + "openmrs_entity_id": "encounter_end", + "openmrs_entity": "encounter" + }, + "type": "end", + "name": "end" + }, + { + "instance": { + "openmrs_entity_id": "OpenSRPID", + "openmrs_entity": "person_identifier" + }, + "type": "integer", + "name": "mother_id", + "label": "Mother ID number:" + }, + { + "name": "gender", + "bind": { + "required": "yes" + }, + "label": "Gender? ಮಗುವಿನ ಲಿಂಗ?", + "instance": { + "openmrs_entity_id": "gender", + "openmrs_entity": "person" + }, + "type": "select one", + "children": [ { - "instance": { - "openmrs_entity_id": "location_id", - "openmrs_entity": "encounter" - }, - "type": "text", - "name": "location", - "label": "Location" + "instance": { + "openmrs_code": "1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "male", + "label": "Male ಗಂಡು" }, { - "instance": { - "openmrs_entity_id": "encounter_date", - "openmrs_entity": "encounter" - }, - "type": "today", - "name": "today" - }, + "instance": { + "openmrs_code": "1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "female", + "label": "Female ಹೆಣ್ಣು" + } + ] + }, + { + "instance": { + "openmrs_entity_id": "birthdate", + "openmrs_entity": "person" + }, + "type": "date", + "name": "mother_birthdate", + "label": "Mother's DOB?" + }, + { + "instance": { + "openmrs_entity_id": "first_name", + "openmrs_entity": "person" + }, + "type": "text", + "name": "mother_first_name", + "label": "Mother's first name?" + }, + { + "instance": { + "openmrs_entity_id": "last_name", + "openmrs_entity": "person" + }, + "type": "text", + "name": "mother_last_name", + "label": "Mother's last name?" + }, + { + "bind": { + "required": "yes", + "constraint": ".<=${today}" + }, + "type": "date", + "instance": { + "openmrs_entity_id": "5599AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "delivery_date", + "label": "Delivery date? ಹೆರಿಗೆ ದಿನಾಂಕ?" + }, + { + "instance": { + "openmrs_entity_id": "162724AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "text", + "name": "delivery_facility_name", + "label": "Name of delivery facility? ಹೆರಿಗೆಯಾದ ಸ್ಥಳದ ಹೆಸರು?" + }, + { + "name": "delivery_skilled", + "bind": { + "required": "yes" + }, + "label": "Delivery attended by SBA? ತರಬೇತಿ ಹೊಂದಿದ ಹೆರಿಗೆ ಸಹಾಯಕರು ಹೆರಿಗೆಯಲ್ಲಿ ಹಾಜರಿದ್ದರೆ?", + "instance": { + "openmrs_entity_id": "160083AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ { - "instance": { - "openmrs_entity_id": "encounter_start", - "openmrs_entity": "encounter" - }, - "type": "start", - "name": "start" + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": "Yes ಹೌದು" }, { - "instance": { - "openmrs_entity_id": "encounter_end", - "openmrs_entity": "encounter" - }, - "type": "end", - "name": "end" - }, + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": "No ಇಲ್ಲ" + } + ] + }, + { + "instance": { + "openmrs_entity_id": "5630AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "label": "Type of delivery? ಯಾವ ವಿಧದ ಹೆರಿಗೆ?", + "type": "select one", + "children": [ { - "instance": { - "openmrs_entity_id": "OpenSRPID", - "openmrs_entity": "person_identifier" - }, - "type": "integer", - "name": "mother_id", - "label": "Mother ID number:" + "instance": { + "openmrs_code": "1170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "normal", + "label": "Normal ಸಾಮಾನ್ಯ" }, { - "name": "gender", - "bind": { - "required": "yes" - }, - "label": "Gender? ಮಗುವಿನ ಲಿಂಗ?", - "instance": { - "openmrs_entity_id": "gender", - "openmrs_entity": "person" - }, - "type": "select one", - "children": [ - { - "instance": { - "openmrs_code": "1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "male", - "label": "Male ಗಂಡು" - }, - { - "instance": { - "openmrs_code": "1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "female", - "label": "Female ಹೆಣ್ಣು" - } - ] + "instance": { + "openmrs_code": "1171AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "cesarean", + "label": "Cesarean ಸಿಸೇರಿಯನ್" }, { - "instance": { - "openmrs_entity_id": "birthdate", - "openmrs_entity": "person" - }, - "type": "date", - "name": "mother_birthdate", - "label": "Mother's DOB?" - }, + "instance": { + "openmrs_code": "118159AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "instrumental_forcep", + "label": "Instrumental / Forcep ಉಪಕರಣಗಳಿಂದ ಮಾಡುವ ಹೆರಿಗೆ" + } + ], + "name": "delivery_type" + }, + { + "name": "delivery_outcome", + "bind": { + "required": "yes" + }, + "label": "Delivery outcome? ಹೆರಿಗೆ ಫಲಿತಾಂಶವೇನು?", + "instance": { + "openmrs_entity_id": "159917AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ { - "instance": { - "openmrs_entity_id": "first_name", - "openmrs_entity": "person" - }, - "type": "text", - "name": "mother_first_name", - "label": "Mother's first name?" + "instance": { + "openmrs_code": "151849AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "live_birth", + "label": "Live Birth ಜೀವಂತ ಜನನ" }, { - "instance": { - "openmrs_entity_id": "last_name", - "openmrs_entity": "person" - }, - "type": "text", - "name": "mother_last_name", - "label": "Mother's last name?" - }, + "instance": { + "openmrs_code": "125872AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "still_birth", + "label": "Still Birth ನಿರ್ಜೀವ ಜನನ" + } + ] + }, + { + "instance": { + "openmrs_entity_id": "1053AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "int", + "name": "parity", + "label": "Parity" + }, + { + "bind": { + "relevant": "${delivery_outcome} = 'live_birth'" + }, + "type": "int", + "instance": { + "openmrs_entity_id": "160601AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "num_livebirths", + "label": "Live births" + }, + { + "bind": { + "relevant": "${delivery_outcome} = 'still_birth'" + }, + "type": "int", + "instance": { + "openmrs_entity_id": "160077AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "num_stillbirths", + "label": "Still births" + }, + { + "instance": { + "openmrs_entity_id": "1576AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "label": "What delivery complications were there? ಯಾವ ಹೆರಿಗೆ ತೊಂದರೆಗಳು ಉಂಟಾದವು?", + "type": "select all that apply", + "children": [ { - "bind": { - "required": "yes", - "constraint": ".<=${today}" - }, - "type": "date", - "instance": { - "openmrs_entity_id": "5599AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "name": "delivery_date", - "label": "Delivery date? ಹೆರಿಗೆ ದಿನಾಂಕ?" + "instance": { + "openmrs_code": "230AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "hemorrhage", + "label": "Hemorrhage ರಕ್ತಸ್ರಾವ" }, { - "instance": { - "openmrs_entity_id": "162724AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "text", - "name": "delivery_facility_name", - "label": "Name of delivery facility? ಹೆರಿಗೆಯಾದ ಸ್ಥಳದ ಹೆಸರು?" + "instance": { + "openmrs_code": "114127AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "placenta_previa", + "label": "Placenta previa ಹಿಂದಿನ ಗರ್ಭದಲ್ಲಿ ಮಾಸು ಮುಂದಿರುವುದು" }, { - "name": "delivery_skilled", - "bind": { - "required": "yes" - }, - "label": "Delivery attended by SBA? ತರಬೇತಿ ಹೊಂದಿದ ಹೆರಿಗೆ ಸಹಾಯಕರು ಹೆರಿಗೆಯಲ್ಲಿ ಹಾಜರಿದ್ದರೆ?", - "instance": { - "openmrs_entity_id": "160083AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "select one", - "children": [ - { - "instance": { - "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "yes", - "label": "Yes ಹೌದು" - }, - { - "instance": { - "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "no", - "label": "No ಇಲ್ಲ" - } - ] + "instance": { + "openmrs_code": "128420AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "cord_prolapse", + "label": "Cord prolapse ಬಳ್ಳಿಯ ಸರಿತ" }, { - "instance": { - "openmrs_entity_id": "5630AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "label": "Type of delivery? ಯಾವ ವಿಧದ ಹೆರಿಗೆ?", - "type": "select one", - "children": [ - { - "instance": { - "openmrs_code": "1170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "normal", - "label": "Normal ಸಾಮಾನ್ಯ" - }, - { - "instance": { - "openmrs_code": "1171AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "cesarean", - "label": "Cesarean ಸಿಸೇರಿಯನ್" - }, - { - "instance": { - "openmrs_code": "118159AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "instrumental_forcep", - "label": "Instrumental / Forcep ಉಪಕರಣಗಳಿಂದ ಮಾಡುವ ಹೆರಿಗೆ" - } - ], - "name": "delivery_type" + "instance": { + "openmrs_code": "115036AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "prolonged_labor", + "label": "Prolonged / obstructed labor ದೀರ್ಘಕಾಲೀನ / ಅಡಚಣೆಯನ್ನು ತಂದೊಡ್ಡುವ ಹೆರಿಗೆ ನೋವು" }, { - "name": "delivery_outcome", - "bind": { - "required": "yes" - }, - "label": "Delivery outcome? ಹೆರಿಗೆ ಫಲಿತಾಂಶವೇನು?", - "instance": { - "openmrs_entity_id": "159917AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "select one", - "children": [ - { - "instance": { - "openmrs_code": "151849AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "live_birth", - "label": "Live Birth ಜೀವಂತ ಜನನ" - }, - { - "instance": { - "openmrs_code": "125872AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "still_birth", - "label": "Still Birth ನಿರ್ಜೀವ ಜನನ" - } - ] + "instance": { + "openmrs_code": "1172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "abnormal_presentation", + "label": "Abnormal presentation ಅಪಸಾಮಾನ್ಯ ಪ್ರಸ್ತುತಿ" }, { - "instance": { - "openmrs_entity_id": "1053AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "int", - "name": "parity", - "label": "Parity" + "instance": { + "openmrs_code": "126886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "perineal_tear_2nd_degree", + "label": "Perineal tear (2 degree)" }, { - "bind": { - "relevant": "${delivery_outcome} = 'live_birth'" - }, - "type": "int", - "instance": { - "openmrs_entity_id": "160601AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "name": "num_livebirths", - "label": "Live births" + "instance": { + "openmrs_code": "124857AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "perineal_tear_3rd_degree", + "label": "Perineal tear (3 degree)" }, { - "bind": { - "relevant": "${delivery_outcome} = 'still_birth'" - }, - "type": "int", - "instance": { - "openmrs_entity_id": "160077AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "name": "num_stillbirths", - "label": "Still births" + "instance": { + "openmrs_code": "39911AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "perineal_tear_4th_degree", + "label": "Perineal tear (4 degree)" }, { - "instance": { - "openmrs_entity_id": "1576AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "label": "What delivery complications were there? ಯಾವ ಹೆರಿಗೆ ತೊಂದರೆಗಳು ಉಂಟಾದವು?", - "type": "select all that apply", - "children": [ - { - "instance": { - "openmrs_code": "230AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "hemorrhage", - "label": "Hemorrhage ರಕ್ತಸ್ರಾವ" - }, - { - "instance": { - "openmrs_code": "114127AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "placenta_previa", - "label": "Placenta previa ಹಿಂದಿನ ಗರ್ಭದಲ್ಲಿ ಮಾಸು ಮುಂದಿರುವುದು" - }, - { - "instance": { - "openmrs_code": "128420AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "cord_prolapse", - "label": "Cord prolapse ಬಳ್ಳಿಯ ಸರಿತ" - }, - { - "instance": { - "openmrs_code": "115036AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "prolonged_labor", - "label": "Prolonged / obstructed labor ದೀರ್ಘಕಾಲೀನ / ಅಡಚಣೆಯನ್ನು ತಂದೊಡ್ಡುವ ಹೆರಿಗೆ ನೋವು" - }, - { - "instance": { - "openmrs_code": "1172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "abnormal_presentation", - "label": "Abnormal presentation ಅಪಸಾಮಾನ್ಯ ಪ್ರಸ್ತುತಿ" - }, - { - "instance": { - "openmrs_code": "126886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "perineal_tear_2nd_degree", - "label": "Perineal tear (2 degree)" - }, - { - "instance": { - "openmrs_code": "124857AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "perineal_tear_3rd_degree", - "label": "Perineal tear (3 degree)" - }, - { - "instance": { - "openmrs_code": "39911AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "perineal_tear_4th_degree", - "label": "Perineal tear (4 degree)" - }, - { - "instance": { - "openmrs_code": "120222AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "others", - "label": "Others ಇತರೆ" - } - ], - "name": "complications" - }, + "instance": { + "openmrs_code": "120222AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "others", + "label": "Others ಇತರೆ" + } + ], + "name": "complications" + }, + { + "name": "woman_survived", + "bind": { + "required": "yes" + }, + "label": "Woman survived childbirth? ಮಗುವಿನ ಜನನದ ನಂತರ ಮಹಿಳೆ ಬದುಕುಳಿದರೆ?", + "instance": { + "openmrs_entity_id": "134612AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ { - "name": "woman_survived", - "bind": { - "required": "yes" - }, - "label": "Woman survived childbirth? ಮಗುವಿನ ಜನನದ ನಂತರ ಮಹಿಳೆ ಬದುಕುಳಿದರೆ?", - "instance": { - "openmrs_entity_id": "134612AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept" - }, - "type": "select one", - "children": [ - { - "instance": { - "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "yes", - "label": "Yes ಹೌದು" - }, - { - "instance": { - "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - "name": "no", - "label": "No ಇಲ್ಲ" - } - ] + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": "Yes ಹೌದು" }, { - "control": { - "bodyless": true - }, - "type": "group", - "children": [ - { - "bind": { - "readonly": "true()", - "calculate": "concat('uuid:', uuid())" - }, - "type": "calculate", - "name": "instanceID" - } - ], - "name": "meta" + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": "No ಇಲ್ಲ" + } + ] + }, + { + "control": { + "bodyless": true + }, + "type": "group", + "children": [ + { + "bind": { + "readonly": "true()", + "calculate": "concat('uuid:', uuid())" + }, + "type": "calculate", + "name": "instanceID" } - ] + ], + "name": "meta" + } + ] } \ No newline at end of file diff --git a/src/test/resources/form/pnc_1st_registration/form.xml b/src/test/resources/form/pnc_1st_registration/form.xml index d9501c2e3..705705172 100644 --- a/src/test/resources/form/pnc_1st_registration/form.xml +++ b/src/test/resources/form/pnc_1st_registration/form.xml @@ -1,29 +1,294 @@ -
-

PNC Registration

- - - - -
Gender? ಮಗುವಿನ ಲಿಂಗ?* -
- - - - - -
Delivery attended by SBA? ತರಬೇತಿ ಹೊಂದಿದ ಹೆರಿಗೆ ಸಹಾಯಕರು ಹೆರಿಗೆಯಲ್ಲಿ ಹಾಜರಿದ್ದರೆ?* -
-
Type of delivery? ಯಾವ ವಿಧದ ಹೆರಿಗೆ? -
-
Delivery outcome? ಹೆರಿಗೆ ಫಲಿತಾಂಶವೇನು?* -
- - - -
What delivery complications were there? ಯಾವ ಹೆರಿಗೆ ತೊಂದರೆಗಳು ಉಂಟಾದವು? -
-
Woman survived childbirth? ಮಗುವಿನ ಜನನದ ನಂತರ ಮಹಿಳೆ ಬದುಕುಳಿದರೆ?* -
- -
XML to HTML transformation for form took 0.03 secondsThis validation is yet not functional.
+ +
+ + +

PNC Registration

+ + + + +
+
+ + Gender? ಮಗುವಿನ + ಲಿಂಗ? + + * + +
+ + +
+
+
+ + + + + +
+
+ + Delivery attended by SBA? ತರಬೇತಿ + ಹೊಂದಿದ ಹೆರಿಗೆ ಸಹಾಯಕರು + ಹೆರಿಗೆಯಲ್ಲಿ ಹಾಜರಿದ್ದರೆ? + + * + +
+ + +
+
+
+
+
+ + Type of delivery? ಯಾವ ವಿಧದ + ಹೆರಿಗೆ? + + +
+ + + +
+
+
+
+
+ + Delivery outcome? ಹೆರಿಗೆ + ಫಲಿತಾಂಶವೇನು? + + * + +
+ + +
+
+
+ + + +
+
+ + What delivery complications were there? ಯಾವ + ಹೆರಿಗೆ ತೊಂದರೆಗಳು + ಉಂಟಾದವು? + + +
+ + + + + + + + + +
+
+
+
+
+ + Woman survived childbirth? ಮಗುವಿನ + ಜನನದ ನಂತರ ಮಹಿಳೆ + ಬದುಕುಳಿದರೆ? + + * + +
+ + +
+
+
+ + + +
+ + XML to HTML transformation for form took 0.03 seconds + + + This validation is yet not functional. + + + + +
diff --git a/src/test/resources/form/pnc_1st_registration/form_definition.json b/src/test/resources/form/pnc_1st_registration/form_definition.json index f715275a8..e72938494 100644 --- a/src/test/resources/form/pnc_1st_registration/form_definition.json +++ b/src/test/resources/form/pnc_1st_registration/form_definition.json @@ -5,8 +5,8 @@ "bind_type": "demo_mother", "fields": [ { - "name":"id", - "shouldLoadValue": true + "name": "id", + "shouldLoadValue": true }, { "name": "location", diff --git a/src/test/resources/form/pnc_1st_registration/form_submission.json b/src/test/resources/form/pnc_1st_registration/form_submission.json index 7cdcb1c63..3b8cf9823 100644 --- a/src/test/resources/form/pnc_1st_registration/form_submission.json +++ b/src/test/resources/form/pnc_1st_registration/form_submission.json @@ -1,135 +1,135 @@ { - "anmId": "admin", - "clientVersion": "1426830449320", - "entityId": "b716d938-1aea-40ae-a081-9ddddddcccc9", - "formDataDefinitionVersion": "5", - "formName": "pnc_1st_registration", - "formInstance": { - "form_data_definition_version": "1", - "form": { - "default_bind_path": "/model/instance/pnc_first_registration_motherdetails", - "bind_type": "demo_mother", - "fields": [ - { - "name": "id", - "shouldLoadValue": true, - "source": "demo_mother.id", - "value": "aec8e1a5-ab11-47ac-8bc0-ff1e7146e342" - }, - { - "name": "location", - "bind": "/model/instance/pnc_first_registration_motherdetails/location", - "source": "demo_mother.location", - "value": "testloc" - }, - { - "name": "today", - "bind": "/model/instance/pnc_first_registration_motherdetails/today", - "source": "demo_mother.today", - "value": "2015-04-02" - }, - { - "name": "start", - "bind": "/model/instance/pnc_first_registration_motherdetails/start", - "source": "demo_mother.start", - "value": "2015-04-02T04:49:16.000-00:00" - }, - { - "name": "end", - "bind": "/model/instance/pnc_first_registration_motherdetails/end", - "source": "demo_mother.end", - "value": "2015-04-02T04:49:16.000-00:00" - }, - { - "name": "mother_id", - "bind": "/model/instance/pnc_first_registration_motherdetails/mother_id", - "source": "demo_mother.mother_id", - "value": "234" - }, - { - "name": "gender", - "bind": "/model/instance/pnc_first_registration_motherdetails/gender", - "source": "demo_mother.gender", - "value": "male" - }, - { - "name": "mother_birthdate", - "bind": "/model/instance/pnc_first_registration_motherdetails/mother_birthdate", - "source": "demo_mother.mother_birthdate", - "value": "1989-01-31" - }, - { - "name": "mother_first_name", - "bind": "/model/instance/pnc_first_registration_motherdetails/mother_first_name", - "source": "demo_mother.mother_first_name", - "value": "jamila" - }, - { - "name": "mother_last_name", - "bind": "/model/instance/pnc_first_registration_motherdetails/mother_last_name", - "source": "demo_mother.mother_last_name", - "value": "rashid" - }, - { - "name": "delivery_date", - "bind": "/model/instance/pnc_first_registration_motherdetails/delivery_date", - "source": "demo_mother.delivery_date", - "value": "2015-04-01" - }, - { - "name": "delivery_facility_name", - "bind": "/model/instance/pnc_first_registration_motherdetails/delivery_facility_name", - "source": "demo_mother.delivery_facility_name", - "value": "moghbazar health center" - }, - { - "name": "delivery_skilled", - "bind": "/model/instance/pnc_first_registration_motherdetails/delivery_skilled", - "source": "demo_mother.delivery_skilled", - "value": "yes" - }, - { - "name": "delivery_type", - "bind": "/model/instance/pnc_first_registration_motherdetails/delivery_type", - "source": "demo_mother.delivery_type", - "value": "normal" - }, - { - "name": "delivery_outcome", - "bind": "/model/instance/pnc_first_registration_motherdetails/delivery_outcome", - "source": "demo_mother.delivery_outcome", - "value": "live_birth" - }, - { - "name": "parity", - "bind": "/model/instance/pnc_first_registration_motherdetails/parity", - "source": "demo_mother.parity", - "value": "1" - }, - { - "name": "num_livebirths", - "bind": "/model/instance/pnc_first_registration_motherdetails/num_livebirths", - "source": "demo_mother.num_livebirths", - "value": "1" - }, - { - "name": "num_stillbirths", - "bind": "/model/instance/pnc_first_registration_motherdetails/num_stillbirths", - "source": "demo_mother.num_stillbirths" - }, - { - "name": "complications", - "bind": "/model/instance/pnc_first_registration_motherdetails/complications", - "source": "demo_mother.complications", - "value": "hemorrhage" - }, - { - "name": "woman_survived", - "bind": "/model/instance/pnc_first_registration_motherdetails/woman_survived", - "source": "demo_mother.woman_survived", - "value": "yes" - } - ] + "anmId": "admin", + "clientVersion": "1426830449320", + "entityId": "b716d938-1aea-40ae-a081-9ddddddcccc9", + "formDataDefinitionVersion": "5", + "formName": "pnc_1st_registration", + "formInstance": { + "form_data_definition_version": "1", + "form": { + "default_bind_path": "/model/instance/pnc_first_registration_motherdetails", + "bind_type": "demo_mother", + "fields": [ + { + "name": "id", + "shouldLoadValue": true, + "source": "demo_mother.id", + "value": "aec8e1a5-ab11-47ac-8bc0-ff1e7146e342" + }, + { + "name": "location", + "bind": "/model/instance/pnc_first_registration_motherdetails/location", + "source": "demo_mother.location", + "value": "testloc" + }, + { + "name": "today", + "bind": "/model/instance/pnc_first_registration_motherdetails/today", + "source": "demo_mother.today", + "value": "2015-04-02" + }, + { + "name": "start", + "bind": "/model/instance/pnc_first_registration_motherdetails/start", + "source": "demo_mother.start", + "value": "2015-04-02T04:49:16.000-00:00" + }, + { + "name": "end", + "bind": "/model/instance/pnc_first_registration_motherdetails/end", + "source": "demo_mother.end", + "value": "2015-04-02T04:49:16.000-00:00" + }, + { + "name": "mother_id", + "bind": "/model/instance/pnc_first_registration_motherdetails/mother_id", + "source": "demo_mother.mother_id", + "value": "234" + }, + { + "name": "gender", + "bind": "/model/instance/pnc_first_registration_motherdetails/gender", + "source": "demo_mother.gender", + "value": "male" + }, + { + "name": "mother_birthdate", + "bind": "/model/instance/pnc_first_registration_motherdetails/mother_birthdate", + "source": "demo_mother.mother_birthdate", + "value": "1989-01-31" + }, + { + "name": "mother_first_name", + "bind": "/model/instance/pnc_first_registration_motherdetails/mother_first_name", + "source": "demo_mother.mother_first_name", + "value": "jamila" + }, + { + "name": "mother_last_name", + "bind": "/model/instance/pnc_first_registration_motherdetails/mother_last_name", + "source": "demo_mother.mother_last_name", + "value": "rashid" + }, + { + "name": "delivery_date", + "bind": "/model/instance/pnc_first_registration_motherdetails/delivery_date", + "source": "demo_mother.delivery_date", + "value": "2015-04-01" + }, + { + "name": "delivery_facility_name", + "bind": "/model/instance/pnc_first_registration_motherdetails/delivery_facility_name", + "source": "demo_mother.delivery_facility_name", + "value": "moghbazar health center" + }, + { + "name": "delivery_skilled", + "bind": "/model/instance/pnc_first_registration_motherdetails/delivery_skilled", + "source": "demo_mother.delivery_skilled", + "value": "yes" + }, + { + "name": "delivery_type", + "bind": "/model/instance/pnc_first_registration_motherdetails/delivery_type", + "source": "demo_mother.delivery_type", + "value": "normal" + }, + { + "name": "delivery_outcome", + "bind": "/model/instance/pnc_first_registration_motherdetails/delivery_outcome", + "source": "demo_mother.delivery_outcome", + "value": "live_birth" + }, + { + "name": "parity", + "bind": "/model/instance/pnc_first_registration_motherdetails/parity", + "source": "demo_mother.parity", + "value": "1" + }, + { + "name": "num_livebirths", + "bind": "/model/instance/pnc_first_registration_motherdetails/num_livebirths", + "source": "demo_mother.num_livebirths", + "value": "1" + }, + { + "name": "num_stillbirths", + "bind": "/model/instance/pnc_first_registration_motherdetails/num_stillbirths", + "source": "demo_mother.num_stillbirths" + }, + { + "name": "complications", + "bind": "/model/instance/pnc_first_registration_motherdetails/complications", + "source": "demo_mother.complications", + "value": "hemorrhage" + }, + { + "name": "woman_survived", + "bind": "/model/instance/pnc_first_registration_motherdetails/woman_survived", + "source": "demo_mother.woman_survived", + "value": "yes" } + ] } + } } \ No newline at end of file diff --git a/src/test/resources/form/pnc_1st_registration/model.xml b/src/test/resources/form/pnc_1st_registration/model.xml index 02529770a..5a5114c71 100644 --- a/src/test/resources/form/pnc_1st_registration/model.xml +++ b/src/test/resources/form/pnc_1st_registration/model.xml @@ -1,31 +1,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - \ No newline at end of file + + \ No newline at end of file diff --git a/src/test/resources/form/pnc_reg_form/form.json b/src/test/resources/form/pnc_reg_form/form.json index 5fd76f37d..163226f9c 100644 --- a/src/test/resources/form/pnc_reg_form/form.json +++ b/src/test/resources/form/pnc_reg_form/form.json @@ -1,1381 +1,1381 @@ { - "default_language": "default", - "id_string": "Delivery_Outcome_EngKan", - "children": [ + "default_language": "default", + "id_string": "Delivery_Outcome_EngKan", + "children": [ + { + "name": "today", + "type": "today" + }, + { + "name": "case_lmp", + "instance": { + "openmrs_entity_id": "1100282", + "openmrs_entity": "concept" + }, + "type": "hidden" + }, + { + "name": "delivery_date", + "bind": { + "required": "yes", + "constraint": ".<=${today}" + }, + "label": "Delivery date? ಹೆರಿಗೆ ದಿನಾಂಕ?", + "instance": { + "openmrs_entity_id": "2129182", + "openmrs_entity": "concept" + }, + "type": "date" + }, + { + "name": "delivery_reg_date", + "bind": { + "required": "yes", + "constraint": ".<=${today} and .>= ${delivery_date}" + }, + "label": "PNC registration date? ಬಾಣಂತಿ ದಾಖಲಾತಿ ದಿನಾಂಕ?", + "instance": { + "openmrs_entity_id": "encounter_date", + "openmrs_entity": "encounter" + }, + "type": "date" + }, + { + "children": [ { - "name": "today", - "type": "today" + "name": "home", + "label": "Home ಮನೆ", + "instance": { + "openmrs_code": "32323213" + } }, { - "name": "case_lmp", - "instance": { - "openmrs_entity_id": "1100282", - "openmrs_entity": "concept" - }, - "type": "hidden" + "name": "subcenter", + "label": "Sub Center ಉಪ ಕೇಂದ್ರ", + "instance": { + "openmrs_code": "2321321" + } }, { - "name": "delivery_date", - "bind": { - "required": "yes", - "constraint": ".<=${today}" - }, - "label": "Delivery date? ಹೆರಿಗೆ ದಿನಾಂಕ?", - "instance": { - "openmrs_entity_id": "2129182", - "openmrs_entity": "concept" - }, - "type": "date" + "name": "phc", + "label": "PHC ಪ್ರಾಥಮಿಕ ಆರೋಗ್ಯ ಕೇಂದ್ರ", + "instance": { + "openmrs_code": "323213" + } }, { - "name": "delivery_reg_date", - "bind": { - "required": "yes", - "constraint": ".<=${today} and .>= ${delivery_date}" - }, - "label": "PNC registration date? ಬಾಣಂತಿ ದಾಖಲಾತಿ ದಿನಾಂಕ?", - "instance": { - "openmrs_entity_id": "encounter_date", - "openmrs_entity": "encounter" - }, - "type": "date" + "name": "chc", + "label": "CHC ಸಮುದಾಯ ಆರೋಗ್ಯ ಕೇಂದ್ರ", + "instance": { + "openmrs_code": "1213213" + } }, { - "children": [ - { - "name": "home", - "label": "Home ಮನೆ", - "instance": { - "openmrs_code": "32323213" - } - }, - { - "name": "subcenter", - "label": "Sub Center ಉಪ ಕೇಂದ್ರ", - "instance": { - "openmrs_code": "2321321" - } - }, - { - "name": "phc", - "label": "PHC ಪ್ರಾಥಮಿಕ ಆರೋಗ್ಯ ಕೇಂದ್ರ", - "instance": { - "openmrs_code": "323213" - } - }, - { - "name": "chc", - "label": "CHC ಸಮುದಾಯ ಆರೋಗ್ಯ ಕೇಂದ್ರ", - "instance": { - "openmrs_code": "1213213" - } - }, - { - "name": "sdh", - "label": "SDH ಉಪ ಜಿಲ್ಲಾ ಆಸ್ಪತ್ರೆ", - "instance": { - "openmrs_code": "23123" - } - }, - { - "name": "dh", - "label": "DH ಜಿಲ್ಲಾ ಆಸ್ಪತ್ರೆ", - "instance": { - "openmrs_code": "232113" - } - }, - { - "name": "private_facility", - "label": "Private ಖಾಸಗಿ", - "instance": { - "openmrs_code": "123123" - } - } - ], - "name": "place_delivery", - "bind": { - "required": "yes" - }, - "label": "Place of delivery? ಹೆರಿಗೆಯಾದ ಸ್ಥಳ?", - "instance": { - "openmrs_entity_id": "location_id", - "openmrs_entity": "encounter" - }, - "type": "select one" + "name": "sdh", + "label": "SDH ಉಪ ಜಿಲ್ಲಾ ಆಸ್ಪತ್ರೆ", + "instance": { + "openmrs_code": "23123" + } }, { - "name": "name_delivery_facility", - "bind": { - "relevant": "${place_delivery} != 'home'" - }, - "label": "Name of delivery place? ಹೆರಿಗೆಯಾದ ಸ್ಥಳದ ಹೆಸರು?", - "instance": { - "openmrs_entity_id": "4787232", - "openmrs_entity": "concept" - }, - "type": "text" + "name": "dh", + "label": "DH ಜಿಲ್ಲಾ ಆಸ್ಪತ್ರೆ", + "instance": { + "openmrs_code": "232113" + } }, { - "children": [ - { - "name": "yes", - "label": "Yes ಹೌದು", - "instance": { - "openmrs_code": "1065" - } - }, - { - "name": "no", - "label": "No ಇಲ್ಲ", - "instance": { - "openmrs_code": "1066" - } - } - ], - "name": "only_delivery_facility", - "label": "Is this the only place woman went for delivery? ಹೆರಿಗೆಗೆ ಇದೊಂದೆ ಸ್ಥಳಕ್ಕೆ ಹೋಗಿದ್ದರೆ?", - "instance": { - "openmrs_entity_id": "120009", - "openmrs_entity": "concept" - }, - "type": "select one" - }, + "name": "private_facility", + "label": "Private ಖಾಸಗಿ", + "instance": { + "openmrs_code": "123123" + } + } + ], + "name": "place_delivery", + "bind": { + "required": "yes" + }, + "label": "Place of delivery? ಹೆರಿಗೆಯಾದ ಸ್ಥಳ?", + "instance": { + "openmrs_entity_id": "location_id", + "openmrs_entity": "encounter" + }, + "type": "select one" + }, + { + "name": "name_delivery_facility", + "bind": { + "relevant": "${place_delivery} != 'home'" + }, + "label": "Name of delivery place? ಹೆರಿಗೆಯಾದ ಸ್ಥಳದ ಹೆಸರು?", + "instance": { + "openmrs_entity_id": "4787232", + "openmrs_entity": "concept" + }, + "type": "text" + }, + { + "children": [ { - "children": [ - { - "name": "home", - "label": "Home ಮನೆ", - "instance": { - "openmrs_code": "32323213" - } - }, - { - "name": "subcenter", - "label": "Sub Center ಉಪ ಕೇಂದ್ರ", - "instance": { - "openmrs_code": "2321321" - } - }, - { - "name": "phc", - "label": "PHC ಪ್ರಾಥಮಿಕ ಆರೋಗ್ಯ ಕೇಂದ್ರ", - "instance": { - "openmrs_code": "323213" - } - }, - { - "name": "chc", - "label": "CHC ಸಮುದಾಯ ಆರೋಗ್ಯ ಕೇಂದ್ರ", - "instance": { - "openmrs_code": "1213213" - } - }, - { - "name": "sdh", - "label": "SDH ಉಪ ಜಿಲ್ಲಾ ಆಸ್ಪತ್ರೆ", - "instance": { - "openmrs_code": "23123" - } - }, - { - "name": "dh", - "label": "DH ಜಿಲ್ಲಾ ಆಸ್ಪತ್ರೆ", - "instance": { - "openmrs_code": "232113" - } - }, - { - "name": "private_facility", - "label": "Private ಖಾಸಗಿ", - "instance": { - "openmrs_code": "123123" - } - } - ], - "name": "addl_delivery_facility", - "bind": { - "relevant": "${only_delivery_facility} = 'no'" - }, - "label": "Where else did she go for delivery? ಹೆರಿಗೆಗೆ ಇನ್ಯಾವ ಸ್ಥಳಕ್ಕೆ ಹೋಗಿದ್ದರೆ?", - "instance": { - "openmrs_entity_id": "124433", - "openmrs_entity": "concept" - }, - "type": "select all that apply" + "name": "yes", + "label": "Yes ಹೌದು", + "instance": { + "openmrs_code": "1065" + } }, { - "children": [ - { - "name": "no_staff", - "label": "No staff available for delivery ಹೆರಿಗೆಗೆ ಸಿಬ್ಬಂಧಿಯು ಲಭ್ಯವಿಲ್ಲ", - "instance": { - "openmrs_code": "4123" - } - }, - { - "name": "referred_higher_facility", - "label": "Referred to higher facility ಹೆಚ್ಚಿನ ಸೌಲಭ್ಯಕ್ಕೆ ರೆಫರ್ ಮಾಡಲಾಗಿದೆ", - "instance": { - "openmrs_code": "21312312" - } - }, - { - "name": "lack_of_supplies", - "label": "Lack of supplies ಸರಬರಾಜು ಕೊರತೆ", - "instance": { - "openmrs_code": "134134" - } - }, - { - "name": "no_electricity", - "label": "No electricity ವಿದ್ಯುತ್ ಇಲ್ಲ", - "instance": { - "openmrs_code": "34134134" - } - }, - { - "name": "family_insisted_elsewhere", - "label": "Family insisted on going elsewhere ಕುಟುಂಬಕ್ಕೆ ಬೇರೇಡೆಗೆ ಹೋಗಲು ಒತ್ತಾಯಿಸಿದರು", - "instance": { - "openmrs_code": "341341" - } - }, - { - "name": "no_money", - "label": "Not enough money ಸಾಕಷ್ಟು ಹಣವಿಲ್ಲ", - "instance": { - "openmrs_code": "43434432" - } - }, - { - "name": "others", - "label": "Others ಇತರೆ", - "instance": { - "openmrs_code": "323243224" - } - } - ], - "name": "reasons_addl_delivery_facility", - "bind": { - "relevant": "${only_delivery_facility} = 'no'" - }, - "label": "Select the reasons why more than one place. ಬೇರೆ ಸ್ಥಳಕ್ಕೆ ಹೋಗಿದ್ದಕ್ಕೆ ಕಾರಣವನ್ನು ಆಯ್ಕೆ ಮಾಡಿ.", - "instance": { - "openmrs_entity_id": "100933", - "openmrs_entity": "concept" - }, - "type": "select all that apply" - }, + "name": "no", + "label": "No ಇಲ್ಲ", + "instance": { + "openmrs_code": "1066" + } + } + ], + "name": "only_delivery_facility", + "label": "Is this the only place woman went for delivery? ಹೆರಿಗೆಗೆ ಇದೊಂದೆ ಸ್ಥಳಕ್ಕೆ ಹೋಗಿದ್ದರೆ?", + "instance": { + "openmrs_entity_id": "120009", + "openmrs_entity": "concept" + }, + "type": "select one" + }, + { + "children": [ { - "name": "other_reasons_addl_delivery_facility", - "bind": { - "relevant": "selected(${reasons_addl_delivery_facility}, 'others')" - }, - "label": "Others ಇತರೆ:", - "instance": { - "openmrs_entity_id": "2323233", - "openmrs_entity": "concept" - }, - "type": "text" + "name": "home", + "label": "Home ಮನೆ", + "instance": { + "openmrs_code": "32323213" + } }, { - "children": [ - { - "name": "yes", - "label": "Yes ಹೌದು", - "instance": { - "openmrs_code": "1065" - } - }, - { - "name": "no", - "label": "No ಇಲ್ಲ", - "instance": { - "openmrs_code": "1066" - } - } - ], - "name": "skilled_delivery", - "bind": { - "relevant": "${place_delivery} = 'home'", - "required": "yes" - }, - "label": "Delivery attended by SBA? ತರಬೇತಿ ಹೊಂದಿದ ಹೆರಿಗೆ ಸಹಾಯಕರು ಹೆರಿಗೆಯಲ್ಲಿ ಹಾಜರಿದ್ದರೆ?", - "instance": { - "openmrs_entity_id": "3231212", - "openmrs_entity": "concept" - }, - "type": "select one" + "name": "subcenter", + "label": "Sub Center ಉಪ ಕೇಂದ್ರ", + "instance": { + "openmrs_code": "2321321" + } }, { - "children": [ - { - "name": "normal", - "label": "Normal ಸಾಮಾನ್ಯ", - "instance": { - "openmrs_code": "43123" - } - }, - { - "name": "cesarean", - "label": "Cesarean ಸಿಸೇರಿಯನ್", - "instance": { - "openmrs_code": "3232" - } - }, - { - "name": "instrumental_forcep", - "label": "Instrumental / Forcep ಉಪಕರಣಗಳಿಂದ ಮಾಡುವ ಹೆರಿಗೆ", - "instance": { - "openmrs_code": "4134123" - } - } - ], - "name": "type_delivery", - "label": "Type of delivery? ಯಾವ ವಿಧದ ಹೆರಿಗೆ?", - "instance": { - "openmrs_entity_id": "120009", - "openmrs_entity": "concept" - }, - "type": "select one" + "name": "phc", + "label": "PHC ಪ್ರಾಥಮಿಕ ಆರೋಗ್ಯ ಕೇಂದ್ರ", + "instance": { + "openmrs_code": "323213" + } }, { - "children": [ - { - "name": "live_birth", - "label": "Live Birth ಜೀವಂತ ಜನನ", - "instance": { - "openmrs_code": "38493849" - } - }, - { - "name": "still_birth", - "label": "Still Birth ನಿರ್ಜೀವ ಜನನ", - "instance": { - "openmrs_code": "343434" - } - } - ], - "name": "delivery_outcome", - "bind": { - "required": "yes" - }, - "label": "Delivery outcome? ಹೆರಿಗೆ ಫಲಿತಾಂಶವೇನು?", - "instance": { - "openmrs_entity_id": "124433", - "openmrs_entity": "concept" - }, - "type": "select one" + "name": "chc", + "label": "CHC ಸಮುದಾಯ ಆರೋಗ್ಯ ಕೇಂದ್ರ", + "instance": { + "openmrs_code": "1213213" + } }, { - "name": "case_parity", - "instance": { - "openmrs_entity_id": "100933", - "openmrs_entity": "concept" - }, - "type": "hidden" + "name": "sdh", + "label": "SDH ಉಪ ಜಿಲ್ಲಾ ಆಸ್ಪತ್ರೆ", + "instance": { + "openmrs_code": "23123" + } }, { - "name": "parity", - "bind": { - "calculate": "${case_parity} + 1" - }, - "instance": { - "openmrs_entity_id": "434343", - "openmrs_entity": "concept" - }, - "type": "calculate" + "name": "dh", + "label": "DH ಜಿಲ್ಲಾ ಆಸ್ಪತ್ರೆ", + "instance": { + "openmrs_code": "232113" + } }, { - "name": "case_num_livebirths", - "instance": { - "openmrs_entity_id": "34324234", - "openmrs_entity": "concept" - }, - "type": "hidden" - }, + "name": "private_facility", + "label": "Private ಖಾಸಗಿ", + "instance": { + "openmrs_code": "123123" + } + } + ], + "name": "addl_delivery_facility", + "bind": { + "relevant": "${only_delivery_facility} = 'no'" + }, + "label": "Where else did she go for delivery? ಹೆರಿಗೆಗೆ ಇನ್ಯಾವ ಸ್ಥಳಕ್ಕೆ ಹೋಗಿದ್ದರೆ?", + "instance": { + "openmrs_entity_id": "124433", + "openmrs_entity": "concept" + }, + "type": "select all that apply" + }, + { + "children": [ { - "name": "num_livebirths", - "bind": { - "relevant": "${delivery_outcome} = 'live_birth'", - "calculate": "${case_num_livebirths} + 1" - }, - "instance": { - "openmrs_entity_id": "3423423", - "openmrs_entity": "concept" - }, - "type": "calculate" + "name": "no_staff", + "label": "No staff available for delivery ಹೆರಿಗೆಗೆ ಸಿಬ್ಬಂಧಿಯು ಲಭ್ಯವಿಲ್ಲ", + "instance": { + "openmrs_code": "4123" + } }, { - "name": "youngestchild_date_of_birth", - "bind": { - "relevant": "${delivery_outcome} = 'live_birth'", - "calculate": "${delivery_date}" - }, - "instance": { - "openmrs_entity_id": "120009", - "openmrs_entity": "concept" - }, - "type": "calculate" + "name": "referred_higher_facility", + "label": "Referred to higher facility ಹೆಚ್ಚಿನ ಸೌಲಭ್ಯಕ್ಕೆ ರೆಫರ್ ಮಾಡಲಾಗಿದೆ", + "instance": { + "openmrs_code": "21312312" + } }, { - "name": "youngestchild_age", - "bind": { - "calculate": "int((${today} - ${youngestchild_date_of_birth}) div 30)" - }, - "instance": { - "openmrs_entity_id": "124433", - "openmrs_entity": "concept" - }, - "type": "calculate" + "name": "lack_of_supplies", + "label": "Lack of supplies ಸರಬರಾಜು ಕೊರತೆ", + "instance": { + "openmrs_code": "134134" + } }, { - "name": "case_num_stillbirths", - "instance": { - "openmrs_entity_id": "100933", - "openmrs_entity": "concept" - }, - "type": "hidden" + "name": "no_electricity", + "label": "No electricity ವಿದ್ಯುತ್ ಇಲ್ಲ", + "instance": { + "openmrs_code": "34134134" + } }, { - "name": "num_stillbirths", - "bind": { - "relevant": "${delivery_outcome} = 'still_birth'", - "calculate": "${case_num_stillbirths} + 1" - }, - "instance": { - "openmrs_entity_id": "3432434", - "openmrs_entity": "concept" - }, - "type": "calculate" + "name": "family_insisted_elsewhere", + "label": "Family insisted on going elsewhere ಕುಟುಂಬಕ್ಕೆ ಬೇರೇಡೆಗೆ ಹೋಗಲು ಒತ್ತಾಯಿಸಿದರು", + "instance": { + "openmrs_code": "341341" + } }, { - "children": [ - { - "children": [ - { - "name": "infection_during_preg", - "label": "Infection during pregnancy ಗರ್ಭಾವಸ್ಥೆಯಲ್ಲಿ ಸೋಂಕು", - "instance": { - "openmrs_code": "2323" - } - }, - { - "name": "gest_hypertension", - "label": "Gestational hypertension ಗರ್ಭಾಧಾರಣೆಯಲ್ಲಿನ ಅಧಿಕ ರಕ್ತದೊತ್ತಡ", - "instance": { - "openmrs_code": "2323" - } - }, - { - "name": "gest_diabetes", - "label": "Gestational diabetes ಗರ್ಭಾಧಾರಣೆಯಲ್ಲಿನ ಸಕ್ಕರೆ ಕಾಯಿಲೆ", - "instance": { - "openmrs_code": "23213" - } - }, - { - "name": "fetal_growth_restriction", - "label": "Fetal growth restriction ಭ್ರೂಣದ ಬೆಳವಣಿಗೆಯಲ್ಲಿ ನಿರ್ಬಂಧ", - "instance": { - "openmrs_code": "23123" - } - }, - { - "name": "birth_defects", - "label": "Birth defects ಜನ್ಮ ನ್ಯೂನ್ಯತೆಗಳು", - "instance": { - "openmrs_code": "23213" - } - }, - { - "name": "unknown", - "label": "Cause not identified ಕಾರಣವನ್ನು ಗುರುತಿಸಲ್ಪಟ್ಟಿಲ್ಲ", - "instance": { - "openmrs_code": "2323" - } - }, - { - "name": "others", - "label": "Others ಇತರೆ", - "instance": { - "openmrs_code": "23213" - } - } - ], - "name": "cause_of_still_birth", - "label": "Cause of still birth? ನಿರ್ಜೀವ ಜನನದ ಕಾರಣಗಳು?", - "instance": { - "openmrs_entity_parent": "65435", - "openmrs_entity_id": "4323232", - "openmrs_entity": "concept" - }, - "type": "select one" - }, - { - "children": [ - { - "name": "yes", - "label": "Yes ಹೌದು", - "instance": { - "openmrs_code": "1065" - } - }, - { - "name": "no", - "label": "No ಇಲ್ಲ", - "instance": { - "openmrs_code": "1066" - } - } - ], - "name": "woman_survived", - "bind": { - "required": "yes" - }, - "label": "Woman survived childbirth? ಮಗುವಿನ ಜನನದ ನಂತರ ಮಹಿಳೆ ಬದುಕುಳಿದರೆ?", - "instance": { - "openmrs_entity_parent": "65435", - "openmrs_entity_id": "100009", - "openmrs_entity": "concept" - }, - "type": "select one" - } - ], - "name": "still_birth_group", - "bind": { - "relevant": "${delivery_outcome} = 'still_birth'" - }, - "instance": { - "openmrs_entity_id": "65435", - "openmrs_entity": "concept" - }, - "type": "group" + "name": "no_money", + "label": "Not enough money ಸಾಕಷ್ಟು ಹಣವಿಲ್ಲ", + "instance": { + "openmrs_code": "43434432" + } }, { - "children": [ - { - "children": [ - { - "children": [ - { - "name": "male", - "label": "Male ಗಂಡು", - "instance": { - "openmrs_code": "21321" - } - }, - { - "name": "female", - "label": "Female ಹೆಣ್ಣು", - "instance": { - "openmrs_code": "312312" - } - } - ], - "name": "sex_child", - "bind": { - "required": "yes" - }, - "label": "Sex of child? ಮಗುವಿನ ಲಿಂಗ?", - "instance": { - "openmrs_entity_id": "gender", - "openmrs_entity": "patient" - }, - "type": "select one" - }, - { - "name": "sex_child_female", - "bind": { - "calculate": "if(${sex_child} = 'female', 1, 0)" - }, - "type": "calculate" - }, - { - "name": "sex_child_male", - "bind": { - "calculate": "if(${sex_child} = 'male', 1, 0)" - }, - "type": "calculate" - }, - { - "name": "birthweight", - "label": "Child birthweight (in kgs)? ಹುಟ್ಟಿದ ಮಗುವಿನ ತೂಕ (ಕೆ.ಜಿ. ಗಳಲ್ಲಿ)?", - "instance": { - "openmrs_entity_id": "323232", - "openmrs_entity": "concept" - }, - "type": "decimal" - }, - { - "control": { - "appearance": "minimal" - }, - "children": [ - { - "name": "a_positive", - "label": "A+", - "instance": { - "openmrs_code": "34324" - } - }, - { - "name": "a_negative", - "label": "A-", - "instance": { - "openmrs_code": "34134" - } - }, - { - "name": "b_positive", - "label": "B+", - "instance": { - "openmrs_code": "1321312" - } - }, - { - "name": "b_negative", - "label": "B-", - "instance": { - "openmrs_code": "43434" - } - }, - { - "name": "ab_positive", - "label": "AB+", - "instance": { - "openmrs_code": "12323214" - } - }, - { - "name": "ab_negative", - "label": "AB-", - "instance": { - "openmrs_code": "11343141" - } - }, - { - "name": "o_positive", - "label": "O+", - "instance": { - "openmrs_code": "134343" - } - }, - { - "name": "o_negative", - "label": "O-", - "instance": { - "openmrs_code": "432434" - } - } - ], - "name": "child_blood_group", - "label": "Child blood group? ಮಗುವಿನ ರಕ್ತದ ಗುಂಪು?", - "instance": { - "openmrs_entity_id": "232112", - "openmrs_entity": "concept" - }, - "type": "select one" - }, - { - "children": [ - { - "name": "bcg", - "label": "BCG ಬಿ.ಸಿ.ಜಿ", - "instance": { - "openmrs_code": "23123" - } - }, - { - "name": "opv_0", - "label": "OPV 0 ಒ.ಪಿ.ವಿ 0", - "instance": { - "openmrs_code": "12312" - } - }, - { - "name": "hepb_0", - "label": "Hep B 0 ಹೆಪಟೆಟಿಸ್ ಬಿ 0", - "instance": { - "openmrs_code": "213123" - } - } - ], - "name": "immunizations_atbirth", - "label": "Immunizations provided at birth? ಹುಟ್ಟಿದ ಮಗುವಿಗೆ ಇಮ್ಯುನೈಜೇಷನ್ ನೀಡಲಾಯಿತೆ?", - "instance": { - "openmrs_entity_id": "199277", - "openmrs_entity": "concept" - }, - "type": "select all that apply" - }, - { - "name": "case_hepb", - "instance": { - "openmrs_entity_id": "100285", - "openmrs_entity": "concept" - }, - "type": "hidden" - }, - { - "children": [ - { - "name": "yes", - "label": "Yes ಹೌದು", - "instance": { - "openmrs_code": "1065" - } - }, - { - "name": "no", - "label": "No ಇಲ್ಲ", - "instance": { - "openmrs_code": "1066" - } - } - ], - "name": "hepb_prophylaxis_provided", - "bind": { - "relevant": "${case_hepb} != ''" - }, - "label": "Hep B prophylaxis provided? ಹೆಪಟೆಟಿಸ್ ಬಿ ರೋಗನಿರೋಧಕ ಚಿಕಿತ್ಸೆ ನೀಡಲಾಗಿದೆತೇ?", - "instance": { - "openmrs_entity_id": "3321323", - "openmrs_entity": "concept" - }, - "type": "select one" - }, - { - "name": "lbw", - "bind": { - "calculate": "if(${birthweight} >= 1.5 and ${birthweight} < 2.5, 'Low_Birth_Weight','')" - }, - "instance": { - "openmrs_entity_id": "1232132", - "openmrs_entity": "concept" - }, - "type": "calculate" - }, - { - "name": "vlbw", - "bind": { - "calculate": "if(${birthweight} < 1.5, 'Very_Low_Birth_Weight', '')" - }, - "instance": { - "openmrs_entity_id": "232133", - "openmrs_entity": "concept" - }, - "type": "calculate" - }, - { - "name": "num_preg_days", - "bind": { - "calculate": "int(date(${delivery_date}) - date(${case_lmp}))" - }, - "instance": { - "openmrs_entity_id": "232323", - "openmrs_entity": "concept" - }, - "type": "calculate" - }, - { - "name": "premature", - "bind": { - "calculate": "if(${num_preg_days} < 259, 'Premature', '')" - }, - "instance": { - "openmrs_entity_id": "232323", - "openmrs_entity": "concept" - }, - "type": "calculate" - }, - { - "name": "premature_message1", - "bind": { - "relevant": "${premature} != ''" - }, - "label": "Baby is premature! Advise kangaroo care and rooming in. ಅವಧಿಗೆ ಮುನ್ನ ಜನಿಸಿದ ಮಗು! ಕಾಂಗರೋ ಆರೈಕೆ ಮತ್ತು ಒಂದೇ ರೂಮಿನಲ್ಲಿಡುವಂತೆ ಸಲಹೆ ನೀಡಿ.", - "type": "note" - }, - { - "name": "is_child_high_risk1", - "bind": { - "calculate": "if(${premature} != '' or ${lbw} != '' or ${vlbw} != '', 'yes', 'no')" - }, - "instance": { - "openmrs_entity_id": "342343", - "openmrs_entity": "concept" - }, - "type": "calculate" - }, - { - "name": "child_high_risk_reasons", - "bind": { - "calculate": "concat(${premature}, ' ', ${lbw}, ' ', ${vlbw})" - }, - "instance": { - "openmrs_entity_id": "423434", - "openmrs_entity": "concept" - }, - "type": "calculate" - }, - { - "name": "high_risk_note_child", - "bind": { - "relevant": "${is_child_high_risk1} = 'yes'" - }, - "label": "Child is at risk because of, ಈಗ ಮಗು ಅಪಾಯದಲ್ಲಿದೆ ಏಕೆಂದರೆ: ${child_high_risk_reasons}", - "type": "note" - }, - { - "children": [ - { - "name": "yes", - "label": "Yes ಹೌದು", - "instance": { - "openmrs_code": "1065" - } - }, - { - "name": "no", - "label": "No ಇಲ್ಲ", - "instance": { - "openmrs_code": "1066" - } - } - ], - "name": "is_child_high_risk", - "bind": { - "required": "yes" - }, - "label": "Do you want to mark child as HR (High Risk)? \nನೀವು ಮಗುವನ್ನು HR (ಹೆಚ್ಚು ಅಪಾಯವಿದೆ) ಎಂದು ಗುರುತಿಸಲು ಬಯಸುವಿರಾ?", - "instance": { - "openmrs_entity_id": "4342343", - "openmrs_entity": "concept" - }, - "type": "select one" - }, - { - "name": "addl_pnc_visit_message", - "bind": { - "relevant": "${is_child_high_risk1} = 'yes'" - }, - "label": "Child needs 3 more PNC visits on days 14, 21, and 28 because of, 14, 21 ಮತ್ತು 28 ನೇ ದಿನಗಳೊಂದು ಮಗುವಿಗೆ 3 ಹೆಚ್ಚಿನ ಭೇಟಿಯ ಅಗತ್ಯವಿದೆ, ಏಕೆಂದರೆ: ${child_high_risk_reasons}", - "type": "note" - } - ], - "name": "child", - "label": "Please enter birth information for each child born. ಜನನವಾದ ಪ್ರತಿ ಮಗುವಿನ ಜನ್ಮ ಮಾಹಿತಿಯನ್ನು ದಯವಿಟ್ಟು ನಮೂದಿಸಿ.", - "instance": { - "openmrs_entity_id": "100029", - "openmrs_entity": "concept" - }, - "type": "repeat" - }, - { - "children": [ - { - "name": "yes", - "label": "Yes ಹೌದು", - "instance": { - "openmrs_code": "1065" - } - }, - { - "name": "no", - "label": "No ಇಲ್ಲ", - "instance": { - "openmrs_code": "1066" - } - } - ], - "name": "mother_survived", - "bind": { - "required": "yes" - }, - "label": "Mother survived childbirth? ಮಗುವಿನ ಜನನದ ನಂತರ ಮಹಿಳೆ ಬದುಕುಳಿದರೆ?", - "instance": { - "openmrs_entity_id": "343434", - "openmrs_entity": "concept" - }, - "type": "select one" - }, - { - "children": [ - { - "name": "yes", - "label": "Yes ಹೌದು", - "instance": { - "openmrs_code": "1065" - } - }, - { - "name": "no", - "label": "No ಇಲ್ಲ", - "instance": { - "openmrs_code": "1066" - } - } - ], - "name": "breastfeeding_postbirth", - "bind": { - "relevant": "${mother_survived} = 'yes'", - "required": "yes" - }, - "label": "Was breastfeeding started within 1 hour of birth? ಹುಟ್ಟಿದ ಒಂದು ಗಂಟೆಯ ಒಳಗೆ ಎದೆಹಾಲು ನೀಡಲಾಯಿತೆ?", - "instance": { - "openmrs_entity_id": "434343", - "openmrs_entity": "concept" - }, - "type": "select one" - } - ], - "name": "live_birth_group", - "bind": { - "relevant": "${delivery_outcome} = 'live_birth'" - }, - "type": "group" - }, + "name": "others", + "label": "Others ಇತರೆ", + "instance": { + "openmrs_code": "323243224" + } + } + ], + "name": "reasons_addl_delivery_facility", + "bind": { + "relevant": "${only_delivery_facility} = 'no'" + }, + "label": "Select the reasons why more than one place. ಬೇರೆ ಸ್ಥಳಕ್ಕೆ ಹೋಗಿದ್ದಕ್ಕೆ ಕಾರಣವನ್ನು ಆಯ್ಕೆ ಮಾಡಿ.", + "instance": { + "openmrs_entity_id": "100933", + "openmrs_entity": "concept" + }, + "type": "select all that apply" + }, + { + "name": "other_reasons_addl_delivery_facility", + "bind": { + "relevant": "selected(${reasons_addl_delivery_facility}, 'others')" + }, + "label": "Others ಇತರೆ:", + "instance": { + "openmrs_entity_id": "2323233", + "openmrs_entity": "concept" + }, + "type": "text" + }, + { + "children": [ { - "name": "case_num_livingchildren", - "instance": { - "openmrs_entity_id": "434344", - "openmrs_entity": "concept" - }, - "type": "hidden" + "name": "yes", + "label": "Yes ಹೌದು", + "instance": { + "openmrs_code": "1065" + } }, { - "name": "num_children_born", - "bind": { - "calculate": "if(${delivery_outcome} = 'still_birth', 0, count(${sex_child}))" - }, - "instance": { - "openmrs_entity_id": "43432", - "openmrs_entity": "concept" - }, - "type": "calculate" - }, + "name": "no", + "label": "No ಇಲ್ಲ", + "instance": { + "openmrs_code": "1066" + } + } + ], + "name": "skilled_delivery", + "bind": { + "relevant": "${place_delivery} = 'home'", + "required": "yes" + }, + "label": "Delivery attended by SBA? ತರಬೇತಿ ಹೊಂದಿದ ಹೆರಿಗೆ ಸಹಾಯಕರು ಹೆರಿಗೆಯಲ್ಲಿ ಹಾಜರಿದ್ದರೆ?", + "instance": { + "openmrs_entity_id": "3231212", + "openmrs_entity": "concept" + }, + "type": "select one" + }, + { + "children": [ { - "name": "num_livingchildren", - "bind": { - "calculate": "${case_num_livingchildren} + ${num_children_born}" - }, - "instance": { - "openmrs_entity_id": "54541", - "openmrs_entity": "concept" - }, - "type": "calculate" + "name": "normal", + "label": "Normal ಸಾಮಾನ್ಯ", + "instance": { + "openmrs_code": "43123" + } }, { - "name": "case_numlivingchildren_female", - "instance": { - "openmrs_entity_id": "57467", - "openmrs_entity": "concept" - }, - "type": "hidden" + "name": "cesarean", + "label": "Cesarean ಸಿಸೇರಿಯನ್", + "instance": { + "openmrs_code": "3232" + } }, { - "name": "num_female_children_born", - "bind": { - "calculate": "sum(${sex_child_female})" - }, - "instance": { - "openmrs_entity_id": "687832", - "openmrs_entity": "concept" - }, - "type": "calculate" - }, + "name": "instrumental_forcep", + "label": "Instrumental / Forcep ಉಪಕರಣಗಳಿಂದ ಮಾಡುವ ಹೆರಿಗೆ", + "instance": { + "openmrs_code": "4134123" + } + } + ], + "name": "type_delivery", + "label": "Type of delivery? ಯಾವ ವಿಧದ ಹೆರಿಗೆ?", + "instance": { + "openmrs_entity_id": "120009", + "openmrs_entity": "concept" + }, + "type": "select one" + }, + { + "children": [ { - "name": "numlivingchildren_female", - "bind": { - "calculate": "${case_numlivingchildren_female} + ${num_female_children_born}" - }, - "instance": { - "openmrs_entity_id": "098343", - "openmrs_entity": "concept" - }, - "type": "calculate" + "name": "live_birth", + "label": "Live Birth ಜೀವಂತ ಜನನ", + "instance": { + "openmrs_code": "38493849" + } }, { - "name": "case_numlivingchildren_male", - "instance": { - "openmrs_entity_id": "98664", - "openmrs_entity": "concept" - }, - "type": "hidden" - }, + "name": "still_birth", + "label": "Still Birth ನಿರ್ಜೀವ ಜನನ", + "instance": { + "openmrs_code": "343434" + } + } + ], + "name": "delivery_outcome", + "bind": { + "required": "yes" + }, + "label": "Delivery outcome? ಹೆರಿಗೆ ಫಲಿತಾಂಶವೇನು?", + "instance": { + "openmrs_entity_id": "124433", + "openmrs_entity": "concept" + }, + "type": "select one" + }, + { + "name": "case_parity", + "instance": { + "openmrs_entity_id": "100933", + "openmrs_entity": "concept" + }, + "type": "hidden" + }, + { + "name": "parity", + "bind": { + "calculate": "${case_parity} + 1" + }, + "instance": { + "openmrs_entity_id": "434343", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "case_num_livebirths", + "instance": { + "openmrs_entity_id": "34324234", + "openmrs_entity": "concept" + }, + "type": "hidden" + }, + { + "name": "num_livebirths", + "bind": { + "relevant": "${delivery_outcome} = 'live_birth'", + "calculate": "${case_num_livebirths} + 1" + }, + "instance": { + "openmrs_entity_id": "3423423", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "youngestchild_date_of_birth", + "bind": { + "relevant": "${delivery_outcome} = 'live_birth'", + "calculate": "${delivery_date}" + }, + "instance": { + "openmrs_entity_id": "120009", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "youngestchild_age", + "bind": { + "calculate": "int((${today} - ${youngestchild_date_of_birth}) div 30)" + }, + "instance": { + "openmrs_entity_id": "124433", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "case_num_stillbirths", + "instance": { + "openmrs_entity_id": "100933", + "openmrs_entity": "concept" + }, + "type": "hidden" + }, + { + "name": "num_stillbirths", + "bind": { + "relevant": "${delivery_outcome} = 'still_birth'", + "calculate": "${case_num_stillbirths} + 1" + }, + "instance": { + "openmrs_entity_id": "3432434", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "children": [ { - "name": "num_male_children_born", - "bind": { - "calculate": "sum(${sex_child_male})" - }, - "instance": { - "openmrs_entity_id": "4343656", - "openmrs_entity": "concept" - }, - "type": "calculate" + "children": [ + { + "name": "infection_during_preg", + "label": "Infection during pregnancy ಗರ್ಭಾವಸ್ಥೆಯಲ್ಲಿ ಸೋಂಕು", + "instance": { + "openmrs_code": "2323" + } + }, + { + "name": "gest_hypertension", + "label": "Gestational hypertension ಗರ್ಭಾಧಾರಣೆಯಲ್ಲಿನ ಅಧಿಕ ರಕ್ತದೊತ್ತಡ", + "instance": { + "openmrs_code": "2323" + } + }, + { + "name": "gest_diabetes", + "label": "Gestational diabetes ಗರ್ಭಾಧಾರಣೆಯಲ್ಲಿನ ಸಕ್ಕರೆ ಕಾಯಿಲೆ", + "instance": { + "openmrs_code": "23213" + } + }, + { + "name": "fetal_growth_restriction", + "label": "Fetal growth restriction ಭ್ರೂಣದ ಬೆಳವಣಿಗೆಯಲ್ಲಿ ನಿರ್ಬಂಧ", + "instance": { + "openmrs_code": "23123" + } + }, + { + "name": "birth_defects", + "label": "Birth defects ಜನ್ಮ ನ್ಯೂನ್ಯತೆಗಳು", + "instance": { + "openmrs_code": "23213" + } + }, + { + "name": "unknown", + "label": "Cause not identified ಕಾರಣವನ್ನು ಗುರುತಿಸಲ್ಪಟ್ಟಿಲ್ಲ", + "instance": { + "openmrs_code": "2323" + } + }, + { + "name": "others", + "label": "Others ಇತರೆ", + "instance": { + "openmrs_code": "23213" + } + } + ], + "name": "cause_of_still_birth", + "label": "Cause of still birth? ನಿರ್ಜೀವ ಜನನದ ಕಾರಣಗಳು?", + "instance": { + "openmrs_entity_parent": "65435", + "openmrs_entity_id": "4323232", + "openmrs_entity": "concept" + }, + "type": "select one" }, { - "name": "numlivingchildren_male", - "bind": { - "calculate": "${case_numlivingchildren_male} + ${num_male_children_born}" - }, - "instance": { - "openmrs_entity_id": "342325", - "openmrs_entity": "concept" - }, - "type": "calculate" - }, + "children": [ + { + "name": "yes", + "label": "Yes ಹೌದು", + "instance": { + "openmrs_code": "1065" + } + }, + { + "name": "no", + "label": "No ಇಲ್ಲ", + "instance": { + "openmrs_code": "1066" + } + } + ], + "name": "woman_survived", + "bind": { + "required": "yes" + }, + "label": "Woman survived childbirth? ಮಗುವಿನ ಜನನದ ನಂತರ ಮಹಿಳೆ ಬದುಕುಳಿದರೆ?", + "instance": { + "openmrs_entity_parent": "65435", + "openmrs_entity_id": "100009", + "openmrs_entity": "concept" + }, + "type": "select one" + } + ], + "name": "still_birth_group", + "bind": { + "relevant": "${delivery_outcome} = 'still_birth'" + }, + "instance": { + "openmrs_entity_id": "65435", + "openmrs_entity": "concept" + }, + "type": "group" + }, + { + "children": [ { - "children": [ + "children": [ + { + "children": [ { - "children": [ - { - "name": "prolonged_obstructed_labor", - "label": "Prolonged / obstructed labor ದೀರ್ಘಕಾಲೀನ / ಅಡಚಣೆಯನ್ನು ತಂದೊಡ್ಡುವ ಹೆರಿಗೆ ನೋವು", - "instance": { - "openmrs_code": "23123" - } - }, - { - "name": "hypertension_fits", - "label": "Severe hypertension / fits ತೀವ್ರತರವಾದ ಅಧಿಕ ರಕ್ತದೊತ್ತಡ / ಮೂರ್ಚೆರೋಗ", - "instance": { - "openmrs_code": "23213" - } - }, - { - "name": "bleeding_hemorrhage", - "label": "Bleeding / hemorrhage ರಕ್ತಸ್ರಾವ", - "instance": { - "openmrs_code": "23123" - } - }, - { - "name": "fever_infection", - "label": "High fever / infection ಅಧಿಕ ಜ್ವರ / ಸೊಂಕು", - "instance": { - "openmrs_code": "2323" - } - }, - { - "name": "cause_not_identified", - "label": "Cause not identified ಕಾರಣವನ್ನು ಗುರುತಿಸಲ್ಪಟ್ಟಿಲ್ಲ", - "instance": { - "openmrs_code": "23213" - } - }, - { - "name": "others", - "label": "Others ಇತರೆ", - "instance": { - "openmrs_code": "23213" - } - } - ], - "name": "maternal_death_cause", - "label": "Cause of maternal death? ತಾಯಿಯ ಮರಣಕ್ಕೆ ಕಾರಣಗಳು?", - "instance": { - "openmrs_entity_id": "43434", - "openmrs_entity": "concept" - }, - "type": "select one" + "name": "male", + "label": "Male ಗಂಡು", + "instance": { + "openmrs_code": "21321" + } }, { - "name": "other_maternal_death_cause", - "bind": { - "relevant": "${maternal_death_cause} = 'others'" - }, - "label": "Others ಇತರೆ:", - "instance": { - "openmrs_entity_id": "43221", - "openmrs_entity": "concept" - }, - "type": "text" + "name": "female", + "label": "Female ಹೆಣ್ಣು", + "instance": { + "openmrs_code": "312312" + } } - ], - "name": "maternal_death_group", - "bind": { - "relevant": "(${woman_survived} = 'no' or ${mother_survived} = 'no')" - }, - "type": "group" - }, - { - "children": [ + ], + "name": "sex_child", + "bind": { + "required": "yes" + }, + "label": "Sex of child? ಮಗುವಿನ ಲಿಂಗ?", + "instance": { + "openmrs_entity_id": "gender", + "openmrs_entity": "patient" + }, + "type": "select one" + }, + { + "name": "sex_child_female", + "bind": { + "calculate": "if(${sex_child} = 'female', 1, 0)" + }, + "type": "calculate" + }, + { + "name": "sex_child_male", + "bind": { + "calculate": "if(${sex_child} = 'male', 1, 0)" + }, + "type": "calculate" + }, + { + "name": "birthweight", + "label": "Child birthweight (in kgs)? ಹುಟ್ಟಿದ ಮಗುವಿನ ತೂಕ (ಕೆ.ಜಿ. ಗಳಲ್ಲಿ)?", + "instance": { + "openmrs_entity_id": "323232", + "openmrs_entity": "concept" + }, + "type": "decimal" + }, + { + "control": { + "appearance": "minimal" + }, + "children": [ { - "name": "case_w_rh_negative", - "instance": { - "openmrs_entity_id": "4324234", - "openmrs_entity": "concept" - }, - "type": "hidden" + "name": "a_positive", + "label": "A+", + "instance": { + "openmrs_code": "34324" + } }, { - "children": [ - { - "name": "yes", - "label": "Yes ಹೌದು", - "instance": { - "openmrs_code": "1065" - } - }, - { - "name": "no", - "label": "No ಇಲ್ಲ", - "instance": { - "openmrs_code": "1066" - } - } - ], - "name": "rh_injection_given", - "bind": { - "relevant": "${case_w_rh_negative} != ''" - }, - "label": "Rh injection given to woman? ಮಹಿಳೆಗೆ Rh ಚುಚ್ಚುಮದ್ದು ನೀಡಲಾಯಿತೆ?", - "instance": { - "openmrs_entity_id": "32323", - "openmrs_entity": "concept" - }, - "type": "select one" + "name": "a_negative", + "label": "A-", + "instance": { + "openmrs_code": "34134" + } }, { - "children": [ - { - "name": "yes", - "label": "Yes ಹೌದು", - "instance": { - "openmrs_code": "1065" - } - }, - { - "name": "no", - "label": "No ಇಲ್ಲ", - "instance": { - "openmrs_code": "1066" - } - } - ], - "name": "had_delivery_complications", - "label": "Were there delivery complications? ಹೆರಿಗೆಯಲ್ಲಿ ತೊಡಕುಂಟಾಯಿತೆ?", - "instance": { - "openmrs_entity_id": "233234", - "openmrs_entity": "concept" - }, - "type": "select one" + "name": "b_positive", + "label": "B+", + "instance": { + "openmrs_code": "1321312" + } }, { - "children": [ - { - "name": "hemorrhage", - "label": "Hemorrhage ರಕ್ತಸ್ರಾವ", - "instance": { - "openmrs_code": "4123213" - } - }, - { - "name": "placenta_previa", - "label": "Placenta previa ಹಿಂದಿನ ಗರ್ಭದಲ್ಲಿ ಮಾಸು ಮುಂದಿರುವುದು", - "instance": { - "openmrs_code": "2131413" - } - }, - { - "name": "cord_prolapse", - "label": "Cord prolapse ಬಳ್ಳಿಯ ಸರಿತ", - "instance": { - "openmrs_code": "4134123" - } - }, - { - "name": "prolonged_labor", - "label": "Prolonged / obstructed labor ದೀರ್ಘಕಾಲೀನ / ಅಡಚಣೆಯನ್ನು ತಂದೊಡ್ಡುವ ಹೆರಿಗೆ ನೋವು", - "instance": { - "openmrs_code": "213124123" - } - }, - { - "name": "abnormal_presentation", - "label": "Abnormal presentation ಅಪಸಾಮಾನ್ಯ ಪ್ರಸ್ತುತಿ", - "instance": { - "openmrs_code": "14123123" - } - }, - { - "name": "perineal_tear", - "label": "Perineal tear (2, 3, or 4 degree)", - "instance": { - "openmrs_code": "23123" - } - }, - { - "name": "others", - "label": "Others ಇತರೆ", - "instance": { - "openmrs_code": "32123" - } - } - ], - "name": "complications", - "bind": { - "relevant": "${had_delivery_complications} = 'yes'" - }, - "label": "What delivery complications were there? ಯಾವ ಹೆರಿಗೆ ತೊಂದರೆಗಳು ಉಂಟಾದವು?", - "instance": { - "openmrs_entity_id": "25343", - "openmrs_entity": "concept" - }, - "type": "select all that apply" + "name": "b_negative", + "label": "B-", + "instance": { + "openmrs_code": "43434" + } }, { - "name": "delivery_complications_other", - "bind": { - "relevant": "selected(${complications}, 'others')" - }, - "label": "Others ಇತರೆ:", - "instance": { - "openmrs_entity_id": "2355435", - "openmrs_entity": "concept" - }, - "type": "text" + "name": "ab_positive", + "label": "AB+", + "instance": { + "openmrs_code": "12323214" + } + }, + { + "name": "ab_negative", + "label": "AB-", + "instance": { + "openmrs_code": "11343141" + } + }, + { + "name": "o_positive", + "label": "O+", + "instance": { + "openmrs_code": "134343" + } + }, + { + "name": "o_negative", + "label": "O-", + "instance": { + "openmrs_code": "432434" + } } - ], - "name": "woman_survived_group", - "bind": { - "relevant": "(${woman_survived} = 'yes' or ${mother_survived} = 'yes')" - }, - "type": "group" - }, - { - "name": "case_is_high_risk_till_pnc_close", - "instance": { - "openmrs_entity_id": "8768767", + ], + "name": "child_blood_group", + "label": "Child blood group? ಮಗುವಿನ ರಕ್ತದ ಗುಂಪು?", + "instance": { + "openmrs_entity_id": "232112", "openmrs_entity": "concept" + }, + "type": "select one" }, - "type": "hidden" - }, - { - "name": "case_is_high_risk_till_pnc_close_reason", - "instance": { - "openmrs_entity_id": "676576", + { + "children": [ + { + "name": "bcg", + "label": "BCG ಬಿ.ಸಿ.ಜಿ", + "instance": { + "openmrs_code": "23123" + } + }, + { + "name": "opv_0", + "label": "OPV 0 ಒ.ಪಿ.ವಿ 0", + "instance": { + "openmrs_code": "12312" + } + }, + { + "name": "hepb_0", + "label": "Hep B 0 ಹೆಪಟೆಟಿಸ್ ಬಿ 0", + "instance": { + "openmrs_code": "213123" + } + } + ], + "name": "immunizations_atbirth", + "label": "Immunizations provided at birth? ಹುಟ್ಟಿದ ಮಗುವಿಗೆ ಇಮ್ಯುನೈಜೇಷನ್ ನೀಡಲಾಯಿತೆ?", + "instance": { + "openmrs_entity_id": "199277", "openmrs_entity": "concept" + }, + "type": "select all that apply" }, - "type": "hidden" - }, - { - "name": "case_anaemic_status", - "instance": { - "openmrs_entity_id": "76767", + { + "name": "case_hepb", + "instance": { + "openmrs_entity_id": "100285", "openmrs_entity": "concept" + }, + "type": "hidden" }, - "type": "hidden" + { + "children": [ + { + "name": "yes", + "label": "Yes ಹೌದು", + "instance": { + "openmrs_code": "1065" + } + }, + { + "name": "no", + "label": "No ಇಲ್ಲ", + "instance": { + "openmrs_code": "1066" + } + } + ], + "name": "hepb_prophylaxis_provided", + "bind": { + "relevant": "${case_hepb} != ''" + }, + "label": "Hep B prophylaxis provided? ಹೆಪಟೆಟಿಸ್ ಬಿ ರೋಗನಿರೋಧಕ ಚಿಕಿತ್ಸೆ ನೀಡಲಾಗಿದೆತೇ?", + "instance": { + "openmrs_entity_id": "3321323", + "openmrs_entity": "concept" + }, + "type": "select one" + }, + { + "name": "lbw", + "bind": { + "calculate": "if(${birthweight} >= 1.5 and ${birthweight} < 2.5, 'Low_Birth_Weight','')" + }, + "instance": { + "openmrs_entity_id": "1232132", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "vlbw", + "bind": { + "calculate": "if(${birthweight} < 1.5, 'Very_Low_Birth_Weight', '')" + }, + "instance": { + "openmrs_entity_id": "232133", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "num_preg_days", + "bind": { + "calculate": "int(date(${delivery_date}) - date(${case_lmp}))" + }, + "instance": { + "openmrs_entity_id": "232323", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "premature", + "bind": { + "calculate": "if(${num_preg_days} < 259, 'Premature', '')" + }, + "instance": { + "openmrs_entity_id": "232323", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "premature_message1", + "bind": { + "relevant": "${premature} != ''" + }, + "label": "Baby is premature! Advise kangaroo care and rooming in. ಅವಧಿಗೆ ಮುನ್ನ ಜನಿಸಿದ ಮಗು! ಕಾಂಗರೋ ಆರೈಕೆ ಮತ್ತು ಒಂದೇ ರೂಮಿನಲ್ಲಿಡುವಂತೆ ಸಲಹೆ ನೀಡಿ.", + "type": "note" + }, + { + "name": "is_child_high_risk1", + "bind": { + "calculate": "if(${premature} != '' or ${lbw} != '' or ${vlbw} != '', 'yes', 'no')" + }, + "instance": { + "openmrs_entity_id": "342343", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "child_high_risk_reasons", + "bind": { + "calculate": "concat(${premature}, ' ', ${lbw}, ' ', ${vlbw})" + }, + "instance": { + "openmrs_entity_id": "423434", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "high_risk_note_child", + "bind": { + "relevant": "${is_child_high_risk1} = 'yes'" + }, + "label": "Child is at risk because of, ಈಗ ಮಗು ಅಪಾಯದಲ್ಲಿದೆ ಏಕೆಂದರೆ: ${child_high_risk_reasons}", + "type": "note" + }, + { + "children": [ + { + "name": "yes", + "label": "Yes ಹೌದು", + "instance": { + "openmrs_code": "1065" + } + }, + { + "name": "no", + "label": "No ಇಲ್ಲ", + "instance": { + "openmrs_code": "1066" + } + } + ], + "name": "is_child_high_risk", + "bind": { + "required": "yes" + }, + "label": "Do you want to mark child as HR (High Risk)? \nನೀವು ಮಗುವನ್ನು HR (ಹೆಚ್ಚು ಅಪಾಯವಿದೆ) ಎಂದು ಗುರುತಿಸಲು ಬಯಸುವಿರಾ?", + "instance": { + "openmrs_entity_id": "4342343", + "openmrs_entity": "concept" + }, + "type": "select one" + }, + { + "name": "addl_pnc_visit_message", + "bind": { + "relevant": "${is_child_high_risk1} = 'yes'" + }, + "label": "Child needs 3 more PNC visits on days 14, 21, and 28 because of, 14, 21 ಮತ್ತು 28 ನೇ ದಿನಗಳೊಂದು ಮಗುವಿಗೆ 3 ಹೆಚ್ಚಿನ ಭೇಟಿಯ ಅಗತ್ಯವಿದೆ, ಏಕೆಂದರೆ: ${child_high_risk_reasons}", + "type": "note" + } + ], + "name": "child", + "label": "Please enter birth information for each child born. ಜನನವಾದ ಪ್ರತಿ ಮಗುವಿನ ಜನ್ಮ ಮಾಹಿತಿಯನ್ನು ದಯವಿಟ್ಟು ನಮೂದಿಸಿ.", + "instance": { + "openmrs_entity_id": "100029", + "openmrs_entity": "concept" + }, + "type": "repeat" }, { - "name": "case_pih", - "instance": { - "openmrs_entity_id": "36787", - "openmrs_entity": "concept" - }, - "type": "hidden" + "children": [ + { + "name": "yes", + "label": "Yes ಹೌದು", + "instance": { + "openmrs_code": "1065" + } + }, + { + "name": "no", + "label": "No ಇಲ್ಲ", + "instance": { + "openmrs_code": "1066" + } + } + ], + "name": "mother_survived", + "bind": { + "required": "yes" + }, + "label": "Mother survived childbirth? ಮಗುವಿನ ಜನನದ ನಂತರ ಮಹಿಳೆ ಬದುಕುಳಿದರೆ?", + "instance": { + "openmrs_entity_id": "343434", + "openmrs_entity": "concept" + }, + "type": "select one" }, { - "name": "case_pre_eclampsia", - "instance": { - "openmrs_entity_id": "376784", - "openmrs_entity": "concept" - }, - "type": "hidden" + "children": [ + { + "name": "yes", + "label": "Yes ಹೌದು", + "instance": { + "openmrs_code": "1065" + } + }, + { + "name": "no", + "label": "No ಇಲ್ಲ", + "instance": { + "openmrs_code": "1066" + } + } + ], + "name": "breastfeeding_postbirth", + "bind": { + "relevant": "${mother_survived} = 'yes'", + "required": "yes" + }, + "label": "Was breastfeeding started within 1 hour of birth? ಹುಟ್ಟಿದ ಒಂದು ಗಂಟೆಯ ಒಳಗೆ ಎದೆಹಾಲು ನೀಡಲಾಯಿತೆ?", + "instance": { + "openmrs_entity_id": "434343", + "openmrs_entity": "concept" + }, + "type": "select one" + } + ], + "name": "live_birth_group", + "bind": { + "relevant": "${delivery_outcome} = 'live_birth'" + }, + "type": "group" + }, + { + "name": "case_num_livingchildren", + "instance": { + "openmrs_entity_id": "434344", + "openmrs_entity": "concept" + }, + "type": "hidden" + }, + { + "name": "num_children_born", + "bind": { + "calculate": "if(${delivery_outcome} = 'still_birth', 0, count(${sex_child}))" + }, + "instance": { + "openmrs_entity_id": "43432", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "num_livingchildren", + "bind": { + "calculate": "${case_num_livingchildren} + ${num_children_born}" + }, + "instance": { + "openmrs_entity_id": "54541", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "case_numlivingchildren_female", + "instance": { + "openmrs_entity_id": "57467", + "openmrs_entity": "concept" + }, + "type": "hidden" + }, + { + "name": "num_female_children_born", + "bind": { + "calculate": "sum(${sex_child_female})" + }, + "instance": { + "openmrs_entity_id": "687832", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "numlivingchildren_female", + "bind": { + "calculate": "${case_numlivingchildren_female} + ${num_female_children_born}" + }, + "instance": { + "openmrs_entity_id": "098343", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "case_numlivingchildren_male", + "instance": { + "openmrs_entity_id": "98664", + "openmrs_entity": "concept" + }, + "type": "hidden" + }, + { + "name": "num_male_children_born", + "bind": { + "calculate": "sum(${sex_child_male})" + }, + "instance": { + "openmrs_entity_id": "4343656", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "numlivingchildren_male", + "bind": { + "calculate": "${case_numlivingchildren_male} + ${num_male_children_born}" + }, + "instance": { + "openmrs_entity_id": "342325", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "children": [ + { + "children": [ + { + "name": "prolonged_obstructed_labor", + "label": "Prolonged / obstructed labor ದೀರ್ಘಕಾಲೀನ / ಅಡಚಣೆಯನ್ನು ತಂದೊಡ್ಡುವ ಹೆರಿಗೆ ನೋವು", + "instance": { + "openmrs_code": "23123" + } + }, + { + "name": "hypertension_fits", + "label": "Severe hypertension / fits ತೀವ್ರತರವಾದ ಅಧಿಕ ರಕ್ತದೊತ್ತಡ / ಮೂರ್ಚೆರೋಗ", + "instance": { + "openmrs_code": "23213" + } + }, + { + "name": "bleeding_hemorrhage", + "label": "Bleeding / hemorrhage ರಕ್ತಸ್ರಾವ", + "instance": { + "openmrs_code": "23123" + } + }, + { + "name": "fever_infection", + "label": "High fever / infection ಅಧಿಕ ಜ್ವರ / ಸೊಂಕು", + "instance": { + "openmrs_code": "2323" + } + }, + { + "name": "cause_not_identified", + "label": "Cause not identified ಕಾರಣವನ್ನು ಗುರುತಿಸಲ್ಪಟ್ಟಿಲ್ಲ", + "instance": { + "openmrs_code": "23213" + } + }, + { + "name": "others", + "label": "Others ಇತರೆ", + "instance": { + "openmrs_code": "23213" + } + } + ], + "name": "maternal_death_cause", + "label": "Cause of maternal death? ತಾಯಿಯ ಮರಣಕ್ಕೆ ಕಾರಣಗಳು?", + "instance": { + "openmrs_entity_id": "43434", + "openmrs_entity": "concept" + }, + "type": "select one" }, { - "name": "case_jaundice", - "instance": { - "openmrs_entity_id": "343434", - "openmrs_entity": "concept" - }, - "type": "hidden" + "name": "other_maternal_death_cause", + "bind": { + "relevant": "${maternal_death_cause} = 'others'" + }, + "label": "Others ಇತರೆ:", + "instance": { + "openmrs_entity_id": "43221", + "openmrs_entity": "concept" + }, + "type": "text" + } + ], + "name": "maternal_death_group", + "bind": { + "relevant": "(${woman_survived} = 'no' or ${mother_survived} = 'no')" + }, + "type": "group" + }, + { + "children": [ + { + "name": "case_w_rh_negative", + "instance": { + "openmrs_entity_id": "4324234", + "openmrs_entity": "concept" + }, + "type": "hidden" }, { - "name": "is_high_risk1", - "bind": { - "calculate": "if(${case_is_high_risk_till_pnc_close} = 'yes' or ${case_anaemic_status} != '' or ${case_pih} != '' or ${case_pre_eclampsia} != '' or ${case_jaundice} != '', 'yes', 'no')" - }, - "instance": { - "openmrs_entity_id": "4746767", - "openmrs_entity": "concept" - }, - "type": "calculate" + "children": [ + { + "name": "yes", + "label": "Yes ಹೌದು", + "instance": { + "openmrs_code": "1065" + } + }, + { + "name": "no", + "label": "No ಇಲ್ಲ", + "instance": { + "openmrs_code": "1066" + } + } + ], + "name": "rh_injection_given", + "bind": { + "relevant": "${case_w_rh_negative} != ''" + }, + "label": "Rh injection given to woman? ಮಹಿಳೆಗೆ Rh ಚುಚ್ಚುಮದ್ದು ನೀಡಲಾಯಿತೆ?", + "instance": { + "openmrs_entity_id": "32323", + "openmrs_entity": "concept" + }, + "type": "select one" }, { - "name": "high_risk_reason", - "bind": { - "calculate": "concat(${case_is_high_risk_till_pnc_close_reason}, ' ', ${case_anaemic_status}, ' ', ${case_pih}, ' ', ${case_pre_eclampsia}, ' ', ${case_jaundice})" - }, - "instance": { - "openmrs_entity_id": "5656", - "openmrs_entity": "concept" - }, - "type": "calculate" + "children": [ + { + "name": "yes", + "label": "Yes ಹೌದು", + "instance": { + "openmrs_code": "1065" + } + }, + { + "name": "no", + "label": "No ಇಲ್ಲ", + "instance": { + "openmrs_code": "1066" + } + } + ], + "name": "had_delivery_complications", + "label": "Were there delivery complications? ಹೆರಿಗೆಯಲ್ಲಿ ತೊಡಕುಂಟಾಯಿತೆ?", + "instance": { + "openmrs_entity_id": "233234", + "openmrs_entity": "concept" + }, + "type": "select one" }, { - "name": "high_risk_note_mother", - "bind": { - "relevant": "${is_high_risk1} = 'yes'" - }, - "label": "Woman is still at risk because of, ಮಹಿಳೆಯು ಈಗಲೂ ಅಪಾಯದಲ್ಲಿದ್ದಾಳೆ ಏಕೆಂದರೆ: ${high_risk_reason}", - "type": "note" + "children": [ + { + "name": "hemorrhage", + "label": "Hemorrhage ರಕ್ತಸ್ರಾವ", + "instance": { + "openmrs_code": "4123213" + } + }, + { + "name": "placenta_previa", + "label": "Placenta previa ಹಿಂದಿನ ಗರ್ಭದಲ್ಲಿ ಮಾಸು ಮುಂದಿರುವುದು", + "instance": { + "openmrs_code": "2131413" + } + }, + { + "name": "cord_prolapse", + "label": "Cord prolapse ಬಳ್ಳಿಯ ಸರಿತ", + "instance": { + "openmrs_code": "4134123" + } + }, + { + "name": "prolonged_labor", + "label": "Prolonged / obstructed labor ದೀರ್ಘಕಾಲೀನ / ಅಡಚಣೆಯನ್ನು ತಂದೊಡ್ಡುವ ಹೆರಿಗೆ ನೋವು", + "instance": { + "openmrs_code": "213124123" + } + }, + { + "name": "abnormal_presentation", + "label": "Abnormal presentation ಅಪಸಾಮಾನ್ಯ ಪ್ರಸ್ತುತಿ", + "instance": { + "openmrs_code": "14123123" + } + }, + { + "name": "perineal_tear", + "label": "Perineal tear (2, 3, or 4 degree)", + "instance": { + "openmrs_code": "23123" + } + }, + { + "name": "others", + "label": "Others ಇತರೆ", + "instance": { + "openmrs_code": "32123" + } + } + ], + "name": "complications", + "bind": { + "relevant": "${had_delivery_complications} = 'yes'" + }, + "label": "What delivery complications were there? ಯಾವ ಹೆರಿಗೆ ತೊಂದರೆಗಳು ಉಂಟಾದವು?", + "instance": { + "openmrs_entity_id": "25343", + "openmrs_entity": "concept" + }, + "type": "select all that apply" }, { - "children": [ - { - "name": "yes", - "label": "Yes ಹೌದು", - "instance": { - "openmrs_code": "1065" - } - }, - { - "name": "no", - "label": "No ಇಲ್ಲ", - "instance": { - "openmrs_code": "1066" - } - } - ], - "name": "is_high_risk", - "bind": { - "relevant": "(${woman_survived} = 'yes' or ${mother_survived} = 'yes')", - "required": "yes" - }, - "label": "Do you want to mark woman as HR (High Risk)?\nನೀವು ಮಹಿಳೆಯನ್ನು HR (ಹೆಚ್ಚು ಅಪಾಯವಿದೆ) ಎಂದು ಗುರುತಿಸಲು ಬಯಸುವಿರಾ?", - "instance": { - "openmrs_entity_id": "424253", - "openmrs_entity": "concept" - }, - "type": "select one" + "name": "delivery_complications_other", + "bind": { + "relevant": "selected(${complications}, 'others')" + }, + "label": "Others ಇತರೆ:", + "instance": { + "openmrs_entity_id": "2355435", + "openmrs_entity": "concept" + }, + "type": "text" + } + ], + "name": "woman_survived_group", + "bind": { + "relevant": "(${woman_survived} = 'yes' or ${mother_survived} = 'yes')" + }, + "type": "group" + }, + { + "name": "case_is_high_risk_till_pnc_close", + "instance": { + "openmrs_entity_id": "8768767", + "openmrs_entity": "concept" + }, + "type": "hidden" + }, + { + "name": "case_is_high_risk_till_pnc_close_reason", + "instance": { + "openmrs_entity_id": "676576", + "openmrs_entity": "concept" + }, + "type": "hidden" + }, + { + "name": "case_anaemic_status", + "instance": { + "openmrs_entity_id": "76767", + "openmrs_entity": "concept" + }, + "type": "hidden" + }, + { + "name": "case_pih", + "instance": { + "openmrs_entity_id": "36787", + "openmrs_entity": "concept" + }, + "type": "hidden" + }, + { + "name": "case_pre_eclampsia", + "instance": { + "openmrs_entity_id": "376784", + "openmrs_entity": "concept" + }, + "type": "hidden" + }, + { + "name": "case_jaundice", + "instance": { + "openmrs_entity_id": "343434", + "openmrs_entity": "concept" + }, + "type": "hidden" + }, + { + "name": "is_high_risk1", + "bind": { + "calculate": "if(${case_is_high_risk_till_pnc_close} = 'yes' or ${case_anaemic_status} != '' or ${case_pih} != '' or ${case_pre_eclampsia} != '' or ${case_jaundice} != '', 'yes', 'no')" + }, + "instance": { + "openmrs_entity_id": "4746767", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "high_risk_reason", + "bind": { + "calculate": "concat(${case_is_high_risk_till_pnc_close_reason}, ' ', ${case_anaemic_status}, ' ', ${case_pih}, ' ', ${case_pre_eclampsia}, ' ', ${case_jaundice})" + }, + "instance": { + "openmrs_entity_id": "5656", + "openmrs_entity": "concept" + }, + "type": "calculate" + }, + { + "name": "high_risk_note_mother", + "bind": { + "relevant": "${is_high_risk1} = 'yes'" + }, + "label": "Woman is still at risk because of, ಮಹಿಳೆಯು ಈಗಲೂ ಅಪಾಯದಲ್ಲಿದ್ದಾಳೆ ಏಕೆಂದರೆ: ${high_risk_reason}", + "type": "note" + }, + { + "children": [ + { + "name": "yes", + "label": "Yes ಹೌದು", + "instance": { + "openmrs_code": "1065" + } }, { - "control": { - "bodyless": true - }, - "children": [ - { - "name": "instanceID", - "bind": { - "readonly": "true()", - "calculate": "concat('uuid:', uuid())" - }, - "type": "calculate" - } - ], - "name": "meta", - "type": "group" + "name": "no", + "label": "No ಇಲ್ಲ", + "instance": { + "openmrs_code": "1066" + } } - ], - "instance": { - "encounter_type": "PNC Registration" + ], + "name": "is_high_risk", + "bind": { + "relevant": "(${woman_survived} = 'yes' or ${mother_survived} = 'yes')", + "required": "yes" + }, + "label": "Do you want to mark woman as HR (High Risk)?\nನೀವು ಮಹಿಳೆಯನ್ನು HR (ಹೆಚ್ಚು ಅಪಾಯವಿದೆ) ಎಂದು ಗುರುತಿಸಲು ಬಯಸುವಿರಾ?", + "instance": { + "openmrs_entity_id": "424253", + "openmrs_entity": "concept" + }, + "type": "select one" }, - "version": "201504300627", - "type": "survey", - "name": "PNC_Registration_EngKan", - "sms_keyword": "Delivery_Outcome_EngKan", - "title": "PNC Registration" + { + "control": { + "bodyless": true + }, + "children": [ + { + "name": "instanceID", + "bind": { + "readonly": "true()", + "calculate": "concat('uuid:', uuid())" + }, + "type": "calculate" + } + ], + "name": "meta", + "type": "group" + } + ], + "instance": { + "encounter_type": "PNC Registration" + }, + "version": "201504300627", + "type": "survey", + "name": "PNC_Registration_EngKan", + "sms_keyword": "Delivery_Outcome_EngKan", + "title": "PNC Registration" } \ No newline at end of file diff --git a/src/test/resources/form/pnc_reg_form/form_definition.json b/src/test/resources/form/pnc_reg_form/form_definition.json index c64ffdc42..cda9e0cf7 100644 --- a/src/test/resources/form/pnc_reg_form/form_definition.json +++ b/src/test/resources/form/pnc_reg_form/form_definition.json @@ -1,315 +1,315 @@ { - "form_data_definition_version": "5", - "form": { - "bind_type": "mother", - "default_bind_path": "/model/instance/PNC_Registration_EngKan/", + "form_data_definition_version": "5", + "form": { + "bind_type": "mother", + "default_bind_path": "/model/instance/PNC_Registration_EngKan/", + "fields": [ + { + "name": "id", + "shouldLoadValue": true + }, + { + "name": "ecId", + "shouldLoadValue": true, + "source": "mother.eligible_couple.id" + }, + { + "name": "referenceDate", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_lmp" + }, + { + "name": "referenceDate", + "bind": "/model/instance/PNC_Registration_EngKan/delivery_date" + }, + { + "name": "deliveryRegistrationDate", + "bind": "/model/instance/PNC_Registration_EngKan/delivery_reg_date" + }, + { + "name": "deliveryPlace", + "bind": "/model/instance/PNC_Registration_EngKan/place_delivery" + }, + { + "name": "deliveryFacilityName", + "bind": "/model/instance/PNC_Registration_EngKan/name_delivery_facility" + }, + { + "name": "isThisOnlyDeliveryFacility", + "bind": "/model/instance/PNC_Registration_EngKan/only_delivery_facility" + }, + { + "name": "additionalDeliveryFacility", + "bind": "/model/instance/PNC_Registration_EngKan/addl_delivery_facility" + }, + { + "name": "reasonsForAdditionalDeliveryFacility", + "bind": "/model/instance/PNC_Registration_EngKan/reasons_addl_delivery_facility" + }, + { + "name": "otherReasonsForAdditionalDeliveryFacility", + "bind": "/model/instance/PNC_Registration_EngKan/other_reasons_addl_delivery_facility" + }, + { + "name": "isSkilledDelivery", + "bind": "/model/instance/PNC_Registration_EngKan/skilled_delivery" + }, + { + "name": "deliveryType", + "bind": "/model/instance/PNC_Registration_EngKan/type_delivery" + }, + { + "name": "deliveryOutcome", + "bind": "/model/instance/PNC_Registration_EngKan/delivery_outcome" + }, + { + "name": "parity", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_parity", + "source": "mother.eligible_couple.parity" + }, + { + "name": "parity", + "bind": "/model/instance/PNC_Registration_EngKan/parity", + "source": "mother.eligible_couple.parity" + }, + { + "name": "numberOfLiveBirths", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_num_livebirths", + "source": "mother.eligible_couple.numberOfLiveBirths" + }, + { + "name": "numberOfLiveBirths", + "bind": "/model/instance/PNC_Registration_EngKan/num_livebirths", + "source": "mother.eligible_couple.numberOfLiveBirths" + }, + { + "name": "numberOfStillBirths", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_num_stillbirths", + "source": "mother.eligible_couple.numberOfStillBirths" + }, + { + "name": "numberOfStillBirths", + "bind": "/model/instance/PNC_Registration_EngKan/num_stillbirths", + "source": "mother.eligible_couple.numberOfStillBirths" + }, + { + "name": "causeOfStillBirth", + "bind": "/model/instance/PNC_Registration_EngKan/still_birth_group/cause_of_still_birth" + }, + { + "name": "didWomanSurvive", + "bind": "/model/instance/PNC_Registration_EngKan/still_birth_group/woman_survived" + }, + { + "name": "didMotherSurvive", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/mother_survived" + }, + { + "name": "didBreastfeedingStart", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/breastfeeding_postbirth" + }, + { + "name": "maternalDeathCause", + "bind": "/model/instance/PNC_Registration_EngKan/maternal_death_group/maternal_death_cause" + }, + { + "name": "otherMaternalDeathCause", + "bind": "/model/instance/PNC_Registration_EngKan/maternal_death_group/other_maternal_death_cause" + }, + { + "name": "isRHNegative", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/case_w_rh_negative" + }, + { + "name": "isRHInjectionGiven", + "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/rh_injection_given" + }, + { + "name": "hadDeliveryComplications", + "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/had_delivery_complications" + }, + { + "name": "deliveryComplications", + "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/complications" + }, + { + "name": "otherDeliveryComplications", + "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/delivery_complications_other" + }, + { + "name": "isHighRiskTillPNCClose", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_is_high_risk_till_pnc_close" + }, + { + "name": "highRiskTillPNCCloseReason", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_is_high_risk_till_pnc_close_reason" + }, + { + "name": "anemicStatus", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_anaemic_status" + }, + { + "name": "pih", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_pih" + }, + { + "name": "preEclampsia", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_pre_eclampsia" + }, + { + "name": "jaundice", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_jaundice" + }, + { + "name": "isHighRisk", + "bind": "/model/instance/PNC_Registration_EngKan/is_high_risk" + }, + { + "name": "isBirthPlanningDone", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_birth_planning" + }, + { + "name": "highRiskReason", + "bind": "/model/instance/PNC_Registration_EngKan/high_risk_reason" + }, + { + "name": "submissionDate", + "bind": "/model/instance/PNC_Registration_EngKan/today" + }, + { + "name": "type", + "value": "PNC", + "source": "mother.type" + }, + { + "name": "numberOfLivingChildren", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_num_livingchildren", + "source": "mother.eligible_couple.numberOfLivingChildren" + }, + { + "name": "numberOfLivingChildren", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/num_livingchildren", + "source": "mother.eligible_couple.numberOfLivingChildren" + }, + { + "name": "numberOfChildrenBorn", + "bind": "/model/instance/PNC_Registration_EngKan/num_children_born" + }, + { + "name": "numberOfFemaleChildrenBorn", + "bind": "/model/instance/PNC_Registration_EngKan/num_female_children_born" + }, + { + "name": "numberOfMaleChildrenBorn", + "bind": "/model/instance/PNC_Registration_EngKan/num_male_children_born" + }, + { + "name": "numberOfLivingFemaleChild", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_numlivingchildren_female", + "source": "mother.eligible_couple.numberOfLivingChildrenFemale" + }, + { + "name": "numberOfLivingFemaleChild", + "bind": "/model/instance/PNC_Registration_EngKan/numlivingchildren_female", + "source": "mother.eligible_couple.numberOfLivingChildrenFemale" + }, + { + "name": "numberOfLivingMaleChild", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_numlivingchildren_male", + "source": "mother.eligible_couple.numberOfLivingMaleChild" + }, + { + "name": "numberOfLivingMaleChild", + "bind": "/model/instance/PNC_Registration_EngKan/numlivingchildren_male", + "source": "mother.eligible_couple.numberOfLivingMaleChild" + }, + { + "name": "youngestChildDOB", + "bind": "/model/instance/PNC_Registration_EngKan/youngestchild_date_of_birth", + "source": "mother.eligible_couple.youngestChildDOB" + }, + { + "name": "youngestChildAge", + "bind": "/model/instance/PNC_Registration_EngKan/youngestchild_age", + "source": "mother.eligible_couple.youngestChildAge" + } + ], + "sub_forms": [ + { + "name": "child_registration", + "bind_type": "child", + "default_bind_path": "/model/instance/PNC_Registration_EngKan/live_birth_group/child", "fields": [ - { - "name": "id", - "shouldLoadValue": true - }, - { - "name": "ecId", - "shouldLoadValue": true, - "source": "mother.eligible_couple.id" - }, - { - "name": "referenceDate", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_lmp" - }, - { - "name": "referenceDate", - "bind": "/model/instance/PNC_Registration_EngKan/delivery_date" - }, - { - "name": "deliveryRegistrationDate", - "bind": "/model/instance/PNC_Registration_EngKan/delivery_reg_date" - }, - { - "name": "deliveryPlace", - "bind": "/model/instance/PNC_Registration_EngKan/place_delivery" - }, - { - "name": "deliveryFacilityName", - "bind": "/model/instance/PNC_Registration_EngKan/name_delivery_facility" - }, - { - "name": "isThisOnlyDeliveryFacility", - "bind": "/model/instance/PNC_Registration_EngKan/only_delivery_facility" - }, - { - "name": "additionalDeliveryFacility", - "bind": "/model/instance/PNC_Registration_EngKan/addl_delivery_facility" - }, - { - "name": "reasonsForAdditionalDeliveryFacility", - "bind": "/model/instance/PNC_Registration_EngKan/reasons_addl_delivery_facility" - }, - { - "name": "otherReasonsForAdditionalDeliveryFacility", - "bind": "/model/instance/PNC_Registration_EngKan/other_reasons_addl_delivery_facility" - }, - { - "name": "isSkilledDelivery", - "bind": "/model/instance/PNC_Registration_EngKan/skilled_delivery" - }, - { - "name": "deliveryType", - "bind": "/model/instance/PNC_Registration_EngKan/type_delivery" - }, - { - "name": "deliveryOutcome", - "bind": "/model/instance/PNC_Registration_EngKan/delivery_outcome" - }, - { - "name": "parity", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_parity", - "source": "mother.eligible_couple.parity" - }, - { - "name": "parity", - "bind": "/model/instance/PNC_Registration_EngKan/parity", - "source": "mother.eligible_couple.parity" - }, - { - "name": "numberOfLiveBirths", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_num_livebirths", - "source": "mother.eligible_couple.numberOfLiveBirths" - }, - { - "name": "numberOfLiveBirths", - "bind": "/model/instance/PNC_Registration_EngKan/num_livebirths", - "source": "mother.eligible_couple.numberOfLiveBirths" - }, - { - "name": "numberOfStillBirths", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_num_stillbirths", - "source": "mother.eligible_couple.numberOfStillBirths" - }, - { - "name": "numberOfStillBirths", - "bind": "/model/instance/PNC_Registration_EngKan/num_stillbirths", - "source": "mother.eligible_couple.numberOfStillBirths" - }, - { - "name": "causeOfStillBirth", - "bind": "/model/instance/PNC_Registration_EngKan/still_birth_group/cause_of_still_birth" - }, - { - "name": "didWomanSurvive", - "bind": "/model/instance/PNC_Registration_EngKan/still_birth_group/woman_survived" - }, - { - "name": "didMotherSurvive", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/mother_survived" - }, - { - "name": "didBreastfeedingStart", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/breastfeeding_postbirth" - }, - { - "name": "maternalDeathCause", - "bind": "/model/instance/PNC_Registration_EngKan/maternal_death_group/maternal_death_cause" - }, - { - "name": "otherMaternalDeathCause", - "bind": "/model/instance/PNC_Registration_EngKan/maternal_death_group/other_maternal_death_cause" - }, - { - "name": "isRHNegative", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/case_w_rh_negative" - }, - { - "name": "isRHInjectionGiven", - "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/rh_injection_given" - }, - { - "name": "hadDeliveryComplications", - "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/had_delivery_complications" - }, - { - "name": "deliveryComplications", - "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/complications" - }, - { - "name": "otherDeliveryComplications", - "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/delivery_complications_other" - }, - { - "name": "isHighRiskTillPNCClose", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_is_high_risk_till_pnc_close" - }, - { - "name": "highRiskTillPNCCloseReason", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_is_high_risk_till_pnc_close_reason" - }, - { - "name": "anemicStatus", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_anaemic_status" - }, - { - "name": "pih", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_pih" - }, - { - "name": "preEclampsia", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_pre_eclampsia" - }, - { - "name": "jaundice", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_jaundice" - }, - { - "name": "isHighRisk", - "bind": "/model/instance/PNC_Registration_EngKan/is_high_risk" - }, - { - "name": "isBirthPlanningDone", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_birth_planning" - }, - { - "name": "highRiskReason", - "bind": "/model/instance/PNC_Registration_EngKan/high_risk_reason" - }, - { - "name": "submissionDate", - "bind": "/model/instance/PNC_Registration_EngKan/today" - }, - { - "name": "type", - "value": "PNC", - "source": "mother.type" - }, - { - "name": "numberOfLivingChildren", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_num_livingchildren", - "source": "mother.eligible_couple.numberOfLivingChildren" - }, - { - "name": "numberOfLivingChildren", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/num_livingchildren", - "source": "mother.eligible_couple.numberOfLivingChildren" - }, - { - "name": "numberOfChildrenBorn", - "bind": "/model/instance/PNC_Registration_EngKan/num_children_born" - }, - { - "name": "numberOfFemaleChildrenBorn", - "bind": "/model/instance/PNC_Registration_EngKan/num_female_children_born" - }, - { - "name": "numberOfMaleChildrenBorn", - "bind": "/model/instance/PNC_Registration_EngKan/num_male_children_born" - }, - { - "name": "numberOfLivingFemaleChild", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_numlivingchildren_female", - "source": "mother.eligible_couple.numberOfLivingChildrenFemale" - }, - { - "name": "numberOfLivingFemaleChild", - "bind": "/model/instance/PNC_Registration_EngKan/numlivingchildren_female", - "source": "mother.eligible_couple.numberOfLivingChildrenFemale" - }, - { - "name": "numberOfLivingMaleChild", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_numlivingchildren_male", - "source": "mother.eligible_couple.numberOfLivingMaleChild" - }, - { - "name": "numberOfLivingMaleChild", - "bind": "/model/instance/PNC_Registration_EngKan/numlivingchildren_male", - "source": "mother.eligible_couple.numberOfLivingMaleChild" - }, - { - "name": "youngestChildDOB", - "bind": "/model/instance/PNC_Registration_EngKan/youngestchild_date_of_birth", - "source": "mother.eligible_couple.youngestChildDOB" - }, - { - "name": "youngestChildAge", - "bind": "/model/instance/PNC_Registration_EngKan/youngestchild_age", - "source": "mother.eligible_couple.youngestChildAge" - } - ], - "sub_forms": [ - { - "name": "child_registration", - "bind_type": "child", - "default_bind_path": "/model/instance/PNC_Registration_EngKan/live_birth_group/child", - "fields": [ - { - "name": "id", - "shouldLoadValue": true - }, - { - "name": "gender", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/sex_child" - }, - { - "name": "weight", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/birthweight" - }, - { - "name": "bloodGroup", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/child_blood_group" - }, - { - "name": "immunizationsGiven", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/immunizations_atbirth" - }, - { - "name": "hepB", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/case_hepb" - }, - { - "name": "isHepBProphylaxisProvided", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/hepb_prophylaxis_provided" - }, - { - "name": "isChildHighRisk1", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/is_child_high_risk1" - }, - { - "name": "childHighRiskReasons", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/child_high_risk_reasons" - }, - { - "name": "isChildHighRisk", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/is_child_high_risk" - }, - { - "name": "lbw", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/lbw" - }, - { - "name": "vlbw", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/vlbw" - }, - { - "name": "premature", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/premature" - } - ] - } + { + "name": "id", + "shouldLoadValue": true + }, + { + "name": "gender", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/sex_child" + }, + { + "name": "weight", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/birthweight" + }, + { + "name": "bloodGroup", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/child_blood_group" + }, + { + "name": "immunizationsGiven", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/immunizations_atbirth" + }, + { + "name": "hepB", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/case_hepb" + }, + { + "name": "isHepBProphylaxisProvided", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/hepb_prophylaxis_provided" + }, + { + "name": "isChildHighRisk1", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/is_child_high_risk1" + }, + { + "name": "childHighRiskReasons", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/child_high_risk_reasons" + }, + { + "name": "isChildHighRisk", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/is_child_high_risk" + }, + { + "name": "lbw", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/lbw" + }, + { + "name": "vlbw", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/vlbw" + }, + { + "name": "premature", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/premature" + } ] - } + } + ] + } } diff --git a/src/test/resources/form/pnc_reg_form/form_submission.json b/src/test/resources/form/pnc_reg_form/form_submission.json index 5ec548d61..0676e1f5e 100644 --- a/src/test/resources/form/pnc_reg_form/form_submission.json +++ b/src/test/resources/form/pnc_reg_form/form_submission.json @@ -1,459 +1,458 @@ { - "anmId": "admin", - "clientVersion": "1426830449320", - "entityId": "b716d938-1aea-40ae-a081-9ddddddcccc9", - "formDataDefinitionVersion": "5", - "formName": "pnc_reg_form", - "formInstance": { - "form_data_definition_version": "5", - "form": { - "bind_type": "mother", - "default_bind_path": "/model/instance/PNC_Registration_EngKan/", - "fields": [ - { - "name": "id", - "shouldLoadValue": true, - "source": "mother.id", - "value": "7efb9e31-0e26-496e-bd16-e09a3b0d1a31" - }, - { - "name": "ecId", - "shouldLoadValue": true, - "source": "mother.eligible_couple.id", - "value": "aa786612-e7a8-4fea-b733-3de4d898f4d6" - }, - { - "name": "referenceDate", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_lmp", - "source": "mother.referenceDate", - "value": "2014-02-20" - }, - { - "name": "referenceDate", - "bind": "/model/instance/PNC_Registration_EngKan/delivery_date", - "source": "mother.referenceDate", - "value": "2015-02-20" - }, - { - "name": "deliveryRegistrationDate", - "bind": "/model/instance/PNC_Registration_EngKan/delivery_reg_date", - "source": "mother.deliveryRegistrationDate", - "value": "2015-03-20" - }, - { - "name": "deliveryPlace", - "bind": "/model/instance/PNC_Registration_EngKan/place_delivery", - "source": "mother.deliveryPlace", - "value": "home" - }, - { - "name": "deliveryFacilityName", - "bind": "/model/instance/PNC_Registration_EngKan/name_delivery_facility", - "source": "mother.deliveryFacilityName" - }, - { - "name": "isThisOnlyDeliveryFacility", - "bind": "/model/instance/PNC_Registration_EngKan/only_delivery_facility", - "source": "mother.isThisOnlyDeliveryFacility", - "value": "yes" - }, - { - "name": "additionalDeliveryFacility", - "bind": "/model/instance/PNC_Registration_EngKan/addl_delivery_facility", - "source": "mother.additionalDeliveryFacility" - }, - { - "name": "reasonsForAdditionalDeliveryFacility", - "bind": "/model/instance/PNC_Registration_EngKan/reasons_addl_delivery_facility", - "source": "mother.reasonsForAdditionalDeliveryFacility" - }, - { - "name": "otherReasonsForAdditionalDeliveryFacility", - "bind": "/model/instance/PNC_Registration_EngKan/other_reasons_addl_delivery_facility", - "source": "mother.otherReasonsForAdditionalDeliveryFacility" - }, - { - "name": "isSkilledDelivery", - "bind": "/model/instance/PNC_Registration_EngKan/skilled_delivery", - "source": "mother.isSkilledDelivery", - "value": "yes" - }, - { - "name": "deliveryType", - "bind": "/model/instance/PNC_Registration_EngKan/type_delivery", - "source": "mother.deliveryType", - "value": "normal" - }, - { - "name": "deliveryOutcome", - "bind": "/model/instance/PNC_Registration_EngKan/delivery_outcome", - "source": "mother.deliveryOutcome", - "value": "live_birth" - }, - { - "name": "parity", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_parity", - "source": "mother.eligible_couple.parity", - "value": "0" - }, - { - "name": "parity", - "bind": "/model/instance/PNC_Registration_EngKan/parity", - "source": "mother.eligible_couple.parity", - "value": "1" - }, - { - "name": "numberOfLiveBirths", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_num_livebirths", - "source": "mother.eligible_couple.numberOfLiveBirths", - "value": "0" - }, - { - "name": "numberOfLiveBirths", - "bind": "/model/instance/PNC_Registration_EngKan/num_livebirths", - "source": "mother.eligible_couple.numberOfLiveBirths", - "value": "1" - }, - { - "name": "numberOfStillBirths", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_num_stillbirths", - "source": "mother.eligible_couple.numberOfStillBirths", - "value": "0" - }, - { - "name": "numberOfStillBirths", - "bind": "/model/instance/PNC_Registration_EngKan/num_stillbirths", - "source": "mother.eligible_couple.numberOfStillBirths" - }, - { - "name": "causeOfStillBirth", - "bind": "/model/instance/PNC_Registration_EngKan/still_birth_group/cause_of_still_birth", - "source": "mother.causeOfStillBirth" - }, - { - "name": "didWomanSurvive", - "bind": "/model/instance/PNC_Registration_EngKan/still_birth_group/woman_survived", - "source": "mother.didWomanSurvive" - }, - { - "name": "didMotherSurvive", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/mother_survived", - "source": "mother.didMotherSurvive", - "value": "yes" - }, - { - "name": "didBreastfeedingStart", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/breastfeeding_postbirth", - "source": "mother.didBreastfeedingStart", - "value": "yes" - }, - { - "name": "maternalDeathCause", - "bind": "/model/instance/PNC_Registration_EngKan/maternal_death_group/maternal_death_cause", - "source": "mother.maternalDeathCause" - }, - { - "name": "otherMaternalDeathCause", - "bind": "/model/instance/PNC_Registration_EngKan/maternal_death_group/other_maternal_death_cause", - "source": "mother.otherMaternalDeathCause" - }, - { - "name": "isRHNegative", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/case_w_rh_negative", - "source": "mother.isRHNegative" - }, - { - "name": "isRHInjectionGiven", - "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/rh_injection_given", - "source": "mother.isRHInjectionGiven" - }, - { - "name": "hadDeliveryComplications", - "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/had_delivery_complications", - "source": "mother.hadDeliveryComplications", - "value": "yes" - }, - { - "name": "deliveryComplications", - "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/complications", - "source": "mother.deliveryComplications", - "value": "hemorrhage placenta_previa" - }, - { - "name": "otherDeliveryComplications", - "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/delivery_complications_other", - "source": "mother.otherDeliveryComplications" - }, - { - "name": "isHighRiskTillPNCClose", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_is_high_risk_till_pnc_close", - "source": "mother.isHighRiskTillPNCClose", - "value": "no" - }, - { - "name": "highRiskTillPNCCloseReason", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_is_high_risk_till_pnc_close_reason", - "source": "mother.highRiskTillPNCCloseReason" - }, - { - "name": "anemicStatus", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_anaemic_status", - "source": "mother.anemicStatus" - }, - { - "name": "pih", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_pih", - "source": "mother.pih" - }, - { - "name": "preEclampsia", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_pre_eclampsia", - "source": "mother.preEclampsia" - }, - { - "name": "jaundice", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_jaundice", - "source": "mother.jaundice" - }, - { - "name": "isHighRisk", - "bind": "/model/instance/PNC_Registration_EngKan/is_high_risk", - "source": "mother.isHighRisk", - "value": "yes" - }, - { - "name": "isBirthPlanningDone", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_birth_planning", - "source": "mother.isBirthPlanningDone" - }, - { - "name": "highRiskReason", - "bind": "/model/instance/PNC_Registration_EngKan/high_risk_reason", - "source": "mother.highRiskReason" - }, - { - "name": "submissionDate", - "bind": "/model/instance/PNC_Registration_EngKan/today", - "source": "mother.submissionDate", - "value": "2015-03-20" - }, - { - "name": "type", - "value": "PNC", - "source": "mother.type" - }, - { - "name": "numberOfLivingChildren", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_num_livingchildren", - "source": "mother.eligible_couple.numberOfLivingChildren", - "value": "0" - }, - { - "name": "numberOfLivingChildren", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/num_livingchildren", - "source": "mother.eligible_couple.numberOfLivingChildren", - "value": "3" - }, - { - "name": "numberOfChildrenBorn", - "bind": "/model/instance/PNC_Registration_EngKan/num_children_born", - "source": "mother.numberOfChildrenBorn", - "value": "3" - }, - { - "name": "numberOfFemaleChildrenBorn", - "bind": "/model/instance/PNC_Registration_EngKan/num_female_children_born", - "source": "mother.numberOfFemaleChildrenBorn", - "value": "1" - }, - { - "name": "numberOfMaleChildrenBorn", - "bind": "/model/instance/PNC_Registration_EngKan/num_male_children_born", - "source": "mother.numberOfMaleChildrenBorn", - "value": "2" - }, - { - "name": "numberOfLivingFemaleChild", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_numlivingchildren_female", - "source": "mother.eligible_couple.numberOfLivingChildrenFemale" - }, - { - "name": "numberOfLivingFemaleChild", - "bind": "/model/instance/PNC_Registration_EngKan/numlivingchildren_female", - "source": "mother.eligible_couple.numberOfLivingChildrenFemale", - "value": "NaN" - }, - { - "name": "numberOfLivingMaleChild", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/case_numlivingchildren_male", - "source": "mother.eligible_couple.numberOfLivingMaleChild" - }, - { - "name": "numberOfLivingMaleChild", - "bind": "/model/instance/PNC_Registration_EngKan/numlivingchildren_male", - "source": "mother.eligible_couple.numberOfLivingMaleChild", - "value": "NaN" - }, - { - "name": "youngestChildDOB", - "bind": "/model/instance/PNC_Registration_EngKan/youngestchild_date_of_birth", - "source": "mother.eligible_couple.youngestChildDOB", - "value": "2015-02-20" - }, - { - "name": "youngestChildAge", - "bind": "/model/instance/PNC_Registration_EngKan/youngestchild_age", - "source": "mother.eligible_couple.youngestChildAge", - "value": "0" - } - ], - "sub_forms": [ - { - "name": "child_registration", - "bind_type": "child", - "default_bind_path": "/model/instance/PNC_Registration_EngKan/live_birth_group/child", - "fields": [ - { - "name": "id", - "shouldLoadValue": true, - "source": "child.id" - }, - { - "name": "gender", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/sex_child", - "source": "child.gender" - }, - { - "name": "birthdate", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/birthdate", - "source": "child.birthdate" - }, - { - - "name": "weight", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/birthweight", - "source": "child.weight" - }, - { - "name": "bloodGroup", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/child_blood_group", - "source": "child.bloodGroup" - }, - { - "name": "immunizationsGiven", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/immunizations_atbirth", - "source": "child.immunizationsGiven" - }, - { - "name": "hepB", - "shouldLoadValue": true, - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/case_hepb", - "source": "child.hepB" - }, - { - "name": "isHepBProphylaxisProvided", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/hepb_prophylaxis_provided", - "source": "child.isHepBProphylaxisProvided" - }, - { - "name": "isChildHighRisk1", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/is_child_high_risk1", - "source": "child.isChildHighRisk1" - }, - { - "name": "childHighRiskReasons", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/child_high_risk_reasons", - "source": "child.childHighRiskReasons" - }, - { - "name": "isChildHighRisk", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/is_child_high_risk", - "source": "child.isChildHighRisk" - }, - { - "name": "lbw", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/lbw", - "source": "child.lbw" - }, - { - "name": "vlbw", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/vlbw", - "source": "child.vlbw" - }, - { - "name": "premature", - "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/premature", - "source": "child.premature" - } - ], - "instances": [ - { - "gender": "male", - "birthdate":"2015-03-05", - "weight": "2", - "bloodGroup": "a_negative", - "immunizationsGiven": "bcg", - "hepB": "", - "isHepBProphylaxisProvided": "", - "lbw": "Low_Birth_Weight", - "vlbw": "", - "premature": "", - "isChildHighRisk1": "yes", - "childHighRiskReasons": " Low_Birth_Weight ", - "isChildHighRisk": "yes", - "id": "e9a91c61-0d33-42d3-bf9b-560b4d08c74f" - }, - { - "gender": "male", - "birthdate":"2015-04-05", - "weight": "", - "bloodGroup": "a_negative", - "immunizationsGiven": "bcg", - "hepB": "", - "isHepBProphylaxisProvided": "", - "lbw": "", - "vlbw": "", - "premature": "", - "isChildHighRisk1": "no", - "childHighRiskReasons": "", - "isChildHighRisk": "yes", - "id": "c7305d21-0b90-4c15-a88f-b08338d3aed9" - }, - { - "gender": "female", - "birthdate":"2015-05-05", - "weight": "", - "bloodGroup": "a_negative", - "immunizationsGiven": "bcg", - "hepB": "", - "isHepBProphylaxisProvided": "", - "lbw": "", - "vlbw": "", - "premature": "", - "isChildHighRisk1": "no", - "childHighRiskReasons": "", - "isChildHighRisk": "no", - "id": "6c2d772b-7d6a-4a05-a83d-5168c183ef42" - } - ] - } - ] + "anmId": "admin", + "clientVersion": "1426830449320", + "entityId": "b716d938-1aea-40ae-a081-9ddddddcccc9", + "formDataDefinitionVersion": "5", + "formName": "pnc_reg_form", + "formInstance": { + "form_data_definition_version": "5", + "form": { + "bind_type": "mother", + "default_bind_path": "/model/instance/PNC_Registration_EngKan/", + "fields": [ + { + "name": "id", + "shouldLoadValue": true, + "source": "mother.id", + "value": "7efb9e31-0e26-496e-bd16-e09a3b0d1a31" + }, + { + "name": "ecId", + "shouldLoadValue": true, + "source": "mother.eligible_couple.id", + "value": "aa786612-e7a8-4fea-b733-3de4d898f4d6" + }, + { + "name": "referenceDate", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_lmp", + "source": "mother.referenceDate", + "value": "2014-02-20" + }, + { + "name": "referenceDate", + "bind": "/model/instance/PNC_Registration_EngKan/delivery_date", + "source": "mother.referenceDate", + "value": "2015-02-20" + }, + { + "name": "deliveryRegistrationDate", + "bind": "/model/instance/PNC_Registration_EngKan/delivery_reg_date", + "source": "mother.deliveryRegistrationDate", + "value": "2015-03-20" + }, + { + "name": "deliveryPlace", + "bind": "/model/instance/PNC_Registration_EngKan/place_delivery", + "source": "mother.deliveryPlace", + "value": "home" + }, + { + "name": "deliveryFacilityName", + "bind": "/model/instance/PNC_Registration_EngKan/name_delivery_facility", + "source": "mother.deliveryFacilityName" + }, + { + "name": "isThisOnlyDeliveryFacility", + "bind": "/model/instance/PNC_Registration_EngKan/only_delivery_facility", + "source": "mother.isThisOnlyDeliveryFacility", + "value": "yes" + }, + { + "name": "additionalDeliveryFacility", + "bind": "/model/instance/PNC_Registration_EngKan/addl_delivery_facility", + "source": "mother.additionalDeliveryFacility" + }, + { + "name": "reasonsForAdditionalDeliveryFacility", + "bind": "/model/instance/PNC_Registration_EngKan/reasons_addl_delivery_facility", + "source": "mother.reasonsForAdditionalDeliveryFacility" + }, + { + "name": "otherReasonsForAdditionalDeliveryFacility", + "bind": "/model/instance/PNC_Registration_EngKan/other_reasons_addl_delivery_facility", + "source": "mother.otherReasonsForAdditionalDeliveryFacility" + }, + { + "name": "isSkilledDelivery", + "bind": "/model/instance/PNC_Registration_EngKan/skilled_delivery", + "source": "mother.isSkilledDelivery", + "value": "yes" + }, + { + "name": "deliveryType", + "bind": "/model/instance/PNC_Registration_EngKan/type_delivery", + "source": "mother.deliveryType", + "value": "normal" + }, + { + "name": "deliveryOutcome", + "bind": "/model/instance/PNC_Registration_EngKan/delivery_outcome", + "source": "mother.deliveryOutcome", + "value": "live_birth" + }, + { + "name": "parity", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_parity", + "source": "mother.eligible_couple.parity", + "value": "0" + }, + { + "name": "parity", + "bind": "/model/instance/PNC_Registration_EngKan/parity", + "source": "mother.eligible_couple.parity", + "value": "1" + }, + { + "name": "numberOfLiveBirths", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_num_livebirths", + "source": "mother.eligible_couple.numberOfLiveBirths", + "value": "0" + }, + { + "name": "numberOfLiveBirths", + "bind": "/model/instance/PNC_Registration_EngKan/num_livebirths", + "source": "mother.eligible_couple.numberOfLiveBirths", + "value": "1" + }, + { + "name": "numberOfStillBirths", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_num_stillbirths", + "source": "mother.eligible_couple.numberOfStillBirths", + "value": "0" + }, + { + "name": "numberOfStillBirths", + "bind": "/model/instance/PNC_Registration_EngKan/num_stillbirths", + "source": "mother.eligible_couple.numberOfStillBirths" + }, + { + "name": "causeOfStillBirth", + "bind": "/model/instance/PNC_Registration_EngKan/still_birth_group/cause_of_still_birth", + "source": "mother.causeOfStillBirth" + }, + { + "name": "didWomanSurvive", + "bind": "/model/instance/PNC_Registration_EngKan/still_birth_group/woman_survived", + "source": "mother.didWomanSurvive" + }, + { + "name": "didMotherSurvive", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/mother_survived", + "source": "mother.didMotherSurvive", + "value": "yes" + }, + { + "name": "didBreastfeedingStart", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/breastfeeding_postbirth", + "source": "mother.didBreastfeedingStart", + "value": "yes" + }, + { + "name": "maternalDeathCause", + "bind": "/model/instance/PNC_Registration_EngKan/maternal_death_group/maternal_death_cause", + "source": "mother.maternalDeathCause" + }, + { + "name": "otherMaternalDeathCause", + "bind": "/model/instance/PNC_Registration_EngKan/maternal_death_group/other_maternal_death_cause", + "source": "mother.otherMaternalDeathCause" + }, + { + "name": "isRHNegative", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/case_w_rh_negative", + "source": "mother.isRHNegative" + }, + { + "name": "isRHInjectionGiven", + "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/rh_injection_given", + "source": "mother.isRHInjectionGiven" + }, + { + "name": "hadDeliveryComplications", + "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/had_delivery_complications", + "source": "mother.hadDeliveryComplications", + "value": "yes" + }, + { + "name": "deliveryComplications", + "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/complications", + "source": "mother.deliveryComplications", + "value": "hemorrhage placenta_previa" + }, + { + "name": "otherDeliveryComplications", + "bind": "/model/instance/PNC_Registration_EngKan/woman_survived_group/delivery_complications_other", + "source": "mother.otherDeliveryComplications" + }, + { + "name": "isHighRiskTillPNCClose", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_is_high_risk_till_pnc_close", + "source": "mother.isHighRiskTillPNCClose", + "value": "no" + }, + { + "name": "highRiskTillPNCCloseReason", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_is_high_risk_till_pnc_close_reason", + "source": "mother.highRiskTillPNCCloseReason" + }, + { + "name": "anemicStatus", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_anaemic_status", + "source": "mother.anemicStatus" + }, + { + "name": "pih", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_pih", + "source": "mother.pih" + }, + { + "name": "preEclampsia", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_pre_eclampsia", + "source": "mother.preEclampsia" + }, + { + "name": "jaundice", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_jaundice", + "source": "mother.jaundice" + }, + { + "name": "isHighRisk", + "bind": "/model/instance/PNC_Registration_EngKan/is_high_risk", + "source": "mother.isHighRisk", + "value": "yes" + }, + { + "name": "isBirthPlanningDone", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_birth_planning", + "source": "mother.isBirthPlanningDone" + }, + { + "name": "highRiskReason", + "bind": "/model/instance/PNC_Registration_EngKan/high_risk_reason", + "source": "mother.highRiskReason" + }, + { + "name": "submissionDate", + "bind": "/model/instance/PNC_Registration_EngKan/today", + "source": "mother.submissionDate", + "value": "2015-03-20" + }, + { + "name": "type", + "value": "PNC", + "source": "mother.type" + }, + { + "name": "numberOfLivingChildren", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_num_livingchildren", + "source": "mother.eligible_couple.numberOfLivingChildren", + "value": "0" + }, + { + "name": "numberOfLivingChildren", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/num_livingchildren", + "source": "mother.eligible_couple.numberOfLivingChildren", + "value": "3" + }, + { + "name": "numberOfChildrenBorn", + "bind": "/model/instance/PNC_Registration_EngKan/num_children_born", + "source": "mother.numberOfChildrenBorn", + "value": "3" + }, + { + "name": "numberOfFemaleChildrenBorn", + "bind": "/model/instance/PNC_Registration_EngKan/num_female_children_born", + "source": "mother.numberOfFemaleChildrenBorn", + "value": "1" + }, + { + "name": "numberOfMaleChildrenBorn", + "bind": "/model/instance/PNC_Registration_EngKan/num_male_children_born", + "source": "mother.numberOfMaleChildrenBorn", + "value": "2" + }, + { + "name": "numberOfLivingFemaleChild", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_numlivingchildren_female", + "source": "mother.eligible_couple.numberOfLivingChildrenFemale" + }, + { + "name": "numberOfLivingFemaleChild", + "bind": "/model/instance/PNC_Registration_EngKan/numlivingchildren_female", + "source": "mother.eligible_couple.numberOfLivingChildrenFemale", + "value": "NaN" + }, + { + "name": "numberOfLivingMaleChild", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/case_numlivingchildren_male", + "source": "mother.eligible_couple.numberOfLivingMaleChild" + }, + { + "name": "numberOfLivingMaleChild", + "bind": "/model/instance/PNC_Registration_EngKan/numlivingchildren_male", + "source": "mother.eligible_couple.numberOfLivingMaleChild", + "value": "NaN" + }, + { + "name": "youngestChildDOB", + "bind": "/model/instance/PNC_Registration_EngKan/youngestchild_date_of_birth", + "source": "mother.eligible_couple.youngestChildDOB", + "value": "2015-02-20" + }, + { + "name": "youngestChildAge", + "bind": "/model/instance/PNC_Registration_EngKan/youngestchild_age", + "source": "mother.eligible_couple.youngestChildAge", + "value": "0" } + ], + "sub_forms": [ + { + "name": "child_registration", + "bind_type": "child", + "default_bind_path": "/model/instance/PNC_Registration_EngKan/live_birth_group/child", + "fields": [ + { + "name": "id", + "shouldLoadValue": true, + "source": "child.id" + }, + { + "name": "gender", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/sex_child", + "source": "child.gender" + }, + { + "name": "birthdate", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/birthdate", + "source": "child.birthdate" + }, + { + "name": "weight", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/birthweight", + "source": "child.weight" + }, + { + "name": "bloodGroup", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/child_blood_group", + "source": "child.bloodGroup" + }, + { + "name": "immunizationsGiven", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/immunizations_atbirth", + "source": "child.immunizationsGiven" + }, + { + "name": "hepB", + "shouldLoadValue": true, + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/case_hepb", + "source": "child.hepB" + }, + { + "name": "isHepBProphylaxisProvided", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/hepb_prophylaxis_provided", + "source": "child.isHepBProphylaxisProvided" + }, + { + "name": "isChildHighRisk1", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/is_child_high_risk1", + "source": "child.isChildHighRisk1" + }, + { + "name": "childHighRiskReasons", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/child_high_risk_reasons", + "source": "child.childHighRiskReasons" + }, + { + "name": "isChildHighRisk", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/is_child_high_risk", + "source": "child.isChildHighRisk" + }, + { + "name": "lbw", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/lbw", + "source": "child.lbw" + }, + { + "name": "vlbw", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/vlbw", + "source": "child.vlbw" + }, + { + "name": "premature", + "bind": "/model/instance/PNC_Registration_EngKan/live_birth_group/child/premature", + "source": "child.premature" + } + ], + "instances": [ + { + "gender": "male", + "birthdate": "2015-03-05", + "weight": "2", + "bloodGroup": "a_negative", + "immunizationsGiven": "bcg", + "hepB": "", + "isHepBProphylaxisProvided": "", + "lbw": "Low_Birth_Weight", + "vlbw": "", + "premature": "", + "isChildHighRisk1": "yes", + "childHighRiskReasons": " Low_Birth_Weight ", + "isChildHighRisk": "yes", + "id": "e9a91c61-0d33-42d3-bf9b-560b4d08c74f" + }, + { + "gender": "male", + "birthdate": "2015-04-05", + "weight": "", + "bloodGroup": "a_negative", + "immunizationsGiven": "bcg", + "hepB": "", + "isHepBProphylaxisProvided": "", + "lbw": "", + "vlbw": "", + "premature": "", + "isChildHighRisk1": "no", + "childHighRiskReasons": "", + "isChildHighRisk": "yes", + "id": "c7305d21-0b90-4c15-a88f-b08338d3aed9" + }, + { + "gender": "female", + "birthdate": "2015-05-05", + "weight": "", + "bloodGroup": "a_negative", + "immunizationsGiven": "bcg", + "hepB": "", + "isHepBProphylaxisProvided": "", + "lbw": "", + "vlbw": "", + "premature": "", + "isChildHighRisk1": "no", + "childHighRiskReasons": "", + "isChildHighRisk": "no", + "id": "6c2d772b-7d6a-4a05-a83d-5168c183ef42" + } + ] + } + ] } + } } \ No newline at end of file diff --git a/src/test/resources/form/pnc_reg_form/model.xml b/src/test/resources/form/pnc_reg_form/model.xml index 21130a05e..bc31fa625 100644 --- a/src/test/resources/form/pnc_reg_form/model.xml +++ b/src/test/resources/form/pnc_reg_form/model.xml @@ -1,91 +1,92 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - \ No newline at end of file + + \ No newline at end of file diff --git a/src/test/resources/form/vaccine_stock_position/form.json b/src/test/resources/form/vaccine_stock_position/form.json index 3405ad7da..4be5450e3 100644 --- a/src/test/resources/form/vaccine_stock_position/form.json +++ b/src/test/resources/form/vaccine_stock_position/form.json @@ -1 +1,972 @@ -{"name":"Vaccine_Stock_Position","title":"ویکسین اسٹاک پوزیشن - Vaccine Stock Position","sms_keyword":"vaccine_stock_position","default_language":"English","instance":{"encounter_type":"Vaccine stock position"},"version":"201604080502","id_string":"vaccine_stock_position","type":"survey","children":[{"type":"hidden","name":"provider_uc"},{"type":"hidden","name":"provider_town"},{"type":"hidden","name":"provider_city"},{"type":"hidden","name":"provider_province"},{"type":"hidden","name":"provider_id"},{"instance":{"openmrs_entity_id":"location_id","openmrs_entity":"encounter"},"type":"hidden","name":"provider_location_id"},{"type":"hidden","name":"provider_location_name"},{"type":"note","name":"provider_location_note","label":{"Urdu":"شہر: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}","English":"City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}","Roman Urdu":"Shehr: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}"}},{"instance":{"openmrs_entity_id":"163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"start","name":"start"},{"instance":{"openmrs_entity_id":"163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"end","name":"end"},{"instance":{"openmrs_entity_id":"163286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"today","name":"today"},{"instance":{"openmrs_entity_id":"163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"deviceid","name":"deviceid"},{"instance":{"openmrs_entity_id":"163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"subscriberid","name":"subscriberid"},{"instance":{"openmrs_entity_id":"163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"simserial","name":"simserial"},{"instance":{"openmrs_entity_id":"163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"phonenumber","name":"phonenumber"},{"bind":{"calculate":"format-date(${today}, '%e-%n-%Y')"},"type":"calculate","name":"date_formatted"},{"type":"note","name":"vaccinator_name","label":{"Urdu":"${provider_id}","English":"${provider_id}","Roman Urdu":"${provider_id}"}},{"type":"note","name":"center_name","label":{"Urdu":"سینٹر کا نام: {provider_location_name}$","English":"Center Name: ${provider_location_name}","Roman Urdu":"Center ka naam: ${provider_location_name}"}},{"instance":{"openmrs_entity_id":"encounter_date","openmrs_entity":"encounter"},"type":"date","name":"date","label":{"Urdu":"تاریخ","English":"Date","Roman Urdu":"Tareekh"}},{"name":"report","bind":{"required":"yes"},"label":{"Urdu":"رپورٹ کی قسم","English":"Report Type","Roman Urdu":"Report ki kism"},"instance":{"openmrs_entity_id":"163331AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"160862AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"daily","label":{"Urdu":"روزانہ کی رپورٹ","Roman Urdu":"Rozaana ki report","English":"Daily"}},{"instance":{"openmrs_code":"1098AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"monthly","label":{"Urdu":"ماہانہ رپورٹ","Roman Urdu":"Mahaana report","English":"Monthly"}}]},{"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"type":"integer","instance":{"openmrs_entity_id":"163174AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"Target_assigned_for_vaccination_at_each_month","label":{"Urdu":"ویکسین لگانے کا ماہانہ ہدف","English":"Monthly Target","Roman Urdu":"Vaccine laganay ka mahaana hadf"}},{"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"type":"integer","instance":{"openmrs_entity_id":"163175AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"Target_assigned_for_vaccination_for_the_year","label":{"Urdu":"ویکسین لگانے کا سالانہ ہدف","English":"Yearly Target","Roman Urdu":"Vaccine laganay ka salaana hadf"}},{"name":"bcg_balance_in_hand","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موجودہ بی سی جی کی تعداد","Roman Urdu":"Maujooda BCG ki taadaad","English":"BCG balance in hand"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"bcg_received","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موصول ہونے والی بی سی جی کی تعداد","Roman Urdu":"Mausool honay wali BCG ki taadaad","English":"BCG received"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"bcg_wasted","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'daily')","required":"yes"},"label":{"Urdu":"ضائع ہونے والی بی سی جی کی تعداد","Roman Urdu":"Zaya honay wali BCG ki taadaad","English":"BCG wasted"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"opv_balance_in_hand","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موجودہ او پی وی کی تعداد","Roman Urdu":"Maujooda OPV ki taadaad","English":"OPV balance in hand"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"opv_received","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موصول ہونے والی او پی وی کی تعداد","Roman Urdu":"Mausool honay wali OPV ki taadaad","English":"OPV received"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"opv_wasted","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'daily')","required":"yes"},"label":{"Urdu":"ضائع ہونے والی او پی وی کی تعداد","Roman Urdu":"Zaya honay wali OPV ki taadaad","English":"OPV wasted"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"ipv_balance_in_hand","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موجودہ آئی پی وی کی تعداد","Roman Urdu":"Maujooda IPV ki taadaad","English":"IPV balance in hand"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1422AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"ipv_received","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موصول ہونے والی آئی پی وی کی تعداد","Roman Urdu":"Mausool honay wali IPV ki taadaad","English":"IPV received"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1422AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"ipv_wasted","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'daily')","required":"yes"},"label":{"Urdu":"ضائع ہونے والی آئی پی وی کی تعداد","Roman Urdu":"Zaya honay wali IPV ki taadaad","English":"IPV wasted"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1422AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"pcv_balance_in_hand","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موجودہ پی سی وی کی تعداد","Roman Urdu":"Maujooda PCV ki taadaad","English":"PCV balance in hand"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"pcv_received","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موصول ہونے والی پی سی وی کی تعداد","Roman Urdu":"Mausool honay wali PCV ki taadaad","English":"PCV received"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"pcv_wasted","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'daily')","required":"yes"},"label":{"Urdu":"ضائع ہونے والی پی سی وی کی تعداد","Roman Urdu":"Zaya honay wali PCV ki taadaad","English":"PCV wasted"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"penta_balance_in_hand","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موجودہ پینٹاویلنٹ کی تعداد","Roman Urdu":"Maujooda Pentavalent ki taadaad","English":"Penta balance in hand"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"penta_received","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موصول ہونے والی پینٹاویلنٹ کی تعداد","Roman Urdu":"Mausool honay wali Pentavalent ki taadaad","English":"Penta received"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"penta_wasted","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'daily')","required":"yes"},"label":{"Urdu":"ضائع ہونے والی پینٹاویلنٹ کی تعداد","Roman Urdu":"Zaya honay wali Pentavalent ki taadaad","English":"Penta wasted"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"measles_balance_in_hand","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موجودہ خسرے کے ٹیکوں کی تعداد","Roman Urdu":"Maujooda khasray ke teekon ki taadaad","English":"Measles balance in hand"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"measles_received","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موصول ہونے والے خسرے کے ٹیکوں کی تعداد","Roman Urdu":"Mausool honay walay khasray ke teekay ki taadaad","English":"Measles received"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"measles_wasted","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'daily')","required":"yes"},"label":{"Urdu":"ضائع ہونے والے خسرے کے ٹیکوں کی تعداد","Roman Urdu":"Zaya honay walay khasray ke teekay ki taadaad","English":"Measles wasted"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"tt_balance_in_hand","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موجودہ ٹی ٹی کی تعداد","Roman Urdu":"Maujooda TT ki taadaad","English":"TT balance in hand"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"tt_received","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موصول ہونے والی ٹی ٹی کی تعداد","Roman Urdu":"Mausool honay wali TT ki taadaad","English":"TT received"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"tt_wasted","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'daily')","required":"yes"},"label":{"Urdu":"ضائع ہونے والی ٹی ٹی کی تعداد","Roman Urdu":"Zaya honay wali TT ki taadaad","English":"TT wasted"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"dilutants_balance_in_hand","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"انجیکشن کے لئے موجودہ جراثیم سے پاک پانی کی شیشیوں کی تعداد","Roman Urdu":"Injection ke liye maujooda jaraseem se paak paani ki sheeshion ki taadaad","English":"Dilutants balance in hand"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"163287AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"dilutants_received","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"انجیکشن کے لئے موصول ہونے والا جراثیم سے پاک پانی کی شیشیوں کی تعداد","Roman Urdu":"Injection ke liye mausool honay wala jaraseem se paak paani ki sheeshion ki taadaad","English":"Dilutants received"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"163287AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"dilutants_wasted","hint":{"Urdu":"شیشیوں کی تعداد","Roman Urdu":"Sheeshion ki taadaad","English":"Number of vials"},"bind":{"relevant":"selected(${report}, 'daily')","required":"yes"},"label":{"Urdu":"انجیکشن کے لئے ضائع ہونے والا جراثیم سے پاک پانی کی شیشیوں کی تعداد","Roman Urdu":"Injection ke liye zaya honay wala jaraseem se paak paani ki sheeshion ki taadaad","English":"Dilutants wasted"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"163287AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"syringes_balance_in_hand","hint":{"Urdu":"سرنج کی تعداد","Roman Urdu":"Syringe ki taadaad","English":"Number of syringes"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موجودہ سرنج کی تعداد","Roman Urdu":"Maujooda siranj ki taadaad","English":"Syringes balance in hand"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162377AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"syringes_received","hint":{"Urdu":"سرنج کی تعداد","Roman Urdu":"Syringe ki taadaad","English":"Number of syringes"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موصول ہونے والی سرنج کی تعداد","Roman Urdu":"Mausool honay wali siranj ki taadaad","English":"Syringes received"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162377AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"syringes_wasted","hint":{"Urdu":"سرنج کی تعداد","Roman Urdu":"Syringe ki taadaad","English":"Number of syringes"},"bind":{"relevant":"selected(${report}, 'daily')","required":"yes"},"label":{"Urdu":"ضائع ہونے والی سرنج کی تعداد","Roman Urdu":"Zaya honay wali siranj taadaad","English":"Syringes wasted"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"162377AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"safety_boxes_balance_in_hand","hint":{"Urdu":"کنٹینر کی تعداد","Roman Urdu":"Container ki taadaad","English":"Number of containers"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موجودہ کنٹینر کی تعداد [جو تیز اوزار کو ضائع کرنے کے لیے استعمال ہوتے ہیں]","Roman Urdu":"Maujooda container ki taadaad [jo taiz auzaar ko zaya karne ke liye istamaal hotay hain]","English":"Sharp disposal container balance in hand"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"163285AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"safety_boxes_received","hint":{"Urdu":"کنٹینر کی تعداد","Roman Urdu":"Container ki taadaad","English":"Number of containers"},"bind":{"relevant":"selected(${report}, 'monthly')","required":"yes"},"label":{"Urdu":"موصول ہونے والے کنٹینر کی تعداد [جو تیز اوزار کو ضائع کرنے کے لیے استعمال ہوتے ہیں]","Roman Urdu":"Mausool honay walay container ki taadaad [jo taiz auzaar ko zaya karne ke liye istamaal hotay hain]","English":"Sharp disposal container received"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"163285AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"name":"safety_boxes_wasted","hint":{"Urdu":"کنٹینر کی تعداد","Roman Urdu":"Container ki taadaad","English":"Number of containers"},"bind":{"relevant":"selected(${report}, 'daily')","required":"yes"},"label":{"Urdu":"ضائع ہونے والے کنٹینر کی تعداد [جو تیز اوزار کو ضائع کرنے کے لیے استعمال ہوتے ہیں]","Roman Urdu":"Zaya honay walay container ki taadaad [jo taiz auzaar ko zaya karne ke liye istamaal hotay hain]","English":"Sharp disposal container wasted"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"163285AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"integer"},{"bind":{"jr:constraintMsg":{"Urdu":"یہ تعداد موصول ہونے والی کل تعداد سے کم یا برابر ہونی چاہئیے","Roman Urdu":"Ye taadaad mausool honay wali kul taadaad se kam ya baraber honi chahiye","English":"This quantity should be less than or equal to the total quantity received"},"calculate":"${bcg_wasted}+${opv_wasted}+${ipv_wasted}+${pcv_wasted}+${penta_wasted}+${measles_wasted}+${tt_wasted}+${dilutants_wasted}+${syringes_wasted}+${safety_boxes_wasted}","constraint":".<=${total_received}"},"type":"calculate","name":"total_wasted","label":{"Urdu":"ضائع ہونے والی اشیاء کی مکمل تعداد","Roman Urdu":"Zaya honay wali ashia ki mukammal taadaad","English":"Total wasted"}},{"bind":{"calculate":"${bcg_received}+${opv_received}+${ipv_received}+${pcv_received}+${penta_received}+${measles_received}+${tt_received}+${dilutants_received}+${syringes_received}+${safety_boxes_received}"},"type":"calculate","name":"total_received","label":{"Urdu":"موصول ہونے والی اشیاء کی مکمل تعداد","Roman Urdu":"Mausool honay wali ashia ki mukammal taadaad","English":"Total received"}},{"bind":{"calculate":"${bcg_balance_in_hand}+${opv_balance_in_hand}+${ipv_balance_in_hand}+${pcv_balance_in_hand}+${penta_balance_in_hand}+${measles_balance_in_hand}+${tt_balance_in_hand}+${dilutants_balance_in_hand}+${syringes_balance_in_hand}+${safety_boxes_balance_in_hand}"},"type":"calculate","name":"total_balanceInHand","label":{"Urdu":"موجودہ اشیاء کی مکمل تعداد","Roman Urdu":"Maujooda ashia ki mukammal taadaad","English":"Total balance in hand"}},{"control":{"bodyless":true},"type":"group","children":[{"bind":{"readonly":"true()","calculate":"concat('uuid:', uuid())"},"type":"calculate","name":"instanceID"}],"name":"meta"}]} \ No newline at end of file +{ + "name": "Vaccine_Stock_Position", + "title": "ویکسین اسٹاک پوزیشن - Vaccine Stock Position", + "sms_keyword": "vaccine_stock_position", + "default_language": "English", + "instance": { + "encounter_type": "Vaccine stock position" + }, + "version": "201604080502", + "id_string": "vaccine_stock_position", + "type": "survey", + "children": [ + { + "type": "hidden", + "name": "provider_uc" + }, + { + "type": "hidden", + "name": "provider_town" + }, + { + "type": "hidden", + "name": "provider_city" + }, + { + "type": "hidden", + "name": "provider_province" + }, + { + "type": "hidden", + "name": "provider_id" + }, + { + "instance": { + "openmrs_entity_id": "location_id", + "openmrs_entity": "encounter" + }, + "type": "hidden", + "name": "provider_location_id" + }, + { + "type": "hidden", + "name": "provider_location_name" + }, + { + "type": "note", + "name": "provider_location_note", + "label": { + "Urdu": "شہر: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}", + "English": "City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}", + "Roman Urdu": "Shehr: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}" + } + }, + { + "instance": { + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "start", + "name": "start" + }, + { + "instance": { + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "end", + "name": "end" + }, + { + "instance": { + "openmrs_entity_id": "163286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "today", + "name": "today" + }, + { + "instance": { + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "deviceid", + "name": "deviceid" + }, + { + "instance": { + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "subscriberid", + "name": "subscriberid" + }, + { + "instance": { + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "simserial", + "name": "simserial" + }, + { + "instance": { + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "phonenumber", + "name": "phonenumber" + }, + { + "bind": { + "calculate": "format-date(${today}, '%e-%n-%Y')" + }, + "type": "calculate", + "name": "date_formatted" + }, + { + "type": "note", + "name": "vaccinator_name", + "label": { + "Urdu": "${provider_id}", + "English": "${provider_id}", + "Roman Urdu": "${provider_id}" + } + }, + { + "type": "note", + "name": "center_name", + "label": { + "Urdu": "سینٹر کا نام: {provider_location_name}$", + "English": "Center Name: ${provider_location_name}", + "Roman Urdu": "Center ka naam: ${provider_location_name}" + } + }, + { + "instance": { + "openmrs_entity_id": "encounter_date", + "openmrs_entity": "encounter" + }, + "type": "date", + "name": "date", + "label": { + "Urdu": "تاریخ", + "English": "Date", + "Roman Urdu": "Tareekh" + } + }, + { + "name": "report", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "رپورٹ کی قسم", + "English": "Report Type", + "Roman Urdu": "Report ki kism" + }, + "instance": { + "openmrs_entity_id": "163331AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "160862AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "daily", + "label": { + "Urdu": "روزانہ کی رپورٹ", + "Roman Urdu": "Rozaana ki report", + "English": "Daily" + } + }, + { + "instance": { + "openmrs_code": "1098AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "monthly", + "label": { + "Urdu": "ماہانہ رپورٹ", + "Roman Urdu": "Mahaana report", + "English": "Monthly" + } + } + ] + }, + { + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "type": "integer", + "instance": { + "openmrs_entity_id": "163174AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "Target_assigned_for_vaccination_at_each_month", + "label": { + "Urdu": "ویکسین لگانے کا ماہانہ ہدف", + "English": "Monthly Target", + "Roman Urdu": "Vaccine laganay ka mahaana hadf" + } + }, + { + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "type": "integer", + "instance": { + "openmrs_entity_id": "163175AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "Target_assigned_for_vaccination_for_the_year", + "label": { + "Urdu": "ویکسین لگانے کا سالانہ ہدف", + "English": "Yearly Target", + "Roman Urdu": "Vaccine laganay ka salaana hadf" + } + }, + { + "name": "bcg_balance_in_hand", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موجودہ بی سی جی کی تعداد", + "Roman Urdu": "Maujooda BCG ki taadaad", + "English": "BCG balance in hand" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "bcg_received", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موصول ہونے والی بی سی جی کی تعداد", + "Roman Urdu": "Mausool honay wali BCG ki taadaad", + "English": "BCG received" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "bcg_wasted", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'daily')", + "required": "yes" + }, + "label": { + "Urdu": "ضائع ہونے والی بی سی جی کی تعداد", + "Roman Urdu": "Zaya honay wali BCG ki taadaad", + "English": "BCG wasted" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "opv_balance_in_hand", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موجودہ او پی وی کی تعداد", + "Roman Urdu": "Maujooda OPV ki taadaad", + "English": "OPV balance in hand" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "opv_received", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موصول ہونے والی او پی وی کی تعداد", + "Roman Urdu": "Mausool honay wali OPV ki taadaad", + "English": "OPV received" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "opv_wasted", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'daily')", + "required": "yes" + }, + "label": { + "Urdu": "ضائع ہونے والی او پی وی کی تعداد", + "Roman Urdu": "Zaya honay wali OPV ki taadaad", + "English": "OPV wasted" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "ipv_balance_in_hand", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موجودہ آئی پی وی کی تعداد", + "Roman Urdu": "Maujooda IPV ki taadaad", + "English": "IPV balance in hand" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1422AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "ipv_received", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موصول ہونے والی آئی پی وی کی تعداد", + "Roman Urdu": "Mausool honay wali IPV ki taadaad", + "English": "IPV received" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1422AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "ipv_wasted", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'daily')", + "required": "yes" + }, + "label": { + "Urdu": "ضائع ہونے والی آئی پی وی کی تعداد", + "Roman Urdu": "Zaya honay wali IPV ki taadaad", + "English": "IPV wasted" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1422AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "pcv_balance_in_hand", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موجودہ پی سی وی کی تعداد", + "Roman Urdu": "Maujooda PCV ki taadaad", + "English": "PCV balance in hand" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "pcv_received", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موصول ہونے والی پی سی وی کی تعداد", + "Roman Urdu": "Mausool honay wali PCV ki taadaad", + "English": "PCV received" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "pcv_wasted", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'daily')", + "required": "yes" + }, + "label": { + "Urdu": "ضائع ہونے والی پی سی وی کی تعداد", + "Roman Urdu": "Zaya honay wali PCV ki taadaad", + "English": "PCV wasted" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162342AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "penta_balance_in_hand", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موجودہ پینٹاویلنٹ کی تعداد", + "Roman Urdu": "Maujooda Pentavalent ki taadaad", + "English": "Penta balance in hand" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "penta_received", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موصول ہونے والی پینٹاویلنٹ کی تعداد", + "Roman Urdu": "Mausool honay wali Pentavalent ki taadaad", + "English": "Penta received" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "penta_wasted", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'daily')", + "required": "yes" + }, + "label": { + "Urdu": "ضائع ہونے والی پینٹاویلنٹ کی تعداد", + "Roman Urdu": "Zaya honay wali Pentavalent ki taadaad", + "English": "Penta wasted" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162339AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "measles_balance_in_hand", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موجودہ خسرے کے ٹیکوں کی تعداد", + "Roman Urdu": "Maujooda khasray ke teekon ki taadaad", + "English": "Measles balance in hand" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "measles_received", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موصول ہونے والے خسرے کے ٹیکوں کی تعداد", + "Roman Urdu": "Mausool honay walay khasray ke teekay ki taadaad", + "English": "Measles received" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "measles_wasted", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'daily')", + "required": "yes" + }, + "label": { + "Urdu": "ضائع ہونے والے خسرے کے ٹیکوں کی تعداد", + "Roman Urdu": "Zaya honay walay khasray ke teekay ki taadaad", + "English": "Measles wasted" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "79409AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "tt_balance_in_hand", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موجودہ ٹی ٹی کی تعداد", + "Roman Urdu": "Maujooda TT ki taadaad", + "English": "TT balance in hand" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "tt_received", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موصول ہونے والی ٹی ٹی کی تعداد", + "Roman Urdu": "Mausool honay wali TT ki taadaad", + "English": "TT received" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "tt_wasted", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'daily')", + "required": "yes" + }, + "label": { + "Urdu": "ضائع ہونے والی ٹی ٹی کی تعداد", + "Roman Urdu": "Zaya honay wali TT ki taadaad", + "English": "TT wasted" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "dilutants_balance_in_hand", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "انجیکشن کے لئے موجودہ جراثیم سے پاک پانی کی شیشیوں کی تعداد", + "Roman Urdu": "Injection ke liye maujooda jaraseem se paak paani ki sheeshion ki taadaad", + "English": "Dilutants balance in hand" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "163287AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "dilutants_received", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "انجیکشن کے لئے موصول ہونے والا جراثیم سے پاک پانی کی شیشیوں کی تعداد", + "Roman Urdu": "Injection ke liye mausool honay wala jaraseem se paak paani ki sheeshion ki taadaad", + "English": "Dilutants received" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "163287AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "dilutants_wasted", + "hint": { + "Urdu": "شیشیوں کی تعداد", + "Roman Urdu": "Sheeshion ki taadaad", + "English": "Number of vials" + }, + "bind": { + "relevant": "selected(${report}, 'daily')", + "required": "yes" + }, + "label": { + "Urdu": "انجیکشن کے لئے ضائع ہونے والا جراثیم سے پاک پانی کی شیشیوں کی تعداد", + "Roman Urdu": "Injection ke liye zaya honay wala jaraseem se paak paani ki sheeshion ki taadaad", + "English": "Dilutants wasted" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "163287AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "syringes_balance_in_hand", + "hint": { + "Urdu": "سرنج کی تعداد", + "Roman Urdu": "Syringe ki taadaad", + "English": "Number of syringes" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موجودہ سرنج کی تعداد", + "Roman Urdu": "Maujooda siranj ki taadaad", + "English": "Syringes balance in hand" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162377AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "syringes_received", + "hint": { + "Urdu": "سرنج کی تعداد", + "Roman Urdu": "Syringe ki taadaad", + "English": "Number of syringes" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موصول ہونے والی سرنج کی تعداد", + "Roman Urdu": "Mausool honay wali siranj ki taadaad", + "English": "Syringes received" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162377AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "syringes_wasted", + "hint": { + "Urdu": "سرنج کی تعداد", + "Roman Urdu": "Syringe ki taadaad", + "English": "Number of syringes" + }, + "bind": { + "relevant": "selected(${report}, 'daily')", + "required": "yes" + }, + "label": { + "Urdu": "ضائع ہونے والی سرنج کی تعداد", + "Roman Urdu": "Zaya honay wali siranj taadaad", + "English": "Syringes wasted" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "162377AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "safety_boxes_balance_in_hand", + "hint": { + "Urdu": "کنٹینر کی تعداد", + "Roman Urdu": "Container ki taadaad", + "English": "Number of containers" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موجودہ کنٹینر کی تعداد [جو تیز اوزار کو ضائع کرنے کے لیے استعمال ہوتے ہیں]", + "Roman Urdu": "Maujooda container ki taadaad [jo taiz auzaar ko zaya karne ke liye istamaal hotay hain]", + "English": "Sharp disposal container balance in hand" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163173AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "163285AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "safety_boxes_received", + "hint": { + "Urdu": "کنٹینر کی تعداد", + "Roman Urdu": "Container ki taadaad", + "English": "Number of containers" + }, + "bind": { + "relevant": "selected(${report}, 'monthly')", + "required": "yes" + }, + "label": { + "Urdu": "موصول ہونے والے کنٹینر کی تعداد [جو تیز اوزار کو ضائع کرنے کے لیے استعمال ہوتے ہیں]", + "Roman Urdu": "Mausool honay walay container ki taadaad [jo taiz auzaar ko zaya karne ke liye istamaal hotay hain]", + "English": "Sharp disposal container received" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "163285AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "name": "safety_boxes_wasted", + "hint": { + "Urdu": "کنٹینر کی تعداد", + "Roman Urdu": "Container ki taadaad", + "English": "Number of containers" + }, + "bind": { + "relevant": "selected(${report}, 'daily')", + "required": "yes" + }, + "label": { + "Urdu": "ضائع ہونے والے کنٹینر کی تعداد [جو تیز اوزار کو ضائع کرنے کے لیے استعمال ہوتے ہیں]", + "Roman Urdu": "Zaya honay walay container ki taadaad [jo taiz auzaar ko zaya karne ke liye istamaal hotay hain]", + "English": "Sharp disposal container wasted" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "163172AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "163285AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "integer" + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "یہ تعداد موصول ہونے والی کل تعداد سے کم یا برابر ہونی چاہئیے", + "Roman Urdu": "Ye taadaad mausool honay wali kul taadaad se kam ya baraber honi chahiye", + "English": "This quantity should be less than or equal to the total quantity received" + }, + "calculate": "${bcg_wasted}+${opv_wasted}+${ipv_wasted}+${pcv_wasted}+${penta_wasted}+${measles_wasted}+${tt_wasted}+${dilutants_wasted}+${syringes_wasted}+${safety_boxes_wasted}", + "constraint": ".<=${total_received}" + }, + "type": "calculate", + "name": "total_wasted", + "label": { + "Urdu": "ضائع ہونے والی اشیاء کی مکمل تعداد", + "Roman Urdu": "Zaya honay wali ashia ki mukammal taadaad", + "English": "Total wasted" + } + }, + { + "bind": { + "calculate": "${bcg_received}+${opv_received}+${ipv_received}+${pcv_received}+${penta_received}+${measles_received}+${tt_received}+${dilutants_received}+${syringes_received}+${safety_boxes_received}" + }, + "type": "calculate", + "name": "total_received", + "label": { + "Urdu": "موصول ہونے والی اشیاء کی مکمل تعداد", + "Roman Urdu": "Mausool honay wali ashia ki mukammal taadaad", + "English": "Total received" + } + }, + { + "bind": { + "calculate": "${bcg_balance_in_hand}+${opv_balance_in_hand}+${ipv_balance_in_hand}+${pcv_balance_in_hand}+${penta_balance_in_hand}+${measles_balance_in_hand}+${tt_balance_in_hand}+${dilutants_balance_in_hand}+${syringes_balance_in_hand}+${safety_boxes_balance_in_hand}" + }, + "type": "calculate", + "name": "total_balanceInHand", + "label": { + "Urdu": "موجودہ اشیاء کی مکمل تعداد", + "Roman Urdu": "Maujooda ashia ki mukammal taadaad", + "English": "Total balance in hand" + } + }, + { + "control": { + "bodyless": true + }, + "type": "group", + "children": [ + { + "bind": { + "readonly": "true()", + "calculate": "concat('uuid:', uuid())" + }, + "type": "calculate", + "name": "instanceID" + } + ], + "name": "meta" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/form/vaccine_stock_position/form.xml b/src/test/resources/form/vaccine_stock_position/form.xml index 713d5efd9..36eaa081b 100644 --- a/src/test/resources/form/vaccine_stock_position/form.xml +++ b/src/test/resources/form/vaccine_stock_position/form.xml @@ -1,381 +1,876 @@ -
+ + - +

ویکسین اسٹاک پوزیشن - Vaccine Stock Position

-
- - رپورٹ کی قسم - Report Type - Report ki kism - * -
- - -
+ + + + + + + + +
+
+ + رپورٹ کی + قسم + + + Report Type + + + Report ki kism + + * + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
diff --git a/src/test/resources/form/vaccine_stock_position/form_definition.json b/src/test/resources/form/vaccine_stock_position/form_definition.json index f6b50a149..03dbefb1e 100644 --- a/src/test/resources/form/vaccine_stock_position/form_definition.json +++ b/src/test/resources/form/vaccine_stock_position/form_definition.json @@ -1,186 +1,244 @@ { - "form_data_definition_version" : "1", - "form" : { - "bind_type" : "stock", - "default_bind_path" : "/model/instance/Vaccine_Stock_Position/", - "fields" : [ { - "name" : "id", - "shouldLoadValue" : true - }, { - "name" : "provider_uc", - "bind" : "/model/instance/Vaccine_Stock_Position/provider_uc", - "shouldLoadValue" : true - }, { - "name" : "provider_town", - "bind" : "/model/instance/Vaccine_Stock_Position/provider_town", - "shouldLoadValue" : true - }, { - "name" : "provider_city", - "bind" : "/model/instance/Vaccine_Stock_Position/provider_city", - "shouldLoadValue" : true - }, { - "name" : "provider_province", - "bind" : "/model/instance/Vaccine_Stock_Position/provider_province", - "shouldLoadValue" : true - }, { - "name" : "provider_id", - "bind" : "/model/instance/Vaccine_Stock_Position/provider_id", - "shouldLoadValue" : true - }, { - "name" : "provider_location_id", - "bind" : "/model/instance/Vaccine_Stock_Position/provider_location_id", - "shouldLoadValue" : true - }, { - "name" : "provider_location_name", - "bind" : "/model/instance/Vaccine_Stock_Position/provider_location_name", - "shouldLoadValue" : true - }, { - "name" : "provider_location_note", - "bind" : "/model/instance/Vaccine_Stock_Position/provider_location_note" - }, { - "name" : "start", - "bind" : "/model/instance/Vaccine_Stock_Position/start" - }, { - "name" : "end", - "bind" : "/model/instance/Vaccine_Stock_Position/end" - }, { - "name" : "today", - "bind" : "/model/instance/Vaccine_Stock_Position/today" - }, { - "name" : "deviceid", - "bind" : "/model/instance/Vaccine_Stock_Position/deviceid" - }, { - "name" : "subscriberid", - "bind" : "/model/instance/Vaccine_Stock_Position/subscriberid" - }, { - "name" : "simserial", - "bind" : "/model/instance/Vaccine_Stock_Position/simserial" - }, { - "name" : "phonenumber", - "bind" : "/model/instance/Vaccine_Stock_Position/phonenumber" - }, { - "name" : "date_formatted", - "bind" : "/model/instance/Vaccine_Stock_Position/date_formatted" - }, { - "name" : "vaccinator_name", - "bind" : "/model/instance/Vaccine_Stock_Position/vaccinator_name" - }, { - "name" : "center_name", - "bind" : "/model/instance/Vaccine_Stock_Position/center_name" - }, { - "name" : "date", - "bind" : "/model/instance/Vaccine_Stock_Position/date" - }, { - "name" : "report", - "bind" : "/model/instance/Vaccine_Stock_Position/report" - }, { - "name" : "Target_assigned_for_vaccination_at_each_month", - "bind" : "/model/instance/Vaccine_Stock_Position/Target_assigned_for_vaccination_at_each_month" - }, { - "name" : "Target_assigned_for_vaccination_for_the_year", - "bind" : "/model/instance/Vaccine_Stock_Position/Target_assigned_for_vaccination_for_the_year" - }, { - "name" : "bcg_balance_in_hand", - "bind" : "/model/instance/Vaccine_Stock_Position/bcg_balance_in_hand" - }, { - "name" : "bcg_received", - "bind" : "/model/instance/Vaccine_Stock_Position/bcg_received" - }, { - "name" : "bcg_wasted", - "bind" : "/model/instance/Vaccine_Stock_Position/bcg_wasted" - }, { - "name" : "opv_balance_in_hand", - "bind" : "/model/instance/Vaccine_Stock_Position/opv_balance_in_hand" - }, { - "name" : "opv_received", - "bind" : "/model/instance/Vaccine_Stock_Position/opv_received" - }, { - "name" : "opv_wasted", - "bind" : "/model/instance/Vaccine_Stock_Position/opv_wasted" - }, { - "name" : "ipv_balance_in_hand", - "bind" : "/model/instance/Vaccine_Stock_Position/ipv_balance_in_hand" - }, { - "name" : "ipv_received", - "bind" : "/model/instance/Vaccine_Stock_Position/ipv_received" - }, { - "name" : "ipv_wasted", - "bind" : "/model/instance/Vaccine_Stock_Position/ipv_wasted" - }, { - "name" : "pcv_balance_in_hand", - "bind" : "/model/instance/Vaccine_Stock_Position/pcv_balance_in_hand" - }, { - "name" : "pcv_received", - "bind" : "/model/instance/Vaccine_Stock_Position/pcv_received" - }, { - "name" : "pcv_wasted", - "bind" : "/model/instance/Vaccine_Stock_Position/pcv_wasted" - }, { - "name" : "penta_balance_in_hand", - "bind" : "/model/instance/Vaccine_Stock_Position/penta_balance_in_hand" - }, { - "name" : "penta_received", - "bind" : "/model/instance/Vaccine_Stock_Position/penta_received" - }, { - "name" : "penta_wasted", - "bind" : "/model/instance/Vaccine_Stock_Position/penta_wasted" - }, { - "name" : "measles_balance_in_hand", - "bind" : "/model/instance/Vaccine_Stock_Position/measles_balance_in_hand" - }, { - "name" : "measles_received", - "bind" : "/model/instance/Vaccine_Stock_Position/measles_received" - }, { - "name" : "measles_wasted", - "bind" : "/model/instance/Vaccine_Stock_Position/measles_wasted" - }, { - "name" : "tt_balance_in_hand", - "bind" : "/model/instance/Vaccine_Stock_Position/tt_balance_in_hand" - }, { - "name" : "tt_received", - "bind" : "/model/instance/Vaccine_Stock_Position/tt_received" - }, { - "name" : "tt_wasted", - "bind" : "/model/instance/Vaccine_Stock_Position/tt_wasted" - }, { - "name" : "dilutants_balance_in_hand", - "bind" : "/model/instance/Vaccine_Stock_Position/dilutants_balance_in_hand" - }, { - "name" : "dilutants_received", - "bind" : "/model/instance/Vaccine_Stock_Position/dilutants_received" - }, { - "name" : "dilutants_wasted", - "bind" : "/model/instance/Vaccine_Stock_Position/dilutants_wasted" - }, { - "name" : "syringes_balance_in_hand", - "bind" : "/model/instance/Vaccine_Stock_Position/syringes_balance_in_hand" - }, { - "name" : "syringes_received", - "bind" : "/model/instance/Vaccine_Stock_Position/syringes_received" - }, { - "name" : "syringes_wasted", - "bind" : "/model/instance/Vaccine_Stock_Position/syringes_wasted" - }, { - "name" : "safety_boxes_balance_in_hand", - "bind" : "/model/instance/Vaccine_Stock_Position/safety_boxes_balance_in_hand" - }, { - "name" : "safety_boxes_received", - "bind" : "/model/instance/Vaccine_Stock_Position/safety_boxes_received" - }, { - "name" : "safety_boxes_wasted", - "bind" : "/model/instance/Vaccine_Stock_Position/safety_boxes_wasted" - }, { - "name" : "total_wasted", - "bind" : "/model/instance/Vaccine_Stock_Position/total_wasted" - }, { - "name" : "total_received", - "bind" : "/model/instance/Vaccine_Stock_Position/total_received" - }, { - "name" : "total_balanceInHand", - "bind" : "/model/instance/Vaccine_Stock_Position/total_balanceInHand" - }, { - "name" : "instanceID", - "bind" : "/model/instance/Vaccine_Stock_Position/meta/instanceID" - } ] + "form_data_definition_version": "1", + "form": { + "bind_type": "stock", + "default_bind_path": "/model/instance/Vaccine_Stock_Position/", + "fields": [ + { + "name": "id", + "shouldLoadValue": true + }, + { + "name": "provider_uc", + "bind": "/model/instance/Vaccine_Stock_Position/provider_uc", + "shouldLoadValue": true + }, + { + "name": "provider_town", + "bind": "/model/instance/Vaccine_Stock_Position/provider_town", + "shouldLoadValue": true + }, + { + "name": "provider_city", + "bind": "/model/instance/Vaccine_Stock_Position/provider_city", + "shouldLoadValue": true + }, + { + "name": "provider_province", + "bind": "/model/instance/Vaccine_Stock_Position/provider_province", + "shouldLoadValue": true + }, + { + "name": "provider_id", + "bind": "/model/instance/Vaccine_Stock_Position/provider_id", + "shouldLoadValue": true + }, + { + "name": "provider_location_id", + "bind": "/model/instance/Vaccine_Stock_Position/provider_location_id", + "shouldLoadValue": true + }, + { + "name": "provider_location_name", + "bind": "/model/instance/Vaccine_Stock_Position/provider_location_name", + "shouldLoadValue": true + }, + { + "name": "provider_location_note", + "bind": "/model/instance/Vaccine_Stock_Position/provider_location_note" + }, + { + "name": "start", + "bind": "/model/instance/Vaccine_Stock_Position/start" + }, + { + "name": "end", + "bind": "/model/instance/Vaccine_Stock_Position/end" + }, + { + "name": "today", + "bind": "/model/instance/Vaccine_Stock_Position/today" + }, + { + "name": "deviceid", + "bind": "/model/instance/Vaccine_Stock_Position/deviceid" + }, + { + "name": "subscriberid", + "bind": "/model/instance/Vaccine_Stock_Position/subscriberid" + }, + { + "name": "simserial", + "bind": "/model/instance/Vaccine_Stock_Position/simserial" + }, + { + "name": "phonenumber", + "bind": "/model/instance/Vaccine_Stock_Position/phonenumber" + }, + { + "name": "date_formatted", + "bind": "/model/instance/Vaccine_Stock_Position/date_formatted" + }, + { + "name": "vaccinator_name", + "bind": "/model/instance/Vaccine_Stock_Position/vaccinator_name" + }, + { + "name": "center_name", + "bind": "/model/instance/Vaccine_Stock_Position/center_name" + }, + { + "name": "date", + "bind": "/model/instance/Vaccine_Stock_Position/date" + }, + { + "name": "report", + "bind": "/model/instance/Vaccine_Stock_Position/report" + }, + { + "name": "Target_assigned_for_vaccination_at_each_month", + "bind": "/model/instance/Vaccine_Stock_Position/Target_assigned_for_vaccination_at_each_month" + }, + { + "name": "Target_assigned_for_vaccination_for_the_year", + "bind": "/model/instance/Vaccine_Stock_Position/Target_assigned_for_vaccination_for_the_year" + }, + { + "name": "bcg_balance_in_hand", + "bind": "/model/instance/Vaccine_Stock_Position/bcg_balance_in_hand" + }, + { + "name": "bcg_received", + "bind": "/model/instance/Vaccine_Stock_Position/bcg_received" + }, + { + "name": "bcg_wasted", + "bind": "/model/instance/Vaccine_Stock_Position/bcg_wasted" + }, + { + "name": "opv_balance_in_hand", + "bind": "/model/instance/Vaccine_Stock_Position/opv_balance_in_hand" + }, + { + "name": "opv_received", + "bind": "/model/instance/Vaccine_Stock_Position/opv_received" + }, + { + "name": "opv_wasted", + "bind": "/model/instance/Vaccine_Stock_Position/opv_wasted" + }, + { + "name": "ipv_balance_in_hand", + "bind": "/model/instance/Vaccine_Stock_Position/ipv_balance_in_hand" + }, + { + "name": "ipv_received", + "bind": "/model/instance/Vaccine_Stock_Position/ipv_received" + }, + { + "name": "ipv_wasted", + "bind": "/model/instance/Vaccine_Stock_Position/ipv_wasted" + }, + { + "name": "pcv_balance_in_hand", + "bind": "/model/instance/Vaccine_Stock_Position/pcv_balance_in_hand" + }, + { + "name": "pcv_received", + "bind": "/model/instance/Vaccine_Stock_Position/pcv_received" + }, + { + "name": "pcv_wasted", + "bind": "/model/instance/Vaccine_Stock_Position/pcv_wasted" + }, + { + "name": "penta_balance_in_hand", + "bind": "/model/instance/Vaccine_Stock_Position/penta_balance_in_hand" + }, + { + "name": "penta_received", + "bind": "/model/instance/Vaccine_Stock_Position/penta_received" + }, + { + "name": "penta_wasted", + "bind": "/model/instance/Vaccine_Stock_Position/penta_wasted" + }, + { + "name": "measles_balance_in_hand", + "bind": "/model/instance/Vaccine_Stock_Position/measles_balance_in_hand" + }, + { + "name": "measles_received", + "bind": "/model/instance/Vaccine_Stock_Position/measles_received" + }, + { + "name": "measles_wasted", + "bind": "/model/instance/Vaccine_Stock_Position/measles_wasted" + }, + { + "name": "tt_balance_in_hand", + "bind": "/model/instance/Vaccine_Stock_Position/tt_balance_in_hand" + }, + { + "name": "tt_received", + "bind": "/model/instance/Vaccine_Stock_Position/tt_received" + }, + { + "name": "tt_wasted", + "bind": "/model/instance/Vaccine_Stock_Position/tt_wasted" + }, + { + "name": "dilutants_balance_in_hand", + "bind": "/model/instance/Vaccine_Stock_Position/dilutants_balance_in_hand" + }, + { + "name": "dilutants_received", + "bind": "/model/instance/Vaccine_Stock_Position/dilutants_received" + }, + { + "name": "dilutants_wasted", + "bind": "/model/instance/Vaccine_Stock_Position/dilutants_wasted" + }, + { + "name": "syringes_balance_in_hand", + "bind": "/model/instance/Vaccine_Stock_Position/syringes_balance_in_hand" + }, + { + "name": "syringes_received", + "bind": "/model/instance/Vaccine_Stock_Position/syringes_received" + }, + { + "name": "syringes_wasted", + "bind": "/model/instance/Vaccine_Stock_Position/syringes_wasted" + }, + { + "name": "safety_boxes_balance_in_hand", + "bind": "/model/instance/Vaccine_Stock_Position/safety_boxes_balance_in_hand" + }, + { + "name": "safety_boxes_received", + "bind": "/model/instance/Vaccine_Stock_Position/safety_boxes_received" + }, + { + "name": "safety_boxes_wasted", + "bind": "/model/instance/Vaccine_Stock_Position/safety_boxes_wasted" + }, + { + "name": "total_wasted", + "bind": "/model/instance/Vaccine_Stock_Position/total_wasted" + }, + { + "name": "total_received", + "bind": "/model/instance/Vaccine_Stock_Position/total_received" + }, + { + "name": "total_balanceInHand", + "bind": "/model/instance/Vaccine_Stock_Position/total_balanceInHand" + }, + { + "name": "instanceID", + "bind": "/model/instance/Vaccine_Stock_Position/meta/instanceID" + } + ] } } \ No newline at end of file diff --git a/src/test/resources/form/vaccine_stock_position/model.xml b/src/test/resources/form/vaccine_stock_position/model.xml index faec7c2e5..e8e20e81e 100644 --- a/src/test/resources/form/vaccine_stock_position/model.xml +++ b/src/test/resources/form/vaccine_stock_position/model.xml @@ -1,7 +1,8 @@ - + @@ -25,38 +26,71 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/form/woman_enrollment/form.json b/src/test/resources/form/woman_enrollment/form.json index fe3f23a6a..af7f2096b 100644 --- a/src/test/resources/form/woman_enrollment/form.json +++ b/src/test/resources/form/woman_enrollment/form.json @@ -1 +1,4069 @@ -{"name":"Woman_TT_Enrollment_Form","title":"خواتین انرولمنٹ فارم برائے ٹی ٹی ٹیکاجات - Woman TT Enrollment Form","sms_keyword":"woman_tt_enrollement_form","default_language":"English","choices":{"provinces":[{"name":"kpk","label":{"Urdu":"خیبر پختون خواہ","English":"Khyber Pakhtunkhwa","Roman Urdu":"Khyber Pakhtunkhwa"}},{"name":"sindh","label":{"Urdu":"سندھ","English":"Sindh","Roman Urdu":"Sindh"}},{"name":"balochistan","label":{"Urdu":"بلوچستان","English":"Balochistan","Roman Urdu":"Balochistan"}},{"name":"punjab","label":{"Urdu":"پنجاب","English":"Punjab","Roman Urdu":"Punjab"}},{"name":"gilgit_baltistan","label":{"Urdu":"گلگت بلتستان","English":"Gilgit Baltistan","Roman Urdu":"Gilgit Baltistan"}},{"name":"kashmir","label":{"Urdu":"کشمیر","English":"Kashmir","Roman Urdu":"Kashmir"}},{"name":"fata","label":{"Urdu":"فاٹا","English":"FATA","Roman Urdu":"FATA"}},{"name":"out_of_country","label":{"Urdu":"ملک سے باہر","English":"Out of Country","Roman Urdu":"Mulk se baahir"}}],"ucs":[{"province":"sindh","city":"karachi","town":"korangi","name":"bilal_colony","label":{"Urdu":"بلال کالونی","Roman Urdu":"Bilal Colony","English":"Bilal Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"nasir_colony","label":{"Urdu":"ناصر کالونی","Roman Urdu":"Nasir Colony","English":"Nasir Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"chakra_goth","label":{"Urdu":"چکرا گوٹھ","Roman Urdu":"Chakra Goth","English":"Chakra Goth"}},{"province":"sindh","city":"karachi","town":"korangi","name":"mustafa_taj_colony","label":{"Urdu":"مصطفی تاج کالونی","Roman Urdu":"Mustafa Taj Colony","English":"Mustafa Taj Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"hundred_quarters","label":{"Urdu":"ہنڈریڈ کوارٹر","Roman Urdu":"Hundred Quarters","English":"Hundred Quarters"}},{"province":"sindh","city":"karachi","town":"korangi","name":"gulzar_colony","label":{"Urdu":"گلزار کالونی","Roman Urdu":"Gulzar Colony","English":"Gulzar Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"korangi_sector_33","label":{"Urdu":"کورنگی سیکٹر 33","Roman Urdu":"Korangi Sector 33","English":"Korangi Sector 33"}},{"province":"sindh","city":"karachi","town":"korangi","name":"zaman_town","label":{"Urdu":"زمان ٹاوَن","Roman Urdu":"Zaman Town","English":"Zaman Town"}},{"province":"sindh","city":"karachi","town":"korangi","name":"hasrat_mohani_colony","label":{"Urdu":"حسرت موہانی کالونی","Roman Urdu":"Hasrat Mohani Colony","English":"Hasrat Mohani Colony"}},{"province":"sindh","city":"karachi","town":"baldia","name":"gulshan_e_ghazi","label":{"Urdu":"گلشن غازی","Roman Urdu":"Gulshan-e-Ghazi","English":"Gulshan-e-Ghazi"}},{"province":"sindh","city":"karachi","town":"baldia","name":"ittehad_town","label":{"Urdu":"اتحاد ٹاوَن","Roman Urdu":"Ittehad Town","English":"Ittehad Town"}},{"province":"sindh","city":"karachi","town":"baldia","name":"islam_nagar","label":{"Urdu":"اسلام نگر","Roman Urdu":"Islam Nagar","English":"Islam Nagar"}},{"province":"sindh","city":"karachi","town":"baldia","name":"nai_abadi","label":{"Urdu":"نئی آبادی","Roman Urdu":"Nai Abadi","English":"Nai Abadi"}},{"province":"sindh","city":"karachi","town":"baldia","name":"saeedabad","label":{"Urdu":"سعید آباد","Roman Urdu":"Saeedabad","English":"Saeedabad"}},{"province":"sindh","city":"karachi","town":"baldia","name":"muslim_mujahid_colony","label":{"Urdu":"مسلم مجاہد کالونی","Roman Urdu":"Muslim Mujahid Colony","English":"Muslim Mujahid Colony"}},{"province":"sindh","city":"karachi","town":"baldia","name":"muhajir_camp","label":{"Urdu":"مہاجر کیمپ","Roman Urdu":"Muhajir Camp","English":"Muhajir Camp"}},{"province":"sindh","city":"karachi","town":"baldia","name":"rasheedabad","label":{"Urdu":"رشید آباد","Roman Urdu":"Rasheedabad","English":"Rasheedabad"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"ibrahim_hyderi","label":{"Urdu":"ابراہیم حیدری","Roman Urdu":"Ibrahim Hyderi","English":"Ibrahim Hyderi"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"rehri","label":{"Urdu":"رہڑی","Roman Urdu":"Rehri","English":"Rehri"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"cattle_colony","label":{"Urdu":"کیٹل کالونی","Roman Urdu":"Cattle Colony","English":"Cattle Colony"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"qaidabad","label":{"Urdu":"قائدآباد","Roman Urdu":"Qaidabad","English":"Qaidabad"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"landhi_colony","label":{"Urdu":"لانڈھی کالونی","Roman Urdu":"Landhi Colony","English":"Landhi Colony"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"gulshan_e_hadeed","label":{"Urdu":"گلشن حدید","Roman Urdu":"Gulshan-e-Hadeed","English":"Gulshan-e-Hadeed"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"gaghar","label":{"Urdu":"گگر","Roman Urdu":"Gaghar","English":"Gaghar"}},{"province":"sindh","city":"karachi","town":"gadap","name":"murad_memon_goth","label":{"Urdu":"مراد میمن گوٹھ","Roman Urdu":"Murad Memon Goth","English":"Murad Memon Goth"}},{"province":"sindh","city":"karachi","town":"gadap","name":"darsano_chana","label":{"Urdu":"درشانو شنو","Roman Urdu":"Darsano Chana","English":"Darsano Chana"}},{"province":"sindh","city":"karachi","town":"gadap","name":"gujro","label":{"Urdu":"گجرو","Roman Urdu":"Gujro","English":"Gujro"}},{"province":"sindh","city":"karachi","town":"gadap","name":"songal","label":{"Urdu":"سنگل","Roman Urdu":"Songal","English":"Songal"}},{"province":"sindh","city":"karachi","town":"gadap","name":"maymarabad","label":{"Urdu":"معمار آباد","Roman Urdu":"Maymarabad","English":"Maymarabad"}},{"province":"sindh","city":"karachi","town":"gadap","name":"yousuf_goth","label":{"Urdu":"یوسف گوٹھ","Roman Urdu":"Yousuf Goth","English":"Yousuf Goth"}},{"province":"sindh","city":"karachi","town":"gadap","name":"manghopir","label":{"Urdu":"منگھوپیر","Roman Urdu":"Manghopir","English":"Manghopir"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"azizabad","label":{"Urdu":"عزیز آباد","Roman Urdu":"Azizabad","English":"Azizabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"karimabad","label":{"Urdu":"کریم آباد","Roman Urdu":"Karimabad","English":"Karimabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"aisha_manzil","label":{"Urdu":"عائشہ منزل","Roman Urdu":"Aisha Manzil","English":"Aisha Manzil"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"ancholi","label":{"Urdu":"انچولی","Roman Urdu":"Ancholi","English":"Ancholi"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"naseerabad","label":{"Urdu":"نصیرآباد","Roman Urdu":"Naseerabad","English":"Naseerabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"yaseenabad","label":{"Urdu":"یاسین آباد","Roman Urdu":"Yaseenabad","English":"Yaseenabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"water_pump","label":{"Urdu":"واٹرپمپ","Roman Urdu":"Water Pump","English":"Water Pump"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"shafiq_mill_colony","label":{"Urdu":"شفیق مل کالونی","Roman Urdu":"Shafiq Mill Colony","English":"Shafiq Mill Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"delhi_mercantile_society","label":{"Urdu":"دہلی مرچنٹائل سوسائٹی","Roman Urdu":"Delhi Mercantile Society","English":"Delhi Mercantile Society"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"civic_centre","label":{"Urdu":"سوک سینٹر","Roman Urdu":"Civic Centre","English":"Civic Centre"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"pir_ilahi_buksh_colony","label":{"Urdu":"پیر الہی بخش کالونی","Roman Urdu":"Pir Ilahi Buksh Colony","English":"Pir Ilahi Buksh Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"essa_nagri","label":{"Urdu":"عیسی نگری","Roman Urdu":"Essa Nagri","English":"Essa Nagri"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulshan_e_iqbal","label":{"Urdu":"گلشن اقبال","Roman Urdu":"Gulshan-e-Iqbal","English":"Gulshan-e-Iqbal"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gillani_railway_station","label":{"Urdu":"گیلانی ریلوے اسٹیشن","Roman Urdu":"Gillani Railway Station","English":"Gillani Railway Station"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"shanti_nagar","label":{"Urdu":"شانتی نگر","Roman Urdu":"Shanti Nagar","English":"Shanti Nagar"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"jamali_colony","label":{"Urdu":"جمالی کالونی","Roman Urdu":"Jamali Colony","English":"Jamali Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulshan_e_iqbal_ii","label":{"Urdu":"گلشن اقبال 2","Roman Urdu":"Gulshan-e-Iqbal II","English":"Gulshan-e-Iqbal II"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"pehlwan_goth","label":{"Urdu":"پہلوان گوٹھ","Roman Urdu":"Pehlwan Goth","English":"Pehlwan Goth"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"matrovil_colony","label":{"Urdu":"میٹروویل کالونی","Roman Urdu":"Matrovil Colony","English":"Matrovil Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulzar_e_hijri","label":{"Urdu":"گلزار ہجری","Roman Urdu":"Gulzar-e-Hijri","English":"Gulzar-e-Hijri"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"safooran_goth","label":{"Urdu":"صفورا گوٹھ","Roman Urdu":"Safooran Goth","English":"Safooran Goth"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"akhtar_colony","label":{"Urdu":"اختر کالونی","Roman Urdu":"Akhtar Colony","English":"Akhtar Colony"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"manzoor_colony","label":{"Urdu":"منظور کالونی","Roman Urdu":"Manzoor Colony","English":"Manzoor Colony"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"azam_basti","label":{"Urdu":"اعظم بستی","Roman Urdu":"Azam Basti","English":"Azam Basti"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"chanesar_goth","label":{"Urdu":"چنیسر گوٹھ","Roman Urdu":"Chanesar Goth","English":"Chanesar Goth"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"mahmudabad","label":{"Urdu":"محمودآباد","Roman Urdu":"Mahmudabad","English":"Mahmudabad"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pechs","label":{"Urdu":"پی۔ای۔سی۔ایچ۔ایس","Roman Urdu":"P.E.C.H.S.","English":"P.E.C.H.S."}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pechs_ii","label":{"Urdu":"پی۔ای۔سی۔ایچ۔ایس 2","Roman Urdu":"P.E.C.H.S. II","English":"P.E.C.H.S. II"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"jut_line","label":{"Urdu":"جٹ لائن","Roman Urdu":"Jut Line","English":"Jut Line"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"central_jacob_lines","label":{"Urdu":"سینٹرل جیکب لائن","Roman Urdu":"Central Jacob Lines","English":"Central Jacob Lines"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"jamshed_quarters","label":{"Urdu":"جمشید کوارٹر","Roman Urdu":"Jamshed Quarters","English":"Jamshed Quarters"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"garden_east","label":{"Urdu":"گارڈن ایسٹ","Roman Urdu":"Garden East","English":"Garden East"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"soldier_bazar","label":{"Urdu":"سولجر بازار","Roman Urdu":"Soldier Bazar","English":"Soldier Bazar"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pakistan_quarters","label":{"Urdu":"پاکستان کوارٹر","Roman Urdu":"Pakistan Quarters","English":"Pakistan Quarters"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"bhutta_village","label":{"Urdu":"بھٹا ولیج","Roman Urdu":"Bhutta Village","English":"Bhutta Village"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"sultanabad","label":{"Urdu":"سلطان آباد","Roman Urdu":"Sultanabad","English":"Sultanabad"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"kiamari_uc","label":{"Urdu":"کیماری یوسی","Roman Urdu":"Kiamari UC","English":"Kiamari UC"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"baba_bhit","label":{"Urdu":"بابا بھٹ","Roman Urdu":"Baba Bhit","English":"Baba Bhit"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"machar_colony","label":{"Urdu":"مچھر کالونی","Roman Urdu":"Machar Colony","English":"Machar Colony"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"maripur","label":{"Urdu":"ماڑی پور","Roman Urdu":"Maripur","English":"Maripur"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"shershah","label":{"Urdu":"شیرشاہ","Roman Urdu":"SherShah","English":"SherShah"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"gabo_pat","label":{"Urdu":"گابو پٹ","Roman Urdu":"Gabo Pat","English":"Gabo Pat"}},{"province":"sindh","city":"karachi","town":"landhi","name":"muzafarabad","label":{"Urdu":"مظفرآباد","Roman Urdu":"Muzafarabad","English":"Muzafarabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"muslimabad","label":{"Urdu":"مسلم آباد","Roman Urdu":"Muslimabad","English":"Muslimabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"dawood_chowrangi","label":{"Urdu":"داوَد چورنگی","Roman Urdu":"Dawood Chowrangi","English":"Dawood Chowrangi"}},{"province":"sindh","city":"karachi","town":"landhi","name":"moinabad","label":{"Urdu":"معین آباد","Roman Urdu":"Moinabad","English":"Moinabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"sharafi_goth","label":{"Urdu":"شرافی گوٹھ","Roman Urdu":"Sharafi Goth","English":"Sharafi Goth"}},{"province":"sindh","city":"karachi","town":"landhi","name":"bhutto_nagar","label":{"Urdu":"بھٹو نگر","Roman Urdu":"Bhutto Nagar","English":"Bhutto Nagar"}},{"province":"sindh","city":"karachi","town":"landhi","name":"khawaja_ajmeer_colony","label":{"Urdu":"خواجہ اجمیر کالونی","Roman Urdu":"Khawaja Ajmeer Colony","English":"Khawaja Ajmeer Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"landhi_uc","label":{"Urdu":"لانڈھی یوسی","Roman Urdu":"Landhi UC","English":"Landhi UC"}},{"province":"sindh","city":"karachi","town":"landhi","name":"awami_colony","label":{"Urdu":"عوامی کالونی","Roman Urdu":"Awami Colony","English":"Awami Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"burmee_colony","label":{"Urdu":"برمی کالونی","Roman Urdu":"Burmee Colony","English":"Burmee Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"korangi_uc","label":{"Urdu":"کورنگی یوسی","Roman Urdu":"Korangi UC","English":"Korangi UC"}},{"province":"sindh","city":"karachi","town":"landhi","name":"sherabad","label":{"Urdu":"شیرآباد","Roman Urdu":"Sherabad","English":"Sherabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"rizvia_society","label":{"Urdu":"رضویہ سوسائٹی","Roman Urdu":"Rizvia Society","English":"Rizvia Society"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"firdous_colony","label":{"Urdu":"فردوس کالونی","Roman Urdu":"Firdous Colony","English":"Firdous Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"super_market","label":{"Urdu":"سپر مارکیٹ","Roman Urdu":"Super Market","English":"Super Market"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"dak_khana","label":{"Urdu":"دک کھانہ","Roman Urdu":"Dak Khana","English":"Dak Khana"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"qasimabad","label":{"Urdu":"قاسم آباد","Roman Urdu":"Qasimabad","English":"Qasimabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"bandhani_colony","label":{"Urdu":"بندھانی کالونی","Roman Urdu":"Bandhani Colony","English":"Bandhani Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"sharifabad","label":{"Urdu":"شریف آباد","Roman Urdu":"Sharifabad","English":"Sharifabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"commercial_area","label":{"Urdu":"کمرشل ایریا","Roman Urdu":"Commercial Area","English":"Commercial Area"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"mujahid_colony","label":{"Urdu":"مجاہد کالونی","Roman Urdu":"Mujahid Colony","English":"Mujahid Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"nazimabad","label":{"Urdu":"ناظم آباد","Roman Urdu":"Nazimabad","English":"Nazimabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"abbasi_shaheed","label":{"Urdu":"عباسی شہید","Roman Urdu":"Abbasi Shaheed","English":"Abbasi Shaheed"}},{"province":"sindh","city":"karachi","town":"lyari","name":"agra_taj_colony","label":{"Urdu":"آگرہ تاج کالونی","Roman Urdu":"Agra Taj Colony","English":"Agra Taj Colony"}},{"province":"sindh","city":"karachi","town":"lyari","name":"daryaabad","label":{"Urdu":"دریاآباد","Roman Urdu":"Daryaabad","English":"Daryaabad"}},{"province":"sindh","city":"karachi","town":"lyari","name":"nawabad","label":{"Urdu":"نواآباد","Roman Urdu":"Nawabad","English":"Nawabad"}},{"province":"sindh","city":"karachi","town":"lyari","name":"khada_memon_society","label":{"Urdu":"خدا- میمن- سوساَٹی","Roman Urdu":"Khada Memon Society","English":"Khada Memon Society"}},{"province":"sindh","city":"karachi","town":"lyari","name":"baghdadi","label":{"Urdu":"بغدادی","Roman Urdu":"Baghdadi","English":"Baghdadi"}},{"province":"sindh","city":"karachi","town":"lyari","name":"shah_baig_line","label":{"Urdu":"شاھ باغ لائن","Roman Urdu":"Shah Baig Line","English":"Shah Baig Line"}},{"province":"sindh","city":"karachi","town":"lyari","name":"bihar_colony","label":{"Urdu":"بہار کالونی","Roman Urdu":"Bihar Colony","English":"Bihar Colony"}},{"province":"sindh","city":"karachi","town":"lyari","name":"ragiwara","label":{"Urdu":"راگی واڑا","Roman Urdu":"Ragiwara","English":"Ragiwara"}},{"province":"sindh","city":"karachi","town":"lyari","name":"singo_line","label":{"Urdu":"سنگولائن","Roman Urdu":"Singo Line","English":"Singo Line"}},{"province":"sindh","city":"karachi","town":"lyari","name":"chakiwara","label":{"Urdu":"چاکی واڑا","Roman Urdu":"Chakiwara","English":"Chakiwara"}},{"province":"sindh","city":"karachi","town":"lyari","name":"allama_iqbal_colony","label":{"Urdu":"علامہ اقبال کالونی","Roman Urdu":"Allama Iqbal Colony","English":"Allama Iqbal Colony"}},{"province":"sindh","city":"karachi","town":"malir","name":"model_colony","label":{"Urdu":"موڈل کالونی","Roman Urdu":"Model Colony","English":"Model Colony"}},{"province":"sindh","city":"karachi","town":"malir","name":"kala_board","label":{"Urdu":"کالا بورڈ","Roman Urdu":"Kala Board","English":"Kala Board"}},{"province":"sindh","city":"karachi","town":"malir","name":"saudabad","label":{"Urdu":"سعودآباد","Roman Urdu":"Saudabad","English":"Saudabad"}},{"province":"sindh","city":"karachi","town":"malir","name":"khokhra_par","label":{"Urdu":"کھوکھرا پار","Roman Urdu":"Khokhra Par","English":"Khokhra Par"}},{"province":"sindh","city":"karachi","town":"malir","name":"jafar_e_tayyar","label":{"Urdu":"جعفر تیار","Roman Urdu":"Jafar-e-Tayyar","English":"Jafar-e-Tayyar"}},{"province":"sindh","city":"karachi","town":"malir","name":"gharibabad","label":{"Urdu":"غریب آباد","Roman Urdu":"Gharibabad","English":"Gharibabad"}},{"province":"sindh","city":"karachi","town":"malir","name":"ghazi_brohi_goth","label":{"Urdu":"غازی بروہی گوٹھ","Roman Urdu":"Ghazi Brohi Goth","English":"Ghazi Brohi Goth"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"kalyana","label":{"Urdu":"کالیانہ","Roman Urdu":"Kalyana","English":"Kalyana"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"sir_syed_colony","label":{"Urdu":"سر سید کالونی","Roman Urdu":"Sir Syed Colony","English":"Sir Syed Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"fatima_jinnah_colony","label":{"Urdu":"فاطمہ جناح کالونی","Roman Urdu":"Fatima Jinnah Colony","English":"Fatima Jinnah Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"godhra","label":{"Urdu":"گودھرا","Roman Urdu":"Godhra","English":"Godhra"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"abu_zar_ghaffari","label":{"Urdu":"ابو زر غفاری","Roman Urdu":"Abu Zar Ghaffari","English":"Abu Zar Ghaffari"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"hakim_ahsan","label":{"Urdu":"حاکم احسان","Roman Urdu":"Hakim Ahsan","English":"Hakim Ahsan"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"madina_colony","label":{"Urdu":"مدینہ کالونی","Roman Urdu":"Madina Colony","English":"Madina Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"faisal_colony","label":{"Urdu":"فیصل کالونی","Roman Urdu":"Faisal Colony","English":"Faisal Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"khamiso_goth","label":{"Urdu":"خمیسو گوٹھ","Roman Urdu":"Khamiso Goth","English":"Khamiso Goth"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"mustufa_colony","label":{"Urdu":"مصطفی کالونی","Roman Urdu":"Mustufa Colony","English":"Mustufa Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"khawaja_ajmeer_nagri","label":{"Urdu":"خواجہ اجمیر نگری","Roman Urdu":"Khawaja Ajmeer Nagri","English":"Khawaja Ajmeer Nagri"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"gulshan_e_saeed","label":{"Urdu":"گلشن سعید","Roman Urdu":"Gulshan-e-Saeed","English":"Gulshan-e-Saeed"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"shah_nawaz_bhutto_colony","label":{"Urdu":"شاہ نواز بھٹو کالونی","Roman Urdu":"Shah Nawaz Bhutto Colony","English":"Shah Nawaz Bhutto Colony"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"paposh_nagar","label":{"Urdu":"پاپوش نگر","Roman Urdu":"Paposh Nagar","English":"Paposh Nagar"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"pahar_ganj","label":{"Urdu":"پہاڑ گنج","Roman Urdu":"Pahar Ganj","English":"Pahar Ganj"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"khandu_goth","label":{"Urdu":"کھنڑو گوٹھ","Roman Urdu":"Khandu Goth","English":"Khandu Goth"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"hyderi","label":{"Urdu":"حیدری","Roman Urdu":"Hyderi","English":"Hyderi"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"sakhi_hassan","label":{"Urdu":"سخی حسن","Roman Urdu":"Sakhi Hassan","English":"Sakhi Hassan"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"farooq_e_azam","label":{"Urdu":"فاروق اعظم","Roman Urdu":"Farooq-e-Azam","English":"Farooq-e-Azam"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"nusrat_bhutto_colony","label":{"Urdu":"نصرت بھٹو کالونی","Roman Urdu":"Nusrat Bhutto Colony","English":"Nusrat Bhutto Colony"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"shadman_town","label":{"Urdu":"شادمان ٹاوَن","Roman Urdu":"Shadman Town","English":"Shadman Town"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"buffer_zone","label":{"Urdu":"بفرزون","Roman Urdu":"Buffer Zone","English":"Buffer Zone"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"buffer_zone_ii","label":{"Urdu":"بفرزون 2","Roman Urdu":"Buffer Zone II","English":"Buffer Zone II"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mominabad","label":{"Urdu":"مومن آباد","Roman Urdu":"Mominabad","English":"Mominabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"haryana_colony","label":{"Urdu":"حریانہ کالونی","Roman Urdu":"Haryana Colony","English":"Haryana Colony"}},{"province":"sindh","city":"karachi","town":"orangi","name":"hanifabad","label":{"Urdu":"حنیف آباد","Roman Urdu":"Hanifabad","English":"Hanifabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mohammad_nagar","label":{"Urdu":"محمد نگر","Roman Urdu":"Mohammad Nagar","English":"Mohammad Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"madina_colony_orangi","label":{"Urdu":"مدینہ کالونی اورنگی","Roman Urdu":"Madina Colony Orangi","English":"Madina Colony Orangi"}},{"province":"sindh","city":"karachi","town":"orangi","name":"ghaziabad","label":{"Urdu":"غازی آباد","Roman Urdu":"Ghaziabad","English":"Ghaziabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"chisti_nagar","label":{"Urdu":"چشتی نگر","Roman Urdu":"Chisti Nagar","English":"Chisti Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"bilal_colony_orangi","label":{"Urdu":"بلال کالونی اورنگی","Roman Urdu":"Bilal Colony Orangi","English":"Bilal Colony Orangi"}},{"province":"sindh","city":"karachi","town":"orangi","name":"iqbal_baloch_colony","label":{"Urdu":"اقبال بلوچ کالونی","Roman Urdu":"Iqbal Baloch Colony","English":"Iqbal Baloch Colony"}},{"province":"sindh","city":"karachi","town":"orangi","name":"ghabool_town","label":{"Urdu":"گبول ٹاوَن","Roman Urdu":"Ghabool Town","English":"Ghabool Town"}},{"province":"sindh","city":"karachi","town":"orangi","name":"data_nagar","label":{"Urdu":"داتا نگر","Roman Urdu":"Data Nagar","English":"Data Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mujahidabad","label":{"Urdu":"مجاہد آباد","Roman Urdu":"Mujahidabad","English":"Mujahidabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"baloch_goth","label":{"Urdu":"بلوچ گوٹھ","Roman Urdu":"Baloch Goth","English":"Baloch Goth"}},{"province":"sindh","city":"karachi","town":"saddar","name":"old_haji_camp","label":{"Urdu":"پرانہ حاجی کیمپ","Roman Urdu":"Old Haji Camp","English":"Old Haji Camp"}},{"province":"sindh","city":"karachi","town":"saddar","name":"garden","label":{"Urdu":"گارڈن","Roman Urdu":"Garden","English":"Garden"}},{"province":"sindh","city":"karachi","town":"saddar","name":"kharadar","label":{"Urdu":"کھارادر","Roman Urdu":"Kharadar","English":"Kharadar"}},{"province":"sindh","city":"karachi","town":"saddar","name":"city_railway_colony","label":{"Urdu":"سٹی ریلوے کالونی","Roman Urdu":"City Railway Colony","English":"City Railway Colony"}},{"province":"sindh","city":"karachi","town":"saddar","name":"nanak_wara","label":{"Urdu":"ناناک واڑا","Roman Urdu":"Nanak Wara","English":"Nanak Wara"}},{"province":"sindh","city":"karachi","town":"saddar","name":"gazdarabad","label":{"Urdu":"گزدرآباد","Roman Urdu":"Gazdarabad","English":"Gazdarabad"}},{"province":"sindh","city":"karachi","town":"saddar","name":"millat_nagar_islam_pura","label":{"Urdu":"ملت نگر اسلام پورا","Roman Urdu":"Millat Nagar/Islam Pura","English":"Millat Nagar/Islam Pura"}},{"province":"sindh","city":"karachi","town":"saddar","name":"saddar_uc","label":{"Urdu":"صدر یو سی","Roman Urdu":"Saddar UC","English":"Saddar UC"}},{"province":"sindh","city":"karachi","town":"saddar","name":"civil_line","label":{"Urdu":"سول لائن","Roman Urdu":"Civil Line","English":"Civil Line"}},{"province":"sindh","city":"karachi","town":"saddar","name":"clifton","label":{"Urdu":"کلفٹن","Roman Urdu":"Clifton","English":"Clifton"}},{"province":"sindh","city":"karachi","town":"saddar","name":"kehkashan","label":{"Urdu":"کہکشان","Roman Urdu":"Kehkashan","English":"Kehkashan"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"natha_khan_goth","label":{"Urdu":"ناتھا خان گوٹھ","Roman Urdu":"Natha Khan Goth","English":"Natha Khan Goth"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"pak_sadat_colony","label":{"Urdu":"پاک صدر کالونی","Roman Urdu":"Pak Sadat Colony","English":"Pak Sadat Colony"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"drigh_colony","label":{"Urdu":"ڈرگ کالونی","Roman Urdu":"Drigh Colony","English":"Drigh Colony"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"raita_plot","label":{"Urdu":"رائتا پلاٹ","Roman Urdu":"Raita Plot","English":"Raita Plot"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"moria_khan_goth","label":{"Urdu":"موریا خان گوٹھ","Roman Urdu":"Moria Khan Goth","English":"Moria Khan Goth"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"rafa_e_aam_society","label":{"Urdu":"رفا عام سوسا ئٹی","Roman Urdu":"Rafa-e-Aam Society","English":"Rafa-e-Aam Society"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"al_falah_society","label":{"Urdu":"الفلاح سوسا ئٹی","Roman Urdu":"Al-Falah Society","English":"Al-Falah Society"}},{"province":"sindh","city":"karachi","town":"site","name":"pak_colony","label":{"Urdu":"پاک کالونی","Roman Urdu":"Pak Colony","English":"Pak Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"old_golimar","label":{"Urdu":"پرانہ گولی مار","Roman Urdu":"Old Golimar","English":"Old Golimar"}},{"province":"sindh","city":"karachi","town":"site","name":"jahanabad","label":{"Urdu":"جہان آباد","Roman Urdu":"Jahanabad","English":"Jahanabad"}},{"province":"sindh","city":"karachi","town":"site","name":"metrovil","label":{"Urdu":"میٹروویل","Roman Urdu":"Metrovil","English":"Metrovil"}},{"province":"sindh","city":"karachi","town":"site","name":"bhawani_chali","label":{"Urdu":"بہوانی چالی","Roman Urdu":"Bhawani Chali","English":"Bhawani Chali"}},{"province":"sindh","city":"karachi","town":"site","name":"frontier_colony","label":{"Urdu":"فرونٹر کالونی","Roman Urdu":"Frontier Colony","English":"Frontier Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"banaras_colony","label":{"Urdu":"بنارس کالونی","Roman Urdu":"Banaras Colony","English":"Banaras Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"qasba_colony","label":{"Urdu":"قصبہ کالونی","Roman Urdu":"Qasba Colony","English":"Qasba Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"islamia_colony","label":{"Urdu":"اسلامیہ کالونی","Roman Urdu":"Islamia Colony","English":"Islamia Colony"}},{"province":"na","city":"na","town":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","city":"na","town":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Qaabil-e-atlaaq nahi","English":"Not Applicable"}}],"gender":[{"instance":{"openmrs_code":"1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"male","label":{"Urdu":"مرد/ لڑکا","Roman Urdu":"Mard/larka","English":"Male"}},{"instance":{"openmrs_code":"1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"female","label":{"Urdu":"عورت/لڑکی","Roman Urdu":"Aurat/larki","English":"Female"}},{"instance":{"openmrs_code":"163163AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"transgender","label":{"Urdu":"خواجہ سرہ","Roman Urdu":"Khwaja sira","English":"Transgender"}}],"vaccines":[{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT1","label":{"Urdu":"ٹی ٹی 1","Roman Urdu":"TT1","English":"TT1"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT2","label":{"Urdu":"ٹی ٹی 2","Roman Urdu":"TT2","English":"TT2"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT3","label":{"Urdu":"ٹی ٹی 3","Roman Urdu":"TT3","English":"TT3"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT4","label":{"Urdu":"ٹی ٹی 4","Roman Urdu":"TT4","English":"TT4"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT5","label":{"Urdu":"ٹی ٹی 5","Roman Urdu":"TT5","English":"TT5"}}],"towns":[{"province":"sindh","city":"karachi","name":"korangi","label":{"Urdu":"کورنگی","Roman Urdu":"Korangi","English":"Korangi"}},{"province":"sindh","city":"karachi","name":"landhi","label":{"Urdu":"لانڈھی","Roman Urdu":"Landhi","English":"Landhi"}},{"province":"sindh","city":"karachi","name":"baldia","label":{"Urdu":"بلدیہ","Roman Urdu":"Baldia","English":"Baldia"}},{"province":"sindh","city":"karachi","name":"bin_qasim","label":{"Urdu":"بن قاسم","Roman Urdu":"Bin Qasim","English":"Bin Qasim"}},{"province":"sindh","city":"karachi","name":"gadap","label":{"Urdu":"گڈاپ","Roman Urdu":"Gadap","English":"Gadap"}},{"province":"sindh","city":"karachi","name":"gulberg","label":{"Urdu":"گلبرگ","Roman Urdu":"Gulberg","English":"Gulberg"}},{"province":"sindh","city":"karachi","name":"gulshan","label":{"Urdu":"گلشن","Roman Urdu":"Gulshan","English":"Gulshan"}},{"province":"sindh","city":"karachi","name":"jamshed","label":{"Urdu":"جمشید","Roman Urdu":"Jamshed","English":"Jamshed"}},{"province":"sindh","city":"karachi","name":"kiamari","label":{"Urdu":"کیماری","Roman Urdu":"Kiamari","English":"Kiamari"}},{"province":"sindh","city":"karachi","name":"liaquatabad","label":{"Urdu":"لیاقت آباد","Roman Urdu":"Liaquatabad","English":"Liaquatabad"}},{"province":"sindh","city":"karachi","name":"lyari","label":{"Urdu":"لیاری","Roman Urdu":"Lyari","English":"Lyari"}},{"province":"sindh","city":"karachi","name":"malir","label":{"Urdu":"ملیر","Roman Urdu":"Malir","English":"Malir"}},{"province":"sindh","city":"karachi","name":"new_karachi","label":{"Urdu":"نیو کراچی","Roman Urdu":"New Karachi","English":"New Karachi"}},{"province":"sindh","city":"karachi","name":"north_nazimabad","label":{"Urdu":"نارتھ ناظم آباد","Roman Urdu":"North Nazimabad","English":"North Nazimabad"}},{"province":"sindh","city":"karachi","name":"orangi","label":{"Urdu":"اورنگی","Roman Urdu":"Orangi","English":"Orangi"}},{"province":"sindh","city":"karachi","name":"saddar","label":{"Urdu":"صدر","Roman Urdu":"Saddar","English":"Saddar"}},{"province":"sindh","city":"karachi","name":"shah_faisal","label":{"Urdu":"شاہ فیصل","Roman Urdu":"Shah Faisal","English":"Shah Faisal"}},{"province":"sindh","city":"karachi","name":"site","label":{"Urdu":"سائٹ","Roman Urdu":"S.I.T.E.","English":"S.I.T.E."}},{"province":"na","city":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","city":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Qaabil-e-atlaaq nahi","English":"Not Applicable"}}],"cities":[{"province":"sindh","name":"karachi","label":{"Urdu":"کراچی","Roman Urdu":"Karachi","English":"Karachi"}},{"province":"punjab","name":"hafizabad","label":{"Urdu":"حافظ آباد","Roman Urdu":"Hafizabad","English":"Hafizabad"}},{"province":"punjab","name":"muzaffargarh","label":{"Urdu":"مظفر گڑھ","Roman Urdu":"Muzaffargarh","English":"Muzaffargarh"}},{"province":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Not Applicable","English":"Not Applicable"}}],"edd_lmp":[{"instance":{"openmrs_code":"5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"edd","label":{"Urdu":"زچگی کی متوقع تاریخ","Roman Urdu":"EDD","English":"EDD"}},{"instance":{"openmrs_code":"1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"lmp","label":{"Urdu":"پچھلی مہواری کی تاریخ","Roman Urdu":"LMP","English":"LMP"}},{"instance":{"openmrs_code":"159617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ultrasound","label":{"Urdu":"الٹرا سائونڈ","Roman Urdu":"Ultrasound","English":"Ultrasound"}},{"instance":{"openmrs_code":"1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"none","label":{"Urdu":"کوئی بھی نہیں","Roman Urdu":"Koi bhi nahi","English":"None of the above"}}],"ethnicity":[{"instance":{"openmrs_code":"163215AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"punjabi","label":{"Urdu":"پنجابی","Roman Urdu":"Punjabi","English":"Punjabi"}},{"instance":{"openmrs_code":"163216AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pushtuns","label":{"Urdu":"پشتون","Roman Urdu":"Pushtun","English":"Pushtun"}},{"instance":{"openmrs_code":"163217AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"sindhi","label":{"Urdu":"سندھی","Roman Urdu":"Sindhi","English":"Sindhi"}},{"instance":{"openmrs_code":"163218AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"saraiki","label":{"Urdu":"سرائیکی","Roman Urdu":"Saraiki","English":"Saraiki"}},{"instance":{"openmrs_code":"163219AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"muhajir","label":{"Urdu":"مہاجر","Roman Urdu":"Muhajir","English":"Muhajir"}},{"instance":{"openmrs_code":"163220AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"balochi","label":{"Urdu":"بلوچی","Roman Urdu":"Balochi","English":"Balochi"}},{"instance":{"openmrs_code":"5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}}],"yes_no":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}]},"instance":{"encounter_type":"Woman TT enrollment"},"version":"201604080500","id_string":"woman_tt_enrollement_form","type":"survey","children":[{"type":"hidden","name":"provider_uc"},{"type":"hidden","name":"provider_town"},{"type":"hidden","name":"provider_city"},{"type":"hidden","name":"provider_province"},{"type":"hidden","name":"provider_id"},{"instance":{"openmrs_entity_id":"location_id","openmrs_entity":"encounter"},"type":"hidden","name":"provider_location_id"},{"instance":{"openmrs_entity_id":"Program Client ID","openmrs_entity":"person_identifier"},"type":"hidden","name":"existing_program_client_id"},{"type":"hidden","name":"provider_location_name"},{"instance":{"openmrs_entity_id":"gender","openmrs_entity":"person"},"type":"hidden","name":"gender"},{"type":"note","name":"provider_location_note","label":{"Urdu":"شہر: ${provider_city} ; ٹائون: ${provider_town} ; یوسی: ${provider_uc} ; سینٹرکا نام: ${provider_location_name}","English":"City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}","Roman Urdu":"Shehr: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center ka naam: ${provider_location_name}"}},{"instance":{"openmrs_entity_id":"163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"start","name":"start"},{"instance":{"openmrs_entity_id":"163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"end","name":"end"},{"instance":{"openmrs_entity_id":"163286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"today","name":"today"},{"instance":{"openmrs_entity_id":"163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"deviceid","name":"deviceid"},{"instance":{"openmrs_entity_id":"163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"subscriberid","name":"subscriberid"},{"instance":{"openmrs_entity_id":"163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"simserial","name":"simserial"},{"instance":{"openmrs_entity_id":"163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"phonenumber","name":"phonenumber"},{"name":"client_reg_date","hint":{"Urdu":"خاتون کو ویکسین لگنے کی تاریخ","English":"Date on which woman was vaccinated","Roman Urdu":"Khatoon ko vaccine lagnay ki tareekh"},"bind":{"jr:constraintMsg":{"Urdu":"پروگرام مین اندراج کی تاریخ مستقبل کی نہیں ہوسکتی","English":"Client registration date cannot be in the future","Roman Urdu":"Program mai andraaj ki tareekh mustaqbil ki nahi hosakti"},"required":"yes","constraint":".<=${today}"},"label":{"Urdu":"پروگرام میں اندراج کی تاریخ","English":"Client Registration date","Roman Urdu":"Program mai andraj ki tareekh"},"instance":{"openmrs_entity_id":"encounter_date","openmrs_entity":"encounter"},"type":"date"},{"bind":{"required":"yes"},"type":"note","name":"program_client_id","label":{"Urdu":"کلائنٹ کی پروگرام آئی ڈی {existing_program_client_id}$","Roman Urdu":"Client ki program ID ${existing_program_client_id}","English":"Program Client ID ${existing_program_client_id}"}},{"bind":{"jr:constraintMsg":{"Urdu":"نمبر آٹھ ہندسوں پر مشتمل ہونا چاہئے","English":"Number should be 8 digits","Roman Urdu":"Number 8 hindason par mushtamil hona chahiye"},"required":"yes","constraint":"string-length(.) = 8"},"type":"integer","instance":{"openmrs_entity_id":"EPI Card Number","openmrs_entity":"person_attribute"},"name":"epi_card_number","label":{"Urdu":"کارڈ نمبر","English":"EPI Card Number","Roman Urdu":"EPI Card Number"}},{"bind":{"jr:constraintMsg":{"Urdu":"نام تین سے پچیس حروف پر مشتمل ہونا چاہئے","English":"Name should be 3 to 25 characters long","Roman Urdu":"Naam 3 say 25 huroof par mushtamil hona chahiye"},"required":"yes","constraint":"regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')"},"type":"text","instance":{"openmrs_entity_id":"first_name","openmrs_entity":"person"},"name":"first_name","label":{"Urdu":"نام","English":"First Name","Roman Urdu":"Naam"}},{"default":"yes","label":{"Urdu":"کیا تاریخ پیدائش معلوم ہے؟","Roman Urdu":"Kya tareekh-e-pedaaish maloom hai?","English":"Is birthdate known?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}],"name":"member_birth_date_known"},{"bind":{"jr:constraintMsg":{"Urdu":"یہ تاریخ مستقبل کی نہیں ہوسکتی","Roman Urdu":"Ye tareekh mustaqbil ki nahi hosakti","English":"This date cannot be in the future"},"relevant":"selected(${member_birth_date_known}, 'yes')","constraint":".<=${today}"},"type":"date","name":"member_birth_date","label":{"Urdu":"تاریخ پیدائش","Roman Urdu":"Tareekh-e-pedaaish","English":"Birth date"}},{"bind":{"relevant":"selected(${member_birth_date_known}, 'no')"},"type":"integer","name":"age","label":{"Urdu":"عمر (سالوں میں)","Roman Urdu":"Umar (saalon me)","English":"Age (years)"}},{"bind":{"calculate":"int((${today} - ${member_birth_date}) div 365.25)"},"type":"calculate","name":"calc_age"},{"bind":{"calculate":"date(${today} - int(${age} * 365.25))"},"type":"calculate","name":"calc_dob"},{"bind":{"calculate":"if(${member_birth_date_known}='yes', ${member_birth_date}, ${calc_dob})"},"type":"calculate","name":"calc_dob_confirm","instance":{"openmrs_entity_id":"birthdate","openmrs_entity":"person"}},{"bind":{"calculate":"if(${member_birth_date_known} = 'yes', '0', '1')"},"type":"calculate","name":"calc_dob_estimated","instance":{"openmrs_entity_id":"birthdate_estimated","openmrs_entity":"person"}},{"bind":{"calculate":"if(${member_birth_date_known}='yes', ${calc_age}, ${age})"},"type":"calculate","name":"calc_age_confirm","instance":{"openmrs_entity_id":"154384AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"type":"note","name":"birth_date_note","label":{"Urdu":"کلائنٹ کی تاریخ پیدائش:${calc_dob_confirm}","English":"Date of Birth: ${calc_dob_confirm}","Roman Urdu":"Member ki Tareekh-e-pedaaish: ${calc_dob_confirm}"}},{"type":"note","name":"note_age","label":{"Urdu":"عمر :{calc_age_confirm}$ سال","English":"Age: ${calc_age_confirm} years","Roman Urdu":"Umar: ${calc_age_confirm} saal"}},{"default":"female","bind":{"required":"yes","calculate":"concat(\"female\",\"\")"},"type":"calculate","name":"gender1","label":{"Urdu":"جنس","Roman Urdu":"Jins","English":"Gender"}},{"bind":{"jr:constraintMsg":{"Urdu":"نام تین سے پچیس حروف پر مشتمل ہونا چاہئے","English":"Name should be 3 to 25 characters long","Roman Urdu":"Naam 3 say 25 huroof par mushtamil hona chahiye"},"constraint":"regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')"},"type":"text","instance":{"openmrs_entity_id":"1594AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"father_name","label":{"Urdu":"والد کا نام","English":"Father's Name","Roman Urdu":"Waalid ka naam"}},{"label":{"Urdu":"کیا آپ شادی شدہ ہیں؟","English":"Are you married?","Roman Urdu":"Kya aap shaadi shuda hain?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}],"name":"marriage"},{"bind":{"jr:constraintMsg":{"Urdu":"نام تین سے پچیس حروف پر مشتمل ہونا چاہئے","English":"Name should be 3 to 25 characters long","Roman Urdu":"Naam 3 say 25 huroof par mushtamil hona chahiye"},"relevant":"selected(${marriage}, 'yes')","constraint":"regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')"},"type":"text","instance":{"openmrs_entity_id":"161135AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"husband_name","label":{"Urdu":"شوہر کا نام","English":"Husband's Name","Roman Urdu":"Shohar ka naam"}},{"bind":{"calculate":"if(${marriage} = 'no', ${father_name}, ${husband_name})"},"type":"calculate","name":"last_name","instance":{"openmrs_entity_id":"last_name","openmrs_entity":"person"}},{"control":{"appearance":"minimal"},"name":"ethnicity","bind":{"required":"yes"},"label":{"Urdu":"قومیت","English":"Ethnicity","Roman Urdu":"Qomiat"},"instance":{"openmrs_entity_id":"163153AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"163215AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"punjabi","label":{"Urdu":"پنجابی","Roman Urdu":"Punjabi","English":"Punjabi"}},{"instance":{"openmrs_code":"163216AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pushtuns","label":{"Urdu":"پشتون","Roman Urdu":"Pushtun","English":"Pushtun"}},{"instance":{"openmrs_code":"163217AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"sindhi","label":{"Urdu":"سندھی","Roman Urdu":"Sindhi","English":"Sindhi"}},{"instance":{"openmrs_code":"163218AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"saraiki","label":{"Urdu":"سرائیکی","Roman Urdu":"Saraiki","English":"Saraiki"}},{"instance":{"openmrs_code":"163219AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"muhajir","label":{"Urdu":"مہاجر","Roman Urdu":"Muhajir","English":"Muhajir"}},{"instance":{"openmrs_code":"163220AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"balochi","label":{"Urdu":"بلوچی","Roman Urdu":"Balochi","English":"Balochi"}},{"instance":{"openmrs_code":"5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}}]},{"bind":{"relevant":"selected(${ethnicity}, 'other')"},"type":"text","instance":{"openmrs_entity":"concept","openmrs_entity_id":"160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"163330AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ethnicity_other","label":{"Urdu":"وضاحت کریں","Roman Urdu":"Wazaahat karain","English":"Please specify:"}},{"control":{"appearance":"minimal"},"name":"province","default":"${provider_province}","bind":{"required":"yes"},"label":{"Urdu":"صوبہ","Roman Urdu":"Suba","English":"Province"},"instance":{"openmrs_entity":"person_address","openmrs_entity_id":"stateProvince","openmrs_entity_parent":"usual_residence"},"type":"select one","children":[{"name":"kpk","label":{"Urdu":"خیبر پختون خواہ","English":"Khyber Pakhtunkhwa","Roman Urdu":"Khyber Pakhtunkhwa"}},{"name":"sindh","label":{"Urdu":"سندھ","English":"Sindh","Roman Urdu":"Sindh"}},{"name":"balochistan","label":{"Urdu":"بلوچستان","English":"Balochistan","Roman Urdu":"Balochistan"}},{"name":"punjab","label":{"Urdu":"پنجاب","English":"Punjab","Roman Urdu":"Punjab"}},{"name":"gilgit_baltistan","label":{"Urdu":"گلگت بلتستان","English":"Gilgit Baltistan","Roman Urdu":"Gilgit Baltistan"}},{"name":"kashmir","label":{"Urdu":"کشمیر","English":"Kashmir","Roman Urdu":"Kashmir"}},{"name":"fata","label":{"Urdu":"فاٹا","English":"FATA","Roman Urdu":"FATA"}},{"name":"out_of_country","label":{"Urdu":"ملک سے باہر","English":"Out of Country","Roman Urdu":"Mulk se baahir"}}]},{"control":{"appearance":"minimal"},"name":"city_village","choice_filter":"province=${province} or province='na'","default":"${provider_city}","bind":{"required":"yes"},"label":{"Urdu":"شہر","Roman Urdu":"Shehr","English":"City"},"itemset":"cities","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"cityVillage","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"control":{"appearance":"minimal"},"name":"town","choice_filter":"(province=${province} and city=${city_village} ) or city='na'","bind":{"required":"yes"},"label":{"Urdu":"ٹاٰئون/ قصبہ/ بستی","Roman Urdu":"Town / Qasbah / Basti","English":"Town"},"itemset":"towns","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"town","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"control":{"appearance":"minimal"},"name":"union_council","choice_filter":"(province=${province} and city=${city_village} and town=${town}) or town='na'","bind":{"required":"yes"},"label":{"Urdu":"یونین کونسل","Roman Urdu":"Union Council","English":"Union Council"},"itemset":"ucs","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"subTown","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"bind":{"required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"house","openmrs_entity_parent":"usual_residence"},"name":"house_number","label":{"Urdu":"گھر کا نمبر","Roman Urdu":"Ghar ka number","English":"House Number"}},{"bind":{"required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"street","openmrs_entity_parent":"usual_residence"},"name":"street","label":{"Urdu":"گلی/کالونی/محلہ","Roman Urdu":"Gali/Colony/Mohalla","English":"Street"}},{"bind":{"required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"landmark","openmrs_entity_parent":"usual_residence"},"name":"landmark","label":{"Urdu":"گھر کے قریب کوئی مشہور جگہ","Roman Urdu":"Ghar ke qareeb koi mashoor jagah","English":"Land Mark"}},{"bind":{"calculate":"jr:choice-name(${province}, '${province}')"},"type":"calculate","name":"provincename"},{"bind":{"calculate":"jr:choice-name(${city_village}, '${city_village}')"},"type":"calculate","name":"city_villagename"},{"bind":{"calculate":"jr:choice-name(${town}, '${town}')"},"type":"calculate","name":"townname"},{"bind":{"calculate":"jr:choice-name(${union_council}, '${union_council}')"},"type":"calculate","name":"union_councilname"},{"type":"note","name":"address","label":{"Urdu":"پتہ: ${house_number}, ${street}, ${landmark}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}","English":"Address: ${house_number}, ${street}, ${landmark}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}","Roman Urdu":"Pata: ${house_number}, ${street}, ${landmark}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}"}},{"instance":{"openmrs_entity_id":"163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"geopoint","name":"centre_gps","label":{"Urdu":"حاصل کردہ معلومات کی جگہ کے GPS کارڈینیٹس درج کریں","English":"Collect GPS coordinates of data entry location","Roman Urdu":"Hasil karda malomaat ki jaga ke GPS coordinates darj karain"}},{"name":"reminders_approval","bind":{"required":"yes"},"label":{"Urdu":"کیا آپ اپنے بچے کی اگلی ویکسین کی تاریخ کے لیے SMS موصول کرنا چاہتے ہیں؟","English":"Are you willing to receive SMS reminders for your next visit?","Roman Urdu":"Kya aap apnay bachay ki agli vaccine ki tareekh ke liye SMS mausool karna chahtay hain?"},"instance":{"openmrs_entity_id":"163089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}]},{"bind":{"jr:constraintMsg":{"Urdu":"فون نمبر گیارہ ہندسوں پر مشتمل اور مندرجہ ذیل شکل میں ہونا چاہئے: *********03","English":"Phone number should be 11 digits in the following format: 03*********","Roman Urdu":"Phone number 11 hindason par mushtamil aur mundarja zail shakal main hona chahiey: 03*********"},"relevant":"${reminders_approval}='yes'","constraint":"regex(., '^03[0-9]{9}$')"},"type":"text","instance":{"openmrs_entity_id":"159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"contact_phone_number","label":{"Urdu":"موبائل نمبر:","English":"Mobile Number:","Roman Urdu":"Mobile number:"}},{"instance":{"openmrs_entity_id":"5272AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"label":{"Urdu":"کیا خا تون حاملہ ہیں؟","English":"Is female pregnant?","Roman Urdu":"Kia khatoon haamla hain?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}],"name":"pregnant"},{"name":"edd_lmp","bind":{"relevant":"selected (${pregnant}, 'yes')"},"label":{"Urdu":"کیا آپ کو اپنی پچھلی ماہواری کی تاریخ، زچگی کی متوقع تاریخ، یا الٹرا سائونڈ کا علم ہے؟","English":"Do you know your LMP, EDD or last Ultrasound information?","Roman Urdu":"Kya aap ko apni pichli mahwaari ki tareekh, zachgi ki mutawaqqa tareekh ya ultrasound ka ilm hai?"},"instance":{"openmrs_entity_id":"160697AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"edd","label":{"Urdu":"زچگی کی متوقع تاریخ","Roman Urdu":"EDD","English":"EDD"}},{"instance":{"openmrs_code":"1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"lmp","label":{"Urdu":"پچھلی مہواری کی تاریخ","Roman Urdu":"LMP","English":"LMP"}},{"instance":{"openmrs_code":"159617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ultrasound","label":{"Urdu":"الٹرا سائونڈ","Roman Urdu":"Ultrasound","English":"Ultrasound"}},{"instance":{"openmrs_code":"1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"none","label":{"Urdu":"کوئی بھی نہیں","Roman Urdu":"Koi bhi nahi","English":"None of the above"}}]},{"bind":{"jr:constraintMsg":{"Urdu":"زچگی کی متوقع تاریخ ماضی کی نہیں ہو سکتی","Roman Urdu":"Zachgi ki mutawaqqa tareekh maazi ki nahi hosakti","English":"EDD cannot be in the past"},"relevant":"selected (${edd_lmp}, 'edd')","constraint":".>=${today}"},"type":"date","name":"edd","label":{"Urdu":"زچگی کی متوقع تاریخ","Roman Urdu":"Zachgi ki mutawaqqa tareekh","English":"EDD"}},{"bind":{"jr:constraintMsg":{"Urdu":"پچھلی ماہواری کی تاریخ مستقبل کی نہیں ہوسکتی","Roman Urdu":"Pichli mahwaari ki tareekh mustaqbil ki nahi hosakti","English":"LMP cannot be in the future"},"relevant":"selected (${edd_lmp}, 'lmp')","constraint":".<=${today}"},"type":"date","name":"lmp","label":{"Urdu":"پچھلی ماہواری کی تاریخ","Roman Urdu":"Pichli mahwaari ki tareekh","English":"LMP"}},{"bind":{"relevant":"selected (${edd_lmp}, 'ultrasound')"},"type":"date","instance":{"openmrs_entity_id":"163165AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"ultrasound_date","label":{"Urdu":"الٹرا سائونڈ کی تاریخ","English":"Ultrasound Date","Roman Urdu":"Ultrasound ki tareekh"}},{"bind":{"relevant":"selected (${edd_lmp}, 'ultrasound')"},"type":"integer","name":"ultrasound_weeks","label":{"Urdu":"الٹرا سائونڈ کی مدد سے حمل کی مدت [ہفتوں میں]","Roman Urdu":"Ultrasound ki madad se hamal ki muddat (hafton me)","English":"Gestational age determined by ultrasound"}},{"bind":{"calculate":"date(${lmp}+280)"},"type":"calculate","name":"edd_calc_lmp"},{"bind":{"calculate":"date((280-(${ultrasound_weeks}*7)+${ultrasound_date} ))"},"type":"calculate","name":"edd_calc_ultrasound"},{"bind":{"calculate":"format-date(${edd_calc_lmp}, '%Y-%n-%e')"},"type":"calculate","name":"edd_calc_lmp_formatted"},{"bind":{"calculate":"format-date(${edd_calc_ultrasound}, '%Y-%n-%e')"},"type":"calculate","name":"edd_calc_ultrasound_formatted"},{"bind":{"calculate":"date(${edd}-280)"},"type":"calculate","name":"lmp_calc_edd"},{"bind":{"calculate":"date(${ultrasound_date}-(${ultrasound_weeks}*7))"},"type":"calculate","name":"lmp_calc_ultrasound"},{"bind":{"calculate":"format-date(${lmp_calc_edd}, '%Y-%n-%e')"},"type":"calculate","name":"lmp_calc_edd_formatted"},{"bind":{"calculate":"format-date(${lmp_calc_ultrasound}, '%Y-%n-%e')"},"type":"calculate","name":"lmp_calc_ultrasound_formatted"},{"bind":{"calculate":"if(${edd_lmp}='lmp',${edd_calc_lmp_formatted},if(${edd_lmp}='edd',${edd} ,if(${edd_lmp}='ultrasound',${edd_calc_ultrasound_formatted},'')))"},"type":"calculate","name":"final_edd","instance":{"openmrs_entity_id":"5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"bind":{"calculate":"if(${edd_lmp}='lmp',${lmp},if(${edd_lmp}='edd',${lmp_calc_edd_formatted} ,if(${edd_lmp}='ultrasound',${lmp_calc_ultrasound_formatted},'')))"},"type":"calculate","name":"final_lmp","instance":{"openmrs_entity_id":"1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"bind":{"calculate":"int((${today} - (${edd}-280))div7)"},"type":"calculate","name":"ga_edd"},{"bind":{"calculate":"int((${today} - ${lmp})div7)"},"type":"calculate","name":"ga_lmp"},{"bind":{"calculate":"int((${today} -(${ultrasound_date}-(${ultrasound_weeks}*7)))div7)"},"type":"calculate","name":"ga_ult"},{"bind":{"relevant":"selected (${pregnant}, 'yes')"},"type":"note","name":"final_edd_note","label":{"Urdu":"${final_edd}: زچگی کی متوقع تاریخ","Roman Urdu":"Zachgi ki mutawaqqa tareekh: ${final_edd}","English":"EDD: ${final_edd}"}},{"bind":{"relevant":"selected (${pregnant}, 'yes')"},"type":"note","name":"final_lmp_note","label":{"Urdu":"پچھلی ماہواری کی تاریخ :{final_lmp}$","Roman Urdu":"Pichli mahwaari ki tareekh: ${final_lmp}","English":"LMP: ${final_lmp}"}},{"bind":{"calculate":"if(${edd_lmp}='lmp',${ga_lmp},if(${edd_lmp}='edd',${ga_edd} ,if(${edd_lmp}='ultrasound',${ga_ult},'')))"},"type":"calculate","name":"final_ga","instance":{"openmrs_entity_id":"163166AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"bind":{"relevant":"selected (${pregnant}, 'yes')"},"type":"note","name":"final_ga_note","label":{"Urdu":"حمل کی مُدّت: {final_ga}$ ہفتے","Roman Urdu":"Hamal ki muddat: ${final_ga} weeks","English":"GA: ${final_ga} weeks"}},{"name":"vaccines","bind":{"calculate":"minimal"},"label":{"Urdu":"پچھلی تاریخ جب کسی اور سینٹر پر ٹیکہ لگوایا گیا یا قطرے پلائے گئے","Roman Urdu":"Pichli tareekh jab kissi aur center par teeka lagwaya gaya ya katray pilaey gaye","English":"Retro vaccines"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1421AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"select all that apply","children":[{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT1","label":{"Urdu":"ٹی ٹی 1","Roman Urdu":"TT1","English":"TT1"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT2","label":{"Urdu":"ٹی ٹی 2","Roman Urdu":"TT2","English":"TT2"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT3","label":{"Urdu":"ٹی ٹی 3","Roman Urdu":"TT3","English":"TT3"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT4","label":{"Urdu":"ٹی ٹی 4","Roman Urdu":"TT4","English":"TT4"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT5","label":{"Urdu":"ٹی ٹی 5","Roman Urdu":"TT5","English":"TT5"}}]},{"bind":{"relevant":"selected(${vaccines},'TT1')","constraint":"(.<=${today} and .<=${client_reg_date})"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt1_retro","label":{"Urdu":"ٹی ٹی 1","Roman Urdu":"TT1","English":"TT1"}},{"bind":{"relevant":"selected(${vaccines},'TT1')","calculate":"1"},"type":"calculate","name":"tt_1_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines},'TT2')","constraint":"(.<=${today} and .>=${tt1_retro} and ((selected(${vaccines}, 'TT1'))))"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt2_retro","label":{"Urdu":"ٹی ٹی 2","Roman Urdu":"TT2","English":"TT2"}},{"bind":{"relevant":"selected(${vaccines},'TT2')","calculate":"2"},"type":"calculate","name":"tt_2_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines},'TT3')","constraint":"(.<=${today} and .>=${tt2_retro} and ((selected(${vaccines}, 'TT2'))))"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt3_retro","label":{"Urdu":"ٹی ٹی 3","Roman Urdu":"TT3","English":"TT3"}},{"bind":{"relevant":"selected(${vaccines},'TT3')","calculate":"3"},"type":"calculate","name":"tt_3_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines},'TT4')","constraint":"(.<=${today} and .>=${tt3_retro} and ((selected(${vaccines}, 'TT3'))))"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt4_retro","label":{"Urdu":"ٹی ٹی 4","Roman Urdu":"TT4","English":"TT4"}},{"bind":{"relevant":"selected(${vaccines},'TT4')","calculate":"4"},"type":"calculate","name":"tt_4_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"name":"vaccines_2","choice_filter":"name = if(selected(${vaccines}, 'TT1'), '', 'TT1') or \nname = if(selected(${vaccines}, 'TT2'), '', 'TT2') or \nname = if(selected(${vaccines}, 'TT3'), '', 'TT3') or \nname = if(selected(${vaccines}, 'TT4'), '', 'TT4') or \nname = if(selected(${vaccines}, 'TT5'), '', 'TT5')","bind":{"required":"yes"},"label":{"Urdu":"آج کون کون سی ویکسین دی گئی ہیں؟","Roman Urdu":"Aaj kon kon si vaccine di gai hain?","English":"Vaccine administered today"},"itemset":"vaccines","instance":{"openmrs_entity":"concept","openmrs_entity_id":"984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1441AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"select all that apply"},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT1'),${client_reg_date},'')"},"type":"calculate","name":"tt1","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT1')","calculate":"1"},"type":"calculate","name":"tt_1_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT2'),${client_reg_date},'')"},"type":"calculate","name":"tt2","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT2')","calculate":"2"},"type":"calculate","name":"tt_2_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT3'),${client_reg_date},'')"},"type":"calculate","name":"tt3","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT3')","calculate":"3"},"type":"calculate","name":"tt_3_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT4'),${client_reg_date},'')"},"type":"calculate","name":"tt4","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT4')","calculate":"4"},"type":"calculate","name":"tt_4_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT5'),${client_reg_date},'')"},"type":"calculate","name":"tt5","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT5')","calculate":"5"},"type":"calculate","name":"tt_5_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"control":{"bodyless":true},"type":"group","children":[{"bind":{"readonly":"true()","calculate":"concat('uuid:', uuid())"},"type":"calculate","name":"instanceID"}],"name":"meta"}]} \ No newline at end of file +{ + "name": "Woman_TT_Enrollment_Form", + "title": "خواتین انرولمنٹ فارم برائے ٹی ٹی ٹیکاجات - Woman TT Enrollment Form", + "sms_keyword": "woman_tt_enrollement_form", + "default_language": "English", + "choices": { + "provinces": [ + { + "name": "kpk", + "label": { + "Urdu": "خیبر پختون خواہ", + "English": "Khyber Pakhtunkhwa", + "Roman Urdu": "Khyber Pakhtunkhwa" + } + }, + { + "name": "sindh", + "label": { + "Urdu": "سندھ", + "English": "Sindh", + "Roman Urdu": "Sindh" + } + }, + { + "name": "balochistan", + "label": { + "Urdu": "بلوچستان", + "English": "Balochistan", + "Roman Urdu": "Balochistan" + } + }, + { + "name": "punjab", + "label": { + "Urdu": "پنجاب", + "English": "Punjab", + "Roman Urdu": "Punjab" + } + }, + { + "name": "gilgit_baltistan", + "label": { + "Urdu": "گلگت بلتستان", + "English": "Gilgit Baltistan", + "Roman Urdu": "Gilgit Baltistan" + } + }, + { + "name": "kashmir", + "label": { + "Urdu": "کشمیر", + "English": "Kashmir", + "Roman Urdu": "Kashmir" + } + }, + { + "name": "fata", + "label": { + "Urdu": "فاٹا", + "English": "FATA", + "Roman Urdu": "FATA" + } + }, + { + "name": "out_of_country", + "label": { + "Urdu": "ملک سے باہر", + "English": "Out of Country", + "Roman Urdu": "Mulk se baahir" + } + } + ], + "ucs": [ + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "bilal_colony", + "label": { + "Urdu": "بلال کالونی", + "Roman Urdu": "Bilal Colony", + "English": "Bilal Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "nasir_colony", + "label": { + "Urdu": "ناصر کالونی", + "Roman Urdu": "Nasir Colony", + "English": "Nasir Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "chakra_goth", + "label": { + "Urdu": "چکرا گوٹھ", + "Roman Urdu": "Chakra Goth", + "English": "Chakra Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "mustafa_taj_colony", + "label": { + "Urdu": "مصطفی تاج کالونی", + "Roman Urdu": "Mustafa Taj Colony", + "English": "Mustafa Taj Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "hundred_quarters", + "label": { + "Urdu": "ہنڈریڈ کوارٹر", + "Roman Urdu": "Hundred Quarters", + "English": "Hundred Quarters" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "gulzar_colony", + "label": { + "Urdu": "گلزار کالونی", + "Roman Urdu": "Gulzar Colony", + "English": "Gulzar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "korangi_sector_33", + "label": { + "Urdu": "کورنگی سیکٹر 33", + "Roman Urdu": "Korangi Sector 33", + "English": "Korangi Sector 33" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "zaman_town", + "label": { + "Urdu": "زمان ٹاوَن", + "Roman Urdu": "Zaman Town", + "English": "Zaman Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "hasrat_mohani_colony", + "label": { + "Urdu": "حسرت موہانی کالونی", + "Roman Urdu": "Hasrat Mohani Colony", + "English": "Hasrat Mohani Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "gulshan_e_ghazi", + "label": { + "Urdu": "گلشن غازی", + "Roman Urdu": "Gulshan-e-Ghazi", + "English": "Gulshan-e-Ghazi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "ittehad_town", + "label": { + "Urdu": "اتحاد ٹاوَن", + "Roman Urdu": "Ittehad Town", + "English": "Ittehad Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "islam_nagar", + "label": { + "Urdu": "اسلام نگر", + "Roman Urdu": "Islam Nagar", + "English": "Islam Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "nai_abadi", + "label": { + "Urdu": "نئی آبادی", + "Roman Urdu": "Nai Abadi", + "English": "Nai Abadi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "saeedabad", + "label": { + "Urdu": "سعید آباد", + "Roman Urdu": "Saeedabad", + "English": "Saeedabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "muslim_mujahid_colony", + "label": { + "Urdu": "مسلم مجاہد کالونی", + "Roman Urdu": "Muslim Mujahid Colony", + "English": "Muslim Mujahid Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "muhajir_camp", + "label": { + "Urdu": "مہاجر کیمپ", + "Roman Urdu": "Muhajir Camp", + "English": "Muhajir Camp" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "rasheedabad", + "label": { + "Urdu": "رشید آباد", + "Roman Urdu": "Rasheedabad", + "English": "Rasheedabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "ibrahim_hyderi", + "label": { + "Urdu": "ابراہیم حیدری", + "Roman Urdu": "Ibrahim Hyderi", + "English": "Ibrahim Hyderi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "rehri", + "label": { + "Urdu": "رہڑی", + "Roman Urdu": "Rehri", + "English": "Rehri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "cattle_colony", + "label": { + "Urdu": "کیٹل کالونی", + "Roman Urdu": "Cattle Colony", + "English": "Cattle Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "qaidabad", + "label": { + "Urdu": "قائدآباد", + "Roman Urdu": "Qaidabad", + "English": "Qaidabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "landhi_colony", + "label": { + "Urdu": "لانڈھی کالونی", + "Roman Urdu": "Landhi Colony", + "English": "Landhi Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "gulshan_e_hadeed", + "label": { + "Urdu": "گلشن حدید", + "Roman Urdu": "Gulshan-e-Hadeed", + "English": "Gulshan-e-Hadeed" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "gaghar", + "label": { + "Urdu": "گگر", + "Roman Urdu": "Gaghar", + "English": "Gaghar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "murad_memon_goth", + "label": { + "Urdu": "مراد میمن گوٹھ", + "Roman Urdu": "Murad Memon Goth", + "English": "Murad Memon Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "darsano_chana", + "label": { + "Urdu": "درشانو شنو", + "Roman Urdu": "Darsano Chana", + "English": "Darsano Chana" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "gujro", + "label": { + "Urdu": "گجرو", + "Roman Urdu": "Gujro", + "English": "Gujro" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "songal", + "label": { + "Urdu": "سنگل", + "Roman Urdu": "Songal", + "English": "Songal" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "maymarabad", + "label": { + "Urdu": "معمار آباد", + "Roman Urdu": "Maymarabad", + "English": "Maymarabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "yousuf_goth", + "label": { + "Urdu": "یوسف گوٹھ", + "Roman Urdu": "Yousuf Goth", + "English": "Yousuf Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "manghopir", + "label": { + "Urdu": "منگھوپیر", + "Roman Urdu": "Manghopir", + "English": "Manghopir" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "azizabad", + "label": { + "Urdu": "عزیز آباد", + "Roman Urdu": "Azizabad", + "English": "Azizabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "karimabad", + "label": { + "Urdu": "کریم آباد", + "Roman Urdu": "Karimabad", + "English": "Karimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "aisha_manzil", + "label": { + "Urdu": "عائشہ منزل", + "Roman Urdu": "Aisha Manzil", + "English": "Aisha Manzil" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "ancholi", + "label": { + "Urdu": "انچولی", + "Roman Urdu": "Ancholi", + "English": "Ancholi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "naseerabad", + "label": { + "Urdu": "نصیرآباد", + "Roman Urdu": "Naseerabad", + "English": "Naseerabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "yaseenabad", + "label": { + "Urdu": "یاسین آباد", + "Roman Urdu": "Yaseenabad", + "English": "Yaseenabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "water_pump", + "label": { + "Urdu": "واٹرپمپ", + "Roman Urdu": "Water Pump", + "English": "Water Pump" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "shafiq_mill_colony", + "label": { + "Urdu": "شفیق مل کالونی", + "Roman Urdu": "Shafiq Mill Colony", + "English": "Shafiq Mill Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "delhi_mercantile_society", + "label": { + "Urdu": "دہلی مرچنٹائل سوسائٹی", + "Roman Urdu": "Delhi Mercantile Society", + "English": "Delhi Mercantile Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "civic_centre", + "label": { + "Urdu": "سوک سینٹر", + "Roman Urdu": "Civic Centre", + "English": "Civic Centre" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "pir_ilahi_buksh_colony", + "label": { + "Urdu": "پیر الہی بخش کالونی", + "Roman Urdu": "Pir Ilahi Buksh Colony", + "English": "Pir Ilahi Buksh Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "essa_nagri", + "label": { + "Urdu": "عیسی نگری", + "Roman Urdu": "Essa Nagri", + "English": "Essa Nagri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gulshan_e_iqbal", + "label": { + "Urdu": "گلشن اقبال", + "Roman Urdu": "Gulshan-e-Iqbal", + "English": "Gulshan-e-Iqbal" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gillani_railway_station", + "label": { + "Urdu": "گیلانی ریلوے اسٹیشن", + "Roman Urdu": "Gillani Railway Station", + "English": "Gillani Railway Station" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "shanti_nagar", + "label": { + "Urdu": "شانتی نگر", + "Roman Urdu": "Shanti Nagar", + "English": "Shanti Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "jamali_colony", + "label": { + "Urdu": "جمالی کالونی", + "Roman Urdu": "Jamali Colony", + "English": "Jamali Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gulshan_e_iqbal_ii", + "label": { + "Urdu": "گلشن اقبال 2", + "Roman Urdu": "Gulshan-e-Iqbal II", + "English": "Gulshan-e-Iqbal II" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "pehlwan_goth", + "label": { + "Urdu": "پہلوان گوٹھ", + "Roman Urdu": "Pehlwan Goth", + "English": "Pehlwan Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "matrovil_colony", + "label": { + "Urdu": "میٹروویل کالونی", + "Roman Urdu": "Matrovil Colony", + "English": "Matrovil Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gulzar_e_hijri", + "label": { + "Urdu": "گلزار ہجری", + "Roman Urdu": "Gulzar-e-Hijri", + "English": "Gulzar-e-Hijri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "safooran_goth", + "label": { + "Urdu": "صفورا گوٹھ", + "Roman Urdu": "Safooran Goth", + "English": "Safooran Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "akhtar_colony", + "label": { + "Urdu": "اختر کالونی", + "Roman Urdu": "Akhtar Colony", + "English": "Akhtar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "manzoor_colony", + "label": { + "Urdu": "منظور کالونی", + "Roman Urdu": "Manzoor Colony", + "English": "Manzoor Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "azam_basti", + "label": { + "Urdu": "اعظم بستی", + "Roman Urdu": "Azam Basti", + "English": "Azam Basti" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "chanesar_goth", + "label": { + "Urdu": "چنیسر گوٹھ", + "Roman Urdu": "Chanesar Goth", + "English": "Chanesar Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "mahmudabad", + "label": { + "Urdu": "محمودآباد", + "Roman Urdu": "Mahmudabad", + "English": "Mahmudabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "pechs", + "label": { + "Urdu": "پی۔ای۔سی۔ایچ۔ایس", + "Roman Urdu": "P.E.C.H.S.", + "English": "P.E.C.H.S." + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "pechs_ii", + "label": { + "Urdu": "پی۔ای۔سی۔ایچ۔ایس 2", + "Roman Urdu": "P.E.C.H.S. II", + "English": "P.E.C.H.S. II" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "jut_line", + "label": { + "Urdu": "جٹ لائن", + "Roman Urdu": "Jut Line", + "English": "Jut Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "central_jacob_lines", + "label": { + "Urdu": "سینٹرل جیکب لائن", + "Roman Urdu": "Central Jacob Lines", + "English": "Central Jacob Lines" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "jamshed_quarters", + "label": { + "Urdu": "جمشید کوارٹر", + "Roman Urdu": "Jamshed Quarters", + "English": "Jamshed Quarters" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "garden_east", + "label": { + "Urdu": "گارڈن ایسٹ", + "Roman Urdu": "Garden East", + "English": "Garden East" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "soldier_bazar", + "label": { + "Urdu": "سولجر بازار", + "Roman Urdu": "Soldier Bazar", + "English": "Soldier Bazar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "pakistan_quarters", + "label": { + "Urdu": "پاکستان کوارٹر", + "Roman Urdu": "Pakistan Quarters", + "English": "Pakistan Quarters" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "bhutta_village", + "label": { + "Urdu": "بھٹا ولیج", + "Roman Urdu": "Bhutta Village", + "English": "Bhutta Village" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "sultanabad", + "label": { + "Urdu": "سلطان آباد", + "Roman Urdu": "Sultanabad", + "English": "Sultanabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "kiamari_uc", + "label": { + "Urdu": "کیماری یوسی", + "Roman Urdu": "Kiamari UC", + "English": "Kiamari UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "baba_bhit", + "label": { + "Urdu": "بابا بھٹ", + "Roman Urdu": "Baba Bhit", + "English": "Baba Bhit" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "machar_colony", + "label": { + "Urdu": "مچھر کالونی", + "Roman Urdu": "Machar Colony", + "English": "Machar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "maripur", + "label": { + "Urdu": "ماڑی پور", + "Roman Urdu": "Maripur", + "English": "Maripur" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "shershah", + "label": { + "Urdu": "شیرشاہ", + "Roman Urdu": "SherShah", + "English": "SherShah" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "gabo_pat", + "label": { + "Urdu": "گابو پٹ", + "Roman Urdu": "Gabo Pat", + "English": "Gabo Pat" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "muzafarabad", + "label": { + "Urdu": "مظفرآباد", + "Roman Urdu": "Muzafarabad", + "English": "Muzafarabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "muslimabad", + "label": { + "Urdu": "مسلم آباد", + "Roman Urdu": "Muslimabad", + "English": "Muslimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "dawood_chowrangi", + "label": { + "Urdu": "داوَد چورنگی", + "Roman Urdu": "Dawood Chowrangi", + "English": "Dawood Chowrangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "moinabad", + "label": { + "Urdu": "معین آباد", + "Roman Urdu": "Moinabad", + "English": "Moinabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "sharafi_goth", + "label": { + "Urdu": "شرافی گوٹھ", + "Roman Urdu": "Sharafi Goth", + "English": "Sharafi Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "bhutto_nagar", + "label": { + "Urdu": "بھٹو نگر", + "Roman Urdu": "Bhutto Nagar", + "English": "Bhutto Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "khawaja_ajmeer_colony", + "label": { + "Urdu": "خواجہ اجمیر کالونی", + "Roman Urdu": "Khawaja Ajmeer Colony", + "English": "Khawaja Ajmeer Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "landhi_uc", + "label": { + "Urdu": "لانڈھی یوسی", + "Roman Urdu": "Landhi UC", + "English": "Landhi UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "awami_colony", + "label": { + "Urdu": "عوامی کالونی", + "Roman Urdu": "Awami Colony", + "English": "Awami Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "burmee_colony", + "label": { + "Urdu": "برمی کالونی", + "Roman Urdu": "Burmee Colony", + "English": "Burmee Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "korangi_uc", + "label": { + "Urdu": "کورنگی یوسی", + "Roman Urdu": "Korangi UC", + "English": "Korangi UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "sherabad", + "label": { + "Urdu": "شیرآباد", + "Roman Urdu": "Sherabad", + "English": "Sherabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "rizvia_society", + "label": { + "Urdu": "رضویہ سوسائٹی", + "Roman Urdu": "Rizvia Society", + "English": "Rizvia Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "firdous_colony", + "label": { + "Urdu": "فردوس کالونی", + "Roman Urdu": "Firdous Colony", + "English": "Firdous Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "super_market", + "label": { + "Urdu": "سپر مارکیٹ", + "Roman Urdu": "Super Market", + "English": "Super Market" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "dak_khana", + "label": { + "Urdu": "دک کھانہ", + "Roman Urdu": "Dak Khana", + "English": "Dak Khana" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "qasimabad", + "label": { + "Urdu": "قاسم آباد", + "Roman Urdu": "Qasimabad", + "English": "Qasimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "bandhani_colony", + "label": { + "Urdu": "بندھانی کالونی", + "Roman Urdu": "Bandhani Colony", + "English": "Bandhani Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "sharifabad", + "label": { + "Urdu": "شریف آباد", + "Roman Urdu": "Sharifabad", + "English": "Sharifabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "commercial_area", + "label": { + "Urdu": "کمرشل ایریا", + "Roman Urdu": "Commercial Area", + "English": "Commercial Area" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "mujahid_colony", + "label": { + "Urdu": "مجاہد کالونی", + "Roman Urdu": "Mujahid Colony", + "English": "Mujahid Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "nazimabad", + "label": { + "Urdu": "ناظم آباد", + "Roman Urdu": "Nazimabad", + "English": "Nazimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "abbasi_shaheed", + "label": { + "Urdu": "عباسی شہید", + "Roman Urdu": "Abbasi Shaheed", + "English": "Abbasi Shaheed" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "agra_taj_colony", + "label": { + "Urdu": "آگرہ تاج کالونی", + "Roman Urdu": "Agra Taj Colony", + "English": "Agra Taj Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "daryaabad", + "label": { + "Urdu": "دریاآباد", + "Roman Urdu": "Daryaabad", + "English": "Daryaabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "nawabad", + "label": { + "Urdu": "نواآباد", + "Roman Urdu": "Nawabad", + "English": "Nawabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "khada_memon_society", + "label": { + "Urdu": "خدا- میمن- سوساَٹی", + "Roman Urdu": "Khada Memon Society", + "English": "Khada Memon Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "baghdadi", + "label": { + "Urdu": "بغدادی", + "Roman Urdu": "Baghdadi", + "English": "Baghdadi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "shah_baig_line", + "label": { + "Urdu": "شاھ باغ لائن", + "Roman Urdu": "Shah Baig Line", + "English": "Shah Baig Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "bihar_colony", + "label": { + "Urdu": "بہار کالونی", + "Roman Urdu": "Bihar Colony", + "English": "Bihar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "ragiwara", + "label": { + "Urdu": "راگی واڑا", + "Roman Urdu": "Ragiwara", + "English": "Ragiwara" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "singo_line", + "label": { + "Urdu": "سنگولائن", + "Roman Urdu": "Singo Line", + "English": "Singo Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "chakiwara", + "label": { + "Urdu": "چاکی واڑا", + "Roman Urdu": "Chakiwara", + "English": "Chakiwara" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "allama_iqbal_colony", + "label": { + "Urdu": "علامہ اقبال کالونی", + "Roman Urdu": "Allama Iqbal Colony", + "English": "Allama Iqbal Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "model_colony", + "label": { + "Urdu": "موڈل کالونی", + "Roman Urdu": "Model Colony", + "English": "Model Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "kala_board", + "label": { + "Urdu": "کالا بورڈ", + "Roman Urdu": "Kala Board", + "English": "Kala Board" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "saudabad", + "label": { + "Urdu": "سعودآباد", + "Roman Urdu": "Saudabad", + "English": "Saudabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "khokhra_par", + "label": { + "Urdu": "کھوکھرا پار", + "Roman Urdu": "Khokhra Par", + "English": "Khokhra Par" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "jafar_e_tayyar", + "label": { + "Urdu": "جعفر تیار", + "Roman Urdu": "Jafar-e-Tayyar", + "English": "Jafar-e-Tayyar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "gharibabad", + "label": { + "Urdu": "غریب آباد", + "Roman Urdu": "Gharibabad", + "English": "Gharibabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "ghazi_brohi_goth", + "label": { + "Urdu": "غازی بروہی گوٹھ", + "Roman Urdu": "Ghazi Brohi Goth", + "English": "Ghazi Brohi Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "kalyana", + "label": { + "Urdu": "کالیانہ", + "Roman Urdu": "Kalyana", + "English": "Kalyana" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "sir_syed_colony", + "label": { + "Urdu": "سر سید کالونی", + "Roman Urdu": "Sir Syed Colony", + "English": "Sir Syed Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "fatima_jinnah_colony", + "label": { + "Urdu": "فاطمہ جناح کالونی", + "Roman Urdu": "Fatima Jinnah Colony", + "English": "Fatima Jinnah Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "godhra", + "label": { + "Urdu": "گودھرا", + "Roman Urdu": "Godhra", + "English": "Godhra" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "abu_zar_ghaffari", + "label": { + "Urdu": "ابو زر غفاری", + "Roman Urdu": "Abu Zar Ghaffari", + "English": "Abu Zar Ghaffari" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "hakim_ahsan", + "label": { + "Urdu": "حاکم احسان", + "Roman Urdu": "Hakim Ahsan", + "English": "Hakim Ahsan" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "madina_colony", + "label": { + "Urdu": "مدینہ کالونی", + "Roman Urdu": "Madina Colony", + "English": "Madina Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "faisal_colony", + "label": { + "Urdu": "فیصل کالونی", + "Roman Urdu": "Faisal Colony", + "English": "Faisal Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "khamiso_goth", + "label": { + "Urdu": "خمیسو گوٹھ", + "Roman Urdu": "Khamiso Goth", + "English": "Khamiso Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "mustufa_colony", + "label": { + "Urdu": "مصطفی کالونی", + "Roman Urdu": "Mustufa Colony", + "English": "Mustufa Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "khawaja_ajmeer_nagri", + "label": { + "Urdu": "خواجہ اجمیر نگری", + "Roman Urdu": "Khawaja Ajmeer Nagri", + "English": "Khawaja Ajmeer Nagri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "gulshan_e_saeed", + "label": { + "Urdu": "گلشن سعید", + "Roman Urdu": "Gulshan-e-Saeed", + "English": "Gulshan-e-Saeed" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "shah_nawaz_bhutto_colony", + "label": { + "Urdu": "شاہ نواز بھٹو کالونی", + "Roman Urdu": "Shah Nawaz Bhutto Colony", + "English": "Shah Nawaz Bhutto Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "paposh_nagar", + "label": { + "Urdu": "پاپوش نگر", + "Roman Urdu": "Paposh Nagar", + "English": "Paposh Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "pahar_ganj", + "label": { + "Urdu": "پہاڑ گنج", + "Roman Urdu": "Pahar Ganj", + "English": "Pahar Ganj" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "khandu_goth", + "label": { + "Urdu": "کھنڑو گوٹھ", + "Roman Urdu": "Khandu Goth", + "English": "Khandu Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "hyderi", + "label": { + "Urdu": "حیدری", + "Roman Urdu": "Hyderi", + "English": "Hyderi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "sakhi_hassan", + "label": { + "Urdu": "سخی حسن", + "Roman Urdu": "Sakhi Hassan", + "English": "Sakhi Hassan" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "farooq_e_azam", + "label": { + "Urdu": "فاروق اعظم", + "Roman Urdu": "Farooq-e-Azam", + "English": "Farooq-e-Azam" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "nusrat_bhutto_colony", + "label": { + "Urdu": "نصرت بھٹو کالونی", + "Roman Urdu": "Nusrat Bhutto Colony", + "English": "Nusrat Bhutto Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "shadman_town", + "label": { + "Urdu": "شادمان ٹاوَن", + "Roman Urdu": "Shadman Town", + "English": "Shadman Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "buffer_zone", + "label": { + "Urdu": "بفرزون", + "Roman Urdu": "Buffer Zone", + "English": "Buffer Zone" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "buffer_zone_ii", + "label": { + "Urdu": "بفرزون 2", + "Roman Urdu": "Buffer Zone II", + "English": "Buffer Zone II" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "mominabad", + "label": { + "Urdu": "مومن آباد", + "Roman Urdu": "Mominabad", + "English": "Mominabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "haryana_colony", + "label": { + "Urdu": "حریانہ کالونی", + "Roman Urdu": "Haryana Colony", + "English": "Haryana Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "hanifabad", + "label": { + "Urdu": "حنیف آباد", + "Roman Urdu": "Hanifabad", + "English": "Hanifabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "mohammad_nagar", + "label": { + "Urdu": "محمد نگر", + "Roman Urdu": "Mohammad Nagar", + "English": "Mohammad Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "madina_colony_orangi", + "label": { + "Urdu": "مدینہ کالونی اورنگی", + "Roman Urdu": "Madina Colony Orangi", + "English": "Madina Colony Orangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "ghaziabad", + "label": { + "Urdu": "غازی آباد", + "Roman Urdu": "Ghaziabad", + "English": "Ghaziabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "chisti_nagar", + "label": { + "Urdu": "چشتی نگر", + "Roman Urdu": "Chisti Nagar", + "English": "Chisti Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "bilal_colony_orangi", + "label": { + "Urdu": "بلال کالونی اورنگی", + "Roman Urdu": "Bilal Colony Orangi", + "English": "Bilal Colony Orangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "iqbal_baloch_colony", + "label": { + "Urdu": "اقبال بلوچ کالونی", + "Roman Urdu": "Iqbal Baloch Colony", + "English": "Iqbal Baloch Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "ghabool_town", + "label": { + "Urdu": "گبول ٹاوَن", + "Roman Urdu": "Ghabool Town", + "English": "Ghabool Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "data_nagar", + "label": { + "Urdu": "داتا نگر", + "Roman Urdu": "Data Nagar", + "English": "Data Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "mujahidabad", + "label": { + "Urdu": "مجاہد آباد", + "Roman Urdu": "Mujahidabad", + "English": "Mujahidabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "baloch_goth", + "label": { + "Urdu": "بلوچ گوٹھ", + "Roman Urdu": "Baloch Goth", + "English": "Baloch Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "old_haji_camp", + "label": { + "Urdu": "پرانہ حاجی کیمپ", + "Roman Urdu": "Old Haji Camp", + "English": "Old Haji Camp" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "garden", + "label": { + "Urdu": "گارڈن", + "Roman Urdu": "Garden", + "English": "Garden" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "kharadar", + "label": { + "Urdu": "کھارادر", + "Roman Urdu": "Kharadar", + "English": "Kharadar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "city_railway_colony", + "label": { + "Urdu": "سٹی ریلوے کالونی", + "Roman Urdu": "City Railway Colony", + "English": "City Railway Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "nanak_wara", + "label": { + "Urdu": "ناناک واڑا", + "Roman Urdu": "Nanak Wara", + "English": "Nanak Wara" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "gazdarabad", + "label": { + "Urdu": "گزدرآباد", + "Roman Urdu": "Gazdarabad", + "English": "Gazdarabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "millat_nagar_islam_pura", + "label": { + "Urdu": "ملت نگر اسلام پورا", + "Roman Urdu": "Millat Nagar/Islam Pura", + "English": "Millat Nagar/Islam Pura" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "saddar_uc", + "label": { + "Urdu": "صدر یو سی", + "Roman Urdu": "Saddar UC", + "English": "Saddar UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "civil_line", + "label": { + "Urdu": "سول لائن", + "Roman Urdu": "Civil Line", + "English": "Civil Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "clifton", + "label": { + "Urdu": "کلفٹن", + "Roman Urdu": "Clifton", + "English": "Clifton" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "kehkashan", + "label": { + "Urdu": "کہکشان", + "Roman Urdu": "Kehkashan", + "English": "Kehkashan" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "natha_khan_goth", + "label": { + "Urdu": "ناتھا خان گوٹھ", + "Roman Urdu": "Natha Khan Goth", + "English": "Natha Khan Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "pak_sadat_colony", + "label": { + "Urdu": "پاک صدر کالونی", + "Roman Urdu": "Pak Sadat Colony", + "English": "Pak Sadat Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "drigh_colony", + "label": { + "Urdu": "ڈرگ کالونی", + "Roman Urdu": "Drigh Colony", + "English": "Drigh Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "raita_plot", + "label": { + "Urdu": "رائتا پلاٹ", + "Roman Urdu": "Raita Plot", + "English": "Raita Plot" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "moria_khan_goth", + "label": { + "Urdu": "موریا خان گوٹھ", + "Roman Urdu": "Moria Khan Goth", + "English": "Moria Khan Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "rafa_e_aam_society", + "label": { + "Urdu": "رفا عام سوسا ئٹی", + "Roman Urdu": "Rafa-e-Aam Society", + "English": "Rafa-e-Aam Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "al_falah_society", + "label": { + "Urdu": "الفلاح سوسا ئٹی", + "Roman Urdu": "Al-Falah Society", + "English": "Al-Falah Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "pak_colony", + "label": { + "Urdu": "پاک کالونی", + "Roman Urdu": "Pak Colony", + "English": "Pak Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "old_golimar", + "label": { + "Urdu": "پرانہ گولی مار", + "Roman Urdu": "Old Golimar", + "English": "Old Golimar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "jahanabad", + "label": { + "Urdu": "جہان آباد", + "Roman Urdu": "Jahanabad", + "English": "Jahanabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "metrovil", + "label": { + "Urdu": "میٹروویل", + "Roman Urdu": "Metrovil", + "English": "Metrovil" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "bhawani_chali", + "label": { + "Urdu": "بہوانی چالی", + "Roman Urdu": "Bhawani Chali", + "English": "Bhawani Chali" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "frontier_colony", + "label": { + "Urdu": "فرونٹر کالونی", + "Roman Urdu": "Frontier Colony", + "English": "Frontier Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "banaras_colony", + "label": { + "Urdu": "بنارس کالونی", + "Roman Urdu": "Banaras Colony", + "English": "Banaras Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "qasba_colony", + "label": { + "Urdu": "قصبہ کالونی", + "Roman Urdu": "Qasba Colony", + "English": "Qasba Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "islamia_colony", + "label": { + "Urdu": "اسلامیہ کالونی", + "Roman Urdu": "Islamia Colony", + "English": "Islamia Colony" + } + }, + { + "province": "na", + "city": "na", + "town": "na", + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + }, + { + "province": "na", + "city": "na", + "town": "na", + "name": "not_applicable", + "label": { + "Urdu": "قابل اطلاق نہیں", + "Roman Urdu": "Qaabil-e-atlaaq nahi", + "English": "Not Applicable" + } + } + ], + "gender": [ + { + "instance": { + "openmrs_code": "1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "male", + "label": { + "Urdu": "مرد/ لڑکا", + "Roman Urdu": "Mard/larka", + "English": "Male" + } + }, + { + "instance": { + "openmrs_code": "1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "female", + "label": { + "Urdu": "عورت/لڑکی", + "Roman Urdu": "Aurat/larki", + "English": "Female" + } + }, + { + "instance": { + "openmrs_code": "163163AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "transgender", + "label": { + "Urdu": "خواجہ سرہ", + "Roman Urdu": "Khwaja sira", + "English": "Transgender" + } + } + ], + "vaccines": [ + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT1", + "label": { + "Urdu": "ٹی ٹی 1", + "Roman Urdu": "TT1", + "English": "TT1" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT2", + "label": { + "Urdu": "ٹی ٹی 2", + "Roman Urdu": "TT2", + "English": "TT2" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT3", + "label": { + "Urdu": "ٹی ٹی 3", + "Roman Urdu": "TT3", + "English": "TT3" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT4", + "label": { + "Urdu": "ٹی ٹی 4", + "Roman Urdu": "TT4", + "English": "TT4" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT5", + "label": { + "Urdu": "ٹی ٹی 5", + "Roman Urdu": "TT5", + "English": "TT5" + } + } + ], + "towns": [ + { + "province": "sindh", + "city": "karachi", + "name": "korangi", + "label": { + "Urdu": "کورنگی", + "Roman Urdu": "Korangi", + "English": "Korangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "landhi", + "label": { + "Urdu": "لانڈھی", + "Roman Urdu": "Landhi", + "English": "Landhi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "baldia", + "label": { + "Urdu": "بلدیہ", + "Roman Urdu": "Baldia", + "English": "Baldia" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "bin_qasim", + "label": { + "Urdu": "بن قاسم", + "Roman Urdu": "Bin Qasim", + "English": "Bin Qasim" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "gadap", + "label": { + "Urdu": "گڈاپ", + "Roman Urdu": "Gadap", + "English": "Gadap" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "gulberg", + "label": { + "Urdu": "گلبرگ", + "Roman Urdu": "Gulberg", + "English": "Gulberg" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "gulshan", + "label": { + "Urdu": "گلشن", + "Roman Urdu": "Gulshan", + "English": "Gulshan" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "jamshed", + "label": { + "Urdu": "جمشید", + "Roman Urdu": "Jamshed", + "English": "Jamshed" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "kiamari", + "label": { + "Urdu": "کیماری", + "Roman Urdu": "Kiamari", + "English": "Kiamari" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "liaquatabad", + "label": { + "Urdu": "لیاقت آباد", + "Roman Urdu": "Liaquatabad", + "English": "Liaquatabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "lyari", + "label": { + "Urdu": "لیاری", + "Roman Urdu": "Lyari", + "English": "Lyari" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "malir", + "label": { + "Urdu": "ملیر", + "Roman Urdu": "Malir", + "English": "Malir" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "new_karachi", + "label": { + "Urdu": "نیو کراچی", + "Roman Urdu": "New Karachi", + "English": "New Karachi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "north_nazimabad", + "label": { + "Urdu": "نارتھ ناظم آباد", + "Roman Urdu": "North Nazimabad", + "English": "North Nazimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "orangi", + "label": { + "Urdu": "اورنگی", + "Roman Urdu": "Orangi", + "English": "Orangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "saddar", + "label": { + "Urdu": "صدر", + "Roman Urdu": "Saddar", + "English": "Saddar" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "shah_faisal", + "label": { + "Urdu": "شاہ فیصل", + "Roman Urdu": "Shah Faisal", + "English": "Shah Faisal" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "site", + "label": { + "Urdu": "سائٹ", + "Roman Urdu": "S.I.T.E.", + "English": "S.I.T.E." + } + }, + { + "province": "na", + "city": "na", + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + }, + { + "province": "na", + "city": "na", + "name": "not_applicable", + "label": { + "Urdu": "قابل اطلاق نہیں", + "Roman Urdu": "Qaabil-e-atlaaq nahi", + "English": "Not Applicable" + } + } + ], + "cities": [ + { + "province": "sindh", + "name": "karachi", + "label": { + "Urdu": "کراچی", + "Roman Urdu": "Karachi", + "English": "Karachi" + } + }, + { + "province": "punjab", + "name": "hafizabad", + "label": { + "Urdu": "حافظ آباد", + "Roman Urdu": "Hafizabad", + "English": "Hafizabad" + } + }, + { + "province": "punjab", + "name": "muzaffargarh", + "label": { + "Urdu": "مظفر گڑھ", + "Roman Urdu": "Muzaffargarh", + "English": "Muzaffargarh" + } + }, + { + "province": "na", + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + }, + { + "province": "na", + "name": "not_applicable", + "label": { + "Urdu": "قابل اطلاق نہیں", + "Roman Urdu": "Not Applicable", + "English": "Not Applicable" + } + } + ], + "edd_lmp": [ + { + "instance": { + "openmrs_code": "5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "edd", + "label": { + "Urdu": "زچگی کی متوقع تاریخ", + "Roman Urdu": "EDD", + "English": "EDD" + } + }, + { + "instance": { + "openmrs_code": "1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "lmp", + "label": { + "Urdu": "پچھلی مہواری کی تاریخ", + "Roman Urdu": "LMP", + "English": "LMP" + } + }, + { + "instance": { + "openmrs_code": "159617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "ultrasound", + "label": { + "Urdu": "الٹرا سائونڈ", + "Roman Urdu": "Ultrasound", + "English": "Ultrasound" + } + }, + { + "instance": { + "openmrs_code": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "none", + "label": { + "Urdu": "کوئی بھی نہیں", + "Roman Urdu": "Koi bhi nahi", + "English": "None of the above" + } + } + ], + "ethnicity": [ + { + "instance": { + "openmrs_code": "163215AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "punjabi", + "label": { + "Urdu": "پنجابی", + "Roman Urdu": "Punjabi", + "English": "Punjabi" + } + }, + { + "instance": { + "openmrs_code": "163216AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pushtuns", + "label": { + "Urdu": "پشتون", + "Roman Urdu": "Pushtun", + "English": "Pushtun" + } + }, + { + "instance": { + "openmrs_code": "163217AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "sindhi", + "label": { + "Urdu": "سندھی", + "Roman Urdu": "Sindhi", + "English": "Sindhi" + } + }, + { + "instance": { + "openmrs_code": "163218AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "saraiki", + "label": { + "Urdu": "سرائیکی", + "Roman Urdu": "Saraiki", + "English": "Saraiki" + } + }, + { + "instance": { + "openmrs_code": "163219AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "muhajir", + "label": { + "Urdu": "مہاجر", + "Roman Urdu": "Muhajir", + "English": "Muhajir" + } + }, + { + "instance": { + "openmrs_code": "163220AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "balochi", + "label": { + "Urdu": "بلوچی", + "Roman Urdu": "Balochi", + "English": "Balochi" + } + }, + { + "instance": { + "openmrs_code": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + } + ], + "yes_no": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ] + }, + "instance": { + "encounter_type": "Woman TT enrollment" + }, + "version": "201604080500", + "id_string": "woman_tt_enrollement_form", + "type": "survey", + "children": [ + { + "type": "hidden", + "name": "provider_uc" + }, + { + "type": "hidden", + "name": "provider_town" + }, + { + "type": "hidden", + "name": "provider_city" + }, + { + "type": "hidden", + "name": "provider_province" + }, + { + "type": "hidden", + "name": "provider_id" + }, + { + "instance": { + "openmrs_entity_id": "location_id", + "openmrs_entity": "encounter" + }, + "type": "hidden", + "name": "provider_location_id" + }, + { + "instance": { + "openmrs_entity_id": "Program Client ID", + "openmrs_entity": "person_identifier" + }, + "type": "hidden", + "name": "existing_program_client_id" + }, + { + "type": "hidden", + "name": "provider_location_name" + }, + { + "instance": { + "openmrs_entity_id": "gender", + "openmrs_entity": "person" + }, + "type": "hidden", + "name": "gender" + }, + { + "type": "note", + "name": "provider_location_note", + "label": { + "Urdu": "شہر: ${provider_city} ; ٹائون: ${provider_town} ; یوسی: ${provider_uc} ; سینٹرکا نام: ${provider_location_name}", + "English": "City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}", + "Roman Urdu": "Shehr: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center ka naam: ${provider_location_name}" + } + }, + { + "instance": { + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "start", + "name": "start" + }, + { + "instance": { + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "end", + "name": "end" + }, + { + "instance": { + "openmrs_entity_id": "163286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "today", + "name": "today" + }, + { + "instance": { + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "deviceid", + "name": "deviceid" + }, + { + "instance": { + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "subscriberid", + "name": "subscriberid" + }, + { + "instance": { + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "simserial", + "name": "simserial" + }, + { + "instance": { + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "phonenumber", + "name": "phonenumber" + }, + { + "name": "client_reg_date", + "hint": { + "Urdu": "خاتون کو ویکسین لگنے کی تاریخ", + "English": "Date on which woman was vaccinated", + "Roman Urdu": "Khatoon ko vaccine lagnay ki tareekh" + }, + "bind": { + "jr:constraintMsg": { + "Urdu": "پروگرام مین اندراج کی تاریخ مستقبل کی نہیں ہوسکتی", + "English": "Client registration date cannot be in the future", + "Roman Urdu": "Program mai andraaj ki tareekh mustaqbil ki nahi hosakti" + }, + "required": "yes", + "constraint": ".<=${today}" + }, + "label": { + "Urdu": "پروگرام میں اندراج کی تاریخ", + "English": "Client Registration date", + "Roman Urdu": "Program mai andraj ki tareekh" + }, + "instance": { + "openmrs_entity_id": "encounter_date", + "openmrs_entity": "encounter" + }, + "type": "date" + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "program_client_id", + "label": { + "Urdu": "کلائنٹ کی پروگرام آئی ڈی {existing_program_client_id}$", + "Roman Urdu": "Client ki program ID ${existing_program_client_id}", + "English": "Program Client ID ${existing_program_client_id}" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "نمبر آٹھ ہندسوں پر مشتمل ہونا چاہئے", + "English": "Number should be 8 digits", + "Roman Urdu": "Number 8 hindason par mushtamil hona chahiye" + }, + "required": "yes", + "constraint": "string-length(.) = 8" + }, + "type": "integer", + "instance": { + "openmrs_entity_id": "EPI Card Number", + "openmrs_entity": "person_attribute" + }, + "name": "epi_card_number", + "label": { + "Urdu": "کارڈ نمبر", + "English": "EPI Card Number", + "Roman Urdu": "EPI Card Number" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "نام تین سے پچیس حروف پر مشتمل ہونا چاہئے", + "English": "Name should be 3 to 25 characters long", + "Roman Urdu": "Naam 3 say 25 huroof par mushtamil hona chahiye" + }, + "required": "yes", + "constraint": "regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')" + }, + "type": "text", + "instance": { + "openmrs_entity_id": "first_name", + "openmrs_entity": "person" + }, + "name": "first_name", + "label": { + "Urdu": "نام", + "English": "First Name", + "Roman Urdu": "Naam" + } + }, + { + "default": "yes", + "label": { + "Urdu": "کیا تاریخ پیدائش معلوم ہے؟", + "Roman Urdu": "Kya tareekh-e-pedaaish maloom hai?", + "English": "Is birthdate known?" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ], + "name": "member_birth_date_known" + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "یہ تاریخ مستقبل کی نہیں ہوسکتی", + "Roman Urdu": "Ye tareekh mustaqbil ki nahi hosakti", + "English": "This date cannot be in the future" + }, + "relevant": "selected(${member_birth_date_known}, 'yes')", + "constraint": ".<=${today}" + }, + "type": "date", + "name": "member_birth_date", + "label": { + "Urdu": "تاریخ پیدائش", + "Roman Urdu": "Tareekh-e-pedaaish", + "English": "Birth date" + } + }, + { + "bind": { + "relevant": "selected(${member_birth_date_known}, 'no')" + }, + "type": "integer", + "name": "age", + "label": { + "Urdu": "عمر (سالوں میں)", + "Roman Urdu": "Umar (saalon me)", + "English": "Age (years)" + } + }, + { + "bind": { + "calculate": "int((${today} - ${member_birth_date}) div 365.25)" + }, + "type": "calculate", + "name": "calc_age" + }, + { + "bind": { + "calculate": "date(${today} - int(${age} * 365.25))" + }, + "type": "calculate", + "name": "calc_dob" + }, + { + "bind": { + "calculate": "if(${member_birth_date_known}='yes', ${member_birth_date}, ${calc_dob})" + }, + "type": "calculate", + "name": "calc_dob_confirm", + "instance": { + "openmrs_entity_id": "birthdate", + "openmrs_entity": "person" + } + }, + { + "bind": { + "calculate": "if(${member_birth_date_known} = 'yes', '0', '1')" + }, + "type": "calculate", + "name": "calc_dob_estimated", + "instance": { + "openmrs_entity_id": "birthdate_estimated", + "openmrs_entity": "person" + } + }, + { + "bind": { + "calculate": "if(${member_birth_date_known}='yes', ${calc_age}, ${age})" + }, + "type": "calculate", + "name": "calc_age_confirm", + "instance": { + "openmrs_entity_id": "154384AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } + }, + { + "type": "note", + "name": "birth_date_note", + "label": { + "Urdu": "کلائنٹ کی تاریخ پیدائش:${calc_dob_confirm}", + "English": "Date of Birth: ${calc_dob_confirm}", + "Roman Urdu": "Member ki Tareekh-e-pedaaish: ${calc_dob_confirm}" + } + }, + { + "type": "note", + "name": "note_age", + "label": { + "Urdu": "عمر :{calc_age_confirm}$ سال", + "English": "Age: ${calc_age_confirm} years", + "Roman Urdu": "Umar: ${calc_age_confirm} saal" + } + }, + { + "default": "female", + "bind": { + "required": "yes", + "calculate": "concat(\"female\",\"\")" + }, + "type": "calculate", + "name": "gender1", + "label": { + "Urdu": "جنس", + "Roman Urdu": "Jins", + "English": "Gender" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "نام تین سے پچیس حروف پر مشتمل ہونا چاہئے", + "English": "Name should be 3 to 25 characters long", + "Roman Urdu": "Naam 3 say 25 huroof par mushtamil hona chahiye" + }, + "constraint": "regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')" + }, + "type": "text", + "instance": { + "openmrs_entity_id": "1594AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "father_name", + "label": { + "Urdu": "والد کا نام", + "English": "Father's Name", + "Roman Urdu": "Waalid ka naam" + } + }, + { + "label": { + "Urdu": "کیا آپ شادی شدہ ہیں؟", + "English": "Are you married?", + "Roman Urdu": "Kya aap shaadi shuda hain?" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ], + "name": "marriage" + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "نام تین سے پچیس حروف پر مشتمل ہونا چاہئے", + "English": "Name should be 3 to 25 characters long", + "Roman Urdu": "Naam 3 say 25 huroof par mushtamil hona chahiye" + }, + "relevant": "selected(${marriage}, 'yes')", + "constraint": "regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')" + }, + "type": "text", + "instance": { + "openmrs_entity_id": "161135AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "husband_name", + "label": { + "Urdu": "شوہر کا نام", + "English": "Husband's Name", + "Roman Urdu": "Shohar ka naam" + } + }, + { + "bind": { + "calculate": "if(${marriage} = 'no', ${father_name}, ${husband_name})" + }, + "type": "calculate", + "name": "last_name", + "instance": { + "openmrs_entity_id": "last_name", + "openmrs_entity": "person" + } + }, + { + "control": { + "appearance": "minimal" + }, + "name": "ethnicity", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "قومیت", + "English": "Ethnicity", + "Roman Urdu": "Qomiat" + }, + "instance": { + "openmrs_entity_id": "163153AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "163215AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "punjabi", + "label": { + "Urdu": "پنجابی", + "Roman Urdu": "Punjabi", + "English": "Punjabi" + } + }, + { + "instance": { + "openmrs_code": "163216AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "pushtuns", + "label": { + "Urdu": "پشتون", + "Roman Urdu": "Pushtun", + "English": "Pushtun" + } + }, + { + "instance": { + "openmrs_code": "163217AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "sindhi", + "label": { + "Urdu": "سندھی", + "Roman Urdu": "Sindhi", + "English": "Sindhi" + } + }, + { + "instance": { + "openmrs_code": "163218AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "saraiki", + "label": { + "Urdu": "سرائیکی", + "Roman Urdu": "Saraiki", + "English": "Saraiki" + } + }, + { + "instance": { + "openmrs_code": "163219AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "muhajir", + "label": { + "Urdu": "مہاجر", + "Roman Urdu": "Muhajir", + "English": "Muhajir" + } + }, + { + "instance": { + "openmrs_code": "163220AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "balochi", + "label": { + "Urdu": "بلوچی", + "Roman Urdu": "Balochi", + "English": "Balochi" + } + }, + { + "instance": { + "openmrs_code": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + } + ] + }, + { + "bind": { + "relevant": "selected(${ethnicity}, 'other')" + }, + "type": "text", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "163330AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "ethnicity_other", + "label": { + "Urdu": "وضاحت کریں", + "Roman Urdu": "Wazaahat karain", + "English": "Please specify:" + } + }, + { + "control": { + "appearance": "minimal" + }, + "name": "province", + "default": "${provider_province}", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "صوبہ", + "Roman Urdu": "Suba", + "English": "Province" + }, + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "stateProvince", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one", + "children": [ + { + "name": "kpk", + "label": { + "Urdu": "خیبر پختون خواہ", + "English": "Khyber Pakhtunkhwa", + "Roman Urdu": "Khyber Pakhtunkhwa" + } + }, + { + "name": "sindh", + "label": { + "Urdu": "سندھ", + "English": "Sindh", + "Roman Urdu": "Sindh" + } + }, + { + "name": "balochistan", + "label": { + "Urdu": "بلوچستان", + "English": "Balochistan", + "Roman Urdu": "Balochistan" + } + }, + { + "name": "punjab", + "label": { + "Urdu": "پنجاب", + "English": "Punjab", + "Roman Urdu": "Punjab" + } + }, + { + "name": "gilgit_baltistan", + "label": { + "Urdu": "گلگت بلتستان", + "English": "Gilgit Baltistan", + "Roman Urdu": "Gilgit Baltistan" + } + }, + { + "name": "kashmir", + "label": { + "Urdu": "کشمیر", + "English": "Kashmir", + "Roman Urdu": "Kashmir" + } + }, + { + "name": "fata", + "label": { + "Urdu": "فاٹا", + "English": "FATA", + "Roman Urdu": "FATA" + } + }, + { + "name": "out_of_country", + "label": { + "Urdu": "ملک سے باہر", + "English": "Out of Country", + "Roman Urdu": "Mulk se baahir" + } + } + ] + }, + { + "control": { + "appearance": "minimal" + }, + "name": "city_village", + "choice_filter": "province=${province} or province='na'", + "default": "${provider_city}", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "شہر", + "Roman Urdu": "Shehr", + "English": "City" + }, + "itemset": "cities", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "cityVillage", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "town", + "choice_filter": "(province=${province} and city=${city_village} ) or city='na'", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "ٹاٰئون/ قصبہ/ بستی", + "Roman Urdu": "Town / Qasbah / Basti", + "English": "Town" + }, + "itemset": "towns", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "town", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "union_council", + "choice_filter": "(province=${province} and city=${city_village} and town=${town}) or town='na'", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "یونین کونسل", + "Roman Urdu": "Union Council", + "English": "Union Council" + }, + "itemset": "ucs", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "subTown", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one" + }, + { + "bind": { + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "house", + "openmrs_entity_parent": "usual_residence" + }, + "name": "house_number", + "label": { + "Urdu": "گھر کا نمبر", + "Roman Urdu": "Ghar ka number", + "English": "House Number" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "street", + "openmrs_entity_parent": "usual_residence" + }, + "name": "street", + "label": { + "Urdu": "گلی/کالونی/محلہ", + "Roman Urdu": "Gali/Colony/Mohalla", + "English": "Street" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "landmark", + "openmrs_entity_parent": "usual_residence" + }, + "name": "landmark", + "label": { + "Urdu": "گھر کے قریب کوئی مشہور جگہ", + "Roman Urdu": "Ghar ke qareeb koi mashoor jagah", + "English": "Land Mark" + } + }, + { + "bind": { + "calculate": "jr:choice-name(${province}, '${province}')" + }, + "type": "calculate", + "name": "provincename" + }, + { + "bind": { + "calculate": "jr:choice-name(${city_village}, '${city_village}')" + }, + "type": "calculate", + "name": "city_villagename" + }, + { + "bind": { + "calculate": "jr:choice-name(${town}, '${town}')" + }, + "type": "calculate", + "name": "townname" + }, + { + "bind": { + "calculate": "jr:choice-name(${union_council}, '${union_council}')" + }, + "type": "calculate", + "name": "union_councilname" + }, + { + "type": "note", + "name": "address", + "label": { + "Urdu": "پتہ: ${house_number}, ${street}, ${landmark}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}", + "English": "Address: ${house_number}, ${street}, ${landmark}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}", + "Roman Urdu": "Pata: ${house_number}, ${street}, ${landmark}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}" + } + }, + { + "instance": { + "openmrs_entity_id": "163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "geopoint", + "name": "centre_gps", + "label": { + "Urdu": "حاصل کردہ معلومات کی جگہ کے GPS کارڈینیٹس درج کریں", + "English": "Collect GPS coordinates of data entry location", + "Roman Urdu": "Hasil karda malomaat ki jaga ke GPS coordinates darj karain" + } + }, + { + "name": "reminders_approval", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "کیا آپ اپنے بچے کی اگلی ویکسین کی تاریخ کے لیے SMS موصول کرنا چاہتے ہیں؟", + "English": "Are you willing to receive SMS reminders for your next visit?", + "Roman Urdu": "Kya aap apnay bachay ki agli vaccine ki tareekh ke liye SMS mausool karna chahtay hain?" + }, + "instance": { + "openmrs_entity_id": "163089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ] + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "فون نمبر گیارہ ہندسوں پر مشتمل اور مندرجہ ذیل شکل میں ہونا چاہئے: *********03", + "English": "Phone number should be 11 digits in the following format: 03*********", + "Roman Urdu": "Phone number 11 hindason par mushtamil aur mundarja zail shakal main hona chahiey: 03*********" + }, + "relevant": "${reminders_approval}='yes'", + "constraint": "regex(., '^03[0-9]{9}$')" + }, + "type": "text", + "instance": { + "openmrs_entity_id": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "contact_phone_number", + "label": { + "Urdu": "موبائل نمبر:", + "English": "Mobile Number:", + "Roman Urdu": "Mobile number:" + } + }, + { + "instance": { + "openmrs_entity_id": "5272AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "label": { + "Urdu": "کیا خا تون حاملہ ہیں؟", + "English": "Is female pregnant?", + "Roman Urdu": "Kia khatoon haamla hain?" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ], + "name": "pregnant" + }, + { + "name": "edd_lmp", + "bind": { + "relevant": "selected (${pregnant}, 'yes')" + }, + "label": { + "Urdu": "کیا آپ کو اپنی پچھلی ماہواری کی تاریخ، زچگی کی متوقع تاریخ، یا الٹرا سائونڈ کا علم ہے؟", + "English": "Do you know your LMP, EDD or last Ultrasound information?", + "Roman Urdu": "Kya aap ko apni pichli mahwaari ki tareekh, zachgi ki mutawaqqa tareekh ya ultrasound ka ilm hai?" + }, + "instance": { + "openmrs_entity_id": "160697AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "edd", + "label": { + "Urdu": "زچگی کی متوقع تاریخ", + "Roman Urdu": "EDD", + "English": "EDD" + } + }, + { + "instance": { + "openmrs_code": "1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "lmp", + "label": { + "Urdu": "پچھلی مہواری کی تاریخ", + "Roman Urdu": "LMP", + "English": "LMP" + } + }, + { + "instance": { + "openmrs_code": "159617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "ultrasound", + "label": { + "Urdu": "الٹرا سائونڈ", + "Roman Urdu": "Ultrasound", + "English": "Ultrasound" + } + }, + { + "instance": { + "openmrs_code": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "none", + "label": { + "Urdu": "کوئی بھی نہیں", + "Roman Urdu": "Koi bhi nahi", + "English": "None of the above" + } + } + ] + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "زچگی کی متوقع تاریخ ماضی کی نہیں ہو سکتی", + "Roman Urdu": "Zachgi ki mutawaqqa tareekh maazi ki nahi hosakti", + "English": "EDD cannot be in the past" + }, + "relevant": "selected (${edd_lmp}, 'edd')", + "constraint": ".>=${today}" + }, + "type": "date", + "name": "edd", + "label": { + "Urdu": "زچگی کی متوقع تاریخ", + "Roman Urdu": "Zachgi ki mutawaqqa tareekh", + "English": "EDD" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "پچھلی ماہواری کی تاریخ مستقبل کی نہیں ہوسکتی", + "Roman Urdu": "Pichli mahwaari ki tareekh mustaqbil ki nahi hosakti", + "English": "LMP cannot be in the future" + }, + "relevant": "selected (${edd_lmp}, 'lmp')", + "constraint": ".<=${today}" + }, + "type": "date", + "name": "lmp", + "label": { + "Urdu": "پچھلی ماہواری کی تاریخ", + "Roman Urdu": "Pichli mahwaari ki tareekh", + "English": "LMP" + } + }, + { + "bind": { + "relevant": "selected (${edd_lmp}, 'ultrasound')" + }, + "type": "date", + "instance": { + "openmrs_entity_id": "163165AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "ultrasound_date", + "label": { + "Urdu": "الٹرا سائونڈ کی تاریخ", + "English": "Ultrasound Date", + "Roman Urdu": "Ultrasound ki tareekh" + } + }, + { + "bind": { + "relevant": "selected (${edd_lmp}, 'ultrasound')" + }, + "type": "integer", + "name": "ultrasound_weeks", + "label": { + "Urdu": "الٹرا سائونڈ کی مدد سے حمل کی مدت [ہفتوں میں]", + "Roman Urdu": "Ultrasound ki madad se hamal ki muddat (hafton me)", + "English": "Gestational age determined by ultrasound" + } + }, + { + "bind": { + "calculate": "date(${lmp}+280)" + }, + "type": "calculate", + "name": "edd_calc_lmp" + }, + { + "bind": { + "calculate": "date((280-(${ultrasound_weeks}*7)+${ultrasound_date} ))" + }, + "type": "calculate", + "name": "edd_calc_ultrasound" + }, + { + "bind": { + "calculate": "format-date(${edd_calc_lmp}, '%Y-%n-%e')" + }, + "type": "calculate", + "name": "edd_calc_lmp_formatted" + }, + { + "bind": { + "calculate": "format-date(${edd_calc_ultrasound}, '%Y-%n-%e')" + }, + "type": "calculate", + "name": "edd_calc_ultrasound_formatted" + }, + { + "bind": { + "calculate": "date(${edd}-280)" + }, + "type": "calculate", + "name": "lmp_calc_edd" + }, + { + "bind": { + "calculate": "date(${ultrasound_date}-(${ultrasound_weeks}*7))" + }, + "type": "calculate", + "name": "lmp_calc_ultrasound" + }, + { + "bind": { + "calculate": "format-date(${lmp_calc_edd}, '%Y-%n-%e')" + }, + "type": "calculate", + "name": "lmp_calc_edd_formatted" + }, + { + "bind": { + "calculate": "format-date(${lmp_calc_ultrasound}, '%Y-%n-%e')" + }, + "type": "calculate", + "name": "lmp_calc_ultrasound_formatted" + }, + { + "bind": { + "calculate": "if(${edd_lmp}='lmp',${edd_calc_lmp_formatted},if(${edd_lmp}='edd',${edd} ,if(${edd_lmp}='ultrasound',${edd_calc_ultrasound_formatted},'')))" + }, + "type": "calculate", + "name": "final_edd", + "instance": { + "openmrs_entity_id": "5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } + }, + { + "bind": { + "calculate": "if(${edd_lmp}='lmp',${lmp},if(${edd_lmp}='edd',${lmp_calc_edd_formatted} ,if(${edd_lmp}='ultrasound',${lmp_calc_ultrasound_formatted},'')))" + }, + "type": "calculate", + "name": "final_lmp", + "instance": { + "openmrs_entity_id": "1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } + }, + { + "bind": { + "calculate": "int((${today} - (${edd}-280))div7)" + }, + "type": "calculate", + "name": "ga_edd" + }, + { + "bind": { + "calculate": "int((${today} - ${lmp})div7)" + }, + "type": "calculate", + "name": "ga_lmp" + }, + { + "bind": { + "calculate": "int((${today} -(${ultrasound_date}-(${ultrasound_weeks}*7)))div7)" + }, + "type": "calculate", + "name": "ga_ult" + }, + { + "bind": { + "relevant": "selected (${pregnant}, 'yes')" + }, + "type": "note", + "name": "final_edd_note", + "label": { + "Urdu": "${final_edd}: زچگی کی متوقع تاریخ", + "Roman Urdu": "Zachgi ki mutawaqqa tareekh: ${final_edd}", + "English": "EDD: ${final_edd}" + } + }, + { + "bind": { + "relevant": "selected (${pregnant}, 'yes')" + }, + "type": "note", + "name": "final_lmp_note", + "label": { + "Urdu": "پچھلی ماہواری کی تاریخ :{final_lmp}$", + "Roman Urdu": "Pichli mahwaari ki tareekh: ${final_lmp}", + "English": "LMP: ${final_lmp}" + } + }, + { + "bind": { + "calculate": "if(${edd_lmp}='lmp',${ga_lmp},if(${edd_lmp}='edd',${ga_edd} ,if(${edd_lmp}='ultrasound',${ga_ult},'')))" + }, + "type": "calculate", + "name": "final_ga", + "instance": { + "openmrs_entity_id": "163166AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } + }, + { + "bind": { + "relevant": "selected (${pregnant}, 'yes')" + }, + "type": "note", + "name": "final_ga_note", + "label": { + "Urdu": "حمل کی مُدّت: {final_ga}$ ہفتے", + "Roman Urdu": "Hamal ki muddat: ${final_ga} weeks", + "English": "GA: ${final_ga} weeks" + } + }, + { + "name": "vaccines", + "bind": { + "calculate": "minimal" + }, + "label": { + "Urdu": "پچھلی تاریخ جب کسی اور سینٹر پر ٹیکہ لگوایا گیا یا قطرے پلائے گئے", + "Roman Urdu": "Pichli tareekh jab kissi aur center par teeka lagwaya gaya ya katray pilaey gaye", + "English": "Retro vaccines" + }, + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1421AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "select all that apply", + "children": [ + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT1", + "label": { + "Urdu": "ٹی ٹی 1", + "Roman Urdu": "TT1", + "English": "TT1" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT2", + "label": { + "Urdu": "ٹی ٹی 2", + "Roman Urdu": "TT2", + "English": "TT2" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT3", + "label": { + "Urdu": "ٹی ٹی 3", + "Roman Urdu": "TT3", + "English": "TT3" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT4", + "label": { + "Urdu": "ٹی ٹی 4", + "Roman Urdu": "TT4", + "English": "TT4" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT5", + "label": { + "Urdu": "ٹی ٹی 5", + "Roman Urdu": "TT5", + "English": "TT5" + } + } + ] + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT1')", + "constraint": "(.<=${today} and .<=${client_reg_date})" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "tt1_retro", + "label": { + "Urdu": "ٹی ٹی 1", + "Roman Urdu": "TT1", + "English": "TT1" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT1')", + "calculate": "1" + }, + "type": "calculate", + "name": "tt_1_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT2')", + "constraint": "(.<=${today} and .>=${tt1_retro} and ((selected(${vaccines}, 'TT1'))))" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "tt2_retro", + "label": { + "Urdu": "ٹی ٹی 2", + "Roman Urdu": "TT2", + "English": "TT2" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT2')", + "calculate": "2" + }, + "type": "calculate", + "name": "tt_2_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT3')", + "constraint": "(.<=${today} and .>=${tt2_retro} and ((selected(${vaccines}, 'TT2'))))" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "tt3_retro", + "label": { + "Urdu": "ٹی ٹی 3", + "Roman Urdu": "TT3", + "English": "TT3" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT3')", + "calculate": "3" + }, + "type": "calculate", + "name": "tt_3_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT4')", + "constraint": "(.<=${today} and .>=${tt3_retro} and ((selected(${vaccines}, 'TT3'))))" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "tt4_retro", + "label": { + "Urdu": "ٹی ٹی 4", + "Roman Urdu": "TT4", + "English": "TT4" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT4')", + "calculate": "4" + }, + "type": "calculate", + "name": "tt_4_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "name": "vaccines_2", + "choice_filter": "name = if(selected(${vaccines}, 'TT1'), '', 'TT1') or \nname = if(selected(${vaccines}, 'TT2'), '', 'TT2') or \nname = if(selected(${vaccines}, 'TT3'), '', 'TT3') or \nname = if(selected(${vaccines}, 'TT4'), '', 'TT4') or \nname = if(selected(${vaccines}, 'TT5'), '', 'TT5')", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "آج کون کون سی ویکسین دی گئی ہیں؟", + "Roman Urdu": "Aaj kon kon si vaccine di gai hain?", + "English": "Vaccine administered today" + }, + "itemset": "vaccines", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1441AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "select all that apply" + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'TT1'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "tt1", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2},'TT1')", + "calculate": "1" + }, + "type": "calculate", + "name": "tt_1_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'TT2'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "tt2", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2},'TT2')", + "calculate": "2" + }, + "type": "calculate", + "name": "tt_2_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'TT3'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "tt3", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2},'TT3')", + "calculate": "3" + }, + "type": "calculate", + "name": "tt_3_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'TT4'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "tt4", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2},'TT4')", + "calculate": "4" + }, + "type": "calculate", + "name": "tt_4_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'TT5'),${client_reg_date},'')" + }, + "type": "calculate", + "name": "tt5", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2},'TT5')", + "calculate": "5" + }, + "type": "calculate", + "name": "tt_5_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "control": { + "bodyless": true + }, + "type": "group", + "children": [ + { + "bind": { + "readonly": "true()", + "calculate": "concat('uuid:', uuid())" + }, + "type": "calculate", + "name": "instanceID" + } + ], + "name": "meta" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/form/woman_enrollment/form.xml b/src/test/resources/form/woman_enrollment/form.xml index ebbd597bb..ef2503b96 100644 --- a/src/test/resources/form/woman_enrollment/form.xml +++ b/src/test/resources/form/woman_enrollment/form.xml @@ -1,1550 +1,2254 @@ -
+ + - +

خواتین انرولمنٹ فارم برائے ٹی ٹی ٹیکاجات - Woman TT Enrollment Form

-
- - کیا تاریخ پیدائش معلوم ہے؟ - Is birthdate known? - - Kya tareekh-e-pedaaish maloom hai? -
- - -
-
-
-
- - کیا آپ شادی شدہ ہیں؟ - Are you married? - - Kya aap shaadi shuda hain? -
- - -
-
-
-
- - کیا آپ اپنے بچے کی اگلی ویکسین کی تاریخ کے لیے SMS موصول کرنا چاہتے ہیں؟ - Are you willing to receive SMS reminders for your next visit? - - Kya aap apnay bachay ki agli vaccine ki tareekh ke liye SMS mausool karna chahtay hain? - * -
- - -
+ + + + + +
+
+ + کیا تاریخ پیدائش معلوم ہے؟ + + Is birthdate known? + + + Kya tareekh-e-pedaaish + maloom hai? + + +
+ + +
+
-
-
- - کیا خا تون حاملہ ہیں؟ - Is female pregnant? - - Kia khatoon haamla hain? -
- - -
+ + + + + +
+
+ + کیا آپ + شادی شدہ ہیں؟ + + + Are you married? + + + Kya aap shaadi shuda hain? + + +
+ + +
+
-
-
- - کیا آپ کو اپنی پچھلی ماہواری کی تاریخ، زچگی کی متوقع تاریخ، یا الٹرا سائونڈ کا علم ہے؟ - Do you know your LMP, EDD or last Ultrasound information? - - Kya aap ko apni pichli mahwaari ki tareekh, zachgi ki mutawaqqa tareekh ya ultrasound ka ilm hai? -
- - - - -
+ + + + + + + + + + + + +
+
+ + کیا آپ اپنے بچے کی اگلی ویکسین + کی تاریخ کے لیے SMS موصول کرنا چاہتے ہیں؟ + + Are you willing to receive SMS + reminders for your next visit? + + + Kya aap apnay bachay ki agli + vaccine ki tareekh ke liye SMS mausool karna chahtay hain? + + * + +
+ + +
+
-
-
- - پچھلی تاریخ جب کسی اور سینٹر پر ٹیکہ لگوایا گیا یا قطرے پلائے گئے - Retro vaccines - - Pichli tareekh jab kissi aur center par teeka lagwaya gaya ya katray pilaey gaye -
- - - - - -
+ +
+
+ + کیا خا + تون حاملہ ہیں؟ + + + Is female pregnant? + + + Kia khatoon haamla hain? + + +
+ + +
+
-
-
- - آج کون کون سی ویکسین دی گئی ہیں؟ - Vaccine administered today - - Aaj kon kon si vaccine di gai hain? - * -
- - - ٹی ٹی 1 - TT1 - - TT1 - ٹی ٹی 2 - TT2 - - TT2 - ٹی ٹی 3 - TT3 - - TT3 - ٹی ٹی 4 - TT4 - - TT4 - ٹی ٹی 5 - TT5 - - TT5 -
+
+
+ + کیا آپ + کو اپنی پچھلی ماہواری کی تاریخ، زچگی کی متوقع تاریخ، یا الٹرا سائونڈ کا علم ہے؟ + + Do + you know your LMP, EDD or last Ultrasound information? + + + + Kya aap ko apni pichli mahwaari ki tareekh, zachgi ki mutawaqqa tareekh ya ultrasound ka ilm hai? + + +
+ + + + +
+
-
+ + +
+
+ + آج + کون کون سی ویکسین دی گئی ہیں؟ + + Vaccine administered today + + + Aaj kon kon si vaccine di gai hain? + + * + +
+ + + ٹی ٹی 1 + TT1 + + TT1 + ٹی ٹی 2 + TT2 + + TT2 + ٹی ٹی 3 + TT3 + + TT3 + ٹی ٹی 4 + TT4 + + TT4 + ٹی ٹی 5 + TT5 + + TT5 + +
+
+
+ diff --git a/src/test/resources/form/woman_enrollment/form_definition.json b/src/test/resources/form/woman_enrollment/form_definition.json index 5d6cbabe3..1f18a5976 100644 --- a/src/test/resources/form/woman_enrollment/form_definition.json +++ b/src/test/resources/form/woman_enrollment/form_definition.json @@ -1,311 +1,410 @@ { - "form_data_definition_version" : "1", - "form" : { - "bind_type" : "pkwoman", - "default_bind_path" : "/model/instance/Woman_TT_Enrollment_Form/", - "fields" : [ { - "name" : "id", - "shouldLoadValue" : true - }, { - "name" : "provider_uc", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/provider_uc", - "shouldLoadValue" : true - }, { - "name" : "provider_town", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/provider_town", - "shouldLoadValue" : true - }, { - "name" : "provider_city", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/provider_city", - "shouldLoadValue" : true - }, { - "name" : "provider_province", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/provider_province", - "shouldLoadValue" : true - }, { - "name" : "provider_id", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/provider_id", - "shouldLoadValue" : true - }, { - "name" : "provider_location_id", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/provider_location_id", - "shouldLoadValue" : true - }, { - "name" : "existing_program_client_id", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/existing_program_client_id", - "shouldLoadValue" : true - }, { - "name" : "provider_location_name", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/provider_location_name", - "shouldLoadValue" : true - }, { - "name" : "gender", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/gender", - "shouldLoadValue" : true - }, { - "name" : "provider_location_note", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/provider_location_note" - }, { - "name" : "start", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/start" - }, { - "name" : "end", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/end" - }, { - "name" : "today", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/today" - }, { - "name" : "deviceid", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/deviceid" - }, { - "name" : "subscriberid", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/subscriberid" - }, { - "name" : "simserial", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/simserial" - }, { - "name" : "phonenumber", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/phonenumber" - }, { - "name" : "client_reg_date", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/client_reg_date" - }, { - "name" : "program_client_id", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/program_client_id" - }, { - "name" : "epi_card_number", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/epi_card_number" - }, { - "name" : "first_name", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/first_name" - }, { - "name" : "birth_date_known", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/member_birth_date_known" - }, { - "name" : "birth_date", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/member_birth_date" - }, { - "name" : "age", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/age" - }, { - "name" : "calc_age", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/calc_age" - }, { - "name" : "calc_dob", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/calc_dob" - }, { - "name" : "dob", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/calc_dob_confirm" - }, { - "name" : "calc_dob_estimated", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/calc_dob_estimated" - }, { - "name" : "calc_age_confirm", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/calc_age_confirm" - }, { - "name" : "birth_date_note", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/birth_date_note" - }, { - "name" : "note_age", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/note_age" - }, { - "name" : "gender1", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/gender1" - }, { - "name" : "father_name", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/father_name" - }, { - "name" : "marriage", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/marriage" - }, { - "name" : "husband_name", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/husband_name" - }, { - "name" : "last_name", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/last_name" - }, { - "name" : "ethnicity", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/ethnicity" - }, { - "name" : "ethnicity_other", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/ethnicity_other" - }, { - "name" : "province", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/province" - }, { - "name" : "city_village", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/city_village" - }, { - "name" : "town", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/town" - }, { - "name" : "union_council", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/union_council" - }, { - "name" : "house_number", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/house_number" - }, { - "name" : "street", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/street" - }, { - "name" : "landmark", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/landmark" - }, { - "name" : "provincename", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/provincename" - }, { - "name" : "city_villagename", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/city_villagename" - }, { - "name" : "townname", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/townname" - }, { - "name" : "union_councilname", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/union_councilname" - }, { - "name" : "address", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/address" - }, { - "name" : "centre_gps", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/centre_gps" - }, { - "name" : "reminders_approval", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/reminders_approval" - }, { - "name" : "contact_phone_number", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/contact_phone_number" - }, { - "name" : "pregnant", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/pregnant" - }, { - "name" : "edd_lmp", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/edd_lmp" - }, { - "name" : "edd", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/edd" - }, { - "name" : "lmp", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/lmp" - }, { - "name" : "ultrasound_date", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/ultrasound_date" - }, { - "name" : "ultrasound_weeks", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/ultrasound_weeks" - }, { - "name" : "edd_calc_lmp", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/edd_calc_lmp" - }, { - "name" : "edd_calc_ultrasound", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/edd_calc_ultrasound" - }, { - "name" : "edd_calc_lmp_formatted", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/edd_calc_lmp_formatted" - }, { - "name" : "edd_calc_ultrasound_formatted", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/edd_calc_ultrasound_formatted" - }, { - "name" : "lmp_calc_edd", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/lmp_calc_edd" - }, { - "name" : "lmp_calc_ultrasound", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/lmp_calc_ultrasound" - }, { - "name" : "lmp_calc_edd_formatted", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/lmp_calc_edd_formatted" - }, { - "name" : "lmp_calc_ultrasound_formatted", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/lmp_calc_ultrasound_formatted" - }, { - "name" : "final_edd", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/final_edd" - }, { - "name" : "final_lmp", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/final_lmp" - }, { - "name" : "ga_edd", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/ga_edd" - }, { - "name" : "ga_lmp", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/ga_lmp" - }, { - "name" : "ga_ult", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/ga_ult" - }, { - "name" : "final_edd_note", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/final_edd_note" - }, { - "name" : "final_lmp_note", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/final_lmp_note" - }, { - "name" : "final_ga", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/final_ga" - }, { - "name" : "final_ga_note", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/final_ga_note" - }, { - "name" : "vaccines", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/vaccines" - }, { - "name" : "tt1_retro", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt1_retro" - }, { - "name" : "tt_1_dose", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt_1_dose" - }, { - "name" : "tt2_retro", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt2_retro" - }, { - "name" : "tt_2_dose", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt_2_dose" - }, { - "name" : "tt3_retro", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt3_retro" - }, { - "name" : "tt_3_dose", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt_3_dose" - }, { - "name" : "tt4_retro", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt4_retro" - }, { - "name" : "tt_4_dose", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt_4_dose" - }, { - "name" : "vaccines_2", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/vaccines_2" - }, { - "name" : "tt1", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt1" - }, { - "name" : "tt_1_dose_today", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt_1_dose_today" - }, { - "name" : "tt2", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt2" - }, { - "name" : "tt_2_dose_today", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt_2_dose_today" - }, { - "name" : "tt3", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt3" - }, { - "name" : "tt_3_dose_today", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt_3_dose_today" - }, { - "name" : "tt4", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt4" - }, { - "name" : "tt_4_dose_today", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt_4_dose_today" - }, { - "name" : "tt5", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt5" - }, { - "name" : "tt_5_dose_today", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/tt_5_dose_today" - }, { - "name" : "instanceID", - "bind" : "/model/instance/Woman_TT_Enrollment_Form/meta/instanceID" - } ] + "form_data_definition_version": "1", + "form": { + "bind_type": "pkwoman", + "default_bind_path": "/model/instance/Woman_TT_Enrollment_Form/", + "fields": [ + { + "name": "id", + "shouldLoadValue": true + }, + { + "name": "provider_uc", + "bind": "/model/instance/Woman_TT_Enrollment_Form/provider_uc", + "shouldLoadValue": true + }, + { + "name": "provider_town", + "bind": "/model/instance/Woman_TT_Enrollment_Form/provider_town", + "shouldLoadValue": true + }, + { + "name": "provider_city", + "bind": "/model/instance/Woman_TT_Enrollment_Form/provider_city", + "shouldLoadValue": true + }, + { + "name": "provider_province", + "bind": "/model/instance/Woman_TT_Enrollment_Form/provider_province", + "shouldLoadValue": true + }, + { + "name": "provider_id", + "bind": "/model/instance/Woman_TT_Enrollment_Form/provider_id", + "shouldLoadValue": true + }, + { + "name": "provider_location_id", + "bind": "/model/instance/Woman_TT_Enrollment_Form/provider_location_id", + "shouldLoadValue": true + }, + { + "name": "existing_program_client_id", + "bind": "/model/instance/Woman_TT_Enrollment_Form/existing_program_client_id", + "shouldLoadValue": true + }, + { + "name": "provider_location_name", + "bind": "/model/instance/Woman_TT_Enrollment_Form/provider_location_name", + "shouldLoadValue": true + }, + { + "name": "gender", + "bind": "/model/instance/Woman_TT_Enrollment_Form/gender", + "shouldLoadValue": true + }, + { + "name": "provider_location_note", + "bind": "/model/instance/Woman_TT_Enrollment_Form/provider_location_note" + }, + { + "name": "start", + "bind": "/model/instance/Woman_TT_Enrollment_Form/start" + }, + { + "name": "end", + "bind": "/model/instance/Woman_TT_Enrollment_Form/end" + }, + { + "name": "today", + "bind": "/model/instance/Woman_TT_Enrollment_Form/today" + }, + { + "name": "deviceid", + "bind": "/model/instance/Woman_TT_Enrollment_Form/deviceid" + }, + { + "name": "subscriberid", + "bind": "/model/instance/Woman_TT_Enrollment_Form/subscriberid" + }, + { + "name": "simserial", + "bind": "/model/instance/Woman_TT_Enrollment_Form/simserial" + }, + { + "name": "phonenumber", + "bind": "/model/instance/Woman_TT_Enrollment_Form/phonenumber" + }, + { + "name": "client_reg_date", + "bind": "/model/instance/Woman_TT_Enrollment_Form/client_reg_date" + }, + { + "name": "program_client_id", + "bind": "/model/instance/Woman_TT_Enrollment_Form/program_client_id" + }, + { + "name": "epi_card_number", + "bind": "/model/instance/Woman_TT_Enrollment_Form/epi_card_number" + }, + { + "name": "first_name", + "bind": "/model/instance/Woman_TT_Enrollment_Form/first_name" + }, + { + "name": "birth_date_known", + "bind": "/model/instance/Woman_TT_Enrollment_Form/member_birth_date_known" + }, + { + "name": "birth_date", + "bind": "/model/instance/Woman_TT_Enrollment_Form/member_birth_date" + }, + { + "name": "age", + "bind": "/model/instance/Woman_TT_Enrollment_Form/age" + }, + { + "name": "calc_age", + "bind": "/model/instance/Woman_TT_Enrollment_Form/calc_age" + }, + { + "name": "calc_dob", + "bind": "/model/instance/Woman_TT_Enrollment_Form/calc_dob" + }, + { + "name": "dob", + "bind": "/model/instance/Woman_TT_Enrollment_Form/calc_dob_confirm" + }, + { + "name": "calc_dob_estimated", + "bind": "/model/instance/Woman_TT_Enrollment_Form/calc_dob_estimated" + }, + { + "name": "calc_age_confirm", + "bind": "/model/instance/Woman_TT_Enrollment_Form/calc_age_confirm" + }, + { + "name": "birth_date_note", + "bind": "/model/instance/Woman_TT_Enrollment_Form/birth_date_note" + }, + { + "name": "note_age", + "bind": "/model/instance/Woman_TT_Enrollment_Form/note_age" + }, + { + "name": "gender1", + "bind": "/model/instance/Woman_TT_Enrollment_Form/gender1" + }, + { + "name": "father_name", + "bind": "/model/instance/Woman_TT_Enrollment_Form/father_name" + }, + { + "name": "marriage", + "bind": "/model/instance/Woman_TT_Enrollment_Form/marriage" + }, + { + "name": "husband_name", + "bind": "/model/instance/Woman_TT_Enrollment_Form/husband_name" + }, + { + "name": "last_name", + "bind": "/model/instance/Woman_TT_Enrollment_Form/last_name" + }, + { + "name": "ethnicity", + "bind": "/model/instance/Woman_TT_Enrollment_Form/ethnicity" + }, + { + "name": "ethnicity_other", + "bind": "/model/instance/Woman_TT_Enrollment_Form/ethnicity_other" + }, + { + "name": "province", + "bind": "/model/instance/Woman_TT_Enrollment_Form/province" + }, + { + "name": "city_village", + "bind": "/model/instance/Woman_TT_Enrollment_Form/city_village" + }, + { + "name": "town", + "bind": "/model/instance/Woman_TT_Enrollment_Form/town" + }, + { + "name": "union_council", + "bind": "/model/instance/Woman_TT_Enrollment_Form/union_council" + }, + { + "name": "house_number", + "bind": "/model/instance/Woman_TT_Enrollment_Form/house_number" + }, + { + "name": "street", + "bind": "/model/instance/Woman_TT_Enrollment_Form/street" + }, + { + "name": "landmark", + "bind": "/model/instance/Woman_TT_Enrollment_Form/landmark" + }, + { + "name": "provincename", + "bind": "/model/instance/Woman_TT_Enrollment_Form/provincename" + }, + { + "name": "city_villagename", + "bind": "/model/instance/Woman_TT_Enrollment_Form/city_villagename" + }, + { + "name": "townname", + "bind": "/model/instance/Woman_TT_Enrollment_Form/townname" + }, + { + "name": "union_councilname", + "bind": "/model/instance/Woman_TT_Enrollment_Form/union_councilname" + }, + { + "name": "address", + "bind": "/model/instance/Woman_TT_Enrollment_Form/address" + }, + { + "name": "centre_gps", + "bind": "/model/instance/Woman_TT_Enrollment_Form/centre_gps" + }, + { + "name": "reminders_approval", + "bind": "/model/instance/Woman_TT_Enrollment_Form/reminders_approval" + }, + { + "name": "contact_phone_number", + "bind": "/model/instance/Woman_TT_Enrollment_Form/contact_phone_number" + }, + { + "name": "pregnant", + "bind": "/model/instance/Woman_TT_Enrollment_Form/pregnant" + }, + { + "name": "edd_lmp", + "bind": "/model/instance/Woman_TT_Enrollment_Form/edd_lmp" + }, + { + "name": "edd", + "bind": "/model/instance/Woman_TT_Enrollment_Form/edd" + }, + { + "name": "lmp", + "bind": "/model/instance/Woman_TT_Enrollment_Form/lmp" + }, + { + "name": "ultrasound_date", + "bind": "/model/instance/Woman_TT_Enrollment_Form/ultrasound_date" + }, + { + "name": "ultrasound_weeks", + "bind": "/model/instance/Woman_TT_Enrollment_Form/ultrasound_weeks" + }, + { + "name": "edd_calc_lmp", + "bind": "/model/instance/Woman_TT_Enrollment_Form/edd_calc_lmp" + }, + { + "name": "edd_calc_ultrasound", + "bind": "/model/instance/Woman_TT_Enrollment_Form/edd_calc_ultrasound" + }, + { + "name": "edd_calc_lmp_formatted", + "bind": "/model/instance/Woman_TT_Enrollment_Form/edd_calc_lmp_formatted" + }, + { + "name": "edd_calc_ultrasound_formatted", + "bind": "/model/instance/Woman_TT_Enrollment_Form/edd_calc_ultrasound_formatted" + }, + { + "name": "lmp_calc_edd", + "bind": "/model/instance/Woman_TT_Enrollment_Form/lmp_calc_edd" + }, + { + "name": "lmp_calc_ultrasound", + "bind": "/model/instance/Woman_TT_Enrollment_Form/lmp_calc_ultrasound" + }, + { + "name": "lmp_calc_edd_formatted", + "bind": "/model/instance/Woman_TT_Enrollment_Form/lmp_calc_edd_formatted" + }, + { + "name": "lmp_calc_ultrasound_formatted", + "bind": "/model/instance/Woman_TT_Enrollment_Form/lmp_calc_ultrasound_formatted" + }, + { + "name": "final_edd", + "bind": "/model/instance/Woman_TT_Enrollment_Form/final_edd" + }, + { + "name": "final_lmp", + "bind": "/model/instance/Woman_TT_Enrollment_Form/final_lmp" + }, + { + "name": "ga_edd", + "bind": "/model/instance/Woman_TT_Enrollment_Form/ga_edd" + }, + { + "name": "ga_lmp", + "bind": "/model/instance/Woman_TT_Enrollment_Form/ga_lmp" + }, + { + "name": "ga_ult", + "bind": "/model/instance/Woman_TT_Enrollment_Form/ga_ult" + }, + { + "name": "final_edd_note", + "bind": "/model/instance/Woman_TT_Enrollment_Form/final_edd_note" + }, + { + "name": "final_lmp_note", + "bind": "/model/instance/Woman_TT_Enrollment_Form/final_lmp_note" + }, + { + "name": "final_ga", + "bind": "/model/instance/Woman_TT_Enrollment_Form/final_ga" + }, + { + "name": "final_ga_note", + "bind": "/model/instance/Woman_TT_Enrollment_Form/final_ga_note" + }, + { + "name": "vaccines", + "bind": "/model/instance/Woman_TT_Enrollment_Form/vaccines" + }, + { + "name": "tt1_retro", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt1_retro" + }, + { + "name": "tt_1_dose", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt_1_dose" + }, + { + "name": "tt2_retro", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt2_retro" + }, + { + "name": "tt_2_dose", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt_2_dose" + }, + { + "name": "tt3_retro", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt3_retro" + }, + { + "name": "tt_3_dose", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt_3_dose" + }, + { + "name": "tt4_retro", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt4_retro" + }, + { + "name": "tt_4_dose", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt_4_dose" + }, + { + "name": "vaccines_2", + "bind": "/model/instance/Woman_TT_Enrollment_Form/vaccines_2" + }, + { + "name": "tt1", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt1" + }, + { + "name": "tt_1_dose_today", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt_1_dose_today" + }, + { + "name": "tt2", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt2" + }, + { + "name": "tt_2_dose_today", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt_2_dose_today" + }, + { + "name": "tt3", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt3" + }, + { + "name": "tt_3_dose_today", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt_3_dose_today" + }, + { + "name": "tt4", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt4" + }, + { + "name": "tt_4_dose_today", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt_4_dose_today" + }, + { + "name": "tt5", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt5" + }, + { + "name": "tt_5_dose_today", + "bind": "/model/instance/Woman_TT_Enrollment_Form/tt_5_dose_today" + }, + { + "name": "instanceID", + "bind": "/model/instance/Woman_TT_Enrollment_Form/meta/instanceID" + } + ] } } \ No newline at end of file diff --git a/src/test/resources/form/woman_enrollment/form_submission.json b/src/test/resources/form/woman_enrollment/form_submission.json index d12e57222..8295e2c5b 100644 --- a/src/test/resources/form/woman_enrollment/form_submission.json +++ b/src/test/resources/form/woman_enrollment/form_submission.json @@ -1,350 +1,437 @@ { - "_id": "5710d57eac4377dea3cbbb96005b6efc", - "_rev": "1-f38e0fadc71b86a7f5dfc27cabe43fa4", - "type": "FormSubmission", - "anmId": "demotest", - "instanceId": "c12d8e42-a230-415f-a513-9117f4c9db6a", - "formName": "woman_enrollment", - "entityId": "cd082cb2-abe1-4c78-a370-bd955d58e0ba", - "clientVersion": 1458899024110, - "formDataDefinitionVersion": "2", - "formInstance": { - "form_data_definition_version": "2", - "form": { - "bind_type": "pkwoman", - "default_bind_path": "/model/instance/Woman_TT_Enrollment_Form/", - "fields": [{ - "name": "id", - "value": "cd082cb2-abe1-4c78-a370-bd955d58e0ba", - "source": "pkwoman.id" - }, { - "name": "provider_uc", - "value": "Zaman Town", - "source": "pkwoman.provider_uc" - }, { - "name": "provider_town", - "value": "Korangi", - "source": "pkwoman.provider_town" - }, { - "name": "provider_city", - "value": "Karachi", - "source": "pkwoman.provider_city" - }, { - "name": "provider_province", - "value": "Sindh", - "source": "pkwoman.provider_province" - }, { - "name": "provider_id", - "value": "demotest", - "source": "pkwoman.provider_id" - }, { - "name": "provider_location_id", - "value": "null", - "source": "pkwoman.provider_location_id" - }, { - "name": "provider_location_name", - "value": "null", - "source": "pkwoman.provider_location_name" - }, { - "name": "existing_program_client_id", - "value": "11338235", - "source": "pkwoman.existing_program_client_id" - }, { - "name": "gender", - "value": "female", - "source": "pkwoman.gender" - }, { - "name": "provider_location_note", - "value": "", - "source": "pkwoman.provider_location_note" - }, { - "name": "start", - "value": "2016-03-25 14:39:36", - "source": "pkwoman.start" - }, { - "name": "end", - "value": "2016-03-25 14:43:43", - "source": "pkwoman.end" - }, { - "name": "today", - "value": "2016-03-25", - "source": "pkwoman.today" - }, { - "name": "deviceid", - "value": "Error: could not determine deviceID", - "source": "pkwoman.deviceid" - }, { - "name": "subscriberid", - "value": "no subscriberid property in enketo", - "source": "pkwoman.subscriberid" - }, { - "name": "simserial", - "value": "no simserial property in enketo", - "source": "pkwoman.simserial" - }, { - "name": "phonenumber", - "value": "no phonenumber property in enketo", - "source": "pkwoman.phonenumber" - }, { - "name": "client_reg_date", - "value": "2016-03-25", - "source": "pkwoman.client_reg_date" - }, { - "name": "program_client_id", - "value": "11338235", - "source": "pkwoman.program_client_id" - }, { - "name": "epi_card_number", - "value": "2015", - "source": "pkwoman.epi_card_number" - }, { - "name": "first_name", - "value": "mehrina", - "source": "pkwoman.first_name" - }, { - "name": "member_birth_date_known", - "value": "yes", - "source": "pkwoman.member_birth_date_known" - }, { - "name": "member_birth_date", - "value": "1986-03-04", - "source": "pkwoman.member_birth_date" - }, { - "name": "age", - "value": "", - "source": "pkwoman.age" - }, { - "name": "dob", - "value": "1986-03-04", - "source": "pkwoman.dob" - }, { - "name": "dob_estimated", - "value": "0", - "source": "pkwoman.dob_estimated" - }, { - "name": "age", - "value": "30", - "source": "pkwoman.age" - }, { - "name": "gender1", - "value": "female", - "source": "pkwoman.gender1" - }, { - "name": "father_name", - "value": "papa", - "source": "pkwoman.father_name" - }, { - "name": "marriage", - "value": "yes", - "source": "pkwoman.marriage" - }, { - "name": "husband_name", - "value": "husbi", - "source": "pkwoman.husband_name" - }, { - "name": "last_name", - "value": "husbi", - "source": "pkwoman.last_name" - }, { - "name": "ethnicity", - "value": "pushtuns", - "source": "pkwoman.ethnicity" - }, { - "name": "ethnicity_other", - "value": "", - "source": "pkwoman.ethnicity_other" - }, { - "name": "province", - "value": "sindh", - "source": "pkwoman.province" - }, { - "name": "city_village", - "value": "karachi", - "source": "pkwoman.city_village" - }, { - "name": "town", - "value": "gadap", - "source": "pkwoman.town" - }, { - "name": "union_council", - "value": "gujro", - "source": "pkwoman.union_council" - }, { - "name": "house_number", - "value": "34 k", - "source": "pkwoman.house_number" - }, { - "name": "street", - "value": "jim", - "source": "pkwoman.street" - }, { - "name": "landmark", - "value": "nishni", - "source": "pkwoman.landmark" - }, { - "name": "address", - "value": "", - "source": "pkwoman.address" - }, { - "name": "centre_gps", - "source": "pkwoman.centre_gps" - }, { - "name": "pregnant", - "value": "yes", - "source": "pkwoman.pregnant" - }, { - "name": "edd_lmp", - "value": "edd", - "source": "pkwoman.edd_lmp" - }, { - "name": "edd", - "value": "2016-04-28", - "source": "pkwoman.edd" - }, { - "name": "lmp", - "value": "", - "source": "pkwoman.lmp" - }, { - "name": "ultrasound_date", - "source": "pkwoman.ultrasound_date" - }, { - "name": "ultrasound_weeks", - "value": "", - "source": "pkwoman.ultrasound_weeks" - }, { - "name": "edd_calc_lmp", - "value": "Invalid Date", - "source": "pkwoman.edd_calc_lmp" - }, { - "name": "edd_calc_ultrasound", - "value": "Invalid Date", - "source": "pkwoman.edd_calc_ultrasound" - }, { - "name": "edd_calc_lmp_formatted", - "value": "Invalid Date", - "source": "pkwoman.edd_calc_lmp_formatted" - }, { - "name": "edd_calc_ultrasound_formatted", - "value": "Invalid Date", - "source": "pkwoman.edd_calc_ultrasound_formatted" - }, { - "name": "lmp_calc_edd", - "value": "Thu, 23 Jul 2015 00:00:00 GMT", - "source": "pkwoman.lmp_calc_edd" - }, { - "name": "lmp_calc_ultrasound", - "value": "Invalid Date", - "source": "pkwoman.lmp_calc_ultrasound" - }, { - "name": "final_edd", - "value": "2016-04-28", - "source": "pkwoman.final_edd" - }, { - "name": "final_lmp", - "value": "Thu, 23 Jul 2015 00:00:00 GMT", - "source": "pkwoman.final_lmp" - }, { - "name": "ga_edd", - "value": "35", - "source": "pkwoman.ga_edd" - }, { - "name": "ga_lmp", - "value": "NaN", - "source": "pkwoman.ga_lmp" - }, { - "name": "ga_ult", - "value": "NaN", - "source": "pkwoman.ga_ult" - }, { - "name": "final_edd_note", - "value": "", - "source": "pkwoman.final_edd_note" - }, { - "name": "final_lmp_note", - "value": "", - "source": "pkwoman.final_lmp_note" - }, { - "name": "final_ga", - "value": "35", - "source": "pkwoman.final_ga" - }, { - "name": "final_ga_note", - "value": "", - "source": "pkwoman.final_ga_note" - }, { - "name": "vaccines", - "value": "TT1 TT2", - "source": "pkwoman.vaccines" - }, { - "name": "tt1_retro", - "value": "2015-03-03", - "source": "pkwoman.tt1_retro" - }, { - "name": "tt_1_dose", - "value": "1", - "source": "pkwoman.tt_1_dose" - }, { - "name": "tt2_retro", - "value": "2015-11-24", - "source": "pkwoman.tt2_retro" - }, { - "name": "tt_2_dose", - "value": "2", - "source": "pkwoman.tt_2_dose" - }, { - "name": "tt3_retro", - "source": "pkwoman.tt3_retro" - }, { - "name": "tt_3_dose", - "source": "pkwoman.tt_3_dose" - }, { - "name": "tt4_retro", - "source": "pkwoman.tt4_retro" - }, { - "name": "tt_4_dose", - "source": "pkwoman.tt_4_dose" - }, { - "name": "vaccines_2", - "value": "TT3", - "source": "pkwoman.vaccines_2" - }, { - "name": "tt1", - "source": "pkwoman.tt1" - }, { - "name": "tt_1_dose_today", - "source": "pkwoman.tt_1_dose_today" - }, { - "name": "tt2", - "source": "pkwoman.tt2" - }, { - "name": "tt_2_dose_today", - "source": "pkwoman.tt_2_dose_today" - }, { - "name": "tt3", - "value": "2016-03-25", - "source": "pkwoman.tt3" - }, { - "name": "tt_3_dose_today", - "value": "3", - "source": "pkwoman.tt_3_dose_today" - }, { - "name": "tt4", - "source": "pkwoman.tt4" - }, { - "name": "tt_4_dose_today", - "source": "pkwoman.tt_4_dose_today" - }, { - "name": "tt5", - "source": "pkwoman.tt5" - }, { - "name": "tt_5_dose_today", - "source": "pkwoman.tt_5_dose_today" - }, { - "name": "instanceID", - "value": "uuid:67fd050a-b528-4de2-b382-c168730bf0df", - "source": "pkwoman.instanceID" - }] - } - }, - "serverVersion": 1458898979653 + "_id": "5710d57eac4377dea3cbbb96005b6efc", + "_rev": "1-f38e0fadc71b86a7f5dfc27cabe43fa4", + "type": "FormSubmission", + "anmId": "demotest", + "instanceId": "c12d8e42-a230-415f-a513-9117f4c9db6a", + "formName": "woman_enrollment", + "entityId": "cd082cb2-abe1-4c78-a370-bd955d58e0ba", + "clientVersion": 1458899024110, + "formDataDefinitionVersion": "2", + "formInstance": { + "form_data_definition_version": "2", + "form": { + "bind_type": "pkwoman", + "default_bind_path": "/model/instance/Woman_TT_Enrollment_Form/", + "fields": [ + { + "name": "id", + "value": "cd082cb2-abe1-4c78-a370-bd955d58e0ba", + "source": "pkwoman.id" + }, + { + "name": "provider_uc", + "value": "Zaman Town", + "source": "pkwoman.provider_uc" + }, + { + "name": "provider_town", + "value": "Korangi", + "source": "pkwoman.provider_town" + }, + { + "name": "provider_city", + "value": "Karachi", + "source": "pkwoman.provider_city" + }, + { + "name": "provider_province", + "value": "Sindh", + "source": "pkwoman.provider_province" + }, + { + "name": "provider_id", + "value": "demotest", + "source": "pkwoman.provider_id" + }, + { + "name": "provider_location_id", + "value": "null", + "source": "pkwoman.provider_location_id" + }, + { + "name": "provider_location_name", + "value": "null", + "source": "pkwoman.provider_location_name" + }, + { + "name": "existing_program_client_id", + "value": "11338235", + "source": "pkwoman.existing_program_client_id" + }, + { + "name": "gender", + "value": "female", + "source": "pkwoman.gender" + }, + { + "name": "provider_location_note", + "value": "", + "source": "pkwoman.provider_location_note" + }, + { + "name": "start", + "value": "2016-03-25 14:39:36", + "source": "pkwoman.start" + }, + { + "name": "end", + "value": "2016-03-25 14:43:43", + "source": "pkwoman.end" + }, + { + "name": "today", + "value": "2016-03-25", + "source": "pkwoman.today" + }, + { + "name": "deviceid", + "value": "Error: could not determine deviceID", + "source": "pkwoman.deviceid" + }, + { + "name": "subscriberid", + "value": "no subscriberid property in enketo", + "source": "pkwoman.subscriberid" + }, + { + "name": "simserial", + "value": "no simserial property in enketo", + "source": "pkwoman.simserial" + }, + { + "name": "phonenumber", + "value": "no phonenumber property in enketo", + "source": "pkwoman.phonenumber" + }, + { + "name": "client_reg_date", + "value": "2016-03-25", + "source": "pkwoman.client_reg_date" + }, + { + "name": "program_client_id", + "value": "11338235", + "source": "pkwoman.program_client_id" + }, + { + "name": "epi_card_number", + "value": "2015", + "source": "pkwoman.epi_card_number" + }, + { + "name": "first_name", + "value": "mehrina", + "source": "pkwoman.first_name" + }, + { + "name": "member_birth_date_known", + "value": "yes", + "source": "pkwoman.member_birth_date_known" + }, + { + "name": "member_birth_date", + "value": "1986-03-04", + "source": "pkwoman.member_birth_date" + }, + { + "name": "age", + "value": "", + "source": "pkwoman.age" + }, + { + "name": "dob", + "value": "1986-03-04", + "source": "pkwoman.dob" + }, + { + "name": "dob_estimated", + "value": "0", + "source": "pkwoman.dob_estimated" + }, + { + "name": "age", + "value": "30", + "source": "pkwoman.age" + }, + { + "name": "gender1", + "value": "female", + "source": "pkwoman.gender1" + }, + { + "name": "father_name", + "value": "papa", + "source": "pkwoman.father_name" + }, + { + "name": "marriage", + "value": "yes", + "source": "pkwoman.marriage" + }, + { + "name": "husband_name", + "value": "husbi", + "source": "pkwoman.husband_name" + }, + { + "name": "last_name", + "value": "husbi", + "source": "pkwoman.last_name" + }, + { + "name": "ethnicity", + "value": "pushtuns", + "source": "pkwoman.ethnicity" + }, + { + "name": "ethnicity_other", + "value": "", + "source": "pkwoman.ethnicity_other" + }, + { + "name": "province", + "value": "sindh", + "source": "pkwoman.province" + }, + { + "name": "city_village", + "value": "karachi", + "source": "pkwoman.city_village" + }, + { + "name": "town", + "value": "gadap", + "source": "pkwoman.town" + }, + { + "name": "union_council", + "value": "gujro", + "source": "pkwoman.union_council" + }, + { + "name": "house_number", + "value": "34 k", + "source": "pkwoman.house_number" + }, + { + "name": "street", + "value": "jim", + "source": "pkwoman.street" + }, + { + "name": "landmark", + "value": "nishni", + "source": "pkwoman.landmark" + }, + { + "name": "address", + "value": "", + "source": "pkwoman.address" + }, + { + "name": "centre_gps", + "source": "pkwoman.centre_gps" + }, + { + "name": "pregnant", + "value": "yes", + "source": "pkwoman.pregnant" + }, + { + "name": "edd_lmp", + "value": "edd", + "source": "pkwoman.edd_lmp" + }, + { + "name": "edd", + "value": "2016-04-28", + "source": "pkwoman.edd" + }, + { + "name": "lmp", + "value": "", + "source": "pkwoman.lmp" + }, + { + "name": "ultrasound_date", + "source": "pkwoman.ultrasound_date" + }, + { + "name": "ultrasound_weeks", + "value": "", + "source": "pkwoman.ultrasound_weeks" + }, + { + "name": "edd_calc_lmp", + "value": "Invalid Date", + "source": "pkwoman.edd_calc_lmp" + }, + { + "name": "edd_calc_ultrasound", + "value": "Invalid Date", + "source": "pkwoman.edd_calc_ultrasound" + }, + { + "name": "edd_calc_lmp_formatted", + "value": "Invalid Date", + "source": "pkwoman.edd_calc_lmp_formatted" + }, + { + "name": "edd_calc_ultrasound_formatted", + "value": "Invalid Date", + "source": "pkwoman.edd_calc_ultrasound_formatted" + }, + { + "name": "lmp_calc_edd", + "value": "Thu, 23 Jul 2015 00:00:00 GMT", + "source": "pkwoman.lmp_calc_edd" + }, + { + "name": "lmp_calc_ultrasound", + "value": "Invalid Date", + "source": "pkwoman.lmp_calc_ultrasound" + }, + { + "name": "final_edd", + "value": "2016-04-28", + "source": "pkwoman.final_edd" + }, + { + "name": "final_lmp", + "value": "Thu, 23 Jul 2015 00:00:00 GMT", + "source": "pkwoman.final_lmp" + }, + { + "name": "ga_edd", + "value": "35", + "source": "pkwoman.ga_edd" + }, + { + "name": "ga_lmp", + "value": "NaN", + "source": "pkwoman.ga_lmp" + }, + { + "name": "ga_ult", + "value": "NaN", + "source": "pkwoman.ga_ult" + }, + { + "name": "final_edd_note", + "value": "", + "source": "pkwoman.final_edd_note" + }, + { + "name": "final_lmp_note", + "value": "", + "source": "pkwoman.final_lmp_note" + }, + { + "name": "final_ga", + "value": "35", + "source": "pkwoman.final_ga" + }, + { + "name": "final_ga_note", + "value": "", + "source": "pkwoman.final_ga_note" + }, + { + "name": "vaccines", + "value": "TT1 TT2", + "source": "pkwoman.vaccines" + }, + { + "name": "tt1_retro", + "value": "2015-03-03", + "source": "pkwoman.tt1_retro" + }, + { + "name": "tt_1_dose", + "value": "1", + "source": "pkwoman.tt_1_dose" + }, + { + "name": "tt2_retro", + "value": "2015-11-24", + "source": "pkwoman.tt2_retro" + }, + { + "name": "tt_2_dose", + "value": "2", + "source": "pkwoman.tt_2_dose" + }, + { + "name": "tt3_retro", + "source": "pkwoman.tt3_retro" + }, + { + "name": "tt_3_dose", + "source": "pkwoman.tt_3_dose" + }, + { + "name": "tt4_retro", + "source": "pkwoman.tt4_retro" + }, + { + "name": "tt_4_dose", + "source": "pkwoman.tt_4_dose" + }, + { + "name": "vaccines_2", + "value": "TT3", + "source": "pkwoman.vaccines_2" + }, + { + "name": "tt1", + "source": "pkwoman.tt1" + }, + { + "name": "tt_1_dose_today", + "source": "pkwoman.tt_1_dose_today" + }, + { + "name": "tt2", + "source": "pkwoman.tt2" + }, + { + "name": "tt_2_dose_today", + "source": "pkwoman.tt_2_dose_today" + }, + { + "name": "tt3", + "value": "2016-03-25", + "source": "pkwoman.tt3" + }, + { + "name": "tt_3_dose_today", + "value": "3", + "source": "pkwoman.tt_3_dose_today" + }, + { + "name": "tt4", + "source": "pkwoman.tt4" + }, + { + "name": "tt_4_dose_today", + "source": "pkwoman.tt_4_dose_today" + }, + { + "name": "tt5", + "source": "pkwoman.tt5" + }, + { + "name": "tt_5_dose_today", + "source": "pkwoman.tt_5_dose_today" + }, + { + "name": "instanceID", + "value": "uuid:67fd050a-b528-4de2-b382-c168730bf0df", + "source": "pkwoman.instanceID" + } + ] + } + }, + "serverVersion": 1458898979653 } \ No newline at end of file diff --git a/src/test/resources/form/woman_enrollment/model.xml b/src/test/resources/form/woman_enrollment/model.xml index 8422c9b6c..05539476a 100644 --- a/src/test/resources/form/woman_enrollment/model.xml +++ b/src/test/resources/form/woman_enrollment/model.xml @@ -1,7 +1,8 @@ - + @@ -42,14 +43,22 @@ - - ${provider_province} - ${provider_city} + + ${provider_province} + + ${provider_city} + - - + + - + @@ -81,26 +90,46 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/form/woman_followup/form.json b/src/test/resources/form/woman_followup/form.json index 73ab62876..d943cd74d 100644 --- a/src/test/resources/form/woman_followup/form.json +++ b/src/test/resources/form/woman_followup/form.json @@ -1 +1,3766 @@ -{"name":"Woman_TT_Followup_Form","title":"خواتین فالواپ رجسٹر برائے ٹیکاجات - Woman TT Follow Up Form","sms_keyword":"woman_tt_followup_form","default_language":"English","choices":{"provinces":[{"name":"kpk","label":{"Urdu":"خیبر پختون خواہ","English":"Khyber Pakhtunkhwa","Roman Urdu":"Khyber Pakhtunkhwa"}},{"name":"sindh","label":{"Urdu":"سندھ","English":"Sindh","Roman Urdu":"Sindh"}},{"name":"balochistan","label":{"Urdu":"بلوچستان","English":"Balochistan","Roman Urdu":"Balochistan"}},{"name":"punjab","label":{"Urdu":"پنجاب","English":"Punjab","Roman Urdu":"Punjab"}},{"name":"gilgit_baltistan","label":{"Urdu":"گلگت بلتستان","English":"Gilgit Baltistan","Roman Urdu":"Gilgit Baltistan"}},{"name":"kashmir","label":{"Urdu":"کشمیر","English":"Kashmir","Roman Urdu":"Kashmir"}},{"name":"fata","label":{"Urdu":"فاٹا","English":"FATA","Roman Urdu":"FATA"}},{"name":"out_of_country","label":{"Urdu":"ملک سے باہر","English":"Out of Country","Roman Urdu":"Mulk se baahir"}}],"ucs":[{"province":"sindh","city":"karachi","town":"korangi","name":"bilal_colony","label":{"Urdu":"بلال کالونی","Roman Urdu":"Bilal Colony","English":"Bilal Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"nasir_colony","label":{"Urdu":"ناصر کالونی","Roman Urdu":"Nasir Colony","English":"Nasir Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"chakra_goth","label":{"Urdu":"چکرا گوٹھ","Roman Urdu":"Chakra Goth","English":"Chakra Goth"}},{"province":"sindh","city":"karachi","town":"korangi","name":"mustafa_taj_colony","label":{"Urdu":"مصطفی تاج کالونی","Roman Urdu":"Mustafa Taj Colony","English":"Mustafa Taj Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"hundred_quarters","label":{"Urdu":"ہنڈریڈ کوارٹر","Roman Urdu":"Hundred Quarters","English":"Hundred Quarters"}},{"province":"sindh","city":"karachi","town":"korangi","name":"gulzar_colony","label":{"Urdu":"گلزار کالونی","Roman Urdu":"Gulzar Colony","English":"Gulzar Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"korangi_sector_33","label":{"Urdu":"کورنگی سیکٹر 33","Roman Urdu":"Korangi Sector 33","English":"Korangi Sector 33"}},{"province":"sindh","city":"karachi","town":"korangi","name":"zaman_town","label":{"Urdu":"زمان ٹاوَن","Roman Urdu":"Zaman Town","English":"Zaman Town"}},{"province":"sindh","city":"karachi","town":"korangi","name":"hasrat_mohani_colony","label":{"Urdu":"حسرت موہانی کالونی","Roman Urdu":"Hasrat Mohani Colony","English":"Hasrat Mohani Colony"}},{"province":"sindh","city":"karachi","town":"baldia","name":"gulshan_e_ghazi","label":{"Urdu":"گلشن غازی","Roman Urdu":"Gulshan-e-Ghazi","English":"Gulshan-e-Ghazi"}},{"province":"sindh","city":"karachi","town":"baldia","name":"ittehad_town","label":{"Urdu":"اتحاد ٹاوَن","Roman Urdu":"Ittehad Town","English":"Ittehad Town"}},{"province":"sindh","city":"karachi","town":"baldia","name":"islam_nagar","label":{"Urdu":"اسلام نگر","Roman Urdu":"Islam Nagar","English":"Islam Nagar"}},{"province":"sindh","city":"karachi","town":"baldia","name":"nai_abadi","label":{"Urdu":"نئی آبادی","Roman Urdu":"Nai Abadi","English":"Nai Abadi"}},{"province":"sindh","city":"karachi","town":"baldia","name":"saeedabad","label":{"Urdu":"سعید آباد","Roman Urdu":"Saeedabad","English":"Saeedabad"}},{"province":"sindh","city":"karachi","town":"baldia","name":"muslim_mujahid_colony","label":{"Urdu":"مسلم مجاہد کالونی","Roman Urdu":"Muslim Mujahid Colony","English":"Muslim Mujahid Colony"}},{"province":"sindh","city":"karachi","town":"baldia","name":"muhajir_camp","label":{"Urdu":"مہاجر کیمپ","Roman Urdu":"Muhajir Camp","English":"Muhajir Camp"}},{"province":"sindh","city":"karachi","town":"baldia","name":"rasheedabad","label":{"Urdu":"رشید آباد","Roman Urdu":"Rasheedabad","English":"Rasheedabad"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"ibrahim_hyderi","label":{"Urdu":"ابراہیم حیدری","Roman Urdu":"Ibrahim Hyderi","English":"Ibrahim Hyderi"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"rehri","label":{"Urdu":"رہڑی","Roman Urdu":"Rehri","English":"Rehri"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"cattle_colony","label":{"Urdu":"کیٹل کالونی","Roman Urdu":"Cattle Colony","English":"Cattle Colony"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"qaidabad","label":{"Urdu":"قائدآباد","Roman Urdu":"Qaidabad","English":"Qaidabad"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"landhi_colony","label":{"Urdu":"لانڈھی کالونی","Roman Urdu":"Landhi Colony","English":"Landhi Colony"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"gulshan_e_hadeed","label":{"Urdu":"گلشن حدید","Roman Urdu":"Gulshan-e-Hadeed","English":"Gulshan-e-Hadeed"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"gaghar","label":{"Urdu":"گگر","Roman Urdu":"Gaghar","English":"Gaghar"}},{"province":"sindh","city":"karachi","town":"gadap","name":"murad_memon_goth","label":{"Urdu":"مراد میمن گوٹھ","Roman Urdu":"Murad Memon Goth","English":"Murad Memon Goth"}},{"province":"sindh","city":"karachi","town":"gadap","name":"darsano_chana","label":{"Urdu":"درشانو شنو","Roman Urdu":"Darsano Chana","English":"Darsano Chana"}},{"province":"sindh","city":"karachi","town":"gadap","name":"gujro","label":{"Urdu":"گجرو","Roman Urdu":"Gujro","English":"Gujro"}},{"province":"sindh","city":"karachi","town":"gadap","name":"songal","label":{"Urdu":"سنگل","Roman Urdu":"Songal","English":"Songal"}},{"province":"sindh","city":"karachi","town":"gadap","name":"maymarabad","label":{"Urdu":"معمار آباد","Roman Urdu":"Maymarabad","English":"Maymarabad"}},{"province":"sindh","city":"karachi","town":"gadap","name":"yousuf_goth","label":{"Urdu":"یوسف گوٹھ","Roman Urdu":"Yousuf Goth","English":"Yousuf Goth"}},{"province":"sindh","city":"karachi","town":"gadap","name":"manghopir","label":{"Urdu":"منگھوپیر","Roman Urdu":"Manghopir","English":"Manghopir"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"azizabad","label":{"Urdu":"عزیز آباد","Roman Urdu":"Azizabad","English":"Azizabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"karimabad","label":{"Urdu":"کریم آباد","Roman Urdu":"Karimabad","English":"Karimabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"aisha_manzil","label":{"Urdu":"عائشہ منزل","Roman Urdu":"Aisha Manzil","English":"Aisha Manzil"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"ancholi","label":{"Urdu":"انچولی","Roman Urdu":"Ancholi","English":"Ancholi"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"naseerabad","label":{"Urdu":"نصیرآباد","Roman Urdu":"Naseerabad","English":"Naseerabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"yaseenabad","label":{"Urdu":"یاسین آباد","Roman Urdu":"Yaseenabad","English":"Yaseenabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"water_pump","label":{"Urdu":"واٹرپمپ","Roman Urdu":"Water Pump","English":"Water Pump"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"shafiq_mill_colony","label":{"Urdu":"شفیق مل کالونی","Roman Urdu":"Shafiq Mill Colony","English":"Shafiq Mill Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"delhi_mercantile_society","label":{"Urdu":"دہلی مرچنٹائل سوسائٹی","Roman Urdu":"Delhi Mercantile Society","English":"Delhi Mercantile Society"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"civic_centre","label":{"Urdu":"سوک سینٹر","Roman Urdu":"Civic Centre","English":"Civic Centre"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"pir_ilahi_buksh_colony","label":{"Urdu":"پیر الہی بخش کالونی","Roman Urdu":"Pir Ilahi Buksh Colony","English":"Pir Ilahi Buksh Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"essa_nagri","label":{"Urdu":"عیسی نگری","Roman Urdu":"Essa Nagri","English":"Essa Nagri"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulshan_e_iqbal","label":{"Urdu":"گلشن اقبال","Roman Urdu":"Gulshan-e-Iqbal","English":"Gulshan-e-Iqbal"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gillani_railway_station","label":{"Urdu":"گیلانی ریلوے اسٹیشن","Roman Urdu":"Gillani Railway Station","English":"Gillani Railway Station"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"shanti_nagar","label":{"Urdu":"شانتی نگر","Roman Urdu":"Shanti Nagar","English":"Shanti Nagar"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"jamali_colony","label":{"Urdu":"جمالی کالونی","Roman Urdu":"Jamali Colony","English":"Jamali Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulshan_e_iqbal_ii","label":{"Urdu":"گلشن اقبال 2","Roman Urdu":"Gulshan-e-Iqbal II","English":"Gulshan-e-Iqbal II"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"pehlwan_goth","label":{"Urdu":"پہلوان گوٹھ","Roman Urdu":"Pehlwan Goth","English":"Pehlwan Goth"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"matrovil_colony","label":{"Urdu":"میٹروویل کالونی","Roman Urdu":"Matrovil Colony","English":"Matrovil Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulzar_e_hijri","label":{"Urdu":"گلزار ہجری","Roman Urdu":"Gulzar-e-Hijri","English":"Gulzar-e-Hijri"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"safooran_goth","label":{"Urdu":"صفورا گوٹھ","Roman Urdu":"Safooran Goth","English":"Safooran Goth"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"akhtar_colony","label":{"Urdu":"اختر کالونی","Roman Urdu":"Akhtar Colony","English":"Akhtar Colony"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"manzoor_colony","label":{"Urdu":"منظور کالونی","Roman Urdu":"Manzoor Colony","English":"Manzoor Colony"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"azam_basti","label":{"Urdu":"اعظم بستی","Roman Urdu":"Azam Basti","English":"Azam Basti"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"chanesar_goth","label":{"Urdu":"چنیسر گوٹھ","Roman Urdu":"Chanesar Goth","English":"Chanesar Goth"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"mahmudabad","label":{"Urdu":"محمودآباد","Roman Urdu":"Mahmudabad","English":"Mahmudabad"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pechs","label":{"Urdu":"پی۔ای۔سی۔ایچ۔ایس","Roman Urdu":"P.E.C.H.S.","English":"P.E.C.H.S."}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pechs_ii","label":{"Urdu":"پی۔ای۔سی۔ایچ۔ایس 2","Roman Urdu":"P.E.C.H.S. II","English":"P.E.C.H.S. II"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"jut_line","label":{"Urdu":"جٹ لائن","Roman Urdu":"Jut Line","English":"Jut Line"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"central_jacob_lines","label":{"Urdu":"سینٹرل جیکب لائن","Roman Urdu":"Central Jacob Lines","English":"Central Jacob Lines"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"jamshed_quarters","label":{"Urdu":"جمشید کوارٹر","Roman Urdu":"Jamshed Quarters","English":"Jamshed Quarters"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"garden_east","label":{"Urdu":"گارڈن ایسٹ","Roman Urdu":"Garden East","English":"Garden East"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"soldier_bazar","label":{"Urdu":"سولجر بازار","Roman Urdu":"Soldier Bazar","English":"Soldier Bazar"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pakistan_quarters","label":{"Urdu":"پاکستان کوارٹر","Roman Urdu":"Pakistan Quarters","English":"Pakistan Quarters"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"bhutta_village","label":{"Urdu":"بھٹا ولیج","Roman Urdu":"Bhutta Village","English":"Bhutta Village"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"sultanabad","label":{"Urdu":"سلطان آباد","Roman Urdu":"Sultanabad","English":"Sultanabad"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"kiamari_uc","label":{"Urdu":"کیماری یوسی","Roman Urdu":"Kiamari UC","English":"Kiamari UC"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"baba_bhit","label":{"Urdu":"بابا بھٹ","Roman Urdu":"Baba Bhit","English":"Baba Bhit"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"machar_colony","label":{"Urdu":"مچھر کالونی","Roman Urdu":"Machar Colony","English":"Machar Colony"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"maripur","label":{"Urdu":"ماڑی پور","Roman Urdu":"Maripur","English":"Maripur"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"shershah","label":{"Urdu":"شیرشاہ","Roman Urdu":"SherShah","English":"SherShah"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"gabo_pat","label":{"Urdu":"گابو پٹ","Roman Urdu":"Gabo Pat","English":"Gabo Pat"}},{"province":"sindh","city":"karachi","town":"landhi","name":"muzafarabad","label":{"Urdu":"مظفرآباد","Roman Urdu":"Muzafarabad","English":"Muzafarabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"muslimabad","label":{"Urdu":"مسلم آباد","Roman Urdu":"Muslimabad","English":"Muslimabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"dawood_chowrangi","label":{"Urdu":"داوَد چورنگی","Roman Urdu":"Dawood Chowrangi","English":"Dawood Chowrangi"}},{"province":"sindh","city":"karachi","town":"landhi","name":"moinabad","label":{"Urdu":"معین آباد","Roman Urdu":"Moinabad","English":"Moinabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"sharafi_goth","label":{"Urdu":"شرافی گوٹھ","Roman Urdu":"Sharafi Goth","English":"Sharafi Goth"}},{"province":"sindh","city":"karachi","town":"landhi","name":"bhutto_nagar","label":{"Urdu":"بھٹو نگر","Roman Urdu":"Bhutto Nagar","English":"Bhutto Nagar"}},{"province":"sindh","city":"karachi","town":"landhi","name":"khawaja_ajmeer_colony","label":{"Urdu":"خواجہ اجمیر کالونی","Roman Urdu":"Khawaja Ajmeer Colony","English":"Khawaja Ajmeer Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"landhi_uc","label":{"Urdu":"لانڈھی یوسی","Roman Urdu":"Landhi UC","English":"Landhi UC"}},{"province":"sindh","city":"karachi","town":"landhi","name":"awami_colony","label":{"Urdu":"عوامی کالونی","Roman Urdu":"Awami Colony","English":"Awami Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"burmee_colony","label":{"Urdu":"برمی کالونی","Roman Urdu":"Burmee Colony","English":"Burmee Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"korangi_uc","label":{"Urdu":"کورنگی یوسی","Roman Urdu":"Korangi UC","English":"Korangi UC"}},{"province":"sindh","city":"karachi","town":"landhi","name":"sherabad","label":{"Urdu":"شیرآباد","Roman Urdu":"Sherabad","English":"Sherabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"rizvia_society","label":{"Urdu":"رضویہ سوسائٹی","Roman Urdu":"Rizvia Society","English":"Rizvia Society"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"firdous_colony","label":{"Urdu":"فردوس کالونی","Roman Urdu":"Firdous Colony","English":"Firdous Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"super_market","label":{"Urdu":"سپر مارکیٹ","Roman Urdu":"Super Market","English":"Super Market"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"dak_khana","label":{"Urdu":"دک کھانہ","Roman Urdu":"Dak Khana","English":"Dak Khana"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"qasimabad","label":{"Urdu":"قاسم آباد","Roman Urdu":"Qasimabad","English":"Qasimabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"bandhani_colony","label":{"Urdu":"بندھانی کالونی","Roman Urdu":"Bandhani Colony","English":"Bandhani Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"sharifabad","label":{"Urdu":"شریف آباد","Roman Urdu":"Sharifabad","English":"Sharifabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"commercial_area","label":{"Urdu":"کمرشل ایریا","Roman Urdu":"Commercial Area","English":"Commercial Area"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"mujahid_colony","label":{"Urdu":"مجاہد کالونی","Roman Urdu":"Mujahid Colony","English":"Mujahid Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"nazimabad","label":{"Urdu":"ناظم آباد","Roman Urdu":"Nazimabad","English":"Nazimabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"abbasi_shaheed","label":{"Urdu":"عباسی شہید","Roman Urdu":"Abbasi Shaheed","English":"Abbasi Shaheed"}},{"province":"sindh","city":"karachi","town":"lyari","name":"agra_taj_colony","label":{"Urdu":"آگرہ تاج کالونی","Roman Urdu":"Agra Taj Colony","English":"Agra Taj Colony"}},{"province":"sindh","city":"karachi","town":"lyari","name":"daryaabad","label":{"Urdu":"دریاآباد","Roman Urdu":"Daryaabad","English":"Daryaabad"}},{"province":"sindh","city":"karachi","town":"lyari","name":"nawabad","label":{"Urdu":"نواآباد","Roman Urdu":"Nawabad","English":"Nawabad"}},{"province":"sindh","city":"karachi","town":"lyari","name":"khada_memon_society","label":{"Urdu":"خدا- میمن- سوساَٹی","Roman Urdu":"Khada Memon Society","English":"Khada Memon Society"}},{"province":"sindh","city":"karachi","town":"lyari","name":"baghdadi","label":{"Urdu":"بغدادی","Roman Urdu":"Baghdadi","English":"Baghdadi"}},{"province":"sindh","city":"karachi","town":"lyari","name":"shah_baig_line","label":{"Urdu":"شاھ باغ لائن","Roman Urdu":"Shah Baig Line","English":"Shah Baig Line"}},{"province":"sindh","city":"karachi","town":"lyari","name":"bihar_colony","label":{"Urdu":"بہار کالونی","Roman Urdu":"Bihar Colony","English":"Bihar Colony"}},{"province":"sindh","city":"karachi","town":"lyari","name":"ragiwara","label":{"Urdu":"راگی واڑا","Roman Urdu":"Ragiwara","English":"Ragiwara"}},{"province":"sindh","city":"karachi","town":"lyari","name":"singo_line","label":{"Urdu":"سنگولائن","Roman Urdu":"Singo Line","English":"Singo Line"}},{"province":"sindh","city":"karachi","town":"lyari","name":"chakiwara","label":{"Urdu":"چاکی واڑا","Roman Urdu":"Chakiwara","English":"Chakiwara"}},{"province":"sindh","city":"karachi","town":"lyari","name":"allama_iqbal_colony","label":{"Urdu":"علامہ اقبال کالونی","Roman Urdu":"Allama Iqbal Colony","English":"Allama Iqbal Colony"}},{"province":"sindh","city":"karachi","town":"malir","name":"model_colony","label":{"Urdu":"موڈل کالونی","Roman Urdu":"Model Colony","English":"Model Colony"}},{"province":"sindh","city":"karachi","town":"malir","name":"kala_board","label":{"Urdu":"کالا بورڈ","Roman Urdu":"Kala Board","English":"Kala Board"}},{"province":"sindh","city":"karachi","town":"malir","name":"saudabad","label":{"Urdu":"سعودآباد","Roman Urdu":"Saudabad","English":"Saudabad"}},{"province":"sindh","city":"karachi","town":"malir","name":"khokhra_par","label":{"Urdu":"کھوکھرا پار","Roman Urdu":"Khokhra Par","English":"Khokhra Par"}},{"province":"sindh","city":"karachi","town":"malir","name":"jafar_e_tayyar","label":{"Urdu":"جعفر تیار","Roman Urdu":"Jafar-e-Tayyar","English":"Jafar-e-Tayyar"}},{"province":"sindh","city":"karachi","town":"malir","name":"gharibabad","label":{"Urdu":"غریب آباد","Roman Urdu":"Gharibabad","English":"Gharibabad"}},{"province":"sindh","city":"karachi","town":"malir","name":"ghazi_brohi_goth","label":{"Urdu":"غازی بروہی گوٹھ","Roman Urdu":"Ghazi Brohi Goth","English":"Ghazi Brohi Goth"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"kalyana","label":{"Urdu":"کالیانہ","Roman Urdu":"Kalyana","English":"Kalyana"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"sir_syed_colony","label":{"Urdu":"سر سید کالونی","Roman Urdu":"Sir Syed Colony","English":"Sir Syed Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"fatima_jinnah_colony","label":{"Urdu":"فاطمہ جناح کالونی","Roman Urdu":"Fatima Jinnah Colony","English":"Fatima Jinnah Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"godhra","label":{"Urdu":"گودھرا","Roman Urdu":"Godhra","English":"Godhra"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"abu_zar_ghaffari","label":{"Urdu":"ابو زر غفاری","Roman Urdu":"Abu Zar Ghaffari","English":"Abu Zar Ghaffari"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"hakim_ahsan","label":{"Urdu":"حاکم احسان","Roman Urdu":"Hakim Ahsan","English":"Hakim Ahsan"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"madina_colony","label":{"Urdu":"مدینہ کالونی","Roman Urdu":"Madina Colony","English":"Madina Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"faisal_colony","label":{"Urdu":"فیصل کالونی","Roman Urdu":"Faisal Colony","English":"Faisal Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"khamiso_goth","label":{"Urdu":"خمیسو گوٹھ","Roman Urdu":"Khamiso Goth","English":"Khamiso Goth"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"mustufa_colony","label":{"Urdu":"مصطفی کالونی","Roman Urdu":"Mustufa Colony","English":"Mustufa Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"khawaja_ajmeer_nagri","label":{"Urdu":"خواجہ اجمیر نگری","Roman Urdu":"Khawaja Ajmeer Nagri","English":"Khawaja Ajmeer Nagri"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"gulshan_e_saeed","label":{"Urdu":"گلشن سعید","Roman Urdu":"Gulshan-e-Saeed","English":"Gulshan-e-Saeed"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"shah_nawaz_bhutto_colony","label":{"Urdu":"شاہ نواز بھٹو کالونی","Roman Urdu":"Shah Nawaz Bhutto Colony","English":"Shah Nawaz Bhutto Colony"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"paposh_nagar","label":{"Urdu":"پاپوش نگر","Roman Urdu":"Paposh Nagar","English":"Paposh Nagar"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"pahar_ganj","label":{"Urdu":"پہاڑ گنج","Roman Urdu":"Pahar Ganj","English":"Pahar Ganj"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"khandu_goth","label":{"Urdu":"کھنڑو گوٹھ","Roman Urdu":"Khandu Goth","English":"Khandu Goth"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"hyderi","label":{"Urdu":"حیدری","Roman Urdu":"Hyderi","English":"Hyderi"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"sakhi_hassan","label":{"Urdu":"سخی حسن","Roman Urdu":"Sakhi Hassan","English":"Sakhi Hassan"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"farooq_e_azam","label":{"Urdu":"فاروق اعظم","Roman Urdu":"Farooq-e-Azam","English":"Farooq-e-Azam"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"nusrat_bhutto_colony","label":{"Urdu":"نصرت بھٹو کالونی","Roman Urdu":"Nusrat Bhutto Colony","English":"Nusrat Bhutto Colony"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"shadman_town","label":{"Urdu":"شادمان ٹاوَن","Roman Urdu":"Shadman Town","English":"Shadman Town"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"buffer_zone","label":{"Urdu":"بفرزون","Roman Urdu":"Buffer Zone","English":"Buffer Zone"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"buffer_zone_ii","label":{"Urdu":"بفرزون 2","Roman Urdu":"Buffer Zone II","English":"Buffer Zone II"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mominabad","label":{"Urdu":"مومن آباد","Roman Urdu":"Mominabad","English":"Mominabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"haryana_colony","label":{"Urdu":"حریانہ کالونی","Roman Urdu":"Haryana Colony","English":"Haryana Colony"}},{"province":"sindh","city":"karachi","town":"orangi","name":"hanifabad","label":{"Urdu":"حنیف آباد","Roman Urdu":"Hanifabad","English":"Hanifabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mohammad_nagar","label":{"Urdu":"محمد نگر","Roman Urdu":"Mohammad Nagar","English":"Mohammad Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"madina_colony_orangi","label":{"Urdu":"مدینہ کالونی اورنگی","Roman Urdu":"Madina Colony Orangi","English":"Madina Colony Orangi"}},{"province":"sindh","city":"karachi","town":"orangi","name":"ghaziabad","label":{"Urdu":"غازی آباد","Roman Urdu":"Ghaziabad","English":"Ghaziabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"chisti_nagar","label":{"Urdu":"چشتی نگر","Roman Urdu":"Chisti Nagar","English":"Chisti Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"bilal_colony_orangi","label":{"Urdu":"بلال کالونی اورنگی","Roman Urdu":"Bilal Colony Orangi","English":"Bilal Colony Orangi"}},{"province":"sindh","city":"karachi","town":"orangi","name":"iqbal_baloch_colony","label":{"Urdu":"اقبال بلوچ کالونی","Roman Urdu":"Iqbal Baloch Colony","English":"Iqbal Baloch Colony"}},{"province":"sindh","city":"karachi","town":"orangi","name":"ghabool_town","label":{"Urdu":"گبول ٹاوَن","Roman Urdu":"Ghabool Town","English":"Ghabool Town"}},{"province":"sindh","city":"karachi","town":"orangi","name":"data_nagar","label":{"Urdu":"داتا نگر","Roman Urdu":"Data Nagar","English":"Data Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mujahidabad","label":{"Urdu":"مجاہد آباد","Roman Urdu":"Mujahidabad","English":"Mujahidabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"baloch_goth","label":{"Urdu":"بلوچ گوٹھ","Roman Urdu":"Baloch Goth","English":"Baloch Goth"}},{"province":"sindh","city":"karachi","town":"saddar","name":"old_haji_camp","label":{"Urdu":"پرانہ حاجی کیمپ","Roman Urdu":"Old Haji Camp","English":"Old Haji Camp"}},{"province":"sindh","city":"karachi","town":"saddar","name":"garden","label":{"Urdu":"گارڈن","Roman Urdu":"Garden","English":"Garden"}},{"province":"sindh","city":"karachi","town":"saddar","name":"kharadar","label":{"Urdu":"کھارادر","Roman Urdu":"Kharadar","English":"Kharadar"}},{"province":"sindh","city":"karachi","town":"saddar","name":"city_railway_colony","label":{"Urdu":"سٹی ریلوے کالونی","Roman Urdu":"City Railway Colony","English":"City Railway Colony"}},{"province":"sindh","city":"karachi","town":"saddar","name":"nanak_wara","label":{"Urdu":"ناناک واڑا","Roman Urdu":"Nanak Wara","English":"Nanak Wara"}},{"province":"sindh","city":"karachi","town":"saddar","name":"gazdarabad","label":{"Urdu":"گزدرآباد","Roman Urdu":"Gazdarabad","English":"Gazdarabad"}},{"province":"sindh","city":"karachi","town":"saddar","name":"millat_nagar_islam_pura","label":{"Urdu":"ملت نگر اسلام پورا","Roman Urdu":"Millat Nagar/Islam Pura","English":"Millat Nagar/Islam Pura"}},{"province":"sindh","city":"karachi","town":"saddar","name":"saddar_uc","label":{"Urdu":"صدر یو سی","Roman Urdu":"Saddar UC","English":"Saddar UC"}},{"province":"sindh","city":"karachi","town":"saddar","name":"civil_line","label":{"Urdu":"سول لائن","Roman Urdu":"Civil Line","English":"Civil Line"}},{"province":"sindh","city":"karachi","town":"saddar","name":"clifton","label":{"Urdu":"کلفٹن","Roman Urdu":"Clifton","English":"Clifton"}},{"province":"sindh","city":"karachi","town":"saddar","name":"kehkashan","label":{"Urdu":"کہکشان","Roman Urdu":"Kehkashan","English":"Kehkashan"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"natha_khan_goth","label":{"Urdu":"ناتھا خان گوٹھ","Roman Urdu":"Natha Khan Goth","English":"Natha Khan Goth"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"pak_sadat_colony","label":{"Urdu":"پاک صدر کالونی","Roman Urdu":"Pak Sadat Colony","English":"Pak Sadat Colony"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"drigh_colony","label":{"Urdu":"ڈرگ کالونی","Roman Urdu":"Drigh Colony","English":"Drigh Colony"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"raita_plot","label":{"Urdu":"رائتا پلاٹ","Roman Urdu":"Raita Plot","English":"Raita Plot"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"moria_khan_goth","label":{"Urdu":"موریا خان گوٹھ","Roman Urdu":"Moria Khan Goth","English":"Moria Khan Goth"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"rafa_e_aam_society","label":{"Urdu":"رفا عام سوسا ئٹی","Roman Urdu":"Rafa-e-Aam Society","English":"Rafa-e-Aam Society"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"al_falah_society","label":{"Urdu":"الفلاح سوسا ئٹی","Roman Urdu":"Al-Falah Society","English":"Al-Falah Society"}},{"province":"sindh","city":"karachi","town":"site","name":"pak_colony","label":{"Urdu":"پاک کالونی","Roman Urdu":"Pak Colony","English":"Pak Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"old_golimar","label":{"Urdu":"پرانہ گولی مار","Roman Urdu":"Old Golimar","English":"Old Golimar"}},{"province":"sindh","city":"karachi","town":"site","name":"jahanabad","label":{"Urdu":"جہان آباد","Roman Urdu":"Jahanabad","English":"Jahanabad"}},{"province":"sindh","city":"karachi","town":"site","name":"metrovil","label":{"Urdu":"میٹروویل","Roman Urdu":"Metrovil","English":"Metrovil"}},{"province":"sindh","city":"karachi","town":"site","name":"bhawani_chali","label":{"Urdu":"بہوانی چالی","Roman Urdu":"Bhawani Chali","English":"Bhawani Chali"}},{"province":"sindh","city":"karachi","town":"site","name":"frontier_colony","label":{"Urdu":"فرونٹر کالونی","Roman Urdu":"Frontier Colony","English":"Frontier Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"banaras_colony","label":{"Urdu":"بنارس کالونی","Roman Urdu":"Banaras Colony","English":"Banaras Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"qasba_colony","label":{"Urdu":"قصبہ کالونی","Roman Urdu":"Qasba Colony","English":"Qasba Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"islamia_colony","label":{"Urdu":"اسلامیہ کالونی","Roman Urdu":"Islamia Colony","English":"Islamia Colony"}},{"province":"na","city":"na","town":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","city":"na","town":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Qaabil-e-atlaaq nahi","English":"Not Applicable"}}],"gender":[{"instance":{"openmrs_code":"1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"male","label":{"Urdu":"مرد/ لڑکا","Roman Urdu":"Mard/larka","English":"Male"}},{"instance":{"openmrs_code":"1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"female","label":{"Urdu":"عورت/لڑکی","Roman Urdu":"Aurat/larki","English":"Female"}},{"instance":{"openmrs_code":"163163AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"transgender","label":{"Urdu":"خواجہ سرہ","Roman Urdu":"Khwaja sira","English":"Transgender"}}],"vaccines":[{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT1","label":{"Urdu":"ٹی ٹی 1","Roman Urdu":"TT1","English":"TT1"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT2","label":{"Urdu":"ٹی ٹی 2","Roman Urdu":"TT2","English":"TT2"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT3","label":{"Urdu":"ٹی ٹی 3","Roman Urdu":"TT3","English":"TT3"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT4","label":{"Urdu":"ٹی ٹی 4","Roman Urdu":"TT4","English":"TT4"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT5","label":{"Urdu":"ٹی ٹی 5","Roman Urdu":"TT5","English":"TT5"}}],"towns":[{"province":"sindh","city":"karachi","name":"korangi","label":{"Urdu":"کورنگی","Roman Urdu":"Korangi","English":"Korangi"}},{"province":"sindh","city":"karachi","name":"landhi","label":{"Urdu":"لانڈھی","Roman Urdu":"Landhi","English":"Landhi"}},{"province":"sindh","city":"karachi","name":"baldia","label":{"Urdu":"بلدیہ","Roman Urdu":"Baldia","English":"Baldia"}},{"province":"sindh","city":"karachi","name":"bin_qasim","label":{"Urdu":"بن قاسم","Roman Urdu":"Bin Qasim","English":"Bin Qasim"}},{"province":"sindh","city":"karachi","name":"gadap","label":{"Urdu":"گڈاپ","Roman Urdu":"Gadap","English":"Gadap"}},{"province":"sindh","city":"karachi","name":"gulberg","label":{"Urdu":"گلبرگ","Roman Urdu":"Gulberg","English":"Gulberg"}},{"province":"sindh","city":"karachi","name":"gulshan","label":{"Urdu":"گلشن","Roman Urdu":"Gulshan","English":"Gulshan"}},{"province":"sindh","city":"karachi","name":"jamshed","label":{"Urdu":"جمشید","Roman Urdu":"Jamshed","English":"Jamshed"}},{"province":"sindh","city":"karachi","name":"kiamari","label":{"Urdu":"کیماری","Roman Urdu":"Kiamari","English":"Kiamari"}},{"province":"sindh","city":"karachi","name":"liaquatabad","label":{"Urdu":"لیاقت آباد","Roman Urdu":"Liaquatabad","English":"Liaquatabad"}},{"province":"sindh","city":"karachi","name":"lyari","label":{"Urdu":"لیاری","Roman Urdu":"Lyari","English":"Lyari"}},{"province":"sindh","city":"karachi","name":"malir","label":{"Urdu":"ملیر","Roman Urdu":"Malir","English":"Malir"}},{"province":"sindh","city":"karachi","name":"new_karachi","label":{"Urdu":"نیو کراچی","Roman Urdu":"New Karachi","English":"New Karachi"}},{"province":"sindh","city":"karachi","name":"north_nazimabad","label":{"Urdu":"نارتھ ناظم آباد","Roman Urdu":"North Nazimabad","English":"North Nazimabad"}},{"province":"sindh","city":"karachi","name":"orangi","label":{"Urdu":"اورنگی","Roman Urdu":"Orangi","English":"Orangi"}},{"province":"sindh","city":"karachi","name":"saddar","label":{"Urdu":"صدر","Roman Urdu":"Saddar","English":"Saddar"}},{"province":"sindh","city":"karachi","name":"shah_faisal","label":{"Urdu":"شاہ فیصل","Roman Urdu":"Shah Faisal","English":"Shah Faisal"}},{"province":"sindh","city":"karachi","name":"site","label":{"Urdu":"سائٹ","Roman Urdu":"S.I.T.E.","English":"S.I.T.E."}},{"province":"na","city":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","city":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Qaabil-e-atlaaq nahi","English":"Not Applicable"}}],"cities":[{"province":"sindh","name":"karachi","label":{"Urdu":"کراچی","Roman Urdu":"Karachi","English":"Karachi"}},{"province":"punjab","name":"hafizabad","label":{"Urdu":"حافظ آباد","Roman Urdu":"Hafizabad","English":"Hafizabad"}},{"province":"punjab","name":"muzaffargarh","label":{"Urdu":"مظفر گڑھ","Roman Urdu":"Muzaffargarh","English":"Muzaffargarh"}},{"province":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Not Applicable","English":"Not Applicable"}}],"edd_lmp":[{"instance":{"openmrs_code":"5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"edd","label":{"Urdu":"زچگی کی متوقع تاریخ","Roman Urdu":"EDD","English":"EDD"}},{"instance":{"openmrs_code":"1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"lmp","label":{"Urdu":"پچھلی مہواری کی تاریخ","Roman Urdu":"LMP","English":"LMP"}},{"instance":{"openmrs_code":"159617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ultrasound","label":{"Urdu":"الٹرا سائونڈ","Roman Urdu":"Ultrasound","English":"Ultrasound"}},{"instance":{"openmrs_code":"1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"none","label":{"Urdu":"کوئی بھی نہیں","Roman Urdu":"Koi bhi nahi","English":"None of the above"}}],"yes_no":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}]},"instance":{"encounter_type":"Woman TT Follow Up"},"version":"201604080459","id_string":"woman_tt_followup_form","type":"survey","children":[{"type":"hidden","name":"provider_uc"},{"type":"hidden","name":"provider_town"},{"type":"hidden","name":"provider_city"},{"type":"hidden","name":"provider_province"},{"type":"hidden","name":"existing_landmark"},{"type":"hidden","name":"existing_house_number"},{"type":"hidden","name":"existing_street"},{"type":"hidden","name":"existing_union_council"},{"type":"hidden","name":"existing_town"},{"type":"hidden","name":"existing_city_village"},{"type":"hidden","name":"existing_province"},{"type":"hidden","name":"existing_union_councilname"},{"type":"hidden","name":"existing_townname"},{"type":"hidden","name":"existing_city_villagename"},{"type":"hidden","name":"existing_provincename"},{"type":"hidden","name":"existing_first_name"},{"type":"hidden","name":"existing_last_name"},{"type":"hidden","name":"existing_father_name"},{"type":"hidden","name":"existing_husband_name"},{"type":"hidden","name":"existing_marriage"},{"type":"hidden","name":"existing_calc_dob_confirm"},{"type":"hidden","name":"existing_gender"},{"type":"hidden","name":"existing_ethnicity"},{"type":"hidden","name":"existing_client_reg_date"},{"type":"hidden","name":"existing_program_client_id"},{"type":"hidden","name":"existing_epi_card_number"},{"type":"hidden","name":"existing_reminders_approval"},{"type":"hidden","name":"existing_contact_phone_number"},{"type":"hidden","name":"e_tt1"},{"type":"hidden","name":"e_tt2"},{"type":"hidden","name":"e_tt3"},{"type":"hidden","name":"e_tt4"},{"type":"hidden","name":"e_tt5"},{"type":"hidden","name":"provider_id"},{"instance":{"openmrs_entity_id":"location_id","openmrs_entity":"encounter"},"type":"hidden","name":"provider_location_id"},{"type":"hidden","name":"provider_location_name"},{"type":"note","name":"provider_location_note","label":{"Urdu":"شہر: ${provider_city} ; ٹائون: ${provider_town} ; یوسی: ${provider_uc} ; سینٹرکا نام: ${provider_location_name}","English":"City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}"}},{"instance":{"openmrs_entity_id":"163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"start","name":"start"},{"instance":{"openmrs_entity_id":"163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"end","name":"end"},{"instance":{"openmrs_entity_id":"163286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"today","name":"today"},{"instance":{"openmrs_entity_id":"163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"deviceid","name":"deviceid"},{"instance":{"openmrs_entity_id":"163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"subscriberid","name":"subscriberid"},{"instance":{"openmrs_entity_id":"163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"simserial","name":"simserial"},{"instance":{"openmrs_entity_id":"163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"phonenumber","name":"phonenumber"},{"bind":{"required":"yes"},"type":"note","name":"client_reg_date_note","label":{"Urdu":"${existing_client_reg_date} :پروگرام میں اندراج کی تاریخ","Roman Urdu":"Program main andraaj ki tareekh: ${existing_client_reg_date}","English":"Client Registration date: ${existing_client_reg_date}"}},{"bind":{"required":"yes"},"type":"note","name":"program_client_id_note","label":{"Urdu":"${existing_program_client_id}:کلائنٹ کی پروگرام ائی ڈی","Roman Urdu":"Client ki program ID: ${existing_program_client_id}","English":"Program Client ID: ${existing_program_client_id}"}},{"bind":{"required":"yes"},"type":"note","name":"epi_card_number_note","label":{"Urdu":"${existing_epi_card_number}: کارڈ نمبر","Roman Urdu":"Card Number: ${existing_epi_card_number}","English":"EPI Card Number: ${existing_epi_card_number}"}},{"bind":{"required":"yes"},"type":"note","name":"first_name_note","label":{"Urdu":"${existing_first_name}: نام","Roman Urdu":"Naam: ${existing_first_name}","English":"First Name: ${existing_first_name}"}},{"bind":{"required":"yes"},"type":"note","name":"last_name_note","label":{"Urdu":"والد کا نام: ${existing_last_name}","Roman Urdu":"Waalid ka naam: ${existing_last_name}","English":"Last name: ${existing_last_name}"}},{"bind":{"calculate":"date( today() - (${existing_calc_dob_confirm} div 365))"},"type":"calculate","name":"client_age","instance":{"openmrs_entity_id":"154384AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"type":"note","name":"member_birth_date_note","label":{"Urdu":"کلائنٹ کی تاریخِ پیدائش: {existing_calc_dob_confirm}$ ({client_age}$) سال","English":"Client birth date: ${existing_calc_dob_confirm} (${client_age}) years","Roman Urdu":"Client ki tareekh-e-pedaaish: ${existing_calc_dob_confirm} (${client_age}) years"}},{"bind":{"required":"yes"},"type":"note","name":"gender_note","label":{"Urdu":"${existing_gender}: جنس","Roman Urdu":"Jins:${existing_gender}","English":"Gender: ${existing_gender}"}},{"type":"note","name":"father_name_note","label":{"Urdu":"والد کا نام: {existing_father_name}$","English":"Father's Name: ${existing_father_name}","Roman Urdu":"Waalid ka naam: ${existing_father_name}"}},{"type":"note","name":"marriage_note","label":{"Urdu":"کیا آپ شادی شدہ ہیں: {existing_marriage}$","English":"Are you married: ${existing_marriage}","Roman Urdu":"Kya aap shaadi shuda hain: ${existing_marriage}"}},{"type":"note","name":"husband_name_note","label":{"Urdu":"شوہر کا نام: {existing_husband_name}$","English":"Husband's name: ${existing_husband_name}","Roman Urdu":"Shohar ka naam: ${existing_husband_name}"}},{"bind":{"required":"yes"},"type":"note","name":"ethnicity_note","label":{"Urdu":"قومیت: {existing_ethnicity}$","Roman Urdu":"Qomiat: ${existing_ethnicity}","English":"Ethnicity: ${existing_ethnicity}"}},{"type":"note","name":"address","label":{"Urdu":"موجودہ پتہ: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}","English":"Current Address: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}","Roman Urdu":"Mojooda Address: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}"}},{"label":{"Urdu":"کیا آپ کا گھر کا پتہ بدلا ہے؟","English":"Has your home address changed?","Roman Urdu":"Kya aap ka ghar ka pata badla hai?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}],"name":"address_change"},{"control":{"appearance":"minimal"},"name":"province","default":"${provider_province}","bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"label":{"Urdu":"صوبہ","Roman Urdu":"Suba","English":"Province"},"instance":{"openmrs_entity":"person_address","openmrs_entity_id":"stateProvince","openmrs_entity_parent":"usual_residence"},"type":"select one","children":[{"name":"kpk","label":{"Urdu":"خیبر پختون خواہ","English":"Khyber Pakhtunkhwa","Roman Urdu":"Khyber Pakhtunkhwa"}},{"name":"sindh","label":{"Urdu":"سندھ","English":"Sindh","Roman Urdu":"Sindh"}},{"name":"balochistan","label":{"Urdu":"بلوچستان","English":"Balochistan","Roman Urdu":"Balochistan"}},{"name":"punjab","label":{"Urdu":"پنجاب","English":"Punjab","Roman Urdu":"Punjab"}},{"name":"gilgit_baltistan","label":{"Urdu":"گلگت بلتستان","English":"Gilgit Baltistan","Roman Urdu":"Gilgit Baltistan"}},{"name":"kashmir","label":{"Urdu":"کشمیر","English":"Kashmir","Roman Urdu":"Kashmir"}},{"name":"fata","label":{"Urdu":"فاٹا","English":"FATA","Roman Urdu":"FATA"}},{"name":"out_of_country","label":{"Urdu":"ملک سے باہر","English":"Out of Country","Roman Urdu":"Mulk se baahir"}}]},{"control":{"appearance":"minimal"},"name":"city_village","choice_filter":"province=${province} or province='na'","default":"${provider_city}","bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"label":{"Urdu":"شہر","Roman Urdu":"Shehr","English":"City"},"itemset":"cities","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"cityVillage","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"control":{"appearance":"minimal"},"name":"town","choice_filter":"(province=${province} and city=${city_village} ) or city='na'","bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"label":{"Urdu":"ٹاٰئون/ قصبہ/ بستی","Roman Urdu":"Town / Qasbah / Basti","English":"Town"},"itemset":"towns","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"town","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"control":{"appearance":"minimal"},"name":"union_council","choice_filter":"(province=${province} and city=${city_village} and town=${town}) or town='na'","bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"label":{"Urdu":"یونین کونسل","Roman Urdu":"Union Council","English":"Union Council"},"itemset":"ucs","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"subTown","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"house","openmrs_entity_parent":"usual_residence"},"name":"house_number","label":{"Urdu":"گھر کا نمبر","Roman Urdu":"Ghar ka number","English":"House Number"}},{"bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"street","openmrs_entity_parent":"usual_residence"},"name":"street","label":{"Urdu":"گلی/کالونی/محلہ","Roman Urdu":"Gali/Colony/Mohalla","English":"Street"}},{"bind":{"relevant":"selected(${address_change}, 'yes')","required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"landmark","openmrs_entity_parent":"usual_residence"},"name":"landmark","label":{"Urdu":"گھر کے قریب کوئی مشہور جگہ","Roman Urdu":"Ghar ke qareeb koi mashoor jagah","English":"Land Mark"}},{"instance":{"openmrs_entity_id":"163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"geopoint","name":"center_gps","label":{"Urdu":"حاصل کردہ معلومات کی جگہ کے GPS کارڈینیٹس درج کریں","English":"Collect GPS coordinates of data entry location:","Roman Urdu":"Hasil karda malomaat ki jaga ke GPS coordinates darj karain"}},{"control":{"appearance":"minimal"},"name":"reminders_approval","bind":{"required":"yes"},"label":{"Urdu":"کیا آپ اپنے بچے کی اگلی ویکسین کی تاریخ کے لیے SMS موصول کرنا چاہتے ہیں؟ {existing_reminders_approval}$","English":"Are you willing to receive SMS reminders for your next visit? ${existing_reminders_approval}","Roman Urdu":"Kya aap apnay bachay ki agli vaccine ki tareekh ke liye SMS mausool karna chahtay hain? ${existing_reminders_approval}"},"instance":{"openmrs_entity_id":"163089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}]},{"bind":{"jr:constraintMsg":{"Urdu":"فون نمبر گیارہ ہندسوں پر مشتمل اور مندرجہ ذیل شکل میں ہونا چاہئے: *********03","English":"Phone number should be 11 digits in the following format: 03*********","Roman Urdu":"Phone number 11 hindason par mushtamil aur mundarja zail shakal main hona chahiey: 03*********"},"relevant":"${existing_reminders_approval}='yes'","constraint":"regex(., '^03[0-9]{9}$')"},"type":"text","instance":{"openmrs_entity_id":"159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"contact_phone_number","label":{"Urdu":"موبائل نمبر:{existing_contact_phone_number}$","English":"Mobile Number: ${existing_contact_phone_number}","Roman Urdu":"Mobile Number: ${existing_contact_phone_number}"}},{"instance":{"openmrs_entity_id":"5272AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"label":{"Urdu":"کیا خا تون حاملہ ہیں؟","English":"Is female pregnant?","Roman Urdu":"Kia khatoon haamla hain?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}],"name":"pregnant"},{"name":"edd_lmp","bind":{"relevant":"selected (${pregnant}, 'yes')"},"label":{"Urdu":"کیا آپ کو اپنی پچھلی ماہواری کی تاریخ، زچگی کی متوقع تاریخ، یا الٹرا سائونڈ کا علم ہے؟","English":"Do you know your LMP, EDD or last Ultrasound information?","Roman Urdu":"Kya aap ko apni pichli mahwaari ki tareekh, zachgi ki mutawaqqa tareekh ya ultrasound ka ilm hai?"},"instance":{"openmrs_entity_id":"160697AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"edd","label":{"Urdu":"زچگی کی متوقع تاریخ","Roman Urdu":"EDD","English":"EDD"}},{"instance":{"openmrs_code":"1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"lmp","label":{"Urdu":"پچھلی مہواری کی تاریخ","Roman Urdu":"LMP","English":"LMP"}},{"instance":{"openmrs_code":"159617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ultrasound","label":{"Urdu":"الٹرا سائونڈ","Roman Urdu":"Ultrasound","English":"Ultrasound"}},{"instance":{"openmrs_code":"1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"none","label":{"Urdu":"کوئی بھی نہیں","Roman Urdu":"Koi bhi nahi","English":"None of the above"}}]},{"bind":{"jr:constraintMsg":{"Urdu":"زچگی کی متوقع تاریخ ماضی کی نہیں ہو سکتی","Roman Urdu":"Zachgi ki mutawaqqa tareekh maazi ki nahi hosakti","English":"EDD cannot be in the past"},"relevant":"selected (${edd_lmp}, 'edd')","constraint":".>=${today}"},"type":"date","name":"edd","label":{"Urdu":"زچگی کی متوقع تاریخ","Roman Urdu":"Zachgi ki mutawaqqa tareekh","English":"EDD"}},{"bind":{"jr:constraintMsg":{"Urdu":"پچھلی ماہواری کی تاریخ مستقبل کی نہیں ہوسکتی","Roman Urdu":"Pichli mahwaari ki tareekh mustaqbil ki nahi hosakti","English":"LMP cannot be in the future"},"relevant":"selected (${edd_lmp}, 'lmp')","constraint":".<=${today}"},"type":"date","name":"lmp","label":{"Urdu":"پچھلی ماہواری کی تاریخ","Roman Urdu":"Pichli mahwaari ki tareekh","English":"LMP"}},{"bind":{"relevant":"selected (${edd_lmp}, 'ultrasound')"},"type":"date","instance":{"openmrs_entity_id":"163165AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"ultrasound_date","label":{"Urdu":"الٹرا سائونڈ کی تاریخ","English":"Ultrasound Date","Roman Urdu":"Ultrasound ki tareekh"}},{"bind":{"relevant":"selected (${edd_lmp}, 'ultrasound')"},"type":"integer","name":"ultrasound_weeks","label":{"Urdu":"الٹرا سائونڈ کی مدد سے حمل کی مدت [ہفتوں میں]","Roman Urdu":"Ultrasound ki madad se hamal ki muddat (hafton me)","English":"Gestational age determined by ultrasound"}},{"bind":{"calculate":"date(${lmp}+280)"},"type":"calculate","name":"edd_calc_lmp"},{"bind":{"calculate":"date((280-(${ultrasound_weeks}*7)+${ultrasound_date} ))"},"type":"calculate","name":"edd_calc_ultrasound"},{"bind":{"calculate":"format-date(${edd_calc_lmp}, '%Y-%n-%e')"},"type":"calculate","name":"edd_calc_lmp_formatted"},{"bind":{"calculate":"format-date(${edd_calc_ultrasound}, '%Y-%n-%e')"},"type":"calculate","name":"edd_calc_ultrasound_formatted"},{"bind":{"calculate":"date(${edd}-280)"},"type":"calculate","name":"lmp_calc_edd"},{"bind":{"calculate":"date(${ultrasound_date}-(${ultrasound_weeks}*7))"},"type":"calculate","name":"lmp_calc_ultrasound"},{"bind":{"calculate":"format-date(${lmp_calc_edd}, '%Y-%n-%e')"},"type":"calculate","name":"lmp_calc_edd_formatted"},{"bind":{"calculate":"format-date(${lmp_calc_ultrasound}, '%Y-%n-%e')"},"type":"calculate","name":"lmp_calc_ultrasound_formatted"},{"bind":{"calculate":"if(${edd_lmp}='lmp',${edd_calc_lmp_formatted},if(${edd_lmp}='edd',${edd} ,if(${edd_lmp}='ultrasound',${edd_calc_ultrasound_formatted},'')))"},"type":"calculate","name":"final_edd","instance":{"openmrs_entity_id":"5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"bind":{"calculate":"if(${edd_lmp}='lmp',${lmp},if(${edd_lmp}='edd',${lmp_calc_edd_formatted} ,if(${edd_lmp}='ultrasound',${lmp_calc_ultrasound_formatted},'')))"},"type":"calculate","name":"final_lmp","instance":{"openmrs_entity_id":"1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"bind":{"calculate":"int((${vaccination_date} - (${edd}-280))div7)"},"type":"calculate","name":"ga_edd"},{"bind":{"calculate":"int((${vaccination_date} - ${lmp})div7)"},"type":"calculate","name":"ga_lmp"},{"bind":{"calculate":"int((${vaccination_date} -(${ultrasound_date}-(${ultrasound_weeks}*7)))div7)"},"type":"calculate","name":"ga_ult"},{"bind":{"relevant":"selected (${pregnant}, 'yes')"},"type":"note","name":"final_edd_note","label":{"Urdu":"${final_edd}: زچگی کی متوقع تاریخ","Roman Urdu":"Zachgi ki mutawaqqa tareekh: ${final_edd}","English":"EDD: ${final_edd}"}},{"bind":{"relevant":"selected (${pregnant}, 'yes')"},"type":"note","name":"final_lmp_note","label":{"Urdu":"پچھلی ماہواری کی تاریخ :{final_lmp}$","Roman Urdu":"Pichli mahwaari ki tareekh: ${final_lmp}","English":"LMP: ${final_lmp}"}},{"bind":{"calculate":"if(${edd_lmp}='lmp',${ga_lmp},if(${edd_lmp}='edd',${ga_edd} ,if(${edd_lmp}='ultrasound',${ga_ult},'')))"},"type":"calculate","name":"final_ga","instance":{"openmrs_entity_id":"163166AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"bind":{"relevant":"selected (${pregnant}, 'yes')"},"type":"note","name":"final_ga_note","label":{"Urdu":"حمل کی مُدّت: {final_ga}$ ہفتے","Roman Urdu":"Hamal ki muddat: ${final_ga} weeks","English":"GA: ${final_ga} weeks"}},{"name":"vaccines","choice_filter":"name != if( ${e_tt1} != '', 'TT1' , '') and \nname != if( ${e_tt2} != '', 'TT2' , '') and \nname != if( ${e_tt3} != '', 'TT3' , '') and \nname != if( ${e_tt4} != '', 'TT4' , '') and \nname != if( ${e_tt5} != '', 'TT5' , '')","default":"minimal","label":{"Urdu":"پچھلی تاریخ جب کسی اور سینٹر پر ٹیکہ لگوایا گیا یا قطرے پلائے گئے","Roman Urdu":"Pichli tareekh jab kissi aur center par teeka lagwaya gaya ya katray pilaey gaye","English":"Retro vaccines"},"itemset":"vaccines","instance":{"openmrs_entity":"concept","openmrs_entity_id":"984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1421AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"select all that apply"},{"bind":{"relevant":"selected(${vaccines},'TT1')","constraint":"(.<=${today} and .<=${existing_client_reg_date})"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt1_retro","label":{"Urdu":"ٹی ٹی 1","Roman Urdu":"TT1","English":"TT1"}},{"bind":{"relevant":"selected(${vaccines},'TT1')","calculate":"1"},"type":"calculate","name":"tt_1_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines},'TT2')","constraint":"(.<=${today} and .>=${tt1_retro} and ((selected(${vaccines}, 'TT1'))))"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt2_retro","label":{"Urdu":"ٹی ٹی 2","Roman Urdu":"TT2","English":"TT2"}},{"bind":{"relevant":"selected(${vaccines},'TT2')","calculate":"2"},"type":"calculate","name":"tt_2_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines},'TT3')","constraint":"(.<=${today} and .>=${tt2_retro} and ((selected(${vaccines}, 'TT2'))))"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt3_retro","label":{"Urdu":"ٹی ٹی 3","Roman Urdu":"TT3","English":"TT3"}},{"bind":{"relevant":"selected(${vaccines},'TT3')","calculate":"3"},"type":"calculate","name":"tt_3_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines},'TT4')","constraint":"(.<=${today} and .>=${tt3_retro} and ((selected(${vaccines}, 'TT3'))))"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt4_retro","label":{"Urdu":"ٹی ٹی 4","Roman Urdu":"TT4","English":"TT4"}},{"bind":{"relevant":"selected(${vaccines},'TT4')","calculate":"4"},"type":"calculate","name":"tt_4_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"name":"vaccines_2","choice_filter":"name != if( ${e_tt1} != '', 'TT1' , '') and \nname != if( ${e_tt2} != '', 'TT2' , '') and \nname != if( ${e_tt3} != '', 'TT3' , '') and \nname != if( ${e_tt4} != '', 'TT4' , '') and \nname != if( ${e_tt5} != '', 'TT5' , '') and \nname != if( selected(${vaccines}, 'TT1') , 'TT1', '') and \nname != if( selected(${vaccines}, 'TT2') , 'TT2', '') and \nname != if( selected(${vaccines}, 'TT3') , 'TT3', '') and \nname != if( selected(${vaccines}, 'TT4') , 'TT4', '') and \nname != if( selected(${vaccines}, 'TT5') , 'TT5', '')","bind":{"required":"yes"},"label":{"Urdu":"آج کون کون سی ویکسین دی گئی ہیں؟","Roman Urdu":"Aaj kon kon si vaccine di gai hain?","English":"Vaccine administered today"},"itemset":"vaccines","instance":{"openmrs_entity":"concept","openmrs_entity_id":"984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1441AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"select all that apply"},{"bind":{"required":"yes"},"type":"date","instance":{"openmrs_entity_id":"encounter_date","openmrs_entity":"encounter"},"name":"vaccination_date","label":{"Urdu":"تاریخ","English":"Vaccination date","Roman Urdu":"Tareekh"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT1'),${vaccination_date},'')"},"type":"calculate","name":"tt1","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT1')","calculate":"1"},"type":"calculate","name":"tt_1_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT2'),${vaccination_date},'')"},"type":"calculate","name":"tt2","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT2')","calculate":"2"},"type":"calculate","name":"tt_2_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT3'),${vaccination_date},'')"},"type":"calculate","name":"tt3","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT3')","calculate":"3"},"type":"calculate","name":"tt_3_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT4'),${vaccination_date},'')"},"type":"calculate","name":"tt4","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT4')","calculate":"4"},"type":"calculate","name":"tt_4_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT5'),${vaccination_date},'')"},"type":"calculate","name":"tt5","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT5')","calculate":"5"},"type":"calculate","name":"tt_5_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"control":{"bodyless":true},"type":"group","children":[{"bind":{"readonly":"true()","calculate":"concat('uuid:', uuid())"},"type":"calculate","name":"instanceID"}],"name":"meta"}]} \ No newline at end of file +{ + "name": "Woman_TT_Followup_Form", + "title": "خواتین فالواپ رجسٹر برائے ٹیکاجات - Woman TT Follow Up Form", + "sms_keyword": "woman_tt_followup_form", + "default_language": "English", + "choices": { + "provinces": [ + { + "name": "kpk", + "label": { + "Urdu": "خیبر پختون خواہ", + "English": "Khyber Pakhtunkhwa", + "Roman Urdu": "Khyber Pakhtunkhwa" + } + }, + { + "name": "sindh", + "label": { + "Urdu": "سندھ", + "English": "Sindh", + "Roman Urdu": "Sindh" + } + }, + { + "name": "balochistan", + "label": { + "Urdu": "بلوچستان", + "English": "Balochistan", + "Roman Urdu": "Balochistan" + } + }, + { + "name": "punjab", + "label": { + "Urdu": "پنجاب", + "English": "Punjab", + "Roman Urdu": "Punjab" + } + }, + { + "name": "gilgit_baltistan", + "label": { + "Urdu": "گلگت بلتستان", + "English": "Gilgit Baltistan", + "Roman Urdu": "Gilgit Baltistan" + } + }, + { + "name": "kashmir", + "label": { + "Urdu": "کشمیر", + "English": "Kashmir", + "Roman Urdu": "Kashmir" + } + }, + { + "name": "fata", + "label": { + "Urdu": "فاٹا", + "English": "FATA", + "Roman Urdu": "FATA" + } + }, + { + "name": "out_of_country", + "label": { + "Urdu": "ملک سے باہر", + "English": "Out of Country", + "Roman Urdu": "Mulk se baahir" + } + } + ], + "ucs": [ + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "bilal_colony", + "label": { + "Urdu": "بلال کالونی", + "Roman Urdu": "Bilal Colony", + "English": "Bilal Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "nasir_colony", + "label": { + "Urdu": "ناصر کالونی", + "Roman Urdu": "Nasir Colony", + "English": "Nasir Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "chakra_goth", + "label": { + "Urdu": "چکرا گوٹھ", + "Roman Urdu": "Chakra Goth", + "English": "Chakra Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "mustafa_taj_colony", + "label": { + "Urdu": "مصطفی تاج کالونی", + "Roman Urdu": "Mustafa Taj Colony", + "English": "Mustafa Taj Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "hundred_quarters", + "label": { + "Urdu": "ہنڈریڈ کوارٹر", + "Roman Urdu": "Hundred Quarters", + "English": "Hundred Quarters" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "gulzar_colony", + "label": { + "Urdu": "گلزار کالونی", + "Roman Urdu": "Gulzar Colony", + "English": "Gulzar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "korangi_sector_33", + "label": { + "Urdu": "کورنگی سیکٹر 33", + "Roman Urdu": "Korangi Sector 33", + "English": "Korangi Sector 33" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "zaman_town", + "label": { + "Urdu": "زمان ٹاوَن", + "Roman Urdu": "Zaman Town", + "English": "Zaman Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "korangi", + "name": "hasrat_mohani_colony", + "label": { + "Urdu": "حسرت موہانی کالونی", + "Roman Urdu": "Hasrat Mohani Colony", + "English": "Hasrat Mohani Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "gulshan_e_ghazi", + "label": { + "Urdu": "گلشن غازی", + "Roman Urdu": "Gulshan-e-Ghazi", + "English": "Gulshan-e-Ghazi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "ittehad_town", + "label": { + "Urdu": "اتحاد ٹاوَن", + "Roman Urdu": "Ittehad Town", + "English": "Ittehad Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "islam_nagar", + "label": { + "Urdu": "اسلام نگر", + "Roman Urdu": "Islam Nagar", + "English": "Islam Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "nai_abadi", + "label": { + "Urdu": "نئی آبادی", + "Roman Urdu": "Nai Abadi", + "English": "Nai Abadi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "saeedabad", + "label": { + "Urdu": "سعید آباد", + "Roman Urdu": "Saeedabad", + "English": "Saeedabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "muslim_mujahid_colony", + "label": { + "Urdu": "مسلم مجاہد کالونی", + "Roman Urdu": "Muslim Mujahid Colony", + "English": "Muslim Mujahid Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "muhajir_camp", + "label": { + "Urdu": "مہاجر کیمپ", + "Roman Urdu": "Muhajir Camp", + "English": "Muhajir Camp" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "baldia", + "name": "rasheedabad", + "label": { + "Urdu": "رشید آباد", + "Roman Urdu": "Rasheedabad", + "English": "Rasheedabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "ibrahim_hyderi", + "label": { + "Urdu": "ابراہیم حیدری", + "Roman Urdu": "Ibrahim Hyderi", + "English": "Ibrahim Hyderi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "rehri", + "label": { + "Urdu": "رہڑی", + "Roman Urdu": "Rehri", + "English": "Rehri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "cattle_colony", + "label": { + "Urdu": "کیٹل کالونی", + "Roman Urdu": "Cattle Colony", + "English": "Cattle Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "qaidabad", + "label": { + "Urdu": "قائدآباد", + "Roman Urdu": "Qaidabad", + "English": "Qaidabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "landhi_colony", + "label": { + "Urdu": "لانڈھی کالونی", + "Roman Urdu": "Landhi Colony", + "English": "Landhi Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "gulshan_e_hadeed", + "label": { + "Urdu": "گلشن حدید", + "Roman Urdu": "Gulshan-e-Hadeed", + "English": "Gulshan-e-Hadeed" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "bin_qasim", + "name": "gaghar", + "label": { + "Urdu": "گگر", + "Roman Urdu": "Gaghar", + "English": "Gaghar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "murad_memon_goth", + "label": { + "Urdu": "مراد میمن گوٹھ", + "Roman Urdu": "Murad Memon Goth", + "English": "Murad Memon Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "darsano_chana", + "label": { + "Urdu": "درشانو شنو", + "Roman Urdu": "Darsano Chana", + "English": "Darsano Chana" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "gujro", + "label": { + "Urdu": "گجرو", + "Roman Urdu": "Gujro", + "English": "Gujro" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "songal", + "label": { + "Urdu": "سنگل", + "Roman Urdu": "Songal", + "English": "Songal" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "maymarabad", + "label": { + "Urdu": "معمار آباد", + "Roman Urdu": "Maymarabad", + "English": "Maymarabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "yousuf_goth", + "label": { + "Urdu": "یوسف گوٹھ", + "Roman Urdu": "Yousuf Goth", + "English": "Yousuf Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gadap", + "name": "manghopir", + "label": { + "Urdu": "منگھوپیر", + "Roman Urdu": "Manghopir", + "English": "Manghopir" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "azizabad", + "label": { + "Urdu": "عزیز آباد", + "Roman Urdu": "Azizabad", + "English": "Azizabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "karimabad", + "label": { + "Urdu": "کریم آباد", + "Roman Urdu": "Karimabad", + "English": "Karimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "aisha_manzil", + "label": { + "Urdu": "عائشہ منزل", + "Roman Urdu": "Aisha Manzil", + "English": "Aisha Manzil" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "ancholi", + "label": { + "Urdu": "انچولی", + "Roman Urdu": "Ancholi", + "English": "Ancholi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "naseerabad", + "label": { + "Urdu": "نصیرآباد", + "Roman Urdu": "Naseerabad", + "English": "Naseerabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "yaseenabad", + "label": { + "Urdu": "یاسین آباد", + "Roman Urdu": "Yaseenabad", + "English": "Yaseenabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "water_pump", + "label": { + "Urdu": "واٹرپمپ", + "Roman Urdu": "Water Pump", + "English": "Water Pump" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulberg", + "name": "shafiq_mill_colony", + "label": { + "Urdu": "شفیق مل کالونی", + "Roman Urdu": "Shafiq Mill Colony", + "English": "Shafiq Mill Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "delhi_mercantile_society", + "label": { + "Urdu": "دہلی مرچنٹائل سوسائٹی", + "Roman Urdu": "Delhi Mercantile Society", + "English": "Delhi Mercantile Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "civic_centre", + "label": { + "Urdu": "سوک سینٹر", + "Roman Urdu": "Civic Centre", + "English": "Civic Centre" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "pir_ilahi_buksh_colony", + "label": { + "Urdu": "پیر الہی بخش کالونی", + "Roman Urdu": "Pir Ilahi Buksh Colony", + "English": "Pir Ilahi Buksh Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "essa_nagri", + "label": { + "Urdu": "عیسی نگری", + "Roman Urdu": "Essa Nagri", + "English": "Essa Nagri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gulshan_e_iqbal", + "label": { + "Urdu": "گلشن اقبال", + "Roman Urdu": "Gulshan-e-Iqbal", + "English": "Gulshan-e-Iqbal" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gillani_railway_station", + "label": { + "Urdu": "گیلانی ریلوے اسٹیشن", + "Roman Urdu": "Gillani Railway Station", + "English": "Gillani Railway Station" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "shanti_nagar", + "label": { + "Urdu": "شانتی نگر", + "Roman Urdu": "Shanti Nagar", + "English": "Shanti Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "jamali_colony", + "label": { + "Urdu": "جمالی کالونی", + "Roman Urdu": "Jamali Colony", + "English": "Jamali Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gulshan_e_iqbal_ii", + "label": { + "Urdu": "گلشن اقبال 2", + "Roman Urdu": "Gulshan-e-Iqbal II", + "English": "Gulshan-e-Iqbal II" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "pehlwan_goth", + "label": { + "Urdu": "پہلوان گوٹھ", + "Roman Urdu": "Pehlwan Goth", + "English": "Pehlwan Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "matrovil_colony", + "label": { + "Urdu": "میٹروویل کالونی", + "Roman Urdu": "Matrovil Colony", + "English": "Matrovil Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "gulzar_e_hijri", + "label": { + "Urdu": "گلزار ہجری", + "Roman Urdu": "Gulzar-e-Hijri", + "English": "Gulzar-e-Hijri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "gulshan", + "name": "safooran_goth", + "label": { + "Urdu": "صفورا گوٹھ", + "Roman Urdu": "Safooran Goth", + "English": "Safooran Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "akhtar_colony", + "label": { + "Urdu": "اختر کالونی", + "Roman Urdu": "Akhtar Colony", + "English": "Akhtar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "manzoor_colony", + "label": { + "Urdu": "منظور کالونی", + "Roman Urdu": "Manzoor Colony", + "English": "Manzoor Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "azam_basti", + "label": { + "Urdu": "اعظم بستی", + "Roman Urdu": "Azam Basti", + "English": "Azam Basti" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "chanesar_goth", + "label": { + "Urdu": "چنیسر گوٹھ", + "Roman Urdu": "Chanesar Goth", + "English": "Chanesar Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "mahmudabad", + "label": { + "Urdu": "محمودآباد", + "Roman Urdu": "Mahmudabad", + "English": "Mahmudabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "pechs", + "label": { + "Urdu": "پی۔ای۔سی۔ایچ۔ایس", + "Roman Urdu": "P.E.C.H.S.", + "English": "P.E.C.H.S." + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "pechs_ii", + "label": { + "Urdu": "پی۔ای۔سی۔ایچ۔ایس 2", + "Roman Urdu": "P.E.C.H.S. II", + "English": "P.E.C.H.S. II" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "jut_line", + "label": { + "Urdu": "جٹ لائن", + "Roman Urdu": "Jut Line", + "English": "Jut Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "central_jacob_lines", + "label": { + "Urdu": "سینٹرل جیکب لائن", + "Roman Urdu": "Central Jacob Lines", + "English": "Central Jacob Lines" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "jamshed_quarters", + "label": { + "Urdu": "جمشید کوارٹر", + "Roman Urdu": "Jamshed Quarters", + "English": "Jamshed Quarters" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "garden_east", + "label": { + "Urdu": "گارڈن ایسٹ", + "Roman Urdu": "Garden East", + "English": "Garden East" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "soldier_bazar", + "label": { + "Urdu": "سولجر بازار", + "Roman Urdu": "Soldier Bazar", + "English": "Soldier Bazar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "jamshed", + "name": "pakistan_quarters", + "label": { + "Urdu": "پاکستان کوارٹر", + "Roman Urdu": "Pakistan Quarters", + "English": "Pakistan Quarters" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "bhutta_village", + "label": { + "Urdu": "بھٹا ولیج", + "Roman Urdu": "Bhutta Village", + "English": "Bhutta Village" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "sultanabad", + "label": { + "Urdu": "سلطان آباد", + "Roman Urdu": "Sultanabad", + "English": "Sultanabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "kiamari_uc", + "label": { + "Urdu": "کیماری یوسی", + "Roman Urdu": "Kiamari UC", + "English": "Kiamari UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "baba_bhit", + "label": { + "Urdu": "بابا بھٹ", + "Roman Urdu": "Baba Bhit", + "English": "Baba Bhit" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "machar_colony", + "label": { + "Urdu": "مچھر کالونی", + "Roman Urdu": "Machar Colony", + "English": "Machar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "maripur", + "label": { + "Urdu": "ماڑی پور", + "Roman Urdu": "Maripur", + "English": "Maripur" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "shershah", + "label": { + "Urdu": "شیرشاہ", + "Roman Urdu": "SherShah", + "English": "SherShah" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "kiamari", + "name": "gabo_pat", + "label": { + "Urdu": "گابو پٹ", + "Roman Urdu": "Gabo Pat", + "English": "Gabo Pat" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "muzafarabad", + "label": { + "Urdu": "مظفرآباد", + "Roman Urdu": "Muzafarabad", + "English": "Muzafarabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "muslimabad", + "label": { + "Urdu": "مسلم آباد", + "Roman Urdu": "Muslimabad", + "English": "Muslimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "dawood_chowrangi", + "label": { + "Urdu": "داوَد چورنگی", + "Roman Urdu": "Dawood Chowrangi", + "English": "Dawood Chowrangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "moinabad", + "label": { + "Urdu": "معین آباد", + "Roman Urdu": "Moinabad", + "English": "Moinabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "sharafi_goth", + "label": { + "Urdu": "شرافی گوٹھ", + "Roman Urdu": "Sharafi Goth", + "English": "Sharafi Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "bhutto_nagar", + "label": { + "Urdu": "بھٹو نگر", + "Roman Urdu": "Bhutto Nagar", + "English": "Bhutto Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "khawaja_ajmeer_colony", + "label": { + "Urdu": "خواجہ اجمیر کالونی", + "Roman Urdu": "Khawaja Ajmeer Colony", + "English": "Khawaja Ajmeer Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "landhi_uc", + "label": { + "Urdu": "لانڈھی یوسی", + "Roman Urdu": "Landhi UC", + "English": "Landhi UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "awami_colony", + "label": { + "Urdu": "عوامی کالونی", + "Roman Urdu": "Awami Colony", + "English": "Awami Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "burmee_colony", + "label": { + "Urdu": "برمی کالونی", + "Roman Urdu": "Burmee Colony", + "English": "Burmee Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "korangi_uc", + "label": { + "Urdu": "کورنگی یوسی", + "Roman Urdu": "Korangi UC", + "English": "Korangi UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "landhi", + "name": "sherabad", + "label": { + "Urdu": "شیرآباد", + "Roman Urdu": "Sherabad", + "English": "Sherabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "rizvia_society", + "label": { + "Urdu": "رضویہ سوسائٹی", + "Roman Urdu": "Rizvia Society", + "English": "Rizvia Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "firdous_colony", + "label": { + "Urdu": "فردوس کالونی", + "Roman Urdu": "Firdous Colony", + "English": "Firdous Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "super_market", + "label": { + "Urdu": "سپر مارکیٹ", + "Roman Urdu": "Super Market", + "English": "Super Market" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "dak_khana", + "label": { + "Urdu": "دک کھانہ", + "Roman Urdu": "Dak Khana", + "English": "Dak Khana" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "qasimabad", + "label": { + "Urdu": "قاسم آباد", + "Roman Urdu": "Qasimabad", + "English": "Qasimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "bandhani_colony", + "label": { + "Urdu": "بندھانی کالونی", + "Roman Urdu": "Bandhani Colony", + "English": "Bandhani Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "sharifabad", + "label": { + "Urdu": "شریف آباد", + "Roman Urdu": "Sharifabad", + "English": "Sharifabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "commercial_area", + "label": { + "Urdu": "کمرشل ایریا", + "Roman Urdu": "Commercial Area", + "English": "Commercial Area" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "mujahid_colony", + "label": { + "Urdu": "مجاہد کالونی", + "Roman Urdu": "Mujahid Colony", + "English": "Mujahid Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "nazimabad", + "label": { + "Urdu": "ناظم آباد", + "Roman Urdu": "Nazimabad", + "English": "Nazimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "liaquatabad", + "name": "abbasi_shaheed", + "label": { + "Urdu": "عباسی شہید", + "Roman Urdu": "Abbasi Shaheed", + "English": "Abbasi Shaheed" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "agra_taj_colony", + "label": { + "Urdu": "آگرہ تاج کالونی", + "Roman Urdu": "Agra Taj Colony", + "English": "Agra Taj Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "daryaabad", + "label": { + "Urdu": "دریاآباد", + "Roman Urdu": "Daryaabad", + "English": "Daryaabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "nawabad", + "label": { + "Urdu": "نواآباد", + "Roman Urdu": "Nawabad", + "English": "Nawabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "khada_memon_society", + "label": { + "Urdu": "خدا- میمن- سوساَٹی", + "Roman Urdu": "Khada Memon Society", + "English": "Khada Memon Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "baghdadi", + "label": { + "Urdu": "بغدادی", + "Roman Urdu": "Baghdadi", + "English": "Baghdadi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "shah_baig_line", + "label": { + "Urdu": "شاھ باغ لائن", + "Roman Urdu": "Shah Baig Line", + "English": "Shah Baig Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "bihar_colony", + "label": { + "Urdu": "بہار کالونی", + "Roman Urdu": "Bihar Colony", + "English": "Bihar Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "ragiwara", + "label": { + "Urdu": "راگی واڑا", + "Roman Urdu": "Ragiwara", + "English": "Ragiwara" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "singo_line", + "label": { + "Urdu": "سنگولائن", + "Roman Urdu": "Singo Line", + "English": "Singo Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "chakiwara", + "label": { + "Urdu": "چاکی واڑا", + "Roman Urdu": "Chakiwara", + "English": "Chakiwara" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "lyari", + "name": "allama_iqbal_colony", + "label": { + "Urdu": "علامہ اقبال کالونی", + "Roman Urdu": "Allama Iqbal Colony", + "English": "Allama Iqbal Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "model_colony", + "label": { + "Urdu": "موڈل کالونی", + "Roman Urdu": "Model Colony", + "English": "Model Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "kala_board", + "label": { + "Urdu": "کالا بورڈ", + "Roman Urdu": "Kala Board", + "English": "Kala Board" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "saudabad", + "label": { + "Urdu": "سعودآباد", + "Roman Urdu": "Saudabad", + "English": "Saudabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "khokhra_par", + "label": { + "Urdu": "کھوکھرا پار", + "Roman Urdu": "Khokhra Par", + "English": "Khokhra Par" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "jafar_e_tayyar", + "label": { + "Urdu": "جعفر تیار", + "Roman Urdu": "Jafar-e-Tayyar", + "English": "Jafar-e-Tayyar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "gharibabad", + "label": { + "Urdu": "غریب آباد", + "Roman Urdu": "Gharibabad", + "English": "Gharibabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "malir", + "name": "ghazi_brohi_goth", + "label": { + "Urdu": "غازی بروہی گوٹھ", + "Roman Urdu": "Ghazi Brohi Goth", + "English": "Ghazi Brohi Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "kalyana", + "label": { + "Urdu": "کالیانہ", + "Roman Urdu": "Kalyana", + "English": "Kalyana" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "sir_syed_colony", + "label": { + "Urdu": "سر سید کالونی", + "Roman Urdu": "Sir Syed Colony", + "English": "Sir Syed Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "fatima_jinnah_colony", + "label": { + "Urdu": "فاطمہ جناح کالونی", + "Roman Urdu": "Fatima Jinnah Colony", + "English": "Fatima Jinnah Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "godhra", + "label": { + "Urdu": "گودھرا", + "Roman Urdu": "Godhra", + "English": "Godhra" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "abu_zar_ghaffari", + "label": { + "Urdu": "ابو زر غفاری", + "Roman Urdu": "Abu Zar Ghaffari", + "English": "Abu Zar Ghaffari" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "hakim_ahsan", + "label": { + "Urdu": "حاکم احسان", + "Roman Urdu": "Hakim Ahsan", + "English": "Hakim Ahsan" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "madina_colony", + "label": { + "Urdu": "مدینہ کالونی", + "Roman Urdu": "Madina Colony", + "English": "Madina Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "faisal_colony", + "label": { + "Urdu": "فیصل کالونی", + "Roman Urdu": "Faisal Colony", + "English": "Faisal Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "khamiso_goth", + "label": { + "Urdu": "خمیسو گوٹھ", + "Roman Urdu": "Khamiso Goth", + "English": "Khamiso Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "mustufa_colony", + "label": { + "Urdu": "مصطفی کالونی", + "Roman Urdu": "Mustufa Colony", + "English": "Mustufa Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "khawaja_ajmeer_nagri", + "label": { + "Urdu": "خواجہ اجمیر نگری", + "Roman Urdu": "Khawaja Ajmeer Nagri", + "English": "Khawaja Ajmeer Nagri" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "gulshan_e_saeed", + "label": { + "Urdu": "گلشن سعید", + "Roman Urdu": "Gulshan-e-Saeed", + "English": "Gulshan-e-Saeed" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "new_karachi", + "name": "shah_nawaz_bhutto_colony", + "label": { + "Urdu": "شاہ نواز بھٹو کالونی", + "Roman Urdu": "Shah Nawaz Bhutto Colony", + "English": "Shah Nawaz Bhutto Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "paposh_nagar", + "label": { + "Urdu": "پاپوش نگر", + "Roman Urdu": "Paposh Nagar", + "English": "Paposh Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "pahar_ganj", + "label": { + "Urdu": "پہاڑ گنج", + "Roman Urdu": "Pahar Ganj", + "English": "Pahar Ganj" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "khandu_goth", + "label": { + "Urdu": "کھنڑو گوٹھ", + "Roman Urdu": "Khandu Goth", + "English": "Khandu Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "hyderi", + "label": { + "Urdu": "حیدری", + "Roman Urdu": "Hyderi", + "English": "Hyderi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "sakhi_hassan", + "label": { + "Urdu": "سخی حسن", + "Roman Urdu": "Sakhi Hassan", + "English": "Sakhi Hassan" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "farooq_e_azam", + "label": { + "Urdu": "فاروق اعظم", + "Roman Urdu": "Farooq-e-Azam", + "English": "Farooq-e-Azam" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "nusrat_bhutto_colony", + "label": { + "Urdu": "نصرت بھٹو کالونی", + "Roman Urdu": "Nusrat Bhutto Colony", + "English": "Nusrat Bhutto Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "shadman_town", + "label": { + "Urdu": "شادمان ٹاوَن", + "Roman Urdu": "Shadman Town", + "English": "Shadman Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "buffer_zone", + "label": { + "Urdu": "بفرزون", + "Roman Urdu": "Buffer Zone", + "English": "Buffer Zone" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "north_nazimabad", + "name": "buffer_zone_ii", + "label": { + "Urdu": "بفرزون 2", + "Roman Urdu": "Buffer Zone II", + "English": "Buffer Zone II" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "mominabad", + "label": { + "Urdu": "مومن آباد", + "Roman Urdu": "Mominabad", + "English": "Mominabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "haryana_colony", + "label": { + "Urdu": "حریانہ کالونی", + "Roman Urdu": "Haryana Colony", + "English": "Haryana Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "hanifabad", + "label": { + "Urdu": "حنیف آباد", + "Roman Urdu": "Hanifabad", + "English": "Hanifabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "mohammad_nagar", + "label": { + "Urdu": "محمد نگر", + "Roman Urdu": "Mohammad Nagar", + "English": "Mohammad Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "madina_colony_orangi", + "label": { + "Urdu": "مدینہ کالونی اورنگی", + "Roman Urdu": "Madina Colony Orangi", + "English": "Madina Colony Orangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "ghaziabad", + "label": { + "Urdu": "غازی آباد", + "Roman Urdu": "Ghaziabad", + "English": "Ghaziabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "chisti_nagar", + "label": { + "Urdu": "چشتی نگر", + "Roman Urdu": "Chisti Nagar", + "English": "Chisti Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "bilal_colony_orangi", + "label": { + "Urdu": "بلال کالونی اورنگی", + "Roman Urdu": "Bilal Colony Orangi", + "English": "Bilal Colony Orangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "iqbal_baloch_colony", + "label": { + "Urdu": "اقبال بلوچ کالونی", + "Roman Urdu": "Iqbal Baloch Colony", + "English": "Iqbal Baloch Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "ghabool_town", + "label": { + "Urdu": "گبول ٹاوَن", + "Roman Urdu": "Ghabool Town", + "English": "Ghabool Town" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "data_nagar", + "label": { + "Urdu": "داتا نگر", + "Roman Urdu": "Data Nagar", + "English": "Data Nagar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "mujahidabad", + "label": { + "Urdu": "مجاہد آباد", + "Roman Urdu": "Mujahidabad", + "English": "Mujahidabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "orangi", + "name": "baloch_goth", + "label": { + "Urdu": "بلوچ گوٹھ", + "Roman Urdu": "Baloch Goth", + "English": "Baloch Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "old_haji_camp", + "label": { + "Urdu": "پرانہ حاجی کیمپ", + "Roman Urdu": "Old Haji Camp", + "English": "Old Haji Camp" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "garden", + "label": { + "Urdu": "گارڈن", + "Roman Urdu": "Garden", + "English": "Garden" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "kharadar", + "label": { + "Urdu": "کھارادر", + "Roman Urdu": "Kharadar", + "English": "Kharadar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "city_railway_colony", + "label": { + "Urdu": "سٹی ریلوے کالونی", + "Roman Urdu": "City Railway Colony", + "English": "City Railway Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "nanak_wara", + "label": { + "Urdu": "ناناک واڑا", + "Roman Urdu": "Nanak Wara", + "English": "Nanak Wara" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "gazdarabad", + "label": { + "Urdu": "گزدرآباد", + "Roman Urdu": "Gazdarabad", + "English": "Gazdarabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "millat_nagar_islam_pura", + "label": { + "Urdu": "ملت نگر اسلام پورا", + "Roman Urdu": "Millat Nagar/Islam Pura", + "English": "Millat Nagar/Islam Pura" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "saddar_uc", + "label": { + "Urdu": "صدر یو سی", + "Roman Urdu": "Saddar UC", + "English": "Saddar UC" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "civil_line", + "label": { + "Urdu": "سول لائن", + "Roman Urdu": "Civil Line", + "English": "Civil Line" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "clifton", + "label": { + "Urdu": "کلفٹن", + "Roman Urdu": "Clifton", + "English": "Clifton" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "saddar", + "name": "kehkashan", + "label": { + "Urdu": "کہکشان", + "Roman Urdu": "Kehkashan", + "English": "Kehkashan" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "natha_khan_goth", + "label": { + "Urdu": "ناتھا خان گوٹھ", + "Roman Urdu": "Natha Khan Goth", + "English": "Natha Khan Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "pak_sadat_colony", + "label": { + "Urdu": "پاک صدر کالونی", + "Roman Urdu": "Pak Sadat Colony", + "English": "Pak Sadat Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "drigh_colony", + "label": { + "Urdu": "ڈرگ کالونی", + "Roman Urdu": "Drigh Colony", + "English": "Drigh Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "raita_plot", + "label": { + "Urdu": "رائتا پلاٹ", + "Roman Urdu": "Raita Plot", + "English": "Raita Plot" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "moria_khan_goth", + "label": { + "Urdu": "موریا خان گوٹھ", + "Roman Urdu": "Moria Khan Goth", + "English": "Moria Khan Goth" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "rafa_e_aam_society", + "label": { + "Urdu": "رفا عام سوسا ئٹی", + "Roman Urdu": "Rafa-e-Aam Society", + "English": "Rafa-e-Aam Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "shah_faisal", + "name": "al_falah_society", + "label": { + "Urdu": "الفلاح سوسا ئٹی", + "Roman Urdu": "Al-Falah Society", + "English": "Al-Falah Society" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "pak_colony", + "label": { + "Urdu": "پاک کالونی", + "Roman Urdu": "Pak Colony", + "English": "Pak Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "old_golimar", + "label": { + "Urdu": "پرانہ گولی مار", + "Roman Urdu": "Old Golimar", + "English": "Old Golimar" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "jahanabad", + "label": { + "Urdu": "جہان آباد", + "Roman Urdu": "Jahanabad", + "English": "Jahanabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "metrovil", + "label": { + "Urdu": "میٹروویل", + "Roman Urdu": "Metrovil", + "English": "Metrovil" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "bhawani_chali", + "label": { + "Urdu": "بہوانی چالی", + "Roman Urdu": "Bhawani Chali", + "English": "Bhawani Chali" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "frontier_colony", + "label": { + "Urdu": "فرونٹر کالونی", + "Roman Urdu": "Frontier Colony", + "English": "Frontier Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "banaras_colony", + "label": { + "Urdu": "بنارس کالونی", + "Roman Urdu": "Banaras Colony", + "English": "Banaras Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "qasba_colony", + "label": { + "Urdu": "قصبہ کالونی", + "Roman Urdu": "Qasba Colony", + "English": "Qasba Colony" + } + }, + { + "province": "sindh", + "city": "karachi", + "town": "site", + "name": "islamia_colony", + "label": { + "Urdu": "اسلامیہ کالونی", + "Roman Urdu": "Islamia Colony", + "English": "Islamia Colony" + } + }, + { + "province": "na", + "city": "na", + "town": "na", + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + }, + { + "province": "na", + "city": "na", + "town": "na", + "name": "not_applicable", + "label": { + "Urdu": "قابل اطلاق نہیں", + "Roman Urdu": "Qaabil-e-atlaaq nahi", + "English": "Not Applicable" + } + } + ], + "gender": [ + { + "instance": { + "openmrs_code": "1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "male", + "label": { + "Urdu": "مرد/ لڑکا", + "Roman Urdu": "Mard/larka", + "English": "Male" + } + }, + { + "instance": { + "openmrs_code": "1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "female", + "label": { + "Urdu": "عورت/لڑکی", + "Roman Urdu": "Aurat/larki", + "English": "Female" + } + }, + { + "instance": { + "openmrs_code": "163163AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "transgender", + "label": { + "Urdu": "خواجہ سرہ", + "Roman Urdu": "Khwaja sira", + "English": "Transgender" + } + } + ], + "vaccines": [ + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT1", + "label": { + "Urdu": "ٹی ٹی 1", + "Roman Urdu": "TT1", + "English": "TT1" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT2", + "label": { + "Urdu": "ٹی ٹی 2", + "Roman Urdu": "TT2", + "English": "TT2" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT3", + "label": { + "Urdu": "ٹی ٹی 3", + "Roman Urdu": "TT3", + "English": "TT3" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT4", + "label": { + "Urdu": "ٹی ٹی 4", + "Roman Urdu": "TT4", + "English": "TT4" + } + }, + { + "instance": { + "openmrs_code": "84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "TT5", + "label": { + "Urdu": "ٹی ٹی 5", + "Roman Urdu": "TT5", + "English": "TT5" + } + } + ], + "towns": [ + { + "province": "sindh", + "city": "karachi", + "name": "korangi", + "label": { + "Urdu": "کورنگی", + "Roman Urdu": "Korangi", + "English": "Korangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "landhi", + "label": { + "Urdu": "لانڈھی", + "Roman Urdu": "Landhi", + "English": "Landhi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "baldia", + "label": { + "Urdu": "بلدیہ", + "Roman Urdu": "Baldia", + "English": "Baldia" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "bin_qasim", + "label": { + "Urdu": "بن قاسم", + "Roman Urdu": "Bin Qasim", + "English": "Bin Qasim" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "gadap", + "label": { + "Urdu": "گڈاپ", + "Roman Urdu": "Gadap", + "English": "Gadap" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "gulberg", + "label": { + "Urdu": "گلبرگ", + "Roman Urdu": "Gulberg", + "English": "Gulberg" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "gulshan", + "label": { + "Urdu": "گلشن", + "Roman Urdu": "Gulshan", + "English": "Gulshan" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "jamshed", + "label": { + "Urdu": "جمشید", + "Roman Urdu": "Jamshed", + "English": "Jamshed" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "kiamari", + "label": { + "Urdu": "کیماری", + "Roman Urdu": "Kiamari", + "English": "Kiamari" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "liaquatabad", + "label": { + "Urdu": "لیاقت آباد", + "Roman Urdu": "Liaquatabad", + "English": "Liaquatabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "lyari", + "label": { + "Urdu": "لیاری", + "Roman Urdu": "Lyari", + "English": "Lyari" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "malir", + "label": { + "Urdu": "ملیر", + "Roman Urdu": "Malir", + "English": "Malir" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "new_karachi", + "label": { + "Urdu": "نیو کراچی", + "Roman Urdu": "New Karachi", + "English": "New Karachi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "north_nazimabad", + "label": { + "Urdu": "نارتھ ناظم آباد", + "Roman Urdu": "North Nazimabad", + "English": "North Nazimabad" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "orangi", + "label": { + "Urdu": "اورنگی", + "Roman Urdu": "Orangi", + "English": "Orangi" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "saddar", + "label": { + "Urdu": "صدر", + "Roman Urdu": "Saddar", + "English": "Saddar" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "shah_faisal", + "label": { + "Urdu": "شاہ فیصل", + "Roman Urdu": "Shah Faisal", + "English": "Shah Faisal" + } + }, + { + "province": "sindh", + "city": "karachi", + "name": "site", + "label": { + "Urdu": "سائٹ", + "Roman Urdu": "S.I.T.E.", + "English": "S.I.T.E." + } + }, + { + "province": "na", + "city": "na", + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + }, + { + "province": "na", + "city": "na", + "name": "not_applicable", + "label": { + "Urdu": "قابل اطلاق نہیں", + "Roman Urdu": "Qaabil-e-atlaaq nahi", + "English": "Not Applicable" + } + } + ], + "cities": [ + { + "province": "sindh", + "name": "karachi", + "label": { + "Urdu": "کراچی", + "Roman Urdu": "Karachi", + "English": "Karachi" + } + }, + { + "province": "punjab", + "name": "hafizabad", + "label": { + "Urdu": "حافظ آباد", + "Roman Urdu": "Hafizabad", + "English": "Hafizabad" + } + }, + { + "province": "punjab", + "name": "muzaffargarh", + "label": { + "Urdu": "مظفر گڑھ", + "Roman Urdu": "Muzaffargarh", + "English": "Muzaffargarh" + } + }, + { + "province": "na", + "name": "other", + "label": { + "Urdu": "دیگر", + "Roman Urdu": "Deegar", + "English": "Other" + } + }, + { + "province": "na", + "name": "not_applicable", + "label": { + "Urdu": "قابل اطلاق نہیں", + "Roman Urdu": "Not Applicable", + "English": "Not Applicable" + } + } + ], + "edd_lmp": [ + { + "instance": { + "openmrs_code": "5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "edd", + "label": { + "Urdu": "زچگی کی متوقع تاریخ", + "Roman Urdu": "EDD", + "English": "EDD" + } + }, + { + "instance": { + "openmrs_code": "1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "lmp", + "label": { + "Urdu": "پچھلی مہواری کی تاریخ", + "Roman Urdu": "LMP", + "English": "LMP" + } + }, + { + "instance": { + "openmrs_code": "159617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "ultrasound", + "label": { + "Urdu": "الٹرا سائونڈ", + "Roman Urdu": "Ultrasound", + "English": "Ultrasound" + } + }, + { + "instance": { + "openmrs_code": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "none", + "label": { + "Urdu": "کوئی بھی نہیں", + "Roman Urdu": "Koi bhi nahi", + "English": "None of the above" + } + } + ], + "yes_no": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ] + }, + "instance": { + "encounter_type": "Woman TT Follow Up" + }, + "version": "201604080459", + "id_string": "woman_tt_followup_form", + "type": "survey", + "children": [ + { + "type": "hidden", + "name": "provider_uc" + }, + { + "type": "hidden", + "name": "provider_town" + }, + { + "type": "hidden", + "name": "provider_city" + }, + { + "type": "hidden", + "name": "provider_province" + }, + { + "type": "hidden", + "name": "existing_landmark" + }, + { + "type": "hidden", + "name": "existing_house_number" + }, + { + "type": "hidden", + "name": "existing_street" + }, + { + "type": "hidden", + "name": "existing_union_council" + }, + { + "type": "hidden", + "name": "existing_town" + }, + { + "type": "hidden", + "name": "existing_city_village" + }, + { + "type": "hidden", + "name": "existing_province" + }, + { + "type": "hidden", + "name": "existing_union_councilname" + }, + { + "type": "hidden", + "name": "existing_townname" + }, + { + "type": "hidden", + "name": "existing_city_villagename" + }, + { + "type": "hidden", + "name": "existing_provincename" + }, + { + "type": "hidden", + "name": "existing_first_name" + }, + { + "type": "hidden", + "name": "existing_last_name" + }, + { + "type": "hidden", + "name": "existing_father_name" + }, + { + "type": "hidden", + "name": "existing_husband_name" + }, + { + "type": "hidden", + "name": "existing_marriage" + }, + { + "type": "hidden", + "name": "existing_calc_dob_confirm" + }, + { + "type": "hidden", + "name": "existing_gender" + }, + { + "type": "hidden", + "name": "existing_ethnicity" + }, + { + "type": "hidden", + "name": "existing_client_reg_date" + }, + { + "type": "hidden", + "name": "existing_program_client_id" + }, + { + "type": "hidden", + "name": "existing_epi_card_number" + }, + { + "type": "hidden", + "name": "existing_reminders_approval" + }, + { + "type": "hidden", + "name": "existing_contact_phone_number" + }, + { + "type": "hidden", + "name": "e_tt1" + }, + { + "type": "hidden", + "name": "e_tt2" + }, + { + "type": "hidden", + "name": "e_tt3" + }, + { + "type": "hidden", + "name": "e_tt4" + }, + { + "type": "hidden", + "name": "e_tt5" + }, + { + "type": "hidden", + "name": "provider_id" + }, + { + "instance": { + "openmrs_entity_id": "location_id", + "openmrs_entity": "encounter" + }, + "type": "hidden", + "name": "provider_location_id" + }, + { + "type": "hidden", + "name": "provider_location_name" + }, + { + "type": "note", + "name": "provider_location_note", + "label": { + "Urdu": "شہر: ${provider_city} ; ٹائون: ${provider_town} ; یوسی: ${provider_uc} ; سینٹرکا نام: ${provider_location_name}", + "English": "City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}" + } + }, + { + "instance": { + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "start", + "name": "start" + }, + { + "instance": { + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "end", + "name": "end" + }, + { + "instance": { + "openmrs_entity_id": "163286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "today", + "name": "today" + }, + { + "instance": { + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "deviceid", + "name": "deviceid" + }, + { + "instance": { + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "subscriberid", + "name": "subscriberid" + }, + { + "instance": { + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "simserial", + "name": "simserial" + }, + { + "instance": { + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "phonenumber", + "name": "phonenumber" + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "client_reg_date_note", + "label": { + "Urdu": "${existing_client_reg_date} :پروگرام میں اندراج کی تاریخ", + "Roman Urdu": "Program main andraaj ki tareekh: ${existing_client_reg_date}", + "English": "Client Registration date: ${existing_client_reg_date}" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "program_client_id_note", + "label": { + "Urdu": "${existing_program_client_id}:کلائنٹ کی پروگرام ائی ڈی", + "Roman Urdu": "Client ki program ID: ${existing_program_client_id}", + "English": "Program Client ID: ${existing_program_client_id}" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "epi_card_number_note", + "label": { + "Urdu": "${existing_epi_card_number}: کارڈ نمبر", + "Roman Urdu": "Card Number: ${existing_epi_card_number}", + "English": "EPI Card Number: ${existing_epi_card_number}" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "first_name_note", + "label": { + "Urdu": "${existing_first_name}: نام", + "Roman Urdu": "Naam: ${existing_first_name}", + "English": "First Name: ${existing_first_name}" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "last_name_note", + "label": { + "Urdu": "والد کا نام: ${existing_last_name}", + "Roman Urdu": "Waalid ka naam: ${existing_last_name}", + "English": "Last name: ${existing_last_name}" + } + }, + { + "bind": { + "calculate": "date( today() - (${existing_calc_dob_confirm} div 365))" + }, + "type": "calculate", + "name": "client_age", + "instance": { + "openmrs_entity_id": "154384AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } + }, + { + "type": "note", + "name": "member_birth_date_note", + "label": { + "Urdu": "کلائنٹ کی تاریخِ پیدائش: {existing_calc_dob_confirm}$ ({client_age}$) سال", + "English": "Client birth date: ${existing_calc_dob_confirm} (${client_age}) years", + "Roman Urdu": "Client ki tareekh-e-pedaaish: ${existing_calc_dob_confirm} (${client_age}) years" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "gender_note", + "label": { + "Urdu": "${existing_gender}: جنس", + "Roman Urdu": "Jins:${existing_gender}", + "English": "Gender: ${existing_gender}" + } + }, + { + "type": "note", + "name": "father_name_note", + "label": { + "Urdu": "والد کا نام: {existing_father_name}$", + "English": "Father's Name: ${existing_father_name}", + "Roman Urdu": "Waalid ka naam: ${existing_father_name}" + } + }, + { + "type": "note", + "name": "marriage_note", + "label": { + "Urdu": "کیا آپ شادی شدہ ہیں: {existing_marriage}$", + "English": "Are you married: ${existing_marriage}", + "Roman Urdu": "Kya aap shaadi shuda hain: ${existing_marriage}" + } + }, + { + "type": "note", + "name": "husband_name_note", + "label": { + "Urdu": "شوہر کا نام: {existing_husband_name}$", + "English": "Husband's name: ${existing_husband_name}", + "Roman Urdu": "Shohar ka naam: ${existing_husband_name}" + } + }, + { + "bind": { + "required": "yes" + }, + "type": "note", + "name": "ethnicity_note", + "label": { + "Urdu": "قومیت: {existing_ethnicity}$", + "Roman Urdu": "Qomiat: ${existing_ethnicity}", + "English": "Ethnicity: ${existing_ethnicity}" + } + }, + { + "type": "note", + "name": "address", + "label": { + "Urdu": "موجودہ پتہ: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}", + "English": "Current Address: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}", + "Roman Urdu": "Mojooda Address: ${existing_house_number}, ${existing_street}, ${existing_landmark}, ${existing_union_councilname}, ${existing_townname}, ${existing_city_villagename}, ${existing_provincename}" + } + }, + { + "label": { + "Urdu": "کیا آپ کا گھر کا پتہ بدلا ہے؟", + "English": "Has your home address changed?", + "Roman Urdu": "Kya aap ka ghar ka pata badla hai?" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ], + "name": "address_change" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "province", + "default": "${provider_province}", + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "label": { + "Urdu": "صوبہ", + "Roman Urdu": "Suba", + "English": "Province" + }, + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "stateProvince", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one", + "children": [ + { + "name": "kpk", + "label": { + "Urdu": "خیبر پختون خواہ", + "English": "Khyber Pakhtunkhwa", + "Roman Urdu": "Khyber Pakhtunkhwa" + } + }, + { + "name": "sindh", + "label": { + "Urdu": "سندھ", + "English": "Sindh", + "Roman Urdu": "Sindh" + } + }, + { + "name": "balochistan", + "label": { + "Urdu": "بلوچستان", + "English": "Balochistan", + "Roman Urdu": "Balochistan" + } + }, + { + "name": "punjab", + "label": { + "Urdu": "پنجاب", + "English": "Punjab", + "Roman Urdu": "Punjab" + } + }, + { + "name": "gilgit_baltistan", + "label": { + "Urdu": "گلگت بلتستان", + "English": "Gilgit Baltistan", + "Roman Urdu": "Gilgit Baltistan" + } + }, + { + "name": "kashmir", + "label": { + "Urdu": "کشمیر", + "English": "Kashmir", + "Roman Urdu": "Kashmir" + } + }, + { + "name": "fata", + "label": { + "Urdu": "فاٹا", + "English": "FATA", + "Roman Urdu": "FATA" + } + }, + { + "name": "out_of_country", + "label": { + "Urdu": "ملک سے باہر", + "English": "Out of Country", + "Roman Urdu": "Mulk se baahir" + } + } + ] + }, + { + "control": { + "appearance": "minimal" + }, + "name": "city_village", + "choice_filter": "province=${province} or province='na'", + "default": "${provider_city}", + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "label": { + "Urdu": "شہر", + "Roman Urdu": "Shehr", + "English": "City" + }, + "itemset": "cities", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "cityVillage", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "town", + "choice_filter": "(province=${province} and city=${city_village} ) or city='na'", + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "label": { + "Urdu": "ٹاٰئون/ قصبہ/ بستی", + "Roman Urdu": "Town / Qasbah / Basti", + "English": "Town" + }, + "itemset": "towns", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "town", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one" + }, + { + "control": { + "appearance": "minimal" + }, + "name": "union_council", + "choice_filter": "(province=${province} and city=${city_village} and town=${town}) or town='na'", + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "label": { + "Urdu": "یونین کونسل", + "Roman Urdu": "Union Council", + "English": "Union Council" + }, + "itemset": "ucs", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "subTown", + "openmrs_entity_parent": "usual_residence" + }, + "type": "select one" + }, + { + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "house", + "openmrs_entity_parent": "usual_residence" + }, + "name": "house_number", + "label": { + "Urdu": "گھر کا نمبر", + "Roman Urdu": "Ghar ka number", + "English": "House Number" + } + }, + { + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "street", + "openmrs_entity_parent": "usual_residence" + }, + "name": "street", + "label": { + "Urdu": "گلی/کالونی/محلہ", + "Roman Urdu": "Gali/Colony/Mohalla", + "English": "Street" + } + }, + { + "bind": { + "relevant": "selected(${address_change}, 'yes')", + "required": "yes" + }, + "type": "text", + "instance": { + "openmrs_entity": "person_address", + "openmrs_entity_id": "landmark", + "openmrs_entity_parent": "usual_residence" + }, + "name": "landmark", + "label": { + "Urdu": "گھر کے قریب کوئی مشہور جگہ", + "Roman Urdu": "Ghar ke qareeb koi mashoor jagah", + "English": "Land Mark" + } + }, + { + "instance": { + "openmrs_entity_id": "163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "geopoint", + "name": "center_gps", + "label": { + "Urdu": "حاصل کردہ معلومات کی جگہ کے GPS کارڈینیٹس درج کریں", + "English": "Collect GPS coordinates of data entry location:", + "Roman Urdu": "Hasil karda malomaat ki jaga ke GPS coordinates darj karain" + } + }, + { + "control": { + "appearance": "minimal" + }, + "name": "reminders_approval", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "کیا آپ اپنے بچے کی اگلی ویکسین کی تاریخ کے لیے SMS موصول کرنا چاہتے ہیں؟ {existing_reminders_approval}$", + "English": "Are you willing to receive SMS reminders for your next visit? ${existing_reminders_approval}", + "Roman Urdu": "Kya aap apnay bachay ki agli vaccine ki tareekh ke liye SMS mausool karna chahtay hain? ${existing_reminders_approval}" + }, + "instance": { + "openmrs_entity_id": "163089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ] + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "فون نمبر گیارہ ہندسوں پر مشتمل اور مندرجہ ذیل شکل میں ہونا چاہئے: *********03", + "English": "Phone number should be 11 digits in the following format: 03*********", + "Roman Urdu": "Phone number 11 hindason par mushtamil aur mundarja zail shakal main hona chahiey: 03*********" + }, + "relevant": "${existing_reminders_approval}='yes'", + "constraint": "regex(., '^03[0-9]{9}$')" + }, + "type": "text", + "instance": { + "openmrs_entity_id": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "contact_phone_number", + "label": { + "Urdu": "موبائل نمبر:{existing_contact_phone_number}$", + "English": "Mobile Number: ${existing_contact_phone_number}", + "Roman Urdu": "Mobile Number: ${existing_contact_phone_number}" + } + }, + { + "instance": { + "openmrs_entity_id": "5272AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "label": { + "Urdu": "کیا خا تون حاملہ ہیں؟", + "English": "Is female pregnant?", + "Roman Urdu": "Kia khatoon haamla hain?" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "yes", + "label": { + "Urdu": "ہاں", + "Roman Urdu": "Yes", + "English": "Yes" + } + }, + { + "instance": { + "openmrs_code": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "no", + "label": { + "Urdu": "نہیں", + "Roman Urdu": "No", + "English": "No" + } + } + ], + "name": "pregnant" + }, + { + "name": "edd_lmp", + "bind": { + "relevant": "selected (${pregnant}, 'yes')" + }, + "label": { + "Urdu": "کیا آپ کو اپنی پچھلی ماہواری کی تاریخ، زچگی کی متوقع تاریخ، یا الٹرا سائونڈ کا علم ہے؟", + "English": "Do you know your LMP, EDD or last Ultrasound information?", + "Roman Urdu": "Kya aap ko apni pichli mahwaari ki tareekh, zachgi ki mutawaqqa tareekh ya ultrasound ka ilm hai?" + }, + "instance": { + "openmrs_entity_id": "160697AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "type": "select one", + "children": [ + { + "instance": { + "openmrs_code": "5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "edd", + "label": { + "Urdu": "زچگی کی متوقع تاریخ", + "Roman Urdu": "EDD", + "English": "EDD" + } + }, + { + "instance": { + "openmrs_code": "1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "lmp", + "label": { + "Urdu": "پچھلی مہواری کی تاریخ", + "Roman Urdu": "LMP", + "English": "LMP" + } + }, + { + "instance": { + "openmrs_code": "159617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "ultrasound", + "label": { + "Urdu": "الٹرا سائونڈ", + "Roman Urdu": "Ultrasound", + "English": "Ultrasound" + } + }, + { + "instance": { + "openmrs_code": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "none", + "label": { + "Urdu": "کوئی بھی نہیں", + "Roman Urdu": "Koi bhi nahi", + "English": "None of the above" + } + } + ] + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "زچگی کی متوقع تاریخ ماضی کی نہیں ہو سکتی", + "Roman Urdu": "Zachgi ki mutawaqqa tareekh maazi ki nahi hosakti", + "English": "EDD cannot be in the past" + }, + "relevant": "selected (${edd_lmp}, 'edd')", + "constraint": ".>=${today}" + }, + "type": "date", + "name": "edd", + "label": { + "Urdu": "زچگی کی متوقع تاریخ", + "Roman Urdu": "Zachgi ki mutawaqqa tareekh", + "English": "EDD" + } + }, + { + "bind": { + "jr:constraintMsg": { + "Urdu": "پچھلی ماہواری کی تاریخ مستقبل کی نہیں ہوسکتی", + "Roman Urdu": "Pichli mahwaari ki tareekh mustaqbil ki nahi hosakti", + "English": "LMP cannot be in the future" + }, + "relevant": "selected (${edd_lmp}, 'lmp')", + "constraint": ".<=${today}" + }, + "type": "date", + "name": "lmp", + "label": { + "Urdu": "پچھلی ماہواری کی تاریخ", + "Roman Urdu": "Pichli mahwaari ki tareekh", + "English": "LMP" + } + }, + { + "bind": { + "relevant": "selected (${edd_lmp}, 'ultrasound')" + }, + "type": "date", + "instance": { + "openmrs_entity_id": "163165AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + }, + "name": "ultrasound_date", + "label": { + "Urdu": "الٹرا سائونڈ کی تاریخ", + "English": "Ultrasound Date", + "Roman Urdu": "Ultrasound ki tareekh" + } + }, + { + "bind": { + "relevant": "selected (${edd_lmp}, 'ultrasound')" + }, + "type": "integer", + "name": "ultrasound_weeks", + "label": { + "Urdu": "الٹرا سائونڈ کی مدد سے حمل کی مدت [ہفتوں میں]", + "Roman Urdu": "Ultrasound ki madad se hamal ki muddat (hafton me)", + "English": "Gestational age determined by ultrasound" + } + }, + { + "bind": { + "calculate": "date(${lmp}+280)" + }, + "type": "calculate", + "name": "edd_calc_lmp" + }, + { + "bind": { + "calculate": "date((280-(${ultrasound_weeks}*7)+${ultrasound_date} ))" + }, + "type": "calculate", + "name": "edd_calc_ultrasound" + }, + { + "bind": { + "calculate": "format-date(${edd_calc_lmp}, '%Y-%n-%e')" + }, + "type": "calculate", + "name": "edd_calc_lmp_formatted" + }, + { + "bind": { + "calculate": "format-date(${edd_calc_ultrasound}, '%Y-%n-%e')" + }, + "type": "calculate", + "name": "edd_calc_ultrasound_formatted" + }, + { + "bind": { + "calculate": "date(${edd}-280)" + }, + "type": "calculate", + "name": "lmp_calc_edd" + }, + { + "bind": { + "calculate": "date(${ultrasound_date}-(${ultrasound_weeks}*7))" + }, + "type": "calculate", + "name": "lmp_calc_ultrasound" + }, + { + "bind": { + "calculate": "format-date(${lmp_calc_edd}, '%Y-%n-%e')" + }, + "type": "calculate", + "name": "lmp_calc_edd_formatted" + }, + { + "bind": { + "calculate": "format-date(${lmp_calc_ultrasound}, '%Y-%n-%e')" + }, + "type": "calculate", + "name": "lmp_calc_ultrasound_formatted" + }, + { + "bind": { + "calculate": "if(${edd_lmp}='lmp',${edd_calc_lmp_formatted},if(${edd_lmp}='edd',${edd} ,if(${edd_lmp}='ultrasound',${edd_calc_ultrasound_formatted},'')))" + }, + "type": "calculate", + "name": "final_edd", + "instance": { + "openmrs_entity_id": "5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } + }, + { + "bind": { + "calculate": "if(${edd_lmp}='lmp',${lmp},if(${edd_lmp}='edd',${lmp_calc_edd_formatted} ,if(${edd_lmp}='ultrasound',${lmp_calc_ultrasound_formatted},'')))" + }, + "type": "calculate", + "name": "final_lmp", + "instance": { + "openmrs_entity_id": "1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } + }, + { + "bind": { + "calculate": "int((${vaccination_date} - (${edd}-280))div7)" + }, + "type": "calculate", + "name": "ga_edd" + }, + { + "bind": { + "calculate": "int((${vaccination_date} - ${lmp})div7)" + }, + "type": "calculate", + "name": "ga_lmp" + }, + { + "bind": { + "calculate": "int((${vaccination_date} -(${ultrasound_date}-(${ultrasound_weeks}*7)))div7)" + }, + "type": "calculate", + "name": "ga_ult" + }, + { + "bind": { + "relevant": "selected (${pregnant}, 'yes')" + }, + "type": "note", + "name": "final_edd_note", + "label": { + "Urdu": "${final_edd}: زچگی کی متوقع تاریخ", + "Roman Urdu": "Zachgi ki mutawaqqa tareekh: ${final_edd}", + "English": "EDD: ${final_edd}" + } + }, + { + "bind": { + "relevant": "selected (${pregnant}, 'yes')" + }, + "type": "note", + "name": "final_lmp_note", + "label": { + "Urdu": "پچھلی ماہواری کی تاریخ :{final_lmp}$", + "Roman Urdu": "Pichli mahwaari ki tareekh: ${final_lmp}", + "English": "LMP: ${final_lmp}" + } + }, + { + "bind": { + "calculate": "if(${edd_lmp}='lmp',${ga_lmp},if(${edd_lmp}='edd',${ga_edd} ,if(${edd_lmp}='ultrasound',${ga_ult},'')))" + }, + "type": "calculate", + "name": "final_ga", + "instance": { + "openmrs_entity_id": "163166AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity": "concept" + } + }, + { + "bind": { + "relevant": "selected (${pregnant}, 'yes')" + }, + "type": "note", + "name": "final_ga_note", + "label": { + "Urdu": "حمل کی مُدّت: {final_ga}$ ہفتے", + "Roman Urdu": "Hamal ki muddat: ${final_ga} weeks", + "English": "GA: ${final_ga} weeks" + } + }, + { + "name": "vaccines", + "choice_filter": "name != if( ${e_tt1} != '', 'TT1' , '') and \nname != if( ${e_tt2} != '', 'TT2' , '') and \nname != if( ${e_tt3} != '', 'TT3' , '') and \nname != if( ${e_tt4} != '', 'TT4' , '') and \nname != if( ${e_tt5} != '', 'TT5' , '')", + "default": "minimal", + "label": { + "Urdu": "پچھلی تاریخ جب کسی اور سینٹر پر ٹیکہ لگوایا گیا یا قطرے پلائے گئے", + "Roman Urdu": "Pichli tareekh jab kissi aur center par teeka lagwaya gaya ya katray pilaey gaye", + "English": "Retro vaccines" + }, + "itemset": "vaccines", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1421AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "select all that apply" + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT1')", + "constraint": "(.<=${today} and .<=${existing_client_reg_date})" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "tt1_retro", + "label": { + "Urdu": "ٹی ٹی 1", + "Roman Urdu": "TT1", + "English": "TT1" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT1')", + "calculate": "1" + }, + "type": "calculate", + "name": "tt_1_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT2')", + "constraint": "(.<=${today} and .>=${tt1_retro} and ((selected(${vaccines}, 'TT1'))))" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "tt2_retro", + "label": { + "Urdu": "ٹی ٹی 2", + "Roman Urdu": "TT2", + "English": "TT2" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT2')", + "calculate": "2" + }, + "type": "calculate", + "name": "tt_2_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT3')", + "constraint": "(.<=${today} and .>=${tt2_retro} and ((selected(${vaccines}, 'TT2'))))" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "tt3_retro", + "label": { + "Urdu": "ٹی ٹی 3", + "Roman Urdu": "TT3", + "English": "TT3" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT3')", + "calculate": "3" + }, + "type": "calculate", + "name": "tt_3_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT4')", + "constraint": "(.<=${today} and .>=${tt3_retro} and ((selected(${vaccines}, 'TT3'))))" + }, + "type": "date", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "name": "tt4_retro", + "label": { + "Urdu": "ٹی ٹی 4", + "Roman Urdu": "TT4", + "English": "TT4" + } + }, + { + "bind": { + "relevant": "selected(${vaccines},'TT4')", + "calculate": "4" + }, + "type": "calculate", + "name": "tt_4_dose", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "name": "vaccines_2", + "choice_filter": "name != if( ${e_tt1} != '', 'TT1' , '') and \nname != if( ${e_tt2} != '', 'TT2' , '') and \nname != if( ${e_tt3} != '', 'TT3' , '') and \nname != if( ${e_tt4} != '', 'TT4' , '') and \nname != if( ${e_tt5} != '', 'TT5' , '') and \nname != if( selected(${vaccines}, 'TT1') , 'TT1', '') and \nname != if( selected(${vaccines}, 'TT2') , 'TT2', '') and \nname != if( selected(${vaccines}, 'TT3') , 'TT3', '') and \nname != if( selected(${vaccines}, 'TT4') , 'TT4', '') and \nname != if( selected(${vaccines}, 'TT5') , 'TT5', '')", + "bind": { + "required": "yes" + }, + "label": { + "Urdu": "آج کون کون سی ویکسین دی گئی ہیں؟", + "Roman Urdu": "Aaj kon kon si vaccine di gai hain?", + "English": "Vaccine administered today" + }, + "itemset": "vaccines", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "1441AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "type": "select all that apply" + }, + { + "bind": { + "required": "yes" + }, + "type": "date", + "instance": { + "openmrs_entity_id": "encounter_date", + "openmrs_entity": "encounter" + }, + "name": "vaccination_date", + "label": { + "Urdu": "تاریخ", + "English": "Vaccination date", + "Roman Urdu": "Tareekh" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'TT1'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "tt1", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2},'TT1')", + "calculate": "1" + }, + "type": "calculate", + "name": "tt_1_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'TT2'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "tt2", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2},'TT2')", + "calculate": "2" + }, + "type": "calculate", + "name": "tt_2_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'TT3'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "tt3", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2},'TT3')", + "calculate": "3" + }, + "type": "calculate", + "name": "tt_3_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'TT4'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "tt4", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2},'TT4')", + "calculate": "4" + }, + "type": "calculate", + "name": "tt_4_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "calculate": "if(selected(${vaccines_2}, 'TT5'),${vaccination_date},'')" + }, + "type": "calculate", + "name": "tt5", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "bind": { + "relevant": "selected(${vaccines_2},'TT5')", + "calculate": "5" + }, + "type": "calculate", + "name": "tt_5_dose_today", + "instance": { + "openmrs_entity": "concept", + "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "control": { + "bodyless": true + }, + "type": "group", + "children": [ + { + "bind": { + "readonly": "true()", + "calculate": "concat('uuid:', uuid())" + }, + "type": "calculate", + "name": "instanceID" + } + ], + "name": "meta" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/form/woman_followup/form.xml b/src/test/resources/form/woman_followup/form.xml index 678d93463..674bff666 100644 --- a/src/test/resources/form/woman_followup/form.xml +++ b/src/test/resources/form/woman_followup/form.xml @@ -1,1435 +1,1967 @@ -
+ + - +

خواتین فالواپ رجسٹر برائے ٹیکاجات - Woman TT Follow Up Form

-
- - کیا آپ کا گھر کا پتہ بدلا ہے؟ - Kya aap ka ghar ka pata badla hai? - - Has your home address changed? -
- - -
-
-
-
- - کیا خا تون حاملہ ہیں؟ - Kia khatoon haamla hain? - - Is female pregnant? -
- - -
-
-
-
- - کیا آپ کو اپنی پچھلی ماہواری کی تاریخ، زچگی کی متوقع تاریخ، یا الٹرا سائونڈ کا علم ہے؟ - Kya aap ko apni pichli mahwaari ki tareekh, zachgi ki mutawaqqa tareekh ya ultrasound ka ilm hai? - - Do you know your LMP, EDD or last Ultrasound information? -
- - - - -
+ + + + + + + + + + + + + +
+
+ + کیا + آپ کا گھر کا پتہ بدلا ہے؟ + + Kya aap ka ghar ka pata badla hai? + + + Has your home address changed? + + +
+ + +
+
-
-
- - پچھلی تاریخ جب کسی اور سینٹر پر ٹیکہ لگوایا گیا یا قطرے پلائے گئے - Pichli tareekh jab kissi aur center par teeka lagwaya gaya ya katray pilaey gaye - - Retro vaccines -
- - - ٹی ٹی 1 - TT1 - - TT1 - ٹی ٹی 2 - TT2 - - TT2 - ٹی ٹی 3 - TT3 - - TT3 - ٹی ٹی 4 - TT4 - - TT4 - ٹی ٹی 5 - TT5 - - TT5 -
+ + + + + + + + + + +
+
+ + کیا خا + تون حاملہ ہیں؟ + + + Kia khatoon haamla hain? + + + Is + female pregnant? + + +
+ + +
+
-
-
- - آج کون کون سی ویکسین دی گئی ہیں؟ - Aaj kon kon si vaccine di gai hain? - - Vaccine administered today - * -
- - - ٹی ٹی 1 - TT1 - - TT1 - ٹی ٹی 2 - TT2 - - TT2 - ٹی ٹی 3 - TT3 - - TT3 - ٹی ٹی 4 - TT4 - - TT4 - ٹی ٹی 5 - TT5 - - TT5 -
+
+
+ + کیا آپ کو + اپنی پچھلی ماہواری کی تاریخ، زچگی کی متوقع تاریخ، یا الٹرا سائونڈ کا علم ہے؟ + + + Kya aap ko apni pichli mahwaari ki tareekh, zachgi ki mutawaqqa tareekh ya ultrasound ka ilm hai? + + + Do + you know your LMP, EDD or last Ultrasound information? + + +
+ + + + +
+
-
+ + +
+
+ + آج کون + کون سی ویکسین دی گئی ہیں؟ + + Aaj kon kon si vaccine di gai hain? + + + + Vaccine administered today + + * + +
+ + + ٹی ٹی 1 + TT1 + + TT1 + ٹی ٹی 2 + TT2 + + TT2 + ٹی ٹی 3 + TT3 + + TT3 + ٹی ٹی 4 + TT4 + + TT4 + ٹی ٹی 5 + TT5 + + TT5 + +
+
+
+ + diff --git a/src/test/resources/form/woman_followup/form_definition.json b/src/test/resources/form/woman_followup/form_definition.json index b1d257f7a..47c1a5ca7 100644 --- a/src/test/resources/form/woman_followup/form_definition.json +++ b/src/test/resources/form/woman_followup/form_definition.json @@ -1,384 +1,499 @@ { - "form_data_definition_version" : "1", - "form" : { - "bind_type" : "pkwoman", - "default_bind_path" : "/model/instance/Woman_TT_Followup_Form/", - "fields" : [ { - "name" : "id", - "shouldLoadValue" : true - }, { - "name" : "provider_uc", - "bind" : "/model/instance/Woman_TT_Followup_Form/provider_uc", - "shouldLoadValue" : true - }, { - "name" : "provider_town", - "bind" : "/model/instance/Woman_TT_Followup_Form/provider_town", - "shouldLoadValue" : true - }, { - "name" : "provider_city", - "bind" : "/model/instance/Woman_TT_Followup_Form/provider_city", - "shouldLoadValue" : true - }, { - "name" : "provider_province", - "bind" : "/model/instance/Woman_TT_Followup_Form/provider_province", - "shouldLoadValue" : true - }, { - "name" : "existing_landmark", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_landmark", - "shouldLoadValue" : true - }, { - "name" : "existing_house_number", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_house_number", - "shouldLoadValue" : true - }, { - "name" : "existing_street", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_street", - "shouldLoadValue" : true - }, { - "name" : "existing_union_council", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_union_council", - "shouldLoadValue" : true - }, { - "name" : "existing_town", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_town", - "shouldLoadValue" : true - }, { - "name" : "existing_city_village", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_city_village", - "shouldLoadValue" : true - }, { - "name" : "existing_province", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_province", - "shouldLoadValue" : true - }, { - "name" : "existing_union_councilname", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_union_councilname", - "shouldLoadValue" : true - }, { - "name" : "existing_townname", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_townname", - "shouldLoadValue" : true - }, { - "name" : "existing_city_villagename", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_city_villagename", - "shouldLoadValue" : true - }, { - "name" : "existing_provincename", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_provincename", - "shouldLoadValue" : true - }, { - "name" : "existing_first_name", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_first_name", - "shouldLoadValue" : true - }, { - "name" : "existing_last_name", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_last_name", - "shouldLoadValue" : true - }, { - "name" : "existing_father_name", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_father_name", - "shouldLoadValue" : true - }, { - "name" : "existing_husband_name", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_husband_name", - "shouldLoadValue" : true - }, { - "name" : "existing_marriage", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_marriage", - "shouldLoadValue" : true - }, { - "name" : "existing_birthdate", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_calc_dob_confirm", - "shouldLoadValue" : true - }, { - "name" : "existing_gender", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_gender", - "shouldLoadValue" : true - }, { - "name" : "existing_ethnicity", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_ethnicity", - "shouldLoadValue" : true - }, { - "name" : "existing_client_reg_date", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_client_reg_date", - "shouldLoadValue" : true - }, { - "name" : "existing_program_client_id", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_program_client_id", - "shouldLoadValue" : true - }, { - "name" : "existing_epi_card_number", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_epi_card_number", - "shouldLoadValue" : true - }, { - "name" : "existing_reminders_approval", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_reminders_approval" - }, { - "name" : "existing_contact_phone_number", - "bind" : "/model/instance/Woman_TT_Followup_Form/existing_contact_phone_number" - }, { - "name" : "e_tt1", - "bind" : "/model/instance/Woman_TT_Followup_Form/e_tt1", - "shouldLoadValue" : true - }, { - "name" : "e_tt2", - "bind" : "/model/instance/Woman_TT_Followup_Form/e_tt2", - "shouldLoadValue" : true - }, { - "name" : "e_tt3", - "bind" : "/model/instance/Woman_TT_Followup_Form/e_tt3", - "shouldLoadValue" : true - }, { - "name" : "e_tt4", - "bind" : "/model/instance/Woman_TT_Followup_Form/e_tt4", - "shouldLoadValue" : true - }, { - "name" : "e_tt5", - "bind" : "/model/instance/Woman_TT_Followup_Form/e_tt5", - "shouldLoadValue" : true - }, { - "name" : "provider_id", - "bind" : "/model/instance/Woman_TT_Followup_Form/provider_id", - "shouldLoadValue" : true - }, { - "name" : "provider_location_id", - "bind" : "/model/instance/Woman_TT_Followup_Form/provider_location_id", - "shouldLoadValue" : true - }, { - "name" : "provider_location_name", - "bind" : "/model/instance/Woman_TT_Followup_Form/provider_location_name", - "shouldLoadValue" : true - }, { - "name" : "provider_location_note", - "bind" : "/model/instance/Woman_TT_Followup_Form/provider_location_note" - }, { - "name" : "start", - "bind" : "/model/instance/Woman_TT_Followup_Form/start" - }, { - "name" : "end", - "bind" : "/model/instance/Woman_TT_Followup_Form/end" - }, { - "name" : "today", - "bind" : "/model/instance/Woman_TT_Followup_Form/today" - }, { - "name" : "deviceid", - "bind" : "/model/instance/Woman_TT_Followup_Form/deviceid" - }, { - "name" : "subscriberid", - "bind" : "/model/instance/Woman_TT_Followup_Form/subscriberid" - }, { - "name" : "simserial", - "bind" : "/model/instance/Woman_TT_Followup_Form/simserial" - }, { - "name" : "phonenumber", - "bind" : "/model/instance/Woman_TT_Followup_Form/phonenumber" - }, { - "name" : "client_reg_date_note", - "bind" : "/model/instance/Woman_TT_Followup_Form/client_reg_date_note" - }, { - "name" : "program_client_id_note", - "bind" : "/model/instance/Woman_TT_Followup_Form/program_client_id_note" - }, { - "name" : "epi_card_number_note", - "bind" : "/model/instance/Woman_TT_Followup_Form/epi_card_number_note" - }, { - "name" : "first_name_note", - "bind" : "/model/instance/Woman_TT_Followup_Form/first_name_note" - }, { - "name" : "last_name_note", - "bind" : "/model/instance/Woman_TT_Followup_Form/last_name_note" - }, { - "name" : "client_age", - "bind" : "/model/instance/Woman_TT_Followup_Form/client_age" - }, { - "name" : "member_birth_date_note", - "bind" : "/model/instance/Woman_TT_Followup_Form/member_birth_date_note" - }, { - "name" : "gender_note", - "bind" : "/model/instance/Woman_TT_Followup_Form/gender_note" - }, { - "name" : "father_name_note", - "bind" : "/model/instance/Woman_TT_Followup_Form/father_name_note" - }, { - "name" : "marriage_note", - "bind" : "/model/instance/Woman_TT_Followup_Form/marriage_note" - }, { - "name" : "husband_name_note", - "bind" : "/model/instance/Woman_TT_Followup_Form/husband_name_note" - }, { - "name" : "ethnicity_note", - "bind" : "/model/instance/Woman_TT_Followup_Form/ethnicity_note" - }, { - "name" : "address", - "bind" : "/model/instance/Woman_TT_Followup_Form/address" - }, { - "name" : "address_change", - "bind" : "/model/instance/Woman_TT_Followup_Form/address_change" - }, { - "name" : "province", - "bind" : "/model/instance/Woman_TT_Followup_Form/province" - }, { - "name" : "city_village", - "bind" : "/model/instance/Woman_TT_Followup_Form/city_village" - }, { - "name" : "town", - "bind" : "/model/instance/Woman_TT_Followup_Form/town" - }, { - "name" : "union_council", - "bind" : "/model/instance/Woman_TT_Followup_Form/union_council" - }, { - "name" : "house_number", - "bind" : "/model/instance/Woman_TT_Followup_Form/house_number" - }, { - "name" : "street", - "bind" : "/model/instance/Woman_TT_Followup_Form/street" - }, { - "name" : "landmark", - "bind" : "/model/instance/Woman_TT_Followup_Form/landmark" - }, { - "name" : "center_gps", - "bind" : "/model/instance/Woman_TT_Followup_Form/center_gps" - }, { - "name" : "reminders_approval", - "bind" : "/model/instance/Woman_TT_Followup_Form/reminders_approval" - }, { - "name" : "contact_phone_number", - "bind" : "/model/instance/Woman_TT_Followup_Form/contact_phone_number" - }, { - "name" : "pregnant", - "bind" : "/model/instance/Woman_TT_Followup_Form/pregnant" - }, { - "name" : "edd_lmp", - "bind" : "/model/instance/Woman_TT_Followup_Form/edd_lmp" - }, { - "name" : "edd", - "bind" : "/model/instance/Woman_TT_Followup_Form/edd" - }, { - "name" : "lmp", - "bind" : "/model/instance/Woman_TT_Followup_Form/lmp" - }, { - "name" : "ultrasound_date", - "bind" : "/model/instance/Woman_TT_Followup_Form/ultrasound_date" - }, { - "name" : "ultrasound_weeks", - "bind" : "/model/instance/Woman_TT_Followup_Form/ultrasound_weeks" - }, { - "name" : "edd_calc_lmp", - "bind" : "/model/instance/Woman_TT_Followup_Form/edd_calc_lmp" - }, { - "name" : "edd_calc_ultrasound", - "bind" : "/model/instance/Woman_TT_Followup_Form/edd_calc_ultrasound" - }, { - "name" : "edd_calc_lmp_formatted", - "bind" : "/model/instance/Woman_TT_Followup_Form/edd_calc_lmp_formatted" - }, { - "name" : "edd_calc_ultrasound_formatted", - "bind" : "/model/instance/Woman_TT_Followup_Form/edd_calc_ultrasound_formatted" - }, { - "name" : "lmp_calc_edd", - "bind" : "/model/instance/Woman_TT_Followup_Form/lmp_calc_edd" - }, { - "name" : "lmp_calc_ultrasound", - "bind" : "/model/instance/Woman_TT_Followup_Form/lmp_calc_ultrasound" - }, { - "name" : "lmp_calc_edd_formatted", - "bind" : "/model/instance/Woman_TT_Followup_Form/lmp_calc_edd_formatted" - }, { - "name" : "lmp_calc_ultrasound_formatted", - "bind" : "/model/instance/Woman_TT_Followup_Form/lmp_calc_ultrasound_formatted" - }, { - "name" : "final_edd", - "bind" : "/model/instance/Woman_TT_Followup_Form/final_edd" - }, { - "name" : "final_lmp", - "bind" : "/model/instance/Woman_TT_Followup_Form/final_lmp" - }, { - "name" : "ga_edd", - "bind" : "/model/instance/Woman_TT_Followup_Form/ga_edd" - }, { - "name" : "ga_lmp", - "bind" : "/model/instance/Woman_TT_Followup_Form/ga_lmp" - }, { - "name" : "ga_ult", - "bind" : "/model/instance/Woman_TT_Followup_Form/ga_ult" - }, { - "name" : "final_edd_note", - "bind" : "/model/instance/Woman_TT_Followup_Form/final_edd_note" - }, { - "name" : "final_lmp_note", - "bind" : "/model/instance/Woman_TT_Followup_Form/final_lmp_note" - }, { - "name" : "final_ga", - "bind" : "/model/instance/Woman_TT_Followup_Form/final_ga" - }, { - "name" : "final_ga_note", - "bind" : "/model/instance/Woman_TT_Followup_Form/final_ga_note" - }, { - "name" : "vaccines", - "bind" : "/model/instance/Woman_TT_Followup_Form/vaccines" - }, { - "name" : "tt1_retro", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt1_retro" - }, { - "name" : "tt_1_dose", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt_1_dose" - }, { - "name" : "tt2_retro", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt2_retro" - }, { - "name" : "tt_2_dose", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt_2_dose" - }, { - "name" : "tt3_retro", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt3_retro" - }, { - "name" : "tt_3_dose", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt_3_dose" - }, { - "name" : "tt4_retro", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt4_retro" - }, { - "name" : "tt_4_dose", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt_4_dose" - }, { - "name" : "vaccines_2", - "bind" : "/model/instance/Woman_TT_Followup_Form/vaccines_2" - }, { - "name" : "vaccination_date", - "bind" : "/model/instance/Woman_TT_Followup_Form/vaccination_date" - }, { - "name" : "tt1", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt1" - }, { - "name" : "tt_1_dose_today", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt_1_dose_today" - }, { - "name" : "tt2", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt2" - }, { - "name" : "tt_2_dose_today", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt_2_dose_today" - }, { - "name" : "tt3", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt3" - }, { - "name" : "tt_3_dose_today", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt_3_dose_today" - }, { - "name" : "tt4", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt4" - }, { - "name" : "tt_4_dose_today", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt_4_dose_today" - }, { - "name" : "tt5", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt5" - }, { - "name" : "tt_5_dose_today", - "bind" : "/model/instance/Woman_TT_Followup_Form/tt_5_dose_today" - }, { - "name" : "instanceID", - "bind" : "/model/instance/Woman_TT_Followup_Form/meta/instanceID" - } ] + "form_data_definition_version": "1", + "form": { + "bind_type": "pkwoman", + "default_bind_path": "/model/instance/Woman_TT_Followup_Form/", + "fields": [ + { + "name": "id", + "shouldLoadValue": true + }, + { + "name": "provider_uc", + "bind": "/model/instance/Woman_TT_Followup_Form/provider_uc", + "shouldLoadValue": true + }, + { + "name": "provider_town", + "bind": "/model/instance/Woman_TT_Followup_Form/provider_town", + "shouldLoadValue": true + }, + { + "name": "provider_city", + "bind": "/model/instance/Woman_TT_Followup_Form/provider_city", + "shouldLoadValue": true + }, + { + "name": "provider_province", + "bind": "/model/instance/Woman_TT_Followup_Form/provider_province", + "shouldLoadValue": true + }, + { + "name": "existing_landmark", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_landmark", + "shouldLoadValue": true + }, + { + "name": "existing_house_number", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_house_number", + "shouldLoadValue": true + }, + { + "name": "existing_street", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_street", + "shouldLoadValue": true + }, + { + "name": "existing_union_council", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_union_council", + "shouldLoadValue": true + }, + { + "name": "existing_town", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_town", + "shouldLoadValue": true + }, + { + "name": "existing_city_village", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_city_village", + "shouldLoadValue": true + }, + { + "name": "existing_province", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_province", + "shouldLoadValue": true + }, + { + "name": "existing_union_councilname", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_union_councilname", + "shouldLoadValue": true + }, + { + "name": "existing_townname", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_townname", + "shouldLoadValue": true + }, + { + "name": "existing_city_villagename", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_city_villagename", + "shouldLoadValue": true + }, + { + "name": "existing_provincename", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_provincename", + "shouldLoadValue": true + }, + { + "name": "existing_first_name", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_first_name", + "shouldLoadValue": true + }, + { + "name": "existing_last_name", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_last_name", + "shouldLoadValue": true + }, + { + "name": "existing_father_name", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_father_name", + "shouldLoadValue": true + }, + { + "name": "existing_husband_name", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_husband_name", + "shouldLoadValue": true + }, + { + "name": "existing_marriage", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_marriage", + "shouldLoadValue": true + }, + { + "name": "existing_birthdate", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_calc_dob_confirm", + "shouldLoadValue": true + }, + { + "name": "existing_gender", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_gender", + "shouldLoadValue": true + }, + { + "name": "existing_ethnicity", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_ethnicity", + "shouldLoadValue": true + }, + { + "name": "existing_client_reg_date", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_client_reg_date", + "shouldLoadValue": true + }, + { + "name": "existing_program_client_id", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_program_client_id", + "shouldLoadValue": true + }, + { + "name": "existing_epi_card_number", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_epi_card_number", + "shouldLoadValue": true + }, + { + "name": "existing_reminders_approval", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_reminders_approval" + }, + { + "name": "existing_contact_phone_number", + "bind": "/model/instance/Woman_TT_Followup_Form/existing_contact_phone_number" + }, + { + "name": "e_tt1", + "bind": "/model/instance/Woman_TT_Followup_Form/e_tt1", + "shouldLoadValue": true + }, + { + "name": "e_tt2", + "bind": "/model/instance/Woman_TT_Followup_Form/e_tt2", + "shouldLoadValue": true + }, + { + "name": "e_tt3", + "bind": "/model/instance/Woman_TT_Followup_Form/e_tt3", + "shouldLoadValue": true + }, + { + "name": "e_tt4", + "bind": "/model/instance/Woman_TT_Followup_Form/e_tt4", + "shouldLoadValue": true + }, + { + "name": "e_tt5", + "bind": "/model/instance/Woman_TT_Followup_Form/e_tt5", + "shouldLoadValue": true + }, + { + "name": "provider_id", + "bind": "/model/instance/Woman_TT_Followup_Form/provider_id", + "shouldLoadValue": true + }, + { + "name": "provider_location_id", + "bind": "/model/instance/Woman_TT_Followup_Form/provider_location_id", + "shouldLoadValue": true + }, + { + "name": "provider_location_name", + "bind": "/model/instance/Woman_TT_Followup_Form/provider_location_name", + "shouldLoadValue": true + }, + { + "name": "provider_location_note", + "bind": "/model/instance/Woman_TT_Followup_Form/provider_location_note" + }, + { + "name": "start", + "bind": "/model/instance/Woman_TT_Followup_Form/start" + }, + { + "name": "end", + "bind": "/model/instance/Woman_TT_Followup_Form/end" + }, + { + "name": "today", + "bind": "/model/instance/Woman_TT_Followup_Form/today" + }, + { + "name": "deviceid", + "bind": "/model/instance/Woman_TT_Followup_Form/deviceid" + }, + { + "name": "subscriberid", + "bind": "/model/instance/Woman_TT_Followup_Form/subscriberid" + }, + { + "name": "simserial", + "bind": "/model/instance/Woman_TT_Followup_Form/simserial" + }, + { + "name": "phonenumber", + "bind": "/model/instance/Woman_TT_Followup_Form/phonenumber" + }, + { + "name": "client_reg_date_note", + "bind": "/model/instance/Woman_TT_Followup_Form/client_reg_date_note" + }, + { + "name": "program_client_id_note", + "bind": "/model/instance/Woman_TT_Followup_Form/program_client_id_note" + }, + { + "name": "epi_card_number_note", + "bind": "/model/instance/Woman_TT_Followup_Form/epi_card_number_note" + }, + { + "name": "first_name_note", + "bind": "/model/instance/Woman_TT_Followup_Form/first_name_note" + }, + { + "name": "last_name_note", + "bind": "/model/instance/Woman_TT_Followup_Form/last_name_note" + }, + { + "name": "client_age", + "bind": "/model/instance/Woman_TT_Followup_Form/client_age" + }, + { + "name": "member_birth_date_note", + "bind": "/model/instance/Woman_TT_Followup_Form/member_birth_date_note" + }, + { + "name": "gender_note", + "bind": "/model/instance/Woman_TT_Followup_Form/gender_note" + }, + { + "name": "father_name_note", + "bind": "/model/instance/Woman_TT_Followup_Form/father_name_note" + }, + { + "name": "marriage_note", + "bind": "/model/instance/Woman_TT_Followup_Form/marriage_note" + }, + { + "name": "husband_name_note", + "bind": "/model/instance/Woman_TT_Followup_Form/husband_name_note" + }, + { + "name": "ethnicity_note", + "bind": "/model/instance/Woman_TT_Followup_Form/ethnicity_note" + }, + { + "name": "address", + "bind": "/model/instance/Woman_TT_Followup_Form/address" + }, + { + "name": "address_change", + "bind": "/model/instance/Woman_TT_Followup_Form/address_change" + }, + { + "name": "province", + "bind": "/model/instance/Woman_TT_Followup_Form/province" + }, + { + "name": "city_village", + "bind": "/model/instance/Woman_TT_Followup_Form/city_village" + }, + { + "name": "town", + "bind": "/model/instance/Woman_TT_Followup_Form/town" + }, + { + "name": "union_council", + "bind": "/model/instance/Woman_TT_Followup_Form/union_council" + }, + { + "name": "house_number", + "bind": "/model/instance/Woman_TT_Followup_Form/house_number" + }, + { + "name": "street", + "bind": "/model/instance/Woman_TT_Followup_Form/street" + }, + { + "name": "landmark", + "bind": "/model/instance/Woman_TT_Followup_Form/landmark" + }, + { + "name": "center_gps", + "bind": "/model/instance/Woman_TT_Followup_Form/center_gps" + }, + { + "name": "reminders_approval", + "bind": "/model/instance/Woman_TT_Followup_Form/reminders_approval" + }, + { + "name": "contact_phone_number", + "bind": "/model/instance/Woman_TT_Followup_Form/contact_phone_number" + }, + { + "name": "pregnant", + "bind": "/model/instance/Woman_TT_Followup_Form/pregnant" + }, + { + "name": "edd_lmp", + "bind": "/model/instance/Woman_TT_Followup_Form/edd_lmp" + }, + { + "name": "edd", + "bind": "/model/instance/Woman_TT_Followup_Form/edd" + }, + { + "name": "lmp", + "bind": "/model/instance/Woman_TT_Followup_Form/lmp" + }, + { + "name": "ultrasound_date", + "bind": "/model/instance/Woman_TT_Followup_Form/ultrasound_date" + }, + { + "name": "ultrasound_weeks", + "bind": "/model/instance/Woman_TT_Followup_Form/ultrasound_weeks" + }, + { + "name": "edd_calc_lmp", + "bind": "/model/instance/Woman_TT_Followup_Form/edd_calc_lmp" + }, + { + "name": "edd_calc_ultrasound", + "bind": "/model/instance/Woman_TT_Followup_Form/edd_calc_ultrasound" + }, + { + "name": "edd_calc_lmp_formatted", + "bind": "/model/instance/Woman_TT_Followup_Form/edd_calc_lmp_formatted" + }, + { + "name": "edd_calc_ultrasound_formatted", + "bind": "/model/instance/Woman_TT_Followup_Form/edd_calc_ultrasound_formatted" + }, + { + "name": "lmp_calc_edd", + "bind": "/model/instance/Woman_TT_Followup_Form/lmp_calc_edd" + }, + { + "name": "lmp_calc_ultrasound", + "bind": "/model/instance/Woman_TT_Followup_Form/lmp_calc_ultrasound" + }, + { + "name": "lmp_calc_edd_formatted", + "bind": "/model/instance/Woman_TT_Followup_Form/lmp_calc_edd_formatted" + }, + { + "name": "lmp_calc_ultrasound_formatted", + "bind": "/model/instance/Woman_TT_Followup_Form/lmp_calc_ultrasound_formatted" + }, + { + "name": "final_edd", + "bind": "/model/instance/Woman_TT_Followup_Form/final_edd" + }, + { + "name": "final_lmp", + "bind": "/model/instance/Woman_TT_Followup_Form/final_lmp" + }, + { + "name": "ga_edd", + "bind": "/model/instance/Woman_TT_Followup_Form/ga_edd" + }, + { + "name": "ga_lmp", + "bind": "/model/instance/Woman_TT_Followup_Form/ga_lmp" + }, + { + "name": "ga_ult", + "bind": "/model/instance/Woman_TT_Followup_Form/ga_ult" + }, + { + "name": "final_edd_note", + "bind": "/model/instance/Woman_TT_Followup_Form/final_edd_note" + }, + { + "name": "final_lmp_note", + "bind": "/model/instance/Woman_TT_Followup_Form/final_lmp_note" + }, + { + "name": "final_ga", + "bind": "/model/instance/Woman_TT_Followup_Form/final_ga" + }, + { + "name": "final_ga_note", + "bind": "/model/instance/Woman_TT_Followup_Form/final_ga_note" + }, + { + "name": "vaccines", + "bind": "/model/instance/Woman_TT_Followup_Form/vaccines" + }, + { + "name": "tt1_retro", + "bind": "/model/instance/Woman_TT_Followup_Form/tt1_retro" + }, + { + "name": "tt_1_dose", + "bind": "/model/instance/Woman_TT_Followup_Form/tt_1_dose" + }, + { + "name": "tt2_retro", + "bind": "/model/instance/Woman_TT_Followup_Form/tt2_retro" + }, + { + "name": "tt_2_dose", + "bind": "/model/instance/Woman_TT_Followup_Form/tt_2_dose" + }, + { + "name": "tt3_retro", + "bind": "/model/instance/Woman_TT_Followup_Form/tt3_retro" + }, + { + "name": "tt_3_dose", + "bind": "/model/instance/Woman_TT_Followup_Form/tt_3_dose" + }, + { + "name": "tt4_retro", + "bind": "/model/instance/Woman_TT_Followup_Form/tt4_retro" + }, + { + "name": "tt_4_dose", + "bind": "/model/instance/Woman_TT_Followup_Form/tt_4_dose" + }, + { + "name": "vaccines_2", + "bind": "/model/instance/Woman_TT_Followup_Form/vaccines_2" + }, + { + "name": "vaccination_date", + "bind": "/model/instance/Woman_TT_Followup_Form/vaccination_date" + }, + { + "name": "tt1", + "bind": "/model/instance/Woman_TT_Followup_Form/tt1" + }, + { + "name": "tt_1_dose_today", + "bind": "/model/instance/Woman_TT_Followup_Form/tt_1_dose_today" + }, + { + "name": "tt2", + "bind": "/model/instance/Woman_TT_Followup_Form/tt2" + }, + { + "name": "tt_2_dose_today", + "bind": "/model/instance/Woman_TT_Followup_Form/tt_2_dose_today" + }, + { + "name": "tt3", + "bind": "/model/instance/Woman_TT_Followup_Form/tt3" + }, + { + "name": "tt_3_dose_today", + "bind": "/model/instance/Woman_TT_Followup_Form/tt_3_dose_today" + }, + { + "name": "tt4", + "bind": "/model/instance/Woman_TT_Followup_Form/tt4" + }, + { + "name": "tt_4_dose_today", + "bind": "/model/instance/Woman_TT_Followup_Form/tt_4_dose_today" + }, + { + "name": "tt5", + "bind": "/model/instance/Woman_TT_Followup_Form/tt5" + }, + { + "name": "tt_5_dose_today", + "bind": "/model/instance/Woman_TT_Followup_Form/tt_5_dose_today" + }, + { + "name": "instanceID", + "bind": "/model/instance/Woman_TT_Followup_Form/meta/instanceID" + } + ] } } \ No newline at end of file diff --git a/src/test/resources/form/woman_followup/model.xml b/src/test/resources/form/woman_followup/model.xml index e914536dd..b4eb3d641 100644 --- a/src/test/resources/form/woman_followup/model.xml +++ b/src/test/resources/form/woman_followup/model.xml @@ -63,13 +63,20 @@
- ${provider_province} - ${provider_city} + ${provider_province} + + ${provider_city} + - - + + - + @@ -96,27 +103,48 @@ - minimal - - - - - - - - - + minimal + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + diff --git a/src/test/resources/report-definition.json b/src/test/resources/report-definition.json index adb4932b8..7b1beb1c6 100644 --- a/src/test/resources/report-definition.json +++ b/src/test/resources/report-definition.json @@ -1,29 +1,29 @@ { - "formIndicators": [ + "formIndicators": [ + { + "form": "child_close", + "indicators": [ { - "form": "child_close", - "indicators": [ - { - "indicator": "INFANT_LEFT", - "formFields": [ - "id", - "closeReason", - "submissionDate" - ], - "referenceData": { - "type": "child", - "idField": "id", - "fields": [ - "dateOfBirth" - ] - }, - "reportWhen": [ - "IsChildLessThanOneYearOldRule", - "RelocationIsPermanentRule" - ], - "bindType": "child" - } + "indicator": "INFANT_LEFT", + "formFields": [ + "id", + "closeReason", + "submissionDate" + ], + "referenceData": { + "type": "child", + "idField": "id", + "fields": [ + "dateOfBirth" ] + }, + "reportWhen": [ + "IsChildLessThanOneYearOldRule", + "RelocationIsPermanentRule" + ], + "bindType": "child" } - ] + ] + } + ] } diff --git a/src/test/resources/report-fields-definition.json b/src/test/resources/report-fields-definition.json index 1de01ae20..6e1711167 100644 --- a/src/test/resources/report-fields-definition.json +++ b/src/test/resources/report-fields-definition.json @@ -1,10 +1,10 @@ { - "form1": [ - "field1", - "field2" - ], - "form2": [ - "field3", - "field4" - ] + "form1": [ + "field1", + "field2" + ], + "form2": [ + "field3", + "field4" + ] } diff --git a/src/test/resources/schedules/child-bcg.json b/src/test/resources/schedules/child-bcg.json index fbab1eefb..c7824c6c1 100644 --- a/src/test/resources/schedules/child-bcg.json +++ b/src/test/resources/schedules/child-bcg.json @@ -1,29 +1,45 @@ { - "name": "BCG", - "absolute": true, - "milestones": [ + "name": "BCG", + "absolute": true, + "milestones": [ + { + "name": "bcg", + "scheduleWindows": { + "earliest": [ + "1 Days" + ], + "due": [ + "28 Days" + ], + "late": [ + "11 Months" + ], + "max": [ + "1 Year" + ] + }, + "alerts": [ { - "name": "bcg", - "scheduleWindows": { - "earliest": ["1 Days"], - "due": ["28 Days"], - "late": ["11 Months"], - "max": ["1 Year"] - }, - "alerts": [ - { - "window": "due", - "offset": ["0 Days"], - "interval": ["1 Day"], - "count": "28" - }, - { - "window": "late", - "offset": ["29 Days"], - "interval": ["1 Day"], - "count": "350" - } - ] + "window": "due", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Day" + ], + "count": "28" + }, + { + "window": "late", + "offset": [ + "29 Days" + ], + "interval": [ + "1 Day" + ], + "count": "350" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-boosters.json b/src/test/resources/schedules/child-boosters.json index 546d4229e..042050ab7 100644 --- a/src/test/resources/schedules/child-boosters.json +++ b/src/test/resources/schedules/child-boosters.json @@ -1,23 +1,35 @@ { - "name": "Boosters", - "absolute": false, - "milestones": [ + "name": "Boosters", + "absolute": false, + "milestones": [ + { + "name": "REMINDER", + "scheduleWindows": { + "earliest": [ + "72 Weeks" + ], + "due": [ + "73 Weeks" + ], + "late": [ + "" + ], + "max": [ + "" + ] + }, + "alerts": [ { - "name": "REMINDER", - "scheduleWindows": { - "earliest": ["72 Weeks"], - "due": ["73 Weeks"], - "late": [""], - "max": [""] - }, - "alerts": [ - { - "window": "due", - "offset": ["0 Days"], - "interval": ["1 Week"], - "count": "1" - } - ] + "window": "due", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Week" + ], + "count": "1" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-dpt-booster1.json b/src/test/resources/schedules/child-dpt-booster1.json index ac3930beb..53bca016e 100644 --- a/src/test/resources/schedules/child-dpt-booster1.json +++ b/src/test/resources/schedules/child-dpt-booster1.json @@ -1,35 +1,55 @@ { - "name": "DPT Booster 1", - "absolute": true, - "milestones": [ + "name": "DPT Booster 1", + "absolute": true, + "milestones": [ + { + "name": "dptbooster_1", + "scheduleWindows": { + "earliest": [ + "16 Months" + ], + "due": [ + "24 Months" + ], + "late": [ + "5 Years" + ], + "max": [ + "" + ] + }, + "alerts": [ { - "name": "dptbooster_1", - "scheduleWindows": { - "earliest": ["16 Months"], - "due": ["24 Months"], - "late": ["5 Years"], - "max": [""] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Days"], - "interval": ["1 Day"], - "count": "486" - }, - { - "window": "due", - "offset": ["16 Months"], - "interval": ["1 Day"], - "count": "243" - }, - { - "window": "late", - "offset": ["24 Months"], - "interval": ["1 Day"], - "count": "1095" - } - ] + "window": "earliest", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Day" + ], + "count": "486" + }, + { + "window": "due", + "offset": [ + "16 Months" + ], + "interval": [ + "1 Day" + ], + "count": "243" + }, + { + "window": "late", + "offset": [ + "24 Months" + ], + "interval": [ + "1 Day" + ], + "count": "1095" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-dpt-booster2.json b/src/test/resources/schedules/child-dpt-booster2.json index 74f1a83ba..3757617d0 100644 --- a/src/test/resources/schedules/child-dpt-booster2.json +++ b/src/test/resources/schedules/child-dpt-booster2.json @@ -1,22 +1,32 @@ { - "name": "DPT Booster 2", - "absolute": true, - "milestones": [ + "name": "DPT Booster 2", + "absolute": true, + "milestones": [ + { + "name": "dptbooster_2", + "scheduleWindows": { + "earliest": [ + "5 Years" + ], + "due": [ + "7 Years" + ], + "max": [ + "7 Years" + ] + }, + "alerts": [ { - "name": "dptbooster_2", - "scheduleWindows": { - "earliest": ["5 Years"], - "due": ["7 Years"], - "max": ["7 Years"] - }, - "alerts": [ - { - "window": "due", - "offset": ["5 Years"], - "interval": ["1 Day"], - "count": "730" - } - ] + "window": "due", + "offset": [ + "5 Years" + ], + "interval": [ + "1 Day" + ], + "count": "730" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-measles-booster.json b/src/test/resources/schedules/child-measles-booster.json index 53adf9df5..e1f240c0d 100644 --- a/src/test/resources/schedules/child-measles-booster.json +++ b/src/test/resources/schedules/child-measles-booster.json @@ -1,35 +1,55 @@ { - "name": "Measles Booster", - "absolute": true, - "milestones": [ + "name": "Measles Booster", + "absolute": true, + "milestones": [ + { + "name": "measlesbooster", + "scheduleWindows": { + "earliest": [ + "16 Months" + ], + "due": [ + "24 Months" + ], + "late": [ + "5 Years" + ], + "max": [ + "5 Years" + ] + }, + "alerts": [ { - "name": "measlesbooster", - "scheduleWindows": { - "earliest": ["16 Months"], - "due": ["24 Months"], - "late": ["5 Years"], - "max": ["5 Years"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Days"], - "interval": ["1 Day"], - "count": "486" - }, - { - "window": "due", - "offset": ["16 Months"], - "interval": ["1 Day"], - "count": "243" - }, - { - "window": "late", - "offset": ["24 Months"], - "interval": ["1 Day"], - "count": "1095" - } - ] + "window": "earliest", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Day" + ], + "count": "486" + }, + { + "window": "due", + "offset": [ + "16 Months" + ], + "interval": [ + "1 Day" + ], + "count": "243" + }, + { + "window": "late", + "offset": [ + "24 Months" + ], + "interval": [ + "1 Day" + ], + "count": "1095" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-measles.json b/src/test/resources/schedules/child-measles.json index ddff3deb8..c04eab806 100644 --- a/src/test/resources/schedules/child-measles.json +++ b/src/test/resources/schedules/child-measles.json @@ -1,35 +1,55 @@ { - "name": "Measles Vaccination", - "absolute": true, - "milestones": [ + "name": "Measles Vaccination", + "absolute": true, + "milestones": [ + { + "name": "measles", + "scheduleWindows": { + "earliest": [ + "9 Months" + ], + "due": [ + "12 Months" + ], + "late": [ + "5 Years" + ], + "max": [ + "5 Years" + ] + }, + "alerts": [ { - "name": "measles", - "scheduleWindows": { - "earliest": ["9 Months"], - "due": ["12 Months"], - "late": ["5 Years"], - "max": ["5 Years"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Days"], - "interval": ["1 Day"], - "count": "273" - }, - { - "window": "due", - "offset": ["9 Months"], - "interval": ["1 Day"], - "count": "91" - }, - { - "window": "late", - "offset": ["12 Months"], - "interval": ["1 Day"], - "count": "1460" - } - ] + "window": "earliest", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Day" + ], + "count": "273" + }, + { + "window": "due", + "offset": [ + "9 Months" + ], + "interval": [ + "1 Day" + ], + "count": "91" + }, + { + "window": "late", + "offset": [ + "12 Months" + ], + "interval": [ + "1 Day" + ], + "count": "1460" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-measles1.json b/src/test/resources/schedules/child-measles1.json index 7539a2d05..10ea09144 100644 --- a/src/test/resources/schedules/child-measles1.json +++ b/src/test/resources/schedules/child-measles1.json @@ -1,35 +1,55 @@ { - "name": "Measles 1", - "absolute": true, - "milestones": [ + "name": "Measles 1", + "absolute": true, + "milestones": [ + { + "name": "measles1", + "scheduleWindows": { + "earliest": [ + "8 Months" + ], + "due": [ + "9 Months" + ], + "late": [ + "12 Months" + ], + "max": [ + "5 Years" + ] + }, + "alerts": [ { - "name": "measles1", - "scheduleWindows": { - "earliest": ["8 Months"], - "due": ["9 Months"], - "late": ["12 Months"], - "max": ["5 Years"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["8 Months"], - "interval": ["1 Day"], - "count": "30" - }, - { - "window": "due", - "offset": ["9 Months"], - "interval": ["1 Day"], - "count": "91" - }, - { - "window": "late", - "offset": ["12 Months"], - "interval": ["1 Day"], - "count": "1460" - } - ] + "window": "earliest", + "offset": [ + "8 Months" + ], + "interval": [ + "1 Day" + ], + "count": "30" + }, + { + "window": "due", + "offset": [ + "9 Months" + ], + "interval": [ + "1 Day" + ], + "count": "91" + }, + { + "window": "late", + "offset": [ + "12 Months" + ], + "interval": [ + "1 Day" + ], + "count": "1460" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-measles2.json b/src/test/resources/schedules/child-measles2.json index d867d1c9a..b5d94a2d4 100644 --- a/src/test/resources/schedules/child-measles2.json +++ b/src/test/resources/schedules/child-measles2.json @@ -1,35 +1,55 @@ { - "name": "Measles 2", - "absolute": true, - "milestones": [ + "name": "Measles 2", + "absolute": true, + "milestones": [ + { + "name": "measles2", + "scheduleWindows": { + "earliest": [ + "14 Months" + ], + "due": [ + "15 Months" + ], + "late": [ + "16 Months" + ], + "max": [ + "5 Years" + ] + }, + "alerts": [ { - "name": "measles2", - "scheduleWindows": { - "earliest": ["14 Months"], - "due": ["15 Months"], - "late": ["16 Months"], - "max": ["5 Years"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["14 Months"], - "interval": ["1 Day"], - "count": "486" - }, - { - "window": "due", - "offset": ["15 Months"], - "interval": ["1 Day"], - "count": "243" - }, - { - "window": "late", - "offset": ["16 Months"], - "interval": ["1 Day"], - "count": "1095" - } - ] + "window": "earliest", + "offset": [ + "14 Months" + ], + "interval": [ + "1 Day" + ], + "count": "486" + }, + { + "window": "due", + "offset": [ + "15 Months" + ], + "interval": [ + "1 Day" + ], + "count": "243" + }, + { + "window": "late", + "offset": [ + "16 Months" + ], + "interval": [ + "1 Day" + ], + "count": "1095" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-opv-booster.json b/src/test/resources/schedules/child-opv-booster.json index 1c4e12250..8e3a2cc61 100644 --- a/src/test/resources/schedules/child-opv-booster.json +++ b/src/test/resources/schedules/child-opv-booster.json @@ -1,29 +1,45 @@ { - "name": "OPV BOOSTER", - "absolute": true, - "milestones": [ + "name": "OPV BOOSTER", + "absolute": true, + "milestones": [ + { + "name": "opvbooster", + "scheduleWindows": { + "earliest": [ + "16 Months" + ], + "due": [ + "24 Months" + ], + "late": [ + "5 Years" + ], + "max": [ + "5 Years" + ] + }, + "alerts": [ { - "name": "opvbooster", - "scheduleWindows": { - "earliest": ["16 Months"], - "due": ["24 Months"], - "late": ["5 Years"], - "max": ["5 Years"] - }, - "alerts": [ - { - "window": "due", - "offset": ["16 Months"], - "interval": ["1 Day"], - "count": "243" - }, - { - "window": "late", - "offset": ["24 Months"], - "interval": ["1 Day"], - "count": "1095" - } - ] + "window": "due", + "offset": [ + "16 Months" + ], + "interval": [ + "1 Day" + ], + "count": "243" + }, + { + "window": "late", + "offset": [ + "24 Months" + ], + "interval": [ + "1 Day" + ], + "count": "1095" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-opv0.json b/src/test/resources/schedules/child-opv0.json index 298046b58..c2ebf0548 100644 --- a/src/test/resources/schedules/child-opv0.json +++ b/src/test/resources/schedules/child-opv0.json @@ -1,29 +1,45 @@ { - "name": "OPV 0", - "absolute": true, - "milestones": [ + "name": "OPV 0", + "absolute": true, + "milestones": [ + { + "name": "opv0", + "scheduleWindows": { + "earliest": [ + "0 Days" + ], + "due": [ + "7 Days" + ], + "late": [ + "15 Days" + ], + "max": [ + "16 Days" + ] + }, + "alerts": [ { - "name": "opv0", - "scheduleWindows": { - "earliest": ["0 Days"], - "due": ["7 Days"], - "late": ["15 Days"], - "max": ["16 Days"] - }, - "alerts": [ - { - "window": "due", - "offset": ["0 Days"], - "interval": ["1 Day"], - "count": "7" - }, - { - "window": "late", - "offset": ["7 Days"], - "interval": ["1 Day"], - "count": "15" - } - ] + "window": "due", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Day" + ], + "count": "7" + }, + { + "window": "late", + "offset": [ + "7 Days" + ], + "interval": [ + "1 Day" + ], + "count": "15" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-opv1.json b/src/test/resources/schedules/child-opv1.json index 10dee713c..add0cd06d 100644 --- a/src/test/resources/schedules/child-opv1.json +++ b/src/test/resources/schedules/child-opv1.json @@ -1,35 +1,55 @@ { - "name": "OPV 1", - "absolute": true, - "milestones": [ + "name": "OPV 1", + "absolute": true, + "milestones": [ + { + "name": "opv1", + "scheduleWindows": { + "earliest": [ + "6 Weeks" + ], + "due": [ + "8 Weeks" + ], + "late": [ + "40 Weeks" + ], + "max": [ + "350 Days" + ] + }, + "alerts": [ { - "name": "opv1", - "scheduleWindows": { - "earliest": ["6 Weeks"], - "due": ["8 Weeks"], - "late": ["40 Weeks"], - "max": ["350 Days"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["4 Weeks"], - "interval": ["1 Day"], - "count": "15" - }, - { - "window": "due", - "offset": ["6 Weeks"], - "interval": ["1 Day"], - "count": "28" - }, - { - "window": "late", - "offset": ["8 Weeks"], - "interval": ["1 Day"], - "count": "350" - } - ] + "window": "earliest", + "offset": [ + "4 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "15" + }, + { + "window": "due", + "offset": [ + "6 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "28" + }, + { + "window": "late", + "offset": [ + "8 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "350" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-opv2.json b/src/test/resources/schedules/child-opv2.json index 620484607..932d950ae 100644 --- a/src/test/resources/schedules/child-opv2.json +++ b/src/test/resources/schedules/child-opv2.json @@ -1,35 +1,55 @@ { - "name": "OPV 2", - "absolute": true, - "milestones": [ + "name": "OPV 2", + "absolute": true, + "milestones": [ + { + "name": "opv2", + "scheduleWindows": { + "earliest": [ + "4 Weeks" + ], + "due": [ + "6 Weeks" + ], + "late": [ + "20 Weeks" + ], + "max": [ + "5 Years" + ] + }, + "alerts": [ { - "name": "opv2", - "scheduleWindows": { - "earliest": ["4 Weeks"], - "due": ["6 Weeks"], - "late": ["20 Weeks"], - "max": ["5 Years"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["2 Weeks"], - "interval": ["1 Day"], - "count": "15" - }, - { - "window": "due", - "offset": ["4 Weeks"], - "interval": ["1 Day"], - "count": "15" - }, - { - "window": "late", - "offset": ["6 Weeks"], - "interval": ["1 Day"], - "count": "1778" - } - ] + "window": "earliest", + "offset": [ + "2 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "15" + }, + { + "window": "due", + "offset": [ + "4 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "15" + }, + { + "window": "late", + "offset": [ + "6 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "1778" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-opv3.json b/src/test/resources/schedules/child-opv3.json index 72aa63052..93c357774 100644 --- a/src/test/resources/schedules/child-opv3.json +++ b/src/test/resources/schedules/child-opv3.json @@ -1,35 +1,55 @@ { - "name": "OPV 3", - "absolute": true, - "milestones": [ + "name": "OPV 3", + "absolute": true, + "milestones": [ + { + "name": "opv3", + "scheduleWindows": { + "earliest": [ + "4 Weeks" + ], + "due": [ + "6 Weeks" + ], + "late": [ + "20 Weeks" + ], + "max": [ + "5 Years" + ] + }, + "alerts": [ { - "name": "opv3", - "scheduleWindows": { - "earliest": ["4 Weeks"], - "due": ["6 Weeks"], - "late": ["20 Weeks"], - "max": ["5 Years"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["2 Weeks"], - "interval": ["1 Day"], - "count": "15" - }, - { - "window": "due", - "offset": ["4 Weeks"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "late", - "offset": ["6 Weeks"], - "interval": ["1 Day"], - "count": "1778" - } - ] + "window": "earliest", + "offset": [ + "2 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "15" + }, + { + "window": "due", + "offset": [ + "4 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "late", + "offset": [ + "6 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "1778" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-pentavalent-1.json b/src/test/resources/schedules/child-pentavalent-1.json index 50085c2d5..9c61dc8f3 100644 --- a/src/test/resources/schedules/child-pentavalent-1.json +++ b/src/test/resources/schedules/child-pentavalent-1.json @@ -1,35 +1,55 @@ { - "name": "PENTAVALENT 1", - "absolute": true, - "milestones": [ + "name": "PENTAVALENT 1", + "absolute": true, + "milestones": [ + { + "name": "pentavalent_1", + "scheduleWindows": { + "earliest": [ + "6 Weeks" + ], + "due": [ + "8 Weeks" + ], + "late": [ + "12 Months" + ], + "max": [ + "12 Months" + ] + }, + "alerts": [ { - "name": "pentavalent_1", - "scheduleWindows": { - "earliest": ["6 Weeks"], - "due": ["8 Weeks"], - "late": ["12 Months"], - "max": ["12 Months"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Days"], - "interval": ["1 Day"], - "count": "42" - }, - { - "window": "due", - "offset": ["6 Weeks"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "late", - "offset": ["8 Weeks"], - "interval": ["1 Day"], - "count": "308" - } - ] + "window": "earliest", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Day" + ], + "count": "42" + }, + { + "window": "due", + "offset": [ + "6 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "late", + "offset": [ + "8 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "308" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-pentavalent-2.json b/src/test/resources/schedules/child-pentavalent-2.json index 9bdc10d86..a3431ac1a 100644 --- a/src/test/resources/schedules/child-pentavalent-2.json +++ b/src/test/resources/schedules/child-pentavalent-2.json @@ -1,35 +1,55 @@ { - "name": "PENTAVALENT 2", - "absolute": true, - "milestones": [ + "name": "PENTAVALENT 2", + "absolute": true, + "milestones": [ + { + "name": "pentavalent_2", + "scheduleWindows": { + "earliest": [ + "4 Weeks" + ], + "due": [ + "6 Weeks" + ], + "late": [ + "12 Months" + ], + "max": [ + "12 Months" + ] + }, + "alerts": [ { - "name": "pentavalent_2", - "scheduleWindows": { - "earliest": ["4 Weeks"], - "due": ["6 Weeks"], - "late": ["12 Months"], - "max": ["12 Months"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Days"], - "interval": ["1 Day"], - "count": "28" - }, - { - "window": "due", - "offset": ["4 Weeks"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "late", - "offset": ["6 Weeks"], - "interval": ["1 Day"], - "count": "322" - } - ] + "window": "earliest", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Day" + ], + "count": "28" + }, + { + "window": "due", + "offset": [ + "4 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "late", + "offset": [ + "6 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "322" } - ] + ] + } + ] } \ No newline at end of file diff --git a/src/test/resources/schedules/child-pentavalent-3.json b/src/test/resources/schedules/child-pentavalent-3.json index 9ffe531b9..5ccb734a5 100644 --- a/src/test/resources/schedules/child-pentavalent-3.json +++ b/src/test/resources/schedules/child-pentavalent-3.json @@ -1,35 +1,55 @@ { - "name": "PENTAVALENT 3", - "absolute": true, - "milestones": [ + "name": "PENTAVALENT 3", + "absolute": true, + "milestones": [ + { + "name": "pentavalent_3", + "scheduleWindows": { + "earliest": [ + "4 Weeks" + ], + "due": [ + "6 Weeks" + ], + "late": [ + "12 Months" + ], + "max": [ + "12 Months" + ] + }, + "alerts": [ { - "name": "pentavalent_3", - "scheduleWindows": { - "earliest": ["4 Weeks"], - "due": ["6 Weeks"], - "late": ["12 Months"], - "max": ["12 Months"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Days"], - "interval": ["1 Day"], - "count": "28" - }, - { - "window": "due", - "offset": ["4 Weeks"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "late", - "offset": ["6 Weeks"], - "interval": ["1 Day"], - "count": "322" - } - ] + "window": "earliest", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Day" + ], + "count": "28" + }, + { + "window": "due", + "offset": [ + "4 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "late", + "offset": [ + "6 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "322" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-pentavalent1.json b/src/test/resources/schedules/child-pentavalent1.json index 13973c148..822da073b 100644 --- a/src/test/resources/schedules/child-pentavalent1.json +++ b/src/test/resources/schedules/child-pentavalent1.json @@ -1,35 +1,55 @@ { - "name": "PENTAVALENT 1", - "absolute": true, - "milestones": [ + "name": "PENTAVALENT 1", + "absolute": true, + "milestones": [ + { + "name": "penta1", + "scheduleWindows": { + "earliest": [ + "6 Weeks" + ], + "due": [ + "10 Weeks" + ], + "late": [ + "12 Weeks" + ], + "max": [ + "12 Months" + ] + }, + "alerts": [ { - "name": "penta1", - "scheduleWindows": { - "earliest": ["6 Weeks"], - "due": ["10 Weeks"], - "late": ["12 Weeks"], - "max": ["12 Months"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["4 Weeks"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "due", - "offset": ["6 Weeks"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "late", - "offset": ["12 Weeks"], - "interval": ["1 Day"], - "count": "350" - } - ] + "window": "earliest", + "offset": [ + "4 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "due", + "offset": [ + "6 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "late", + "offset": [ + "12 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "350" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/child-pentavalent2.json b/src/test/resources/schedules/child-pentavalent2.json index 7b250e99e..008971770 100644 --- a/src/test/resources/schedules/child-pentavalent2.json +++ b/src/test/resources/schedules/child-pentavalent2.json @@ -1,35 +1,55 @@ { - "name": "PENTAVALENT 2", - "absolute": true, - "milestones": [ + "name": "PENTAVALENT 2", + "absolute": true, + "milestones": [ + { + "name": "penta2", + "scheduleWindows": { + "earliest": [ + "4 Weeks" + ], + "due": [ + "6 Weeks" + ], + "late": [ + "12 Weeks" + ], + "max": [ + "12 Months" + ] + }, + "alerts": [ { - "name": "penta2", - "scheduleWindows": { - "earliest": ["4 Weeks"], - "due": ["6 Weeks"], - "late": ["12 Weeks"], - "max": ["12 Months"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["2 Weeks"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "due", - "offset": ["4 Weeks"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "late", - "offset": ["6 Weeks"], - "interval": ["1 Day"], - "count": "322" - } - ] + "window": "earliest", + "offset": [ + "2 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "due", + "offset": [ + "4 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "late", + "offset": [ + "6 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "322" } - ] + ] + } + ] } \ No newline at end of file diff --git a/src/test/resources/schedules/child-pentavalent3.json b/src/test/resources/schedules/child-pentavalent3.json index 2dd945a70..d8c6a0b53 100644 --- a/src/test/resources/schedules/child-pentavalent3.json +++ b/src/test/resources/schedules/child-pentavalent3.json @@ -1,35 +1,55 @@ { - "name": "PENTAVALENT 3", - "absolute": true, - "milestones": [ + "name": "PENTAVALENT 3", + "absolute": true, + "milestones": [ + { + "name": "penta3", + "scheduleWindows": { + "earliest": [ + "4 Weeks" + ], + "due": [ + "6 Weeks" + ], + "late": [ + "12 Weeks" + ], + "max": [ + "12 Months" + ] + }, + "alerts": [ { - "name": "penta3", - "scheduleWindows": { - "earliest": ["4 Weeks"], - "due": ["6 Weeks"], - "late": ["12 Weeks"], - "max": ["12 Months"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["2 Weeks"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "due", - "offset": ["4 Weeks"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "late", - "offset": ["6 Weeks"], - "interval": ["1 Day"], - "count": "322" - } - ] + "window": "earliest", + "offset": [ + "2 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "due", + "offset": [ + "4 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "late", + "offset": [ + "6 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "322" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/delivery-plan.json b/src/test/resources/schedules/delivery-plan.json index a265d6515..43bbc69e7 100644 --- a/src/test/resources/schedules/delivery-plan.json +++ b/src/test/resources/schedules/delivery-plan.json @@ -1,35 +1,55 @@ { - "name": "Delivery Plan", - "absolute": true, - "milestones": [ + "name": "Delivery Plan", + "absolute": true, + "milestones": [ + { + "name": "Delivery Plan", + "scheduleWindows": { + "earliest": [ + "34 Weeks" + ], + "due": [ + "36 Weeks" + ], + "late": [ + "300 Days" + ], + "max": [ + "5 Years" + ] + }, + "alerts": [ { - "name": "Delivery Plan", - "scheduleWindows": { - "earliest": ["34 Weeks"], - "due": ["36 Weeks"], - "late": ["300 Days"], - "max": ["5 Years"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Days"], - "interval": ["1 Day"], - "count": "238" - }, - { - "window": "due", - "offset": ["34 Weeks"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "late", - "offset": ["36 Weeks"], - "interval": ["1 Day"], - "count": "48" - } - ] + "window": "earliest", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Day" + ], + "count": "238" + }, + { + "window": "due", + "offset": [ + "34 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "late", + "offset": [ + "36 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "48" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/ec-condom-refill.json b/src/test/resources/schedules/ec-condom-refill.json index cce9f9893..2bf681d50 100644 --- a/src/test/resources/schedules/ec-condom-refill.json +++ b/src/test/resources/schedules/ec-condom-refill.json @@ -1,29 +1,46 @@ { - "name": "Condom Refill", - "absolute": true, - "milestones": [ + "name": "Condom Refill", + "absolute": true, + "milestones": [ + { + "name": "Condom Refill", + "scheduleWindows": { + "earliest": [ + "0 Weeks" + ], + "due": [ + "1 Weeks" + ], + "late": [ + "1 Year" + ], + "max": [ + "1 Year", + "1 Day" + ] + }, + "alerts": [ { - "name": "Condom Refill", - "scheduleWindows": { - "earliest": ["0 Weeks"], - "due": ["1 Weeks"], - "late": ["1 Year"], - "max": ["1 Year", "1 Day"] - }, - "alerts": [ - { - "window": "due", - "offset": ["0 Weeks"], - "interval": ["1 Day"], - "count": "7" - }, - { - "window": "late", - "offset": ["1 Weeks"], - "interval": ["1 Day"], - "count": "358" - } - ] + "window": "due", + "offset": [ + "0 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "7" + }, + { + "window": "late", + "offset": [ + "1 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "358" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/ec-dmpa-injectable-refill.json b/src/test/resources/schedules/ec-dmpa-injectable-refill.json index d83b18ce8..7c248d530 100644 --- a/src/test/resources/schedules/ec-dmpa-injectable-refill.json +++ b/src/test/resources/schedules/ec-dmpa-injectable-refill.json @@ -1,35 +1,56 @@ { - "name": "DMPA Injectable Refill", - "absolute": true, - "milestones": [ + "name": "DMPA Injectable Refill", + "absolute": true, + "milestones": [ + { + "name": "DMPA Injectable Refill", + "scheduleWindows": { + "earliest": [ + "12 Weeks" + ], + "due": [ + "13 Weeks" + ], + "late": [ + "1 Year" + ], + "max": [ + "1 Year", + "1 Day" + ] + }, + "alerts": [ { - "name": "DMPA Injectable Refill", - "scheduleWindows": { - "earliest": ["12 Weeks"], - "due": ["13 Weeks"], - "late": ["1 Year"], - "max": ["1 Year", "1 Day"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Weeks"], - "interval": ["1 Day"], - "count": "84" - }, - { - "window": "due", - "offset": ["12 Weeks"], - "interval": ["1 Day"], - "count": "7" - }, - { - "window": "late", - "offset": ["13 Weeks"], - "interval": ["1 Day"], - "count": "274" - } - ] + "window": "earliest", + "offset": [ + "0 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "84" + }, + { + "window": "due", + "offset": [ + "12 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "7" + }, + { + "window": "late", + "offset": [ + "13 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "274" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/ec-female-sterilization-followup.json b/src/test/resources/schedules/ec-female-sterilization-followup.json index 2fe8f4c6d..3519b9829 100644 --- a/src/test/resources/schedules/ec-female-sterilization-followup.json +++ b/src/test/resources/schedules/ec-female-sterilization-followup.json @@ -1,75 +1,126 @@ { - "name": "Female sterilization Followup", - "absolute": true, - "milestones": [ + "name": "Female sterilization Followup", + "absolute": true, + "milestones": [ + { + "name": "Female sterilization Followup 1", + "scheduleWindows": { + "earliest": [ + "0 Weeks" + ], + "due": [ + "2 Days" + ], + "late": [ + "7 Days" + ], + "max": [ + "7 Days" + ] + }, + "alerts": [ { - "name": "Female sterilization Followup 1", - "scheduleWindows": { - "earliest": ["0 Weeks"], - "due": ["2 Days"], - "late": ["7 Days"], - "max": ["7 Days"] - }, - "alerts": [ - { - "window": "due", - "offset": ["0 Days"], - "interval": ["1 Day"], - "count": "2" - }, - { - "window": "late", - "offset": ["2 Days"], - "interval": ["1 Day"], - "count": "5" - } - ] + "window": "due", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Day" + ], + "count": "2" }, { - "name": "Female sterilization Followup 2", - "scheduleWindows": { - "earliest": ["0 Weeks"], - "due": ["9 Days"], - "late": ["1 Month"], - "max": ["1 Month"] - }, - "alerts": [ - { - "window": "due", - "offset": ["7 Days"], - "interval": ["1 Day"], - "count": "2" - }, - { - "window": "late", - "offset": ["9 Days"], - "interval": ["1 Day"], - "count": "22" - } - ] + "window": "late", + "offset": [ + "2 Days" + ], + "interval": [ + "1 Day" + ], + "count": "5" + } + ] + }, + { + "name": "Female sterilization Followup 2", + "scheduleWindows": { + "earliest": [ + "0 Weeks" + ], + "due": [ + "9 Days" + ], + "late": [ + "1 Month" + ], + "max": [ + "1 Month" + ] + }, + "alerts": [ + { + "window": "due", + "offset": [ + "7 Days" + ], + "interval": [ + "1 Day" + ], + "count": "2" + }, + { + "window": "late", + "offset": [ + "9 Days" + ], + "interval": [ + "1 Day" + ], + "count": "22" + } + ] + }, + { + "name": "Female sterilization Followup 3", + "scheduleWindows": { + "earliest": [ + "0 Weeks" + ], + "due": [ + "1 Month", + "1 Week" + ], + "late": [ + "100 Weeks" + ], + "max": [ + "100 Weeks", + "1 Day" + ] + }, + "alerts": [ + { + "window": "due", + "offset": [ + "1 Month" + ], + "interval": [ + "1 Day" + ], + "count": "7" }, { - "name": "Female sterilization Followup 3", - "scheduleWindows": { - "earliest": ["0 Weeks"], - "due": ["1 Month", "1 Week"], - "late": ["100 Weeks"], - "max": ["100 Weeks", "1 Day"] - }, - "alerts": [ - { - "window": "due", - "offset": ["1 Month"], - "interval": ["1 Day"], - "count": "7" - }, - { - "window": "late", - "offset": ["1 Month", "1 Week"], - "interval": ["1 Day"], - "count": "665" - } - ] + "window": "late", + "offset": [ + "1 Month", + "1 Week" + ], + "interval": [ + "1 Day" + ], + "count": "665" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/ec-fp-followup.json b/src/test/resources/schedules/ec-fp-followup.json index 092db4307..3b3fa3d17 100644 --- a/src/test/resources/schedules/ec-fp-followup.json +++ b/src/test/resources/schedules/ec-fp-followup.json @@ -1,35 +1,56 @@ { - "name": "FP Followup", - "absolute": true, - "milestones": [ + "name": "FP Followup", + "absolute": true, + "milestones": [ + { + "name": "FP Followup", + "scheduleWindows": { + "earliest": [ + "3 Days" + ], + "due": [ + "7 Days" + ], + "late": [ + "100 Weeks" + ], + "max": [ + "100 Weeks", + "1 Day" + ] + }, + "alerts": [ { - "name": "FP Followup", - "scheduleWindows": { - "earliest": ["3 Days"], - "due": ["7 Days"], - "late": ["100 Weeks"], - "max": ["100 Weeks", "1 Day"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Days"], - "interval": ["1 Day"], - "count": "3" - }, - { - "window": "due", - "offset": ["3 Days"], - "interval": ["1 Day"], - "count": "4" - }, - { - "window": "late", - "offset": ["7 Days"], - "interval": ["1 Day"], - "count": "693" - } - ] + "window": "earliest", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Day" + ], + "count": "3" + }, + { + "window": "due", + "offset": [ + "3 Days" + ], + "interval": [ + "1 Day" + ], + "count": "4" + }, + { + "window": "late", + "offset": [ + "7 Days" + ], + "interval": [ + "1 Day" + ], + "count": "693" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/ec-fp-referral-followup.json b/src/test/resources/schedules/ec-fp-referral-followup.json index 3c36c7dc9..e745c5132 100644 --- a/src/test/resources/schedules/ec-fp-referral-followup.json +++ b/src/test/resources/schedules/ec-fp-referral-followup.json @@ -1,35 +1,56 @@ { - "name": "FP Referral Followup", - "absolute": true, - "milestones": [ + "name": "FP Referral Followup", + "absolute": true, + "milestones": [ + { + "name": "FP Referral Followup", + "scheduleWindows": { + "earliest": [ + "1 Day" + ], + "due": [ + "2 Days" + ], + "late": [ + "100 Weeks" + ], + "max": [ + "100 Weeks", + "1 Day" + ] + }, + "alerts": [ { - "name": "FP Referral Followup", - "scheduleWindows": { - "earliest": ["1 Day"], - "due": ["2 Days"], - "late": ["100 Weeks"], - "max": ["100 Weeks", "1 Day"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Days"], - "interval": ["1 Day"], - "count": "1" - }, - { - "window": "due", - "offset": ["1 Day"], - "interval": ["1 Day"], - "count": "1" - }, - { - "window": "late", - "offset": ["2 Days"], - "interval": ["1 Day"], - "count": "698" - } - ] + "window": "earliest", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Day" + ], + "count": "1" + }, + { + "window": "due", + "offset": [ + "1 Day" + ], + "interval": [ + "1 Day" + ], + "count": "1" + }, + { + "window": "late", + "offset": [ + "2 Days" + ], + "interval": [ + "1 Day" + ], + "count": "698" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/ec-iud-followup.json b/src/test/resources/schedules/ec-iud-followup.json index 5e39cdaf8..846855d13 100644 --- a/src/test/resources/schedules/ec-iud-followup.json +++ b/src/test/resources/schedules/ec-iud-followup.json @@ -1,58 +1,99 @@ { - "name": "IUD Followup", - "absolute": true, - "milestones": [ + "name": "IUD Followup", + "absolute": true, + "milestones": [ + { + "name": "IUD Followup 1", + "scheduleWindows": { + "earliest": [ + "1 Month" + ], + "due": [ + "1 Month", + "1 Week" + ], + "late": [ + "4 Months" + ], + "max": [ + "4 Months" + ] + }, + "alerts": [ { - "name": "IUD Followup 1", - "scheduleWindows": { - "earliest": ["1 Month"], - "due": ["1 Month", "1 Week"], - "late": ["4 Months"], - "max": ["4 Months"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Days"], - "interval": ["1 Day"], - "count": "30" - }, - { - "window": "due", - "offset": ["1 Month"], - "interval": ["1 Day"], - "count": "7" - }, - { - "window": "late", - "offset": ["1 Month", "1 Week"], - "interval": ["1 Day"], - "count": "84" - } - ] + "window": "earliest", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Day" + ], + "count": "30" }, { - "name": "IUD Followup 2", - "scheduleWindows": { - "earliest": ["0 Weeks"], - "due": ["4 Months", "1 Week"], - "late": ["100 Weeks"], - "max": ["100 Weeks", "1 Day"] - }, - "alerts": [ - { - "window": "due", - "offset": ["4 Months"], - "interval": ["1 Day"], - "count": "7" - }, - { - "window": "late", - "offset": ["4 Months", "1 Week"], - "interval": ["1 Day"], - "count": "572" - } - ] + "window": "due", + "offset": [ + "1 Month" + ], + "interval": [ + "1 Day" + ], + "count": "7" + }, + { + "window": "late", + "offset": [ + "1 Month", + "1 Week" + ], + "interval": [ + "1 Day" + ], + "count": "84" + } + ] + }, + { + "name": "IUD Followup 2", + "scheduleWindows": { + "earliest": [ + "0 Weeks" + ], + "due": [ + "4 Months", + "1 Week" + ], + "late": [ + "100 Weeks" + ], + "max": [ + "100 Weeks", + "1 Day" + ] + }, + "alerts": [ + { + "window": "due", + "offset": [ + "4 Months" + ], + "interval": [ + "1 Day" + ], + "count": "7" + }, + { + "window": "late", + "offset": [ + "4 Months", + "1 Week" + ], + "interval": [ + "1 Day" + ], + "count": "572" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/ec-male-sterilization-followup.json b/src/test/resources/schedules/ec-male-sterilization-followup.json index 72d095e48..8803a12f3 100644 --- a/src/test/resources/schedules/ec-male-sterilization-followup.json +++ b/src/test/resources/schedules/ec-male-sterilization-followup.json @@ -1,52 +1,87 @@ { - "name": "Male sterilization Followup", - "absolute": true, - "milestones": [ + "name": "Male sterilization Followup", + "absolute": true, + "milestones": [ + { + "name": "Male sterilization Followup 1", + "scheduleWindows": { + "earliest": [ + "0 Weeks" + ], + "due": [ + "2 Days" + ], + "late": [ + "3 Months" + ], + "max": [ + "3 Months" + ] + }, + "alerts": [ { - "name": "Male sterilization Followup 1", - "scheduleWindows": { - "earliest": ["0 Weeks"], - "due": ["2 Days"], - "late": ["3 Months"], - "max": ["3 Months"] - }, - "alerts": [ - { - "window": "due", - "offset": ["0 Days"], - "interval": ["1 Day"], - "count": "2" - }, - { - "window": "late", - "offset": ["2 Days"], - "interval": ["1 Day"], - "count": "89" - } - ] + "window": "due", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Day" + ], + "count": "2" }, { - "name": "Male sterilization Followup 2", - "scheduleWindows": { - "earliest": ["0 Weeks"], - "due": ["3 Months", "1 Week"], - "late": ["100 Weeks"], - "max": ["100 Weeks", "1 Day"] - }, - "alerts": [ - { - "window": "due", - "offset": ["3 Months"], - "interval": ["1 Day"], - "count": "7" - }, - { - "window": "late", - "offset": ["3 Months", "1 Week"], - "interval": ["1 Day"], - "count": "602" - } - ] + "window": "late", + "offset": [ + "2 Days" + ], + "interval": [ + "1 Day" + ], + "count": "89" } - ] + ] + }, + { + "name": "Male sterilization Followup 2", + "scheduleWindows": { + "earliest": [ + "0 Weeks" + ], + "due": [ + "3 Months", + "1 Week" + ], + "late": [ + "100 Weeks" + ], + "max": [ + "100 Weeks", + "1 Day" + ] + }, + "alerts": [ + { + "window": "due", + "offset": [ + "3 Months" + ], + "interval": [ + "1 Day" + ], + "count": "7" + }, + { + "window": "late", + "offset": [ + "3 Months", + "1 Week" + ], + "interval": [ + "1 Day" + ], + "count": "602" + } + ] + } + ] } diff --git a/src/test/resources/schedules/ec-ocp-refill.json b/src/test/resources/schedules/ec-ocp-refill.json index e5b0c4556..58d75bc44 100644 --- a/src/test/resources/schedules/ec-ocp-refill.json +++ b/src/test/resources/schedules/ec-ocp-refill.json @@ -1,29 +1,46 @@ { - "name": "OCP Refill", - "absolute": true, - "milestones": [ + "name": "OCP Refill", + "absolute": true, + "milestones": [ + { + "name": "OCP Refill", + "scheduleWindows": { + "earliest": [ + "0 Weeks" + ], + "due": [ + "1 Week" + ], + "late": [ + "1 Year" + ], + "max": [ + "1 Year", + "1 Day" + ] + }, + "alerts": [ { - "name": "OCP Refill", - "scheduleWindows": { - "earliest": ["0 Weeks"], - "due": ["1 Week"], - "late": ["1 Year"], - "max": ["1 Year", "1 Day"] - }, - "alerts": [ - { - "window": "due", - "offset": ["0 Week"], - "interval": ["1 Day"], - "count": "7" - }, - { - "window": "late", - "offset": ["1 Weeks"], - "interval": ["1 Day"], - "count": "358" - } - ] + "window": "due", + "offset": [ + "0 Week" + ], + "interval": [ + "1 Day" + ], + "count": "7" + }, + { + "window": "late", + "offset": [ + "1 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "358" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/fw-census.json b/src/test/resources/schedules/fw-census.json index 2e1c935ae..ee8545a29 100644 --- a/src/test/resources/schedules/fw-census.json +++ b/src/test/resources/schedules/fw-census.json @@ -1,35 +1,55 @@ { - "name": "FW CENSUS", - "absolute": true, - "milestones": [ + "name": "FW CENSUS", + "absolute": true, + "milestones": [ + { + "name": "FW CENSUS", + "scheduleWindows": { + "earliest": [ + "1 Day" + ], + "due": [ + "2 Days" + ], + "late": [ + "4 Days" + ], + "max": [ + "8 Days" + ] + }, + "alerts": [ { - "name": "FW CENSUS", - "scheduleWindows": { - "earliest": ["1 Day"], - "due": ["2 Days"], - "late": ["4 Days"], - "max": ["8 Days"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Days"], - "interval": ["1 Day"], - "count": "1" - }, - { - "window": "due", - "offset": ["1 Day"], - "interval": ["1 Day"], - "count": "1" - }, - { - "window": "late", - "offset": ["2 Days"], - "interval": ["1 Day"], - "count": "2" - } - ] + "window": "earliest", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Day" + ], + "count": "1" + }, + { + "window": "due", + "offset": [ + "1 Day" + ], + "interval": [ + "1 Day" + ], + "count": "1" + }, + { + "window": "late", + "offset": [ + "2 Days" + ], + "interval": [ + "1 Day" + ], + "count": "2" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/mother-anc-normal.json b/src/test/resources/schedules/mother-anc-normal.json index 7032989b4..ab8cc3bb2 100644 --- a/src/test/resources/schedules/mother-anc-normal.json +++ b/src/test/resources/schedules/mother-anc-normal.json @@ -1,104 +1,173 @@ { - "name": "Ante Natal Care - Normal", - "absolute": true, - "milestones": [ + "name": "Ante Natal Care - Normal", + "absolute": true, + "milestones": [ + { + "name": "ANC 1", + "scheduleWindows": { + "earliest": [ + "0 Weeks" + ], + "due": [ + "12 Weeks" + ], + "late": [ + "14 Weeks" + ], + "max": [ + "14 weeks" + ] + }, + "alerts": [ { - "name": "ANC 1", - "scheduleWindows": { - "earliest": ["0 Weeks"], - "due": ["12 Weeks"], - "late": ["14 Weeks"], - "max": ["14 weeks"] - }, - "alerts": [ - { - "window": "due", - "offset": ["0 Weeks"], - "interval": ["1 Day"], - "count": "84" - }, - { - "window": "late", - "offset": ["12 Weeks"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "max", - "offset": ["14 Weeks"], - "interval": ["1 Day"], - "count": "2" - } - ] + "window": "due", + "offset": [ + "0 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "84" }, { - "name": "ANC 2", - "scheduleWindows": { - "earliest": ["14 Weeks"], - "due": ["26 Weeks"], - "late": ["28 Weeks"], - "max": ["28 Weeks"] - }, - "alerts": [ - { - "window": "due", - "offset": ["14 Weeks"], - "interval": ["1 Day"], - "count": "84" - }, - { - "window": "late", - "offset": ["26 Weeks"], - "interval": ["1 Day"], - "count": "14" - } - ] + "window": "late", + "offset": [ + "12 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" }, { - "name": "ANC 3", - "scheduleWindows": { - "earliest": ["28 Weeks"], - "due": ["34 Weeks"], - "late": ["36 Weeks"], - "max": ["36 Weeks"] - }, - "alerts": [ - { - "window": "due", - "offset": ["28 Weeks"], - "interval": ["1 Day"], - "count": "42" - }, - { - "window": "late", - "offset": ["34 Weeks"], - "interval": ["1 Day"], - "count": "14" - } - ] + "window": "max", + "offset": [ + "14 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "2" + } + ] + }, + { + "name": "ANC 2", + "scheduleWindows": { + "earliest": [ + "14 Weeks" + ], + "due": [ + "26 Weeks" + ], + "late": [ + "28 Weeks" + ], + "max": [ + "28 Weeks" + ] + }, + "alerts": [ + { + "window": "due", + "offset": [ + "14 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "84" + }, + { + "window": "late", + "offset": [ + "26 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" + } + ] + }, + { + "name": "ANC 3", + "scheduleWindows": { + "earliest": [ + "28 Weeks" + ], + "due": [ + "34 Weeks" + ], + "late": [ + "36 Weeks" + ], + "max": [ + "36 Weeks" + ] + }, + "alerts": [ + { + "window": "due", + "offset": [ + "28 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "42" + }, + { + "window": "late", + "offset": [ + "34 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" + } + ] + }, + { + "name": "ANC 4", + "scheduleWindows": { + "earliest": [ + "36 Weeks" + ], + "due": [ + "39 Weeks" + ], + "late": [ + "100 Weeks" + ], + "max": [ + "100 Weeks", + "1 Day" + ] + }, + "alerts": [ + { + "window": "due", + "offset": [ + "36 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "21" }, { - "name": "ANC 4", - "scheduleWindows": { - "earliest": ["36 Weeks"], - "due": ["39 Weeks"], - "late": ["100 Weeks"], - "max": ["100 Weeks", "1 Day"] - }, - "alerts": [ - { - "window": "due", - "offset": ["36 Weeks"], - "interval": ["1 Day"], - "count": "21" - }, - { - "window": "late", - "offset": ["39 Weeks"], - "interval": ["1 Day"], - "count": "427" - } - ] + "window": "late", + "offset": [ + "39 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "427" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/mother-auto-close-pnc.json b/src/test/resources/schedules/mother-auto-close-pnc.json index e73b24f8b..620990b6d 100644 --- a/src/test/resources/schedules/mother-auto-close-pnc.json +++ b/src/test/resources/schedules/mother-auto-close-pnc.json @@ -1,20 +1,27 @@ { - "name": "Auto Close PNC", - "absolute": false, - "milestones": [ + "name": "Auto Close PNC", + "absolute": false, + "milestones": [ + { + "name": "Auto Close PNC", + "scheduleWindows": { + "due": [ + "8 Weeks", + "4 Day" + ] + }, + "alerts": [ { - "name": "Auto Close PNC", - "scheduleWindows": { - "due": ["8 Weeks", "4 Day"] - }, - "alerts": [ - { - "window": "due", - "offset": ["8 Weeks"], - "interval": ["1 Day"], - "count": "4" - } - ] + "window": "due", + "offset": [ + "8 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "4" } - ] + ] + } + ] } \ No newline at end of file diff --git a/src/test/resources/schedules/mother-expected-date-of-delivery.json b/src/test/resources/schedules/mother-expected-date-of-delivery.json index adf092133..d13447bd2 100644 --- a/src/test/resources/schedules/mother-expected-date-of-delivery.json +++ b/src/test/resources/schedules/mother-expected-date-of-delivery.json @@ -1,35 +1,57 @@ { - "name": "Expected Date Of Delivery", - "absolute": false, - "milestones": [ + "name": "Expected Date Of Delivery", + "absolute": false, + "milestones": [ + { + "name": "EDD", + "scheduleWindows": { + "earliest": [ + "38 Weeks" + ], + "due": [ + "40 Weeks", + "1 Day" + ], + "late": [ + "100 Weeks" + ], + "max": [ + "100 Weeks", + "1 Day" + ] + }, + "alerts": [ { - "name": "EDD", - "scheduleWindows": { - "earliest": ["38 Weeks"], - "due": ["40 Weeks", "1 Day"], - "late": ["100 Weeks"], - "max": ["100 Weeks", "1 Day"] - }, - "alerts": [ - { - "window": "due", - "offset": ["0 Days"], - "interval": ["1 Weeks"], - "count": "3" - }, - { - "window": "late", - "offset": ["2 Days"], - "interval": ["1 Weeks"], - "count": "100" - }, - { - "window": "late", - "offset": ["6 Days"], - "interval": ["1 Weeks"], - "count": "100" - } - ] + "window": "due", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Weeks" + ], + "count": "3" + }, + { + "window": "late", + "offset": [ + "2 Days" + ], + "interval": [ + "1 Weeks" + ], + "count": "100" + }, + { + "window": "late", + "offset": [ + "6 Days" + ], + "interval": [ + "1 Weeks" + ], + "count": "100" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/mother-hb-followup-test.json b/src/test/resources/schedules/mother-hb-followup-test.json index cceeeeb49..e4e72ce1e 100644 --- a/src/test/resources/schedules/mother-hb-followup-test.json +++ b/src/test/resources/schedules/mother-hb-followup-test.json @@ -1,35 +1,58 @@ { - "name": "Hb Followup Test", - "absolute": true, - "milestones": [ + "name": "Hb Followup Test", + "absolute": true, + "milestones": [ + { + "name": "Hb Followup Test", + "scheduleWindows": { + "earliest": [ + "1 Month" + ], + "due": [ + "1 Month", + "2 Weeks" + ], + "late": [ + "100 Weeks" + ], + "max": [ + "100 Weeks", + "1 Day" + ] + }, + "alerts": [ { - "name": "Hb Followup Test", - "scheduleWindows": { - "earliest": ["1 Month"], - "due": ["1 Month", "2 Weeks"], - "late": ["100 Weeks"], - "max": ["100 Weeks", "1 Day"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Weeks"], - "interval": ["1 Day"], - "count": "30" - }, - { - "window": "due", - "offset": ["1 Month"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "late", - "offset": ["1 Month", "2 Weeks"], - "interval": ["1 Day"], - "count": "655" - } - ] + "window": "earliest", + "offset": [ + "0 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "30" + }, + { + "window": "due", + "offset": [ + "1 Month" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "late", + "offset": [ + "1 Month", + "2 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "655" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/mother-hb-test-1.json b/src/test/resources/schedules/mother-hb-test-1.json index 97f7b5426..0ce1a79c6 100644 --- a/src/test/resources/schedules/mother-hb-test-1.json +++ b/src/test/resources/schedules/mother-hb-test-1.json @@ -1,29 +1,46 @@ { - "name": "Hb Test 1", - "absolute": true, - "milestones": [ + "name": "Hb Test 1", + "absolute": true, + "milestones": [ + { + "name": "Hb Test 1", + "scheduleWindows": { + "earliest": [ + "0 Weeks" + ], + "due": [ + "12 Weeks" + ], + "late": [ + "100 Weeks" + ], + "max": [ + "100 Weeks", + "1 Day" + ] + }, + "alerts": [ { - "name": "Hb Test 1", - "scheduleWindows": { - "earliest": ["0 Weeks"], - "due": ["12 Weeks"], - "late": ["100 Weeks"], - "max": ["100 Weeks", "1 Day"] - }, - "alerts": [ - { - "window": "due", - "offset": ["0 Weeks"], - "interval": ["1 Day"], - "count": "84" - }, - { - "window": "late", - "offset": ["12 Weeks"], - "interval": ["1 Day"], - "count": "616" - } - ] + "window": "due", + "offset": [ + "0 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "84" + }, + { + "window": "late", + "offset": [ + "12 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "616" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/mother-hb-test-2.json b/src/test/resources/schedules/mother-hb-test-2.json index 70d2f18b4..f338605cb 100644 --- a/src/test/resources/schedules/mother-hb-test-2.json +++ b/src/test/resources/schedules/mother-hb-test-2.json @@ -1,29 +1,46 @@ { - "name": "Hb Test 2", - "absolute": true, - "milestones": [ + "name": "Hb Test 2", + "absolute": true, + "milestones": [ + { + "name": "Hb Test 2", + "scheduleWindows": { + "earliest": [ + "0 Weeks" + ], + "due": [ + "30 Weeks" + ], + "late": [ + "100 Weeks" + ], + "max": [ + "100 Weeks", + "1 Day" + ] + }, + "alerts": [ { - "name": "Hb Test 2", - "scheduleWindows": { - "earliest": ["0 Weeks"], - "due": ["30 Weeks"], - "late": ["100 Weeks"], - "max": ["100 Weeks", "1 Day"] - }, - "alerts": [ - { - "window": "due", - "offset": ["28 Weeks"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "late", - "offset": ["30 Weeks"], - "interval": ["1 Day"], - "count": "490" - } - ] + "window": "due", + "offset": [ + "28 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "late", + "offset": [ + "30 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "490" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/mother-ifa-1.json b/src/test/resources/schedules/mother-ifa-1.json index 027939ac5..bc1bd4428 100644 --- a/src/test/resources/schedules/mother-ifa-1.json +++ b/src/test/resources/schedules/mother-ifa-1.json @@ -1,35 +1,56 @@ { - "name": "IFA 1", - "absolute": true, - "milestones": [ + "name": "IFA 1", + "absolute": true, + "milestones": [ + { + "name": "IFA 1", + "scheduleWindows": { + "earliest": [ + "14 Weeks" + ], + "due": [ + "16 Weeks" + ], + "late": [ + "100 Weeks" + ], + "max": [ + "100 Weeks", + "1 Day" + ] + }, + "alerts": [ { - "name": "IFA 1", - "scheduleWindows": { - "earliest": ["14 Weeks"], - "due": ["16 Weeks"], - "late": ["100 Weeks"], - "max": ["100 Weeks", "1 Day"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Weeks"], - "interval": ["1 Day"], - "count": "90" - }, - { - "window": "due", - "offset": ["14 Weeks"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "late", - "offset": ["16 Weeks"], - "interval": ["1 Day"], - "count": "588" - } - ] + "window": "earliest", + "offset": [ + "0 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "90" + }, + { + "window": "due", + "offset": [ + "14 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "late", + "offset": [ + "16 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "588" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/mother-ifa-2.json b/src/test/resources/schedules/mother-ifa-2.json index e45e067ee..480b1c1dd 100644 --- a/src/test/resources/schedules/mother-ifa-2.json +++ b/src/test/resources/schedules/mother-ifa-2.json @@ -1,35 +1,58 @@ { - "name": "IFA 2", - "absolute": true, - "milestones": [ + "name": "IFA 2", + "absolute": true, + "milestones": [ + { + "name": "IFA 2", + "scheduleWindows": { + "earliest": [ + "1 Months" + ], + "due": [ + "1 Month", + "2 Weeks" + ], + "late": [ + "100 Weeks" + ], + "max": [ + "100 Weeks", + "1 Day" + ] + }, + "alerts": [ { - "name": "IFA 2", - "scheduleWindows": { - "earliest": ["1 Months"], - "due": ["1 Month", "2 Weeks"], - "late": ["100 Weeks"], - "max": ["100 Weeks", "1 Day"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Weeks"], - "interval": ["1 Day"], - "count": "30" - }, - { - "window": "due", - "offset": ["1 Months"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "late", - "offset": ["1 Month", "2 Weeks"], - "interval": ["1 Day"], - "count": "658" - } - ] + "window": "earliest", + "offset": [ + "0 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "30" + }, + { + "window": "due", + "offset": [ + "1 Months" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "late", + "offset": [ + "1 Month", + "2 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "658" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/mother-ifa-3.json b/src/test/resources/schedules/mother-ifa-3.json index 206ede5e1..7bdb71d1a 100644 --- a/src/test/resources/schedules/mother-ifa-3.json +++ b/src/test/resources/schedules/mother-ifa-3.json @@ -1,35 +1,58 @@ { - "name": "IFA 3", - "absolute": true, - "milestones": [ + "name": "IFA 3", + "absolute": true, + "milestones": [ + { + "name": "IFA 3", + "scheduleWindows": { + "earliest": [ + "1 Months" + ], + "due": [ + "1 Month", + "2 Weeks" + ], + "late": [ + "100 Weeks" + ], + "max": [ + "100 Weeks", + "1 Day" + ] + }, + "alerts": [ { - "name": "IFA 3", - "scheduleWindows": { - "earliest": ["1 Months"], - "due": ["1 Month", "2 Weeks"], - "late": ["100 Weeks"], - "max": ["100 Weeks", "1 Day"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Weeks"], - "interval": ["1 Day"], - "count": "30" - }, - { - "window": "due", - "offset": ["1 Months"], - "interval": ["1 Day"], - "count": "14" - }, - { - "window": "late", - "offset": ["1 Month", "2 Weeks"], - "interval": ["1 Day"], - "count": "658" - } - ] + "window": "earliest", + "offset": [ + "0 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "30" + }, + { + "window": "due", + "offset": [ + "1 Months" + ], + "interval": [ + "1 Day" + ], + "count": "14" + }, + { + "window": "late", + "offset": [ + "1 Month", + "2 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "658" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/mother-lab-reminder.json b/src/test/resources/schedules/mother-lab-reminder.json index 6738572b5..b32534dd9 100644 --- a/src/test/resources/schedules/mother-lab-reminder.json +++ b/src/test/resources/schedules/mother-lab-reminder.json @@ -1,29 +1,46 @@ { - "name": "Lab Reminders", - "absolute": false, - "milestones": [ + "name": "Lab Reminders", + "absolute": false, + "milestones": [ + { + "name": "REMINDER", + "scheduleWindows": { + "earliest": [ + "10 Weeks" + ], + "due": [ + "30 Weeks" + ], + "late": [ + "40 Weeks", + "1 Day" + ], + "max": [ + "41 Weeks" + ] + }, + "alerts": [ { - "name": "REMINDER", - "scheduleWindows": { - "earliest": ["10 Weeks"], - "due": ["30 Weeks"], - "late": ["40 Weeks", "1 Day"], - "max": ["41 Weeks"] - }, - "alerts": [ - { - "window": "late", - "offset": ["0 Days"], - "interval": ["1 Weeks"], - "count": "11" - }, - { - "window": "max", - "offset": ["1 Day"], - "interval": ["1 Day"], - "count": "3" - } - ] + "window": "late", + "offset": [ + "0 Days" + ], + "interval": [ + "1 Weeks" + ], + "count": "11" + }, + { + "window": "max", + "offset": [ + "1 Day" + ], + "interval": [ + "1 Day" + ], + "count": "3" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/woman-tt1.json b/src/test/resources/schedules/woman-tt1.json index 1e8a410ef..ea37a2d24 100644 --- a/src/test/resources/schedules/woman-tt1.json +++ b/src/test/resources/schedules/woman-tt1.json @@ -1,29 +1,45 @@ { - "name": "TT 1", - "absolute": true, - "milestones": [ + "name": "TT 1", + "absolute": true, + "milestones": [ + { + "name": "tt1", + "scheduleWindows": { + "earliest": [ + "0 Weeks" + ], + "due": [ + "12 Weeks" + ], + "late": [ + "1 Year" + ], + "max": [ + "1 Year" + ] + }, + "alerts": [ { - "name": "tt1", - "scheduleWindows": { - "earliest": ["0 Weeks"], - "due": ["12 Weeks"], - "late": ["1 Year"], - "max": ["1 Year"] - }, - "alerts": [ - { - "window": "due", - "offset": ["0 Weeks"], - "interval": ["1 Day"], - "count": "84" - }, - { - "window": "late", - "offset": ["12 Weeks"], - "interval": ["1 Day"], - "count": "280" - } - ] + "window": "due", + "offset": [ + "0 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "84" + }, + { + "window": "late", + "offset": [ + "12 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "280" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/woman-tt2.json b/src/test/resources/schedules/woman-tt2.json index 69ccd3977..837820e79 100644 --- a/src/test/resources/schedules/woman-tt2.json +++ b/src/test/resources/schedules/woman-tt2.json @@ -1,35 +1,55 @@ { - "name": "TT 2", - "absolute": true, - "milestones": [ + "name": "TT 2", + "absolute": true, + "milestones": [ + { + "name": "tt2", + "scheduleWindows": { + "earliest": [ + "4 Weeks" + ], + "due": [ + "6 Weeks" + ], + "late": [ + "20 Weeks" + ], + "max": [ + "1 Year" + ] + }, + "alerts": [ { - "name": "tt2", - "scheduleWindows": { - "earliest": ["4 Weeks"], - "due": ["6 Weeks"], - "late": ["20 Weeks"], - "max": ["1 Year"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Weeks"], - "interval": ["1 Day"], - "count": "28" - }, - { - "window": "due", - "offset": ["4 Weeks"], - "interval": ["1 Day"], - "count": "50" - }, - { - "window": "late", - "offset": ["6 Weeks"], - "interval": ["1 Day"], - "count": "322" - } - ] + "window": "earliest", + "offset": [ + "0 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "28" + }, + { + "window": "due", + "offset": [ + "4 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "50" + }, + { + "window": "late", + "offset": [ + "6 Weeks" + ], + "interval": [ + "1 Day" + ], + "count": "322" } - ] + ] + } + ] } diff --git a/src/test/resources/schedules/woman-tt3.json b/src/test/resources/schedules/woman-tt3.json index 04143b042..05207aefe 100644 --- a/src/test/resources/schedules/woman-tt3.json +++ b/src/test/resources/schedules/woman-tt3.json @@ -1,35 +1,55 @@ { - "name": "TT 3", - "absolute": true, - "milestones": [ + "name": "TT 3", + "absolute": true, + "milestones": [ + { + "name": "tt3", + "scheduleWindows": { + "earliest": [ + "6 Months" + ], + "due": [ + "8 Months" + ], + "late": [ + "9 Months" + ], + "max": [ + "1 Year" + ] + }, + "alerts": [ { - "name": "tt3", - "scheduleWindows": { - "earliest": ["6 Months"], - "due": ["8 Months"], - "late": ["9 Months"], - "max": ["1 Year"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Months"], - "interval": ["1 Day"], - "count": "100" - }, - { - "window": "due", - "offset": ["6 Months"], - "interval": ["1 Day"], - "count": "360" - }, - { - "window": "late", - "offset": ["8 Months"], - "interval": ["1 Day"], - "count": "360" - } - ] + "window": "earliest", + "offset": [ + "0 Months" + ], + "interval": [ + "1 Day" + ], + "count": "100" + }, + { + "window": "due", + "offset": [ + "6 Months" + ], + "interval": [ + "1 Day" + ], + "count": "360" + }, + { + "window": "late", + "offset": [ + "8 Months" + ], + "interval": [ + "1 Day" + ], + "count": "360" } - ] + ] + } + ] } \ No newline at end of file diff --git a/src/test/resources/schedules/woman-tt4.json b/src/test/resources/schedules/woman-tt4.json index bcb755002..af67e40fc 100644 --- a/src/test/resources/schedules/woman-tt4.json +++ b/src/test/resources/schedules/woman-tt4.json @@ -1,36 +1,55 @@ { - "name": "TT 4", - "absolute": true, - "milestones": [ + "name": "TT 4", + "absolute": true, + "milestones": [ + { + "name": "tt4", + "scheduleWindows": { + "earliest": [ + "12 Months" + ], + "due": [ + "14 Months" + ], + "late": [ + "20 Months" + ], + "max": [ + "30 Months" + ] + }, + "alerts": [ { - "name": "tt4", - "scheduleWindows": { - "earliest": ["12 Months"], - "due": ["14 Months"], - "late": ["20 Months"], - "max": ["30 Months"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Months"], - "interval": ["1 Day"], - "count": "40" - }, - { - "window": "due", - "offset": ["1 Year"], - "interval": ["1 Day"], - "count": "360" - }, - { - "window": "late", - "offset": ["14 Months"], - "interval": ["1 Day"], - "count": "360" - } - - ] + "window": "earliest", + "offset": [ + "0 Months" + ], + "interval": [ + "1 Day" + ], + "count": "40" + }, + { + "window": "due", + "offset": [ + "1 Year" + ], + "interval": [ + "1 Day" + ], + "count": "360" + }, + { + "window": "late", + "offset": [ + "14 Months" + ], + "interval": [ + "1 Day" + ], + "count": "360" } - ] + ] + } + ] } \ No newline at end of file diff --git a/src/test/resources/schedules/woman-tt5.json b/src/test/resources/schedules/woman-tt5.json index ff9cd30d4..2d9dc8824 100644 --- a/src/test/resources/schedules/woman-tt5.json +++ b/src/test/resources/schedules/woman-tt5.json @@ -1,35 +1,55 @@ { - "name": "TT 5", - "absolute": true, - "milestones": [ + "name": "TT 5", + "absolute": true, + "milestones": [ + { + "name": "tt5", + "scheduleWindows": { + "earliest": [ + "12 Months" + ], + "due": [ + "14 Months" + ], + "late": [ + "20 Months" + ], + "max": [ + "30 Months" + ] + }, + "alerts": [ { - "name": "tt5", - "scheduleWindows": { - "earliest": ["12 Months"], - "due": ["14 Months"], - "late": ["20 Months"], - "max": ["30 Months"] - }, - "alerts": [ - { - "window": "earliest", - "offset": ["0 Months"], - "interval": ["1 Day"], - "count": "50" - }, - { - "window": "due", - "offset": ["1 Year"], - "interval": ["1 Day"], - "count": "360" - }, - { - "window": "late", - "offset": ["14 Months"], - "interval": ["1 Day"], - "count": "360" - } - ] + "window": "earliest", + "offset": [ + "0 Months" + ], + "interval": [ + "1 Day" + ], + "count": "50" + }, + { + "window": "due", + "offset": [ + "1 Year" + ], + "interval": [ + "1 Day" + ], + "count": "360" + }, + { + "window": "late", + "offset": [ + "14 Months" + ], + "interval": [ + "1 Day" + ], + "count": "360" } - ] + ] + } + ] } \ No newline at end of file diff --git a/src/test/resources/settings.json b/src/test/resources/settings.json index d9d7d1172..f99e4a562 100644 --- a/src/test/resources/settings.json +++ b/src/test/resources/settings.json @@ -1,17860 +1,17859 @@ - - { - "identifier": "jurisdiction_metadata-population", - "locationId": "", - "providerId": "onatest", - "settings": [ - { - "description": "Jurisdiction Metadata for Zambia(vl 2020) id ecfbf048-fb7a-47d8-a12b-61bf5d2a6e7b", - "key": "ecfbf048-fb7a-47d8-a12b-61bf5d2a6e7b", - "label": "Zambia(vl 2020) metadata", - "value": "" - }, - { - "description": "Jurisdiction Metadata for Zambia(vl 2020) id ecfbf048-fb7a-47d8-a12b-61bf5d2a6e7b", - "key": "ecfbf048-fb7a-47d8-a12b-61bf5d2a6e7b", - "label": "Zambia(vl 2020) metadata", - "value": "" - }, - { - "description": "Jurisdiction Metadata for Zambia(vl 2020) id ecfbf048-fb7a-47d8-a12b-61bf5d2a6e7b", - "key": "ecfbf048-fb7a-47d8-a12b-61bf5d2a6e7b", - "label": "Zambia(vl 2020) metadata", - "value": "" - }, - { - "description": "Jurisdiction Metadata for Luapula Province (2020) id b4d25f09-1365-41aa-ac37-f5768d9075bf", - "key": "b4d25f09-1365-41aa-ac37-f5768d9075bf", - "label": "Luapula Province (2020) metadata", - "value": "25001" - }, - { - "description": "Jurisdiction Metadata for Nchelenge District (2020) id 7d1297d2-a7e7-4896-a391-31d14cab9d32", - "key": "7d1297d2-a7e7-4896-a391-31d14cab9d32", - "label": "Nchelenge District (2020) metadata", - "value": "25002" - }, - { - "description": "Jurisdiction Metadata for Chisenga(2020) id 3c518249-2441-4e02-bf76-1f9de9498e76", - "key": "3c518249-2441-4e02-bf76-1f9de9498e76", - "label": "Chisenga(2020) metadata", - "value": "25003" - }, - { - "description": "Jurisdiction Metadata for Chisenga Zone id d6dffe1f-a02a-429b-b10a-ffc9a9c822c3", - "key": "d6dffe1f-a02a-429b-b10a-ffc9a9c822c3", - "label": "Chisenga Zone metadata", - "value": "25004" - }, - { - "description": "Jurisdiction Metadata for chs_1(2020) id 7d1ae3ba-9b65-49d9-b5a9-67ad6c0ee8a5", - "key": "7d1ae3ba-9b65-49d9-b5a9-67ad6c0ee8a5", - "label": "chs_1(2020) metadata", - "value": "25005" - }, - { - "description": "Jurisdiction Metadata for Chipashi Zone id a53f8368-cfc1-4d7b-bf7e-28edc8571497", - "key": "a53f8368-cfc1-4d7b-bf7e-28edc8571497", - "label": "Chipashi Zone metadata", - "value": "25006" - }, - { - "description": "Jurisdiction Metadata for chs_20(2020) id f5d61a2e-5478-49f9-8fb1-5e7ac9e5c1c1", - "key": "f5d61a2e-5478-49f9-8fb1-5e7ac9e5c1c1", - "label": "chs_20(2020) metadata", - "value": "" - }, - { - "description": "Jurisdiction Metadata for chs_14(2020) id 385cb609-4611-4a7a-8572-9a77320dd612", - "key": "385cb609-4611-4a7a-8572-9a77320dd612", - "label": "chs_14(2020) metadata", - "value": "" - }, - { - "description": "Jurisdiction Metadata for chs_4(2020) id e6e0c27f-7113-4405-a955-f29548cea166", - "key": "e6e0c27f-7113-4405-a955-f29548cea166", - "label": "chs_4(2020) metadata", - "value": "" - }, - { - "description": "Jurisdiction Metadata for chs_9(2020) id 6f34a217-0445-4d49-8dc6-a02f7b0d175f", - "key": "6f34a217-0445-4d49-8dc6-a02f7b0d175f", - "label": "chs_9(2020) metadata", - "value": "" - }, - { - "description": "Jurisdiction Metadata for chs_5(2020) id c8861921-2439-46f7-bed1-e814784c45e4", - "key": "c8861921-2439-46f7-bed1-e814784c45e4", - "label": "chs_5(2020) metadata", - "value": "" - }, - { - "description": "Jurisdiction Metadata for Chawelwa Zone id d109fa56-7097-49d5-9850-fb03df325e0e", - "key": "d109fa56-7097-49d5-9850-fb03df325e0e", - "label": "Chawelwa Zone metadata", - "value": "25012" - }, - { - "description": "Jurisdiction Metadata for chs_6(2020) id 52e0b58d-b746-4903-ba49-e090b5b6987d", - "key": "52e0b58d-b746-4903-ba49-e090b5b6987d", - "label": "chs_6(2020) metadata", - "value": "25013" - }, - { - "description": "Jurisdiction Metadata for chs_2(2020) id 60f1dede-617a-4ddb-85d9-82e936c6466c", - "key": "60f1dede-617a-4ddb-85d9-82e936c6466c", - "label": "chs_2(2020) metadata", - "value": "25014" - }, - { - "description": "Jurisdiction Metadata for chs_16(2020) id c8bfa81b-fc77-42f4-8ace-7f5a34d33ade", - "key": "c8bfa81b-fc77-42f4-8ace-7f5a34d33ade", - "label": "chs_16(2020) metadata", - "value": "25015" - }, - { - "description": "Jurisdiction Metadata for chs_18(2020) id 3294b520-c390-4011-a5c1-1e62a67fdbe4", - "key": "3294b520-c390-4011-a5c1-1e62a67fdbe4", - "label": "chs_18(2020) metadata", - "value": "25016" - }, - { - "description": "Jurisdiction Metadata for Kamonga Zone id 9af0268b-d8e5-48e7-84a0-a94984a62c07", - "key": "9af0268b-d8e5-48e7-84a0-a94984a62c07", - "label": "Kamonga Zone metadata", - "value": "25017" - }, - { - "description": "Jurisdiction Metadata for chs_19(2020) id 7c047096-dd51-424b-8665-bd3d03f16736", - "key": "7c047096-dd51-424b-8665-bd3d03f16736", - "label": "chs_19(2020) metadata", - "value": "25018" - }, - { - "description": "Jurisdiction Metadata for chs_13(2020) id 94791c4e-0343-440b-b744-6fd708ce6b16", - "key": "94791c4e-0343-440b-b744-6fd708ce6b16", - "label": "chs_13(2020) metadata", - "value": "25019" - }, - { - "description": "Jurisdiction Metadata for chs_15(2020) id 892242a7-ddb1-4715-b54f-97c5e25b59b4", - "key": "892242a7-ddb1-4715-b54f-97c5e25b59b4", - "label": "chs_15(2020) metadata", - "value": "25020" - }, - { - "description": "Jurisdiction Metadata for chs_8(2020) id f61a7584-df47-4f5e-a034-eec8978ba8a7", - "key": "f61a7584-df47-4f5e-a034-eec8978ba8a7", - "label": "chs_8(2020) metadata", - "value": "25021" - }, - { - "description": "Jurisdiction Metadata for chs_3(2020) id 006ee86f-9fd0-4b4a-a203-f493676dc7a9", - "key": "006ee86f-9fd0-4b4a-a203-f493676dc7a9", - "label": "chs_3(2020) metadata", - "value": "25022" - }, - { - "description": "Jurisdiction Metadata for Kashengeneke Zone id 8e3c031e-abba-4205-97da-afe1f5861ea6", - "key": "8e3c031e-abba-4205-97da-afe1f5861ea6", - "label": "Kashengeneke Zone metadata", - "value": "25023" - }, - { - "description": "Jurisdiction Metadata for chs_10(2020) id 674dfd54-f94d-4e62-b4e2-c7c2bf1b5783", - "key": "674dfd54-f94d-4e62-b4e2-c7c2bf1b5783", - "label": "chs_10(2020) metadata", - "value": "25024" - }, - { - "description": "Jurisdiction Metadata for chs_11(2020) id 488ab72d-0db0-45df-9e27-deed715f094e", - "key": "488ab72d-0db0-45df-9e27-deed715f094e", - "label": "chs_11(2020) metadata", - "value": "25025" - }, - { - "description": "Jurisdiction Metadata for chs_17(2020) id d4ea6140-6485-45bc-9604-0e5c4799ed90", - "key": "d4ea6140-6485-45bc-9604-0e5c4799ed90", - "label": "chs_17(2020) metadata", - "value": "25026" - }, - { - "description": "Jurisdiction Metadata for chs_12(2020) id f445755c-b867-4a75-9239-9c1663302645", - "key": "f445755c-b867-4a75-9239-9c1663302645", - "label": "chs_12(2020) metadata", - "value": "25027" - }, - { - "description": "Jurisdiction Metadata for chs_7(2020) id 1863230d-8e53-4ee4-8259-8df54bc30bf5", - "key": "1863230d-8e53-4ee4-8259-8df54bc30bf5", - "label": "chs_7(2020) metadata", - "value": "25028" - }, - { - "description": "Jurisdiction Metadata for Kafutuma(2020) id 8ca6a58f-78b7-4782-ada3-eca56caa63ae", - "key": "8ca6a58f-78b7-4782-ada3-eca56caa63ae", - "label": "Kafutuma(2020) metadata", - "value": "25029" - }, - { - "description": "Jurisdiction Metadata for Kalweo Zone id 2172b0f5-edae-443f-a9d2-29d5fb072b9a", - "key": "2172b0f5-edae-443f-a9d2-29d5fb072b9a", - "label": "Kalweo Zone metadata", - "value": "25030" - }, - { - "description": "Jurisdiction Metadata for kft_328(2020) id 3cf59804-5079-4854-869a-66d250397a18", - "key": "3cf59804-5079-4854-869a-66d250397a18", - "label": "kft_328(2020) metadata", - "value": "25031" - }, - { - "description": "Jurisdiction Metadata for kft_30(2020) id 8662bc0f-a1f7-46f4-887c-5088ca18b6e6", - "key": "8662bc0f-a1f7-46f4-887c-5088ca18b6e6", - "label": "kft_30(2020) metadata", - "value": "25032" - }, - { - "description": "Jurisdiction Metadata for kft_278(2020) id e144df9e-6316-4e94-9539-36c489e45f80", - "key": "e144df9e-6316-4e94-9539-36c489e45f80", - "label": "kft_278(2020) metadata", - "value": "25033" - }, - { - "description": "Jurisdiction Metadata for kft_237(2020) id 6c1c0237-9dc1-40e9-a485-47891ea6c5c7", - "key": "6c1c0237-9dc1-40e9-a485-47891ea6c5c7", - "label": "kft_237(2020) metadata", - "value": "25034" - }, - { - "description": "Jurisdiction Metadata for kft_23(2020) id a35dba6f-fbea-428b-bd74-82739de07546", - "key": "a35dba6f-fbea-428b-bd74-82739de07546", - "label": "kft_23(2020) metadata", - "value": "25035" - }, - { - "description": "Jurisdiction Metadata for kft_91(2020) id 310ddebb-99bd-43fd-92bc-cb89f62971b0", - "key": "310ddebb-99bd-43fd-92bc-cb89f62971b0", - "label": "kft_91(2020) metadata", - "value": "25036" - }, - { - "description": "Jurisdiction Metadata for kft_283(2020) id 47c85d02-b849-4e47-8407-dd2e6e8670a6", - "key": "47c85d02-b849-4e47-8407-dd2e6e8670a6", - "label": "kft_283(2020) metadata", - "value": "25037" - }, - { - "description": "Jurisdiction Metadata for kft_189(2020) id 875d19ef-4f3e-4434-930c-06786ea7d389", - "key": "875d19ef-4f3e-4434-930c-06786ea7d389", - "label": "kft_189(2020) metadata", - "value": "25038" - }, - { - "description": "Jurisdiction Metadata for kft_241(2020) id 2108a527-d4b3-42e6-a59e-8561e959d544", - "key": "2108a527-d4b3-42e6-a59e-8561e959d544", - "label": "kft_241(2020) metadata", - "value": "25039" - }, - { - "description": "Jurisdiction Metadata for kft_235(2020) id 913e65a8-dba7-4485-93c0-aa35292614b7", - "key": "913e65a8-dba7-4485-93c0-aa35292614b7", - "label": "kft_235(2020) metadata", - "value": "25040" - }, - { - "description": "Jurisdiction Metadata for kft_95(2020) id 674bea32-c4e1-417c-863a-f2bc35735561", - "key": "674bea32-c4e1-417c-863a-f2bc35735561", - "label": "kft_95(2020) metadata", - "value": "25041" - }, - { - "description": "Jurisdiction Metadata for kft_273(2020) id 945b1b81-0537-4f66-b656-381a1582d110", - "key": "945b1b81-0537-4f66-b656-381a1582d110", - "label": "kft_273(2020) metadata", - "value": "25042" - }, - { - "description": "Jurisdiction Metadata for kft_128(2020) id b0d225a6-fc7d-45ea-aced-daf75a81d08d", - "key": "b0d225a6-fc7d-45ea-aced-daf75a81d08d", - "label": "kft_128(2020) metadata", - "value": "25043" - }, - { - "description": "Jurisdiction Metadata for kft_299(2020) id 75702d24-d66c-45ef-8606-bca353ccc400", - "key": "75702d24-d66c-45ef-8606-bca353ccc400", - "label": "kft_299(2020) metadata", - "value": "25044" - }, - { - "description": "Jurisdiction Metadata for kft_274(2020) id 806191cf-c8ed-42f5-8e17-f5cf54a4057e", - "key": "806191cf-c8ed-42f5-8e17-f5cf54a4057e", - "label": "kft_274(2020) metadata", - "value": "25045" - }, - { - "description": "Jurisdiction Metadata for kft_140(2020) id 49241892-0df0-4dea-8952-6ca784497adf", - "key": "49241892-0df0-4dea-8952-6ca784497adf", - "label": "kft_140(2020) metadata", - "value": "25046" - }, - { - "description": "Jurisdiction Metadata for kft_323(2020) id 560a0fd8-bb2d-4463-a643-cda0ec84e2f4", - "key": "560a0fd8-bb2d-4463-a643-cda0ec84e2f4", - "label": "kft_323(2020) metadata", - "value": "25047" - }, - { - "description": "Jurisdiction Metadata for kft_96(2020) id 82310f84-929e-4151-8c9c-3dc724890071", - "key": "82310f84-929e-4151-8c9c-3dc724890071", - "label": "kft_96(2020) metadata", - "value": "25048" - }, - { - "description": "Jurisdiction Metadata for kft_271(2020) id 416f9b2a-5bf2-4549-883d-f5e11b079678", - "key": "416f9b2a-5bf2-4549-883d-f5e11b079678", - "label": "kft_271(2020) metadata", - "value": "25049" - }, - { - "description": "Jurisdiction Metadata for kft_173(2020) id 2e33ec2e-4a66-4572-a156-67c974e325ce", - "key": "2e33ec2e-4a66-4572-a156-67c974e325ce", - "label": "kft_173(2020) metadata", - "value": "25050" - }, - { - "description": "Jurisdiction Metadata for kft_9(2020) id 763d4954-1776-4708-92e4-6c68d6cc0845", - "key": "763d4954-1776-4708-92e4-6c68d6cc0845", - "label": "kft_9(2020) metadata", - "value": "25051" - }, - { - "description": "Jurisdiction Metadata for kft_143(2020) id 150fa319-8b5f-4c4a-8b9a-d64adfe9a8af", - "key": "150fa319-8b5f-4c4a-8b9a-d64adfe9a8af", - "label": "kft_143(2020) metadata", - "value": "25052" - }, - { - "description": "Jurisdiction Metadata for kft_236(2020) id f927185b-2ef0-4bcc-a231-8f3e8633fbf4", - "key": "f927185b-2ef0-4bcc-a231-8f3e8633fbf4", - "label": "kft_236(2020) metadata", - "value": "25053" - }, - { - "description": "Jurisdiction Metadata for kft_135(2020) id 2eb84450-f917-4209-834f-9a7f1f858e0a", - "key": "2eb84450-f917-4209-834f-9a7f1f858e0a", - "label": "kft_135(2020) metadata", - "value": "25054" - }, - { - "description": "Jurisdiction Metadata for kft_102(2020) id 8b0695c0-f9ed-435c-b0d0-ed15f43620b5", - "key": "8b0695c0-f9ed-435c-b0d0-ed15f43620b5", - "label": "kft_102(2020) metadata", - "value": "25055" - }, - { - "description": "Jurisdiction Metadata for kft_53(2020) id cfb7435f-d2df-44e1-8f55-f053ff3c75eb", - "key": "cfb7435f-d2df-44e1-8f55-f053ff3c75eb", - "label": "kft_53(2020) metadata", - "value": "25056" - }, - { - "description": "Jurisdiction Metadata for kft_155(2020) id d1c0749f-67bb-4ce7-b98d-a0cf42af64ba", - "key": "d1c0749f-67bb-4ce7-b98d-a0cf42af64ba", - "label": "kft_155(2020) metadata", - "value": "25057" - }, - { - "description": "Jurisdiction Metadata for kft_131(2020) id 876c1db4-147f-4348-b09e-6b626e25a500", - "key": "876c1db4-147f-4348-b09e-6b626e25a500", - "label": "kft_131(2020) metadata", - "value": "25058" - }, - { - "description": "Jurisdiction Metadata for kft_62(2020) id 9de18a7c-0536-4983-b915-c8e2bcb854e3", - "key": "9de18a7c-0536-4983-b915-c8e2bcb854e3", - "label": "kft_62(2020) metadata", - "value": "25059" - }, - { - "description": "Jurisdiction Metadata for kft_37(2020) id 7c5ebce7-32e2-4cbd-8d79-2f315886fd00", - "key": "7c5ebce7-32e2-4cbd-8d79-2f315886fd00", - "label": "kft_37(2020) metadata", - "value": "25060" - }, - { - "description": "Jurisdiction Metadata for kft_243(2020) id 79d5be71-7411-4b15-add1-14e7213145e0", - "key": "79d5be71-7411-4b15-add1-14e7213145e0", - "label": "kft_243(2020) metadata", - "value": "25061" - }, - { - "description": "Jurisdiction Metadata for kft_73(2020) id eec2a385-71b7-4b73-af1c-f7ee58049764", - "key": "eec2a385-71b7-4b73-af1c-f7ee58049764", - "label": "kft_73(2020) metadata", - "value": "25062" - }, - { - "description": "Jurisdiction Metadata for kft_36(2020) id 5ee9ca16-2026-41c6-8244-feac4ed78d70", - "key": "5ee9ca16-2026-41c6-8244-feac4ed78d70", - "label": "kft_36(2020) metadata", - "value": "25063" - }, - { - "description": "Jurisdiction Metadata for kft_10(2020) id 22287d93-b811-4be2-8ddf-7085af37c623", - "key": "22287d93-b811-4be2-8ddf-7085af37c623", - "label": "kft_10(2020) metadata", - "value": "25064" - }, - { - "description": "Jurisdiction Metadata for kft_153(2020) id b1740aa7-4586-45bc-9055-43cc8bbabc02", - "key": "b1740aa7-4586-45bc-9055-43cc8bbabc02", - "label": "kft_153(2020) metadata", - "value": "25065" - }, - { - "description": "Jurisdiction Metadata for kft_148(2020) id 7c0a2bea-2ca3-485b-a4e6-081ef3788f9a", - "key": "7c0a2bea-2ca3-485b-a4e6-081ef3788f9a", - "label": "kft_148(2020) metadata", - "value": "25066" - }, - { - "description": "Jurisdiction Metadata for kft_166(2020) id 3c952b12-c571-40e6-acad-325ed635fd72", - "key": "3c952b12-c571-40e6-acad-325ed635fd72", - "label": "kft_166(2020) metadata", - "value": "25067" - }, - { - "description": "Jurisdiction Metadata for kft_233(2020) id 6a61b9da-4f79-4c9c-ad57-629ceba3daac", - "key": "6a61b9da-4f79-4c9c-ad57-629ceba3daac", - "label": "kft_233(2020) metadata", - "value": "25068" - }, - { - "description": "Jurisdiction Metadata for kft_19(2020) id 5e5a8bdd-c8a7-4f11-a7b2-32c8a045864f", - "key": "5e5a8bdd-c8a7-4f11-a7b2-32c8a045864f", - "label": "kft_19(2020) metadata", - "value": "25069" - }, - { - "description": "Jurisdiction Metadata for kft_277(2020) id bde21d4a-cb5c-40b9-8d61-3fea85a79f23", - "key": "bde21d4a-cb5c-40b9-8d61-3fea85a79f23", - "label": "kft_277(2020) metadata", - "value": "25070" - }, - { - "description": "Jurisdiction Metadata for kft_203(2020) id 40d0851d-31b4-4a92-befe-ceb1e39eb50f", - "key": "40d0851d-31b4-4a92-befe-ceb1e39eb50f", - "label": "kft_203(2020) metadata", - "value": "25071" - }, - { - "description": "Jurisdiction Metadata for kft_101(2020) id 6b316a94-0ae1-427a-ab65-974499b387ea", - "key": "6b316a94-0ae1-427a-ab65-974499b387ea", - "label": "kft_101(2020) metadata", - "value": "25072" - }, - { - "description": "Jurisdiction Metadata for kft_264(2020) id b79814e8-7c82-4ead-8f43-d56f8114ab19", - "key": "b79814e8-7c82-4ead-8f43-d56f8114ab19", - "label": "kft_264(2020) metadata", - "value": "25073" - }, - { - "description": "Jurisdiction Metadata for kft_35(2020) id 301e42e3-7a8d-4be8-af05-f86b905bb414", - "key": "301e42e3-7a8d-4be8-af05-f86b905bb414", - "label": "kft_35(2020) metadata", - "value": "25074" - }, - { - "description": "Jurisdiction Metadata for kft_72(2020) id 754e39cb-27c2-478f-882e-dfd9fb38fe49", - "key": "754e39cb-27c2-478f-882e-dfd9fb38fe49", - "label": "kft_72(2020) metadata", - "value": "25075" - }, - { - "description": "Jurisdiction Metadata for kft_142(2020) id 88e93622-8b4c-43bc-9461-0c4cda07c16b", - "key": "88e93622-8b4c-43bc-9461-0c4cda07c16b", - "label": "kft_142(2020) metadata", - "value": "25076" - }, - { - "description": "Jurisdiction Metadata for kft_32(2020) id b72a4394-37d9-44fe-afe1-4adce10cab44", - "key": "b72a4394-37d9-44fe-afe1-4adce10cab44", - "label": "kft_32(2020) metadata", - "value": "25077" - }, - { - "description": "Jurisdiction Metadata for kft_230(2020) id e2eef72d-fbe4-45bb-b954-c041a0162eed", - "key": "e2eef72d-fbe4-45bb-b954-c041a0162eed", - "label": "kft_230(2020) metadata", - "value": "25078" - }, - { - "description": "Jurisdiction Metadata for kft_188(2020) id 45d201a7-a915-4dec-a52e-73824329a8fc", - "key": "45d201a7-a915-4dec-a52e-73824329a8fc", - "label": "kft_188(2020) metadata", - "value": "25079" - }, - { - "description": "Jurisdiction Metadata for kft_130(2020) id 95545d6b-48b9-45c6-bcab-2c522424bee7", - "key": "95545d6b-48b9-45c6-bcab-2c522424bee7", - "label": "kft_130(2020) metadata", - "value": "25080" - }, - { - "description": "Jurisdiction Metadata for kft_39(2020) id fe0e0f65-d1c0-4bf7-866d-c3ca4ad61c9a", - "key": "fe0e0f65-d1c0-4bf7-866d-c3ca4ad61c9a", - "label": "kft_39(2020) metadata", - "value": "25081" - }, - { - "description": "Jurisdiction Metadata for kft_68(2020) id 39a59408-0cda-4c53-99ed-6e6187a26961", - "key": "39a59408-0cda-4c53-99ed-6e6187a26961", - "label": "kft_68(2020) metadata", - "value": "25082" - }, - { - "description": "Jurisdiction Metadata for kft_276(2020) id 20c1af76-0da0-4721-afbf-d8636a861d4b", - "key": "20c1af76-0da0-4721-afbf-d8636a861d4b", - "label": "kft_276(2020) metadata", - "value": "25083" - }, - { - "description": "Jurisdiction Metadata for kft_25(2020) id 4ca4933a-7059-4301-b551-be139174b579", - "key": "4ca4933a-7059-4301-b551-be139174b579", - "label": "kft_25(2020) metadata", - "value": "25084" - }, - { - "description": "Jurisdiction Metadata for kft_307(2020) id d7980819-e4cd-4f11-b19d-ca1ad39cd4a7", - "key": "d7980819-e4cd-4f11-b19d-ca1ad39cd4a7", - "label": "kft_307(2020) metadata", - "value": "25085" - }, - { - "description": "Jurisdiction Metadata for kft_344(2020) id 0df76c95-0e10-4fdf-b6e7-3922a392409a", - "key": "0df76c95-0e10-4fdf-b6e7-3922a392409a", - "label": "kft_344(2020) metadata", - "value": "25086" - }, - { - "description": "Jurisdiction Metadata for kft_259(2020) id a3cee12d-2311-466f-b278-cbed562c818b", - "key": "a3cee12d-2311-466f-b278-cbed562c818b", - "label": "kft_259(2020) metadata", - "value": "25087" - }, - { - "description": "Jurisdiction Metadata for kft_187(2020) id 9c4b0422-ec0d-498b-8cf1-6e38cbf2f1f8", - "key": "9c4b0422-ec0d-498b-8cf1-6e38cbf2f1f8", - "label": "kft_187(2020) metadata", - "value": "25088" - }, - { - "description": "Jurisdiction Metadata for kft_179(2020) id a66cd42f-0862-4fda-b0b7-f6014853a50b", - "key": "a66cd42f-0862-4fda-b0b7-f6014853a50b", - "label": "kft_179(2020) metadata", - "value": "25089" - }, - { - "description": "Jurisdiction Metadata for kft_117(2020) id ea3c652f-5926-478e-ba10-5d9b0abc90ec", - "key": "ea3c652f-5926-478e-ba10-5d9b0abc90ec", - "label": "kft_117(2020) metadata", - "value": "25090" - }, - { - "description": "Jurisdiction Metadata for kft_70(2020) id 5d717374-ba3c-41cc-9ee0-7018a8dc24f8", - "key": "5d717374-ba3c-41cc-9ee0-7018a8dc24f8", - "label": "kft_70(2020) metadata", - "value": "25091" - }, - { - "description": "Jurisdiction Metadata for kft_239(2020) id 9649a63e-7fd5-4442-94ce-7e6ecdf329cb", - "key": "9649a63e-7fd5-4442-94ce-7e6ecdf329cb", - "label": "kft_239(2020) metadata", - "value": "25092" - }, - { - "description": "Jurisdiction Metadata for kft_201(2020) id 7865ec2d-a832-4655-9cf4-267bebd1c138", - "key": "7865ec2d-a832-4655-9cf4-267bebd1c138", - "label": "kft_201(2020) metadata", - "value": "25093" - }, - { - "description": "Jurisdiction Metadata for kft_225(2020) id 44713f6e-4a1f-42ae-9f8e-b97114de97ed", - "key": "44713f6e-4a1f-42ae-9f8e-b97114de97ed", - "label": "kft_225(2020) metadata", - "value": "25094" - }, - { - "description": "Jurisdiction Metadata for kft_257(2020) id f0af0dc5-40c4-46d1-8044-d56eb538023e", - "key": "f0af0dc5-40c4-46d1-8044-d56eb538023e", - "label": "kft_257(2020) metadata", - "value": "25095" - }, - { - "description": "Jurisdiction Metadata for kft_108(2020) id 1279d77a-25e8-4ca5-a204-e5773b573615", - "key": "1279d77a-25e8-4ca5-a204-e5773b573615", - "label": "kft_108(2020) metadata", - "value": "25096" - }, - { - "description": "Jurisdiction Metadata for kft_302(2020) id bfda2151-c86a-4211-9f74-ea1f1a788178", - "key": "bfda2151-c86a-4211-9f74-ea1f1a788178", - "label": "kft_302(2020) metadata", - "value": "25097" - }, - { - "description": "Jurisdiction Metadata for kft_138(2020) id 9ec57e53-f988-44c5-b93e-007a93285e4c", - "key": "9ec57e53-f988-44c5-b93e-007a93285e4c", - "label": "kft_138(2020) metadata", - "value": "25098" - }, - { - "description": "Jurisdiction Metadata for kft_21(2020) id 1c1c693a-b3b3-4487-a86a-285403c8e09e", - "key": "1c1c693a-b3b3-4487-a86a-285403c8e09e", - "label": "kft_21(2020) metadata", - "value": "25099" - }, - { - "description": "Jurisdiction Metadata for kft_87(2020) id f7525c23-ee55-46c8-ab9c-318f599c40ae", - "key": "f7525c23-ee55-46c8-ab9c-318f599c40ae", - "label": "kft_87(2020) metadata", - "value": "25100" - }, - { - "description": "Jurisdiction Metadata for kft_219(2020) id 1d07bb34-0a11-46d1-aa0f-72db2cf70a40", - "key": "1d07bb34-0a11-46d1-aa0f-72db2cf70a40", - "label": "kft_219(2020) metadata", - "value": "25101" - }, - { - "description": "Jurisdiction Metadata for kft_75(2020) id 4b05a9e0-daaf-4e0f-bd28-865aaae29d91", - "key": "4b05a9e0-daaf-4e0f-bd28-865aaae29d91", - "label": "kft_75(2020) metadata", - "value": "25102" - }, - { - "description": "Jurisdiction Metadata for kft_38(2020) id 0f527ec7-9313-49b3-848b-bdccac9766d9", - "key": "0f527ec7-9313-49b3-848b-bdccac9766d9", - "label": "kft_38(2020) metadata", - "value": "25103" - }, - { - "description": "Jurisdiction Metadata for kft_329(2020) id f3ae2cba-8127-4d6d-9f14-fefdac8815d3", - "key": "f3ae2cba-8127-4d6d-9f14-fefdac8815d3", - "label": "kft_329(2020) metadata", - "value": "25104" - }, - { - "description": "Jurisdiction Metadata for kft_300(2020) id ec887900-4add-417c-a473-4697f97210dd", - "key": "ec887900-4add-417c-a473-4697f97210dd", - "label": "kft_300(2020) metadata", - "value": "25105" - }, - { - "description": "Jurisdiction Metadata for kft_320(2020) id 0904eda6-5a36-4de4-b494-5c84a03539db", - "key": "0904eda6-5a36-4de4-b494-5c84a03539db", - "label": "kft_320(2020) metadata", - "value": "25106" - }, - { - "description": "Jurisdiction Metadata for kft_184(2020) id 68baf2da-a819-4451-8666-12cc1e0c19b3", - "key": "68baf2da-a819-4451-8666-12cc1e0c19b3", - "label": "kft_184(2020) metadata", - "value": "25107" - }, - { - "description": "Jurisdiction Metadata for kft_77(2020) id a0528349-d3ed-45cb-b8e3-6059e868f654", - "key": "a0528349-d3ed-45cb-b8e3-6059e868f654", - "label": "kft_77(2020) metadata", - "value": "25108" - }, - { - "description": "Jurisdiction Metadata for kft_181(2020) id dd560563-9a1d-4b56-a8a7-17aef2541769", - "key": "dd560563-9a1d-4b56-a8a7-17aef2541769", - "label": "kft_181(2020) metadata", - "value": "25109" - }, - { - "description": "Jurisdiction Metadata for kft_158(2020) id 5fd3c170-a7ea-44c8-b7a2-4ef7d5f20a93", - "key": "5fd3c170-a7ea-44c8-b7a2-4ef7d5f20a93", - "label": "kft_158(2020) metadata", - "value": "25110" - }, - { - "description": "Jurisdiction Metadata for kft_46(2020) id 435fa78e-d6ca-44b9-9088-9dff73e05554", - "key": "435fa78e-d6ca-44b9-9088-9dff73e05554", - "label": "kft_46(2020) metadata", - "value": "25111" - }, - { - "description": "Jurisdiction Metadata for kft_127(2020) id a5a43633-8aeb-4a32-b79a-24a87238c013", - "key": "a5a43633-8aeb-4a32-b79a-24a87238c013", - "label": "kft_127(2020) metadata", - "value": "25112" - }, - { - "description": "Jurisdiction Metadata for kft_234(2020) id bfbbf577-b301-4d44-9e27-d1bcb77b6d86", - "key": "bfbbf577-b301-4d44-9e27-d1bcb77b6d86", - "label": "kft_234(2020) metadata", - "value": "25113" - }, - { - "description": "Jurisdiction Metadata for kft_79(2020) id 780effe4-c053-40e8-a491-ad35ba249b47", - "key": "780effe4-c053-40e8-a491-ad35ba249b47", - "label": "kft_79(2020) metadata", - "value": "25114" - }, - { - "description": "Jurisdiction Metadata for kft_27(2020) id 82dc66ff-4a81-4e21-aaf2-48f3547c9ea5", - "key": "82dc66ff-4a81-4e21-aaf2-48f3547c9ea5", - "label": "kft_27(2020) metadata", - "value": "25115" - }, - { - "description": "Jurisdiction Metadata for kft_116(2020) id e3363493-66cd-4570-84af-037a46cd122b", - "key": "e3363493-66cd-4570-84af-037a46cd122b", - "label": "kft_116(2020) metadata", - "value": "25116" - }, - { - "description": "Jurisdiction Metadata for kft_220(2020) id 250194ee-5386-484c-8b96-a6fe00a45cec", - "key": "250194ee-5386-484c-8b96-a6fe00a45cec", - "label": "kft_220(2020) metadata", - "value": "25117" - }, - { - "description": "Jurisdiction Metadata for kft_74(2020) id e69ef9fb-ce29-4439-86da-1aaa86e474d3", - "key": "e69ef9fb-ce29-4439-86da-1aaa86e474d3", - "label": "kft_74(2020) metadata", - "value": "25118" - }, - { - "description": "Jurisdiction Metadata for kft_45(2020) id 605b7126-d6df-4c28-9411-f9fba20073df", - "key": "605b7126-d6df-4c28-9411-f9fba20073df", - "label": "kft_45(2020) metadata", - "value": "25119" - }, - { - "description": "Jurisdiction Metadata for kft_285(2020) id 0071e4d6-be36-472a-a7d9-fd2d89c97802", - "key": "0071e4d6-be36-472a-a7d9-fd2d89c97802", - "label": "kft_285(2020) metadata", - "value": "25120" - }, - { - "description": "Jurisdiction Metadata for kft_218(2020) id d4d4a718-f4e0-4089-a88d-4ddbdb30611f", - "key": "d4d4a718-f4e0-4089-a88d-4ddbdb30611f", - "label": "kft_218(2020) metadata", - "value": "25121" - }, - { - "description": "Jurisdiction Metadata for kft_80(2020) id a9857bd5-dd3e-49ff-8af2-920d56e097b5", - "key": "a9857bd5-dd3e-49ff-8af2-920d56e097b5", - "label": "kft_80(2020) metadata", - "value": "25122" - }, - { - "description": "Jurisdiction Metadata for kft_238(2020) id 15b07c1c-d60e-41bd-8480-dacc20c70318", - "key": "15b07c1c-d60e-41bd-8480-dacc20c70318", - "label": "kft_238(2020) metadata", - "value": "25123" - }, - { - "description": "Jurisdiction Metadata for kft_315(2020) id b4043df5-029b-45b1-af0f-85fe3a8c42ff", - "key": "b4043df5-029b-45b1-af0f-85fe3a8c42ff", - "label": "kft_315(2020) metadata", - "value": "25124" - }, - { - "description": "Jurisdiction Metadata for kft_20(2020) id b82a866d-01d5-491b-9982-68cbafaf15df", - "key": "b82a866d-01d5-491b-9982-68cbafaf15df", - "label": "kft_20(2020) metadata", - "value": "25125" - }, - { - "description": "Jurisdiction Metadata for kft_165(2020) id 1a39d4a8-44b5-466f-989b-69b549343cce", - "key": "1a39d4a8-44b5-466f-989b-69b549343cce", - "label": "kft_165(2020) metadata", - "value": "25126" - }, - { - "description": "Jurisdiction Metadata for kft_202(2020) id 9590bcce-f400-47f0-8d76-74e55f463e83", - "key": "9590bcce-f400-47f0-8d76-74e55f463e83", - "label": "kft_202(2020) metadata", - "value": "25127" - }, - { - "description": "Jurisdiction Metadata for kft_14(2020) id 32e8cd39-4e5c-4f2f-b43d-a2027d77e09e", - "key": "32e8cd39-4e5c-4f2f-b43d-a2027d77e09e", - "label": "kft_14(2020) metadata", - "value": "25128" - }, - { - "description": "Jurisdiction Metadata for kft_65(2020) id ab98860a-862a-48b1-844c-12ce7bb027da", - "key": "ab98860a-862a-48b1-844c-12ce7bb027da", - "label": "kft_65(2020) metadata", - "value": "25129" - }, - { - "description": "Jurisdiction Metadata for kft_263(2020) id a710f078-3d36-4b9a-a520-e1ccb2c60578", - "key": "a710f078-3d36-4b9a-a520-e1ccb2c60578", - "label": "kft_263(2020) metadata", - "value": "25130" - }, - { - "description": "Jurisdiction Metadata for kft_193(2020) id 69b70911-6ad3-4352-8b14-4d9e35b51089", - "key": "69b70911-6ad3-4352-8b14-4d9e35b51089", - "label": "kft_193(2020) metadata", - "value": "25131" - }, - { - "description": "Jurisdiction Metadata for kft_294(2020) id 09c1ed60-0fab-4274-b74c-2ed8ec24a483", - "key": "09c1ed60-0fab-4274-b74c-2ed8ec24a483", - "label": "kft_294(2020) metadata", - "value": "25132" - }, - { - "description": "Jurisdiction Metadata for kft_240(2020) id 32b36d14-32be-493f-980b-d68da75cd61a", - "key": "32b36d14-32be-493f-980b-d68da75cd61a", - "label": "kft_240(2020) metadata", - "value": "25133" - }, - { - "description": "Jurisdiction Metadata for kft_93(2020) id 547dca32-96ae-4d86-a9b0-736e7a1d8a52", - "key": "547dca32-96ae-4d86-a9b0-736e7a1d8a52", - "label": "kft_93(2020) metadata", - "value": "25134" - }, - { - "description": "Jurisdiction Metadata for kft_106(2020) id 5ff4d044-4bd9-44b4-9411-bd8b9985f8ca", - "key": "5ff4d044-4bd9-44b4-9411-bd8b9985f8ca", - "label": "kft_106(2020) metadata", - "value": "25135" - }, - { - "description": "Jurisdiction Metadata for kft_42(2020) id 1eee0e06-5b80-4624-8571-d4115e001a48", - "key": "1eee0e06-5b80-4624-8571-d4115e001a48", - "label": "kft_42(2020) metadata", - "value": "25136" - }, - { - "description": "Jurisdiction Metadata for kft_98(2020) id 82004427-cb14-40cf-a794-60a2545bac35", - "key": "82004427-cb14-40cf-a794-60a2545bac35", - "label": "kft_98(2020) metadata", - "value": "25137" - }, - { - "description": "Jurisdiction Metadata for kft_342(2020) id eead978b-c0d5-4192-9178-9ef247d62dfa", - "key": "eead978b-c0d5-4192-9178-9ef247d62dfa", - "label": "kft_342(2020) metadata", - "value": "25138" - }, - { - "description": "Jurisdiction Metadata for kft_139(2020) id f2c36f8f-f3b5-41fe-8e74-01fdabdb6ade", - "key": "f2c36f8f-f3b5-41fe-8e74-01fdabdb6ade", - "label": "kft_139(2020) metadata", - "value": "25139" - }, - { - "description": "Jurisdiction Metadata for kft_256(2020) id 092540ca-3141-4db8-82d4-befdd7263f92", - "key": "092540ca-3141-4db8-82d4-befdd7263f92", - "label": "kft_256(2020) metadata", - "value": "25140" - }, - { - "description": "Jurisdiction Metadata for kft_103(2020) id 5ff0790a-1254-4e67-8bfe-4d56d3f99513", - "key": "5ff0790a-1254-4e67-8bfe-4d56d3f99513", - "label": "kft_103(2020) metadata", - "value": "25141" - }, - { - "description": "Jurisdiction Metadata for kft_124(2020) id 0e854ba6-64b6-4fcf-961f-a25d0dff3871", - "key": "0e854ba6-64b6-4fcf-961f-a25d0dff3871", - "label": "kft_124(2020) metadata", - "value": "25142" - }, - { - "description": "Jurisdiction Metadata for kft_109(2020) id 28208766-61f8-409a-930a-a7ccb9c2eb1b", - "key": "28208766-61f8-409a-930a-a7ccb9c2eb1b", - "label": "kft_109(2020) metadata", - "value": "25143" - }, - { - "description": "Jurisdiction Metadata for kft_164(2020) id 97c5f48a-5f12-4b53-99c3-6309d6af7663", - "key": "97c5f48a-5f12-4b53-99c3-6309d6af7663", - "label": "kft_164(2020) metadata", - "value": "25144" - }, - { - "description": "Jurisdiction Metadata for kft_223(2020) id dd554cdc-1664-499f-a040-d75c08bdb720", - "key": "dd554cdc-1664-499f-a040-d75c08bdb720", - "label": "kft_223(2020) metadata", - "value": "25145" - }, - { - "description": "Jurisdiction Metadata for kft_16(2020) id 9c42f3cc-27d0-43c5-8c90-4b48f3319223", - "key": "9c42f3cc-27d0-43c5-8c90-4b48f3319223", - "label": "kft_16(2020) metadata", - "value": "25146" - }, - { - "description": "Jurisdiction Metadata for kft_231(2020) id 8cbd0b38-773b-4413-b161-5bbd47a46572", - "key": "8cbd0b38-773b-4413-b161-5bbd47a46572", - "label": "kft_231(2020) metadata", - "value": "25147" - }, - { - "description": "Jurisdiction Metadata for kft_49(2020) id ae3d896b-b5e3-4d75-b343-213b232eb5df", - "key": "ae3d896b-b5e3-4d75-b343-213b232eb5df", - "label": "kft_49(2020) metadata", - "value": "25148" - }, - { - "description": "Jurisdiction Metadata for kft_51(2020) id 8d42ba85-85a1-464e-9be5-f39a3b5531d8", - "key": "8d42ba85-85a1-464e-9be5-f39a3b5531d8", - "label": "kft_51(2020) metadata", - "value": "25149" - }, - { - "description": "Jurisdiction Metadata for kft_318(2020) id b4668c10-e8f9-4618-a685-a86e684b8586", - "key": "b4668c10-e8f9-4618-a685-a86e684b8586", - "label": "kft_318(2020) metadata", - "value": "25150" - }, - { - "description": "Jurisdiction Metadata for kft_324(2020) id de934dde-f99a-43ba-a4a1-5d3dd810e152", - "key": "de934dde-f99a-43ba-a4a1-5d3dd810e152", - "label": "kft_324(2020) metadata", - "value": "25151" - }, - { - "description": "Jurisdiction Metadata for kft_242(2020) id 91ef5196-4915-4ea0-bc85-3100a04c2678", - "key": "91ef5196-4915-4ea0-bc85-3100a04c2678", - "label": "kft_242(2020) metadata", - "value": "25152" - }, - { - "description": "Jurisdiction Metadata for kft_272(2020) id 858e1acb-d5da-4c74-a06a-d605399fb6ce", - "key": "858e1acb-d5da-4c74-a06a-d605399fb6ce", - "label": "kft_272(2020) metadata", - "value": "25153" - }, - { - "description": "Jurisdiction Metadata for kft_163(2020) id 81d32404-b62f-49c4-8547-6455d44c8f3b", - "key": "81d32404-b62f-49c4-8547-6455d44c8f3b", - "label": "kft_163(2020) metadata", - "value": "25154" - }, - { - "description": "Jurisdiction Metadata for kft_258(2020) id 338d6dd3-0970-4b73-8ccb-3c420ced0d77", - "key": "338d6dd3-0970-4b73-8ccb-3c420ced0d77", - "label": "kft_258(2020) metadata", - "value": "25155" - }, - { - "description": "Jurisdiction Metadata for kft_217(2020) id 8f0612f5-46c0-4074-bae6-aa935b708876", - "key": "8f0612f5-46c0-4074-bae6-aa935b708876", - "label": "kft_217(2020) metadata", - "value": "25156" - }, - { - "description": "Jurisdiction Metadata for kft_228(2020) id 86cf8f58-e1ad-4e6a-b4ed-3667d603790a", - "key": "86cf8f58-e1ad-4e6a-b4ed-3667d603790a", - "label": "kft_228(2020) metadata", - "value": "25157" - }, - { - "description": "Jurisdiction Metadata for kft_67(2020) id e58ea223-80c6-4475-95a8-65084f8243b4", - "key": "e58ea223-80c6-4475-95a8-65084f8243b4", - "label": "kft_67(2020) metadata", - "value": "25158" - }, - { - "description": "Jurisdiction Metadata for kft_111(2020) id bc3e73a5-2d3b-4170-a70a-c7ef3e9cd94f", - "key": "bc3e73a5-2d3b-4170-a70a-c7ef3e9cd94f", - "label": "kft_111(2020) metadata", - "value": "25159" - }, - { - "description": "Jurisdiction Metadata for kft_341(2020) id b086232b-2e02-418e-892e-91764175cc71", - "key": "b086232b-2e02-418e-892e-91764175cc71", - "label": "kft_341(2020) metadata", - "value": "25160" - }, - { - "description": "Jurisdiction Metadata for kft_269(2020) id f10570bc-f9d2-4497-a6b0-a1bffcee94f6", - "key": "f10570bc-f9d2-4497-a6b0-a1bffcee94f6", - "label": "kft_269(2020) metadata", - "value": "25161" - }, - { - "description": "Jurisdiction Metadata for kft_33(2020) id 9a4f2d79-3128-47dc-a71e-876bd1a80a65", - "key": "9a4f2d79-3128-47dc-a71e-876bd1a80a65", - "label": "kft_33(2020) metadata", - "value": "25162" - }, - { - "description": "Jurisdiction Metadata for kft_129(2020) id 076f32f9-07f3-490b-a9a3-2a65e667462e", - "key": "076f32f9-07f3-490b-a9a3-2a65e667462e", - "label": "kft_129(2020) metadata", - "value": "25163" - }, - { - "description": "Jurisdiction Metadata for kft_316(2020) id 0a9c6891-51a3-47c4-8d77-ebf478ab7efe", - "key": "0a9c6891-51a3-47c4-8d77-ebf478ab7efe", - "label": "kft_316(2020) metadata", - "value": "25164" - }, - { - "description": "Jurisdiction Metadata for kft_279(2020) id 1406f27f-ed79-4b72-9b8f-b55340893af8", - "key": "1406f27f-ed79-4b72-9b8f-b55340893af8", - "label": "kft_279(2020) metadata", - "value": "25165" - }, - { - "description": "Jurisdiction Metadata for kft_92(2020) id ef9f74f3-c07f-4009-9d7f-3ec808af325d", - "key": "ef9f74f3-c07f-4009-9d7f-3ec808af325d", - "label": "kft_92(2020) metadata", - "value": "25166" - }, - { - "description": "Jurisdiction Metadata for kft_71(2020) id c16df14a-fa59-4726-9a4e-9c8e70d1fbe6", - "key": "c16df14a-fa59-4726-9a4e-9c8e70d1fbe6", - "label": "kft_71(2020) metadata", - "value": "25167" - }, - { - "description": "Jurisdiction Metadata for kft_326(2020) id 718ec2ed-e5c4-4732-badc-670cb05ab21d", - "key": "718ec2ed-e5c4-4732-badc-670cb05ab21d", - "label": "kft_326(2020) metadata", - "value": "25168" - }, - { - "description": "Jurisdiction Metadata for kft_52(2020) id bba960e9-aa5c-45e5-af11-1ec639e186e8", - "key": "bba960e9-aa5c-45e5-af11-1ec639e186e8", - "label": "kft_52(2020) metadata", - "value": "25169" - }, - { - "description": "Jurisdiction Metadata for kft_22(2020) id 2b3ed432-8379-4e4c-8e2b-dc75a3efb91a", - "key": "2b3ed432-8379-4e4c-8e2b-dc75a3efb91a", - "label": "kft_22(2020) metadata", - "value": "25170" - }, - { - "description": "Jurisdiction Metadata for kft_78(2020) id a5d78c06-b279-40c6-9043-a879a2f3f74e", - "key": "a5d78c06-b279-40c6-9043-a879a2f3f74e", - "label": "kft_78(2020) metadata", - "value": "25171" - }, - { - "description": "Jurisdiction Metadata for kft_66(2020) id 4d9ea4e9-310e-42e2-a7ef-debab8f85f4f", - "key": "4d9ea4e9-310e-42e2-a7ef-debab8f85f4f", - "label": "kft_66(2020) metadata", - "value": "25172" - }, - { - "description": "Jurisdiction Metadata for kft_88(2020) id 910fc574-2e57-469a-8600-dfbd09b578be", - "key": "910fc574-2e57-469a-8600-dfbd09b578be", - "label": "kft_88(2020) metadata", - "value": "25173" - }, - { - "description": "Jurisdiction Metadata for kft_156(2020) id 5c072aa8-4275-46bb-875f-a70a52740109", - "key": "5c072aa8-4275-46bb-875f-a70a52740109", - "label": "kft_156(2020) metadata", - "value": "25174" - }, - { - "description": "Jurisdiction Metadata for kft_115(2020) id 860632fc-83fd-4be5-874f-6d965b6b2fa8", - "key": "860632fc-83fd-4be5-874f-6d965b6b2fa8", - "label": "kft_115(2020) metadata", - "value": "25175" - }, - { - "description": "Jurisdiction Metadata for kft_113(2020) id d08b543e-50b3-4acd-be9f-97d83b047721", - "key": "d08b543e-50b3-4acd-be9f-97d83b047721", - "label": "kft_113(2020) metadata", - "value": "25176" - }, - { - "description": "Jurisdiction Metadata for kft_159(2020) id a9370c5a-bdeb-4c24-8760-b312e3e41c6c", - "key": "a9370c5a-bdeb-4c24-8760-b312e3e41c6c", - "label": "kft_159(2020) metadata", - "value": "25177" - }, - { - "description": "Jurisdiction Metadata for kft_105(2020) id 27e178d8-b3cf-4a37-9f9e-9fc8d88a0881", - "key": "27e178d8-b3cf-4a37-9f9e-9fc8d88a0881", - "label": "kft_105(2020) metadata", - "value": "25178" - }, - { - "description": "Jurisdiction Metadata for kft_200(2020) id 39dd0df1-ec48-4836-af25-4f33a21dd58e", - "key": "39dd0df1-ec48-4836-af25-4f33a21dd58e", - "label": "kft_200(2020) metadata", - "value": "25179" - }, - { - "description": "Jurisdiction Metadata for kft_232(2020) id 1a927144-557c-4b2a-9fb0-4a0d6db6e2b3", - "key": "1a927144-557c-4b2a-9fb0-4a0d6db6e2b3", - "label": "kft_232(2020) metadata", - "value": "25180" - }, - { - "description": "Jurisdiction Metadata for kft_136(2020) id 02a6a043-72b5-4521-a61f-2606dc38ca91", - "key": "02a6a043-72b5-4521-a61f-2606dc38ca91", - "label": "kft_136(2020) metadata", - "value": "25181" - }, - { - "description": "Jurisdiction Metadata for kft_123(2020) id 2065cc91-7530-44a4-9aad-d7f61c8dab82", - "key": "2065cc91-7530-44a4-9aad-d7f61c8dab82", - "label": "kft_123(2020) metadata", - "value": "25182" - }, - { - "description": "Jurisdiction Metadata for kft_119(2020) id 34548868-3d97-40da-916c-fb7381aa1ee8", - "key": "34548868-3d97-40da-916c-fb7381aa1ee8", - "label": "kft_119(2020) metadata", - "value": "25183" - }, - { - "description": "Jurisdiction Metadata for kft_34(2020) id fff2ca78-fa5e-4b3a-a8dd-c85d2d5dbecc", - "key": "fff2ca78-fa5e-4b3a-a8dd-c85d2d5dbecc", - "label": "kft_34(2020) metadata", - "value": "25184" - }, - { - "description": "Jurisdiction Metadata for kft_196(2020) id 60eb203e-ba52-412b-b834-793248cc1d57", - "key": "60eb203e-ba52-412b-b834-793248cc1d57", - "label": "kft_196(2020) metadata", - "value": "25185" - }, - { - "description": "Jurisdiction Metadata for kft_195(2020) id 8cf7350e-4696-498e-81de-ed4d6eaab29d", - "key": "8cf7350e-4696-498e-81de-ed4d6eaab29d", - "label": "kft_195(2020) metadata", - "value": "25186" - }, - { - "description": "Jurisdiction Metadata for kft_47(2020) id b700f220-90bc-4f93-84db-4b3555c217df", - "key": "b700f220-90bc-4f93-84db-4b3555c217df", - "label": "kft_47(2020) metadata", - "value": "25187" - }, - { - "description": "Jurisdiction Metadata for kft_50(2020) id 1de0a44a-0cb9-4c55-bc93-e561f3a24905", - "key": "1de0a44a-0cb9-4c55-bc93-e561f3a24905", - "label": "kft_50(2020) metadata", - "value": "25188" - }, - { - "description": "Jurisdiction Metadata for kft_81(2020) id 713438d9-7d14-44ec-a901-7b3f0df191a4", - "key": "713438d9-7d14-44ec-a901-7b3f0df191a4", - "label": "kft_81(2020) metadata", - "value": "25189" - }, - { - "description": "Jurisdiction Metadata for kft_26(2020) id 481b4a3a-5306-4b2f-a60a-421101abaa6c", - "key": "481b4a3a-5306-4b2f-a60a-421101abaa6c", - "label": "kft_26(2020) metadata", - "value": "25190" - }, - { - "description": "Jurisdiction Metadata for kft_204(2020) id 1346322a-cc3d-4dfa-a18a-d06c3c9283c3", - "key": "1346322a-cc3d-4dfa-a18a-d06c3c9283c3", - "label": "kft_204(2020) metadata", - "value": "25191" - }, - { - "description": "Jurisdiction Metadata for kft_192(2020) id 1169d669-8a67-4bf9-99b4-5a5fe401e08a", - "key": "1169d669-8a67-4bf9-99b4-5a5fe401e08a", - "label": "kft_192(2020) metadata", - "value": "25192" - }, - { - "description": "Jurisdiction Metadata for kft_76(2020) id d82e9b0c-c3ae-4887-892a-2ca3b78b6ee6", - "key": "d82e9b0c-c3ae-4887-892a-2ca3b78b6ee6", - "label": "kft_76(2020) metadata", - "value": "25193" - }, - { - "description": "Jurisdiction Metadata for kft_210(2020) id ebca20ae-522c-494f-bb00-51f4463ca88d", - "key": "ebca20ae-522c-494f-bb00-51f4463ca88d", - "label": "kft_210(2020) metadata", - "value": "25194" - }, - { - "description": "Jurisdiction Metadata for kft_180(2020) id 387a07eb-f6c8-4b73-b77d-39e345685d37", - "key": "387a07eb-f6c8-4b73-b77d-39e345685d37", - "label": "kft_180(2020) metadata", - "value": "25195" - }, - { - "description": "Jurisdiction Metadata for kft_160(2020) id 7946a4f9-78ed-4429-93b6-5c1267671777", - "key": "7946a4f9-78ed-4429-93b6-5c1267671777", - "label": "kft_160(2020) metadata", - "value": "25196" - }, - { - "description": "Jurisdiction Metadata for kft_29(2020) id aa71f618-251d-4f1b-b579-aca4a1167c69", - "key": "aa71f618-251d-4f1b-b579-aca4a1167c69", - "label": "kft_29(2020) metadata", - "value": "25197" - }, - { - "description": "Jurisdiction Metadata for Shimpundu Zone id c361bf40-b0bd-4182-a9da-b420c9014382", - "key": "c361bf40-b0bd-4182-a9da-b420c9014382", - "label": "Shimpundu Zone metadata", - "value": "25198" - }, - { - "description": "Jurisdiction Metadata for kft_175(2020) id a0f708a8-6232-4cd0-b707-3573854a9631", - "key": "a0f708a8-6232-4cd0-b707-3573854a9631", - "label": "kft_175(2020) metadata", - "value": "25199" - }, - { - "description": "Jurisdiction Metadata for kft_5(2020) id cf2a233f-6203-4925-8c9d-1bd56c3084d0", - "key": "cf2a233f-6203-4925-8c9d-1bd56c3084d0", - "label": "kft_5(2020) metadata", - "value": "25200" - }, - { - "description": "Jurisdiction Metadata for Mulule Zone id b7c7de34-28f1-472a-86a0-2c3fe0c4a532", - "key": "b7c7de34-28f1-472a-86a0-2c3fe0c4a532", - "label": "Mulule Zone metadata", - "value": "25201" - }, - { - "description": "Jurisdiction Metadata for kft_56(2020) id 5898c78b-86df-4672-abf5-b24a7cefeb26", - "key": "5898c78b-86df-4672-abf5-b24a7cefeb26", - "label": "kft_56(2020) metadata", - "value": "25202" - }, - { - "description": "Jurisdiction Metadata for kft_122(2020) id ffecb4c9-3314-4e0a-b19a-36e1e3245e8e", - "key": "ffecb4c9-3314-4e0a-b19a-36e1e3245e8e", - "label": "kft_122(2020) metadata", - "value": "25203" - }, - { - "description": "Jurisdiction Metadata for kft_99(2020) id 2c4483c8-1276-4279-8865-0b098790c461", - "key": "2c4483c8-1276-4279-8865-0b098790c461", - "label": "kft_99(2020) metadata", - "value": "25204" - }, - { - "description": "Jurisdiction Metadata for kft_312(2020) id 89b79a0c-2dba-4880-a2b5-3ae7454ea4a8", - "key": "89b79a0c-2dba-4880-a2b5-3ae7454ea4a8", - "label": "kft_312(2020) metadata", - "value": "25205" - }, - { - "description": "Jurisdiction Metadata for kft_305(2020) id 030da7e8-0157-417d-9cf0-2955cb7fd115", - "key": "030da7e8-0157-417d-9cf0-2955cb7fd115", - "label": "kft_305(2020) metadata", - "value": "25206" - }, - { - "description": "Jurisdiction Metadata for kft_157(2020) id 2a08c5fa-709c-47aa-bfe8-668703ec2ccd", - "key": "2a08c5fa-709c-47aa-bfe8-668703ec2ccd", - "label": "kft_157(2020) metadata", - "value": "25207" - }, - { - "description": "Jurisdiction Metadata for kft_141(2020) id 2c2009e3-88f7-4957-b273-71391b35acfe", - "key": "2c2009e3-88f7-4957-b273-71391b35acfe", - "label": "kft_141(2020) metadata", - "value": "25208" - }, - { - "description": "Jurisdiction Metadata for kft_289(2020) id c63ac00b-b985-405c-af88-92356d0ba9cf", - "key": "c63ac00b-b985-405c-af88-92356d0ba9cf", - "label": "kft_289(2020) metadata", - "value": "25209" - }, - { - "description": "Jurisdiction Metadata for kft_343(2020) id a361effc-0824-4cfa-adec-bbf74e4ee455", - "key": "a361effc-0824-4cfa-adec-bbf74e4ee455", - "label": "kft_343(2020) metadata", - "value": "25210" - }, - { - "description": "Jurisdiction Metadata for kft_208(2020) id 0a6ed6ab-625a-49b9-8a08-67ff7b990f5b", - "key": "0a6ed6ab-625a-49b9-8a08-67ff7b990f5b", - "label": "kft_208(2020) metadata", - "value": "25211" - }, - { - "description": "Jurisdiction Metadata for kft_110(2020) id 92de3d0e-7973-4877-be7c-36ee1facd02c", - "key": "92de3d0e-7973-4877-be7c-36ee1facd02c", - "label": "kft_110(2020) metadata", - "value": "25212" - }, - { - "description": "Jurisdiction Metadata for kft_41(2020) id 20aba988-422d-4d96-a3ab-fd57620ab1e6", - "key": "20aba988-422d-4d96-a3ab-fd57620ab1e6", - "label": "kft_41(2020) metadata", - "value": "25213" - }, - { - "description": "Jurisdiction Metadata for kft_168(2020) id f9710eb4-d101-4f5e-9148-4fe98a6f6b4d", - "key": "f9710eb4-d101-4f5e-9148-4fe98a6f6b4d", - "label": "kft_168(2020) metadata", - "value": "25214" - }, - { - "description": "Jurisdiction Metadata for kft_275(2020) id 266adc44-4a04-400a-b47e-bb5ea9545240", - "key": "266adc44-4a04-400a-b47e-bb5ea9545240", - "label": "kft_275(2020) metadata", - "value": "25215" - }, - { - "description": "Jurisdiction Metadata for kft_24(2020) id f1f0988b-44e4-4d29-87dc-b9477b519956", - "key": "f1f0988b-44e4-4d29-87dc-b9477b519956", - "label": "kft_24(2020) metadata", - "value": "25216" - }, - { - "description": "Jurisdiction Metadata for kft_213(2020) id 69b7829c-c044-40cc-b07a-4d9de78cc289", - "key": "69b7829c-c044-40cc-b07a-4d9de78cc289", - "label": "kft_213(2020) metadata", - "value": "25217" - }, - { - "description": "Jurisdiction Metadata for kft_311(2020) id c6ccd91d-b179-4b12-9023-4cf2f7c79acf", - "key": "c6ccd91d-b179-4b12-9023-4cf2f7c79acf", - "label": "kft_311(2020) metadata", - "value": "25218" - }, - { - "description": "Jurisdiction Metadata for kft_144(2020) id a614d477-15ce-4dcb-b4ab-05911af0c8cf", - "key": "a614d477-15ce-4dcb-b4ab-05911af0c8cf", - "label": "kft_144(2020) metadata", - "value": "25219" - }, - { - "description": "Jurisdiction Metadata for kft_347(2020) id be63d02d-5bc2-46ae-8fc8-cbfad71511ab", - "key": "be63d02d-5bc2-46ae-8fc8-cbfad71511ab", - "label": "kft_347(2020) metadata", - "value": "25220" - }, - { - "description": "Jurisdiction Metadata for kft_85(2020) id 6287d382-0969-4b3d-aa06-d0dbd71ee188", - "key": "6287d382-0969-4b3d-aa06-d0dbd71ee188", - "label": "kft_85(2020) metadata", - "value": "25221" - }, - { - "description": "Jurisdiction Metadata for kft_227(2020) id 3e4c5bb7-392f-4c27-831b-c91e1a0be81c", - "key": "3e4c5bb7-392f-4c27-831b-c91e1a0be81c", - "label": "kft_227(2020) metadata", - "value": "25222" - }, - { - "description": "Jurisdiction Metadata for kft_336(2020) id 7a37c38d-e137-4d32-b996-712b7220c266", - "key": "7a37c38d-e137-4d32-b996-712b7220c266", - "label": "kft_336(2020) metadata", - "value": "25223" - }, - { - "description": "Jurisdiction Metadata for kft_198(2020) id 457e11f3-bbde-4861-9e21-201404f7e53b", - "key": "457e11f3-bbde-4861-9e21-201404f7e53b", - "label": "kft_198(2020) metadata", - "value": "25224" - }, - { - "description": "Jurisdiction Metadata for kft_290(2020) id f6606b55-4bab-4a6f-a5a6-a129b473b434", - "key": "f6606b55-4bab-4a6f-a5a6-a129b473b434", - "label": "kft_290(2020) metadata", - "value": "25225" - }, - { - "description": "Jurisdiction Metadata for kft_222(2020) id 6d558f1e-0ff4-4f78-af1d-743401aa75b9", - "key": "6d558f1e-0ff4-4f78-af1d-743401aa75b9", - "label": "kft_222(2020) metadata", - "value": "25226" - }, - { - "description": "Jurisdiction Metadata for Chimba Zone id 47b91c53-0611-4e14-a30a-a5957053304a", - "key": "47b91c53-0611-4e14-a30a-a5957053304a", - "label": "Chimba Zone metadata", - "value": "25227" - }, - { - "description": "Jurisdiction Metadata for kft_7(2020) id 5f8bffe7-213a-4a03-8d85-59a075bef403", - "key": "5f8bffe7-213a-4a03-8d85-59a075bef403", - "label": "kft_7(2020) metadata", - "value": "25228" - }, - { - "description": "Jurisdiction Metadata for kft_293(2020) id 0e080313-aab1-4897-a046-510ffc305d80", - "key": "0e080313-aab1-4897-a046-510ffc305d80", - "label": "kft_293(2020) metadata", - "value": "25229" - }, - { - "description": "Jurisdiction Metadata for kft_8(2020) id 93121e37-3f62-4e18-a377-1c6ffccf80ae", - "key": "93121e37-3f62-4e18-a377-1c6ffccf80ae", - "label": "kft_8(2020) metadata", - "value": "25230" - }, - { - "description": "Jurisdiction Metadata for Belu Zone id e420f7b5-b2aa-446a-96f0-335eb6eb662d", - "key": "e420f7b5-b2aa-446a-96f0-335eb6eb662d", - "label": "Belu Zone metadata", - "value": "25231" - }, - { - "description": "Jurisdiction Metadata for kft_4(2020) id c905bc65-d434-4081-bd1a-165b31dbe106", - "key": "c905bc65-d434-4081-bd1a-165b31dbe106", - "label": "kft_4(2020) metadata", - "value": "25232" - }, - { - "description": "Jurisdiction Metadata for Kasheta Zone id 43b6b13d-22e4-47d8-8fab-fd6c19285f88", - "key": "43b6b13d-22e4-47d8-8fab-fd6c19285f88", - "label": "Kasheta Zone metadata", - "value": "25233" - }, - { - "description": "Jurisdiction Metadata for kft_3(2020) id be8a196c-ce9b-4885-8683-20e8562fd1b6", - "key": "be8a196c-ce9b-4885-8683-20e8562fd1b6", - "label": "kft_3(2020) metadata", - "value": "25234" - }, - { - "description": "Jurisdiction Metadata for Mutamuka Zone id bba40e51-e37a-419e-ad4e-52329651446c", - "key": "bba40e51-e37a-419e-ad4e-52329651446c", - "label": "Mutamuka Zone metadata", - "value": "25235" - }, - { - "description": "Jurisdiction Metadata for kft_2(2020) id d0726245-3d0d-4adf-979a-8011e01b2dee", - "key": "d0726245-3d0d-4adf-979a-8011e01b2dee", - "label": "kft_2(2020) metadata", - "value": "25236" - }, - { - "description": "Jurisdiction Metadata for kft_268(2020) id 9f4af6da-b701-43a0-af5b-8d3b9926344c", - "key": "9f4af6da-b701-43a0-af5b-8d3b9926344c", - "label": "kft_268(2020) metadata", - "value": "25237" - }, - { - "description": "Jurisdiction Metadata for kft_340(2020) id df07dff7-5271-4ea4-a4f9-07b02b426f2e", - "key": "df07dff7-5271-4ea4-a4f9-07b02b426f2e", - "label": "kft_340(2020) metadata", - "value": "25238" - }, - { - "description": "Jurisdiction Metadata for kft_339(2020) id ceae9023-2755-474f-98ec-5513cf7b1100", - "key": "ceae9023-2755-474f-98ec-5513cf7b1100", - "label": "kft_339(2020) metadata", - "value": "25239" - }, - { - "description": "Jurisdiction Metadata for kft_327(2020) id d1a9e66a-1b30-4e35-8e7c-613f77854bc7", - "key": "d1a9e66a-1b30-4e35-8e7c-613f77854bc7", - "label": "kft_327(2020) metadata", - "value": "25240" - }, - { - "description": "Jurisdiction Metadata for kft_216(2020) id 658f51ae-d5e5-4114-aef8-5c160ee8f5ce", - "key": "658f51ae-d5e5-4114-aef8-5c160ee8f5ce", - "label": "kft_216(2020) metadata", - "value": "25241" - }, - { - "description": "Jurisdiction Metadata for kft_291(2020) id 281141c8-8459-4891-9841-6908bc5f8056", - "key": "281141c8-8459-4891-9841-6908bc5f8056", - "label": "kft_291(2020) metadata", - "value": "25242" - }, - { - "description": "Jurisdiction Metadata for kft_287(2020) id 19593740-04dd-48d3-869f-54b00a63f79e", - "key": "19593740-04dd-48d3-869f-54b00a63f79e", - "label": "kft_287(2020) metadata", - "value": "25243" - }, - { - "description": "Jurisdiction Metadata for kft_171(2020) id a739cd59-32d5-4e8a-a4ce-561c95a82d3f", - "key": "a739cd59-32d5-4e8a-a4ce-561c95a82d3f", - "label": "kft_171(2020) metadata", - "value": "25244" - }, - { - "description": "Jurisdiction Metadata for kft_145(2020) id f474f974-1810-461b-a022-c4dbdbceb5fb", - "key": "f474f974-1810-461b-a022-c4dbdbceb5fb", - "label": "kft_145(2020) metadata", - "value": "25245" - }, - { - "description": "Jurisdiction Metadata for Shimwilima Zone id 605e9311-71de-4e37-ae9e-6e345ededfdf", - "key": "605e9311-71de-4e37-ae9e-6e345ededfdf", - "label": "Shimwilima Zone metadata", - "value": "25246" - }, - { - "description": "Jurisdiction Metadata for kft_82(2020) id d3c5efd1-4d03-4b72-9896-3da75451d45e", - "key": "d3c5efd1-4d03-4b72-9896-3da75451d45e", - "label": "kft_82(2020) metadata", - "value": "25247" - }, - { - "description": "Jurisdiction Metadata for kft_178(2020) id 970184a5-bc15-4f9c-8d9f-b07e2150c044", - "key": "970184a5-bc15-4f9c-8d9f-b07e2150c044", - "label": "kft_178(2020) metadata", - "value": "25248" - }, - { - "description": "Jurisdiction Metadata for kft_310(2020) id da39a225-55ef-4898-884c-3c9410597b8d", - "key": "da39a225-55ef-4898-884c-3c9410597b8d", - "label": "kft_310(2020) metadata", - "value": "25249" - }, - { - "description": "Jurisdiction Metadata for kft_335(2020) id 26f4fe7f-8880-452c-93b7-25844d55e8ca", - "key": "26f4fe7f-8880-452c-93b7-25844d55e8ca", - "label": "kft_335(2020) metadata", - "value": "25250" - }, - { - "description": "Jurisdiction Metadata for kft_149(2020) id b9f1eb6c-fafd-4286-a2fb-c39428d9d90b", - "key": "b9f1eb6c-fafd-4286-a2fb-c39428d9d90b", - "label": "kft_149(2020) metadata", - "value": "25251" - }, - { - "description": "Jurisdiction Metadata for kft_176(2020) id cf3c75e2-3834-46a7-be78-9db561c2bf28", - "key": "cf3c75e2-3834-46a7-be78-9db561c2bf28", - "label": "kft_176(2020) metadata", - "value": "25252" - }, - { - "description": "Jurisdiction Metadata for kft_13(2020) id d5e18a59-c077-4b4d-b82e-3f2d68299c96", - "key": "d5e18a59-c077-4b4d-b82e-3f2d68299c96", - "label": "kft_13(2020) metadata", - "value": "25253" - }, - { - "description": "Jurisdiction Metadata for kft_338(2020) id 2508c247-c972-4f67-a3cc-3e904389f988", - "key": "2508c247-c972-4f67-a3cc-3e904389f988", - "label": "kft_338(2020) metadata", - "value": "25254" - }, - { - "description": "Jurisdiction Metadata for kft_246(2020) id aba4d6df-0fa9-4cc7-a0c8-216cafb1fb68", - "key": "aba4d6df-0fa9-4cc7-a0c8-216cafb1fb68", - "label": "kft_246(2020) metadata", - "value": "25255" - }, - { - "description": "Jurisdiction Metadata for kft_297(2020) id 716785c3-99e4-41af-9eb8-37673d27eab9", - "key": "716785c3-99e4-41af-9eb8-37673d27eab9", - "label": "kft_297(2020) metadata", - "value": "25256" - }, - { - "description": "Jurisdiction Metadata for kft_126(2020) id 8ac7828c-2ac2-453c-a9ad-59f7947218e8", - "key": "8ac7828c-2ac2-453c-a9ad-59f7947218e8", - "label": "kft_126(2020) metadata", - "value": "25257" - }, - { - "description": "Jurisdiction Metadata for kft_48(2020) id 7f32ebfa-86d7-4009-bbdc-73e9e18a2abb", - "key": "7f32ebfa-86d7-4009-bbdc-73e9e18a2abb", - "label": "kft_48(2020) metadata", - "value": "25258" - }, - { - "description": "Jurisdiction Metadata for kft_167(2020) id 0a68e77a-8566-4f2f-b257-431b5b7bbbdd", - "key": "0a68e77a-8566-4f2f-b257-431b5b7bbbdd", - "label": "kft_167(2020) metadata", - "value": "25259" - }, - { - "description": "Jurisdiction Metadata for kft_120(2020) id 078cced0-a891-4af3-8922-252c36b2d8ad", - "key": "078cced0-a891-4af3-8922-252c36b2d8ad", - "label": "kft_120(2020) metadata", - "value": "25260" - }, - { - "description": "Jurisdiction Metadata for kft_266(2020) id 2acc12a7-fbfe-452b-a62b-f2b266a3fd6a", - "key": "2acc12a7-fbfe-452b-a62b-f2b266a3fd6a", - "label": "kft_266(2020) metadata", - "value": "25261" - }, - { - "description": "Jurisdiction Metadata for kft_174(2020) id 5dfd1d65-c383-4e33-8530-1bb34576ba1e", - "key": "5dfd1d65-c383-4e33-8530-1bb34576ba1e", - "label": "kft_174(2020) metadata", - "value": "25262" - }, - { - "description": "Jurisdiction Metadata for kft_64(2020) id 778e23ad-9d3d-44a6-b6d0-42bf9f6a957e", - "key": "778e23ad-9d3d-44a6-b6d0-42bf9f6a957e", - "label": "kft_64(2020) metadata", - "value": "25263" - }, - { - "description": "Jurisdiction Metadata for kft_345(2020) id 79cb0aaf-980e-42e0-90bb-d8a219543816", - "key": "79cb0aaf-980e-42e0-90bb-d8a219543816", - "label": "kft_345(2020) metadata", - "value": "25264" - }, - { - "description": "Jurisdiction Metadata for kft_133(2020) id e7f4f2c2-bb01-402b-97da-90965ecd72c4", - "key": "e7f4f2c2-bb01-402b-97da-90965ecd72c4", - "label": "kft_133(2020) metadata", - "value": "25265" - }, - { - "description": "Jurisdiction Metadata for kft_301(2020) id d6b55cc4-eef1-4830-92a6-2da51a102296", - "key": "d6b55cc4-eef1-4830-92a6-2da51a102296", - "label": "kft_301(2020) metadata", - "value": "25266" - }, - { - "description": "Jurisdiction Metadata for kft_191(2020) id 3925e837-f9e8-44a7-b413-5ce327653d9f", - "key": "3925e837-f9e8-44a7-b413-5ce327653d9f", - "label": "kft_191(2020) metadata", - "value": "25267" - }, - { - "description": "Jurisdiction Metadata for kft_100(2020) id 86d3910a-2110-4f38-a06a-9d795e8717b3", - "key": "86d3910a-2110-4f38-a06a-9d795e8717b3", - "label": "kft_100(2020) metadata", - "value": "25268" - }, - { - "description": "Jurisdiction Metadata for kft_197(2020) id b4d11e50-9967-459e-85cf-ddf4ec4fd814", - "key": "b4d11e50-9967-459e-85cf-ddf4ec4fd814", - "label": "kft_197(2020) metadata", - "value": "25269" - }, - { - "description": "Jurisdiction Metadata for kft_90(2020) id 4d11e594-538f-4eac-9028-9bb6c7723c4d", - "key": "4d11e594-538f-4eac-9028-9bb6c7723c4d", - "label": "kft_90(2020) metadata", - "value": "25270" - }, - { - "description": "Jurisdiction Metadata for kft_247(2020) id 8638677c-1a9f-4033-8032-c0ee56c83a60", - "key": "8638677c-1a9f-4033-8032-c0ee56c83a60", - "label": "kft_247(2020) metadata", - "value": "25271" - }, - { - "description": "Jurisdiction Metadata for kft_55(2020) id 037b8996-0c23-4d25-940c-51abb0624a01", - "key": "037b8996-0c23-4d25-940c-51abb0624a01", - "label": "kft_55(2020) metadata", - "value": "25272" - }, - { - "description": "Jurisdiction Metadata for kft_57(2020) id cfe0c7f9-040a-4b7c-90c8-41090a9d1f41", - "key": "cfe0c7f9-040a-4b7c-90c8-41090a9d1f41", - "label": "kft_57(2020) metadata", - "value": "25273" - }, - { - "description": "Jurisdiction Metadata for kft_314(2020) id ff4fa62f-4df3-40a5-a8a8-f99db28c79a0", - "key": "ff4fa62f-4df3-40a5-a8a8-f99db28c79a0", - "label": "kft_314(2020) metadata", - "value": "25274" - }, - { - "description": "Jurisdiction Metadata for kft_43(2020) id b66c1266-958b-4418-96b5-cff4234cd028", - "key": "b66c1266-958b-4418-96b5-cff4234cd028", - "label": "kft_43(2020) metadata", - "value": "25275" - }, - { - "description": "Jurisdiction Metadata for kft_304(2020) id 8ce00768-0452-4be3-9407-feec4f25c905", - "key": "8ce00768-0452-4be3-9407-feec4f25c905", - "label": "kft_304(2020) metadata", - "value": "25276" - }, - { - "description": "Jurisdiction Metadata for kft_11(2020) id 0817ba2b-d14d-497f-9ba5-4c74f8205f01", - "key": "0817ba2b-d14d-497f-9ba5-4c74f8205f01", - "label": "kft_11(2020) metadata", - "value": "25277" - }, - { - "description": "Jurisdiction Metadata for kft_151(2020) id 05f20023-8136-476e-9713-c55583f80db8", - "key": "05f20023-8136-476e-9713-c55583f80db8", - "label": "kft_151(2020) metadata", - "value": "25278" - }, - { - "description": "Jurisdiction Metadata for kft_267(2020) id a6688b80-8b70-4f63-a7ec-d7505d521d47", - "key": "a6688b80-8b70-4f63-a7ec-d7505d521d47", - "label": "kft_267(2020) metadata", - "value": "25279" - }, - { - "description": "Jurisdiction Metadata for kft_125(2020) id 619a2d82-8ef1-4003-9a98-ef6ca97193e8", - "key": "619a2d82-8ef1-4003-9a98-ef6ca97193e8", - "label": "kft_125(2020) metadata", - "value": "25280" - }, - { - "description": "Jurisdiction Metadata for kft_134(2020) id ecf2f51f-2332-45b4-a11c-a135fa4aaf8f", - "key": "ecf2f51f-2332-45b4-a11c-a135fa4aaf8f", - "label": "kft_134(2020) metadata", - "value": "25281" - }, - { - "description": "Jurisdiction Metadata for kft_40(2020) id c867e314-1a39-4bbb-b29a-481fe6bf8cf9", - "key": "c867e314-1a39-4bbb-b29a-481fe6bf8cf9", - "label": "kft_40(2020) metadata", - "value": "25282" - }, - { - "description": "Jurisdiction Metadata for kft_162(2020) id be6c779a-0051-453e-ac7e-87c2e3ef93b7", - "key": "be6c779a-0051-453e-ac7e-87c2e3ef93b7", - "label": "kft_162(2020) metadata", - "value": "25283" - }, - { - "description": "Jurisdiction Metadata for kft_221(2020) id 8a1373d3-87f6-4bd0-8c6e-de9c48334050", - "key": "8a1373d3-87f6-4bd0-8c6e-de9c48334050", - "label": "kft_221(2020) metadata", - "value": "25284" - }, - { - "description": "Jurisdiction Metadata for kft_172(2020) id 4d864f8e-b8bb-4d73-8baf-2a45dfbec01c", - "key": "4d864f8e-b8bb-4d73-8baf-2a45dfbec01c", - "label": "kft_172(2020) metadata", - "value": "25285" - }, - { - "description": "Jurisdiction Metadata for kft_325(2020) id 05fa85fc-4621-4fce-9129-8e1d53a837bc", - "key": "05fa85fc-4621-4fce-9129-8e1d53a837bc", - "label": "kft_325(2020) metadata", - "value": "25286" - }, - { - "description": "Jurisdiction Metadata for kft_317(2020) id 2feb1edc-9a3b-4de6-852f-db3bc8b7fb96", - "key": "2feb1edc-9a3b-4de6-852f-db3bc8b7fb96", - "label": "kft_317(2020) metadata", - "value": "25287" - }, - { - "description": "Jurisdiction Metadata for kft_137(2020) id 46d108dd-1ced-4034-9292-efafd852fdf1", - "key": "46d108dd-1ced-4034-9292-efafd852fdf1", - "label": "kft_137(2020) metadata", - "value": "25288" - }, - { - "description": "Jurisdiction Metadata for kft_97(2020) id 335d9476-efd9-404e-9b94-bc2a98e6be78", - "key": "335d9476-efd9-404e-9b94-bc2a98e6be78", - "label": "kft_97(2020) metadata", - "value": "25289" - }, - { - "description": "Jurisdiction Metadata for kft_229(2020) id f11711e8-8e7b-4a9b-9d43-4af6739350c3", - "key": "f11711e8-8e7b-4a9b-9d43-4af6739350c3", - "label": "kft_229(2020) metadata", - "value": "25290" - }, - { - "description": "Jurisdiction Metadata for kft_319(2020) id 18640669-4e41-4b00-acff-4a8a70373c08", - "key": "18640669-4e41-4b00-acff-4a8a70373c08", - "label": "kft_319(2020) metadata", - "value": "25291" - }, - { - "description": "Jurisdiction Metadata for kft_296(2020) id ef981c6d-ce38-4e8c-b7b2-16a2ebe693c0", - "key": "ef981c6d-ce38-4e8c-b7b2-16a2ebe693c0", - "label": "kft_296(2020) metadata", - "value": "25292" - }, - { - "description": "Jurisdiction Metadata for kft_334(2020) id 51e00035-c41a-451c-8748-76ba2000983a", - "key": "51e00035-c41a-451c-8748-76ba2000983a", - "label": "kft_334(2020) metadata", - "value": "25293" - }, - { - "description": "Jurisdiction Metadata for kft_333(2020) id 1110f3e2-2cc7-49ea-8815-0ece3f19bdc8", - "key": "1110f3e2-2cc7-49ea-8815-0ece3f19bdc8", - "label": "kft_333(2020) metadata", - "value": "25294" - }, - { - "description": "Jurisdiction Metadata for kft_44(2020) id a0ea8bd4-2431-4a76-9919-98ddac6b3b3d", - "key": "a0ea8bd4-2431-4a76-9919-98ddac6b3b3d", - "label": "kft_44(2020) metadata", - "value": "25295" - }, - { - "description": "Jurisdiction Metadata for Chimpulumba Zone id 0cef375c-1697-49c3-949b-e18961acb562", - "key": "0cef375c-1697-49c3-949b-e18961acb562", - "label": "Chimpulumba Zone metadata", - "value": "25296" - }, - { - "description": "Jurisdiction Metadata for kft_6(2020) id 146d8f86-7d41-47ed-a29b-788d0866fa1a", - "key": "146d8f86-7d41-47ed-a29b-788d0866fa1a", - "label": "kft_6(2020) metadata", - "value": "25297" - }, - { - "description": "Jurisdiction Metadata for kft_147(2020) id 36582423-7b15-49eb-86ff-4bbace603003", - "key": "36582423-7b15-49eb-86ff-4bbace603003", - "label": "kft_147(2020) metadata", - "value": "25298" - }, - { - "description": "Jurisdiction Metadata for Mancheni Zone id 4dafa568-0567-4d83-9536-a4c3229534fa", - "key": "4dafa568-0567-4d83-9536-a4c3229534fa", - "label": "Mancheni Zone metadata", - "value": "25299" - }, - { - "description": "Jurisdiction Metadata for kft_28(2020) id 074d1ba3-7938-433d-8884-9f2f85a5c86e", - "key": "074d1ba3-7938-433d-8884-9f2f85a5c86e", - "label": "kft_28(2020) metadata", - "value": "25300" - }, - { - "description": "Jurisdiction Metadata for kft_270(2020) id 8d058c09-6749-425c-8e4b-89fe5e4ae2d8", - "key": "8d058c09-6749-425c-8e4b-89fe5e4ae2d8", - "label": "kft_270(2020) metadata", - "value": "25301" - }, - { - "description": "Jurisdiction Metadata for kft_260(2020) id 40adedf5-0ce9-42a0-96c2-89268152c520", - "key": "40adedf5-0ce9-42a0-96c2-89268152c520", - "label": "kft_260(2020) metadata", - "value": "25302" - }, - { - "description": "Jurisdiction Metadata for kft_94(2020) id 6570ad5e-a1d0-45c7-9525-2565b71ed960", - "key": "6570ad5e-a1d0-45c7-9525-2565b71ed960", - "label": "kft_94(2020) metadata", - "value": "25303" - }, - { - "description": "Jurisdiction Metadata for kft_298(2020) id b2f02a82-724b-497b-b184-c1ca891eda1f", - "key": "b2f02a82-724b-497b-b184-c1ca891eda1f", - "label": "kft_298(2020) metadata", - "value": "25304" - }, - { - "description": "Jurisdiction Metadata for kft_59(2020) id b7210565-5c35-4f23-b12e-dbfada721e51", - "key": "b7210565-5c35-4f23-b12e-dbfada721e51", - "label": "kft_59(2020) metadata", - "value": "25305" - }, - { - "description": "Jurisdiction Metadata for kft_58(2020) id 6aea4f5f-ea75-4355-a385-6da95708aa51", - "key": "6aea4f5f-ea75-4355-a385-6da95708aa51", - "label": "kft_58(2020) metadata", - "value": "25306" - }, - { - "description": "Jurisdiction Metadata for kft_63(2020) id a728396d-ecee-478d-9fc5-7be7b9363217", - "key": "a728396d-ecee-478d-9fc5-7be7b9363217", - "label": "kft_63(2020) metadata", - "value": "25307" - }, - { - "description": "Jurisdiction Metadata for kft_226(2020) id b6177ce7-cad0-4f81-a819-9ada32cf5ece", - "key": "b6177ce7-cad0-4f81-a819-9ada32cf5ece", - "label": "kft_226(2020) metadata", - "value": "25308" - }, - { - "description": "Jurisdiction Metadata for kft_183(2020) id 5e203579-de81-4bf6-b203-41f6bcd6d3f0", - "key": "5e203579-de81-4bf6-b203-41f6bcd6d3f0", - "label": "kft_183(2020) metadata", - "value": "25309" - }, - { - "description": "Jurisdiction Metadata for kft_182(2020) id 17f3ae39-4810-4e53-874a-f72e99ec17c2", - "key": "17f3ae39-4810-4e53-874a-f72e99ec17c2", - "label": "kft_182(2020) metadata", - "value": "25310" - }, - { - "description": "Jurisdiction Metadata for kft_199(2020) id 1b8323b8-28fd-472f-9ba2-4d9fd69467f7", - "key": "1b8323b8-28fd-472f-9ba2-4d9fd69467f7", - "label": "kft_199(2020) metadata", - "value": "25311" - }, - { - "description": "Jurisdiction Metadata for kft_161(2020) id f2ae9561-79a8-46da-95c1-b80afb760462", - "key": "f2ae9561-79a8-46da-95c1-b80afb760462", - "label": "kft_161(2020) metadata", - "value": "25312" - }, - { - "description": "Jurisdiction Metadata for kft_112(2020) id 674313aa-dbd1-428d-b0d8-2ce9b64bee93", - "key": "674313aa-dbd1-428d-b0d8-2ce9b64bee93", - "label": "kft_112(2020) metadata", - "value": "25313" - }, - { - "description": "Jurisdiction Metadata for kft_224(2020) id feafd748-fa6a-44c6-b82f-bae0915eb6d8", - "key": "feafd748-fa6a-44c6-b82f-bae0915eb6d8", - "label": "kft_224(2020) metadata", - "value": "25314" - }, - { - "description": "Jurisdiction Metadata for kft_284(2020) id 200dd1c2-02b3-4626-a1a4-5343cbffe252", - "key": "200dd1c2-02b3-4626-a1a4-5343cbffe252", - "label": "kft_284(2020) metadata", - "value": "25315" - }, - { - "description": "Jurisdiction Metadata for kft_255(2020) id ea7a9e10-8fcc-44fc-b07b-3df11950d0d2", - "key": "ea7a9e10-8fcc-44fc-b07b-3df11950d0d2", - "label": "kft_255(2020) metadata", - "value": "25316" - }, - { - "description": "Jurisdiction Metadata for kft_170(2020) id 8affdda1-6496-41d3-9028-41113592c068", - "key": "8affdda1-6496-41d3-9028-41113592c068", - "label": "kft_170(2020) metadata", - "value": "25317" - }, - { - "description": "Jurisdiction Metadata for kft_185(2020) id 72339480-587a-43b6-bfb0-25437687eeba", - "key": "72339480-587a-43b6-bfb0-25437687eeba", - "label": "kft_185(2020) metadata", - "value": "25318" - }, - { - "description": "Jurisdiction Metadata for Kafwala Zone id 6fc2902e-ffa7-4bf7-8a5a-d3fe798a0dec", - "key": "6fc2902e-ffa7-4bf7-8a5a-d3fe798a0dec", - "label": "Kafwala Zone metadata", - "value": "25319" - }, - { - "description": "Jurisdiction Metadata for kft_1(2020) id 8e8164bb-9c69-44f0-9f9d-a2cb8602e65b", - "key": "8e8164bb-9c69-44f0-9f9d-a2cb8602e65b", - "label": "kft_1(2020) metadata", - "value": "25320" - }, - { - "description": "Jurisdiction Metadata for kft_286(2020) id 06d03efd-b5f9-4c75-b8d6-499f740722cd", - "key": "06d03efd-b5f9-4c75-b8d6-499f740722cd", - "label": "kft_286(2020) metadata", - "value": "25321" - }, - { - "description": "Jurisdiction Metadata for kft_244(2020) id 222bfa62-2d1a-4752-8d4b-16d0c5776d89", - "key": "222bfa62-2d1a-4752-8d4b-16d0c5776d89", - "label": "kft_244(2020) metadata", - "value": "25322" - }, - { - "description": "Jurisdiction Metadata for kft_83(2020) id 167efc44-c694-4dd7-86e9-91ac0a8e94bd", - "key": "167efc44-c694-4dd7-86e9-91ac0a8e94bd", - "label": "kft_83(2020) metadata", - "value": "25323" - }, - { - "description": "Jurisdiction Metadata for kft_346(2020) id 9339eae8-edf9-4c0c-9b4c-af88f12c3090", - "key": "9339eae8-edf9-4c0c-9b4c-af88f12c3090", - "label": "kft_346(2020) metadata", - "value": "25324" - }, - { - "description": "Jurisdiction Metadata for kft_261(2020) id 2d8b50d1-c377-4053-8db3-e56ed48b51e2", - "key": "2d8b50d1-c377-4053-8db3-e56ed48b51e2", - "label": "kft_261(2020) metadata", - "value": "25325" - }, - { - "description": "Jurisdiction Metadata for kft_186(2020) id c36295e6-189f-4aed-b8a8-022d92388c26", - "key": "c36295e6-189f-4aed-b8a8-022d92388c26", - "label": "kft_186(2020) metadata", - "value": "25326" - }, - { - "description": "Jurisdiction Metadata for kft_245(2020) id 6709cc44-7b55-4589-ba9b-b85b6b54e2d3", - "key": "6709cc44-7b55-4589-ba9b-b85b6b54e2d3", - "label": "kft_245(2020) metadata", - "value": "25327" - }, - { - "description": "Jurisdiction Metadata for kft_309(2020) id 7820ebef-a17b-477c-b1bc-4d1ab956f355", - "key": "7820ebef-a17b-477c-b1bc-4d1ab956f355", - "label": "kft_309(2020) metadata", - "value": "25328" - }, - { - "description": "Jurisdiction Metadata for kft_262(2020) id 8fb53076-ce94-4e62-b248-5cff0aba6794", - "key": "8fb53076-ce94-4e62-b248-5cff0aba6794", - "label": "kft_262(2020) metadata", - "value": "25329" - }, - { - "description": "Jurisdiction Metadata for Shemanueli Zone id b31323cd-13ec-4cbe-be11-8720b1c4d651", - "key": "b31323cd-13ec-4cbe-be11-8720b1c4d651", - "label": "Shemanueli Zone metadata", - "value": "25330" - }, - { - "description": "Jurisdiction Metadata for kft_154(2020) id b4a14017-b31a-4c52-8c63-4ca445c9cc5e", - "key": "b4a14017-b31a-4c52-8c63-4ca445c9cc5e", - "label": "kft_154(2020) metadata", - "value": "25331" - }, - { - "description": "Jurisdiction Metadata for kft_313(2020) id 09dea480-421b-475b-84a7-8ad4ccb3af8d", - "key": "09dea480-421b-475b-84a7-8ad4ccb3af8d", - "label": "kft_313(2020) metadata", - "value": "25332" - }, - { - "description": "Jurisdiction Metadata for kft_205(2020) id a6feeab3-236a-477a-b100-2790d545f38b", - "key": "a6feeab3-236a-477a-b100-2790d545f38b", - "label": "kft_205(2020) metadata", - "value": "25333" - }, - { - "description": "Jurisdiction Metadata for kft_118(2020) id 79d8adad-7092-49d2-8bd7-742a3d349c71", - "key": "79d8adad-7092-49d2-8bd7-742a3d349c71", - "label": "kft_118(2020) metadata", - "value": "25334" - }, - { - "description": "Jurisdiction Metadata for kft_69(2020) id 39ae4684-d915-47e9-8284-d5d9f3980a76", - "key": "39ae4684-d915-47e9-8284-d5d9f3980a76", - "label": "kft_69(2020) metadata", - "value": "25335" - }, - { - "description": "Jurisdiction Metadata for kft_146(2020) id d1fcc559-0d18-44d4-88c5-329a3143d4fc", - "key": "d1fcc559-0d18-44d4-88c5-329a3143d4fc", - "label": "kft_146(2020) metadata", - "value": "25336" - }, - { - "description": "Jurisdiction Metadata for kft_194(2020) id 3e5d8d9d-1966-4824-9c21-31e3b8d4ffdf", - "key": "3e5d8d9d-1966-4824-9c21-31e3b8d4ffdf", - "label": "kft_194(2020) metadata", - "value": "25337" - }, - { - "description": "Jurisdiction Metadata for kft_265(2020) id 44593a3c-8772-4d56-90ed-5b5d798dd7ae", - "key": "44593a3c-8772-4d56-90ed-5b5d798dd7ae", - "label": "kft_265(2020) metadata", - "value": "25338" - }, - { - "description": "Jurisdiction Metadata for kft_61(2020) id 91033525-94dd-4640-9347-e827e602804c", - "key": "91033525-94dd-4640-9347-e827e602804c", - "label": "kft_61(2020) metadata", - "value": "25339" - }, - { - "description": "Jurisdiction Metadata for kft_206(2020) id 8dd1fc94-20c1-4ebc-a336-a7066c265966", - "key": "8dd1fc94-20c1-4ebc-a336-a7066c265966", - "label": "kft_206(2020) metadata", - "value": "25340" - }, - { - "description": "Jurisdiction Metadata for kft_121(2020) id 4aebd765-23b3-40ba-b4e8-e16f837ed376", - "key": "4aebd765-23b3-40ba-b4e8-e16f837ed376", - "label": "kft_121(2020) metadata", - "value": "25341" - }, - { - "description": "Jurisdiction Metadata for kft_331(2020) id bce41335-e175-43a0-9e8a-8255cb2177ef", - "key": "bce41335-e175-43a0-9e8a-8255cb2177ef", - "label": "kft_331(2020) metadata", - "value": "25342" - }, - { - "description": "Jurisdiction Metadata for kft_132(2020) id a0651b27-0752-4fde-a302-79a21bdcb848", - "key": "a0651b27-0752-4fde-a302-79a21bdcb848", - "label": "kft_132(2020) metadata", - "value": "25343" - }, - { - "description": "Jurisdiction Metadata for kft_190(2020) id cc61f89b-b453-4c78-a986-50edc2236cb7", - "key": "cc61f89b-b453-4c78-a986-50edc2236cb7", - "label": "kft_190(2020) metadata", - "value": "25344" - }, - { - "description": "Jurisdiction Metadata for kft_337(2020) id 43fe23fa-63d1-4710-9a04-c0402395c803", - "key": "43fe23fa-63d1-4710-9a04-c0402395c803", - "label": "kft_337(2020) metadata", - "value": "25345" - }, - { - "description": "Jurisdiction Metadata for kft_152(2020) id a11fb2f5-2011-45aa-ba50-186550ec6293", - "key": "a11fb2f5-2011-45aa-ba50-186550ec6293", - "label": "kft_152(2020) metadata", - "value": "25346" - }, - { - "description": "Jurisdiction Metadata for kft_308(2020) id 7950e827-50cd-4280-b16e-27e6a0df65c7", - "key": "7950e827-50cd-4280-b16e-27e6a0df65c7", - "label": "kft_308(2020) metadata", - "value": "25347" - }, - { - "description": "Jurisdiction Metadata for kft_17(2020) id 267301fe-82a2-4180-a199-fd9fdaab7191", - "key": "267301fe-82a2-4180-a199-fd9fdaab7191", - "label": "kft_17(2020) metadata", - "value": "25348" - }, - { - "description": "Jurisdiction Metadata for kft_281(2020) id 5e9419d7-1f7f-414e-9ccc-56ae8112fc25", - "key": "5e9419d7-1f7f-414e-9ccc-56ae8112fc25", - "label": "kft_281(2020) metadata", - "value": "25349" - }, - { - "description": "Jurisdiction Metadata for kft_150(2020) id 88d41fcb-029e-4d80-a7e4-5e0e01f42be7", - "key": "88d41fcb-029e-4d80-a7e4-5e0e01f42be7", - "label": "kft_150(2020) metadata", - "value": "25350" - }, - { - "description": "Jurisdiction Metadata for kft_107(2020) id 295dcc58-9f2c-4298-9492-1ab9856c4de4", - "key": "295dcc58-9f2c-4298-9492-1ab9856c4de4", - "label": "kft_107(2020) metadata", - "value": "25351" - }, - { - "description": "Jurisdiction Metadata for kft_84(2020) id 2ac58b2d-c821-4a2c-9e26-33d959bc4ccc", - "key": "2ac58b2d-c821-4a2c-9e26-33d959bc4ccc", - "label": "kft_84(2020) metadata", - "value": "25352" - }, - { - "description": "Jurisdiction Metadata for kft_321(2020) id 581ecc45-f78f-4f54-b69b-af39c33d6cba", - "key": "581ecc45-f78f-4f54-b69b-af39c33d6cba", - "label": "kft_321(2020) metadata", - "value": "25353" - }, - { - "description": "Jurisdiction Metadata for kft_214(2020) id 75de15ff-db69-424a-845d-23ec9e28ff41", - "key": "75de15ff-db69-424a-845d-23ec9e28ff41", - "label": "kft_214(2020) metadata", - "value": "25354" - }, - { - "description": "Jurisdiction Metadata for kft_330(2020) id bb6c27bb-4b66-4df7-836a-6a09c6f68d49", - "key": "bb6c27bb-4b66-4df7-836a-6a09c6f68d49", - "label": "kft_330(2020) metadata", - "value": "25355" - }, - { - "description": "Jurisdiction Metadata for kft_250(2020) id df80fbe5-4255-4782-b585-8cb55ab11ec6", - "key": "df80fbe5-4255-4782-b585-8cb55ab11ec6", - "label": "kft_250(2020) metadata", - "value": "25356" - }, - { - "description": "Jurisdiction Metadata for kft_114(2020) id ddf37d19-1d34-4b7a-8ebb-600436fb81c2", - "key": "ddf37d19-1d34-4b7a-8ebb-600436fb81c2", - "label": "kft_114(2020) metadata", - "value": "25357" - }, - { - "description": "Jurisdiction Metadata for kft_249(2020) id e2e957f5-e732-44d9-b091-31c34cc337f8", - "key": "e2e957f5-e732-44d9-b091-31c34cc337f8", - "label": "kft_249(2020) metadata", - "value": "25358" - }, - { - "description": "Jurisdiction Metadata for kft_253(2020) id 1a3731aa-7907-402f-8f4b-539925ef02f3", - "key": "1a3731aa-7907-402f-8f4b-539925ef02f3", - "label": "kft_253(2020) metadata", - "value": "25359" - }, - { - "description": "Jurisdiction Metadata for kft_15(2020) id c01ed746-91ee-4d46-a762-13434299914a", - "key": "c01ed746-91ee-4d46-a762-13434299914a", - "label": "kft_15(2020) metadata", - "value": "25360" - }, - { - "description": "Jurisdiction Metadata for kft_31(2020) id 2e24212e-2ef7-45b4-b7cc-f3858a68c185", - "key": "2e24212e-2ef7-45b4-b7cc-f3858a68c185", - "label": "kft_31(2020) metadata", - "value": "25361" - }, - { - "description": "Jurisdiction Metadata for kft_292(2020) id e902e709-3daf-4b02-8b2f-150923752277", - "key": "e902e709-3daf-4b02-8b2f-150923752277", - "label": "kft_292(2020) metadata", - "value": "25362" - }, - { - "description": "Jurisdiction Metadata for kft_322(2020) id b804ba3a-6fe6-4404-8866-ed87d60c4694", - "key": "b804ba3a-6fe6-4404-8866-ed87d60c4694", - "label": "kft_322(2020) metadata", - "value": "25363" - }, - { - "description": "Jurisdiction Metadata for kft_60(2020) id 7304e19f-0e0a-4cad-9f3f-306b23911eb7", - "key": "7304e19f-0e0a-4cad-9f3f-306b23911eb7", - "label": "kft_60(2020) metadata", - "value": "25364" - }, - { - "description": "Jurisdiction Metadata for kft_54(2020) id b1a90106-62a6-4959-a1a4-5829602ebf14", - "key": "b1a90106-62a6-4959-a1a4-5829602ebf14", - "label": "kft_54(2020) metadata", - "value": "25365" - }, - { - "description": "Jurisdiction Metadata for kft_12(2020) id 24368207-2666-4102-8322-bf39c4d5fafd", - "key": "24368207-2666-4102-8322-bf39c4d5fafd", - "label": "kft_12(2020) metadata", - "value": "25366" - }, - { - "description": "Jurisdiction Metadata for kft_177(2020) id fab1f774-7185-452a-9ef7-a575d4f4c611", - "key": "fab1f774-7185-452a-9ef7-a575d4f4c611", - "label": "kft_177(2020) metadata", - "value": "25367" - }, - { - "description": "Jurisdiction Metadata for kft_282(2020) id 51898c41-8053-424a-9983-326e1612c109", - "key": "51898c41-8053-424a-9983-326e1612c109", - "label": "kft_282(2020) metadata", - "value": "25368" - }, - { - "description": "Jurisdiction Metadata for kft_18(2020) id 323cac3b-cc8d-4b13-8fd4-a801840946f7", - "key": "323cac3b-cc8d-4b13-8fd4-a801840946f7", - "label": "kft_18(2020) metadata", - "value": "25369" - }, - { - "description": "Jurisdiction Metadata for kft_248(2020) id ff494b0c-a673-41e3-ad4e-fd26af5eeff5", - "key": "ff494b0c-a673-41e3-ad4e-fd26af5eeff5", - "label": "kft_248(2020) metadata", - "value": "25370" - }, - { - "description": "Jurisdiction Metadata for kft_89(2020) id 040c940e-1693-401c-975c-97f0e8d0be73", - "key": "040c940e-1693-401c-975c-97f0e8d0be73", - "label": "kft_89(2020) metadata", - "value": "25371" - }, - { - "description": "Jurisdiction Metadata for kft_207(2020) id 8dd1a4f0-416d-4ca4-8f71-d1b6b5b83f5d", - "key": "8dd1a4f0-416d-4ca4-8f71-d1b6b5b83f5d", - "label": "kft_207(2020) metadata", - "value": "25372" - }, - { - "description": "Jurisdiction Metadata for kft_211(2020) id 147c3e00-b4bb-4961-8bc7-54546ebddb2d", - "key": "147c3e00-b4bb-4961-8bc7-54546ebddb2d", - "label": "kft_211(2020) metadata", - "value": "25373" - }, - { - "description": "Jurisdiction Metadata for kft_332(2020) id 023c4ebf-738d-4cba-b182-9208673646c1", - "key": "023c4ebf-738d-4cba-b182-9208673646c1", - "label": "kft_332(2020) metadata", - "value": "25374" - }, - { - "description": "Jurisdiction Metadata for kft_295(2020) id d36ecbfe-7ea3-4fba-9a76-5987da26b1ea", - "key": "d36ecbfe-7ea3-4fba-9a76-5987da26b1ea", - "label": "kft_295(2020) metadata", - "value": "25375" - }, - { - "description": "Jurisdiction Metadata for kft_280(2020) id 10ca4922-b1b7-45d3-bb89-cbed12d6a35c", - "key": "10ca4922-b1b7-45d3-bb89-cbed12d6a35c", - "label": "kft_280(2020) metadata", - "value": "25376" - }, - { - "description": "Jurisdiction Metadata for kft_212(2020) id aed32141-0f65-4819-9bde-4d98c3e880bb", - "key": "aed32141-0f65-4819-9bde-4d98c3e880bb", - "label": "kft_212(2020) metadata", - "value": "25377" - }, - { - "description": "Jurisdiction Metadata for kft_251(2020) id d6faed2a-189f-49b6-873a-cee3067fe6cb", - "key": "d6faed2a-189f-49b6-873a-cee3067fe6cb", - "label": "kft_251(2020) metadata", - "value": "25378" - }, - { - "description": "Jurisdiction Metadata for kft_252(2020) id 74f33210-2d81-473d-a27b-3255c99d32c9", - "key": "74f33210-2d81-473d-a27b-3255c99d32c9", - "label": "kft_252(2020) metadata", - "value": "25379" - }, - { - "description": "Jurisdiction Metadata for kft_86(2020) id 7267c7b8-1f23-483c-b04d-3bfca5ee384a", - "key": "7267c7b8-1f23-483c-b04d-3bfca5ee384a", - "label": "kft_86(2020) metadata", - "value": "25380" - }, - { - "description": "Jurisdiction Metadata for kft_254(2020) id e2110ee8-a822-461d-a369-f2bf8a168f3d", - "key": "e2110ee8-a822-461d-a369-f2bf8a168f3d", - "label": "kft_254(2020) metadata", - "value": "25381" - }, - { - "description": "Jurisdiction Metadata for kft_169(2020) id f8410624-adcd-45d8-8e84-74f741df850f", - "key": "f8410624-adcd-45d8-8e84-74f741df850f", - "label": "kft_169(2020) metadata", - "value": "25382" - }, - { - "description": "Jurisdiction Metadata for kft_288(2020) id b292438b-c80b-443c-ad9e-9876a56b0d65", - "key": "b292438b-c80b-443c-ad9e-9876a56b0d65", - "label": "kft_288(2020) metadata", - "value": "25383" - }, - { - "description": "Jurisdiction Metadata for kft_215(2020) id 0c8cf2ef-9aab-4dd6-8aa0-b27763021b64", - "key": "0c8cf2ef-9aab-4dd6-8aa0-b27763021b64", - "label": "kft_215(2020) metadata", - "value": "25384" - }, - { - "description": "Jurisdiction Metadata for kft_209(2020) id 40cf0e40-342d-4c1a-b8c2-e2a9e3bbc478", - "key": "40cf0e40-342d-4c1a-b8c2-e2a9e3bbc478", - "label": "kft_209(2020) metadata", - "value": "25385" - }, - { - "description": "Jurisdiction Metadata for kft_104(2020) id c89d754b-2eb2-4560-b4ea-a3ac3d0f2db4", - "key": "c89d754b-2eb2-4560-b4ea-a3ac3d0f2db4", - "label": "kft_104(2020) metadata", - "value": "25386" - }, - { - "description": "Jurisdiction Metadata for kft_306(2020) id f17d125d-9951-47b5-90cc-0506e24efff6", - "key": "f17d125d-9951-47b5-90cc-0506e24efff6", - "label": "kft_306(2020) metadata", - "value": "25387" - }, - { - "description": "Jurisdiction Metadata for kft_303(2020) id 1bbfeb29-72a9-4e83-9e2b-f04ab041a2ec", - "key": "1bbfeb29-72a9-4e83-9e2b-f04ab041a2ec", - "label": "kft_303(2020) metadata", - "value": "25388" - }, - { - "description": "Jurisdiction Metadata for Kabuta(2020) id 2814945f-982b-41a5-ad16-455182acafff", - "key": "2814945f-982b-41a5-ad16-455182acafff", - "label": "Kabuta(2020) metadata", - "value": "25389" - }, - { - "description": "Jurisdiction Metadata for Mulonda id 1357363f-b8b2-4980-9faf-97aae7139e28", - "key": "1357363f-b8b2-4980-9faf-97aae7139e28", - "label": "Mulonda metadata", - "value": "25390" - }, - { - "description": "Jurisdiction Metadata for kbt_6(2020) id cf8f72a5-2c2c-4860-923e-6403b03856f2", - "key": "cf8f72a5-2c2c-4860-923e-6403b03856f2", - "label": "kbt_6(2020) metadata", - "value": "25391" - }, - { - "description": "Jurisdiction Metadata for Kabuta East id a2791d42-8838-4ee9-9ca5-cffcf0ffa30f", - "key": "a2791d42-8838-4ee9-9ca5-cffcf0ffa30f", - "label": "Kabuta East metadata", - "value": "25392" - }, - { - "description": "Jurisdiction Metadata for kbt_160(2020) id 3fe14868-e334-4f66-bdeb-cb6f3c7158b4", - "key": "3fe14868-e334-4f66-bdeb-cb6f3c7158b4", - "label": "kbt_160(2020) metadata", - "value": "25393" - }, - { - "description": "Jurisdiction Metadata for kbt_242(2020) id f6add0c8-127a-4dd3-aa6d-f13ea16de31b", - "key": "f6add0c8-127a-4dd3-aa6d-f13ea16de31b", - "label": "kbt_242(2020) metadata", - "value": "25394" - }, - { - "description": "Jurisdiction Metadata for kbt_85(2020) id bec53c62-7c60-4eed-8d10-adac75ccf357", - "key": "bec53c62-7c60-4eed-8d10-adac75ccf357", - "label": "kbt_85(2020) metadata", - "value": "25395" - }, - { - "description": "Jurisdiction Metadata for kbt_128(2020) id 2a40c6d4-ad9a-4fc9-8e16-b8c539ce1fa6", - "key": "2a40c6d4-ad9a-4fc9-8e16-b8c539ce1fa6", - "label": "kbt_128(2020) metadata", - "value": "25396" - }, - { - "description": "Jurisdiction Metadata for kbt_48(2020) id cef10d32-4719-4664-8424-f99a116c1c9b", - "key": "cef10d32-4719-4664-8424-f99a116c1c9b", - "label": "kbt_48(2020) metadata", - "value": "25397" - }, - { - "description": "Jurisdiction Metadata for kbt_54(2020) id 25dcda53-8500-4c46-8b8f-c368546cca98", - "key": "25dcda53-8500-4c46-8b8f-c368546cca98", - "label": "kbt_54(2020) metadata", - "value": "25398" - }, - { - "description": "Jurisdiction Metadata for kbt_89(2020) id e850fd30-5910-473a-933b-613b73420240", - "key": "e850fd30-5910-473a-933b-613b73420240", - "label": "kbt_89(2020) metadata", - "value": "25399" - }, - { - "description": "Jurisdiction Metadata for kbt_51(2020) id bc09099e-212f-4ca5-93a9-f276dfd0dbda", - "key": "bc09099e-212f-4ca5-93a9-f276dfd0dbda", - "label": "kbt_51(2020) metadata", - "value": "25400" - }, - { - "description": "Jurisdiction Metadata for kbt_210(2020) id f6e60d56-e977-45ad-8d04-d56dc89a8ff1", - "key": "f6e60d56-e977-45ad-8d04-d56dc89a8ff1", - "label": "kbt_210(2020) metadata", - "value": "25401" - }, - { - "description": "Jurisdiction Metadata for kbt_168(2020) id 340f5cb9-cd08-4784-a344-2d3fda6f90bb", - "key": "340f5cb9-cd08-4784-a344-2d3fda6f90bb", - "label": "kbt_168(2020) metadata", - "value": "25402" - }, - { - "description": "Jurisdiction Metadata for kbt_141(2020) id 65febcd9-3588-4bd1-be92-802cb12dc7ca", - "key": "65febcd9-3588-4bd1-be92-802cb12dc7ca", - "label": "kbt_141(2020) metadata", - "value": "25403" - }, - { - "description": "Jurisdiction Metadata for kbt_44(2020) id 8097a15d-a37f-4b61-bda7-8c648feb2b9a", - "key": "8097a15d-a37f-4b61-bda7-8c648feb2b9a", - "label": "kbt_44(2020) metadata", - "value": "25404" - }, - { - "description": "Jurisdiction Metadata for kbt_228(2020) id 48104084-4303-4019-ac6b-a39828e74189", - "key": "48104084-4303-4019-ac6b-a39828e74189", - "label": "kbt_228(2020) metadata", - "value": "25405" - }, - { - "description": "Jurisdiction Metadata for kbt_195(2020) id 52e15787-c136-46ef-8b54-3a20d3a04540", - "key": "52e15787-c136-46ef-8b54-3a20d3a04540", - "label": "kbt_195(2020) metadata", - "value": "25406" - }, - { - "description": "Jurisdiction Metadata for kbt_236(2020) id cea8b065-e0cb-4d82-9242-ffd37cac9d34", - "key": "cea8b065-e0cb-4d82-9242-ffd37cac9d34", - "label": "kbt_236(2020) metadata", - "value": "25407" - }, - { - "description": "Jurisdiction Metadata for kbt_68(2020) id 03384610-dd8f-4530-aa78-fcd32bcb0e6e", - "key": "03384610-dd8f-4530-aa78-fcd32bcb0e6e", - "label": "kbt_68(2020) metadata", - "value": "25408" - }, - { - "description": "Jurisdiction Metadata for kbt_17(2020) id 01cf87e4-84b4-496c-84cf-859c5da74f14", - "key": "01cf87e4-84b4-496c-84cf-859c5da74f14", - "label": "kbt_17(2020) metadata", - "value": "25409" - }, - { - "description": "Jurisdiction Metadata for kbt_200(2020) id f3616ec2-9a74-4353-80bd-99bd1c3430da", - "key": "f3616ec2-9a74-4353-80bd-99bd1c3430da", - "label": "kbt_200(2020) metadata", - "value": "25410" - }, - { - "description": "Jurisdiction Metadata for kbt_33(2020) id 4ee4856e-3ea6-4343-983a-d0e455d994a6", - "key": "4ee4856e-3ea6-4343-983a-d0e455d994a6", - "label": "kbt_33(2020) metadata", - "value": "25411" - }, - { - "description": "Jurisdiction Metadata for kbt_119(2020) id e96c4910-ba92-4cf0-aa3a-22e846be8882", - "key": "e96c4910-ba92-4cf0-aa3a-22e846be8882", - "label": "kbt_119(2020) metadata", - "value": "25412" - }, - { - "description": "Jurisdiction Metadata for kbt_146(2020) id df4347db-8061-4852-846c-ce9137f8c587", - "key": "df4347db-8061-4852-846c-ce9137f8c587", - "label": "kbt_146(2020) metadata", - "value": "25413" - }, - { - "description": "Jurisdiction Metadata for kbt_67(2020) id 6cffadd1-927c-4dc0-9a14-90b1e7c05866", - "key": "6cffadd1-927c-4dc0-9a14-90b1e7c05866", - "label": "kbt_67(2020) metadata", - "value": "25414" - }, - { - "description": "Jurisdiction Metadata for kbt_142(2020) id 52bf8887-c862-4a9b-a51f-b65dc73045b7", - "key": "52bf8887-c862-4a9b-a51f-b65dc73045b7", - "label": "kbt_142(2020) metadata", - "value": "25415" - }, - { - "description": "Jurisdiction Metadata for kbt_18(2020) id e0144482-e577-4dab-8f75-a86199008ea4", - "key": "e0144482-e577-4dab-8f75-a86199008ea4", - "label": "kbt_18(2020) metadata", - "value": "25416" - }, - { - "description": "Jurisdiction Metadata for kbt_32(2020) id a4819865-fb8b-4065-828b-5b1b27e66081", - "key": "a4819865-fb8b-4065-828b-5b1b27e66081", - "label": "kbt_32(2020) metadata", - "value": "25417" - }, - { - "description": "Jurisdiction Metadata for kbt_234(2020) id c4850898-0a0c-41db-949a-dc1a6e3666ab", - "key": "c4850898-0a0c-41db-949a-dc1a6e3666ab", - "label": "kbt_234(2020) metadata", - "value": "25418" - }, - { - "description": "Jurisdiction Metadata for kbt_178(2020) id 647b0a57-9cb6-4905-9a45-d85bf1d0535c", - "key": "647b0a57-9cb6-4905-9a45-d85bf1d0535c", - "label": "kbt_178(2020) metadata", - "value": "25419" - }, - { - "description": "Jurisdiction Metadata for kbt_226(2020) id 731d6495-8417-498f-bbb6-5ef1514ea0ce", - "key": "731d6495-8417-498f-bbb6-5ef1514ea0ce", - "label": "kbt_226(2020) metadata", - "value": "25420" - }, - { - "description": "Jurisdiction Metadata for kbt_25(2020) id 84f66d1b-115d-4440-ba52-9976ccd320eb", - "key": "84f66d1b-115d-4440-ba52-9976ccd320eb", - "label": "kbt_25(2020) metadata", - "value": "25421" - }, - { - "description": "Jurisdiction Metadata for kbt_223(2020) id 0c7db45b-5e37-4567-9f34-49395d9f8422", - "key": "0c7db45b-5e37-4567-9f34-49395d9f8422", - "label": "kbt_223(2020) metadata", - "value": "25422" - }, - { - "description": "Jurisdiction Metadata for kbt_216(2020) id fb9e35f9-ab15-4faa-a397-ad32dcf2560d", - "key": "fb9e35f9-ab15-4faa-a397-ad32dcf2560d", - "label": "kbt_216(2020) metadata", - "value": "25423" - }, - { - "description": "Jurisdiction Metadata for kbt_209(2020) id 4f6fcdbc-6435-4903-840d-d78b30eaf833", - "key": "4f6fcdbc-6435-4903-840d-d78b30eaf833", - "label": "kbt_209(2020) metadata", - "value": "25424" - }, - { - "description": "Jurisdiction Metadata for kbt_82(2020) id b5fe26c9-56a2-44d2-9319-a325a8947e95", - "key": "b5fe26c9-56a2-44d2-9319-a325a8947e95", - "label": "kbt_82(2020) metadata", - "value": "25425" - }, - { - "description": "Jurisdiction Metadata for kbt_231(2020) id 5d84a527-64f8-4d83-8a32-f53fe8fb2f5a", - "key": "5d84a527-64f8-4d83-8a32-f53fe8fb2f5a", - "label": "kbt_231(2020) metadata", - "value": "25426" - }, - { - "description": "Jurisdiction Metadata for kbt_98(2020) id a886d356-8e88-40a9-9068-5c4f4e386f46", - "key": "a886d356-8e88-40a9-9068-5c4f4e386f46", - "label": "kbt_98(2020) metadata", - "value": "25427" - }, - { - "description": "Jurisdiction Metadata for kbt_73(2020) id d576f3aa-8831-47a7-bed7-4c6691b7055d", - "key": "d576f3aa-8831-47a7-bed7-4c6691b7055d", - "label": "kbt_73(2020) metadata", - "value": "25428" - }, - { - "description": "Jurisdiction Metadata for kbt_47(2020) id 061e81e4-f01e-4e08-b3d1-1a4ad705d746", - "key": "061e81e4-f01e-4e08-b3d1-1a4ad705d746", - "label": "kbt_47(2020) metadata", - "value": "25429" - }, - { - "description": "Jurisdiction Metadata for kbt_190(2020) id f520e8f1-e82b-449f-8f14-e041485d48d1", - "key": "f520e8f1-e82b-449f-8f14-e041485d48d1", - "label": "kbt_190(2020) metadata", - "value": "25430" - }, - { - "description": "Jurisdiction Metadata for kbt_211(2020) id 49b3cc1d-3aa9-4c1a-bf1d-17a8a9dbae7f", - "key": "49b3cc1d-3aa9-4c1a-bf1d-17a8a9dbae7f", - "label": "kbt_211(2020) metadata", - "value": "25431" - }, - { - "description": "Jurisdiction Metadata for kbt_197(2020) id 730a5e00-fc07-472a-b86d-e9635fc4f605", - "key": "730a5e00-fc07-472a-b86d-e9635fc4f605", - "label": "kbt_197(2020) metadata", - "value": "25432" - }, - { - "description": "Jurisdiction Metadata for kbt_240(2020) id a6c0fd71-6203-4603-b82a-cf988b1e9f5c", - "key": "a6c0fd71-6203-4603-b82a-cf988b1e9f5c", - "label": "kbt_240(2020) metadata", - "value": "25433" - }, - { - "description": "Jurisdiction Metadata for kbt_213(2020) id ab669a3b-0f9c-4d98-b14e-2752a11ac9a1", - "key": "ab669a3b-0f9c-4d98-b14e-2752a11ac9a1", - "label": "kbt_213(2020) metadata", - "value": "25434" - }, - { - "description": "Jurisdiction Metadata for kbt_75(2020) id 3d714cf0-28bc-40ad-858f-c123aba96806", - "key": "3d714cf0-28bc-40ad-858f-c123aba96806", - "label": "kbt_75(2020) metadata", - "value": "25435" - }, - { - "description": "Jurisdiction Metadata for kbt_86(2020) id 841624d8-0f84-4aa5-ac37-5255e1464825", - "key": "841624d8-0f84-4aa5-ac37-5255e1464825", - "label": "kbt_86(2020) metadata", - "value": "25436" - }, - { - "description": "Jurisdiction Metadata for kbt_247(2020) id 87430e57-eca8-4622-aaa1-05d9600a2648", - "key": "87430e57-eca8-4622-aaa1-05d9600a2648", - "label": "kbt_247(2020) metadata", - "value": "25437" - }, - { - "description": "Jurisdiction Metadata for kbt_14(2020) id c7f89cf1-26e4-4d9b-ac0a-b497c6b60e6d", - "key": "c7f89cf1-26e4-4d9b-ac0a-b497c6b60e6d", - "label": "kbt_14(2020) metadata", - "value": "25438" - }, - { - "description": "Jurisdiction Metadata for kbt_198(2020) id 44e2841a-3afc-41e8-9a18-faa1a1dc41b6", - "key": "44e2841a-3afc-41e8-9a18-faa1a1dc41b6", - "label": "kbt_198(2020) metadata", - "value": "25439" - }, - { - "description": "Jurisdiction Metadata for kbt_215(2020) id 5fca4aa3-d92c-4d2a-99b1-71858c2f1050", - "key": "5fca4aa3-d92c-4d2a-99b1-71858c2f1050", - "label": "kbt_215(2020) metadata", - "value": "25440" - }, - { - "description": "Jurisdiction Metadata for kbt_84(2020) id 4afe5642-b2f9-48df-a327-0398cb85edd7", - "key": "4afe5642-b2f9-48df-a327-0398cb85edd7", - "label": "kbt_84(2020) metadata", - "value": "25441" - }, - { - "description": "Jurisdiction Metadata for kbt_94(2020) id d7c8032d-68c4-40f9-95ea-f170d970e826", - "key": "d7c8032d-68c4-40f9-95ea-f170d970e826", - "label": "kbt_94(2020) metadata", - "value": "25442" - }, - { - "description": "Jurisdiction Metadata for kbt_181(2020) id 59e58a64-d599-419e-9a38-27b263326f2a", - "key": "59e58a64-d599-419e-9a38-27b263326f2a", - "label": "kbt_181(2020) metadata", - "value": "25443" - }, - { - "description": "Jurisdiction Metadata for kbt_145(2020) id 3d13b8eb-92c7-4243-821f-36f5c124d234", - "key": "3d13b8eb-92c7-4243-821f-36f5c124d234", - "label": "kbt_145(2020) metadata", - "value": "25444" - }, - { - "description": "Jurisdiction Metadata for kbt_167(2020) id 61f57fc7-d450-499d-85ba-17dcca2d8ffc", - "key": "61f57fc7-d450-499d-85ba-17dcca2d8ffc", - "label": "kbt_167(2020) metadata", - "value": "25445" - }, - { - "description": "Jurisdiction Metadata for kbt_159(2020) id 01bd594e-12f8-48aa-9523-457d9e0c152f", - "key": "01bd594e-12f8-48aa-9523-457d9e0c152f", - "label": "kbt_159(2020) metadata", - "value": "25446" - }, - { - "description": "Jurisdiction Metadata for kbt_225(2020) id b394da7c-a499-466f-80f9-25b0203f208c", - "key": "b394da7c-a499-466f-80f9-25b0203f208c", - "label": "kbt_225(2020) metadata", - "value": "25447" - }, - { - "description": "Jurisdiction Metadata for kbt_53(2020) id 8a68f70f-0993-4798-8935-4a15363663f4", - "key": "8a68f70f-0993-4798-8935-4a15363663f4", - "label": "kbt_53(2020) metadata", - "value": "25448" - }, - { - "description": "Jurisdiction Metadata for kbt_165(2020) id 52b38bf6-0eb9-4737-ac34-0898a50e4944", - "key": "52b38bf6-0eb9-4737-ac34-0898a50e4944", - "label": "kbt_165(2020) metadata", - "value": "25449" - }, - { - "description": "Jurisdiction Metadata for kbt_69(2020) id 02cf6736-2d40-480f-aad0-5055098a5a78", - "key": "02cf6736-2d40-480f-aad0-5055098a5a78", - "label": "kbt_69(2020) metadata", - "value": "25450" - }, - { - "description": "Jurisdiction Metadata for kbt_212(2020) id 380a2d5c-7564-45e4-af71-862c79ac9800", - "key": "380a2d5c-7564-45e4-af71-862c79ac9800", - "label": "kbt_212(2020) metadata", - "value": "25451" - }, - { - "description": "Jurisdiction Metadata for kbt_126(2020) id 584f77ba-41b4-4a2f-ae46-851eb08b74a3", - "key": "584f77ba-41b4-4a2f-ae46-851eb08b74a3", - "label": "kbt_126(2020) metadata", - "value": "25452" - }, - { - "description": "Jurisdiction Metadata for kbt_115(2020) id 9b3533d9-a292-41ed-8353-5837176d1ec2", - "key": "9b3533d9-a292-41ed-8353-5837176d1ec2", - "label": "kbt_115(2020) metadata", - "value": "25453" - }, - { - "description": "Jurisdiction Metadata for kbt_163(2020) id ffb6a531-7754-458c-b4f3-55f4f6e6d671", - "key": "ffb6a531-7754-458c-b4f3-55f4f6e6d671", - "label": "kbt_163(2020) metadata", - "value": "25454" - }, - { - "description": "Jurisdiction Metadata for kbt_31(2020) id 9dbe2e6d-0b31-4b97-bf76-f6360a4b79cd", - "key": "9dbe2e6d-0b31-4b97-bf76-f6360a4b79cd", - "label": "kbt_31(2020) metadata", - "value": "25455" - }, - { - "description": "Jurisdiction Metadata for kbt_201(2020) id f39c456c-9a33-43bf-9733-267159b94e7d", - "key": "f39c456c-9a33-43bf-9733-267159b94e7d", - "label": "kbt_201(2020) metadata", - "value": "25456" - }, - { - "description": "Jurisdiction Metadata for kbt_199(2020) id bd492554-b4ea-4149-9765-5ad23417b7f4", - "key": "bd492554-b4ea-4149-9765-5ad23417b7f4", - "label": "kbt_199(2020) metadata", - "value": "25457" - }, - { - "description": "Jurisdiction Metadata for kbt_182(2020) id 794e0188-2144-468b-bb78-34639e074ca6", - "key": "794e0188-2144-468b-bb78-34639e074ca6", - "label": "kbt_182(2020) metadata", - "value": "25458" - }, - { - "description": "Jurisdiction Metadata for kbt_130(2020) id 412d1b76-5d97-4337-876d-8ea4d434fe49", - "key": "412d1b76-5d97-4337-876d-8ea4d434fe49", - "label": "kbt_130(2020) metadata", - "value": "25459" - }, - { - "description": "Jurisdiction Metadata for kbt_241(2020) id d58e77d7-0c16-4009-82e5-0600de5de778", - "key": "d58e77d7-0c16-4009-82e5-0600de5de778", - "label": "kbt_241(2020) metadata", - "value": "25460" - }, - { - "description": "Jurisdiction Metadata for kbt_50(2020) id 2e41c2be-89fd-4d39-9d8f-462166b0adc7", - "key": "2e41c2be-89fd-4d39-9d8f-462166b0adc7", - "label": "kbt_50(2020) metadata", - "value": "25461" - }, - { - "description": "Jurisdiction Metadata for kbt_71(2020) id 9d7efc86-b84d-496c-a291-04b5d600c2e4", - "key": "9d7efc86-b84d-496c-a291-04b5d600c2e4", - "label": "kbt_71(2020) metadata", - "value": "25462" - }, - { - "description": "Jurisdiction Metadata for kbt_15(2020) id 857a7042-8771-4212-ab1c-33fcf5a4468b", - "key": "857a7042-8771-4212-ab1c-33fcf5a4468b", - "label": "kbt_15(2020) metadata", - "value": "25463" - }, - { - "description": "Jurisdiction Metadata for kbt_224(2020) id 843a65c5-8c32-4c52-8529-5de8aff1ba37", - "key": "843a65c5-8c32-4c52-8529-5de8aff1ba37", - "label": "kbt_224(2020) metadata", - "value": "25464" - }, - { - "description": "Jurisdiction Metadata for kbt_171(2020) id 4735b846-c5ea-4c8b-b681-571158c65921", - "key": "4735b846-c5ea-4c8b-b681-571158c65921", - "label": "kbt_171(2020) metadata", - "value": "25465" - }, - { - "description": "Jurisdiction Metadata for kbt_131(2020) id 80e73ef0-0ead-4e6e-9dd8-32f42634fee3", - "key": "80e73ef0-0ead-4e6e-9dd8-32f42634fee3", - "label": "kbt_131(2020) metadata", - "value": "25466" - }, - { - "description": "Jurisdiction Metadata for kbt_162(2020) id f0eee11d-f930-490a-a17a-a0c92df9d4d5", - "key": "f0eee11d-f930-490a-a17a-a0c92df9d4d5", - "label": "kbt_162(2020) metadata", - "value": "25467" - }, - { - "description": "Jurisdiction Metadata for kbt_144(2020) id 3ff8f5b9-97b0-4f59-97d6-70953eb75c57", - "key": "3ff8f5b9-97b0-4f59-97d6-70953eb75c57", - "label": "kbt_144(2020) metadata", - "value": "25468" - }, - { - "description": "Jurisdiction Metadata for kbt_122(2020) id 6b277cbb-6a3c-46da-afc8-5b12ddaf2cee", - "key": "6b277cbb-6a3c-46da-afc8-5b12ddaf2cee", - "label": "kbt_122(2020) metadata", - "value": "25469" - }, - { - "description": "Jurisdiction Metadata for kbt_133(2020) id d2de9fce-71e7-4b73-b03c-b404bb81724b", - "key": "d2de9fce-71e7-4b73-b03c-b404bb81724b", - "label": "kbt_133(2020) metadata", - "value": "25470" - }, - { - "description": "Jurisdiction Metadata for kbt_70(2020) id 3a9b664a-9da6-4766-af96-78ea29705c42", - "key": "3a9b664a-9da6-4766-af96-78ea29705c42", - "label": "kbt_70(2020) metadata", - "value": "25471" - }, - { - "description": "Jurisdiction Metadata for kbt_166(2020) id 29182ff9-fb95-4cee-aea6-52208d627b0a", - "key": "29182ff9-fb95-4cee-aea6-52208d627b0a", - "label": "kbt_166(2020) metadata", - "value": "25472" - }, - { - "description": "Jurisdiction Metadata for kbt_120(2020) id 7d984117-be5e-4192-bdd9-469176e8e448", - "key": "7d984117-be5e-4192-bdd9-469176e8e448", - "label": "kbt_120(2020) metadata", - "value": "25473" - }, - { - "description": "Jurisdiction Metadata for kbt_29(2020) id 71c7a1ce-26c8-4a04-89d5-0c41a2539b1a", - "key": "71c7a1ce-26c8-4a04-89d5-0c41a2539b1a", - "label": "kbt_29(2020) metadata", - "value": "25474" - }, - { - "description": "Jurisdiction Metadata for kbt_112(2020) id 03774dd7-0a7d-4c10-aacf-0a19f080cf2c", - "key": "03774dd7-0a7d-4c10-aacf-0a19f080cf2c", - "label": "kbt_112(2020) metadata", - "value": "25475" - }, - { - "description": "Jurisdiction Metadata for kbt_203(2020) id 6f13cae0-d12c-4600-9001-d586a90d1065", - "key": "6f13cae0-d12c-4600-9001-d586a90d1065", - "label": "kbt_203(2020) metadata", - "value": "25476" - }, - { - "description": "Jurisdiction Metadata for kbt_102(2020) id 7b2692d1-c9a1-499a-ab4a-e3267f940e6a", - "key": "7b2692d1-c9a1-499a-ab4a-e3267f940e6a", - "label": "kbt_102(2020) metadata", - "value": "25477" - }, - { - "description": "Jurisdiction Metadata for kbt_12(2020) id c4c9895c-4d9f-4925-8a91-5a362ddaec9b", - "key": "c4c9895c-4d9f-4925-8a91-5a362ddaec9b", - "label": "kbt_12(2020) metadata", - "value": "25478" - }, - { - "description": "Jurisdiction Metadata for kbt_124(2020) id 0a392bab-8078-405a-b4f9-13c580fab172", - "key": "0a392bab-8078-405a-b4f9-13c580fab172", - "label": "kbt_124(2020) metadata", - "value": "25479" - }, - { - "description": "Jurisdiction Metadata for kbt_180(2020) id ec5d19b2-ba64-4f70-aae2-17a96ca8334b", - "key": "ec5d19b2-ba64-4f70-aae2-17a96ca8334b", - "label": "kbt_180(2020) metadata", - "value": "25480" - }, - { - "description": "Jurisdiction Metadata for kbt_23(2020) id a7dfa4eb-897b-4ca8-971f-e0ab8fecb175", - "key": "a7dfa4eb-897b-4ca8-971f-e0ab8fecb175", - "label": "kbt_23(2020) metadata", - "value": "25481" - }, - { - "description": "Jurisdiction Metadata for kbt_135(2020) id 51352794-07c1-4d73-9e7c-1e09c6c3223f", - "key": "51352794-07c1-4d73-9e7c-1e09c6c3223f", - "label": "kbt_135(2020) metadata", - "value": "25482" - }, - { - "description": "Jurisdiction Metadata for kbt_214(2020) id ed9588f1-c4ee-4f82-ad5a-f4f41305b703", - "key": "ed9588f1-c4ee-4f82-ad5a-f4f41305b703", - "label": "kbt_214(2020) metadata", - "value": "25483" - }, - { - "description": "Jurisdiction Metadata for kbt_22(2020) id 0494f643-6046-499a-b834-abae70a0e09f", - "key": "0494f643-6046-499a-b834-abae70a0e09f", - "label": "kbt_22(2020) metadata", - "value": "25484" - }, - { - "description": "Jurisdiction Metadata for kbt_207(2020) id b31fcc6a-b3cf-4d42-94c9-c16b45071109", - "key": "b31fcc6a-b3cf-4d42-94c9-c16b45071109", - "label": "kbt_207(2020) metadata", - "value": "25485" - }, - { - "description": "Jurisdiction Metadata for kbt_227(2020) id 72ecbfe9-cf4a-46a2-a883-8db411cb5c0f", - "key": "72ecbfe9-cf4a-46a2-a883-8db411cb5c0f", - "label": "kbt_227(2020) metadata", - "value": "25486" - }, - { - "description": "Jurisdiction Metadata for kbt_39(2020) id 7605f0d5-aa50-45c9-b7a2-f3f34a159ccc", - "key": "7605f0d5-aa50-45c9-b7a2-f3f34a159ccc", - "label": "kbt_39(2020) metadata", - "value": "25487" - }, - { - "description": "Jurisdiction Metadata for kbt_239(2020) id 5fd0483f-331c-421b-ad28-1f8fdfbf92e5", - "key": "5fd0483f-331c-421b-ad28-1f8fdfbf92e5", - "label": "kbt_239(2020) metadata", - "value": "25488" - }, - { - "description": "Jurisdiction Metadata for kbt_60(2020) id 31f92500-6072-4585-95c3-430134e6a189", - "key": "31f92500-6072-4585-95c3-430134e6a189", - "label": "kbt_60(2020) metadata", - "value": "25489" - }, - { - "description": "Jurisdiction Metadata for kbt_140(2020) id 3583553d-a158-40a3-a78c-6665f8137a94", - "key": "3583553d-a158-40a3-a78c-6665f8137a94", - "label": "kbt_140(2020) metadata", - "value": "25490" - }, - { - "description": "Jurisdiction Metadata for kbt_173(2020) id 9edfff6c-fc7f-43b2-a7a4-adf21c877fc7", - "key": "9edfff6c-fc7f-43b2-a7a4-adf21c877fc7", - "label": "kbt_173(2020) metadata", - "value": "25491" - }, - { - "description": "Jurisdiction Metadata for kbt_164(2020) id 70105458-a8f3-47f4-b09e-8f6f3635a9c6", - "key": "70105458-a8f3-47f4-b09e-8f6f3635a9c6", - "label": "kbt_164(2020) metadata", - "value": "25492" - }, - { - "description": "Jurisdiction Metadata for kbt_235(2020) id a1471793-8195-485b-a104-7201e26ea24c", - "key": "a1471793-8195-485b-a104-7201e26ea24c", - "label": "kbt_235(2020) metadata", - "value": "25493" - }, - { - "description": "Jurisdiction Metadata for kbt_26(2020) id 54c3028f-ca99-46da-a136-77a2a9ddf4db", - "key": "54c3028f-ca99-46da-a136-77a2a9ddf4db", - "label": "kbt_26(2020) metadata", - "value": "25494" - }, - { - "description": "Jurisdiction Metadata for kbt_95(2020) id 278a2f37-76b4-4db1-b36a-b9a65aed656d", - "key": "278a2f37-76b4-4db1-b36a-b9a65aed656d", - "label": "kbt_95(2020) metadata", - "value": "25495" - }, - { - "description": "Jurisdiction Metadata for kbt_103(2020) id f4da5fa2-b0f7-41fc-a65c-517cd67a0812", - "key": "f4da5fa2-b0f7-41fc-a65c-517cd67a0812", - "label": "kbt_103(2020) metadata", - "value": "25496" - }, - { - "description": "Jurisdiction Metadata for kbt_139(2020) id afd90659-b7f5-47f1-b7a6-7ebadc36a00e", - "key": "afd90659-b7f5-47f1-b7a6-7ebadc36a00e", - "label": "kbt_139(2020) metadata", - "value": "25497" - }, - { - "description": "Jurisdiction Metadata for kbt_42(2020) id 195c1bd2-cc4c-4fae-a4af-a2ebc3b95666", - "key": "195c1bd2-cc4c-4fae-a4af-a2ebc3b95666", - "label": "kbt_42(2020) metadata", - "value": "25498" - }, - { - "description": "Jurisdiction Metadata for kbt_169(2020) id bac9cf39-e140-46cc-b5a9-4616c40abc98", - "key": "bac9cf39-e140-46cc-b5a9-4616c40abc98", - "label": "kbt_169(2020) metadata", - "value": "25499" - }, - { - "description": "Jurisdiction Metadata for kbt_13(2020) id f7f1c1d1-fdf6-4ed2-9d48-9563478390d0", - "key": "f7f1c1d1-fdf6-4ed2-9d48-9563478390d0", - "label": "kbt_13(2020) metadata", - "value": "25500" - }, - { - "description": "Jurisdiction Metadata for kbt_187(2020) id 2dabd3a1-6250-4ca4-9d5b-fc43368e1544", - "key": "2dabd3a1-6250-4ca4-9d5b-fc43368e1544", - "label": "kbt_187(2020) metadata", - "value": "25501" - }, - { - "description": "Jurisdiction Metadata for kbt_246(2020) id 0ae3b83e-b4d5-4989-b895-b374764fd832", - "key": "0ae3b83e-b4d5-4989-b895-b374764fd832", - "label": "kbt_246(2020) metadata", - "value": "25502" - }, - { - "description": "Jurisdiction Metadata for kbt_24(2020) id 28656b47-7e19-47aa-9bc5-e381f30109c5", - "key": "28656b47-7e19-47aa-9bc5-e381f30109c5", - "label": "kbt_24(2020) metadata", - "value": "25503" - }, - { - "description": "Jurisdiction Metadata for kbt_30(2020) id f30b6ac4-d9b0-4b70-9ef3-6740aab1bc97", - "key": "f30b6ac4-d9b0-4b70-9ef3-6740aab1bc97", - "label": "kbt_30(2020) metadata", - "value": "25504" - }, - { - "description": "Jurisdiction Metadata for kbt_177(2020) id 2919e4f3-28b7-40c8-8261-703e04bcfb42", - "key": "2919e4f3-28b7-40c8-8261-703e04bcfb42", - "label": "kbt_177(2020) metadata", - "value": "25505" - }, - { - "description": "Jurisdiction Metadata for kbt_192(2020) id a8787279-4635-4fc8-bc4c-4a033db0844a", - "key": "a8787279-4635-4fc8-bc4c-4a033db0844a", - "label": "kbt_192(2020) metadata", - "value": "25506" - }, - { - "description": "Jurisdiction Metadata for kbt_117(2020) id 3d7d7233-ad7f-47cb-89eb-591ca6b265df", - "key": "3d7d7233-ad7f-47cb-89eb-591ca6b265df", - "label": "kbt_117(2020) metadata", - "value": "25507" - }, - { - "description": "Jurisdiction Metadata for kbt_137(2020) id 2c6c7d56-bd55-4a65-b0b1-8da8922a9ee9", - "key": "2c6c7d56-bd55-4a65-b0b1-8da8922a9ee9", - "label": "kbt_137(2020) metadata", - "value": "25508" - }, - { - "description": "Jurisdiction Metadata for kbt_218(2020) id a5f8f614-c760-4e98-8424-4b60b74bbccd", - "key": "a5f8f614-c760-4e98-8424-4b60b74bbccd", - "label": "kbt_218(2020) metadata", - "value": "25509" - }, - { - "description": "Jurisdiction Metadata for kbt_136(2020) id 4e2e9f97-1a6e-4a0c-9a9a-2a95fe8244a1", - "key": "4e2e9f97-1a6e-4a0c-9a9a-2a95fe8244a1", - "label": "kbt_136(2020) metadata", - "value": "25510" - }, - { - "description": "Jurisdiction Metadata for kbt_38(2020) id 1c59954e-5e6e-4465-97e8-d369d2e342f2", - "key": "1c59954e-5e6e-4465-97e8-d369d2e342f2", - "label": "kbt_38(2020) metadata", - "value": "25511" - }, - { - "description": "Jurisdiction Metadata for kbt_109(2020) id 6c3aacf9-b5fc-4560-afe9-3f7b193fdce4", - "key": "6c3aacf9-b5fc-4560-afe9-3f7b193fdce4", - "label": "kbt_109(2020) metadata", - "value": "25512" - }, - { - "description": "Jurisdiction Metadata for kbt_61(2020) id 5f9ac6a1-ba44-4cce-8d93-5986bc17ced3", - "key": "5f9ac6a1-ba44-4cce-8d93-5986bc17ced3", - "label": "kbt_61(2020) metadata", - "value": "25513" - }, - { - "description": "Jurisdiction Metadata for kbt_106(2020) id 9fddeae9-4c18-4d64-b397-9e379cebed9d", - "key": "9fddeae9-4c18-4d64-b397-9e379cebed9d", - "label": "kbt_106(2020) metadata", - "value": "25514" - }, - { - "description": "Jurisdiction Metadata for kbt_245(2020) id 24cb2e71-e2ff-46b0-bafd-39fdee55fc14", - "key": "24cb2e71-e2ff-46b0-bafd-39fdee55fc14", - "label": "kbt_245(2020) metadata", - "value": "25515" - }, - { - "description": "Jurisdiction Metadata for kbt_57(2020) id 02f073fb-57c5-4150-9030-3fbcb10f10ce", - "key": "02f073fb-57c5-4150-9030-3fbcb10f10ce", - "label": "kbt_57(2020) metadata", - "value": "25516" - }, - { - "description": "Jurisdiction Metadata for kbt_96(2020) id 6cca7580-7bf8-4c87-a72e-1cf9f625443c", - "key": "6cca7580-7bf8-4c87-a72e-1cf9f625443c", - "label": "kbt_96(2020) metadata", - "value": "25517" - }, - { - "description": "Jurisdiction Metadata for kbt_27(2020) id 52aad8da-54b6-4da1-a93b-6ab6c25512a7", - "key": "52aad8da-54b6-4da1-a93b-6ab6c25512a7", - "label": "kbt_27(2020) metadata", - "value": "25518" - }, - { - "description": "Jurisdiction Metadata for kbt_77(2020) id e2c2cde8-a861-4c86-8e23-328852caee79", - "key": "e2c2cde8-a861-4c86-8e23-328852caee79", - "label": "kbt_77(2020) metadata", - "value": "25519" - }, - { - "description": "Jurisdiction Metadata for kbt_220(2020) id f44dd381-7105-4b4c-9c20-8d49adeedcda", - "key": "f44dd381-7105-4b4c-9c20-8d49adeedcda", - "label": "kbt_220(2020) metadata", - "value": "25520" - }, - { - "description": "Jurisdiction Metadata for kbt_49(2020) id 6d7c621c-6b18-4d1b-a9f2-5339d9b5e91e", - "key": "6d7c621c-6b18-4d1b-a9f2-5339d9b5e91e", - "label": "kbt_49(2020) metadata", - "value": "25521" - }, - { - "description": "Jurisdiction Metadata for kbt_172(2020) id 89451f60-7995-40b4-9184-d4aeb7870c28", - "key": "89451f60-7995-40b4-9184-d4aeb7870c28", - "label": "kbt_172(2020) metadata", - "value": "25522" - }, - { - "description": "Jurisdiction Metadata for kbt_76(2020) id d34a0541-6bd9-4b96-bf98-ca72f6514610", - "key": "d34a0541-6bd9-4b96-bf98-ca72f6514610", - "label": "kbt_76(2020) metadata", - "value": "25523" - }, - { - "description": "Jurisdiction Metadata for kbt_243(2020) id 1ee17404-90dc-44fe-b91c-15eed1c30a8d", - "key": "1ee17404-90dc-44fe-b91c-15eed1c30a8d", - "label": "kbt_243(2020) metadata", - "value": "25524" - }, - { - "description": "Jurisdiction Metadata for kbt_138(2020) id f20bb75a-2df2-4b50-9fcd-f99730588e68", - "key": "f20bb75a-2df2-4b50-9fcd-f99730588e68", - "label": "kbt_138(2020) metadata", - "value": "25525" - }, - { - "description": "Jurisdiction Metadata for kbt_83(2020) id a0b81a67-fb67-4989-89dd-35e2cb5c1f56", - "key": "a0b81a67-fb67-4989-89dd-35e2cb5c1f56", - "label": "kbt_83(2020) metadata", - "value": "25526" - }, - { - "description": "Jurisdiction Metadata for kbt_16(2020) id 777f40ae-de9a-450d-8f4d-98fc2fd6f88c", - "key": "777f40ae-de9a-450d-8f4d-98fc2fd6f88c", - "label": "kbt_16(2020) metadata", - "value": "25527" - }, - { - "description": "Jurisdiction Metadata for kbt_230(2020) id a0c6e9dd-f773-4b67-9267-7b9cb28ecb83", - "key": "a0c6e9dd-f773-4b67-9267-7b9cb28ecb83", - "label": "kbt_230(2020) metadata", - "value": "25528" - }, - { - "description": "Jurisdiction Metadata for kbt_52(2020) id 8aa6fcdb-c69a-4098-892a-f9f23d4a3aa7", - "key": "8aa6fcdb-c69a-4098-892a-f9f23d4a3aa7", - "label": "kbt_52(2020) metadata", - "value": "25529" - }, - { - "description": "Jurisdiction Metadata for kbt_132(2020) id 9ff12b28-8e06-4c44-80e1-4e0408beeec2", - "key": "9ff12b28-8e06-4c44-80e1-4e0408beeec2", - "label": "kbt_132(2020) metadata", - "value": "25530" - }, - { - "description": "Jurisdiction Metadata for kbt_244(2020) id 6387dfb5-6cc6-41e2-83c9-420b02722602", - "key": "6387dfb5-6cc6-41e2-83c9-420b02722602", - "label": "kbt_244(2020) metadata", - "value": "25531" - }, - { - "description": "Jurisdiction Metadata for kbt_62(2020) id 78946858-fa5c-4be2-a1e7-2b692005d7fd", - "key": "78946858-fa5c-4be2-a1e7-2b692005d7fd", - "label": "kbt_62(2020) metadata", - "value": "25532" - }, - { - "description": "Jurisdiction Metadata for kbt_170(2020) id 6fe8bdc7-311a-4af5-894c-9822ff1a5769", - "key": "6fe8bdc7-311a-4af5-894c-9822ff1a5769", - "label": "kbt_170(2020) metadata", - "value": "25533" - }, - { - "description": "Jurisdiction Metadata for kbt_179(2020) id 7212c3a1-4c77-444d-9ecd-de4517b34b7e", - "key": "7212c3a1-4c77-444d-9ecd-de4517b34b7e", - "label": "kbt_179(2020) metadata", - "value": "25534" - }, - { - "description": "Jurisdiction Metadata for kbt_161(2020) id 108a2461-bc58-4871-b2c1-c90352b12823", - "key": "108a2461-bc58-4871-b2c1-c90352b12823", - "label": "kbt_161(2020) metadata", - "value": "25535" - }, - { - "description": "Jurisdiction Metadata for kbt_232(2020) id 0809b938-30b0-459f-b234-50e69b528c01", - "key": "0809b938-30b0-459f-b234-50e69b528c01", - "label": "kbt_232(2020) metadata", - "value": "25536" - }, - { - "description": "Jurisdiction Metadata for kbt_97(2020) id 487c3ff3-2dbc-4fce-9bdc-c38881ce04fc", - "key": "487c3ff3-2dbc-4fce-9bdc-c38881ce04fc", - "label": "kbt_97(2020) metadata", - "value": "25537" - }, - { - "description": "Jurisdiction Metadata for kbt_184(2020) id e5ca97a3-9f9c-42de-a029-c055a1bce4a2", - "key": "e5ca97a3-9f9c-42de-a029-c055a1bce4a2", - "label": "kbt_184(2020) metadata", - "value": "25538" - }, - { - "description": "Jurisdiction Metadata for kbt_37(2020) id 3115f0d8-ae6a-4d19-855c-964ad881960f", - "key": "3115f0d8-ae6a-4d19-855c-964ad881960f", - "label": "kbt_37(2020) metadata", - "value": "25539" - }, - { - "description": "Jurisdiction Metadata for kbt_206(2020) id 70cc9bb3-b546-41c4-a08b-2f3b2869d462", - "key": "70cc9bb3-b546-41c4-a08b-2f3b2869d462", - "label": "kbt_206(2020) metadata", - "value": "25540" - }, - { - "description": "Jurisdiction Metadata for Chipanta id a74621eb-7dda-4dd4-9dc6-7edfb040442a", - "key": "a74621eb-7dda-4dd4-9dc6-7edfb040442a", - "label": "Chipanta metadata", - "value": "25541" - }, - { - "description": "Jurisdiction Metadata for kbt_238(2020) id af9fe42b-ff10-4e10-bdb1-12b09b4e5e7a", - "key": "af9fe42b-ff10-4e10-bdb1-12b09b4e5e7a", - "label": "kbt_238(2020) metadata", - "value": "25542" - }, - { - "description": "Jurisdiction Metadata for kbt_21(2020) id 0a5fb139-e1e6-469d-9219-23a3046c81dc", - "key": "0a5fb139-e1e6-469d-9219-23a3046c81dc", - "label": "kbt_21(2020) metadata", - "value": "25543" - }, - { - "description": "Jurisdiction Metadata for kbt_99(2020) id 9b0f527f-7fb9-45dd-a306-eb73da4f4aca", - "key": "9b0f527f-7fb9-45dd-a306-eb73da4f4aca", - "label": "kbt_99(2020) metadata", - "value": "25544" - }, - { - "description": "Jurisdiction Metadata for kbt_10(2020) id 5ceeb341-20bb-47c6-b832-c1577d676124", - "key": "5ceeb341-20bb-47c6-b832-c1577d676124", - "label": "kbt_10(2020) metadata", - "value": "25545" - }, - { - "description": "Jurisdiction Metadata for Lupili id b4622346-f745-48a5-b6c3-34a61e0b85d1", - "key": "b4622346-f745-48a5-b6c3-34a61e0b85d1", - "label": "Lupili metadata", - "value": "25546" - }, - { - "description": "Jurisdiction Metadata for kbt_156(2020) id 93fc1924-6089-423f-966b-3405652d75b4", - "key": "93fc1924-6089-423f-966b-3405652d75b4", - "label": "kbt_156(2020) metadata", - "value": "25547" - }, - { - "description": "Jurisdiction Metadata for kbt_129(2020) id b786e4ce-e51c-483b-a2b5-da7bd3c8e5c2", - "key": "b786e4ce-e51c-483b-a2b5-da7bd3c8e5c2", - "label": "kbt_129(2020) metadata", - "value": "25548" - }, - { - "description": "Jurisdiction Metadata for kbt_219(2020) id 3b1ecb44-9988-40fe-95fc-affbd2bac9ae", - "key": "3b1ecb44-9988-40fe-95fc-affbd2bac9ae", - "label": "kbt_219(2020) metadata", - "value": "25549" - }, - { - "description": "Jurisdiction Metadata for kbt_233(2020) id f7a8e512-8bde-47da-b143-97e0d686aa3d", - "key": "f7a8e512-8bde-47da-b143-97e0d686aa3d", - "label": "kbt_233(2020) metadata", - "value": "25550" - }, - { - "description": "Jurisdiction Metadata for kbt_194(2020) id 6c5a4c50-e3f0-48ef-8d39-38ada92bec5a", - "key": "6c5a4c50-e3f0-48ef-8d39-38ada92bec5a", - "label": "kbt_194(2020) metadata", - "value": "25551" - }, - { - "description": "Jurisdiction Metadata for kbt_208(2020) id 4c0375b5-73b2-40ee-9e9d-cdb26c41e57c", - "key": "4c0375b5-73b2-40ee-9e9d-cdb26c41e57c", - "label": "kbt_208(2020) metadata", - "value": "25552" - }, - { - "description": "Jurisdiction Metadata for kbt_204(2020) id 6ee20e95-dfdd-4e00-8119-626c80a8d398", - "key": "6ee20e95-dfdd-4e00-8119-626c80a8d398", - "label": "kbt_204(2020) metadata", - "value": "25553" - }, - { - "description": "Jurisdiction Metadata for kbt_134(2020) id 88cc2c0d-3c8f-4b7e-93b3-48907d782581", - "key": "88cc2c0d-3c8f-4b7e-93b3-48907d782581", - "label": "kbt_134(2020) metadata", - "value": "25554" - }, - { - "description": "Jurisdiction Metadata for kbt_7(2020) id 035d8d1e-2f49-4f0f-838c-7ee3efe04ded", - "key": "035d8d1e-2f49-4f0f-838c-7ee3efe04ded", - "label": "kbt_7(2020) metadata", - "value": "25555" - }, - { - "description": "Jurisdiction Metadata for kbt_116(2020) id f9e2e042-b742-47f6-b143-d8dc75ce7ae3", - "key": "f9e2e042-b742-47f6-b143-d8dc75ce7ae3", - "label": "kbt_116(2020) metadata", - "value": "25556" - }, - { - "description": "Jurisdiction Metadata for kbt_113(2020) id 45c021a1-bab5-49ed-8c81-f780c6709774", - "key": "45c021a1-bab5-49ed-8c81-f780c6709774", - "label": "kbt_113(2020) metadata", - "value": "25557" - }, - { - "description": "Jurisdiction Metadata for kbt_158(2020) id 6a70e07b-c045-481c-a12a-8ef2dc5966fd", - "key": "6a70e07b-c045-481c-a12a-8ef2dc5966fd", - "label": "kbt_158(2020) metadata", - "value": "25558" - }, - { - "description": "Jurisdiction Metadata for kbt_118(2020) id 4b05175f-459b-4a89-8aff-fca545fce903", - "key": "4b05175f-459b-4a89-8aff-fca545fce903", - "label": "kbt_118(2020) metadata", - "value": "25559" - }, - { - "description": "Jurisdiction Metadata for kbt_237(2020) id 8a09afb6-8cb8-4334-80cd-3f8adea9d850", - "key": "8a09afb6-8cb8-4334-80cd-3f8adea9d850", - "label": "kbt_237(2020) metadata", - "value": "25560" - }, - { - "description": "Jurisdiction Metadata for kbt_107(2020) id 2f31872f-9043-4a53-8a10-405f72873242", - "key": "2f31872f-9043-4a53-8a10-405f72873242", - "label": "kbt_107(2020) metadata", - "value": "25561" - }, - { - "description": "Jurisdiction Metadata for kbt_157(2020) id 6c2bd582-13b7-4b65-b5f3-a9c901badda3", - "key": "6c2bd582-13b7-4b65-b5f3-a9c901badda3", - "label": "kbt_157(2020) metadata", - "value": "25562" - }, - { - "description": "Jurisdiction Metadata for kbt_189(2020) id 394c4e3e-a896-49d6-b7a2-fc309dba4dc4", - "key": "394c4e3e-a896-49d6-b7a2-fc309dba4dc4", - "label": "kbt_189(2020) metadata", - "value": "25563" - }, - { - "description": "Jurisdiction Metadata for Chishima id e4809e9d-eeea-454d-af28-5d03eec31928", - "key": "e4809e9d-eeea-454d-af28-5d03eec31928", - "label": "Chishima metadata", - "value": "25564" - }, - { - "description": "Jurisdiction Metadata for kbt_1(2020) id 5f1d04e9-47db-4acf-9e37-32773e189772", - "key": "5f1d04e9-47db-4acf-9e37-32773e189772", - "label": "kbt_1(2020) metadata", - "value": "25565" - }, - { - "description": "Jurisdiction Metadata for kbt_222(2020) id 04aa5214-4bd3-4887-b1bf-7dbe56666ef2", - "key": "04aa5214-4bd3-4887-b1bf-7dbe56666ef2", - "label": "kbt_222(2020) metadata", - "value": "25566" - }, - { - "description": "Jurisdiction Metadata for kbt_125(2020) id 1de81dd0-cd19-4474-bda7-b07f8898c7a3", - "key": "1de81dd0-cd19-4474-bda7-b07f8898c7a3", - "label": "kbt_125(2020) metadata", - "value": "25567" - }, - { - "description": "Jurisdiction Metadata for kbt_183(2020) id 78de32df-a640-46c5-8a26-4277ebef3c87", - "key": "78de32df-a640-46c5-8a26-4277ebef3c87", - "label": "kbt_183(2020) metadata", - "value": "25568" - }, - { - "description": "Jurisdiction Metadata for kbt_151(2020) id 81e92873-a34b-4735-876d-543a5aeca93f", - "key": "81e92873-a34b-4735-876d-543a5aeca93f", - "label": "kbt_151(2020) metadata", - "value": "25569" - }, - { - "description": "Jurisdiction Metadata for kbt_152(2020) id ce6ffe9a-fb6c-4c1e-a5e6-6f6f7561b18f", - "key": "ce6ffe9a-fb6c-4c1e-a5e6-6f6f7561b18f", - "label": "kbt_152(2020) metadata", - "value": "25570" - }, - { - "description": "Jurisdiction Metadata for Chifwalo id ef5f350c-1cff-4cb7-a81f-37b1df67a901", - "key": "ef5f350c-1cff-4cb7-a81f-37b1df67a901", - "label": "Chifwalo metadata", - "value": "25571" - }, - { - "description": "Jurisdiction Metadata for kbt_11(2020) id 33baa300-fcbf-4b38-8f05-6bb176c72a9a", - "key": "33baa300-fcbf-4b38-8f05-6bb176c72a9a", - "label": "kbt_11(2020) metadata", - "value": "25572" - }, - { - "description": "Jurisdiction Metadata for Kayope id 2aa9367e-87b2-43bb-baae-4b8632346449", - "key": "2aa9367e-87b2-43bb-baae-4b8632346449", - "label": "Kayope metadata", - "value": "25573" - }, - { - "description": "Jurisdiction Metadata for kbt_205(2020) id 8275525a-fdcc-4c84-95c1-33ff1b7d0238", - "key": "8275525a-fdcc-4c84-95c1-33ff1b7d0238", - "label": "kbt_205(2020) metadata", - "value": "25574" - }, - { - "description": "Jurisdiction Metadata for kbt_154(2020) id f35dcdea-012c-48ef-8f34-2e9fd68b3d95", - "key": "f35dcdea-012c-48ef-8f34-2e9fd68b3d95", - "label": "kbt_154(2020) metadata", - "value": "25575" - }, - { - "description": "Jurisdiction Metadata for kbt_65(2020) id 051a4cb4-1f0e-42af-abcc-2adadcca22fb", - "key": "051a4cb4-1f0e-42af-abcc-2adadcca22fb", - "label": "kbt_65(2020) metadata", - "value": "25576" - }, - { - "description": "Jurisdiction Metadata for kbt_153(2020) id b64b823b-a417-4d1e-b1a8-e2139297e2eb", - "key": "b64b823b-a417-4d1e-b1a8-e2139297e2eb", - "label": "kbt_153(2020) metadata", - "value": "25577" - }, - { - "description": "Jurisdiction Metadata for kbt_155(2020) id 1811f995-b1a7-4abe-a178-5d1c462a075b", - "key": "1811f995-b1a7-4abe-a178-5d1c462a075b", - "label": "kbt_155(2020) metadata", - "value": "25578" - }, - { - "description": "Jurisdiction Metadata for kbt_108(2020) id d8f8bb56-c629-4529-96b2-53c3a9bef641", - "key": "d8f8bb56-c629-4529-96b2-53c3a9bef641", - "label": "kbt_108(2020) metadata", - "value": "25579" - }, - { - "description": "Jurisdiction Metadata for kbt_123(2020) id 809d06f0-f69f-489f-affe-c13f13398b8a", - "key": "809d06f0-f69f-489f-affe-c13f13398b8a", - "label": "kbt_123(2020) metadata", - "value": "25580" - }, - { - "description": "Jurisdiction Metadata for kbt_217(2020) id 31a09fa9-7075-4450-972d-586c4bd456c4", - "key": "31a09fa9-7075-4450-972d-586c4bd456c4", - "label": "kbt_217(2020) metadata", - "value": "25581" - }, - { - "description": "Jurisdiction Metadata for kbt_191(2020) id 0e702a11-4933-43f5-9a7e-2626a132696d", - "key": "0e702a11-4933-43f5-9a7e-2626a132696d", - "label": "kbt_191(2020) metadata", - "value": "25582" - }, - { - "description": "Jurisdiction Metadata for kbt_221(2020) id af2682d9-d986-479c-a496-e4c32dea9693", - "key": "af2682d9-d986-479c-a496-e4c32dea9693", - "label": "kbt_221(2020) metadata", - "value": "25583" - }, - { - "description": "Jurisdiction Metadata for kbt_3(2020) id 7544f4dd-2381-4862-9efa-94b959fac166", - "key": "7544f4dd-2381-4862-9efa-94b959fac166", - "label": "kbt_3(2020) metadata", - "value": "25584" - }, - { - "description": "Jurisdiction Metadata for Kapela id b58a69a7-fda7-46b6-b15b-602b21ebd1f9", - "key": "b58a69a7-fda7-46b6-b15b-602b21ebd1f9", - "label": "Kapela metadata", - "value": "25585" - }, - { - "description": "Jurisdiction Metadata for kbt_186(2020) id b0ed7ebe-254e-4398-aa46-461dddac5c4b", - "key": "b0ed7ebe-254e-4398-aa46-461dddac5c4b", - "label": "kbt_186(2020) metadata", - "value": "25586" - }, - { - "description": "Jurisdiction Metadata for kbt_149(2020) id df77811a-1ad8-40cb-a2e0-5bac4b01547d", - "key": "df77811a-1ad8-40cb-a2e0-5bac4b01547d", - "label": "kbt_149(2020) metadata", - "value": "25587" - }, - { - "description": "Jurisdiction Metadata for kbt_5(2020) id 23073932-3348-433d-84ce-061d9582f0ff", - "key": "23073932-3348-433d-84ce-061d9582f0ff", - "label": "kbt_5(2020) metadata", - "value": "25588" - }, - { - "description": "Jurisdiction Metadata for kbt_150(2020) id aa0b68fc-d402-4049-bde3-0159d4727be0", - "key": "aa0b68fc-d402-4049-bde3-0159d4727be0", - "label": "kbt_150(2020) metadata", - "value": "25589" - }, - { - "description": "Jurisdiction Metadata for Sekeleti id 4e4d0285-1d35-4bbd-ae23-9c91c6a2dda6", - "key": "4e4d0285-1d35-4bbd-ae23-9c91c6a2dda6", - "label": "Sekeleti metadata", - "value": "25590" - }, - { - "description": "Jurisdiction Metadata for kbt_143(2020) id 7255bc2f-3296-46f1-8ff4-8b6b0d442a2a", - "key": "7255bc2f-3296-46f1-8ff4-8b6b0d442a2a", - "label": "kbt_143(2020) metadata", - "value": "25591" - }, - { - "description": "Jurisdiction Metadata for kbt_185(2020) id 954e094d-5acc-4747-ab62-6d699b55889d", - "key": "954e094d-5acc-4747-ab62-6d699b55889d", - "label": "kbt_185(2020) metadata", - "value": "25592" - }, - { - "description": "Jurisdiction Metadata for kbt_196(2020) id b203de26-e28c-4771-aeb7-2b6e5d36acfb", - "key": "b203de26-e28c-4771-aeb7-2b6e5d36acfb", - "label": "kbt_196(2020) metadata", - "value": "25593" - }, - { - "description": "Jurisdiction Metadata for kbt_92(2020) id c1b9efaf-0e57-4e6b-a880-18e91c95f4a1", - "key": "c1b9efaf-0e57-4e6b-a880-18e91c95f4a1", - "label": "kbt_92(2020) metadata", - "value": "25594" - }, - { - "description": "Jurisdiction Metadata for kbt_93(2020) id 28dd345b-c33a-444f-9d08-5834a95beb51", - "key": "28dd345b-c33a-444f-9d08-5834a95beb51", - "label": "kbt_93(2020) metadata", - "value": "25595" - }, - { - "description": "Jurisdiction Metadata for kbt_81(2020) id 8465e067-2006-4e88-b285-ae27b7be2e2e", - "key": "8465e067-2006-4e88-b285-ae27b7be2e2e", - "label": "kbt_81(2020) metadata", - "value": "25596" - }, - { - "description": "Jurisdiction Metadata for kbt_4(2020) id 803e0da5-cd69-4a67-bffe-ccc59a309764", - "key": "803e0da5-cd69-4a67-bffe-ccc59a309764", - "label": "kbt_4(2020) metadata", - "value": "25597" - }, - { - "description": "Jurisdiction Metadata for kbt_229(2020) id 54e28784-28b4-402b-9265-d211ce3dad19", - "key": "54e28784-28b4-402b-9265-d211ce3dad19", - "label": "kbt_229(2020) metadata", - "value": "25598" - }, - { - "description": "Jurisdiction Metadata for kbt_74(2020) id db0c09d4-05f0-4d41-b959-09b987089054", - "key": "db0c09d4-05f0-4d41-b959-09b987089054", - "label": "kbt_74(2020) metadata", - "value": "25599" - }, - { - "description": "Jurisdiction Metadata for Lusha id 5d00b165-69dc-4db3-9cf3-f0b8448a8311", - "key": "5d00b165-69dc-4db3-9cf3-f0b8448a8311", - "label": "Lusha metadata", - "value": "25600" - }, - { - "description": "Jurisdiction Metadata for kbt_100(2020) id 3ae3f851-716c-4502-a2bb-4bb98790b6a8", - "key": "3ae3f851-716c-4502-a2bb-4bb98790b6a8", - "label": "kbt_100(2020) metadata", - "value": "25601" - }, - { - "description": "Jurisdiction Metadata for kbt_193(2020) id d91bff1d-5a71-49c6-adbf-6cdbb3e95be7", - "key": "d91bff1d-5a71-49c6-adbf-6cdbb3e95be7", - "label": "kbt_193(2020) metadata", - "value": "25602" - }, - { - "description": "Jurisdiction Metadata for kbt_66(2020) id cbff4c00-7ccb-447d-b13b-f57e1d3103e2", - "key": "cbff4c00-7ccb-447d-b13b-f57e1d3103e2", - "label": "kbt_66(2020) metadata", - "value": "25603" - }, - { - "description": "Jurisdiction Metadata for kbt_36(2020) id df454170-42c3-4f6f-9c53-9d2347800d3c", - "key": "df454170-42c3-4f6f-9c53-9d2347800d3c", - "label": "kbt_36(2020) metadata", - "value": "25604" - }, - { - "description": "Jurisdiction Metadata for kbt_174(2020) id ccf96794-02a2-4a6b-b5a5-89d9a301a1f5", - "key": "ccf96794-02a2-4a6b-b5a5-89d9a301a1f5", - "label": "kbt_174(2020) metadata", - "value": "25605" - }, - { - "description": "Jurisdiction Metadata for kbt_9(2020) id 54f8b369-16cb-40e4-83d4-eb6c9f7ebab4", - "key": "54f8b369-16cb-40e4-83d4-eb6c9f7ebab4", - "label": "kbt_9(2020) metadata", - "value": "25606" - }, - { - "description": "Jurisdiction Metadata for kbt_111(2020) id db332510-070b-48f1-afba-2a04f38bd090", - "key": "db332510-070b-48f1-afba-2a04f38bd090", - "label": "kbt_111(2020) metadata", - "value": "25607" - }, - { - "description": "Jurisdiction Metadata for kbt_176(2020) id 5df61234-e41f-4b07-9bc8-ccada7192726", - "key": "5df61234-e41f-4b07-9bc8-ccada7192726", - "label": "kbt_176(2020) metadata", - "value": "25608" - }, - { - "description": "Jurisdiction Metadata for kbt_2(2020) id 71aad902-9dc7-4d09-978a-4d514315a9c7", - "key": "71aad902-9dc7-4d09-978a-4d514315a9c7", - "label": "kbt_2(2020) metadata", - "value": "25609" - }, - { - "description": "Jurisdiction Metadata for kbt_58(2020) id eb1f9059-af18-4190-867a-8e557965bd42", - "key": "eb1f9059-af18-4190-867a-8e557965bd42", - "label": "kbt_58(2020) metadata", - "value": "25610" - }, - { - "description": "Jurisdiction Metadata for kbt_20(2020) id 36e43c3d-1617-4cdb-8c77-56f122896b02", - "key": "36e43c3d-1617-4cdb-8c77-56f122896b02", - "label": "kbt_20(2020) metadata", - "value": "25611" - }, - { - "description": "Jurisdiction Metadata for kbt_46(2020) id f5da4e50-28ea-4d12-8d70-792db7848ad4", - "key": "f5da4e50-28ea-4d12-8d70-792db7848ad4", - "label": "kbt_46(2020) metadata", - "value": "25612" - }, - { - "description": "Jurisdiction Metadata for kbt_91(2020) id bc5c891a-4a17-4a5c-af7a-a8da2edba277", - "key": "bc5c891a-4a17-4a5c-af7a-a8da2edba277", - "label": "kbt_91(2020) metadata", - "value": "25613" - }, - { - "description": "Jurisdiction Metadata for kbt_175(2020) id 9a99fdf6-ad36-472f-b162-3d8093db4899", - "key": "9a99fdf6-ad36-472f-b162-3d8093db4899", - "label": "kbt_175(2020) metadata", - "value": "25614" - }, - { - "description": "Jurisdiction Metadata for kbt_188(2020) id 13a49096-8a14-4916-a659-1363659f8c8a", - "key": "13a49096-8a14-4916-a659-1363659f8c8a", - "label": "kbt_188(2020) metadata", - "value": "25615" - }, - { - "description": "Jurisdiction Metadata for kbt_59(2020) id 4a7673a4-c43e-4d54-aedc-03c8750cc714", - "key": "4a7673a4-c43e-4d54-aedc-03c8750cc714", - "label": "kbt_59(2020) metadata", - "value": "25616" - }, - { - "description": "Jurisdiction Metadata for kbt_121(2020) id d95a5994-0351-4fd6-82c4-3ef640b6e261", - "key": "d95a5994-0351-4fd6-82c4-3ef640b6e261", - "label": "kbt_121(2020) metadata", - "value": "25617" - }, - { - "description": "Jurisdiction Metadata for kbt_28(2020) id ec5c32f5-38ae-4639-8438-b98fb89d12c9", - "key": "ec5c32f5-38ae-4639-8438-b98fb89d12c9", - "label": "kbt_28(2020) metadata", - "value": "25618" - }, - { - "description": "Jurisdiction Metadata for kbt_88(2020) id 146095c6-902a-4b6a-9e7c-bc9ab2fb5943", - "key": "146095c6-902a-4b6a-9e7c-bc9ab2fb5943", - "label": "kbt_88(2020) metadata", - "value": "25619" - }, - { - "description": "Jurisdiction Metadata for kbt_101(2020) id 44add25d-d578-4487-88bc-44db9e25b291", - "key": "44add25d-d578-4487-88bc-44db9e25b291", - "label": "kbt_101(2020) metadata", - "value": "25620" - }, - { - "description": "Jurisdiction Metadata for kbt_114(2020) id 3bc782f6-f1a6-4bba-b67d-d696afdbb63e", - "key": "3bc782f6-f1a6-4bba-b67d-d696afdbb63e", - "label": "kbt_114(2020) metadata", - "value": "25621" - }, - { - "description": "Jurisdiction Metadata for kbt_72(2020) id cef78efe-1072-4bba-8654-be200e80e070", - "key": "cef78efe-1072-4bba-8654-be200e80e070", - "label": "kbt_72(2020) metadata", - "value": "25622" - }, - { - "description": "Jurisdiction Metadata for kbt_64(2020) id cc0086d2-aa2b-472a-8a7c-bf7cba61c03c", - "key": "cc0086d2-aa2b-472a-8a7c-bf7cba61c03c", - "label": "kbt_64(2020) metadata", - "value": "25623" - }, - { - "description": "Jurisdiction Metadata for kbt_202(2020) id 223b2e5a-d168-43e6-a44e-b603da958001", - "key": "223b2e5a-d168-43e6-a44e-b603da958001", - "label": "kbt_202(2020) metadata", - "value": "25624" - }, - { - "description": "Jurisdiction Metadata for kbt_80(2020) id 1a4cf9fd-5525-4379-ab7e-023d08ab15f6", - "key": "1a4cf9fd-5525-4379-ab7e-023d08ab15f6", - "label": "kbt_80(2020) metadata", - "value": "25625" - }, - { - "description": "Jurisdiction Metadata for kbt_35(2020) id ff3b6d71-c152-4f89-9737-3fb135fc1c11", - "key": "ff3b6d71-c152-4f89-9737-3fb135fc1c11", - "label": "kbt_35(2020) metadata", - "value": "25626" - }, - { - "description": "Jurisdiction Metadata for kbt_79(2020) id a91ff9a5-5295-4987-aaf4-32329982ffb5", - "key": "a91ff9a5-5295-4987-aaf4-32329982ffb5", - "label": "kbt_79(2020) metadata", - "value": "25627" - }, - { - "description": "Jurisdiction Metadata for kbt_105(2020) id f64d4edf-4370-4dac-9687-80d1d822ba65", - "key": "f64d4edf-4370-4dac-9687-80d1d822ba65", - "label": "kbt_105(2020) metadata", - "value": "25628" - }, - { - "description": "Jurisdiction Metadata for kbt_41(2020) id 3315802e-fd90-4721-a131-7251b6a5d2a7", - "key": "3315802e-fd90-4721-a131-7251b6a5d2a7", - "label": "kbt_41(2020) metadata", - "value": "25629" - }, - { - "description": "Jurisdiction Metadata for Mulanga id df5a5119-8c3d-48f0-a44e-afa1151c81d0", - "key": "df5a5119-8c3d-48f0-a44e-afa1151c81d0", - "label": "Mulanga metadata", - "value": "25630" - }, - { - "description": "Jurisdiction Metadata for kbt_8(2020) id bb72d91a-8b3f-4837-af7c-70ca4db9a7b8", - "key": "bb72d91a-8b3f-4837-af7c-70ca4db9a7b8", - "label": "kbt_8(2020) metadata", - "value": "25631" - }, - { - "description": "Jurisdiction Metadata for kbt_63(2020) id dd129a36-b3bb-4ed9-99de-9c20d2fa82a0", - "key": "dd129a36-b3bb-4ed9-99de-9c20d2fa82a0", - "label": "kbt_63(2020) metadata", - "value": "25632" - }, - { - "description": "Jurisdiction Metadata for kbt_127(2020) id ace48888-85e4-46fc-8d8d-f98cf7421604", - "key": "ace48888-85e4-46fc-8d8d-f98cf7421604", - "label": "kbt_127(2020) metadata", - "value": "25633" - }, - { - "description": "Jurisdiction Metadata for kbt_87(2020) id a30b0a31-c078-4100-b45e-8cace56ef03d", - "key": "a30b0a31-c078-4100-b45e-8cace56ef03d", - "label": "kbt_87(2020) metadata", - "value": "25634" - }, - { - "description": "Jurisdiction Metadata for kbt_19(2020) id 829983ff-d0fc-4304-a13d-fa888bb22107", - "key": "829983ff-d0fc-4304-a13d-fa888bb22107", - "label": "kbt_19(2020) metadata", - "value": "25635" - }, - { - "description": "Jurisdiction Metadata for kbt_147(2020) id 12d564a9-3f90-4838-b3af-026c9bc0c1ad", - "key": "12d564a9-3f90-4838-b3af-026c9bc0c1ad", - "label": "kbt_147(2020) metadata", - "value": "25636" - }, - { - "description": "Jurisdiction Metadata for kbt_90(2020) id d090f257-c58b-44ce-9cbb-ac94e4995390", - "key": "d090f257-c58b-44ce-9cbb-ac94e4995390", - "label": "kbt_90(2020) metadata", - "value": "25637" - }, - { - "description": "Jurisdiction Metadata for kbt_78(2020) id f1147f63-10d0-4ec1-b3a4-50606c2098ea", - "key": "f1147f63-10d0-4ec1-b3a4-50606c2098ea", - "label": "kbt_78(2020) metadata", - "value": "25638" - }, - { - "description": "Jurisdiction Metadata for kbt_45(2020) id 29e633b0-759b-4c65-aa5a-dfefec71a4b7", - "key": "29e633b0-759b-4c65-aa5a-dfefec71a4b7", - "label": "kbt_45(2020) metadata", - "value": "25639" - }, - { - "description": "Jurisdiction Metadata for kbt_148(2020) id eea7d748-9340-4d6e-8818-bc80bb3f70fa", - "key": "eea7d748-9340-4d6e-8818-bc80bb3f70fa", - "label": "kbt_148(2020) metadata", - "value": "25640" - }, - { - "description": "Jurisdiction Metadata for kbt_40(2020) id 9881e4c8-50b5-42bf-9dc7-88607d0f8553", - "key": "9881e4c8-50b5-42bf-9dc7-88607d0f8553", - "label": "kbt_40(2020) metadata", - "value": "25641" - }, - { - "description": "Jurisdiction Metadata for kbt_110(2020) id 76e5b185-1be0-4743-8d94-852e46956c06", - "key": "76e5b185-1be0-4743-8d94-852e46956c06", - "label": "kbt_110(2020) metadata", - "value": "25642" - }, - { - "description": "Jurisdiction Metadata for kbt_55(2020) id 399542ab-624a-43a2-b0ea-38fba6a7e7ad", - "key": "399542ab-624a-43a2-b0ea-38fba6a7e7ad", - "label": "kbt_55(2020) metadata", - "value": "25643" - }, - { - "description": "Jurisdiction Metadata for kbt_56(2020) id 480cdbca-9b78-4263-a790-17689c463496", - "key": "480cdbca-9b78-4263-a790-17689c463496", - "label": "kbt_56(2020) metadata", - "value": "25644" - }, - { - "description": "Jurisdiction Metadata for kbt_43(2020) id 46a1c277-fb0a-4891-a1db-ff508aa1d4c4", - "key": "46a1c277-fb0a-4891-a1db-ff508aa1d4c4", - "label": "kbt_43(2020) metadata", - "value": "25645" - }, - { - "description": "Jurisdiction Metadata for kbt_34(2020) id 5faf2a92-480d-4463-be73-87f163a63d90", - "key": "5faf2a92-480d-4463-be73-87f163a63d90", - "label": "kbt_34(2020) metadata", - "value": "25646" - }, - { - "description": "Jurisdiction Metadata for kbt_104(2020) id d6ea74dd-ff0f-4b96-b1eb-8eaeb24d5203", - "key": "d6ea74dd-ff0f-4b96-b1eb-8eaeb24d5203", - "label": "kbt_104(2020) metadata", - "value": "25647" - }, - { - "description": "Jurisdiction Metadata for Mulwe(2020) id 7ecaaa10-26c0-42b8-9ba4-a8a45180a0a0", - "key": "7ecaaa10-26c0-42b8-9ba4-a8a45180a0a0", - "label": "Mulwe(2020) metadata", - "value": "25648" - }, - { - "description": "Jurisdiction Metadata for Mulwe Zone id 138563f2-cd93-44db-9564-0fd6ed79b83e", - "key": "138563f2-cd93-44db-9564-0fd6ed79b83e", - "label": "Mulwe Zone metadata", - "value": "25649" - }, - { - "description": "Jurisdiction Metadata for mlw_2(2020) id 20be96e8-e6aa-4028-ad55-502ee5ded9c8", - "key": "20be96e8-e6aa-4028-ad55-502ee5ded9c8", - "label": "mlw_2(2020) metadata", - "value": "25650" - }, - { - "description": "Jurisdiction Metadata for Mukange Zone id 7663e72b-2398-4169-9d13-6679906edbd9", - "key": "7663e72b-2398-4169-9d13-6679906edbd9", - "label": "Mukange Zone metadata", - "value": "25651" - }, - { - "description": "Jurisdiction Metadata for mlw_3(2020) id c7064aca-8e7b-4e10-b14c-6842a3f3c0c0", - "key": "c7064aca-8e7b-4e10-b14c-6842a3f3c0c0", - "label": "mlw_3(2020) metadata", - "value": "25652" - }, - { - "description": "Jurisdiction Metadata for mlw_18(2020) id f7559f51-d99e-4ec8-9687-1b736e7a9008", - "key": "f7559f51-d99e-4ec8-9687-1b736e7a9008", - "label": "mlw_18(2020) metadata", - "value": "25653" - }, - { - "description": "Jurisdiction Metadata for mlw_51(2020) id 94427c11-bfd7-4341-aad6-f9c9161bb418", - "key": "94427c11-bfd7-4341-aad6-f9c9161bb418", - "label": "mlw_51(2020) metadata", - "value": "25654" - }, - { - "description": "Jurisdiction Metadata for mlw_58(2020) id 853ef974-b234-4543-bdac-09dd41c50814", - "key": "853ef974-b234-4543-bdac-09dd41c50814", - "label": "mlw_58(2020) metadata", - "value": "25655" - }, - { - "description": "Jurisdiction Metadata for mlw_83(2020) id 9b5321e9-c072-4d2f-9e33-82b6ab333ad1", - "key": "9b5321e9-c072-4d2f-9e33-82b6ab333ad1", - "label": "mlw_83(2020) metadata", - "value": "25656" - }, - { - "description": "Jurisdiction Metadata for mlw_108(2020) id 1d92f11a-4b38-4a3d-9a79-0f90721ebad1", - "key": "1d92f11a-4b38-4a3d-9a79-0f90721ebad1", - "label": "mlw_108(2020) metadata", - "value": "25657" - }, - { - "description": "Jurisdiction Metadata for mlw_69(2020) id eddb9434-b211-47c3-a6da-412a57861747", - "key": "eddb9434-b211-47c3-a6da-412a57861747", - "label": "mlw_69(2020) metadata", - "value": "25658" - }, - { - "description": "Jurisdiction Metadata for mlw_42(2020) id fa717b79-5df5-4d01-8846-5b53949067d8", - "key": "fa717b79-5df5-4d01-8846-5b53949067d8", - "label": "mlw_42(2020) metadata", - "value": "25659" - }, - { - "description": "Jurisdiction Metadata for Matampala (Nshoka) Zone id 4ff86e2b-4b34-430f-bee0-504719204000", - "key": "4ff86e2b-4b34-430f-bee0-504719204000", - "label": "Matampala (Nshoka) Zone metadata", - "value": "25660" - }, - { - "description": "Jurisdiction Metadata for mlw_79(2020) id 12c863d0-7193-4b3a-921f-cb3f09afdf18", - "key": "12c863d0-7193-4b3a-921f-cb3f09afdf18", - "label": "mlw_79(2020) metadata", - "value": "25661" - }, - { - "description": "Jurisdiction Metadata for mlw_87(2020) id 1f466fd2-bd91-4be4-8601-3e3225fb095c", - "key": "1f466fd2-bd91-4be4-8601-3e3225fb095c", - "label": "mlw_87(2020) metadata", - "value": "25662" - }, - { - "description": "Jurisdiction Metadata for mlw_105(2020) id 3b34c88b-5e37-4cfe-b2d1-d84a1fa41bae", - "key": "3b34c88b-5e37-4cfe-b2d1-d84a1fa41bae", - "label": "mlw_105(2020) metadata", - "value": "25663" - }, - { - "description": "Jurisdiction Metadata for mlw_9(2020) id 103594cb-1ced-4f62-97e4-28bc548a9b61", - "key": "103594cb-1ced-4f62-97e4-28bc548a9b61", - "label": "mlw_9(2020) metadata", - "value": "25664" - }, - { - "description": "Jurisdiction Metadata for mlw_76(2020) id 1a24db18-b6a5-40f6-8e07-35eaa85bc9c5", - "key": "1a24db18-b6a5-40f6-8e07-35eaa85bc9c5", - "label": "mlw_76(2020) metadata", - "value": "25665" - }, - { - "description": "Jurisdiction Metadata for mlw_39(2020) id 2d9457c5-b785-43f0-8795-40c971d47998", - "key": "2d9457c5-b785-43f0-8795-40c971d47998", - "label": "mlw_39(2020) metadata", - "value": "25666" - }, - { - "description": "Jurisdiction Metadata for mlw_31(2020) id cc41a7e5-5ad8-4d66-b52e-6afac301f24c", - "key": "cc41a7e5-5ad8-4d66-b52e-6afac301f24c", - "label": "mlw_31(2020) metadata", - "value": "25667" - }, - { - "description": "Jurisdiction Metadata for mlw_66(2020) id 2b994a1d-7a69-4ab3-8bc1-df6c5e742ef1", - "key": "2b994a1d-7a69-4ab3-8bc1-df6c5e742ef1", - "label": "mlw_66(2020) metadata", - "value": "25668" - }, - { - "description": "Jurisdiction Metadata for mlw_104(2020) id cf93e585-16e8-4e6a-94c3-1f4f53794788", - "key": "cf93e585-16e8-4e6a-94c3-1f4f53794788", - "label": "mlw_104(2020) metadata", - "value": "25669" - }, - { - "description": "Jurisdiction Metadata for mlw_36(2020) id f5d76d5c-47d9-479e-b2c3-25dc623416dd", - "key": "f5d76d5c-47d9-479e-b2c3-25dc623416dd", - "label": "mlw_36(2020) metadata", - "value": "25670" - }, - { - "description": "Jurisdiction Metadata for mlw_123(2020) id 5e964744-4c50-4fcc-86bb-7c75351ac8de", - "key": "5e964744-4c50-4fcc-86bb-7c75351ac8de", - "label": "mlw_123(2020) metadata", - "value": "25671" - }, - { - "description": "Jurisdiction Metadata for mlw_12(2020) id d996deb6-ae36-4198-bda5-8d1c8ba7a1a1", - "key": "d996deb6-ae36-4198-bda5-8d1c8ba7a1a1", - "label": "mlw_12(2020) metadata", - "value": "25672" - }, - { - "description": "Jurisdiction Metadata for mlw_95(2020) id 67e72fc5-3fe3-44f2-91ef-a33d996c99de", - "key": "67e72fc5-3fe3-44f2-91ef-a33d996c99de", - "label": "mlw_95(2020) metadata", - "value": "25673" - }, - { - "description": "Jurisdiction Metadata for mlw_17(2020) id 3b607635-815e-4beb-a766-f1d9d42bbc8f", - "key": "3b607635-815e-4beb-a766-f1d9d42bbc8f", - "label": "mlw_17(2020) metadata", - "value": "25674" - }, - { - "description": "Jurisdiction Metadata for mlw_19(2020) id fa82f61b-65b0-4196-89ab-f811cdceb132", - "key": "fa82f61b-65b0-4196-89ab-f811cdceb132", - "label": "mlw_19(2020) metadata", - "value": "25675" - }, - { - "description": "Jurisdiction Metadata for mlw_52(2020) id 54d46484-bb61-4889-a878-aa7d6457462b", - "key": "54d46484-bb61-4889-a878-aa7d6457462b", - "label": "mlw_52(2020) metadata", - "value": "25676" - }, - { - "description": "Jurisdiction Metadata for mlw_63(2020) id 84fd8831-f8a4-4449-83a1-951647631b8a", - "key": "84fd8831-f8a4-4449-83a1-951647631b8a", - "label": "mlw_63(2020) metadata", - "value": "25677" - }, - { - "description": "Jurisdiction Metadata for mlw_86(2020) id 47d6693a-5d22-49ef-a0e8-51f9a8f15066", - "key": "47d6693a-5d22-49ef-a0e8-51f9a8f15066", - "label": "mlw_86(2020) metadata", - "value": "25678" - }, - { - "description": "Jurisdiction Metadata for mlw_111(2020) id 041d76c4-28f8-4d03-a7bc-f2f49b9cd6c5", - "key": "041d76c4-28f8-4d03-a7bc-f2f49b9cd6c5", - "label": "mlw_111(2020) metadata", - "value": "25679" - }, - { - "description": "Jurisdiction Metadata for mlw_109(2020) id 4e886ffe-ce85-47c2-ac23-cbb636467bdc", - "key": "4e886ffe-ce85-47c2-ac23-cbb636467bdc", - "label": "mlw_109(2020) metadata", - "value": "25680" - }, - { - "description": "Jurisdiction Metadata for mlw_37(2020) id 30b85a2c-ba5f-437a-90a3-9cf6a9c6a968", - "key": "30b85a2c-ba5f-437a-90a3-9cf6a9c6a968", - "label": "mlw_37(2020) metadata", - "value": "25681" - }, - { - "description": "Jurisdiction Metadata for mlw_21(2020) id ac9027cf-86b1-4af4-a997-1fe793b963ba", - "key": "ac9027cf-86b1-4af4-a997-1fe793b963ba", - "label": "mlw_21(2020) metadata", - "value": "25682" - }, - { - "description": "Jurisdiction Metadata for mlw_10(2020) id 566b34bf-987c-469e-a12c-8e7a235741ba", - "key": "566b34bf-987c-469e-a12c-8e7a235741ba", - "label": "mlw_10(2020) metadata", - "value": "25683" - }, - { - "description": "Jurisdiction Metadata for mlw_114(2020) id 1513ec89-756c-4a65-af12-853dc1b4521d", - "key": "1513ec89-756c-4a65-af12-853dc1b4521d", - "label": "mlw_114(2020) metadata", - "value": "25684" - }, - { - "description": "Jurisdiction Metadata for mlw_44(2020) id 2f9cd60f-d6a1-4267-aa6a-fab6e2e61465", - "key": "2f9cd60f-d6a1-4267-aa6a-fab6e2e61465", - "label": "mlw_44(2020) metadata", - "value": "25685" - }, - { - "description": "Jurisdiction Metadata for mlw_112(2020) id 409730fb-8670-4ead-88ea-bcd47c0bf5a4", - "key": "409730fb-8670-4ead-88ea-bcd47c0bf5a4", - "label": "mlw_112(2020) metadata", - "value": "25686" - }, - { - "description": "Jurisdiction Metadata for mlw_64(2020) id 64a46ad3-d0ab-4edc-9e64-625c05ebbea7", - "key": "64a46ad3-d0ab-4edc-9e64-625c05ebbea7", - "label": "mlw_64(2020) metadata", - "value": "25687" - }, - { - "description": "Jurisdiction Metadata for mlw_74(2020) id 4c5a683d-f460-4403-8292-00598d860fef", - "key": "4c5a683d-f460-4403-8292-00598d860fef", - "label": "mlw_74(2020) metadata", - "value": "25688" - }, - { - "description": "Jurisdiction Metadata for mlw_40(2020) id a9fcec05-e5e5-41ac-a4af-2525c501aa98", - "key": "a9fcec05-e5e5-41ac-a4af-2525c501aa98", - "label": "mlw_40(2020) metadata", - "value": "25689" - }, - { - "description": "Jurisdiction Metadata for mlw_20(2020) id 3de69914-1d53-4830-9a0c-b3a88109148c", - "key": "3de69914-1d53-4830-9a0c-b3a88109148c", - "label": "mlw_20(2020) metadata", - "value": "25690" - }, - { - "description": "Jurisdiction Metadata for mlw_110(2020) id 6e27dab3-592e-4a92-9d23-9b4a5b2785e3", - "key": "6e27dab3-592e-4a92-9d23-9b4a5b2785e3", - "label": "mlw_110(2020) metadata", - "value": "25691" - }, - { - "description": "Jurisdiction Metadata for mlw_72(2020) id 8eca4b71-c2fd-4a01-9ca2-df3c3ab915ae", - "key": "8eca4b71-c2fd-4a01-9ca2-df3c3ab915ae", - "label": "mlw_72(2020) metadata", - "value": "25692" - }, - { - "description": "Jurisdiction Metadata for mlw_91(2020) id 41c64898-63c8-4a04-b5f5-49faa0c02965", - "key": "41c64898-63c8-4a04-b5f5-49faa0c02965", - "label": "mlw_91(2020) metadata", - "value": "25693" - }, - { - "description": "Jurisdiction Metadata for mlw_106(2020) id 617e4f82-cbb4-453e-bb31-634987d26564", - "key": "617e4f82-cbb4-453e-bb31-634987d26564", - "label": "mlw_106(2020) metadata", - "value": "25694" - }, - { - "description": "Jurisdiction Metadata for mlw_60(2020) id e237494f-9115-4b2f-bc51-aea5757bef3d", - "key": "e237494f-9115-4b2f-bc51-aea5757bef3d", - "label": "mlw_60(2020) metadata", - "value": "25695" - }, - { - "description": "Jurisdiction Metadata for mlw_22(2020) id e9403563-a584-45ac-a877-747dccabdd4f", - "key": "e9403563-a584-45ac-a877-747dccabdd4f", - "label": "mlw_22(2020) metadata", - "value": "25696" - }, - { - "description": "Jurisdiction Metadata for mlw_34(2020) id 8955231f-b283-4f62-8494-d48ef2b5ffbf", - "key": "8955231f-b283-4f62-8494-d48ef2b5ffbf", - "label": "mlw_34(2020) metadata", - "value": "25697" - }, - { - "description": "Jurisdiction Metadata for mlw_78(2020) id acbff628-9920-4e05-8421-060992586067", - "key": "acbff628-9920-4e05-8421-060992586067", - "label": "mlw_78(2020) metadata", - "value": "25698" - }, - { - "description": "Jurisdiction Metadata for mlw_30(2020) id 4ee8c7a2-e15d-4962-9a0a-33a83057e2ca", - "key": "4ee8c7a2-e15d-4962-9a0a-33a83057e2ca", - "label": "mlw_30(2020) metadata", - "value": "25699" - }, - { - "description": "Jurisdiction Metadata for mlw_41(2020) id 7330d82c-bd5a-4a7f-ac1d-c1c1dc7f6a92", - "key": "7330d82c-bd5a-4a7f-ac1d-c1c1dc7f6a92", - "label": "mlw_41(2020) metadata", - "value": "25700" - }, - { - "description": "Jurisdiction Metadata for mlw_16(2020) id 889ece0a-d81d-4117-9aca-5bce0c1f530e", - "key": "889ece0a-d81d-4117-9aca-5bce0c1f530e", - "label": "mlw_16(2020) metadata", - "value": "25701" - }, - { - "description": "Jurisdiction Metadata for mlw_80(2020) id b80597d1-97ca-48c2-8825-3203096f53a9", - "key": "b80597d1-97ca-48c2-8825-3203096f53a9", - "label": "mlw_80(2020) metadata", - "value": "25702" - }, - { - "description": "Jurisdiction Metadata for mlw_71(2020) id 20b5319b-60ff-48a1-9f0e-3abd79a44c9d", - "key": "20b5319b-60ff-48a1-9f0e-3abd79a44c9d", - "label": "mlw_71(2020) metadata", - "value": "25703" - }, - { - "description": "Jurisdiction Metadata for mlw_28(2020) id 60957d5f-e555-401e-93e5-2440b93bfbaa", - "key": "60957d5f-e555-401e-93e5-2440b93bfbaa", - "label": "mlw_28(2020) metadata", - "value": "25704" - }, - { - "description": "Jurisdiction Metadata for mlw_101(2020) id daf0e634-9f2a-477d-bb3a-c6776e1dd01f", - "key": "daf0e634-9f2a-477d-bb3a-c6776e1dd01f", - "label": "mlw_101(2020) metadata", - "value": "25705" - }, - { - "description": "Jurisdiction Metadata for mlw_46(2020) id 7ea34856-f66c-4e24-b9f1-ecc5a597417c", - "key": "7ea34856-f66c-4e24-b9f1-ecc5a597417c", - "label": "mlw_46(2020) metadata", - "value": "25706" - }, - { - "description": "Jurisdiction Metadata for mlw_15(2020) id 25f6b874-9fe7-4059-8c0f-722631192da9", - "key": "25f6b874-9fe7-4059-8c0f-722631192da9", - "label": "mlw_15(2020) metadata", - "value": "25707" - }, - { - "description": "Jurisdiction Metadata for mlw_113(2020) id 3acb3e17-ef9f-4e68-af76-75e6c515cb2a", - "key": "3acb3e17-ef9f-4e68-af76-75e6c515cb2a", - "label": "mlw_113(2020) metadata", - "value": "25708" - }, - { - "description": "Jurisdiction Metadata for mlw_55(2020) id d19ab460-7f3f-4838-a008-c3848da662bb", - "key": "d19ab460-7f3f-4838-a008-c3848da662bb", - "label": "mlw_55(2020) metadata", - "value": "25709" - }, - { - "description": "Jurisdiction Metadata for mlw_100(2020) id 6fe9fc2b-811b-4571-89f2-8253bb82e3df", - "key": "6fe9fc2b-811b-4571-89f2-8253bb82e3df", - "label": "mlw_100(2020) metadata", - "value": "25710" - }, - { - "description": "Jurisdiction Metadata for mlw_116(2020) id 5109e1b5-b002-44d3-a0c8-f0ca13ab6d21", - "key": "5109e1b5-b002-44d3-a0c8-f0ca13ab6d21", - "label": "mlw_116(2020) metadata", - "value": "25711" - }, - { - "description": "Jurisdiction Metadata for mlw_103(2020) id f73b575e-d06c-4caf-8061-398cc732318e", - "key": "f73b575e-d06c-4caf-8061-398cc732318e", - "label": "mlw_103(2020) metadata", - "value": "25712" - }, - { - "description": "Jurisdiction Metadata for mlw_56(2020) id b3293ea4-ac4c-4202-b51d-030f18910e52", - "key": "b3293ea4-ac4c-4202-b51d-030f18910e52", - "label": "mlw_56(2020) metadata", - "value": "25713" - }, - { - "description": "Jurisdiction Metadata for mlw_65(2020) id b95e4473-85f7-474d-9db7-393c8e9c33ba", - "key": "b95e4473-85f7-474d-9db7-393c8e9c33ba", - "label": "mlw_65(2020) metadata", - "value": "25714" - }, - { - "description": "Jurisdiction Metadata for mlw_54(2020) id 72d86874-6943-4ec6-98c8-bfd0046d109b", - "key": "72d86874-6943-4ec6-98c8-bfd0046d109b", - "label": "mlw_54(2020) metadata", - "value": "25715" - }, - { - "description": "Jurisdiction Metadata for mlw_45(2020) id 9d46f6ea-2520-4d15-ba0e-5b27d78ab91a", - "key": "9d46f6ea-2520-4d15-ba0e-5b27d78ab91a", - "label": "mlw_45(2020) metadata", - "value": "25716" - }, - { - "description": "Jurisdiction Metadata for mlw_92(2020) id a4c5b2a3-ef7e-4e0b-8720-6a982d15ab30", - "key": "a4c5b2a3-ef7e-4e0b-8720-6a982d15ab30", - "label": "mlw_92(2020) metadata", - "value": "25717" - }, - { - "description": "Jurisdiction Metadata for mlw_33(2020) id 35d00506-a893-4312-906d-62a09f2c5ddc", - "key": "35d00506-a893-4312-906d-62a09f2c5ddc", - "label": "mlw_33(2020) metadata", - "value": "25718" - }, - { - "description": "Jurisdiction Metadata for mlw_25(2020) id 3741db87-1a94-46d6-8a7f-99b012139b88", - "key": "3741db87-1a94-46d6-8a7f-99b012139b88", - "label": "mlw_25(2020) metadata", - "value": "25719" - }, - { - "description": "Jurisdiction Metadata for mlw_6(2020) id 7ccc4b35-96b0-4967-98e7-26152dfd4aae", - "key": "7ccc4b35-96b0-4967-98e7-26152dfd4aae", - "label": "mlw_6(2020) metadata", - "value": "25720" - }, - { - "description": "Jurisdiction Metadata for mlw_89(2020) id 2bdff13f-1ded-4113-a917-0bb153abe274", - "key": "2bdff13f-1ded-4113-a917-0bb153abe274", - "label": "mlw_89(2020) metadata", - "value": "25721" - }, - { - "description": "Jurisdiction Metadata for mlw_97(2020) id 327f19f1-cb99-493f-8d45-c44898b3d9ab", - "key": "327f19f1-cb99-493f-8d45-c44898b3d9ab", - "label": "mlw_97(2020) metadata", - "value": "25722" - }, - { - "description": "Jurisdiction Metadata for mlw_49(2020) id 9fa4fa3d-20cf-4042-ba5d-d50d440afedc", - "key": "9fa4fa3d-20cf-4042-ba5d-d50d440afedc", - "label": "mlw_49(2020) metadata", - "value": "25723" - }, - { - "description": "Jurisdiction Metadata for mlw_117(2020) id 9641192c-a4b9-489d-9698-8000dcb542fc", - "key": "9641192c-a4b9-489d-9698-8000dcb542fc", - "label": "mlw_117(2020) metadata", - "value": "25724" - }, - { - "description": "Jurisdiction Metadata for mlw_107(2020) id aa995fbe-cac2-4b95-b644-ba31aa14db87", - "key": "aa995fbe-cac2-4b95-b644-ba31aa14db87", - "label": "mlw_107(2020) metadata", - "value": "25725" - }, - { - "description": "Jurisdiction Metadata for mlw_98(2020) id e6d45528-c83e-4754-80d0-b2345a14813a", - "key": "e6d45528-c83e-4754-80d0-b2345a14813a", - "label": "mlw_98(2020) metadata", - "value": "25726" - }, - { - "description": "Jurisdiction Metadata for mlw_73(2020) id 38d1c892-5860-4e61-a859-1712b6bfdd7f", - "key": "38d1c892-5860-4e61-a859-1712b6bfdd7f", - "label": "mlw_73(2020) metadata", - "value": "25727" - }, - { - "description": "Jurisdiction Metadata for mlw_62(2020) id 83562b14-d722-494a-81dd-0d26c609973a", - "key": "83562b14-d722-494a-81dd-0d26c609973a", - "label": "mlw_62(2020) metadata", - "value": "25728" - }, - { - "description": "Jurisdiction Metadata for mlw_118(2020) id e00724df-2126-4777-8c11-1f801546b671", - "key": "e00724df-2126-4777-8c11-1f801546b671", - "label": "mlw_118(2020) metadata", - "value": "25729" - }, - { - "description": "Jurisdiction Metadata for mlw_7(2020) id 5c119c3b-1199-48a2-8149-0a77fe50673a", - "key": "5c119c3b-1199-48a2-8149-0a77fe50673a", - "label": "mlw_7(2020) metadata", - "value": "25730" - }, - { - "description": "Jurisdiction Metadata for mlw_77(2020) id e57da5bc-dd55-4563-94ef-b1b0b2754df6", - "key": "e57da5bc-dd55-4563-94ef-b1b0b2754df6", - "label": "mlw_77(2020) metadata", - "value": "25731" - }, - { - "description": "Jurisdiction Metadata for mlw_99(2020) id ddfdadac-03aa-49ab-b793-dac692e15b0e", - "key": "ddfdadac-03aa-49ab-b793-dac692e15b0e", - "label": "mlw_99(2020) metadata", - "value": "25732" - }, - { - "description": "Jurisdiction Metadata for mlw_29(2020) id de3b9c6e-953f-4899-8dab-b0691cc17a18", - "key": "de3b9c6e-953f-4899-8dab-b0691cc17a18", - "label": "mlw_29(2020) metadata", - "value": "25733" - }, - { - "description": "Jurisdiction Metadata for mlw_13(2020) id c175f3fd-c7ad-4326-a1e8-f266d6cf4779", - "key": "c175f3fd-c7ad-4326-a1e8-f266d6cf4779", - "label": "mlw_13(2020) metadata", - "value": "25734" - }, - { - "description": "Jurisdiction Metadata for mlw_120(2020) id af5df24d-3c17-4445-a7f5-afabb686f495", - "key": "af5df24d-3c17-4445-a7f5-afabb686f495", - "label": "mlw_120(2020) metadata", - "value": "25735" - }, - { - "description": "Jurisdiction Metadata for mlw_115(2020) id 8fb028fc-0fa9-45d2-a8fe-28370ec33381", - "key": "8fb028fc-0fa9-45d2-a8fe-28370ec33381", - "label": "mlw_115(2020) metadata", - "value": "25736" - }, - { - "description": "Jurisdiction Metadata for mlw_5(2020) id d73e847b-ab3f-4a53-9b79-87b5b9814e52", - "key": "d73e847b-ab3f-4a53-9b79-87b5b9814e52", - "label": "mlw_5(2020) metadata", - "value": "25737" - }, - { - "description": "Jurisdiction Metadata for mlw_14(2020) id 82aeb31d-e46f-4cef-b82c-5ccac4c1f9cf", - "key": "82aeb31d-e46f-4cef-b82c-5ccac4c1f9cf", - "label": "mlw_14(2020) metadata", - "value": "25738" - }, - { - "description": "Jurisdiction Metadata for mlw_81(2020) id e0ff4c29-ef2f-47e7-92cc-0a766ecf6b9d", - "key": "e0ff4c29-ef2f-47e7-92cc-0a766ecf6b9d", - "label": "mlw_81(2020) metadata", - "value": "25739" - }, - { - "description": "Jurisdiction Metadata for mlw_93(2020) id 2462fede-f27d-4e8a-9244-9c920954f44f", - "key": "2462fede-f27d-4e8a-9244-9c920954f44f", - "label": "mlw_93(2020) metadata", - "value": "25740" - }, - { - "description": "Jurisdiction Metadata for mlw_43(2020) id 77396cc5-e7eb-4ebc-a1af-f42f11ea0a5a", - "key": "77396cc5-e7eb-4ebc-a1af-f42f11ea0a5a", - "label": "mlw_43(2020) metadata", - "value": "25741" - }, - { - "description": "Jurisdiction Metadata for mlw_67(2020) id 29bda44b-f92f-4dcf-93c3-cb3d33942b11", - "key": "29bda44b-f92f-4dcf-93c3-cb3d33942b11", - "label": "mlw_67(2020) metadata", - "value": "25742" - }, - { - "description": "Jurisdiction Metadata for mlw_38(2020) id 265dc9f1-ea33-44cf-8b9a-eb90752dbb7f", - "key": "265dc9f1-ea33-44cf-8b9a-eb90752dbb7f", - "label": "mlw_38(2020) metadata", - "value": "25743" - }, - { - "description": "Jurisdiction Metadata for mlw_119(2020) id c70fa4fe-53ee-4343-a27c-0c85560ac1cc", - "key": "c70fa4fe-53ee-4343-a27c-0c85560ac1cc", - "label": "mlw_119(2020) metadata", - "value": "25744" - }, - { - "description": "Jurisdiction Metadata for mlw_68(2020) id 56b052a2-dd8e-4e63-8339-2aabe0ef57d5", - "key": "56b052a2-dd8e-4e63-8339-2aabe0ef57d5", - "label": "mlw_68(2020) metadata", - "value": "25745" - }, - { - "description": "Jurisdiction Metadata for mlw_53(2020) id 65e514e1-45a3-49e1-8bd8-3cd94e182685", - "key": "65e514e1-45a3-49e1-8bd8-3cd94e182685", - "label": "mlw_53(2020) metadata", - "value": "25746" - }, - { - "description": "Jurisdiction Metadata for mlw_85(2020) id 604d2ae4-70b4-4fc9-84b3-cf8e2fe0061d", - "key": "604d2ae4-70b4-4fc9-84b3-cf8e2fe0061d", - "label": "mlw_85(2020) metadata", - "value": "25747" - }, - { - "description": "Jurisdiction Metadata for mlw_24(2020) id a61a04b1-2b4b-4fb2-b715-9ca1c861ecc6", - "key": "a61a04b1-2b4b-4fb2-b715-9ca1c861ecc6", - "label": "mlw_24(2020) metadata", - "value": "25748" - }, - { - "description": "Jurisdiction Metadata for mlw_32(2020) id 7508ceec-860d-42d0-bb89-0da6fd473fa4", - "key": "7508ceec-860d-42d0-bb89-0da6fd473fa4", - "label": "mlw_32(2020) metadata", - "value": "25749" - }, - { - "description": "Jurisdiction Metadata for mlw_61(2020) id 01bda4aa-c39c-4e4a-87ca-5bb73b318874", - "key": "01bda4aa-c39c-4e4a-87ca-5bb73b318874", - "label": "mlw_61(2020) metadata", - "value": "25750" - }, - { - "description": "Jurisdiction Metadata for mlw_102(2020) id a5f849e7-76ff-4619-9072-060a58d4bd9c", - "key": "a5f849e7-76ff-4619-9072-060a58d4bd9c", - "label": "mlw_102(2020) metadata", - "value": "25751" - }, - { - "description": "Jurisdiction Metadata for mlw_122(2020) id f289f930-c383-4e25-9533-efa8834980ea", - "key": "f289f930-c383-4e25-9533-efa8834980ea", - "label": "mlw_122(2020) metadata", - "value": "25752" - }, - { - "description": "Jurisdiction Metadata for mlw_94(2020) id d3403268-a28b-44ae-bae1-0b5ca8af0244", - "key": "d3403268-a28b-44ae-bae1-0b5ca8af0244", - "label": "mlw_94(2020) metadata", - "value": "25753" - }, - { - "description": "Jurisdiction Metadata for mlw_57(2020) id e2f49b9b-c22d-4f6a-a79a-5045d8a29121", - "key": "e2f49b9b-c22d-4f6a-a79a-5045d8a29121", - "label": "mlw_57(2020) metadata", - "value": "25754" - }, - { - "description": "Jurisdiction Metadata for mlw_75(2020) id 4a105c40-47af-4389-9fcc-b0ac31cb393a", - "key": "4a105c40-47af-4389-9fcc-b0ac31cb393a", - "label": "mlw_75(2020) metadata", - "value": "25755" - }, - { - "description": "Jurisdiction Metadata for mlw_11(2020) id 37abf250-0d93-4cc5-bfb1-81ef06350374", - "key": "37abf250-0d93-4cc5-bfb1-81ef06350374", - "label": "mlw_11(2020) metadata", - "value": "25756" - }, - { - "description": "Jurisdiction Metadata for mlw_59(2020) id 20562e5f-54aa-458a-90d4-7588674dc8e7", - "key": "20562e5f-54aa-458a-90d4-7588674dc8e7", - "label": "mlw_59(2020) metadata", - "value": "25757" - }, - { - "description": "Jurisdiction Metadata for mlw_26(2020) id 3245d02f-2268-43a4-90c8-22289d2f5137", - "key": "3245d02f-2268-43a4-90c8-22289d2f5137", - "label": "mlw_26(2020) metadata", - "value": "25758" - }, - { - "description": "Jurisdiction Metadata for mlw_8(2020) id f7b13e4b-aa52-458b-8633-719cdf859182", - "key": "f7b13e4b-aa52-458b-8633-719cdf859182", - "label": "mlw_8(2020) metadata", - "value": "25759" - }, - { - "description": "Jurisdiction Metadata for mlw_88(2020) id 56afc1d1-0ea1-4242-9b89-8e3623b028c9", - "key": "56afc1d1-0ea1-4242-9b89-8e3623b028c9", - "label": "mlw_88(2020) metadata", - "value": "25760" - }, - { - "description": "Jurisdiction Metadata for mlw_48(2020) id b06cd34e-54a5-4d10-8fab-e79470e46712", - "key": "b06cd34e-54a5-4d10-8fab-e79470e46712", - "label": "mlw_48(2020) metadata", - "value": "25761" - }, - { - "description": "Jurisdiction Metadata for mlw_96(2020) id fbec85a0-871b-478a-b093-96b478d15e1d", - "key": "fbec85a0-871b-478a-b093-96b478d15e1d", - "label": "mlw_96(2020) metadata", - "value": "25762" - }, - { - "description": "Jurisdiction Metadata for mlw_70(2020) id a1c23d27-bec7-4c3b-a5ae-e0765edf03ca", - "key": "a1c23d27-bec7-4c3b-a5ae-e0765edf03ca", - "label": "mlw_70(2020) metadata", - "value": "25763" - }, - { - "description": "Jurisdiction Metadata for mlw_90(2020) id 67d9e79e-25bb-447e-931f-e2784e60f28b", - "key": "67d9e79e-25bb-447e-931f-e2784e60f28b", - "label": "mlw_90(2020) metadata", - "value": "25764" - }, - { - "description": "Jurisdiction Metadata for mlw_23(2020) id 3c53f458-2b73-47a3-8ac0-9715141a59a0", - "key": "3c53f458-2b73-47a3-8ac0-9715141a59a0", - "label": "mlw_23(2020) metadata", - "value": "25765" - }, - { - "description": "Jurisdiction Metadata for mlw_121(2020) id 3f2667f7-47cd-4d88-a996-4129e162ee9d", - "key": "3f2667f7-47cd-4d88-a996-4129e162ee9d", - "label": "mlw_121(2020) metadata", - "value": "25766" - }, - { - "description": "Jurisdiction Metadata for mlw_50(2020) id e661e7e9-d2d2-4d92-be95-f2dc9499b717", - "key": "e661e7e9-d2d2-4d92-be95-f2dc9499b717", - "label": "mlw_50(2020) metadata", - "value": "25767" - }, - { - "description": "Jurisdiction Metadata for mlw_84(2020) id 49c7d166-7c3c-4b2e-8b51-4941fb05e2f0", - "key": "49c7d166-7c3c-4b2e-8b51-4941fb05e2f0", - "label": "mlw_84(2020) metadata", - "value": "25768" - }, - { - "description": "Jurisdiction Metadata for Nshinda Zone id a3d6b1ec-7345-47a1-9538-7f3cead8a1ad", - "key": "a3d6b1ec-7345-47a1-9538-7f3cead8a1ad", - "label": "Nshinda Zone metadata", - "value": "25769" - }, - { - "description": "Jurisdiction Metadata for mlw_35(2020) id 6bbf12de-585c-4921-8fe4-0d30b6014e15", - "key": "6bbf12de-585c-4921-8fe4-0d30b6014e15", - "label": "mlw_35(2020) metadata", - "value": "25770" - }, - { - "description": "Jurisdiction Metadata for mlw_47(2020) id 1b028f7d-fbc7-48ce-a997-d464133d7a01", - "key": "1b028f7d-fbc7-48ce-a997-d464133d7a01", - "label": "mlw_47(2020) metadata", - "value": "25771" - }, - { - "description": "Jurisdiction Metadata for mlw_4(2020) id ded46bc8-83ba-45c3-b829-3050b2ebbef1", - "key": "ded46bc8-83ba-45c3-b829-3050b2ebbef1", - "label": "mlw_4(2020) metadata", - "value": "25772" - }, - { - "description": "Jurisdiction Metadata for mlw_27(2020) id d09dd43a-85f3-469a-94e2-6daf968ae5a3", - "key": "d09dd43a-85f3-469a-94e2-6daf968ae5a3", - "label": "mlw_27(2020) metadata", - "value": "25773" - }, - { - "description": "Jurisdiction Metadata for Kampampi zone id 9ca80078-2200-4cdf-94ca-c4ee6cb3c2ea", - "key": "9ca80078-2200-4cdf-94ca-c4ee6cb3c2ea", - "label": "Kampampi zone metadata", - "value": "25774" - }, - { - "description": "Jurisdiction Metadata for mlw_82(2020) id 92ac8b8b-e9d2-45f8-a0f4-0f0637e2501f", - "key": "92ac8b8b-e9d2-45f8-a0f4-0f0637e2501f", - "label": "mlw_82(2020) metadata", - "value": "25775" - }, - { - "description": "Jurisdiction Metadata for mlw_1(2020) id 9fe04a9e-dac3-4861-a4fe-483ec38206eb", - "key": "9fe04a9e-dac3-4861-a4fe-483ec38206eb", - "label": "mlw_1(2020) metadata", - "value": "25776" - }, - { - "description": "Jurisdiction Metadata for Kanyembo(2020) id 218d9948-336a-4937-a412-fa24ec9e53be", - "key": "218d9948-336a-4937-a412-fa24ec9e53be", - "label": "Kanyembo(2020) metadata", - "value": "25777" - }, - { - "description": "Jurisdiction Metadata for Chikumbi Zone id 56e2ffcc-4208-4dcd-8875-76d01092b4d7", - "key": "56e2ffcc-4208-4dcd-8875-76d01092b4d7", - "label": "Chikumbi Zone metadata", - "value": "25778" - }, - { - "description": "Jurisdiction Metadata for kym_46(2020) id ad574c63-af95-44ae-9453-06b078b48532", - "key": "ad574c63-af95-44ae-9453-06b078b48532", - "label": "kym_46(2020) metadata", - "value": "25779" - }, - { - "description": "Jurisdiction Metadata for kym_38(2020) id d139350d-27fb-4d99-b305-5b00f113bd77", - "key": "d139350d-27fb-4d99-b305-5b00f113bd77", - "label": "kym_38(2020) metadata", - "value": "25780" - }, - { - "description": "Jurisdiction Metadata for kym_10(2020) id 20fbbd13-014b-4a78-afe2-2bea3cec0579", - "key": "20fbbd13-014b-4a78-afe2-2bea3cec0579", - "label": "kym_10(2020) metadata", - "value": "25781" - }, - { - "description": "Jurisdiction Metadata for kym_49(2020) id a900ce8f-8f67-44c8-9339-c8ade43ecc96", - "key": "a900ce8f-8f67-44c8-9339-c8ade43ecc96", - "label": "kym_49(2020) metadata", - "value": "25782" - }, - { - "description": "Jurisdiction Metadata for kym_47(2020) id f7cd9451-b7c9-4dfe-a436-92cafb27be57", - "key": "f7cd9451-b7c9-4dfe-a436-92cafb27be57", - "label": "kym_47(2020) metadata", - "value": "25783" - }, - { - "description": "Jurisdiction Metadata for kym_35(2020) id 03a23b42-ca74-4c15-94fd-c967d6c49d0d", - "key": "03a23b42-ca74-4c15-94fd-c967d6c49d0d", - "label": "kym_35(2020) metadata", - "value": "25784" - }, - { - "description": "Jurisdiction Metadata for Kapota Zone id bff16cc3-dd3c-40e0-9535-55caf0c8f2d2", - "key": "bff16cc3-dd3c-40e0-9535-55caf0c8f2d2", - "label": "Kapota Zone metadata", - "value": "25785" - }, - { - "description": "Jurisdiction Metadata for kym_18(2020) id 91f5059c-9b6d-477d-b9a4-b7a5c00671d6", - "key": "91f5059c-9b6d-477d-b9a4-b7a5c00671d6", - "label": "kym_18(2020) metadata", - "value": "25786" - }, - { - "description": "Jurisdiction Metadata for kym_24(2020) id 6ea6fee9-5bb3-42ec-881a-65cc2e0dc328", - "key": "6ea6fee9-5bb3-42ec-881a-65cc2e0dc328", - "label": "kym_24(2020) metadata", - "value": "25787" - }, - { - "description": "Jurisdiction Metadata for kym_14(2020) id 31815e8c-f177-41f7-b1a3-abe910393923", - "key": "31815e8c-f177-41f7-b1a3-abe910393923", - "label": "kym_14(2020) metadata", - "value": "25788" - }, - { - "description": "Jurisdiction Metadata for kym_19(2020) id fc177072-ae71-4b8d-99ee-88dc9ab3d6de", - "key": "fc177072-ae71-4b8d-99ee-88dc9ab3d6de", - "label": "kym_19(2020) metadata", - "value": "25789" - }, - { - "description": "Jurisdiction Metadata for kym_31(2020) id 31faef02-4e69-4973-a4be-271bd8bf1939", - "key": "31faef02-4e69-4973-a4be-271bd8bf1939", - "label": "kym_31(2020) metadata", - "value": "25790" - }, - { - "description": "Jurisdiction Metadata for kym_21(2020) id 2f643475-6044-43c6-aa44-22a1f7a1d1aa", - "key": "2f643475-6044-43c6-aa44-22a1f7a1d1aa", - "label": "kym_21(2020) metadata", - "value": "25791" - }, - { - "description": "Jurisdiction Metadata for kym_25(2020) id b77e8489-dd3c-46d2-b2a0-5b91824e2648", - "key": "b77e8489-dd3c-46d2-b2a0-5b91824e2648", - "label": "kym_25(2020) metadata", - "value": "25792" - }, - { - "description": "Jurisdiction Metadata for kym_32(2020) id 8e259e5a-3f96-4984-a14c-4e6182ffd603", - "key": "8e259e5a-3f96-4984-a14c-4e6182ffd603", - "label": "kym_32(2020) metadata", - "value": "25793" - }, - { - "description": "Jurisdiction Metadata for kym_27(2020) id ad6f8194-455e-4bdc-acbc-d9c45827f042", - "key": "ad6f8194-455e-4bdc-acbc-d9c45827f042", - "label": "kym_27(2020) metadata", - "value": "25794" - }, - { - "description": "Jurisdiction Metadata for kym_42(2020) id ffa206a8-304f-48bd-a971-c656bd45c4b0", - "key": "ffa206a8-304f-48bd-a971-c656bd45c4b0", - "label": "kym_42(2020) metadata", - "value": "25795" - }, - { - "description": "Jurisdiction Metadata for kym_57(2020) id 9722952a-41be-499f-b663-7c82bc9ef7d0", - "key": "9722952a-41be-499f-b663-7c82bc9ef7d0", - "label": "kym_57(2020) metadata", - "value": "25796" - }, - { - "description": "Jurisdiction Metadata for kym_43(2020) id 6fb8b0d6-b987-4e51-852e-96f2902e796c", - "key": "6fb8b0d6-b987-4e51-852e-96f2902e796c", - "label": "kym_43(2020) metadata", - "value": "25797" - }, - { - "description": "Jurisdiction Metadata for kym_20(2020) id 5fc0ee64-ecfa-4ec9-9bd8-bd2210593a11", - "key": "5fc0ee64-ecfa-4ec9-9bd8-bd2210593a11", - "label": "kym_20(2020) metadata", - "value": "25798" - }, - { - "description": "Jurisdiction Metadata for kym_30(2020) id 86909ce9-dda8-4dae-83ec-d16da35da8cd", - "key": "86909ce9-dda8-4dae-83ec-d16da35da8cd", - "label": "kym_30(2020) metadata", - "value": "25799" - }, - { - "description": "Jurisdiction Metadata for kym_11(2020) id d7b32c42-359e-4490-b1be-7034cfe552ef", - "key": "d7b32c42-359e-4490-b1be-7034cfe552ef", - "label": "kym_11(2020) metadata", - "value": "25800" - }, - { - "description": "Jurisdiction Metadata for kym_50(2020) id ef85eb82-127d-4a16-89b9-f7cb21ffd294", - "key": "ef85eb82-127d-4a16-89b9-f7cb21ffd294", - "label": "kym_50(2020) metadata", - "value": "25801" - }, - { - "description": "Jurisdiction Metadata for kym_15(2020) id da3b5d38-89b8-42a5-99d1-0c931f933329", - "key": "da3b5d38-89b8-42a5-99d1-0c931f933329", - "label": "kym_15(2020) metadata", - "value": "25802" - }, - { - "description": "Jurisdiction Metadata for kym_23(2020) id 2061d680-32d2-4528-b02d-278f6592e059", - "key": "2061d680-32d2-4528-b02d-278f6592e059", - "label": "kym_23(2020) metadata", - "value": "25803" - }, - { - "description": "Jurisdiction Metadata for kym_28(2020) id 36d29557-0207-4141-b914-ade80d17c4ef", - "key": "36d29557-0207-4141-b914-ade80d17c4ef", - "label": "kym_28(2020) metadata", - "value": "25804" - }, - { - "description": "Jurisdiction Metadata for kym_55(2020) id eca3f85e-f398-46f3-99c8-58cb93a570d6", - "key": "eca3f85e-f398-46f3-99c8-58cb93a570d6", - "label": "kym_55(2020) metadata", - "value": "25805" - }, - { - "description": "Jurisdiction Metadata for kym_58(2020) id 17a9540f-aa5c-4715-a888-6b2a58ef3c87", - "key": "17a9540f-aa5c-4715-a888-6b2a58ef3c87", - "label": "kym_58(2020) metadata", - "value": "25806" - }, - { - "description": "Jurisdiction Metadata for kym_53(2020) id 6b6149ab-472b-4c80-bbb7-269d37079144", - "key": "6b6149ab-472b-4c80-bbb7-269d37079144", - "label": "kym_53(2020) metadata", - "value": "25807" - }, - { - "description": "Jurisdiction Metadata for kym_37(2020) id 696cbf44-7612-4697-bfee-2eaad024af12", - "key": "696cbf44-7612-4697-bfee-2eaad024af12", - "label": "kym_37(2020) metadata", - "value": "25808" - }, - { - "description": "Jurisdiction Metadata for kym_29(2020) id 481720e7-e324-4b8e-9c7b-8e51376d710d", - "key": "481720e7-e324-4b8e-9c7b-8e51376d710d", - "label": "kym_29(2020) metadata", - "value": "25809" - }, - { - "description": "Jurisdiction Metadata for kym_44(2020) id 658ca53d-ee95-4eb9-9ce8-43099e72e25c", - "key": "658ca53d-ee95-4eb9-9ce8-43099e72e25c", - "label": "kym_44(2020) metadata", - "value": "25810" - }, - { - "description": "Jurisdiction Metadata for kym_56(2020) id 6c8c2180-f2cf-4afc-8cb8-5ee7657623b4", - "key": "6c8c2180-f2cf-4afc-8cb8-5ee7657623b4", - "label": "kym_56(2020) metadata", - "value": "25811" - }, - { - "description": "Jurisdiction Metadata for kym_59(2020) id 5e8321f7-556f-491c-b1f7-ad503ca77a8d", - "key": "5e8321f7-556f-491c-b1f7-ad503ca77a8d", - "label": "kym_59(2020) metadata", - "value": "25812" - }, - { - "description": "Jurisdiction Metadata for kym_60(2020) id 4891c9ca-9925-4e84-b875-4dd86d5b2179", - "key": "4891c9ca-9925-4e84-b875-4dd86d5b2179", - "label": "kym_60(2020) metadata", - "value": "25813" - }, - { - "description": "Jurisdiction Metadata for kym_22(2020) id ac99f5c6-c93c-46e6-985e-a9cd5f27f0a7", - "key": "ac99f5c6-c93c-46e6-985e-a9cd5f27f0a7", - "label": "kym_22(2020) metadata", - "value": "25814" - }, - { - "description": "Jurisdiction Metadata for kym_12(2020) id a65949e5-d2ef-45d5-8890-6933b0d77c8b", - "key": "a65949e5-d2ef-45d5-8890-6933b0d77c8b", - "label": "kym_12(2020) metadata", - "value": "25815" - }, - { - "description": "Jurisdiction Metadata for kym_51(2020) id e1a8473e-b69e-45bf-b0b5-9c89793cc570", - "key": "e1a8473e-b69e-45bf-b0b5-9c89793cc570", - "label": "kym_51(2020) metadata", - "value": "25816" - }, - { - "description": "Jurisdiction Metadata for kym_36(2020) id 4c9b4dde-458f-42c6-8d24-ab053613671e", - "key": "4c9b4dde-458f-42c6-8d24-ab053613671e", - "label": "kym_36(2020) metadata", - "value": "25817" - }, - { - "description": "Jurisdiction Metadata for kym_26(2020) id b03658be-0e0c-46b5-a445-4ae2067b95ee", - "key": "b03658be-0e0c-46b5-a445-4ae2067b95ee", - "label": "kym_26(2020) metadata", - "value": "25818" - }, - { - "description": "Jurisdiction Metadata for kym_7(2020) id 9914386d-7736-4800-b70c-7347104ddc5a", - "key": "9914386d-7736-4800-b70c-7347104ddc5a", - "label": "kym_7(2020) metadata", - "value": "25819" - }, - { - "description": "Jurisdiction Metadata for kym_41(2020) id 3c3486a8-b110-4c3f-85b5-dcfa6910165c", - "key": "3c3486a8-b110-4c3f-85b5-dcfa6910165c", - "label": "kym_41(2020) metadata", - "value": "25820" - }, - { - "description": "Jurisdiction Metadata for Lunde Zone id 654713b2-f924-40ae-a113-ef35a5c97c76", - "key": "654713b2-f924-40ae-a113-ef35a5c97c76", - "label": "Lunde Zone metadata", - "value": "25821" - }, - { - "description": "Jurisdiction Metadata for kym_34(2020) id 1a48e6c0-555c-472d-b84e-be1197af5f61", - "key": "1a48e6c0-555c-472d-b84e-be1197af5f61", - "label": "kym_34(2020) metadata", - "value": "25822" - }, - { - "description": "Jurisdiction Metadata for kym_16(2020) id 8d1ab5a0-e44b-49c8-ae2e-81ba9a745602", - "key": "8d1ab5a0-e44b-49c8-ae2e-81ba9a745602", - "label": "kym_16(2020) metadata", - "value": "25823" - }, - { - "description": "Jurisdiction Metadata for kym_48(2020) id 2ce3062d-b511-4f20-b900-57ebb266814f", - "key": "2ce3062d-b511-4f20-b900-57ebb266814f", - "label": "kym_48(2020) metadata", - "value": "25824" - }, - { - "description": "Jurisdiction Metadata for kym_33(2020) id 4755e177-ee0a-4e55-a3ed-b190c6496175", - "key": "4755e177-ee0a-4e55-a3ed-b190c6496175", - "label": "kym_33(2020) metadata", - "value": "25825" - }, - { - "description": "Jurisdiction Metadata for kym_13(2020) id 7cffb031-9cc2-4c1c-beed-03f599c930a3", - "key": "7cffb031-9cc2-4c1c-beed-03f599c930a3", - "label": "kym_13(2020) metadata", - "value": "25826" - }, - { - "description": "Jurisdiction Metadata for kym_54(2020) id 014a524a-6450-4afb-9a7f-d4ff322f7fe7", - "key": "014a524a-6450-4afb-9a7f-d4ff322f7fe7", - "label": "kym_54(2020) metadata", - "value": "25827" - }, - { - "description": "Jurisdiction Metadata for kym_8(2020) id 65b12a2d-11fb-454b-8dfc-55e818e6c881", - "key": "65b12a2d-11fb-454b-8dfc-55e818e6c881", - "label": "kym_8(2020) metadata", - "value": "25828" - }, - { - "description": "Jurisdiction Metadata for kym_9(2020) id 268f47ec-6bf8-432d-82ac-9c41f70f3858", - "key": "268f47ec-6bf8-432d-82ac-9c41f70f3858", - "label": "kym_9(2020) metadata", - "value": "25829" - }, - { - "description": "Jurisdiction Metadata for kym_40(2020) id 2847f7d8-cecc-4b8f-bfbf-80f67cec6bf7", - "key": "2847f7d8-cecc-4b8f-bfbf-80f67cec6bf7", - "label": "kym_40(2020) metadata", - "value": "25830" - }, - { - "description": "Jurisdiction Metadata for kym_17(2020) id 3fc9c5a8-e5a9-4b53-9ace-3d688a1ef30e", - "key": "3fc9c5a8-e5a9-4b53-9ace-3d688a1ef30e", - "label": "kym_17(2020) metadata", - "value": "25831" - }, - { - "description": "Jurisdiction Metadata for Shanyemba Zone id 531d95f4-db48-4386-85cb-de0f571d518d", - "key": "531d95f4-db48-4386-85cb-de0f571d518d", - "label": "Shanyemba Zone metadata", - "value": "25832" - }, - { - "description": "Jurisdiction Metadata for kym_39(2020) id f63158b4-9820-4d7e-af80-90a79883772f", - "key": "f63158b4-9820-4d7e-af80-90a79883772f", - "label": "kym_39(2020) metadata", - "value": "25833" - }, - { - "description": "Jurisdiction Metadata for kym_5(2020) id ed86e650-0309-41d6-80c8-def9705939c4", - "key": "ed86e650-0309-41d6-80c8-def9705939c4", - "label": "kym_5(2020) metadata", - "value": "25834" - }, - { - "description": "Jurisdiction Metadata for Labi Zone id 854f3bd2-314e-4230-a8da-496596c5284b", - "key": "854f3bd2-314e-4230-a8da-496596c5284b", - "label": "Labi Zone metadata", - "value": "25835" - }, - { - "description": "Jurisdiction Metadata for kym_1(2020) id 89adf25b-0584-4336-9d87-b07ea6311391", - "key": "89adf25b-0584-4336-9d87-b07ea6311391", - "label": "kym_1(2020) metadata", - "value": "25836" - }, - { - "description": "Jurisdiction Metadata for Kanyembo Zone id 66edbe5b-5f1b-48dd-8678-d7cc9b746687", - "key": "66edbe5b-5f1b-48dd-8678-d7cc9b746687", - "label": "Kanyembo Zone metadata", - "value": "25837" - }, - { - "description": "Jurisdiction Metadata for kym_4(2020) id d29606e4-e69d-4bb3-8566-61bdc494c49b", - "key": "d29606e4-e69d-4bb3-8566-61bdc494c49b", - "label": "kym_4(2020) metadata", - "value": "25838" - }, - { - "description": "Jurisdiction Metadata for Lushili Zone id 38fe4c6b-7ea1-4de5-9920-9a1f6412086c", - "key": "38fe4c6b-7ea1-4de5-9920-9a1f6412086c", - "label": "Lushili Zone metadata", - "value": "25839" - }, - { - "description": "Jurisdiction Metadata for kym_45(2020) id 0f235851-3b3b-4d6a-a36e-db91592480ea", - "key": "0f235851-3b3b-4d6a-a36e-db91592480ea", - "label": "kym_45(2020) metadata", - "value": "25840" - }, - { - "description": "Jurisdiction Metadata for kym_2(2020) id 1718320c-f887-45b5-a8aa-0c369957a863", - "key": "1718320c-f887-45b5-a8aa-0c369957a863", - "label": "kym_2(2020) metadata", - "value": "25841" - }, - { - "description": "Jurisdiction Metadata for Kashita Zone id 1314496f-7e86-4754-94bb-c30c3ba09a12", - "key": "1314496f-7e86-4754-94bb-c30c3ba09a12", - "label": "Kashita Zone metadata", - "value": "25842" - }, - { - "description": "Jurisdiction Metadata for kym_3(2020) id 4c187c55-abf9-4c05-89f9-3b3afa322e4c", - "key": "4c187c55-abf9-4c05-89f9-3b3afa322e4c", - "label": "kym_3(2020) metadata", - "value": "25843" - }, - { - "description": "Jurisdiction Metadata for kym_52(2020) id d56e8e47-7a84-4c51-9a75-ce614ae6f684", - "key": "d56e8e47-7a84-4c51-9a75-ce614ae6f684", - "label": "kym_52(2020) metadata", - "value": "25844" - }, - { - "description": "Jurisdiction Metadata for Chomba Zone id 8a03529d-2afe-4098-afd5-d1460e3b4f8a", - "key": "8a03529d-2afe-4098-afd5-d1460e3b4f8a", - "label": "Chomba Zone metadata", - "value": "25845" - }, - { - "description": "Jurisdiction Metadata for kym_6(2020) id 21a14b59-6102-4f35-99dd-ec34d44ae383", - "key": "21a14b59-6102-4f35-99dd-ec34d44ae383", - "label": "kym_6(2020) metadata", - "value": "25846" - }, - { - "description": "Jurisdiction Metadata for Kashikishi(2020) id dd5ba964-d76f-4f82-a4e3-c3f822d2ae2a", - "key": "dd5ba964-d76f-4f82-a4e3-c3f822d2ae2a", - "label": "Kashikishi(2020) metadata", - "value": "25847" - }, - { - "description": "Jurisdiction Metadata for Kabuku Zone id f47ec07c-825d-4e19-9444-bf71f48d9c95", - "key": "f47ec07c-825d-4e19-9444-bf71f48d9c95", - "label": "Kabuku Zone metadata", - "value": "25848" - }, - { - "description": "Jurisdiction Metadata for ksh_44(2020) id e51d62ad-e613-4ddf-8049-c391415c8332", - "key": "e51d62ad-e613-4ddf-8049-c391415c8332", - "label": "ksh_44(2020) metadata", - "value": "25849" - }, - { - "description": "Jurisdiction Metadata for ksh_36(2020) id 9825efef-9853-4216-85a2-b525912ea10f", - "key": "9825efef-9853-4216-85a2-b525912ea10f", - "label": "ksh_36(2020) metadata", - "value": "25850" - }, - { - "description": "Jurisdiction Metadata for ksh_112(2020) id eb8977ef-e2cf-4e2b-9a1c-3da0c308c608", - "key": "eb8977ef-e2cf-4e2b-9a1c-3da0c308c608", - "label": "ksh_112(2020) metadata", - "value": "25851" - }, - { - "description": "Jurisdiction Metadata for ksh_148(2020) id 7cf41a7d-5e7a-4892-9c38-96f4b338bd38", - "key": "7cf41a7d-5e7a-4892-9c38-96f4b338bd38", - "label": "ksh_148(2020) metadata", - "value": "25852" - }, - { - "description": "Jurisdiction Metadata for ksh_130(2020) id c64aa631-2fb3-4267-8148-1592752177b5", - "key": "c64aa631-2fb3-4267-8148-1592752177b5", - "label": "ksh_130(2020) metadata", - "value": "25853" - }, - { - "description": "Jurisdiction Metadata for ksh_119(2020) id 68722efa-6619-41cc-86bc-ba763ea0b1ad", - "key": "68722efa-6619-41cc-86bc-ba763ea0b1ad", - "label": "ksh_119(2020) metadata", - "value": "25854" - }, - { - "description": "Jurisdiction Metadata for ksh_162(2020) id e12091ab-395e-4000-b711-e6901a0f9c8a", - "key": "e12091ab-395e-4000-b711-e6901a0f9c8a", - "label": "ksh_162(2020) metadata", - "value": "25855" - }, - { - "description": "Jurisdiction Metadata for ksh_22(2020) id b5306c06-f12e-4e10-a03d-2c145b8c4bc0", - "key": "b5306c06-f12e-4e10-a03d-2c145b8c4bc0", - "label": "ksh_22(2020) metadata", - "value": "25856" - }, - { - "description": "Jurisdiction Metadata for ksh_147(2020) id 8062be78-9d99-4594-b784-b9af2ae0cec9", - "key": "8062be78-9d99-4594-b784-b9af2ae0cec9", - "label": "ksh_147(2020) metadata", - "value": "25857" - }, - { - "description": "Jurisdiction Metadata for ksh_128(2020) id ad941238-f61c-448f-a97a-200cffb0c724", - "key": "ad941238-f61c-448f-a97a-200cffb0c724", - "label": "ksh_128(2020) metadata", - "value": "25858" - }, - { - "description": "Jurisdiction Metadata for ksh_87(2020) id db15cb44-344b-4938-9b13-cda398a5defd", - "key": "db15cb44-344b-4938-9b13-cda398a5defd", - "label": "ksh_87(2020) metadata", - "value": "25859" - }, - { - "description": "Jurisdiction Metadata for ksh_61(2020) id e97b2699-d1c0-4eea-b655-99cba1133b62", - "key": "e97b2699-d1c0-4eea-b655-99cba1133b62", - "label": "ksh_61(2020) metadata", - "value": "25860" - }, - { - "description": "Jurisdiction Metadata for ksh_65(2020) id a98ff117-3d33-4248-b1f0-118e708769c2", - "key": "a98ff117-3d33-4248-b1f0-118e708769c2", - "label": "ksh_65(2020) metadata", - "value": "25861" - }, - { - "description": "Jurisdiction Metadata for ksh_31(2020) id a8e77ead-94b4-4b39-8f2c-70490024f43f", - "key": "a8e77ead-94b4-4b39-8f2c-70490024f43f", - "label": "ksh_31(2020) metadata", - "value": "25862" - }, - { - "description": "Jurisdiction Metadata for ksh_85(2020) id d11b4266-7f22-4a25-a090-1f6cb19189f1", - "key": "d11b4266-7f22-4a25-a090-1f6cb19189f1", - "label": "ksh_85(2020) metadata", - "value": "25863" - }, - { - "description": "Jurisdiction Metadata for ksh_138(2020) id 6397a39a-ded4-4d7e-928b-38dd0b8a3417", - "key": "6397a39a-ded4-4d7e-928b-38dd0b8a3417", - "label": "ksh_138(2020) metadata", - "value": "25864" - }, - { - "description": "Jurisdiction Metadata for ksh_204(2020) id e407f950-1126-4980-936c-6dc91a56671e", - "key": "e407f950-1126-4980-936c-6dc91a56671e", - "label": "ksh_204(2020) metadata", - "value": "25865" - }, - { - "description": "Jurisdiction Metadata for ksh_197(2020) id 578d48ae-947f-4c8f-a030-b77f6ed8ed18", - "key": "578d48ae-947f-4c8f-a030-b77f6ed8ed18", - "label": "ksh_197(2020) metadata", - "value": "25866" - }, - { - "description": "Jurisdiction Metadata for ksh_40(2020) id d3fee227-5d26-4c7c-b5f1-28743621495e", - "key": "d3fee227-5d26-4c7c-b5f1-28743621495e", - "label": "ksh_40(2020) metadata", - "value": "25867" - }, - { - "description": "Jurisdiction Metadata for ksh_129(2020) id 5a9c5266-e00c-426d-b5e0-f05d0e46c76f", - "key": "5a9c5266-e00c-426d-b5e0-f05d0e46c76f", - "label": "ksh_129(2020) metadata", - "value": "25868" - }, - { - "description": "Jurisdiction Metadata for ksh_118(2020) id 344dac7b-5fd4-48fe-bf2c-1d1df72eaace", - "key": "344dac7b-5fd4-48fe-bf2c-1d1df72eaace", - "label": "ksh_118(2020) metadata", - "value": "25869" - }, - { - "description": "Jurisdiction Metadata for ksh_80(2020) id 638cac0b-baa3-41f8-a6f8-d14f6f41d702", - "key": "638cac0b-baa3-41f8-a6f8-d14f6f41d702", - "label": "ksh_80(2020) metadata", - "value": "25870" - }, - { - "description": "Jurisdiction Metadata for ksh_160(2020) id 57e0fd99-1f89-414e-ac66-a0e66bc11f21", - "key": "57e0fd99-1f89-414e-ac66-a0e66bc11f21", - "label": "ksh_160(2020) metadata", - "value": "25871" - }, - { - "description": "Jurisdiction Metadata for ksh_50(2020) id 72ba7490-aaa7-4585-b28f-2edea1d0a3af", - "key": "72ba7490-aaa7-4585-b28f-2edea1d0a3af", - "label": "ksh_50(2020) metadata", - "value": "25872" - }, - { - "description": "Jurisdiction Metadata for ksh_86(2020) id e975450e-fba4-4b99-8d94-d0c66dbe25ff", - "key": "e975450e-fba4-4b99-8d94-d0c66dbe25ff", - "label": "ksh_86(2020) metadata", - "value": "25873" - }, - { - "description": "Jurisdiction Metadata for ksh_100(2020) id b79b74e1-3375-4f4e-857d-478e6e4ff6b1", - "key": "b79b74e1-3375-4f4e-857d-478e6e4ff6b1", - "label": "ksh_100(2020) metadata", - "value": "25874" - }, - { - "description": "Jurisdiction Metadata for ksh_37(2020) id 5075d193-d347-4fd1-a0de-0b0f77fd50f7", - "key": "5075d193-d347-4fd1-a0de-0b0f77fd50f7", - "label": "ksh_37(2020) metadata", - "value": "25875" - }, - { - "description": "Jurisdiction Metadata for ksh_69(2020) id 7561f294-c6bc-493e-a835-2aa1ae01382c", - "key": "7561f294-c6bc-493e-a835-2aa1ae01382c", - "label": "ksh_69(2020) metadata", - "value": "25876" - }, - { - "description": "Jurisdiction Metadata for ksh_117(2020) id 9bb0a46b-1414-4120-b02d-22bd0c8499d6", - "key": "9bb0a46b-1414-4120-b02d-22bd0c8499d6", - "label": "ksh_117(2020) metadata", - "value": "25877" - }, - { - "description": "Jurisdiction Metadata for ksh_47(2020) id 92043036-7203-4b0c-acd1-b641b2bb2f0f", - "key": "92043036-7203-4b0c-acd1-b641b2bb2f0f", - "label": "ksh_47(2020) metadata", - "value": "25878" - }, - { - "description": "Jurisdiction Metadata for ksh_180(2020) id 0707c406-a431-49d3-ae24-2632dc459b9f", - "key": "0707c406-a431-49d3-ae24-2632dc459b9f", - "label": "ksh_180(2020) metadata", - "value": "25879" - }, - { - "description": "Jurisdiction Metadata for ksh_192(2020) id 6a4ccd8e-a7a8-4358-936d-ea4b8387b3f2", - "key": "6a4ccd8e-a7a8-4358-936d-ea4b8387b3f2", - "label": "ksh_192(2020) metadata", - "value": "25880" - }, - { - "description": "Jurisdiction Metadata for ksh_159(2020) id 6bd19013-2ff3-4cae-ac01-0efdbf61619a", - "key": "6bd19013-2ff3-4cae-ac01-0efdbf61619a", - "label": "ksh_159(2020) metadata", - "value": "25881" - }, - { - "description": "Jurisdiction Metadata for ksh_146(2020) id 8aa360dd-085e-4d70-b5cc-b05848e92b71", - "key": "8aa360dd-085e-4d70-b5cc-b05848e92b71", - "label": "ksh_146(2020) metadata", - "value": "25882" - }, - { - "description": "Jurisdiction Metadata for ksh_30(2020) id 7bb8460e-e431-44c2-884b-77768271a665", - "key": "7bb8460e-e431-44c2-884b-77768271a665", - "label": "ksh_30(2020) metadata", - "value": "25883" - }, - { - "description": "Jurisdiction Metadata for ksh_203(2020) id b358c41d-4be6-48aa-9f62-22b5943d4e6c", - "key": "b358c41d-4be6-48aa-9f62-22b5943d4e6c", - "label": "ksh_203(2020) metadata", - "value": "25884" - }, - { - "description": "Jurisdiction Metadata for ksh_163(2020) id de1f5d6f-2d92-4b2f-b102-9e306db3435d", - "key": "de1f5d6f-2d92-4b2f-b102-9e306db3435d", - "label": "ksh_163(2020) metadata", - "value": "25885" - }, - { - "description": "Jurisdiction Metadata for ksh_122(2020) id 9d61372b-823e-4d99-898b-07e4fd7a87e1", - "key": "9d61372b-823e-4d99-898b-07e4fd7a87e1", - "label": "ksh_122(2020) metadata", - "value": "25886" - }, - { - "description": "Jurisdiction Metadata for ksh_196(2020) id 5b260383-e4a6-42cd-a807-cb4a50b8ebd1", - "key": "5b260383-e4a6-42cd-a807-cb4a50b8ebd1", - "label": "ksh_196(2020) metadata", - "value": "25887" - }, - { - "description": "Jurisdiction Metadata for ksh_95(2020) id e9667a2a-1307-407c-afee-627033cc17be", - "key": "e9667a2a-1307-407c-afee-627033cc17be", - "label": "ksh_95(2020) metadata", - "value": "25888" - }, - { - "description": "Jurisdiction Metadata for ksh_140(2020) id 8facbdd7-d419-4048-897d-0e08106dc49b", - "key": "8facbdd7-d419-4048-897d-0e08106dc49b", - "label": "ksh_140(2020) metadata", - "value": "25889" - }, - { - "description": "Jurisdiction Metadata for ksh_161(2020) id 97f98c00-6ec7-4f3c-b0e9-36176eab19f4", - "key": "97f98c00-6ec7-4f3c-b0e9-36176eab19f4", - "label": "ksh_161(2020) metadata", - "value": "25890" - }, - { - "description": "Jurisdiction Metadata for ksh_198(2020) id 384ac465-b3f7-4590-a076-f48c0fb9cf39", - "key": "384ac465-b3f7-4590-a076-f48c0fb9cf39", - "label": "ksh_198(2020) metadata", - "value": "25891" - }, - { - "description": "Jurisdiction Metadata for ksh_54(2020) id ded88348-60dd-4bc4-bf19-6d24b6edb4fc", - "key": "ded88348-60dd-4bc4-bf19-6d24b6edb4fc", - "label": "ksh_54(2020) metadata", - "value": "25892" - }, - { - "description": "Jurisdiction Metadata for ksh_205(2020) id cf4f5640-6047-4414-9b09-9501734e421a", - "key": "cf4f5640-6047-4414-9b09-9501734e421a", - "label": "ksh_205(2020) metadata", - "value": "25893" - }, - { - "description": "Jurisdiction Metadata for ksh_191(2020) id daaf18a5-f855-4a4d-ae24-8872787d48cb", - "key": "daaf18a5-f855-4a4d-ae24-8872787d48cb", - "label": "ksh_191(2020) metadata", - "value": "25894" - }, - { - "description": "Jurisdiction Metadata for ksh_57(2020) id 7c685ced-6c14-495c-8bbb-275406fe6e8a", - "key": "7c685ced-6c14-495c-8bbb-275406fe6e8a", - "label": "ksh_57(2020) metadata", - "value": "25895" - }, - { - "description": "Jurisdiction Metadata for ksh_185(2020) id 2e7cb77b-eb6f-4e91-823b-86c6d41a998e", - "key": "2e7cb77b-eb6f-4e91-823b-86c6d41a998e", - "label": "ksh_185(2020) metadata", - "value": "25896" - }, - { - "description": "Jurisdiction Metadata for ksh_190(2020) id d9ff7268-0c0f-4474-987e-1a0953707e3e", - "key": "d9ff7268-0c0f-4474-987e-1a0953707e3e", - "label": "ksh_190(2020) metadata", - "value": "25897" - }, - { - "description": "Jurisdiction Metadata for ksh_136(2020) id 69981531-09ed-41ef-9c8f-c3b013760f6b", - "key": "69981531-09ed-41ef-9c8f-c3b013760f6b", - "label": "ksh_136(2020) metadata", - "value": "25898" - }, - { - "description": "Jurisdiction Metadata for Chandiwe Zone id 00800e86-80bf-4c84-b6a7-1d1289b3ac90", - "key": "00800e86-80bf-4c84-b6a7-1d1289b3ac90", - "label": "Chandiwe Zone metadata", - "value": "25899" - }, - { - "description": "Jurisdiction Metadata for ksh_6(2020) id b4d3fbde-3686-4472-b3c4-7e28ba455168", - "key": "b4d3fbde-3686-4472-b3c4-7e28ba455168", - "label": "ksh_6(2020) metadata", - "value": "25900" - }, - { - "description": "Jurisdiction Metadata for ksh_49(2020) id 6be2f032-ab8e-4f0d-999c-d951f7040418", - "key": "6be2f032-ab8e-4f0d-999c-d951f7040418", - "label": "ksh_49(2020) metadata", - "value": "25901" - }, - { - "description": "Jurisdiction Metadata for ksh_8(2020) id 78db3a15-249b-45ac-94fb-fa00c7c96033", - "key": "78db3a15-249b-45ac-94fb-fa00c7c96033", - "label": "ksh_8(2020) metadata", - "value": "25902" - }, - { - "description": "Jurisdiction Metadata for ksh_189(2020) id 009537b2-3722-4254-9aa6-1a0288ecfe41", - "key": "009537b2-3722-4254-9aa6-1a0288ecfe41", - "label": "ksh_189(2020) metadata", - "value": "25903" - }, - { - "description": "Jurisdiction Metadata for Kalila Nshindo Zone id 58fdeb77-cae5-407d-8245-e87a1bdac7f3", - "key": "58fdeb77-cae5-407d-8245-e87a1bdac7f3", - "label": "Kalila Nshindo Zone metadata", - "value": "25904" - }, - { - "description": "Jurisdiction Metadata for ksh_26(2020) id 732e9305-201b-4a6d-8802-f17e295f2a22", - "key": "732e9305-201b-4a6d-8802-f17e295f2a22", - "label": "ksh_26(2020) metadata", - "value": "25905" - }, - { - "description": "Jurisdiction Metadata for ksh_74(2020) id 6d1ad326-cc6b-4280-bd18-ac4b9150406d", - "key": "6d1ad326-cc6b-4280-bd18-ac4b9150406d", - "label": "ksh_74(2020) metadata", - "value": "25906" - }, - { - "description": "Jurisdiction Metadata for ksh_99(2020) id 768cebed-6979-4922-9e93-4f52702ba15b", - "key": "768cebed-6979-4922-9e93-4f52702ba15b", - "label": "ksh_99(2020) metadata", - "value": "25907" - }, - { - "description": "Jurisdiction Metadata for ksh_150(2020) id 710739ab-0fbe-4223-b250-b6d22037f37e", - "key": "710739ab-0fbe-4223-b250-b6d22037f37e", - "label": "ksh_150(2020) metadata", - "value": "25908" - }, - { - "description": "Jurisdiction Metadata for ksh_202(2020) id 1de98a1e-7f13-4b0a-b546-f4f003f98889", - "key": "1de98a1e-7f13-4b0a-b546-f4f003f98889", - "label": "ksh_202(2020) metadata", - "value": "25909" - }, - { - "description": "Jurisdiction Metadata for ksh_41(2020) id 43738d10-dfaf-4973-8036-e050eff45e93", - "key": "43738d10-dfaf-4973-8036-e050eff45e93", - "label": "ksh_41(2020) metadata", - "value": "25910" - }, - { - "description": "Jurisdiction Metadata for ksh_125(2020) id e56d450f-f5f2-4013-a534-8a78dd27fdfc", - "key": "e56d450f-f5f2-4013-a534-8a78dd27fdfc", - "label": "ksh_125(2020) metadata", - "value": "25911" - }, - { - "description": "Jurisdiction Metadata for ksh_187(2020) id 01742e32-1628-4599-8cfb-c64710cb22bd", - "key": "01742e32-1628-4599-8cfb-c64710cb22bd", - "label": "ksh_187(2020) metadata", - "value": "25912" - }, - { - "description": "Jurisdiction Metadata for ksh_170(2020) id 458977bd-2912-40a5-9457-ee8d5ace98e9", - "key": "458977bd-2912-40a5-9457-ee8d5ace98e9", - "label": "ksh_170(2020) metadata", - "value": "25913" - }, - { - "description": "Jurisdiction Metadata for ksh_89(2020) id 3e76fd6f-158c-48ce-aed6-569353c9da69", - "key": "3e76fd6f-158c-48ce-aed6-569353c9da69", - "label": "ksh_89(2020) metadata", - "value": "25914" - }, - { - "description": "Jurisdiction Metadata for ksh_172(2020) id 84ddd4fc-a540-408b-b354-494299fe6b0d", - "key": "84ddd4fc-a540-408b-b354-494299fe6b0d", - "label": "ksh_172(2020) metadata", - "value": "25915" - }, - { - "description": "Jurisdiction Metadata for ksh_154(2020) id 49ee2be9-422d-447b-9052-a4530dfa568f", - "key": "49ee2be9-422d-447b-9052-a4530dfa568f", - "label": "ksh_154(2020) metadata", - "value": "25916" - }, - { - "description": "Jurisdiction Metadata for ksh_70(2020) id e23e442b-7596-4ca0-8a94-114207ea8d7c", - "key": "e23e442b-7596-4ca0-8a94-114207ea8d7c", - "label": "ksh_70(2020) metadata", - "value": "25917" - }, - { - "description": "Jurisdiction Metadata for ksh_149(2020) id dc29770a-7e24-4f06-b470-f99521baf8b7", - "key": "dc29770a-7e24-4f06-b470-f99521baf8b7", - "label": "ksh_149(2020) metadata", - "value": "25918" - }, - { - "description": "Jurisdiction Metadata for ksh_109(2020) id 9d04840d-57f8-4522-881c-1d6070c2f589", - "key": "9d04840d-57f8-4522-881c-1d6070c2f589", - "label": "ksh_109(2020) metadata", - "value": "25919" - }, - { - "description": "Jurisdiction Metadata for ksh_171(2020) id 0e439b5c-da78-402f-95ca-7ce7acd1f12e", - "key": "0e439b5c-da78-402f-95ca-7ce7acd1f12e", - "label": "ksh_171(2020) metadata", - "value": "25920" - }, - { - "description": "Jurisdiction Metadata for ksh_142(2020) id 85d8b233-d4ba-437c-9dfc-eda9e1444a59", - "key": "85d8b233-d4ba-437c-9dfc-eda9e1444a59", - "label": "ksh_142(2020) metadata", - "value": "25921" - }, - { - "description": "Jurisdiction Metadata for ksh_152(2020) id 55a40ed1-4d6f-494e-a03a-75df54014c7d", - "key": "55a40ed1-4d6f-494e-a03a-75df54014c7d", - "label": "ksh_152(2020) metadata", - "value": "25922" - }, - { - "description": "Jurisdiction Metadata for ksh_181(2020) id cae3cda1-5a6b-41c3-a453-abdbcc48133d", - "key": "cae3cda1-5a6b-41c3-a453-abdbcc48133d", - "label": "ksh_181(2020) metadata", - "value": "25923" - }, - { - "description": "Jurisdiction Metadata for ksh_169(2020) id 9d68f157-a494-4547-ad97-f26c52c13e43", - "key": "9d68f157-a494-4547-ad97-f26c52c13e43", - "label": "ksh_169(2020) metadata", - "value": "25924" - }, - { - "description": "Jurisdiction Metadata for ksh_23(2020) id 3aaef337-03bf-44bd-92c4-d2eea53d9df6", - "key": "3aaef337-03bf-44bd-92c4-d2eea53d9df6", - "label": "ksh_23(2020) metadata", - "value": "25925" - }, - { - "description": "Jurisdiction Metadata for ksh_141(2020) id 3145afdb-3a75-4773-bd22-538fe8907fc8", - "key": "3145afdb-3a75-4773-bd22-538fe8907fc8", - "label": "ksh_141(2020) metadata", - "value": "25926" - }, - { - "description": "Jurisdiction Metadata for ksh_108(2020) id 95ddc1cd-d38e-42b1-a8fe-0db5f9728a05", - "key": "95ddc1cd-d38e-42b1-a8fe-0db5f9728a05", - "label": "ksh_108(2020) metadata", - "value": "25927" - }, - { - "description": "Jurisdiction Metadata for ksh_60(2020) id e1ec3205-ad47-40b1-84c5-0f70f44f350a", - "key": "e1ec3205-ad47-40b1-84c5-0f70f44f350a", - "label": "ksh_60(2020) metadata", - "value": "25928" - }, - { - "description": "Jurisdiction Metadata for ksh_143(2020) id 4fe71b0c-739b-42fb-8462-854f07a81408", - "key": "4fe71b0c-739b-42fb-8462-854f07a81408", - "label": "ksh_143(2020) metadata", - "value": "25929" - }, - { - "description": "Jurisdiction Metadata for ksh_88(2020) id b2a97448-0919-4651-b4df-7e4bb0db698c", - "key": "b2a97448-0919-4651-b4df-7e4bb0db698c", - "label": "ksh_88(2020) metadata", - "value": "25930" - }, - { - "description": "Jurisdiction Metadata for ksh_102(2020) id aaa13ca8-9d8a-4c39-972f-9ab1250fb8d8", - "key": "aaa13ca8-9d8a-4c39-972f-9ab1250fb8d8", - "label": "ksh_102(2020) metadata", - "value": "25931" - }, - { - "description": "Jurisdiction Metadata for ksh_55(2020) id a7d86261-640f-4834-8796-ea7042e8421f", - "key": "a7d86261-640f-4834-8796-ea7042e8421f", - "label": "ksh_55(2020) metadata", - "value": "25932" - }, - { - "description": "Jurisdiction Metadata for ksh_124(2020) id 00376af7-b7b1-49f2-aac4-2a7f53937c8e", - "key": "00376af7-b7b1-49f2-aac4-2a7f53937c8e", - "label": "ksh_124(2020) metadata", - "value": "25933" - }, - { - "description": "Jurisdiction Metadata for ksh_178(2020) id dfb2119f-92ee-41c7-a225-c5ae51db2603", - "key": "dfb2119f-92ee-41c7-a225-c5ae51db2603", - "label": "ksh_178(2020) metadata", - "value": "25934" - }, - { - "description": "Jurisdiction Metadata for ksh_51(2020) id f82400ea-22f0-41b7-959d-60b863a85edf", - "key": "f82400ea-22f0-41b7-959d-60b863a85edf", - "label": "ksh_51(2020) metadata", - "value": "25935" - }, - { - "description": "Jurisdiction Metadata for ksh_82(2020) id de3c53af-b67b-4751-a5c8-e541b63271ce", - "key": "de3c53af-b67b-4751-a5c8-e541b63271ce", - "label": "ksh_82(2020) metadata", - "value": "25936" - }, - { - "description": "Jurisdiction Metadata for ksh_63(2020) id f5f68631-cf17-44d4-a412-535a37c19460", - "key": "f5f68631-cf17-44d4-a412-535a37c19460", - "label": "ksh_63(2020) metadata", - "value": "25937" - }, - { - "description": "Jurisdiction Metadata for ksh_139(2020) id 9f7ce612-0da1-4de2-b6b9-d84a5a783afb", - "key": "9f7ce612-0da1-4de2-b6b9-d84a5a783afb", - "label": "ksh_139(2020) metadata", - "value": "25938" - }, - { - "description": "Jurisdiction Metadata for ksh_21(2020) id f110632c-c6f5-45f7-84d0-69aa01d923fb", - "key": "f110632c-c6f5-45f7-84d0-69aa01d923fb", - "label": "ksh_21(2020) metadata", - "value": "25939" - }, - { - "description": "Jurisdiction Metadata for ksh_84(2020) id 67b00793-311c-4621-bc9e-8b60df384aa4", - "key": "67b00793-311c-4621-bc9e-8b60df384aa4", - "label": "ksh_84(2020) metadata", - "value": "25940" - }, - { - "description": "Jurisdiction Metadata for ksh_176(2020) id ac633f00-d6e1-4d0a-9fcf-a3e7c968abd8", - "key": "ac633f00-d6e1-4d0a-9fcf-a3e7c968abd8", - "label": "ksh_176(2020) metadata", - "value": "25941" - }, - { - "description": "Jurisdiction Metadata for ksh_123(2020) id 34160da5-96b3-40a1-a954-6ae5013b6726", - "key": "34160da5-96b3-40a1-a954-6ae5013b6726", - "label": "ksh_123(2020) metadata", - "value": "25942" - }, - { - "description": "Jurisdiction Metadata for ksh_62(2020) id feacb726-d0dd-4c0b-b746-f63869f6f35a", - "key": "feacb726-d0dd-4c0b-b746-f63869f6f35a", - "label": "ksh_62(2020) metadata", - "value": "25943" - }, - { - "description": "Jurisdiction Metadata for ksh_59(2020) id ac34ad35-72b5-4410-8490-fb7821f7b8e8", - "key": "ac34ad35-72b5-4410-8490-fb7821f7b8e8", - "label": "ksh_59(2020) metadata", - "value": "25944" - }, - { - "description": "Jurisdiction Metadata for ksh_175(2020) id 6c1aa78f-f0ba-41d5-ac11-13c373301f7f", - "key": "6c1aa78f-f0ba-41d5-ac11-13c373301f7f", - "label": "ksh_175(2020) metadata", - "value": "25945" - }, - { - "description": "Jurisdiction Metadata for ksh_93(2020) id 23a9e8ef-8bef-42a8-98ed-087a46f320f9", - "key": "23a9e8ef-8bef-42a8-98ed-087a46f320f9", - "label": "ksh_93(2020) metadata", - "value": "25946" - }, - { - "description": "Jurisdiction Metadata for ksh_58(2020) id cb962ac3-381b-4234-abff-5a219aac7e53", - "key": "cb962ac3-381b-4234-abff-5a219aac7e53", - "label": "ksh_58(2020) metadata", - "value": "25947" - }, - { - "description": "Jurisdiction Metadata for ksh_110(2020) id 2d822e07-d498-413f-a112-da32c0fcef0b", - "key": "2d822e07-d498-413f-a112-da32c0fcef0b", - "label": "ksh_110(2020) metadata", - "value": "25948" - }, - { - "description": "Jurisdiction Metadata for ksh_77(2020) id 42e36347-d707-4bd5-be9c-2cc4e0fcbffd", - "key": "42e36347-d707-4bd5-be9c-2cc4e0fcbffd", - "label": "ksh_77(2020) metadata", - "value": "25949" - }, - { - "description": "Jurisdiction Metadata for ksh_92(2020) id 846e6ddd-280c-41da-80a9-994106d4a539", - "key": "846e6ddd-280c-41da-80a9-994106d4a539", - "label": "ksh_92(2020) metadata", - "value": "25950" - }, - { - "description": "Jurisdiction Metadata for ksh_103(2020) id 10763266-c63e-4d89-b052-9d0cb583a214", - "key": "10763266-c63e-4d89-b052-9d0cb583a214", - "label": "ksh_103(2020) metadata", - "value": "25951" - }, - { - "description": "Jurisdiction Metadata for ksh_165(2020) id 9490b48f-f0fc-48f0-8ffb-18b059b14201", - "key": "9490b48f-f0fc-48f0-8ffb-18b059b14201", - "label": "ksh_165(2020) metadata", - "value": "25952" - }, - { - "description": "Jurisdiction Metadata for ksh_97(2020) id 39b93ec5-ebb5-47a2-af9d-644f84723025", - "key": "39b93ec5-ebb5-47a2-af9d-644f84723025", - "label": "ksh_97(2020) metadata", - "value": "25953" - }, - { - "description": "Jurisdiction Metadata for ksh_71(2020) id 890dc7e0-4d1e-436c-b440-59bef9bbe5bc", - "key": "890dc7e0-4d1e-436c-b440-59bef9bbe5bc", - "label": "ksh_71(2020) metadata", - "value": "25954" - }, - { - "description": "Jurisdiction Metadata for ksh_81(2020) id 2d63c8da-a075-4fbc-9d74-bf090c54b21e", - "key": "2d63c8da-a075-4fbc-9d74-bf090c54b21e", - "label": "ksh_81(2020) metadata", - "value": "25955" - }, - { - "description": "Jurisdiction Metadata for ksh_151(2020) id 431a554f-32b5-4671-ab14-88c0fa2af26b", - "key": "431a554f-32b5-4671-ab14-88c0fa2af26b", - "label": "ksh_151(2020) metadata", - "value": "25956" - }, - { - "description": "Jurisdiction Metadata for ksh_56(2020) id 044a9ee7-f348-4424-baef-1d08b6556866", - "key": "044a9ee7-f348-4424-baef-1d08b6556866", - "label": "ksh_56(2020) metadata", - "value": "25957" - }, - { - "description": "Jurisdiction Metadata for ksh_199(2020) id 7f767a2f-7a59-4a2b-aa4a-a56121e5520c", - "key": "7f767a2f-7a59-4a2b-aa4a-a56121e5520c", - "label": "ksh_199(2020) metadata", - "value": "25958" - }, - { - "description": "Jurisdiction Metadata for ksh_179(2020) id f050d977-80d8-48b6-affa-b5cfe593349a", - "key": "f050d977-80d8-48b6-affa-b5cfe593349a", - "label": "ksh_179(2020) metadata", - "value": "25959" - }, - { - "description": "Jurisdiction Metadata for ksh_72(2020) id 2506552e-6dca-439c-b9fb-2a426650793f", - "key": "2506552e-6dca-439c-b9fb-2a426650793f", - "label": "ksh_72(2020) metadata", - "value": "25960" - }, - { - "description": "Jurisdiction Metadata for ksh_33(2020) id d9a0a417-7e7e-42fe-8532-40622acf2b14", - "key": "d9a0a417-7e7e-42fe-8532-40622acf2b14", - "label": "ksh_33(2020) metadata", - "value": "25961" - }, - { - "description": "Jurisdiction Metadata for ksh_113(2020) id 11696c3d-7ada-47e3-8052-83ad680ae623", - "key": "11696c3d-7ada-47e3-8052-83ad680ae623", - "label": "ksh_113(2020) metadata", - "value": "25962" - }, - { - "description": "Jurisdiction Metadata for ksh_194(2020) id bb0256de-58e0-4845-829c-6a50003c277b", - "key": "bb0256de-58e0-4845-829c-6a50003c277b", - "label": "ksh_194(2020) metadata", - "value": "25963" - }, - { - "description": "Jurisdiction Metadata for ksh_38(2020) id c65bdd5a-1197-48f1-b1ae-04cbbe31b249", - "key": "c65bdd5a-1197-48f1-b1ae-04cbbe31b249", - "label": "ksh_38(2020) metadata", - "value": "25964" - }, - { - "description": "Jurisdiction Metadata for ksh_153(2020) id 3ac3567e-6908-46a1-88e5-584b1eecc1d6", - "key": "3ac3567e-6908-46a1-88e5-584b1eecc1d6", - "label": "ksh_153(2020) metadata", - "value": "25965" - }, - { - "description": "Jurisdiction Metadata for ksh_67(2020) id 301f69ff-ca14-4bcd-b88a-6c4c3eb36ebb", - "key": "301f69ff-ca14-4bcd-b88a-6c4c3eb36ebb", - "label": "ksh_67(2020) metadata", - "value": "25966" - }, - { - "description": "Jurisdiction Metadata for ksh_177(2020) id b3522993-58a9-4891-8a4a-4c28b662604e", - "key": "b3522993-58a9-4891-8a4a-4c28b662604e", - "label": "ksh_177(2020) metadata", - "value": "25967" - }, - { - "description": "Jurisdiction Metadata for ksh_201(2020) id e98cb3c9-4aa6-4b6c-ab21-bd3520668ef9", - "key": "e98cb3c9-4aa6-4b6c-ab21-bd3520668ef9", - "label": "ksh_201(2020) metadata", - "value": "25968" - }, - { - "description": "Jurisdiction Metadata for ksh_173(2020) id e9cda47a-76ff-477e-b1d5-9f6517e8b244", - "key": "e9cda47a-76ff-477e-b1d5-9f6517e8b244", - "label": "ksh_173(2020) metadata", - "value": "25969" - }, - { - "description": "Jurisdiction Metadata for ksh_144(2020) id dd0bb4c7-36ff-4652-950d-65baa4a1b3d9", - "key": "dd0bb4c7-36ff-4652-950d-65baa4a1b3d9", - "label": "ksh_144(2020) metadata", - "value": "25970" - }, - { - "description": "Jurisdiction Metadata for ksh_28(2020) id c006e42c-d5c6-4f2c-a02f-e618b872176d", - "key": "c006e42c-d5c6-4f2c-a02f-e618b872176d", - "label": "ksh_28(2020) metadata", - "value": "25971" - }, - { - "description": "Jurisdiction Metadata for ksh_186(2020) id 5fcc427c-1ad8-41d6-8282-4f19b800c72c", - "key": "5fcc427c-1ad8-41d6-8282-4f19b800c72c", - "label": "ksh_186(2020) metadata", - "value": "25972" - }, - { - "description": "Jurisdiction Metadata for ksh_121(2020) id d4d4b130-c0a7-4820-bd93-07385c7e14fd", - "key": "d4d4b130-c0a7-4820-bd93-07385c7e14fd", - "label": "ksh_121(2020) metadata", - "value": "25973" - }, - { - "description": "Jurisdiction Metadata for Kasensele Zone id 61839c62-f517-4375-8a11-518bdca4764a", - "key": "61839c62-f517-4375-8a11-518bdca4764a", - "label": "Kasensele Zone metadata", - "value": "25974" - }, - { - "description": "Jurisdiction Metadata for ksh_101(2020) id dd7fb291-d364-4300-b36e-ecd50a2c0b56", - "key": "dd7fb291-d364-4300-b36e-ecd50a2c0b56", - "label": "ksh_101(2020) metadata", - "value": "25975" - }, - { - "description": "Jurisdiction Metadata for ksh_48(2020) id e4fbbdd7-1bc6-4fa2-9cda-66f5f40d1af4", - "key": "e4fbbdd7-1bc6-4fa2-9cda-66f5f40d1af4", - "label": "ksh_48(2020) metadata", - "value": "25976" - }, - { - "description": "Jurisdiction Metadata for ksh_45(2020) id 73b065fd-9b3f-4a63-a43e-5d13a9bd554a", - "key": "73b065fd-9b3f-4a63-a43e-5d13a9bd554a", - "label": "ksh_45(2020) metadata", - "value": "25977" - }, - { - "description": "Jurisdiction Metadata for ksh_182(2020) id 2c211a66-3f0f-4e4f-a9b4-84000dd56c83", - "key": "2c211a66-3f0f-4e4f-a9b4-84000dd56c83", - "label": "ksh_182(2020) metadata", - "value": "25978" - }, - { - "description": "Jurisdiction Metadata for ksh_167(2020) id d0a69405-4077-4246-85a5-ab47c2b95b65", - "key": "d0a69405-4077-4246-85a5-ab47c2b95b65", - "label": "ksh_167(2020) metadata", - "value": "25979" - }, - { - "description": "Jurisdiction Metadata for ksh_200(2020) id 2f9d2079-0955-42be-a22c-14454cbf6803", - "key": "2f9d2079-0955-42be-a22c-14454cbf6803", - "label": "ksh_200(2020) metadata", - "value": "25980" - }, - { - "description": "Jurisdiction Metadata for ksh_106(2020) id 98e06915-08c4-4b81-9adf-3684ac4d8aad", - "key": "98e06915-08c4-4b81-9adf-3684ac4d8aad", - "label": "ksh_106(2020) metadata", - "value": "25981" - }, - { - "description": "Jurisdiction Metadata for ksh_98(2020) id ace9f179-36bf-45c6-a912-4f60b21d359f", - "key": "ace9f179-36bf-45c6-a912-4f60b21d359f", - "label": "ksh_98(2020) metadata", - "value": "25982" - }, - { - "description": "Jurisdiction Metadata for ksh_75(2020) id 4a8d1e0a-9b95-4343-94c0-e15923547f3c", - "key": "4a8d1e0a-9b95-4343-94c0-e15923547f3c", - "label": "ksh_75(2020) metadata", - "value": "25983" - }, - { - "description": "Jurisdiction Metadata for ksh_73(2020) id dc67e4a5-a5bd-4900-9999-ef8deab2ebfb", - "key": "dc67e4a5-a5bd-4900-9999-ef8deab2ebfb", - "label": "ksh_73(2020) metadata", - "value": "25984" - }, - { - "description": "Jurisdiction Metadata for ksh_116(2020) id 88f7e352-cc9b-4fcc-a5b2-2a5fc5ca2bc8", - "key": "88f7e352-cc9b-4fcc-a5b2-2a5fc5ca2bc8", - "label": "ksh_116(2020) metadata", - "value": "25985" - }, - { - "description": "Jurisdiction Metadata for ksh_64(2020) id 38a55422-1046-4aea-86ee-3a8f935604de", - "key": "38a55422-1046-4aea-86ee-3a8f935604de", - "label": "ksh_64(2020) metadata", - "value": "25986" - }, - { - "description": "Jurisdiction Metadata for ksh_53(2020) id 70d12e8a-ec28-4b79-90d3-15c7602c6e66", - "key": "70d12e8a-ec28-4b79-90d3-15c7602c6e66", - "label": "ksh_53(2020) metadata", - "value": "25987" - }, - { - "description": "Jurisdiction Metadata for ksh_91(2020) id f2f5d806-4ad1-4cee-9e5b-74c5298aa41a", - "key": "f2f5d806-4ad1-4cee-9e5b-74c5298aa41a", - "label": "ksh_91(2020) metadata", - "value": "25988" - }, - { - "description": "Jurisdiction Metadata for ksh_79(2020) id 93f631fd-1142-4190-9433-15a0c26c1911", - "key": "93f631fd-1142-4190-9433-15a0c26c1911", - "label": "ksh_79(2020) metadata", - "value": "25989" - }, - { - "description": "Jurisdiction Metadata for ksh_183(2020) id 7846f6f5-aa97-4286-a05d-7ec91eeef2c7", - "key": "7846f6f5-aa97-4286-a05d-7ec91eeef2c7", - "label": "ksh_183(2020) metadata", - "value": "25990" - }, - { - "description": "Jurisdiction Metadata for ksh_24(2020) id cbfbc00e-4909-4c7a-986b-13ce408ba533", - "key": "cbfbc00e-4909-4c7a-986b-13ce408ba533", - "label": "ksh_24(2020) metadata", - "value": "25991" - }, - { - "description": "Jurisdiction Metadata for ksh_195(2020) id c7265a03-7614-4fb9-90b4-a420c59abe22", - "key": "c7265a03-7614-4fb9-90b4-a420c59abe22", - "label": "ksh_195(2020) metadata", - "value": "25992" - }, - { - "description": "Jurisdiction Metadata for ksh_193(2020) id dae968c3-a920-459e-bcaf-854d8135d08e", - "key": "dae968c3-a920-459e-bcaf-854d8135d08e", - "label": "ksh_193(2020) metadata", - "value": "25993" - }, - { - "description": "Jurisdiction Metadata for ksh_27(2020) id 32420842-869b-47a0-840d-037a99ae2e3b", - "key": "32420842-869b-47a0-840d-037a99ae2e3b", - "label": "ksh_27(2020) metadata", - "value": "25994" - }, - { - "description": "Jurisdiction Metadata for ksh_134(2020) id 5b9ab1ac-166a-459a-b0e5-8e4ad85435c1", - "key": "5b9ab1ac-166a-459a-b0e5-8e4ad85435c1", - "label": "ksh_134(2020) metadata", - "value": "25995" - }, - { - "description": "Jurisdiction Metadata for ksh_168(2020) id 29193e49-2c07-435d-b993-a4f59ed252ad", - "key": "29193e49-2c07-435d-b993-a4f59ed252ad", - "label": "ksh_168(2020) metadata", - "value": "25996" - }, - { - "description": "Jurisdiction Metadata for ksh_164(2020) id b28dfac7-d19b-492c-8c02-3bf044e73da8", - "key": "b28dfac7-d19b-492c-8c02-3bf044e73da8", - "label": "ksh_164(2020) metadata", - "value": "25997" - }, - { - "description": "Jurisdiction Metadata for ksh_156(2020) id 36f559a4-ece3-4cd0-b387-a913e61cb448", - "key": "36f559a4-ece3-4cd0-b387-a913e61cb448", - "label": "ksh_156(2020) metadata", - "value": "25998" - }, - { - "description": "Jurisdiction Metadata for ksh_115(2020) id 127e1601-2301-410b-ae6e-ccb9664613f7", - "key": "127e1601-2301-410b-ae6e-ccb9664613f7", - "label": "ksh_115(2020) metadata", - "value": "25999" - }, - { - "description": "Jurisdiction Metadata for ksh_111(2020) id 2efef2dd-dc23-46a3-86af-7c79b53cbcaa", - "key": "2efef2dd-dc23-46a3-86af-7c79b53cbcaa", - "label": "ksh_111(2020) metadata", - "value": "26000" - }, - { - "description": "Jurisdiction Metadata for ksh_135(2020) id 669f2894-7a53-411a-aab6-3a27bfff699e", - "key": "669f2894-7a53-411a-aab6-3a27bfff699e", - "label": "ksh_135(2020) metadata", - "value": "26001" - }, - { - "description": "Jurisdiction Metadata for ksh_76(2020) id 2d87af58-d39a-418a-ba9b-b14676fdb493", - "key": "2d87af58-d39a-418a-ba9b-b14676fdb493", - "label": "ksh_76(2020) metadata", - "value": "26002" - }, - { - "description": "Jurisdiction Metadata for ksh_90(2020) id 4693cff0-5188-48c3-9dcb-01c975e0b9d9", - "key": "4693cff0-5188-48c3-9dcb-01c975e0b9d9", - "label": "ksh_90(2020) metadata", - "value": "26003" - }, - { - "description": "Jurisdiction Metadata for ksh_158(2020) id c587142c-171d-4426-8c54-b5864121cf05", - "key": "c587142c-171d-4426-8c54-b5864121cf05", - "label": "ksh_158(2020) metadata", - "value": "26004" - }, - { - "description": "Jurisdiction Metadata for ksh_104(2020) id 5343969b-847e-48be-9d16-bba1a3cd2d37", - "key": "5343969b-847e-48be-9d16-bba1a3cd2d37", - "label": "ksh_104(2020) metadata", - "value": "26005" - }, - { - "description": "Jurisdiction Metadata for ksh_29(2020) id feb02de2-571d-41f0-8aaa-5c38c153b1a6", - "key": "feb02de2-571d-41f0-8aaa-5c38c153b1a6", - "label": "ksh_29(2020) metadata", - "value": "26006" - }, - { - "description": "Jurisdiction Metadata for ksh_105(2020) id 063b2844-f0fc-4fa5-828f-99157754769b", - "key": "063b2844-f0fc-4fa5-828f-99157754769b", - "label": "ksh_105(2020) metadata", - "value": "26007" - }, - { - "description": "Jurisdiction Metadata for ksh_94(2020) id 0b3d0fff-a561-4406-92d2-5b3bdbeb44b1", - "key": "0b3d0fff-a561-4406-92d2-5b3bdbeb44b1", - "label": "ksh_94(2020) metadata", - "value": "26008" - }, - { - "description": "Jurisdiction Metadata for ksh_184(2020) id 3c8f3ca8-c46a-427d-b83e-42fd68054f45", - "key": "3c8f3ca8-c46a-427d-b83e-42fd68054f45", - "label": "ksh_184(2020) metadata", - "value": "26009" - }, - { - "description": "Jurisdiction Metadata for ksh_137(2020) id 0761a51c-1c7a-45c6-87e6-bae383493b2d", - "key": "0761a51c-1c7a-45c6-87e6-bae383493b2d", - "label": "ksh_137(2020) metadata", - "value": "26010" - }, - { - "description": "Jurisdiction Metadata for ksh_43(2020) id 6d9ed5c0-a5d9-479d-a1ad-33e676dba6aa", - "key": "6d9ed5c0-a5d9-479d-a1ad-33e676dba6aa", - "label": "ksh_43(2020) metadata", - "value": "26011" - }, - { - "description": "Jurisdiction Metadata for ksh_174(2020) id 26187afe-9c4a-4508-8e51-d4228eab2b7e", - "key": "26187afe-9c4a-4508-8e51-d4228eab2b7e", - "label": "ksh_174(2020) metadata", - "value": "26012" - }, - { - "description": "Jurisdiction Metadata for ksh_188(2020) id af0b83ac-bf64-4db9-ac69-2399888a744f", - "key": "af0b83ac-bf64-4db9-ac69-2399888a744f", - "label": "ksh_188(2020) metadata", - "value": "26013" - }, - { - "description": "Jurisdiction Metadata for ksh_166(2020) id 31c5c257-fc82-4919-a91f-f9e7d1e26fd0", - "key": "31c5c257-fc82-4919-a91f-f9e7d1e26fd0", - "label": "ksh_166(2020) metadata", - "value": "26014" - }, - { - "description": "Jurisdiction Metadata for ksh_83(2020) id 63f646fd-9fee-4e0b-bf08-4eff1e6b906b", - "key": "63f646fd-9fee-4e0b-bf08-4eff1e6b906b", - "label": "ksh_83(2020) metadata", - "value": "26015" - }, - { - "description": "Jurisdiction Metadata for ksh_39(2020) id 6ac85751-b1f2-4a3a-b87d-446ee6c475d7", - "key": "6ac85751-b1f2-4a3a-b87d-446ee6c475d7", - "label": "ksh_39(2020) metadata", - "value": "26016" - }, - { - "description": "Jurisdiction Metadata for ksh_107(2020) id b347d67e-4a64-463f-a2ba-25e105c730de", - "key": "b347d67e-4a64-463f-a2ba-25e105c730de", - "label": "ksh_107(2020) metadata", - "value": "26017" - }, - { - "description": "Jurisdiction Metadata for ksh_131(2020) id a5b9abae-1990-4501-80fa-29d2e37ed0f7", - "key": "a5b9abae-1990-4501-80fa-29d2e37ed0f7", - "label": "ksh_131(2020) metadata", - "value": "26018" - }, - { - "description": "Jurisdiction Metadata for ksh_66(2020) id 18091750-0695-465a-916b-f360353eb492", - "key": "18091750-0695-465a-916b-f360353eb492", - "label": "ksh_66(2020) metadata", - "value": "26019" - }, - { - "description": "Jurisdiction Metadata for ksh_114(2020) id bdcb014f-890b-4483-9630-24b00e7fdcc6", - "key": "bdcb014f-890b-4483-9630-24b00e7fdcc6", - "label": "ksh_114(2020) metadata", - "value": "26020" - }, - { - "description": "Jurisdiction Metadata for ksh_96(2020) id 98c8fc6b-7c39-461b-a5fb-dd343bcf03b2", - "key": "98c8fc6b-7c39-461b-a5fb-dd343bcf03b2", - "label": "ksh_96(2020) metadata", - "value": "26021" - }, - { - "description": "Jurisdiction Metadata for ksh_133(2020) id 2b60af50-24d2-49d4-9617-6ae326257a1f", - "key": "2b60af50-24d2-49d4-9617-6ae326257a1f", - "label": "ksh_133(2020) metadata", - "value": "26022" - }, - { - "description": "Jurisdiction Metadata for ksh_120(2020) id b85ad335-1dc2-48c2-890b-5ce04375bb00", - "key": "b85ad335-1dc2-48c2-890b-5ce04375bb00", - "label": "ksh_120(2020) metadata", - "value": "26023" - }, - { - "description": "Jurisdiction Metadata for ksh_18(2020) id 8d3c1ddf-6e9d-4cfc-a3eb-243d799469be", - "key": "8d3c1ddf-6e9d-4cfc-a3eb-243d799469be", - "label": "ksh_18(2020) metadata", - "value": "26024" - }, - { - "description": "Jurisdiction Metadata for ksh_35(2020) id feb6fbf7-7d97-4500-b499-f29f69bcfa08", - "key": "feb6fbf7-7d97-4500-b499-f29f69bcfa08", - "label": "ksh_35(2020) metadata", - "value": "26025" - }, - { - "description": "Jurisdiction Metadata for ksh_52(2020) id 8d5e8dc9-1506-4883-b654-b954543b8cc0", - "key": "8d5e8dc9-1506-4883-b654-b954543b8cc0", - "label": "ksh_52(2020) metadata", - "value": "26026" - }, - { - "description": "Jurisdiction Metadata for ksh_132(2020) id 71e233bd-d742-4ec3-aa53-95a57f3ef049", - "key": "71e233bd-d742-4ec3-aa53-95a57f3ef049", - "label": "ksh_132(2020) metadata", - "value": "26027" - }, - { - "description": "Jurisdiction Metadata for ksh_145(2020) id f148471a-8f7a-4004-89a3-0a86685f1a00", - "key": "f148471a-8f7a-4004-89a3-0a86685f1a00", - "label": "ksh_145(2020) metadata", - "value": "26028" - }, - { - "description": "Jurisdiction Metadata for ksh_127(2020) id f89e0fee-e50f-44cd-9ea4-03c8b5a3e36b", - "key": "f89e0fee-e50f-44cd-9ea4-03c8b5a3e36b", - "label": "ksh_127(2020) metadata", - "value": "26029" - }, - { - "description": "Jurisdiction Metadata for ksh_157(2020) id b924cf58-2bc7-4cec-9da5-6f9b5329ee51", - "key": "b924cf58-2bc7-4cec-9da5-6f9b5329ee51", - "label": "ksh_157(2020) metadata", - "value": "26030" - }, - { - "description": "Jurisdiction Metadata for ksh_126(2020) id 8cb212f1-ee34-4ec8-8326-e3f3f8b123a4", - "key": "8cb212f1-ee34-4ec8-8326-e3f3f8b123a4", - "label": "ksh_126(2020) metadata", - "value": "26031" - }, - { - "description": "Jurisdiction Metadata for ksh_25(2020) id 3b8341b3-1c59-4143-8326-a35b761e28bc", - "key": "3b8341b3-1c59-4143-8326-a35b761e28bc", - "label": "ksh_25(2020) metadata", - "value": "26032" - }, - { - "description": "Jurisdiction Metadata for ksh_32(2020) id ba323089-e23d-4097-aee2-9f3197e5caef", - "key": "ba323089-e23d-4097-aee2-9f3197e5caef", - "label": "ksh_32(2020) metadata", - "value": "26033" - }, - { - "description": "Jurisdiction Metadata for ksh_46(2020) id ffa0254d-55b0-4227-b662-f88f16b9776e", - "key": "ffa0254d-55b0-4227-b662-f88f16b9776e", - "label": "ksh_46(2020) metadata", - "value": "26034" - }, - { - "description": "Jurisdiction Metadata for Mutono Zone id c20849ec-8537-49cf-b0d2-f1530c99a98b", - "key": "c20849ec-8537-49cf-b0d2-f1530c99a98b", - "label": "Mutono Zone metadata", - "value": "26035" - }, - { - "description": "Jurisdiction Metadata for ksh_9(2020) id ef5540aa-b4c2-41f9-9052-a4cf63f7f528", - "key": "ef5540aa-b4c2-41f9-9052-a4cf63f7f528", - "label": "ksh_9(2020) metadata", - "value": "26036" - }, - { - "description": "Jurisdiction Metadata for ksh_42(2020) id 853934ee-d1a6-4b69-9191-59047edbc9a8", - "key": "853934ee-d1a6-4b69-9191-59047edbc9a8", - "label": "ksh_42(2020) metadata", - "value": "26037" - }, - { - "description": "Jurisdiction Metadata for ksh_78(2020) id 45e59e15-9d30-4099-8739-150f7b893ef7", - "key": "45e59e15-9d30-4099-8739-150f7b893ef7", - "label": "ksh_78(2020) metadata", - "value": "26038" - }, - { - "description": "Jurisdiction Metadata for ksh_34(2020) id 72e1e262-5244-41a3-a23e-6bd87b5de7e7", - "key": "72e1e262-5244-41a3-a23e-6bd87b5de7e7", - "label": "ksh_34(2020) metadata", - "value": "26039" - }, - { - "description": "Jurisdiction Metadata for ksh_3(2020) id c05a67b9-75d9-4c41-842c-704146a1057f", - "key": "c05a67b9-75d9-4c41-842c-704146a1057f", - "label": "ksh_3(2020) metadata", - "value": "26040" - }, - { - "description": "Jurisdiction Metadata for Nkomba Kapepa Zone id 4ed8f536-5c08-4203-8a90-a7e13becb01d", - "key": "4ed8f536-5c08-4203-8a90-a7e13becb01d", - "label": "Nkomba Kapepa Zone metadata", - "value": "26041" - }, - { - "description": "Jurisdiction Metadata for ksh_2(2020) id 67c5e0a4-132f-457b-b573-9abf5ec95c75", - "key": "67c5e0a4-132f-457b-b573-9abf5ec95c75", - "label": "ksh_2(2020) metadata", - "value": "26042" - }, - { - "description": "Jurisdiction Metadata for Sonka Zone id 372d52e9-9409-4f34-8099-a515362db3f5", - "key": "372d52e9-9409-4f34-8099-a515362db3f5", - "label": "Sonka Zone metadata", - "value": "26043" - }, - { - "description": "Jurisdiction Metadata for ksh_7(2020) id 2db79e9d-3ab8-463e-845d-8a3b57de149f", - "key": "2db79e9d-3ab8-463e-845d-8a3b57de149f", - "label": "ksh_7(2020) metadata", - "value": "26044" - }, - { - "description": "Jurisdiction Metadata for ksh_206(2020) id ad749ae4-609e-4854-b47c-87988acf2760", - "key": "ad749ae4-609e-4854-b47c-87988acf2760", - "label": "ksh_206(2020) metadata", - "value": "26045" - }, - { - "description": "Jurisdiction Metadata for ksh_68(2020) id 9391d5a5-cc45-4461-bd2c-4e41126e921d", - "key": "9391d5a5-cc45-4461-bd2c-4e41126e921d", - "label": "ksh_68(2020) metadata", - "value": "26046" - }, - { - "description": "Jurisdiction Metadata for ksh_16(2020) id e6aba96a-5cd9-4c15-a555-15d30696c5f1", - "key": "e6aba96a-5cd9-4c15-a555-15d30696c5f1", - "label": "ksh_16(2020) metadata", - "value": "26047" - }, - { - "description": "Jurisdiction Metadata for ksh_14(2020) id f7845b16-ec0d-420b-b199-e1e0d2a6261c", - "key": "f7845b16-ec0d-420b-b199-e1e0d2a6261c", - "label": "ksh_14(2020) metadata", - "value": "26048" - }, - { - "description": "Jurisdiction Metadata for ksh_15(2020) id bb13995e-6d44-4709-8828-fd8cb9daccd0", - "key": "bb13995e-6d44-4709-8828-fd8cb9daccd0", - "label": "ksh_15(2020) metadata", - "value": "26049" - }, - { - "description": "Jurisdiction Metadata for ksh_17(2020) id 0a8b4981-3ea5-476c-bf98-61e11a368d04", - "key": "0a8b4981-3ea5-476c-bf98-61e11a368d04", - "label": "ksh_17(2020) metadata", - "value": "26050" - }, - { - "description": "Jurisdiction Metadata for ksh_19(2020) id e98eda68-3d1c-466c-8bd6-714f82b3cf35", - "key": "e98eda68-3d1c-466c-8bd6-714f82b3cf35", - "label": "ksh_19(2020) metadata", - "value": "26051" - }, - { - "description": "Jurisdiction Metadata for Daison Zone id d595ea79-5cda-4210-8774-98a8a6a41ca5", - "key": "d595ea79-5cda-4210-8774-98a8a6a41ca5", - "label": "Daison Zone metadata", - "value": "26052" - }, - { - "description": "Jurisdiction Metadata for ksh_13(2020) id 89efdbf1-d2c2-4cd0-b651-c47ae16dd274", - "key": "89efdbf1-d2c2-4cd0-b651-c47ae16dd274", - "label": "ksh_13(2020) metadata", - "value": "26053" - }, - { - "description": "Jurisdiction Metadata for ksh_4(2020) id dc8b12f9-e461-4012-ac62-4dca2dc18390", - "key": "dc8b12f9-e461-4012-ac62-4dca2dc18390", - "label": "ksh_4(2020) metadata", - "value": "26054" - }, - { - "description": "Jurisdiction Metadata for Yenga Zone id 4219cca4-9916-4da9-9cbc-505ab6b5b375", - "key": "4219cca4-9916-4da9-9cbc-505ab6b5b375", - "label": "Yenga Zone metadata", - "value": "26055" - }, - { - "description": "Jurisdiction Metadata for ksh_10(2020) id 2c93e794-8499-4a9e-a626-771fc23dc412", - "key": "2c93e794-8499-4a9e-a626-771fc23dc412", - "label": "ksh_10(2020) metadata", - "value": "26056" - }, - { - "description": "Jurisdiction Metadata for ksh_155(2020) id 16e1543c-dcd8-4c4b-9a33-e5edcb97497e", - "key": "16e1543c-dcd8-4c4b-9a33-e5edcb97497e", - "label": "ksh_155(2020) metadata", - "value": "26057" - }, - { - "description": "Jurisdiction Metadata for ksh_20(2020) id 4673840b-bfc7-4b60-a0b2-cd87bb7cedac", - "key": "4673840b-bfc7-4b60-a0b2-cd87bb7cedac", - "label": "ksh_20(2020) metadata", - "value": "26058" - }, - { - "description": "Jurisdiction Metadata for ksh_11(2020) id af3d332b-f528-4245-8b0b-6d74c3c06558", - "key": "af3d332b-f528-4245-8b0b-6d74c3c06558", - "label": "ksh_11(2020) metadata", - "value": "26059" - }, - { - "description": "Jurisdiction Metadata for ksh_5(2020) id d0106a8f-91fd-447a-b2cb-a2249228233a", - "key": "d0106a8f-91fd-447a-b2cb-a2249228233a", - "label": "ksh_5(2020) metadata", - "value": "26060" - }, - { - "description": "Jurisdiction Metadata for Mpundu Zone id 4ace14cd-effe-497f-9eac-20bd622503af", - "key": "4ace14cd-effe-497f-9eac-20bd622503af", - "label": "Mpundu Zone metadata", - "value": "26061" - }, - { - "description": "Jurisdiction Metadata for ksh_1(2020) id f3ac7a52-9242-4fa6-952d-ac3e3ca1a809", - "key": "f3ac7a52-9242-4fa6-952d-ac3e3ca1a809", - "label": "ksh_1(2020) metadata", - "value": "26062" - }, - { - "description": "Jurisdiction Metadata for ksh_12(2020) id 31b25656-df7f-4f4a-b2dc-fdc49a8bb7e6", - "key": "31b25656-df7f-4f4a-b2dc-fdc49a8bb7e6", - "label": "ksh_12(2020) metadata", - "value": "26063" - }, - { - "description": "Jurisdiction Metadata for Kefulwa(2020) id f787f122-72e1-424b-97be-4e9505844191", - "key": "f787f122-72e1-424b-97be-4e9505844191", - "label": "Kefulwa(2020) metadata", - "value": "26064" - }, - { - "description": "Jurisdiction Metadata for Felushi id c82293da-790e-4128-a1f8-1e0c48021522", - "key": "c82293da-790e-4128-a1f8-1e0c48021522", - "label": "Felushi metadata", - "value": "26065" - }, - { - "description": "Jurisdiction Metadata for Kef_102(2020) id 034bfbf9-819a-4af1-8052-07948187214b", - "key": "034bfbf9-819a-4af1-8052-07948187214b", - "label": "Kef_102(2020) metadata", - "value": "26066" - }, - { - "description": "Jurisdiction Metadata for Kef_6(2020) id cfdeac6e-d38c-4f72-80f6-81f867c8f587", - "key": "cfdeac6e-d38c-4f72-80f6-81f867c8f587", - "label": "Kef_6(2020) metadata", - "value": "26067" - }, - { - "description": "Jurisdiction Metadata for Kef_83(2020) id 966744f0-60c2-4f23-9c77-0e8a7415f8fa", - "key": "966744f0-60c2-4f23-9c77-0e8a7415f8fa", - "label": "Kef_83(2020) metadata", - "value": "26068" - }, - { - "description": "Jurisdiction Metadata for Kef_149(2020) id 56d5a940-d71a-4f3c-b9e5-a0d8bacbab4e", - "key": "56d5a940-d71a-4f3c-b9e5-a0d8bacbab4e", - "label": "Kef_149(2020) metadata", - "value": "26069" - }, - { - "description": "Jurisdiction Metadata for Kef_70(2020) id 87b24082-5965-4d98-b972-e1bcd5d18032", - "key": "87b24082-5965-4d98-b972-e1bcd5d18032", - "label": "Kef_70(2020) metadata", - "value": "26070" - }, - { - "description": "Jurisdiction Metadata for Kef_147(2020) id 4bcab0a7-7db0-4727-857d-a980c7d13615", - "key": "4bcab0a7-7db0-4727-857d-a980c7d13615", - "label": "Kef_147(2020) metadata", - "value": "26071" - }, - { - "description": "Jurisdiction Metadata for Kef_1(2020) id fd63626d-e621-46fd-b482-7265678ac4d9", - "key": "fd63626d-e621-46fd-b482-7265678ac4d9", - "label": "Kef_1(2020) metadata", - "value": "26072" - }, - { - "description": "Jurisdiction Metadata for Kef_148(2020) id e381f7b8-4d93-4f6f-a76e-af20097ea082", - "key": "e381f7b8-4d93-4f6f-a76e-af20097ea082", - "label": "Kef_148(2020) metadata", - "value": "26073" - }, - { - "description": "Jurisdiction Metadata for Kef_208(2020) id e65b52b8-d711-4805-ab6f-0d6c35384883", - "key": "e65b52b8-d711-4805-ab6f-0d6c35384883", - "label": "Kef_208(2020) metadata", - "value": "26074" - }, - { - "description": "Jurisdiction Metadata for Kaputo (Munkombwe) id da29b655-57eb-45ac-85f4-72f8dc5d24ca", - "key": "da29b655-57eb-45ac-85f4-72f8dc5d24ca", - "label": "Kaputo (Munkombwe) metadata", - "value": "26075" - }, - { - "description": "Jurisdiction Metadata for Kef_16(2020) id 11c83854-8a0d-4fb0-8495-ac074913beac", - "key": "11c83854-8a0d-4fb0-8495-ac074913beac", - "label": "Kef_16(2020) metadata", - "value": "26076" - }, - { - "description": "Jurisdiction Metadata for Kef_42(2020) id b08b0614-dd00-4548-88ff-35957694c236", - "key": "b08b0614-dd00-4548-88ff-35957694c236", - "label": "Kef_42(2020) metadata", - "value": "26077" - }, - { - "description": "Jurisdiction Metadata for Kef_26(2020) id a057171a-f38a-4831-8acc-3b7a76ee36b6", - "key": "a057171a-f38a-4831-8acc-3b7a76ee36b6", - "label": "Kef_26(2020) metadata", - "value": "26078" - }, - { - "description": "Jurisdiction Metadata for Kef_55(2020) id 44a398d4-212f-4552-89d8-c1fcdb26b3eb", - "key": "44a398d4-212f-4552-89d8-c1fcdb26b3eb", - "label": "Kef_55(2020) metadata", - "value": "26079" - }, - { - "description": "Jurisdiction Metadata for Kef_11(2020) id d490fc04-0a25-431c-af33-2d6445ea28d3", - "key": "d490fc04-0a25-431c-af33-2d6445ea28d3", - "label": "Kef_11(2020) metadata", - "value": "26080" - }, - { - "description": "Jurisdiction Metadata for Kef_118(2020) id ffe59187-50ed-44d6-b5ea-aa0350ee639d", - "key": "ffe59187-50ed-44d6-b5ea-aa0350ee639d", - "label": "Kef_118(2020) metadata", - "value": "26081" - }, - { - "description": "Jurisdiction Metadata for Kef_224(2020) id dce779b3-e7e5-4d13-b8a3-dadae68d486d", - "key": "dce779b3-e7e5-4d13-b8a3-dadae68d486d", - "label": "Kef_224(2020) metadata", - "value": "26082" - }, - { - "description": "Jurisdiction Metadata for Kef_48(2020) id 53740598-0d11-40ea-b4b6-86fa418dde08", - "key": "53740598-0d11-40ea-b4b6-86fa418dde08", - "label": "Kef_48(2020) metadata", - "value": "26083" - }, - { - "description": "Jurisdiction Metadata for Kef_60(2020) id 797d6415-b3b3-4845-ae8d-513b8a7a2a88", - "key": "797d6415-b3b3-4845-ae8d-513b8a7a2a88", - "label": "Kef_60(2020) metadata", - "value": "26084" - }, - { - "description": "Jurisdiction Metadata for Kef_130(2020) id c33ea0ca-045b-409a-abbe-9339378dbcd5", - "key": "c33ea0ca-045b-409a-abbe-9339378dbcd5", - "label": "Kef_130(2020) metadata", - "value": "26085" - }, - { - "description": "Jurisdiction Metadata for Kef_27(2020) id b3658dd2-2a49-45e1-bfdd-a4368f74adc2", - "key": "b3658dd2-2a49-45e1-bfdd-a4368f74adc2", - "label": "Kef_27(2020) metadata", - "value": "26086" - }, - { - "description": "Jurisdiction Metadata for Kef_39(2020) id a604ece7-686d-46ee-9a97-816316b62282", - "key": "a604ece7-686d-46ee-9a97-816316b62282", - "label": "Kef_39(2020) metadata", - "value": "26087" - }, - { - "description": "Jurisdiction Metadata for Kef_67(2020) id 365e8d79-04c1-485a-82f4-6685eb35c696", - "key": "365e8d79-04c1-485a-82f4-6685eb35c696", - "label": "Kef_67(2020) metadata", - "value": "26088" - }, - { - "description": "Jurisdiction Metadata for Kef_31(2020) id b228bb61-2ba1-40f7-9687-d55dbac749f2", - "key": "b228bb61-2ba1-40f7-9687-d55dbac749f2", - "label": "Kef_31(2020) metadata", - "value": "26089" - }, - { - "description": "Jurisdiction Metadata for Kef_127(2020) id debcca44-55fc-4475-9efd-21bb95013b01", - "key": "debcca44-55fc-4475-9efd-21bb95013b01", - "label": "Kef_127(2020) metadata", - "value": "26090" - }, - { - "description": "Jurisdiction Metadata for Kef_34(2020) id 4270a291-9b5e-4cf5-bcd4-b2d318d19a41", - "key": "4270a291-9b5e-4cf5-bcd4-b2d318d19a41", - "label": "Kef_34(2020) metadata", - "value": "26091" - }, - { - "description": "Jurisdiction Metadata for Kef_62(2020) id 0a4dbc36-9d8a-4982-bb77-1d8446bbec11", - "key": "0a4dbc36-9d8a-4982-bb77-1d8446bbec11", - "label": "Kef_62(2020) metadata", - "value": "26092" - }, - { - "description": "Jurisdiction Metadata for Kef_49(2020) id 9e78f5a7-98e6-465b-8008-d98b360ffb5e", - "key": "9e78f5a7-98e6-465b-8008-d98b360ffb5e", - "label": "Kef_49(2020) metadata", - "value": "26093" - }, - { - "description": "Jurisdiction Metadata for Kef_119(2020) id 8c922279-c14b-4e6d-ad63-d3d16e63e4bc", - "key": "8c922279-c14b-4e6d-ad63-d3d16e63e4bc", - "label": "Kef_119(2020) metadata", - "value": "26094" - }, - { - "description": "Jurisdiction Metadata for Kef_68(2020) id 7a1f859c-1ea6-4214-a5de-9f7dab790e8c", - "key": "7a1f859c-1ea6-4214-a5de-9f7dab790e8c", - "label": "Kef_68(2020) metadata", - "value": "26095" - }, - { - "description": "Jurisdiction Metadata for Kef_24(2020) id 5becc2fa-f075-4acd-9fba-d570bf7a8d14", - "key": "5becc2fa-f075-4acd-9fba-d570bf7a8d14", - "label": "Kef_24(2020) metadata", - "value": "26096" - }, - { - "description": "Jurisdiction Metadata for Kef_185(2020) id 5eb5a79f-534c-4d1a-876a-d04cc823f7dc", - "key": "5eb5a79f-534c-4d1a-876a-d04cc823f7dc", - "label": "Kef_185(2020) metadata", - "value": "26097" - }, - { - "description": "Jurisdiction Metadata for Kalubi id 98525cfa-4e29-4ed7-85da-f0cf31a61d8e", - "key": "98525cfa-4e29-4ed7-85da-f0cf31a61d8e", - "label": "Kalubi metadata", - "value": "26098" - }, - { - "description": "Jurisdiction Metadata for Kef_7(2020) id 45c50008-222b-4b54-84e8-b55adf6b5f2c", - "key": "45c50008-222b-4b54-84e8-b55adf6b5f2c", - "label": "Kef_7(2020) metadata", - "value": "26099" - }, - { - "description": "Jurisdiction Metadata for Kef_41(2020) id a34d0217-a216-4317-bb16-dd2d56b70bf4", - "key": "a34d0217-a216-4317-bb16-dd2d56b70bf4", - "label": "Kef_41(2020) metadata", - "value": "26100" - }, - { - "description": "Jurisdiction Metadata for Kef_66(2020) id 79a82c52-06dc-448a-adfa-c6e94c1e0148", - "key": "79a82c52-06dc-448a-adfa-c6e94c1e0148", - "label": "Kef_66(2020) metadata", - "value": "26101" - }, - { - "description": "Jurisdiction Metadata for Mukeya id fc937da0-922c-42a0-bec1-3402bfa80d51", - "key": "fc937da0-922c-42a0-bec1-3402bfa80d51", - "label": "Mukeya metadata", - "value": "26102" - }, - { - "description": "Jurisdiction Metadata for Kef_4(2020) id 93da30f9-e3de-4b4f-bc2e-c2172716f9ad", - "key": "93da30f9-e3de-4b4f-bc2e-c2172716f9ad", - "label": "Kef_4(2020) metadata", - "value": "26103" - }, - { - "description": "Jurisdiction Metadata for Kef_12(2020) id 73908ed2-86ff-4c8f-8081-5fa941bd86c6", - "key": "73908ed2-86ff-4c8f-8081-5fa941bd86c6", - "label": "Kef_12(2020) metadata", - "value": "26104" - }, - { - "description": "Jurisdiction Metadata for Kandeke id 2922593a-0042-4c82-ab8f-d9d0c70ec7cb", - "key": "2922593a-0042-4c82-ab8f-d9d0c70ec7cb", - "label": "Kandeke metadata", - "value": "26105" - }, - { - "description": "Jurisdiction Metadata for Kef_8(2020) id dedddf18-29c7-47ba-a5b0-12359c77f835", - "key": "dedddf18-29c7-47ba-a5b0-12359c77f835", - "label": "Kef_8(2020) metadata", - "value": "26106" - }, - { - "description": "Jurisdiction Metadata for Malambo id 94376ef0-fdd5-4f9c-a777-0e2e444e6549", - "key": "94376ef0-fdd5-4f9c-a777-0e2e444e6549", - "label": "Malambo metadata", - "value": "26107" - }, - { - "description": "Jurisdiction Metadata for Kef_142(2020) id 6332c9b3-c149-46ef-ae4f-23c9c8ac372e", - "key": "6332c9b3-c149-46ef-ae4f-23c9c8ac372e", - "label": "Kef_142(2020) metadata", - "value": "26108" - }, - { - "description": "Jurisdiction Metadata for Kef_9(2020) id cd7999f5-d75b-4c34-80da-e9caa234c087", - "key": "cd7999f5-d75b-4c34-80da-e9caa234c087", - "label": "Kef_9(2020) metadata", - "value": "26109" - }, - { - "description": "Jurisdiction Metadata for Chiba id 04428222-a0f3-4289-bbbd-95640602d299", - "key": "04428222-a0f3-4289-bbbd-95640602d299", - "label": "Chiba metadata", - "value": "26110" - }, - { - "description": "Jurisdiction Metadata for Kef_2(2020) id 0e199a40-8d23-48af-9c0d-95d35a539143", - "key": "0e199a40-8d23-48af-9c0d-95d35a539143", - "label": "Kef_2(2020) metadata", - "value": "26111" - }, - { - "description": "Jurisdiction Metadata for Kef_145(2020) id 11d785ce-410d-4817-ae41-0e2e7bbb8170", - "key": "11d785ce-410d-4817-ae41-0e2e7bbb8170", - "label": "Kef_145(2020) metadata", - "value": "26112" - }, - { - "description": "Jurisdiction Metadata for Kef_54(2020) id d2e60221-0b96-4a0a-9473-b5bd28bdce6e", - "key": "d2e60221-0b96-4a0a-9473-b5bd28bdce6e", - "label": "Kef_54(2020) metadata", - "value": "26113" - }, - { - "description": "Jurisdiction Metadata for Kaputo id c2c9ea6c-fef5-436a-bac5-5280f8d0b595", - "key": "c2c9ea6c-fef5-436a-bac5-5280f8d0b595", - "label": "Kaputo metadata", - "value": "26114" - }, - { - "description": "Jurisdiction Metadata for Kef_3(2020) id 3e5d8914-b355-4097-9665-e700695bcb53", - "key": "3e5d8914-b355-4097-9665-e700695bcb53", - "label": "Kef_3(2020) metadata", - "value": "26115" - }, - { - "description": "Jurisdiction Metadata for Kef_18(2020) id dd798014-fbe5-491e-a2ea-41cf1caf6228", - "key": "dd798014-fbe5-491e-a2ea-41cf1caf6228", - "label": "Kef_18(2020) metadata", - "value": "26116" - }, - { - "description": "Jurisdiction Metadata for Kalimashe id 5aa534b7-accc-4442-b3e0-3f50c8012da1", - "key": "5aa534b7-accc-4442-b3e0-3f50c8012da1", - "label": "Kalimashe metadata", - "value": "26117" - }, - { - "description": "Jurisdiction Metadata for Kef_32(2020) id 56b92c9f-b7b6-4c97-af78-24653c601ee5", - "key": "56b92c9f-b7b6-4c97-af78-24653c601ee5", - "label": "Kef_32(2020) metadata", - "value": "26118" - }, - { - "description": "Jurisdiction Metadata for Kef_19(2020) id ac719b51-f6e9-425a-aa74-a8053705650d", - "key": "ac719b51-f6e9-425a-aa74-a8053705650d", - "label": "Kef_19(2020) metadata", - "value": "26119" - }, - { - "description": "Jurisdiction Metadata for Kef_23(2020) id 12dcfb30-4f38-4241-a3c2-acae272f02cf", - "key": "12dcfb30-4f38-4241-a3c2-acae272f02cf", - "label": "Kef_23(2020) metadata", - "value": "26120" - }, - { - "description": "Jurisdiction Metadata for Kasamba id bde599f7-b817-434d-bc4f-028c814d0a58", - "key": "bde599f7-b817-434d-bc4f-028c814d0a58", - "label": "Kasamba metadata", - "value": "26121" - }, - { - "description": "Jurisdiction Metadata for Kef_211(2020) id 6f1b3dae-031d-4a0c-a915-97bca3b6b88c", - "key": "6f1b3dae-031d-4a0c-a915-97bca3b6b88c", - "label": "Kef_211(2020) metadata", - "value": "26122" - }, - { - "description": "Jurisdiction Metadata for Kef_146(2020) id 2a8e7159-dc71-4e18-9ad4-5b3a320bd383", - "key": "2a8e7159-dc71-4e18-9ad4-5b3a320bd383", - "label": "Kef_146(2020) metadata", - "value": "26123" - }, - { - "description": "Jurisdiction Metadata for Kef_51(2020) id 5a0c4f71-5dfe-4d1b-b15e-d13b1db9d2a0", - "key": "5a0c4f71-5dfe-4d1b-b15e-d13b1db9d2a0", - "label": "Kef_51(2020) metadata", - "value": "26124" - }, - { - "description": "Jurisdiction Metadata for Kef_203(2020) id 2fc29958-496d-4a45-8e43-de0238c2f79f", - "key": "2fc29958-496d-4a45-8e43-de0238c2f79f", - "label": "Kef_203(2020) metadata", - "value": "26125" - }, - { - "description": "Jurisdiction Metadata for Kef_84(2020) id 0d9e8ca2-6fd8-4216-b0be-18ca1dc143a7", - "key": "0d9e8ca2-6fd8-4216-b0be-18ca1dc143a7", - "label": "Kef_84(2020) metadata", - "value": "26126" - }, - { - "description": "Jurisdiction Metadata for Kef_106(2020) id 3cd18585-48bc-4d1d-b14b-cd3af9fa44fb", - "key": "3cd18585-48bc-4d1d-b14b-cd3af9fa44fb", - "label": "Kef_106(2020) metadata", - "value": "26127" - }, - { - "description": "Jurisdiction Metadata for Kef_85(2020) id cd5ca32c-0096-4d53-9cc7-4da863148b48", - "key": "cd5ca32c-0096-4d53-9cc7-4da863148b48", - "label": "Kef_85(2020) metadata", - "value": "26128" - }, - { - "description": "Jurisdiction Metadata for Kef_221(2020) id 19dde055-a640-4815-bb6a-8317b1846afc", - "key": "19dde055-a640-4815-bb6a-8317b1846afc", - "label": "Kef_221(2020) metadata", - "value": "26129" - }, - { - "description": "Jurisdiction Metadata for Kef_206(2020) id 2b717e56-71c6-4cf0-92ee-e9a9ef1c4e75", - "key": "2b717e56-71c6-4cf0-92ee-e9a9ef1c4e75", - "label": "Kef_206(2020) metadata", - "value": "26130" - }, - { - "description": "Jurisdiction Metadata for Kef_197(2020) id 7a1de10c-bb98-431b-9ff1-472581f201a1", - "key": "7a1de10c-bb98-431b-9ff1-472581f201a1", - "label": "Kef_197(2020) metadata", - "value": "26131" - }, - { - "description": "Jurisdiction Metadata for Kef_187(2020) id a0143ae2-84a6-48fd-bcdd-6ff89b612fb0", - "key": "a0143ae2-84a6-48fd-bcdd-6ff89b612fb0", - "label": "Kef_187(2020) metadata", - "value": "26132" - }, - { - "description": "Jurisdiction Metadata for Kef_133(2020) id 183191be-08ff-444e-9ad5-084e93529eed", - "key": "183191be-08ff-444e-9ad5-084e93529eed", - "label": "Kef_133(2020) metadata", - "value": "26133" - }, - { - "description": "Jurisdiction Metadata for Kef_126(2020) id 3c8b0057-ec2e-4271-8c55-aac7a26478aa", - "key": "3c8b0057-ec2e-4271-8c55-aac7a26478aa", - "label": "Kef_126(2020) metadata", - "value": "26134" - }, - { - "description": "Jurisdiction Metadata for Kef_156(2020) id 725ffe67-d4e7-4244-aa02-7c1237b2fa82", - "key": "725ffe67-d4e7-4244-aa02-7c1237b2fa82", - "label": "Kef_156(2020) metadata", - "value": "26135" - }, - { - "description": "Jurisdiction Metadata for Kef_166(2020) id 69f0751d-472c-487c-b46b-a13c96c34e08", - "key": "69f0751d-472c-487c-b46b-a13c96c34e08", - "label": "Kef_166(2020) metadata", - "value": "26136" - }, - { - "description": "Jurisdiction Metadata for Kef_163(2020) id 4b9d4c9d-af9b-4665-9ed4-008995c82115", - "key": "4b9d4c9d-af9b-4665-9ed4-008995c82115", - "label": "Kef_163(2020) metadata", - "value": "26137" - }, - { - "description": "Jurisdiction Metadata for Kef_151(2020) id 903587e1-0647-4653-8313-945b4596acb0", - "key": "903587e1-0647-4653-8313-945b4596acb0", - "label": "Kef_151(2020) metadata", - "value": "26138" - }, - { - "description": "Jurisdiction Metadata for Kef_128(2020) id 5838bc38-028f-41bb-ae77-239025d67a45", - "key": "5838bc38-028f-41bb-ae77-239025d67a45", - "label": "Kef_128(2020) metadata", - "value": "26139" - }, - { - "description": "Jurisdiction Metadata for Kef_129(2020) id 3b741bdf-d90a-446a-9476-76c489a809df", - "key": "3b741bdf-d90a-446a-9476-76c489a809df", - "label": "Kef_129(2020) metadata", - "value": "26140" - }, - { - "description": "Jurisdiction Metadata for Kef_93(2020) id c549ee84-fb05-49ce-b2f4-9114b5e9ee24", - "key": "c549ee84-fb05-49ce-b2f4-9114b5e9ee24", - "label": "Kef_93(2020) metadata", - "value": "26141" - }, - { - "description": "Jurisdiction Metadata for Kef_189(2020) id 86ed1c6c-8052-4122-b379-ebf1dfbe0e70", - "key": "86ed1c6c-8052-4122-b379-ebf1dfbe0e70", - "label": "Kef_189(2020) metadata", - "value": "26142" - }, - { - "description": "Jurisdiction Metadata for Kef_168(2020) id 19ab2409-28dd-459d-9cb8-401e21363b0f", - "key": "19ab2409-28dd-459d-9cb8-401e21363b0f", - "label": "Kef_168(2020) metadata", - "value": "26143" - }, - { - "description": "Jurisdiction Metadata for Kef_21(2020) id e5ddea04-f3c2-45a1-8f1e-0f66d623fc9f", - "key": "e5ddea04-f3c2-45a1-8f1e-0f66d623fc9f", - "label": "Kef_21(2020) metadata", - "value": "26144" - }, - { - "description": "Jurisdiction Metadata for Kef_172(2020) id f184af30-0c55-4768-9af9-7ea5a0f7f6ae", - "key": "f184af30-0c55-4768-9af9-7ea5a0f7f6ae", - "label": "Kef_172(2020) metadata", - "value": "26145" - }, - { - "description": "Jurisdiction Metadata for Kef_89(2020) id 9f28460c-eafe-436f-892b-f50e83a62003", - "key": "9f28460c-eafe-436f-892b-f50e83a62003", - "label": "Kef_89(2020) metadata", - "value": "26146" - }, - { - "description": "Jurisdiction Metadata for Kef_104(2020) id 12e5254f-d913-4ea6-91ea-b2215872a855", - "key": "12e5254f-d913-4ea6-91ea-b2215872a855", - "label": "Kef_104(2020) metadata", - "value": "26147" - }, - { - "description": "Jurisdiction Metadata for Kef_188(2020) id 7e134218-12f2-478d-b67b-3e4f96475cdc", - "key": "7e134218-12f2-478d-b67b-3e4f96475cdc", - "label": "Kef_188(2020) metadata", - "value": "26148" - }, - { - "description": "Jurisdiction Metadata for Kef_165(2020) id 7d6c01dc-9fea-44bc-a26a-e2fbc7d94021", - "key": "7d6c01dc-9fea-44bc-a26a-e2fbc7d94021", - "label": "Kef_165(2020) metadata", - "value": "26149" - }, - { - "description": "Jurisdiction Metadata for Kef_58(2020) id 9cea982f-66af-4c11-8a74-255ee9313a27", - "key": "9cea982f-66af-4c11-8a74-255ee9313a27", - "label": "Kef_58(2020) metadata", - "value": "26150" - }, - { - "description": "Jurisdiction Metadata for Kef_111(2020) id 4f60c03e-7c2b-41ad-b471-a1cd63f44043", - "key": "4f60c03e-7c2b-41ad-b471-a1cd63f44043", - "label": "Kef_111(2020) metadata", - "value": "26151" - }, - { - "description": "Jurisdiction Metadata for Kef_155(2020) id 7d3fc678-b44e-41d1-a068-aed58b0ef888", - "key": "7d3fc678-b44e-41d1-a068-aed58b0ef888", - "label": "Kef_155(2020) metadata", - "value": "26152" - }, - { - "description": "Jurisdiction Metadata for Kef_71(2020) id 72d3a91e-2bb3-47b9-8984-fccfd0361d71", - "key": "72d3a91e-2bb3-47b9-8984-fccfd0361d71", - "label": "Kef_71(2020) metadata", - "value": "26153" - }, - { - "description": "Jurisdiction Metadata for Kef_91(2020) id 57262cbb-e634-4bb4-8d6e-0bbc3c8c8fda", - "key": "57262cbb-e634-4bb4-8d6e-0bbc3c8c8fda", - "label": "Kef_91(2020) metadata", - "value": "26154" - }, - { - "description": "Jurisdiction Metadata for Kef_231(2020) id b9b6c1a1-4a31-4682-93e3-539dbcb8d690", - "key": "b9b6c1a1-4a31-4682-93e3-539dbcb8d690", - "label": "Kef_231(2020) metadata", - "value": "26155" - }, - { - "description": "Jurisdiction Metadata for Kef_78(2020) id f520a437-407e-49f4-9346-190371965ce4", - "key": "f520a437-407e-49f4-9346-190371965ce4", - "label": "Kef_78(2020) metadata", - "value": "26156" - }, - { - "description": "Jurisdiction Metadata for Kef_159(2020) id a7514805-6a13-4371-ac1a-0da54d3a61e7", - "key": "a7514805-6a13-4371-ac1a-0da54d3a61e7", - "label": "Kef_159(2020) metadata", - "value": "26157" - }, - { - "description": "Jurisdiction Metadata for Kef_105(2020) id 5166a456-3060-4a90-a873-b13091674785", - "key": "5166a456-3060-4a90-a873-b13091674785", - "label": "Kef_105(2020) metadata", - "value": "26158" - }, - { - "description": "Jurisdiction Metadata for Kef_138(2020) id fb2caf92-4b69-4621-920f-984cea90b5ee", - "key": "fb2caf92-4b69-4621-920f-984cea90b5ee", - "label": "Kef_138(2020) metadata", - "value": "26159" - }, - { - "description": "Jurisdiction Metadata for Kef_139(2020) id 3315046d-99e3-4a13-ab99-f0659187e8b9", - "key": "3315046d-99e3-4a13-ab99-f0659187e8b9", - "label": "Kef_139(2020) metadata", - "value": "26160" - }, - { - "description": "Jurisdiction Metadata for Kef_120(2020) id f6300f81-9c14-4d86-ba6f-6df4e5931824", - "key": "f6300f81-9c14-4d86-ba6f-6df4e5931824", - "label": "Kef_120(2020) metadata", - "value": "26161" - }, - { - "description": "Jurisdiction Metadata for Kef_38(2020) id 52b28c2a-6e2f-41ad-836c-90053aac4286", - "key": "52b28c2a-6e2f-41ad-836c-90053aac4286", - "label": "Kef_38(2020) metadata", - "value": "26162" - }, - { - "description": "Jurisdiction Metadata for Kef_47(2020) id fa229504-514c-4851-8be4-18188f3abc66", - "key": "fa229504-514c-4851-8be4-18188f3abc66", - "label": "Kef_47(2020) metadata", - "value": "26163" - }, - { - "description": "Jurisdiction Metadata for Kef_212(2020) id 34281906-7c49-4dca-9c43-2cf83a925e25", - "key": "34281906-7c49-4dca-9c43-2cf83a925e25", - "label": "Kef_212(2020) metadata", - "value": "26164" - }, - { - "description": "Jurisdiction Metadata for Kef_170(2020) id e082431d-dbc6-453d-b2b5-b6d702e84e60", - "key": "e082431d-dbc6-453d-b2b5-b6d702e84e60", - "label": "Kef_170(2020) metadata", - "value": "26165" - }, - { - "description": "Jurisdiction Metadata for Kef_63(2020) id b025d783-8ca5-4d46-9605-a7c84e2ac3c4", - "key": "b025d783-8ca5-4d46-9605-a7c84e2ac3c4", - "label": "Kef_63(2020) metadata", - "value": "26166" - }, - { - "description": "Jurisdiction Metadata for Kef_109(2020) id a8ef87c2-8212-402f-9e3b-dbd16df32a8d", - "key": "a8ef87c2-8212-402f-9e3b-dbd16df32a8d", - "label": "Kef_109(2020) metadata", - "value": "26167" - }, - { - "description": "Jurisdiction Metadata for Kef_226(2020) id f1551ec2-b25c-48b0-8c00-33f8260ab740", - "key": "f1551ec2-b25c-48b0-8c00-33f8260ab740", - "label": "Kef_226(2020) metadata", - "value": "26168" - }, - { - "description": "Jurisdiction Metadata for Kef_36(2020) id 2bb6e5dd-e9a6-4a8a-af95-674d2252779d", - "key": "2bb6e5dd-e9a6-4a8a-af95-674d2252779d", - "label": "Kef_36(2020) metadata", - "value": "26169" - }, - { - "description": "Jurisdiction Metadata for Kef_154(2020) id 01ff18e1-03b5-4abe-91a3-0228e35150fb", - "key": "01ff18e1-03b5-4abe-91a3-0228e35150fb", - "label": "Kef_154(2020) metadata", - "value": "26170" - }, - { - "description": "Jurisdiction Metadata for Kef_150(2020) id f6f849d2-5ff0-4504-ac12-822d4cc1a22d", - "key": "f6f849d2-5ff0-4504-ac12-822d4cc1a22d", - "label": "Kef_150(2020) metadata", - "value": "26171" - }, - { - "description": "Jurisdiction Metadata for Kef_186(2020) id d5cac38a-163a-4aa1-a74b-a2fc491370df", - "key": "d5cac38a-163a-4aa1-a74b-a2fc491370df", - "label": "Kef_186(2020) metadata", - "value": "26172" - }, - { - "description": "Jurisdiction Metadata for Kef_25(2020) id cfd5b182-ad40-4121-9584-a68160b6a009", - "key": "cfd5b182-ad40-4121-9584-a68160b6a009", - "label": "Kef_25(2020) metadata", - "value": "26173" - }, - { - "description": "Jurisdiction Metadata for Kef_173(2020) id 1d50ed34-3091-4ff9-8e6b-f1e73ef97d86", - "key": "1d50ed34-3091-4ff9-8e6b-f1e73ef97d86", - "label": "Kef_173(2020) metadata", - "value": "26174" - }, - { - "description": "Jurisdiction Metadata for Kef_87(2020) id cacb8c29-9f9d-4c8c-86b1-aa54d819fca5", - "key": "cacb8c29-9f9d-4c8c-86b1-aa54d819fca5", - "label": "Kef_87(2020) metadata", - "value": "26175" - }, - { - "description": "Jurisdiction Metadata for Kef_30(2020) id 84ef7a22-37ff-4673-9a40-b87e31ad5bc6", - "key": "84ef7a22-37ff-4673-9a40-b87e31ad5bc6", - "label": "Kef_30(2020) metadata", - "value": "26176" - }, - { - "description": "Jurisdiction Metadata for Kef_132(2020) id 44531daf-b098-4d15-b5d1-04b3a8f05401", - "key": "44531daf-b098-4d15-b5d1-04b3a8f05401", - "label": "Kef_132(2020) metadata", - "value": "26177" - }, - { - "description": "Jurisdiction Metadata for Kef_122(2020) id 19e1e73f-bdaf-4c2f-9e5e-c8bf87676d21", - "key": "19e1e73f-bdaf-4c2f-9e5e-c8bf87676d21", - "label": "Kef_122(2020) metadata", - "value": "26178" - }, - { - "description": "Jurisdiction Metadata for Kef_177(2020) id 6f1f4860-dbee-418e-9ee3-4bba61ff3e31", - "key": "6f1f4860-dbee-418e-9ee3-4bba61ff3e31", - "label": "Kef_177(2020) metadata", - "value": "26179" - }, - { - "description": "Jurisdiction Metadata for Kef_56(2020) id 9d291f41-4db0-4a4d-baa4-973d822a13a0", - "key": "9d291f41-4db0-4a4d-baa4-973d822a13a0", - "label": "Kef_56(2020) metadata", - "value": "26180" - }, - { - "description": "Jurisdiction Metadata for Kef_153(2020) id c850b33c-d6f8-40d7-8457-7677aaee8efc", - "key": "c850b33c-d6f8-40d7-8457-7677aaee8efc", - "label": "Kef_153(2020) metadata", - "value": "26181" - }, - { - "description": "Jurisdiction Metadata for Kef_20(2020) id b72daa27-1f2a-44c7-a2e0-9e35fb579931", - "key": "b72daa27-1f2a-44c7-a2e0-9e35fb579931", - "label": "Kef_20(2020) metadata", - "value": "26182" - }, - { - "description": "Jurisdiction Metadata for Kef_218(2020) id b058c217-9cc5-480c-80a6-c1a2f19cc24e", - "key": "b058c217-9cc5-480c-80a6-c1a2f19cc24e", - "label": "Kef_218(2020) metadata", - "value": "26183" - }, - { - "description": "Jurisdiction Metadata for Kef_64(2020) id a5270169-4551-41c4-9701-b5dcb8229f87", - "key": "a5270169-4551-41c4-9701-b5dcb8229f87", - "label": "Kef_64(2020) metadata", - "value": "26184" - }, - { - "description": "Jurisdiction Metadata for Kef_190(2020) id 3ec362fc-229b-44ab-8d3e-761541bc5f08", - "key": "3ec362fc-229b-44ab-8d3e-761541bc5f08", - "label": "Kef_190(2020) metadata", - "value": "26185" - }, - { - "description": "Jurisdiction Metadata for Kef_82(2020) id 12375d0a-7801-47ca-91d2-afb840a66887", - "key": "12375d0a-7801-47ca-91d2-afb840a66887", - "label": "Kef_82(2020) metadata", - "value": "26186" - }, - { - "description": "Jurisdiction Metadata for Kef_123(2020) id 2c65ba7b-bf25-4b4c-9b71-30e9a98f3f4c", - "key": "2c65ba7b-bf25-4b4c-9b71-30e9a98f3f4c", - "label": "Kef_123(2020) metadata", - "value": "26187" - }, - { - "description": "Jurisdiction Metadata for Kef_194(2020) id d15c6bd4-ce1f-4274-93a2-03857fff79fa", - "key": "d15c6bd4-ce1f-4274-93a2-03857fff79fa", - "label": "Kef_194(2020) metadata", - "value": "26188" - }, - { - "description": "Jurisdiction Metadata for Kef_207(2020) id fbebbdcb-993c-49a0-b66a-17d9e75e62a1", - "key": "fbebbdcb-993c-49a0-b66a-17d9e75e62a1", - "label": "Kef_207(2020) metadata", - "value": "26189" - }, - { - "description": "Jurisdiction Metadata for Kef_17(2020) id 2f1e01c0-9e47-43ea-87a5-6920f0e775b4", - "key": "2f1e01c0-9e47-43ea-87a5-6920f0e775b4", - "label": "Kef_17(2020) metadata", - "value": "26190" - }, - { - "description": "Jurisdiction Metadata for Kef_76(2020) id 14c310e8-1621-43aa-afd3-3a8596bc4e52", - "key": "14c310e8-1621-43aa-afd3-3a8596bc4e52", - "label": "Kef_76(2020) metadata", - "value": "26191" - }, - { - "description": "Jurisdiction Metadata for Kef_95(2020) id 6d7758c8-9989-4915-b5e9-3c24938c7b27", - "key": "6d7758c8-9989-4915-b5e9-3c24938c7b27", - "label": "Kef_95(2020) metadata", - "value": "26192" - }, - { - "description": "Jurisdiction Metadata for Kef_96(2020) id d5392f65-9220-4394-9ab2-2fb7c91892d7", - "key": "d5392f65-9220-4394-9ab2-2fb7c91892d7", - "label": "Kef_96(2020) metadata", - "value": "26193" - }, - { - "description": "Jurisdiction Metadata for Kef_225(2020) id 053fda0a-5b30-47dc-ab99-b32ed9cd2ce9", - "key": "053fda0a-5b30-47dc-ab99-b32ed9cd2ce9", - "label": "Kef_225(2020) metadata", - "value": "26194" - }, - { - "description": "Jurisdiction Metadata for Kef_100(2020) id dd8f58ed-f8fc-4fa8-a560-6d826ba91091", - "key": "dd8f58ed-f8fc-4fa8-a560-6d826ba91091", - "label": "Kef_100(2020) metadata", - "value": "26195" - }, - { - "description": "Jurisdiction Metadata for Kef_79(2020) id 84f2ecc9-6090-49fd-a298-308023a239c8", - "key": "84f2ecc9-6090-49fd-a298-308023a239c8", - "label": "Kef_79(2020) metadata", - "value": "26196" - }, - { - "description": "Jurisdiction Metadata for Kef_33(2020) id bb7c659a-4fb3-4d3d-8ad6-290ed39c9af9", - "key": "bb7c659a-4fb3-4d3d-8ad6-290ed39c9af9", - "label": "Kef_33(2020) metadata", - "value": "26197" - }, - { - "description": "Jurisdiction Metadata for Kef_97(2020) id a270f12d-1e90-47cc-924a-012e0b9a2979", - "key": "a270f12d-1e90-47cc-924a-012e0b9a2979", - "label": "Kef_97(2020) metadata", - "value": "26198" - }, - { - "description": "Jurisdiction Metadata for Kef_107(2020) id 8737e894-a019-4eae-ab82-becdbda1b80a", - "key": "8737e894-a019-4eae-ab82-becdbda1b80a", - "label": "Kef_107(2020) metadata", - "value": "26199" - }, - { - "description": "Jurisdiction Metadata for Kef_77(2020) id d9ce1949-3fce-46f6-9909-01be7cdbd9cc", - "key": "d9ce1949-3fce-46f6-9909-01be7cdbd9cc", - "label": "Kef_77(2020) metadata", - "value": "26200" - }, - { - "description": "Jurisdiction Metadata for Kef_215(2020) id e83214fe-2f57-4fdc-978b-14c93bd3c23b", - "key": "e83214fe-2f57-4fdc-978b-14c93bd3c23b", - "label": "Kef_215(2020) metadata", - "value": "26201" - }, - { - "description": "Jurisdiction Metadata for Kef_125(2020) id f97a7a69-f01f-4187-9c0e-dcae6255d5b0", - "key": "f97a7a69-f01f-4187-9c0e-dcae6255d5b0", - "label": "Kef_125(2020) metadata", - "value": "26202" - }, - { - "description": "Jurisdiction Metadata for Kef_223(2020) id cb61548d-91bc-48cd-93ee-c3c8ae108b6e", - "key": "cb61548d-91bc-48cd-93ee-c3c8ae108b6e", - "label": "Kef_223(2020) metadata", - "value": "26203" - }, - { - "description": "Jurisdiction Metadata for Kef_164(2020) id 06ac2321-6d5d-4868-9bdc-bc9597a70708", - "key": "06ac2321-6d5d-4868-9bdc-bc9597a70708", - "label": "Kef_164(2020) metadata", - "value": "26204" - }, - { - "description": "Jurisdiction Metadata for Kef_86(2020) id dcf84629-79d3-46da-93c4-c5a0312139d8", - "key": "dcf84629-79d3-46da-93c4-c5a0312139d8", - "label": "Kef_86(2020) metadata", - "value": "26205" - }, - { - "description": "Jurisdiction Metadata for Kef_174(2020) id 46a1ab96-127a-482b-8bdf-ff56f753fac8", - "key": "46a1ab96-127a-482b-8bdf-ff56f753fac8", - "label": "Kef_174(2020) metadata", - "value": "26206" - }, - { - "description": "Jurisdiction Metadata for Kef_131(2020) id 37850010-659e-4f42-b7ed-7296da993345", - "key": "37850010-659e-4f42-b7ed-7296da993345", - "label": "Kef_131(2020) metadata", - "value": "26207" - }, - { - "description": "Jurisdiction Metadata for Kef_92(2020) id feb9d087-cb04-4cfd-b342-ff80ae582750", - "key": "feb9d087-cb04-4cfd-b342-ff80ae582750", - "label": "Kef_92(2020) metadata", - "value": "26208" - }, - { - "description": "Jurisdiction Metadata for Kef_200(2020) id fc2b113e-4063-4a47-a432-07ad764884a9", - "key": "fc2b113e-4063-4a47-a432-07ad764884a9", - "label": "Kef_200(2020) metadata", - "value": "26209" - }, - { - "description": "Jurisdiction Metadata for Kef_44(2020) id 6a104a59-0616-45c4-a05e-e831bcc50154", - "key": "6a104a59-0616-45c4-a05e-e831bcc50154", - "label": "Kef_44(2020) metadata", - "value": "26210" - }, - { - "description": "Jurisdiction Metadata for Kef_195(2020) id ae517b35-a77b-481a-b9c6-d7a24cddef8f", - "key": "ae517b35-a77b-481a-b9c6-d7a24cddef8f", - "label": "Kef_195(2020) metadata", - "value": "26211" - }, - { - "description": "Jurisdiction Metadata for Kef_198(2020) id 649f41eb-c880-475f-b5eb-c9cae7323d13", - "key": "649f41eb-c880-475f-b5eb-c9cae7323d13", - "label": "Kef_198(2020) metadata", - "value": "26212" - }, - { - "description": "Jurisdiction Metadata for Kef_152(2020) id 65713600-887c-4af0-88d2-7edb8be0fc1c", - "key": "65713600-887c-4af0-88d2-7edb8be0fc1c", - "label": "Kef_152(2020) metadata", - "value": "26213" - }, - { - "description": "Jurisdiction Metadata for Kef_219(2020) id 8fe19761-2640-4a07-aacb-972aee7412b5", - "key": "8fe19761-2640-4a07-aacb-972aee7412b5", - "label": "Kef_219(2020) metadata", - "value": "26214" - }, - { - "description": "Jurisdiction Metadata for Kef_140(2020) id 6204c657-7881-421a-bee0-2b671506469b", - "key": "6204c657-7881-421a-bee0-2b671506469b", - "label": "Kef_140(2020) metadata", - "value": "26215" - }, - { - "description": "Jurisdiction Metadata for Kef_115(2020) id ba5498eb-c4d5-417b-8c66-6d53c8c4531b", - "key": "ba5498eb-c4d5-417b-8c66-6d53c8c4531b", - "label": "Kef_115(2020) metadata", - "value": "26216" - }, - { - "description": "Jurisdiction Metadata for Kef_59(2020) id 1bfe2ad0-7497-4bf8-9bb0-18d91b2a29f8", - "key": "1bfe2ad0-7497-4bf8-9bb0-18d91b2a29f8", - "label": "Kef_59(2020) metadata", - "value": "26217" - }, - { - "description": "Jurisdiction Metadata for Kef_43(2020) id b090ce19-a93f-4913-8e19-d992645309b3", - "key": "b090ce19-a93f-4913-8e19-d992645309b3", - "label": "Kef_43(2020) metadata", - "value": "26218" - }, - { - "description": "Jurisdiction Metadata for Kef_57(2020) id 8071118d-29bc-4c61-a80e-2531d091d637", - "key": "8071118d-29bc-4c61-a80e-2531d091d637", - "label": "Kef_57(2020) metadata", - "value": "26219" - }, - { - "description": "Jurisdiction Metadata for Kef_65(2020) id 04a3ae0b-145c-4ca8-8e71-cfeff964136e", - "key": "04a3ae0b-145c-4ca8-8e71-cfeff964136e", - "label": "Kef_65(2020) metadata", - "value": "26220" - }, - { - "description": "Jurisdiction Metadata for Kef_143(2020) id 86f8cc3a-56b1-4489-8506-84063dc8e45c", - "key": "86f8cc3a-56b1-4489-8506-84063dc8e45c", - "label": "Kef_143(2020) metadata", - "value": "26221" - }, - { - "description": "Jurisdiction Metadata for Kef_229(2020) id d3449e10-20d9-4ca5-80b0-32134e9d7fb1", - "key": "d3449e10-20d9-4ca5-80b0-32134e9d7fb1", - "label": "Kef_229(2020) metadata", - "value": "26222" - }, - { - "description": "Jurisdiction Metadata for Kef_158(2020) id d3063218-139c-43af-a440-cbc0b3e0284d", - "key": "d3063218-139c-43af-a440-cbc0b3e0284d", - "label": "Kef_158(2020) metadata", - "value": "26223" - }, - { - "description": "Jurisdiction Metadata for Kef_40(2020) id a6b83cf7-1d9a-4e72-9241-dc33a57f0fb4", - "key": "a6b83cf7-1d9a-4e72-9241-dc33a57f0fb4", - "label": "Kef_40(2020) metadata", - "value": "26224" - }, - { - "description": "Jurisdiction Metadata for Kef_217(2020) id 847f4d98-2fdf-4fa3-8ad9-d789d5d68b9c", - "key": "847f4d98-2fdf-4fa3-8ad9-d789d5d68b9c", - "label": "Kef_217(2020) metadata", - "value": "26225" - }, - { - "description": "Jurisdiction Metadata for Kef_176(2020) id 5efa6b19-3131-46b2-8c67-8ee9e86eb703", - "key": "5efa6b19-3131-46b2-8c67-8ee9e86eb703", - "label": "Kef_176(2020) metadata", - "value": "26226" - }, - { - "description": "Jurisdiction Metadata for Kef_169(2020) id 8db34c1b-596d-448e-8511-bfa4ac6bb283", - "key": "8db34c1b-596d-448e-8511-bfa4ac6bb283", - "label": "Kef_169(2020) metadata", - "value": "26227" - }, - { - "description": "Jurisdiction Metadata for Kef_161(2020) id dc736063-607a-4a97-94d1-40426e959024", - "key": "dc736063-607a-4a97-94d1-40426e959024", - "label": "Kef_161(2020) metadata", - "value": "26228" - }, - { - "description": "Jurisdiction Metadata for Kef_192(2020) id 26d36a7d-1cc8-4767-b11d-2ef346daaec9", - "key": "26d36a7d-1cc8-4767-b11d-2ef346daaec9", - "label": "Kef_192(2020) metadata", - "value": "26229" - }, - { - "description": "Jurisdiction Metadata for Kef_213(2020) id 91241062-4867-4011-88c2-b5626397c99a", - "key": "91241062-4867-4011-88c2-b5626397c99a", - "label": "Kef_213(2020) metadata", - "value": "26230" - }, - { - "description": "Jurisdiction Metadata for Kef_114(2020) id ccf617c7-d8ea-4d4c-9483-6eb7aedef8fd", - "key": "ccf617c7-d8ea-4d4c-9483-6eb7aedef8fd", - "label": "Kef_114(2020) metadata", - "value": "26231" - }, - { - "description": "Jurisdiction Metadata for Kef_90(2020) id 89eba760-121f-4fa9-9c6a-2421fc42bc89", - "key": "89eba760-121f-4fa9-9c6a-2421fc42bc89", - "label": "Kef_90(2020) metadata", - "value": "26232" - }, - { - "description": "Jurisdiction Metadata for Kef_171(2020) id a6e539ab-903c-4632-b107-5742690527d3", - "key": "a6e539ab-903c-4632-b107-5742690527d3", - "label": "Kef_171(2020) metadata", - "value": "26233" - }, - { - "description": "Jurisdiction Metadata for Kef_101(2020) id 40f3213a-54c7-4b3e-a56f-cbaf47e75f10", - "key": "40f3213a-54c7-4b3e-a56f-cbaf47e75f10", - "label": "Kef_101(2020) metadata", - "value": "26234" - }, - { - "description": "Jurisdiction Metadata for Kef_193(2020) id 567a8fa4-85ec-451c-8696-c73fa9fdaf84", - "key": "567a8fa4-85ec-451c-8696-c73fa9fdaf84", - "label": "Kef_193(2020) metadata", - "value": "26235" - }, - { - "description": "Jurisdiction Metadata for Kef_124(2020) id 34dd11fd-2d1f-4866-9c82-5f28c4aa5b18", - "key": "34dd11fd-2d1f-4866-9c82-5f28c4aa5b18", - "label": "Kef_124(2020) metadata", - "value": "26236" - }, - { - "description": "Jurisdiction Metadata for Kef_222(2020) id ad22c152-d744-4521-a047-58833f28aa45", - "key": "ad22c152-d744-4521-a047-58833f28aa45", - "label": "Kef_222(2020) metadata", - "value": "26237" - }, - { - "description": "Jurisdiction Metadata for Kef_112(2020) id 33791ff7-b572-4ea7-b0c3-0da802b293b2", - "key": "33791ff7-b572-4ea7-b0c3-0da802b293b2", - "label": "Kef_112(2020) metadata", - "value": "26238" - }, - { - "description": "Jurisdiction Metadata for Kef_121(2020) id 830da69c-d99b-460e-bfd5-cd6ba0335f10", - "key": "830da69c-d99b-460e-bfd5-cd6ba0335f10", - "label": "Kef_121(2020) metadata", - "value": "26239" - }, - { - "description": "Jurisdiction Metadata for Kef_50(2020) id 4995cb94-d1b4-4fe9-aa22-a0a0b7f22663", - "key": "4995cb94-d1b4-4fe9-aa22-a0a0b7f22663", - "label": "Kef_50(2020) metadata", - "value": "26240" - }, - { - "description": "Jurisdiction Metadata for Kef_144(2020) id cb9a6c66-e256-4c2e-a376-975a84d907c4", - "key": "cb9a6c66-e256-4c2e-a376-975a84d907c4", - "label": "Kef_144(2020) metadata", - "value": "26241" - }, - { - "description": "Jurisdiction Metadata for Kef_167(2020) id 0296e82e-ea28-4353-8160-898b8e3ed9c5", - "key": "0296e82e-ea28-4353-8160-898b8e3ed9c5", - "label": "Kef_167(2020) metadata", - "value": "26242" - }, - { - "description": "Jurisdiction Metadata for Kef_88(2020) id 409e9b0f-dc2c-49e5-bb67-dedfb2387b31", - "key": "409e9b0f-dc2c-49e5-bb67-dedfb2387b31", - "label": "Kef_88(2020) metadata", - "value": "26243" - }, - { - "description": "Jurisdiction Metadata for Kef_98(2020) id d197fc7d-1b3e-44c3-a571-8cf0989b9f8f", - "key": "d197fc7d-1b3e-44c3-a571-8cf0989b9f8f", - "label": "Kef_98(2020) metadata", - "value": "26244" - }, - { - "description": "Jurisdiction Metadata for Kef_52(2020) id 9d2b0a18-51c6-483c-b11a-fb7bcebb6cc1", - "key": "9d2b0a18-51c6-483c-b11a-fb7bcebb6cc1", - "label": "Kef_52(2020) metadata", - "value": "26245" - }, - { - "description": "Jurisdiction Metadata for Kef_230(2020) id 11198eb2-81bc-401f-827d-4c79e5f431e0", - "key": "11198eb2-81bc-401f-827d-4c79e5f431e0", - "label": "Kef_230(2020) metadata", - "value": "26246" - }, - { - "description": "Jurisdiction Metadata for Kef_136(2020) id 3d18eb42-0e62-430f-aaf4-dd0f99524133", - "key": "3d18eb42-0e62-430f-aaf4-dd0f99524133", - "label": "Kef_136(2020) metadata", - "value": "26247" - }, - { - "description": "Jurisdiction Metadata for Kef_46(2020) id 1dbb9f48-84aa-48b0-a232-d059bda48703", - "key": "1dbb9f48-84aa-48b0-a232-d059bda48703", - "label": "Kef_46(2020) metadata", - "value": "26248" - }, - { - "description": "Jurisdiction Metadata for Kef_201(2020) id 358dc154-a585-43e1-a333-65b0292a0414", - "key": "358dc154-a585-43e1-a333-65b0292a0414", - "label": "Kef_201(2020) metadata", - "value": "26249" - }, - { - "description": "Jurisdiction Metadata for Kef_160(2020) id 809be683-902d-40a0-b987-51582a00bc5c", - "key": "809be683-902d-40a0-b987-51582a00bc5c", - "label": "Kef_160(2020) metadata", - "value": "26250" - }, - { - "description": "Jurisdiction Metadata for Kef_157(2020) id 744b5ed9-7ae1-4f36-97e2-04f8a563f937", - "key": "744b5ed9-7ae1-4f36-97e2-04f8a563f937", - "label": "Kef_157(2020) metadata", - "value": "26251" - }, - { - "description": "Jurisdiction Metadata for Kef_214(2020) id 871a4470-b298-467c-9415-12056963ec80", - "key": "871a4470-b298-467c-9415-12056963ec80", - "label": "Kef_214(2020) metadata", - "value": "26252" - }, - { - "description": "Jurisdiction Metadata for Kef_191(2020) id 8ae41bf2-f1bb-4387-89c5-07de683d6425", - "key": "8ae41bf2-f1bb-4387-89c5-07de683d6425", - "label": "Kef_191(2020) metadata", - "value": "26253" - }, - { - "description": "Jurisdiction Metadata for Kef_134(2020) id 79d98bc9-c8fc-476b-8189-e42aef1b53c0", - "key": "79d98bc9-c8fc-476b-8189-e42aef1b53c0", - "label": "Kef_134(2020) metadata", - "value": "26254" - }, - { - "description": "Jurisdiction Metadata for Kef_205(2020) id 41136272-883f-49df-adcf-c5310157797e", - "key": "41136272-883f-49df-adcf-c5310157797e", - "label": "Kef_205(2020) metadata", - "value": "26255" - }, - { - "description": "Jurisdiction Metadata for Kef_220(2020) id 1156891c-f332-4423-aa3b-39c1f23924bb", - "key": "1156891c-f332-4423-aa3b-39c1f23924bb", - "label": "Kef_220(2020) metadata", - "value": "26256" - }, - { - "description": "Jurisdiction Metadata for Kef_37(2020) id f9a91931-e22d-4aea-ab6e-fe72404f658c", - "key": "f9a91931-e22d-4aea-ab6e-fe72404f658c", - "label": "Kef_37(2020) metadata", - "value": "26257" - }, - { - "description": "Jurisdiction Metadata for Kef_69(2020) id 89576bd3-7e05-46a3-bab5-3e8f292d45de", - "key": "89576bd3-7e05-46a3-bab5-3e8f292d45de", - "label": "Kef_69(2020) metadata", - "value": "26258" - }, - { - "description": "Jurisdiction Metadata for Kef_135(2020) id 44c559ef-8777-4a44-8aa4-d25713b61802", - "key": "44c559ef-8777-4a44-8aa4-d25713b61802", - "label": "Kef_135(2020) metadata", - "value": "26259" - }, - { - "description": "Jurisdiction Metadata for Kef_162(2020) id c896170e-e508-44db-8463-ececcff1e88f", - "key": "c896170e-e508-44db-8463-ececcff1e88f", - "label": "Kef_162(2020) metadata", - "value": "26260" - }, - { - "description": "Jurisdiction Metadata for Kef_108(2020) id 022eacb3-fd46-473a-a881-a2c54c6b2aed", - "key": "022eacb3-fd46-473a-a881-a2c54c6b2aed", - "label": "Kef_108(2020) metadata", - "value": "26261" - }, - { - "description": "Jurisdiction Metadata for Kef_81(2020) id c6329de8-e5fb-479c-832e-ca666c657694", - "key": "c6329de8-e5fb-479c-832e-ca666c657694", - "label": "Kef_81(2020) metadata", - "value": "26262" - }, - { - "description": "Jurisdiction Metadata for Kef_35(2020) id 534a0e85-60bc-4145-910e-23e6be5c0421", - "key": "534a0e85-60bc-4145-910e-23e6be5c0421", - "label": "Kef_35(2020) metadata", - "value": "26263" - }, - { - "description": "Jurisdiction Metadata for Kef_210(2020) id 16f86265-5fd5-437c-981c-dd1c5bd0a1ba", - "key": "16f86265-5fd5-437c-981c-dd1c5bd0a1ba", - "label": "Kef_210(2020) metadata", - "value": "26264" - }, - { - "description": "Jurisdiction Metadata for Kef_227(2020) id 8461f2b6-fa7c-4c64-b433-e98ba87cde57", - "key": "8461f2b6-fa7c-4c64-b433-e98ba87cde57", - "label": "Kef_227(2020) metadata", - "value": "26265" - }, - { - "description": "Jurisdiction Metadata for Kef_74(2020) id c5d47e85-4695-414d-85e6-650a29987434", - "key": "c5d47e85-4695-414d-85e6-650a29987434", - "label": "Kef_74(2020) metadata", - "value": "26266" - }, - { - "description": "Jurisdiction Metadata for Kef_196(2020) id 2264726a-a4b6-4a2f-8bca-f37d9c2c7f84", - "key": "2264726a-a4b6-4a2f-8bca-f37d9c2c7f84", - "label": "Kef_196(2020) metadata", - "value": "26267" - }, - { - "description": "Jurisdiction Metadata for Kef_15(2020) id 219daf09-cd6b-4b9b-a46c-072c4a2b3ca6", - "key": "219daf09-cd6b-4b9b-a46c-072c4a2b3ca6", - "label": "Kef_15(2020) metadata", - "value": "26268" - }, - { - "description": "Jurisdiction Metadata for Kef_209(2020) id 67693905-85da-4898-b8f0-9a3d9323d388", - "key": "67693905-85da-4898-b8f0-9a3d9323d388", - "label": "Kef_209(2020) metadata", - "value": "26269" - }, - { - "description": "Jurisdiction Metadata for Kef_80(2020) id 776782d8-52b4-416b-911f-8325bffd993f", - "key": "776782d8-52b4-416b-911f-8325bffd993f", - "label": "Kef_80(2020) metadata", - "value": "26270" - }, - { - "description": "Jurisdiction Metadata for Kef_75(2020) id bb3d7eb5-034a-46ae-a1de-294bb3156e2d", - "key": "bb3d7eb5-034a-46ae-a1de-294bb3156e2d", - "label": "Kef_75(2020) metadata", - "value": "26271" - }, - { - "description": "Jurisdiction Metadata for Kef_199(2020) id c6f646bb-e090-49f2-b9e4-55301d43ba95", - "key": "c6f646bb-e090-49f2-b9e4-55301d43ba95", - "label": "Kef_199(2020) metadata", - "value": "26272" - }, - { - "description": "Jurisdiction Metadata for Kef_175(2020) id 2346fcbf-1924-448d-918d-1b8aed2a4e4c", - "key": "2346fcbf-1924-448d-918d-1b8aed2a4e4c", - "label": "Kef_175(2020) metadata", - "value": "26273" - }, - { - "description": "Jurisdiction Metadata for Kef_73(2020) id f39e89a4-21a3-487b-b13a-efb0890323ab", - "key": "f39e89a4-21a3-487b-b13a-efb0890323ab", - "label": "Kef_73(2020) metadata", - "value": "26274" - }, - { - "description": "Jurisdiction Metadata for Kef_216(2020) id af710279-8ff3-4e13-bd04-76fff0136308", - "key": "af710279-8ff3-4e13-bd04-76fff0136308", - "label": "Kef_216(2020) metadata", - "value": "26275" - }, - { - "description": "Jurisdiction Metadata for Kef_178(2020) id 57d073b8-700b-47dc-a322-f3b0012aa83f", - "key": "57d073b8-700b-47dc-a322-f3b0012aa83f", - "label": "Kef_178(2020) metadata", - "value": "26276" - }, - { - "description": "Jurisdiction Metadata for Kef_110(2020) id 905536fe-6605-4de9-841a-db5774b36629", - "key": "905536fe-6605-4de9-841a-db5774b36629", - "label": "Kef_110(2020) metadata", - "value": "26277" - }, - { - "description": "Jurisdiction Metadata for Kef_94(2020) id e7a45b29-623d-46fc-bda4-c8c7a6538cc3", - "key": "e7a45b29-623d-46fc-bda4-c8c7a6538cc3", - "label": "Kef_94(2020) metadata", - "value": "26278" - }, - { - "description": "Jurisdiction Metadata for Kef_113(2020) id 89cd2d4a-8f5e-488d-8752-e57a9a4ec548", - "key": "89cd2d4a-8f5e-488d-8752-e57a9a4ec548", - "label": "Kef_113(2020) metadata", - "value": "26279" - }, - { - "description": "Jurisdiction Metadata for Kef_202(2020) id c345b830-ff0e-4d5a-8c90-bc625a30eb87", - "key": "c345b830-ff0e-4d5a-8c90-bc625a30eb87", - "label": "Kef_202(2020) metadata", - "value": "26280" - }, - { - "description": "Jurisdiction Metadata for Kef_204(2020) id 89f49e6a-8c4b-4acc-bf80-2c849abc888b", - "key": "89f49e6a-8c4b-4acc-bf80-2c849abc888b", - "label": "Kef_204(2020) metadata", - "value": "26281" - }, - { - "description": "Jurisdiction Metadata for Kanama id 4bd7ea22-2aa1-425d-af54-8a40ede0472d", - "key": "4bd7ea22-2aa1-425d-af54-8a40ede0472d", - "label": "Kanama metadata", - "value": "26282" - }, - { - "description": "Jurisdiction Metadata for Kef_5(2020) id 20ad9da2-e63d-4ed8-bc52-c50fc3e5a775", - "key": "20ad9da2-e63d-4ed8-bc52-c50fc3e5a775", - "label": "Kef_5(2020) metadata", - "value": "26283" - }, - { - "description": "Jurisdiction Metadata for Kapema id e3182417-adca-4a69-9a19-261fbbf9e172", - "key": "e3182417-adca-4a69-9a19-261fbbf9e172", - "label": "Kapema metadata", - "value": "26284" - }, - { - "description": "Jurisdiction Metadata for Kef_103(2020) id ce12a9fe-764d-457e-a45c-297ca14e896b", - "key": "ce12a9fe-764d-457e-a45c-297ca14e896b", - "label": "Kef_103(2020) metadata", - "value": "26285" - }, - { - "description": "Jurisdiction Metadata for Munkombwe id 9614c1ac-8947-48d2-bc18-43eae954cd73", - "key": "9614c1ac-8947-48d2-bc18-43eae954cd73", - "label": "Munkombwe metadata", - "value": "26286" - }, - { - "description": "Jurisdiction Metadata for Kef_14(2020) id 15162fb8-a49d-4e84-b688-28dd26624a2c", - "key": "15162fb8-a49d-4e84-b688-28dd26624a2c", - "label": "Kef_14(2020) metadata", - "value": "26287" - }, - { - "description": "Jurisdiction Metadata for Kef_117(2020) id 8deab913-9869-4f60-8067-3cc51365b08d", - "key": "8deab913-9869-4f60-8067-3cc51365b08d", - "label": "Kef_117(2020) metadata", - "value": "26288" - }, - { - "description": "Jurisdiction Metadata for Kef_141(2020) id 5960082a-f07d-4a51-84d6-c869ab74149b", - "key": "5960082a-f07d-4a51-84d6-c869ab74149b", - "label": "Kef_141(2020) metadata", - "value": "26289" - }, - { - "description": "Jurisdiction Metadata for Kef_184(2020) id b3f00c56-5d20-44be-81fe-b2942f26b10a", - "key": "b3f00c56-5d20-44be-81fe-b2942f26b10a", - "label": "Kef_184(2020) metadata", - "value": "26290" - }, - { - "description": "Jurisdiction Metadata for Kef_99(2020) id a5f7c810-cd7d-41b4-9b67-5fefedd788ee", - "key": "a5f7c810-cd7d-41b4-9b67-5fefedd788ee", - "label": "Kef_99(2020) metadata", - "value": "26291" - }, - { - "description": "Jurisdiction Metadata for Kef_116(2020) id c2c6e1fd-8256-44ba-b626-157d1fea3076", - "key": "c2c6e1fd-8256-44ba-b626-157d1fea3076", - "label": "Kef_116(2020) metadata", - "value": "26292" - }, - { - "description": "Jurisdiction Metadata for Kef_53(2020) id d8447317-af53-44a8-9e17-f6cf21bed67c", - "key": "d8447317-af53-44a8-9e17-f6cf21bed67c", - "label": "Kef_53(2020) metadata", - "value": "26293" - }, - { - "description": "Jurisdiction Metadata for Kef_29(2020) id 8e068b6d-fca4-42b5-aa50-46fb14b1aa5e", - "key": "8e068b6d-fca4-42b5-aa50-46fb14b1aa5e", - "label": "Kef_29(2020) metadata", - "value": "26294" - }, - { - "description": "Jurisdiction Metadata for Kef_183(2020) id fd904700-0457-48e3-9973-d028817bbcf4", - "key": "fd904700-0457-48e3-9973-d028817bbcf4", - "label": "Kef_183(2020) metadata", - "value": "26295" - }, - { - "description": "Jurisdiction Metadata for Kef_180(2020) id ce75a870-f6d1-41a6-8ce4-02692edf6095", - "key": "ce75a870-f6d1-41a6-8ce4-02692edf6095", - "label": "Kef_180(2020) metadata", - "value": "26296" - }, - { - "description": "Jurisdiction Metadata for Kef_137(2020) id e840b929-0beb-48b8-acc4-d823f65bfc71", - "key": "e840b929-0beb-48b8-acc4-d823f65bfc71", - "label": "Kef_137(2020) metadata", - "value": "26297" - }, - { - "description": "Jurisdiction Metadata for Kef_182(2020) id 685f2c10-d4a1-4df8-934f-4ef7cfe8cba8", - "key": "685f2c10-d4a1-4df8-934f-4ef7cfe8cba8", - "label": "Kef_182(2020) metadata", - "value": "26298" - }, - { - "description": "Jurisdiction Metadata for Kef_179(2020) id 2d90b121-24e0-4781-b715-ec2c2d01caa1", - "key": "2d90b121-24e0-4781-b715-ec2c2d01caa1", - "label": "Kef_179(2020) metadata", - "value": "26299" - }, - { - "description": "Jurisdiction Metadata for Kef_181(2020) id 51adaafd-dba7-4192-b43b-b6389e01be4e", - "key": "51adaafd-dba7-4192-b43b-b6389e01be4e", - "label": "Kef_181(2020) metadata", - "value": "26300" - }, - { - "description": "Jurisdiction Metadata for Kef_10(2020) id e1d38497-8c91-41fb-84e4-7047bf2ef5d0", - "key": "e1d38497-8c91-41fb-84e4-7047bf2ef5d0", - "label": "Kef_10(2020) metadata", - "value": "26301" - }, - { - "description": "Jurisdiction Metadata for Kef_61(2020) id 832b7ec0-9c4e-4c55-8e63-21dadcc7c129", - "key": "832b7ec0-9c4e-4c55-8e63-21dadcc7c129", - "label": "Kef_61(2020) metadata", - "value": "26302" - }, - { - "description": "Jurisdiction Metadata for Kef_28(2020) id 5400eecb-eca2-497a-8f5f-91f64ca129a0", - "key": "5400eecb-eca2-497a-8f5f-91f64ca129a0", - "label": "Kef_28(2020) metadata", - "value": "26303" - }, - { - "description": "Jurisdiction Metadata for Kef_72(2020) id 2487efe9-ffc5-4630-b614-1cd44eb6619e", - "key": "2487efe9-ffc5-4630-b614-1cd44eb6619e", - "label": "Kef_72(2020) metadata", - "value": "26304" - }, - { - "description": "Jurisdiction Metadata for Chilamba id 19789c34-9ace-4c95-9a38-1e8411dbc695", - "key": "19789c34-9ace-4c95-9a38-1e8411dbc695", - "label": "Chilamba metadata", - "value": "26305" - }, - { - "description": "Jurisdiction Metadata for Kef_228(2020) id 2dcef13f-ee24-4e1d-86ac-a83de6939dfe", - "key": "2dcef13f-ee24-4e1d-86ac-a83de6939dfe", - "label": "Kef_228(2020) metadata", - "value": "26306" - }, - { - "description": "Jurisdiction Metadata for Kef_45(2020) id 9c976640-1a96-4d5c-b8a5-3f968f5a98df", - "key": "9c976640-1a96-4d5c-b8a5-3f968f5a98df", - "label": "Kef_45(2020) metadata", - "value": "26307" - }, - { - "description": "Jurisdiction Metadata for Kef_22(2020) id 625be27e-c86e-4663-855d-216a88142022", - "key": "625be27e-c86e-4663-855d-216a88142022", - "label": "Kef_22(2020) metadata", - "value": "26308" - }, - { - "description": "Jurisdiction Metadata for Kef_13(2020) id 81d111b9-986f-45d8-8a3c-837a5baa166f", - "key": "81d111b9-986f-45d8-8a3c-837a5baa166f", - "label": "Kef_13(2020) metadata", - "value": "26309" - }, - { - "description": "Jurisdiction Metadata for Kilwa(2020) id be783669-c474-4c15-9ff2-c14c4c1c5668", - "key": "be783669-c474-4c15-9ff2-c14c4c1c5668", - "label": "Kilwa(2020) metadata", - "value": "26310" - }, - { - "description": "Jurisdiction Metadata for Nshimba Zone id d05b9d43-b439-429a-bb20-d0e37588ccd9", - "key": "d05b9d43-b439-429a-bb20-d0e37588ccd9", - "label": "Nshimba Zone metadata", - "value": "26311" - }, - { - "description": "Jurisdiction Metadata for kwa_1(2020) id a32e14d3-725d-40a9-b2cc-b62b51146592", - "key": "a32e14d3-725d-40a9-b2cc-b62b51146592", - "label": "kwa_1(2020) metadata", - "value": "26312" - }, - { - "description": "Jurisdiction Metadata for kwa_13(2020) id 4a779a6b-8851-4d55-9104-8bc112e689ef", - "key": "4a779a6b-8851-4d55-9104-8bc112e689ef", - "label": "kwa_13(2020) metadata", - "value": "26313" - }, - { - "description": "Jurisdiction Metadata for Chipuma Zone id e5df7898-78ad-4e4e-9786-43beca43b9db", - "key": "e5df7898-78ad-4e4e-9786-43beca43b9db", - "label": "Chipuma Zone metadata", - "value": "26314" - }, - { - "description": "Jurisdiction Metadata for kwa_8(2020) id 260484ee-965e-480b-ba3d-4e54c7ca6131", - "key": "260484ee-965e-480b-ba3d-4e54c7ca6131", - "label": "kwa_8(2020) metadata", - "value": "26315" - }, - { - "description": "Jurisdiction Metadata for Lukwesa Zone id 7a98f2b0-c2b8-48ea-8bc9-c25b692618f7", - "key": "7a98f2b0-c2b8-48ea-8bc9-c25b692618f7", - "label": "Lukwesa Zone metadata", - "value": "26316" - }, - { - "description": "Jurisdiction Metadata for kwa_3(2020) id 5d6ca2c3-3bd3-4d6c-9c04-25103bed64ae", - "key": "5d6ca2c3-3bd3-4d6c-9c04-25103bed64ae", - "label": "kwa_3(2020) metadata", - "value": "26317" - }, - { - "description": "Jurisdiction Metadata for Kapopolo Zone id 9f212ff5-26fd-4dc4-a39a-f1beb0cc319e", - "key": "9f212ff5-26fd-4dc4-a39a-f1beb0cc319e", - "label": "Kapopolo Zone metadata", - "value": "26318" - }, - { - "description": "Jurisdiction Metadata for kwa_9(2020) id 35b6763e-cce8-4a93-831f-f02a4dd3f9f9", - "key": "35b6763e-cce8-4a93-831f-f02a4dd3f9f9", - "label": "kwa_9(2020) metadata", - "value": "26319" - }, - { - "description": "Jurisdiction Metadata for Kasompe Zone id c87c2098-80c2-4da6-b807-dec546a725f1", - "key": "c87c2098-80c2-4da6-b807-dec546a725f1", - "label": "Kasompe Zone metadata", - "value": "26320" - }, - { - "description": "Jurisdiction Metadata for kwa_15(2020) id 78e7f56e-1b33-446c-afb8-48274d743208", - "key": "78e7f56e-1b33-446c-afb8-48274d743208", - "label": "kwa_15(2020) metadata", - "value": "26321" - }, - { - "description": "Jurisdiction Metadata for kwa_7(2020) id cc6ee92e-35e3-4b7a-b754-18853e01a3f5", - "key": "cc6ee92e-35e3-4b7a-b754-18853e01a3f5", - "label": "kwa_7(2020) metadata", - "value": "26322" - }, - { - "description": "Jurisdiction Metadata for Chisukulu Zone id b9e858e6-dbb0-4140-9afa-891faf2a8d1b", - "key": "b9e858e6-dbb0-4140-9afa-891faf2a8d1b", - "label": "Chisukulu Zone metadata", - "value": "26323" - }, - { - "description": "Jurisdiction Metadata for kwa_11(2020) id 272633ba-8380-4cb6-a9b9-5eef89bbf3b5", - "key": "272633ba-8380-4cb6-a9b9-5eef89bbf3b5", - "label": "kwa_11(2020) metadata", - "value": "26324" - }, - { - "description": "Jurisdiction Metadata for kwa_10(2020) id d7ca5c26-630f-4f85-a995-ddd1424fe66d", - "key": "d7ca5c26-630f-4f85-a995-ddd1424fe66d", - "label": "kwa_10(2020) metadata", - "value": "26325" - }, - { - "description": "Jurisdiction Metadata for kwa_18(2020) id b809df6a-ce1b-432c-8396-16eb2a7c041f", - "key": "b809df6a-ce1b-432c-8396-16eb2a7c041f", - "label": "kwa_18(2020) metadata", - "value": "26326" - }, - { - "description": "Jurisdiction Metadata for Kabake Zone id e39cb2fc-ff5c-4aea-8fd8-3247db88b707", - "key": "e39cb2fc-ff5c-4aea-8fd8-3247db88b707", - "label": "Kabake Zone metadata", - "value": "26327" - }, - { - "description": "Jurisdiction Metadata for Fyombwe Zone id 82acfe92-1083-47fd-8888-64c2b9d51df7", - "key": "82acfe92-1083-47fd-8888-64c2b9d51df7", - "label": "Fyombwe Zone metadata", - "value": "26328" - }, - { - "description": "Jurisdiction Metadata for kwa_12(2020) id 69b885bb-ca56-4915-94b6-116be58f63a9", - "key": "69b885bb-ca56-4915-94b6-116be58f63a9", - "label": "kwa_12(2020) metadata", - "value": "26329" - }, - { - "description": "Jurisdiction Metadata for kwa_16(2020) id a17e289a-8967-4776-a14c-3c5f5c831a6b", - "key": "a17e289a-8967-4776-a14c-3c5f5c831a6b", - "label": "kwa_16(2020) metadata", - "value": "26330" - }, - { - "description": "Jurisdiction Metadata for Bwaya Zone id aee7d960-f769-4c47-b39e-b732f69e6cff", - "key": "aee7d960-f769-4c47-b39e-b732f69e6cff", - "label": "Bwaya Zone metadata", - "value": "26331" - }, - { - "description": "Jurisdiction Metadata for kwa_6(2020) id c078eb27-4d30-4047-88a1-a1883b965336", - "key": "c078eb27-4d30-4047-88a1-a1883b965336", - "label": "kwa_6(2020) metadata", - "value": "26332" - }, - { - "description": "Jurisdiction Metadata for Kabake Zone id 95cb74a6-8f55-4897-84bb-4562a8a41f44", - "key": "95cb74a6-8f55-4897-84bb-4562a8a41f44", - "label": "Kabake Zone metadata", - "value": "26333" - }, - { - "description": "Jurisdiction Metadata for kwa_4(2020) id fb17f4ce-83e3-4a45-9ea7-e3a63522b126", - "key": "fb17f4ce-83e3-4a45-9ea7-e3a63522b126", - "label": "kwa_4(2020) metadata", - "value": "26334" - }, - { - "description": "Jurisdiction Metadata for kwa_5(2020) id 99279b17-347b-40f2-874e-4f7ef7cc6efa", - "key": "99279b17-347b-40f2-874e-4f7ef7cc6efa", - "label": "kwa_5(2020) metadata", - "value": "26335" - }, - { - "description": "Jurisdiction Metadata for Chisamba Zone id 7e6b615c-8a67-4fcb-a4ca-32d3a237980d", - "key": "7e6b615c-8a67-4fcb-a4ca-32d3a237980d", - "label": "Chisamba Zone metadata", - "value": "26336" - }, - { - "description": "Jurisdiction Metadata for kwa_14(2020) id 7f775991-da86-4ac0-86bd-be7538392b12", - "key": "7f775991-da86-4ac0-86bd-be7538392b12", - "label": "kwa_14(2020) metadata", - "value": "26337" - }, - { - "description": "Jurisdiction Metadata for kwa_17(2020) id 66940473-eaa0-4792-a022-5a1699cf8044", - "key": "66940473-eaa0-4792-a022-5a1699cf8044", - "label": "kwa_17(2020) metadata", - "value": "26338" - }, - { - "description": "Jurisdiction Metadata for kwa_2(2020) id 1c3b382f-0f56-4a12-b035-c52d9dfc0674", - "key": "1c3b382f-0f56-4a12-b035-c52d9dfc0674", - "label": "kwa_2(2020) metadata", - "value": "26339" - }, - { - "description": "Jurisdiction Metadata for Nchelenge(2020) id 44359bdc-d74a-4a04-9e1c-1e52e6b9102d", - "key": "44359bdc-d74a-4a04-9e1c-1e52e6b9102d", - "label": "Nchelenge(2020) metadata", - "value": "26340" - }, - { - "description": "Jurisdiction Metadata for Boma Zone id f579a1f0-054b-42f2-aee3-956cd88e0fbe", - "key": "f579a1f0-054b-42f2-aee3-956cd88e0fbe", - "label": "Boma Zone metadata", - "value": "26341" - }, - { - "description": "Jurisdiction Metadata for nch_34(2020) id a1340657-4cc0-4edb-b282-12177b18cb29", - "key": "a1340657-4cc0-4edb-b282-12177b18cb29", - "label": "nch_34(2020) metadata", - "value": "26342" - }, - { - "description": "Jurisdiction Metadata for nch_9(2020) id 6876c2fe-c7ad-4dfc-b519-dbd28d63a5ae", - "key": "6876c2fe-c7ad-4dfc-b519-dbd28d63a5ae", - "label": "nch_9(2020) metadata", - "value": "26343" - }, - { - "description": "Jurisdiction Metadata for nch_4(2020) id 4e376312-860e-4961-bd69-2761483b9eed", - "key": "4e376312-860e-4961-bd69-2761483b9eed", - "label": "nch_4(2020) metadata", - "value": "26344" - }, - { - "description": "Jurisdiction Metadata for nch_75(2020) id 97d38a30-b6bd-47ae-bcd5-12e904a28cca", - "key": "97d38a30-b6bd-47ae-bcd5-12e904a28cca", - "label": "nch_75(2020) metadata", - "value": "26345" - }, - { - "description": "Jurisdiction Metadata for Mubamba Zone id 7782c472-d432-4463-829b-35bde5a22aa2", - "key": "7782c472-d432-4463-829b-35bde5a22aa2", - "label": "Mubamba Zone metadata", - "value": "26346" - }, - { - "description": "Jurisdiction Metadata for nch_1(2020) id 33a1577e-f0d4-415a-a2f7-e8a08cfb271f", - "key": "33a1577e-f0d4-415a-a2f7-e8a08cfb271f", - "label": "nch_1(2020) metadata", - "value": "26347" - }, - { - "description": "Jurisdiction Metadata for nch_3(2020) id f48bb965-0dbc-49c1-91e3-dcd6eeb21372", - "key": "f48bb965-0dbc-49c1-91e3-dcd6eeb21372", - "label": "nch_3(2020) metadata", - "value": "26348" - }, - { - "description": "Jurisdiction Metadata for Kamfembwa Zone id e566b569-c8e1-4cf8-ac42-f7c97e4717c2", - "key": "e566b569-c8e1-4cf8-ac42-f7c97e4717c2", - "label": "Kamfembwa Zone metadata", - "value": "26349" - }, - { - "description": "Jurisdiction Metadata for nch_77(2020) id bcbc077f-edda-4157-b747-0148b1f73ea0", - "key": "bcbc077f-edda-4157-b747-0148b1f73ea0", - "label": "nch_77(2020) metadata", - "value": "26350" - }, - { - "description": "Jurisdiction Metadata for nch_8(2020) id b49137d0-95f9-4c28-b968-8103632c61ef", - "key": "b49137d0-95f9-4c28-b968-8103632c61ef", - "label": "nch_8(2020) metadata", - "value": "26351" - }, - { - "description": "Jurisdiction Metadata for nch_2(2020) id 2ec0c8ce-7d0d-4312-bd20-f7da8b32725a", - "key": "2ec0c8ce-7d0d-4312-bd20-f7da8b32725a", - "label": "nch_2(2020) metadata", - "value": "26352" - }, - { - "description": "Jurisdiction Metadata for nch_5(2020) id bb1d1658-dd54-4909-9703-7421bb0cbf9f", - "key": "bb1d1658-dd54-4909-9703-7421bb0cbf9f", - "label": "nch_5(2020) metadata", - "value": "26353" - }, - { - "description": "Jurisdiction Metadata for Chilongo Zone id 713c3b32-341f-4108-a337-dd223df5b58c", - "key": "713c3b32-341f-4108-a337-dd223df5b58c", - "label": "Chilongo Zone metadata", - "value": "26354" - }, - { - "description": "Jurisdiction Metadata for nch_29(2020) id 5c428b11-b433-4d60-b9e4-b3356be8f5b5", - "key": "5c428b11-b433-4d60-b9e4-b3356be8f5b5", - "label": "nch_29(2020) metadata", - "value": "26355" - }, - { - "description": "Jurisdiction Metadata for nch_60(2020) id d701875b-7842-4f70-af51-ba81d238e84d", - "key": "d701875b-7842-4f70-af51-ba81d238e84d", - "label": "nch_60(2020) metadata", - "value": "26356" - }, - { - "description": "Jurisdiction Metadata for nch_30(2020) id d2e942bf-303a-4490-a830-bd9160697ad5", - "key": "d2e942bf-303a-4490-a830-bd9160697ad5", - "label": "nch_30(2020) metadata", - "value": "26357" - }, - { - "description": "Jurisdiction Metadata for nch_52(2020) id a47a48a7-08ab-4c3a-8131-65278a6bfd49", - "key": "a47a48a7-08ab-4c3a-8131-65278a6bfd49", - "label": "nch_52(2020) metadata", - "value": "26358" - }, - { - "description": "Jurisdiction Metadata for nch_25(2020) id b588ca19-a17a-40a1-8886-f8dd996b500f", - "key": "b588ca19-a17a-40a1-8886-f8dd996b500f", - "label": "nch_25(2020) metadata", - "value": "26359" - }, - { - "description": "Jurisdiction Metadata for nch_76(2020) id ca7f0e26-7a2d-48cd-9971-b056a7101333", - "key": "ca7f0e26-7a2d-48cd-9971-b056a7101333", - "label": "nch_76(2020) metadata", - "value": "26360" - }, - { - "description": "Jurisdiction Metadata for nch_31(2020) id 56c596c7-22bd-47ef-946f-137deb971a63", - "key": "56c596c7-22bd-47ef-946f-137deb971a63", - "label": "nch_31(2020) metadata", - "value": "26361" - }, - { - "description": "Jurisdiction Metadata for nch_10(2020) id 7d350c60-2613-422e-a116-e7fee5009004", - "key": "7d350c60-2613-422e-a116-e7fee5009004", - "label": "nch_10(2020) metadata", - "value": "26362" - }, - { - "description": "Jurisdiction Metadata for nch_74(2020) id ee91c608-59cc-46c8-b461-c23dcb9596f8", - "key": "ee91c608-59cc-46c8-b461-c23dcb9596f8", - "label": "nch_74(2020) metadata", - "value": "26363" - }, - { - "description": "Jurisdiction Metadata for nch_71(2020) id 337f7d74-1889-4cc3-a603-65c61ae6da5e", - "key": "337f7d74-1889-4cc3-a603-65c61ae6da5e", - "label": "nch_71(2020) metadata", - "value": "26364" - }, - { - "description": "Jurisdiction Metadata for nch_66(2020) id 132df99c-ce91-41ab-9690-7b1a2e487432", - "key": "132df99c-ce91-41ab-9690-7b1a2e487432", - "label": "nch_66(2020) metadata", - "value": "26365" - }, - { - "description": "Jurisdiction Metadata for nch_35(2020) id b264ff5c-8ffa-4b93-aae7-8434f9197c5d", - "key": "b264ff5c-8ffa-4b93-aae7-8434f9197c5d", - "label": "nch_35(2020) metadata", - "value": "26366" - }, - { - "description": "Jurisdiction Metadata for nch_41(2020) id f0b0dbeb-d7b9-4e32-be63-d96562c2c040", - "key": "f0b0dbeb-d7b9-4e32-be63-d96562c2c040", - "label": "nch_41(2020) metadata", - "value": "26367" - }, - { - "description": "Jurisdiction Metadata for nch_57(2020) id f3c872a3-063f-4a0d-af10-a5bf6c5872b7", - "key": "f3c872a3-063f-4a0d-af10-a5bf6c5872b7", - "label": "nch_57(2020) metadata", - "value": "26368" - }, - { - "description": "Jurisdiction Metadata for nch_22(2020) id 515c96c9-cc6b-404d-bc16-b2cbfe8eb174", - "key": "515c96c9-cc6b-404d-bc16-b2cbfe8eb174", - "label": "nch_22(2020) metadata", - "value": "26369" - }, - { - "description": "Jurisdiction Metadata for nch_68(2020) id 719d2348-9730-42e6-8cb4-a366ee5b345e", - "key": "719d2348-9730-42e6-8cb4-a366ee5b345e", - "label": "nch_68(2020) metadata", - "value": "26370" - }, - { - "description": "Jurisdiction Metadata for nch_12(2020) id 392ab686-a448-4fe3-b746-2cffc12666b2", - "key": "392ab686-a448-4fe3-b746-2cffc12666b2", - "label": "nch_12(2020) metadata", - "value": "26371" - }, - { - "description": "Jurisdiction Metadata for nch_72(2020) id 05f928c4-bb9d-4091-9f76-ad82eab7fcf3", - "key": "05f928c4-bb9d-4091-9f76-ad82eab7fcf3", - "label": "nch_72(2020) metadata", - "value": "26372" - }, - { - "description": "Jurisdiction Metadata for nch_45(2020) id 597ba053-2913-4c59-823e-3ed15ddbe00f", - "key": "597ba053-2913-4c59-823e-3ed15ddbe00f", - "label": "nch_45(2020) metadata", - "value": "26373" - }, - { - "description": "Jurisdiction Metadata for nch_69(2020) id db5063ce-d311-4a71-9757-b903bb2db0a7", - "key": "db5063ce-d311-4a71-9757-b903bb2db0a7", - "label": "nch_69(2020) metadata", - "value": "26374" - }, - { - "description": "Jurisdiction Metadata for nch_44(2020) id f168ce98-996a-4bd1-ab10-9237303712c6", - "key": "f168ce98-996a-4bd1-ab10-9237303712c6", - "label": "nch_44(2020) metadata", - "value": "26375" - }, - { - "description": "Jurisdiction Metadata for nch_49(2020) id 5f7a00df-82ab-4f53-babe-b3188d64ff64", - "key": "5f7a00df-82ab-4f53-babe-b3188d64ff64", - "label": "nch_49(2020) metadata", - "value": "26376" - }, - { - "description": "Jurisdiction Metadata for nch_51(2020) id f6886c9b-0316-4c71-82d7-e40593b82cbb", - "key": "f6886c9b-0316-4c71-82d7-e40593b82cbb", - "label": "nch_51(2020) metadata", - "value": "26377" - }, - { - "description": "Jurisdiction Metadata for nch_11(2020) id 64c73411-f199-4244-9898-ccd35244b947", - "key": "64c73411-f199-4244-9898-ccd35244b947", - "label": "nch_11(2020) metadata", - "value": "26378" - }, - { - "description": "Jurisdiction Metadata for nch_40(2020) id 1d97db30-0733-4c3d-8877-332c8b9cefb3", - "key": "1d97db30-0733-4c3d-8877-332c8b9cefb3", - "label": "nch_40(2020) metadata", - "value": "26379" - }, - { - "description": "Jurisdiction Metadata for nch_59(2020) id a3005a12-5ee8-4d92-bd64-8c0c00c8fec0", - "key": "a3005a12-5ee8-4d92-bd64-8c0c00c8fec0", - "label": "nch_59(2020) metadata", - "value": "26380" - }, - { - "description": "Jurisdiction Metadata for nch_43(2020) id 9437bc4f-d770-41b2-a16e-360580f4a4d9", - "key": "9437bc4f-d770-41b2-a16e-360580f4a4d9", - "label": "nch_43(2020) metadata", - "value": "26381" - }, - { - "description": "Jurisdiction Metadata for nch_14(2020) id 8b36b024-dd7e-4fe0-b497-337e6a6b7a18", - "key": "8b36b024-dd7e-4fe0-b497-337e6a6b7a18", - "label": "nch_14(2020) metadata", - "value": "26382" - }, - { - "description": "Jurisdiction Metadata for nch_21(2020) id 8f282732-75ce-4066-8936-06097a525268", - "key": "8f282732-75ce-4066-8936-06097a525268", - "label": "nch_21(2020) metadata", - "value": "26383" - }, - { - "description": "Jurisdiction Metadata for nch_65(2020) id fcc84697-e9dd-41d4-b58a-44483ff0efeb", - "key": "fcc84697-e9dd-41d4-b58a-44483ff0efeb", - "label": "nch_65(2020) metadata", - "value": "26384" - }, - { - "description": "Jurisdiction Metadata for nch_7(2020) id bb8c4fc4-064c-45ca-ad46-00f7d6495fce", - "key": "bb8c4fc4-064c-45ca-ad46-00f7d6495fce", - "label": "nch_7(2020) metadata", - "value": "26385" - }, - { - "description": "Jurisdiction Metadata for nch_81(2020) id 7e276616-a9be-4238-8764-085a6b3ef110", - "key": "7e276616-a9be-4238-8764-085a6b3ef110", - "label": "nch_81(2020) metadata", - "value": "26386" - }, - { - "description": "Jurisdiction Metadata for nch_20(2020) id 9482cc01-f8d7-4e5e-b121-0319a2a5279b", - "key": "9482cc01-f8d7-4e5e-b121-0319a2a5279b", - "label": "nch_20(2020) metadata", - "value": "26387" - }, - { - "description": "Jurisdiction Metadata for nch_15(2020) id 86f370c8-e53a-451f-9c2c-3ef7ee8a9629", - "key": "86f370c8-e53a-451f-9c2c-3ef7ee8a9629", - "label": "nch_15(2020) metadata", - "value": "26388" - }, - { - "description": "Jurisdiction Metadata for nch_61(2020) id 541e3b2c-5d79-4c15-b69b-8e93630c4a15", - "key": "541e3b2c-5d79-4c15-b69b-8e93630c4a15", - "label": "nch_61(2020) metadata", - "value": "26389" - }, - { - "description": "Jurisdiction Metadata for nch_86(2020) id 5246fc13-0277-4631-80f3-102d017d611e", - "key": "5246fc13-0277-4631-80f3-102d017d611e", - "label": "nch_86(2020) metadata", - "value": "26390" - }, - { - "description": "Jurisdiction Metadata for nch_16(2020) id c323ef8f-8b4a-4743-891b-b049921370cd", - "key": "c323ef8f-8b4a-4743-891b-b049921370cd", - "label": "nch_16(2020) metadata", - "value": "26391" - }, - { - "description": "Jurisdiction Metadata for nch_13(2020) id 1edc78e6-fa15-481e-97a0-b9cce331d7a5", - "key": "1edc78e6-fa15-481e-97a0-b9cce331d7a5", - "label": "nch_13(2020) metadata", - "value": "26392" - }, - { - "description": "Jurisdiction Metadata for nch_27(2020) id 35d52313-74f9-4e68-9986-1cd50c04bf9b", - "key": "35d52313-74f9-4e68-9986-1cd50c04bf9b", - "label": "nch_27(2020) metadata", - "value": "26393" - }, - { - "description": "Jurisdiction Metadata for nch_32(2020) id 934cd2f3-0e83-4374-b456-a622886b5545", - "key": "934cd2f3-0e83-4374-b456-a622886b5545", - "label": "nch_32(2020) metadata", - "value": "26394" - }, - { - "description": "Jurisdiction Metadata for nch_63(2020) id 3977cbdf-eba6-4c36-af30-0f15dc987d2e", - "key": "3977cbdf-eba6-4c36-af30-0f15dc987d2e", - "label": "nch_63(2020) metadata", - "value": "26395" - }, - { - "description": "Jurisdiction Metadata for nch_33(2020) id 11eb37e8-c956-4ed5-9929-d96e3d193ddb", - "key": "11eb37e8-c956-4ed5-9929-d96e3d193ddb", - "label": "nch_33(2020) metadata", - "value": "26396" - }, - { - "description": "Jurisdiction Metadata for nch_82(2020) id 57c75c39-84f1-4c5b-99b2-92cabe8ae492", - "key": "57c75c39-84f1-4c5b-99b2-92cabe8ae492", - "label": "nch_82(2020) metadata", - "value": "26397" - }, - { - "description": "Jurisdiction Metadata for nch_17(2020) id 57eb5fb6-32bd-4f53-ae75-0c2c1383f510", - "key": "57eb5fb6-32bd-4f53-ae75-0c2c1383f510", - "label": "nch_17(2020) metadata", - "value": "26398" - }, - { - "description": "Jurisdiction Metadata for nch_80(2020) id cc51f41b-d058-4923-95fa-e21df37cf522", - "key": "cc51f41b-d058-4923-95fa-e21df37cf522", - "label": "nch_80(2020) metadata", - "value": "26399" - }, - { - "description": "Jurisdiction Metadata for nch_56(2020) id 80e91345-da6f-4cac-8ef4-38e3a66105f3", - "key": "80e91345-da6f-4cac-8ef4-38e3a66105f3", - "label": "nch_56(2020) metadata", - "value": "26400" - }, - { - "description": "Jurisdiction Metadata for nch_38(2020) id 0ac9f38d-1a6a-40a2-8d32-cd6b5bc3c4ca", - "key": "0ac9f38d-1a6a-40a2-8d32-cd6b5bc3c4ca", - "label": "nch_38(2020) metadata", - "value": "26401" - }, - { - "description": "Jurisdiction Metadata for nch_84(2020) id 76ea44db-ef68-456f-9a96-c1634d54f214", - "key": "76ea44db-ef68-456f-9a96-c1634d54f214", - "label": "nch_84(2020) metadata", - "value": "26402" - }, - { - "description": "Jurisdiction Metadata for nch_26(2020) id a949cf3b-286e-4cfd-9ec2-ff5b241103a0", - "key": "a949cf3b-286e-4cfd-9ec2-ff5b241103a0", - "label": "nch_26(2020) metadata", - "value": "26403" - }, - { - "description": "Jurisdiction Metadata for nch_70(2020) id b50716c6-9c8b-4eca-8316-1393abba891f", - "key": "b50716c6-9c8b-4eca-8316-1393abba891f", - "label": "nch_70(2020) metadata", - "value": "26404" - }, - { - "description": "Jurisdiction Metadata for nch_39(2020) id e3b9decd-982b-4e8b-a585-635d3c987de8", - "key": "e3b9decd-982b-4e8b-a585-635d3c987de8", - "label": "nch_39(2020) metadata", - "value": "26405" - }, - { - "description": "Jurisdiction Metadata for nch_85(2020) id e0ed129f-aefe-4aa0-8da7-49414293346a", - "key": "e0ed129f-aefe-4aa0-8da7-49414293346a", - "label": "nch_85(2020) metadata", - "value": "26406" - }, - { - "description": "Jurisdiction Metadata for nch_37(2020) id 1c901f54-0156-4c38-8c57-ec9878cd00c8", - "key": "1c901f54-0156-4c38-8c57-ec9878cd00c8", - "label": "nch_37(2020) metadata", - "value": "26407" - }, - { - "description": "Jurisdiction Metadata for nch_36(2020) id aaadf5ac-ee5c-476a-9121-cdd95da2929e", - "key": "aaadf5ac-ee5c-476a-9121-cdd95da2929e", - "label": "nch_36(2020) metadata", - "value": "26408" - }, - { - "description": "Jurisdiction Metadata for nch_62(2020) id 57a77867-e8c3-401d-bf1a-6e76d5f73c71", - "key": "57a77867-e8c3-401d-bf1a-6e76d5f73c71", - "label": "nch_62(2020) metadata", - "value": "26409" - }, - { - "description": "Jurisdiction Metadata for nch_87(2020) id 94c0ffaa-1d5a-47b0-b7d7-95fe8ca0b12a", - "key": "94c0ffaa-1d5a-47b0-b7d7-95fe8ca0b12a", - "label": "nch_87(2020) metadata", - "value": "26410" - }, - { - "description": "Jurisdiction Metadata for nch_55(2020) id 0fa2cf3a-6c1d-4bad-a998-c3d089cc0232", - "key": "0fa2cf3a-6c1d-4bad-a998-c3d089cc0232", - "label": "nch_55(2020) metadata", - "value": "26411" - }, - { - "description": "Jurisdiction Metadata for nch_73(2020) id 230e67dc-a25f-4e23-8c77-74627b6e4bca", - "key": "230e67dc-a25f-4e23-8c77-74627b6e4bca", - "label": "nch_73(2020) metadata", - "value": "26412" - }, - { - "description": "Jurisdiction Metadata for nch_24(2020) id 5665bc18-a6cc-47f3-af77-232df6cb1f62", - "key": "5665bc18-a6cc-47f3-af77-232df6cb1f62", - "label": "nch_24(2020) metadata", - "value": "26413" - }, - { - "description": "Jurisdiction Metadata for nch_47(2020) id 92af91f5-6bd2-45a6-98b0-fae15daca446", - "key": "92af91f5-6bd2-45a6-98b0-fae15daca446", - "label": "nch_47(2020) metadata", - "value": "26414" - }, - { - "description": "Jurisdiction Metadata for nch_28(2020) id 4874e19d-37ab-4162-9ee6-835ba224edd0", - "key": "4874e19d-37ab-4162-9ee6-835ba224edd0", - "label": "nch_28(2020) metadata", - "value": "26415" - }, - { - "description": "Jurisdiction Metadata for nch_23(2020) id f77ae4b2-65d4-4cc5-a6a1-5671446a4174", - "key": "f77ae4b2-65d4-4cc5-a6a1-5671446a4174", - "label": "nch_23(2020) metadata", - "value": "26416" - }, - { - "description": "Jurisdiction Metadata for nch_54(2020) id f928f665-eeaf-422e-bb23-8d51d934573c", - "key": "f928f665-eeaf-422e-bb23-8d51d934573c", - "label": "nch_54(2020) metadata", - "value": "26417" - }, - { - "description": "Jurisdiction Metadata for nch_48(2020) id c62c4bb3-61c9-43bb-9fee-25d615e5d7e1", - "key": "c62c4bb3-61c9-43bb-9fee-25d615e5d7e1", - "label": "nch_48(2020) metadata", - "value": "26418" - }, - { - "description": "Jurisdiction Metadata for nch_46(2020) id 0efbad8f-910d-4713-a32b-ba67a4399aa7", - "key": "0efbad8f-910d-4713-a32b-ba67a4399aa7", - "label": "nch_46(2020) metadata", - "value": "26419" - }, - { - "description": "Jurisdiction Metadata for nch_83(2020) id 91622bf1-696f-4c7e-b6d6-59ad33f5701c", - "key": "91622bf1-696f-4c7e-b6d6-59ad33f5701c", - "label": "nch_83(2020) metadata", - "value": "26420" - }, - { - "description": "Jurisdiction Metadata for nch_79(2020) id 190e41fd-bf4a-4189-949c-85cd9c0f84bc", - "key": "190e41fd-bf4a-4189-949c-85cd9c0f84bc", - "label": "nch_79(2020) metadata", - "value": "26421" - }, - { - "description": "Jurisdiction Metadata for nch_53(2020) id b9ae4b08-2202-4063-8f11-176368709ebf", - "key": "b9ae4b08-2202-4063-8f11-176368709ebf", - "label": "nch_53(2020) metadata", - "value": "26422" - }, - { - "description": "Jurisdiction Metadata for nch_64(2020) id 859a4d2e-0d60-4e97-9f1d-1559b9cfecfa", - "key": "859a4d2e-0d60-4e97-9f1d-1559b9cfecfa", - "label": "nch_64(2020) metadata", - "value": "26423" - }, - { - "description": "Jurisdiction Metadata for nch_58(2020) id af137575-4afc-4a8d-87f9-8482afe2952b", - "key": "af137575-4afc-4a8d-87f9-8482afe2952b", - "label": "nch_58(2020) metadata", - "value": "26424" - }, - { - "description": "Jurisdiction Metadata for nch_50(2020) id 92e0ac5b-de6e-438c-a6fb-75d67b901e72", - "key": "92e0ac5b-de6e-438c-a6fb-75d67b901e72", - "label": "nch_50(2020) metadata", - "value": "26425" - }, - { - "description": "Jurisdiction Metadata for nch_67(2020) id 24b0ac21-06dc-4982-bea0-5feb7d490958", - "key": "24b0ac21-06dc-4982-bea0-5feb7d490958", - "label": "nch_67(2020) metadata", - "value": "26426" - }, - { - "description": "Jurisdiction Metadata for nch_19(2020) id 66c9bb9e-331e-44c5-84c0-fa4bf604e7eb", - "key": "66c9bb9e-331e-44c5-84c0-fa4bf604e7eb", - "label": "nch_19(2020) metadata", - "value": "26427" - }, - { - "description": "Jurisdiction Metadata for nch_6(2020) id a3a2444b-dfc6-4fa9-b5da-0d355b35f7c8", - "key": "a3a2444b-dfc6-4fa9-b5da-0d355b35f7c8", - "label": "nch_6(2020) metadata", - "value": "26428" - }, - { - "description": "Jurisdiction Metadata for nch_78(2020) id 612e30b7-23d3-4e1f-8357-42843b080b1a", - "key": "612e30b7-23d3-4e1f-8357-42843b080b1a", - "label": "nch_78(2020) metadata", - "value": "26429" - }, - { - "description": "Jurisdiction Metadata for nch_18(2020) id 9f8a40de-c7da-4417-a6ed-7dede2bb9746", - "key": "9f8a40de-c7da-4417-a6ed-7dede2bb9746", - "label": "nch_18(2020) metadata", - "value": "26430" - }, - { - "description": "Jurisdiction Metadata for nch_42(2020) id 68dcd5c3-6726-454d-a0bd-e2b7be70cc32", - "key": "68dcd5c3-6726-454d-a0bd-e2b7be70cc32", - "label": "nch_42(2020) metadata", - "value": "26431" - }, - { - "description": "Jurisdiction Metadata for Kambwali(2020) id 00d16a60-80b0-4fc1-9c87-9bff2efad72f", - "key": "00d16a60-80b0-4fc1-9c87-9bff2efad72f", - "label": "Kambwali(2020) metadata", - "value": "26432" - }, - { - "description": "Jurisdiction Metadata for Kapaya Zone id f35e15ab-383a-49cc-b0c2-fc9d1792492c", - "key": "f35e15ab-383a-49cc-b0c2-fc9d1792492c", - "label": "Kapaya Zone metadata", - "value": "26433" - }, - { - "description": "Jurisdiction Metadata for kmb_4(2020) id a9fe67d9-d445-4682-adb5-617518f1efa2", - "key": "a9fe67d9-d445-4682-adb5-617518f1efa2", - "label": "kmb_4(2020) metadata", - "value": "26434" - }, - { - "description": "Jurisdiction Metadata for Chimbofuma Zone id fe7445dd-0ade-4388-b4d4-492335c995e3", - "key": "fe7445dd-0ade-4388-b4d4-492335c995e3", - "label": "Chimbofuma Zone metadata", - "value": "26435" - }, - { - "description": "Jurisdiction Metadata for kmb_3(2020) id 06a2b4b8-8790-4017-80a4-cf482f9b469b", - "key": "06a2b4b8-8790-4017-80a4-cf482f9b469b", - "label": "kmb_3(2020) metadata", - "value": "26436" - }, - { - "description": "Jurisdiction Metadata for Kalimbwa id 28f7289e-26b1-4188-919a-7957a16b7ede", - "key": "28f7289e-26b1-4188-919a-7957a16b7ede", - "label": "Kalimbwa metadata", - "value": "26437" - }, - { - "description": "Jurisdiction Metadata for kmb_19(2020) id 870ff69d-c566-4b24-9954-1503f0310c69", - "key": "870ff69d-c566-4b24-9954-1503f0310c69", - "label": "kmb_19(2020) metadata", - "value": "26438" - }, - { - "description": "Jurisdiction Metadata for kmb_32(2020) id 11bfacf5-c32d-4d74-a64e-d45a0aa0e4c3", - "key": "11bfacf5-c32d-4d74-a64e-d45a0aa0e4c3", - "label": "kmb_32(2020) metadata", - "value": "26439" - }, - { - "description": "Jurisdiction Metadata for kmb_48(2020) id 2402da36-b177-4688-83da-d10d0e9435a2", - "key": "2402da36-b177-4688-83da-d10d0e9435a2", - "label": "kmb_48(2020) metadata", - "value": "26440" - }, - { - "description": "Jurisdiction Metadata for kmb_33(2020) id 976612b8-8fea-4b5c-89f3-73b615cf281a", - "key": "976612b8-8fea-4b5c-89f3-73b615cf281a", - "label": "kmb_33(2020) metadata", - "value": "26441" - }, - { - "description": "Jurisdiction Metadata for kmb_39(2020) id e95108bc-e104-4be4-b52b-8bf7e132f75e", - "key": "e95108bc-e104-4be4-b52b-8bf7e132f75e", - "label": "kmb_39(2020) metadata", - "value": "26442" - }, - { - "description": "Jurisdiction Metadata for kmb_29(2020) id 2851d2db-b7d1-4a8b-8711-813727ed2754", - "key": "2851d2db-b7d1-4a8b-8711-813727ed2754", - "label": "kmb_29(2020) metadata", - "value": "26443" - }, - { - "description": "Jurisdiction Metadata for kmb_30(2020) id ca5c7c96-a052-4bfc-8262-a34b7bd8bc0a", - "key": "ca5c7c96-a052-4bfc-8262-a34b7bd8bc0a", - "label": "kmb_30(2020) metadata", - "value": "26444" - }, - { - "description": "Jurisdiction Metadata for kmb_26(2020) id 05c68781-f85b-46a8-b36a-e365019b340c", - "key": "05c68781-f85b-46a8-b36a-e365019b340c", - "label": "kmb_26(2020) metadata", - "value": "26445" - }, - { - "description": "Jurisdiction Metadata for kmb_55(2020) id 0c2079fd-6616-483c-9618-21335f27e3e4", - "key": "0c2079fd-6616-483c-9618-21335f27e3e4", - "label": "kmb_55(2020) metadata", - "value": "26446" - }, - { - "description": "Jurisdiction Metadata for kmb_31(2020) id ba3c0cba-30ca-48a9-9e4f-4f37fdbe1cbe", - "key": "ba3c0cba-30ca-48a9-9e4f-4f37fdbe1cbe", - "label": "kmb_31(2020) metadata", - "value": "26447" - }, - { - "description": "Jurisdiction Metadata for kmb_53(2020) id 1f64d240-2681-4eb2-aa27-84fe7642ed34", - "key": "1f64d240-2681-4eb2-aa27-84fe7642ed34", - "label": "kmb_53(2020) metadata", - "value": "26448" - }, - { - "description": "Jurisdiction Metadata for kmb_61(2020) id 5ac6c612-fa6b-4af6-9169-86b0912e4ed5", - "key": "5ac6c612-fa6b-4af6-9169-86b0912e4ed5", - "label": "kmb_61(2020) metadata", - "value": "26449" - }, - { - "description": "Jurisdiction Metadata for kmb_45(2020) id 06b6a184-ca81-4ded-9100-25d26369e0a2", - "key": "06b6a184-ca81-4ded-9100-25d26369e0a2", - "label": "kmb_45(2020) metadata", - "value": "26450" - }, - { - "description": "Jurisdiction Metadata for kmb_63(2020) id f0e0d169-3f65-428b-88a2-8054129d954e", - "key": "f0e0d169-3f65-428b-88a2-8054129d954e", - "label": "kmb_63(2020) metadata", - "value": "26451" - }, - { - "description": "Jurisdiction Metadata for kmb_28(2020) id 957b7278-899d-4963-97bf-38d73bf27faf", - "key": "957b7278-899d-4963-97bf-38d73bf27faf", - "label": "kmb_28(2020) metadata", - "value": "26452" - }, - { - "description": "Jurisdiction Metadata for kmb_64(2020) id 6177dd97-f602-403f-8958-e2f69c70aa83", - "key": "6177dd97-f602-403f-8958-e2f69c70aa83", - "label": "kmb_64(2020) metadata", - "value": "26453" - }, - { - "description": "Jurisdiction Metadata for kmb_36(2020) id 29906736-a383-4444-8bf2-09cb1c81cdd3", - "key": "29906736-a383-4444-8bf2-09cb1c81cdd3", - "label": "kmb_36(2020) metadata", - "value": "26454" - }, - { - "description": "Jurisdiction Metadata for kmb_51(2020) id ebbc56ae-281b-42ce-8bc5-60c109ecf266", - "key": "ebbc56ae-281b-42ce-8bc5-60c109ecf266", - "label": "kmb_51(2020) metadata", - "value": "26455" - }, - { - "description": "Jurisdiction Metadata for kmb_37(2020) id 3c800fc8-3179-455b-be00-340f2dfb5cbe", - "key": "3c800fc8-3179-455b-be00-340f2dfb5cbe", - "label": "kmb_37(2020) metadata", - "value": "26456" - }, - { - "description": "Jurisdiction Metadata for kmb_54(2020) id e2bbab1c-5a2b-4702-83cb-c1ac5d0102cb", - "key": "e2bbab1c-5a2b-4702-83cb-c1ac5d0102cb", - "label": "kmb_54(2020) metadata", - "value": "26457" - }, - { - "description": "Jurisdiction Metadata for kmb_44(2020) id 02df8e4b-2631-4e7b-9cf1-f563eddda7e7", - "key": "02df8e4b-2631-4e7b-9cf1-f563eddda7e7", - "label": "kmb_44(2020) metadata", - "value": "26458" - }, - { - "description": "Jurisdiction Metadata for kmb_46(2020) id 1abb72e9-660e-4953-9de1-5aefba7946b5", - "key": "1abb72e9-660e-4953-9de1-5aefba7946b5", - "label": "kmb_46(2020) metadata", - "value": "26459" - }, - { - "description": "Jurisdiction Metadata for kmb_49(2020) id 981fb803-cbec-4ce9-96e8-a6cbff6a2175", - "key": "981fb803-cbec-4ce9-96e8-a6cbff6a2175", - "label": "kmb_49(2020) metadata", - "value": "26460" - }, - { - "description": "Jurisdiction Metadata for kmb_15(2020) id 1bacb10f-18ca-4ae2-affc-8ccd569870c8", - "key": "1bacb10f-18ca-4ae2-affc-8ccd569870c8", - "label": "kmb_15(2020) metadata", - "value": "26461" - }, - { - "description": "Jurisdiction Metadata for kmb_68(2020) id 2553b23c-4240-4120-9981-813a279fd607", - "key": "2553b23c-4240-4120-9981-813a279fd607", - "label": "kmb_68(2020) metadata", - "value": "26462" - }, - { - "description": "Jurisdiction Metadata for kmb_43(2020) id 49572feb-375d-4619-8390-6f307a4bd906", - "key": "49572feb-375d-4619-8390-6f307a4bd906", - "label": "kmb_43(2020) metadata", - "value": "26463" - }, - { - "description": "Jurisdiction Metadata for kmb_34(2020) id 02749d65-4ca8-4ffd-94af-1e36c3304cb6", - "key": "02749d65-4ca8-4ffd-94af-1e36c3304cb6", - "label": "kmb_34(2020) metadata", - "value": "26464" - }, - { - "description": "Jurisdiction Metadata for kmb_14(2020) id fd75e721-3aab-4162-9218-d03457669066", - "key": "fd75e721-3aab-4162-9218-d03457669066", - "label": "kmb_14(2020) metadata", - "value": "26465" - }, - { - "description": "Jurisdiction Metadata for kmb_25(2020) id 0a54be3e-dc84-4143-bc80-d41edfbee029", - "key": "0a54be3e-dc84-4143-bc80-d41edfbee029", - "label": "kmb_25(2020) metadata", - "value": "26466" - }, - { - "description": "Jurisdiction Metadata for kmb_40(2020) id dd34fdd8-c894-4355-88c7-8930f51e517a", - "key": "dd34fdd8-c894-4355-88c7-8930f51e517a", - "label": "kmb_40(2020) metadata", - "value": "26467" - }, - { - "description": "Jurisdiction Metadata for kmb_50(2020) id f4ed6088-2ce8-417d-ae92-b6d78283e2e6", - "key": "f4ed6088-2ce8-417d-ae92-b6d78283e2e6", - "label": "kmb_50(2020) metadata", - "value": "26468" - }, - { - "description": "Jurisdiction Metadata for kmb_17(2020) id 88a91d4b-47fa-478c-ab2e-817a55e84065", - "key": "88a91d4b-47fa-478c-ab2e-817a55e84065", - "label": "kmb_17(2020) metadata", - "value": "26469" - }, - { - "description": "Jurisdiction Metadata for kmb_10(2020) id 4637582f-1413-45ec-a6fb-251cd3d26102", - "key": "4637582f-1413-45ec-a6fb-251cd3d26102", - "label": "kmb_10(2020) metadata", - "value": "26470" - }, - { - "description": "Jurisdiction Metadata for kmb_35(2020) id 574926fe-8c4c-4af2-9327-4263dca6ef2f", - "key": "574926fe-8c4c-4af2-9327-4263dca6ef2f", - "label": "kmb_35(2020) metadata", - "value": "26471" - }, - { - "description": "Jurisdiction Metadata for kmb_62(2020) id 0d86c858-756d-4cf8-add4-625863e6d13c", - "key": "0d86c858-756d-4cf8-add4-625863e6d13c", - "label": "kmb_62(2020) metadata", - "value": "26472" - }, - { - "description": "Jurisdiction Metadata for kmb_52(2020) id beb0f8ee-c66d-4692-8f34-03d5f4da2f56", - "key": "beb0f8ee-c66d-4692-8f34-03d5f4da2f56", - "label": "kmb_52(2020) metadata", - "value": "26473" - }, - { - "description": "Jurisdiction Metadata for kmb_47(2020) id e1640aac-c6f5-46c8-b836-145df7dee717", - "key": "e1640aac-c6f5-46c8-b836-145df7dee717", - "label": "kmb_47(2020) metadata", - "value": "26474" - }, - { - "description": "Jurisdiction Metadata for kmb_56(2020) id 2f80bd06-641e-4223-b24a-ccf5303cc3d0", - "key": "2f80bd06-641e-4223-b24a-ccf5303cc3d0", - "label": "kmb_56(2020) metadata", - "value": "26475" - }, - { - "description": "Jurisdiction Metadata for kmb_18(2020) id 74670e26-eadc-4ae5-b565-f47aee06f41e", - "key": "74670e26-eadc-4ae5-b565-f47aee06f41e", - "label": "kmb_18(2020) metadata", - "value": "26476" - }, - { - "description": "Jurisdiction Metadata for kmb_23(2020) id 1a8d18ba-791f-4de5-b4be-9b5619535d5c", - "key": "1a8d18ba-791f-4de5-b4be-9b5619535d5c", - "label": "kmb_23(2020) metadata", - "value": "26477" - }, - { - "description": "Jurisdiction Metadata for kmb_38(2020) id 7460b82f-3fe9-4150-82f6-64c06148294f", - "key": "7460b82f-3fe9-4150-82f6-64c06148294f", - "label": "kmb_38(2020) metadata", - "value": "26478" - }, - { - "description": "Jurisdiction Metadata for kmb_67(2020) id 0ef8bca0-b9cc-40c0-a06e-281be31764ee", - "key": "0ef8bca0-b9cc-40c0-a06e-281be31764ee", - "label": "kmb_67(2020) metadata", - "value": "26479" - }, - { - "description": "Jurisdiction Metadata for kmb_27(2020) id c2343d93-4ed4-417d-9e25-c525ce3596e7", - "key": "c2343d93-4ed4-417d-9e25-c525ce3596e7", - "label": "kmb_27(2020) metadata", - "value": "26480" - }, - { - "description": "Jurisdiction Metadata for kmb_65(2020) id 85fd9130-f431-4765-be5b-6cea9043eb05", - "key": "85fd9130-f431-4765-be5b-6cea9043eb05", - "label": "kmb_65(2020) metadata", - "value": "26481" - }, - { - "description": "Jurisdiction Metadata for kmb_70(2020) id 9bb13341-1c6e-45f9-8565-68a02a32892b", - "key": "9bb13341-1c6e-45f9-8565-68a02a32892b", - "label": "kmb_70(2020) metadata", - "value": "26482" - }, - { - "description": "Jurisdiction Metadata for kmb_21(2020) id b7caa0b2-4ea0-4768-961c-a53fb0c23bd2", - "key": "b7caa0b2-4ea0-4768-961c-a53fb0c23bd2", - "label": "kmb_21(2020) metadata", - "value": "26483" - }, - { - "description": "Jurisdiction Metadata for kmb_66(2020) id 962f6e11-f0c3-4182-8ba5-5815bb1003e6", - "key": "962f6e11-f0c3-4182-8ba5-5815bb1003e6", - "label": "kmb_66(2020) metadata", - "value": "26484" - }, - { - "description": "Jurisdiction Metadata for Lukanga Zone id 17e6b69a-e45b-4a98-93f2-84bc99250b56", - "key": "17e6b69a-e45b-4a98-93f2-84bc99250b56", - "label": "Lukanga Zone metadata", - "value": "26485" - }, - { - "description": "Jurisdiction Metadata for kmb_41(2020) id b4e5c328-8a6b-4bc9-877a-03b2ced35111", - "key": "b4e5c328-8a6b-4bc9-877a-03b2ced35111", - "label": "kmb_41(2020) metadata", - "value": "26486" - }, - { - "description": "Jurisdiction Metadata for kmb_24(2020) id 4bd11499-817d-4edb-9b80-8580a7c314b6", - "key": "4bd11499-817d-4edb-9b80-8580a7c314b6", - "label": "kmb_24(2020) metadata", - "value": "26487" - }, - { - "description": "Jurisdiction Metadata for kmb_1(2020) id 23da130a-255f-488c-a93d-4bdd776855e7", - "key": "23da130a-255f-488c-a93d-4bdd776855e7", - "label": "kmb_1(2020) metadata", - "value": "26488" - }, - { - "description": "Jurisdiction Metadata for kmb_9(2020) id 2104f6da-ff28-43ad-878c-a94b881ced34", - "key": "2104f6da-ff28-43ad-878c-a94b881ced34", - "label": "kmb_9(2020) metadata", - "value": "26489" - }, - { - "description": "Jurisdiction Metadata for Isokwe Zone id bb136f6b-70aa-462a-afd9-51325c6ae202", - "key": "bb136f6b-70aa-462a-afd9-51325c6ae202", - "label": "Isokwe Zone metadata", - "value": "26490" - }, - { - "description": "Jurisdiction Metadata for kmb_6(2020) id d151be38-b25c-4626-916b-4d118e19c066", - "key": "d151be38-b25c-4626-916b-4d118e19c066", - "label": "kmb_6(2020) metadata", - "value": "26491" - }, - { - "description": "Jurisdiction Metadata for kmb_60(2020) id 0902c635-b1b7-40be-84a7-100178f0a1e2", - "key": "0902c635-b1b7-40be-84a7-100178f0a1e2", - "label": "kmb_60(2020) metadata", - "value": "26492" - }, - { - "description": "Jurisdiction Metadata for kmb_20(2020) id ef29a5b6-2182-41f8-868c-492f17c7067b", - "key": "ef29a5b6-2182-41f8-868c-492f17c7067b", - "label": "kmb_20(2020) metadata", - "value": "26493" - }, - { - "description": "Jurisdiction Metadata for kmb_7(2020) id 1afe207d-38a6-43ce-8ab6-a7284f947de2", - "key": "1afe207d-38a6-43ce-8ab6-a7284f947de2", - "label": "kmb_7(2020) metadata", - "value": "26494" - }, - { - "description": "Jurisdiction Metadata for kmb_42(2020) id 0810882b-07d8-47a8-812b-36e45872b7c7", - "key": "0810882b-07d8-47a8-812b-36e45872b7c7", - "label": "kmb_42(2020) metadata", - "value": "26495" - }, - { - "description": "Jurisdiction Metadata for kmb_8(2020) id 4efa9d9b-9108-44e0-ab10-1b8b4564d186", - "key": "4efa9d9b-9108-44e0-ab10-1b8b4564d186", - "label": "kmb_8(2020) metadata", - "value": "26496" - }, - { - "description": "Jurisdiction Metadata for kmb_5(2020) id a595cf60-b856-4375-a4f0-449a5b6e82bc", - "key": "a595cf60-b856-4375-a4f0-449a5b6e82bc", - "label": "kmb_5(2020) metadata", - "value": "26497" - }, - { - "description": "Jurisdiction Metadata for Kasamba Zone id db2c1c5e-4676-4b74-97d9-db77bcd3f376", - "key": "db2c1c5e-4676-4b74-97d9-db77bcd3f376", - "label": "Kasamba Zone metadata", - "value": "26498" - }, - { - "description": "Jurisdiction Metadata for kmb_2(2020) id a3a66dce-eb7a-405a-b14c-0755db622947", - "key": "a3a66dce-eb7a-405a-b14c-0755db622947", - "label": "kmb_2(2020) metadata", - "value": "26499" - }, - { - "description": "Jurisdiction Metadata for kmb_57(2020) id e2705472-2f84-44d4-a7bb-c8a946db16fc", - "key": "e2705472-2f84-44d4-a7bb-c8a946db16fc", - "label": "kmb_57(2020) metadata", - "value": "26500" - }, - { - "description": "Jurisdiction Metadata for kmb_12(2020) id e08bc57e-9eca-4f75-805f-1ddde7bc85b1", - "key": "e08bc57e-9eca-4f75-805f-1ddde7bc85b1", - "label": "kmb_12(2020) metadata", - "value": "26501" - }, - { - "description": "Jurisdiction Metadata for kmb_22(2020) id 431b7eb1-0e22-4b07-8fa0-cfd6569e46db", - "key": "431b7eb1-0e22-4b07-8fa0-cfd6569e46db", - "label": "kmb_22(2020) metadata", - "value": "26502" - }, - { - "description": "Jurisdiction Metadata for kmb_16(2020) id 11dddbcb-ec88-4225-8f6c-000b6ed6f01c", - "key": "11dddbcb-ec88-4225-8f6c-000b6ed6f01c", - "label": "kmb_16(2020) metadata", - "value": "26503" - }, - { - "description": "Jurisdiction Metadata for kmb_13(2020) id 8dadcbea-c59b-4c50-8e21-776e29982768", - "key": "8dadcbea-c59b-4c50-8e21-776e29982768", - "label": "kmb_13(2020) metadata", - "value": "26504" - }, - { - "description": "Jurisdiction Metadata for kmb_58(2020) id c404ab50-f952-435a-89e9-5ebe49db7d99", - "key": "c404ab50-f952-435a-89e9-5ebe49db7d99", - "label": "kmb_58(2020) metadata", - "value": "26505" - }, - { - "description": "Jurisdiction Metadata for kmb_69(2020) id 94fc5d4f-fcf3-42e1-b6af-590206311469", - "key": "94fc5d4f-fcf3-42e1-b6af-590206311469", - "label": "kmb_69(2020) metadata", - "value": "26506" - }, - { - "description": "Jurisdiction Metadata for kmb_59(2020) id 0f34163c-eae7-4675-a115-c0cd9f471c3e", - "key": "0f34163c-eae7-4675-a115-c0cd9f471c3e", - "label": "kmb_59(2020) metadata", - "value": "26507" - }, - { - "description": "Jurisdiction Metadata for kmb_11(2020) id 69d22541-9281-4242-9356-49ff2bf341dd", - "key": "69d22541-9281-4242-9356-49ff2bf341dd", - "label": "kmb_11(2020) metadata", - "value": "26508" - }, - { - "description": "Jurisdiction Metadata for Chabilikila(2020) id fc5223eb-ddd5-44c7-a3b2-287e7660ea04", - "key": "fc5223eb-ddd5-44c7-a3b2-287e7660ea04", - "label": "Chabilikila(2020) metadata", - "value": "26509" - }, - { - "description": "Jurisdiction Metadata for Kashishi Zone id b671a16b-575c-41ca-acaf-2ca4c8b5ac6b", - "key": "b671a16b-575c-41ca-acaf-2ca4c8b5ac6b", - "label": "Kashishi Zone metadata", - "value": "26510" - }, - { - "description": "Jurisdiction Metadata for cbk_33(2020) id 18b5c8f2-c277-4128-90b5-0f5d27349657", - "key": "18b5c8f2-c277-4128-90b5-0f5d27349657", - "label": "cbk_33(2020) metadata", - "value": "26511" - }, - { - "description": "Jurisdiction Metadata for cbk_26(2020) id 0d658086-2ecc-4930-9b16-014ca7d49249", - "key": "0d658086-2ecc-4930-9b16-014ca7d49249", - "label": "cbk_26(2020) metadata", - "value": "26512" - }, - { - "description": "Jurisdiction Metadata for cbk_65(2020) id 02d619ca-0a4a-481a-9f36-7b4984978abf", - "key": "02d619ca-0a4a-481a-9f36-7b4984978abf", - "label": "cbk_65(2020) metadata", - "value": "26513" - }, - { - "description": "Jurisdiction Metadata for cbk_105(2020) id 91473ca1-972f-4f5d-a00a-e42868f9315a", - "key": "91473ca1-972f-4f5d-a00a-e42868f9315a", - "label": "cbk_105(2020) metadata", - "value": "26514" - }, - { - "description": "Jurisdiction Metadata for cbk_19(2020) id 4fdfb327-de80-466d-a4d7-02be960da2bd", - "key": "4fdfb327-de80-466d-a4d7-02be960da2bd", - "label": "cbk_19(2020) metadata", - "value": "26515" - }, - { - "description": "Jurisdiction Metadata for cbk_60(2020) id 22ccb3c5-c184-4d87-aee9-5b98b461bef7", - "key": "22ccb3c5-c184-4d87-aee9-5b98b461bef7", - "label": "cbk_60(2020) metadata", - "value": "26516" - }, - { - "description": "Jurisdiction Metadata for cbk_35(2020) id f9ff28b6-c632-46ce-857c-c4bae916b102", - "key": "f9ff28b6-c632-46ce-857c-c4bae916b102", - "label": "cbk_35(2020) metadata", - "value": "26517" - }, - { - "description": "Jurisdiction Metadata for cbk_86(2020) id 20b399aa-3bea-48b2-853c-a9c537c6d613", - "key": "20b399aa-3bea-48b2-853c-a9c537c6d613", - "label": "cbk_86(2020) metadata", - "value": "26518" - }, - { - "description": "Jurisdiction Metadata for cbk_48(2020) id 5bf56d5e-e96e-4a23-b02c-d1999d636e59", - "key": "5bf56d5e-e96e-4a23-b02c-d1999d636e59", - "label": "cbk_48(2020) metadata", - "value": "26519" - }, - { - "description": "Jurisdiction Metadata for Sikazwe Zone id 4b9a1310-76e4-4aa6-b232-9aef0a8590e1", - "key": "4b9a1310-76e4-4aa6-b232-9aef0a8590e1", - "label": "Sikazwe Zone metadata", - "value": "26520" - }, - { - "description": "Jurisdiction Metadata for cbk_95(2020) id 6ceb884f-4fc4-489e-a998-4932b40c829a", - "key": "6ceb884f-4fc4-489e-a998-4932b40c829a", - "label": "cbk_95(2020) metadata", - "value": "26521" - }, - { - "description": "Jurisdiction Metadata for cbk_70(2020) id 424dbe56-e4b3-400f-b8a6-34cca38d2e8f", - "key": "424dbe56-e4b3-400f-b8a6-34cca38d2e8f", - "label": "cbk_70(2020) metadata", - "value": "26522" - }, - { - "description": "Jurisdiction Metadata for cbk_93(2020) id bf0dafe8-4c5b-47f2-b99c-f6b6a2084f1a", - "key": "bf0dafe8-4c5b-47f2-b99c-f6b6a2084f1a", - "label": "cbk_93(2020) metadata", - "value": "26523" - }, - { - "description": "Jurisdiction Metadata for cbk_57(2020) id d5584ddf-fc64-4aa2-a7a5-5aeb1ac7f8e4", - "key": "d5584ddf-fc64-4aa2-a7a5-5aeb1ac7f8e4", - "label": "cbk_57(2020) metadata", - "value": "26524" - }, - { - "description": "Jurisdiction Metadata for cbk_92(2020) id d69dd328-8f14-40e2-9e55-ec6e00147339", - "key": "d69dd328-8f14-40e2-9e55-ec6e00147339", - "label": "cbk_92(2020) metadata", - "value": "26525" - }, - { - "description": "Jurisdiction Metadata for cbk_38(2020) id e0bf7368-0ba4-4eb7-bc71-528039d3db14", - "key": "e0bf7368-0ba4-4eb7-bc71-528039d3db14", - "label": "cbk_38(2020) metadata", - "value": "26526" - }, - { - "description": "Jurisdiction Metadata for cbk_9(2020) id 959cbe40-2ac6-407a-a62f-96ff2374b561", - "key": "959cbe40-2ac6-407a-a62f-96ff2374b561", - "label": "cbk_9(2020) metadata", - "value": "26527" - }, - { - "description": "Jurisdiction Metadata for cbk_53(2020) id c07240de-b5e8-4d69-9748-baa9bcf336cc", - "key": "c07240de-b5e8-4d69-9748-baa9bcf336cc", - "label": "cbk_53(2020) metadata", - "value": "26528" - }, - { - "description": "Jurisdiction Metadata for cbk_90(2020) id 8910ac4a-4289-418d-8ca9-65e11abb836d", - "key": "8910ac4a-4289-418d-8ca9-65e11abb836d", - "label": "cbk_90(2020) metadata", - "value": "26529" - }, - { - "description": "Jurisdiction Metadata for cbk_43(2020) id 651662a6-bd0d-4121-856c-d36a4dcc1212", - "key": "651662a6-bd0d-4121-856c-d36a4dcc1212", - "label": "cbk_43(2020) metadata", - "value": "26530" - }, - { - "description": "Jurisdiction Metadata for cbk_103(2020) id b2bd84c7-f21c-4f28-84a4-8d9f48d94105", - "key": "b2bd84c7-f21c-4f28-84a4-8d9f48d94105", - "label": "cbk_103(2020) metadata", - "value": "26531" - }, - { - "description": "Jurisdiction Metadata for cbk_50(2020) id 3eae824f-394d-4119-ade1-3ef0608d942d", - "key": "3eae824f-394d-4119-ade1-3ef0608d942d", - "label": "cbk_50(2020) metadata", - "value": "26532" - }, - { - "description": "Jurisdiction Metadata for cbk_40(2020) id 87e417f2-0180-4c8d-8e69-aa8ecab4ab54", - "key": "87e417f2-0180-4c8d-8e69-aa8ecab4ab54", - "label": "cbk_40(2020) metadata", - "value": "26533" - }, - { - "description": "Jurisdiction Metadata for cbk_85(2020) id 847d7bc3-7a1b-43ab-a9b1-a72d25fc172f", - "key": "847d7bc3-7a1b-43ab-a9b1-a72d25fc172f", - "label": "cbk_85(2020) metadata", - "value": "26534" - }, - { - "description": "Jurisdiction Metadata for chikutilwe Zone id 12692ecf-a6fd-477e-8c06-60deadd6f5ec", - "key": "12692ecf-a6fd-477e-8c06-60deadd6f5ec", - "label": "chikutilwe Zone metadata", - "value": "26535" - }, - { - "description": "Jurisdiction Metadata for cbk_41(2020) id cb08b396-c409-4ae2-ba33-e4a681c62f63", - "key": "cb08b396-c409-4ae2-ba33-e4a681c62f63", - "label": "cbk_41(2020) metadata", - "value": "26536" - }, - { - "description": "Jurisdiction Metadata for cbk_44(2020) id d2eac4ec-fed9-4735-bec4-0c17e2b12459", - "key": "d2eac4ec-fed9-4735-bec4-0c17e2b12459", - "label": "cbk_44(2020) metadata", - "value": "26537" - }, - { - "description": "Jurisdiction Metadata for cbk_29(2020) id 76105f44-0700-46ea-bdeb-178eb5b55c92", - "key": "76105f44-0700-46ea-bdeb-178eb5b55c92", - "label": "cbk_29(2020) metadata", - "value": "26538" - }, - { - "description": "Jurisdiction Metadata for cbk_97(2020) id 09e64cff-606a-49b6-bd8d-f4c19e45c803", - "key": "09e64cff-606a-49b6-bd8d-f4c19e45c803", - "label": "cbk_97(2020) metadata", - "value": "26539" - }, - { - "description": "Jurisdiction Metadata for cbk_20(2020) id ae9362fd-87b1-4aca-a29c-9bcbd4a07144", - "key": "ae9362fd-87b1-4aca-a29c-9bcbd4a07144", - "label": "cbk_20(2020) metadata", - "value": "26540" - }, - { - "description": "Jurisdiction Metadata for Chabilikila Zone id ca8d62fd-acec-4498-a041-03414c67efc8", - "key": "ca8d62fd-acec-4498-a041-03414c67efc8", - "label": "Chabilikila Zone metadata", - "value": "26541" - }, - { - "description": "Jurisdiction Metadata for cbk_5(2020) id 74c56c2d-b59b-49c0-89cb-c328ef409e50", - "key": "74c56c2d-b59b-49c0-89cb-c328ef409e50", - "label": "cbk_5(2020) metadata", - "value": "26542" - }, - { - "description": "Jurisdiction Metadata for MuKanso Zone id e3472ceb-55f0-4675-8568-49d4239fb94e", - "key": "e3472ceb-55f0-4675-8568-49d4239fb94e", - "label": "MuKanso Zone metadata", - "value": "26543" - }, - { - "description": "Jurisdiction Metadata for cbk_17(2020) id dde833ff-f816-49e2-9ba4-81838a5eacbf", - "key": "dde833ff-f816-49e2-9ba4-81838a5eacbf", - "label": "cbk_17(2020) metadata", - "value": "26544" - }, - { - "description": "Jurisdiction Metadata for cbk_4(2020) id a81c1446-9eba-4d33-bccb-a2eb2577376a", - "key": "a81c1446-9eba-4d33-bccb-a2eb2577376a", - "label": "cbk_4(2020) metadata", - "value": "26545" - }, - { - "description": "Jurisdiction Metadata for cbk_37(2020) id 58bda4a3-1017-4468-8d0f-60078f89d012", - "key": "58bda4a3-1017-4468-8d0f-60078f89d012", - "label": "cbk_37(2020) metadata", - "value": "26546" - }, - { - "description": "Jurisdiction Metadata for Kanwabatondo Zone id 5d423302-8850-46e4-bf4d-08df9f33f347", - "key": "5d423302-8850-46e4-bf4d-08df9f33f347", - "label": "Kanwabatondo Zone metadata", - "value": "26547" - }, - { - "description": "Jurisdiction Metadata for cbk_99(2020) id 7d3102dd-dd6a-4ebc-b0b9-334ca9489224", - "key": "7d3102dd-dd6a-4ebc-b0b9-334ca9489224", - "label": "cbk_99(2020) metadata", - "value": "26548" - }, - { - "description": "Jurisdiction Metadata for cbk_42(2020) id 6a661823-208c-4abd-b9f8-e40351a50e80", - "key": "6a661823-208c-4abd-b9f8-e40351a50e80", - "label": "cbk_42(2020) metadata", - "value": "26549" - }, - { - "description": "Jurisdiction Metadata for cbk_88(2020) id f0d2db60-fffb-4057-9873-16569882ed56", - "key": "f0d2db60-fffb-4057-9873-16569882ed56", - "label": "cbk_88(2020) metadata", - "value": "26550" - }, - { - "description": "Jurisdiction Metadata for cbk_32(2020) id d184ac9d-36ce-470d-b7cd-f0c602347f02", - "key": "d184ac9d-36ce-470d-b7cd-f0c602347f02", - "label": "cbk_32(2020) metadata", - "value": "26551" - }, - { - "description": "Jurisdiction Metadata for cbk_63(2020) id d3be8346-b0c5-4894-84d5-894be2061d9e", - "key": "d3be8346-b0c5-4894-84d5-894be2061d9e", - "label": "cbk_63(2020) metadata", - "value": "26552" - }, - { - "description": "Jurisdiction Metadata for cbk_46(2020) id 4b8b498c-51d2-433e-b1ae-fbf9796a3685", - "key": "4b8b498c-51d2-433e-b1ae-fbf9796a3685", - "label": "cbk_46(2020) metadata", - "value": "26553" - }, - { - "description": "Jurisdiction Metadata for cbk_78(2020) id e9242454-6c7e-413a-a3df-3c48ba0f3000", - "key": "e9242454-6c7e-413a-a3df-3c48ba0f3000", - "label": "cbk_78(2020) metadata", - "value": "26554" - }, - { - "description": "Jurisdiction Metadata for cbk_107(2020) id 74ed2420-1945-4ddf-b6ba-f2d8b6f42521", - "key": "74ed2420-1945-4ddf-b6ba-f2d8b6f42521", - "label": "cbk_107(2020) metadata", - "value": "26555" - }, - { - "description": "Jurisdiction Metadata for cbk_47(2020) id df199277-154c-4f17-8afe-5bd88a39d0dd", - "key": "df199277-154c-4f17-8afe-5bd88a39d0dd", - "label": "cbk_47(2020) metadata", - "value": "26556" - }, - { - "description": "Jurisdiction Metadata for cbk_81(2020) id 4e028650-9de0-4fde-a308-48380b868d2a", - "key": "4e028650-9de0-4fde-a308-48380b868d2a", - "label": "cbk_81(2020) metadata", - "value": "26557" - }, - { - "description": "Jurisdiction Metadata for cbk_24(2020) id cb5afbe2-2c8a-40f2-ae30-8c95dc1bc0e3", - "key": "cb5afbe2-2c8a-40f2-ae30-8c95dc1bc0e3", - "label": "cbk_24(2020) metadata", - "value": "26558" - }, - { - "description": "Jurisdiction Metadata for cbk_71(2020) id f2b2cc84-cfcf-4ea8-a342-c1908045d9e0", - "key": "f2b2cc84-cfcf-4ea8-a342-c1908045d9e0", - "label": "cbk_71(2020) metadata", - "value": "26559" - }, - { - "description": "Jurisdiction Metadata for cbk_45(2020) id 319f3744-77d2-4489-bdc8-666d72c3b98b", - "key": "319f3744-77d2-4489-bdc8-666d72c3b98b", - "label": "cbk_45(2020) metadata", - "value": "26560" - }, - { - "description": "Jurisdiction Metadata for cbk_74(2020) id 7827c0b4-706a-49a6-bd3f-abb18e46ef74", - "key": "7827c0b4-706a-49a6-bd3f-abb18e46ef74", - "label": "cbk_74(2020) metadata", - "value": "26561" - }, - { - "description": "Jurisdiction Metadata for cbk_52(2020) id 86d3dcf7-20fa-453e-8b6b-940e8fd505fc", - "key": "86d3dcf7-20fa-453e-8b6b-940e8fd505fc", - "label": "cbk_52(2020) metadata", - "value": "26562" - }, - { - "description": "Jurisdiction Metadata for cbk_104(2020) id 26732a17-8996-41e2-9a5d-927912121402", - "key": "26732a17-8996-41e2-9a5d-927912121402", - "label": "cbk_104(2020) metadata", - "value": "26563" - }, - { - "description": "Jurisdiction Metadata for cbk_3(2020) id c6db60c9-338a-4b96-b6d3-5c22626cbfa7", - "key": "c6db60c9-338a-4b96-b6d3-5c22626cbfa7", - "label": "cbk_3(2020) metadata", - "value": "26564" - }, - { - "description": "Jurisdiction Metadata for cbk_69(2020) id 7fbf6dab-e037-4af3-b7b2-f55017b02548", - "key": "7fbf6dab-e037-4af3-b7b2-f55017b02548", - "label": "cbk_69(2020) metadata", - "value": "26565" - }, - { - "description": "Jurisdiction Metadata for cbk_80(2020) id 32d56fb9-e351-4266-8654-429d221fdbf4", - "key": "32d56fb9-e351-4266-8654-429d221fdbf4", - "label": "cbk_80(2020) metadata", - "value": "26566" - }, - { - "description": "Jurisdiction Metadata for cbk_25(2020) id ac62e6f9-ae3d-4f62-be4e-0a41449dc281", - "key": "ac62e6f9-ae3d-4f62-be4e-0a41449dc281", - "label": "cbk_25(2020) metadata", - "value": "26567" - }, - { - "description": "Jurisdiction Metadata for cbk_68(2020) id 3e7a8a97-56bb-444f-84bb-9b24f2f23173", - "key": "3e7a8a97-56bb-444f-84bb-9b24f2f23173", - "label": "cbk_68(2020) metadata", - "value": "26568" - }, - { - "description": "Jurisdiction Metadata for cbk_91(2020) id 4bfdb8b9-8f1d-481d-8659-ccd03a6a07cb", - "key": "4bfdb8b9-8f1d-481d-8659-ccd03a6a07cb", - "label": "cbk_91(2020) metadata", - "value": "26569" - }, - { - "description": "Jurisdiction Metadata for cbk_21(2020) id 0cd8956e-5bfd-4bbf-9e89-a3394a4541c0", - "key": "0cd8956e-5bfd-4bbf-9e89-a3394a4541c0", - "label": "cbk_21(2020) metadata", - "value": "26570" - }, - { - "description": "Jurisdiction Metadata for cbk_12(2020) id fa131f94-67d6-4c36-aed9-984be5ef3301", - "key": "fa131f94-67d6-4c36-aed9-984be5ef3301", - "label": "cbk_12(2020) metadata", - "value": "26571" - }, - { - "description": "Jurisdiction Metadata for cbk_30(2020) id 2426ceea-e811-420a-a3b7-0b7d173d12d8", - "key": "2426ceea-e811-420a-a3b7-0b7d173d12d8", - "label": "cbk_30(2020) metadata", - "value": "26572" - }, - { - "description": "Jurisdiction Metadata for cbk_49(2020) id 414c14de-712b-4139-8fc7-b77a2fa7e3d8", - "key": "414c14de-712b-4139-8fc7-b77a2fa7e3d8", - "label": "cbk_49(2020) metadata", - "value": "26573" - }, - { - "description": "Jurisdiction Metadata for cbk_76(2020) id e54b9f10-83fe-4c53-bc0e-515e0780834c", - "key": "e54b9f10-83fe-4c53-bc0e-515e0780834c", - "label": "cbk_76(2020) metadata", - "value": "26574" - }, - { - "description": "Jurisdiction Metadata for cbk_39(2020) id 301e0d4f-f8da-47f9-a898-0e68306c3526", - "key": "301e0d4f-f8da-47f9-a898-0e68306c3526", - "label": "cbk_39(2020) metadata", - "value": "26575" - }, - { - "description": "Jurisdiction Metadata for cbk_14(2020) id d9a2be7f-f8b1-4f44-887b-f995b6017888", - "key": "d9a2be7f-f8b1-4f44-887b-f995b6017888", - "label": "cbk_14(2020) metadata", - "value": "26576" - }, - { - "description": "Jurisdiction Metadata for cbk_16(2020) id 0591c921-cdc4-40e1-9251-79cb68eb0716", - "key": "0591c921-cdc4-40e1-9251-79cb68eb0716", - "label": "cbk_16(2020) metadata", - "value": "26577" - }, - { - "description": "Jurisdiction Metadata for cbk_61(2020) id 10370483-b99b-4697-95a9-d1c4739ae5e7", - "key": "10370483-b99b-4697-95a9-d1c4739ae5e7", - "label": "cbk_61(2020) metadata", - "value": "26578" - }, - { - "description": "Jurisdiction Metadata for cbk_102(2020) id 4e17c1c4-2e52-4a7c-817f-bae84d1657d4", - "key": "4e17c1c4-2e52-4a7c-817f-bae84d1657d4", - "label": "cbk_102(2020) metadata", - "value": "26579" - }, - { - "description": "Jurisdiction Metadata for cbk_15(2020) id 909f6428-367a-4c9d-9db0-4434c0ee415d", - "key": "909f6428-367a-4c9d-9db0-4434c0ee415d", - "label": "cbk_15(2020) metadata", - "value": "26580" - }, - { - "description": "Jurisdiction Metadata for cbk_66(2020) id c8deda71-be46-4d91-b8ec-7853f5dbec8e", - "key": "c8deda71-be46-4d91-b8ec-7853f5dbec8e", - "label": "cbk_66(2020) metadata", - "value": "26581" - }, - { - "description": "Jurisdiction Metadata for cbk_75(2020) id fef72d8c-dbfc-42f0-9998-f67ac15737ac", - "key": "fef72d8c-dbfc-42f0-9998-f67ac15737ac", - "label": "cbk_75(2020) metadata", - "value": "26582" - }, - { - "description": "Jurisdiction Metadata for cbk_73(2020) id 7721f148-d0e1-415a-a1e7-bdcdb531733c", - "key": "7721f148-d0e1-415a-a1e7-bdcdb531733c", - "label": "cbk_73(2020) metadata", - "value": "26583" - }, - { - "description": "Jurisdiction Metadata for cbk_101(2020) id 91556ed6-89d1-4353-a0a3-df6431c0a17f", - "key": "91556ed6-89d1-4353-a0a3-df6431c0a17f", - "label": "cbk_101(2020) metadata", - "value": "26584" - }, - { - "description": "Jurisdiction Metadata for cbk_10(2020) id 98482deb-7352-406a-aae8-673d745c5563", - "key": "98482deb-7352-406a-aae8-673d745c5563", - "label": "cbk_10(2020) metadata", - "value": "26585" - }, - { - "description": "Jurisdiction Metadata for cbk_79(2020) id f36ed917-285c-46c0-813a-f1c6b343700e", - "key": "f36ed917-285c-46c0-813a-f1c6b343700e", - "label": "cbk_79(2020) metadata", - "value": "26586" - }, - { - "description": "Jurisdiction Metadata for cbk_11(2020) id 99762ee5-f781-452d-b48b-8a747d29d997", - "key": "99762ee5-f781-452d-b48b-8a747d29d997", - "label": "cbk_11(2020) metadata", - "value": "26587" - }, - { - "description": "Jurisdiction Metadata for cbk_2(2020) id 21b537cf-da23-419b-a674-8ea33b1c80d0", - "key": "21b537cf-da23-419b-a674-8ea33b1c80d0", - "label": "cbk_2(2020) metadata", - "value": "26588" - }, - { - "description": "Jurisdiction Metadata for cbk_100(2020) id 4391debd-e4f9-4170-b1d0-952195b918db", - "key": "4391debd-e4f9-4170-b1d0-952195b918db", - "label": "cbk_100(2020) metadata", - "value": "26589" - }, - { - "description": "Jurisdiction Metadata for cbk_56(2020) id 19da2265-6d2b-4486-a776-6deb5c9d6d67", - "key": "19da2265-6d2b-4486-a776-6deb5c9d6d67", - "label": "cbk_56(2020) metadata", - "value": "26590" - }, - { - "description": "Jurisdiction Metadata for cbk_77(2020) id 43960be5-a9e3-4fab-94c3-b3e98397bed0", - "key": "43960be5-a9e3-4fab-94c3-b3e98397bed0", - "label": "cbk_77(2020) metadata", - "value": "26591" - }, - { - "description": "Jurisdiction Metadata for cbk_54(2020) id 790ecf1b-6084-44e9-8af5-79087dc0ca1e", - "key": "790ecf1b-6084-44e9-8af5-79087dc0ca1e", - "label": "cbk_54(2020) metadata", - "value": "26592" - }, - { - "description": "Jurisdiction Metadata for cbk_64(2020) id 23c7b073-05ed-43bd-9a1b-55e2f7b76091", - "key": "23c7b073-05ed-43bd-9a1b-55e2f7b76091", - "label": "cbk_64(2020) metadata", - "value": "26593" - }, - { - "description": "Jurisdiction Metadata for cbk_82(2020) id cd6b2586-0b49-45db-8ca4-83a630f785e6", - "key": "cd6b2586-0b49-45db-8ca4-83a630f785e6", - "label": "cbk_82(2020) metadata", - "value": "26594" - }, - { - "description": "Jurisdiction Metadata for cbk_31(2020) id 0c9cf38b-1274-4984-aa21-86e0dbe9e48d", - "key": "0c9cf38b-1274-4984-aa21-86e0dbe9e48d", - "label": "cbk_31(2020) metadata", - "value": "26595" - }, - { - "description": "Jurisdiction Metadata for cbk_34(2020) id ccfd0011-486d-450a-a3d5-fd8a6002e85b", - "key": "ccfd0011-486d-450a-a3d5-fd8a6002e85b", - "label": "cbk_34(2020) metadata", - "value": "26596" - }, - { - "description": "Jurisdiction Metadata for cbk_67(2020) id e110f949-6a65-43d2-945f-592c031487ad", - "key": "e110f949-6a65-43d2-945f-592c031487ad", - "label": "cbk_67(2020) metadata", - "value": "26597" - }, - { - "description": "Jurisdiction Metadata for cbk_62(2020) id 36a9f848-e698-4698-a5a5-555c1eac6b5c", - "key": "36a9f848-e698-4698-a5a5-555c1eac6b5c", - "label": "cbk_62(2020) metadata", - "value": "26598" - }, - { - "description": "Jurisdiction Metadata for cbk_94(2020) id 87c7223b-8792-40d4-8faf-973deefde823", - "key": "87c7223b-8792-40d4-8faf-973deefde823", - "label": "cbk_94(2020) metadata", - "value": "26599" - }, - { - "description": "Jurisdiction Metadata for cbk_89(2020) id 98784605-7089-491d-ba76-53345b61aa5e", - "key": "98784605-7089-491d-ba76-53345b61aa5e", - "label": "cbk_89(2020) metadata", - "value": "26600" - }, - { - "description": "Jurisdiction Metadata for cbk_96(2020) id 5bafc343-86d9-4be7-b89f-10ceb1a9aa93", - "key": "5bafc343-86d9-4be7-b89f-10ceb1a9aa93", - "label": "cbk_96(2020) metadata", - "value": "26601" - }, - { - "description": "Jurisdiction Metadata for cbk_1(2020) id a2740880-e297-4d10-bc10-e74a4cb1dca5", - "key": "a2740880-e297-4d10-bc10-e74a4cb1dca5", - "label": "cbk_1(2020) metadata", - "value": "26602" - }, - { - "description": "Jurisdiction Metadata for cbk_106(2020) id 828db9a5-0ed0-40ea-b947-c08329712a0c", - "key": "828db9a5-0ed0-40ea-b947-c08329712a0c", - "label": "cbk_106(2020) metadata", - "value": "26603" - }, - { - "description": "Jurisdiction Metadata for cbk_51(2020) id 61eb4350-c651-4e96-ae35-5b07e28bd000", - "key": "61eb4350-c651-4e96-ae35-5b07e28bd000", - "label": "cbk_51(2020) metadata", - "value": "26604" - }, - { - "description": "Jurisdiction Metadata for cbk_72(2020) id fb8c567e-1527-4cfc-a928-928bd16a8ac8", - "key": "fb8c567e-1527-4cfc-a928-928bd16a8ac8", - "label": "cbk_72(2020) metadata", - "value": "26605" - }, - { - "description": "Jurisdiction Metadata for Chipulumshi Zone id 083d6f1b-e68e-45cd-8e82-4b6a9e7d3ac9", - "key": "083d6f1b-e68e-45cd-8e82-4b6a9e7d3ac9", - "label": "Chipulumshi Zone metadata", - "value": "26606" - }, - { - "description": "Jurisdiction Metadata for cbk_7(2020) id 63f6b0af-4789-4906-832f-bca64421d5d2", - "key": "63f6b0af-4789-4906-832f-bca64421d5d2", - "label": "cbk_7(2020) metadata", - "value": "26607" - }, - { - "description": "Jurisdiction Metadata for Chibwili Zone id 85fbf91a-2405-4689-a71e-7139b4af190b", - "key": "85fbf91a-2405-4689-a71e-7139b4af190b", - "label": "Chibwili Zone metadata", - "value": "26608" - }, - { - "description": "Jurisdiction Metadata for cbk_6(2020) id 66d51d27-5f1c-452c-be47-5c6a9a16ea95", - "key": "66d51d27-5f1c-452c-be47-5c6a9a16ea95", - "label": "cbk_6(2020) metadata", - "value": "26609" - }, - { - "description": "Jurisdiction Metadata for Kapololoka Zone id 398d0b3e-9972-4dfb-8292-b024929dc4b9", - "key": "398d0b3e-9972-4dfb-8292-b024929dc4b9", - "label": "Kapololoka Zone metadata", - "value": "26610" - }, - { - "description": "Jurisdiction Metadata for cbk_55(2020) id a85d218d-87de-4e51-95fd-450bd7c3210d", - "key": "a85d218d-87de-4e51-95fd-450bd7c3210d", - "label": "cbk_55(2020) metadata", - "value": "26611" - }, - { - "description": "Jurisdiction Metadata for Chungu Zone id 5470d5b9-013e-486b-a32d-1ec40a0fbf2b", - "key": "5470d5b9-013e-486b-a32d-1ec40a0fbf2b", - "label": "Chungu Zone metadata", - "value": "26612" - }, - { - "description": "Jurisdiction Metadata for cbk_87(2020) id 7126b523-85dc-44a2-9b5d-a7288bbf58b8", - "key": "7126b523-85dc-44a2-9b5d-a7288bbf58b8", - "label": "cbk_87(2020) metadata", - "value": "26613" - }, - { - "description": "Jurisdiction Metadata for cbk_28(2020) id 642e6bdf-3db9-4588-a84e-fb362d65b361", - "key": "642e6bdf-3db9-4588-a84e-fb362d65b361", - "label": "cbk_28(2020) metadata", - "value": "26614" - }, - { - "description": "Jurisdiction Metadata for cbk_18(2020) id 4c0586fb-1e77-4439-accc-7a207a69aea0", - "key": "4c0586fb-1e77-4439-accc-7a207a69aea0", - "label": "cbk_18(2020) metadata", - "value": "26615" - }, - { - "description": "Jurisdiction Metadata for cbk_84(2020) id 3b12639e-f08f-41a1-bb59-08cd972fd1d3", - "key": "3b12639e-f08f-41a1-bb59-08cd972fd1d3", - "label": "cbk_84(2020) metadata", - "value": "26616" - }, - { - "description": "Jurisdiction Metadata for cbk_59(2020) id 7da4bfb0-33f4-45f0-9d7c-4cf40f236211", - "key": "7da4bfb0-33f4-45f0-9d7c-4cf40f236211", - "label": "cbk_59(2020) metadata", - "value": "26617" - }, - { - "description": "Jurisdiction Metadata for cbk_83(2020) id 77250e91-98cb-4d78-a2e3-de507d6973a8", - "key": "77250e91-98cb-4d78-a2e3-de507d6973a8", - "label": "cbk_83(2020) metadata", - "value": "26618" - }, - { - "description": "Jurisdiction Metadata for cbk_22(2020) id 489c9cae-d059-4f01-bdfd-a946ba426422", - "key": "489c9cae-d059-4f01-bdfd-a946ba426422", - "label": "cbk_22(2020) metadata", - "value": "26619" - }, - { - "description": "Jurisdiction Metadata for cbk_27(2020) id 1ff4f0ea-9975-4e4d-a145-7304e584d735", - "key": "1ff4f0ea-9975-4e4d-a145-7304e584d735", - "label": "cbk_27(2020) metadata", - "value": "26620" - }, - { - "description": "Jurisdiction Metadata for cbk_13(2020) id 065bb56a-e58e-46c1-8d93-9ceab667123e", - "key": "065bb56a-e58e-46c1-8d93-9ceab667123e", - "label": "cbk_13(2020) metadata", - "value": "26621" - }, - { - "description": "Jurisdiction Metadata for cbk_58(2020) id 69df6fe5-c4c7-4fb3-8945-0268463c8821", - "key": "69df6fe5-c4c7-4fb3-8945-0268463c8821", - "label": "cbk_58(2020) metadata", - "value": "26622" - }, - { - "description": "Jurisdiction Metadata for cbk_98(2020) id c7267ed1-2eb0-4ad0-a61b-067304061ea9", - "key": "c7267ed1-2eb0-4ad0-a61b-067304061ea9", - "label": "cbk_98(2020) metadata", - "value": "26623" - }, - { - "description": "Jurisdiction Metadata for cbk_36(2020) id 5ff0e35c-8675-4015-9cce-0fff49c42e8b", - "key": "5ff0e35c-8675-4015-9cce-0fff49c42e8b", - "label": "cbk_36(2020) metadata", - "value": "26624" - }, - { - "description": "Jurisdiction Metadata for cbk_23(2020) id 137dc0d4-96ef-4996-8b90-779ea9ed8918", - "key": "137dc0d4-96ef-4996-8b90-779ea9ed8918", - "label": "cbk_23(2020) metadata", - "value": "26625" - }, - { - "description": "Jurisdiction Metadata for Chebele Zone id c4158059-01a0-4fd7-839d-ce30b98f47f1", - "key": "c4158059-01a0-4fd7-839d-ce30b98f47f1", - "label": "Chebele Zone metadata", - "value": "26626" - }, - { - "description": "Jurisdiction Metadata for cbk_8(2020) id e691ab21-ef44-4aa0-aa07-fd2fd052c072", - "key": "e691ab21-ef44-4aa0-aa07-fd2fd052c072", - "label": "cbk_8(2020) metadata", - "value": "26627" - }, - { - "description": "Jurisdiction Metadata for Tokatoka(2020) id c5adc183-46fa-4087-b066-a8da4f7d0550", - "key": "c5adc183-46fa-4087-b066-a8da4f7d0550", - "label": "Tokatoka(2020) metadata", - "value": "26628" - }, - { - "description": "Jurisdiction Metadata for Kasakula Zone id f61fcf2b-7bc7-4ecb-bd68-c379c0b357fc", - "key": "f61fcf2b-7bc7-4ecb-bd68-c379c0b357fc", - "label": "Kasakula Zone metadata", - "value": "26629" - }, - { - "description": "Jurisdiction Metadata for tkt_5(2020) id 99eb6799-5310-401f-a2e5-0f1fa18844be", - "key": "99eb6799-5310-401f-a2e5-0f1fa18844be", - "label": "tkt_5(2020) metadata", - "value": "26630" - }, - { - "description": "Jurisdiction Metadata for Chisambo Zone id 4e5303b2-d3e0-4450-946b-fff1d459ffc6", - "key": "4e5303b2-d3e0-4450-946b-fff1d459ffc6", - "label": "Chisambo Zone metadata", - "value": "26631" - }, - { - "description": "Jurisdiction Metadata for tkt_4(2020) id 7d9edcd1-8e55-484d-b5d2-8114c721c618", - "key": "7d9edcd1-8e55-484d-b5d2-8114c721c618", - "label": "tkt_4(2020) metadata", - "value": "26632" - }, - { - "description": "Jurisdiction Metadata for Mfunduaula Zone id b4da57d2-922f-4d63-91dd-0c737d1bc129", - "key": "b4da57d2-922f-4d63-91dd-0c737d1bc129", - "label": "Mfunduaula Zone metadata", - "value": "26633" - }, - { - "description": "Jurisdiction Metadata for tkt_2(2020) id 2702bc39-77d9-43db-b8bb-498e3d6f14d4", - "key": "2702bc39-77d9-43db-b8bb-498e3d6f14d4", - "label": "tkt_2(2020) metadata", - "value": "26634" - }, - { - "description": "Jurisdiction Metadata for Tokatoka Zone id 5d86fd64-0330-40fb-bb6b-a7c5e7d7b39d", - "key": "5d86fd64-0330-40fb-bb6b-a7c5e7d7b39d", - "label": "Tokatoka Zone metadata", - "value": "26635" - }, - { - "description": "Jurisdiction Metadata for tkt_1(2020) id acc0c267-1c3a-4d12-9359-baac3f63d1b3", - "key": "acc0c267-1c3a-4d12-9359-baac3f63d1b3", - "label": "tkt_1(2020) metadata", - "value": "26636" - }, - { - "description": "Jurisdiction Metadata for Kanaya Zone id 350a02b9-72ca-4f85-9f53-4a4f6392fd74", - "key": "350a02b9-72ca-4f85-9f53-4a4f6392fd74", - "label": "Kanaya Zone metadata", - "value": "26637" - }, - { - "description": "Jurisdiction Metadata for tkt_7(2020) id 1109d291-e2f5-4646-b7b2-352511389020", - "key": "1109d291-e2f5-4646-b7b2-352511389020", - "label": "tkt_7(2020) metadata", - "value": "26638" - }, - { - "description": "Jurisdiction Metadata for tkt_3(2020) id 1c7e1eb4-90e3-45ab-98c7-ca8d51023493", - "key": "1c7e1eb4-90e3-45ab-98c7-ca8d51023493", - "label": "tkt_3(2020) metadata", - "value": "26639" - }, - { - "description": "Jurisdiction Metadata for tkt_11(2020) id 0d06d624-59c3-46b7-b687-0b21571acbe0", - "key": "0d06d624-59c3-46b7-b687-0b21571acbe0", - "label": "tkt_11(2020) metadata", - "value": "26640" - }, - { - "description": "Jurisdiction Metadata for tkt_10(2020) id a94c15b6-b386-4684-90f3-19b7397b186a", - "key": "a94c15b6-b386-4684-90f3-19b7397b186a", - "label": "tkt_10(2020) metadata", - "value": "26641" - }, - { - "description": "Jurisdiction Metadata for tkt_6(2020) id 6f855136-5af0-4833-a670-74e53597d578", - "key": "6f855136-5af0-4833-a670-74e53597d578", - "label": "tkt_6(2020) metadata", - "value": "26642" - }, - { - "description": "Jurisdiction Metadata for tkt_9(2020) id 8aed91d4-6a45-4dcd-b24d-45d0ac970486", - "key": "8aed91d4-6a45-4dcd-b24d-45d0ac970486", - "label": "tkt_9(2020) metadata", - "value": "26643" - }, - { - "description": "Jurisdiction Metadata for tkt_8(2020) id 7bc96358-2a34-4bb3-9ed3-8a2c3724fd10", - "key": "7bc96358-2a34-4bb3-9ed3-8a2c3724fd10", - "label": "tkt_8(2020) metadata", - "value": "26644" - }, - { - "description": "Jurisdiction Metadata for Lushiba(2020) id 66093100-8d38-45ed-ba39-04fe93714273", - "key": "66093100-8d38-45ed-ba39-04fe93714273", - "label": "Lushiba(2020) metadata", - "value": "26645" - }, - { - "description": "Jurisdiction Metadata for Kabulo Zone id 698bc35c-a483-4117-b225-059c2af68d95", - "key": "698bc35c-a483-4117-b225-059c2af68d95", - "label": "Kabulo Zone metadata", - "value": "26646" - }, - { - "description": "Jurisdiction Metadata for lsh_2(2020) id fe8e3485-8915-49ad-a067-36eb93b7f2e0", - "key": "fe8e3485-8915-49ad-a067-36eb93b7f2e0", - "label": "lsh_2(2020) metadata", - "value": "26647" - }, - { - "description": "Jurisdiction Metadata for Shikapamdi id 96b036b5-71f2-4853-b5c6-dca6ab0126c0", - "key": "96b036b5-71f2-4853-b5c6-dca6ab0126c0", - "label": "Shikapamdi metadata", - "value": "26648" - }, - { - "description": "Jurisdiction Metadata for lsh_9(2020) id 29a13bfe-72e3-4c0f-ab5c-f867a93df5d1", - "key": "29a13bfe-72e3-4c0f-ab5c-f867a93df5d1", - "label": "lsh_9(2020) metadata", - "value": "26649" - }, - { - "description": "Jurisdiction Metadata for lsh_10(2020) id d623eefa-e3ea-44eb-9b52-dafdf1fe0f36", - "key": "d623eefa-e3ea-44eb-9b52-dafdf1fe0f36", - "label": "lsh_10(2020) metadata", - "value": "26650" - }, - { - "description": "Jurisdiction Metadata for lsh_8(2020) id d8b45f5a-507b-4dd8-8cf4-6bfb7230af2c", - "key": "d8b45f5a-507b-4dd8-8cf4-6bfb7230af2c", - "label": "lsh_8(2020) metadata", - "value": "26651" - }, - { - "description": "Jurisdiction Metadata for Lushiba Zone id c7c87812-0e8b-47f5-911d-0ced9ac879cb", - "key": "c7c87812-0e8b-47f5-911d-0ced9ac879cb", - "label": "Lushiba Zone metadata", - "value": "26652" - }, - { - "description": "Jurisdiction Metadata for lsh_3(2020) id b75125c0-b111-4bab-b4f9-c8b1e8980c62", - "key": "b75125c0-b111-4bab-b4f9-c8b1e8980c62", - "label": "lsh_3(2020) metadata", - "value": "26653" - }, - { - "description": "Jurisdiction Metadata for lsh_6(2020) id 5b4e3a67-6a2c-4649-8761-c68d43786a9e", - "key": "5b4e3a67-6a2c-4649-8761-c68d43786a9e", - "label": "lsh_6(2020) metadata", - "value": "26654" - }, - { - "description": "Jurisdiction Metadata for Shindoni Zone 1 id 82b0767e-b0f1-4137-bf8c-fc0dff1a9e86", - "key": "82b0767e-b0f1-4137-bf8c-fc0dff1a9e86", - "label": "Shindoni Zone 1 metadata", - "value": "26655" - }, - { - "description": "Jurisdiction Metadata for lsh_5(2020) id 4e604c83-090b-42fe-a4bf-80ae05590012", - "key": "4e604c83-090b-42fe-a4bf-80ae05590012", - "label": "lsh_5(2020) metadata", - "value": "26656" - }, - { - "description": "Jurisdiction Metadata for lsh_11(2020) id d0e8c31a-a361-42c0-89ee-f60e806e9fdd", - "key": "d0e8c31a-a361-42c0-89ee-f60e806e9fdd", - "label": "lsh_11(2020) metadata", - "value": "26657" - }, - { - "description": "Jurisdiction Metadata for Shishibeti Zone id 31c30222-f2db-44c1-8c0c-c8bfe552424e", - "key": "31c30222-f2db-44c1-8c0c-c8bfe552424e", - "label": "Shishibeti Zone metadata", - "value": "26658" - }, - { - "description": "Jurisdiction Metadata for lsh_4(2020) id 379d0260-aab2-4baf-9df6-14d6a1f8493b", - "key": "379d0260-aab2-4baf-9df6-14d6a1f8493b", - "label": "lsh_4(2020) metadata", - "value": "26659" - }, - { - "description": "Jurisdiction Metadata for lsh_7(2020) id 8de9d0ec-9ca2-4826-8bb3-bedb97ec71b3", - "key": "8de9d0ec-9ca2-4826-8bb3-bedb97ec71b3", - "label": "lsh_7(2020) metadata", - "value": "26660" - }, - { - "description": "Jurisdiction Metadata for lsh_1(2020) id d9fde01f-384a-44cc-b196-56a502382a70", - "key": "d9fde01f-384a-44cc-b196-56a502382a70", - "label": "lsh_1(2020) metadata", - "value": "26661" - }, - { - "description": "Jurisdiction Metadata for Kabalenge(2020) id e9f1bf67-4333-4285-82ac-9a06a25b17c8", - "key": "e9f1bf67-4333-4285-82ac-9a06a25b17c8", - "label": "Kabalenge(2020) metadata", - "value": "26662" - }, - { - "description": "Jurisdiction Metadata for Kasumpa Zone id a022fe10-4353-461e-836b-2cb2b1158609", - "key": "a022fe10-4353-461e-836b-2cb2b1158609", - "label": "Kasumpa Zone metadata", - "value": "26663" - }, - { - "description": "Jurisdiction Metadata for kbl_15(2020) id f2aaf67d-434c-404a-8e25-eee634d5910f", - "key": "f2aaf67d-434c-404a-8e25-eee634d5910f", - "label": "kbl_15(2020) metadata", - "value": "26664" - }, - { - "description": "Jurisdiction Metadata for kbl_53(2020) id dd03d8b7-c830-468d-a030-2c5499d69693", - "key": "dd03d8b7-c830-468d-a030-2c5499d69693", - "label": "kbl_53(2020) metadata", - "value": "26665" - }, - { - "description": "Jurisdiction Metadata for kbl_94(2020) id d27fe023-aa45-49af-9a67-7ff87ddda6a5", - "key": "d27fe023-aa45-49af-9a67-7ff87ddda6a5", - "label": "kbl_94(2020) metadata", - "value": "26666" - }, - { - "description": "Jurisdiction Metadata for kbl_1(2020) id c0b3c670-0976-478b-8fbb-e10da2e524bd", - "key": "c0b3c670-0976-478b-8fbb-e10da2e524bd", - "label": "kbl_1(2020) metadata", - "value": "26667" - }, - { - "description": "Jurisdiction Metadata for kbl_6(2020) id a7a7b628-1a03-4e52-b0b6-ad803529f87c", - "key": "a7a7b628-1a03-4e52-b0b6-ad803529f87c", - "label": "kbl_6(2020) metadata", - "value": "26668" - }, - { - "description": "Jurisdiction Metadata for kbl_90(2020) id fbcd6985-4418-4116-8a5b-7aeb308e427c", - "key": "fbcd6985-4418-4116-8a5b-7aeb308e427c", - "label": "kbl_90(2020) metadata", - "value": "26669" - }, - { - "description": "Jurisdiction Metadata for kbl_50(2020) id fc3bd106-fc32-4c8d-9787-85cb0875f81f", - "key": "fc3bd106-fc32-4c8d-9787-85cb0875f81f", - "label": "kbl_50(2020) metadata", - "value": "26670" - }, - { - "description": "Jurisdiction Metadata for kbl_55(2020) id a3bed780-4e0a-481b-a069-5375d431ffdb", - "key": "a3bed780-4e0a-481b-a069-5375d431ffdb", - "label": "kbl_55(2020) metadata", - "value": "26671" - }, - { - "description": "Jurisdiction Metadata for kbl_19(2020) id 0276b47c-4773-4052-8e0a-16d66840b5a2", - "key": "0276b47c-4773-4052-8e0a-16d66840b5a2", - "label": "kbl_19(2020) metadata", - "value": "26672" - }, - { - "description": "Jurisdiction Metadata for kbl_7(2020) id e560111e-f4f9-444e-bdc6-ac655c2c0cd1", - "key": "e560111e-f4f9-444e-bdc6-ac655c2c0cd1", - "label": "kbl_7(2020) metadata", - "value": "26673" - }, - { - "description": "Jurisdiction Metadata for Chibeka Zone id a8ae5848-52f7-4b02-b17f-1a37a77a3aa2", - "key": "a8ae5848-52f7-4b02-b17f-1a37a77a3aa2", - "label": "Chibeka Zone metadata", - "value": "26674" - }, - { - "description": "Jurisdiction Metadata for kbl_71(2020) id db94256f-e8a0-4d1c-aaf0-22100add8538", - "key": "db94256f-e8a0-4d1c-aaf0-22100add8538", - "label": "kbl_71(2020) metadata", - "value": "26675" - }, - { - "description": "Jurisdiction Metadata for kbl_35(2020) id 01409243-d160-4dfb-8060-51df560c8bdb", - "key": "01409243-d160-4dfb-8060-51df560c8bdb", - "label": "kbl_35(2020) metadata", - "value": "26676" - }, - { - "description": "Jurisdiction Metadata for Mangamu Zone id 7e278501-7335-43fa-8408-168621de1f22", - "key": "7e278501-7335-43fa-8408-168621de1f22", - "label": "Mangamu Zone metadata", - "value": "26677" - }, - { - "description": "Jurisdiction Metadata for kbl_12(2020) id 85e4f6dd-fe66-4308-afa1-6b05bfa1663d", - "key": "85e4f6dd-fe66-4308-afa1-6b05bfa1663d", - "label": "kbl_12(2020) metadata", - "value": "26678" - }, - { - "description": "Jurisdiction Metadata for kbl_2(2020) id c0186589-6002-45fb-a511-308fdaefba1f", - "key": "c0186589-6002-45fb-a511-308fdaefba1f", - "label": "kbl_2(2020) metadata", - "value": "26679" - }, - { - "description": "Jurisdiction Metadata for Chendaeka Zone id c60bfd2f-049d-4880-8045-fe4c5a31eb61", - "key": "c60bfd2f-049d-4880-8045-fe4c5a31eb61", - "label": "Chendaeka Zone metadata", - "value": "26680" - }, - { - "description": "Jurisdiction Metadata for kbl_22(2020) id aa0554b9-3ed8-4863-b639-534ee7c7ec2f", - "key": "aa0554b9-3ed8-4863-b639-534ee7c7ec2f", - "label": "kbl_22(2020) metadata", - "value": "26681" - }, - { - "description": "Jurisdiction Metadata for kbl_4(2020) id c169989a-2a54-4aeb-bc32-3ec4ee28192d", - "key": "c169989a-2a54-4aeb-bc32-3ec4ee28192d", - "label": "kbl_4(2020) metadata", - "value": "26682" - }, - { - "description": "Jurisdiction Metadata for kbl_26(2020) id 769ab213-542b-48e4-9af3-efcbb6b8836e", - "key": "769ab213-542b-48e4-9af3-efcbb6b8836e", - "label": "kbl_26(2020) metadata", - "value": "26683" - }, - { - "description": "Jurisdiction Metadata for Chama Zone id 62a460a9-21aa-4a5f-b018-477a48f5000b", - "key": "62a460a9-21aa-4a5f-b018-477a48f5000b", - "label": "Chama Zone metadata", - "value": "26684" - }, - { - "description": "Jurisdiction Metadata for kbl_23(2020) id 387f128a-153d-4f26-ba7e-7345f013ea7b", - "key": "387f128a-153d-4f26-ba7e-7345f013ea7b", - "label": "kbl_23(2020) metadata", - "value": "26685" - }, - { - "description": "Jurisdiction Metadata for kbl_36(2020) id 3c171df8-d1b3-429c-a3e4-51cc5509b4fc", - "key": "3c171df8-d1b3-429c-a3e4-51cc5509b4fc", - "label": "kbl_36(2020) metadata", - "value": "26686" - }, - { - "description": "Jurisdiction Metadata for kbl_29(2020) id 9c5997b8-b10b-4b5b-af18-b0b98374a951", - "key": "9c5997b8-b10b-4b5b-af18-b0b98374a951", - "label": "kbl_29(2020) metadata", - "value": "26687" - }, - { - "description": "Jurisdiction Metadata for kbl_54(2020) id fd9d6fd1-3fcc-452d-8125-3fba8ebe57ee", - "key": "fd9d6fd1-3fcc-452d-8125-3fba8ebe57ee", - "label": "kbl_54(2020) metadata", - "value": "26688" - }, - { - "description": "Jurisdiction Metadata for kbl_3(2020) id 1f91e77d-4691-4436-8689-fb78e2c6c6b4", - "key": "1f91e77d-4691-4436-8689-fb78e2c6c6b4", - "label": "kbl_3(2020) metadata", - "value": "26689" - }, - { - "description": "Jurisdiction Metadata for kbl_72(2020) id 8cdfdfb7-a4ea-43fd-bd0d-8a0e77bd7bcb", - "key": "8cdfdfb7-a4ea-43fd-bd0d-8a0e77bd7bcb", - "label": "kbl_72(2020) metadata", - "value": "26690" - }, - { - "description": "Jurisdiction Metadata for kbl_73(2020) id 0258ebf3-4716-4a08-bb15-2cf5c192a105", - "key": "0258ebf3-4716-4a08-bb15-2cf5c192a105", - "label": "kbl_73(2020) metadata", - "value": "26691" - }, - { - "description": "Jurisdiction Metadata for kbl_51(2020) id 7784d529-1f29-4b82-b23b-dadd8950732d", - "key": "7784d529-1f29-4b82-b23b-dadd8950732d", - "label": "kbl_51(2020) metadata", - "value": "26692" - }, - { - "description": "Jurisdiction Metadata for kbl_8(2020) id 1797bb36-fbfd-479e-93e4-c266e8f137c9", - "key": "1797bb36-fbfd-479e-93e4-c266e8f137c9", - "label": "kbl_8(2020) metadata", - "value": "26693" - }, - { - "description": "Jurisdiction Metadata for kbl_13(2020) id c0a2906e-fd40-4054-b1a0-0886701fe7ff", - "key": "c0a2906e-fd40-4054-b1a0-0886701fe7ff", - "label": "kbl_13(2020) metadata", - "value": "26694" - }, - { - "description": "Jurisdiction Metadata for Mpopo Zone id c396e797-cef3-4558-83a1-c5994315eba5", - "key": "c396e797-cef3-4558-83a1-c5994315eba5", - "label": "Mpopo Zone metadata", - "value": "26695" - }, - { - "description": "Jurisdiction Metadata for kbl_91(2020) id 5bee8a46-1acc-49af-a1b3-afccac3259dd", - "key": "5bee8a46-1acc-49af-a1b3-afccac3259dd", - "label": "kbl_91(2020) metadata", - "value": "26696" - }, - { - "description": "Jurisdiction Metadata for kbl_14(2020) id af73fa15-d729-42e5-bd3c-afb9c065fed9", - "key": "af73fa15-d729-42e5-bd3c-afb9c065fed9", - "label": "kbl_14(2020) metadata", - "value": "26697" - }, - { - "description": "Jurisdiction Metadata for kbl_49(2020) id e834e777-1ce6-4cb4-b733-f208df660da0", - "key": "e834e777-1ce6-4cb4-b733-f208df660da0", - "label": "kbl_49(2020) metadata", - "value": "26698" - }, - { - "description": "Jurisdiction Metadata for kbl_58(2020) id bf5dc5f3-fe75-4ba9-9b34-b4ca2d6844f1", - "key": "bf5dc5f3-fe75-4ba9-9b34-b4ca2d6844f1", - "label": "kbl_58(2020) metadata", - "value": "26699" - }, - { - "description": "Jurisdiction Metadata for kbl_87(2020) id c9d891a5-16ab-4b66-9c88-c5c2128ceb78", - "key": "c9d891a5-16ab-4b66-9c88-c5c2128ceb78", - "label": "kbl_87(2020) metadata", - "value": "26700" - }, - { - "description": "Jurisdiction Metadata for kbl_57(2020) id cf001901-9744-4c07-9cda-28b7e94d02cf", - "key": "cf001901-9744-4c07-9cda-28b7e94d02cf", - "label": "kbl_57(2020) metadata", - "value": "26701" - }, - { - "description": "Jurisdiction Metadata for kbl_70(2020) id 1cfa35c0-a880-4716-8855-2adcc130f9d3", - "key": "1cfa35c0-a880-4716-8855-2adcc130f9d3", - "label": "kbl_70(2020) metadata", - "value": "26702" - }, - { - "description": "Jurisdiction Metadata for kbl_69(2020) id e85e2404-51cb-4e13-8aaa-cbc22edd351d", - "key": "e85e2404-51cb-4e13-8aaa-cbc22edd351d", - "label": "kbl_69(2020) metadata", - "value": "26703" - }, - { - "description": "Jurisdiction Metadata for kbl_27(2020) id 8c00fd67-c579-4ab5-8a47-9518ac09da66", - "key": "8c00fd67-c579-4ab5-8a47-9518ac09da66", - "label": "kbl_27(2020) metadata", - "value": "26704" - }, - { - "description": "Jurisdiction Metadata for kbl_82(2020) id 309e2980-e75a-4773-8897-4739c86eed41", - "key": "309e2980-e75a-4773-8897-4739c86eed41", - "label": "kbl_82(2020) metadata", - "value": "26705" - }, - { - "description": "Jurisdiction Metadata for kbl_56(2020) id 58070148-7523-487b-bf87-eceec42d9ead", - "key": "58070148-7523-487b-bf87-eceec42d9ead", - "label": "kbl_56(2020) metadata", - "value": "26706" - }, - { - "description": "Jurisdiction Metadata for kbl_30(2020) id e82206a6-98aa-4056-a1b6-15128be21a01", - "key": "e82206a6-98aa-4056-a1b6-15128be21a01", - "label": "kbl_30(2020) metadata", - "value": "26707" - }, - { - "description": "Jurisdiction Metadata for kbl_61(2020) id 294fffed-0baa-475a-a562-e57aaff42eb4", - "key": "294fffed-0baa-475a-a562-e57aaff42eb4", - "label": "kbl_61(2020) metadata", - "value": "26708" - }, - { - "description": "Jurisdiction Metadata for kbl_66(2020) id 2c6638b2-0d2c-4f7f-aab9-dfcc260b2dbe", - "key": "2c6638b2-0d2c-4f7f-aab9-dfcc260b2dbe", - "label": "kbl_66(2020) metadata", - "value": "26709" - }, - { - "description": "Jurisdiction Metadata for kbl_43(2020) id 53ee8893-22b8-4844-ac67-216db4ec5560", - "key": "53ee8893-22b8-4844-ac67-216db4ec5560", - "label": "kbl_43(2020) metadata", - "value": "26710" - }, - { - "description": "Jurisdiction Metadata for kbl_92(2020) id 7e559fc0-ab0d-4a68-9093-d63af3a116a3", - "key": "7e559fc0-ab0d-4a68-9093-d63af3a116a3", - "label": "kbl_92(2020) metadata", - "value": "26711" - }, - { - "description": "Jurisdiction Metadata for kbl_17(2020) id 9b4a80f9-3f34-4495-b23d-c765952b314c", - "key": "9b4a80f9-3f34-4495-b23d-c765952b314c", - "label": "kbl_17(2020) metadata", - "value": "26712" - }, - { - "description": "Jurisdiction Metadata for kbl_67(2020) id 92d5b651-484d-4a08-9d6d-d48a4c38922d", - "key": "92d5b651-484d-4a08-9d6d-d48a4c38922d", - "label": "kbl_67(2020) metadata", - "value": "26713" - }, - { - "description": "Jurisdiction Metadata for kbl_41(2020) id bc4d3c7b-abb3-49be-bedb-f90a2bf3e30b", - "key": "bc4d3c7b-abb3-49be-bedb-f90a2bf3e30b", - "label": "kbl_41(2020) metadata", - "value": "26714" - }, - { - "description": "Jurisdiction Metadata for kbl_20(2020) id e3be504c-b259-4e53-aa94-4b97163ad179", - "key": "e3be504c-b259-4e53-aa94-4b97163ad179", - "label": "kbl_20(2020) metadata", - "value": "26715" - }, - { - "description": "Jurisdiction Metadata for kbl_11(2020) id f4b73c8b-372f-41e1-a16f-ef68c001bb30", - "key": "f4b73c8b-372f-41e1-a16f-ef68c001bb30", - "label": "kbl_11(2020) metadata", - "value": "26716" - }, - { - "description": "Jurisdiction Metadata for kbl_59(2020) id f15fbc3a-3adf-45b0-87d3-f9009f2cf0b3", - "key": "f15fbc3a-3adf-45b0-87d3-f9009f2cf0b3", - "label": "kbl_59(2020) metadata", - "value": "26717" - }, - { - "description": "Jurisdiction Metadata for kbl_81(2020) id e975ffc4-a779-416d-a549-bc471a26e583", - "key": "e975ffc4-a779-416d-a549-bc471a26e583", - "label": "kbl_81(2020) metadata", - "value": "26718" - }, - { - "description": "Jurisdiction Metadata for kbl_95(2020) id 10ed06f5-b9a0-48eb-9c9f-4d6ce9baa420", - "key": "10ed06f5-b9a0-48eb-9c9f-4d6ce9baa420", - "label": "kbl_95(2020) metadata", - "value": "26719" - }, - { - "description": "Jurisdiction Metadata for kbl_85(2020) id e21d4bc6-2345-4781-b319-320ecefc98bb", - "key": "e21d4bc6-2345-4781-b319-320ecefc98bb", - "label": "kbl_85(2020) metadata", - "value": "26720" - }, - { - "description": "Jurisdiction Metadata for kbl_10(2020) id 83e08c5d-99ad-4896-aaa1-348684623506", - "key": "83e08c5d-99ad-4896-aaa1-348684623506", - "label": "kbl_10(2020) metadata", - "value": "26721" - }, - { - "description": "Jurisdiction Metadata for kbl_89(2020) id 79613fc2-cc6a-4c11-93c2-fc0323a459f8", - "key": "79613fc2-cc6a-4c11-93c2-fc0323a459f8", - "label": "kbl_89(2020) metadata", - "value": "26722" - }, - { - "description": "Jurisdiction Metadata for kbl_84(2020) id 4c2b47ef-dafa-474c-9d0e-a1faac7258bf", - "key": "4c2b47ef-dafa-474c-9d0e-a1faac7258bf", - "label": "kbl_84(2020) metadata", - "value": "26723" - }, - { - "description": "Jurisdiction Metadata for kbl_44(2020) id 85f1c102-5dab-4b1c-a620-d7c73045b2b6", - "key": "85f1c102-5dab-4b1c-a620-d7c73045b2b6", - "label": "kbl_44(2020) metadata", - "value": "26724" - }, - { - "description": "Jurisdiction Metadata for kbl_62(2020) id 62df09fa-70bd-495e-9a6f-ee00d628aeb7", - "key": "62df09fa-70bd-495e-9a6f-ee00d628aeb7", - "label": "kbl_62(2020) metadata", - "value": "26725" - }, - { - "description": "Jurisdiction Metadata for kbl_45(2020) id b032370c-f2c7-4512-a5e7-a18c2943ffee", - "key": "b032370c-f2c7-4512-a5e7-a18c2943ffee", - "label": "kbl_45(2020) metadata", - "value": "26726" - }, - { - "description": "Jurisdiction Metadata for kbl_32(2020) id 2fdf2c01-b088-4cab-af86-d246a88e0149", - "key": "2fdf2c01-b088-4cab-af86-d246a88e0149", - "label": "kbl_32(2020) metadata", - "value": "26727" - }, - { - "description": "Jurisdiction Metadata for kbl_28(2020) id bfa71b80-a770-4d39-945d-1a85a983ba2c", - "key": "bfa71b80-a770-4d39-945d-1a85a983ba2c", - "label": "kbl_28(2020) metadata", - "value": "26728" - }, - { - "description": "Jurisdiction Metadata for kbl_42(2020) id 92ccb1ff-4f73-4efa-b8be-d302cc15955e", - "key": "92ccb1ff-4f73-4efa-b8be-d302cc15955e", - "label": "kbl_42(2020) metadata", - "value": "26729" - }, - { - "description": "Jurisdiction Metadata for kbl_63(2020) id 0492b442-6a9e-4491-9c12-04a9d629f10d", - "key": "0492b442-6a9e-4491-9c12-04a9d629f10d", - "label": "kbl_63(2020) metadata", - "value": "26730" - }, - { - "description": "Jurisdiction Metadata for kbl_86(2020) id d5f7a9d5-3265-4537-aa16-92fb068d3746", - "key": "d5f7a9d5-3265-4537-aa16-92fb068d3746", - "label": "kbl_86(2020) metadata", - "value": "26731" - }, - { - "description": "Jurisdiction Metadata for kbl_68(2020) id 9283b595-b76d-4839-b248-7e90f07a8937", - "key": "9283b595-b76d-4839-b248-7e90f07a8937", - "label": "kbl_68(2020) metadata", - "value": "26732" - }, - { - "description": "Jurisdiction Metadata for kbl_21(2020) id f1846380-5d48-4aef-a532-8a86ac094263", - "key": "f1846380-5d48-4aef-a532-8a86ac094263", - "label": "kbl_21(2020) metadata", - "value": "26733" - }, - { - "description": "Jurisdiction Metadata for kbl_33(2020) id c711f1f6-f1ad-4771-aee1-259efb80dbd1", - "key": "c711f1f6-f1ad-4771-aee1-259efb80dbd1", - "label": "kbl_33(2020) metadata", - "value": "26734" - }, - { - "description": "Jurisdiction Metadata for kbl_31(2020) id b2e5b578-0c7c-4963-b17b-b4fa74d93a75", - "key": "b2e5b578-0c7c-4963-b17b-b4fa74d93a75", - "label": "kbl_31(2020) metadata", - "value": "26735" - }, - { - "description": "Jurisdiction Metadata for kbl_88(2020) id b3b07f03-bd73-4620-817f-c4d8e582d350", - "key": "b3b07f03-bd73-4620-817f-c4d8e582d350", - "label": "kbl_88(2020) metadata", - "value": "26736" - }, - { - "description": "Jurisdiction Metadata for kbl_64(2020) id b277743c-be27-4ebe-8d90-17fd7ca60c12", - "key": "b277743c-be27-4ebe-8d90-17fd7ca60c12", - "label": "kbl_64(2020) metadata", - "value": "26737" - }, - { - "description": "Jurisdiction Metadata for kbl_80(2020) id d3a6211a-60c1-473a-b715-4f81c733719b", - "key": "d3a6211a-60c1-473a-b715-4f81c733719b", - "label": "kbl_80(2020) metadata", - "value": "26738" - }, - { - "description": "Jurisdiction Metadata for kbl_46(2020) id 381f648a-05c3-4a1c-accf-3eb91f17ff1d", - "key": "381f648a-05c3-4a1c-accf-3eb91f17ff1d", - "label": "kbl_46(2020) metadata", - "value": "26739" - }, - { - "description": "Jurisdiction Metadata for kbl_65(2020) id 66a97d3a-5d93-4ecb-a65e-0695ec010b4d", - "key": "66a97d3a-5d93-4ecb-a65e-0695ec010b4d", - "label": "kbl_65(2020) metadata", - "value": "26740" - }, - { - "description": "Jurisdiction Metadata for kbl_40(2020) id 1738e796-ee41-448b-8633-cf7c08b0f55d", - "key": "1738e796-ee41-448b-8633-cf7c08b0f55d", - "label": "kbl_40(2020) metadata", - "value": "26741" - }, - { - "description": "Jurisdiction Metadata for kbl_47(2020) id 2640a58c-ef01-4483-9692-80983ffa0291", - "key": "2640a58c-ef01-4483-9692-80983ffa0291", - "label": "kbl_47(2020) metadata", - "value": "26742" - }, - { - "description": "Jurisdiction Metadata for kbl_34(2020) id 720ca15f-40bc-4f16-b7d0-b08a8496de8a", - "key": "720ca15f-40bc-4f16-b7d0-b08a8496de8a", - "label": "kbl_34(2020) metadata", - "value": "26743" - }, - { - "description": "Jurisdiction Metadata for kbl_48(2020) id 8fb7c397-6a87-45fb-a364-87057e9cbddc", - "key": "8fb7c397-6a87-45fb-a364-87057e9cbddc", - "label": "kbl_48(2020) metadata", - "value": "26744" - }, - { - "description": "Jurisdiction Metadata for kbl_60(2020) id 20c02c81-92f7-4ec9-a47f-f27036ae3a3c", - "key": "20c02c81-92f7-4ec9-a47f-f27036ae3a3c", - "label": "kbl_60(2020) metadata", - "value": "26745" - }, - { - "description": "Jurisdiction Metadata for kbl_5(2020) id 21acb85c-4fa2-4642-947d-5e566bff7a47", - "key": "21acb85c-4fa2-4642-947d-5e566bff7a47", - "label": "kbl_5(2020) metadata", - "value": "26746" - }, - { - "description": "Jurisdiction Metadata for kbl_24(2020) id 7a45d60f-4fcb-4147-bef6-088c7a1852af", - "key": "7a45d60f-4fcb-4147-bef6-088c7a1852af", - "label": "kbl_24(2020) metadata", - "value": "26747" - }, - { - "description": "Jurisdiction Metadata for kbl_83(2020) id 0a27b8e7-db18-42b4-b894-5809f9738359", - "key": "0a27b8e7-db18-42b4-b894-5809f9738359", - "label": "kbl_83(2020) metadata", - "value": "26748" - }, - { - "description": "Jurisdiction Metadata for kbl_52(2020) id e01b7fa0-9bcc-4cea-949e-86c3a195306e", - "key": "e01b7fa0-9bcc-4cea-949e-86c3a195306e", - "label": "kbl_52(2020) metadata", - "value": "26749" - }, - { - "description": "Jurisdiction Metadata for Katofyo Zone id 5945ed41-8d05-434c-9fb9-39147bfee7e8", - "key": "5945ed41-8d05-434c-9fb9-39147bfee7e8", - "label": "Katofyo Zone metadata", - "value": "26750" - }, - { - "description": "Jurisdiction Metadata for kbl_93(2020) id bef75634-36e0-4433-895e-d418e257fb58", - "key": "bef75634-36e0-4433-895e-d418e257fb58", - "label": "kbl_93(2020) metadata", - "value": "26751" - }, - { - "description": "Jurisdiction Metadata for kbl_9(2020) id f98167fe-0318-4eb6-8ca2-43629f119d8a", - "key": "f98167fe-0318-4eb6-8ca2-43629f119d8a", - "label": "kbl_9(2020) metadata", - "value": "26752" - }, - { - "description": "Jurisdiction Metadata for kbl_79(2020) id abb98885-cb05-405d-aceb-a75ed272bc1c", - "key": "abb98885-cb05-405d-aceb-a75ed272bc1c", - "label": "kbl_79(2020) metadata", - "value": "26753" - }, - { - "description": "Jurisdiction Metadata for kbl_74(2020) id 3f86a691-a3a0-4027-aa83-bf07b1fe9f0b", - "key": "3f86a691-a3a0-4027-aa83-bf07b1fe9f0b", - "label": "kbl_74(2020) metadata", - "value": "26754" - }, - { - "description": "Jurisdiction Metadata for kbl_38(2020) id 18213960-642e-4759-9f98-cd717372216b", - "key": "18213960-642e-4759-9f98-cd717372216b", - "label": "kbl_38(2020) metadata", - "value": "26755" - }, - { - "description": "Jurisdiction Metadata for kbl_75(2020) id fd64e405-aa0e-460b-a508-7465a0fe62f2", - "key": "fd64e405-aa0e-460b-a508-7465a0fe62f2", - "label": "kbl_75(2020) metadata", - "value": "26756" - }, - { - "description": "Jurisdiction Metadata for kbl_25(2020) id d91678cd-1ab6-491d-b142-84dba48f2c19", - "key": "d91678cd-1ab6-491d-b142-84dba48f2c19", - "label": "kbl_25(2020) metadata", - "value": "26757" - }, - { - "description": "Jurisdiction Metadata for kbl_39(2020) id 1eb4c4e6-8c44-4a61-8832-640663b76a5c", - "key": "1eb4c4e6-8c44-4a61-8832-640663b76a5c", - "label": "kbl_39(2020) metadata", - "value": "26758" - }, - { - "description": "Jurisdiction Metadata for kbl_18(2020) id cc3a01d5-9cbe-421c-9234-f44b03057b3d", - "key": "cc3a01d5-9cbe-421c-9234-f44b03057b3d", - "label": "kbl_18(2020) metadata", - "value": "26759" - }, - { - "description": "Jurisdiction Metadata for kbl_77(2020) id f37dd10a-1bc0-425a-a548-19fc737dbfb6", - "key": "f37dd10a-1bc0-425a-a548-19fc737dbfb6", - "label": "kbl_77(2020) metadata", - "value": "26760" - }, - { - "description": "Jurisdiction Metadata for kbl_76(2020) id 9c9e9be4-cccf-4b81-99a5-9fb9adcdffcf", - "key": "9c9e9be4-cccf-4b81-99a5-9fb9adcdffcf", - "label": "kbl_76(2020) metadata", - "value": "26761" - }, - { - "description": "Jurisdiction Metadata for kbl_37(2020) id 93815c7c-dc27-4984-a666-11f8eaa45a48", - "key": "93815c7c-dc27-4984-a666-11f8eaa45a48", - "label": "kbl_37(2020) metadata", - "value": "26762" - }, - { - "description": "Jurisdiction Metadata for kbl_16(2020) id 4ccdf4fe-d45c-4548-8336-eb1f7b82db20", - "key": "4ccdf4fe-d45c-4548-8336-eb1f7b82db20", - "label": "kbl_16(2020) metadata", - "value": "26763" - }, - { - "description": "Jurisdiction Metadata for kbl_78(2020) id 8ff7da0e-88d8-4e3a-b9a9-232c6e7f2d49", - "key": "8ff7da0e-88d8-4e3a-b9a9-232c6e7f2d49", - "label": "kbl_78(2020) metadata", - "value": "26764" - }, - { - "description": "Jurisdiction Metadata for Kapambwe(2020) id 5d389c9e-1ffe-4b95-8254-5422a7007ea0", - "key": "5d389c9e-1ffe-4b95-8254-5422a7007ea0", - "label": "Kapambwe(2020) metadata", - "value": "26765" - }, - { - "description": "Jurisdiction Metadata for Zone 1 id dcaece7a-70c4-4881-b6e1-1a00302d7929", - "key": "dcaece7a-70c4-4881-b6e1-1a00302d7929", - "label": "Zone 1 metadata", - "value": "26766" - }, - { - "description": "Jurisdiction Metadata for kpb_1(2020) id e6d11c56-0119-4c4b-a2d5-e38ebcc9ae4a", - "key": "e6d11c56-0119-4c4b-a2d5-e38ebcc9ae4a", - "label": "kpb_1(2020) metadata", - "value": "26767" - }, - { - "description": "Jurisdiction Metadata for Zone 3 id 9171f593-00a4-475f-9e6f-08285024eeb5", - "key": "9171f593-00a4-475f-9e6f-08285024eeb5", - "label": "Zone 3 metadata", - "value": "26768" - }, - { - "description": "Jurisdiction Metadata for kpb_2(2020) id 17753788-e92f-4fed-a96c-cb2574f0e317", - "key": "17753788-e92f-4fed-a96c-cb2574f0e317", - "label": "kpb_2(2020) metadata", - "value": "26769" - }, - { - "description": "Jurisdiction Metadata for Zonne 2 id d7f3c66f-a422-4087-8249-4d95b9b33839", - "key": "d7f3c66f-a422-4087-8249-4d95b9b33839", - "label": "Zonne 2 metadata", - "value": "26770" - }, - { - "description": "Jurisdiction Metadata for kpb_3(2020) id fbb032f8-3a4b-4b1f-ba1b-f6de0261bb8d", - "key": "fbb032f8-3a4b-4b1f-ba1b-f6de0261bb8d", - "label": "kpb_3(2020) metadata", - "value": "26771" - }, - { - "description": "Jurisdiction Metadata for kpb_4(2020) id 88df895d-e12a-4172-903f-284368fe579f", - "key": "88df895d-e12a-4172-903f-284368fe579f", - "label": "kpb_4(2020) metadata", - "value": "26772" - }, - { - "description": "Jurisdiction Metadata for Zone 4 id f4f82a95-a2dd-45b4-9dd8-e9414eaab90d", - "key": "f4f82a95-a2dd-45b4-9dd8-e9414eaab90d", - "label": "Zone 4 metadata", - "value": "26773" - }, - { - "description": "Jurisdiction Metadata for Eastern Prov (2020) id 4669b841-5f06-47bc-ac87-4282ca21ae6a", - "key": "4669b841-5f06-47bc-ac87-4282ca21ae6a", - "label": "Eastern Prov (2020) metadata", - "value": "26774" - }, - { - "description": "Jurisdiction Metadata for Chadiza District (2020) id a31047b0-0240-4ea5-af8b-d0418a4a099a", - "key": "a31047b0-0240-4ea5-af8b-d0418a4a099a", - "label": "Chadiza District (2020) metadata", - "value": "26775" - }, - { - "description": "Jurisdiction Metadata for Chilenga(2020) id 7a898483-b2f2-4d7e-878c-64fbe7e00fe0", - "key": "7a898483-b2f2-4d7e-878c-64fbe7e00fe0", - "label": "Chilenga(2020) metadata", - "value": "26776" - }, - { - "description": "Jurisdiction Metadata for Dulira_NHC id 4cc758c2-fbe3-439c-9229-313332e1b771", - "key": "4cc758c2-fbe3-439c-9229-313332e1b771", - "label": "Dulira_NHC metadata", - "value": "26777" - }, - { - "description": "Jurisdiction Metadata for CLG_19(2020) id 45ac1f05-7235-42ea-b2ae-a382d8b6fdf5", - "key": "45ac1f05-7235-42ea-b2ae-a382d8b6fdf5", - "label": "CLG_19(2020) metadata", - "value": "26778" - }, - { - "description": "Jurisdiction Metadata for CLG_8(2020) id 69c2f104-41e2-4bbb-a54e-8652c4dcef33", - "key": "69c2f104-41e2-4bbb-a54e-8652c4dcef33", - "label": "CLG_8(2020) metadata", - "value": "26779" - }, - { - "description": "Jurisdiction Metadata for CLG_2(2020) id e56e4894-70a7-4a76-a0da-572c5c32dc2c", - "key": "e56e4894-70a7-4a76-a0da-572c5c32dc2c", - "label": "CLG_2(2020) metadata", - "value": "26780" - }, - { - "description": "Jurisdiction Metadata for CLG_6(2020) id d8234c61-2ce9-4b13-907c-1a7e378e2db4", - "key": "d8234c61-2ce9-4b13-907c-1a7e378e2db4", - "label": "CLG_6(2020) metadata", - "value": "26781" - }, - { - "description": "Jurisdiction Metadata for CLG_23(2020) id 05a24141-9b00-4a09-8fb9-ae7b51ca620c", - "key": "05a24141-9b00-4a09-8fb9-ae7b51ca620c", - "label": "CLG_23(2020) metadata", - "value": "26782" - }, - { - "description": "Jurisdiction Metadata for CLG_1(2020) id 2ffd7355-e62a-4cda-8d06-7f96c5874de3", - "key": "2ffd7355-e62a-4cda-8d06-7f96c5874de3", - "label": "CLG_1(2020) metadata", - "value": "26783" - }, - { - "description": "Jurisdiction Metadata for CLG_17(2020) id 26fbaf6b-2b01-4c35-9667-6b909bbd1615", - "key": "26fbaf6b-2b01-4c35-9667-6b909bbd1615", - "label": "CLG_17(2020) metadata", - "value": "26784" - }, - { - "description": "Jurisdiction Metadata for CLG_16(2020) id 737f2729-2ff3-4e99-b4cb-bd0102a91c49", - "key": "737f2729-2ff3-4e99-b4cb-bd0102a91c49", - "label": "CLG_16(2020) metadata", - "value": "26785" - }, - { - "description": "Jurisdiction Metadata for CLG_27(2020) id 7b852b09-efbd-4d7b-b6f0-89e63d483e39", - "key": "7b852b09-efbd-4d7b-b6f0-89e63d483e39", - "label": "CLG_27(2020) metadata", - "value": "26786" - }, - { - "description": "Jurisdiction Metadata for CLG_20(2020) id 81108223-e938-46ac-bbd4-c195d88b364c", - "key": "81108223-e938-46ac-bbd4-c195d88b364c", - "label": "CLG_20(2020) metadata", - "value": "26787" - }, - { - "description": "Jurisdiction Metadata for CLG_21(2020) id 4d41c5f1-662d-460c-8176-4766cb0069a0", - "key": "4d41c5f1-662d-460c-8176-4766cb0069a0", - "label": "CLG_21(2020) metadata", - "value": "26788" - }, - { - "description": "Jurisdiction Metadata for CLG_15(2020) id a1abe859-1d63-4b05-b27f-e088afc884e0", - "key": "a1abe859-1d63-4b05-b27f-e088afc884e0", - "label": "CLG_15(2020) metadata", - "value": "26789" - }, - { - "description": "Jurisdiction Metadata for CLG_9(2020) id 50632df3-5edb-4174-9d70-b3e7c85413ad", - "key": "50632df3-5edb-4174-9d70-b3e7c85413ad", - "label": "CLG_9(2020) metadata", - "value": "26790" - }, - { - "description": "Jurisdiction Metadata for CLG_25(2020) id d29d613b-7f90-4e3c-ad50-172b30710f83", - "key": "d29d613b-7f90-4e3c-ad50-172b30710f83", - "label": "CLG_25(2020) metadata", - "value": "26791" - }, - { - "description": "Jurisdiction Metadata for CLG_7(2020) id 63e1be76-d808-4d02-b7dc-d31a8b53332e", - "key": "63e1be76-d808-4d02-b7dc-d31a8b53332e", - "label": "CLG_7(2020) metadata", - "value": "26792" - }, - { - "description": "Jurisdiction Metadata for CLG_29(2020) id 64b86052-608c-4a9a-b688-34a520e2e386", - "key": "64b86052-608c-4a9a-b688-34a520e2e386", - "label": "CLG_29(2020) metadata", - "value": "26793" - }, - { - "description": "Jurisdiction Metadata for CLG_13(2020) id eaaefdcd-6c54-4e73-81a4-3441943f2371", - "key": "eaaefdcd-6c54-4e73-81a4-3441943f2371", - "label": "CLG_13(2020) metadata", - "value": "26794" - }, - { - "description": "Jurisdiction Metadata for CLG_18(2020) id 00f055d8-e103-47a0-b14b-88613e3d1512", - "key": "00f055d8-e103-47a0-b14b-88613e3d1512", - "label": "CLG_18(2020) metadata", - "value": "26795" - }, - { - "description": "Jurisdiction Metadata for CLG_22(2020) id 4e3ca8d3-134f-424c-bc85-c07ea317f164", - "key": "4e3ca8d3-134f-424c-bc85-c07ea317f164", - "label": "CLG_22(2020) metadata", - "value": "26796" - }, - { - "description": "Jurisdiction Metadata for CLG_12(2020) id 55aef2b6-b783-452f-8ec8-060681733f62", - "key": "55aef2b6-b783-452f-8ec8-060681733f62", - "label": "CLG_12(2020) metadata", - "value": "26797" - }, - { - "description": "Jurisdiction Metadata for CLG_11(2020) id 67d0c1c4-ab8c-4763-896d-dfb64dac956a", - "key": "67d0c1c4-ab8c-4763-896d-dfb64dac956a", - "label": "CLG_11(2020) metadata", - "value": "26798" - }, - { - "description": "Jurisdiction Metadata for CLG_28(2020) id ef8f32c1-17da-46a9-a6b1-3a549c403081", - "key": "ef8f32c1-17da-46a9-a6b1-3a549c403081", - "label": "CLG_28(2020) metadata", - "value": "26799" - }, - { - "description": "Jurisdiction Metadata for CLG_14(2020) id e4522dc1-19c7-48ce-896f-28cdf2cde166", - "key": "e4522dc1-19c7-48ce-896f-28cdf2cde166", - "label": "CLG_14(2020) metadata", - "value": "26800" - }, - { - "description": "Jurisdiction Metadata for CLG_4(2020) id c69c5156-c16c-465a-80a2-51c718f58da3", - "key": "c69c5156-c16c-465a-80a2-51c718f58da3", - "label": "CLG_4(2020) metadata", - "value": "26801" - }, - { - "description": "Jurisdiction Metadata for CLG_5(2020) id 2cbc70d9-536f-4449-89a9-701b7a50f147", - "key": "2cbc70d9-536f-4449-89a9-701b7a50f147", - "label": "CLG_5(2020) metadata", - "value": "26802" - }, - { - "description": "Jurisdiction Metadata for CLG_3(2020) id 22858416-4964-4967-a93a-41b1e7ba8d0c", - "key": "22858416-4964-4967-a93a-41b1e7ba8d0c", - "label": "CLG_3(2020) metadata", - "value": "26803" - }, - { - "description": "Jurisdiction Metadata for CLG_26(2020) id 2ea271bd-e805-4a6e-960d-34785914a5bc", - "key": "2ea271bd-e805-4a6e-960d-34785914a5bc", - "label": "CLG_26(2020) metadata", - "value": "26804" - }, - { - "description": "Jurisdiction Metadata for CLG_24(2020) id fd98d9bb-a2c0-4320-b6e1-27fc96a68444", - "key": "fd98d9bb-a2c0-4320-b6e1-27fc96a68444", - "label": "CLG_24(2020) metadata", - "value": "26805" - }, - { - "description": "Jurisdiction Metadata for CLG_10(2020) id 34770079-7e50-49b5-84a1-f6530a264e8a", - "key": "34770079-7e50-49b5-84a1-f6530a264e8a", - "label": "CLG_10(2020) metadata", - "value": "26806" - }, - { - "description": "Jurisdiction Metadata for Mtaya(2020) id 5f7e5e28-2a22-43e1-8581-71f89896e06a", - "key": "5f7e5e28-2a22-43e1-8581-71f89896e06a", - "label": "Mtaya(2020) metadata", - "value": "26807" - }, - { - "description": "Jurisdiction Metadata for Simatiza_NHC id 29488fac-125b-43b3-b777-29e298786fa5", - "key": "29488fac-125b-43b3-b777-29e298786fa5", - "label": "Simatiza_NHC metadata", - "value": "26808" - }, - { - "description": "Jurisdiction Metadata for MTY_3(2020) id 1d9cfd8e-5242-4d82-8e5c-793381e1f407", - "key": "1d9cfd8e-5242-4d82-8e5c-793381e1f407", - "label": "MTY_3(2020) metadata", - "value": "26809" - }, - { - "description": "Jurisdiction Metadata for MTY_25(2020) id 52817be6-313e-418f-b7c5-38be785270f0", - "key": "52817be6-313e-418f-b7c5-38be785270f0", - "label": "MTY_25(2020) metadata", - "value": "26810" - }, - { - "description": "Jurisdiction Metadata for MTY_40(2020) id be62487d-60a0-4311-8ba6-b712a949c42a", - "key": "be62487d-60a0-4311-8ba6-b712a949c42a", - "label": "MTY_40(2020) metadata", - "value": "26811" - }, - { - "description": "Jurisdiction Metadata for MTY_69(2020) id 3c8f705c-36ec-4e50-ba3a-6654232a6a97", - "key": "3c8f705c-36ec-4e50-ba3a-6654232a6a97", - "label": "MTY_69(2020) metadata", - "value": "26812" - }, - { - "description": "Jurisdiction Metadata for MTY_50(2020) id cb886d58-abec-4f53-883e-d88fe2878e3b", - "key": "cb886d58-abec-4f53-883e-d88fe2878e3b", - "label": "MTY_50(2020) metadata", - "value": "26813" - }, - { - "description": "Jurisdiction Metadata for MTY_64(2020) id 290008e9-a5e2-434b-b07d-ebf65a942699", - "key": "290008e9-a5e2-434b-b07d-ebf65a942699", - "label": "MTY_64(2020) metadata", - "value": "26814" - }, - { - "description": "Jurisdiction Metadata for MTY_10(2020) id 21e6dae3-dc75-4255-aef3-08393952ce07", - "key": "21e6dae3-dc75-4255-aef3-08393952ce07", - "label": "MTY_10(2020) metadata", - "value": "26815" - }, - { - "description": "Jurisdiction Metadata for MTY_5(2020) id 88a2a65c-92a0-4f67-99c8-df6ed2439a32", - "key": "88a2a65c-92a0-4f67-99c8-df6ed2439a32", - "label": "MTY_5(2020) metadata", - "value": "26816" - }, - { - "description": "Jurisdiction Metadata for MTY_21(2020) id 458e942a-fd09-4078-a21e-a65938e73f8d", - "key": "458e942a-fd09-4078-a21e-a65938e73f8d", - "label": "MTY_21(2020) metadata", - "value": "26817" - }, - { - "description": "Jurisdiction Metadata for MTY_37(2020) id 2d02f422-5af2-4c2d-a9e5-66bad965a034", - "key": "2d02f422-5af2-4c2d-a9e5-66bad965a034", - "label": "MTY_37(2020) metadata", - "value": "26818" - }, - { - "description": "Jurisdiction Metadata for MTY_28(2020) id 2833b4a7-1783-4183-98c4-95ac399f6ece", - "key": "2833b4a7-1783-4183-98c4-95ac399f6ece", - "label": "MTY_28(2020) metadata", - "value": "26819" - }, - { - "description": "Jurisdiction Metadata for MTY_67(2020) id 2a96d36f-4350-4eef-b8a7-e7e36046b8a5", - "key": "2a96d36f-4350-4eef-b8a7-e7e36046b8a5", - "label": "MTY_67(2020) metadata", - "value": "26820" - }, - { - "description": "Jurisdiction Metadata for MTY_51(2020) id 434f27a8-1242-48a3-aad3-09d14bb6c099", - "key": "434f27a8-1242-48a3-aad3-09d14bb6c099", - "label": "MTY_51(2020) metadata", - "value": "26821" - }, - { - "description": "Jurisdiction Metadata for MTY_31(2020) id a086ffa7-963e-45f1-afe4-eb3e3b4095b4", - "key": "a086ffa7-963e-45f1-afe4-eb3e3b4095b4", - "label": "MTY_31(2020) metadata", - "value": "26822" - }, - { - "description": "Jurisdiction Metadata for MTY_7(2020) id 42c94dd0-fa2f-47a4-ae6e-608482f79ddf", - "key": "42c94dd0-fa2f-47a4-ae6e-608482f79ddf", - "label": "MTY_7(2020) metadata", - "value": "26823" - }, - { - "description": "Jurisdiction Metadata for MTY_63(2020) id a00e0b93-ca38-4809-9e21-b9cb7e0e0ce2", - "key": "a00e0b93-ca38-4809-9e21-b9cb7e0e0ce2", - "label": "MTY_63(2020) metadata", - "value": "26824" - }, - { - "description": "Jurisdiction Metadata for MTY_66(2020) id 0a42146d-1743-4265-b55a-0add747d0ad7", - "key": "0a42146d-1743-4265-b55a-0add747d0ad7", - "label": "MTY_66(2020) metadata", - "value": "26825" - }, - { - "description": "Jurisdiction Metadata for MTY_45(2020) id 47612253-461f-47f1-a9ee-150d958ed89a", - "key": "47612253-461f-47f1-a9ee-150d958ed89a", - "label": "MTY_45(2020) metadata", - "value": "26826" - }, - { - "description": "Jurisdiction Metadata for MTY_42(2020) id e506dee4-bf78-4460-9f19-3aa44664cd03", - "key": "e506dee4-bf78-4460-9f19-3aa44664cd03", - "label": "MTY_42(2020) metadata", - "value": "26827" - }, - { - "description": "Jurisdiction Metadata for MTY_19(2020) id 9d54f7e6-82fb-441b-ba65-ae620145f4e8", - "key": "9d54f7e6-82fb-441b-ba65-ae620145f4e8", - "label": "MTY_19(2020) metadata", - "value": "26828" - }, - { - "description": "Jurisdiction Metadata for MTY_53(2020) id 83ef83cf-2da2-4e91-b02d-61c81fb44499", - "key": "83ef83cf-2da2-4e91-b02d-61c81fb44499", - "label": "MTY_53(2020) metadata", - "value": "26829" - }, - { - "description": "Jurisdiction Metadata for MTY_57(2020) id 2b8249f8-43ad-44a1-8151-eebb05d3f432", - "key": "2b8249f8-43ad-44a1-8151-eebb05d3f432", - "label": "MTY_57(2020) metadata", - "value": "26830" - }, - { - "description": "Jurisdiction Metadata for MTY_9(2020) id 4a4851b8-0d77-4cb6-871a-68d10e5bd73e", - "key": "4a4851b8-0d77-4cb6-871a-68d10e5bd73e", - "label": "MTY_9(2020) metadata", - "value": "26831" - }, - { - "description": "Jurisdiction Metadata for MTY_43(2020) id f81c6d2c-63aa-4009-af43-4d8aa33d074b", - "key": "f81c6d2c-63aa-4009-af43-4d8aa33d074b", - "label": "MTY_43(2020) metadata", - "value": "26832" - }, - { - "description": "Jurisdiction Metadata for MTY_70(2020) id 4e87594a-9876-4010-97f9-d851d0fd9ef4", - "key": "4e87594a-9876-4010-97f9-d851d0fd9ef4", - "label": "MTY_70(2020) metadata", - "value": "26833" - }, - { - "description": "Jurisdiction Metadata for MTY_22(2020) id 9c1df04e-31ac-4cb0-aef7-aec3c92d0dfa", - "key": "9c1df04e-31ac-4cb0-aef7-aec3c92d0dfa", - "label": "MTY_22(2020) metadata", - "value": "26834" - }, - { - "description": "Jurisdiction Metadata for MTY_65(2020) id 09961d8c-0646-45f9-8162-00ea92cb4dcf", - "key": "09961d8c-0646-45f9-8162-00ea92cb4dcf", - "label": "MTY_65(2020) metadata", - "value": "26835" - }, - { - "description": "Jurisdiction Metadata for MTY_34(2020) id a5ac9522-47ff-425b-b33a-2d2a588279af", - "key": "a5ac9522-47ff-425b-b33a-2d2a588279af", - "label": "MTY_34(2020) metadata", - "value": "26836" - }, - { - "description": "Jurisdiction Metadata for MTY_24(2020) id 37c4b8ee-ab9a-4be8-b99a-54797eee12f7", - "key": "37c4b8ee-ab9a-4be8-b99a-54797eee12f7", - "label": "MTY_24(2020) metadata", - "value": "26837" - }, - { - "description": "Jurisdiction Metadata for MTY_47(2020) id 6b5d7e96-00c8-4253-bbd7-9bfa38379058", - "key": "6b5d7e96-00c8-4253-bbd7-9bfa38379058", - "label": "MTY_47(2020) metadata", - "value": "26838" - }, - { - "description": "Jurisdiction Metadata for MTY_44(2020) id f2f683d6-c4fe-4160-a583-dca6c417e2db", - "key": "f2f683d6-c4fe-4160-a583-dca6c417e2db", - "label": "MTY_44(2020) metadata", - "value": "26839" - }, - { - "description": "Jurisdiction Metadata for MTY_68(2020) id 85702ae6-9e63-4733-8b95-6711d7b40f5a", - "key": "85702ae6-9e63-4733-8b95-6711d7b40f5a", - "label": "MTY_68(2020) metadata", - "value": "26840" - }, - { - "description": "Jurisdiction Metadata for MTY_60(2020) id ea4e3059-c8c6-46ec-bc16-21ccf38888ac", - "key": "ea4e3059-c8c6-46ec-bc16-21ccf38888ac", - "label": "MTY_60(2020) metadata", - "value": "26841" - }, - { - "description": "Jurisdiction Metadata for MTY_58(2020) id 06fbad30-ef42-413e-a3d1-d8a21366ebdb", - "key": "06fbad30-ef42-413e-a3d1-d8a21366ebdb", - "label": "MTY_58(2020) metadata", - "value": "26842" - }, - { - "description": "Jurisdiction Metadata for MTY_27(2020) id fc54346c-d728-4a37-a981-b40539f2d35d", - "key": "fc54346c-d728-4a37-a981-b40539f2d35d", - "label": "MTY_27(2020) metadata", - "value": "26843" - }, - { - "description": "Jurisdiction Metadata for MTY_17(2020) id 7c543773-0cb7-48c0-bc3f-393cd1915a81", - "key": "7c543773-0cb7-48c0-bc3f-393cd1915a81", - "label": "MTY_17(2020) metadata", - "value": "26844" - }, - { - "description": "Jurisdiction Metadata for MTY_74(2020) id 533aa910-26f3-4298-81ba-abacfa327eb8", - "key": "533aa910-26f3-4298-81ba-abacfa327eb8", - "label": "MTY_74(2020) metadata", - "value": "26845" - }, - { - "description": "Jurisdiction Metadata for MTY_71(2020) id fdbc7e04-6b0d-425f-9e33-b9958c3c947d", - "key": "fdbc7e04-6b0d-425f-9e33-b9958c3c947d", - "label": "MTY_71(2020) metadata", - "value": "26846" - }, - { - "description": "Jurisdiction Metadata for MTY_13(2020) id 9b713259-9d91-4f42-96d0-9aa1d377f58e", - "key": "9b713259-9d91-4f42-96d0-9aa1d377f58e", - "label": "MTY_13(2020) metadata", - "value": "26847" - }, - { - "description": "Jurisdiction Metadata for MTY_29(2020) id 5629a642-7637-48ef-817c-5e33b7fba0a9", - "key": "5629a642-7637-48ef-817c-5e33b7fba0a9", - "label": "MTY_29(2020) metadata", - "value": "26848" - }, - { - "description": "Jurisdiction Metadata for MTY_48(2020) id ef138743-85ee-4bdf-8c62-13a2590ec7a8", - "key": "ef138743-85ee-4bdf-8c62-13a2590ec7a8", - "label": "MTY_48(2020) metadata", - "value": "26849" - }, - { - "description": "Jurisdiction Metadata for MTY_49(2020) id 3c6fc82b-9452-4437-a374-3c308b70f5c9", - "key": "3c6fc82b-9452-4437-a374-3c308b70f5c9", - "label": "MTY_49(2020) metadata", - "value": "26850" - }, - { - "description": "Jurisdiction Metadata for MTY_36(2020) id 9b103f4f-ad97-4267-b5ed-0026fddee198", - "key": "9b103f4f-ad97-4267-b5ed-0026fddee198", - "label": "MTY_36(2020) metadata", - "value": "26851" - }, - { - "description": "Jurisdiction Metadata for MTY_55(2020) id ff54d0c0-f54e-4412-87c2-c4fc44b4f524", - "key": "ff54d0c0-f54e-4412-87c2-c4fc44b4f524", - "label": "MTY_55(2020) metadata", - "value": "26852" - }, - { - "description": "Jurisdiction Metadata for MTY_38(2020) id 58c1e164-2d41-44b6-a9eb-1a507110982c", - "key": "58c1e164-2d41-44b6-a9eb-1a507110982c", - "label": "MTY_38(2020) metadata", - "value": "26853" - }, - { - "description": "Jurisdiction Metadata for MTY_54(2020) id 1488c799-7afe-47c0-937d-4ed1ca775f7b", - "key": "1488c799-7afe-47c0-937d-4ed1ca775f7b", - "label": "MTY_54(2020) metadata", - "value": "26854" - }, - { - "description": "Jurisdiction Metadata for MTY_18(2020) id 956d9631-fc86-412d-8f96-b5634e78b818", - "key": "956d9631-fc86-412d-8f96-b5634e78b818", - "label": "MTY_18(2020) metadata", - "value": "26855" - }, - { - "description": "Jurisdiction Metadata for MTY_15(2020) id 8405aff1-840a-48f1-83e5-4a1640d85740", - "key": "8405aff1-840a-48f1-83e5-4a1640d85740", - "label": "MTY_15(2020) metadata", - "value": "26856" - }, - { - "description": "Jurisdiction Metadata for MTY_52(2020) id f0b2a83e-3cf2-4b35-935c-08d5c1056dfb", - "key": "f0b2a83e-3cf2-4b35-935c-08d5c1056dfb", - "label": "MTY_52(2020) metadata", - "value": "26857" - }, - { - "description": "Jurisdiction Metadata for MTY_56(2020) id 40fddf53-2172-45da-b5cb-658b78ed6812", - "key": "40fddf53-2172-45da-b5cb-658b78ed6812", - "label": "MTY_56(2020) metadata", - "value": "26858" - }, - { - "description": "Jurisdiction Metadata for MTY_30(2020) id dd3a3b74-f12d-4cbc-a6fd-c9252b8d4fdf", - "key": "dd3a3b74-f12d-4cbc-a6fd-c9252b8d4fdf", - "label": "MTY_30(2020) metadata", - "value": "26859" - }, - { - "description": "Jurisdiction Metadata for MTY_59(2020) id c11e7742-6362-48d1-bd06-22e901f1cf03", - "key": "c11e7742-6362-48d1-bd06-22e901f1cf03", - "label": "MTY_59(2020) metadata", - "value": "26860" - }, - { - "description": "Jurisdiction Metadata for MTY_35(2020) id 99410108-11e2-4f99-86a6-ee4f8926390d", - "key": "99410108-11e2-4f99-86a6-ee4f8926390d", - "label": "MTY_35(2020) metadata", - "value": "26861" - }, - { - "description": "Jurisdiction Metadata for MTY_23(2020) id 1f942272-b047-4ab5-9010-b5a3e4bda95e", - "key": "1f942272-b047-4ab5-9010-b5a3e4bda95e", - "label": "MTY_23(2020) metadata", - "value": "26862" - }, - { - "description": "Jurisdiction Metadata for MTY_73(2020) id 0a591a15-7411-443a-925d-12ddb0b59ef4", - "key": "0a591a15-7411-443a-925d-12ddb0b59ef4", - "label": "MTY_73(2020) metadata", - "value": "26863" - }, - { - "description": "Jurisdiction Metadata for MTY_46(2020) id 23a5e9cf-1feb-46f5-b6b6-9fb0089acb68", - "key": "23a5e9cf-1feb-46f5-b6b6-9fb0089acb68", - "label": "MTY_46(2020) metadata", - "value": "26864" - }, - { - "description": "Jurisdiction Metadata for MTY_26(2020) id 61c72689-e8d5-4a80-88b7-592b312fa8b2", - "key": "61c72689-e8d5-4a80-88b7-592b312fa8b2", - "label": "MTY_26(2020) metadata", - "value": "26865" - }, - { - "description": "Jurisdiction Metadata for MTY_16(2020) id a1e1f8e9-ad4e-48c4-9a72-7d51763358d5", - "key": "a1e1f8e9-ad4e-48c4-9a72-7d51763358d5", - "label": "MTY_16(2020) metadata", - "value": "26866" - }, - { - "description": "Jurisdiction Metadata for MTY_62(2020) id 3d4b4521-a6f7-4d39-9de8-0d1d73483515", - "key": "3d4b4521-a6f7-4d39-9de8-0d1d73483515", - "label": "MTY_62(2020) metadata", - "value": "26867" - }, - { - "description": "Jurisdiction Metadata for MTY_33(2020) id 5f96a65a-38f6-455e-9cef-defd0134ddd6", - "key": "5f96a65a-38f6-455e-9cef-defd0134ddd6", - "label": "MTY_33(2020) metadata", - "value": "26868" - }, - { - "description": "Jurisdiction Metadata for MTY_2(2020) id 1c3079ac-7379-4b44-97bb-39ed7b012cab", - "key": "1c3079ac-7379-4b44-97bb-39ed7b012cab", - "label": "MTY_2(2020) metadata", - "value": "26869" - }, - { - "description": "Jurisdiction Metadata for MTY_39(2020) id 13612c9d-e206-48e7-a214-e671900a475a", - "key": "13612c9d-e206-48e7-a214-e671900a475a", - "label": "MTY_39(2020) metadata", - "value": "26870" - }, - { - "description": "Jurisdiction Metadata for MTY_20(2020) id 8573b2a5-89fd-49cc-b5b2-781866c676c2", - "key": "8573b2a5-89fd-49cc-b5b2-781866c676c2", - "label": "MTY_20(2020) metadata", - "value": "26871" - }, - { - "description": "Jurisdiction Metadata for MTY_14(2020) id 98c3a015-61e6-49fc-89f7-4871c4146f9a", - "key": "98c3a015-61e6-49fc-89f7-4871c4146f9a", - "label": "MTY_14(2020) metadata", - "value": "26872" - }, - { - "description": "Jurisdiction Metadata for MTY_8(2020) id 537d9290-0b44-49f1-93ec-e92076f743a8", - "key": "537d9290-0b44-49f1-93ec-e92076f743a8", - "label": "MTY_8(2020) metadata", - "value": "26873" - }, - { - "description": "Jurisdiction Metadata for MTY_41(2020) id a7eb70d5-4d89-436a-a9cd-2f699b28feb8", - "key": "a7eb70d5-4d89-436a-a9cd-2f699b28feb8", - "label": "MTY_41(2020) metadata", - "value": "26874" - }, - { - "description": "Jurisdiction Metadata for MTY_72(2020) id 201100c4-9d3b-4bf2-84c4-f64bd9f5ac60", - "key": "201100c4-9d3b-4bf2-84c4-f64bd9f5ac60", - "label": "MTY_72(2020) metadata", - "value": "26875" - }, - { - "description": "Jurisdiction Metadata for MTY_4(2020) id 7da2521e-2330-40bf-8f5f-54b3fcbf2544", - "key": "7da2521e-2330-40bf-8f5f-54b3fcbf2544", - "label": "MTY_4(2020) metadata", - "value": "26876" - }, - { - "description": "Jurisdiction Metadata for MTY_12(2020) id 0e33130e-a599-4daf-b92a-3bd4f7d20682", - "key": "0e33130e-a599-4daf-b92a-3bd4f7d20682", - "label": "MTY_12(2020) metadata", - "value": "26877" - }, - { - "description": "Jurisdiction Metadata for MTY_1(2020) id 9fb660c6-966c-43b4-9d13-f2011bbab26d", - "key": "9fb660c6-966c-43b4-9d13-f2011bbab26d", - "label": "MTY_1(2020) metadata", - "value": "26878" - }, - { - "description": "Jurisdiction Metadata for MTY_6(2020) id bba866f2-48bf-4716-a875-3768bdf55c00", - "key": "bba866f2-48bf-4716-a875-3768bdf55c00", - "label": "MTY_6(2020) metadata", - "value": "26879" - }, - { - "description": "Jurisdiction Metadata for MTY_61(2020) id e2580b98-fc88-4b48-ac0c-ac30c0745820", - "key": "e2580b98-fc88-4b48-ac0c-ac30c0745820", - "label": "MTY_61(2020) metadata", - "value": "26880" - }, - { - "description": "Jurisdiction Metadata for MTY_11(2020) id f6e262ad-e2cb-4750-9c79-a6787cbb6620", - "key": "f6e262ad-e2cb-4750-9c79-a6787cbb6620", - "label": "MTY_11(2020) metadata", - "value": "26881" - }, - { - "description": "Jurisdiction Metadata for MTY_32(2020) id 4548de9f-5fa1-46db-a208-1d85f07fee6f", - "key": "4548de9f-5fa1-46db-a208-1d85f07fee6f", - "label": "MTY_32(2020) metadata", - "value": "26882" - }, - { - "description": "Jurisdiction Metadata for Madzaela(2020) id 610c2294-c5ee-43bb-85a7-2f14af70c93e", - "key": "610c2294-c5ee-43bb-85a7-2f14af70c93e", - "label": "Madzaela(2020) metadata", - "value": "26883" - }, - { - "description": "Jurisdiction Metadata for Robby_NHC id 0b2021fe-03ab-4b4d-b529-850e7a2fdca1", - "key": "0b2021fe-03ab-4b4d-b529-850e7a2fdca1", - "label": "Robby_NHC metadata", - "value": "26884" - }, - { - "description": "Jurisdiction Metadata for MDZ_88(2020) id 311c0034-bfba-408b-af88-ff65a561fdb2", - "key": "311c0034-bfba-408b-af88-ff65a561fdb2", - "label": "MDZ_88(2020) metadata", - "value": "26885" - }, - { - "description": "Jurisdiction Metadata for MDZ_96(2020) id ad20e9ff-cf3c-4648-ad53-3138ea7c03dd", - "key": "ad20e9ff-cf3c-4648-ad53-3138ea7c03dd", - "label": "MDZ_96(2020) metadata", - "value": "26886" - }, - { - "description": "Jurisdiction Metadata for MDZ_65(2020) id da5cf948-15d8-4dda-a8a4-40a444875151", - "key": "da5cf948-15d8-4dda-a8a4-40a444875151", - "label": "MDZ_65(2020) metadata", - "value": "26887" - }, - { - "description": "Jurisdiction Metadata for MDZ_63(2020) id 080637e9-0140-4c33-a87d-2da83dc8abbb", - "key": "080637e9-0140-4c33-a87d-2da83dc8abbb", - "label": "MDZ_63(2020) metadata", - "value": "26888" - }, - { - "description": "Jurisdiction Metadata for MDZ_108(2020) id 3d155150-e300-4a96-837e-f29799d6f30c", - "key": "3d155150-e300-4a96-837e-f29799d6f30c", - "label": "MDZ_108(2020) metadata", - "value": "26889" - }, - { - "description": "Jurisdiction Metadata for MDZ_41(2020) id 9ac606bc-50f4-4b3b-9ccc-26dc6290f5b6", - "key": "9ac606bc-50f4-4b3b-9ccc-26dc6290f5b6", - "label": "MDZ_41(2020) metadata", - "value": "26890" - }, - { - "description": "Jurisdiction Metadata for MDZ_16(2020) id e6c63239-2005-4d5b-b325-e2399c22e93d", - "key": "e6c63239-2005-4d5b-b325-e2399c22e93d", - "label": "MDZ_16(2020) metadata", - "value": "26891" - }, - { - "description": "Jurisdiction Metadata for MDZ_48(2020) id c897e235-2a87-4c87-8292-8c2f8c70a2cf", - "key": "c897e235-2a87-4c87-8292-8c2f8c70a2cf", - "label": "MDZ_48(2020) metadata", - "value": "26892" - }, - { - "description": "Jurisdiction Metadata for MDZ_42(2020) id 39a2e639-8756-4f77-bdf5-532dba83f931", - "key": "39a2e639-8756-4f77-bdf5-532dba83f931", - "label": "MDZ_42(2020) metadata", - "value": "26893" - }, - { - "description": "Jurisdiction Metadata for MDZ_33(2020) id 379d0640-f60b-459a-bcf0-94a90ffc6811", - "key": "379d0640-f60b-459a-bcf0-94a90ffc6811", - "label": "MDZ_33(2020) metadata", - "value": "26894" - }, - { - "description": "Jurisdiction Metadata for MDZ_71(2020) id 1d2cba97-8d81-49c2-a2ae-7c8689241cad", - "key": "1d2cba97-8d81-49c2-a2ae-7c8689241cad", - "label": "MDZ_71(2020) metadata", - "value": "26895" - }, - { - "description": "Jurisdiction Metadata for MDZ_84(2020) id faae4b63-3e30-4370-a7df-283242148e07", - "key": "faae4b63-3e30-4370-a7df-283242148e07", - "label": "MDZ_84(2020) metadata", - "value": "26896" - }, - { - "description": "Jurisdiction Metadata for MDZ_59(2020) id 5a3e0851-669f-4c49-9e6d-cf7d69b385d1", - "key": "5a3e0851-669f-4c49-9e6d-cf7d69b385d1", - "label": "MDZ_59(2020) metadata", - "value": "26897" - }, - { - "description": "Jurisdiction Metadata for MDZ_8(2020) id 55824e9a-56a6-4fba-9ea8-cc1567e94cf4", - "key": "55824e9a-56a6-4fba-9ea8-cc1567e94cf4", - "label": "MDZ_8(2020) metadata", - "value": "26898" - }, - { - "description": "Jurisdiction Metadata for MDZ_95(2020) id 83cda347-0c8d-48e2-9c42-48a366da9981", - "key": "83cda347-0c8d-48e2-9c42-48a366da9981", - "label": "MDZ_95(2020) metadata", - "value": "26899" - }, - { - "description": "Jurisdiction Metadata for MDZ_101(2020) id 9e1ea8ce-56b3-4d67-9786-2d08b174c45f", - "key": "9e1ea8ce-56b3-4d67-9786-2d08b174c45f", - "label": "MDZ_101(2020) metadata", - "value": "26900" - }, - { - "description": "Jurisdiction Metadata for MDZ_55(2020) id 05966091-bf9a-4283-9b9b-5563e2b079ce", - "key": "05966091-bf9a-4283-9b9b-5563e2b079ce", - "label": "MDZ_55(2020) metadata", - "value": "26901" - }, - { - "description": "Jurisdiction Metadata for MDZ_109(2020) id edd7ef8f-a5c0-4808-b93e-58ece1d45503", - "key": "edd7ef8f-a5c0-4808-b93e-58ece1d45503", - "label": "MDZ_109(2020) metadata", - "value": "26902" - }, - { - "description": "Jurisdiction Metadata for MDZ_5(2020) id 95876642-6dc7-4924-ae82-b0c7bbaf6185", - "key": "95876642-6dc7-4924-ae82-b0c7bbaf6185", - "label": "MDZ_5(2020) metadata", - "value": "26903" - }, - { - "description": "Jurisdiction Metadata for MDZ_76(2020) id 1a9aa50b-0fa5-4836-86f1-f643ad3b6f7e", - "key": "1a9aa50b-0fa5-4836-86f1-f643ad3b6f7e", - "label": "MDZ_76(2020) metadata", - "value": "26904" - }, - { - "description": "Jurisdiction Metadata for MDZ_72(2020) id b9aa7aa9-48cc-486a-bccb-e06a2e844097", - "key": "b9aa7aa9-48cc-486a-bccb-e06a2e844097", - "label": "MDZ_72(2020) metadata", - "value": "26905" - }, - { - "description": "Jurisdiction Metadata for MDZ_31(2020) id 3ef67edb-7933-4121-b227-416298c89939", - "key": "3ef67edb-7933-4121-b227-416298c89939", - "label": "MDZ_31(2020) metadata", - "value": "26906" - }, - { - "description": "Jurisdiction Metadata for MDZ_2(2020) id 16cdd2a2-0844-4808-a52d-4c84991510a8", - "key": "16cdd2a2-0844-4808-a52d-4c84991510a8", - "label": "MDZ_2(2020) metadata", - "value": "26907" - }, - { - "description": "Jurisdiction Metadata for MDZ_25(2020) id 7abed387-d91f-4aac-862b-f61ad6af66ad", - "key": "7abed387-d91f-4aac-862b-f61ad6af66ad", - "label": "MDZ_25(2020) metadata", - "value": "26908" - }, - { - "description": "Jurisdiction Metadata for MDZ_50(2020) id b547c5c2-be00-4b0e-b651-78b3d1c0461a", - "key": "b547c5c2-be00-4b0e-b651-78b3d1c0461a", - "label": "MDZ_50(2020) metadata", - "value": "26909" - }, - { - "description": "Jurisdiction Metadata for MDZ_20(2020) id 79f466c9-2b61-471d-9a5c-e1ff21cf41cb", - "key": "79f466c9-2b61-471d-9a5c-e1ff21cf41cb", - "label": "MDZ_20(2020) metadata", - "value": "26910" - }, - { - "description": "Jurisdiction Metadata for MDZ_21(2020) id 6d8ab228-b8c0-487d-9759-f14611d0de2c", - "key": "6d8ab228-b8c0-487d-9759-f14611d0de2c", - "label": "MDZ_21(2020) metadata", - "value": "26911" - }, - { - "description": "Jurisdiction Metadata for MDZ_102(2020) id 7eb04c27-d3ee-4610-b180-7714810e97a0", - "key": "7eb04c27-d3ee-4610-b180-7714810e97a0", - "label": "MDZ_102(2020) metadata", - "value": "26912" - }, - { - "description": "Jurisdiction Metadata for MDZ_46(2020) id a93ed444-bb14-42bc-ac91-9ea8c4e4e795", - "key": "a93ed444-bb14-42bc-ac91-9ea8c4e4e795", - "label": "MDZ_46(2020) metadata", - "value": "26913" - }, - { - "description": "Jurisdiction Metadata for MDZ_12(2020) id 56cd9c5d-3482-4cf6-8236-7995593e4ee2", - "key": "56cd9c5d-3482-4cf6-8236-7995593e4ee2", - "label": "MDZ_12(2020) metadata", - "value": "26914" - }, - { - "description": "Jurisdiction Metadata for MDZ_56(2020) id f3392e75-a29e-49fb-ae07-89044ec04e0d", - "key": "f3392e75-a29e-49fb-ae07-89044ec04e0d", - "label": "MDZ_56(2020) metadata", - "value": "26915" - }, - { - "description": "Jurisdiction Metadata for MDZ_75(2020) id b647f272-f672-4487-a865-f5e536128db4", - "key": "b647f272-f672-4487-a865-f5e536128db4", - "label": "MDZ_75(2020) metadata", - "value": "26916" - }, - { - "description": "Jurisdiction Metadata for MDZ_18(2020) id e52de79e-de28-40fb-857e-9bcdba4441e1", - "key": "e52de79e-de28-40fb-857e-9bcdba4441e1", - "label": "MDZ_18(2020) metadata", - "value": "26917" - }, - { - "description": "Jurisdiction Metadata for MDZ_3(2020) id de08a00b-7613-4586-936e-ea488e0b52fd", - "key": "de08a00b-7613-4586-936e-ea488e0b52fd", - "label": "MDZ_3(2020) metadata", - "value": "26918" - }, - { - "description": "Jurisdiction Metadata for MDZ_14(2020) id 38565ade-af3a-46f1-a090-0dc52b622456", - "key": "38565ade-af3a-46f1-a090-0dc52b622456", - "label": "MDZ_14(2020) metadata", - "value": "26919" - }, - { - "description": "Jurisdiction Metadata for MDZ_40(2020) id b861ca2e-d768-47d7-97ab-20c312156536", - "key": "b861ca2e-d768-47d7-97ab-20c312156536", - "label": "MDZ_40(2020) metadata", - "value": "26920" - }, - { - "description": "Jurisdiction Metadata for MDZ_80(2020) id eb96c8d4-4a88-40d0-8bb8-9534dfb2f6e5", - "key": "eb96c8d4-4a88-40d0-8bb8-9534dfb2f6e5", - "label": "MDZ_80(2020) metadata", - "value": "26921" - }, - { - "description": "Jurisdiction Metadata for MDZ_90(2020) id 2362ab2f-9aea-402c-b4cc-deea9f3b1c4d", - "key": "2362ab2f-9aea-402c-b4cc-deea9f3b1c4d", - "label": "MDZ_90(2020) metadata", - "value": "26922" - }, - { - "description": "Jurisdiction Metadata for MDZ_36(2020) id f48f401e-c7d6-47da-a8c0-e52ac132e80a", - "key": "f48f401e-c7d6-47da-a8c0-e52ac132e80a", - "label": "MDZ_36(2020) metadata", - "value": "26923" - }, - { - "description": "Jurisdiction Metadata for MDZ_107(2020) id 5575a953-d7fc-4b01-9c9b-260b1bb36590", - "key": "5575a953-d7fc-4b01-9c9b-260b1bb36590", - "label": "MDZ_107(2020) metadata", - "value": "26924" - }, - { - "description": "Jurisdiction Metadata for MDZ_74(2020) id 173f6212-3949-444d-bb2f-dd121c214173", - "key": "173f6212-3949-444d-bb2f-dd121c214173", - "label": "MDZ_74(2020) metadata", - "value": "26925" - }, - { - "description": "Jurisdiction Metadata for MDZ_23(2020) id 1845ea6d-d4d7-4fb7-b19e-764cefffe5cd", - "key": "1845ea6d-d4d7-4fb7-b19e-764cefffe5cd", - "label": "MDZ_23(2020) metadata", - "value": "26926" - }, - { - "description": "Jurisdiction Metadata for MDZ_38(2020) id a067c665-ff07-4bb7-bf5f-f4e10d9db987", - "key": "a067c665-ff07-4bb7-bf5f-f4e10d9db987", - "label": "MDZ_38(2020) metadata", - "value": "26927" - }, - { - "description": "Jurisdiction Metadata for MDZ_9(2020) id 2f9e7c0f-1e77-41bc-98c5-ead99e3c37b9", - "key": "2f9e7c0f-1e77-41bc-98c5-ead99e3c37b9", - "label": "MDZ_9(2020) metadata", - "value": "26928" - }, - { - "description": "Jurisdiction Metadata for MDZ_94(2020) id b8be45a9-1faf-48ec-b34e-7d3ee16faa15", - "key": "b8be45a9-1faf-48ec-b34e-7d3ee16faa15", - "label": "MDZ_94(2020) metadata", - "value": "26929" - }, - { - "description": "Jurisdiction Metadata for MDZ_15(2020) id e49b5421-68ce-4f33-b5c2-94e65c4743b2", - "key": "e49b5421-68ce-4f33-b5c2-94e65c4743b2", - "label": "MDZ_15(2020) metadata", - "value": "26930" - }, - { - "description": "Jurisdiction Metadata for MDZ_6(2020) id c5ae84ce-15b1-42c2-a254-b7812f20d57a", - "key": "c5ae84ce-15b1-42c2-a254-b7812f20d57a", - "label": "MDZ_6(2020) metadata", - "value": "26931" - }, - { - "description": "Jurisdiction Metadata for MDZ_85(2020) id 8160ecad-1e78-44ef-83cb-a651dbcbfdbf", - "key": "8160ecad-1e78-44ef-83cb-a651dbcbfdbf", - "label": "MDZ_85(2020) metadata", - "value": "26932" - }, - { - "description": "Jurisdiction Metadata for MDZ_4(2020) id 2042a733-2db4-40a9-bcfa-578ffeb11e2e", - "key": "2042a733-2db4-40a9-bcfa-578ffeb11e2e", - "label": "MDZ_4(2020) metadata", - "value": "26933" - }, - { - "description": "Jurisdiction Metadata for MDZ_73(2020) id d67bb377-cb6e-48c7-8cc9-a1908215a00c", - "key": "d67bb377-cb6e-48c7-8cc9-a1908215a00c", - "label": "MDZ_73(2020) metadata", - "value": "26934" - }, - { - "description": "Jurisdiction Metadata for MDZ_62(2020) id 654a0b42-dbbc-4453-814d-30a1459ca4c2", - "key": "654a0b42-dbbc-4453-814d-30a1459ca4c2", - "label": "MDZ_62(2020) metadata", - "value": "26935" - }, - { - "description": "Jurisdiction Metadata for MDZ_47(2020) id a3675630-ebf9-4994-b7c7-4d512fc32b42", - "key": "a3675630-ebf9-4994-b7c7-4d512fc32b42", - "label": "MDZ_47(2020) metadata", - "value": "26936" - }, - { - "description": "Jurisdiction Metadata for MDZ_43(2020) id babebc9e-255d-4dbb-8c1d-9afc4ceb226f", - "key": "babebc9e-255d-4dbb-8c1d-9afc4ceb226f", - "label": "MDZ_43(2020) metadata", - "value": "26937" - }, - { - "description": "Jurisdiction Metadata for MDZ_27(2020) id 2ea49a5a-551f-4710-a5df-c664cc636d60", - "key": "2ea49a5a-551f-4710-a5df-c664cc636d60", - "label": "MDZ_27(2020) metadata", - "value": "26938" - }, - { - "description": "Jurisdiction Metadata for MDZ_98(2020) id bc35c2fa-a2c4-45c1-ae5d-a4e09fa456ef", - "key": "bc35c2fa-a2c4-45c1-ae5d-a4e09fa456ef", - "label": "MDZ_98(2020) metadata", - "value": "26939" - }, - { - "description": "Jurisdiction Metadata for MDZ_52(2020) id ea68bb29-11c4-4b68-a4ea-833c456d73c0", - "key": "ea68bb29-11c4-4b68-a4ea-833c456d73c0", - "label": "MDZ_52(2020) metadata", - "value": "26940" - }, - { - "description": "Jurisdiction Metadata for MDZ_7(2020) id 42ac5b9d-e73c-4972-9e1c-e953f1adee5b", - "key": "42ac5b9d-e73c-4972-9e1c-e953f1adee5b", - "label": "MDZ_7(2020) metadata", - "value": "26941" - }, - { - "description": "Jurisdiction Metadata for MDZ_82(2020) id 7f4a5586-8a4d-41ba-abea-93d73b9cf276", - "key": "7f4a5586-8a4d-41ba-abea-93d73b9cf276", - "label": "MDZ_82(2020) metadata", - "value": "26942" - }, - { - "description": "Jurisdiction Metadata for MDZ_54(2020) id 17974e23-34be-4ccf-a86a-69bb10a4ffbf", - "key": "17974e23-34be-4ccf-a86a-69bb10a4ffbf", - "label": "MDZ_54(2020) metadata", - "value": "26943" - }, - { - "description": "Jurisdiction Metadata for MDZ_64(2020) id 81c454b8-dcfc-462f-952e-00e90afc9beb", - "key": "81c454b8-dcfc-462f-952e-00e90afc9beb", - "label": "MDZ_64(2020) metadata", - "value": "26944" - }, - { - "description": "Jurisdiction Metadata for MDZ_87(2020) id 54734f84-0a61-4c07-b95a-3dfa93eaa03f", - "key": "54734f84-0a61-4c07-b95a-3dfa93eaa03f", - "label": "MDZ_87(2020) metadata", - "value": "26945" - }, - { - "description": "Jurisdiction Metadata for MDZ_83(2020) id e2a4013a-2601-4c8b-a471-5131c2b50568", - "key": "e2a4013a-2601-4c8b-a471-5131c2b50568", - "label": "MDZ_83(2020) metadata", - "value": "26946" - }, - { - "description": "Jurisdiction Metadata for MDZ_58(2020) id 22b0327a-3bde-49c1-b36a-c397e3f35a97", - "key": "22b0327a-3bde-49c1-b36a-c397e3f35a97", - "label": "MDZ_58(2020) metadata", - "value": "26947" - }, - { - "description": "Jurisdiction Metadata for MDZ_13(2020) id 344efad9-39d9-44b2-bf0e-4939fba0d357", - "key": "344efad9-39d9-44b2-bf0e-4939fba0d357", - "label": "MDZ_13(2020) metadata", - "value": "26948" - }, - { - "description": "Jurisdiction Metadata for MDZ_89(2020) id 61fcd075-a9db-433b-91ac-aba7d2348eae", - "key": "61fcd075-a9db-433b-91ac-aba7d2348eae", - "label": "MDZ_89(2020) metadata", - "value": "26949" - }, - { - "description": "Jurisdiction Metadata for MDZ_17(2020) id 12c9cc2b-22a7-45bc-be14-42243337580c", - "key": "12c9cc2b-22a7-45bc-be14-42243337580c", - "label": "MDZ_17(2020) metadata", - "value": "26950" - }, - { - "description": "Jurisdiction Metadata for MDZ_45(2020) id 11ef8ef5-9cdb-49f2-9f0e-c50d15055b6f", - "key": "11ef8ef5-9cdb-49f2-9f0e-c50d15055b6f", - "label": "MDZ_45(2020) metadata", - "value": "26951" - }, - { - "description": "Jurisdiction Metadata for MDZ_91(2020) id 4cfb698b-6237-4546-84cb-6f1e6bfda297", - "key": "4cfb698b-6237-4546-84cb-6f1e6bfda297", - "label": "MDZ_91(2020) metadata", - "value": "26952" - }, - { - "description": "Jurisdiction Metadata for MDZ_1(2020) id 3451ef70-e0f1-44d0-877e-23b94287187d", - "key": "3451ef70-e0f1-44d0-877e-23b94287187d", - "label": "MDZ_1(2020) metadata", - "value": "26953" - }, - { - "description": "Jurisdiction Metadata for MDZ_105(2020) id b829d7ee-676f-46db-845c-99c46f8d1a5b", - "key": "b829d7ee-676f-46db-845c-99c46f8d1a5b", - "label": "MDZ_105(2020) metadata", - "value": "26954" - }, - { - "description": "Jurisdiction Metadata for MDZ_99(2020) id 66e11813-84e5-4a7b-b017-432ce6b58469", - "key": "66e11813-84e5-4a7b-b017-432ce6b58469", - "label": "MDZ_99(2020) metadata", - "value": "26955" - }, - { - "description": "Jurisdiction Metadata for MDZ_60(2020) id 20ea9455-41be-47e2-9dca-1c0dad336c09", - "key": "20ea9455-41be-47e2-9dca-1c0dad336c09", - "label": "MDZ_60(2020) metadata", - "value": "26956" - }, - { - "description": "Jurisdiction Metadata for MDZ_86(2020) id 1f91c7b1-1228-490c-bbf3-610e2d0ce23a", - "key": "1f91c7b1-1228-490c-bbf3-610e2d0ce23a", - "label": "MDZ_86(2020) metadata", - "value": "26957" - }, - { - "description": "Jurisdiction Metadata for MDZ_61(2020) id b33db197-06ea-4399-b095-f2804008a9d0", - "key": "b33db197-06ea-4399-b095-f2804008a9d0", - "label": "MDZ_61(2020) metadata", - "value": "26958" - }, - { - "description": "Jurisdiction Metadata for MDZ_97(2020) id aaabf13e-0ea1-4598-b3a7-4c17e8660a4d", - "key": "aaabf13e-0ea1-4598-b3a7-4c17e8660a4d", - "label": "MDZ_97(2020) metadata", - "value": "26959" - }, - { - "description": "Jurisdiction Metadata for MDZ_106(2020) id 455abd34-3b6b-4e07-acf1-0bb2c3dd3a48", - "key": "455abd34-3b6b-4e07-acf1-0bb2c3dd3a48", - "label": "MDZ_106(2020) metadata", - "value": "26960" - }, - { - "description": "Jurisdiction Metadata for MDZ_70(2020) id 569ef1a2-013d-4266-9dac-23d321919267", - "key": "569ef1a2-013d-4266-9dac-23d321919267", - "label": "MDZ_70(2020) metadata", - "value": "26961" - }, - { - "description": "Jurisdiction Metadata for MDZ_66(2020) id 0d40b874-0cee-4c61-a387-606f3034380a", - "key": "0d40b874-0cee-4c61-a387-606f3034380a", - "label": "MDZ_66(2020) metadata", - "value": "26962" - }, - { - "description": "Jurisdiction Metadata for MDZ_30(2020) id 090504de-3547-43a3-8b56-28fa8f1b168d", - "key": "090504de-3547-43a3-8b56-28fa8f1b168d", - "label": "MDZ_30(2020) metadata", - "value": "26963" - }, - { - "description": "Jurisdiction Metadata for MDZ_29(2020) id c59cfef1-67df-4218-a916-282ee9654798", - "key": "c59cfef1-67df-4218-a916-282ee9654798", - "label": "MDZ_29(2020) metadata", - "value": "26964" - }, - { - "description": "Jurisdiction Metadata for MDZ_100(2020) id a4811ddd-88fe-4837-8bf6-5aefc3a5c5a7", - "key": "a4811ddd-88fe-4837-8bf6-5aefc3a5c5a7", - "label": "MDZ_100(2020) metadata", - "value": "26965" - }, - { - "description": "Jurisdiction Metadata for MDZ_53(2020) id 1a812720-8d56-4b7e-b9aa-61760708b296", - "key": "1a812720-8d56-4b7e-b9aa-61760708b296", - "label": "MDZ_53(2020) metadata", - "value": "26966" - }, - { - "description": "Jurisdiction Metadata for MDZ_34(2020) id 5132f9b1-ea00-4bac-ab8b-8f71248c545f", - "key": "5132f9b1-ea00-4bac-ab8b-8f71248c545f", - "label": "MDZ_34(2020) metadata", - "value": "26967" - }, - { - "description": "Jurisdiction Metadata for MDZ_67(2020) id 06b21d80-2f53-4572-b39b-abbf66548887", - "key": "06b21d80-2f53-4572-b39b-abbf66548887", - "label": "MDZ_67(2020) metadata", - "value": "26968" - }, - { - "description": "Jurisdiction Metadata for MDZ_22(2020) id 28c7dde5-a299-4049-8189-5662a2377b6a", - "key": "28c7dde5-a299-4049-8189-5662a2377b6a", - "label": "MDZ_22(2020) metadata", - "value": "26969" - }, - { - "description": "Jurisdiction Metadata for MDZ_79(2020) id 9d874dcb-a762-41a1-9a68-57c48a6f0f5d", - "key": "9d874dcb-a762-41a1-9a68-57c48a6f0f5d", - "label": "MDZ_79(2020) metadata", - "value": "26970" - }, - { - "description": "Jurisdiction Metadata for MDZ_35(2020) id f689d7c9-f02e-4254-b4c1-689284c2207a", - "key": "f689d7c9-f02e-4254-b4c1-689284c2207a", - "label": "MDZ_35(2020) metadata", - "value": "26971" - }, - { - "description": "Jurisdiction Metadata for MDZ_37(2020) id c54fbdac-6b2c-402e-b987-623ad143a05b", - "key": "c54fbdac-6b2c-402e-b987-623ad143a05b", - "label": "MDZ_37(2020) metadata", - "value": "26972" - }, - { - "description": "Jurisdiction Metadata for MDZ_111(2020) id c1f46443-6bbf-45cf-89a3-bc9663b1f95d", - "key": "c1f46443-6bbf-45cf-89a3-bc9663b1f95d", - "label": "MDZ_111(2020) metadata", - "value": "26973" - }, - { - "description": "Jurisdiction Metadata for MDZ_110(2020) id f0aee417-49f8-430e-8384-f3936486bf7b", - "key": "f0aee417-49f8-430e-8384-f3936486bf7b", - "label": "MDZ_110(2020) metadata", - "value": "26974" - }, - { - "description": "Jurisdiction Metadata for MDZ_103(2020) id 1748bed6-9490-416a-833c-a8612323d6ef", - "key": "1748bed6-9490-416a-833c-a8612323d6ef", - "label": "MDZ_103(2020) metadata", - "value": "26975" - }, - { - "description": "Jurisdiction Metadata for MDZ_28(2020) id 048661de-3d39-4f7e-812f-d9dde54d0deb", - "key": "048661de-3d39-4f7e-812f-d9dde54d0deb", - "label": "MDZ_28(2020) metadata", - "value": "26976" - }, - { - "description": "Jurisdiction Metadata for MDZ_11(2020) id dd2db678-aa4a-4170-b92a-b38749739392", - "key": "dd2db678-aa4a-4170-b92a-b38749739392", - "label": "MDZ_11(2020) metadata", - "value": "26977" - }, - { - "description": "Jurisdiction Metadata for MDZ_44(2020) id b77b808b-38d6-4288-87a9-186a0074aaf1", - "key": "b77b808b-38d6-4288-87a9-186a0074aaf1", - "label": "MDZ_44(2020) metadata", - "value": "26978" - }, - { - "description": "Jurisdiction Metadata for MDZ_49(2020) id f87e8df3-29b2-4848-9900-46045688542c", - "key": "f87e8df3-29b2-4848-9900-46045688542c", - "label": "MDZ_49(2020) metadata", - "value": "26979" - }, - { - "description": "Jurisdiction Metadata for MDZ_81(2020) id 781a7fc9-dff3-4d45-85b2-43d1ae022ae7", - "key": "781a7fc9-dff3-4d45-85b2-43d1ae022ae7", - "label": "MDZ_81(2020) metadata", - "value": "26980" - }, - { - "description": "Jurisdiction Metadata for MDZ_39(2020) id 968dcd10-63b7-4476-828c-b854038eef39", - "key": "968dcd10-63b7-4476-828c-b854038eef39", - "label": "MDZ_39(2020) metadata", - "value": "26981" - }, - { - "description": "Jurisdiction Metadata for MDZ_78(2020) id 6a3fc7af-4613-4385-9e9d-1228b207b6c9", - "key": "6a3fc7af-4613-4385-9e9d-1228b207b6c9", - "label": "MDZ_78(2020) metadata", - "value": "26982" - }, - { - "description": "Jurisdiction Metadata for MDZ_92(2020) id db7bb659-fadc-4459-85e6-ba5cc02cb684", - "key": "db7bb659-fadc-4459-85e6-ba5cc02cb684", - "label": "MDZ_92(2020) metadata", - "value": "26983" - }, - { - "description": "Jurisdiction Metadata for MDZ_19(2020) id b1404075-90a4-4a18-b4ec-42589ba6e9bb", - "key": "b1404075-90a4-4a18-b4ec-42589ba6e9bb", - "label": "MDZ_19(2020) metadata", - "value": "26984" - }, - { - "description": "Jurisdiction Metadata for MDZ_69(2020) id ea4c385e-834a-40f3-bc5e-7979bdddf377", - "key": "ea4c385e-834a-40f3-bc5e-7979bdddf377", - "label": "MDZ_69(2020) metadata", - "value": "26985" - }, - { - "description": "Jurisdiction Metadata for MDZ_26(2020) id 54a2163e-fb97-4980-b8cd-0082a7b4c780", - "key": "54a2163e-fb97-4980-b8cd-0082a7b4c780", - "label": "MDZ_26(2020) metadata", - "value": "26986" - }, - { - "description": "Jurisdiction Metadata for MDZ_10(2020) id 019da98e-59fe-4cd0-a6e1-48b9706d8dd6", - "key": "019da98e-59fe-4cd0-a6e1-48b9706d8dd6", - "label": "MDZ_10(2020) metadata", - "value": "26987" - }, - { - "description": "Jurisdiction Metadata for MDZ_104(2020) id 3c4f93a9-4665-459f-af47-b01386816bc7", - "key": "3c4f93a9-4665-459f-af47-b01386816bc7", - "label": "MDZ_104(2020) metadata", - "value": "26988" - }, - { - "description": "Jurisdiction Metadata for MDZ_57(2020) id 8a129653-7a34-4448-a9b4-65b8d459a3c2", - "key": "8a129653-7a34-4448-a9b4-65b8d459a3c2", - "label": "MDZ_57(2020) metadata", - "value": "26989" - }, - { - "description": "Jurisdiction Metadata for MDZ_77(2020) id 10e5292e-e17d-48c7-90d9-ae28fb3ae24c", - "key": "10e5292e-e17d-48c7-90d9-ae28fb3ae24c", - "label": "MDZ_77(2020) metadata", - "value": "26990" - }, - { - "description": "Jurisdiction Metadata for MDZ_24(2020) id cf892f2d-761d-4c19-a5bf-da24aa86cca8", - "key": "cf892f2d-761d-4c19-a5bf-da24aa86cca8", - "label": "MDZ_24(2020) metadata", - "value": "26991" - }, - { - "description": "Jurisdiction Metadata for MDZ_68(2020) id b26124a8-09ef-4364-9d41-2326a44cdf5c", - "key": "b26124a8-09ef-4364-9d41-2326a44cdf5c", - "label": "MDZ_68(2020) metadata", - "value": "26992" - }, - { - "description": "Jurisdiction Metadata for MDZ_93(2020) id 8e830d10-7b1c-4add-97e4-249596ae5417", - "key": "8e830d10-7b1c-4add-97e4-249596ae5417", - "label": "MDZ_93(2020) metadata", - "value": "26993" - }, - { - "description": "Jurisdiction Metadata for MDZ_32(2020) id 309fae64-a6b5-4a7f-b7c6-e9d8c2ad8ff6", - "key": "309fae64-a6b5-4a7f-b7c6-e9d8c2ad8ff6", - "label": "MDZ_32(2020) metadata", - "value": "26994" - }, - { - "description": "Jurisdiction Metadata for MDZ_51(2020) id 0d3998e5-5d4d-43fc-95e4-7948cf599cea", - "key": "0d3998e5-5d4d-43fc-95e4-7948cf599cea", - "label": "MDZ_51(2020) metadata", - "value": "26995" - }, - { - "description": "Jurisdiction Metadata for Naviluli(2020) id fb370c3f-62d0-4ff1-b721-92bcc0e48820", - "key": "fb370c3f-62d0-4ff1-b721-92bcc0e48820", - "label": "Naviluli(2020) metadata", - "value": "26996" - }, - { - "description": "Jurisdiction Metadata for Chimutnde NHC id da372dbc-3d7e-4abe-a8c1-0ec97ccbec9f", - "key": "da372dbc-3d7e-4abe-a8c1-0ec97ccbec9f", - "label": "Chimutnde NHC metadata", - "value": "26997" - }, - { - "description": "Jurisdiction Metadata for NVI_28(2020) id 9cc00f20-e6e9-442d-9434-ac9aafdd0d5c", - "key": "9cc00f20-e6e9-442d-9434-ac9aafdd0d5c", - "label": "NVI_28(2020) metadata", - "value": "26998" - }, - { - "description": "Jurisdiction Metadata for NVI_32(2020) id 301a8e5b-20ec-47d3-86ca-2e2ed5099d17", - "key": "301a8e5b-20ec-47d3-86ca-2e2ed5099d17", - "label": "NVI_32(2020) metadata", - "value": "26999" - }, - { - "description": "Jurisdiction Metadata for NVI_48(2020) id b46ccc1e-e1ae-4cd0-b621-98924807c50b", - "key": "b46ccc1e-e1ae-4cd0-b621-98924807c50b", - "label": "NVI_48(2020) metadata", - "value": "27000" - }, - { - "description": "Jurisdiction Metadata for NVI_2(2020) id ff04843f-81b8-417e-833d-3d216568a7dd", - "key": "ff04843f-81b8-417e-833d-3d216568a7dd", - "label": "NVI_2(2020) metadata", - "value": "27001" - }, - { - "description": "Jurisdiction Metadata for NVI_21(2020) id 0b1533c0-99f5-4448-a4dc-ea3361958e82", - "key": "0b1533c0-99f5-4448-a4dc-ea3361958e82", - "label": "NVI_21(2020) metadata", - "value": "27002" - }, - { - "description": "Jurisdiction Metadata for NVI_11(2020) id 40bd4362-7749-4358-934e-d017b81c4ea4", - "key": "40bd4362-7749-4358-934e-d017b81c4ea4", - "label": "NVI_11(2020) metadata", - "value": "27003" - }, - { - "description": "Jurisdiction Metadata for NVI_30(2020) id 2a579050-06ed-4b71-8953-fae23ab46df4", - "key": "2a579050-06ed-4b71-8953-fae23ab46df4", - "label": "NVI_30(2020) metadata", - "value": "27004" - }, - { - "description": "Jurisdiction Metadata for NVI_40(2020) id 5c30ba5f-5791-4ed0-a17f-841669cb19d8", - "key": "5c30ba5f-5791-4ed0-a17f-841669cb19d8", - "label": "NVI_40(2020) metadata", - "value": "27005" - }, - { - "description": "Jurisdiction Metadata for NVI_45(2020) id cd369a6c-ac1d-4389-b77e-16fbd3e46e6d", - "key": "cd369a6c-ac1d-4389-b77e-16fbd3e46e6d", - "label": "NVI_45(2020) metadata", - "value": "27006" - }, - { - "description": "Jurisdiction Metadata for NVI_25(2020) id 75dcf885-6e40-4130-a346-ca3706714392", - "key": "75dcf885-6e40-4130-a346-ca3706714392", - "label": "NVI_25(2020) metadata", - "value": "27007" - }, - { - "description": "Jurisdiction Metadata for NVI_8(2020) id 76be3a6e-c4b4-4815-ae99-1a30442ca6d2", - "key": "76be3a6e-c4b4-4815-ae99-1a30442ca6d2", - "label": "NVI_8(2020) metadata", - "value": "27008" - }, - { - "description": "Jurisdiction Metadata for NVI_49(2020) id 9ae450a7-1e03-473c-8014-c420b472d453", - "key": "9ae450a7-1e03-473c-8014-c420b472d453", - "label": "NVI_49(2020) metadata", - "value": "27009" - }, - { - "description": "Jurisdiction Metadata for NVI_43(2020) id 5f3df4c8-78a5-4307-a634-5ce258bb63c4", - "key": "5f3df4c8-78a5-4307-a634-5ce258bb63c4", - "label": "NVI_43(2020) metadata", - "value": "27010" - }, - { - "description": "Jurisdiction Metadata for NVI_44(2020) id e5d60731-c01b-450b-893c-28d5b597cddf", - "key": "e5d60731-c01b-450b-893c-28d5b597cddf", - "label": "NVI_44(2020) metadata", - "value": "27011" - }, - { - "description": "Jurisdiction Metadata for NVI_7(2020) id 2bc3816e-7c2f-44a7-a13e-c9570dc71813", - "key": "2bc3816e-7c2f-44a7-a13e-c9570dc71813", - "label": "NVI_7(2020) metadata", - "value": "27012" - }, - { - "description": "Jurisdiction Metadata for NVI_18(2020) id 3a9107e9-27dd-438a-bbc7-592f16d0862e", - "key": "3a9107e9-27dd-438a-bbc7-592f16d0862e", - "label": "NVI_18(2020) metadata", - "value": "27013" - }, - { - "description": "Jurisdiction Metadata for NVI_47(2020) id 2fc2f70f-3f21-4f83-92c6-9ce9229dd03b", - "key": "2fc2f70f-3f21-4f83-92c6-9ce9229dd03b", - "label": "NVI_47(2020) metadata", - "value": "27014" - }, - { - "description": "Jurisdiction Metadata for NVI_6(2020) id 61ee8bb3-ae09-4822-b060-8e37f9982975", - "key": "61ee8bb3-ae09-4822-b060-8e37f9982975", - "label": "NVI_6(2020) metadata", - "value": "27015" - }, - { - "description": "Jurisdiction Metadata for NVI_1(2020) id 63964eec-fd2a-4657-9e14-03fc53549c49", - "key": "63964eec-fd2a-4657-9e14-03fc53549c49", - "label": "NVI_1(2020) metadata", - "value": "27016" - }, - { - "description": "Jurisdiction Metadata for NVI_23(2020) id 6cfafe50-4855-45ce-8c77-88392c9089ec", - "key": "6cfafe50-4855-45ce-8c77-88392c9089ec", - "label": "NVI_23(2020) metadata", - "value": "27017" - }, - { - "description": "Jurisdiction Metadata for NVI_14(2020) id 74f0ae3b-d77c-4b61-9957-aa6af4ddb94b", - "key": "74f0ae3b-d77c-4b61-9957-aa6af4ddb94b", - "label": "NVI_14(2020) metadata", - "value": "27018" - }, - { - "description": "Jurisdiction Metadata for NVI_35(2020) id 29b01a39-1346-4f07-8dd9-0ff052d8c938", - "key": "29b01a39-1346-4f07-8dd9-0ff052d8c938", - "label": "NVI_35(2020) metadata", - "value": "27019" - }, - { - "description": "Jurisdiction Metadata for NVI_50(2020) id 34323f33-2b7d-4b42-8b57-cf26d198d450", - "key": "34323f33-2b7d-4b42-8b57-cf26d198d450", - "label": "NVI_50(2020) metadata", - "value": "27020" - }, - { - "description": "Jurisdiction Metadata for NVI_19(2020) id a14fb6bf-391f-4df9-b920-0418b9606424", - "key": "a14fb6bf-391f-4df9-b920-0418b9606424", - "label": "NVI_19(2020) metadata", - "value": "27021" - }, - { - "description": "Jurisdiction Metadata for NVI_17(2020) id 8649461e-6653-45c8-a5b0-1b3c8a93a174", - "key": "8649461e-6653-45c8-a5b0-1b3c8a93a174", - "label": "NVI_17(2020) metadata", - "value": "27022" - }, - { - "description": "Jurisdiction Metadata for NVI_10(2020) id f2f10aaa-306c-4dc6-b670-4af887852747", - "key": "f2f10aaa-306c-4dc6-b670-4af887852747", - "label": "NVI_10(2020) metadata", - "value": "27023" - }, - { - "description": "Jurisdiction Metadata for NVI_16(2020) id 7db9734c-73fd-4a99-a0fe-d1eb8be38536", - "key": "7db9734c-73fd-4a99-a0fe-d1eb8be38536", - "label": "NVI_16(2020) metadata", - "value": "27024" - }, - { - "description": "Jurisdiction Metadata for NVI_4(2020) id ae34843b-21bb-4190-9d35-f3e9407661bd", - "key": "ae34843b-21bb-4190-9d35-f3e9407661bd", - "label": "NVI_4(2020) metadata", - "value": "27025" - }, - { - "description": "Jurisdiction Metadata for NVI_3(2020) id 8c8e6900-bdc7-4a16-8699-0bb9c1b83f98", - "key": "8c8e6900-bdc7-4a16-8699-0bb9c1b83f98", - "label": "NVI_3(2020) metadata", - "value": "27026" - }, - { - "description": "Jurisdiction Metadata for NVI_26(2020) id ba6229d1-9141-427d-a00a-23b886507a4d", - "key": "ba6229d1-9141-427d-a00a-23b886507a4d", - "label": "NVI_26(2020) metadata", - "value": "27027" - }, - { - "description": "Jurisdiction Metadata for NVI_15(2020) id a8029f0e-14b0-4f61-bbe8-c531979c82c6", - "key": "a8029f0e-14b0-4f61-bbe8-c531979c82c6", - "label": "NVI_15(2020) metadata", - "value": "27028" - }, - { - "description": "Jurisdiction Metadata for NVI_12(2020) id f0657ef2-8eac-4a11-9236-dc7ed68b0a5a", - "key": "f0657ef2-8eac-4a11-9236-dc7ed68b0a5a", - "label": "NVI_12(2020) metadata", - "value": "27029" - }, - { - "description": "Jurisdiction Metadata for NVI_46(2020) id 1d91c242-49c8-4b18-8349-49d60d845097", - "key": "1d91c242-49c8-4b18-8349-49d60d845097", - "label": "NVI_46(2020) metadata", - "value": "27030" - }, - { - "description": "Jurisdiction Metadata for NVI_36(2020) id a98d1c65-e63f-4871-9252-4a4788ed9aca", - "key": "a98d1c65-e63f-4871-9252-4a4788ed9aca", - "label": "NVI_36(2020) metadata", - "value": "27031" - }, - { - "description": "Jurisdiction Metadata for NVI_33(2020) id 7a50d98b-827a-41b1-ab69-91d16310dc46", - "key": "7a50d98b-827a-41b1-ab69-91d16310dc46", - "label": "NVI_33(2020) metadata", - "value": "27032" - }, - { - "description": "Jurisdiction Metadata for NVI_34(2020) id 9622b1b1-34fa-4bae-971e-0276f2250dfd", - "key": "9622b1b1-34fa-4bae-971e-0276f2250dfd", - "label": "NVI_34(2020) metadata", - "value": "27033" - }, - { - "description": "Jurisdiction Metadata for NVI_39(2020) id 7ad6c5f5-4b29-4063-b978-bb02e93fcbd7", - "key": "7ad6c5f5-4b29-4063-b978-bb02e93fcbd7", - "label": "NVI_39(2020) metadata", - "value": "27034" - }, - { - "description": "Jurisdiction Metadata for NVI_41(2020) id c32b9414-b831-494b-ab88-514500d27e33", - "key": "c32b9414-b831-494b-ab88-514500d27e33", - "label": "NVI_41(2020) metadata", - "value": "27035" - }, - { - "description": "Jurisdiction Metadata for NVI_5(2020) id c12f0b5b-fc5d-412c-b479-b4cc4225240c", - "key": "c12f0b5b-fc5d-412c-b479-b4cc4225240c", - "label": "NVI_5(2020) metadata", - "value": "27036" - }, - { - "description": "Jurisdiction Metadata for NVI_24(2020) id 164f48c1-6367-4260-a6c3-68d0cc81ce9c", - "key": "164f48c1-6367-4260-a6c3-68d0cc81ce9c", - "label": "NVI_24(2020) metadata", - "value": "27037" - }, - { - "description": "Jurisdiction Metadata for NVI_13(2020) id 36fa7b46-2471-460a-89eb-2ca9bea062bd", - "key": "36fa7b46-2471-460a-89eb-2ca9bea062bd", - "label": "NVI_13(2020) metadata", - "value": "27038" - }, - { - "description": "Jurisdiction Metadata for NVI_20(2020) id 9d562276-960e-484f-80fb-a5593552c68e", - "key": "9d562276-960e-484f-80fb-a5593552c68e", - "label": "NVI_20(2020) metadata", - "value": "27039" - }, - { - "description": "Jurisdiction Metadata for NVI_38(2020) id be2ab43d-3631-49f2-b880-c976585da8e5", - "key": "be2ab43d-3631-49f2-b880-c976585da8e5", - "label": "NVI_38(2020) metadata", - "value": "27040" - }, - { - "description": "Jurisdiction Metadata for NVI_22(2020) id c8946b6c-926d-4b2a-be56-be82b541e3db", - "key": "c8946b6c-926d-4b2a-be56-be82b541e3db", - "label": "NVI_22(2020) metadata", - "value": "27041" - }, - { - "description": "Jurisdiction Metadata for NVI_27(2020) id 14c3dbd5-2c20-4d23-be85-001e70a7743a", - "key": "14c3dbd5-2c20-4d23-be85-001e70a7743a", - "label": "NVI_27(2020) metadata", - "value": "27042" - }, - { - "description": "Jurisdiction Metadata for NVI_29(2020) id 60ef3b51-3ccd-4b08-8a66-7da26bcc6a66", - "key": "60ef3b51-3ccd-4b08-8a66-7da26bcc6a66", - "label": "NVI_29(2020) metadata", - "value": "27043" - }, - { - "description": "Jurisdiction Metadata for NVI_9(2020) id 76cea488-7cbc-4661-8c32-64bed21ad440", - "key": "76cea488-7cbc-4661-8c32-64bed21ad440", - "label": "NVI_9(2020) metadata", - "value": "27044" - }, - { - "description": "Jurisdiction Metadata for NVI_42(2020) id fa54b917-2009-457d-9e58-71b135e72696", - "key": "fa54b917-2009-457d-9e58-71b135e72696", - "label": "NVI_42(2020) metadata", - "value": "27045" - }, - { - "description": "Jurisdiction Metadata for NVI_31(2020) id 2cc17270-f872-42a9-9862-54fccf2b6b99", - "key": "2cc17270-f872-42a9-9862-54fccf2b6b99", - "label": "NVI_31(2020) metadata", - "value": "27046" - }, - { - "description": "Jurisdiction Metadata for NVI_37(2020) id f2cb7b68-4bad-450c-a349-bb1d5865a240", - "key": "f2cb7b68-4bad-450c-a349-bb1d5865a240", - "label": "NVI_37(2020) metadata", - "value": "27047" - }, - { - "description": "Jurisdiction Metadata for Chadiza(2020) id 33b21665-8280-4de1-99e5-5954aaefa1a0", - "key": "33b21665-8280-4de1-99e5-5954aaefa1a0", - "label": "Chadiza(2020) metadata", - "value": "27048" - }, - { - "description": "Jurisdiction Metadata for Changaya NHC id 94ff1372-a69d-4397-b3fb-45ab6525f89a", - "key": "94ff1372-a69d-4397-b3fb-45ab6525f89a", - "label": "Changaya NHC metadata", - "value": "27049" - }, - { - "description": "Jurisdiction Metadata for CDZ_34(2020) id 3f6e7cb8-b28f-44b3-9512-25177ecc794d", - "key": "3f6e7cb8-b28f-44b3-9512-25177ecc794d", - "label": "CDZ_34(2020) metadata", - "value": "27050" - }, - { - "description": "Jurisdiction Metadata for CDZ_20(2020) id 416c9219-5f9d-47a9-a3b2-a8ba7f59a462", - "key": "416c9219-5f9d-47a9-a3b2-a8ba7f59a462", - "label": "CDZ_20(2020) metadata", - "value": "27051" - }, - { - "description": "Jurisdiction Metadata for CDZ_35(2020) id 9d1f64bc-2012-4293-a1bf-f87f1405ed25", - "key": "9d1f64bc-2012-4293-a1bf-f87f1405ed25", - "label": "CDZ_35(2020) metadata", - "value": "27052" - }, - { - "description": "Jurisdiction Metadata for CDZ_36(2020) id 20777539-8310-4cb3-9e94-acfdd0f84488", - "key": "20777539-8310-4cb3-9e94-acfdd0f84488", - "label": "CDZ_36(2020) metadata", - "value": "27053" - }, - { - "description": "Jurisdiction Metadata for CDZ_39(2020) id 822c02d7-9e68-4eb1-a134-064369d4ca9d", - "key": "822c02d7-9e68-4eb1-a134-064369d4ca9d", - "label": "CDZ_39(2020) metadata", - "value": "27054" - }, - { - "description": "Jurisdiction Metadata for CDZ_48(2020) id b7219355-df14-4b1b-8684-0cf86a02147b", - "key": "b7219355-df14-4b1b-8684-0cf86a02147b", - "label": "CDZ_48(2020) metadata", - "value": "27055" - }, - { - "description": "Jurisdiction Metadata for CDZ_28(2020) id 1e71687d-8837-4dc4-8fe1-d106172f9d52", - "key": "1e71687d-8837-4dc4-8fe1-d106172f9d52", - "label": "CDZ_28(2020) metadata", - "value": "27056" - }, - { - "description": "Jurisdiction Metadata for CDZ_56(2020) id 9cb766bf-2957-4c3f-b1cc-28d8e16b8790", - "key": "9cb766bf-2957-4c3f-b1cc-28d8e16b8790", - "label": "CDZ_56(2020) metadata", - "value": "27057" - }, - { - "description": "Jurisdiction Metadata for CDZ_60(2020) id ec2f922c-03c3-47f8-bbe3-ea8ad019bf50", - "key": "ec2f922c-03c3-47f8-bbe3-ea8ad019bf50", - "label": "CDZ_60(2020) metadata", - "value": "27058" - }, - { - "description": "Jurisdiction Metadata for CDZ_46(2020) id 2cdea62b-e6e1-4c4d-9f3d-b39a90bcaf0c", - "key": "2cdea62b-e6e1-4c4d-9f3d-b39a90bcaf0c", - "label": "CDZ_46(2020) metadata", - "value": "27059" - }, - { - "description": "Jurisdiction Metadata for CDZ_69(2020) id fb5a3706-9c7c-4b61-ace5-0c906af50936", - "key": "fb5a3706-9c7c-4b61-ace5-0c906af50936", - "label": "CDZ_69(2020) metadata", - "value": "27060" - }, - { - "description": "Jurisdiction Metadata for CDZ_3(2020) id f7c54263-7c16-4ee1-b6ee-f8865cf9bd6f", - "key": "f7c54263-7c16-4ee1-b6ee-f8865cf9bd6f", - "label": "CDZ_3(2020) metadata", - "value": "27061" - }, - { - "description": "Jurisdiction Metadata for CDZ_26(2020) id 649fd5df-8525-4572-a07b-1ba15600f53e", - "key": "649fd5df-8525-4572-a07b-1ba15600f53e", - "label": "CDZ_26(2020) metadata", - "value": "27062" - }, - { - "description": "Jurisdiction Metadata for CDZ_55(2020) id 1649e71f-b441-4252-975b-208e2f5b7669", - "key": "1649e71f-b441-4252-975b-208e2f5b7669", - "label": "CDZ_55(2020) metadata", - "value": "27063" - }, - { - "description": "Jurisdiction Metadata for CDZ_7(2020) id dc4647f7-0f12-45a7-9cc8-051cdfeb4b3f", - "key": "dc4647f7-0f12-45a7-9cc8-051cdfeb4b3f", - "label": "CDZ_7(2020) metadata", - "value": "27064" - }, - { - "description": "Jurisdiction Metadata for CDZ_22(2020) id bcfc674a-4841-4112-84fd-dc727a36f4f3", - "key": "bcfc674a-4841-4112-84fd-dc727a36f4f3", - "label": "CDZ_22(2020) metadata", - "value": "27065" - }, - { - "description": "Jurisdiction Metadata for CDZ_47(2020) id e1a3405c-1988-4de7-bbb4-5495ba5d080d", - "key": "e1a3405c-1988-4de7-bbb4-5495ba5d080d", - "label": "CDZ_47(2020) metadata", - "value": "27066" - }, - { - "description": "Jurisdiction Metadata for CDZ_14(2020) id a117f528-30e7-40c4-b10c-2c22eb9b9f48", - "key": "a117f528-30e7-40c4-b10c-2c22eb9b9f48", - "label": "CDZ_14(2020) metadata", - "value": "27067" - }, - { - "description": "Jurisdiction Metadata for CDZ_40(2020) id 31f5e80b-6821-4f91-9f48-3caede1bc83d", - "key": "31f5e80b-6821-4f91-9f48-3caede1bc83d", - "label": "CDZ_40(2020) metadata", - "value": "27068" - }, - { - "description": "Jurisdiction Metadata for CDZ_23(2020) id 029762bf-04ed-4ec2-bbb6-1c001ccc6347", - "key": "029762bf-04ed-4ec2-bbb6-1c001ccc6347", - "label": "CDZ_23(2020) metadata", - "value": "27069" - }, - { - "description": "Jurisdiction Metadata for CDZ_57(2020) id 75933052-f1b1-451c-838f-33cbef8cfdc8", - "key": "75933052-f1b1-451c-838f-33cbef8cfdc8", - "label": "CDZ_57(2020) metadata", - "value": "27070" - }, - { - "description": "Jurisdiction Metadata for CDZ_17(2020) id 144aca10-35ea-4acc-a7b5-6b257726b763", - "key": "144aca10-35ea-4acc-a7b5-6b257726b763", - "label": "CDZ_17(2020) metadata", - "value": "27071" - }, - { - "description": "Jurisdiction Metadata for CDZ_64(2020) id 0efc0904-a701-4238-a372-c833665ea872", - "key": "0efc0904-a701-4238-a372-c833665ea872", - "label": "CDZ_64(2020) metadata", - "value": "27072" - }, - { - "description": "Jurisdiction Metadata for CDZ_27(2020) id a003039c-509b-4d7c-b2bc-bc2b102af92d", - "key": "a003039c-509b-4d7c-b2bc-bc2b102af92d", - "label": "CDZ_27(2020) metadata", - "value": "27073" - }, - { - "description": "Jurisdiction Metadata for CDZ_5(2020) id 6a639141-7dc3-436a-9e07-3ffdda4157b6", - "key": "6a639141-7dc3-436a-9e07-3ffdda4157b6", - "label": "CDZ_5(2020) metadata", - "value": "27074" - }, - { - "description": "Jurisdiction Metadata for CDZ_12(2020) id dc892df1-4eab-41db-9330-8ba9f103eafc", - "key": "dc892df1-4eab-41db-9330-8ba9f103eafc", - "label": "CDZ_12(2020) metadata", - "value": "27075" - }, - { - "description": "Jurisdiction Metadata for CDZ_6(2020) id e838ad16-8920-48b1-b722-2a66591b1895", - "key": "e838ad16-8920-48b1-b722-2a66591b1895", - "label": "CDZ_6(2020) metadata", - "value": "27076" - }, - { - "description": "Jurisdiction Metadata for CDZ_53(2020) id ba51b63f-846b-4534-b9c4-6bcc54de1b1e", - "key": "ba51b63f-846b-4534-b9c4-6bcc54de1b1e", - "label": "CDZ_53(2020) metadata", - "value": "27077" - }, - { - "description": "Jurisdiction Metadata for CDZ_68(2020) id ebca35e4-75f7-46d0-9eed-ba5026ac0ad4", - "key": "ebca35e4-75f7-46d0-9eed-ba5026ac0ad4", - "label": "CDZ_68(2020) metadata", - "value": "27078" - }, - { - "description": "Jurisdiction Metadata for CDZ_18(2020) id 4e2365db-2dc1-4d13-a1b4-5ee944e6645e", - "key": "4e2365db-2dc1-4d13-a1b4-5ee944e6645e", - "label": "CDZ_18(2020) metadata", - "value": "27079" - }, - { - "description": "Jurisdiction Metadata for CDZ_67(2020) id 5980463b-3c89-41d4-84b0-72eaa5d0e1cb", - "key": "5980463b-3c89-41d4-84b0-72eaa5d0e1cb", - "label": "CDZ_67(2020) metadata", - "value": "27080" - }, - { - "description": "Jurisdiction Metadata for CDZ_32(2020) id e95b2f77-8f9b-4df3-89d8-e89d80c2c278", - "key": "e95b2f77-8f9b-4df3-89d8-e89d80c2c278", - "label": "CDZ_32(2020) metadata", - "value": "27081" - }, - { - "description": "Jurisdiction Metadata for CDZ_51(2020) id 67e621f4-f71a-47cd-8993-fd94264c01b4", - "key": "67e621f4-f71a-47cd-8993-fd94264c01b4", - "label": "CDZ_51(2020) metadata", - "value": "27082" - }, - { - "description": "Jurisdiction Metadata for CDZ_61(2020) id 90c0df86-ec85-4273-82a5-bfc9e7bbe5ae", - "key": "90c0df86-ec85-4273-82a5-bfc9e7bbe5ae", - "label": "CDZ_61(2020) metadata", - "value": "27083" - }, - { - "description": "Jurisdiction Metadata for CDZ_29(2020) id ad72ea3c-ab2a-41a2-8400-acc9b720ae8e", - "key": "ad72ea3c-ab2a-41a2-8400-acc9b720ae8e", - "label": "CDZ_29(2020) metadata", - "value": "27084" - }, - { - "description": "Jurisdiction Metadata for CDZ_59(2020) id 48d44847-12dc-4e6d-adfc-5e98f1ac0340", - "key": "48d44847-12dc-4e6d-adfc-5e98f1ac0340", - "label": "CDZ_59(2020) metadata", - "value": "27085" - }, - { - "description": "Jurisdiction Metadata for CDZ_24(2020) id c317ad18-7d26-4d85-96b5-ebb2da75dde7", - "key": "c317ad18-7d26-4d85-96b5-ebb2da75dde7", - "label": "CDZ_24(2020) metadata", - "value": "27086" - }, - { - "description": "Jurisdiction Metadata for CDZ_8(2020) id 0121abf8-d2f8-4b3b-b911-cd4a4ab00718", - "key": "0121abf8-d2f8-4b3b-b911-cd4a4ab00718", - "label": "CDZ_8(2020) metadata", - "value": "27087" - }, - { - "description": "Jurisdiction Metadata for CDZ_58(2020) id 8c80bfb1-35a3-4bbe-a292-086e88a20c5e", - "key": "8c80bfb1-35a3-4bbe-a292-086e88a20c5e", - "label": "CDZ_58(2020) metadata", - "value": "27088" - }, - { - "description": "Jurisdiction Metadata for CDZ_33(2020) id 8098172a-dec4-4e25-a0ce-5b001bd63192", - "key": "8098172a-dec4-4e25-a0ce-5b001bd63192", - "label": "CDZ_33(2020) metadata", - "value": "27089" - }, - { - "description": "Jurisdiction Metadata for CDZ_43(2020) id 2d1ffb2d-d219-4bdf-ba89-5e121f52a9fd", - "key": "2d1ffb2d-d219-4bdf-ba89-5e121f52a9fd", - "label": "CDZ_43(2020) metadata", - "value": "27090" - }, - { - "description": "Jurisdiction Metadata for CDZ_44(2020) id c33a488a-8853-41cb-932c-9047d66745ab", - "key": "c33a488a-8853-41cb-932c-9047d66745ab", - "label": "CDZ_44(2020) metadata", - "value": "27091" - }, - { - "description": "Jurisdiction Metadata for CDZ_52(2020) id c3e2875b-4c1e-456c-995a-ab4eb5efc353", - "key": "c3e2875b-4c1e-456c-995a-ab4eb5efc353", - "label": "CDZ_52(2020) metadata", - "value": "27092" - }, - { - "description": "Jurisdiction Metadata for CDZ_62(2020) id 6f96fea6-74f1-4d6c-bcfd-7ef5a3ce50d0", - "key": "6f96fea6-74f1-4d6c-bcfd-7ef5a3ce50d0", - "label": "CDZ_62(2020) metadata", - "value": "27093" - }, - { - "description": "Jurisdiction Metadata for CDZ_21(2020) id 1b8f6ec9-0108-439b-8799-f78d486be1cf", - "key": "1b8f6ec9-0108-439b-8799-f78d486be1cf", - "label": "CDZ_21(2020) metadata", - "value": "27094" - }, - { - "description": "Jurisdiction Metadata for CDZ_10(2020) id 81f2e980-2be5-4588-9437-bbfb38283b0d", - "key": "81f2e980-2be5-4588-9437-bbfb38283b0d", - "label": "CDZ_10(2020) metadata", - "value": "27095" - }, - { - "description": "Jurisdiction Metadata for CDZ_65(2020) id ded8ee1b-b9dc-49bb-82ff-296739402aa3", - "key": "ded8ee1b-b9dc-49bb-82ff-296739402aa3", - "label": "CDZ_65(2020) metadata", - "value": "27096" - }, - { - "description": "Jurisdiction Metadata for CDZ_19(2020) id c3359f20-2de1-4155-addc-8d3bf0eee52f", - "key": "c3359f20-2de1-4155-addc-8d3bf0eee52f", - "label": "CDZ_19(2020) metadata", - "value": "27097" - }, - { - "description": "Jurisdiction Metadata for CDZ_4(2020) id 446d85da-0e95-47f4-aa5a-e6fe2c3a1c08", - "key": "446d85da-0e95-47f4-aa5a-e6fe2c3a1c08", - "label": "CDZ_4(2020) metadata", - "value": "27098" - }, - { - "description": "Jurisdiction Metadata for CDZ_30(2020) id aaf43835-530c-42e7-a4bb-0d2f9a6dde94", - "key": "aaf43835-530c-42e7-a4bb-0d2f9a6dde94", - "label": "CDZ_30(2020) metadata", - "value": "27099" - }, - { - "description": "Jurisdiction Metadata for CDZ_1(2020) id 7f8c6f01-8642-4920-8c42-97e594347ee0", - "key": "7f8c6f01-8642-4920-8c42-97e594347ee0", - "label": "CDZ_1(2020) metadata", - "value": "27100" - }, - { - "description": "Jurisdiction Metadata for CDZ_31(2020) id f1190bc7-f6fa-4aca-9a84-0dfaed72b660", - "key": "f1190bc7-f6fa-4aca-9a84-0dfaed72b660", - "label": "CDZ_31(2020) metadata", - "value": "27101" - }, - { - "description": "Jurisdiction Metadata for CDZ_41(2020) id eb3ece99-1624-467c-8d30-6ee53451cfa3", - "key": "eb3ece99-1624-467c-8d30-6ee53451cfa3", - "label": "CDZ_41(2020) metadata", - "value": "27102" - }, - { - "description": "Jurisdiction Metadata for CDZ_16(2020) id cd3cc04f-7fd5-4660-a50f-0709dcb874c9", - "key": "cd3cc04f-7fd5-4660-a50f-0709dcb874c9", - "label": "CDZ_16(2020) metadata", - "value": "27103" - }, - { - "description": "Jurisdiction Metadata for CDZ_15(2020) id a7f344f1-c11d-4ae6-b5bc-fdf9739d7e48", - "key": "a7f344f1-c11d-4ae6-b5bc-fdf9739d7e48", - "label": "CDZ_15(2020) metadata", - "value": "27104" - }, - { - "description": "Jurisdiction Metadata for CDZ_50(2020) id 9b1eabee-91d2-480e-ad38-bf57cd33912e", - "key": "9b1eabee-91d2-480e-ad38-bf57cd33912e", - "label": "CDZ_50(2020) metadata", - "value": "27105" - }, - { - "description": "Jurisdiction Metadata for CDZ_54(2020) id 47341bb5-593b-4451-9edf-b86de2b21bb5", - "key": "47341bb5-593b-4451-9edf-b86de2b21bb5", - "label": "CDZ_54(2020) metadata", - "value": "27106" - }, - { - "description": "Jurisdiction Metadata for CDZ_2(2020) id 4f68cfd7-66bf-4105-8655-a849ec27a63a", - "key": "4f68cfd7-66bf-4105-8655-a849ec27a63a", - "label": "CDZ_2(2020) metadata", - "value": "27107" - }, - { - "description": "Jurisdiction Metadata for CDZ_42(2020) id 938198d8-0cf0-40bb-9902-fdfc08c0b325", - "key": "938198d8-0cf0-40bb-9902-fdfc08c0b325", - "label": "CDZ_42(2020) metadata", - "value": "27108" - }, - { - "description": "Jurisdiction Metadata for CDZ_37(2020) id e2fad906-368a-4f5d-96ae-6fe11fd9036f", - "key": "e2fad906-368a-4f5d-96ae-6fe11fd9036f", - "label": "CDZ_37(2020) metadata", - "value": "27109" - }, - { - "description": "Jurisdiction Metadata for CDZ_11(2020) id 74a05587-f236-43a1-848f-b69082e0a323", - "key": "74a05587-f236-43a1-848f-b69082e0a323", - "label": "CDZ_11(2020) metadata", - "value": "27110" - }, - { - "description": "Jurisdiction Metadata for CDZ_25(2020) id c4576cb2-c87f-4963-98de-dc6b1dcd4d34", - "key": "c4576cb2-c87f-4963-98de-dc6b1dcd4d34", - "label": "CDZ_25(2020) metadata", - "value": "27111" - }, - { - "description": "Jurisdiction Metadata for CDZ_38(2020) id add3aca0-5ee1-470a-8fed-1b0c823c0632", - "key": "add3aca0-5ee1-470a-8fed-1b0c823c0632", - "label": "CDZ_38(2020) metadata", - "value": "27112" - }, - { - "description": "Jurisdiction Metadata for CDZ_49(2020) id a588822e-f365-451c-a2a7-7d84a3ffb241", - "key": "a588822e-f365-451c-a2a7-7d84a3ffb241", - "label": "CDZ_49(2020) metadata", - "value": "27113" - }, - { - "description": "Jurisdiction Metadata for CDZ_66(2020) id ab2ef18e-b92f-4f61-9e7a-4588a7ce1d0b", - "key": "ab2ef18e-b92f-4f61-9e7a-4588a7ce1d0b", - "label": "CDZ_66(2020) metadata", - "value": "27114" - }, - { - "description": "Jurisdiction Metadata for CDZ_63(2020) id dc84eda0-51aa-4603-aa03-cbea6c8e05a6", - "key": "dc84eda0-51aa-4603-aa03-cbea6c8e05a6", - "label": "CDZ_63(2020) metadata", - "value": "27115" - }, - { - "description": "Jurisdiction Metadata for CDZ_13(2020) id 81dee609-57dd-4f2a-892d-a1d01fa118b7", - "key": "81dee609-57dd-4f2a-892d-a1d01fa118b7", - "label": "CDZ_13(2020) metadata", - "value": "27116" - }, - { - "description": "Jurisdiction Metadata for CDZ_45(2020) id f94475cb-db23-4e37-a5a3-c292bd822297", - "key": "f94475cb-db23-4e37-a5a3-c292bd822297", - "label": "CDZ_45(2020) metadata", - "value": "27117" - }, - { - "description": "Jurisdiction Metadata for CDZ_9(2020) id dbc2480b-0e75-470e-8ff7-119c37e0e481", - "key": "dbc2480b-0e75-470e-8ff7-119c37e0e481", - "label": "CDZ_9(2020) metadata", - "value": "27118" - }, - { - "description": "Jurisdiction Metadata for Kapirimpika(2020) id 3ead94e9-dabc-4a66-8197-7d10cacb7751", - "key": "3ead94e9-dabc-4a66-8197-7d10cacb7751", - "label": "Kapirimpika(2020) metadata", - "value": "27119" - }, - { - "description": "Jurisdiction Metadata for Kafulukuta_NHC id 67e59ccf-6414-4b27-b7b8-4d2562f582db", - "key": "67e59ccf-6414-4b27-b7b8-4d2562f582db", - "label": "Kafulukuta_NHC metadata", - "value": "27120" - }, - { - "description": "Jurisdiction Metadata for KPR_9(2020) id de0d6ada-96eb-4ce2-9563-1747cc352b7f", - "key": "de0d6ada-96eb-4ce2-9563-1747cc352b7f", - "label": "KPR_9(2020) metadata", - "value": "27121" - }, - { - "description": "Jurisdiction Metadata for KPR_8(2020) id c683eb14-b710-462d-9900-33cd0531a129", - "key": "c683eb14-b710-462d-9900-33cd0531a129", - "label": "KPR_8(2020) metadata", - "value": "27122" - }, - { - "description": "Jurisdiction Metadata for KPR_4(2020) id 9f160ec8-80b7-43a4-a779-420bca475831", - "key": "9f160ec8-80b7-43a4-a779-420bca475831", - "label": "KPR_4(2020) metadata", - "value": "27123" - }, - { - "description": "Jurisdiction Metadata for KPR_10(2020) id 665c6259-dae8-446e-b29d-fea878a26b06", - "key": "665c6259-dae8-446e-b29d-fea878a26b06", - "label": "KPR_10(2020) metadata", - "value": "27124" - }, - { - "description": "Jurisdiction Metadata for KPR_3(2020) id 3116135f-c25b-4a0f-96e8-06bc64e13328", - "key": "3116135f-c25b-4a0f-96e8-06bc64e13328", - "label": "KPR_3(2020) metadata", - "value": "27125" - }, - { - "description": "Jurisdiction Metadata for KPR_6(2020) id a0a86c57-753c-41d1-a81f-3895c98e9701", - "key": "a0a86c57-753c-41d1-a81f-3895c98e9701", - "label": "KPR_6(2020) metadata", - "value": "27126" - }, - { - "description": "Jurisdiction Metadata for KPR_1(2020) id ef87ad93-69e8-476f-b90a-735b8f4de616", - "key": "ef87ad93-69e8-476f-b90a-735b8f4de616", - "label": "KPR_1(2020) metadata", - "value": "27127" - }, - { - "description": "Jurisdiction Metadata for KPR_5(2020) id 55f491bb-d893-4bf3-9157-ed13d91a9e77", - "key": "55f491bb-d893-4bf3-9157-ed13d91a9e77", - "label": "KPR_5(2020) metadata", - "value": "27128" - }, - { - "description": "Jurisdiction Metadata for KPR_7(2020) id f9838aca-2d99-4b3e-93a4-a0b6d289aa16", - "key": "f9838aca-2d99-4b3e-93a4-a0b6d289aa16", - "label": "KPR_7(2020) metadata", - "value": "27129" - }, - { - "description": "Jurisdiction Metadata for KPR_2(2020) id 1a3db008-5824-49e7-aa9d-ded1b702cfe5", - "key": "1a3db008-5824-49e7-aa9d-ded1b702cfe5", - "label": "KPR_2(2020) metadata", - "value": "27130" - }, - { - "description": "Jurisdiction Metadata for John(2020) id 1770f46f-ab04-440a-915d-8f2d186ff041", - "key": "1770f46f-ab04-440a-915d-8f2d186ff041", - "label": "John(2020) metadata", - "value": "27131" - }, - { - "description": "Jurisdiction Metadata for Chaingo_NHC id f75648a1-c9ce-4306-9753-79a4caf3134f", - "key": "f75648a1-c9ce-4306-9753-79a4caf3134f", - "label": "Chaingo_NHC metadata", - "value": "27132" - }, - { - "description": "Jurisdiction Metadata for JON_66(2020) id ce05261e-b4e1-42b5-ae4b-1d41a9a4aeed", - "key": "ce05261e-b4e1-42b5-ae4b-1d41a9a4aeed", - "label": "JON_66(2020) metadata", - "value": "27133" - }, - { - "description": "Jurisdiction Metadata for JON_45(2020) id 83c6e4d2-d34a-4640-a1ce-460d4e1ba692", - "key": "83c6e4d2-d34a-4640-a1ce-460d4e1ba692", - "label": "JON_45(2020) metadata", - "value": "27134" - }, - { - "description": "Jurisdiction Metadata for JON_50(2020) id e37f9a7f-a109-456e-83da-a384bdcfb677", - "key": "e37f9a7f-a109-456e-83da-a384bdcfb677", - "label": "JON_50(2020) metadata", - "value": "27135" - }, - { - "description": "Jurisdiction Metadata for JON_87(2020) id 2e6a8ea7-2886-43c8-a116-cd2fcc82bb31", - "key": "2e6a8ea7-2886-43c8-a116-cd2fcc82bb31", - "label": "JON_87(2020) metadata", - "value": "27136" - }, - { - "description": "Jurisdiction Metadata for JON_72(2020) id f2b57903-a964-4d8e-a282-0727f556ec3f", - "key": "f2b57903-a964-4d8e-a282-0727f556ec3f", - "label": "JON_72(2020) metadata", - "value": "27137" - }, - { - "description": "Jurisdiction Metadata for JON_111(2020) id 0a691aa5-8824-4075-9479-d00d647b7265", - "key": "0a691aa5-8824-4075-9479-d00d647b7265", - "label": "JON_111(2020) metadata", - "value": "27138" - }, - { - "description": "Jurisdiction Metadata for JON_80(2020) id 777bd618-48a5-4c3b-bb42-2357cede644d", - "key": "777bd618-48a5-4c3b-bb42-2357cede644d", - "label": "JON_80(2020) metadata", - "value": "27139" - }, - { - "description": "Jurisdiction Metadata for JON_101(2020) id 6ef06446-5531-430a-a638-0603faa4a9b7", - "key": "6ef06446-5531-430a-a638-0603faa4a9b7", - "label": "JON_101(2020) metadata", - "value": "27140" - }, - { - "description": "Jurisdiction Metadata for JON_91(2020) id a7a93932-740a-4d83-a74d-65aa05fe9ad4", - "key": "a7a93932-740a-4d83-a74d-65aa05fe9ad4", - "label": "JON_91(2020) metadata", - "value": "27141" - }, - { - "description": "Jurisdiction Metadata for JON_83(2020) id 0fa0d1a8-37d0-47b7-a691-0ecaa19bfaa1", - "key": "0fa0d1a8-37d0-47b7-a691-0ecaa19bfaa1", - "label": "JON_83(2020) metadata", - "value": "27142" - }, - { - "description": "Jurisdiction Metadata for JON_65(2020) id 4e0bc071-d389-4f30-ab1f-0a73bc80b3d1", - "key": "4e0bc071-d389-4f30-ab1f-0a73bc80b3d1", - "label": "JON_65(2020) metadata", - "value": "27143" - }, - { - "description": "Jurisdiction Metadata for JON_35(2020) id f06e4e20-aed2-4227-81cb-6225f7542278", - "key": "f06e4e20-aed2-4227-81cb-6225f7542278", - "label": "JON_35(2020) metadata", - "value": "27144" - }, - { - "description": "Jurisdiction Metadata for JON_19(2020) id 51a59ac8-04a2-42ae-adf9-8c3d21431cb7", - "key": "51a59ac8-04a2-42ae-adf9-8c3d21431cb7", - "label": "JON_19(2020) metadata", - "value": "27145" - }, - { - "description": "Jurisdiction Metadata for JON_109(2020) id 585a9932-42e8-4783-a580-506f8d3cd7bd", - "key": "585a9932-42e8-4783-a580-506f8d3cd7bd", - "label": "JON_109(2020) metadata", - "value": "27146" - }, - { - "description": "Jurisdiction Metadata for JON_73(2020) id 32376312-1037-4be3-b6b9-3af6eb4b14d0", - "key": "32376312-1037-4be3-b6b9-3af6eb4b14d0", - "label": "JON_73(2020) metadata", - "value": "27147" - }, - { - "description": "Jurisdiction Metadata for JON_58(2020) id e6ae3213-5435-45fd-905f-3c808b158af6", - "key": "e6ae3213-5435-45fd-905f-3c808b158af6", - "label": "JON_58(2020) metadata", - "value": "27148" - }, - { - "description": "Jurisdiction Metadata for JON_77(2020) id 3f376df7-4928-4a65-8320-c5528ede50f4", - "key": "3f376df7-4928-4a65-8320-c5528ede50f4", - "label": "JON_77(2020) metadata", - "value": "27149" - }, - { - "description": "Jurisdiction Metadata for JON_20(2020) id f2be8e4e-c21e-4bb6-81a7-f1b89c9f014c", - "key": "f2be8e4e-c21e-4bb6-81a7-f1b89c9f014c", - "label": "JON_20(2020) metadata", - "value": "27150" - }, - { - "description": "Jurisdiction Metadata for JON_49(2020) id 6dcd8f97-953f-4aee-bba6-4fc37251ffed", - "key": "6dcd8f97-953f-4aee-bba6-4fc37251ffed", - "label": "JON_49(2020) metadata", - "value": "27151" - }, - { - "description": "Jurisdiction Metadata for JON_14(2020) id a2e06fc6-cfcd-4a6f-9c8d-e3b590322f6b", - "key": "a2e06fc6-cfcd-4a6f-9c8d-e3b590322f6b", - "label": "JON_14(2020) metadata", - "value": "27152" - }, - { - "description": "Jurisdiction Metadata for JON_86(2020) id e9d006c7-5607-4f87-82bf-d6108737451b", - "key": "e9d006c7-5607-4f87-82bf-d6108737451b", - "label": "JON_86(2020) metadata", - "value": "27153" - }, - { - "description": "Jurisdiction Metadata for JON_108(2020) id 04ec1f63-fa57-48c6-9e1e-bc67b0b623e7", - "key": "04ec1f63-fa57-48c6-9e1e-bc67b0b623e7", - "label": "JON_108(2020) metadata", - "value": "27154" - }, - { - "description": "Jurisdiction Metadata for JON_32(2020) id 5965b6a8-a884-4b8f-990e-61e3cf5225c1", - "key": "5965b6a8-a884-4b8f-990e-61e3cf5225c1", - "label": "JON_32(2020) metadata", - "value": "27155" - }, - { - "description": "Jurisdiction Metadata for JON_110(2020) id 080a4d40-02f1-4456-8531-8c8482903949", - "key": "080a4d40-02f1-4456-8531-8c8482903949", - "label": "JON_110(2020) metadata", - "value": "27156" - }, - { - "description": "Jurisdiction Metadata for JON_37(2020) id e6b422e4-5cca-4cb8-9f60-918e0106e9f2", - "key": "e6b422e4-5cca-4cb8-9f60-918e0106e9f2", - "label": "JON_37(2020) metadata", - "value": "27157" - }, - { - "description": "Jurisdiction Metadata for JON_55(2020) id b644c696-2534-41f7-8be4-a68fb2bd5686", - "key": "b644c696-2534-41f7-8be4-a68fb2bd5686", - "label": "JON_55(2020) metadata", - "value": "27158" - }, - { - "description": "Jurisdiction Metadata for JON_47(2020) id 918a7177-578a-40e0-8d59-6fb5cb187373", - "key": "918a7177-578a-40e0-8d59-6fb5cb187373", - "label": "JON_47(2020) metadata", - "value": "27159" - }, - { - "description": "Jurisdiction Metadata for JON_81(2020) id 96e15fdd-f6ae-4ab9-8f4b-2096ec6f8aa4", - "key": "96e15fdd-f6ae-4ab9-8f4b-2096ec6f8aa4", - "label": "JON_81(2020) metadata", - "value": "27160" - }, - { - "description": "Jurisdiction Metadata for JON_48(2020) id 9440cc82-9e6b-49e2-a2f3-67f75a420e53", - "key": "9440cc82-9e6b-49e2-a2f3-67f75a420e53", - "label": "JON_48(2020) metadata", - "value": "27161" - }, - { - "description": "Jurisdiction Metadata for JON_29(2020) id 1b10aeef-94b1-4dc7-8108-e84582f19107", - "key": "1b10aeef-94b1-4dc7-8108-e84582f19107", - "label": "JON_29(2020) metadata", - "value": "27162" - }, - { - "description": "Jurisdiction Metadata for JON_5(2020) id b195cc0c-df87-4387-971a-40d977adf0c6", - "key": "b195cc0c-df87-4387-971a-40d977adf0c6", - "label": "JON_5(2020) metadata", - "value": "27163" - }, - { - "description": "Jurisdiction Metadata for JON_42(2020) id 38c59fa0-c5ce-4d3d-9e0c-47180d42ef10", - "key": "38c59fa0-c5ce-4d3d-9e0c-47180d42ef10", - "label": "JON_42(2020) metadata", - "value": "27164" - }, - { - "description": "Jurisdiction Metadata for JON_43(2020) id 6367e7fc-91a8-44a5-ad23-683495863385", - "key": "6367e7fc-91a8-44a5-ad23-683495863385", - "label": "JON_43(2020) metadata", - "value": "27165" - }, - { - "description": "Jurisdiction Metadata for JON_61(2020) id 9ef62979-36df-4dd8-8c82-431c4ab8179d", - "key": "9ef62979-36df-4dd8-8c82-431c4ab8179d", - "label": "JON_61(2020) metadata", - "value": "27166" - }, - { - "description": "Jurisdiction Metadata for JON_59(2020) id e34d22b1-e059-420a-be78-ec95fc08a56d", - "key": "e34d22b1-e059-420a-be78-ec95fc08a56d", - "label": "JON_59(2020) metadata", - "value": "27167" - }, - { - "description": "Jurisdiction Metadata for JON_21(2020) id 5c13dabc-162b-4f91-bdd8-2c7b2e29078d", - "key": "5c13dabc-162b-4f91-bdd8-2c7b2e29078d", - "label": "JON_21(2020) metadata", - "value": "27168" - }, - { - "description": "Jurisdiction Metadata for JON_56(2020) id 94dddc2a-621e-4a6f-b8a2-ebf2f5cde84a", - "key": "94dddc2a-621e-4a6f-b8a2-ebf2f5cde84a", - "label": "JON_56(2020) metadata", - "value": "27169" - }, - { - "description": "Jurisdiction Metadata for JON_79(2020) id 3b576c53-988c-42d8-9319-ace5c55f3f57", - "key": "3b576c53-988c-42d8-9319-ace5c55f3f57", - "label": "JON_79(2020) metadata", - "value": "27170" - }, - { - "description": "Jurisdiction Metadata for JON_76(2020) id d19bed5a-2553-4d12-82e3-05599fbbe372", - "key": "d19bed5a-2553-4d12-82e3-05599fbbe372", - "label": "JON_76(2020) metadata", - "value": "27171" - }, - { - "description": "Jurisdiction Metadata for JON_41(2020) id 458a4755-b2df-47b8-804d-2039e1bc62c8", - "key": "458a4755-b2df-47b8-804d-2039e1bc62c8", - "label": "JON_41(2020) metadata", - "value": "27172" - }, - { - "description": "Jurisdiction Metadata for JON_107(2020) id 6228b23d-e533-4921-b9e8-1c62774b4935", - "key": "6228b23d-e533-4921-b9e8-1c62774b4935", - "label": "JON_107(2020) metadata", - "value": "27173" - }, - { - "description": "Jurisdiction Metadata for JON_16(2020) id e745ab8d-0430-4aa6-a137-3940c6d32f3b", - "key": "e745ab8d-0430-4aa6-a137-3940c6d32f3b", - "label": "JON_16(2020) metadata", - "value": "27174" - }, - { - "description": "Jurisdiction Metadata for JON_63(2020) id 6a9bc53a-36d7-4b4b-97f7-289aeceda227", - "key": "6a9bc53a-36d7-4b4b-97f7-289aeceda227", - "label": "JON_63(2020) metadata", - "value": "27175" - }, - { - "description": "Jurisdiction Metadata for JON_53(2020) id 9c99d556-c1cc-4236-84bb-b225d3c18d54", - "key": "9c99d556-c1cc-4236-84bb-b225d3c18d54", - "label": "JON_53(2020) metadata", - "value": "27176" - }, - { - "description": "Jurisdiction Metadata for JON_64(2020) id a0daaf06-71f0-4a47-981b-770261e04959", - "key": "a0daaf06-71f0-4a47-981b-770261e04959", - "label": "JON_64(2020) metadata", - "value": "27177" - }, - { - "description": "Jurisdiction Metadata for JON_82(2020) id 71e68472-1bd9-4802-95cd-3d88152f3dd1", - "key": "71e68472-1bd9-4802-95cd-3d88152f3dd1", - "label": "JON_82(2020) metadata", - "value": "27178" - }, - { - "description": "Jurisdiction Metadata for JON_95(2020) id d924b4e5-10c7-43ab-b530-633deb801659", - "key": "d924b4e5-10c7-43ab-b530-633deb801659", - "label": "JON_95(2020) metadata", - "value": "27179" - }, - { - "description": "Jurisdiction Metadata for JON_106(2020) id 818b973c-549d-4c58-a950-b42f0f18b0b2", - "key": "818b973c-549d-4c58-a950-b42f0f18b0b2", - "label": "JON_106(2020) metadata", - "value": "27180" - }, - { - "description": "Jurisdiction Metadata for JON_9(2020) id e11ee702-f77e-43db-8126-bfe48927cc02", - "key": "e11ee702-f77e-43db-8126-bfe48927cc02", - "label": "JON_9(2020) metadata", - "value": "27181" - }, - { - "description": "Jurisdiction Metadata for JON_3(2020) id bfbdfb5a-4f60-4f79-abd2-f2e2b61170f8", - "key": "bfbdfb5a-4f60-4f79-abd2-f2e2b61170f8", - "label": "JON_3(2020) metadata", - "value": "27182" - }, - { - "description": "Jurisdiction Metadata for JON_54(2020) id bbf148ce-7f35-4dd7-8c32-f0005200452f", - "key": "bbf148ce-7f35-4dd7-8c32-f0005200452f", - "label": "JON_54(2020) metadata", - "value": "27183" - }, - { - "description": "Jurisdiction Metadata for JON_12(2020) id 4a10c6e0-0e5f-4f97-9cb9-68501054873e", - "key": "4a10c6e0-0e5f-4f97-9cb9-68501054873e", - "label": "JON_12(2020) metadata", - "value": "27184" - }, - { - "description": "Jurisdiction Metadata for JON_38(2020) id b9f9db25-694e-46d7-872b-b6288cc04a8e", - "key": "b9f9db25-694e-46d7-872b-b6288cc04a8e", - "label": "JON_38(2020) metadata", - "value": "27185" - }, - { - "description": "Jurisdiction Metadata for JON_92(2020) id ee6d2dab-cba1-435f-9834-79c14ee83995", - "key": "ee6d2dab-cba1-435f-9834-79c14ee83995", - "label": "JON_92(2020) metadata", - "value": "27186" - }, - { - "description": "Jurisdiction Metadata for JON_68(2020) id 7412d105-dd5f-4148-84aa-966008efcf63", - "key": "7412d105-dd5f-4148-84aa-966008efcf63", - "label": "JON_68(2020) metadata", - "value": "27187" - }, - { - "description": "Jurisdiction Metadata for JON_69(2020) id a4b4490c-e4f8-4270-b4b4-74fcd270d300", - "key": "a4b4490c-e4f8-4270-b4b4-74fcd270d300", - "label": "JON_69(2020) metadata", - "value": "27188" - }, - { - "description": "Jurisdiction Metadata for JON_93(2020) id 955bf875-c909-42b3-b478-e1c5a329e4e4", - "key": "955bf875-c909-42b3-b478-e1c5a329e4e4", - "label": "JON_93(2020) metadata", - "value": "27189" - }, - { - "description": "Jurisdiction Metadata for JON_24(2020) id b69337a7-0958-4fff-ba11-780100165757", - "key": "b69337a7-0958-4fff-ba11-780100165757", - "label": "JON_24(2020) metadata", - "value": "27190" - }, - { - "description": "Jurisdiction Metadata for JON_34(2020) id b4f3aded-f857-498d-b8f6-40859dcff531", - "key": "b4f3aded-f857-498d-b8f6-40859dcff531", - "label": "JON_34(2020) metadata", - "value": "27191" - }, - { - "description": "Jurisdiction Metadata for JON_23(2020) id 4aa4167d-4c89-41c0-9c2a-afafd9a561cc", - "key": "4aa4167d-4c89-41c0-9c2a-afafd9a561cc", - "label": "JON_23(2020) metadata", - "value": "27192" - }, - { - "description": "Jurisdiction Metadata for JON_4(2020) id afc5c9bc-40b5-4bc2-a033-a1f0c0c3e2e1", - "key": "afc5c9bc-40b5-4bc2-a033-a1f0c0c3e2e1", - "label": "JON_4(2020) metadata", - "value": "27193" - }, - { - "description": "Jurisdiction Metadata for JON_17(2020) id 2e159f21-de69-4b44-b0db-6eb7e42b98b8", - "key": "2e159f21-de69-4b44-b0db-6eb7e42b98b8", - "label": "JON_17(2020) metadata", - "value": "27194" - }, - { - "description": "Jurisdiction Metadata for JON_99(2020) id b53de949-4174-4ee5-bee8-8c6f3e8416d8", - "key": "b53de949-4174-4ee5-bee8-8c6f3e8416d8", - "label": "JON_99(2020) metadata", - "value": "27195" - }, - { - "description": "Jurisdiction Metadata for JON_105(2020) id 473dcf2b-8411-4288-9ddd-5fb7acac9fe4", - "key": "473dcf2b-8411-4288-9ddd-5fb7acac9fe4", - "label": "JON_105(2020) metadata", - "value": "27196" - }, - { - "description": "Jurisdiction Metadata for JON_26(2020) id ec7690a5-d398-427b-bed0-effc01abf01a", - "key": "ec7690a5-d398-427b-bed0-effc01abf01a", - "label": "JON_26(2020) metadata", - "value": "27197" - }, - { - "description": "Jurisdiction Metadata for JON_7(2020) id 8b4b2d91-564c-44fa-b942-60d37d90411e", - "key": "8b4b2d91-564c-44fa-b942-60d37d90411e", - "label": "JON_7(2020) metadata", - "value": "27198" - }, - { - "description": "Jurisdiction Metadata for JON_70(2020) id 54f01643-38e1-41e5-abaa-3dcd4c44940e", - "key": "54f01643-38e1-41e5-abaa-3dcd4c44940e", - "label": "JON_70(2020) metadata", - "value": "27199" - }, - { - "description": "Jurisdiction Metadata for JON_88(2020) id 42b69677-7fa1-40b8-8eb0-2511c8e0212a", - "key": "42b69677-7fa1-40b8-8eb0-2511c8e0212a", - "label": "JON_88(2020) metadata", - "value": "27200" - }, - { - "description": "Jurisdiction Metadata for JON_57(2020) id 97c57ea5-39b8-41bd-92f0-a010e6a492dc", - "key": "97c57ea5-39b8-41bd-92f0-a010e6a492dc", - "label": "JON_57(2020) metadata", - "value": "27201" - }, - { - "description": "Jurisdiction Metadata for JON_94(2020) id 7dd0cfec-2e73-4c61-ad8b-fc0b00cede38", - "key": "7dd0cfec-2e73-4c61-ad8b-fc0b00cede38", - "label": "JON_94(2020) metadata", - "value": "27202" - }, - { - "description": "Jurisdiction Metadata for JON_27(2020) id e3f2842d-6ccd-4292-b109-c89a99065c5b", - "key": "e3f2842d-6ccd-4292-b109-c89a99065c5b", - "label": "JON_27(2020) metadata", - "value": "27203" - }, - { - "description": "Jurisdiction Metadata for JON_31(2020) id 74999b18-4a4f-4829-9494-2d8f7ced841e", - "key": "74999b18-4a4f-4829-9494-2d8f7ced841e", - "label": "JON_31(2020) metadata", - "value": "27204" - }, - { - "description": "Jurisdiction Metadata for JON_44(2020) id 926a0e5b-44f2-4607-8010-4ea50f9c6b4d", - "key": "926a0e5b-44f2-4607-8010-4ea50f9c6b4d", - "label": "JON_44(2020) metadata", - "value": "27205" - }, - { - "description": "Jurisdiction Metadata for JON_89(2020) id d312e7b1-15e4-46c6-8a7f-c76be8af71a5", - "key": "d312e7b1-15e4-46c6-8a7f-c76be8af71a5", - "label": "JON_89(2020) metadata", - "value": "27206" - }, - { - "description": "Jurisdiction Metadata for JON_22(2020) id f870250a-5edc-43b1-8f14-dbab2636efcc", - "key": "f870250a-5edc-43b1-8f14-dbab2636efcc", - "label": "JON_22(2020) metadata", - "value": "27207" - }, - { - "description": "Jurisdiction Metadata for JON_98(2020) id e0b3791c-edfe-4bfd-82b0-63b17a389b4a", - "key": "e0b3791c-edfe-4bfd-82b0-63b17a389b4a", - "label": "JON_98(2020) metadata", - "value": "27208" - }, - { - "description": "Jurisdiction Metadata for JON_62(2020) id 83e7ec2b-cef0-4a54-be8c-a823f2c05a67", - "key": "83e7ec2b-cef0-4a54-be8c-a823f2c05a67", - "label": "JON_62(2020) metadata", - "value": "27209" - }, - { - "description": "Jurisdiction Metadata for JON_96(2020) id e64509a2-83f2-4e39-8363-0832386a735e", - "key": "e64509a2-83f2-4e39-8363-0832386a735e", - "label": "JON_96(2020) metadata", - "value": "27210" - }, - { - "description": "Jurisdiction Metadata for JON_46(2020) id 27f8db43-701f-4caf-91cd-91cec7533d6e", - "key": "27f8db43-701f-4caf-91cd-91cec7533d6e", - "label": "JON_46(2020) metadata", - "value": "27211" - }, - { - "description": "Jurisdiction Metadata for JON_1(2020) id d2741c73-574a-47e0-ac84-8da1c2ae48a0", - "key": "d2741c73-574a-47e0-ac84-8da1c2ae48a0", - "label": "JON_1(2020) metadata", - "value": "27212" - }, - { - "description": "Jurisdiction Metadata for JON_78(2020) id dbfe0ab9-9dab-44fb-bbf7-fc2547c52a0e", - "key": "dbfe0ab9-9dab-44fb-bbf7-fc2547c52a0e", - "label": "JON_78(2020) metadata", - "value": "27213" - }, - { - "description": "Jurisdiction Metadata for JON_75(2020) id 97ce1689-7f19-47e2-a5da-7f34da7489ec", - "key": "97ce1689-7f19-47e2-a5da-7f34da7489ec", - "label": "JON_75(2020) metadata", - "value": "27214" - }, - { - "description": "Jurisdiction Metadata for JON_33(2020) id 24731848-928e-4a69-bb80-c30a17daf0c5", - "key": "24731848-928e-4a69-bb80-c30a17daf0c5", - "label": "JON_33(2020) metadata", - "value": "27215" - }, - { - "description": "Jurisdiction Metadata for JON_11(2020) id 64a26d2a-409a-4753-b654-906a2d1a3faf", - "key": "64a26d2a-409a-4753-b654-906a2d1a3faf", - "label": "JON_11(2020) metadata", - "value": "27216" - }, - { - "description": "Jurisdiction Metadata for JON_67(2020) id 2cac3b8f-c39c-43b4-b0eb-7e743fd14478", - "key": "2cac3b8f-c39c-43b4-b0eb-7e743fd14478", - "label": "JON_67(2020) metadata", - "value": "27217" - }, - { - "description": "Jurisdiction Metadata for JON_10(2020) id a349071e-6be6-4231-8413-2f0c1f6d2b9a", - "key": "a349071e-6be6-4231-8413-2f0c1f6d2b9a", - "label": "JON_10(2020) metadata", - "value": "27218" - }, - { - "description": "Jurisdiction Metadata for JON_71(2020) id e7d582cc-9bf3-4f01-bdf6-de5e5b2c4034", - "key": "e7d582cc-9bf3-4f01-bdf6-de5e5b2c4034", - "label": "JON_71(2020) metadata", - "value": "27219" - }, - { - "description": "Jurisdiction Metadata for JON_2(2020) id b9e19a4d-aed5-45e7-b8e6-fb3b94ada38d", - "key": "b9e19a4d-aed5-45e7-b8e6-fb3b94ada38d", - "label": "JON_2(2020) metadata", - "value": "27220" - }, - { - "description": "Jurisdiction Metadata for JON_51(2020) id 8513fafe-281d-4c3f-85ee-03b38b8b2da9", - "key": "8513fafe-281d-4c3f-85ee-03b38b8b2da9", - "label": "JON_51(2020) metadata", - "value": "27221" - }, - { - "description": "Jurisdiction Metadata for JON_39(2020) id 71dd7634-0099-4dec-998d-1d407071735a", - "key": "71dd7634-0099-4dec-998d-1d407071735a", - "label": "JON_39(2020) metadata", - "value": "27222" - }, - { - "description": "Jurisdiction Metadata for JON_28(2020) id 34ce4df3-9b10-4cde-841f-632b76cfe51c", - "key": "34ce4df3-9b10-4cde-841f-632b76cfe51c", - "label": "JON_28(2020) metadata", - "value": "27223" - }, - { - "description": "Jurisdiction Metadata for JON_30(2020) id 12f78037-bb4a-4b6b-ae27-be021cdd0624", - "key": "12f78037-bb4a-4b6b-ae27-be021cdd0624", - "label": "JON_30(2020) metadata", - "value": "27224" - }, - { - "description": "Jurisdiction Metadata for JON_15(2020) id b1ce0a1c-4401-40ee-9879-c406721415c2", - "key": "b1ce0a1c-4401-40ee-9879-c406721415c2", - "label": "JON_15(2020) metadata", - "value": "27225" - }, - { - "description": "Jurisdiction Metadata for JON_84(2020) id f2a4ad57-055f-4fa7-823d-81211a623d6c", - "key": "f2a4ad57-055f-4fa7-823d-81211a623d6c", - "label": "JON_84(2020) metadata", - "value": "27226" - }, - { - "description": "Jurisdiction Metadata for JON_6(2020) id bbcb16af-29c1-4fc2-82c8-e327975bb39a", - "key": "bbcb16af-29c1-4fc2-82c8-e327975bb39a", - "label": "JON_6(2020) metadata", - "value": "27227" - }, - { - "description": "Jurisdiction Metadata for JON_60(2020) id 18ef53b2-33e1-48ea-b9ff-abfb6762ac75", - "key": "18ef53b2-33e1-48ea-b9ff-abfb6762ac75", - "label": "JON_60(2020) metadata", - "value": "27228" - }, - { - "description": "Jurisdiction Metadata for JON_74(2020) id b7858f4f-c479-49f8-8351-c0b4fa33f964", - "key": "b7858f4f-c479-49f8-8351-c0b4fa33f964", - "label": "JON_74(2020) metadata", - "value": "27229" - }, - { - "description": "Jurisdiction Metadata for JON_90(2020) id a0081e82-8fde-4e2c-91d7-0c9f5edbabc5", - "key": "a0081e82-8fde-4e2c-91d7-0c9f5edbabc5", - "label": "JON_90(2020) metadata", - "value": "27230" - }, - { - "description": "Jurisdiction Metadata for JON_52(2020) id dd359567-d699-40fc-8b8a-8c4b98716a9f", - "key": "dd359567-d699-40fc-8b8a-8c4b98716a9f", - "label": "JON_52(2020) metadata", - "value": "27231" - }, - { - "description": "Jurisdiction Metadata for JON_103(2020) id 7267944d-d8a6-4f87-ae4d-e766672aac35", - "key": "7267944d-d8a6-4f87-ae4d-e766672aac35", - "label": "JON_103(2020) metadata", - "value": "27232" - }, - { - "description": "Jurisdiction Metadata for JON_100(2020) id 377ba51a-4de1-490a-9004-eac16df48403", - "key": "377ba51a-4de1-490a-9004-eac16df48403", - "label": "JON_100(2020) metadata", - "value": "27233" - }, - { - "description": "Jurisdiction Metadata for JON_18(2020) id be4fa0f9-847d-40ac-9e84-dc369c070b62", - "key": "be4fa0f9-847d-40ac-9e84-dc369c070b62", - "label": "JON_18(2020) metadata", - "value": "27234" - }, - { - "description": "Jurisdiction Metadata for JON_8(2020) id 670dc486-8eec-4435-92c5-31aba7ee6e20", - "key": "670dc486-8eec-4435-92c5-31aba7ee6e20", - "label": "JON_8(2020) metadata", - "value": "27235" - }, - { - "description": "Jurisdiction Metadata for JON_85(2020) id 5c5b30b5-3c5e-4c6d-b203-24a9b7c47aea", - "key": "5c5b30b5-3c5e-4c6d-b203-24a9b7c47aea", - "label": "JON_85(2020) metadata", - "value": "27236" - }, - { - "description": "Jurisdiction Metadata for JON_104(2020) id f332ec11-ff65-4b7f-889c-907014e6770a", - "key": "f332ec11-ff65-4b7f-889c-907014e6770a", - "label": "JON_104(2020) metadata", - "value": "27237" - }, - { - "description": "Jurisdiction Metadata for JON_25(2020) id 907667dc-416f-49d9-b51e-2a414ec69061", - "key": "907667dc-416f-49d9-b51e-2a414ec69061", - "label": "JON_25(2020) metadata", - "value": "27238" - }, - { - "description": "Jurisdiction Metadata for JON_102(2020) id b53ec00d-e025-4b44-9a9e-5a80b6a5a957", - "key": "b53ec00d-e025-4b44-9a9e-5a80b6a5a957", - "label": "JON_102(2020) metadata", - "value": "27239" - }, - { - "description": "Jurisdiction Metadata for JON_97(2020) id 46012041-0b50-4f67-9b1b-737cfa965382", - "key": "46012041-0b50-4f67-9b1b-737cfa965382", - "label": "JON_97(2020) metadata", - "value": "27240" - }, - { - "description": "Jurisdiction Metadata for JON_36(2020) id 8d317aee-5e16-4770-be2d-9a8b890212ae", - "key": "8d317aee-5e16-4770-be2d-9a8b890212ae", - "label": "JON_36(2020) metadata", - "value": "27241" - }, - { - "description": "Jurisdiction Metadata for JON_13(2020) id a3514850-e37d-48ae-b88a-1bd44c8aab5e", - "key": "a3514850-e37d-48ae-b88a-1bd44c8aab5e", - "label": "JON_13(2020) metadata", - "value": "27242" - }, - { - "description": "Jurisdiction Metadata for JON_40(2020) id 47093142-48f1-4dac-9347-a628ea3a20ff", - "key": "47093142-48f1-4dac-9347-a628ea3a20ff", - "label": "JON_40(2020) metadata", - "value": "27243" - }, - { - "description": "Jurisdiction Metadata for Tafelansoni(2020) id b98b3c6a-6028-46aa-8b3f-a0b61909ebc8", - "key": "b98b3c6a-6028-46aa-8b3f-a0b61909ebc8", - "label": "Tafelansoni(2020) metadata", - "value": "27244" - }, - { - "description": "Jurisdiction Metadata for Namwela NHc id 03629e5f-75dc-4ee8-b73a-787ae2fc7beb", - "key": "03629e5f-75dc-4ee8-b73a-787ae2fc7beb", - "label": "Namwela NHc metadata", - "value": "27245" - }, - { - "description": "Jurisdiction Metadata for TFL_11(2020) id 972300dd-320a-4c19-800b-14b1a07767da", - "key": "972300dd-320a-4c19-800b-14b1a07767da", - "label": "TFL_11(2020) metadata", - "value": "27246" - }, - { - "description": "Jurisdiction Metadata for TFL_8(2020) id 4bed372d-789d-475a-8b06-9292b6e143e3", - "key": "4bed372d-789d-475a-8b06-9292b6e143e3", - "label": "TFL_8(2020) metadata", - "value": "27247" - }, - { - "description": "Jurisdiction Metadata for TFL_7(2020) id 6ea68da8-546f-4823-bcc6-c2dac522fa6c", - "key": "6ea68da8-546f-4823-bcc6-c2dac522fa6c", - "label": "TFL_7(2020) metadata", - "value": "27248" - }, - { - "description": "Jurisdiction Metadata for TFL_5(2020) id b8f16624-59a8-4b90-a761-c087d1651d32", - "key": "b8f16624-59a8-4b90-a761-c087d1651d32", - "label": "TFL_5(2020) metadata", - "value": "27249" - }, - { - "description": "Jurisdiction Metadata for TFL_3(2020) id bcb9b2ea-1ace-45bb-a1b3-b3ea321e95cc", - "key": "bcb9b2ea-1ace-45bb-a1b3-b3ea321e95cc", - "label": "TFL_3(2020) metadata", - "value": "27250" - }, - { - "description": "Jurisdiction Metadata for TFL_12(2020) id 74086fb8-3264-4ea1-8527-d939c6cbbeb0", - "key": "74086fb8-3264-4ea1-8527-d939c6cbbeb0", - "label": "TFL_12(2020) metadata", - "value": "27251" - }, - { - "description": "Jurisdiction Metadata for TFL_2(2020) id 172b504c-1337-4d27-acb5-0b9f4e0cfc81", - "key": "172b504c-1337-4d27-acb5-0b9f4e0cfc81", - "label": "TFL_2(2020) metadata", - "value": "27252" - }, - { - "description": "Jurisdiction Metadata for TFL_9(2020) id 6cba09a0-4028-450c-859a-1f86cb49f889", - "key": "6cba09a0-4028-450c-859a-1f86cb49f889", - "label": "TFL_9(2020) metadata", - "value": "27253" - }, - { - "description": "Jurisdiction Metadata for TFL_4(2020) id 48cd417e-d272-4ea5-b495-2f44ced83a2f", - "key": "48cd417e-d272-4ea5-b495-2f44ced83a2f", - "label": "TFL_4(2020) metadata", - "value": "27254" - }, - { - "description": "Jurisdiction Metadata for TFL_1(2020) id ee93578a-776c-4a47-8be8-a06d82123987", - "key": "ee93578a-776c-4a47-8be8-a06d82123987", - "label": "TFL_1(2020) metadata", - "value": "27255" - }, - { - "description": "Jurisdiction Metadata for TFL_15(2020) id 2d073573-74e2-4872-b206-8b7fc01b0110", - "key": "2d073573-74e2-4872-b206-8b7fc01b0110", - "label": "TFL_15(2020) metadata", - "value": "27256" - }, - { - "description": "Jurisdiction Metadata for TFL_10(2020) id 11900807-7a11-4753-8774-6fabf11bb0e4", - "key": "11900807-7a11-4753-8774-6fabf11bb0e4", - "label": "TFL_10(2020) metadata", - "value": "27257" - }, - { - "description": "Jurisdiction Metadata for TFL_13(2020) id 570d2e62-d8be-4929-a8e2-6c6001aee7d9", - "key": "570d2e62-d8be-4929-a8e2-6c6001aee7d9", - "label": "TFL_13(2020) metadata", - "value": "27258" - }, - { - "description": "Jurisdiction Metadata for TFL_16(2020) id dca841b6-004e-413c-b965-650dfb3f0f80", - "key": "dca841b6-004e-413c-b965-650dfb3f0f80", - "label": "TFL_16(2020) metadata", - "value": "27259" - }, - { - "description": "Jurisdiction Metadata for TFL_6(2020) id 0b939825-60bb-49d3-be49-58853c276e6c", - "key": "0b939825-60bb-49d3-be49-58853c276e6c", - "label": "TFL_6(2020) metadata", - "value": "27260" - }, - { - "description": "Jurisdiction Metadata for TFL_14(2020) id cf0f5735-12f7-4b8a-84c1-abc37d36a71b", - "key": "cf0f5735-12f7-4b8a-84c1-abc37d36a71b", - "label": "TFL_14(2020) metadata", - "value": "27261" - }, - { - "description": "Jurisdiction Metadata for Kabvumo(2020) id e9fc8a3a-88b7-40a9-8337-9835b03f702a", - "key": "e9fc8a3a-88b7-40a9-8337-9835b03f702a", - "label": "Kabvumo(2020) metadata", - "value": "27262" - }, - { - "description": "Jurisdiction Metadata for Mbongombe_NHC id 5c39eecc-3c22-43b9-8b1a-5ae53dbb5de1", - "key": "5c39eecc-3c22-43b9-8b1a-5ae53dbb5de1", - "label": "Mbongombe_NHC metadata", - "value": "27263" - }, - { - "description": "Jurisdiction Metadata for KBV_11(2020) id 4fb07345-4448-42d8-b7e3-18af3315f4cd", - "key": "4fb07345-4448-42d8-b7e3-18af3315f4cd", - "label": "KBV_11(2020) metadata", - "value": "27264" - }, - { - "description": "Jurisdiction Metadata for KBV_19(2020) id e58a62cc-33bd-4c41-b6c9-1fafae498010", - "key": "e58a62cc-33bd-4c41-b6c9-1fafae498010", - "label": "KBV_19(2020) metadata", - "value": "27265" - }, - { - "description": "Jurisdiction Metadata for KBV_22(2020) id 781839cc-e9c2-4e57-be43-2e64d1f28fdd", - "key": "781839cc-e9c2-4e57-be43-2e64d1f28fdd", - "label": "KBV_22(2020) metadata", - "value": "27266" - }, - { - "description": "Jurisdiction Metadata for KBV_24(2020) id 27bda7b7-74ef-45b5-a574-9f15c49deb7d", - "key": "27bda7b7-74ef-45b5-a574-9f15c49deb7d", - "label": "KBV_24(2020) metadata", - "value": "27267" - }, - { - "description": "Jurisdiction Metadata for KBV_6(2020) id 9ccf9d8a-20cc-4f36-a363-536e40b6125d", - "key": "9ccf9d8a-20cc-4f36-a363-536e40b6125d", - "label": "KBV_6(2020) metadata", - "value": "27268" - }, - { - "description": "Jurisdiction Metadata for KBV_7(2020) id 3236a662-c15f-46f2-8d72-c87f6421ff37", - "key": "3236a662-c15f-46f2-8d72-c87f6421ff37", - "label": "KBV_7(2020) metadata", - "value": "27269" - }, - { - "description": "Jurisdiction Metadata for KBV_18(2020) id 91d1e9b6-c5b0-4033-8c72-b7ef635213c2", - "key": "91d1e9b6-c5b0-4033-8c72-b7ef635213c2", - "label": "KBV_18(2020) metadata", - "value": "27270" - }, - { - "description": "Jurisdiction Metadata for KBV_8(2020) id 903f7c53-2e9f-4209-843d-5be4de50eba5", - "key": "903f7c53-2e9f-4209-843d-5be4de50eba5", - "label": "KBV_8(2020) metadata", - "value": "27271" - }, - { - "description": "Jurisdiction Metadata for KBV_2(2020) id d94c71da-8320-44f3-a290-6fd4652d7027", - "key": "d94c71da-8320-44f3-a290-6fd4652d7027", - "label": "KBV_2(2020) metadata", - "value": "27272" - }, - { - "description": "Jurisdiction Metadata for KBV_9(2020) id 2b9ca0ec-9916-422c-8263-fa5d749de8af", - "key": "2b9ca0ec-9916-422c-8263-fa5d749de8af", - "label": "KBV_9(2020) metadata", - "value": "27273" - }, - { - "description": "Jurisdiction Metadata for KBV_15(2020) id 854dbc58-f33e-41d5-81d5-e066f1808cdc", - "key": "854dbc58-f33e-41d5-81d5-e066f1808cdc", - "label": "KBV_15(2020) metadata", - "value": "27274" - }, - { - "description": "Jurisdiction Metadata for KBV_5(2020) id bbb61836-24c2-4fcc-b507-f4ed2563c070", - "key": "bbb61836-24c2-4fcc-b507-f4ed2563c070", - "label": "KBV_5(2020) metadata", - "value": "27275" - }, - { - "description": "Jurisdiction Metadata for KBV_12(2020) id cdee405c-14f5-4b9c-978b-893860b585c6", - "key": "cdee405c-14f5-4b9c-978b-893860b585c6", - "label": "KBV_12(2020) metadata", - "value": "27276" - }, - { - "description": "Jurisdiction Metadata for KBV_14(2020) id 86736564-01b2-47b6-9b45-0e5ed5daf21d", - "key": "86736564-01b2-47b6-9b45-0e5ed5daf21d", - "label": "KBV_14(2020) metadata", - "value": "27277" - }, - { - "description": "Jurisdiction Metadata for KBV_13(2020) id abec2865-3173-4d3d-971c-72757b3fe485", - "key": "abec2865-3173-4d3d-971c-72757b3fe485", - "label": "KBV_13(2020) metadata", - "value": "27278" - }, - { - "description": "Jurisdiction Metadata for KBV_20(2020) id c2d1a09f-c8ef-45fe-ac2e-43d2b3ca59ef", - "key": "c2d1a09f-c8ef-45fe-ac2e-43d2b3ca59ef", - "label": "KBV_20(2020) metadata", - "value": "27279" - }, - { - "description": "Jurisdiction Metadata for KBV_21(2020) id c6e7b2d3-60df-4b53-b5f1-5b171ffef979", - "key": "c6e7b2d3-60df-4b53-b5f1-5b171ffef979", - "label": "KBV_21(2020) metadata", - "value": "27280" - }, - { - "description": "Jurisdiction Metadata for KBV_16(2020) id b415311b-d0b5-43b2-a72e-19fd75cfa871", - "key": "b415311b-d0b5-43b2-a72e-19fd75cfa871", - "label": "KBV_16(2020) metadata", - "value": "27281" - }, - { - "description": "Jurisdiction Metadata for KBV_10(2020) id 6569d633-2dd7-4388-9543-c239728e435f", - "key": "6569d633-2dd7-4388-9543-c239728e435f", - "label": "KBV_10(2020) metadata", - "value": "27282" - }, - { - "description": "Jurisdiction Metadata for KBV_23(2020) id 8762ca5f-37c9-4a8f-8140-4dcd7d596f4f", - "key": "8762ca5f-37c9-4a8f-8140-4dcd7d596f4f", - "label": "KBV_23(2020) metadata", - "value": "27283" - }, - { - "description": "Jurisdiction Metadata for KBV_25(2020) id d1cc4604-52aa-4328-b15a-6329527ff245", - "key": "d1cc4604-52aa-4328-b15a-6329527ff245", - "label": "KBV_25(2020) metadata", - "value": "27284" - }, - { - "description": "Jurisdiction Metadata for KBV_4(2020) id e3d384ff-d464-47a9-84c8-549948911654", - "key": "e3d384ff-d464-47a9-84c8-549948911654", - "label": "KBV_4(2020) metadata", - "value": "27285" - }, - { - "description": "Jurisdiction Metadata for KBV_17(2020) id 765fcda9-a438-4716-8a18-71a9846cbc55", - "key": "765fcda9-a438-4716-8a18-71a9846cbc55", - "label": "KBV_17(2020) metadata", - "value": "27286" - }, - { - "description": "Jurisdiction Metadata for KBV_3(2020) id da19ebb7-b7b3-49b6-9588-6549220c8296", - "key": "da19ebb7-b7b3-49b6-9588-6549220c8296", - "label": "KBV_3(2020) metadata", - "value": "27287" - }, - { - "description": "Jurisdiction Metadata for KBV_1(2020) id 0a2828f7-75e6-4a0f-836e-5dd4c64c27d5", - "key": "0a2828f7-75e6-4a0f-836e-5dd4c64c27d5", - "label": "KBV_1(2020) metadata", - "value": "27288" - }, - { - "description": "Jurisdiction Metadata for Msokosela(2020) id bd89489a-b31d-42d7-a74f-e562e1def3ac", - "key": "bd89489a-b31d-42d7-a74f-e562e1def3ac", - "label": "Msokosela(2020) metadata", - "value": "27289" - }, - { - "description": "Jurisdiction Metadata for Kafele NHC id e72a80a2-25e1-4986-b6cf-668b45c78044", - "key": "e72a80a2-25e1-4986-b6cf-668b45c78044", - "label": "Kafele NHC metadata", - "value": "27290" - }, - { - "description": "Jurisdiction Metadata for MSK_5(2020) id e9a2962d-bfbf-440c-8d33-3f406bd1ff0e", - "key": "e9a2962d-bfbf-440c-8d33-3f406bd1ff0e", - "label": "MSK_5(2020) metadata", - "value": "27291" - }, - { - "description": "Jurisdiction Metadata for MSK_4(2020) id 528b058b-be8e-4b45-ba5c-cfd7b57831f5", - "key": "528b058b-be8e-4b45-ba5c-cfd7b57831f5", - "label": "MSK_4(2020) metadata", - "value": "27292" - }, - { - "description": "Jurisdiction Metadata for MSK_6(2020) id 9001aebe-3fa4-468c-959a-8bb96ba84328", - "key": "9001aebe-3fa4-468c-959a-8bb96ba84328", - "label": "MSK_6(2020) metadata", - "value": "27293" - }, - { - "description": "Jurisdiction Metadata for MSK_1(2020) id ab9ab6d8-5958-4cf8-820d-7fddfc412f30", - "key": "ab9ab6d8-5958-4cf8-820d-7fddfc412f30", - "label": "MSK_1(2020) metadata", - "value": "27294" - }, - { - "description": "Jurisdiction Metadata for MSK_8(2020) id 318d7a82-cf6e-46ef-924f-11f904899c93", - "key": "318d7a82-cf6e-46ef-924f-11f904899c93", - "label": "MSK_8(2020) metadata", - "value": "27295" - }, - { - "description": "Jurisdiction Metadata for MSK_14(2020) id 2f108e56-e8d9-45d0-9a21-c53723d32b3f", - "key": "2f108e56-e8d9-45d0-9a21-c53723d32b3f", - "label": "MSK_14(2020) metadata", - "value": "27296" - }, - { - "description": "Jurisdiction Metadata for MSK_9(2020) id 32cbd919-5fae-403d-98ae-fe971cab2580", - "key": "32cbd919-5fae-403d-98ae-fe971cab2580", - "label": "MSK_9(2020) metadata", - "value": "27297" - }, - { - "description": "Jurisdiction Metadata for MSK_7(2020) id 624c9d68-0fe0-4abe-a436-542e9b730112", - "key": "624c9d68-0fe0-4abe-a436-542e9b730112", - "label": "MSK_7(2020) metadata", - "value": "27298" - }, - { - "description": "Jurisdiction Metadata for MSK_3(2020) id 08533096-35e6-4ce8-9103-b9a5b97e7110", - "key": "08533096-35e6-4ce8-9103-b9a5b97e7110", - "label": "MSK_3(2020) metadata", - "value": "27299" - }, - { - "description": "Jurisdiction Metadata for MSK_15(2020) id d2a94f83-06ac-49b1-b8b3-2589746fc096", - "key": "d2a94f83-06ac-49b1-b8b3-2589746fc096", - "label": "MSK_15(2020) metadata", - "value": "27300" - }, - { - "description": "Jurisdiction Metadata for MSK_11(2020) id 1315b6dc-ca6f-40d2-a673-370e75efe166", - "key": "1315b6dc-ca6f-40d2-a673-370e75efe166", - "label": "MSK_11(2020) metadata", - "value": "27301" - }, - { - "description": "Jurisdiction Metadata for MSK_2(2020) id e5d533f4-2f9b-43f5-a294-7bc07ef676d1", - "key": "e5d533f4-2f9b-43f5-a294-7bc07ef676d1", - "label": "MSK_2(2020) metadata", - "value": "27302" - }, - { - "description": "Jurisdiction Metadata for MSK_13(2020) id 7dc1985b-5037-4829-a31b-98262a77e880", - "key": "7dc1985b-5037-4829-a31b-98262a77e880", - "label": "MSK_13(2020) metadata", - "value": "27303" - }, - { - "description": "Jurisdiction Metadata for MSK_10(2020) id bf637a57-4082-4ae7-a149-c453435ca302", - "key": "bf637a57-4082-4ae7-a149-c453435ca302", - "label": "MSK_10(2020) metadata", - "value": "27304" - }, - { - "description": "Jurisdiction Metadata for MSK_12(2020) id 5c93c157-7129-4ed9-9156-63814a392fe1", - "key": "5c93c157-7129-4ed9-9156-63814a392fe1", - "label": "MSK_12(2020) metadata", - "value": "27305" - }, - { - "description": "Jurisdiction Metadata for Sinalo(2020) id b7daea1a-65d3-4324-8bcb-90ab44d91fc3", - "key": "b7daea1a-65d3-4324-8bcb-90ab44d91fc3", - "label": "Sinalo(2020) metadata", - "value": "27306" - }, - { - "description": "Jurisdiction Metadata for Chikatima_NHC id 3f391d73-5591-4f5a-98b9-5f9b9fc1597f", - "key": "3f391d73-5591-4f5a-98b9-5f9b9fc1597f", - "label": "Chikatima_NHC metadata", - "value": "27307" - }, - { - "description": "Jurisdiction Metadata for SNO_13(2020) id dc0e98ec-7162-4353-8f04-85c2c55494ca", - "key": "dc0e98ec-7162-4353-8f04-85c2c55494ca", - "label": "SNO_13(2020) metadata", - "value": "27308" - }, - { - "description": "Jurisdiction Metadata for SNO_7(2020) id 5a0f85e0-6381-41cc-b356-3001d519be2e", - "key": "5a0f85e0-6381-41cc-b356-3001d519be2e", - "label": "SNO_7(2020) metadata", - "value": "27309" - }, - { - "description": "Jurisdiction Metadata for SNO_15(2020) id 0ed2b7eb-243d-49dd-89e4-b70fa15949c0", - "key": "0ed2b7eb-243d-49dd-89e4-b70fa15949c0", - "label": "SNO_15(2020) metadata", - "value": "27310" - }, - { - "description": "Jurisdiction Metadata for SNO_5(2020) id 39695490-e43f-469d-9600-9ded64886355", - "key": "39695490-e43f-469d-9600-9ded64886355", - "label": "SNO_5(2020) metadata", - "value": "27311" - }, - { - "description": "Jurisdiction Metadata for SNO_11(2020) id c0241ef0-0a80-4c16-be1e-31601e21a339", - "key": "c0241ef0-0a80-4c16-be1e-31601e21a339", - "label": "SNO_11(2020) metadata", - "value": "27312" - }, - { - "description": "Jurisdiction Metadata for SNO_14(2020) id d88f9e75-7981-461e-968a-2a6af517aba8", - "key": "d88f9e75-7981-461e-968a-2a6af517aba8", - "label": "SNO_14(2020) metadata", - "value": "27313" - }, - { - "description": "Jurisdiction Metadata for SNO_1(2020) id 9c42c0f6-dd1d-43af-a468-e029bb93b2a1", - "key": "9c42c0f6-dd1d-43af-a468-e029bb93b2a1", - "label": "SNO_1(2020) metadata", - "value": "27314" - }, - { - "description": "Jurisdiction Metadata for SNO_3(2020) id 24102c48-6fdc-4298-b07b-7c2997076cc7", - "key": "24102c48-6fdc-4298-b07b-7c2997076cc7", - "label": "SNO_3(2020) metadata", - "value": "27315" - }, - { - "description": "Jurisdiction Metadata for SNO_4(2020) id 97a83c47-5899-4605-a173-747771c7f1cc", - "key": "97a83c47-5899-4605-a173-747771c7f1cc", - "label": "SNO_4(2020) metadata", - "value": "27316" - }, - { - "description": "Jurisdiction Metadata for SNO_6(2020) id b0767442-4661-462b-89c7-6ea759c19135", - "key": "b0767442-4661-462b-89c7-6ea759c19135", - "label": "SNO_6(2020) metadata", - "value": "27317" - }, - { - "description": "Jurisdiction Metadata for SNO_9(2020) id dd9fe367-0e48-4b80-bb38-382bcf3ca3b0", - "key": "dd9fe367-0e48-4b80-bb38-382bcf3ca3b0", - "label": "SNO_9(2020) metadata", - "value": "27318" - }, - { - "description": "Jurisdiction Metadata for SNO_12(2020) id a5637f30-7dd6-4301-9887-8260056d9896", - "key": "a5637f30-7dd6-4301-9887-8260056d9896", - "label": "SNO_12(2020) metadata", - "value": "27319" - }, - { - "description": "Jurisdiction Metadata for SNO_8(2020) id 741ba316-01d2-4857-8ae5-b14d2a5f0a39", - "key": "741ba316-01d2-4857-8ae5-b14d2a5f0a39", - "label": "SNO_8(2020) metadata", - "value": "27320" - }, - { - "description": "Jurisdiction Metadata for SNO_10(2020) id 103885f9-607e-4efb-b0b9-69cb49c7471a", - "key": "103885f9-607e-4efb-b0b9-69cb49c7471a", - "label": "SNO_10(2020) metadata", - "value": "27321" - }, - { - "description": "Jurisdiction Metadata for SNO_2(2020) id 0bf709b7-0e20-489e-8299-a5e2036c5a3a", - "key": "0bf709b7-0e20-489e-8299-a5e2036c5a3a", - "label": "SNO_2(2020) metadata", - "value": "27322" - }, - { - "description": "Jurisdiction Metadata for Chanida Border(2020) id 8f3506ef-7cd2-4326-92af-143175432ac0", - "key": "8f3506ef-7cd2-4326-92af-143175432ac0", - "label": "Chanida Border(2020) metadata", - "value": "27323" - }, - { - "description": "Jurisdiction Metadata for Border_NHC id b17e5ef7-ca63-4ce5-81ad-8891580246d9", - "key": "b17e5ef7-ca63-4ce5-81ad-8891580246d9", - "label": "Border_NHC metadata", - "value": "27324" - }, - { - "description": "Jurisdiction Metadata for CNB_3(2020) id 389045c8-332f-4ce0-ad21-3a105c8a2503", - "key": "389045c8-332f-4ce0-ad21-3a105c8a2503", - "label": "CNB_3(2020) metadata", - "value": "27325" - }, - { - "description": "Jurisdiction Metadata for CNB_11(2020) id 6ad35299-f98d-4c73-864b-789f7125c7e3", - "key": "6ad35299-f98d-4c73-864b-789f7125c7e3", - "label": "CNB_11(2020) metadata", - "value": "27326" - }, - { - "description": "Jurisdiction Metadata for CNB_8(2020) id 8b13d8fb-4c06-43d0-96bd-d463ce802960", - "key": "8b13d8fb-4c06-43d0-96bd-d463ce802960", - "label": "CNB_8(2020) metadata", - "value": "27327" - }, - { - "description": "Jurisdiction Metadata for CNB_7(2020) id 053afe53-9674-4a2f-a61f-a1991400e50e", - "key": "053afe53-9674-4a2f-a61f-a1991400e50e", - "label": "CNB_7(2020) metadata", - "value": "27328" - }, - { - "description": "Jurisdiction Metadata for CNB_1(2020) id 83867020-68ca-4063-810f-094bbe87b856", - "key": "83867020-68ca-4063-810f-094bbe87b856", - "label": "CNB_1(2020) metadata", - "value": "27329" - }, - { - "description": "Jurisdiction Metadata for CNB_5(2020) id 3d5d6011-4844-42c7-acaf-0462187cbcbd", - "key": "3d5d6011-4844-42c7-acaf-0462187cbcbd", - "label": "CNB_5(2020) metadata", - "value": "27330" - }, - { - "description": "Jurisdiction Metadata for CNB_12(2020) id e282f646-1d7e-4761-bb97-3e7a7adf33fd", - "key": "e282f646-1d7e-4761-bb97-3e7a7adf33fd", - "label": "CNB_12(2020) metadata", - "value": "27331" - }, - { - "description": "Jurisdiction Metadata for CNB_2(2020) id f29fb836-4c3e-4732-9ced-55dd26e14935", - "key": "f29fb836-4c3e-4732-9ced-55dd26e14935", - "label": "CNB_2(2020) metadata", - "value": "27332" - }, - { - "description": "Jurisdiction Metadata for CNB_9(2020) id d0df0735-8665-437d-a168-c32a89404a0a", - "key": "d0df0735-8665-437d-a168-c32a89404a0a", - "label": "CNB_9(2020) metadata", - "value": "27333" - }, - { - "description": "Jurisdiction Metadata for CNB_6(2020) id 164d9cb9-5974-4de0-b9ce-44348879d814", - "key": "164d9cb9-5974-4de0-b9ce-44348879d814", - "label": "CNB_6(2020) metadata", - "value": "27334" - }, - { - "description": "Jurisdiction Metadata for CNB_14(2020) id 11320dbe-c08f-4953-b30c-880b1708065b", - "key": "11320dbe-c08f-4953-b30c-880b1708065b", - "label": "CNB_14(2020) metadata", - "value": "27335" - }, - { - "description": "Jurisdiction Metadata for CNB_13(2020) id 2cef1ace-345d-4159-8d66-08f702dda55c", - "key": "2cef1ace-345d-4159-8d66-08f702dda55c", - "label": "CNB_13(2020) metadata", - "value": "27336" - }, - { - "description": "Jurisdiction Metadata for CNB_10(2020) id e37ca9bd-0bbc-45bf-9d1b-77606cc54cbc", - "key": "e37ca9bd-0bbc-45bf-9d1b-77606cc54cbc", - "label": "CNB_10(2020) metadata", - "value": "27337" - }, - { - "description": "Jurisdiction Metadata for CNB_4(2020) id 0f683266-630e-4f61-b2a2-1d9f92abbe57", - "key": "0f683266-630e-4f61-b2a2-1d9f92abbe57", - "label": "CNB_4(2020) metadata", - "value": "27338" - }, - { - "description": "Jurisdiction Metadata for CNB_15(2020) id d91d2ef8-07f3-448c-bfa1-82a594a7eef8", - "key": "d91d2ef8-07f3-448c-bfa1-82a594a7eef8", - "label": "CNB_15(2020) metadata", - "value": "27339" - }, - { - "description": "Jurisdiction Metadata for CNB_16(2020) id 7a1c8d35-20b1-4d4a-9332-ef00b4b3f9bf", - "key": "7a1c8d35-20b1-4d4a-9332-ef00b4b3f9bf", - "label": "CNB_16(2020) metadata", - "value": "27340" - }, - { - "description": "Jurisdiction Metadata for Zemba(2020) id 3970ee33-cde8-4b39-9af9-5b120ecea0b7", - "key": "3970ee33-cde8-4b39-9af9-5b120ecea0b7", - "label": "Zemba(2020) metadata", - "value": "27341" - }, - { - "description": "Jurisdiction Metadata for Mangwe_NHC id 3403b9c7-3025-40a4-9290-ef3817483572", - "key": "3403b9c7-3025-40a4-9290-ef3817483572", - "label": "Mangwe_NHC metadata", - "value": "27342" - }, - { - "description": "Jurisdiction Metadata for ZMB_118(2020) id 24ffa05d-77ac-4529-91c9-8b829908c8f5", - "key": "24ffa05d-77ac-4529-91c9-8b829908c8f5", - "label": "ZMB_118(2020) metadata", - "value": "27343" - }, - { - "description": "Jurisdiction Metadata for ZMB_121(2020) id 71094193-df79-429a-9273-f118d43cf8a6", - "key": "71094193-df79-429a-9273-f118d43cf8a6", - "label": "ZMB_121(2020) metadata", - "value": "27344" - }, - { - "description": "Jurisdiction Metadata for ZMB_95(2020) id 08340255-f1a9-48d3-bb9b-b19010d64151", - "key": "08340255-f1a9-48d3-bb9b-b19010d64151", - "label": "ZMB_95(2020) metadata", - "value": "27345" - }, - { - "description": "Jurisdiction Metadata for ZMB_33(2020) id 9e647275-0cfd-4a60-a1e7-2cf0ea649f92", - "key": "9e647275-0cfd-4a60-a1e7-2cf0ea649f92", - "label": "ZMB_33(2020) metadata", - "value": "27346" - }, - { - "description": "Jurisdiction Metadata for ZMB_13(2020) id a5f27f65-90f0-4a4f-bab0-800519e4244d", - "key": "a5f27f65-90f0-4a4f-bab0-800519e4244d", - "label": "ZMB_13(2020) metadata", - "value": "27347" - }, - { - "description": "Jurisdiction Metadata for ZMB_27(2020) id c385c600-d06b-4c63-9604-04fff3e11e03", - "key": "c385c600-d06b-4c63-9604-04fff3e11e03", - "label": "ZMB_27(2020) metadata", - "value": "27348" - }, - { - "description": "Jurisdiction Metadata for ZMB_8(2020) id 842bddf1-606c-4cd3-a404-00ecc56a6198", - "key": "842bddf1-606c-4cd3-a404-00ecc56a6198", - "label": "ZMB_8(2020) metadata", - "value": "27349" - }, - { - "description": "Jurisdiction Metadata for ZMB_19(2020) id 284724c3-6f94-4173-b25b-bd442f5b4eb1", - "key": "284724c3-6f94-4173-b25b-bd442f5b4eb1", - "label": "ZMB_19(2020) metadata", - "value": "27350" - }, - { - "description": "Jurisdiction Metadata for ZMB_64(2020) id 7a62d1b6-610a-4483-a2d2-44c08c4f6bf6", - "key": "7a62d1b6-610a-4483-a2d2-44c08c4f6bf6", - "label": "ZMB_64(2020) metadata", - "value": "27351" - }, - { - "description": "Jurisdiction Metadata for ZMB_76(2020) id 9e85edb1-8e8b-4ddd-9a60-5be44086db39", - "key": "9e85edb1-8e8b-4ddd-9a60-5be44086db39", - "label": "ZMB_76(2020) metadata", - "value": "27352" - }, - { - "description": "Jurisdiction Metadata for ZMB_77(2020) id a7508ed1-aa77-42ac-8596-a5ebcabc2b93", - "key": "a7508ed1-aa77-42ac-8596-a5ebcabc2b93", - "label": "ZMB_77(2020) metadata", - "value": "27353" - }, - { - "description": "Jurisdiction Metadata for ZMB_50(2020) id 6d61312b-2b52-499c-99b7-136c5c993991", - "key": "6d61312b-2b52-499c-99b7-136c5c993991", - "label": "ZMB_50(2020) metadata", - "value": "27354" - }, - { - "description": "Jurisdiction Metadata for ZMB_38(2020) id 1a0033cf-fec7-49ac-8348-6b54bb7caef8", - "key": "1a0033cf-fec7-49ac-8348-6b54bb7caef8", - "label": "ZMB_38(2020) metadata", - "value": "27355" - }, - { - "description": "Jurisdiction Metadata for ZMB_45(2020) id dbf95afa-640c-41b0-989a-afcaff99fb81", - "key": "dbf95afa-640c-41b0-989a-afcaff99fb81", - "label": "ZMB_45(2020) metadata", - "value": "27356" - }, - { - "description": "Jurisdiction Metadata for ZMB_60(2020) id 45902aca-46a8-4397-a542-b2fa65c9d9b0", - "key": "45902aca-46a8-4397-a542-b2fa65c9d9b0", - "label": "ZMB_60(2020) metadata", - "value": "27357" - }, - { - "description": "Jurisdiction Metadata for ZMB_36(2020) id cb7b8045-fbc9-4723-abd0-f19801238d92", - "key": "cb7b8045-fbc9-4723-abd0-f19801238d92", - "label": "ZMB_36(2020) metadata", - "value": "27358" - }, - { - "description": "Jurisdiction Metadata for ZMB_51(2020) id 5ed9f5fa-29ef-4228-86a2-2a7ef970ecc7", - "key": "5ed9f5fa-29ef-4228-86a2-2a7ef970ecc7", - "label": "ZMB_51(2020) metadata", - "value": "27359" - }, - { - "description": "Jurisdiction Metadata for ZMB_73(2020) id 0c3bc5f1-dbeb-408b-bfd5-de21e81cb339", - "key": "0c3bc5f1-dbeb-408b-bfd5-de21e81cb339", - "label": "ZMB_73(2020) metadata", - "value": "27360" - }, - { - "description": "Jurisdiction Metadata for ZMB_93(2020) id bde488c3-54e1-4c68-8184-e6d282ae3268", - "key": "bde488c3-54e1-4c68-8184-e6d282ae3268", - "label": "ZMB_93(2020) metadata", - "value": "27361" - }, - { - "description": "Jurisdiction Metadata for ZMB_68(2020) id a24100d7-8816-4012-b27f-05e3a532a9e1", - "key": "a24100d7-8816-4012-b27f-05e3a532a9e1", - "label": "ZMB_68(2020) metadata", - "value": "27362" - }, - { - "description": "Jurisdiction Metadata for ZMB_49(2020) id 0eef5867-0361-4e94-96f3-2c79a661e42b", - "key": "0eef5867-0361-4e94-96f3-2c79a661e42b", - "label": "ZMB_49(2020) metadata", - "value": "27363" - }, - { - "description": "Jurisdiction Metadata for ZMB_52(2020) id 7ab090d0-a335-491f-9a75-fd64c45aa374", - "key": "7ab090d0-a335-491f-9a75-fd64c45aa374", - "label": "ZMB_52(2020) metadata", - "value": "27364" - }, - { - "description": "Jurisdiction Metadata for ZMB_15(2020) id d2c360ae-c866-4041-9a24-3b0120a226e5", - "key": "d2c360ae-c866-4041-9a24-3b0120a226e5", - "label": "ZMB_15(2020) metadata", - "value": "27365" - }, - { - "description": "Jurisdiction Metadata for ZMB_7(2020) id 7eaa688d-a19c-4a6f-b755-14643a51d405", - "key": "7eaa688d-a19c-4a6f-b755-14643a51d405", - "label": "ZMB_7(2020) metadata", - "value": "27366" - }, - { - "description": "Jurisdiction Metadata for ZMB_79(2020) id 55236d28-878a-4bbb-bf4b-1adf4f13315c", - "key": "55236d28-878a-4bbb-bf4b-1adf4f13315c", - "label": "ZMB_79(2020) metadata", - "value": "27367" - }, - { - "description": "Jurisdiction Metadata for ZMB_5(2020) id ef051e6f-0989-4d31-9e46-d5fe2bb2321b", - "key": "ef051e6f-0989-4d31-9e46-d5fe2bb2321b", - "label": "ZMB_5(2020) metadata", - "value": "27368" - }, - { - "description": "Jurisdiction Metadata for ZMB_105(2020) id 4ccb442c-2f3b-41a9-a2c6-441e7732c085", - "key": "4ccb442c-2f3b-41a9-a2c6-441e7732c085", - "label": "ZMB_105(2020) metadata", - "value": "27369" - }, - { - "description": "Jurisdiction Metadata for ZMB_20(2020) id ec5a3b9b-5ee9-4efd-a04c-6567ba1b0fad", - "key": "ec5a3b9b-5ee9-4efd-a04c-6567ba1b0fad", - "label": "ZMB_20(2020) metadata", - "value": "27370" - }, - { - "description": "Jurisdiction Metadata for ZMB_21(2020) id fca8bcce-880d-4307-a8a0-45d284968d53", - "key": "fca8bcce-880d-4307-a8a0-45d284968d53", - "label": "ZMB_21(2020) metadata", - "value": "27371" - }, - { - "description": "Jurisdiction Metadata for ZMB_26(2020) id e2aba9fb-6838-47fa-ad32-6d4fa5305d0e", - "key": "e2aba9fb-6838-47fa-ad32-6d4fa5305d0e", - "label": "ZMB_26(2020) metadata", - "value": "27372" - }, - { - "description": "Jurisdiction Metadata for ZMB_57(2020) id 800f6ace-f43f-47ba-815c-8e21dee26beb", - "key": "800f6ace-f43f-47ba-815c-8e21dee26beb", - "label": "ZMB_57(2020) metadata", - "value": "27373" - }, - { - "description": "Jurisdiction Metadata for ZMB_55(2020) id a503481d-ac9f-4b41-b939-7eac3094a4e0", - "key": "a503481d-ac9f-4b41-b939-7eac3094a4e0", - "label": "ZMB_55(2020) metadata", - "value": "27374" - }, - { - "description": "Jurisdiction Metadata for ZMB_89(2020) id 2a3004e7-8845-4c5a-9aba-c220040b17aa", - "key": "2a3004e7-8845-4c5a-9aba-c220040b17aa", - "label": "ZMB_89(2020) metadata", - "value": "27375" - }, - { - "description": "Jurisdiction Metadata for ZMB_81(2020) id e3792568-58f0-4064-a9df-b23c6a1a3343", - "key": "e3792568-58f0-4064-a9df-b23c6a1a3343", - "label": "ZMB_81(2020) metadata", - "value": "27376" - }, - { - "description": "Jurisdiction Metadata for ZMB_82(2020) id fbbf86f9-b87d-47f1-99b6-236cb26556c6", - "key": "fbbf86f9-b87d-47f1-99b6-236cb26556c6", - "label": "ZMB_82(2020) metadata", - "value": "27377" - }, - { - "description": "Jurisdiction Metadata for ZMB_75(2020) id 91e0ccfd-fb39-49e0-84c1-c452d0cbc88b", - "key": "91e0ccfd-fb39-49e0-84c1-c452d0cbc88b", - "label": "ZMB_75(2020) metadata", - "value": "27378" - }, - { - "description": "Jurisdiction Metadata for ZMB_25(2020) id a12239b6-3b0a-43e4-9cca-3cd86832ded2", - "key": "a12239b6-3b0a-43e4-9cca-3cd86832ded2", - "label": "ZMB_25(2020) metadata", - "value": "27379" - }, - { - "description": "Jurisdiction Metadata for ZMB_62(2020) id f390c304-7a32-4813-be03-f7042cd62a92", - "key": "f390c304-7a32-4813-be03-f7042cd62a92", - "label": "ZMB_62(2020) metadata", - "value": "27380" - }, - { - "description": "Jurisdiction Metadata for ZMB_17(2020) id b5af2c1c-2ed6-4d08-bd7d-9d4dcefb98cf", - "key": "b5af2c1c-2ed6-4d08-bd7d-9d4dcefb98cf", - "label": "ZMB_17(2020) metadata", - "value": "27381" - }, - { - "description": "Jurisdiction Metadata for ZMB_116(2020) id 4da1e56d-177c-4faa-b734-943d0be068c3", - "key": "4da1e56d-177c-4faa-b734-943d0be068c3", - "label": "ZMB_116(2020) metadata", - "value": "27382" - }, - { - "description": "Jurisdiction Metadata for ZMB_35(2020) id 3719ab83-4968-4cab-aec1-8fa76b43261e", - "key": "3719ab83-4968-4cab-aec1-8fa76b43261e", - "label": "ZMB_35(2020) metadata", - "value": "27383" - }, - { - "description": "Jurisdiction Metadata for ZMB_37(2020) id 3f9802a0-ff45-440d-b0b2-f0d2474b9fc2", - "key": "3f9802a0-ff45-440d-b0b2-f0d2474b9fc2", - "label": "ZMB_37(2020) metadata", - "value": "27384" - }, - { - "description": "Jurisdiction Metadata for ZMB_103(2020) id 0c634971-8af7-492d-b663-dea3882fd20b", - "key": "0c634971-8af7-492d-b663-dea3882fd20b", - "label": "ZMB_103(2020) metadata", - "value": "27385" - }, - { - "description": "Jurisdiction Metadata for ZMB_1(2020) id 3dff89c2-5ca7-4570-b51c-bbc7e4c07ee3", - "key": "3dff89c2-5ca7-4570-b51c-bbc7e4c07ee3", - "label": "ZMB_1(2020) metadata", - "value": "27386" - }, - { - "description": "Jurisdiction Metadata for ZMB_63(2020) id a6640d93-5811-4f00-8e1f-4681b97d9eb0", - "key": "a6640d93-5811-4f00-8e1f-4681b97d9eb0", - "label": "ZMB_63(2020) metadata", - "value": "27387" - }, - { - "description": "Jurisdiction Metadata for ZMB_80(2020) id 2c9478ad-8c02-4c0e-8780-8bfe1c6d430d", - "key": "2c9478ad-8c02-4c0e-8780-8bfe1c6d430d", - "label": "ZMB_80(2020) metadata", - "value": "27388" - }, - { - "description": "Jurisdiction Metadata for ZMB_18(2020) id e507f6ec-0080-4809-9de0-eb1eb3e2c301", - "key": "e507f6ec-0080-4809-9de0-eb1eb3e2c301", - "label": "ZMB_18(2020) metadata", - "value": "27389" - }, - { - "description": "Jurisdiction Metadata for ZMB_74(2020) id eaf6ceb8-254d-47f1-8c90-602469f4474d", - "key": "eaf6ceb8-254d-47f1-8c90-602469f4474d", - "label": "ZMB_74(2020) metadata", - "value": "27390" - }, - { - "description": "Jurisdiction Metadata for ZMB_110(2020) id e7b1d409-6fad-4a43-9eda-c20c80979e51", - "key": "e7b1d409-6fad-4a43-9eda-c20c80979e51", - "label": "ZMB_110(2020) metadata", - "value": "27391" - }, - { - "description": "Jurisdiction Metadata for ZMB_34(2020) id ee260e50-1e2a-4ecd-be98-e9ddeb1ecdc8", - "key": "ee260e50-1e2a-4ecd-be98-e9ddeb1ecdc8", - "label": "ZMB_34(2020) metadata", - "value": "27392" - }, - { - "description": "Jurisdiction Metadata for ZMB_104(2020) id 0bf03e5b-2137-4b65-9a3a-23001c09cba4", - "key": "0bf03e5b-2137-4b65-9a3a-23001c09cba4", - "label": "ZMB_104(2020) metadata", - "value": "27393" - }, - { - "description": "Jurisdiction Metadata for ZMB_42(2020) id 48f4cd87-9931-4f85-846c-2e8ea2b8efe6", - "key": "48f4cd87-9931-4f85-846c-2e8ea2b8efe6", - "label": "ZMB_42(2020) metadata", - "value": "27394" - }, - { - "description": "Jurisdiction Metadata for ZMB_87(2020) id ae04218d-ca82-4cfa-9295-cf4404717384", - "key": "ae04218d-ca82-4cfa-9295-cf4404717384", - "label": "ZMB_87(2020) metadata", - "value": "27395" - }, - { - "description": "Jurisdiction Metadata for ZMB_113(2020) id a6d18fe4-4695-4b2c-b47d-ca2d9683e771", - "key": "a6d18fe4-4695-4b2c-b47d-ca2d9683e771", - "label": "ZMB_113(2020) metadata", - "value": "27396" - }, - { - "description": "Jurisdiction Metadata for ZMB_120(2020) id 4be82327-d2e2-4b12-99d5-37aec685acc7", - "key": "4be82327-d2e2-4b12-99d5-37aec685acc7", - "label": "ZMB_120(2020) metadata", - "value": "27397" - }, - { - "description": "Jurisdiction Metadata for ZMB_2(2020) id 6a57f9fd-567b-45cf-b1b4-00d36c96bb99", - "key": "6a57f9fd-567b-45cf-b1b4-00d36c96bb99", - "label": "ZMB_2(2020) metadata", - "value": "27398" - }, - { - "description": "Jurisdiction Metadata for ZMB_108(2020) id 066cd36f-2d01-4893-9cd2-fc22ee2b7ee3", - "key": "066cd36f-2d01-4893-9cd2-fc22ee2b7ee3", - "label": "ZMB_108(2020) metadata", - "value": "27399" - }, - { - "description": "Jurisdiction Metadata for ZMB_48(2020) id a5f48bbb-0139-4bde-8852-427535b973e6", - "key": "a5f48bbb-0139-4bde-8852-427535b973e6", - "label": "ZMB_48(2020) metadata", - "value": "27400" - }, - { - "description": "Jurisdiction Metadata for ZMB_112(2020) id 4f105778-d674-47cc-b296-23346b8f0776", - "key": "4f105778-d674-47cc-b296-23346b8f0776", - "label": "ZMB_112(2020) metadata", - "value": "27401" - }, - { - "description": "Jurisdiction Metadata for ZMB_66(2020) id abbd0eb2-64ca-42ee-82c2-427a32ecb2f9", - "key": "abbd0eb2-64ca-42ee-82c2-427a32ecb2f9", - "label": "ZMB_66(2020) metadata", - "value": "27402" - }, - { - "description": "Jurisdiction Metadata for ZMB_9(2020) id 2ed57d26-1147-47a3-8d79-d24505a6336c", - "key": "2ed57d26-1147-47a3-8d79-d24505a6336c", - "label": "ZMB_9(2020) metadata", - "value": "27403" - }, - { - "description": "Jurisdiction Metadata for ZMB_102(2020) id c20a2916-453b-4eb5-aea8-9464a1aefa8f", - "key": "c20a2916-453b-4eb5-aea8-9464a1aefa8f", - "label": "ZMB_102(2020) metadata", - "value": "27404" - }, - { - "description": "Jurisdiction Metadata for ZMB_47(2020) id 1dccfb08-2077-463a-b136-75e4517b92c7", - "key": "1dccfb08-2077-463a-b136-75e4517b92c7", - "label": "ZMB_47(2020) metadata", - "value": "27405" - }, - { - "description": "Jurisdiction Metadata for ZMB_32(2020) id 94144b6a-0abf-4eff-978f-c12dc19a8569", - "key": "94144b6a-0abf-4eff-978f-c12dc19a8569", - "label": "ZMB_32(2020) metadata", - "value": "27406" - }, - { - "description": "Jurisdiction Metadata for ZMB_43(2020) id 40b9f13b-efed-4f6c-8303-e13cf794b70a", - "key": "40b9f13b-efed-4f6c-8303-e13cf794b70a", - "label": "ZMB_43(2020) metadata", - "value": "27407" - }, - { - "description": "Jurisdiction Metadata for ZMB_71(2020) id 5b623cf9-9671-4f84-a3a9-36acb7d619a7", - "key": "5b623cf9-9671-4f84-a3a9-36acb7d619a7", - "label": "ZMB_71(2020) metadata", - "value": "27408" - }, - { - "description": "Jurisdiction Metadata for ZMB_83(2020) id 6637e711-5bb0-406e-8d7d-05597a71e3fd", - "key": "6637e711-5bb0-406e-8d7d-05597a71e3fd", - "label": "ZMB_83(2020) metadata", - "value": "27409" - }, - { - "description": "Jurisdiction Metadata for ZMB_41(2020) id 278f5031-4725-4a0a-91e9-5c64ec97eeb4", - "key": "278f5031-4725-4a0a-91e9-5c64ec97eeb4", - "label": "ZMB_41(2020) metadata", - "value": "27410" - }, - { - "description": "Jurisdiction Metadata for ZMB_31(2020) id 7a2d410c-7fe5-4b35-b191-830f8379b85a", - "key": "7a2d410c-7fe5-4b35-b191-830f8379b85a", - "label": "ZMB_31(2020) metadata", - "value": "27411" - }, - { - "description": "Jurisdiction Metadata for ZMB_98(2020) id 65160c6c-2d0d-4178-82c4-2351da8574cc", - "key": "65160c6c-2d0d-4178-82c4-2351da8574cc", - "label": "ZMB_98(2020) metadata", - "value": "27412" - }, - { - "description": "Jurisdiction Metadata for ZMB_94(2020) id 05f91fe3-971d-452b-b0a7-00e89bc21215", - "key": "05f91fe3-971d-452b-b0a7-00e89bc21215", - "label": "ZMB_94(2020) metadata", - "value": "27413" - }, - { - "description": "Jurisdiction Metadata for ZMB_84(2020) id ecbce016-8eeb-4fc2-be44-7e249b43cf81", - "key": "ecbce016-8eeb-4fc2-be44-7e249b43cf81", - "label": "ZMB_84(2020) metadata", - "value": "27414" - }, - { - "description": "Jurisdiction Metadata for ZMB_23(2020) id 906c72f2-4553-4a06-8042-d1f5e7f066ac", - "key": "906c72f2-4553-4a06-8042-d1f5e7f066ac", - "label": "ZMB_23(2020) metadata", - "value": "27415" - }, - { - "description": "Jurisdiction Metadata for ZMB_58(2020) id 66e4ba8d-b832-4581-a5a5-67fc37405244", - "key": "66e4ba8d-b832-4581-a5a5-67fc37405244", - "label": "ZMB_58(2020) metadata", - "value": "27416" - }, - { - "description": "Jurisdiction Metadata for ZMB_88(2020) id 74d65cf0-61c5-445c-b4cd-2315f89def3c", - "key": "74d65cf0-61c5-445c-b4cd-2315f89def3c", - "label": "ZMB_88(2020) metadata", - "value": "27417" - }, - { - "description": "Jurisdiction Metadata for ZMB_69(2020) id 729a77d1-0981-4edd-9418-7c9100687fa2", - "key": "729a77d1-0981-4edd-9418-7c9100687fa2", - "label": "ZMB_69(2020) metadata", - "value": "27418" - }, - { - "description": "Jurisdiction Metadata for ZMB_4(2020) id 9c80d90c-86c9-487d-bcfd-1d37201cc879", - "key": "9c80d90c-86c9-487d-bcfd-1d37201cc879", - "label": "ZMB_4(2020) metadata", - "value": "27419" - }, - { - "description": "Jurisdiction Metadata for ZMB_10(2020) id 5741b1cb-4d16-426d-9860-e22247803439", - "key": "5741b1cb-4d16-426d-9860-e22247803439", - "label": "ZMB_10(2020) metadata", - "value": "27420" - }, - { - "description": "Jurisdiction Metadata for ZMB_12(2020) id 52e8a741-abd0-4033-a448-3961544a8338", - "key": "52e8a741-abd0-4033-a448-3961544a8338", - "label": "ZMB_12(2020) metadata", - "value": "27421" - }, - { - "description": "Jurisdiction Metadata for ZMB_114(2020) id 14c089b2-ff3a-494e-be5f-fa51e58cd372", - "key": "14c089b2-ff3a-494e-be5f-fa51e58cd372", - "label": "ZMB_114(2020) metadata", - "value": "27422" - }, - { - "description": "Jurisdiction Metadata for ZMB_117(2020) id 9ec022c3-17e0-484c-9ffe-ab644c2b641e", - "key": "9ec022c3-17e0-484c-9ffe-ab644c2b641e", - "label": "ZMB_117(2020) metadata", - "value": "27423" - }, - { - "description": "Jurisdiction Metadata for ZMB_115(2020) id 648cf7da-f584-494b-a04b-e13b30dfb29b", - "key": "648cf7da-f584-494b-a04b-e13b30dfb29b", - "label": "ZMB_115(2020) metadata", - "value": "27424" - }, - { - "description": "Jurisdiction Metadata for ZMB_24(2020) id 102d4005-4f75-4b15-ad29-a5194e14fd1b", - "key": "102d4005-4f75-4b15-ad29-a5194e14fd1b", - "label": "ZMB_24(2020) metadata", - "value": "27425" - }, - { - "description": "Jurisdiction Metadata for ZMB_39(2020) id d8cb0447-5764-4e2d-a7aa-6f4f94f8669f", - "key": "d8cb0447-5764-4e2d-a7aa-6f4f94f8669f", - "label": "ZMB_39(2020) metadata", - "value": "27426" - }, - { - "description": "Jurisdiction Metadata for ZMB_92(2020) id 595626db-3a2f-4633-9d10-f2933d466aa5", - "key": "595626db-3a2f-4633-9d10-f2933d466aa5", - "label": "ZMB_92(2020) metadata", - "value": "27427" - }, - { - "description": "Jurisdiction Metadata for ZMB_91(2020) id 44844bb5-c6b1-4dba-a937-6ef468059d11", - "key": "44844bb5-c6b1-4dba-a937-6ef468059d11", - "label": "ZMB_91(2020) metadata", - "value": "27428" - }, - { - "description": "Jurisdiction Metadata for ZMB_70(2020) id 1e6829db-85f5-4cba-9198-88bccf9788b9", - "key": "1e6829db-85f5-4cba-9198-88bccf9788b9", - "label": "ZMB_70(2020) metadata", - "value": "27429" - }, - { - "description": "Jurisdiction Metadata for ZMB_29(2020) id bf8c3470-ec63-4afb-a73e-ae4330d77d2a", - "key": "bf8c3470-ec63-4afb-a73e-ae4330d77d2a", - "label": "ZMB_29(2020) metadata", - "value": "27430" - }, - { - "description": "Jurisdiction Metadata for ZMB_56(2020) id 4e01fa0f-a7b2-4087-a528-be49c06e9ee3", - "key": "4e01fa0f-a7b2-4087-a528-be49c06e9ee3", - "label": "ZMB_56(2020) metadata", - "value": "27431" - }, - { - "description": "Jurisdiction Metadata for ZMB_6(2020) id 22983e55-5483-48a9-8a82-7010162c5163", - "key": "22983e55-5483-48a9-8a82-7010162c5163", - "label": "ZMB_6(2020) metadata", - "value": "27432" - }, - { - "description": "Jurisdiction Metadata for ZMB_86(2020) id 7ec3ba4f-33e0-46d6-9e45-d89fec2a9098", - "key": "7ec3ba4f-33e0-46d6-9e45-d89fec2a9098", - "label": "ZMB_86(2020) metadata", - "value": "27433" - }, - { - "description": "Jurisdiction Metadata for ZMB_72(2020) id 3a96c4c7-b3da-408f-b39f-28c462a9f05c", - "key": "3a96c4c7-b3da-408f-b39f-28c462a9f05c", - "label": "ZMB_72(2020) metadata", - "value": "27434" - }, - { - "description": "Jurisdiction Metadata for ZMB_14(2020) id 9426d44c-d782-49c7-82e1-acf8db5c188f", - "key": "9426d44c-d782-49c7-82e1-acf8db5c188f", - "label": "ZMB_14(2020) metadata", - "value": "27435" - }, - { - "description": "Jurisdiction Metadata for ZMB_53(2020) id 20fe36bc-a678-49e9-8eae-b0286a7ba4f7", - "key": "20fe36bc-a678-49e9-8eae-b0286a7ba4f7", - "label": "ZMB_53(2020) metadata", - "value": "27436" - }, - { - "description": "Jurisdiction Metadata for ZMB_122(2020) id 0a15fafe-e118-4958-a64a-4ea0af5f7edf", - "key": "0a15fafe-e118-4958-a64a-4ea0af5f7edf", - "label": "ZMB_122(2020) metadata", - "value": "27437" - }, - { - "description": "Jurisdiction Metadata for ZMB_97(2020) id 9177ae99-98fd-42cc-aa35-5b079f74ca01", - "key": "9177ae99-98fd-42cc-aa35-5b079f74ca01", - "label": "ZMB_97(2020) metadata", - "value": "27438" - }, - { - "description": "Jurisdiction Metadata for ZMB_107(2020) id 4f9dae5d-195c-44cf-b3eb-0436ea30bc16", - "key": "4f9dae5d-195c-44cf-b3eb-0436ea30bc16", - "label": "ZMB_107(2020) metadata", - "value": "27439" - }, - { - "description": "Jurisdiction Metadata for ZMB_65(2020) id bac023c4-146c-46ba-85c8-c00f677fb0f1", - "key": "bac023c4-146c-46ba-85c8-c00f677fb0f1", - "label": "ZMB_65(2020) metadata", - "value": "27440" - }, - { - "description": "Jurisdiction Metadata for ZMB_78(2020) id de113481-77dd-49d5-94a8-13576ee11d2f", - "key": "de113481-77dd-49d5-94a8-13576ee11d2f", - "label": "ZMB_78(2020) metadata", - "value": "27441" - }, - { - "description": "Jurisdiction Metadata for ZMB_123(2020) id f4a22252-6da5-40a4-bb9c-f8b6d750e51a", - "key": "f4a22252-6da5-40a4-bb9c-f8b6d750e51a", - "label": "ZMB_123(2020) metadata", - "value": "27442" - }, - { - "description": "Jurisdiction Metadata for ZMB_85(2020) id 4eb1f44f-7567-47cb-aeb3-8ad66593e6e2", - "key": "4eb1f44f-7567-47cb-aeb3-8ad66593e6e2", - "label": "ZMB_85(2020) metadata", - "value": "27443" - }, - { - "description": "Jurisdiction Metadata for ZMB_111(2020) id 03c2b4bd-24ae-4e15-b754-0a46909c7f0f", - "key": "03c2b4bd-24ae-4e15-b754-0a46909c7f0f", - "label": "ZMB_111(2020) metadata", - "value": "27444" - }, - { - "description": "Jurisdiction Metadata for ZMB_96(2020) id 73e1387b-1d96-426e-8fc4-e3c70a1358ec", - "key": "73e1387b-1d96-426e-8fc4-e3c70a1358ec", - "label": "ZMB_96(2020) metadata", - "value": "27445" - }, - { - "description": "Jurisdiction Metadata for ZMB_40(2020) id 29340723-b963-4485-86ba-1fa0b9f5ecd8", - "key": "29340723-b963-4485-86ba-1fa0b9f5ecd8", - "label": "ZMB_40(2020) metadata", - "value": "27446" - }, - { - "description": "Jurisdiction Metadata for ZMB_54(2020) id 12226db4-0cc1-4b99-87a8-833d16a7b0b8", - "key": "12226db4-0cc1-4b99-87a8-833d16a7b0b8", - "label": "ZMB_54(2020) metadata", - "value": "27447" - }, - { - "description": "Jurisdiction Metadata for ZMB_30(2020) id f769d54f-4fb6-4200-975e-4964b9f0dd00", - "key": "f769d54f-4fb6-4200-975e-4964b9f0dd00", - "label": "ZMB_30(2020) metadata", - "value": "27448" - }, - { - "description": "Jurisdiction Metadata for ZMB_90(2020) id be74f25b-b546-46d2-b3e7-1e0826b5227c", - "key": "be74f25b-b546-46d2-b3e7-1e0826b5227c", - "label": "ZMB_90(2020) metadata", - "value": "27449" - }, - { - "description": "Jurisdiction Metadata for ZMB_106(2020) id 18bbe63f-a303-4009-9b3a-b107ed07ae08", - "key": "18bbe63f-a303-4009-9b3a-b107ed07ae08", - "label": "ZMB_106(2020) metadata", - "value": "27450" - }, - { - "description": "Jurisdiction Metadata for ZMB_46(2020) id 976fdb9f-7a67-4aec-8f57-d119ec5bbc5c", - "key": "976fdb9f-7a67-4aec-8f57-d119ec5bbc5c", - "label": "ZMB_46(2020) metadata", - "value": "27451" - }, - { - "description": "Jurisdiction Metadata for ZMB_61(2020) id c56d36de-7466-4996-a809-698973dfc41f", - "key": "c56d36de-7466-4996-a809-698973dfc41f", - "label": "ZMB_61(2020) metadata", - "value": "27452" - }, - { - "description": "Jurisdiction Metadata for ZMB_44(2020) id 4ab8baac-2991-468b-bad1-6263f82d6fc5", - "key": "4ab8baac-2991-468b-bad1-6263f82d6fc5", - "label": "ZMB_44(2020) metadata", - "value": "27453" - }, - { - "description": "Jurisdiction Metadata for ZMB_119(2020) id 6144dc2c-e030-47b7-a129-02440f5ac724", - "key": "6144dc2c-e030-47b7-a129-02440f5ac724", - "label": "ZMB_119(2020) metadata", - "value": "27454" - }, - { - "description": "Jurisdiction Metadata for ZMB_11(2020) id 7f85998e-48c5-40d0-9bf0-a45d324cb360", - "key": "7f85998e-48c5-40d0-9bf0-a45d324cb360", - "label": "ZMB_11(2020) metadata", - "value": "27455" - }, - { - "description": "Jurisdiction Metadata for ZMB_101(2020) id 2b704813-94e5-4118-81e6-f338e47dd966", - "key": "2b704813-94e5-4118-81e6-f338e47dd966", - "label": "ZMB_101(2020) metadata", - "value": "27456" - }, - { - "description": "Jurisdiction Metadata for ZMB_59(2020) id 542b210a-2ffc-4831-9112-93dc2b27b1bd", - "key": "542b210a-2ffc-4831-9112-93dc2b27b1bd", - "label": "ZMB_59(2020) metadata", - "value": "27457" - }, - { - "description": "Jurisdiction Metadata for ZMB_16(2020) id 02996c44-0f3a-4a7f-96ce-874dc2635eba", - "key": "02996c44-0f3a-4a7f-96ce-874dc2635eba", - "label": "ZMB_16(2020) metadata", - "value": "27458" - }, - { - "description": "Jurisdiction Metadata for ZMB_100(2020) id 08c0a57b-f6d2-495e-ba60-44b51cc00923", - "key": "08c0a57b-f6d2-495e-ba60-44b51cc00923", - "label": "ZMB_100(2020) metadata", - "value": "27459" - }, - { - "description": "Jurisdiction Metadata for ZMB_109(2020) id e182c198-447f-4217-a37e-c785db12013d", - "key": "e182c198-447f-4217-a37e-c785db12013d", - "label": "ZMB_109(2020) metadata", - "value": "27460" - }, - { - "description": "Jurisdiction Metadata for ZMB_22(2020) id c886e084-b68a-4ff2-85f0-57b5f9dd6c54", - "key": "c886e084-b68a-4ff2-85f0-57b5f9dd6c54", - "label": "ZMB_22(2020) metadata", - "value": "27461" - }, - { - "description": "Jurisdiction Metadata for ZMB_99(2020) id 9aeebb21-bf8d-474d-9146-198b6449e025", - "key": "9aeebb21-bf8d-474d-9146-198b6449e025", - "label": "ZMB_99(2020) metadata", - "value": "27462" - }, - { - "description": "Jurisdiction Metadata for ZMB_28(2020) id fab0f55f-5925-46b1-b2c3-badff5815741", - "key": "fab0f55f-5925-46b1-b2c3-badff5815741", - "label": "ZMB_28(2020) metadata", - "value": "27463" - }, - { - "description": "Jurisdiction Metadata for ZMB_3(2020) id 6e7721e7-f69b-4623-9a7d-a9640f9ac811", - "key": "6e7721e7-f69b-4623-9a7d-a9640f9ac811", - "label": "ZMB_3(2020) metadata", - "value": "27464" - }, - { - "description": "Jurisdiction Metadata for ZMB_67(2020) id 88ec303f-64e6-41ef-b946-ba88fc762798", - "key": "88ec303f-64e6-41ef-b946-ba88fc762798", - "label": "ZMB_67(2020) metadata", - "value": "27465" - }, - { - "description": "Jurisdiction Metadata for Bwanunkha(2020) id 8d453cbf-16ef-4f81-b0df-a115d83df7a5", - "key": "8d453cbf-16ef-4f81-b0df-a115d83df7a5", - "label": "Bwanunkha(2020) metadata", - "value": "27466" - }, - { - "description": "Jurisdiction Metadata for Kapwazi_NHC id e0c3c7e7-7cc4-4888-ba1c-caf982965ba9", - "key": "e0c3c7e7-7cc4-4888-ba1c-caf982965ba9", - "label": "Kapwazi_NHC metadata", - "value": "27467" - }, - { - "description": "Jurisdiction Metadata for BNK_4(2020) id a7132216-b43c-4b26-a7b7-76336ab46007", - "key": "a7132216-b43c-4b26-a7b7-76336ab46007", - "label": "BNK_4(2020) metadata", - "value": "27468" - }, - { - "description": "Jurisdiction Metadata for BNK_53(2020) id f388e1d2-d509-4304-b660-e7953952990b", - "key": "f388e1d2-d509-4304-b660-e7953952990b", - "label": "BNK_53(2020) metadata", - "value": "27469" - }, - { - "description": "Jurisdiction Metadata for BNK_46(2020) id e187d876-753b-4fbb-bd17-891e3dc1e485", - "key": "e187d876-753b-4fbb-bd17-891e3dc1e485", - "label": "BNK_46(2020) metadata", - "value": "27470" - }, - { - "description": "Jurisdiction Metadata for BNK_16(2020) id ad7bfbb3-7eb7-4253-99b3-6f43dcc52479", - "key": "ad7bfbb3-7eb7-4253-99b3-6f43dcc52479", - "label": "BNK_16(2020) metadata", - "value": "27471" - }, - { - "description": "Jurisdiction Metadata for BNK_37(2020) id fce5922f-6d0c-48db-9933-d80e3ad118c0", - "key": "fce5922f-6d0c-48db-9933-d80e3ad118c0", - "label": "BNK_37(2020) metadata", - "value": "27472" - }, - { - "description": "Jurisdiction Metadata for BNK_26(2020) id 172ffe03-5c70-4d6e-9ee0-cfeae8bbb415", - "key": "172ffe03-5c70-4d6e-9ee0-cfeae8bbb415", - "label": "BNK_26(2020) metadata", - "value": "27473" - }, - { - "description": "Jurisdiction Metadata for BNK_28(2020) id 04053398-5a84-4385-ae12-284f6a142c0d", - "key": "04053398-5a84-4385-ae12-284f6a142c0d", - "label": "BNK_28(2020) metadata", - "value": "27474" - }, - { - "description": "Jurisdiction Metadata for BNK_52(2020) id 9b7be09a-b15c-4d6e-82b8-c1f0fb6bde34", - "key": "9b7be09a-b15c-4d6e-82b8-c1f0fb6bde34", - "label": "BNK_52(2020) metadata", - "value": "27475" - }, - { - "description": "Jurisdiction Metadata for BNK_18(2020) id 3cc39a18-a76c-4df0-975f-fa4f061845e5", - "key": "3cc39a18-a76c-4df0-975f-fa4f061845e5", - "label": "BNK_18(2020) metadata", - "value": "27476" - }, - { - "description": "Jurisdiction Metadata for BNK_12(2020) id ce695e16-47fa-4476-959d-532a20e4cccf", - "key": "ce695e16-47fa-4476-959d-532a20e4cccf", - "label": "BNK_12(2020) metadata", - "value": "27477" - }, - { - "description": "Jurisdiction Metadata for BNK_48(2020) id fcf062d1-3877-46fd-8f14-e668c57f18ac", - "key": "fcf062d1-3877-46fd-8f14-e668c57f18ac", - "label": "BNK_48(2020) metadata", - "value": "27478" - }, - { - "description": "Jurisdiction Metadata for BNK_9(2020) id 68a72b0c-bd71-40ef-b955-378b5a4d8f08", - "key": "68a72b0c-bd71-40ef-b955-378b5a4d8f08", - "label": "BNK_9(2020) metadata", - "value": "27479" - }, - { - "description": "Jurisdiction Metadata for BNK_17(2020) id 554269a4-ffea-402f-81e8-c57f8ffddbbd", - "key": "554269a4-ffea-402f-81e8-c57f8ffddbbd", - "label": "BNK_17(2020) metadata", - "value": "27480" - }, - { - "description": "Jurisdiction Metadata for BNK_57(2020) id 653044c1-7aa1-442d-b397-28b558434f86", - "key": "653044c1-7aa1-442d-b397-28b558434f86", - "label": "BNK_57(2020) metadata", - "value": "27481" - }, - { - "description": "Jurisdiction Metadata for BNK_22(2020) id ccf145ea-a1bd-4b81-8e85-67bd885d1281", - "key": "ccf145ea-a1bd-4b81-8e85-67bd885d1281", - "label": "BNK_22(2020) metadata", - "value": "27482" - }, - { - "description": "Jurisdiction Metadata for BNK_21(2020) id 8eeada74-bcde-4f23-a9de-cb2212c41812", - "key": "8eeada74-bcde-4f23-a9de-cb2212c41812", - "label": "BNK_21(2020) metadata", - "value": "27483" - }, - { - "description": "Jurisdiction Metadata for BNK_51(2020) id f85540e6-beff-4c57-b91d-ef5d456bb7a2", - "key": "f85540e6-beff-4c57-b91d-ef5d456bb7a2", - "label": "BNK_51(2020) metadata", - "value": "27484" - }, - { - "description": "Jurisdiction Metadata for BNK_31(2020) id a853a44c-cb5e-4e30-9e9e-11fb20f4f34b", - "key": "a853a44c-cb5e-4e30-9e9e-11fb20f4f34b", - "label": "BNK_31(2020) metadata", - "value": "27485" - }, - { - "description": "Jurisdiction Metadata for BNK_34(2020) id 79e18225-3881-4f52-8dc1-6f9cdaa4878f", - "key": "79e18225-3881-4f52-8dc1-6f9cdaa4878f", - "label": "BNK_34(2020) metadata", - "value": "27486" - }, - { - "description": "Jurisdiction Metadata for BNK_55(2020) id 258409c2-c532-4f22-bc3c-660db71ef68f", - "key": "258409c2-c532-4f22-bc3c-660db71ef68f", - "label": "BNK_55(2020) metadata", - "value": "27487" - }, - { - "description": "Jurisdiction Metadata for BNK_62(2020) id 4cbb7d0b-27c9-4479-a6ed-0482570e2c2f", - "key": "4cbb7d0b-27c9-4479-a6ed-0482570e2c2f", - "label": "BNK_62(2020) metadata", - "value": "27488" - }, - { - "description": "Jurisdiction Metadata for BNK_35(2020) id a6baa096-c7a2-4c6f-a03b-6113111e7447", - "key": "a6baa096-c7a2-4c6f-a03b-6113111e7447", - "label": "BNK_35(2020) metadata", - "value": "27489" - }, - { - "description": "Jurisdiction Metadata for BNK_41(2020) id 3e34809a-1e58-45bf-926e-347ba668a90a", - "key": "3e34809a-1e58-45bf-926e-347ba668a90a", - "label": "BNK_41(2020) metadata", - "value": "27490" - }, - { - "description": "Jurisdiction Metadata for BNK_29(2020) id 98fb78c4-7f8b-407b-94bf-c9c371ef5a67", - "key": "98fb78c4-7f8b-407b-94bf-c9c371ef5a67", - "label": "BNK_29(2020) metadata", - "value": "27491" - }, - { - "description": "Jurisdiction Metadata for BNK_24(2020) id 740c79d1-a8c3-4b42-b4ce-c31712490c0b", - "key": "740c79d1-a8c3-4b42-b4ce-c31712490c0b", - "label": "BNK_24(2020) metadata", - "value": "27492" - }, - { - "description": "Jurisdiction Metadata for BNK_54(2020) id 8bcb120e-ab13-414a-be84-6f3a8ae8caf8", - "key": "8bcb120e-ab13-414a-be84-6f3a8ae8caf8", - "label": "BNK_54(2020) metadata", - "value": "27493" - }, - { - "description": "Jurisdiction Metadata for BNK_50(2020) id 33b43940-8f43-4486-ad0e-07c3e9df2648", - "key": "33b43940-8f43-4486-ad0e-07c3e9df2648", - "label": "BNK_50(2020) metadata", - "value": "27494" - }, - { - "description": "Jurisdiction Metadata for BNK_30(2020) id 81093ab1-2607-4542-b7fc-beaa2a9523dc", - "key": "81093ab1-2607-4542-b7fc-beaa2a9523dc", - "label": "BNK_30(2020) metadata", - "value": "27495" - }, - { - "description": "Jurisdiction Metadata for BNK_32(2020) id e6771a50-702d-4b22-81a5-d8c7b7f30038", - "key": "e6771a50-702d-4b22-81a5-d8c7b7f30038", - "label": "BNK_32(2020) metadata", - "value": "27496" - }, - { - "description": "Jurisdiction Metadata for BNK_43(2020) id a3900aa9-4946-40a2-aab5-ca22286f1134", - "key": "a3900aa9-4946-40a2-aab5-ca22286f1134", - "label": "BNK_43(2020) metadata", - "value": "27497" - }, - { - "description": "Jurisdiction Metadata for BNK_5(2020) id 363c7005-64b0-4261-97c4-827876a43bdd", - "key": "363c7005-64b0-4261-97c4-827876a43bdd", - "label": "BNK_5(2020) metadata", - "value": "27498" - }, - { - "description": "Jurisdiction Metadata for BNK_11(2020) id 5bf8b70a-6be2-4032-ba1f-3b3877777986", - "key": "5bf8b70a-6be2-4032-ba1f-3b3877777986", - "label": "BNK_11(2020) metadata", - "value": "27499" - }, - { - "description": "Jurisdiction Metadata for BNK_58(2020) id 512af7c9-4ce6-4c69-a7fe-c07d08b8e4e9", - "key": "512af7c9-4ce6-4c69-a7fe-c07d08b8e4e9", - "label": "BNK_58(2020) metadata", - "value": "27500" - }, - { - "description": "Jurisdiction Metadata for BNK_45(2020) id 3adc9812-1ad5-4931-ad80-ec91a8817c6d", - "key": "3adc9812-1ad5-4931-ad80-ec91a8817c6d", - "label": "BNK_45(2020) metadata", - "value": "27501" - }, - { - "description": "Jurisdiction Metadata for BNK_20(2020) id 81205eaa-874c-4775-9be9-4dae91da17cb", - "key": "81205eaa-874c-4775-9be9-4dae91da17cb", - "label": "BNK_20(2020) metadata", - "value": "27502" - }, - { - "description": "Jurisdiction Metadata for BNK_59(2020) id 1bdf4b26-f32c-425a-a722-c3b4831086a5", - "key": "1bdf4b26-f32c-425a-a722-c3b4831086a5", - "label": "BNK_59(2020) metadata", - "value": "27503" - }, - { - "description": "Jurisdiction Metadata for BNK_6(2020) id dbd9a889-e3a6-4bb7-9d19-e386ec5d07d4", - "key": "dbd9a889-e3a6-4bb7-9d19-e386ec5d07d4", - "label": "BNK_6(2020) metadata", - "value": "27504" - }, - { - "description": "Jurisdiction Metadata for BNK_8(2020) id e60bb1d7-f290-41ac-85be-3a54594fe1d3", - "key": "e60bb1d7-f290-41ac-85be-3a54594fe1d3", - "label": "BNK_8(2020) metadata", - "value": "27505" - }, - { - "description": "Jurisdiction Metadata for BNK_2(2020) id 579fee54-064e-4c56-9d32-f0a895563efc", - "key": "579fee54-064e-4c56-9d32-f0a895563efc", - "label": "BNK_2(2020) metadata", - "value": "27506" - }, - { - "description": "Jurisdiction Metadata for BNK_44(2020) id 018cdfe2-6028-4e0f-bbcb-664339462ada", - "key": "018cdfe2-6028-4e0f-bbcb-664339462ada", - "label": "BNK_44(2020) metadata", - "value": "27507" - }, - { - "description": "Jurisdiction Metadata for BNK_47(2020) id 88a2b756-543d-449d-8412-9abbb3f9d358", - "key": "88a2b756-543d-449d-8412-9abbb3f9d358", - "label": "BNK_47(2020) metadata", - "value": "27508" - }, - { - "description": "Jurisdiction Metadata for BNK_60(2020) id 9d9f950e-6b8d-4a8b-a6a2-4fb722919693", - "key": "9d9f950e-6b8d-4a8b-a6a2-4fb722919693", - "label": "BNK_60(2020) metadata", - "value": "27509" - }, - { - "description": "Jurisdiction Metadata for BNK_15(2020) id d104d1c8-fef0-4af3-b9db-00f9d359d9dd", - "key": "d104d1c8-fef0-4af3-b9db-00f9d359d9dd", - "label": "BNK_15(2020) metadata", - "value": "27510" - }, - { - "description": "Jurisdiction Metadata for BNK_14(2020) id d931e373-35cf-4529-8a88-d1a761cd9fae", - "key": "d931e373-35cf-4529-8a88-d1a761cd9fae", - "label": "BNK_14(2020) metadata", - "value": "27511" - }, - { - "description": "Jurisdiction Metadata for BNK_10(2020) id 95f09ccc-7f50-4726-ab5b-2b81fb2fee29", - "key": "95f09ccc-7f50-4726-ab5b-2b81fb2fee29", - "label": "BNK_10(2020) metadata", - "value": "27512" - }, - { - "description": "Jurisdiction Metadata for BNK_3(2020) id 7ce4bc80-8b91-4f11-8a1a-a61b36d4af95", - "key": "7ce4bc80-8b91-4f11-8a1a-a61b36d4af95", - "label": "BNK_3(2020) metadata", - "value": "27513" - }, - { - "description": "Jurisdiction Metadata for BNK_42(2020) id 7f40cfc1-994e-4397-84ae-5180fefd5795", - "key": "7f40cfc1-994e-4397-84ae-5180fefd5795", - "label": "BNK_42(2020) metadata", - "value": "27514" - }, - { - "description": "Jurisdiction Metadata for BNK_19(2020) id 49a085ff-fed6-4377-8a68-f6970053a492", - "key": "49a085ff-fed6-4377-8a68-f6970053a492", - "label": "BNK_19(2020) metadata", - "value": "27515" - }, - { - "description": "Jurisdiction Metadata for BNK_13(2020) id 23de352d-b386-40ac-82b1-d41155824d5a", - "key": "23de352d-b386-40ac-82b1-d41155824d5a", - "label": "BNK_13(2020) metadata", - "value": "27516" - }, - { - "description": "Jurisdiction Metadata for BNK_7(2020) id 9e7f095b-df9e-4314-bd59-7ee7820051b9", - "key": "9e7f095b-df9e-4314-bd59-7ee7820051b9", - "label": "BNK_7(2020) metadata", - "value": "27517" - }, - { - "description": "Jurisdiction Metadata for BNK_23(2020) id 1c0f5d30-375d-447e-a100-164ea8b3e6f3", - "key": "1c0f5d30-375d-447e-a100-164ea8b3e6f3", - "label": "BNK_23(2020) metadata", - "value": "27518" - }, - { - "description": "Jurisdiction Metadata for BNK_49(2020) id dda20b5a-5739-43b3-b5c2-fa6dfdc44523", - "key": "dda20b5a-5739-43b3-b5c2-fa6dfdc44523", - "label": "BNK_49(2020) metadata", - "value": "27519" - }, - { - "description": "Jurisdiction Metadata for BNK_38(2020) id 1e46e78e-f976-47bb-89bb-675eefbb1939", - "key": "1e46e78e-f976-47bb-89bb-675eefbb1939", - "label": "BNK_38(2020) metadata", - "value": "27520" - }, - { - "description": "Jurisdiction Metadata for BNK_63(2020) id df4c54d5-54df-4b8e-afad-624c3c95e4d0", - "key": "df4c54d5-54df-4b8e-afad-624c3c95e4d0", - "label": "BNK_63(2020) metadata", - "value": "27521" - }, - { - "description": "Jurisdiction Metadata for BNK_56(2020) id db9a0473-ee58-498d-ba09-c07b28ea38e8", - "key": "db9a0473-ee58-498d-ba09-c07b28ea38e8", - "label": "BNK_56(2020) metadata", - "value": "27522" - }, - { - "description": "Jurisdiction Metadata for BNK_25(2020) id a03c37e4-18b3-40a7-9a3d-48bd97e61612", - "key": "a03c37e4-18b3-40a7-9a3d-48bd97e61612", - "label": "BNK_25(2020) metadata", - "value": "27523" - }, - { - "description": "Jurisdiction Metadata for BNK_36(2020) id edad63f9-c8a8-4edf-9499-4dca79396c66", - "key": "edad63f9-c8a8-4edf-9499-4dca79396c66", - "label": "BNK_36(2020) metadata", - "value": "27524" - }, - { - "description": "Jurisdiction Metadata for BNK_61(2020) id b6d9bea1-be1b-4243-ba05-39e862532c55", - "key": "b6d9bea1-be1b-4243-ba05-39e862532c55", - "label": "BNK_61(2020) metadata", - "value": "27525" - }, - { - "description": "Jurisdiction Metadata for BNK_27(2020) id 663d5305-4e0a-477b-95d2-5213b5747089", - "key": "663d5305-4e0a-477b-95d2-5213b5747089", - "label": "BNK_27(2020) metadata", - "value": "27526" - }, - { - "description": "Jurisdiction Metadata for BNK_40(2020) id 763afc9b-50b4-4119-a538-943036d40d24", - "key": "763afc9b-50b4-4119-a538-943036d40d24", - "label": "BNK_40(2020) metadata", - "value": "27527" - }, - { - "description": "Jurisdiction Metadata for BNK_39(2020) id cb0d3935-bf22-4347-a068-d0f5f0f3c768", - "key": "cb0d3935-bf22-4347-a068-d0f5f0f3c768", - "label": "BNK_39(2020) metadata", - "value": "27528" - }, - { - "description": "Jurisdiction Metadata for BNK_1(2020) id 1b89013b-6644-4d9b-9427-85cbb21783ff", - "key": "1b89013b-6644-4d9b-9427-85cbb21783ff", - "label": "BNK_1(2020) metadata", - "value": "27529" - }, - { - "description": "Jurisdiction Metadata for BNK_33(2020) id c965a06f-5a3f-4cc7-ad9d-4873f22edbc7", - "key": "c965a06f-5a3f-4cc7-ad9d-4873f22edbc7", - "label": "BNK_33(2020) metadata", - "value": "27530" - }, - { - "description": "Jurisdiction Metadata for Chanida(2020) id 73a7dd60-1b43-4d6d-b4a5-5ed0368b53d4", - "key": "73a7dd60-1b43-4d6d-b4a5-5ed0368b53d4", - "label": "Chanida(2020) metadata", - "value": "27531" - }, - { - "description": "Jurisdiction Metadata for Chanida_NHC id b2de60e6-17a5-4305-b267-d998f6b7bfe3", - "key": "b2de60e6-17a5-4305-b267-d998f6b7bfe3", - "label": "Chanida_NHC metadata", - "value": "27532" - }, - { - "description": "Jurisdiction Metadata for CND_1(2020) id cf78ef87-9370-4a80-8952-f69ab9f45235", - "key": "cf78ef87-9370-4a80-8952-f69ab9f45235", - "label": "CND_1(2020) metadata", - "value": "27533" - }, - { - "description": "Jurisdiction Metadata for CND_6(2020) id 2bd12880-f4bf-47e1-a855-fb57b0eca8fc", - "key": "2bd12880-f4bf-47e1-a855-fb57b0eca8fc", - "label": "CND_6(2020) metadata", - "value": "27534" - }, - { - "description": "Jurisdiction Metadata for CND_7(2020) id 20ed2289-14b5-4044-a279-909bb972199a", - "key": "20ed2289-14b5-4044-a279-909bb972199a", - "label": "CND_7(2020) metadata", - "value": "27535" - }, - { - "description": "Jurisdiction Metadata for CND_11(2020) id 4735f588-d81e-4689-8ab9-4ad66987770c", - "key": "4735f588-d81e-4689-8ab9-4ad66987770c", - "label": "CND_11(2020) metadata", - "value": "27536" - }, - { - "description": "Jurisdiction Metadata for CND_2(2020) id 5de02ad4-278e-48fe-875d-eacf98ec2be4", - "key": "5de02ad4-278e-48fe-875d-eacf98ec2be4", - "label": "CND_2(2020) metadata", - "value": "27537" - }, - { - "description": "Jurisdiction Metadata for CND_3(2020) id 682705f9-a052-41e7-a373-aa545b61dd9c", - "key": "682705f9-a052-41e7-a373-aa545b61dd9c", - "label": "CND_3(2020) metadata", - "value": "27538" - }, - { - "description": "Jurisdiction Metadata for CND_12(2020) id 7dad005f-be3f-46bd-a60f-b5bef534a2e8", - "key": "7dad005f-be3f-46bd-a60f-b5bef534a2e8", - "label": "CND_12(2020) metadata", - "value": "27539" - }, - { - "description": "Jurisdiction Metadata for CND_5(2020) id fe3a53a7-fdd1-4e49-a9e5-63ac2f266764", - "key": "fe3a53a7-fdd1-4e49-a9e5-63ac2f266764", - "label": "CND_5(2020) metadata", - "value": "27540" - }, - { - "description": "Jurisdiction Metadata for CND_8(2020) id a4eeb706-bcc6-468e-b4e6-c2c7624637ac", - "key": "a4eeb706-bcc6-468e-b4e6-c2c7624637ac", - "label": "CND_8(2020) metadata", - "value": "27541" - }, - { - "description": "Jurisdiction Metadata for CND_9(2020) id 00b279c1-ecb2-44e7-80c1-72ffe237f075", - "key": "00b279c1-ecb2-44e7-80c1-72ffe237f075", - "label": "CND_9(2020) metadata", - "value": "27542" - }, - { - "description": "Jurisdiction Metadata for CND_4(2020) id 89cc8027-a89b-4f7a-86e5-1ee07583a9af", - "key": "89cc8027-a89b-4f7a-86e5-1ee07583a9af", - "label": "CND_4(2020) metadata", - "value": "27543" - }, - { - "description": "Jurisdiction Metadata for CND_13(2020) id 305bdc54-1156-4e69-8de0-1242cf35a83c", - "key": "305bdc54-1156-4e69-8de0-1242cf35a83c", - "label": "CND_13(2020) metadata", - "value": "27544" - }, - { - "description": "Jurisdiction Metadata for CND_10(2020) id 899c93a2-7d5e-4dcc-b5e3-681ff260ac0b", - "key": "899c93a2-7d5e-4dcc-b5e3-681ff260ac0b", - "label": "CND_10(2020) metadata", - "value": "27545" - }, - { - "description": "Jurisdiction Metadata for Nsadzu(2020) id 60d07154-48cc-4a08-8c95-26a50d2ba716", - "key": "60d07154-48cc-4a08-8c95-26a50d2ba716", - "label": "Nsadzu(2020) metadata", - "value": "27546" - }, - { - "description": "Jurisdiction Metadata for Kasiya NHC id 71e178d1-2edb-415f-aa99-3a9e7c8cfe31", - "key": "71e178d1-2edb-415f-aa99-3a9e7c8cfe31", - "label": "Kasiya NHC metadata", - "value": "27547" - }, - { - "description": "Jurisdiction Metadata for NSD_20(2020) id 0fff4ac5-3b8e-4859-8f10-165b2b076baa", - "key": "0fff4ac5-3b8e-4859-8f10-165b2b076baa", - "label": "NSD_20(2020) metadata", - "value": "27548" - }, - { - "description": "Jurisdiction Metadata for NSD_16(2020) id 289476a8-34f2-49fc-9ebc-bc2a8b96d269", - "key": "289476a8-34f2-49fc-9ebc-bc2a8b96d269", - "label": "NSD_16(2020) metadata", - "value": "27549" - }, - { - "description": "Jurisdiction Metadata for NSD_12(2020) id 072e6615-69d2-4f39-bf1d-816fd3d03da2", - "key": "072e6615-69d2-4f39-bf1d-816fd3d03da2", - "label": "NSD_12(2020) metadata", - "value": "27550" - }, - { - "description": "Jurisdiction Metadata for NSD_10(2020) id 06e7384c-188f-4095-b662-d796f6b28fa8", - "key": "06e7384c-188f-4095-b662-d796f6b28fa8", - "label": "NSD_10(2020) metadata", - "value": "27551" - }, - { - "description": "Jurisdiction Metadata for NSD_37(2020) id 4062aac9-1b19-4d56-866f-52bb662d437e", - "key": "4062aac9-1b19-4d56-866f-52bb662d437e", - "label": "NSD_37(2020) metadata", - "value": "27552" - }, - { - "description": "Jurisdiction Metadata for NSD_27(2020) id 52991324-58f8-4b97-a974-35d292c9444f", - "key": "52991324-58f8-4b97-a974-35d292c9444f", - "label": "NSD_27(2020) metadata", - "value": "27553" - }, - { - "description": "Jurisdiction Metadata for NSD_26(2020) id 08cae021-e0de-4874-ad5c-c54fdb83a57e", - "key": "08cae021-e0de-4874-ad5c-c54fdb83a57e", - "label": "NSD_26(2020) metadata", - "value": "27554" - }, - { - "description": "Jurisdiction Metadata for NSD_2(2020) id ba61cb5a-3fe8-4a4e-8fcd-9886c9b33e82", - "key": "ba61cb5a-3fe8-4a4e-8fcd-9886c9b33e82", - "label": "NSD_2(2020) metadata", - "value": "27555" - }, - { - "description": "Jurisdiction Metadata for NSD_48(2020) id f19bd9bc-285d-40c7-a1e8-6bc143a4a4df", - "key": "f19bd9bc-285d-40c7-a1e8-6bc143a4a4df", - "label": "NSD_48(2020) metadata", - "value": "27556" - }, - { - "description": "Jurisdiction Metadata for NSD_36(2020) id ddb110d5-180d-43b2-99c4-7110ba5e2766", - "key": "ddb110d5-180d-43b2-99c4-7110ba5e2766", - "label": "NSD_36(2020) metadata", - "value": "27557" - }, - { - "description": "Jurisdiction Metadata for NSD_4(2020) id 2341b800-a263-4672-b6db-3cf880f964b0", - "key": "2341b800-a263-4672-b6db-3cf880f964b0", - "label": "NSD_4(2020) metadata", - "value": "27558" - }, - { - "description": "Jurisdiction Metadata for NSD_59(2020) id e67aab2e-7429-443d-a2cc-ae6e3d6c6a45", - "key": "e67aab2e-7429-443d-a2cc-ae6e3d6c6a45", - "label": "NSD_59(2020) metadata", - "value": "27559" - }, - { - "description": "Jurisdiction Metadata for NSD_24(2020) id fbd4a535-1b48-40a7-97b6-8fa562eff0f3", - "key": "fbd4a535-1b48-40a7-97b6-8fa562eff0f3", - "label": "NSD_24(2020) metadata", - "value": "27560" - }, - { - "description": "Jurisdiction Metadata for NSD_28(2020) id 4b781a76-23f2-44d6-8f77-148cd9503228", - "key": "4b781a76-23f2-44d6-8f77-148cd9503228", - "label": "NSD_28(2020) metadata", - "value": "27561" - }, - { - "description": "Jurisdiction Metadata for NSD_11(2020) id 8b175b3d-c10c-47c9-b1e4-fa5e4b2e5a0c", - "key": "8b175b3d-c10c-47c9-b1e4-fa5e4b2e5a0c", - "label": "NSD_11(2020) metadata", - "value": "27562" - }, - { - "description": "Jurisdiction Metadata for NSD_25(2020) id d38a6c2c-6882-49a2-9cc6-fca07fddf8b9", - "key": "d38a6c2c-6882-49a2-9cc6-fca07fddf8b9", - "label": "NSD_25(2020) metadata", - "value": "27563" - }, - { - "description": "Jurisdiction Metadata for NSD_61(2020) id 2539b309-ee3d-4a76-adc3-a608166c91ef", - "key": "2539b309-ee3d-4a76-adc3-a608166c91ef", - "label": "NSD_61(2020) metadata", - "value": "27564" - }, - { - "description": "Jurisdiction Metadata for NSD_6(2020) id b5549a4d-a9ff-41ff-b3b9-4f61b77aa4df", - "key": "b5549a4d-a9ff-41ff-b3b9-4f61b77aa4df", - "label": "NSD_6(2020) metadata", - "value": "27565" - }, - { - "description": "Jurisdiction Metadata for NSD_44(2020) id 0da358f8-eec1-40e0-97d9-7ef4e5d422bd", - "key": "0da358f8-eec1-40e0-97d9-7ef4e5d422bd", - "label": "NSD_44(2020) metadata", - "value": "27566" - }, - { - "description": "Jurisdiction Metadata for NSD_5(2020) id ceeefd0b-ccc8-495d-9ea8-dc85f920c50c", - "key": "ceeefd0b-ccc8-495d-9ea8-dc85f920c50c", - "label": "NSD_5(2020) metadata", - "value": "27567" - }, - { - "description": "Jurisdiction Metadata for NSD_1(2020) id db35624b-5f44-48f4-a4c6-8b69bc689783", - "key": "db35624b-5f44-48f4-a4c6-8b69bc689783", - "label": "NSD_1(2020) metadata", - "value": "27568" - }, - { - "description": "Jurisdiction Metadata for NSD_17(2020) id 642a9c18-39b4-42b2-9adf-c6f0c553b17d", - "key": "642a9c18-39b4-42b2-9adf-c6f0c553b17d", - "label": "NSD_17(2020) metadata", - "value": "27569" - }, - { - "description": "Jurisdiction Metadata for NSD_30(2020) id b8ba2b2e-cdb2-4b5c-a7f2-919b70483c46", - "key": "b8ba2b2e-cdb2-4b5c-a7f2-919b70483c46", - "label": "NSD_30(2020) metadata", - "value": "27570" - }, - { - "description": "Jurisdiction Metadata for NSD_7(2020) id eb66c034-f9a9-46a0-9fbd-25790757cac3", - "key": "eb66c034-f9a9-46a0-9fbd-25790757cac3", - "label": "NSD_7(2020) metadata", - "value": "27571" - }, - { - "description": "Jurisdiction Metadata for NSD_39(2020) id 83047616-2688-423d-b644-8d3ab76650f8", - "key": "83047616-2688-423d-b644-8d3ab76650f8", - "label": "NSD_39(2020) metadata", - "value": "27572" - }, - { - "description": "Jurisdiction Metadata for NSD_18(2020) id d03c95ff-5c73-4391-92a8-bf595bc928a5", - "key": "d03c95ff-5c73-4391-92a8-bf595bc928a5", - "label": "NSD_18(2020) metadata", - "value": "27573" - }, - { - "description": "Jurisdiction Metadata for NSD_62(2020) id c2e23851-f26a-48a4-bcd5-fb0d19b8d4ab", - "key": "c2e23851-f26a-48a4-bcd5-fb0d19b8d4ab", - "label": "NSD_62(2020) metadata", - "value": "27574" - }, - { - "description": "Jurisdiction Metadata for NSD_33(2020) id 21f6ae41-699e-444d-935f-a5ef55f686e5", - "key": "21f6ae41-699e-444d-935f-a5ef55f686e5", - "label": "NSD_33(2020) metadata", - "value": "27575" - }, - { - "description": "Jurisdiction Metadata for NSD_43(2020) id 172cd37c-e51b-4a5b-9c1f-05d40a22c333", - "key": "172cd37c-e51b-4a5b-9c1f-05d40a22c333", - "label": "NSD_43(2020) metadata", - "value": "27576" - }, - { - "description": "Jurisdiction Metadata for NSD_9(2020) id e3d40cb7-3c9a-4e1f-bb81-53b7ec22d28f", - "key": "e3d40cb7-3c9a-4e1f-bb81-53b7ec22d28f", - "label": "NSD_9(2020) metadata", - "value": "27577" - }, - { - "description": "Jurisdiction Metadata for NSD_47(2020) id 5e90b379-0f6a-4a63-b44f-5ab10092ca07", - "key": "5e90b379-0f6a-4a63-b44f-5ab10092ca07", - "label": "NSD_47(2020) metadata", - "value": "27578" - }, - { - "description": "Jurisdiction Metadata for NSD_38(2020) id 1624f675-3a93-4d8a-8448-45ad5911dec0", - "key": "1624f675-3a93-4d8a-8448-45ad5911dec0", - "label": "NSD_38(2020) metadata", - "value": "27579" - }, - { - "description": "Jurisdiction Metadata for NSD_15(2020) id 2687a750-4414-4699-90ee-c07d1e52271f", - "key": "2687a750-4414-4699-90ee-c07d1e52271f", - "label": "NSD_15(2020) metadata", - "value": "27580" - }, - { - "description": "Jurisdiction Metadata for NSD_45(2020) id 98684b89-aa33-462a-9132-266592cfa62a", - "key": "98684b89-aa33-462a-9132-266592cfa62a", - "label": "NSD_45(2020) metadata", - "value": "27581" - }, - { - "description": "Jurisdiction Metadata for NSD_54(2020) id 32ee11a4-d240-446a-8d88-dd6e718e5061", - "key": "32ee11a4-d240-446a-8d88-dd6e718e5061", - "label": "NSD_54(2020) metadata", - "value": "27582" - }, - { - "description": "Jurisdiction Metadata for NSD_22(2020) id e072ffcc-6f2c-4d8c-969b-aae9c4d60e8d", - "key": "e072ffcc-6f2c-4d8c-969b-aae9c4d60e8d", - "label": "NSD_22(2020) metadata", - "value": "27583" - }, - { - "description": "Jurisdiction Metadata for NSD_14(2020) id c437be9a-db61-4389-b9c5-6dfc81ac7f74", - "key": "c437be9a-db61-4389-b9c5-6dfc81ac7f74", - "label": "NSD_14(2020) metadata", - "value": "27584" - }, - { - "description": "Jurisdiction Metadata for NSD_13(2020) id f3f40ab9-fdec-404a-9f0a-1d3cba4420b6", - "key": "f3f40ab9-fdec-404a-9f0a-1d3cba4420b6", - "label": "NSD_13(2020) metadata", - "value": "27585" - }, - { - "description": "Jurisdiction Metadata for NSD_31(2020) id 283a165f-b391-4427-a343-84feff417a4a", - "key": "283a165f-b391-4427-a343-84feff417a4a", - "label": "NSD_31(2020) metadata", - "value": "27586" - }, - { - "description": "Jurisdiction Metadata for NSD_3(2020) id 82b79f84-f696-4125-b0b9-7c7f7cedfaec", - "key": "82b79f84-f696-4125-b0b9-7c7f7cedfaec", - "label": "NSD_3(2020) metadata", - "value": "27587" - }, - { - "description": "Jurisdiction Metadata for NSD_29(2020) id 8fbcb66f-a654-4d61-be2c-5c565c779775", - "key": "8fbcb66f-a654-4d61-be2c-5c565c779775", - "label": "NSD_29(2020) metadata", - "value": "27588" - }, - { - "description": "Jurisdiction Metadata for NSD_23(2020) id c2231e0e-1d55-491c-ba16-7511dedea67c", - "key": "c2231e0e-1d55-491c-ba16-7511dedea67c", - "label": "NSD_23(2020) metadata", - "value": "27589" - }, - { - "description": "Jurisdiction Metadata for NSD_46(2020) id 921e2f62-0685-4b49-b499-f00bf73b7fd7", - "key": "921e2f62-0685-4b49-b499-f00bf73b7fd7", - "label": "NSD_46(2020) metadata", - "value": "27590" - }, - { - "description": "Jurisdiction Metadata for NSD_60(2020) id f1d50cce-bcf2-4442-b1c8-68d282a7bd7f", - "key": "f1d50cce-bcf2-4442-b1c8-68d282a7bd7f", - "label": "NSD_60(2020) metadata", - "value": "27591" - }, - { - "description": "Jurisdiction Metadata for NSD_52(2020) id 99b381e5-aaf4-4782-9704-b12aae92ca03", - "key": "99b381e5-aaf4-4782-9704-b12aae92ca03", - "label": "NSD_52(2020) metadata", - "value": "27592" - }, - { - "description": "Jurisdiction Metadata for NSD_42(2020) id b9b944b4-053d-4225-b20e-63e29e276771", - "key": "b9b944b4-053d-4225-b20e-63e29e276771", - "label": "NSD_42(2020) metadata", - "value": "27593" - }, - { - "description": "Jurisdiction Metadata for NSD_58(2020) id 640765ad-30a3-473e-9d34-ba0bd6bff0ec", - "key": "640765ad-30a3-473e-9d34-ba0bd6bff0ec", - "label": "NSD_58(2020) metadata", - "value": "27594" - }, - { - "description": "Jurisdiction Metadata for NSD_56(2020) id 1168b29f-9122-470f-8a79-099d3664d708", - "key": "1168b29f-9122-470f-8a79-099d3664d708", - "label": "NSD_56(2020) metadata", - "value": "27595" - }, - { - "description": "Jurisdiction Metadata for NSD_8(2020) id bf274acd-a998-4990-8920-80f198e4566f", - "key": "bf274acd-a998-4990-8920-80f198e4566f", - "label": "NSD_8(2020) metadata", - "value": "27596" - }, - { - "description": "Jurisdiction Metadata for NSD_34(2020) id 6274de3d-df93-47d4-8cce-486d10a7a255", - "key": "6274de3d-df93-47d4-8cce-486d10a7a255", - "label": "NSD_34(2020) metadata", - "value": "27597" - }, - { - "description": "Jurisdiction Metadata for NSD_55(2020) id f9471999-db5d-4cde-a123-c7478d4d2efd", - "key": "f9471999-db5d-4cde-a123-c7478d4d2efd", - "label": "NSD_55(2020) metadata", - "value": "27598" - }, - { - "description": "Jurisdiction Metadata for NSD_50(2020) id 300f6566-26e5-4807-8dd6-0f98218e86c0", - "key": "300f6566-26e5-4807-8dd6-0f98218e86c0", - "label": "NSD_50(2020) metadata", - "value": "27599" - }, - { - "description": "Jurisdiction Metadata for NSD_35(2020) id 0e8a4e0b-a5c4-4214-8b58-d85809066724", - "key": "0e8a4e0b-a5c4-4214-8b58-d85809066724", - "label": "NSD_35(2020) metadata", - "value": "27600" - }, - { - "description": "Jurisdiction Metadata for NSD_53(2020) id d06a4f49-b9bc-4daf-82de-4669818e5f0e", - "key": "d06a4f49-b9bc-4daf-82de-4669818e5f0e", - "label": "NSD_53(2020) metadata", - "value": "27601" - }, - { - "description": "Jurisdiction Metadata for NSD_51(2020) id d3f12c43-eb5d-429f-a988-255a5dd7bd01", - "key": "d3f12c43-eb5d-429f-a988-255a5dd7bd01", - "label": "NSD_51(2020) metadata", - "value": "27602" - }, - { - "description": "Jurisdiction Metadata for NSD_49(2020) id adc52b39-68ad-494a-916b-4cb5f948fbdc", - "key": "adc52b39-68ad-494a-916b-4cb5f948fbdc", - "label": "NSD_49(2020) metadata", - "value": "27603" - }, - { - "description": "Jurisdiction Metadata for NSD_57(2020) id 9f1c0678-4164-4a55-9f6c-8b1d2c9ebbb9", - "key": "9f1c0678-4164-4a55-9f6c-8b1d2c9ebbb9", - "label": "NSD_57(2020) metadata", - "value": "27604" - }, - { - "description": "Jurisdiction Metadata for NSD_40(2020) id 84f20f96-3367-47ef-a4c0-e106a395f42c", - "key": "84f20f96-3367-47ef-a4c0-e106a395f42c", - "label": "NSD_40(2020) metadata", - "value": "27605" - }, - { - "description": "Jurisdiction Metadata for NSD_32(2020) id 995e6753-ba80-42e4-a40b-ce9cb61a7fe4", - "key": "995e6753-ba80-42e4-a40b-ce9cb61a7fe4", - "label": "NSD_32(2020) metadata", - "value": "27606" - }, - { - "description": "Jurisdiction Metadata for NSD_41(2020) id 0200338e-feae-4db5-b36a-62b36ad40633", - "key": "0200338e-feae-4db5-b36a-62b36ad40633", - "label": "NSD_41(2020) metadata", - "value": "27607" - }, - { - "description": "Jurisdiction Metadata for NSD_19(2020) id 07334e34-d80c-486e-9f14-3e969def207f", - "key": "07334e34-d80c-486e-9f14-3e969def207f", - "label": "NSD_19(2020) metadata", - "value": "27608" - }, - { - "description": "Jurisdiction Metadata for NSD_21(2020) id 5665ed29-c494-4e56-b16c-8e8dacced968", - "key": "5665ed29-c494-4e56-b16c-8e8dacced968", - "label": "NSD_21(2020) metadata", - "value": "27609" - }, - { - "description": "Jurisdiction Metadata for Chanjowe(2020) id 23e7054b-e657-4ffb-a11c-893e2e173f60", - "key": "23e7054b-e657-4ffb-a11c-893e2e173f60", - "label": "Chanjowe(2020) metadata", - "value": "27610" - }, - { - "description": "Jurisdiction Metadata for Kabeni_NHC id b0f1dec9-2da0-4310-9df4-a68240bcd329", - "key": "b0f1dec9-2da0-4310-9df4-a68240bcd329", - "label": "Kabeni_NHC metadata", - "value": "27611" - }, - { - "description": "Jurisdiction Metadata for CJB_3(2020) id 37d51c16-be8f-42aa-9504-34e6ba8ff7dc", - "key": "37d51c16-be8f-42aa-9504-34e6ba8ff7dc", - "label": "CJB_3(2020) metadata", - "value": "27612" - }, - { - "description": "Jurisdiction Metadata for CJB_134(2020) id 3c66358c-dc3a-48b0-ab78-28304079038e", - "key": "3c66358c-dc3a-48b0-ab78-28304079038e", - "label": "CJB_134(2020) metadata", - "value": "27613" - }, - { - "description": "Jurisdiction Metadata for CJB_2(2020) id 3b982c70-289e-4fc2-b928-34b41b5e2e40", - "key": "3b982c70-289e-4fc2-b928-34b41b5e2e40", - "label": "CJB_2(2020) metadata", - "value": "27614" - }, - { - "description": "Jurisdiction Metadata for CJB_124(2020) id c1d31278-0594-468e-8488-6f99db341c67", - "key": "c1d31278-0594-468e-8488-6f99db341c67", - "label": "CJB_124(2020) metadata", - "value": "27615" - }, - { - "description": "Jurisdiction Metadata for CJB_62(2020) id 19eb19c1-6b6a-4c8b-a031-5c9370129707", - "key": "19eb19c1-6b6a-4c8b-a031-5c9370129707", - "label": "CJB_62(2020) metadata", - "value": "27616" - }, - { - "description": "Jurisdiction Metadata for CJB_67(2020) id 6422655f-2bde-487c-adee-015659a4dc05", - "key": "6422655f-2bde-487c-adee-015659a4dc05", - "label": "CJB_67(2020) metadata", - "value": "27617" - }, - { - "description": "Jurisdiction Metadata for CJB_50(2020) id 5038fd85-fa26-4feb-8bc4-6d11252c3bba", - "key": "5038fd85-fa26-4feb-8bc4-6d11252c3bba", - "label": "CJB_50(2020) metadata", - "value": "27618" - }, - { - "description": "Jurisdiction Metadata for CJB_8(2020) id 1d242cec-8ace-4a53-a962-52e6f5212622", - "key": "1d242cec-8ace-4a53-a962-52e6f5212622", - "label": "CJB_8(2020) metadata", - "value": "27619" - }, - { - "description": "Jurisdiction Metadata for CJB_24(2020) id d77215be-faca-471b-9b63-7980f36b860e", - "key": "d77215be-faca-471b-9b63-7980f36b860e", - "label": "CJB_24(2020) metadata", - "value": "27620" - }, - { - "description": "Jurisdiction Metadata for CJB_95(2020) id f9b2aa89-2e66-45fc-9921-4fd79c4f6ca8", - "key": "f9b2aa89-2e66-45fc-9921-4fd79c4f6ca8", - "label": "CJB_95(2020) metadata", - "value": "27621" - }, - { - "description": "Jurisdiction Metadata for CJB_35(2020) id a3e7b480-9b2d-427d-a2dc-75ee1bdce3d5", - "key": "a3e7b480-9b2d-427d-a2dc-75ee1bdce3d5", - "label": "CJB_35(2020) metadata", - "value": "27622" - }, - { - "description": "Jurisdiction Metadata for CJB_78(2020) id 57145a17-8991-435d-b9ee-99ebda38802c", - "key": "57145a17-8991-435d-b9ee-99ebda38802c", - "label": "CJB_78(2020) metadata", - "value": "27623" - }, - { - "description": "Jurisdiction Metadata for CJB_26(2020) id f1cc9795-949e-4f39-b6cf-278375e8464a", - "key": "f1cc9795-949e-4f39-b6cf-278375e8464a", - "label": "CJB_26(2020) metadata", - "value": "27624" - }, - { - "description": "Jurisdiction Metadata for CJB_98(2020) id e7914aaf-a1ce-4db0-9ed8-249f1d7790a3", - "key": "e7914aaf-a1ce-4db0-9ed8-249f1d7790a3", - "label": "CJB_98(2020) metadata", - "value": "27625" - }, - { - "description": "Jurisdiction Metadata for CJB_40(2020) id 67b66a50-0bee-4526-8c45-3430e0cd69f9", - "key": "67b66a50-0bee-4526-8c45-3430e0cd69f9", - "label": "CJB_40(2020) metadata", - "value": "27626" - }, - { - "description": "Jurisdiction Metadata for CJB_105(2020) id 650da659-3b61-437c-a3cd-0506edf81170", - "key": "650da659-3b61-437c-a3cd-0506edf81170", - "label": "CJB_105(2020) metadata", - "value": "27627" - }, - { - "description": "Jurisdiction Metadata for CJB_79(2020) id 72fd0ea7-81dc-4064-9706-796f8102bb8f", - "key": "72fd0ea7-81dc-4064-9706-796f8102bb8f", - "label": "CJB_79(2020) metadata", - "value": "27628" - }, - { - "description": "Jurisdiction Metadata for CJB_83(2020) id 626c7d3d-05ad-4884-a2fd-586c95669972", - "key": "626c7d3d-05ad-4884-a2fd-586c95669972", - "label": "CJB_83(2020) metadata", - "value": "27629" - }, - { - "description": "Jurisdiction Metadata for CJB_58(2020) id 04cd07ac-d1c0-43b4-8510-b9d657c6b835", - "key": "04cd07ac-d1c0-43b4-8510-b9d657c6b835", - "label": "CJB_58(2020) metadata", - "value": "27630" - }, - { - "description": "Jurisdiction Metadata for CJB_64(2020) id 957cbc85-fc23-4d6f-9fc3-c9284f82c5a9", - "key": "957cbc85-fc23-4d6f-9fc3-c9284f82c5a9", - "label": "CJB_64(2020) metadata", - "value": "27631" - }, - { - "description": "Jurisdiction Metadata for CJB_55(2020) id 8e0c0d3e-3ba0-41aa-bba1-2ac7744068cb", - "key": "8e0c0d3e-3ba0-41aa-bba1-2ac7744068cb", - "label": "CJB_55(2020) metadata", - "value": "27632" - }, - { - "description": "Jurisdiction Metadata for CJB_71(2020) id 02d4fe66-66ff-49d6-94f3-9d871bd7f654", - "key": "02d4fe66-66ff-49d6-94f3-9d871bd7f654", - "label": "CJB_71(2020) metadata", - "value": "27633" - }, - { - "description": "Jurisdiction Metadata for CJB_51(2020) id ec761f7b-c62a-4017-941c-f8a4dcaea948", - "key": "ec761f7b-c62a-4017-941c-f8a4dcaea948", - "label": "CJB_51(2020) metadata", - "value": "27634" - }, - { - "description": "Jurisdiction Metadata for CJB_65(2020) id 32a70744-587d-41aa-baf3-b66c0fe82e8e", - "key": "32a70744-587d-41aa-baf3-b66c0fe82e8e", - "label": "CJB_65(2020) metadata", - "value": "27635" - }, - { - "description": "Jurisdiction Metadata for CJB_128(2020) id e63eb304-acea-4c72-a4c2-10b18e8b431c", - "key": "e63eb304-acea-4c72-a4c2-10b18e8b431c", - "label": "CJB_128(2020) metadata", - "value": "27636" - }, - { - "description": "Jurisdiction Metadata for CJB_96(2020) id 560c8a5e-9b5f-4d83-95c3-7a38d4398e7f", - "key": "560c8a5e-9b5f-4d83-95c3-7a38d4398e7f", - "label": "CJB_96(2020) metadata", - "value": "27637" - }, - { - "description": "Jurisdiction Metadata for CJB_101(2020) id b1dcf453-9daa-478d-ac73-918f41e806d8", - "key": "b1dcf453-9daa-478d-ac73-918f41e806d8", - "label": "CJB_101(2020) metadata", - "value": "27638" - }, - { - "description": "Jurisdiction Metadata for CJB_52(2020) id 84718755-fd76-4d46-9d06-24b59deeb410", - "key": "84718755-fd76-4d46-9d06-24b59deeb410", - "label": "CJB_52(2020) metadata", - "value": "27639" - }, - { - "description": "Jurisdiction Metadata for CJB_123(2020) id cd50c81d-95d2-40c7-9034-339fc29c4f9c", - "key": "cd50c81d-95d2-40c7-9034-339fc29c4f9c", - "label": "CJB_123(2020) metadata", - "value": "27640" - }, - { - "description": "Jurisdiction Metadata for CJB_74(2020) id 0bfb529a-edda-4401-b6d2-1328900561c3", - "key": "0bfb529a-edda-4401-b6d2-1328900561c3", - "label": "CJB_74(2020) metadata", - "value": "27641" - }, - { - "description": "Jurisdiction Metadata for CJB_1(2020) id 19c5040c-24af-4e88-a035-d3c6b9df87ac", - "key": "19c5040c-24af-4e88-a035-d3c6b9df87ac", - "label": "CJB_1(2020) metadata", - "value": "27642" - }, - { - "description": "Jurisdiction Metadata for CJB_82(2020) id 9a8e64b5-8223-4938-a424-45267090f9e5", - "key": "9a8e64b5-8223-4938-a424-45267090f9e5", - "label": "CJB_82(2020) metadata", - "value": "27643" - }, - { - "description": "Jurisdiction Metadata for CJB_133(2020) id 0ba2576c-bc26-48d0-b0d6-db4c186f15ec", - "key": "0ba2576c-bc26-48d0-b0d6-db4c186f15ec", - "label": "CJB_133(2020) metadata", - "value": "27644" - }, - { - "description": "Jurisdiction Metadata for CJB_37(2020) id 28f110a0-8ade-4570-b69f-b832cd1b4949", - "key": "28f110a0-8ade-4570-b69f-b832cd1b4949", - "label": "CJB_37(2020) metadata", - "value": "27645" - }, - { - "description": "Jurisdiction Metadata for CJB_59(2020) id f95e6c02-b36b-4994-b566-a9150b187cec", - "key": "f95e6c02-b36b-4994-b566-a9150b187cec", - "label": "CJB_59(2020) metadata", - "value": "27646" - }, - { - "description": "Jurisdiction Metadata for CJB_77(2020) id 09913934-dd6a-443e-8267-09067c53dfa5", - "key": "09913934-dd6a-443e-8267-09067c53dfa5", - "label": "CJB_77(2020) metadata", - "value": "27647" - }, - { - "description": "Jurisdiction Metadata for CJB_86(2020) id 0f26e449-6a66-41a1-81cf-a45cf1c2ecab", - "key": "0f26e449-6a66-41a1-81cf-a45cf1c2ecab", - "label": "CJB_86(2020) metadata", - "value": "27648" - }, - { - "description": "Jurisdiction Metadata for CJB_113(2020) id 74b23307-c0f2-4993-a7b9-48c52074f017", - "key": "74b23307-c0f2-4993-a7b9-48c52074f017", - "label": "CJB_113(2020) metadata", - "value": "27649" - }, - { - "description": "Jurisdiction Metadata for CJB_29(2020) id 3f670037-7156-4da8-992d-0c581874e79f", - "key": "3f670037-7156-4da8-992d-0c581874e79f", - "label": "CJB_29(2020) metadata", - "value": "27650" - }, - { - "description": "Jurisdiction Metadata for CJB_49(2020) id 4f1e33a4-7e2a-4ade-81e2-6ae50ee3517f", - "key": "4f1e33a4-7e2a-4ade-81e2-6ae50ee3517f", - "label": "CJB_49(2020) metadata", - "value": "27651" - }, - { - "description": "Jurisdiction Metadata for CJB_122(2020) id cb8967f4-61e9-4eaf-8ee3-a450763b1d28", - "key": "cb8967f4-61e9-4eaf-8ee3-a450763b1d28", - "label": "CJB_122(2020) metadata", - "value": "27652" - }, - { - "description": "Jurisdiction Metadata for CJB_94(2020) id 05d64406-04fc-4981-89fc-5d8be9267909", - "key": "05d64406-04fc-4981-89fc-5d8be9267909", - "label": "CJB_94(2020) metadata", - "value": "27653" - }, - { - "description": "Jurisdiction Metadata for CJB_127(2020) id 6669c2ff-b77c-48b1-aab3-aa2437d4cc5f", - "key": "6669c2ff-b77c-48b1-aab3-aa2437d4cc5f", - "label": "CJB_127(2020) metadata", - "value": "27654" - }, - { - "description": "Jurisdiction Metadata for CJB_136(2020) id 05640863-407b-446d-92dc-976ce6662b95", - "key": "05640863-407b-446d-92dc-976ce6662b95", - "label": "CJB_136(2020) metadata", - "value": "27655" - }, - { - "description": "Jurisdiction Metadata for CJB_87(2020) id 9211aff4-6496-4290-8724-0c88d19a7e99", - "key": "9211aff4-6496-4290-8724-0c88d19a7e99", - "label": "CJB_87(2020) metadata", - "value": "27656" - }, - { - "description": "Jurisdiction Metadata for CJB_81(2020) id 15ad582e-d13f-4116-b705-a927cdb45d60", - "key": "15ad582e-d13f-4116-b705-a927cdb45d60", - "label": "CJB_81(2020) metadata", - "value": "27657" - }, - { - "description": "Jurisdiction Metadata for CJB_14(2020) id 10478df1-60ad-4bf4-bbd6-c740cc19b250", - "key": "10478df1-60ad-4bf4-bbd6-c740cc19b250", - "label": "CJB_14(2020) metadata", - "value": "27658" - }, - { - "description": "Jurisdiction Metadata for CJB_38(2020) id a44bde9a-1ede-4b3f-86be-766b125c366b", - "key": "a44bde9a-1ede-4b3f-86be-766b125c366b", - "label": "CJB_38(2020) metadata", - "value": "27659" - }, - { - "description": "Jurisdiction Metadata for CJB_12(2020) id 9a62add8-0bec-4e6f-b017-2b709c9ea4a6", - "key": "9a62add8-0bec-4e6f-b017-2b709c9ea4a6", - "label": "CJB_12(2020) metadata", - "value": "27660" - }, - { - "description": "Jurisdiction Metadata for CJB_19(2020) id bc7cb0c8-8f4b-4e48-b903-8f205057b1e8", - "key": "bc7cb0c8-8f4b-4e48-b903-8f205057b1e8", - "label": "CJB_19(2020) metadata", - "value": "27661" - }, - { - "description": "Jurisdiction Metadata for CJB_109(2020) id ab7f5996-c146-4492-9b30-b1a8087150c9", - "key": "ab7f5996-c146-4492-9b30-b1a8087150c9", - "label": "CJB_109(2020) metadata", - "value": "27662" - }, - { - "description": "Jurisdiction Metadata for CJB_93(2020) id 2cba8875-05d1-4eb6-9c6b-fff013b8738a", - "key": "2cba8875-05d1-4eb6-9c6b-fff013b8738a", - "label": "CJB_93(2020) metadata", - "value": "27663" - }, - { - "description": "Jurisdiction Metadata for CJB_103(2020) id e295cbf7-fd46-4e3c-a2b3-bfd7609872c1", - "key": "e295cbf7-fd46-4e3c-a2b3-bfd7609872c1", - "label": "CJB_103(2020) metadata", - "value": "27664" - }, - { - "description": "Jurisdiction Metadata for CJB_88(2020) id f70c07fe-7f4f-4c76-82a9-02b32f57c749", - "key": "f70c07fe-7f4f-4c76-82a9-02b32f57c749", - "label": "CJB_88(2020) metadata", - "value": "27665" - }, - { - "description": "Jurisdiction Metadata for CJB_106(2020) id 4aaf096c-9652-440c-8ad0-72df38175e0b", - "key": "4aaf096c-9652-440c-8ad0-72df38175e0b", - "label": "CJB_106(2020) metadata", - "value": "27666" - }, - { - "description": "Jurisdiction Metadata for CJB_121(2020) id 7558a8f2-04df-4683-902b-3fcbbcecac19", - "key": "7558a8f2-04df-4683-902b-3fcbbcecac19", - "label": "CJB_121(2020) metadata", - "value": "27667" - }, - { - "description": "Jurisdiction Metadata for CJB_97(2020) id edb322d7-fad6-480e-9e3e-3360642cf9c8", - "key": "edb322d7-fad6-480e-9e3e-3360642cf9c8", - "label": "CJB_97(2020) metadata", - "value": "27668" - }, - { - "description": "Jurisdiction Metadata for CJB_11(2020) id baa5cb80-5c5b-4ca0-8fb9-cc2551b46768", - "key": "baa5cb80-5c5b-4ca0-8fb9-cc2551b46768", - "label": "CJB_11(2020) metadata", - "value": "27669" - }, - { - "description": "Jurisdiction Metadata for CJB_110(2020) id 7b2a5679-1370-484a-b29b-97585ff82632", - "key": "7b2a5679-1370-484a-b29b-97585ff82632", - "label": "CJB_110(2020) metadata", - "value": "27670" - }, - { - "description": "Jurisdiction Metadata for CJB_16(2020) id 25e66c81-d0fb-424a-9c07-bca7e6f71b0c", - "key": "25e66c81-d0fb-424a-9c07-bca7e6f71b0c", - "label": "CJB_16(2020) metadata", - "value": "27671" - }, - { - "description": "Jurisdiction Metadata for CJB_15(2020) id bb205b67-d8dc-4222-8907-e9a2f4e95ce6", - "key": "bb205b67-d8dc-4222-8907-e9a2f4e95ce6", - "label": "CJB_15(2020) metadata", - "value": "27672" - }, - { - "description": "Jurisdiction Metadata for CJB_126(2020) id da2b8cd6-b28d-4607-b759-417f0d066385", - "key": "da2b8cd6-b28d-4607-b759-417f0d066385", - "label": "CJB_126(2020) metadata", - "value": "27673" - }, - { - "description": "Jurisdiction Metadata for CJB_132(2020) id b6ca05f7-1cf5-4898-b757-2716753d5e49", - "key": "b6ca05f7-1cf5-4898-b757-2716753d5e49", - "label": "CJB_132(2020) metadata", - "value": "27674" - }, - { - "description": "Jurisdiction Metadata for CJB_85(2020) id 3e2e4f6f-2b4d-498c-979e-491c40a624db", - "key": "3e2e4f6f-2b4d-498c-979e-491c40a624db", - "label": "CJB_85(2020) metadata", - "value": "27675" - }, - { - "description": "Jurisdiction Metadata for CJB_7(2020) id 149802eb-7da2-401b-b068-5288d36fc545", - "key": "149802eb-7da2-401b-b068-5288d36fc545", - "label": "CJB_7(2020) metadata", - "value": "27676" - }, - { - "description": "Jurisdiction Metadata for CJB_99(2020) id 35f63280-39f7-4286-b581-816a0ae5abc0", - "key": "35f63280-39f7-4286-b581-816a0ae5abc0", - "label": "CJB_99(2020) metadata", - "value": "27677" - }, - { - "description": "Jurisdiction Metadata for CJB_92(2020) id 06a48c35-3486-494f-8ef9-0383858e85d6", - "key": "06a48c35-3486-494f-8ef9-0383858e85d6", - "label": "CJB_92(2020) metadata", - "value": "27678" - }, - { - "description": "Jurisdiction Metadata for CJB_30(2020) id 79127321-42a2-47f4-a265-6e8db4795fb4", - "key": "79127321-42a2-47f4-a265-6e8db4795fb4", - "label": "CJB_30(2020) metadata", - "value": "27679" - }, - { - "description": "Jurisdiction Metadata for CJB_61(2020) id 96bc45ae-e637-4413-9605-9c076de27ca1", - "key": "96bc45ae-e637-4413-9605-9c076de27ca1", - "label": "CJB_61(2020) metadata", - "value": "27680" - }, - { - "description": "Jurisdiction Metadata for CJB_68(2020) id ad759296-82ed-46b9-b52d-968052554609", - "key": "ad759296-82ed-46b9-b52d-968052554609", - "label": "CJB_68(2020) metadata", - "value": "27681" - }, - { - "description": "Jurisdiction Metadata for CJB_114(2020) id 98c7e4e5-5afd-4e9f-8db1-b82f26be4afa", - "key": "98c7e4e5-5afd-4e9f-8db1-b82f26be4afa", - "label": "CJB_114(2020) metadata", - "value": "27682" - }, - { - "description": "Jurisdiction Metadata for CJB_31(2020) id 66070c91-66c3-426f-84a2-5da78de91171", - "key": "66070c91-66c3-426f-84a2-5da78de91171", - "label": "CJB_31(2020) metadata", - "value": "27683" - }, - { - "description": "Jurisdiction Metadata for CJB_41(2020) id 5a6c13c9-40c9-42f6-82ba-7f2bb074b618", - "key": "5a6c13c9-40c9-42f6-82ba-7f2bb074b618", - "label": "CJB_41(2020) metadata", - "value": "27684" - }, - { - "description": "Jurisdiction Metadata for CJB_115(2020) id 2293ec2b-6b1b-42e2-8c19-99ab9b577885", - "key": "2293ec2b-6b1b-42e2-8c19-99ab9b577885", - "label": "CJB_115(2020) metadata", - "value": "27685" - }, - { - "description": "Jurisdiction Metadata for CJB_63(2020) id cc493052-ca81-43fe-bd8f-0a001ae3ac94", - "key": "cc493052-ca81-43fe-bd8f-0a001ae3ac94", - "label": "CJB_63(2020) metadata", - "value": "27686" - }, - { - "description": "Jurisdiction Metadata for CJB_73(2020) id b8444eab-a208-4b2f-b661-f08cf51eb2ec", - "key": "b8444eab-a208-4b2f-b661-f08cf51eb2ec", - "label": "CJB_73(2020) metadata", - "value": "27687" - }, - { - "description": "Jurisdiction Metadata for CJB_34(2020) id c9b98c0e-3c28-401a-9a58-c30d91924b20", - "key": "c9b98c0e-3c28-401a-9a58-c30d91924b20", - "label": "CJB_34(2020) metadata", - "value": "27688" - }, - { - "description": "Jurisdiction Metadata for CJB_112(2020) id 645ff091-b137-43c0-9efe-764513215aa5", - "key": "645ff091-b137-43c0-9efe-764513215aa5", - "label": "CJB_112(2020) metadata", - "value": "27689" - }, - { - "description": "Jurisdiction Metadata for CJB_5(2020) id 6bbbb710-9c7d-4754-aa7e-2f39bd22ee1e", - "key": "6bbbb710-9c7d-4754-aa7e-2f39bd22ee1e", - "label": "CJB_5(2020) metadata", - "value": "27690" - }, - { - "description": "Jurisdiction Metadata for CJB_60(2020) id 2e50c778-f5d7-4bb8-9ff2-b6bcffe147b6", - "key": "2e50c778-f5d7-4bb8-9ff2-b6bcffe147b6", - "label": "CJB_60(2020) metadata", - "value": "27691" - }, - { - "description": "Jurisdiction Metadata for CJB_90(2020) id 852a3a1b-afd9-4469-816c-2c0b787c8b0f", - "key": "852a3a1b-afd9-4469-816c-2c0b787c8b0f", - "label": "CJB_90(2020) metadata", - "value": "27692" - }, - { - "description": "Jurisdiction Metadata for CJB_39(2020) id 028861f0-6e1c-4549-ac0b-a790fedd7bc7", - "key": "028861f0-6e1c-4549-ac0b-a790fedd7bc7", - "label": "CJB_39(2020) metadata", - "value": "27693" - }, - { - "description": "Jurisdiction Metadata for CJB_54(2020) id 36800aa3-a8f2-4930-90e5-0f1bf049039d", - "key": "36800aa3-a8f2-4930-90e5-0f1bf049039d", - "label": "CJB_54(2020) metadata", - "value": "27694" - }, - { - "description": "Jurisdiction Metadata for CJB_22(2020) id 535f3328-1317-48ce-b69d-9f52ffb4fa51", - "key": "535f3328-1317-48ce-b69d-9f52ffb4fa51", - "label": "CJB_22(2020) metadata", - "value": "27695" - }, - { - "description": "Jurisdiction Metadata for CJB_4(2020) id 72b7bce5-ada7-40c2-a758-5fae7a5acf15", - "key": "72b7bce5-ada7-40c2-a758-5fae7a5acf15", - "label": "CJB_4(2020) metadata", - "value": "27696" - }, - { - "description": "Jurisdiction Metadata for CJB_100(2020) id 5732404a-59e7-4e81-b3cd-3b43cd5ae859", - "key": "5732404a-59e7-4e81-b3cd-3b43cd5ae859", - "label": "CJB_100(2020) metadata", - "value": "27697" - }, - { - "description": "Jurisdiction Metadata for CJB_70(2020) id b2db6aec-e921-47c9-bb9c-d0826de3108e", - "key": "b2db6aec-e921-47c9-bb9c-d0826de3108e", - "label": "CJB_70(2020) metadata", - "value": "27698" - }, - { - "description": "Jurisdiction Metadata for CJB_28(2020) id c949a31b-fc86-4e27-b1d3-89cb6c6a7fb8", - "key": "c949a31b-fc86-4e27-b1d3-89cb6c6a7fb8", - "label": "CJB_28(2020) metadata", - "value": "27699" - }, - { - "description": "Jurisdiction Metadata for CJB_27(2020) id ff03787f-b4a2-4bcf-b8b1-d0ac0662b9dc", - "key": "ff03787f-b4a2-4bcf-b8b1-d0ac0662b9dc", - "label": "CJB_27(2020) metadata", - "value": "27700" - }, - { - "description": "Jurisdiction Metadata for CJB_130(2020) id 78c179a4-d012-4fbe-afc7-a05f8f8b9b5a", - "key": "78c179a4-d012-4fbe-afc7-a05f8f8b9b5a", - "label": "CJB_130(2020) metadata", - "value": "27701" - }, - { - "description": "Jurisdiction Metadata for CJB_116(2020) id 35b90764-d991-4db0-bfba-2f966b72fe02", - "key": "35b90764-d991-4db0-bfba-2f966b72fe02", - "label": "CJB_116(2020) metadata", - "value": "27702" - }, - { - "description": "Jurisdiction Metadata for CJB_18(2020) id b2bb28e2-78e1-4ee4-9f42-01c62f47acb3", - "key": "b2bb28e2-78e1-4ee4-9f42-01c62f47acb3", - "label": "CJB_18(2020) metadata", - "value": "27703" - }, - { - "description": "Jurisdiction Metadata for CJB_108(2020) id cdd81004-0083-4fe0-9330-d0521810056c", - "key": "cdd81004-0083-4fe0-9330-d0521810056c", - "label": "CJB_108(2020) metadata", - "value": "27704" - }, - { - "description": "Jurisdiction Metadata for CJB_125(2020) id c009f8a0-4cc0-4ddc-802b-ae5b0acf5a14", - "key": "c009f8a0-4cc0-4ddc-802b-ae5b0acf5a14", - "label": "CJB_125(2020) metadata", - "value": "27705" - }, - { - "description": "Jurisdiction Metadata for CJB_57(2020) id 7699107b-46fd-493a-a579-85ce6023d732", - "key": "7699107b-46fd-493a-a579-85ce6023d732", - "label": "CJB_57(2020) metadata", - "value": "27706" - }, - { - "description": "Jurisdiction Metadata for CJB_10(2020) id 2499b375-4dee-4fef-9756-bee1b134aa26", - "key": "2499b375-4dee-4fef-9756-bee1b134aa26", - "label": "CJB_10(2020) metadata", - "value": "27707" - }, - { - "description": "Jurisdiction Metadata for CJB_66(2020) id 59e18148-3b9c-44b6-a3ac-b1bf27c6f62b", - "key": "59e18148-3b9c-44b6-a3ac-b1bf27c6f62b", - "label": "CJB_66(2020) metadata", - "value": "27708" - }, - { - "description": "Jurisdiction Metadata for CJB_72(2020) id fdb2282a-104e-4191-8443-85674b927fd5", - "key": "fdb2282a-104e-4191-8443-85674b927fd5", - "label": "CJB_72(2020) metadata", - "value": "27709" - }, - { - "description": "Jurisdiction Metadata for CJB_80(2020) id 36202680-9aa0-4e4b-96ec-9fa77c9fb516", - "key": "36202680-9aa0-4e4b-96ec-9fa77c9fb516", - "label": "CJB_80(2020) metadata", - "value": "27710" - }, - { - "description": "Jurisdiction Metadata for CJB_53(2020) id bec35a1f-5534-4cf8-ab1f-24ba1663f93e", - "key": "bec35a1f-5534-4cf8-ab1f-24ba1663f93e", - "label": "CJB_53(2020) metadata", - "value": "27711" - }, - { - "description": "Jurisdiction Metadata for CJB_119(2020) id ef771367-2e9e-4a2d-996e-a55db058c3e3", - "key": "ef771367-2e9e-4a2d-996e-a55db058c3e3", - "label": "CJB_119(2020) metadata", - "value": "27712" - }, - { - "description": "Jurisdiction Metadata for CJB_33(2020) id 72268b7e-5b6b-48af-8104-72a2cd44d314", - "key": "72268b7e-5b6b-48af-8104-72a2cd44d314", - "label": "CJB_33(2020) metadata", - "value": "27713" - }, - { - "description": "Jurisdiction Metadata for CJB_120(2020) id 5eebb783-c8a7-4d69-b6a7-0b6bfba3af3c", - "key": "5eebb783-c8a7-4d69-b6a7-0b6bfba3af3c", - "label": "CJB_120(2020) metadata", - "value": "27714" - }, - { - "description": "Jurisdiction Metadata for CJB_102(2020) id 152d8752-161c-429c-9821-270317025485", - "key": "152d8752-161c-429c-9821-270317025485", - "label": "CJB_102(2020) metadata", - "value": "27715" - }, - { - "description": "Jurisdiction Metadata for CJB_25(2020) id 02e2a311-e8ae-49d0-8c57-22267bf562cd", - "key": "02e2a311-e8ae-49d0-8c57-22267bf562cd", - "label": "CJB_25(2020) metadata", - "value": "27716" - }, - { - "description": "Jurisdiction Metadata for CJB_46(2020) id 39a084ed-db37-400a-acee-147d59615c2c", - "key": "39a084ed-db37-400a-acee-147d59615c2c", - "label": "CJB_46(2020) metadata", - "value": "27717" - }, - { - "description": "Jurisdiction Metadata for CJB_21(2020) id 426cdb0e-25ad-4624-bb53-d3703e79e45b", - "key": "426cdb0e-25ad-4624-bb53-d3703e79e45b", - "label": "CJB_21(2020) metadata", - "value": "27718" - }, - { - "description": "Jurisdiction Metadata for CJB_118(2020) id a52fc7b4-066f-4650-86cd-a452770140de", - "key": "a52fc7b4-066f-4650-86cd-a452770140de", - "label": "CJB_118(2020) metadata", - "value": "27719" - }, - { - "description": "Jurisdiction Metadata for CJB_9(2020) id 037040ec-c4e0-4054-83d3-b7001b601410", - "key": "037040ec-c4e0-4054-83d3-b7001b601410", - "label": "CJB_9(2020) metadata", - "value": "27720" - }, - { - "description": "Jurisdiction Metadata for CJB_44(2020) id d26f89fd-c636-44a0-8dae-56dfd9d180ee", - "key": "d26f89fd-c636-44a0-8dae-56dfd9d180ee", - "label": "CJB_44(2020) metadata", - "value": "27721" - }, - { - "description": "Jurisdiction Metadata for CJB_89(2020) id 767d4b6b-2c30-4975-b03b-647bf846363c", - "key": "767d4b6b-2c30-4975-b03b-647bf846363c", - "label": "CJB_89(2020) metadata", - "value": "27722" - }, - { - "description": "Jurisdiction Metadata for CJB_47(2020) id d87de073-098b-4c61-81d3-cb6eb1e1287e", - "key": "d87de073-098b-4c61-81d3-cb6eb1e1287e", - "label": "CJB_47(2020) metadata", - "value": "27723" - }, - { - "description": "Jurisdiction Metadata for CJB_42(2020) id b26c6bd3-0e1a-4086-a8b5-49a081b176d6", - "key": "b26c6bd3-0e1a-4086-a8b5-49a081b176d6", - "label": "CJB_42(2020) metadata", - "value": "27724" - }, - { - "description": "Jurisdiction Metadata for CJB_56(2020) id 7f8a9979-8670-4bfe-abd7-0694293dded6", - "key": "7f8a9979-8670-4bfe-abd7-0694293dded6", - "label": "CJB_56(2020) metadata", - "value": "27725" - }, - { - "description": "Jurisdiction Metadata for CJB_91(2020) id a2201c63-9fb9-463e-b82c-2229fcd1da7d", - "key": "a2201c63-9fb9-463e-b82c-2229fcd1da7d", - "label": "CJB_91(2020) metadata", - "value": "27726" - }, - { - "description": "Jurisdiction Metadata for CJB_135(2020) id 95f2ca8a-394e-41ee-a34a-a55c479cb67e", - "key": "95f2ca8a-394e-41ee-a34a-a55c479cb67e", - "label": "CJB_135(2020) metadata", - "value": "27727" - }, - { - "description": "Jurisdiction Metadata for CJB_45(2020) id 9bbd4e54-55d4-4a37-aae0-66a6a05ede36", - "key": "9bbd4e54-55d4-4a37-aae0-66a6a05ede36", - "label": "CJB_45(2020) metadata", - "value": "27728" - }, - { - "description": "Jurisdiction Metadata for CJB_23(2020) id d67e4f66-d55d-42af-94e4-b24d26a9ad86", - "key": "d67e4f66-d55d-42af-94e4-b24d26a9ad86", - "label": "CJB_23(2020) metadata", - "value": "27729" - }, - { - "description": "Jurisdiction Metadata for CJB_131(2020) id 74eea27a-1cb3-43c1-b1b0-52baf354bd09", - "key": "74eea27a-1cb3-43c1-b1b0-52baf354bd09", - "label": "CJB_131(2020) metadata", - "value": "27730" - }, - { - "description": "Jurisdiction Metadata for CJB_117(2020) id 96c2edca-9a03-498a-8264-856b482c3841", - "key": "96c2edca-9a03-498a-8264-856b482c3841", - "label": "CJB_117(2020) metadata", - "value": "27731" - }, - { - "description": "Jurisdiction Metadata for CJB_107(2020) id b1e0ecf3-8d1a-44e3-b4fd-2dbfdc5c57c5", - "key": "b1e0ecf3-8d1a-44e3-b4fd-2dbfdc5c57c5", - "label": "CJB_107(2020) metadata", - "value": "27732" - }, - { - "description": "Jurisdiction Metadata for CJB_17(2020) id 117a1374-3496-4292-aecd-92316e0c8d5a", - "key": "117a1374-3496-4292-aecd-92316e0c8d5a", - "label": "CJB_17(2020) metadata", - "value": "27733" - }, - { - "description": "Jurisdiction Metadata for CJB_43(2020) id 2f6e50d7-285d-4744-b1a6-c7be800d235f", - "key": "2f6e50d7-285d-4744-b1a6-c7be800d235f", - "label": "CJB_43(2020) metadata", - "value": "27734" - }, - { - "description": "Jurisdiction Metadata for CJB_13(2020) id 89bc70ac-3bea-4c0c-b9e6-6d7d4c64a8fb", - "key": "89bc70ac-3bea-4c0c-b9e6-6d7d4c64a8fb", - "label": "CJB_13(2020) metadata", - "value": "27735" - }, - { - "description": "Jurisdiction Metadata for CJB_84(2020) id 11b67bc4-3935-46e6-b8ff-56d9f70a484f", - "key": "11b67bc4-3935-46e6-b8ff-56d9f70a484f", - "label": "CJB_84(2020) metadata", - "value": "27736" - }, - { - "description": "Jurisdiction Metadata for CJB_75(2020) id 75cc2e59-0803-41ae-a65c-5660539f89a5", - "key": "75cc2e59-0803-41ae-a65c-5660539f89a5", - "label": "CJB_75(2020) metadata", - "value": "27737" - }, - { - "description": "Jurisdiction Metadata for CJB_104(2020) id b96d0684-8e40-4056-a45b-6210a3197de5", - "key": "b96d0684-8e40-4056-a45b-6210a3197de5", - "label": "CJB_104(2020) metadata", - "value": "27738" - }, - { - "description": "Jurisdiction Metadata for CJB_48(2020) id 5aac8e73-3e56-4a9f-9f2b-6a6157037d53", - "key": "5aac8e73-3e56-4a9f-9f2b-6a6157037d53", - "label": "CJB_48(2020) metadata", - "value": "27739" - }, - { - "description": "Jurisdiction Metadata for CJB_111(2020) id d00505de-fe91-4d2f-a39e-6e00e3121bac", - "key": "d00505de-fe91-4d2f-a39e-6e00e3121bac", - "label": "CJB_111(2020) metadata", - "value": "27740" - }, - { - "description": "Jurisdiction Metadata for CJB_32(2020) id 65c754de-2b08-4993-ba94-d96b84e2581b", - "key": "65c754de-2b08-4993-ba94-d96b84e2581b", - "label": "CJB_32(2020) metadata", - "value": "27741" - }, - { - "description": "Jurisdiction Metadata for CJB_76(2020) id 71a4e101-e619-45dc-ae44-f7fb9b852c4e", - "key": "71a4e101-e619-45dc-ae44-f7fb9b852c4e", - "label": "CJB_76(2020) metadata", - "value": "27742" - }, - { - "description": "Jurisdiction Metadata for CJB_129(2020) id 7bd46e02-6e8d-46e7-b0b1-5b057b276f9b", - "key": "7bd46e02-6e8d-46e7-b0b1-5b057b276f9b", - "label": "CJB_129(2020) metadata", - "value": "27743" - }, - { - "description": "Jurisdiction Metadata for CJB_69(2020) id e19005d6-c742-44a6-8770-2935555b4007", - "key": "e19005d6-c742-44a6-8770-2935555b4007", - "label": "CJB_69(2020) metadata", - "value": "27744" - }, - { - "description": "Jurisdiction Metadata for CJB_6(2020) id 875d1c8f-fa2b-42d6-b51c-4119aa3a5f69", - "key": "875d1c8f-fa2b-42d6-b51c-4119aa3a5f69", - "label": "CJB_6(2020) metadata", - "value": "27745" - }, - { - "description": "Jurisdiction Metadata for CJB_36(2020) id 28c7bfe1-5887-480a-9968-7a56d92fbe72", - "key": "28c7bfe1-5887-480a-9968-7a56d92fbe72", - "label": "CJB_36(2020) metadata", - "value": "27746" - }, - { - "description": "Jurisdiction Metadata for CJB_20(2020) id 141fcb3b-0e03-4d82-922f-5b1193c9650b", - "key": "141fcb3b-0e03-4d82-922f-5b1193c9650b", - "label": "CJB_20(2020) metadata", - "value": "27747" - }, - { - "description": "Jurisdiction Metadata for Chamandala(2020) id 55c7dce3-ed65-45ba-a59a-e20b074df846", - "key": "55c7dce3-ed65-45ba-a59a-e20b074df846", - "label": "Chamandala(2020) metadata", - "value": "27748" - }, - { - "description": "Jurisdiction Metadata for Njoka NHC id 81b26c51-d810-4e4f-9a9c-c18f87db5656", - "key": "81b26c51-d810-4e4f-9a9c-c18f87db5656", - "label": "Njoka NHC metadata", - "value": "27749" - }, - { - "description": "Jurisdiction Metadata for CDZ_81(2020) id dfcf011a-c7f4-478e-9ae0-18addf7fa0f2", - "key": "dfcf011a-c7f4-478e-9ae0-18addf7fa0f2", - "label": "CDZ_81(2020) metadata", - "value": "27750" - }, - { - "description": "Jurisdiction Metadata for CDZ_79(2020) id 9b3957ec-ecbf-4594-b719-193911dc7a04", - "key": "9b3957ec-ecbf-4594-b719-193911dc7a04", - "label": "CDZ_79(2020) metadata", - "value": "27751" - }, - { - "description": "Jurisdiction Metadata for CDZ_71(2020) id 93184b85-e237-4b50-97a0-f66a02d1c5b7", - "key": "93184b85-e237-4b50-97a0-f66a02d1c5b7", - "label": "CDZ_71(2020) metadata", - "value": "27752" - }, - { - "description": "Jurisdiction Metadata for CDZ_78(2020) id 0c8b16ff-3d02-4b69-82b9-d228622d718e", - "key": "0c8b16ff-3d02-4b69-82b9-d228622d718e", - "label": "CDZ_78(2020) metadata", - "value": "27753" - }, - { - "description": "Jurisdiction Metadata for CDZ_80(2020) id 172cb39d-e856-467e-9a7e-9e61a14d5f64", - "key": "172cb39d-e856-467e-9a7e-9e61a14d5f64", - "label": "CDZ_80(2020) metadata", - "value": "27754" - }, - { - "description": "Jurisdiction Metadata for CDZ_77(2020) id 2e78534f-0fbd-4668-8609-a5c053a1be6e", - "key": "2e78534f-0fbd-4668-8609-a5c053a1be6e", - "label": "CDZ_77(2020) metadata", - "value": "27755" - }, - { - "description": "Jurisdiction Metadata for CDZ_73(2020) id f48b5fd1-8eec-4cca-b474-f27cf6b6746b", - "key": "f48b5fd1-8eec-4cca-b474-f27cf6b6746b", - "label": "CDZ_73(2020) metadata", - "value": "27756" - }, - { - "description": "Jurisdiction Metadata for CDZ_72(2020) id 284e3323-9823-49ae-a063-8def71d71cb9", - "key": "284e3323-9823-49ae-a063-8def71d71cb9", - "label": "CDZ_72(2020) metadata", - "value": "27757" - }, - { - "description": "Jurisdiction Metadata for CDZ_70(2020) id 651968d3-7793-4a40-b2fc-a9b9084523d6", - "key": "651968d3-7793-4a40-b2fc-a9b9084523d6", - "label": "CDZ_70(2020) metadata", - "value": "27758" - }, - { - "description": "Jurisdiction Metadata for CDZ_75(2020) id 6c3634df-7149-4760-ab46-260671174de2", - "key": "6c3634df-7149-4760-ab46-260671174de2", - "label": "CDZ_75(2020) metadata", - "value": "27759" - }, - { - "description": "Jurisdiction Metadata for CDZ_76(2020) id e9469297-75af-4c1f-b2f4-ca30c93e79d8", - "key": "e9469297-75af-4c1f-b2f4-ca30c93e79d8", - "label": "CDZ_76(2020) metadata", - "value": "27760" - }, - { - "description": "Jurisdiction Metadata for CDZ_74(2020) id c0b2c6b8-f75b-4076-b0de-bc05a7e9c112", - "key": "c0b2c6b8-f75b-4076-b0de-bc05a7e9c112", - "label": "CDZ_74(2020) metadata", - "value": "27761" - }, - { - "description": "Jurisdiction Metadata for Miti(2020) id dc8452e4-60b7-4b3e-a31f-6409dfd961e3", - "key": "dc8452e4-60b7-4b3e-a31f-6409dfd961e3", - "label": "Miti(2020) metadata", - "value": "27762" - }, - { - "description": "Jurisdiction Metadata for Kamupandani_NHC id 37e41ade-b662-44c8-bf2f-aedca2c82d29", - "key": "37e41ade-b662-44c8-bf2f-aedca2c82d29", - "label": "Kamupandani_NHC metadata", - "value": "27763" - }, - { - "description": "Jurisdiction Metadata for MTI_112(2020) id f1f14aaa-5bb9-400f-8d2f-6023d21fa882", - "key": "f1f14aaa-5bb9-400f-8d2f-6023d21fa882", - "label": "MTI_112(2020) metadata", - "value": "27764" - }, - { - "description": "Jurisdiction Metadata for MTI_111(2020) id b69efe21-3d6f-4055-b1f0-3ba8b0de6d7b", - "key": "b69efe21-3d6f-4055-b1f0-3ba8b0de6d7b", - "label": "MTI_111(2020) metadata", - "value": "27765" - }, - { - "description": "Jurisdiction Metadata for MTI_16(2020) id 6dedfc44-3683-4849-96fb-9fa0e0c21671", - "key": "6dedfc44-3683-4849-96fb-9fa0e0c21671", - "label": "MTI_16(2020) metadata", - "value": "27766" - }, - { - "description": "Jurisdiction Metadata for MTI_109(2020) id 9dde2aef-cc3e-4bc2-8c0d-58e1a96dcca5", - "key": "9dde2aef-cc3e-4bc2-8c0d-58e1a96dcca5", - "label": "MTI_109(2020) metadata", - "value": "27767" - }, - { - "description": "Jurisdiction Metadata for MTI_12(2020) id b417e9b1-ef86-41d7-915f-cc32b186304e", - "key": "b417e9b1-ef86-41d7-915f-cc32b186304e", - "label": "MTI_12(2020) metadata", - "value": "27768" - }, - { - "description": "Jurisdiction Metadata for MTI_86(2020) id d7a83e3c-6fbd-4fe3-b2b5-627d9d7fccff", - "key": "d7a83e3c-6fbd-4fe3-b2b5-627d9d7fccff", - "label": "MTI_86(2020) metadata", - "value": "27769" - }, - { - "description": "Jurisdiction Metadata for MTI_58(2020) id 7116a5d5-b9d7-4c93-a176-b82a5fb1f209", - "key": "7116a5d5-b9d7-4c93-a176-b82a5fb1f209", - "label": "MTI_58(2020) metadata", - "value": "27770" - }, - { - "description": "Jurisdiction Metadata for MTI_25(2020) id a4d2a97a-cfcc-44b4-a0b4-0e1b3d245b09", - "key": "a4d2a97a-cfcc-44b4-a0b4-0e1b3d245b09", - "label": "MTI_25(2020) metadata", - "value": "27771" - }, - { - "description": "Jurisdiction Metadata for MTI_46(2020) id aef2c881-06cd-4e6e-9bda-468e48d846be", - "key": "aef2c881-06cd-4e6e-9bda-468e48d846be", - "label": "MTI_46(2020) metadata", - "value": "27772" - }, - { - "description": "Jurisdiction Metadata for MTI_20(2020) id 9ca5f4bd-f7dc-45f3-94d9-3cca52347a8f", - "key": "9ca5f4bd-f7dc-45f3-94d9-3cca52347a8f", - "label": "MTI_20(2020) metadata", - "value": "27773" - }, - { - "description": "Jurisdiction Metadata for MTI_14(2020) id c624172d-148b-49f9-aa09-9d77aad8d331", - "key": "c624172d-148b-49f9-aa09-9d77aad8d331", - "label": "MTI_14(2020) metadata", - "value": "27774" - }, - { - "description": "Jurisdiction Metadata for MTI_6(2020) id fcdc33cd-6fe7-4194-9fa6-f90213742caa", - "key": "fcdc33cd-6fe7-4194-9fa6-f90213742caa", - "label": "MTI_6(2020) metadata", - "value": "27775" - }, - { - "description": "Jurisdiction Metadata for MTI_79(2020) id 0a4e75f4-2ba7-460b-b98c-9ff13bc925c2", - "key": "0a4e75f4-2ba7-460b-b98c-9ff13bc925c2", - "label": "MTI_79(2020) metadata", - "value": "27776" - }, - { - "description": "Jurisdiction Metadata for MTI_28(2020) id b3956fd6-8c37-4154-8091-62fbbf56d400", - "key": "b3956fd6-8c37-4154-8091-62fbbf56d400", - "label": "MTI_28(2020) metadata", - "value": "27777" - }, - { - "description": "Jurisdiction Metadata for MTI_64(2020) id cb78a60d-40b0-4a40-bd80-80da6c08915c", - "key": "cb78a60d-40b0-4a40-bd80-80da6c08915c", - "label": "MTI_64(2020) metadata", - "value": "27778" - }, - { - "description": "Jurisdiction Metadata for MTI_68(2020) id 560ea6a1-2a05-4fcb-bc34-848d2b4b9a5c", - "key": "560ea6a1-2a05-4fcb-bc34-848d2b4b9a5c", - "label": "MTI_68(2020) metadata", - "value": "27779" - }, - { - "description": "Jurisdiction Metadata for MTI_62(2020) id 90a66149-660d-46fa-a2cd-c95334a21c9f", - "key": "90a66149-660d-46fa-a2cd-c95334a21c9f", - "label": "MTI_62(2020) metadata", - "value": "27780" - }, - { - "description": "Jurisdiction Metadata for MTI_34(2020) id c836ed39-68af-4f87-8066-698d65e8d236", - "key": "c836ed39-68af-4f87-8066-698d65e8d236", - "label": "MTI_34(2020) metadata", - "value": "27781" - }, - { - "description": "Jurisdiction Metadata for MTI_57(2020) id 4dfefa1d-d9e9-4039-87d5-841e3fcfa71b", - "key": "4dfefa1d-d9e9-4039-87d5-841e3fcfa71b", - "label": "MTI_57(2020) metadata", - "value": "27782" - }, - { - "description": "Jurisdiction Metadata for MTI_91(2020) id 87649f82-0b7b-410d-a192-6132378b0e54", - "key": "87649f82-0b7b-410d-a192-6132378b0e54", - "label": "MTI_91(2020) metadata", - "value": "27783" - }, - { - "description": "Jurisdiction Metadata for MTI_80(2020) id e373df12-7352-4298-af4d-5d4acc792ee4", - "key": "e373df12-7352-4298-af4d-5d4acc792ee4", - "label": "MTI_80(2020) metadata", - "value": "27784" - }, - { - "description": "Jurisdiction Metadata for MTI_100(2020) id 27227c88-a14e-4322-9d82-ef13c98f0f8d", - "key": "27227c88-a14e-4322-9d82-ef13c98f0f8d", - "label": "MTI_100(2020) metadata", - "value": "27785" - }, - { - "description": "Jurisdiction Metadata for MTI_63(2020) id f4e0e380-791a-45be-b7be-05618dedda21", - "key": "f4e0e380-791a-45be-b7be-05618dedda21", - "label": "MTI_63(2020) metadata", - "value": "27786" - }, - { - "description": "Jurisdiction Metadata for MTI_74(2020) id 10818640-6029-4391-9d92-a7f823d4f08b", - "key": "10818640-6029-4391-9d92-a7f823d4f08b", - "label": "MTI_74(2020) metadata", - "value": "27787" - }, - { - "description": "Jurisdiction Metadata for MTI_29(2020) id 78c8c98c-4c2c-444f-9d16-5b40a450b6d3", - "key": "78c8c98c-4c2c-444f-9d16-5b40a450b6d3", - "label": "MTI_29(2020) metadata", - "value": "27788" - }, - { - "description": "Jurisdiction Metadata for MTI_85(2020) id e73ef898-9a0b-4384-a498-03ba4e662ae5", - "key": "e73ef898-9a0b-4384-a498-03ba4e662ae5", - "label": "MTI_85(2020) metadata", - "value": "27789" - }, - { - "description": "Jurisdiction Metadata for MTI_70(2020) id 8b99cf9b-989f-4804-aa3a-aab2a038e638", - "key": "8b99cf9b-989f-4804-aa3a-aab2a038e638", - "label": "MTI_70(2020) metadata", - "value": "27790" - }, - { - "description": "Jurisdiction Metadata for MTI_84(2020) id 5394cfac-cda5-4f9e-9d16-fd10fc43b36f", - "key": "5394cfac-cda5-4f9e-9d16-fd10fc43b36f", - "label": "MTI_84(2020) metadata", - "value": "27791" - }, - { - "description": "Jurisdiction Metadata for MTI_5(2020) id 74acf175-9106-445d-aaa7-b8e16661dfc4", - "key": "74acf175-9106-445d-aaa7-b8e16661dfc4", - "label": "MTI_5(2020) metadata", - "value": "27792" - }, - { - "description": "Jurisdiction Metadata for MTI_113(2020) id 298e0e2a-4cd7-4026-a344-33641f525bc1", - "key": "298e0e2a-4cd7-4026-a344-33641f525bc1", - "label": "MTI_113(2020) metadata", - "value": "27793" - }, - { - "description": "Jurisdiction Metadata for MTI_2(2020) id 1718ee0a-098f-4f72-93b0-11148e8a5b33", - "key": "1718ee0a-098f-4f72-93b0-11148e8a5b33", - "label": "MTI_2(2020) metadata", - "value": "27794" - }, - { - "description": "Jurisdiction Metadata for MTI_73(2020) id bcbcb544-d25d-4d20-9f11-651794a4004c", - "key": "bcbcb544-d25d-4d20-9f11-651794a4004c", - "label": "MTI_73(2020) metadata", - "value": "27795" - }, - { - "description": "Jurisdiction Metadata for MTI_106(2020) id e23f834a-e1ac-4e67-8508-08355fb32cf2", - "key": "e23f834a-e1ac-4e67-8508-08355fb32cf2", - "label": "MTI_106(2020) metadata", - "value": "27796" - }, - { - "description": "Jurisdiction Metadata for MTI_90(2020) id d1be741e-7c7e-494b-80f4-159c5f5d30c2", - "key": "d1be741e-7c7e-494b-80f4-159c5f5d30c2", - "label": "MTI_90(2020) metadata", - "value": "27797" - }, - { - "description": "Jurisdiction Metadata for MTI_10(2020) id 29261053-43d2-4d3d-a97e-6c768d86d440", - "key": "29261053-43d2-4d3d-a97e-6c768d86d440", - "label": "MTI_10(2020) metadata", - "value": "27798" - }, - { - "description": "Jurisdiction Metadata for MTI_123(2020) id f9ebd90f-6de2-46f0-85fe-6f3aaa61f12d", - "key": "f9ebd90f-6de2-46f0-85fe-6f3aaa61f12d", - "label": "MTI_123(2020) metadata", - "value": "27799" - }, - { - "description": "Jurisdiction Metadata for MTI_45(2020) id 034bfb9a-de7a-4ac1-84ce-f6dab99aa979", - "key": "034bfb9a-de7a-4ac1-84ce-f6dab99aa979", - "label": "MTI_45(2020) metadata", - "value": "27800" - }, - { - "description": "Jurisdiction Metadata for MTI_47(2020) id 0d541eb6-c7a3-46df-8c40-c81d707ef4f3", - "key": "0d541eb6-c7a3-46df-8c40-c81d707ef4f3", - "label": "MTI_47(2020) metadata", - "value": "27801" - }, - { - "description": "Jurisdiction Metadata for MTI_126(2020) id 4405751e-9ea3-4e1e-9f5b-7813c7be1b93", - "key": "4405751e-9ea3-4e1e-9f5b-7813c7be1b93", - "label": "MTI_126(2020) metadata", - "value": "27802" - }, - { - "description": "Jurisdiction Metadata for MTI_19(2020) id efecee0c-c674-4faa-996b-45f0fff3341f", - "key": "efecee0c-c674-4faa-996b-45f0fff3341f", - "label": "MTI_19(2020) metadata", - "value": "27803" - }, - { - "description": "Jurisdiction Metadata for MTI_128(2020) id dd884bfa-dbeb-4cab-a7eb-eaf3e499dea3", - "key": "dd884bfa-dbeb-4cab-a7eb-eaf3e499dea3", - "label": "MTI_128(2020) metadata", - "value": "27804" - }, - { - "description": "Jurisdiction Metadata for MTI_105(2020) id 104d5b74-ecd7-4bd6-b927-540af26c41e0", - "key": "104d5b74-ecd7-4bd6-b927-540af26c41e0", - "label": "MTI_105(2020) metadata", - "value": "27805" - }, - { - "description": "Jurisdiction Metadata for MTI_114(2020) id 5d8a796f-bd94-44b4-86e8-e698f2a4528d", - "key": "5d8a796f-bd94-44b4-86e8-e698f2a4528d", - "label": "MTI_114(2020) metadata", - "value": "27806" - }, - { - "description": "Jurisdiction Metadata for MTI_15(2020) id 29888e76-8c83-4a70-9b3c-9b37299635cd", - "key": "29888e76-8c83-4a70-9b3c-9b37299635cd", - "label": "MTI_15(2020) metadata", - "value": "27807" - }, - { - "description": "Jurisdiction Metadata for MTI_97(2020) id e4b7c1bc-82cc-46cc-8959-c3311486ca15", - "key": "e4b7c1bc-82cc-46cc-8959-c3311486ca15", - "label": "MTI_97(2020) metadata", - "value": "27808" - }, - { - "description": "Jurisdiction Metadata for MTI_72(2020) id 565a7c64-b588-467a-a97f-e4b0132dd6b4", - "key": "565a7c64-b588-467a-a97f-e4b0132dd6b4", - "label": "MTI_72(2020) metadata", - "value": "27809" - }, - { - "description": "Jurisdiction Metadata for MTI_101(2020) id 567052d8-1a99-4eae-af98-e38bb0367670", - "key": "567052d8-1a99-4eae-af98-e38bb0367670", - "label": "MTI_101(2020) metadata", - "value": "27810" - }, - { - "description": "Jurisdiction Metadata for MTI_122(2020) id cdf44e58-5fbc-491a-904e-bc9622b95dec", - "key": "cdf44e58-5fbc-491a-904e-bc9622b95dec", - "label": "MTI_122(2020) metadata", - "value": "27811" - }, - { - "description": "Jurisdiction Metadata for MTI_61(2020) id 3d3bae71-4d68-458b-a01d-bdc25615313c", - "key": "3d3bae71-4d68-458b-a01d-bdc25615313c", - "label": "MTI_61(2020) metadata", - "value": "27812" - }, - { - "description": "Jurisdiction Metadata for MTI_44(2020) id a7abb4e7-92c9-45f4-802e-f9aad477e8e8", - "key": "a7abb4e7-92c9-45f4-802e-f9aad477e8e8", - "label": "MTI_44(2020) metadata", - "value": "27813" - }, - { - "description": "Jurisdiction Metadata for MTI_65(2020) id 5552c8c9-586b-445d-8cb9-72c13ebc89ef", - "key": "5552c8c9-586b-445d-8cb9-72c13ebc89ef", - "label": "MTI_65(2020) metadata", - "value": "27814" - }, - { - "description": "Jurisdiction Metadata for MTI_21(2020) id 42255575-6963-4471-8bed-a8d258bbac39", - "key": "42255575-6963-4471-8bed-a8d258bbac39", - "label": "MTI_21(2020) metadata", - "value": "27815" - }, - { - "description": "Jurisdiction Metadata for MTI_32(2020) id 6ca3d981-64ca-41b5-9005-69607e2b119d", - "key": "6ca3d981-64ca-41b5-9005-69607e2b119d", - "label": "MTI_32(2020) metadata", - "value": "27816" - }, - { - "description": "Jurisdiction Metadata for MTI_36(2020) id 1334723b-1662-436a-afd8-c476042447af", - "key": "1334723b-1662-436a-afd8-c476042447af", - "label": "MTI_36(2020) metadata", - "value": "27817" - }, - { - "description": "Jurisdiction Metadata for MTI_30(2020) id d7a72ec5-0b0c-417d-b21c-570031e840e8", - "key": "d7a72ec5-0b0c-417d-b21c-570031e840e8", - "label": "MTI_30(2020) metadata", - "value": "27818" - }, - { - "description": "Jurisdiction Metadata for MTI_56(2020) id 8c81dbd5-d19e-4d24-bd2d-b42a1cf4f821", - "key": "8c81dbd5-d19e-4d24-bd2d-b42a1cf4f821", - "label": "MTI_56(2020) metadata", - "value": "27819" - }, - { - "description": "Jurisdiction Metadata for MTI_9(2020) id a849d099-dace-4a80-a4e7-182081e7f469", - "key": "a849d099-dace-4a80-a4e7-182081e7f469", - "label": "MTI_9(2020) metadata", - "value": "27820" - }, - { - "description": "Jurisdiction Metadata for MTI_55(2020) id d81cfa54-5b8f-4d8c-b6cf-676839eb0ad6", - "key": "d81cfa54-5b8f-4d8c-b6cf-676839eb0ad6", - "label": "MTI_55(2020) metadata", - "value": "27821" - }, - { - "description": "Jurisdiction Metadata for MTI_38(2020) id c022e54d-6545-4a2b-8e35-3099c7be38e3", - "key": "c022e54d-6545-4a2b-8e35-3099c7be38e3", - "label": "MTI_38(2020) metadata", - "value": "27822" - }, - { - "description": "Jurisdiction Metadata for MTI_119(2020) id 0b046a14-26de-4813-a5e1-8460135f829c", - "key": "0b046a14-26de-4813-a5e1-8460135f829c", - "label": "MTI_119(2020) metadata", - "value": "27823" - }, - { - "description": "Jurisdiction Metadata for MTI_33(2020) id f653d2e2-d152-4514-b520-9f40f0dcca36", - "key": "f653d2e2-d152-4514-b520-9f40f0dcca36", - "label": "MTI_33(2020) metadata", - "value": "27824" - }, - { - "description": "Jurisdiction Metadata for MTI_71(2020) id 7bf137b6-db22-40bd-8df1-c6114d1ef2f6", - "key": "7bf137b6-db22-40bd-8df1-c6114d1ef2f6", - "label": "MTI_71(2020) metadata", - "value": "27825" - }, - { - "description": "Jurisdiction Metadata for MTI_7(2020) id eac964e5-1596-498b-908a-7e35c9acf52e", - "key": "eac964e5-1596-498b-908a-7e35c9acf52e", - "label": "MTI_7(2020) metadata", - "value": "27826" - }, - { - "description": "Jurisdiction Metadata for MTI_39(2020) id e31a3409-f037-476d-a4f9-26091c2883ef", - "key": "e31a3409-f037-476d-a4f9-26091c2883ef", - "label": "MTI_39(2020) metadata", - "value": "27827" - }, - { - "description": "Jurisdiction Metadata for MTI_43(2020) id 84ccba87-c7a6-4abe-b81e-7828177a007c", - "key": "84ccba87-c7a6-4abe-b81e-7828177a007c", - "label": "MTI_43(2020) metadata", - "value": "27828" - }, - { - "description": "Jurisdiction Metadata for MTI_18(2020) id b86ff9c7-70a2-41aa-8e0b-589b1e2496aa", - "key": "b86ff9c7-70a2-41aa-8e0b-589b1e2496aa", - "label": "MTI_18(2020) metadata", - "value": "27829" - }, - { - "description": "Jurisdiction Metadata for MTI_37(2020) id c2dae009-06b4-48b3-97de-087b5f06961d", - "key": "c2dae009-06b4-48b3-97de-087b5f06961d", - "label": "MTI_37(2020) metadata", - "value": "27830" - }, - { - "description": "Jurisdiction Metadata for MTI_99(2020) id 494683ae-f7a3-4f37-a83a-edea1ed21aa1", - "key": "494683ae-f7a3-4f37-a83a-edea1ed21aa1", - "label": "MTI_99(2020) metadata", - "value": "27831" - }, - { - "description": "Jurisdiction Metadata for MTI_82(2020) id 2c99cd14-d2b1-45fe-90ea-846b8d3db51f", - "key": "2c99cd14-d2b1-45fe-90ea-846b8d3db51f", - "label": "MTI_82(2020) metadata", - "value": "27832" - }, - { - "description": "Jurisdiction Metadata for MTI_89(2020) id f505f0af-5ef6-4497-86f8-5efcc08063f4", - "key": "f505f0af-5ef6-4497-86f8-5efcc08063f4", - "label": "MTI_89(2020) metadata", - "value": "27833" - }, - { - "description": "Jurisdiction Metadata for MTI_24(2020) id d44fda06-fade-4190-b8a4-b713c660683c", - "key": "d44fda06-fade-4190-b8a4-b713c660683c", - "label": "MTI_24(2020) metadata", - "value": "27834" - }, - { - "description": "Jurisdiction Metadata for MTI_60(2020) id 6b1845df-2e57-4cff-89fd-65005b516d28", - "key": "6b1845df-2e57-4cff-89fd-65005b516d28", - "label": "MTI_60(2020) metadata", - "value": "27835" - }, - { - "description": "Jurisdiction Metadata for MTI_108(2020) id 70799517-d18d-4a3d-9294-81c5b4bf38a9", - "key": "70799517-d18d-4a3d-9294-81c5b4bf38a9", - "label": "MTI_108(2020) metadata", - "value": "27836" - }, - { - "description": "Jurisdiction Metadata for MTI_102(2020) id e68d7cb1-bf31-486f-9406-4f41c968750c", - "key": "e68d7cb1-bf31-486f-9406-4f41c968750c", - "label": "MTI_102(2020) metadata", - "value": "27837" - }, - { - "description": "Jurisdiction Metadata for MTI_59(2020) id 41dbb4ec-e08d-455d-a247-bb70d7baa120", - "key": "41dbb4ec-e08d-455d-a247-bb70d7baa120", - "label": "MTI_59(2020) metadata", - "value": "27838" - }, - { - "description": "Jurisdiction Metadata for MTI_96(2020) id 3b00e171-94df-4def-ad27-fa44031f8b41", - "key": "3b00e171-94df-4def-ad27-fa44031f8b41", - "label": "MTI_96(2020) metadata", - "value": "27839" - }, - { - "description": "Jurisdiction Metadata for MTI_26(2020) id 3c909213-7ef5-41ae-aeb4-2258779e093e", - "key": "3c909213-7ef5-41ae-aeb4-2258779e093e", - "label": "MTI_26(2020) metadata", - "value": "27840" - }, - { - "description": "Jurisdiction Metadata for MTI_81(2020) id 4d57c175-57e7-43b0-b6e9-31035ac40241", - "key": "4d57c175-57e7-43b0-b6e9-31035ac40241", - "label": "MTI_81(2020) metadata", - "value": "27841" - }, - { - "description": "Jurisdiction Metadata for MTI_116(2020) id 2b054371-6bda-4d7e-90fd-10d2df245698", - "key": "2b054371-6bda-4d7e-90fd-10d2df245698", - "label": "MTI_116(2020) metadata", - "value": "27842" - }, - { - "description": "Jurisdiction Metadata for MTI_95(2020) id 1fe4cb00-706c-4a1b-b2ea-11052132f879", - "key": "1fe4cb00-706c-4a1b-b2ea-11052132f879", - "label": "MTI_95(2020) metadata", - "value": "27843" - }, - { - "description": "Jurisdiction Metadata for MTI_54(2020) id 0b8c714f-68a9-4e8d-b5ea-3a06c25d9ca0", - "key": "0b8c714f-68a9-4e8d-b5ea-3a06c25d9ca0", - "label": "MTI_54(2020) metadata", - "value": "27844" - }, - { - "description": "Jurisdiction Metadata for MTI_42(2020) id 5ca5c770-af83-4620-a1c7-af6d7216b64c", - "key": "5ca5c770-af83-4620-a1c7-af6d7216b64c", - "label": "MTI_42(2020) metadata", - "value": "27845" - }, - { - "description": "Jurisdiction Metadata for MTI_52(2020) id 3da8c19c-c349-4f67-803b-fc731f64ab22", - "key": "3da8c19c-c349-4f67-803b-fc731f64ab22", - "label": "MTI_52(2020) metadata", - "value": "27846" - }, - { - "description": "Jurisdiction Metadata for MTI_124(2020) id 6483bc6d-525c-45f6-a098-11dc29905246", - "key": "6483bc6d-525c-45f6-a098-11dc29905246", - "label": "MTI_124(2020) metadata", - "value": "27847" - }, - { - "description": "Jurisdiction Metadata for MTI_127(2020) id 9cd6d56e-9846-4ff2-8dce-791f40d1314e", - "key": "9cd6d56e-9846-4ff2-8dce-791f40d1314e", - "label": "MTI_127(2020) metadata", - "value": "27848" - }, - { - "description": "Jurisdiction Metadata for MTI_48(2020) id 0b815459-7528-46ca-b961-fcaf39593990", - "key": "0b815459-7528-46ca-b961-fcaf39593990", - "label": "MTI_48(2020) metadata", - "value": "27849" - }, - { - "description": "Jurisdiction Metadata for MTI_129(2020) id 00fb39a6-22c8-43f3-9370-62b8b0e734b4", - "key": "00fb39a6-22c8-43f3-9370-62b8b0e734b4", - "label": "MTI_129(2020) metadata", - "value": "27850" - }, - { - "description": "Jurisdiction Metadata for MTI_83(2020) id d172f9ce-fa65-4e83-97ec-2f888ff974de", - "key": "d172f9ce-fa65-4e83-97ec-2f888ff974de", - "label": "MTI_83(2020) metadata", - "value": "27851" - }, - { - "description": "Jurisdiction Metadata for MTI_22(2020) id 0e521aac-8b6d-4174-b1fe-ef07cdec63bd", - "key": "0e521aac-8b6d-4174-b1fe-ef07cdec63bd", - "label": "MTI_22(2020) metadata", - "value": "27852" - }, - { - "description": "Jurisdiction Metadata for MTI_11(2020) id 55bbeba6-089f-4e0e-b174-84dd73cfa720", - "key": "55bbeba6-089f-4e0e-b174-84dd73cfa720", - "label": "MTI_11(2020) metadata", - "value": "27853" - }, - { - "description": "Jurisdiction Metadata for MTI_103(2020) id d8ebece0-e54b-43cf-8214-dc327f625525", - "key": "d8ebece0-e54b-43cf-8214-dc327f625525", - "label": "MTI_103(2020) metadata", - "value": "27854" - }, - { - "description": "Jurisdiction Metadata for MTI_117(2020) id cd3eb687-a899-4a2d-950a-78de269ba661", - "key": "cd3eb687-a899-4a2d-950a-78de269ba661", - "label": "MTI_117(2020) metadata", - "value": "27855" - }, - { - "description": "Jurisdiction Metadata for MTI_69(2020) id a75a46c2-41fd-43dd-ac52-e03f1c71766e", - "key": "a75a46c2-41fd-43dd-ac52-e03f1c71766e", - "label": "MTI_69(2020) metadata", - "value": "27856" - }, - { - "description": "Jurisdiction Metadata for MTI_40(2020) id a74e926b-d1a9-49bb-92ad-aef9b5c46e73", - "key": "a74e926b-d1a9-49bb-92ad-aef9b5c46e73", - "label": "MTI_40(2020) metadata", - "value": "27857" - }, - { - "description": "Jurisdiction Metadata for MTI_75(2020) id ef2c18e6-0f7a-4913-b9ca-d257e02b19de", - "key": "ef2c18e6-0f7a-4913-b9ca-d257e02b19de", - "label": "MTI_75(2020) metadata", - "value": "27858" - }, - { - "description": "Jurisdiction Metadata for MTI_125(2020) id 3de8ed5c-e4fd-4bf8-a293-94f1ba23eb3b", - "key": "3de8ed5c-e4fd-4bf8-a293-94f1ba23eb3b", - "label": "MTI_125(2020) metadata", - "value": "27859" - }, - { - "description": "Jurisdiction Metadata for MTI_50(2020) id c7ac7e0f-84a5-4486-92da-e3b0326cc691", - "key": "c7ac7e0f-84a5-4486-92da-e3b0326cc691", - "label": "MTI_50(2020) metadata", - "value": "27860" - }, - { - "description": "Jurisdiction Metadata for MTI_120(2020) id 7aafdacc-b6c0-40b7-8abe-f2a2fa2db216", - "key": "7aafdacc-b6c0-40b7-8abe-f2a2fa2db216", - "label": "MTI_120(2020) metadata", - "value": "27861" - }, - { - "description": "Jurisdiction Metadata for MTI_98(2020) id 83e1fa29-f89b-4c79-887f-771047757785", - "key": "83e1fa29-f89b-4c79-887f-771047757785", - "label": "MTI_98(2020) metadata", - "value": "27862" - }, - { - "description": "Jurisdiction Metadata for MTI_41(2020) id f4402c30-180b-4059-bd29-f621b372aae6", - "key": "f4402c30-180b-4059-bd29-f621b372aae6", - "label": "MTI_41(2020) metadata", - "value": "27863" - }, - { - "description": "Jurisdiction Metadata for MTI_67(2020) id 80b29083-1b14-4dab-b4d9-7e53eb95fcc9", - "key": "80b29083-1b14-4dab-b4d9-7e53eb95fcc9", - "label": "MTI_67(2020) metadata", - "value": "27864" - }, - { - "description": "Jurisdiction Metadata for MTI_77(2020) id 6c36b6eb-c4b1-4f77-a467-3d65b21fe31a", - "key": "6c36b6eb-c4b1-4f77-a467-3d65b21fe31a", - "label": "MTI_77(2020) metadata", - "value": "27865" - }, - { - "description": "Jurisdiction Metadata for MTI_1(2020) id 2fefe1ef-5bd4-4105-9052-c132e1dcf4c3", - "key": "2fefe1ef-5bd4-4105-9052-c132e1dcf4c3", - "label": "MTI_1(2020) metadata", - "value": "27866" - }, - { - "description": "Jurisdiction Metadata for MTI_8(2020) id de794ec6-23c1-4ae5-b0f3-69fa994bce09", - "key": "de794ec6-23c1-4ae5-b0f3-69fa994bce09", - "label": "MTI_8(2020) metadata", - "value": "27867" - }, - { - "description": "Jurisdiction Metadata for MTI_94(2020) id 62a7a9ab-4275-457c-81b9-9574dc9b42f3", - "key": "62a7a9ab-4275-457c-81b9-9574dc9b42f3", - "label": "MTI_94(2020) metadata", - "value": "27868" - }, - { - "description": "Jurisdiction Metadata for MTI_93(2020) id 8a6ab35d-0431-47ea-a30e-56ae5150c95d", - "key": "8a6ab35d-0431-47ea-a30e-56ae5150c95d", - "label": "MTI_93(2020) metadata", - "value": "27869" - }, - { - "description": "Jurisdiction Metadata for MTI_4(2020) id 664f66a7-da1f-43f3-b9e0-5d290b8218de", - "key": "664f66a7-da1f-43f3-b9e0-5d290b8218de", - "label": "MTI_4(2020) metadata", - "value": "27870" - }, - { - "description": "Jurisdiction Metadata for MTI_87(2020) id 040147e2-1421-4af4-bac6-7114fc984b87", - "key": "040147e2-1421-4af4-bac6-7114fc984b87", - "label": "MTI_87(2020) metadata", - "value": "27871" - }, - { - "description": "Jurisdiction Metadata for MTI_92(2020) id 7161f7fe-d384-4d80-8637-92f906e12322", - "key": "7161f7fe-d384-4d80-8637-92f906e12322", - "label": "MTI_92(2020) metadata", - "value": "27872" - }, - { - "description": "Jurisdiction Metadata for MTI_110(2020) id 2ec687a1-c54b-4c1e-a2d8-4a1f9fe37b18", - "key": "2ec687a1-c54b-4c1e-a2d8-4a1f9fe37b18", - "label": "MTI_110(2020) metadata", - "value": "27873" - }, - { - "description": "Jurisdiction Metadata for MTI_23(2020) id ed2733f0-c796-43d3-95d6-848764cbd039", - "key": "ed2733f0-c796-43d3-95d6-848764cbd039", - "label": "MTI_23(2020) metadata", - "value": "27874" - }, - { - "description": "Jurisdiction Metadata for MTI_107(2020) id 3378de68-f693-464f-9419-9ba46e0b53e2", - "key": "3378de68-f693-464f-9419-9ba46e0b53e2", - "label": "MTI_107(2020) metadata", - "value": "27875" - }, - { - "description": "Jurisdiction Metadata for MTI_78(2020) id 9fab0976-da46-417e-b10e-bd3073dd1cd8", - "key": "9fab0976-da46-417e-b10e-bd3073dd1cd8", - "label": "MTI_78(2020) metadata", - "value": "27876" - }, - { - "description": "Jurisdiction Metadata for MTI_121(2020) id ea698fee-95d7-4ddf-9ba8-7c06d0f8807b", - "key": "ea698fee-95d7-4ddf-9ba8-7c06d0f8807b", - "label": "MTI_121(2020) metadata", - "value": "27877" - }, - { - "description": "Jurisdiction Metadata for MTI_3(2020) id 3107eff6-ba55-49c7-92c6-2bfbc3229885", - "key": "3107eff6-ba55-49c7-92c6-2bfbc3229885", - "label": "MTI_3(2020) metadata", - "value": "27878" - }, - { - "description": "Jurisdiction Metadata for MTI_53(2020) id 5025d85d-fe0b-4645-9da7-e574e9b62929", - "key": "5025d85d-fe0b-4645-9da7-e574e9b62929", - "label": "MTI_53(2020) metadata", - "value": "27879" - }, - { - "description": "Jurisdiction Metadata for MTI_51(2020) id d330e0ec-0b18-4d1a-944b-ba1d58d86218", - "key": "d330e0ec-0b18-4d1a-944b-ba1d58d86218", - "label": "MTI_51(2020) metadata", - "value": "27880" - }, - { - "description": "Jurisdiction Metadata for MTI_115(2020) id a7f1e2fa-15b9-43f3-918f-f3c1bbf2e18b", - "key": "a7f1e2fa-15b9-43f3-918f-f3c1bbf2e18b", - "label": "MTI_115(2020) metadata", - "value": "27881" - }, - { - "description": "Jurisdiction Metadata for MTI_76(2020) id e636ddcb-4fbc-463c-b1b4-0d01c4478fd8", - "key": "e636ddcb-4fbc-463c-b1b4-0d01c4478fd8", - "label": "MTI_76(2020) metadata", - "value": "27882" - }, - { - "description": "Jurisdiction Metadata for MTI_35(2020) id 65d6819b-9931-4d7f-aaa1-35f92af46a9a", - "key": "65d6819b-9931-4d7f-aaa1-35f92af46a9a", - "label": "MTI_35(2020) metadata", - "value": "27883" - }, - { - "description": "Jurisdiction Metadata for MTI_118(2020) id a4593489-542f-42ac-84f7-5ca9f7d15992", - "key": "a4593489-542f-42ac-84f7-5ca9f7d15992", - "label": "MTI_118(2020) metadata", - "value": "27884" - }, - { - "description": "Jurisdiction Metadata for MTI_66(2020) id 98ed95ff-763a-44b1-81a1-4d8fcdc66c5f", - "key": "98ed95ff-763a-44b1-81a1-4d8fcdc66c5f", - "label": "MTI_66(2020) metadata", - "value": "27885" - }, - { - "description": "Jurisdiction Metadata for MTI_17(2020) id 03a9bc82-f282-4ba0-9c60-ae742beed632", - "key": "03a9bc82-f282-4ba0-9c60-ae742beed632", - "label": "MTI_17(2020) metadata", - "value": "27886" - }, - { - "description": "Jurisdiction Metadata for MTI_27(2020) id 9628bf4e-0f26-4874-a2a6-aaae79085de6", - "key": "9628bf4e-0f26-4874-a2a6-aaae79085de6", - "label": "MTI_27(2020) metadata", - "value": "27887" - }, - { - "description": "Jurisdiction Metadata for MTI_88(2020) id 6ac9df7a-f093-4277-af0b-9b8de917c29f", - "key": "6ac9df7a-f093-4277-af0b-9b8de917c29f", - "label": "MTI_88(2020) metadata", - "value": "27888" - }, - { - "description": "Jurisdiction Metadata for MTI_31(2020) id 5194bfdb-68e4-473d-9f71-f206c5bad2b5", - "key": "5194bfdb-68e4-473d-9f71-f206c5bad2b5", - "label": "MTI_31(2020) metadata", - "value": "27889" - }, - { - "description": "Jurisdiction Metadata for MTI_49(2020) id f2a6bac5-b3f6-4efe-9bbc-98f8d0dca9bc", - "key": "f2a6bac5-b3f6-4efe-9bbc-98f8d0dca9bc", - "label": "MTI_49(2020) metadata", - "value": "27890" - }, - { - "description": "Jurisdiction Metadata for MTI_104(2020) id ebd74b15-d247-4106-826c-74db4e5e0afb", - "key": "ebd74b15-d247-4106-826c-74db4e5e0afb", - "label": "MTI_104(2020) metadata", - "value": "27891" - }, - { - "description": "Jurisdiction Metadata for MTI_13(2020) id 3fa8f9d7-4117-4af5-93db-e28de89cacf6", - "key": "3fa8f9d7-4117-4af5-93db-e28de89cacf6", - "label": "MTI_13(2020) metadata", - "value": "27892" - }, - { - "description": "Jurisdiction Metadata for Zingalume(2020) id dddaff26-42a1-4531-86ef-e56aad1692da", - "key": "dddaff26-42a1-4531-86ef-e56aad1692da", - "label": "Zingalume(2020) metadata", - "value": "27893" - }, - { - "description": "Jurisdiction Metadata for Mpima NHC id a4876acd-86d9-48f3-8b10-ae81b8530414", - "key": "a4876acd-86d9-48f3-8b10-ae81b8530414", - "label": "Mpima NHC metadata", - "value": "27894" - }, - { - "description": "Jurisdiction Metadata for ZGL_2(2020) id dd01946d-642b-47ee-b185-ba9fe0ebef1b", - "key": "dd01946d-642b-47ee-b185-ba9fe0ebef1b", - "label": "ZGL_2(2020) metadata", - "value": "27895" - }, - { - "description": "Jurisdiction Metadata for ZGL_5(2020) id 251535db-2637-4b57-a1d3-e96567591a4a", - "key": "251535db-2637-4b57-a1d3-e96567591a4a", - "label": "ZGL_5(2020) metadata", - "value": "27896" - }, - { - "description": "Jurisdiction Metadata for ZGL_1(2020) id 0a3ae56b-fdb0-427a-8760-c8867b2b9a99", - "key": "0a3ae56b-fdb0-427a-8760-c8867b2b9a99", - "label": "ZGL_1(2020) metadata", - "value": "27897" - }, - { - "description": "Jurisdiction Metadata for ZGL_12(2020) id 4e9cfb5e-4932-4d15-8090-73b5e87db7a0", - "key": "4e9cfb5e-4932-4d15-8090-73b5e87db7a0", - "label": "ZGL_12(2020) metadata", - "value": "27898" - }, - { - "description": "Jurisdiction Metadata for ZGL_3(2020) id 6420a35e-3b4c-40f8-83a6-6775d8ed67eb", - "key": "6420a35e-3b4c-40f8-83a6-6775d8ed67eb", - "label": "ZGL_3(2020) metadata", - "value": "27899" - }, - { - "description": "Jurisdiction Metadata for ZGL_18(2020) id 03e802cc-7f90-4a16-9447-04933dcb5c68", - "key": "03e802cc-7f90-4a16-9447-04933dcb5c68", - "label": "ZGL_18(2020) metadata", - "value": "27900" - }, - { - "description": "Jurisdiction Metadata for ZGL_7(2020) id 5527c7db-f23e-466d-a64e-9a7c211c10e8", - "key": "5527c7db-f23e-466d-a64e-9a7c211c10e8", - "label": "ZGL_7(2020) metadata", - "value": "27901" - }, - { - "description": "Jurisdiction Metadata for ZGL_14(2020) id da62b483-f074-407b-be74-3cc30f309a78", - "key": "da62b483-f074-407b-be74-3cc30f309a78", - "label": "ZGL_14(2020) metadata", - "value": "27902" - }, - { - "description": "Jurisdiction Metadata for ZGL_9(2020) id e8547803-8683-4c8b-b669-51cde0b4cbe2", - "key": "e8547803-8683-4c8b-b669-51cde0b4cbe2", - "label": "ZGL_9(2020) metadata", - "value": "27903" - }, - { - "description": "Jurisdiction Metadata for ZGL_19(2020) id 75578211-17d2-446d-a469-96582f75838c", - "key": "75578211-17d2-446d-a469-96582f75838c", - "label": "ZGL_19(2020) metadata", - "value": "27904" - }, - { - "description": "Jurisdiction Metadata for ZGL_8(2020) id 96983624-ef66-4625-96d7-0d4b677e4361", - "key": "96983624-ef66-4625-96d7-0d4b677e4361", - "label": "ZGL_8(2020) metadata", - "value": "27905" - }, - { - "description": "Jurisdiction Metadata for ZGL_17(2020) id be469428-6477-4fd6-bcc4-bac5d2aaff10", - "key": "be469428-6477-4fd6-bcc4-bac5d2aaff10", - "label": "ZGL_17(2020) metadata", - "value": "27906" - }, - { - "description": "Jurisdiction Metadata for ZGL_6(2020) id 81fbb7f7-152b-446a-98dd-c3956b4099fa", - "key": "81fbb7f7-152b-446a-98dd-c3956b4099fa", - "label": "ZGL_6(2020) metadata", - "value": "27907" - }, - { - "description": "Jurisdiction Metadata for ZGL_11(2020) id 78553040-b8a5-4517-ba40-e9103d806d43", - "key": "78553040-b8a5-4517-ba40-e9103d806d43", - "label": "ZGL_11(2020) metadata", - "value": "27908" - }, - { - "description": "Jurisdiction Metadata for ZGL_10(2020) id 0951e31e-1ddb-4514-8ce9-be2698a344c1", - "key": "0951e31e-1ddb-4514-8ce9-be2698a344c1", - "label": "ZGL_10(2020) metadata", - "value": "27909" - }, - { - "description": "Jurisdiction Metadata for ZGL_4(2020) id 5040dfb0-75f9-403c-8f12-f81de1069180", - "key": "5040dfb0-75f9-403c-8f12-f81de1069180", - "label": "ZGL_4(2020) metadata", - "value": "27910" - }, - { - "description": "Jurisdiction Metadata for ZGL_13(2020) id 1031f274-5b7f-4c60-b674-1cc049e2a49b", - "key": "1031f274-5b7f-4c60-b674-1cc049e2a49b", - "label": "ZGL_13(2020) metadata", - "value": "27911" - }, - { - "description": "Jurisdiction Metadata for ZGL_15(2020) id 60fefab4-31fc-40fb-a3f3-ca3a6b4b9466", - "key": "60fefab4-31fc-40fb-a3f3-ca3a6b4b9466", - "label": "ZGL_15(2020) metadata", - "value": "27912" - }, - { - "description": "Jurisdiction Metadata for ZGL_16(2020) id 06d8727d-062c-4dee-81fe-a210f79804a9", - "key": "06d8727d-062c-4dee-81fe-a210f79804a9", - "label": "ZGL_16(2020) metadata", - "value": "27913" - }, - { - "description": "Jurisdiction Metadata for Mkumbuzi(2020) id 7714f567-1050-4d7f-9401-a245d151d6f5", - "key": "7714f567-1050-4d7f-9401-a245d151d6f5", - "label": "Mkumbuzi(2020) metadata", - "value": "27914" - }, - { - "description": "Jurisdiction Metadata for Mukumbuzi_NHC id c0be6085-05af-41db-bcb1-eeaeedb5aae0", - "key": "c0be6085-05af-41db-bcb1-eeaeedb5aae0", - "label": "Mukumbuzi_NHC metadata", - "value": "27915" - }, - { - "description": "Jurisdiction Metadata for MKB_42(2020) id 14b401d4-f29b-4f59-97e4-2b87f2bfad1c", - "key": "14b401d4-f29b-4f59-97e4-2b87f2bfad1c", - "label": "MKB_42(2020) metadata", - "value": "27916" - }, - { - "description": "Jurisdiction Metadata for MKB_50(2020) id 48249673-52e0-4cfc-a1d9-fc9590f56ecf", - "key": "48249673-52e0-4cfc-a1d9-fc9590f56ecf", - "label": "MKB_50(2020) metadata", - "value": "27917" - }, - { - "description": "Jurisdiction Metadata for MKB_51(2020) id 0e58b01b-d682-473e-b5b0-7ab76ed14781", - "key": "0e58b01b-d682-473e-b5b0-7ab76ed14781", - "label": "MKB_51(2020) metadata", - "value": "27918" - }, - { - "description": "Jurisdiction Metadata for MKB_8(2020) id 021edd5a-8534-49f2-9271-baf51d5d4bae", - "key": "021edd5a-8534-49f2-9271-baf51d5d4bae", - "label": "MKB_8(2020) metadata", - "value": "27919" - }, - { - "description": "Jurisdiction Metadata for MKB_30(2020) id 510c7faa-1acb-4672-8845-8f91254502a5", - "key": "510c7faa-1acb-4672-8845-8f91254502a5", - "label": "MKB_30(2020) metadata", - "value": "27920" - }, - { - "description": "Jurisdiction Metadata for MKB_16(2020) id 92315d6b-a17a-4e23-95b5-456e58fc859c", - "key": "92315d6b-a17a-4e23-95b5-456e58fc859c", - "label": "MKB_16(2020) metadata", - "value": "27921" - }, - { - "description": "Jurisdiction Metadata for MKB_31(2020) id c003a560-d212-4d2b-bb5a-a62bdea36fed", - "key": "c003a560-d212-4d2b-bb5a-a62bdea36fed", - "label": "MKB_31(2020) metadata", - "value": "27922" - }, - { - "description": "Jurisdiction Metadata for MKB_2(2020) id 1bf5f0b8-72bb-4d99-9996-c044b1c1304e", - "key": "1bf5f0b8-72bb-4d99-9996-c044b1c1304e", - "label": "MKB_2(2020) metadata", - "value": "27923" - }, - { - "description": "Jurisdiction Metadata for MKB_56(2020) id 25e38597-9595-47b9-8d32-e13d2d336967", - "key": "25e38597-9595-47b9-8d32-e13d2d336967", - "label": "MKB_56(2020) metadata", - "value": "27924" - }, - { - "description": "Jurisdiction Metadata for MKB_47(2020) id 7cf3354a-a8b4-4ffd-bd2a-f0a7c3a685a3", - "key": "7cf3354a-a8b4-4ffd-bd2a-f0a7c3a685a3", - "label": "MKB_47(2020) metadata", - "value": "27925" - }, - { - "description": "Jurisdiction Metadata for MKB_22(2020) id 66bc9463-9a2e-42cb-893e-3651c9075782", - "key": "66bc9463-9a2e-42cb-893e-3651c9075782", - "label": "MKB_22(2020) metadata", - "value": "27926" - }, - { - "description": "Jurisdiction Metadata for MKB_3(2020) id ffd72b4a-a16a-4412-918f-346c9a72e2a3", - "key": "ffd72b4a-a16a-4412-918f-346c9a72e2a3", - "label": "MKB_3(2020) metadata", - "value": "27927" - }, - { - "description": "Jurisdiction Metadata for MKB_27(2020) id df91b37a-e865-407d-9e1b-8697f336ca3e", - "key": "df91b37a-e865-407d-9e1b-8697f336ca3e", - "label": "MKB_27(2020) metadata", - "value": "27928" - }, - { - "description": "Jurisdiction Metadata for MKB_49(2020) id 3be25594-b8b6-4c60-ab8c-c43db8cdc8da", - "key": "3be25594-b8b6-4c60-ab8c-c43db8cdc8da", - "label": "MKB_49(2020) metadata", - "value": "27929" - }, - { - "description": "Jurisdiction Metadata for MKB_1(2020) id cfe71f26-b1bd-4480-91c5-2dcd4c612f35", - "key": "cfe71f26-b1bd-4480-91c5-2dcd4c612f35", - "label": "MKB_1(2020) metadata", - "value": "27930" - }, - { - "description": "Jurisdiction Metadata for MKB_45(2020) id 74e8ac73-a976-4d1a-b7a9-1510baec7107", - "key": "74e8ac73-a976-4d1a-b7a9-1510baec7107", - "label": "MKB_45(2020) metadata", - "value": "27931" - }, - { - "description": "Jurisdiction Metadata for MKB_28(2020) id 639c8ce6-9925-46e8-a4c4-ca090fafa54b", - "key": "639c8ce6-9925-46e8-a4c4-ca090fafa54b", - "label": "MKB_28(2020) metadata", - "value": "27932" - }, - { - "description": "Jurisdiction Metadata for MKB_11(2020) id 820d257a-c837-42cb-aa24-3246e4ff3ef1", - "key": "820d257a-c837-42cb-aa24-3246e4ff3ef1", - "label": "MKB_11(2020) metadata", - "value": "27933" - }, - { - "description": "Jurisdiction Metadata for MKB_55(2020) id b0ad55c0-e1c8-4321-9e12-9634351a3efa", - "key": "b0ad55c0-e1c8-4321-9e12-9634351a3efa", - "label": "MKB_55(2020) metadata", - "value": "27934" - }, - { - "description": "Jurisdiction Metadata for MKB_36(2020) id 6807f3b4-10fb-4e9b-8007-7ca32579c423", - "key": "6807f3b4-10fb-4e9b-8007-7ca32579c423", - "label": "MKB_36(2020) metadata", - "value": "27935" - }, - { - "description": "Jurisdiction Metadata for MKB_53(2020) id 7b66a5f4-7552-469b-9a9b-d401d698f523", - "key": "7b66a5f4-7552-469b-9a9b-d401d698f523", - "label": "MKB_53(2020) metadata", - "value": "27936" - }, - { - "description": "Jurisdiction Metadata for MKB_24(2020) id c9c9315c-983b-4b57-ba31-b5cb958aaa45", - "key": "c9c9315c-983b-4b57-ba31-b5cb958aaa45", - "label": "MKB_24(2020) metadata", - "value": "27937" - }, - { - "description": "Jurisdiction Metadata for MKB_39(2020) id dcd7aa8f-c2bc-4793-8007-388173f74807", - "key": "dcd7aa8f-c2bc-4793-8007-388173f74807", - "label": "MKB_39(2020) metadata", - "value": "27938" - }, - { - "description": "Jurisdiction Metadata for MKB_33(2020) id c1cb546e-a48b-4b5d-b49a-0e3b2f2eb6d5", - "key": "c1cb546e-a48b-4b5d-b49a-0e3b2f2eb6d5", - "label": "MKB_33(2020) metadata", - "value": "27939" - }, - { - "description": "Jurisdiction Metadata for MKB_40(2020) id 1cea670f-ef79-42bf-9dde-1c7a8c82b094", - "key": "1cea670f-ef79-42bf-9dde-1c7a8c82b094", - "label": "MKB_40(2020) metadata", - "value": "27940" - }, - { - "description": "Jurisdiction Metadata for MKB_57(2020) id 2a120001-1592-4a94-9454-8e37937a6159", - "key": "2a120001-1592-4a94-9454-8e37937a6159", - "label": "MKB_57(2020) metadata", - "value": "27941" - }, - { - "description": "Jurisdiction Metadata for MKB_17(2020) id bbdbda81-ae2c-41ca-bfa3-388cc7ff87ee", - "key": "bbdbda81-ae2c-41ca-bfa3-388cc7ff87ee", - "label": "MKB_17(2020) metadata", - "value": "27942" - }, - { - "description": "Jurisdiction Metadata for MKB_18(2020) id 7db4d43d-7a33-484c-abd1-f49929bc40f4", - "key": "7db4d43d-7a33-484c-abd1-f49929bc40f4", - "label": "MKB_18(2020) metadata", - "value": "27943" - }, - { - "description": "Jurisdiction Metadata for MKB_25(2020) id 3fb5dd04-6b71-46c6-b340-d33dc05d512c", - "key": "3fb5dd04-6b71-46c6-b340-d33dc05d512c", - "label": "MKB_25(2020) metadata", - "value": "27944" - }, - { - "description": "Jurisdiction Metadata for MKB_20(2020) id 05243590-f2b0-47ea-8b51-e4558a861c0b", - "key": "05243590-f2b0-47ea-8b51-e4558a861c0b", - "label": "MKB_20(2020) metadata", - "value": "27945" - }, - { - "description": "Jurisdiction Metadata for MKB_34(2020) id 858a74bb-16cb-4a2c-88ba-61c7a3f1f047", - "key": "858a74bb-16cb-4a2c-88ba-61c7a3f1f047", - "label": "MKB_34(2020) metadata", - "value": "27946" - }, - { - "description": "Jurisdiction Metadata for MKB_7(2020) id c3db8f82-da83-4ef6-9423-20e9673629ba", - "key": "c3db8f82-da83-4ef6-9423-20e9673629ba", - "label": "MKB_7(2020) metadata", - "value": "27947" - }, - { - "description": "Jurisdiction Metadata for MKB_44(2020) id 29a09db8-6b1f-4e4d-ad46-e9a4ac2a7303", - "key": "29a09db8-6b1f-4e4d-ad46-e9a4ac2a7303", - "label": "MKB_44(2020) metadata", - "value": "27948" - }, - { - "description": "Jurisdiction Metadata for MKB_21(2020) id 32e7ff3e-ef14-4ed0-9b68-5877da138243", - "key": "32e7ff3e-ef14-4ed0-9b68-5877da138243", - "label": "MKB_21(2020) metadata", - "value": "27949" - }, - { - "description": "Jurisdiction Metadata for MKB_14(2020) id ca04ba5d-a099-447c-819b-b334963a8591", - "key": "ca04ba5d-a099-447c-819b-b334963a8591", - "label": "MKB_14(2020) metadata", - "value": "27950" - }, - { - "description": "Jurisdiction Metadata for MKB_54(2020) id 90add713-b385-4654-880b-3419ed1908aa", - "key": "90add713-b385-4654-880b-3419ed1908aa", - "label": "MKB_54(2020) metadata", - "value": "27951" - }, - { - "description": "Jurisdiction Metadata for MKB_41(2020) id bc7e2ef6-615c-43bc-afd6-9e11886cc32c", - "key": "bc7e2ef6-615c-43bc-afd6-9e11886cc32c", - "label": "MKB_41(2020) metadata", - "value": "27952" - }, - { - "description": "Jurisdiction Metadata for MKB_43(2020) id 8984b873-04f6-4e19-b4a8-6560b62ee492", - "key": "8984b873-04f6-4e19-b4a8-6560b62ee492", - "label": "MKB_43(2020) metadata", - "value": "27953" - }, - { - "description": "Jurisdiction Metadata for MKB_5(2020) id 9e7e80f6-38f8-40ab-aa70-9c923b15bafb", - "key": "9e7e80f6-38f8-40ab-aa70-9c923b15bafb", - "label": "MKB_5(2020) metadata", - "value": "27954" - }, - { - "description": "Jurisdiction Metadata for MKB_37(2020) id e890e2fd-7142-4dc0-9562-a41bedacb647", - "key": "e890e2fd-7142-4dc0-9562-a41bedacb647", - "label": "MKB_37(2020) metadata", - "value": "27955" - }, - { - "description": "Jurisdiction Metadata for MKB_15(2020) id 1795e47a-aa8a-48cf-bece-68eaf13f5ce7", - "key": "1795e47a-aa8a-48cf-bece-68eaf13f5ce7", - "label": "MKB_15(2020) metadata", - "value": "27956" - }, - { - "description": "Jurisdiction Metadata for MKB_48(2020) id 451ffa94-f845-4bdd-8a17-9187811fff8b", - "key": "451ffa94-f845-4bdd-8a17-9187811fff8b", - "label": "MKB_48(2020) metadata", - "value": "27957" - }, - { - "description": "Jurisdiction Metadata for MKB_32(2020) id aa908b39-2b5a-433a-9554-6bd1ca699664", - "key": "aa908b39-2b5a-433a-9554-6bd1ca699664", - "label": "MKB_32(2020) metadata", - "value": "27958" - }, - { - "description": "Jurisdiction Metadata for MKB_52(2020) id b743f1f1-1ed8-4072-a6c4-26f8b24ed011", - "key": "b743f1f1-1ed8-4072-a6c4-26f8b24ed011", - "label": "MKB_52(2020) metadata", - "value": "27959" - }, - { - "description": "Jurisdiction Metadata for MKB_19(2020) id 0b20c04e-6759-46a3-b3e7-c352461eaa10", - "key": "0b20c04e-6759-46a3-b3e7-c352461eaa10", - "label": "MKB_19(2020) metadata", - "value": "27960" - }, - { - "description": "Jurisdiction Metadata for MKB_13(2020) id 7ef180da-fe57-4f92-a1c2-b345e75d71e9", - "key": "7ef180da-fe57-4f92-a1c2-b345e75d71e9", - "label": "MKB_13(2020) metadata", - "value": "27961" - }, - { - "description": "Jurisdiction Metadata for MKB_46(2020) id 8f9f053f-b0b1-4d65-9c3f-25e9fedd7e4d", - "key": "8f9f053f-b0b1-4d65-9c3f-25e9fedd7e4d", - "label": "MKB_46(2020) metadata", - "value": "27962" - }, - { - "description": "Jurisdiction Metadata for MKB_29(2020) id 83a8c716-a1ec-4b82-ad08-1a10d1c26944", - "key": "83a8c716-a1ec-4b82-ad08-1a10d1c26944", - "label": "MKB_29(2020) metadata", - "value": "27963" - }, - { - "description": "Jurisdiction Metadata for MKB_26(2020) id 64aa44f2-e734-4bf0-921f-0896907548a9", - "key": "64aa44f2-e734-4bf0-921f-0896907548a9", - "label": "MKB_26(2020) metadata", - "value": "27964" - }, - { - "description": "Jurisdiction Metadata for MKB_9(2020) id 3bb5c8ca-5b34-4845-af99-796dc2828599", - "key": "3bb5c8ca-5b34-4845-af99-796dc2828599", - "label": "MKB_9(2020) metadata", - "value": "27965" - }, - { - "description": "Jurisdiction Metadata for MKB_38(2020) id d17e34e2-d586-4027-ac00-3157eb9eea09", - "key": "d17e34e2-d586-4027-ac00-3157eb9eea09", - "label": "MKB_38(2020) metadata", - "value": "27966" - }, - { - "description": "Jurisdiction Metadata for MKB_6(2020) id 6a4029f4-b09f-418c-86e3-505f86a3e180", - "key": "6a4029f4-b09f-418c-86e3-505f86a3e180", - "label": "MKB_6(2020) metadata", - "value": "27967" - }, - { - "description": "Jurisdiction Metadata for MKB_10(2020) id 9b9d4b7b-f4d4-4e3b-b04e-47a1d9fc9d38", - "key": "9b9d4b7b-f4d4-4e3b-b04e-47a1d9fc9d38", - "label": "MKB_10(2020) metadata", - "value": "27968" - }, - { - "description": "Jurisdiction Metadata for MKB_35(2020) id 02c2c854-a9c9-4277-96be-db4459decb2a", - "key": "02c2c854-a9c9-4277-96be-db4459decb2a", - "label": "MKB_35(2020) metadata", - "value": "27969" - }, - { - "description": "Jurisdiction Metadata for MKB_12(2020) id 7b2b61dd-0629-451b-92c8-14b998004cb2", - "key": "7b2b61dd-0629-451b-92c8-14b998004cb2", - "label": "MKB_12(2020) metadata", - "value": "27970" - }, - { - "description": "Jurisdiction Metadata for MKB_23(2020) id 98deb1c2-68be-4626-b2b9-17ce638c569b", - "key": "98deb1c2-68be-4626-b2b9-17ce638c569b", - "label": "MKB_23(2020) metadata", - "value": "27971" - }, - { - "description": "Jurisdiction Metadata for MKB_4(2020) id d6a210e1-933e-4cc8-ad72-9f6f7fc0971d", - "key": "d6a210e1-933e-4cc8-ad72-9f6f7fc0971d", - "label": "MKB_4(2020) metadata", - "value": "27972" - } - ], - "teamId": "", - "type": "SettingConfiguration" +{ + "identifier": "jurisdiction_metadata-population", + "locationId": "", + "providerId": "onatest", + "settings": [ + { + "description": "Jurisdiction Metadata for Zambia(vl 2020) id ecfbf048-fb7a-47d8-a12b-61bf5d2a6e7b", + "key": "ecfbf048-fb7a-47d8-a12b-61bf5d2a6e7b", + "label": "Zambia(vl 2020) metadata", + "value": "" + }, + { + "description": "Jurisdiction Metadata for Zambia(vl 2020) id ecfbf048-fb7a-47d8-a12b-61bf5d2a6e7b", + "key": "ecfbf048-fb7a-47d8-a12b-61bf5d2a6e7b", + "label": "Zambia(vl 2020) metadata", + "value": "" + }, + { + "description": "Jurisdiction Metadata for Zambia(vl 2020) id ecfbf048-fb7a-47d8-a12b-61bf5d2a6e7b", + "key": "ecfbf048-fb7a-47d8-a12b-61bf5d2a6e7b", + "label": "Zambia(vl 2020) metadata", + "value": "" + }, + { + "description": "Jurisdiction Metadata for Luapula Province (2020) id b4d25f09-1365-41aa-ac37-f5768d9075bf", + "key": "b4d25f09-1365-41aa-ac37-f5768d9075bf", + "label": "Luapula Province (2020) metadata", + "value": "25001" + }, + { + "description": "Jurisdiction Metadata for Nchelenge District (2020) id 7d1297d2-a7e7-4896-a391-31d14cab9d32", + "key": "7d1297d2-a7e7-4896-a391-31d14cab9d32", + "label": "Nchelenge District (2020) metadata", + "value": "25002" + }, + { + "description": "Jurisdiction Metadata for Chisenga(2020) id 3c518249-2441-4e02-bf76-1f9de9498e76", + "key": "3c518249-2441-4e02-bf76-1f9de9498e76", + "label": "Chisenga(2020) metadata", + "value": "25003" + }, + { + "description": "Jurisdiction Metadata for Chisenga Zone id d6dffe1f-a02a-429b-b10a-ffc9a9c822c3", + "key": "d6dffe1f-a02a-429b-b10a-ffc9a9c822c3", + "label": "Chisenga Zone metadata", + "value": "25004" + }, + { + "description": "Jurisdiction Metadata for chs_1(2020) id 7d1ae3ba-9b65-49d9-b5a9-67ad6c0ee8a5", + "key": "7d1ae3ba-9b65-49d9-b5a9-67ad6c0ee8a5", + "label": "chs_1(2020) metadata", + "value": "25005" + }, + { + "description": "Jurisdiction Metadata for Chipashi Zone id a53f8368-cfc1-4d7b-bf7e-28edc8571497", + "key": "a53f8368-cfc1-4d7b-bf7e-28edc8571497", + "label": "Chipashi Zone metadata", + "value": "25006" + }, + { + "description": "Jurisdiction Metadata for chs_20(2020) id f5d61a2e-5478-49f9-8fb1-5e7ac9e5c1c1", + "key": "f5d61a2e-5478-49f9-8fb1-5e7ac9e5c1c1", + "label": "chs_20(2020) metadata", + "value": "" + }, + { + "description": "Jurisdiction Metadata for chs_14(2020) id 385cb609-4611-4a7a-8572-9a77320dd612", + "key": "385cb609-4611-4a7a-8572-9a77320dd612", + "label": "chs_14(2020) metadata", + "value": "" + }, + { + "description": "Jurisdiction Metadata for chs_4(2020) id e6e0c27f-7113-4405-a955-f29548cea166", + "key": "e6e0c27f-7113-4405-a955-f29548cea166", + "label": "chs_4(2020) metadata", + "value": "" + }, + { + "description": "Jurisdiction Metadata for chs_9(2020) id 6f34a217-0445-4d49-8dc6-a02f7b0d175f", + "key": "6f34a217-0445-4d49-8dc6-a02f7b0d175f", + "label": "chs_9(2020) metadata", + "value": "" + }, + { + "description": "Jurisdiction Metadata for chs_5(2020) id c8861921-2439-46f7-bed1-e814784c45e4", + "key": "c8861921-2439-46f7-bed1-e814784c45e4", + "label": "chs_5(2020) metadata", + "value": "" + }, + { + "description": "Jurisdiction Metadata for Chawelwa Zone id d109fa56-7097-49d5-9850-fb03df325e0e", + "key": "d109fa56-7097-49d5-9850-fb03df325e0e", + "label": "Chawelwa Zone metadata", + "value": "25012" + }, + { + "description": "Jurisdiction Metadata for chs_6(2020) id 52e0b58d-b746-4903-ba49-e090b5b6987d", + "key": "52e0b58d-b746-4903-ba49-e090b5b6987d", + "label": "chs_6(2020) metadata", + "value": "25013" + }, + { + "description": "Jurisdiction Metadata for chs_2(2020) id 60f1dede-617a-4ddb-85d9-82e936c6466c", + "key": "60f1dede-617a-4ddb-85d9-82e936c6466c", + "label": "chs_2(2020) metadata", + "value": "25014" + }, + { + "description": "Jurisdiction Metadata for chs_16(2020) id c8bfa81b-fc77-42f4-8ace-7f5a34d33ade", + "key": "c8bfa81b-fc77-42f4-8ace-7f5a34d33ade", + "label": "chs_16(2020) metadata", + "value": "25015" + }, + { + "description": "Jurisdiction Metadata for chs_18(2020) id 3294b520-c390-4011-a5c1-1e62a67fdbe4", + "key": "3294b520-c390-4011-a5c1-1e62a67fdbe4", + "label": "chs_18(2020) metadata", + "value": "25016" + }, + { + "description": "Jurisdiction Metadata for Kamonga Zone id 9af0268b-d8e5-48e7-84a0-a94984a62c07", + "key": "9af0268b-d8e5-48e7-84a0-a94984a62c07", + "label": "Kamonga Zone metadata", + "value": "25017" + }, + { + "description": "Jurisdiction Metadata for chs_19(2020) id 7c047096-dd51-424b-8665-bd3d03f16736", + "key": "7c047096-dd51-424b-8665-bd3d03f16736", + "label": "chs_19(2020) metadata", + "value": "25018" + }, + { + "description": "Jurisdiction Metadata for chs_13(2020) id 94791c4e-0343-440b-b744-6fd708ce6b16", + "key": "94791c4e-0343-440b-b744-6fd708ce6b16", + "label": "chs_13(2020) metadata", + "value": "25019" + }, + { + "description": "Jurisdiction Metadata for chs_15(2020) id 892242a7-ddb1-4715-b54f-97c5e25b59b4", + "key": "892242a7-ddb1-4715-b54f-97c5e25b59b4", + "label": "chs_15(2020) metadata", + "value": "25020" + }, + { + "description": "Jurisdiction Metadata for chs_8(2020) id f61a7584-df47-4f5e-a034-eec8978ba8a7", + "key": "f61a7584-df47-4f5e-a034-eec8978ba8a7", + "label": "chs_8(2020) metadata", + "value": "25021" + }, + { + "description": "Jurisdiction Metadata for chs_3(2020) id 006ee86f-9fd0-4b4a-a203-f493676dc7a9", + "key": "006ee86f-9fd0-4b4a-a203-f493676dc7a9", + "label": "chs_3(2020) metadata", + "value": "25022" + }, + { + "description": "Jurisdiction Metadata for Kashengeneke Zone id 8e3c031e-abba-4205-97da-afe1f5861ea6", + "key": "8e3c031e-abba-4205-97da-afe1f5861ea6", + "label": "Kashengeneke Zone metadata", + "value": "25023" + }, + { + "description": "Jurisdiction Metadata for chs_10(2020) id 674dfd54-f94d-4e62-b4e2-c7c2bf1b5783", + "key": "674dfd54-f94d-4e62-b4e2-c7c2bf1b5783", + "label": "chs_10(2020) metadata", + "value": "25024" + }, + { + "description": "Jurisdiction Metadata for chs_11(2020) id 488ab72d-0db0-45df-9e27-deed715f094e", + "key": "488ab72d-0db0-45df-9e27-deed715f094e", + "label": "chs_11(2020) metadata", + "value": "25025" + }, + { + "description": "Jurisdiction Metadata for chs_17(2020) id d4ea6140-6485-45bc-9604-0e5c4799ed90", + "key": "d4ea6140-6485-45bc-9604-0e5c4799ed90", + "label": "chs_17(2020) metadata", + "value": "25026" + }, + { + "description": "Jurisdiction Metadata for chs_12(2020) id f445755c-b867-4a75-9239-9c1663302645", + "key": "f445755c-b867-4a75-9239-9c1663302645", + "label": "chs_12(2020) metadata", + "value": "25027" + }, + { + "description": "Jurisdiction Metadata for chs_7(2020) id 1863230d-8e53-4ee4-8259-8df54bc30bf5", + "key": "1863230d-8e53-4ee4-8259-8df54bc30bf5", + "label": "chs_7(2020) metadata", + "value": "25028" + }, + { + "description": "Jurisdiction Metadata for Kafutuma(2020) id 8ca6a58f-78b7-4782-ada3-eca56caa63ae", + "key": "8ca6a58f-78b7-4782-ada3-eca56caa63ae", + "label": "Kafutuma(2020) metadata", + "value": "25029" + }, + { + "description": "Jurisdiction Metadata for Kalweo Zone id 2172b0f5-edae-443f-a9d2-29d5fb072b9a", + "key": "2172b0f5-edae-443f-a9d2-29d5fb072b9a", + "label": "Kalweo Zone metadata", + "value": "25030" + }, + { + "description": "Jurisdiction Metadata for kft_328(2020) id 3cf59804-5079-4854-869a-66d250397a18", + "key": "3cf59804-5079-4854-869a-66d250397a18", + "label": "kft_328(2020) metadata", + "value": "25031" + }, + { + "description": "Jurisdiction Metadata for kft_30(2020) id 8662bc0f-a1f7-46f4-887c-5088ca18b6e6", + "key": "8662bc0f-a1f7-46f4-887c-5088ca18b6e6", + "label": "kft_30(2020) metadata", + "value": "25032" + }, + { + "description": "Jurisdiction Metadata for kft_278(2020) id e144df9e-6316-4e94-9539-36c489e45f80", + "key": "e144df9e-6316-4e94-9539-36c489e45f80", + "label": "kft_278(2020) metadata", + "value": "25033" + }, + { + "description": "Jurisdiction Metadata for kft_237(2020) id 6c1c0237-9dc1-40e9-a485-47891ea6c5c7", + "key": "6c1c0237-9dc1-40e9-a485-47891ea6c5c7", + "label": "kft_237(2020) metadata", + "value": "25034" + }, + { + "description": "Jurisdiction Metadata for kft_23(2020) id a35dba6f-fbea-428b-bd74-82739de07546", + "key": "a35dba6f-fbea-428b-bd74-82739de07546", + "label": "kft_23(2020) metadata", + "value": "25035" + }, + { + "description": "Jurisdiction Metadata for kft_91(2020) id 310ddebb-99bd-43fd-92bc-cb89f62971b0", + "key": "310ddebb-99bd-43fd-92bc-cb89f62971b0", + "label": "kft_91(2020) metadata", + "value": "25036" + }, + { + "description": "Jurisdiction Metadata for kft_283(2020) id 47c85d02-b849-4e47-8407-dd2e6e8670a6", + "key": "47c85d02-b849-4e47-8407-dd2e6e8670a6", + "label": "kft_283(2020) metadata", + "value": "25037" + }, + { + "description": "Jurisdiction Metadata for kft_189(2020) id 875d19ef-4f3e-4434-930c-06786ea7d389", + "key": "875d19ef-4f3e-4434-930c-06786ea7d389", + "label": "kft_189(2020) metadata", + "value": "25038" + }, + { + "description": "Jurisdiction Metadata for kft_241(2020) id 2108a527-d4b3-42e6-a59e-8561e959d544", + "key": "2108a527-d4b3-42e6-a59e-8561e959d544", + "label": "kft_241(2020) metadata", + "value": "25039" + }, + { + "description": "Jurisdiction Metadata for kft_235(2020) id 913e65a8-dba7-4485-93c0-aa35292614b7", + "key": "913e65a8-dba7-4485-93c0-aa35292614b7", + "label": "kft_235(2020) metadata", + "value": "25040" + }, + { + "description": "Jurisdiction Metadata for kft_95(2020) id 674bea32-c4e1-417c-863a-f2bc35735561", + "key": "674bea32-c4e1-417c-863a-f2bc35735561", + "label": "kft_95(2020) metadata", + "value": "25041" + }, + { + "description": "Jurisdiction Metadata for kft_273(2020) id 945b1b81-0537-4f66-b656-381a1582d110", + "key": "945b1b81-0537-4f66-b656-381a1582d110", + "label": "kft_273(2020) metadata", + "value": "25042" + }, + { + "description": "Jurisdiction Metadata for kft_128(2020) id b0d225a6-fc7d-45ea-aced-daf75a81d08d", + "key": "b0d225a6-fc7d-45ea-aced-daf75a81d08d", + "label": "kft_128(2020) metadata", + "value": "25043" + }, + { + "description": "Jurisdiction Metadata for kft_299(2020) id 75702d24-d66c-45ef-8606-bca353ccc400", + "key": "75702d24-d66c-45ef-8606-bca353ccc400", + "label": "kft_299(2020) metadata", + "value": "25044" + }, + { + "description": "Jurisdiction Metadata for kft_274(2020) id 806191cf-c8ed-42f5-8e17-f5cf54a4057e", + "key": "806191cf-c8ed-42f5-8e17-f5cf54a4057e", + "label": "kft_274(2020) metadata", + "value": "25045" + }, + { + "description": "Jurisdiction Metadata for kft_140(2020) id 49241892-0df0-4dea-8952-6ca784497adf", + "key": "49241892-0df0-4dea-8952-6ca784497adf", + "label": "kft_140(2020) metadata", + "value": "25046" + }, + { + "description": "Jurisdiction Metadata for kft_323(2020) id 560a0fd8-bb2d-4463-a643-cda0ec84e2f4", + "key": "560a0fd8-bb2d-4463-a643-cda0ec84e2f4", + "label": "kft_323(2020) metadata", + "value": "25047" + }, + { + "description": "Jurisdiction Metadata for kft_96(2020) id 82310f84-929e-4151-8c9c-3dc724890071", + "key": "82310f84-929e-4151-8c9c-3dc724890071", + "label": "kft_96(2020) metadata", + "value": "25048" + }, + { + "description": "Jurisdiction Metadata for kft_271(2020) id 416f9b2a-5bf2-4549-883d-f5e11b079678", + "key": "416f9b2a-5bf2-4549-883d-f5e11b079678", + "label": "kft_271(2020) metadata", + "value": "25049" + }, + { + "description": "Jurisdiction Metadata for kft_173(2020) id 2e33ec2e-4a66-4572-a156-67c974e325ce", + "key": "2e33ec2e-4a66-4572-a156-67c974e325ce", + "label": "kft_173(2020) metadata", + "value": "25050" + }, + { + "description": "Jurisdiction Metadata for kft_9(2020) id 763d4954-1776-4708-92e4-6c68d6cc0845", + "key": "763d4954-1776-4708-92e4-6c68d6cc0845", + "label": "kft_9(2020) metadata", + "value": "25051" + }, + { + "description": "Jurisdiction Metadata for kft_143(2020) id 150fa319-8b5f-4c4a-8b9a-d64adfe9a8af", + "key": "150fa319-8b5f-4c4a-8b9a-d64adfe9a8af", + "label": "kft_143(2020) metadata", + "value": "25052" + }, + { + "description": "Jurisdiction Metadata for kft_236(2020) id f927185b-2ef0-4bcc-a231-8f3e8633fbf4", + "key": "f927185b-2ef0-4bcc-a231-8f3e8633fbf4", + "label": "kft_236(2020) metadata", + "value": "25053" + }, + { + "description": "Jurisdiction Metadata for kft_135(2020) id 2eb84450-f917-4209-834f-9a7f1f858e0a", + "key": "2eb84450-f917-4209-834f-9a7f1f858e0a", + "label": "kft_135(2020) metadata", + "value": "25054" + }, + { + "description": "Jurisdiction Metadata for kft_102(2020) id 8b0695c0-f9ed-435c-b0d0-ed15f43620b5", + "key": "8b0695c0-f9ed-435c-b0d0-ed15f43620b5", + "label": "kft_102(2020) metadata", + "value": "25055" + }, + { + "description": "Jurisdiction Metadata for kft_53(2020) id cfb7435f-d2df-44e1-8f55-f053ff3c75eb", + "key": "cfb7435f-d2df-44e1-8f55-f053ff3c75eb", + "label": "kft_53(2020) metadata", + "value": "25056" + }, + { + "description": "Jurisdiction Metadata for kft_155(2020) id d1c0749f-67bb-4ce7-b98d-a0cf42af64ba", + "key": "d1c0749f-67bb-4ce7-b98d-a0cf42af64ba", + "label": "kft_155(2020) metadata", + "value": "25057" + }, + { + "description": "Jurisdiction Metadata for kft_131(2020) id 876c1db4-147f-4348-b09e-6b626e25a500", + "key": "876c1db4-147f-4348-b09e-6b626e25a500", + "label": "kft_131(2020) metadata", + "value": "25058" + }, + { + "description": "Jurisdiction Metadata for kft_62(2020) id 9de18a7c-0536-4983-b915-c8e2bcb854e3", + "key": "9de18a7c-0536-4983-b915-c8e2bcb854e3", + "label": "kft_62(2020) metadata", + "value": "25059" + }, + { + "description": "Jurisdiction Metadata for kft_37(2020) id 7c5ebce7-32e2-4cbd-8d79-2f315886fd00", + "key": "7c5ebce7-32e2-4cbd-8d79-2f315886fd00", + "label": "kft_37(2020) metadata", + "value": "25060" + }, + { + "description": "Jurisdiction Metadata for kft_243(2020) id 79d5be71-7411-4b15-add1-14e7213145e0", + "key": "79d5be71-7411-4b15-add1-14e7213145e0", + "label": "kft_243(2020) metadata", + "value": "25061" + }, + { + "description": "Jurisdiction Metadata for kft_73(2020) id eec2a385-71b7-4b73-af1c-f7ee58049764", + "key": "eec2a385-71b7-4b73-af1c-f7ee58049764", + "label": "kft_73(2020) metadata", + "value": "25062" + }, + { + "description": "Jurisdiction Metadata for kft_36(2020) id 5ee9ca16-2026-41c6-8244-feac4ed78d70", + "key": "5ee9ca16-2026-41c6-8244-feac4ed78d70", + "label": "kft_36(2020) metadata", + "value": "25063" + }, + { + "description": "Jurisdiction Metadata for kft_10(2020) id 22287d93-b811-4be2-8ddf-7085af37c623", + "key": "22287d93-b811-4be2-8ddf-7085af37c623", + "label": "kft_10(2020) metadata", + "value": "25064" + }, + { + "description": "Jurisdiction Metadata for kft_153(2020) id b1740aa7-4586-45bc-9055-43cc8bbabc02", + "key": "b1740aa7-4586-45bc-9055-43cc8bbabc02", + "label": "kft_153(2020) metadata", + "value": "25065" + }, + { + "description": "Jurisdiction Metadata for kft_148(2020) id 7c0a2bea-2ca3-485b-a4e6-081ef3788f9a", + "key": "7c0a2bea-2ca3-485b-a4e6-081ef3788f9a", + "label": "kft_148(2020) metadata", + "value": "25066" + }, + { + "description": "Jurisdiction Metadata for kft_166(2020) id 3c952b12-c571-40e6-acad-325ed635fd72", + "key": "3c952b12-c571-40e6-acad-325ed635fd72", + "label": "kft_166(2020) metadata", + "value": "25067" + }, + { + "description": "Jurisdiction Metadata for kft_233(2020) id 6a61b9da-4f79-4c9c-ad57-629ceba3daac", + "key": "6a61b9da-4f79-4c9c-ad57-629ceba3daac", + "label": "kft_233(2020) metadata", + "value": "25068" + }, + { + "description": "Jurisdiction Metadata for kft_19(2020) id 5e5a8bdd-c8a7-4f11-a7b2-32c8a045864f", + "key": "5e5a8bdd-c8a7-4f11-a7b2-32c8a045864f", + "label": "kft_19(2020) metadata", + "value": "25069" + }, + { + "description": "Jurisdiction Metadata for kft_277(2020) id bde21d4a-cb5c-40b9-8d61-3fea85a79f23", + "key": "bde21d4a-cb5c-40b9-8d61-3fea85a79f23", + "label": "kft_277(2020) metadata", + "value": "25070" + }, + { + "description": "Jurisdiction Metadata for kft_203(2020) id 40d0851d-31b4-4a92-befe-ceb1e39eb50f", + "key": "40d0851d-31b4-4a92-befe-ceb1e39eb50f", + "label": "kft_203(2020) metadata", + "value": "25071" + }, + { + "description": "Jurisdiction Metadata for kft_101(2020) id 6b316a94-0ae1-427a-ab65-974499b387ea", + "key": "6b316a94-0ae1-427a-ab65-974499b387ea", + "label": "kft_101(2020) metadata", + "value": "25072" + }, + { + "description": "Jurisdiction Metadata for kft_264(2020) id b79814e8-7c82-4ead-8f43-d56f8114ab19", + "key": "b79814e8-7c82-4ead-8f43-d56f8114ab19", + "label": "kft_264(2020) metadata", + "value": "25073" + }, + { + "description": "Jurisdiction Metadata for kft_35(2020) id 301e42e3-7a8d-4be8-af05-f86b905bb414", + "key": "301e42e3-7a8d-4be8-af05-f86b905bb414", + "label": "kft_35(2020) metadata", + "value": "25074" + }, + { + "description": "Jurisdiction Metadata for kft_72(2020) id 754e39cb-27c2-478f-882e-dfd9fb38fe49", + "key": "754e39cb-27c2-478f-882e-dfd9fb38fe49", + "label": "kft_72(2020) metadata", + "value": "25075" + }, + { + "description": "Jurisdiction Metadata for kft_142(2020) id 88e93622-8b4c-43bc-9461-0c4cda07c16b", + "key": "88e93622-8b4c-43bc-9461-0c4cda07c16b", + "label": "kft_142(2020) metadata", + "value": "25076" + }, + { + "description": "Jurisdiction Metadata for kft_32(2020) id b72a4394-37d9-44fe-afe1-4adce10cab44", + "key": "b72a4394-37d9-44fe-afe1-4adce10cab44", + "label": "kft_32(2020) metadata", + "value": "25077" + }, + { + "description": "Jurisdiction Metadata for kft_230(2020) id e2eef72d-fbe4-45bb-b954-c041a0162eed", + "key": "e2eef72d-fbe4-45bb-b954-c041a0162eed", + "label": "kft_230(2020) metadata", + "value": "25078" + }, + { + "description": "Jurisdiction Metadata for kft_188(2020) id 45d201a7-a915-4dec-a52e-73824329a8fc", + "key": "45d201a7-a915-4dec-a52e-73824329a8fc", + "label": "kft_188(2020) metadata", + "value": "25079" + }, + { + "description": "Jurisdiction Metadata for kft_130(2020) id 95545d6b-48b9-45c6-bcab-2c522424bee7", + "key": "95545d6b-48b9-45c6-bcab-2c522424bee7", + "label": "kft_130(2020) metadata", + "value": "25080" + }, + { + "description": "Jurisdiction Metadata for kft_39(2020) id fe0e0f65-d1c0-4bf7-866d-c3ca4ad61c9a", + "key": "fe0e0f65-d1c0-4bf7-866d-c3ca4ad61c9a", + "label": "kft_39(2020) metadata", + "value": "25081" + }, + { + "description": "Jurisdiction Metadata for kft_68(2020) id 39a59408-0cda-4c53-99ed-6e6187a26961", + "key": "39a59408-0cda-4c53-99ed-6e6187a26961", + "label": "kft_68(2020) metadata", + "value": "25082" + }, + { + "description": "Jurisdiction Metadata for kft_276(2020) id 20c1af76-0da0-4721-afbf-d8636a861d4b", + "key": "20c1af76-0da0-4721-afbf-d8636a861d4b", + "label": "kft_276(2020) metadata", + "value": "25083" + }, + { + "description": "Jurisdiction Metadata for kft_25(2020) id 4ca4933a-7059-4301-b551-be139174b579", + "key": "4ca4933a-7059-4301-b551-be139174b579", + "label": "kft_25(2020) metadata", + "value": "25084" + }, + { + "description": "Jurisdiction Metadata for kft_307(2020) id d7980819-e4cd-4f11-b19d-ca1ad39cd4a7", + "key": "d7980819-e4cd-4f11-b19d-ca1ad39cd4a7", + "label": "kft_307(2020) metadata", + "value": "25085" + }, + { + "description": "Jurisdiction Metadata for kft_344(2020) id 0df76c95-0e10-4fdf-b6e7-3922a392409a", + "key": "0df76c95-0e10-4fdf-b6e7-3922a392409a", + "label": "kft_344(2020) metadata", + "value": "25086" + }, + { + "description": "Jurisdiction Metadata for kft_259(2020) id a3cee12d-2311-466f-b278-cbed562c818b", + "key": "a3cee12d-2311-466f-b278-cbed562c818b", + "label": "kft_259(2020) metadata", + "value": "25087" + }, + { + "description": "Jurisdiction Metadata for kft_187(2020) id 9c4b0422-ec0d-498b-8cf1-6e38cbf2f1f8", + "key": "9c4b0422-ec0d-498b-8cf1-6e38cbf2f1f8", + "label": "kft_187(2020) metadata", + "value": "25088" + }, + { + "description": "Jurisdiction Metadata for kft_179(2020) id a66cd42f-0862-4fda-b0b7-f6014853a50b", + "key": "a66cd42f-0862-4fda-b0b7-f6014853a50b", + "label": "kft_179(2020) metadata", + "value": "25089" + }, + { + "description": "Jurisdiction Metadata for kft_117(2020) id ea3c652f-5926-478e-ba10-5d9b0abc90ec", + "key": "ea3c652f-5926-478e-ba10-5d9b0abc90ec", + "label": "kft_117(2020) metadata", + "value": "25090" + }, + { + "description": "Jurisdiction Metadata for kft_70(2020) id 5d717374-ba3c-41cc-9ee0-7018a8dc24f8", + "key": "5d717374-ba3c-41cc-9ee0-7018a8dc24f8", + "label": "kft_70(2020) metadata", + "value": "25091" + }, + { + "description": "Jurisdiction Metadata for kft_239(2020) id 9649a63e-7fd5-4442-94ce-7e6ecdf329cb", + "key": "9649a63e-7fd5-4442-94ce-7e6ecdf329cb", + "label": "kft_239(2020) metadata", + "value": "25092" + }, + { + "description": "Jurisdiction Metadata for kft_201(2020) id 7865ec2d-a832-4655-9cf4-267bebd1c138", + "key": "7865ec2d-a832-4655-9cf4-267bebd1c138", + "label": "kft_201(2020) metadata", + "value": "25093" + }, + { + "description": "Jurisdiction Metadata for kft_225(2020) id 44713f6e-4a1f-42ae-9f8e-b97114de97ed", + "key": "44713f6e-4a1f-42ae-9f8e-b97114de97ed", + "label": "kft_225(2020) metadata", + "value": "25094" + }, + { + "description": "Jurisdiction Metadata for kft_257(2020) id f0af0dc5-40c4-46d1-8044-d56eb538023e", + "key": "f0af0dc5-40c4-46d1-8044-d56eb538023e", + "label": "kft_257(2020) metadata", + "value": "25095" + }, + { + "description": "Jurisdiction Metadata for kft_108(2020) id 1279d77a-25e8-4ca5-a204-e5773b573615", + "key": "1279d77a-25e8-4ca5-a204-e5773b573615", + "label": "kft_108(2020) metadata", + "value": "25096" + }, + { + "description": "Jurisdiction Metadata for kft_302(2020) id bfda2151-c86a-4211-9f74-ea1f1a788178", + "key": "bfda2151-c86a-4211-9f74-ea1f1a788178", + "label": "kft_302(2020) metadata", + "value": "25097" + }, + { + "description": "Jurisdiction Metadata for kft_138(2020) id 9ec57e53-f988-44c5-b93e-007a93285e4c", + "key": "9ec57e53-f988-44c5-b93e-007a93285e4c", + "label": "kft_138(2020) metadata", + "value": "25098" + }, + { + "description": "Jurisdiction Metadata for kft_21(2020) id 1c1c693a-b3b3-4487-a86a-285403c8e09e", + "key": "1c1c693a-b3b3-4487-a86a-285403c8e09e", + "label": "kft_21(2020) metadata", + "value": "25099" + }, + { + "description": "Jurisdiction Metadata for kft_87(2020) id f7525c23-ee55-46c8-ab9c-318f599c40ae", + "key": "f7525c23-ee55-46c8-ab9c-318f599c40ae", + "label": "kft_87(2020) metadata", + "value": "25100" + }, + { + "description": "Jurisdiction Metadata for kft_219(2020) id 1d07bb34-0a11-46d1-aa0f-72db2cf70a40", + "key": "1d07bb34-0a11-46d1-aa0f-72db2cf70a40", + "label": "kft_219(2020) metadata", + "value": "25101" + }, + { + "description": "Jurisdiction Metadata for kft_75(2020) id 4b05a9e0-daaf-4e0f-bd28-865aaae29d91", + "key": "4b05a9e0-daaf-4e0f-bd28-865aaae29d91", + "label": "kft_75(2020) metadata", + "value": "25102" + }, + { + "description": "Jurisdiction Metadata for kft_38(2020) id 0f527ec7-9313-49b3-848b-bdccac9766d9", + "key": "0f527ec7-9313-49b3-848b-bdccac9766d9", + "label": "kft_38(2020) metadata", + "value": "25103" + }, + { + "description": "Jurisdiction Metadata for kft_329(2020) id f3ae2cba-8127-4d6d-9f14-fefdac8815d3", + "key": "f3ae2cba-8127-4d6d-9f14-fefdac8815d3", + "label": "kft_329(2020) metadata", + "value": "25104" + }, + { + "description": "Jurisdiction Metadata for kft_300(2020) id ec887900-4add-417c-a473-4697f97210dd", + "key": "ec887900-4add-417c-a473-4697f97210dd", + "label": "kft_300(2020) metadata", + "value": "25105" + }, + { + "description": "Jurisdiction Metadata for kft_320(2020) id 0904eda6-5a36-4de4-b494-5c84a03539db", + "key": "0904eda6-5a36-4de4-b494-5c84a03539db", + "label": "kft_320(2020) metadata", + "value": "25106" + }, + { + "description": "Jurisdiction Metadata for kft_184(2020) id 68baf2da-a819-4451-8666-12cc1e0c19b3", + "key": "68baf2da-a819-4451-8666-12cc1e0c19b3", + "label": "kft_184(2020) metadata", + "value": "25107" + }, + { + "description": "Jurisdiction Metadata for kft_77(2020) id a0528349-d3ed-45cb-b8e3-6059e868f654", + "key": "a0528349-d3ed-45cb-b8e3-6059e868f654", + "label": "kft_77(2020) metadata", + "value": "25108" + }, + { + "description": "Jurisdiction Metadata for kft_181(2020) id dd560563-9a1d-4b56-a8a7-17aef2541769", + "key": "dd560563-9a1d-4b56-a8a7-17aef2541769", + "label": "kft_181(2020) metadata", + "value": "25109" + }, + { + "description": "Jurisdiction Metadata for kft_158(2020) id 5fd3c170-a7ea-44c8-b7a2-4ef7d5f20a93", + "key": "5fd3c170-a7ea-44c8-b7a2-4ef7d5f20a93", + "label": "kft_158(2020) metadata", + "value": "25110" + }, + { + "description": "Jurisdiction Metadata for kft_46(2020) id 435fa78e-d6ca-44b9-9088-9dff73e05554", + "key": "435fa78e-d6ca-44b9-9088-9dff73e05554", + "label": "kft_46(2020) metadata", + "value": "25111" + }, + { + "description": "Jurisdiction Metadata for kft_127(2020) id a5a43633-8aeb-4a32-b79a-24a87238c013", + "key": "a5a43633-8aeb-4a32-b79a-24a87238c013", + "label": "kft_127(2020) metadata", + "value": "25112" + }, + { + "description": "Jurisdiction Metadata for kft_234(2020) id bfbbf577-b301-4d44-9e27-d1bcb77b6d86", + "key": "bfbbf577-b301-4d44-9e27-d1bcb77b6d86", + "label": "kft_234(2020) metadata", + "value": "25113" + }, + { + "description": "Jurisdiction Metadata for kft_79(2020) id 780effe4-c053-40e8-a491-ad35ba249b47", + "key": "780effe4-c053-40e8-a491-ad35ba249b47", + "label": "kft_79(2020) metadata", + "value": "25114" + }, + { + "description": "Jurisdiction Metadata for kft_27(2020) id 82dc66ff-4a81-4e21-aaf2-48f3547c9ea5", + "key": "82dc66ff-4a81-4e21-aaf2-48f3547c9ea5", + "label": "kft_27(2020) metadata", + "value": "25115" + }, + { + "description": "Jurisdiction Metadata for kft_116(2020) id e3363493-66cd-4570-84af-037a46cd122b", + "key": "e3363493-66cd-4570-84af-037a46cd122b", + "label": "kft_116(2020) metadata", + "value": "25116" + }, + { + "description": "Jurisdiction Metadata for kft_220(2020) id 250194ee-5386-484c-8b96-a6fe00a45cec", + "key": "250194ee-5386-484c-8b96-a6fe00a45cec", + "label": "kft_220(2020) metadata", + "value": "25117" + }, + { + "description": "Jurisdiction Metadata for kft_74(2020) id e69ef9fb-ce29-4439-86da-1aaa86e474d3", + "key": "e69ef9fb-ce29-4439-86da-1aaa86e474d3", + "label": "kft_74(2020) metadata", + "value": "25118" + }, + { + "description": "Jurisdiction Metadata for kft_45(2020) id 605b7126-d6df-4c28-9411-f9fba20073df", + "key": "605b7126-d6df-4c28-9411-f9fba20073df", + "label": "kft_45(2020) metadata", + "value": "25119" + }, + { + "description": "Jurisdiction Metadata for kft_285(2020) id 0071e4d6-be36-472a-a7d9-fd2d89c97802", + "key": "0071e4d6-be36-472a-a7d9-fd2d89c97802", + "label": "kft_285(2020) metadata", + "value": "25120" + }, + { + "description": "Jurisdiction Metadata for kft_218(2020) id d4d4a718-f4e0-4089-a88d-4ddbdb30611f", + "key": "d4d4a718-f4e0-4089-a88d-4ddbdb30611f", + "label": "kft_218(2020) metadata", + "value": "25121" + }, + { + "description": "Jurisdiction Metadata for kft_80(2020) id a9857bd5-dd3e-49ff-8af2-920d56e097b5", + "key": "a9857bd5-dd3e-49ff-8af2-920d56e097b5", + "label": "kft_80(2020) metadata", + "value": "25122" + }, + { + "description": "Jurisdiction Metadata for kft_238(2020) id 15b07c1c-d60e-41bd-8480-dacc20c70318", + "key": "15b07c1c-d60e-41bd-8480-dacc20c70318", + "label": "kft_238(2020) metadata", + "value": "25123" + }, + { + "description": "Jurisdiction Metadata for kft_315(2020) id b4043df5-029b-45b1-af0f-85fe3a8c42ff", + "key": "b4043df5-029b-45b1-af0f-85fe3a8c42ff", + "label": "kft_315(2020) metadata", + "value": "25124" + }, + { + "description": "Jurisdiction Metadata for kft_20(2020) id b82a866d-01d5-491b-9982-68cbafaf15df", + "key": "b82a866d-01d5-491b-9982-68cbafaf15df", + "label": "kft_20(2020) metadata", + "value": "25125" + }, + { + "description": "Jurisdiction Metadata for kft_165(2020) id 1a39d4a8-44b5-466f-989b-69b549343cce", + "key": "1a39d4a8-44b5-466f-989b-69b549343cce", + "label": "kft_165(2020) metadata", + "value": "25126" + }, + { + "description": "Jurisdiction Metadata for kft_202(2020) id 9590bcce-f400-47f0-8d76-74e55f463e83", + "key": "9590bcce-f400-47f0-8d76-74e55f463e83", + "label": "kft_202(2020) metadata", + "value": "25127" + }, + { + "description": "Jurisdiction Metadata for kft_14(2020) id 32e8cd39-4e5c-4f2f-b43d-a2027d77e09e", + "key": "32e8cd39-4e5c-4f2f-b43d-a2027d77e09e", + "label": "kft_14(2020) metadata", + "value": "25128" + }, + { + "description": "Jurisdiction Metadata for kft_65(2020) id ab98860a-862a-48b1-844c-12ce7bb027da", + "key": "ab98860a-862a-48b1-844c-12ce7bb027da", + "label": "kft_65(2020) metadata", + "value": "25129" + }, + { + "description": "Jurisdiction Metadata for kft_263(2020) id a710f078-3d36-4b9a-a520-e1ccb2c60578", + "key": "a710f078-3d36-4b9a-a520-e1ccb2c60578", + "label": "kft_263(2020) metadata", + "value": "25130" + }, + { + "description": "Jurisdiction Metadata for kft_193(2020) id 69b70911-6ad3-4352-8b14-4d9e35b51089", + "key": "69b70911-6ad3-4352-8b14-4d9e35b51089", + "label": "kft_193(2020) metadata", + "value": "25131" + }, + { + "description": "Jurisdiction Metadata for kft_294(2020) id 09c1ed60-0fab-4274-b74c-2ed8ec24a483", + "key": "09c1ed60-0fab-4274-b74c-2ed8ec24a483", + "label": "kft_294(2020) metadata", + "value": "25132" + }, + { + "description": "Jurisdiction Metadata for kft_240(2020) id 32b36d14-32be-493f-980b-d68da75cd61a", + "key": "32b36d14-32be-493f-980b-d68da75cd61a", + "label": "kft_240(2020) metadata", + "value": "25133" + }, + { + "description": "Jurisdiction Metadata for kft_93(2020) id 547dca32-96ae-4d86-a9b0-736e7a1d8a52", + "key": "547dca32-96ae-4d86-a9b0-736e7a1d8a52", + "label": "kft_93(2020) metadata", + "value": "25134" + }, + { + "description": "Jurisdiction Metadata for kft_106(2020) id 5ff4d044-4bd9-44b4-9411-bd8b9985f8ca", + "key": "5ff4d044-4bd9-44b4-9411-bd8b9985f8ca", + "label": "kft_106(2020) metadata", + "value": "25135" + }, + { + "description": "Jurisdiction Metadata for kft_42(2020) id 1eee0e06-5b80-4624-8571-d4115e001a48", + "key": "1eee0e06-5b80-4624-8571-d4115e001a48", + "label": "kft_42(2020) metadata", + "value": "25136" + }, + { + "description": "Jurisdiction Metadata for kft_98(2020) id 82004427-cb14-40cf-a794-60a2545bac35", + "key": "82004427-cb14-40cf-a794-60a2545bac35", + "label": "kft_98(2020) metadata", + "value": "25137" + }, + { + "description": "Jurisdiction Metadata for kft_342(2020) id eead978b-c0d5-4192-9178-9ef247d62dfa", + "key": "eead978b-c0d5-4192-9178-9ef247d62dfa", + "label": "kft_342(2020) metadata", + "value": "25138" + }, + { + "description": "Jurisdiction Metadata for kft_139(2020) id f2c36f8f-f3b5-41fe-8e74-01fdabdb6ade", + "key": "f2c36f8f-f3b5-41fe-8e74-01fdabdb6ade", + "label": "kft_139(2020) metadata", + "value": "25139" + }, + { + "description": "Jurisdiction Metadata for kft_256(2020) id 092540ca-3141-4db8-82d4-befdd7263f92", + "key": "092540ca-3141-4db8-82d4-befdd7263f92", + "label": "kft_256(2020) metadata", + "value": "25140" + }, + { + "description": "Jurisdiction Metadata for kft_103(2020) id 5ff0790a-1254-4e67-8bfe-4d56d3f99513", + "key": "5ff0790a-1254-4e67-8bfe-4d56d3f99513", + "label": "kft_103(2020) metadata", + "value": "25141" + }, + { + "description": "Jurisdiction Metadata for kft_124(2020) id 0e854ba6-64b6-4fcf-961f-a25d0dff3871", + "key": "0e854ba6-64b6-4fcf-961f-a25d0dff3871", + "label": "kft_124(2020) metadata", + "value": "25142" + }, + { + "description": "Jurisdiction Metadata for kft_109(2020) id 28208766-61f8-409a-930a-a7ccb9c2eb1b", + "key": "28208766-61f8-409a-930a-a7ccb9c2eb1b", + "label": "kft_109(2020) metadata", + "value": "25143" + }, + { + "description": "Jurisdiction Metadata for kft_164(2020) id 97c5f48a-5f12-4b53-99c3-6309d6af7663", + "key": "97c5f48a-5f12-4b53-99c3-6309d6af7663", + "label": "kft_164(2020) metadata", + "value": "25144" + }, + { + "description": "Jurisdiction Metadata for kft_223(2020) id dd554cdc-1664-499f-a040-d75c08bdb720", + "key": "dd554cdc-1664-499f-a040-d75c08bdb720", + "label": "kft_223(2020) metadata", + "value": "25145" + }, + { + "description": "Jurisdiction Metadata for kft_16(2020) id 9c42f3cc-27d0-43c5-8c90-4b48f3319223", + "key": "9c42f3cc-27d0-43c5-8c90-4b48f3319223", + "label": "kft_16(2020) metadata", + "value": "25146" + }, + { + "description": "Jurisdiction Metadata for kft_231(2020) id 8cbd0b38-773b-4413-b161-5bbd47a46572", + "key": "8cbd0b38-773b-4413-b161-5bbd47a46572", + "label": "kft_231(2020) metadata", + "value": "25147" + }, + { + "description": "Jurisdiction Metadata for kft_49(2020) id ae3d896b-b5e3-4d75-b343-213b232eb5df", + "key": "ae3d896b-b5e3-4d75-b343-213b232eb5df", + "label": "kft_49(2020) metadata", + "value": "25148" + }, + { + "description": "Jurisdiction Metadata for kft_51(2020) id 8d42ba85-85a1-464e-9be5-f39a3b5531d8", + "key": "8d42ba85-85a1-464e-9be5-f39a3b5531d8", + "label": "kft_51(2020) metadata", + "value": "25149" + }, + { + "description": "Jurisdiction Metadata for kft_318(2020) id b4668c10-e8f9-4618-a685-a86e684b8586", + "key": "b4668c10-e8f9-4618-a685-a86e684b8586", + "label": "kft_318(2020) metadata", + "value": "25150" + }, + { + "description": "Jurisdiction Metadata for kft_324(2020) id de934dde-f99a-43ba-a4a1-5d3dd810e152", + "key": "de934dde-f99a-43ba-a4a1-5d3dd810e152", + "label": "kft_324(2020) metadata", + "value": "25151" + }, + { + "description": "Jurisdiction Metadata for kft_242(2020) id 91ef5196-4915-4ea0-bc85-3100a04c2678", + "key": "91ef5196-4915-4ea0-bc85-3100a04c2678", + "label": "kft_242(2020) metadata", + "value": "25152" + }, + { + "description": "Jurisdiction Metadata for kft_272(2020) id 858e1acb-d5da-4c74-a06a-d605399fb6ce", + "key": "858e1acb-d5da-4c74-a06a-d605399fb6ce", + "label": "kft_272(2020) metadata", + "value": "25153" + }, + { + "description": "Jurisdiction Metadata for kft_163(2020) id 81d32404-b62f-49c4-8547-6455d44c8f3b", + "key": "81d32404-b62f-49c4-8547-6455d44c8f3b", + "label": "kft_163(2020) metadata", + "value": "25154" + }, + { + "description": "Jurisdiction Metadata for kft_258(2020) id 338d6dd3-0970-4b73-8ccb-3c420ced0d77", + "key": "338d6dd3-0970-4b73-8ccb-3c420ced0d77", + "label": "kft_258(2020) metadata", + "value": "25155" + }, + { + "description": "Jurisdiction Metadata for kft_217(2020) id 8f0612f5-46c0-4074-bae6-aa935b708876", + "key": "8f0612f5-46c0-4074-bae6-aa935b708876", + "label": "kft_217(2020) metadata", + "value": "25156" + }, + { + "description": "Jurisdiction Metadata for kft_228(2020) id 86cf8f58-e1ad-4e6a-b4ed-3667d603790a", + "key": "86cf8f58-e1ad-4e6a-b4ed-3667d603790a", + "label": "kft_228(2020) metadata", + "value": "25157" + }, + { + "description": "Jurisdiction Metadata for kft_67(2020) id e58ea223-80c6-4475-95a8-65084f8243b4", + "key": "e58ea223-80c6-4475-95a8-65084f8243b4", + "label": "kft_67(2020) metadata", + "value": "25158" + }, + { + "description": "Jurisdiction Metadata for kft_111(2020) id bc3e73a5-2d3b-4170-a70a-c7ef3e9cd94f", + "key": "bc3e73a5-2d3b-4170-a70a-c7ef3e9cd94f", + "label": "kft_111(2020) metadata", + "value": "25159" + }, + { + "description": "Jurisdiction Metadata for kft_341(2020) id b086232b-2e02-418e-892e-91764175cc71", + "key": "b086232b-2e02-418e-892e-91764175cc71", + "label": "kft_341(2020) metadata", + "value": "25160" + }, + { + "description": "Jurisdiction Metadata for kft_269(2020) id f10570bc-f9d2-4497-a6b0-a1bffcee94f6", + "key": "f10570bc-f9d2-4497-a6b0-a1bffcee94f6", + "label": "kft_269(2020) metadata", + "value": "25161" + }, + { + "description": "Jurisdiction Metadata for kft_33(2020) id 9a4f2d79-3128-47dc-a71e-876bd1a80a65", + "key": "9a4f2d79-3128-47dc-a71e-876bd1a80a65", + "label": "kft_33(2020) metadata", + "value": "25162" + }, + { + "description": "Jurisdiction Metadata for kft_129(2020) id 076f32f9-07f3-490b-a9a3-2a65e667462e", + "key": "076f32f9-07f3-490b-a9a3-2a65e667462e", + "label": "kft_129(2020) metadata", + "value": "25163" + }, + { + "description": "Jurisdiction Metadata for kft_316(2020) id 0a9c6891-51a3-47c4-8d77-ebf478ab7efe", + "key": "0a9c6891-51a3-47c4-8d77-ebf478ab7efe", + "label": "kft_316(2020) metadata", + "value": "25164" + }, + { + "description": "Jurisdiction Metadata for kft_279(2020) id 1406f27f-ed79-4b72-9b8f-b55340893af8", + "key": "1406f27f-ed79-4b72-9b8f-b55340893af8", + "label": "kft_279(2020) metadata", + "value": "25165" + }, + { + "description": "Jurisdiction Metadata for kft_92(2020) id ef9f74f3-c07f-4009-9d7f-3ec808af325d", + "key": "ef9f74f3-c07f-4009-9d7f-3ec808af325d", + "label": "kft_92(2020) metadata", + "value": "25166" + }, + { + "description": "Jurisdiction Metadata for kft_71(2020) id c16df14a-fa59-4726-9a4e-9c8e70d1fbe6", + "key": "c16df14a-fa59-4726-9a4e-9c8e70d1fbe6", + "label": "kft_71(2020) metadata", + "value": "25167" + }, + { + "description": "Jurisdiction Metadata for kft_326(2020) id 718ec2ed-e5c4-4732-badc-670cb05ab21d", + "key": "718ec2ed-e5c4-4732-badc-670cb05ab21d", + "label": "kft_326(2020) metadata", + "value": "25168" + }, + { + "description": "Jurisdiction Metadata for kft_52(2020) id bba960e9-aa5c-45e5-af11-1ec639e186e8", + "key": "bba960e9-aa5c-45e5-af11-1ec639e186e8", + "label": "kft_52(2020) metadata", + "value": "25169" + }, + { + "description": "Jurisdiction Metadata for kft_22(2020) id 2b3ed432-8379-4e4c-8e2b-dc75a3efb91a", + "key": "2b3ed432-8379-4e4c-8e2b-dc75a3efb91a", + "label": "kft_22(2020) metadata", + "value": "25170" + }, + { + "description": "Jurisdiction Metadata for kft_78(2020) id a5d78c06-b279-40c6-9043-a879a2f3f74e", + "key": "a5d78c06-b279-40c6-9043-a879a2f3f74e", + "label": "kft_78(2020) metadata", + "value": "25171" + }, + { + "description": "Jurisdiction Metadata for kft_66(2020) id 4d9ea4e9-310e-42e2-a7ef-debab8f85f4f", + "key": "4d9ea4e9-310e-42e2-a7ef-debab8f85f4f", + "label": "kft_66(2020) metadata", + "value": "25172" + }, + { + "description": "Jurisdiction Metadata for kft_88(2020) id 910fc574-2e57-469a-8600-dfbd09b578be", + "key": "910fc574-2e57-469a-8600-dfbd09b578be", + "label": "kft_88(2020) metadata", + "value": "25173" + }, + { + "description": "Jurisdiction Metadata for kft_156(2020) id 5c072aa8-4275-46bb-875f-a70a52740109", + "key": "5c072aa8-4275-46bb-875f-a70a52740109", + "label": "kft_156(2020) metadata", + "value": "25174" + }, + { + "description": "Jurisdiction Metadata for kft_115(2020) id 860632fc-83fd-4be5-874f-6d965b6b2fa8", + "key": "860632fc-83fd-4be5-874f-6d965b6b2fa8", + "label": "kft_115(2020) metadata", + "value": "25175" + }, + { + "description": "Jurisdiction Metadata for kft_113(2020) id d08b543e-50b3-4acd-be9f-97d83b047721", + "key": "d08b543e-50b3-4acd-be9f-97d83b047721", + "label": "kft_113(2020) metadata", + "value": "25176" + }, + { + "description": "Jurisdiction Metadata for kft_159(2020) id a9370c5a-bdeb-4c24-8760-b312e3e41c6c", + "key": "a9370c5a-bdeb-4c24-8760-b312e3e41c6c", + "label": "kft_159(2020) metadata", + "value": "25177" + }, + { + "description": "Jurisdiction Metadata for kft_105(2020) id 27e178d8-b3cf-4a37-9f9e-9fc8d88a0881", + "key": "27e178d8-b3cf-4a37-9f9e-9fc8d88a0881", + "label": "kft_105(2020) metadata", + "value": "25178" + }, + { + "description": "Jurisdiction Metadata for kft_200(2020) id 39dd0df1-ec48-4836-af25-4f33a21dd58e", + "key": "39dd0df1-ec48-4836-af25-4f33a21dd58e", + "label": "kft_200(2020) metadata", + "value": "25179" + }, + { + "description": "Jurisdiction Metadata for kft_232(2020) id 1a927144-557c-4b2a-9fb0-4a0d6db6e2b3", + "key": "1a927144-557c-4b2a-9fb0-4a0d6db6e2b3", + "label": "kft_232(2020) metadata", + "value": "25180" + }, + { + "description": "Jurisdiction Metadata for kft_136(2020) id 02a6a043-72b5-4521-a61f-2606dc38ca91", + "key": "02a6a043-72b5-4521-a61f-2606dc38ca91", + "label": "kft_136(2020) metadata", + "value": "25181" + }, + { + "description": "Jurisdiction Metadata for kft_123(2020) id 2065cc91-7530-44a4-9aad-d7f61c8dab82", + "key": "2065cc91-7530-44a4-9aad-d7f61c8dab82", + "label": "kft_123(2020) metadata", + "value": "25182" + }, + { + "description": "Jurisdiction Metadata for kft_119(2020) id 34548868-3d97-40da-916c-fb7381aa1ee8", + "key": "34548868-3d97-40da-916c-fb7381aa1ee8", + "label": "kft_119(2020) metadata", + "value": "25183" + }, + { + "description": "Jurisdiction Metadata for kft_34(2020) id fff2ca78-fa5e-4b3a-a8dd-c85d2d5dbecc", + "key": "fff2ca78-fa5e-4b3a-a8dd-c85d2d5dbecc", + "label": "kft_34(2020) metadata", + "value": "25184" + }, + { + "description": "Jurisdiction Metadata for kft_196(2020) id 60eb203e-ba52-412b-b834-793248cc1d57", + "key": "60eb203e-ba52-412b-b834-793248cc1d57", + "label": "kft_196(2020) metadata", + "value": "25185" + }, + { + "description": "Jurisdiction Metadata for kft_195(2020) id 8cf7350e-4696-498e-81de-ed4d6eaab29d", + "key": "8cf7350e-4696-498e-81de-ed4d6eaab29d", + "label": "kft_195(2020) metadata", + "value": "25186" + }, + { + "description": "Jurisdiction Metadata for kft_47(2020) id b700f220-90bc-4f93-84db-4b3555c217df", + "key": "b700f220-90bc-4f93-84db-4b3555c217df", + "label": "kft_47(2020) metadata", + "value": "25187" + }, + { + "description": "Jurisdiction Metadata for kft_50(2020) id 1de0a44a-0cb9-4c55-bc93-e561f3a24905", + "key": "1de0a44a-0cb9-4c55-bc93-e561f3a24905", + "label": "kft_50(2020) metadata", + "value": "25188" + }, + { + "description": "Jurisdiction Metadata for kft_81(2020) id 713438d9-7d14-44ec-a901-7b3f0df191a4", + "key": "713438d9-7d14-44ec-a901-7b3f0df191a4", + "label": "kft_81(2020) metadata", + "value": "25189" + }, + { + "description": "Jurisdiction Metadata for kft_26(2020) id 481b4a3a-5306-4b2f-a60a-421101abaa6c", + "key": "481b4a3a-5306-4b2f-a60a-421101abaa6c", + "label": "kft_26(2020) metadata", + "value": "25190" + }, + { + "description": "Jurisdiction Metadata for kft_204(2020) id 1346322a-cc3d-4dfa-a18a-d06c3c9283c3", + "key": "1346322a-cc3d-4dfa-a18a-d06c3c9283c3", + "label": "kft_204(2020) metadata", + "value": "25191" + }, + { + "description": "Jurisdiction Metadata for kft_192(2020) id 1169d669-8a67-4bf9-99b4-5a5fe401e08a", + "key": "1169d669-8a67-4bf9-99b4-5a5fe401e08a", + "label": "kft_192(2020) metadata", + "value": "25192" + }, + { + "description": "Jurisdiction Metadata for kft_76(2020) id d82e9b0c-c3ae-4887-892a-2ca3b78b6ee6", + "key": "d82e9b0c-c3ae-4887-892a-2ca3b78b6ee6", + "label": "kft_76(2020) metadata", + "value": "25193" + }, + { + "description": "Jurisdiction Metadata for kft_210(2020) id ebca20ae-522c-494f-bb00-51f4463ca88d", + "key": "ebca20ae-522c-494f-bb00-51f4463ca88d", + "label": "kft_210(2020) metadata", + "value": "25194" + }, + { + "description": "Jurisdiction Metadata for kft_180(2020) id 387a07eb-f6c8-4b73-b77d-39e345685d37", + "key": "387a07eb-f6c8-4b73-b77d-39e345685d37", + "label": "kft_180(2020) metadata", + "value": "25195" + }, + { + "description": "Jurisdiction Metadata for kft_160(2020) id 7946a4f9-78ed-4429-93b6-5c1267671777", + "key": "7946a4f9-78ed-4429-93b6-5c1267671777", + "label": "kft_160(2020) metadata", + "value": "25196" + }, + { + "description": "Jurisdiction Metadata for kft_29(2020) id aa71f618-251d-4f1b-b579-aca4a1167c69", + "key": "aa71f618-251d-4f1b-b579-aca4a1167c69", + "label": "kft_29(2020) metadata", + "value": "25197" + }, + { + "description": "Jurisdiction Metadata for Shimpundu Zone id c361bf40-b0bd-4182-a9da-b420c9014382", + "key": "c361bf40-b0bd-4182-a9da-b420c9014382", + "label": "Shimpundu Zone metadata", + "value": "25198" + }, + { + "description": "Jurisdiction Metadata for kft_175(2020) id a0f708a8-6232-4cd0-b707-3573854a9631", + "key": "a0f708a8-6232-4cd0-b707-3573854a9631", + "label": "kft_175(2020) metadata", + "value": "25199" + }, + { + "description": "Jurisdiction Metadata for kft_5(2020) id cf2a233f-6203-4925-8c9d-1bd56c3084d0", + "key": "cf2a233f-6203-4925-8c9d-1bd56c3084d0", + "label": "kft_5(2020) metadata", + "value": "25200" + }, + { + "description": "Jurisdiction Metadata for Mulule Zone id b7c7de34-28f1-472a-86a0-2c3fe0c4a532", + "key": "b7c7de34-28f1-472a-86a0-2c3fe0c4a532", + "label": "Mulule Zone metadata", + "value": "25201" + }, + { + "description": "Jurisdiction Metadata for kft_56(2020) id 5898c78b-86df-4672-abf5-b24a7cefeb26", + "key": "5898c78b-86df-4672-abf5-b24a7cefeb26", + "label": "kft_56(2020) metadata", + "value": "25202" + }, + { + "description": "Jurisdiction Metadata for kft_122(2020) id ffecb4c9-3314-4e0a-b19a-36e1e3245e8e", + "key": "ffecb4c9-3314-4e0a-b19a-36e1e3245e8e", + "label": "kft_122(2020) metadata", + "value": "25203" + }, + { + "description": "Jurisdiction Metadata for kft_99(2020) id 2c4483c8-1276-4279-8865-0b098790c461", + "key": "2c4483c8-1276-4279-8865-0b098790c461", + "label": "kft_99(2020) metadata", + "value": "25204" + }, + { + "description": "Jurisdiction Metadata for kft_312(2020) id 89b79a0c-2dba-4880-a2b5-3ae7454ea4a8", + "key": "89b79a0c-2dba-4880-a2b5-3ae7454ea4a8", + "label": "kft_312(2020) metadata", + "value": "25205" + }, + { + "description": "Jurisdiction Metadata for kft_305(2020) id 030da7e8-0157-417d-9cf0-2955cb7fd115", + "key": "030da7e8-0157-417d-9cf0-2955cb7fd115", + "label": "kft_305(2020) metadata", + "value": "25206" + }, + { + "description": "Jurisdiction Metadata for kft_157(2020) id 2a08c5fa-709c-47aa-bfe8-668703ec2ccd", + "key": "2a08c5fa-709c-47aa-bfe8-668703ec2ccd", + "label": "kft_157(2020) metadata", + "value": "25207" + }, + { + "description": "Jurisdiction Metadata for kft_141(2020) id 2c2009e3-88f7-4957-b273-71391b35acfe", + "key": "2c2009e3-88f7-4957-b273-71391b35acfe", + "label": "kft_141(2020) metadata", + "value": "25208" + }, + { + "description": "Jurisdiction Metadata for kft_289(2020) id c63ac00b-b985-405c-af88-92356d0ba9cf", + "key": "c63ac00b-b985-405c-af88-92356d0ba9cf", + "label": "kft_289(2020) metadata", + "value": "25209" + }, + { + "description": "Jurisdiction Metadata for kft_343(2020) id a361effc-0824-4cfa-adec-bbf74e4ee455", + "key": "a361effc-0824-4cfa-adec-bbf74e4ee455", + "label": "kft_343(2020) metadata", + "value": "25210" + }, + { + "description": "Jurisdiction Metadata for kft_208(2020) id 0a6ed6ab-625a-49b9-8a08-67ff7b990f5b", + "key": "0a6ed6ab-625a-49b9-8a08-67ff7b990f5b", + "label": "kft_208(2020) metadata", + "value": "25211" + }, + { + "description": "Jurisdiction Metadata for kft_110(2020) id 92de3d0e-7973-4877-be7c-36ee1facd02c", + "key": "92de3d0e-7973-4877-be7c-36ee1facd02c", + "label": "kft_110(2020) metadata", + "value": "25212" + }, + { + "description": "Jurisdiction Metadata for kft_41(2020) id 20aba988-422d-4d96-a3ab-fd57620ab1e6", + "key": "20aba988-422d-4d96-a3ab-fd57620ab1e6", + "label": "kft_41(2020) metadata", + "value": "25213" + }, + { + "description": "Jurisdiction Metadata for kft_168(2020) id f9710eb4-d101-4f5e-9148-4fe98a6f6b4d", + "key": "f9710eb4-d101-4f5e-9148-4fe98a6f6b4d", + "label": "kft_168(2020) metadata", + "value": "25214" + }, + { + "description": "Jurisdiction Metadata for kft_275(2020) id 266adc44-4a04-400a-b47e-bb5ea9545240", + "key": "266adc44-4a04-400a-b47e-bb5ea9545240", + "label": "kft_275(2020) metadata", + "value": "25215" + }, + { + "description": "Jurisdiction Metadata for kft_24(2020) id f1f0988b-44e4-4d29-87dc-b9477b519956", + "key": "f1f0988b-44e4-4d29-87dc-b9477b519956", + "label": "kft_24(2020) metadata", + "value": "25216" + }, + { + "description": "Jurisdiction Metadata for kft_213(2020) id 69b7829c-c044-40cc-b07a-4d9de78cc289", + "key": "69b7829c-c044-40cc-b07a-4d9de78cc289", + "label": "kft_213(2020) metadata", + "value": "25217" + }, + { + "description": "Jurisdiction Metadata for kft_311(2020) id c6ccd91d-b179-4b12-9023-4cf2f7c79acf", + "key": "c6ccd91d-b179-4b12-9023-4cf2f7c79acf", + "label": "kft_311(2020) metadata", + "value": "25218" + }, + { + "description": "Jurisdiction Metadata for kft_144(2020) id a614d477-15ce-4dcb-b4ab-05911af0c8cf", + "key": "a614d477-15ce-4dcb-b4ab-05911af0c8cf", + "label": "kft_144(2020) metadata", + "value": "25219" + }, + { + "description": "Jurisdiction Metadata for kft_347(2020) id be63d02d-5bc2-46ae-8fc8-cbfad71511ab", + "key": "be63d02d-5bc2-46ae-8fc8-cbfad71511ab", + "label": "kft_347(2020) metadata", + "value": "25220" + }, + { + "description": "Jurisdiction Metadata for kft_85(2020) id 6287d382-0969-4b3d-aa06-d0dbd71ee188", + "key": "6287d382-0969-4b3d-aa06-d0dbd71ee188", + "label": "kft_85(2020) metadata", + "value": "25221" + }, + { + "description": "Jurisdiction Metadata for kft_227(2020) id 3e4c5bb7-392f-4c27-831b-c91e1a0be81c", + "key": "3e4c5bb7-392f-4c27-831b-c91e1a0be81c", + "label": "kft_227(2020) metadata", + "value": "25222" + }, + { + "description": "Jurisdiction Metadata for kft_336(2020) id 7a37c38d-e137-4d32-b996-712b7220c266", + "key": "7a37c38d-e137-4d32-b996-712b7220c266", + "label": "kft_336(2020) metadata", + "value": "25223" + }, + { + "description": "Jurisdiction Metadata for kft_198(2020) id 457e11f3-bbde-4861-9e21-201404f7e53b", + "key": "457e11f3-bbde-4861-9e21-201404f7e53b", + "label": "kft_198(2020) metadata", + "value": "25224" + }, + { + "description": "Jurisdiction Metadata for kft_290(2020) id f6606b55-4bab-4a6f-a5a6-a129b473b434", + "key": "f6606b55-4bab-4a6f-a5a6-a129b473b434", + "label": "kft_290(2020) metadata", + "value": "25225" + }, + { + "description": "Jurisdiction Metadata for kft_222(2020) id 6d558f1e-0ff4-4f78-af1d-743401aa75b9", + "key": "6d558f1e-0ff4-4f78-af1d-743401aa75b9", + "label": "kft_222(2020) metadata", + "value": "25226" + }, + { + "description": "Jurisdiction Metadata for Chimba Zone id 47b91c53-0611-4e14-a30a-a5957053304a", + "key": "47b91c53-0611-4e14-a30a-a5957053304a", + "label": "Chimba Zone metadata", + "value": "25227" + }, + { + "description": "Jurisdiction Metadata for kft_7(2020) id 5f8bffe7-213a-4a03-8d85-59a075bef403", + "key": "5f8bffe7-213a-4a03-8d85-59a075bef403", + "label": "kft_7(2020) metadata", + "value": "25228" + }, + { + "description": "Jurisdiction Metadata for kft_293(2020) id 0e080313-aab1-4897-a046-510ffc305d80", + "key": "0e080313-aab1-4897-a046-510ffc305d80", + "label": "kft_293(2020) metadata", + "value": "25229" + }, + { + "description": "Jurisdiction Metadata for kft_8(2020) id 93121e37-3f62-4e18-a377-1c6ffccf80ae", + "key": "93121e37-3f62-4e18-a377-1c6ffccf80ae", + "label": "kft_8(2020) metadata", + "value": "25230" + }, + { + "description": "Jurisdiction Metadata for Belu Zone id e420f7b5-b2aa-446a-96f0-335eb6eb662d", + "key": "e420f7b5-b2aa-446a-96f0-335eb6eb662d", + "label": "Belu Zone metadata", + "value": "25231" + }, + { + "description": "Jurisdiction Metadata for kft_4(2020) id c905bc65-d434-4081-bd1a-165b31dbe106", + "key": "c905bc65-d434-4081-bd1a-165b31dbe106", + "label": "kft_4(2020) metadata", + "value": "25232" + }, + { + "description": "Jurisdiction Metadata for Kasheta Zone id 43b6b13d-22e4-47d8-8fab-fd6c19285f88", + "key": "43b6b13d-22e4-47d8-8fab-fd6c19285f88", + "label": "Kasheta Zone metadata", + "value": "25233" + }, + { + "description": "Jurisdiction Metadata for kft_3(2020) id be8a196c-ce9b-4885-8683-20e8562fd1b6", + "key": "be8a196c-ce9b-4885-8683-20e8562fd1b6", + "label": "kft_3(2020) metadata", + "value": "25234" + }, + { + "description": "Jurisdiction Metadata for Mutamuka Zone id bba40e51-e37a-419e-ad4e-52329651446c", + "key": "bba40e51-e37a-419e-ad4e-52329651446c", + "label": "Mutamuka Zone metadata", + "value": "25235" + }, + { + "description": "Jurisdiction Metadata for kft_2(2020) id d0726245-3d0d-4adf-979a-8011e01b2dee", + "key": "d0726245-3d0d-4adf-979a-8011e01b2dee", + "label": "kft_2(2020) metadata", + "value": "25236" + }, + { + "description": "Jurisdiction Metadata for kft_268(2020) id 9f4af6da-b701-43a0-af5b-8d3b9926344c", + "key": "9f4af6da-b701-43a0-af5b-8d3b9926344c", + "label": "kft_268(2020) metadata", + "value": "25237" + }, + { + "description": "Jurisdiction Metadata for kft_340(2020) id df07dff7-5271-4ea4-a4f9-07b02b426f2e", + "key": "df07dff7-5271-4ea4-a4f9-07b02b426f2e", + "label": "kft_340(2020) metadata", + "value": "25238" + }, + { + "description": "Jurisdiction Metadata for kft_339(2020) id ceae9023-2755-474f-98ec-5513cf7b1100", + "key": "ceae9023-2755-474f-98ec-5513cf7b1100", + "label": "kft_339(2020) metadata", + "value": "25239" + }, + { + "description": "Jurisdiction Metadata for kft_327(2020) id d1a9e66a-1b30-4e35-8e7c-613f77854bc7", + "key": "d1a9e66a-1b30-4e35-8e7c-613f77854bc7", + "label": "kft_327(2020) metadata", + "value": "25240" + }, + { + "description": "Jurisdiction Metadata for kft_216(2020) id 658f51ae-d5e5-4114-aef8-5c160ee8f5ce", + "key": "658f51ae-d5e5-4114-aef8-5c160ee8f5ce", + "label": "kft_216(2020) metadata", + "value": "25241" + }, + { + "description": "Jurisdiction Metadata for kft_291(2020) id 281141c8-8459-4891-9841-6908bc5f8056", + "key": "281141c8-8459-4891-9841-6908bc5f8056", + "label": "kft_291(2020) metadata", + "value": "25242" + }, + { + "description": "Jurisdiction Metadata for kft_287(2020) id 19593740-04dd-48d3-869f-54b00a63f79e", + "key": "19593740-04dd-48d3-869f-54b00a63f79e", + "label": "kft_287(2020) metadata", + "value": "25243" + }, + { + "description": "Jurisdiction Metadata for kft_171(2020) id a739cd59-32d5-4e8a-a4ce-561c95a82d3f", + "key": "a739cd59-32d5-4e8a-a4ce-561c95a82d3f", + "label": "kft_171(2020) metadata", + "value": "25244" + }, + { + "description": "Jurisdiction Metadata for kft_145(2020) id f474f974-1810-461b-a022-c4dbdbceb5fb", + "key": "f474f974-1810-461b-a022-c4dbdbceb5fb", + "label": "kft_145(2020) metadata", + "value": "25245" + }, + { + "description": "Jurisdiction Metadata for Shimwilima Zone id 605e9311-71de-4e37-ae9e-6e345ededfdf", + "key": "605e9311-71de-4e37-ae9e-6e345ededfdf", + "label": "Shimwilima Zone metadata", + "value": "25246" + }, + { + "description": "Jurisdiction Metadata for kft_82(2020) id d3c5efd1-4d03-4b72-9896-3da75451d45e", + "key": "d3c5efd1-4d03-4b72-9896-3da75451d45e", + "label": "kft_82(2020) metadata", + "value": "25247" + }, + { + "description": "Jurisdiction Metadata for kft_178(2020) id 970184a5-bc15-4f9c-8d9f-b07e2150c044", + "key": "970184a5-bc15-4f9c-8d9f-b07e2150c044", + "label": "kft_178(2020) metadata", + "value": "25248" + }, + { + "description": "Jurisdiction Metadata for kft_310(2020) id da39a225-55ef-4898-884c-3c9410597b8d", + "key": "da39a225-55ef-4898-884c-3c9410597b8d", + "label": "kft_310(2020) metadata", + "value": "25249" + }, + { + "description": "Jurisdiction Metadata for kft_335(2020) id 26f4fe7f-8880-452c-93b7-25844d55e8ca", + "key": "26f4fe7f-8880-452c-93b7-25844d55e8ca", + "label": "kft_335(2020) metadata", + "value": "25250" + }, + { + "description": "Jurisdiction Metadata for kft_149(2020) id b9f1eb6c-fafd-4286-a2fb-c39428d9d90b", + "key": "b9f1eb6c-fafd-4286-a2fb-c39428d9d90b", + "label": "kft_149(2020) metadata", + "value": "25251" + }, + { + "description": "Jurisdiction Metadata for kft_176(2020) id cf3c75e2-3834-46a7-be78-9db561c2bf28", + "key": "cf3c75e2-3834-46a7-be78-9db561c2bf28", + "label": "kft_176(2020) metadata", + "value": "25252" + }, + { + "description": "Jurisdiction Metadata for kft_13(2020) id d5e18a59-c077-4b4d-b82e-3f2d68299c96", + "key": "d5e18a59-c077-4b4d-b82e-3f2d68299c96", + "label": "kft_13(2020) metadata", + "value": "25253" + }, + { + "description": "Jurisdiction Metadata for kft_338(2020) id 2508c247-c972-4f67-a3cc-3e904389f988", + "key": "2508c247-c972-4f67-a3cc-3e904389f988", + "label": "kft_338(2020) metadata", + "value": "25254" + }, + { + "description": "Jurisdiction Metadata for kft_246(2020) id aba4d6df-0fa9-4cc7-a0c8-216cafb1fb68", + "key": "aba4d6df-0fa9-4cc7-a0c8-216cafb1fb68", + "label": "kft_246(2020) metadata", + "value": "25255" + }, + { + "description": "Jurisdiction Metadata for kft_297(2020) id 716785c3-99e4-41af-9eb8-37673d27eab9", + "key": "716785c3-99e4-41af-9eb8-37673d27eab9", + "label": "kft_297(2020) metadata", + "value": "25256" + }, + { + "description": "Jurisdiction Metadata for kft_126(2020) id 8ac7828c-2ac2-453c-a9ad-59f7947218e8", + "key": "8ac7828c-2ac2-453c-a9ad-59f7947218e8", + "label": "kft_126(2020) metadata", + "value": "25257" + }, + { + "description": "Jurisdiction Metadata for kft_48(2020) id 7f32ebfa-86d7-4009-bbdc-73e9e18a2abb", + "key": "7f32ebfa-86d7-4009-bbdc-73e9e18a2abb", + "label": "kft_48(2020) metadata", + "value": "25258" + }, + { + "description": "Jurisdiction Metadata for kft_167(2020) id 0a68e77a-8566-4f2f-b257-431b5b7bbbdd", + "key": "0a68e77a-8566-4f2f-b257-431b5b7bbbdd", + "label": "kft_167(2020) metadata", + "value": "25259" + }, + { + "description": "Jurisdiction Metadata for kft_120(2020) id 078cced0-a891-4af3-8922-252c36b2d8ad", + "key": "078cced0-a891-4af3-8922-252c36b2d8ad", + "label": "kft_120(2020) metadata", + "value": "25260" + }, + { + "description": "Jurisdiction Metadata for kft_266(2020) id 2acc12a7-fbfe-452b-a62b-f2b266a3fd6a", + "key": "2acc12a7-fbfe-452b-a62b-f2b266a3fd6a", + "label": "kft_266(2020) metadata", + "value": "25261" + }, + { + "description": "Jurisdiction Metadata for kft_174(2020) id 5dfd1d65-c383-4e33-8530-1bb34576ba1e", + "key": "5dfd1d65-c383-4e33-8530-1bb34576ba1e", + "label": "kft_174(2020) metadata", + "value": "25262" + }, + { + "description": "Jurisdiction Metadata for kft_64(2020) id 778e23ad-9d3d-44a6-b6d0-42bf9f6a957e", + "key": "778e23ad-9d3d-44a6-b6d0-42bf9f6a957e", + "label": "kft_64(2020) metadata", + "value": "25263" + }, + { + "description": "Jurisdiction Metadata for kft_345(2020) id 79cb0aaf-980e-42e0-90bb-d8a219543816", + "key": "79cb0aaf-980e-42e0-90bb-d8a219543816", + "label": "kft_345(2020) metadata", + "value": "25264" + }, + { + "description": "Jurisdiction Metadata for kft_133(2020) id e7f4f2c2-bb01-402b-97da-90965ecd72c4", + "key": "e7f4f2c2-bb01-402b-97da-90965ecd72c4", + "label": "kft_133(2020) metadata", + "value": "25265" + }, + { + "description": "Jurisdiction Metadata for kft_301(2020) id d6b55cc4-eef1-4830-92a6-2da51a102296", + "key": "d6b55cc4-eef1-4830-92a6-2da51a102296", + "label": "kft_301(2020) metadata", + "value": "25266" + }, + { + "description": "Jurisdiction Metadata for kft_191(2020) id 3925e837-f9e8-44a7-b413-5ce327653d9f", + "key": "3925e837-f9e8-44a7-b413-5ce327653d9f", + "label": "kft_191(2020) metadata", + "value": "25267" + }, + { + "description": "Jurisdiction Metadata for kft_100(2020) id 86d3910a-2110-4f38-a06a-9d795e8717b3", + "key": "86d3910a-2110-4f38-a06a-9d795e8717b3", + "label": "kft_100(2020) metadata", + "value": "25268" + }, + { + "description": "Jurisdiction Metadata for kft_197(2020) id b4d11e50-9967-459e-85cf-ddf4ec4fd814", + "key": "b4d11e50-9967-459e-85cf-ddf4ec4fd814", + "label": "kft_197(2020) metadata", + "value": "25269" + }, + { + "description": "Jurisdiction Metadata for kft_90(2020) id 4d11e594-538f-4eac-9028-9bb6c7723c4d", + "key": "4d11e594-538f-4eac-9028-9bb6c7723c4d", + "label": "kft_90(2020) metadata", + "value": "25270" + }, + { + "description": "Jurisdiction Metadata for kft_247(2020) id 8638677c-1a9f-4033-8032-c0ee56c83a60", + "key": "8638677c-1a9f-4033-8032-c0ee56c83a60", + "label": "kft_247(2020) metadata", + "value": "25271" + }, + { + "description": "Jurisdiction Metadata for kft_55(2020) id 037b8996-0c23-4d25-940c-51abb0624a01", + "key": "037b8996-0c23-4d25-940c-51abb0624a01", + "label": "kft_55(2020) metadata", + "value": "25272" + }, + { + "description": "Jurisdiction Metadata for kft_57(2020) id cfe0c7f9-040a-4b7c-90c8-41090a9d1f41", + "key": "cfe0c7f9-040a-4b7c-90c8-41090a9d1f41", + "label": "kft_57(2020) metadata", + "value": "25273" + }, + { + "description": "Jurisdiction Metadata for kft_314(2020) id ff4fa62f-4df3-40a5-a8a8-f99db28c79a0", + "key": "ff4fa62f-4df3-40a5-a8a8-f99db28c79a0", + "label": "kft_314(2020) metadata", + "value": "25274" + }, + { + "description": "Jurisdiction Metadata for kft_43(2020) id b66c1266-958b-4418-96b5-cff4234cd028", + "key": "b66c1266-958b-4418-96b5-cff4234cd028", + "label": "kft_43(2020) metadata", + "value": "25275" + }, + { + "description": "Jurisdiction Metadata for kft_304(2020) id 8ce00768-0452-4be3-9407-feec4f25c905", + "key": "8ce00768-0452-4be3-9407-feec4f25c905", + "label": "kft_304(2020) metadata", + "value": "25276" + }, + { + "description": "Jurisdiction Metadata for kft_11(2020) id 0817ba2b-d14d-497f-9ba5-4c74f8205f01", + "key": "0817ba2b-d14d-497f-9ba5-4c74f8205f01", + "label": "kft_11(2020) metadata", + "value": "25277" + }, + { + "description": "Jurisdiction Metadata for kft_151(2020) id 05f20023-8136-476e-9713-c55583f80db8", + "key": "05f20023-8136-476e-9713-c55583f80db8", + "label": "kft_151(2020) metadata", + "value": "25278" + }, + { + "description": "Jurisdiction Metadata for kft_267(2020) id a6688b80-8b70-4f63-a7ec-d7505d521d47", + "key": "a6688b80-8b70-4f63-a7ec-d7505d521d47", + "label": "kft_267(2020) metadata", + "value": "25279" + }, + { + "description": "Jurisdiction Metadata for kft_125(2020) id 619a2d82-8ef1-4003-9a98-ef6ca97193e8", + "key": "619a2d82-8ef1-4003-9a98-ef6ca97193e8", + "label": "kft_125(2020) metadata", + "value": "25280" + }, + { + "description": "Jurisdiction Metadata for kft_134(2020) id ecf2f51f-2332-45b4-a11c-a135fa4aaf8f", + "key": "ecf2f51f-2332-45b4-a11c-a135fa4aaf8f", + "label": "kft_134(2020) metadata", + "value": "25281" + }, + { + "description": "Jurisdiction Metadata for kft_40(2020) id c867e314-1a39-4bbb-b29a-481fe6bf8cf9", + "key": "c867e314-1a39-4bbb-b29a-481fe6bf8cf9", + "label": "kft_40(2020) metadata", + "value": "25282" + }, + { + "description": "Jurisdiction Metadata for kft_162(2020) id be6c779a-0051-453e-ac7e-87c2e3ef93b7", + "key": "be6c779a-0051-453e-ac7e-87c2e3ef93b7", + "label": "kft_162(2020) metadata", + "value": "25283" + }, + { + "description": "Jurisdiction Metadata for kft_221(2020) id 8a1373d3-87f6-4bd0-8c6e-de9c48334050", + "key": "8a1373d3-87f6-4bd0-8c6e-de9c48334050", + "label": "kft_221(2020) metadata", + "value": "25284" + }, + { + "description": "Jurisdiction Metadata for kft_172(2020) id 4d864f8e-b8bb-4d73-8baf-2a45dfbec01c", + "key": "4d864f8e-b8bb-4d73-8baf-2a45dfbec01c", + "label": "kft_172(2020) metadata", + "value": "25285" + }, + { + "description": "Jurisdiction Metadata for kft_325(2020) id 05fa85fc-4621-4fce-9129-8e1d53a837bc", + "key": "05fa85fc-4621-4fce-9129-8e1d53a837bc", + "label": "kft_325(2020) metadata", + "value": "25286" + }, + { + "description": "Jurisdiction Metadata for kft_317(2020) id 2feb1edc-9a3b-4de6-852f-db3bc8b7fb96", + "key": "2feb1edc-9a3b-4de6-852f-db3bc8b7fb96", + "label": "kft_317(2020) metadata", + "value": "25287" + }, + { + "description": "Jurisdiction Metadata for kft_137(2020) id 46d108dd-1ced-4034-9292-efafd852fdf1", + "key": "46d108dd-1ced-4034-9292-efafd852fdf1", + "label": "kft_137(2020) metadata", + "value": "25288" + }, + { + "description": "Jurisdiction Metadata for kft_97(2020) id 335d9476-efd9-404e-9b94-bc2a98e6be78", + "key": "335d9476-efd9-404e-9b94-bc2a98e6be78", + "label": "kft_97(2020) metadata", + "value": "25289" + }, + { + "description": "Jurisdiction Metadata for kft_229(2020) id f11711e8-8e7b-4a9b-9d43-4af6739350c3", + "key": "f11711e8-8e7b-4a9b-9d43-4af6739350c3", + "label": "kft_229(2020) metadata", + "value": "25290" + }, + { + "description": "Jurisdiction Metadata for kft_319(2020) id 18640669-4e41-4b00-acff-4a8a70373c08", + "key": "18640669-4e41-4b00-acff-4a8a70373c08", + "label": "kft_319(2020) metadata", + "value": "25291" + }, + { + "description": "Jurisdiction Metadata for kft_296(2020) id ef981c6d-ce38-4e8c-b7b2-16a2ebe693c0", + "key": "ef981c6d-ce38-4e8c-b7b2-16a2ebe693c0", + "label": "kft_296(2020) metadata", + "value": "25292" + }, + { + "description": "Jurisdiction Metadata for kft_334(2020) id 51e00035-c41a-451c-8748-76ba2000983a", + "key": "51e00035-c41a-451c-8748-76ba2000983a", + "label": "kft_334(2020) metadata", + "value": "25293" + }, + { + "description": "Jurisdiction Metadata for kft_333(2020) id 1110f3e2-2cc7-49ea-8815-0ece3f19bdc8", + "key": "1110f3e2-2cc7-49ea-8815-0ece3f19bdc8", + "label": "kft_333(2020) metadata", + "value": "25294" + }, + { + "description": "Jurisdiction Metadata for kft_44(2020) id a0ea8bd4-2431-4a76-9919-98ddac6b3b3d", + "key": "a0ea8bd4-2431-4a76-9919-98ddac6b3b3d", + "label": "kft_44(2020) metadata", + "value": "25295" + }, + { + "description": "Jurisdiction Metadata for Chimpulumba Zone id 0cef375c-1697-49c3-949b-e18961acb562", + "key": "0cef375c-1697-49c3-949b-e18961acb562", + "label": "Chimpulumba Zone metadata", + "value": "25296" + }, + { + "description": "Jurisdiction Metadata for kft_6(2020) id 146d8f86-7d41-47ed-a29b-788d0866fa1a", + "key": "146d8f86-7d41-47ed-a29b-788d0866fa1a", + "label": "kft_6(2020) metadata", + "value": "25297" + }, + { + "description": "Jurisdiction Metadata for kft_147(2020) id 36582423-7b15-49eb-86ff-4bbace603003", + "key": "36582423-7b15-49eb-86ff-4bbace603003", + "label": "kft_147(2020) metadata", + "value": "25298" + }, + { + "description": "Jurisdiction Metadata for Mancheni Zone id 4dafa568-0567-4d83-9536-a4c3229534fa", + "key": "4dafa568-0567-4d83-9536-a4c3229534fa", + "label": "Mancheni Zone metadata", + "value": "25299" + }, + { + "description": "Jurisdiction Metadata for kft_28(2020) id 074d1ba3-7938-433d-8884-9f2f85a5c86e", + "key": "074d1ba3-7938-433d-8884-9f2f85a5c86e", + "label": "kft_28(2020) metadata", + "value": "25300" + }, + { + "description": "Jurisdiction Metadata for kft_270(2020) id 8d058c09-6749-425c-8e4b-89fe5e4ae2d8", + "key": "8d058c09-6749-425c-8e4b-89fe5e4ae2d8", + "label": "kft_270(2020) metadata", + "value": "25301" + }, + { + "description": "Jurisdiction Metadata for kft_260(2020) id 40adedf5-0ce9-42a0-96c2-89268152c520", + "key": "40adedf5-0ce9-42a0-96c2-89268152c520", + "label": "kft_260(2020) metadata", + "value": "25302" + }, + { + "description": "Jurisdiction Metadata for kft_94(2020) id 6570ad5e-a1d0-45c7-9525-2565b71ed960", + "key": "6570ad5e-a1d0-45c7-9525-2565b71ed960", + "label": "kft_94(2020) metadata", + "value": "25303" + }, + { + "description": "Jurisdiction Metadata for kft_298(2020) id b2f02a82-724b-497b-b184-c1ca891eda1f", + "key": "b2f02a82-724b-497b-b184-c1ca891eda1f", + "label": "kft_298(2020) metadata", + "value": "25304" + }, + { + "description": "Jurisdiction Metadata for kft_59(2020) id b7210565-5c35-4f23-b12e-dbfada721e51", + "key": "b7210565-5c35-4f23-b12e-dbfada721e51", + "label": "kft_59(2020) metadata", + "value": "25305" + }, + { + "description": "Jurisdiction Metadata for kft_58(2020) id 6aea4f5f-ea75-4355-a385-6da95708aa51", + "key": "6aea4f5f-ea75-4355-a385-6da95708aa51", + "label": "kft_58(2020) metadata", + "value": "25306" + }, + { + "description": "Jurisdiction Metadata for kft_63(2020) id a728396d-ecee-478d-9fc5-7be7b9363217", + "key": "a728396d-ecee-478d-9fc5-7be7b9363217", + "label": "kft_63(2020) metadata", + "value": "25307" + }, + { + "description": "Jurisdiction Metadata for kft_226(2020) id b6177ce7-cad0-4f81-a819-9ada32cf5ece", + "key": "b6177ce7-cad0-4f81-a819-9ada32cf5ece", + "label": "kft_226(2020) metadata", + "value": "25308" + }, + { + "description": "Jurisdiction Metadata for kft_183(2020) id 5e203579-de81-4bf6-b203-41f6bcd6d3f0", + "key": "5e203579-de81-4bf6-b203-41f6bcd6d3f0", + "label": "kft_183(2020) metadata", + "value": "25309" + }, + { + "description": "Jurisdiction Metadata for kft_182(2020) id 17f3ae39-4810-4e53-874a-f72e99ec17c2", + "key": "17f3ae39-4810-4e53-874a-f72e99ec17c2", + "label": "kft_182(2020) metadata", + "value": "25310" + }, + { + "description": "Jurisdiction Metadata for kft_199(2020) id 1b8323b8-28fd-472f-9ba2-4d9fd69467f7", + "key": "1b8323b8-28fd-472f-9ba2-4d9fd69467f7", + "label": "kft_199(2020) metadata", + "value": "25311" + }, + { + "description": "Jurisdiction Metadata for kft_161(2020) id f2ae9561-79a8-46da-95c1-b80afb760462", + "key": "f2ae9561-79a8-46da-95c1-b80afb760462", + "label": "kft_161(2020) metadata", + "value": "25312" + }, + { + "description": "Jurisdiction Metadata for kft_112(2020) id 674313aa-dbd1-428d-b0d8-2ce9b64bee93", + "key": "674313aa-dbd1-428d-b0d8-2ce9b64bee93", + "label": "kft_112(2020) metadata", + "value": "25313" + }, + { + "description": "Jurisdiction Metadata for kft_224(2020) id feafd748-fa6a-44c6-b82f-bae0915eb6d8", + "key": "feafd748-fa6a-44c6-b82f-bae0915eb6d8", + "label": "kft_224(2020) metadata", + "value": "25314" + }, + { + "description": "Jurisdiction Metadata for kft_284(2020) id 200dd1c2-02b3-4626-a1a4-5343cbffe252", + "key": "200dd1c2-02b3-4626-a1a4-5343cbffe252", + "label": "kft_284(2020) metadata", + "value": "25315" + }, + { + "description": "Jurisdiction Metadata for kft_255(2020) id ea7a9e10-8fcc-44fc-b07b-3df11950d0d2", + "key": "ea7a9e10-8fcc-44fc-b07b-3df11950d0d2", + "label": "kft_255(2020) metadata", + "value": "25316" + }, + { + "description": "Jurisdiction Metadata for kft_170(2020) id 8affdda1-6496-41d3-9028-41113592c068", + "key": "8affdda1-6496-41d3-9028-41113592c068", + "label": "kft_170(2020) metadata", + "value": "25317" + }, + { + "description": "Jurisdiction Metadata for kft_185(2020) id 72339480-587a-43b6-bfb0-25437687eeba", + "key": "72339480-587a-43b6-bfb0-25437687eeba", + "label": "kft_185(2020) metadata", + "value": "25318" + }, + { + "description": "Jurisdiction Metadata for Kafwala Zone id 6fc2902e-ffa7-4bf7-8a5a-d3fe798a0dec", + "key": "6fc2902e-ffa7-4bf7-8a5a-d3fe798a0dec", + "label": "Kafwala Zone metadata", + "value": "25319" + }, + { + "description": "Jurisdiction Metadata for kft_1(2020) id 8e8164bb-9c69-44f0-9f9d-a2cb8602e65b", + "key": "8e8164bb-9c69-44f0-9f9d-a2cb8602e65b", + "label": "kft_1(2020) metadata", + "value": "25320" + }, + { + "description": "Jurisdiction Metadata for kft_286(2020) id 06d03efd-b5f9-4c75-b8d6-499f740722cd", + "key": "06d03efd-b5f9-4c75-b8d6-499f740722cd", + "label": "kft_286(2020) metadata", + "value": "25321" + }, + { + "description": "Jurisdiction Metadata for kft_244(2020) id 222bfa62-2d1a-4752-8d4b-16d0c5776d89", + "key": "222bfa62-2d1a-4752-8d4b-16d0c5776d89", + "label": "kft_244(2020) metadata", + "value": "25322" + }, + { + "description": "Jurisdiction Metadata for kft_83(2020) id 167efc44-c694-4dd7-86e9-91ac0a8e94bd", + "key": "167efc44-c694-4dd7-86e9-91ac0a8e94bd", + "label": "kft_83(2020) metadata", + "value": "25323" + }, + { + "description": "Jurisdiction Metadata for kft_346(2020) id 9339eae8-edf9-4c0c-9b4c-af88f12c3090", + "key": "9339eae8-edf9-4c0c-9b4c-af88f12c3090", + "label": "kft_346(2020) metadata", + "value": "25324" + }, + { + "description": "Jurisdiction Metadata for kft_261(2020) id 2d8b50d1-c377-4053-8db3-e56ed48b51e2", + "key": "2d8b50d1-c377-4053-8db3-e56ed48b51e2", + "label": "kft_261(2020) metadata", + "value": "25325" + }, + { + "description": "Jurisdiction Metadata for kft_186(2020) id c36295e6-189f-4aed-b8a8-022d92388c26", + "key": "c36295e6-189f-4aed-b8a8-022d92388c26", + "label": "kft_186(2020) metadata", + "value": "25326" + }, + { + "description": "Jurisdiction Metadata for kft_245(2020) id 6709cc44-7b55-4589-ba9b-b85b6b54e2d3", + "key": "6709cc44-7b55-4589-ba9b-b85b6b54e2d3", + "label": "kft_245(2020) metadata", + "value": "25327" + }, + { + "description": "Jurisdiction Metadata for kft_309(2020) id 7820ebef-a17b-477c-b1bc-4d1ab956f355", + "key": "7820ebef-a17b-477c-b1bc-4d1ab956f355", + "label": "kft_309(2020) metadata", + "value": "25328" + }, + { + "description": "Jurisdiction Metadata for kft_262(2020) id 8fb53076-ce94-4e62-b248-5cff0aba6794", + "key": "8fb53076-ce94-4e62-b248-5cff0aba6794", + "label": "kft_262(2020) metadata", + "value": "25329" + }, + { + "description": "Jurisdiction Metadata for Shemanueli Zone id b31323cd-13ec-4cbe-be11-8720b1c4d651", + "key": "b31323cd-13ec-4cbe-be11-8720b1c4d651", + "label": "Shemanueli Zone metadata", + "value": "25330" + }, + { + "description": "Jurisdiction Metadata for kft_154(2020) id b4a14017-b31a-4c52-8c63-4ca445c9cc5e", + "key": "b4a14017-b31a-4c52-8c63-4ca445c9cc5e", + "label": "kft_154(2020) metadata", + "value": "25331" + }, + { + "description": "Jurisdiction Metadata for kft_313(2020) id 09dea480-421b-475b-84a7-8ad4ccb3af8d", + "key": "09dea480-421b-475b-84a7-8ad4ccb3af8d", + "label": "kft_313(2020) metadata", + "value": "25332" + }, + { + "description": "Jurisdiction Metadata for kft_205(2020) id a6feeab3-236a-477a-b100-2790d545f38b", + "key": "a6feeab3-236a-477a-b100-2790d545f38b", + "label": "kft_205(2020) metadata", + "value": "25333" + }, + { + "description": "Jurisdiction Metadata for kft_118(2020) id 79d8adad-7092-49d2-8bd7-742a3d349c71", + "key": "79d8adad-7092-49d2-8bd7-742a3d349c71", + "label": "kft_118(2020) metadata", + "value": "25334" + }, + { + "description": "Jurisdiction Metadata for kft_69(2020) id 39ae4684-d915-47e9-8284-d5d9f3980a76", + "key": "39ae4684-d915-47e9-8284-d5d9f3980a76", + "label": "kft_69(2020) metadata", + "value": "25335" + }, + { + "description": "Jurisdiction Metadata for kft_146(2020) id d1fcc559-0d18-44d4-88c5-329a3143d4fc", + "key": "d1fcc559-0d18-44d4-88c5-329a3143d4fc", + "label": "kft_146(2020) metadata", + "value": "25336" + }, + { + "description": "Jurisdiction Metadata for kft_194(2020) id 3e5d8d9d-1966-4824-9c21-31e3b8d4ffdf", + "key": "3e5d8d9d-1966-4824-9c21-31e3b8d4ffdf", + "label": "kft_194(2020) metadata", + "value": "25337" + }, + { + "description": "Jurisdiction Metadata for kft_265(2020) id 44593a3c-8772-4d56-90ed-5b5d798dd7ae", + "key": "44593a3c-8772-4d56-90ed-5b5d798dd7ae", + "label": "kft_265(2020) metadata", + "value": "25338" + }, + { + "description": "Jurisdiction Metadata for kft_61(2020) id 91033525-94dd-4640-9347-e827e602804c", + "key": "91033525-94dd-4640-9347-e827e602804c", + "label": "kft_61(2020) metadata", + "value": "25339" + }, + { + "description": "Jurisdiction Metadata for kft_206(2020) id 8dd1fc94-20c1-4ebc-a336-a7066c265966", + "key": "8dd1fc94-20c1-4ebc-a336-a7066c265966", + "label": "kft_206(2020) metadata", + "value": "25340" + }, + { + "description": "Jurisdiction Metadata for kft_121(2020) id 4aebd765-23b3-40ba-b4e8-e16f837ed376", + "key": "4aebd765-23b3-40ba-b4e8-e16f837ed376", + "label": "kft_121(2020) metadata", + "value": "25341" + }, + { + "description": "Jurisdiction Metadata for kft_331(2020) id bce41335-e175-43a0-9e8a-8255cb2177ef", + "key": "bce41335-e175-43a0-9e8a-8255cb2177ef", + "label": "kft_331(2020) metadata", + "value": "25342" + }, + { + "description": "Jurisdiction Metadata for kft_132(2020) id a0651b27-0752-4fde-a302-79a21bdcb848", + "key": "a0651b27-0752-4fde-a302-79a21bdcb848", + "label": "kft_132(2020) metadata", + "value": "25343" + }, + { + "description": "Jurisdiction Metadata for kft_190(2020) id cc61f89b-b453-4c78-a986-50edc2236cb7", + "key": "cc61f89b-b453-4c78-a986-50edc2236cb7", + "label": "kft_190(2020) metadata", + "value": "25344" + }, + { + "description": "Jurisdiction Metadata for kft_337(2020) id 43fe23fa-63d1-4710-9a04-c0402395c803", + "key": "43fe23fa-63d1-4710-9a04-c0402395c803", + "label": "kft_337(2020) metadata", + "value": "25345" + }, + { + "description": "Jurisdiction Metadata for kft_152(2020) id a11fb2f5-2011-45aa-ba50-186550ec6293", + "key": "a11fb2f5-2011-45aa-ba50-186550ec6293", + "label": "kft_152(2020) metadata", + "value": "25346" + }, + { + "description": "Jurisdiction Metadata for kft_308(2020) id 7950e827-50cd-4280-b16e-27e6a0df65c7", + "key": "7950e827-50cd-4280-b16e-27e6a0df65c7", + "label": "kft_308(2020) metadata", + "value": "25347" + }, + { + "description": "Jurisdiction Metadata for kft_17(2020) id 267301fe-82a2-4180-a199-fd9fdaab7191", + "key": "267301fe-82a2-4180-a199-fd9fdaab7191", + "label": "kft_17(2020) metadata", + "value": "25348" + }, + { + "description": "Jurisdiction Metadata for kft_281(2020) id 5e9419d7-1f7f-414e-9ccc-56ae8112fc25", + "key": "5e9419d7-1f7f-414e-9ccc-56ae8112fc25", + "label": "kft_281(2020) metadata", + "value": "25349" + }, + { + "description": "Jurisdiction Metadata for kft_150(2020) id 88d41fcb-029e-4d80-a7e4-5e0e01f42be7", + "key": "88d41fcb-029e-4d80-a7e4-5e0e01f42be7", + "label": "kft_150(2020) metadata", + "value": "25350" + }, + { + "description": "Jurisdiction Metadata for kft_107(2020) id 295dcc58-9f2c-4298-9492-1ab9856c4de4", + "key": "295dcc58-9f2c-4298-9492-1ab9856c4de4", + "label": "kft_107(2020) metadata", + "value": "25351" + }, + { + "description": "Jurisdiction Metadata for kft_84(2020) id 2ac58b2d-c821-4a2c-9e26-33d959bc4ccc", + "key": "2ac58b2d-c821-4a2c-9e26-33d959bc4ccc", + "label": "kft_84(2020) metadata", + "value": "25352" + }, + { + "description": "Jurisdiction Metadata for kft_321(2020) id 581ecc45-f78f-4f54-b69b-af39c33d6cba", + "key": "581ecc45-f78f-4f54-b69b-af39c33d6cba", + "label": "kft_321(2020) metadata", + "value": "25353" + }, + { + "description": "Jurisdiction Metadata for kft_214(2020) id 75de15ff-db69-424a-845d-23ec9e28ff41", + "key": "75de15ff-db69-424a-845d-23ec9e28ff41", + "label": "kft_214(2020) metadata", + "value": "25354" + }, + { + "description": "Jurisdiction Metadata for kft_330(2020) id bb6c27bb-4b66-4df7-836a-6a09c6f68d49", + "key": "bb6c27bb-4b66-4df7-836a-6a09c6f68d49", + "label": "kft_330(2020) metadata", + "value": "25355" + }, + { + "description": "Jurisdiction Metadata for kft_250(2020) id df80fbe5-4255-4782-b585-8cb55ab11ec6", + "key": "df80fbe5-4255-4782-b585-8cb55ab11ec6", + "label": "kft_250(2020) metadata", + "value": "25356" + }, + { + "description": "Jurisdiction Metadata for kft_114(2020) id ddf37d19-1d34-4b7a-8ebb-600436fb81c2", + "key": "ddf37d19-1d34-4b7a-8ebb-600436fb81c2", + "label": "kft_114(2020) metadata", + "value": "25357" + }, + { + "description": "Jurisdiction Metadata for kft_249(2020) id e2e957f5-e732-44d9-b091-31c34cc337f8", + "key": "e2e957f5-e732-44d9-b091-31c34cc337f8", + "label": "kft_249(2020) metadata", + "value": "25358" + }, + { + "description": "Jurisdiction Metadata for kft_253(2020) id 1a3731aa-7907-402f-8f4b-539925ef02f3", + "key": "1a3731aa-7907-402f-8f4b-539925ef02f3", + "label": "kft_253(2020) metadata", + "value": "25359" + }, + { + "description": "Jurisdiction Metadata for kft_15(2020) id c01ed746-91ee-4d46-a762-13434299914a", + "key": "c01ed746-91ee-4d46-a762-13434299914a", + "label": "kft_15(2020) metadata", + "value": "25360" + }, + { + "description": "Jurisdiction Metadata for kft_31(2020) id 2e24212e-2ef7-45b4-b7cc-f3858a68c185", + "key": "2e24212e-2ef7-45b4-b7cc-f3858a68c185", + "label": "kft_31(2020) metadata", + "value": "25361" + }, + { + "description": "Jurisdiction Metadata for kft_292(2020) id e902e709-3daf-4b02-8b2f-150923752277", + "key": "e902e709-3daf-4b02-8b2f-150923752277", + "label": "kft_292(2020) metadata", + "value": "25362" + }, + { + "description": "Jurisdiction Metadata for kft_322(2020) id b804ba3a-6fe6-4404-8866-ed87d60c4694", + "key": "b804ba3a-6fe6-4404-8866-ed87d60c4694", + "label": "kft_322(2020) metadata", + "value": "25363" + }, + { + "description": "Jurisdiction Metadata for kft_60(2020) id 7304e19f-0e0a-4cad-9f3f-306b23911eb7", + "key": "7304e19f-0e0a-4cad-9f3f-306b23911eb7", + "label": "kft_60(2020) metadata", + "value": "25364" + }, + { + "description": "Jurisdiction Metadata for kft_54(2020) id b1a90106-62a6-4959-a1a4-5829602ebf14", + "key": "b1a90106-62a6-4959-a1a4-5829602ebf14", + "label": "kft_54(2020) metadata", + "value": "25365" + }, + { + "description": "Jurisdiction Metadata for kft_12(2020) id 24368207-2666-4102-8322-bf39c4d5fafd", + "key": "24368207-2666-4102-8322-bf39c4d5fafd", + "label": "kft_12(2020) metadata", + "value": "25366" + }, + { + "description": "Jurisdiction Metadata for kft_177(2020) id fab1f774-7185-452a-9ef7-a575d4f4c611", + "key": "fab1f774-7185-452a-9ef7-a575d4f4c611", + "label": "kft_177(2020) metadata", + "value": "25367" + }, + { + "description": "Jurisdiction Metadata for kft_282(2020) id 51898c41-8053-424a-9983-326e1612c109", + "key": "51898c41-8053-424a-9983-326e1612c109", + "label": "kft_282(2020) metadata", + "value": "25368" + }, + { + "description": "Jurisdiction Metadata for kft_18(2020) id 323cac3b-cc8d-4b13-8fd4-a801840946f7", + "key": "323cac3b-cc8d-4b13-8fd4-a801840946f7", + "label": "kft_18(2020) metadata", + "value": "25369" + }, + { + "description": "Jurisdiction Metadata for kft_248(2020) id ff494b0c-a673-41e3-ad4e-fd26af5eeff5", + "key": "ff494b0c-a673-41e3-ad4e-fd26af5eeff5", + "label": "kft_248(2020) metadata", + "value": "25370" + }, + { + "description": "Jurisdiction Metadata for kft_89(2020) id 040c940e-1693-401c-975c-97f0e8d0be73", + "key": "040c940e-1693-401c-975c-97f0e8d0be73", + "label": "kft_89(2020) metadata", + "value": "25371" + }, + { + "description": "Jurisdiction Metadata for kft_207(2020) id 8dd1a4f0-416d-4ca4-8f71-d1b6b5b83f5d", + "key": "8dd1a4f0-416d-4ca4-8f71-d1b6b5b83f5d", + "label": "kft_207(2020) metadata", + "value": "25372" + }, + { + "description": "Jurisdiction Metadata for kft_211(2020) id 147c3e00-b4bb-4961-8bc7-54546ebddb2d", + "key": "147c3e00-b4bb-4961-8bc7-54546ebddb2d", + "label": "kft_211(2020) metadata", + "value": "25373" + }, + { + "description": "Jurisdiction Metadata for kft_332(2020) id 023c4ebf-738d-4cba-b182-9208673646c1", + "key": "023c4ebf-738d-4cba-b182-9208673646c1", + "label": "kft_332(2020) metadata", + "value": "25374" + }, + { + "description": "Jurisdiction Metadata for kft_295(2020) id d36ecbfe-7ea3-4fba-9a76-5987da26b1ea", + "key": "d36ecbfe-7ea3-4fba-9a76-5987da26b1ea", + "label": "kft_295(2020) metadata", + "value": "25375" + }, + { + "description": "Jurisdiction Metadata for kft_280(2020) id 10ca4922-b1b7-45d3-bb89-cbed12d6a35c", + "key": "10ca4922-b1b7-45d3-bb89-cbed12d6a35c", + "label": "kft_280(2020) metadata", + "value": "25376" + }, + { + "description": "Jurisdiction Metadata for kft_212(2020) id aed32141-0f65-4819-9bde-4d98c3e880bb", + "key": "aed32141-0f65-4819-9bde-4d98c3e880bb", + "label": "kft_212(2020) metadata", + "value": "25377" + }, + { + "description": "Jurisdiction Metadata for kft_251(2020) id d6faed2a-189f-49b6-873a-cee3067fe6cb", + "key": "d6faed2a-189f-49b6-873a-cee3067fe6cb", + "label": "kft_251(2020) metadata", + "value": "25378" + }, + { + "description": "Jurisdiction Metadata for kft_252(2020) id 74f33210-2d81-473d-a27b-3255c99d32c9", + "key": "74f33210-2d81-473d-a27b-3255c99d32c9", + "label": "kft_252(2020) metadata", + "value": "25379" + }, + { + "description": "Jurisdiction Metadata for kft_86(2020) id 7267c7b8-1f23-483c-b04d-3bfca5ee384a", + "key": "7267c7b8-1f23-483c-b04d-3bfca5ee384a", + "label": "kft_86(2020) metadata", + "value": "25380" + }, + { + "description": "Jurisdiction Metadata for kft_254(2020) id e2110ee8-a822-461d-a369-f2bf8a168f3d", + "key": "e2110ee8-a822-461d-a369-f2bf8a168f3d", + "label": "kft_254(2020) metadata", + "value": "25381" + }, + { + "description": "Jurisdiction Metadata for kft_169(2020) id f8410624-adcd-45d8-8e84-74f741df850f", + "key": "f8410624-adcd-45d8-8e84-74f741df850f", + "label": "kft_169(2020) metadata", + "value": "25382" + }, + { + "description": "Jurisdiction Metadata for kft_288(2020) id b292438b-c80b-443c-ad9e-9876a56b0d65", + "key": "b292438b-c80b-443c-ad9e-9876a56b0d65", + "label": "kft_288(2020) metadata", + "value": "25383" + }, + { + "description": "Jurisdiction Metadata for kft_215(2020) id 0c8cf2ef-9aab-4dd6-8aa0-b27763021b64", + "key": "0c8cf2ef-9aab-4dd6-8aa0-b27763021b64", + "label": "kft_215(2020) metadata", + "value": "25384" + }, + { + "description": "Jurisdiction Metadata for kft_209(2020) id 40cf0e40-342d-4c1a-b8c2-e2a9e3bbc478", + "key": "40cf0e40-342d-4c1a-b8c2-e2a9e3bbc478", + "label": "kft_209(2020) metadata", + "value": "25385" + }, + { + "description": "Jurisdiction Metadata for kft_104(2020) id c89d754b-2eb2-4560-b4ea-a3ac3d0f2db4", + "key": "c89d754b-2eb2-4560-b4ea-a3ac3d0f2db4", + "label": "kft_104(2020) metadata", + "value": "25386" + }, + { + "description": "Jurisdiction Metadata for kft_306(2020) id f17d125d-9951-47b5-90cc-0506e24efff6", + "key": "f17d125d-9951-47b5-90cc-0506e24efff6", + "label": "kft_306(2020) metadata", + "value": "25387" + }, + { + "description": "Jurisdiction Metadata for kft_303(2020) id 1bbfeb29-72a9-4e83-9e2b-f04ab041a2ec", + "key": "1bbfeb29-72a9-4e83-9e2b-f04ab041a2ec", + "label": "kft_303(2020) metadata", + "value": "25388" + }, + { + "description": "Jurisdiction Metadata for Kabuta(2020) id 2814945f-982b-41a5-ad16-455182acafff", + "key": "2814945f-982b-41a5-ad16-455182acafff", + "label": "Kabuta(2020) metadata", + "value": "25389" + }, + { + "description": "Jurisdiction Metadata for Mulonda id 1357363f-b8b2-4980-9faf-97aae7139e28", + "key": "1357363f-b8b2-4980-9faf-97aae7139e28", + "label": "Mulonda metadata", + "value": "25390" + }, + { + "description": "Jurisdiction Metadata for kbt_6(2020) id cf8f72a5-2c2c-4860-923e-6403b03856f2", + "key": "cf8f72a5-2c2c-4860-923e-6403b03856f2", + "label": "kbt_6(2020) metadata", + "value": "25391" + }, + { + "description": "Jurisdiction Metadata for Kabuta East id a2791d42-8838-4ee9-9ca5-cffcf0ffa30f", + "key": "a2791d42-8838-4ee9-9ca5-cffcf0ffa30f", + "label": "Kabuta East metadata", + "value": "25392" + }, + { + "description": "Jurisdiction Metadata for kbt_160(2020) id 3fe14868-e334-4f66-bdeb-cb6f3c7158b4", + "key": "3fe14868-e334-4f66-bdeb-cb6f3c7158b4", + "label": "kbt_160(2020) metadata", + "value": "25393" + }, + { + "description": "Jurisdiction Metadata for kbt_242(2020) id f6add0c8-127a-4dd3-aa6d-f13ea16de31b", + "key": "f6add0c8-127a-4dd3-aa6d-f13ea16de31b", + "label": "kbt_242(2020) metadata", + "value": "25394" + }, + { + "description": "Jurisdiction Metadata for kbt_85(2020) id bec53c62-7c60-4eed-8d10-adac75ccf357", + "key": "bec53c62-7c60-4eed-8d10-adac75ccf357", + "label": "kbt_85(2020) metadata", + "value": "25395" + }, + { + "description": "Jurisdiction Metadata for kbt_128(2020) id 2a40c6d4-ad9a-4fc9-8e16-b8c539ce1fa6", + "key": "2a40c6d4-ad9a-4fc9-8e16-b8c539ce1fa6", + "label": "kbt_128(2020) metadata", + "value": "25396" + }, + { + "description": "Jurisdiction Metadata for kbt_48(2020) id cef10d32-4719-4664-8424-f99a116c1c9b", + "key": "cef10d32-4719-4664-8424-f99a116c1c9b", + "label": "kbt_48(2020) metadata", + "value": "25397" + }, + { + "description": "Jurisdiction Metadata for kbt_54(2020) id 25dcda53-8500-4c46-8b8f-c368546cca98", + "key": "25dcda53-8500-4c46-8b8f-c368546cca98", + "label": "kbt_54(2020) metadata", + "value": "25398" + }, + { + "description": "Jurisdiction Metadata for kbt_89(2020) id e850fd30-5910-473a-933b-613b73420240", + "key": "e850fd30-5910-473a-933b-613b73420240", + "label": "kbt_89(2020) metadata", + "value": "25399" + }, + { + "description": "Jurisdiction Metadata for kbt_51(2020) id bc09099e-212f-4ca5-93a9-f276dfd0dbda", + "key": "bc09099e-212f-4ca5-93a9-f276dfd0dbda", + "label": "kbt_51(2020) metadata", + "value": "25400" + }, + { + "description": "Jurisdiction Metadata for kbt_210(2020) id f6e60d56-e977-45ad-8d04-d56dc89a8ff1", + "key": "f6e60d56-e977-45ad-8d04-d56dc89a8ff1", + "label": "kbt_210(2020) metadata", + "value": "25401" + }, + { + "description": "Jurisdiction Metadata for kbt_168(2020) id 340f5cb9-cd08-4784-a344-2d3fda6f90bb", + "key": "340f5cb9-cd08-4784-a344-2d3fda6f90bb", + "label": "kbt_168(2020) metadata", + "value": "25402" + }, + { + "description": "Jurisdiction Metadata for kbt_141(2020) id 65febcd9-3588-4bd1-be92-802cb12dc7ca", + "key": "65febcd9-3588-4bd1-be92-802cb12dc7ca", + "label": "kbt_141(2020) metadata", + "value": "25403" + }, + { + "description": "Jurisdiction Metadata for kbt_44(2020) id 8097a15d-a37f-4b61-bda7-8c648feb2b9a", + "key": "8097a15d-a37f-4b61-bda7-8c648feb2b9a", + "label": "kbt_44(2020) metadata", + "value": "25404" + }, + { + "description": "Jurisdiction Metadata for kbt_228(2020) id 48104084-4303-4019-ac6b-a39828e74189", + "key": "48104084-4303-4019-ac6b-a39828e74189", + "label": "kbt_228(2020) metadata", + "value": "25405" + }, + { + "description": "Jurisdiction Metadata for kbt_195(2020) id 52e15787-c136-46ef-8b54-3a20d3a04540", + "key": "52e15787-c136-46ef-8b54-3a20d3a04540", + "label": "kbt_195(2020) metadata", + "value": "25406" + }, + { + "description": "Jurisdiction Metadata for kbt_236(2020) id cea8b065-e0cb-4d82-9242-ffd37cac9d34", + "key": "cea8b065-e0cb-4d82-9242-ffd37cac9d34", + "label": "kbt_236(2020) metadata", + "value": "25407" + }, + { + "description": "Jurisdiction Metadata for kbt_68(2020) id 03384610-dd8f-4530-aa78-fcd32bcb0e6e", + "key": "03384610-dd8f-4530-aa78-fcd32bcb0e6e", + "label": "kbt_68(2020) metadata", + "value": "25408" + }, + { + "description": "Jurisdiction Metadata for kbt_17(2020) id 01cf87e4-84b4-496c-84cf-859c5da74f14", + "key": "01cf87e4-84b4-496c-84cf-859c5da74f14", + "label": "kbt_17(2020) metadata", + "value": "25409" + }, + { + "description": "Jurisdiction Metadata for kbt_200(2020) id f3616ec2-9a74-4353-80bd-99bd1c3430da", + "key": "f3616ec2-9a74-4353-80bd-99bd1c3430da", + "label": "kbt_200(2020) metadata", + "value": "25410" + }, + { + "description": "Jurisdiction Metadata for kbt_33(2020) id 4ee4856e-3ea6-4343-983a-d0e455d994a6", + "key": "4ee4856e-3ea6-4343-983a-d0e455d994a6", + "label": "kbt_33(2020) metadata", + "value": "25411" + }, + { + "description": "Jurisdiction Metadata for kbt_119(2020) id e96c4910-ba92-4cf0-aa3a-22e846be8882", + "key": "e96c4910-ba92-4cf0-aa3a-22e846be8882", + "label": "kbt_119(2020) metadata", + "value": "25412" + }, + { + "description": "Jurisdiction Metadata for kbt_146(2020) id df4347db-8061-4852-846c-ce9137f8c587", + "key": "df4347db-8061-4852-846c-ce9137f8c587", + "label": "kbt_146(2020) metadata", + "value": "25413" + }, + { + "description": "Jurisdiction Metadata for kbt_67(2020) id 6cffadd1-927c-4dc0-9a14-90b1e7c05866", + "key": "6cffadd1-927c-4dc0-9a14-90b1e7c05866", + "label": "kbt_67(2020) metadata", + "value": "25414" + }, + { + "description": "Jurisdiction Metadata for kbt_142(2020) id 52bf8887-c862-4a9b-a51f-b65dc73045b7", + "key": "52bf8887-c862-4a9b-a51f-b65dc73045b7", + "label": "kbt_142(2020) metadata", + "value": "25415" + }, + { + "description": "Jurisdiction Metadata for kbt_18(2020) id e0144482-e577-4dab-8f75-a86199008ea4", + "key": "e0144482-e577-4dab-8f75-a86199008ea4", + "label": "kbt_18(2020) metadata", + "value": "25416" + }, + { + "description": "Jurisdiction Metadata for kbt_32(2020) id a4819865-fb8b-4065-828b-5b1b27e66081", + "key": "a4819865-fb8b-4065-828b-5b1b27e66081", + "label": "kbt_32(2020) metadata", + "value": "25417" + }, + { + "description": "Jurisdiction Metadata for kbt_234(2020) id c4850898-0a0c-41db-949a-dc1a6e3666ab", + "key": "c4850898-0a0c-41db-949a-dc1a6e3666ab", + "label": "kbt_234(2020) metadata", + "value": "25418" + }, + { + "description": "Jurisdiction Metadata for kbt_178(2020) id 647b0a57-9cb6-4905-9a45-d85bf1d0535c", + "key": "647b0a57-9cb6-4905-9a45-d85bf1d0535c", + "label": "kbt_178(2020) metadata", + "value": "25419" + }, + { + "description": "Jurisdiction Metadata for kbt_226(2020) id 731d6495-8417-498f-bbb6-5ef1514ea0ce", + "key": "731d6495-8417-498f-bbb6-5ef1514ea0ce", + "label": "kbt_226(2020) metadata", + "value": "25420" + }, + { + "description": "Jurisdiction Metadata for kbt_25(2020) id 84f66d1b-115d-4440-ba52-9976ccd320eb", + "key": "84f66d1b-115d-4440-ba52-9976ccd320eb", + "label": "kbt_25(2020) metadata", + "value": "25421" + }, + { + "description": "Jurisdiction Metadata for kbt_223(2020) id 0c7db45b-5e37-4567-9f34-49395d9f8422", + "key": "0c7db45b-5e37-4567-9f34-49395d9f8422", + "label": "kbt_223(2020) metadata", + "value": "25422" + }, + { + "description": "Jurisdiction Metadata for kbt_216(2020) id fb9e35f9-ab15-4faa-a397-ad32dcf2560d", + "key": "fb9e35f9-ab15-4faa-a397-ad32dcf2560d", + "label": "kbt_216(2020) metadata", + "value": "25423" + }, + { + "description": "Jurisdiction Metadata for kbt_209(2020) id 4f6fcdbc-6435-4903-840d-d78b30eaf833", + "key": "4f6fcdbc-6435-4903-840d-d78b30eaf833", + "label": "kbt_209(2020) metadata", + "value": "25424" + }, + { + "description": "Jurisdiction Metadata for kbt_82(2020) id b5fe26c9-56a2-44d2-9319-a325a8947e95", + "key": "b5fe26c9-56a2-44d2-9319-a325a8947e95", + "label": "kbt_82(2020) metadata", + "value": "25425" + }, + { + "description": "Jurisdiction Metadata for kbt_231(2020) id 5d84a527-64f8-4d83-8a32-f53fe8fb2f5a", + "key": "5d84a527-64f8-4d83-8a32-f53fe8fb2f5a", + "label": "kbt_231(2020) metadata", + "value": "25426" + }, + { + "description": "Jurisdiction Metadata for kbt_98(2020) id a886d356-8e88-40a9-9068-5c4f4e386f46", + "key": "a886d356-8e88-40a9-9068-5c4f4e386f46", + "label": "kbt_98(2020) metadata", + "value": "25427" + }, + { + "description": "Jurisdiction Metadata for kbt_73(2020) id d576f3aa-8831-47a7-bed7-4c6691b7055d", + "key": "d576f3aa-8831-47a7-bed7-4c6691b7055d", + "label": "kbt_73(2020) metadata", + "value": "25428" + }, + { + "description": "Jurisdiction Metadata for kbt_47(2020) id 061e81e4-f01e-4e08-b3d1-1a4ad705d746", + "key": "061e81e4-f01e-4e08-b3d1-1a4ad705d746", + "label": "kbt_47(2020) metadata", + "value": "25429" + }, + { + "description": "Jurisdiction Metadata for kbt_190(2020) id f520e8f1-e82b-449f-8f14-e041485d48d1", + "key": "f520e8f1-e82b-449f-8f14-e041485d48d1", + "label": "kbt_190(2020) metadata", + "value": "25430" + }, + { + "description": "Jurisdiction Metadata for kbt_211(2020) id 49b3cc1d-3aa9-4c1a-bf1d-17a8a9dbae7f", + "key": "49b3cc1d-3aa9-4c1a-bf1d-17a8a9dbae7f", + "label": "kbt_211(2020) metadata", + "value": "25431" + }, + { + "description": "Jurisdiction Metadata for kbt_197(2020) id 730a5e00-fc07-472a-b86d-e9635fc4f605", + "key": "730a5e00-fc07-472a-b86d-e9635fc4f605", + "label": "kbt_197(2020) metadata", + "value": "25432" + }, + { + "description": "Jurisdiction Metadata for kbt_240(2020) id a6c0fd71-6203-4603-b82a-cf988b1e9f5c", + "key": "a6c0fd71-6203-4603-b82a-cf988b1e9f5c", + "label": "kbt_240(2020) metadata", + "value": "25433" + }, + { + "description": "Jurisdiction Metadata for kbt_213(2020) id ab669a3b-0f9c-4d98-b14e-2752a11ac9a1", + "key": "ab669a3b-0f9c-4d98-b14e-2752a11ac9a1", + "label": "kbt_213(2020) metadata", + "value": "25434" + }, + { + "description": "Jurisdiction Metadata for kbt_75(2020) id 3d714cf0-28bc-40ad-858f-c123aba96806", + "key": "3d714cf0-28bc-40ad-858f-c123aba96806", + "label": "kbt_75(2020) metadata", + "value": "25435" + }, + { + "description": "Jurisdiction Metadata for kbt_86(2020) id 841624d8-0f84-4aa5-ac37-5255e1464825", + "key": "841624d8-0f84-4aa5-ac37-5255e1464825", + "label": "kbt_86(2020) metadata", + "value": "25436" + }, + { + "description": "Jurisdiction Metadata for kbt_247(2020) id 87430e57-eca8-4622-aaa1-05d9600a2648", + "key": "87430e57-eca8-4622-aaa1-05d9600a2648", + "label": "kbt_247(2020) metadata", + "value": "25437" + }, + { + "description": "Jurisdiction Metadata for kbt_14(2020) id c7f89cf1-26e4-4d9b-ac0a-b497c6b60e6d", + "key": "c7f89cf1-26e4-4d9b-ac0a-b497c6b60e6d", + "label": "kbt_14(2020) metadata", + "value": "25438" + }, + { + "description": "Jurisdiction Metadata for kbt_198(2020) id 44e2841a-3afc-41e8-9a18-faa1a1dc41b6", + "key": "44e2841a-3afc-41e8-9a18-faa1a1dc41b6", + "label": "kbt_198(2020) metadata", + "value": "25439" + }, + { + "description": "Jurisdiction Metadata for kbt_215(2020) id 5fca4aa3-d92c-4d2a-99b1-71858c2f1050", + "key": "5fca4aa3-d92c-4d2a-99b1-71858c2f1050", + "label": "kbt_215(2020) metadata", + "value": "25440" + }, + { + "description": "Jurisdiction Metadata for kbt_84(2020) id 4afe5642-b2f9-48df-a327-0398cb85edd7", + "key": "4afe5642-b2f9-48df-a327-0398cb85edd7", + "label": "kbt_84(2020) metadata", + "value": "25441" + }, + { + "description": "Jurisdiction Metadata for kbt_94(2020) id d7c8032d-68c4-40f9-95ea-f170d970e826", + "key": "d7c8032d-68c4-40f9-95ea-f170d970e826", + "label": "kbt_94(2020) metadata", + "value": "25442" + }, + { + "description": "Jurisdiction Metadata for kbt_181(2020) id 59e58a64-d599-419e-9a38-27b263326f2a", + "key": "59e58a64-d599-419e-9a38-27b263326f2a", + "label": "kbt_181(2020) metadata", + "value": "25443" + }, + { + "description": "Jurisdiction Metadata for kbt_145(2020) id 3d13b8eb-92c7-4243-821f-36f5c124d234", + "key": "3d13b8eb-92c7-4243-821f-36f5c124d234", + "label": "kbt_145(2020) metadata", + "value": "25444" + }, + { + "description": "Jurisdiction Metadata for kbt_167(2020) id 61f57fc7-d450-499d-85ba-17dcca2d8ffc", + "key": "61f57fc7-d450-499d-85ba-17dcca2d8ffc", + "label": "kbt_167(2020) metadata", + "value": "25445" + }, + { + "description": "Jurisdiction Metadata for kbt_159(2020) id 01bd594e-12f8-48aa-9523-457d9e0c152f", + "key": "01bd594e-12f8-48aa-9523-457d9e0c152f", + "label": "kbt_159(2020) metadata", + "value": "25446" + }, + { + "description": "Jurisdiction Metadata for kbt_225(2020) id b394da7c-a499-466f-80f9-25b0203f208c", + "key": "b394da7c-a499-466f-80f9-25b0203f208c", + "label": "kbt_225(2020) metadata", + "value": "25447" + }, + { + "description": "Jurisdiction Metadata for kbt_53(2020) id 8a68f70f-0993-4798-8935-4a15363663f4", + "key": "8a68f70f-0993-4798-8935-4a15363663f4", + "label": "kbt_53(2020) metadata", + "value": "25448" + }, + { + "description": "Jurisdiction Metadata for kbt_165(2020) id 52b38bf6-0eb9-4737-ac34-0898a50e4944", + "key": "52b38bf6-0eb9-4737-ac34-0898a50e4944", + "label": "kbt_165(2020) metadata", + "value": "25449" + }, + { + "description": "Jurisdiction Metadata for kbt_69(2020) id 02cf6736-2d40-480f-aad0-5055098a5a78", + "key": "02cf6736-2d40-480f-aad0-5055098a5a78", + "label": "kbt_69(2020) metadata", + "value": "25450" + }, + { + "description": "Jurisdiction Metadata for kbt_212(2020) id 380a2d5c-7564-45e4-af71-862c79ac9800", + "key": "380a2d5c-7564-45e4-af71-862c79ac9800", + "label": "kbt_212(2020) metadata", + "value": "25451" + }, + { + "description": "Jurisdiction Metadata for kbt_126(2020) id 584f77ba-41b4-4a2f-ae46-851eb08b74a3", + "key": "584f77ba-41b4-4a2f-ae46-851eb08b74a3", + "label": "kbt_126(2020) metadata", + "value": "25452" + }, + { + "description": "Jurisdiction Metadata for kbt_115(2020) id 9b3533d9-a292-41ed-8353-5837176d1ec2", + "key": "9b3533d9-a292-41ed-8353-5837176d1ec2", + "label": "kbt_115(2020) metadata", + "value": "25453" + }, + { + "description": "Jurisdiction Metadata for kbt_163(2020) id ffb6a531-7754-458c-b4f3-55f4f6e6d671", + "key": "ffb6a531-7754-458c-b4f3-55f4f6e6d671", + "label": "kbt_163(2020) metadata", + "value": "25454" + }, + { + "description": "Jurisdiction Metadata for kbt_31(2020) id 9dbe2e6d-0b31-4b97-bf76-f6360a4b79cd", + "key": "9dbe2e6d-0b31-4b97-bf76-f6360a4b79cd", + "label": "kbt_31(2020) metadata", + "value": "25455" + }, + { + "description": "Jurisdiction Metadata for kbt_201(2020) id f39c456c-9a33-43bf-9733-267159b94e7d", + "key": "f39c456c-9a33-43bf-9733-267159b94e7d", + "label": "kbt_201(2020) metadata", + "value": "25456" + }, + { + "description": "Jurisdiction Metadata for kbt_199(2020) id bd492554-b4ea-4149-9765-5ad23417b7f4", + "key": "bd492554-b4ea-4149-9765-5ad23417b7f4", + "label": "kbt_199(2020) metadata", + "value": "25457" + }, + { + "description": "Jurisdiction Metadata for kbt_182(2020) id 794e0188-2144-468b-bb78-34639e074ca6", + "key": "794e0188-2144-468b-bb78-34639e074ca6", + "label": "kbt_182(2020) metadata", + "value": "25458" + }, + { + "description": "Jurisdiction Metadata for kbt_130(2020) id 412d1b76-5d97-4337-876d-8ea4d434fe49", + "key": "412d1b76-5d97-4337-876d-8ea4d434fe49", + "label": "kbt_130(2020) metadata", + "value": "25459" + }, + { + "description": "Jurisdiction Metadata for kbt_241(2020) id d58e77d7-0c16-4009-82e5-0600de5de778", + "key": "d58e77d7-0c16-4009-82e5-0600de5de778", + "label": "kbt_241(2020) metadata", + "value": "25460" + }, + { + "description": "Jurisdiction Metadata for kbt_50(2020) id 2e41c2be-89fd-4d39-9d8f-462166b0adc7", + "key": "2e41c2be-89fd-4d39-9d8f-462166b0adc7", + "label": "kbt_50(2020) metadata", + "value": "25461" + }, + { + "description": "Jurisdiction Metadata for kbt_71(2020) id 9d7efc86-b84d-496c-a291-04b5d600c2e4", + "key": "9d7efc86-b84d-496c-a291-04b5d600c2e4", + "label": "kbt_71(2020) metadata", + "value": "25462" + }, + { + "description": "Jurisdiction Metadata for kbt_15(2020) id 857a7042-8771-4212-ab1c-33fcf5a4468b", + "key": "857a7042-8771-4212-ab1c-33fcf5a4468b", + "label": "kbt_15(2020) metadata", + "value": "25463" + }, + { + "description": "Jurisdiction Metadata for kbt_224(2020) id 843a65c5-8c32-4c52-8529-5de8aff1ba37", + "key": "843a65c5-8c32-4c52-8529-5de8aff1ba37", + "label": "kbt_224(2020) metadata", + "value": "25464" + }, + { + "description": "Jurisdiction Metadata for kbt_171(2020) id 4735b846-c5ea-4c8b-b681-571158c65921", + "key": "4735b846-c5ea-4c8b-b681-571158c65921", + "label": "kbt_171(2020) metadata", + "value": "25465" + }, + { + "description": "Jurisdiction Metadata for kbt_131(2020) id 80e73ef0-0ead-4e6e-9dd8-32f42634fee3", + "key": "80e73ef0-0ead-4e6e-9dd8-32f42634fee3", + "label": "kbt_131(2020) metadata", + "value": "25466" + }, + { + "description": "Jurisdiction Metadata for kbt_162(2020) id f0eee11d-f930-490a-a17a-a0c92df9d4d5", + "key": "f0eee11d-f930-490a-a17a-a0c92df9d4d5", + "label": "kbt_162(2020) metadata", + "value": "25467" + }, + { + "description": "Jurisdiction Metadata for kbt_144(2020) id 3ff8f5b9-97b0-4f59-97d6-70953eb75c57", + "key": "3ff8f5b9-97b0-4f59-97d6-70953eb75c57", + "label": "kbt_144(2020) metadata", + "value": "25468" + }, + { + "description": "Jurisdiction Metadata for kbt_122(2020) id 6b277cbb-6a3c-46da-afc8-5b12ddaf2cee", + "key": "6b277cbb-6a3c-46da-afc8-5b12ddaf2cee", + "label": "kbt_122(2020) metadata", + "value": "25469" + }, + { + "description": "Jurisdiction Metadata for kbt_133(2020) id d2de9fce-71e7-4b73-b03c-b404bb81724b", + "key": "d2de9fce-71e7-4b73-b03c-b404bb81724b", + "label": "kbt_133(2020) metadata", + "value": "25470" + }, + { + "description": "Jurisdiction Metadata for kbt_70(2020) id 3a9b664a-9da6-4766-af96-78ea29705c42", + "key": "3a9b664a-9da6-4766-af96-78ea29705c42", + "label": "kbt_70(2020) metadata", + "value": "25471" + }, + { + "description": "Jurisdiction Metadata for kbt_166(2020) id 29182ff9-fb95-4cee-aea6-52208d627b0a", + "key": "29182ff9-fb95-4cee-aea6-52208d627b0a", + "label": "kbt_166(2020) metadata", + "value": "25472" + }, + { + "description": "Jurisdiction Metadata for kbt_120(2020) id 7d984117-be5e-4192-bdd9-469176e8e448", + "key": "7d984117-be5e-4192-bdd9-469176e8e448", + "label": "kbt_120(2020) metadata", + "value": "25473" + }, + { + "description": "Jurisdiction Metadata for kbt_29(2020) id 71c7a1ce-26c8-4a04-89d5-0c41a2539b1a", + "key": "71c7a1ce-26c8-4a04-89d5-0c41a2539b1a", + "label": "kbt_29(2020) metadata", + "value": "25474" + }, + { + "description": "Jurisdiction Metadata for kbt_112(2020) id 03774dd7-0a7d-4c10-aacf-0a19f080cf2c", + "key": "03774dd7-0a7d-4c10-aacf-0a19f080cf2c", + "label": "kbt_112(2020) metadata", + "value": "25475" + }, + { + "description": "Jurisdiction Metadata for kbt_203(2020) id 6f13cae0-d12c-4600-9001-d586a90d1065", + "key": "6f13cae0-d12c-4600-9001-d586a90d1065", + "label": "kbt_203(2020) metadata", + "value": "25476" + }, + { + "description": "Jurisdiction Metadata for kbt_102(2020) id 7b2692d1-c9a1-499a-ab4a-e3267f940e6a", + "key": "7b2692d1-c9a1-499a-ab4a-e3267f940e6a", + "label": "kbt_102(2020) metadata", + "value": "25477" + }, + { + "description": "Jurisdiction Metadata for kbt_12(2020) id c4c9895c-4d9f-4925-8a91-5a362ddaec9b", + "key": "c4c9895c-4d9f-4925-8a91-5a362ddaec9b", + "label": "kbt_12(2020) metadata", + "value": "25478" + }, + { + "description": "Jurisdiction Metadata for kbt_124(2020) id 0a392bab-8078-405a-b4f9-13c580fab172", + "key": "0a392bab-8078-405a-b4f9-13c580fab172", + "label": "kbt_124(2020) metadata", + "value": "25479" + }, + { + "description": "Jurisdiction Metadata for kbt_180(2020) id ec5d19b2-ba64-4f70-aae2-17a96ca8334b", + "key": "ec5d19b2-ba64-4f70-aae2-17a96ca8334b", + "label": "kbt_180(2020) metadata", + "value": "25480" + }, + { + "description": "Jurisdiction Metadata for kbt_23(2020) id a7dfa4eb-897b-4ca8-971f-e0ab8fecb175", + "key": "a7dfa4eb-897b-4ca8-971f-e0ab8fecb175", + "label": "kbt_23(2020) metadata", + "value": "25481" + }, + { + "description": "Jurisdiction Metadata for kbt_135(2020) id 51352794-07c1-4d73-9e7c-1e09c6c3223f", + "key": "51352794-07c1-4d73-9e7c-1e09c6c3223f", + "label": "kbt_135(2020) metadata", + "value": "25482" + }, + { + "description": "Jurisdiction Metadata for kbt_214(2020) id ed9588f1-c4ee-4f82-ad5a-f4f41305b703", + "key": "ed9588f1-c4ee-4f82-ad5a-f4f41305b703", + "label": "kbt_214(2020) metadata", + "value": "25483" + }, + { + "description": "Jurisdiction Metadata for kbt_22(2020) id 0494f643-6046-499a-b834-abae70a0e09f", + "key": "0494f643-6046-499a-b834-abae70a0e09f", + "label": "kbt_22(2020) metadata", + "value": "25484" + }, + { + "description": "Jurisdiction Metadata for kbt_207(2020) id b31fcc6a-b3cf-4d42-94c9-c16b45071109", + "key": "b31fcc6a-b3cf-4d42-94c9-c16b45071109", + "label": "kbt_207(2020) metadata", + "value": "25485" + }, + { + "description": "Jurisdiction Metadata for kbt_227(2020) id 72ecbfe9-cf4a-46a2-a883-8db411cb5c0f", + "key": "72ecbfe9-cf4a-46a2-a883-8db411cb5c0f", + "label": "kbt_227(2020) metadata", + "value": "25486" + }, + { + "description": "Jurisdiction Metadata for kbt_39(2020) id 7605f0d5-aa50-45c9-b7a2-f3f34a159ccc", + "key": "7605f0d5-aa50-45c9-b7a2-f3f34a159ccc", + "label": "kbt_39(2020) metadata", + "value": "25487" + }, + { + "description": "Jurisdiction Metadata for kbt_239(2020) id 5fd0483f-331c-421b-ad28-1f8fdfbf92e5", + "key": "5fd0483f-331c-421b-ad28-1f8fdfbf92e5", + "label": "kbt_239(2020) metadata", + "value": "25488" + }, + { + "description": "Jurisdiction Metadata for kbt_60(2020) id 31f92500-6072-4585-95c3-430134e6a189", + "key": "31f92500-6072-4585-95c3-430134e6a189", + "label": "kbt_60(2020) metadata", + "value": "25489" + }, + { + "description": "Jurisdiction Metadata for kbt_140(2020) id 3583553d-a158-40a3-a78c-6665f8137a94", + "key": "3583553d-a158-40a3-a78c-6665f8137a94", + "label": "kbt_140(2020) metadata", + "value": "25490" + }, + { + "description": "Jurisdiction Metadata for kbt_173(2020) id 9edfff6c-fc7f-43b2-a7a4-adf21c877fc7", + "key": "9edfff6c-fc7f-43b2-a7a4-adf21c877fc7", + "label": "kbt_173(2020) metadata", + "value": "25491" + }, + { + "description": "Jurisdiction Metadata for kbt_164(2020) id 70105458-a8f3-47f4-b09e-8f6f3635a9c6", + "key": "70105458-a8f3-47f4-b09e-8f6f3635a9c6", + "label": "kbt_164(2020) metadata", + "value": "25492" + }, + { + "description": "Jurisdiction Metadata for kbt_235(2020) id a1471793-8195-485b-a104-7201e26ea24c", + "key": "a1471793-8195-485b-a104-7201e26ea24c", + "label": "kbt_235(2020) metadata", + "value": "25493" + }, + { + "description": "Jurisdiction Metadata for kbt_26(2020) id 54c3028f-ca99-46da-a136-77a2a9ddf4db", + "key": "54c3028f-ca99-46da-a136-77a2a9ddf4db", + "label": "kbt_26(2020) metadata", + "value": "25494" + }, + { + "description": "Jurisdiction Metadata for kbt_95(2020) id 278a2f37-76b4-4db1-b36a-b9a65aed656d", + "key": "278a2f37-76b4-4db1-b36a-b9a65aed656d", + "label": "kbt_95(2020) metadata", + "value": "25495" + }, + { + "description": "Jurisdiction Metadata for kbt_103(2020) id f4da5fa2-b0f7-41fc-a65c-517cd67a0812", + "key": "f4da5fa2-b0f7-41fc-a65c-517cd67a0812", + "label": "kbt_103(2020) metadata", + "value": "25496" + }, + { + "description": "Jurisdiction Metadata for kbt_139(2020) id afd90659-b7f5-47f1-b7a6-7ebadc36a00e", + "key": "afd90659-b7f5-47f1-b7a6-7ebadc36a00e", + "label": "kbt_139(2020) metadata", + "value": "25497" + }, + { + "description": "Jurisdiction Metadata for kbt_42(2020) id 195c1bd2-cc4c-4fae-a4af-a2ebc3b95666", + "key": "195c1bd2-cc4c-4fae-a4af-a2ebc3b95666", + "label": "kbt_42(2020) metadata", + "value": "25498" + }, + { + "description": "Jurisdiction Metadata for kbt_169(2020) id bac9cf39-e140-46cc-b5a9-4616c40abc98", + "key": "bac9cf39-e140-46cc-b5a9-4616c40abc98", + "label": "kbt_169(2020) metadata", + "value": "25499" + }, + { + "description": "Jurisdiction Metadata for kbt_13(2020) id f7f1c1d1-fdf6-4ed2-9d48-9563478390d0", + "key": "f7f1c1d1-fdf6-4ed2-9d48-9563478390d0", + "label": "kbt_13(2020) metadata", + "value": "25500" + }, + { + "description": "Jurisdiction Metadata for kbt_187(2020) id 2dabd3a1-6250-4ca4-9d5b-fc43368e1544", + "key": "2dabd3a1-6250-4ca4-9d5b-fc43368e1544", + "label": "kbt_187(2020) metadata", + "value": "25501" + }, + { + "description": "Jurisdiction Metadata for kbt_246(2020) id 0ae3b83e-b4d5-4989-b895-b374764fd832", + "key": "0ae3b83e-b4d5-4989-b895-b374764fd832", + "label": "kbt_246(2020) metadata", + "value": "25502" + }, + { + "description": "Jurisdiction Metadata for kbt_24(2020) id 28656b47-7e19-47aa-9bc5-e381f30109c5", + "key": "28656b47-7e19-47aa-9bc5-e381f30109c5", + "label": "kbt_24(2020) metadata", + "value": "25503" + }, + { + "description": "Jurisdiction Metadata for kbt_30(2020) id f30b6ac4-d9b0-4b70-9ef3-6740aab1bc97", + "key": "f30b6ac4-d9b0-4b70-9ef3-6740aab1bc97", + "label": "kbt_30(2020) metadata", + "value": "25504" + }, + { + "description": "Jurisdiction Metadata for kbt_177(2020) id 2919e4f3-28b7-40c8-8261-703e04bcfb42", + "key": "2919e4f3-28b7-40c8-8261-703e04bcfb42", + "label": "kbt_177(2020) metadata", + "value": "25505" + }, + { + "description": "Jurisdiction Metadata for kbt_192(2020) id a8787279-4635-4fc8-bc4c-4a033db0844a", + "key": "a8787279-4635-4fc8-bc4c-4a033db0844a", + "label": "kbt_192(2020) metadata", + "value": "25506" + }, + { + "description": "Jurisdiction Metadata for kbt_117(2020) id 3d7d7233-ad7f-47cb-89eb-591ca6b265df", + "key": "3d7d7233-ad7f-47cb-89eb-591ca6b265df", + "label": "kbt_117(2020) metadata", + "value": "25507" + }, + { + "description": "Jurisdiction Metadata for kbt_137(2020) id 2c6c7d56-bd55-4a65-b0b1-8da8922a9ee9", + "key": "2c6c7d56-bd55-4a65-b0b1-8da8922a9ee9", + "label": "kbt_137(2020) metadata", + "value": "25508" + }, + { + "description": "Jurisdiction Metadata for kbt_218(2020) id a5f8f614-c760-4e98-8424-4b60b74bbccd", + "key": "a5f8f614-c760-4e98-8424-4b60b74bbccd", + "label": "kbt_218(2020) metadata", + "value": "25509" + }, + { + "description": "Jurisdiction Metadata for kbt_136(2020) id 4e2e9f97-1a6e-4a0c-9a9a-2a95fe8244a1", + "key": "4e2e9f97-1a6e-4a0c-9a9a-2a95fe8244a1", + "label": "kbt_136(2020) metadata", + "value": "25510" + }, + { + "description": "Jurisdiction Metadata for kbt_38(2020) id 1c59954e-5e6e-4465-97e8-d369d2e342f2", + "key": "1c59954e-5e6e-4465-97e8-d369d2e342f2", + "label": "kbt_38(2020) metadata", + "value": "25511" + }, + { + "description": "Jurisdiction Metadata for kbt_109(2020) id 6c3aacf9-b5fc-4560-afe9-3f7b193fdce4", + "key": "6c3aacf9-b5fc-4560-afe9-3f7b193fdce4", + "label": "kbt_109(2020) metadata", + "value": "25512" + }, + { + "description": "Jurisdiction Metadata for kbt_61(2020) id 5f9ac6a1-ba44-4cce-8d93-5986bc17ced3", + "key": "5f9ac6a1-ba44-4cce-8d93-5986bc17ced3", + "label": "kbt_61(2020) metadata", + "value": "25513" + }, + { + "description": "Jurisdiction Metadata for kbt_106(2020) id 9fddeae9-4c18-4d64-b397-9e379cebed9d", + "key": "9fddeae9-4c18-4d64-b397-9e379cebed9d", + "label": "kbt_106(2020) metadata", + "value": "25514" + }, + { + "description": "Jurisdiction Metadata for kbt_245(2020) id 24cb2e71-e2ff-46b0-bafd-39fdee55fc14", + "key": "24cb2e71-e2ff-46b0-bafd-39fdee55fc14", + "label": "kbt_245(2020) metadata", + "value": "25515" + }, + { + "description": "Jurisdiction Metadata for kbt_57(2020) id 02f073fb-57c5-4150-9030-3fbcb10f10ce", + "key": "02f073fb-57c5-4150-9030-3fbcb10f10ce", + "label": "kbt_57(2020) metadata", + "value": "25516" + }, + { + "description": "Jurisdiction Metadata for kbt_96(2020) id 6cca7580-7bf8-4c87-a72e-1cf9f625443c", + "key": "6cca7580-7bf8-4c87-a72e-1cf9f625443c", + "label": "kbt_96(2020) metadata", + "value": "25517" + }, + { + "description": "Jurisdiction Metadata for kbt_27(2020) id 52aad8da-54b6-4da1-a93b-6ab6c25512a7", + "key": "52aad8da-54b6-4da1-a93b-6ab6c25512a7", + "label": "kbt_27(2020) metadata", + "value": "25518" + }, + { + "description": "Jurisdiction Metadata for kbt_77(2020) id e2c2cde8-a861-4c86-8e23-328852caee79", + "key": "e2c2cde8-a861-4c86-8e23-328852caee79", + "label": "kbt_77(2020) metadata", + "value": "25519" + }, + { + "description": "Jurisdiction Metadata for kbt_220(2020) id f44dd381-7105-4b4c-9c20-8d49adeedcda", + "key": "f44dd381-7105-4b4c-9c20-8d49adeedcda", + "label": "kbt_220(2020) metadata", + "value": "25520" + }, + { + "description": "Jurisdiction Metadata for kbt_49(2020) id 6d7c621c-6b18-4d1b-a9f2-5339d9b5e91e", + "key": "6d7c621c-6b18-4d1b-a9f2-5339d9b5e91e", + "label": "kbt_49(2020) metadata", + "value": "25521" + }, + { + "description": "Jurisdiction Metadata for kbt_172(2020) id 89451f60-7995-40b4-9184-d4aeb7870c28", + "key": "89451f60-7995-40b4-9184-d4aeb7870c28", + "label": "kbt_172(2020) metadata", + "value": "25522" + }, + { + "description": "Jurisdiction Metadata for kbt_76(2020) id d34a0541-6bd9-4b96-bf98-ca72f6514610", + "key": "d34a0541-6bd9-4b96-bf98-ca72f6514610", + "label": "kbt_76(2020) metadata", + "value": "25523" + }, + { + "description": "Jurisdiction Metadata for kbt_243(2020) id 1ee17404-90dc-44fe-b91c-15eed1c30a8d", + "key": "1ee17404-90dc-44fe-b91c-15eed1c30a8d", + "label": "kbt_243(2020) metadata", + "value": "25524" + }, + { + "description": "Jurisdiction Metadata for kbt_138(2020) id f20bb75a-2df2-4b50-9fcd-f99730588e68", + "key": "f20bb75a-2df2-4b50-9fcd-f99730588e68", + "label": "kbt_138(2020) metadata", + "value": "25525" + }, + { + "description": "Jurisdiction Metadata for kbt_83(2020) id a0b81a67-fb67-4989-89dd-35e2cb5c1f56", + "key": "a0b81a67-fb67-4989-89dd-35e2cb5c1f56", + "label": "kbt_83(2020) metadata", + "value": "25526" + }, + { + "description": "Jurisdiction Metadata for kbt_16(2020) id 777f40ae-de9a-450d-8f4d-98fc2fd6f88c", + "key": "777f40ae-de9a-450d-8f4d-98fc2fd6f88c", + "label": "kbt_16(2020) metadata", + "value": "25527" + }, + { + "description": "Jurisdiction Metadata for kbt_230(2020) id a0c6e9dd-f773-4b67-9267-7b9cb28ecb83", + "key": "a0c6e9dd-f773-4b67-9267-7b9cb28ecb83", + "label": "kbt_230(2020) metadata", + "value": "25528" + }, + { + "description": "Jurisdiction Metadata for kbt_52(2020) id 8aa6fcdb-c69a-4098-892a-f9f23d4a3aa7", + "key": "8aa6fcdb-c69a-4098-892a-f9f23d4a3aa7", + "label": "kbt_52(2020) metadata", + "value": "25529" + }, + { + "description": "Jurisdiction Metadata for kbt_132(2020) id 9ff12b28-8e06-4c44-80e1-4e0408beeec2", + "key": "9ff12b28-8e06-4c44-80e1-4e0408beeec2", + "label": "kbt_132(2020) metadata", + "value": "25530" + }, + { + "description": "Jurisdiction Metadata for kbt_244(2020) id 6387dfb5-6cc6-41e2-83c9-420b02722602", + "key": "6387dfb5-6cc6-41e2-83c9-420b02722602", + "label": "kbt_244(2020) metadata", + "value": "25531" + }, + { + "description": "Jurisdiction Metadata for kbt_62(2020) id 78946858-fa5c-4be2-a1e7-2b692005d7fd", + "key": "78946858-fa5c-4be2-a1e7-2b692005d7fd", + "label": "kbt_62(2020) metadata", + "value": "25532" + }, + { + "description": "Jurisdiction Metadata for kbt_170(2020) id 6fe8bdc7-311a-4af5-894c-9822ff1a5769", + "key": "6fe8bdc7-311a-4af5-894c-9822ff1a5769", + "label": "kbt_170(2020) metadata", + "value": "25533" + }, + { + "description": "Jurisdiction Metadata for kbt_179(2020) id 7212c3a1-4c77-444d-9ecd-de4517b34b7e", + "key": "7212c3a1-4c77-444d-9ecd-de4517b34b7e", + "label": "kbt_179(2020) metadata", + "value": "25534" + }, + { + "description": "Jurisdiction Metadata for kbt_161(2020) id 108a2461-bc58-4871-b2c1-c90352b12823", + "key": "108a2461-bc58-4871-b2c1-c90352b12823", + "label": "kbt_161(2020) metadata", + "value": "25535" + }, + { + "description": "Jurisdiction Metadata for kbt_232(2020) id 0809b938-30b0-459f-b234-50e69b528c01", + "key": "0809b938-30b0-459f-b234-50e69b528c01", + "label": "kbt_232(2020) metadata", + "value": "25536" + }, + { + "description": "Jurisdiction Metadata for kbt_97(2020) id 487c3ff3-2dbc-4fce-9bdc-c38881ce04fc", + "key": "487c3ff3-2dbc-4fce-9bdc-c38881ce04fc", + "label": "kbt_97(2020) metadata", + "value": "25537" + }, + { + "description": "Jurisdiction Metadata for kbt_184(2020) id e5ca97a3-9f9c-42de-a029-c055a1bce4a2", + "key": "e5ca97a3-9f9c-42de-a029-c055a1bce4a2", + "label": "kbt_184(2020) metadata", + "value": "25538" + }, + { + "description": "Jurisdiction Metadata for kbt_37(2020) id 3115f0d8-ae6a-4d19-855c-964ad881960f", + "key": "3115f0d8-ae6a-4d19-855c-964ad881960f", + "label": "kbt_37(2020) metadata", + "value": "25539" + }, + { + "description": "Jurisdiction Metadata for kbt_206(2020) id 70cc9bb3-b546-41c4-a08b-2f3b2869d462", + "key": "70cc9bb3-b546-41c4-a08b-2f3b2869d462", + "label": "kbt_206(2020) metadata", + "value": "25540" + }, + { + "description": "Jurisdiction Metadata for Chipanta id a74621eb-7dda-4dd4-9dc6-7edfb040442a", + "key": "a74621eb-7dda-4dd4-9dc6-7edfb040442a", + "label": "Chipanta metadata", + "value": "25541" + }, + { + "description": "Jurisdiction Metadata for kbt_238(2020) id af9fe42b-ff10-4e10-bdb1-12b09b4e5e7a", + "key": "af9fe42b-ff10-4e10-bdb1-12b09b4e5e7a", + "label": "kbt_238(2020) metadata", + "value": "25542" + }, + { + "description": "Jurisdiction Metadata for kbt_21(2020) id 0a5fb139-e1e6-469d-9219-23a3046c81dc", + "key": "0a5fb139-e1e6-469d-9219-23a3046c81dc", + "label": "kbt_21(2020) metadata", + "value": "25543" + }, + { + "description": "Jurisdiction Metadata for kbt_99(2020) id 9b0f527f-7fb9-45dd-a306-eb73da4f4aca", + "key": "9b0f527f-7fb9-45dd-a306-eb73da4f4aca", + "label": "kbt_99(2020) metadata", + "value": "25544" + }, + { + "description": "Jurisdiction Metadata for kbt_10(2020) id 5ceeb341-20bb-47c6-b832-c1577d676124", + "key": "5ceeb341-20bb-47c6-b832-c1577d676124", + "label": "kbt_10(2020) metadata", + "value": "25545" + }, + { + "description": "Jurisdiction Metadata for Lupili id b4622346-f745-48a5-b6c3-34a61e0b85d1", + "key": "b4622346-f745-48a5-b6c3-34a61e0b85d1", + "label": "Lupili metadata", + "value": "25546" + }, + { + "description": "Jurisdiction Metadata for kbt_156(2020) id 93fc1924-6089-423f-966b-3405652d75b4", + "key": "93fc1924-6089-423f-966b-3405652d75b4", + "label": "kbt_156(2020) metadata", + "value": "25547" + }, + { + "description": "Jurisdiction Metadata for kbt_129(2020) id b786e4ce-e51c-483b-a2b5-da7bd3c8e5c2", + "key": "b786e4ce-e51c-483b-a2b5-da7bd3c8e5c2", + "label": "kbt_129(2020) metadata", + "value": "25548" + }, + { + "description": "Jurisdiction Metadata for kbt_219(2020) id 3b1ecb44-9988-40fe-95fc-affbd2bac9ae", + "key": "3b1ecb44-9988-40fe-95fc-affbd2bac9ae", + "label": "kbt_219(2020) metadata", + "value": "25549" + }, + { + "description": "Jurisdiction Metadata for kbt_233(2020) id f7a8e512-8bde-47da-b143-97e0d686aa3d", + "key": "f7a8e512-8bde-47da-b143-97e0d686aa3d", + "label": "kbt_233(2020) metadata", + "value": "25550" + }, + { + "description": "Jurisdiction Metadata for kbt_194(2020) id 6c5a4c50-e3f0-48ef-8d39-38ada92bec5a", + "key": "6c5a4c50-e3f0-48ef-8d39-38ada92bec5a", + "label": "kbt_194(2020) metadata", + "value": "25551" + }, + { + "description": "Jurisdiction Metadata for kbt_208(2020) id 4c0375b5-73b2-40ee-9e9d-cdb26c41e57c", + "key": "4c0375b5-73b2-40ee-9e9d-cdb26c41e57c", + "label": "kbt_208(2020) metadata", + "value": "25552" + }, + { + "description": "Jurisdiction Metadata for kbt_204(2020) id 6ee20e95-dfdd-4e00-8119-626c80a8d398", + "key": "6ee20e95-dfdd-4e00-8119-626c80a8d398", + "label": "kbt_204(2020) metadata", + "value": "25553" + }, + { + "description": "Jurisdiction Metadata for kbt_134(2020) id 88cc2c0d-3c8f-4b7e-93b3-48907d782581", + "key": "88cc2c0d-3c8f-4b7e-93b3-48907d782581", + "label": "kbt_134(2020) metadata", + "value": "25554" + }, + { + "description": "Jurisdiction Metadata for kbt_7(2020) id 035d8d1e-2f49-4f0f-838c-7ee3efe04ded", + "key": "035d8d1e-2f49-4f0f-838c-7ee3efe04ded", + "label": "kbt_7(2020) metadata", + "value": "25555" + }, + { + "description": "Jurisdiction Metadata for kbt_116(2020) id f9e2e042-b742-47f6-b143-d8dc75ce7ae3", + "key": "f9e2e042-b742-47f6-b143-d8dc75ce7ae3", + "label": "kbt_116(2020) metadata", + "value": "25556" + }, + { + "description": "Jurisdiction Metadata for kbt_113(2020) id 45c021a1-bab5-49ed-8c81-f780c6709774", + "key": "45c021a1-bab5-49ed-8c81-f780c6709774", + "label": "kbt_113(2020) metadata", + "value": "25557" + }, + { + "description": "Jurisdiction Metadata for kbt_158(2020) id 6a70e07b-c045-481c-a12a-8ef2dc5966fd", + "key": "6a70e07b-c045-481c-a12a-8ef2dc5966fd", + "label": "kbt_158(2020) metadata", + "value": "25558" + }, + { + "description": "Jurisdiction Metadata for kbt_118(2020) id 4b05175f-459b-4a89-8aff-fca545fce903", + "key": "4b05175f-459b-4a89-8aff-fca545fce903", + "label": "kbt_118(2020) metadata", + "value": "25559" + }, + { + "description": "Jurisdiction Metadata for kbt_237(2020) id 8a09afb6-8cb8-4334-80cd-3f8adea9d850", + "key": "8a09afb6-8cb8-4334-80cd-3f8adea9d850", + "label": "kbt_237(2020) metadata", + "value": "25560" + }, + { + "description": "Jurisdiction Metadata for kbt_107(2020) id 2f31872f-9043-4a53-8a10-405f72873242", + "key": "2f31872f-9043-4a53-8a10-405f72873242", + "label": "kbt_107(2020) metadata", + "value": "25561" + }, + { + "description": "Jurisdiction Metadata for kbt_157(2020) id 6c2bd582-13b7-4b65-b5f3-a9c901badda3", + "key": "6c2bd582-13b7-4b65-b5f3-a9c901badda3", + "label": "kbt_157(2020) metadata", + "value": "25562" + }, + { + "description": "Jurisdiction Metadata for kbt_189(2020) id 394c4e3e-a896-49d6-b7a2-fc309dba4dc4", + "key": "394c4e3e-a896-49d6-b7a2-fc309dba4dc4", + "label": "kbt_189(2020) metadata", + "value": "25563" + }, + { + "description": "Jurisdiction Metadata for Chishima id e4809e9d-eeea-454d-af28-5d03eec31928", + "key": "e4809e9d-eeea-454d-af28-5d03eec31928", + "label": "Chishima metadata", + "value": "25564" + }, + { + "description": "Jurisdiction Metadata for kbt_1(2020) id 5f1d04e9-47db-4acf-9e37-32773e189772", + "key": "5f1d04e9-47db-4acf-9e37-32773e189772", + "label": "kbt_1(2020) metadata", + "value": "25565" + }, + { + "description": "Jurisdiction Metadata for kbt_222(2020) id 04aa5214-4bd3-4887-b1bf-7dbe56666ef2", + "key": "04aa5214-4bd3-4887-b1bf-7dbe56666ef2", + "label": "kbt_222(2020) metadata", + "value": "25566" + }, + { + "description": "Jurisdiction Metadata for kbt_125(2020) id 1de81dd0-cd19-4474-bda7-b07f8898c7a3", + "key": "1de81dd0-cd19-4474-bda7-b07f8898c7a3", + "label": "kbt_125(2020) metadata", + "value": "25567" + }, + { + "description": "Jurisdiction Metadata for kbt_183(2020) id 78de32df-a640-46c5-8a26-4277ebef3c87", + "key": "78de32df-a640-46c5-8a26-4277ebef3c87", + "label": "kbt_183(2020) metadata", + "value": "25568" + }, + { + "description": "Jurisdiction Metadata for kbt_151(2020) id 81e92873-a34b-4735-876d-543a5aeca93f", + "key": "81e92873-a34b-4735-876d-543a5aeca93f", + "label": "kbt_151(2020) metadata", + "value": "25569" + }, + { + "description": "Jurisdiction Metadata for kbt_152(2020) id ce6ffe9a-fb6c-4c1e-a5e6-6f6f7561b18f", + "key": "ce6ffe9a-fb6c-4c1e-a5e6-6f6f7561b18f", + "label": "kbt_152(2020) metadata", + "value": "25570" + }, + { + "description": "Jurisdiction Metadata for Chifwalo id ef5f350c-1cff-4cb7-a81f-37b1df67a901", + "key": "ef5f350c-1cff-4cb7-a81f-37b1df67a901", + "label": "Chifwalo metadata", + "value": "25571" + }, + { + "description": "Jurisdiction Metadata for kbt_11(2020) id 33baa300-fcbf-4b38-8f05-6bb176c72a9a", + "key": "33baa300-fcbf-4b38-8f05-6bb176c72a9a", + "label": "kbt_11(2020) metadata", + "value": "25572" + }, + { + "description": "Jurisdiction Metadata for Kayope id 2aa9367e-87b2-43bb-baae-4b8632346449", + "key": "2aa9367e-87b2-43bb-baae-4b8632346449", + "label": "Kayope metadata", + "value": "25573" + }, + { + "description": "Jurisdiction Metadata for kbt_205(2020) id 8275525a-fdcc-4c84-95c1-33ff1b7d0238", + "key": "8275525a-fdcc-4c84-95c1-33ff1b7d0238", + "label": "kbt_205(2020) metadata", + "value": "25574" + }, + { + "description": "Jurisdiction Metadata for kbt_154(2020) id f35dcdea-012c-48ef-8f34-2e9fd68b3d95", + "key": "f35dcdea-012c-48ef-8f34-2e9fd68b3d95", + "label": "kbt_154(2020) metadata", + "value": "25575" + }, + { + "description": "Jurisdiction Metadata for kbt_65(2020) id 051a4cb4-1f0e-42af-abcc-2adadcca22fb", + "key": "051a4cb4-1f0e-42af-abcc-2adadcca22fb", + "label": "kbt_65(2020) metadata", + "value": "25576" + }, + { + "description": "Jurisdiction Metadata for kbt_153(2020) id b64b823b-a417-4d1e-b1a8-e2139297e2eb", + "key": "b64b823b-a417-4d1e-b1a8-e2139297e2eb", + "label": "kbt_153(2020) metadata", + "value": "25577" + }, + { + "description": "Jurisdiction Metadata for kbt_155(2020) id 1811f995-b1a7-4abe-a178-5d1c462a075b", + "key": "1811f995-b1a7-4abe-a178-5d1c462a075b", + "label": "kbt_155(2020) metadata", + "value": "25578" + }, + { + "description": "Jurisdiction Metadata for kbt_108(2020) id d8f8bb56-c629-4529-96b2-53c3a9bef641", + "key": "d8f8bb56-c629-4529-96b2-53c3a9bef641", + "label": "kbt_108(2020) metadata", + "value": "25579" + }, + { + "description": "Jurisdiction Metadata for kbt_123(2020) id 809d06f0-f69f-489f-affe-c13f13398b8a", + "key": "809d06f0-f69f-489f-affe-c13f13398b8a", + "label": "kbt_123(2020) metadata", + "value": "25580" + }, + { + "description": "Jurisdiction Metadata for kbt_217(2020) id 31a09fa9-7075-4450-972d-586c4bd456c4", + "key": "31a09fa9-7075-4450-972d-586c4bd456c4", + "label": "kbt_217(2020) metadata", + "value": "25581" + }, + { + "description": "Jurisdiction Metadata for kbt_191(2020) id 0e702a11-4933-43f5-9a7e-2626a132696d", + "key": "0e702a11-4933-43f5-9a7e-2626a132696d", + "label": "kbt_191(2020) metadata", + "value": "25582" + }, + { + "description": "Jurisdiction Metadata for kbt_221(2020) id af2682d9-d986-479c-a496-e4c32dea9693", + "key": "af2682d9-d986-479c-a496-e4c32dea9693", + "label": "kbt_221(2020) metadata", + "value": "25583" + }, + { + "description": "Jurisdiction Metadata for kbt_3(2020) id 7544f4dd-2381-4862-9efa-94b959fac166", + "key": "7544f4dd-2381-4862-9efa-94b959fac166", + "label": "kbt_3(2020) metadata", + "value": "25584" + }, + { + "description": "Jurisdiction Metadata for Kapela id b58a69a7-fda7-46b6-b15b-602b21ebd1f9", + "key": "b58a69a7-fda7-46b6-b15b-602b21ebd1f9", + "label": "Kapela metadata", + "value": "25585" + }, + { + "description": "Jurisdiction Metadata for kbt_186(2020) id b0ed7ebe-254e-4398-aa46-461dddac5c4b", + "key": "b0ed7ebe-254e-4398-aa46-461dddac5c4b", + "label": "kbt_186(2020) metadata", + "value": "25586" + }, + { + "description": "Jurisdiction Metadata for kbt_149(2020) id df77811a-1ad8-40cb-a2e0-5bac4b01547d", + "key": "df77811a-1ad8-40cb-a2e0-5bac4b01547d", + "label": "kbt_149(2020) metadata", + "value": "25587" + }, + { + "description": "Jurisdiction Metadata for kbt_5(2020) id 23073932-3348-433d-84ce-061d9582f0ff", + "key": "23073932-3348-433d-84ce-061d9582f0ff", + "label": "kbt_5(2020) metadata", + "value": "25588" + }, + { + "description": "Jurisdiction Metadata for kbt_150(2020) id aa0b68fc-d402-4049-bde3-0159d4727be0", + "key": "aa0b68fc-d402-4049-bde3-0159d4727be0", + "label": "kbt_150(2020) metadata", + "value": "25589" + }, + { + "description": "Jurisdiction Metadata for Sekeleti id 4e4d0285-1d35-4bbd-ae23-9c91c6a2dda6", + "key": "4e4d0285-1d35-4bbd-ae23-9c91c6a2dda6", + "label": "Sekeleti metadata", + "value": "25590" + }, + { + "description": "Jurisdiction Metadata for kbt_143(2020) id 7255bc2f-3296-46f1-8ff4-8b6b0d442a2a", + "key": "7255bc2f-3296-46f1-8ff4-8b6b0d442a2a", + "label": "kbt_143(2020) metadata", + "value": "25591" + }, + { + "description": "Jurisdiction Metadata for kbt_185(2020) id 954e094d-5acc-4747-ab62-6d699b55889d", + "key": "954e094d-5acc-4747-ab62-6d699b55889d", + "label": "kbt_185(2020) metadata", + "value": "25592" + }, + { + "description": "Jurisdiction Metadata for kbt_196(2020) id b203de26-e28c-4771-aeb7-2b6e5d36acfb", + "key": "b203de26-e28c-4771-aeb7-2b6e5d36acfb", + "label": "kbt_196(2020) metadata", + "value": "25593" + }, + { + "description": "Jurisdiction Metadata for kbt_92(2020) id c1b9efaf-0e57-4e6b-a880-18e91c95f4a1", + "key": "c1b9efaf-0e57-4e6b-a880-18e91c95f4a1", + "label": "kbt_92(2020) metadata", + "value": "25594" + }, + { + "description": "Jurisdiction Metadata for kbt_93(2020) id 28dd345b-c33a-444f-9d08-5834a95beb51", + "key": "28dd345b-c33a-444f-9d08-5834a95beb51", + "label": "kbt_93(2020) metadata", + "value": "25595" + }, + { + "description": "Jurisdiction Metadata for kbt_81(2020) id 8465e067-2006-4e88-b285-ae27b7be2e2e", + "key": "8465e067-2006-4e88-b285-ae27b7be2e2e", + "label": "kbt_81(2020) metadata", + "value": "25596" + }, + { + "description": "Jurisdiction Metadata for kbt_4(2020) id 803e0da5-cd69-4a67-bffe-ccc59a309764", + "key": "803e0da5-cd69-4a67-bffe-ccc59a309764", + "label": "kbt_4(2020) metadata", + "value": "25597" + }, + { + "description": "Jurisdiction Metadata for kbt_229(2020) id 54e28784-28b4-402b-9265-d211ce3dad19", + "key": "54e28784-28b4-402b-9265-d211ce3dad19", + "label": "kbt_229(2020) metadata", + "value": "25598" + }, + { + "description": "Jurisdiction Metadata for kbt_74(2020) id db0c09d4-05f0-4d41-b959-09b987089054", + "key": "db0c09d4-05f0-4d41-b959-09b987089054", + "label": "kbt_74(2020) metadata", + "value": "25599" + }, + { + "description": "Jurisdiction Metadata for Lusha id 5d00b165-69dc-4db3-9cf3-f0b8448a8311", + "key": "5d00b165-69dc-4db3-9cf3-f0b8448a8311", + "label": "Lusha metadata", + "value": "25600" + }, + { + "description": "Jurisdiction Metadata for kbt_100(2020) id 3ae3f851-716c-4502-a2bb-4bb98790b6a8", + "key": "3ae3f851-716c-4502-a2bb-4bb98790b6a8", + "label": "kbt_100(2020) metadata", + "value": "25601" + }, + { + "description": "Jurisdiction Metadata for kbt_193(2020) id d91bff1d-5a71-49c6-adbf-6cdbb3e95be7", + "key": "d91bff1d-5a71-49c6-adbf-6cdbb3e95be7", + "label": "kbt_193(2020) metadata", + "value": "25602" + }, + { + "description": "Jurisdiction Metadata for kbt_66(2020) id cbff4c00-7ccb-447d-b13b-f57e1d3103e2", + "key": "cbff4c00-7ccb-447d-b13b-f57e1d3103e2", + "label": "kbt_66(2020) metadata", + "value": "25603" + }, + { + "description": "Jurisdiction Metadata for kbt_36(2020) id df454170-42c3-4f6f-9c53-9d2347800d3c", + "key": "df454170-42c3-4f6f-9c53-9d2347800d3c", + "label": "kbt_36(2020) metadata", + "value": "25604" + }, + { + "description": "Jurisdiction Metadata for kbt_174(2020) id ccf96794-02a2-4a6b-b5a5-89d9a301a1f5", + "key": "ccf96794-02a2-4a6b-b5a5-89d9a301a1f5", + "label": "kbt_174(2020) metadata", + "value": "25605" + }, + { + "description": "Jurisdiction Metadata for kbt_9(2020) id 54f8b369-16cb-40e4-83d4-eb6c9f7ebab4", + "key": "54f8b369-16cb-40e4-83d4-eb6c9f7ebab4", + "label": "kbt_9(2020) metadata", + "value": "25606" + }, + { + "description": "Jurisdiction Metadata for kbt_111(2020) id db332510-070b-48f1-afba-2a04f38bd090", + "key": "db332510-070b-48f1-afba-2a04f38bd090", + "label": "kbt_111(2020) metadata", + "value": "25607" + }, + { + "description": "Jurisdiction Metadata for kbt_176(2020) id 5df61234-e41f-4b07-9bc8-ccada7192726", + "key": "5df61234-e41f-4b07-9bc8-ccada7192726", + "label": "kbt_176(2020) metadata", + "value": "25608" + }, + { + "description": "Jurisdiction Metadata for kbt_2(2020) id 71aad902-9dc7-4d09-978a-4d514315a9c7", + "key": "71aad902-9dc7-4d09-978a-4d514315a9c7", + "label": "kbt_2(2020) metadata", + "value": "25609" + }, + { + "description": "Jurisdiction Metadata for kbt_58(2020) id eb1f9059-af18-4190-867a-8e557965bd42", + "key": "eb1f9059-af18-4190-867a-8e557965bd42", + "label": "kbt_58(2020) metadata", + "value": "25610" + }, + { + "description": "Jurisdiction Metadata for kbt_20(2020) id 36e43c3d-1617-4cdb-8c77-56f122896b02", + "key": "36e43c3d-1617-4cdb-8c77-56f122896b02", + "label": "kbt_20(2020) metadata", + "value": "25611" + }, + { + "description": "Jurisdiction Metadata for kbt_46(2020) id f5da4e50-28ea-4d12-8d70-792db7848ad4", + "key": "f5da4e50-28ea-4d12-8d70-792db7848ad4", + "label": "kbt_46(2020) metadata", + "value": "25612" + }, + { + "description": "Jurisdiction Metadata for kbt_91(2020) id bc5c891a-4a17-4a5c-af7a-a8da2edba277", + "key": "bc5c891a-4a17-4a5c-af7a-a8da2edba277", + "label": "kbt_91(2020) metadata", + "value": "25613" + }, + { + "description": "Jurisdiction Metadata for kbt_175(2020) id 9a99fdf6-ad36-472f-b162-3d8093db4899", + "key": "9a99fdf6-ad36-472f-b162-3d8093db4899", + "label": "kbt_175(2020) metadata", + "value": "25614" + }, + { + "description": "Jurisdiction Metadata for kbt_188(2020) id 13a49096-8a14-4916-a659-1363659f8c8a", + "key": "13a49096-8a14-4916-a659-1363659f8c8a", + "label": "kbt_188(2020) metadata", + "value": "25615" + }, + { + "description": "Jurisdiction Metadata for kbt_59(2020) id 4a7673a4-c43e-4d54-aedc-03c8750cc714", + "key": "4a7673a4-c43e-4d54-aedc-03c8750cc714", + "label": "kbt_59(2020) metadata", + "value": "25616" + }, + { + "description": "Jurisdiction Metadata for kbt_121(2020) id d95a5994-0351-4fd6-82c4-3ef640b6e261", + "key": "d95a5994-0351-4fd6-82c4-3ef640b6e261", + "label": "kbt_121(2020) metadata", + "value": "25617" + }, + { + "description": "Jurisdiction Metadata for kbt_28(2020) id ec5c32f5-38ae-4639-8438-b98fb89d12c9", + "key": "ec5c32f5-38ae-4639-8438-b98fb89d12c9", + "label": "kbt_28(2020) metadata", + "value": "25618" + }, + { + "description": "Jurisdiction Metadata for kbt_88(2020) id 146095c6-902a-4b6a-9e7c-bc9ab2fb5943", + "key": "146095c6-902a-4b6a-9e7c-bc9ab2fb5943", + "label": "kbt_88(2020) metadata", + "value": "25619" + }, + { + "description": "Jurisdiction Metadata for kbt_101(2020) id 44add25d-d578-4487-88bc-44db9e25b291", + "key": "44add25d-d578-4487-88bc-44db9e25b291", + "label": "kbt_101(2020) metadata", + "value": "25620" + }, + { + "description": "Jurisdiction Metadata for kbt_114(2020) id 3bc782f6-f1a6-4bba-b67d-d696afdbb63e", + "key": "3bc782f6-f1a6-4bba-b67d-d696afdbb63e", + "label": "kbt_114(2020) metadata", + "value": "25621" + }, + { + "description": "Jurisdiction Metadata for kbt_72(2020) id cef78efe-1072-4bba-8654-be200e80e070", + "key": "cef78efe-1072-4bba-8654-be200e80e070", + "label": "kbt_72(2020) metadata", + "value": "25622" + }, + { + "description": "Jurisdiction Metadata for kbt_64(2020) id cc0086d2-aa2b-472a-8a7c-bf7cba61c03c", + "key": "cc0086d2-aa2b-472a-8a7c-bf7cba61c03c", + "label": "kbt_64(2020) metadata", + "value": "25623" + }, + { + "description": "Jurisdiction Metadata for kbt_202(2020) id 223b2e5a-d168-43e6-a44e-b603da958001", + "key": "223b2e5a-d168-43e6-a44e-b603da958001", + "label": "kbt_202(2020) metadata", + "value": "25624" + }, + { + "description": "Jurisdiction Metadata for kbt_80(2020) id 1a4cf9fd-5525-4379-ab7e-023d08ab15f6", + "key": "1a4cf9fd-5525-4379-ab7e-023d08ab15f6", + "label": "kbt_80(2020) metadata", + "value": "25625" + }, + { + "description": "Jurisdiction Metadata for kbt_35(2020) id ff3b6d71-c152-4f89-9737-3fb135fc1c11", + "key": "ff3b6d71-c152-4f89-9737-3fb135fc1c11", + "label": "kbt_35(2020) metadata", + "value": "25626" + }, + { + "description": "Jurisdiction Metadata for kbt_79(2020) id a91ff9a5-5295-4987-aaf4-32329982ffb5", + "key": "a91ff9a5-5295-4987-aaf4-32329982ffb5", + "label": "kbt_79(2020) metadata", + "value": "25627" + }, + { + "description": "Jurisdiction Metadata for kbt_105(2020) id f64d4edf-4370-4dac-9687-80d1d822ba65", + "key": "f64d4edf-4370-4dac-9687-80d1d822ba65", + "label": "kbt_105(2020) metadata", + "value": "25628" + }, + { + "description": "Jurisdiction Metadata for kbt_41(2020) id 3315802e-fd90-4721-a131-7251b6a5d2a7", + "key": "3315802e-fd90-4721-a131-7251b6a5d2a7", + "label": "kbt_41(2020) metadata", + "value": "25629" + }, + { + "description": "Jurisdiction Metadata for Mulanga id df5a5119-8c3d-48f0-a44e-afa1151c81d0", + "key": "df5a5119-8c3d-48f0-a44e-afa1151c81d0", + "label": "Mulanga metadata", + "value": "25630" + }, + { + "description": "Jurisdiction Metadata for kbt_8(2020) id bb72d91a-8b3f-4837-af7c-70ca4db9a7b8", + "key": "bb72d91a-8b3f-4837-af7c-70ca4db9a7b8", + "label": "kbt_8(2020) metadata", + "value": "25631" + }, + { + "description": "Jurisdiction Metadata for kbt_63(2020) id dd129a36-b3bb-4ed9-99de-9c20d2fa82a0", + "key": "dd129a36-b3bb-4ed9-99de-9c20d2fa82a0", + "label": "kbt_63(2020) metadata", + "value": "25632" + }, + { + "description": "Jurisdiction Metadata for kbt_127(2020) id ace48888-85e4-46fc-8d8d-f98cf7421604", + "key": "ace48888-85e4-46fc-8d8d-f98cf7421604", + "label": "kbt_127(2020) metadata", + "value": "25633" + }, + { + "description": "Jurisdiction Metadata for kbt_87(2020) id a30b0a31-c078-4100-b45e-8cace56ef03d", + "key": "a30b0a31-c078-4100-b45e-8cace56ef03d", + "label": "kbt_87(2020) metadata", + "value": "25634" + }, + { + "description": "Jurisdiction Metadata for kbt_19(2020) id 829983ff-d0fc-4304-a13d-fa888bb22107", + "key": "829983ff-d0fc-4304-a13d-fa888bb22107", + "label": "kbt_19(2020) metadata", + "value": "25635" + }, + { + "description": "Jurisdiction Metadata for kbt_147(2020) id 12d564a9-3f90-4838-b3af-026c9bc0c1ad", + "key": "12d564a9-3f90-4838-b3af-026c9bc0c1ad", + "label": "kbt_147(2020) metadata", + "value": "25636" + }, + { + "description": "Jurisdiction Metadata for kbt_90(2020) id d090f257-c58b-44ce-9cbb-ac94e4995390", + "key": "d090f257-c58b-44ce-9cbb-ac94e4995390", + "label": "kbt_90(2020) metadata", + "value": "25637" + }, + { + "description": "Jurisdiction Metadata for kbt_78(2020) id f1147f63-10d0-4ec1-b3a4-50606c2098ea", + "key": "f1147f63-10d0-4ec1-b3a4-50606c2098ea", + "label": "kbt_78(2020) metadata", + "value": "25638" + }, + { + "description": "Jurisdiction Metadata for kbt_45(2020) id 29e633b0-759b-4c65-aa5a-dfefec71a4b7", + "key": "29e633b0-759b-4c65-aa5a-dfefec71a4b7", + "label": "kbt_45(2020) metadata", + "value": "25639" + }, + { + "description": "Jurisdiction Metadata for kbt_148(2020) id eea7d748-9340-4d6e-8818-bc80bb3f70fa", + "key": "eea7d748-9340-4d6e-8818-bc80bb3f70fa", + "label": "kbt_148(2020) metadata", + "value": "25640" + }, + { + "description": "Jurisdiction Metadata for kbt_40(2020) id 9881e4c8-50b5-42bf-9dc7-88607d0f8553", + "key": "9881e4c8-50b5-42bf-9dc7-88607d0f8553", + "label": "kbt_40(2020) metadata", + "value": "25641" + }, + { + "description": "Jurisdiction Metadata for kbt_110(2020) id 76e5b185-1be0-4743-8d94-852e46956c06", + "key": "76e5b185-1be0-4743-8d94-852e46956c06", + "label": "kbt_110(2020) metadata", + "value": "25642" + }, + { + "description": "Jurisdiction Metadata for kbt_55(2020) id 399542ab-624a-43a2-b0ea-38fba6a7e7ad", + "key": "399542ab-624a-43a2-b0ea-38fba6a7e7ad", + "label": "kbt_55(2020) metadata", + "value": "25643" + }, + { + "description": "Jurisdiction Metadata for kbt_56(2020) id 480cdbca-9b78-4263-a790-17689c463496", + "key": "480cdbca-9b78-4263-a790-17689c463496", + "label": "kbt_56(2020) metadata", + "value": "25644" + }, + { + "description": "Jurisdiction Metadata for kbt_43(2020) id 46a1c277-fb0a-4891-a1db-ff508aa1d4c4", + "key": "46a1c277-fb0a-4891-a1db-ff508aa1d4c4", + "label": "kbt_43(2020) metadata", + "value": "25645" + }, + { + "description": "Jurisdiction Metadata for kbt_34(2020) id 5faf2a92-480d-4463-be73-87f163a63d90", + "key": "5faf2a92-480d-4463-be73-87f163a63d90", + "label": "kbt_34(2020) metadata", + "value": "25646" + }, + { + "description": "Jurisdiction Metadata for kbt_104(2020) id d6ea74dd-ff0f-4b96-b1eb-8eaeb24d5203", + "key": "d6ea74dd-ff0f-4b96-b1eb-8eaeb24d5203", + "label": "kbt_104(2020) metadata", + "value": "25647" + }, + { + "description": "Jurisdiction Metadata for Mulwe(2020) id 7ecaaa10-26c0-42b8-9ba4-a8a45180a0a0", + "key": "7ecaaa10-26c0-42b8-9ba4-a8a45180a0a0", + "label": "Mulwe(2020) metadata", + "value": "25648" + }, + { + "description": "Jurisdiction Metadata for Mulwe Zone id 138563f2-cd93-44db-9564-0fd6ed79b83e", + "key": "138563f2-cd93-44db-9564-0fd6ed79b83e", + "label": "Mulwe Zone metadata", + "value": "25649" + }, + { + "description": "Jurisdiction Metadata for mlw_2(2020) id 20be96e8-e6aa-4028-ad55-502ee5ded9c8", + "key": "20be96e8-e6aa-4028-ad55-502ee5ded9c8", + "label": "mlw_2(2020) metadata", + "value": "25650" + }, + { + "description": "Jurisdiction Metadata for Mukange Zone id 7663e72b-2398-4169-9d13-6679906edbd9", + "key": "7663e72b-2398-4169-9d13-6679906edbd9", + "label": "Mukange Zone metadata", + "value": "25651" + }, + { + "description": "Jurisdiction Metadata for mlw_3(2020) id c7064aca-8e7b-4e10-b14c-6842a3f3c0c0", + "key": "c7064aca-8e7b-4e10-b14c-6842a3f3c0c0", + "label": "mlw_3(2020) metadata", + "value": "25652" + }, + { + "description": "Jurisdiction Metadata for mlw_18(2020) id f7559f51-d99e-4ec8-9687-1b736e7a9008", + "key": "f7559f51-d99e-4ec8-9687-1b736e7a9008", + "label": "mlw_18(2020) metadata", + "value": "25653" + }, + { + "description": "Jurisdiction Metadata for mlw_51(2020) id 94427c11-bfd7-4341-aad6-f9c9161bb418", + "key": "94427c11-bfd7-4341-aad6-f9c9161bb418", + "label": "mlw_51(2020) metadata", + "value": "25654" + }, + { + "description": "Jurisdiction Metadata for mlw_58(2020) id 853ef974-b234-4543-bdac-09dd41c50814", + "key": "853ef974-b234-4543-bdac-09dd41c50814", + "label": "mlw_58(2020) metadata", + "value": "25655" + }, + { + "description": "Jurisdiction Metadata for mlw_83(2020) id 9b5321e9-c072-4d2f-9e33-82b6ab333ad1", + "key": "9b5321e9-c072-4d2f-9e33-82b6ab333ad1", + "label": "mlw_83(2020) metadata", + "value": "25656" + }, + { + "description": "Jurisdiction Metadata for mlw_108(2020) id 1d92f11a-4b38-4a3d-9a79-0f90721ebad1", + "key": "1d92f11a-4b38-4a3d-9a79-0f90721ebad1", + "label": "mlw_108(2020) metadata", + "value": "25657" + }, + { + "description": "Jurisdiction Metadata for mlw_69(2020) id eddb9434-b211-47c3-a6da-412a57861747", + "key": "eddb9434-b211-47c3-a6da-412a57861747", + "label": "mlw_69(2020) metadata", + "value": "25658" + }, + { + "description": "Jurisdiction Metadata for mlw_42(2020) id fa717b79-5df5-4d01-8846-5b53949067d8", + "key": "fa717b79-5df5-4d01-8846-5b53949067d8", + "label": "mlw_42(2020) metadata", + "value": "25659" + }, + { + "description": "Jurisdiction Metadata for Matampala (Nshoka) Zone id 4ff86e2b-4b34-430f-bee0-504719204000", + "key": "4ff86e2b-4b34-430f-bee0-504719204000", + "label": "Matampala (Nshoka) Zone metadata", + "value": "25660" + }, + { + "description": "Jurisdiction Metadata for mlw_79(2020) id 12c863d0-7193-4b3a-921f-cb3f09afdf18", + "key": "12c863d0-7193-4b3a-921f-cb3f09afdf18", + "label": "mlw_79(2020) metadata", + "value": "25661" + }, + { + "description": "Jurisdiction Metadata for mlw_87(2020) id 1f466fd2-bd91-4be4-8601-3e3225fb095c", + "key": "1f466fd2-bd91-4be4-8601-3e3225fb095c", + "label": "mlw_87(2020) metadata", + "value": "25662" + }, + { + "description": "Jurisdiction Metadata for mlw_105(2020) id 3b34c88b-5e37-4cfe-b2d1-d84a1fa41bae", + "key": "3b34c88b-5e37-4cfe-b2d1-d84a1fa41bae", + "label": "mlw_105(2020) metadata", + "value": "25663" + }, + { + "description": "Jurisdiction Metadata for mlw_9(2020) id 103594cb-1ced-4f62-97e4-28bc548a9b61", + "key": "103594cb-1ced-4f62-97e4-28bc548a9b61", + "label": "mlw_9(2020) metadata", + "value": "25664" + }, + { + "description": "Jurisdiction Metadata for mlw_76(2020) id 1a24db18-b6a5-40f6-8e07-35eaa85bc9c5", + "key": "1a24db18-b6a5-40f6-8e07-35eaa85bc9c5", + "label": "mlw_76(2020) metadata", + "value": "25665" + }, + { + "description": "Jurisdiction Metadata for mlw_39(2020) id 2d9457c5-b785-43f0-8795-40c971d47998", + "key": "2d9457c5-b785-43f0-8795-40c971d47998", + "label": "mlw_39(2020) metadata", + "value": "25666" + }, + { + "description": "Jurisdiction Metadata for mlw_31(2020) id cc41a7e5-5ad8-4d66-b52e-6afac301f24c", + "key": "cc41a7e5-5ad8-4d66-b52e-6afac301f24c", + "label": "mlw_31(2020) metadata", + "value": "25667" + }, + { + "description": "Jurisdiction Metadata for mlw_66(2020) id 2b994a1d-7a69-4ab3-8bc1-df6c5e742ef1", + "key": "2b994a1d-7a69-4ab3-8bc1-df6c5e742ef1", + "label": "mlw_66(2020) metadata", + "value": "25668" + }, + { + "description": "Jurisdiction Metadata for mlw_104(2020) id cf93e585-16e8-4e6a-94c3-1f4f53794788", + "key": "cf93e585-16e8-4e6a-94c3-1f4f53794788", + "label": "mlw_104(2020) metadata", + "value": "25669" + }, + { + "description": "Jurisdiction Metadata for mlw_36(2020) id f5d76d5c-47d9-479e-b2c3-25dc623416dd", + "key": "f5d76d5c-47d9-479e-b2c3-25dc623416dd", + "label": "mlw_36(2020) metadata", + "value": "25670" + }, + { + "description": "Jurisdiction Metadata for mlw_123(2020) id 5e964744-4c50-4fcc-86bb-7c75351ac8de", + "key": "5e964744-4c50-4fcc-86bb-7c75351ac8de", + "label": "mlw_123(2020) metadata", + "value": "25671" + }, + { + "description": "Jurisdiction Metadata for mlw_12(2020) id d996deb6-ae36-4198-bda5-8d1c8ba7a1a1", + "key": "d996deb6-ae36-4198-bda5-8d1c8ba7a1a1", + "label": "mlw_12(2020) metadata", + "value": "25672" + }, + { + "description": "Jurisdiction Metadata for mlw_95(2020) id 67e72fc5-3fe3-44f2-91ef-a33d996c99de", + "key": "67e72fc5-3fe3-44f2-91ef-a33d996c99de", + "label": "mlw_95(2020) metadata", + "value": "25673" + }, + { + "description": "Jurisdiction Metadata for mlw_17(2020) id 3b607635-815e-4beb-a766-f1d9d42bbc8f", + "key": "3b607635-815e-4beb-a766-f1d9d42bbc8f", + "label": "mlw_17(2020) metadata", + "value": "25674" + }, + { + "description": "Jurisdiction Metadata for mlw_19(2020) id fa82f61b-65b0-4196-89ab-f811cdceb132", + "key": "fa82f61b-65b0-4196-89ab-f811cdceb132", + "label": "mlw_19(2020) metadata", + "value": "25675" + }, + { + "description": "Jurisdiction Metadata for mlw_52(2020) id 54d46484-bb61-4889-a878-aa7d6457462b", + "key": "54d46484-bb61-4889-a878-aa7d6457462b", + "label": "mlw_52(2020) metadata", + "value": "25676" + }, + { + "description": "Jurisdiction Metadata for mlw_63(2020) id 84fd8831-f8a4-4449-83a1-951647631b8a", + "key": "84fd8831-f8a4-4449-83a1-951647631b8a", + "label": "mlw_63(2020) metadata", + "value": "25677" + }, + { + "description": "Jurisdiction Metadata for mlw_86(2020) id 47d6693a-5d22-49ef-a0e8-51f9a8f15066", + "key": "47d6693a-5d22-49ef-a0e8-51f9a8f15066", + "label": "mlw_86(2020) metadata", + "value": "25678" + }, + { + "description": "Jurisdiction Metadata for mlw_111(2020) id 041d76c4-28f8-4d03-a7bc-f2f49b9cd6c5", + "key": "041d76c4-28f8-4d03-a7bc-f2f49b9cd6c5", + "label": "mlw_111(2020) metadata", + "value": "25679" + }, + { + "description": "Jurisdiction Metadata for mlw_109(2020) id 4e886ffe-ce85-47c2-ac23-cbb636467bdc", + "key": "4e886ffe-ce85-47c2-ac23-cbb636467bdc", + "label": "mlw_109(2020) metadata", + "value": "25680" + }, + { + "description": "Jurisdiction Metadata for mlw_37(2020) id 30b85a2c-ba5f-437a-90a3-9cf6a9c6a968", + "key": "30b85a2c-ba5f-437a-90a3-9cf6a9c6a968", + "label": "mlw_37(2020) metadata", + "value": "25681" + }, + { + "description": "Jurisdiction Metadata for mlw_21(2020) id ac9027cf-86b1-4af4-a997-1fe793b963ba", + "key": "ac9027cf-86b1-4af4-a997-1fe793b963ba", + "label": "mlw_21(2020) metadata", + "value": "25682" + }, + { + "description": "Jurisdiction Metadata for mlw_10(2020) id 566b34bf-987c-469e-a12c-8e7a235741ba", + "key": "566b34bf-987c-469e-a12c-8e7a235741ba", + "label": "mlw_10(2020) metadata", + "value": "25683" + }, + { + "description": "Jurisdiction Metadata for mlw_114(2020) id 1513ec89-756c-4a65-af12-853dc1b4521d", + "key": "1513ec89-756c-4a65-af12-853dc1b4521d", + "label": "mlw_114(2020) metadata", + "value": "25684" + }, + { + "description": "Jurisdiction Metadata for mlw_44(2020) id 2f9cd60f-d6a1-4267-aa6a-fab6e2e61465", + "key": "2f9cd60f-d6a1-4267-aa6a-fab6e2e61465", + "label": "mlw_44(2020) metadata", + "value": "25685" + }, + { + "description": "Jurisdiction Metadata for mlw_112(2020) id 409730fb-8670-4ead-88ea-bcd47c0bf5a4", + "key": "409730fb-8670-4ead-88ea-bcd47c0bf5a4", + "label": "mlw_112(2020) metadata", + "value": "25686" + }, + { + "description": "Jurisdiction Metadata for mlw_64(2020) id 64a46ad3-d0ab-4edc-9e64-625c05ebbea7", + "key": "64a46ad3-d0ab-4edc-9e64-625c05ebbea7", + "label": "mlw_64(2020) metadata", + "value": "25687" + }, + { + "description": "Jurisdiction Metadata for mlw_74(2020) id 4c5a683d-f460-4403-8292-00598d860fef", + "key": "4c5a683d-f460-4403-8292-00598d860fef", + "label": "mlw_74(2020) metadata", + "value": "25688" + }, + { + "description": "Jurisdiction Metadata for mlw_40(2020) id a9fcec05-e5e5-41ac-a4af-2525c501aa98", + "key": "a9fcec05-e5e5-41ac-a4af-2525c501aa98", + "label": "mlw_40(2020) metadata", + "value": "25689" + }, + { + "description": "Jurisdiction Metadata for mlw_20(2020) id 3de69914-1d53-4830-9a0c-b3a88109148c", + "key": "3de69914-1d53-4830-9a0c-b3a88109148c", + "label": "mlw_20(2020) metadata", + "value": "25690" + }, + { + "description": "Jurisdiction Metadata for mlw_110(2020) id 6e27dab3-592e-4a92-9d23-9b4a5b2785e3", + "key": "6e27dab3-592e-4a92-9d23-9b4a5b2785e3", + "label": "mlw_110(2020) metadata", + "value": "25691" + }, + { + "description": "Jurisdiction Metadata for mlw_72(2020) id 8eca4b71-c2fd-4a01-9ca2-df3c3ab915ae", + "key": "8eca4b71-c2fd-4a01-9ca2-df3c3ab915ae", + "label": "mlw_72(2020) metadata", + "value": "25692" + }, + { + "description": "Jurisdiction Metadata for mlw_91(2020) id 41c64898-63c8-4a04-b5f5-49faa0c02965", + "key": "41c64898-63c8-4a04-b5f5-49faa0c02965", + "label": "mlw_91(2020) metadata", + "value": "25693" + }, + { + "description": "Jurisdiction Metadata for mlw_106(2020) id 617e4f82-cbb4-453e-bb31-634987d26564", + "key": "617e4f82-cbb4-453e-bb31-634987d26564", + "label": "mlw_106(2020) metadata", + "value": "25694" + }, + { + "description": "Jurisdiction Metadata for mlw_60(2020) id e237494f-9115-4b2f-bc51-aea5757bef3d", + "key": "e237494f-9115-4b2f-bc51-aea5757bef3d", + "label": "mlw_60(2020) metadata", + "value": "25695" + }, + { + "description": "Jurisdiction Metadata for mlw_22(2020) id e9403563-a584-45ac-a877-747dccabdd4f", + "key": "e9403563-a584-45ac-a877-747dccabdd4f", + "label": "mlw_22(2020) metadata", + "value": "25696" + }, + { + "description": "Jurisdiction Metadata for mlw_34(2020) id 8955231f-b283-4f62-8494-d48ef2b5ffbf", + "key": "8955231f-b283-4f62-8494-d48ef2b5ffbf", + "label": "mlw_34(2020) metadata", + "value": "25697" + }, + { + "description": "Jurisdiction Metadata for mlw_78(2020) id acbff628-9920-4e05-8421-060992586067", + "key": "acbff628-9920-4e05-8421-060992586067", + "label": "mlw_78(2020) metadata", + "value": "25698" + }, + { + "description": "Jurisdiction Metadata for mlw_30(2020) id 4ee8c7a2-e15d-4962-9a0a-33a83057e2ca", + "key": "4ee8c7a2-e15d-4962-9a0a-33a83057e2ca", + "label": "mlw_30(2020) metadata", + "value": "25699" + }, + { + "description": "Jurisdiction Metadata for mlw_41(2020) id 7330d82c-bd5a-4a7f-ac1d-c1c1dc7f6a92", + "key": "7330d82c-bd5a-4a7f-ac1d-c1c1dc7f6a92", + "label": "mlw_41(2020) metadata", + "value": "25700" + }, + { + "description": "Jurisdiction Metadata for mlw_16(2020) id 889ece0a-d81d-4117-9aca-5bce0c1f530e", + "key": "889ece0a-d81d-4117-9aca-5bce0c1f530e", + "label": "mlw_16(2020) metadata", + "value": "25701" + }, + { + "description": "Jurisdiction Metadata for mlw_80(2020) id b80597d1-97ca-48c2-8825-3203096f53a9", + "key": "b80597d1-97ca-48c2-8825-3203096f53a9", + "label": "mlw_80(2020) metadata", + "value": "25702" + }, + { + "description": "Jurisdiction Metadata for mlw_71(2020) id 20b5319b-60ff-48a1-9f0e-3abd79a44c9d", + "key": "20b5319b-60ff-48a1-9f0e-3abd79a44c9d", + "label": "mlw_71(2020) metadata", + "value": "25703" + }, + { + "description": "Jurisdiction Metadata for mlw_28(2020) id 60957d5f-e555-401e-93e5-2440b93bfbaa", + "key": "60957d5f-e555-401e-93e5-2440b93bfbaa", + "label": "mlw_28(2020) metadata", + "value": "25704" + }, + { + "description": "Jurisdiction Metadata for mlw_101(2020) id daf0e634-9f2a-477d-bb3a-c6776e1dd01f", + "key": "daf0e634-9f2a-477d-bb3a-c6776e1dd01f", + "label": "mlw_101(2020) metadata", + "value": "25705" + }, + { + "description": "Jurisdiction Metadata for mlw_46(2020) id 7ea34856-f66c-4e24-b9f1-ecc5a597417c", + "key": "7ea34856-f66c-4e24-b9f1-ecc5a597417c", + "label": "mlw_46(2020) metadata", + "value": "25706" + }, + { + "description": "Jurisdiction Metadata for mlw_15(2020) id 25f6b874-9fe7-4059-8c0f-722631192da9", + "key": "25f6b874-9fe7-4059-8c0f-722631192da9", + "label": "mlw_15(2020) metadata", + "value": "25707" + }, + { + "description": "Jurisdiction Metadata for mlw_113(2020) id 3acb3e17-ef9f-4e68-af76-75e6c515cb2a", + "key": "3acb3e17-ef9f-4e68-af76-75e6c515cb2a", + "label": "mlw_113(2020) metadata", + "value": "25708" + }, + { + "description": "Jurisdiction Metadata for mlw_55(2020) id d19ab460-7f3f-4838-a008-c3848da662bb", + "key": "d19ab460-7f3f-4838-a008-c3848da662bb", + "label": "mlw_55(2020) metadata", + "value": "25709" + }, + { + "description": "Jurisdiction Metadata for mlw_100(2020) id 6fe9fc2b-811b-4571-89f2-8253bb82e3df", + "key": "6fe9fc2b-811b-4571-89f2-8253bb82e3df", + "label": "mlw_100(2020) metadata", + "value": "25710" + }, + { + "description": "Jurisdiction Metadata for mlw_116(2020) id 5109e1b5-b002-44d3-a0c8-f0ca13ab6d21", + "key": "5109e1b5-b002-44d3-a0c8-f0ca13ab6d21", + "label": "mlw_116(2020) metadata", + "value": "25711" + }, + { + "description": "Jurisdiction Metadata for mlw_103(2020) id f73b575e-d06c-4caf-8061-398cc732318e", + "key": "f73b575e-d06c-4caf-8061-398cc732318e", + "label": "mlw_103(2020) metadata", + "value": "25712" + }, + { + "description": "Jurisdiction Metadata for mlw_56(2020) id b3293ea4-ac4c-4202-b51d-030f18910e52", + "key": "b3293ea4-ac4c-4202-b51d-030f18910e52", + "label": "mlw_56(2020) metadata", + "value": "25713" + }, + { + "description": "Jurisdiction Metadata for mlw_65(2020) id b95e4473-85f7-474d-9db7-393c8e9c33ba", + "key": "b95e4473-85f7-474d-9db7-393c8e9c33ba", + "label": "mlw_65(2020) metadata", + "value": "25714" + }, + { + "description": "Jurisdiction Metadata for mlw_54(2020) id 72d86874-6943-4ec6-98c8-bfd0046d109b", + "key": "72d86874-6943-4ec6-98c8-bfd0046d109b", + "label": "mlw_54(2020) metadata", + "value": "25715" + }, + { + "description": "Jurisdiction Metadata for mlw_45(2020) id 9d46f6ea-2520-4d15-ba0e-5b27d78ab91a", + "key": "9d46f6ea-2520-4d15-ba0e-5b27d78ab91a", + "label": "mlw_45(2020) metadata", + "value": "25716" + }, + { + "description": "Jurisdiction Metadata for mlw_92(2020) id a4c5b2a3-ef7e-4e0b-8720-6a982d15ab30", + "key": "a4c5b2a3-ef7e-4e0b-8720-6a982d15ab30", + "label": "mlw_92(2020) metadata", + "value": "25717" + }, + { + "description": "Jurisdiction Metadata for mlw_33(2020) id 35d00506-a893-4312-906d-62a09f2c5ddc", + "key": "35d00506-a893-4312-906d-62a09f2c5ddc", + "label": "mlw_33(2020) metadata", + "value": "25718" + }, + { + "description": "Jurisdiction Metadata for mlw_25(2020) id 3741db87-1a94-46d6-8a7f-99b012139b88", + "key": "3741db87-1a94-46d6-8a7f-99b012139b88", + "label": "mlw_25(2020) metadata", + "value": "25719" + }, + { + "description": "Jurisdiction Metadata for mlw_6(2020) id 7ccc4b35-96b0-4967-98e7-26152dfd4aae", + "key": "7ccc4b35-96b0-4967-98e7-26152dfd4aae", + "label": "mlw_6(2020) metadata", + "value": "25720" + }, + { + "description": "Jurisdiction Metadata for mlw_89(2020) id 2bdff13f-1ded-4113-a917-0bb153abe274", + "key": "2bdff13f-1ded-4113-a917-0bb153abe274", + "label": "mlw_89(2020) metadata", + "value": "25721" + }, + { + "description": "Jurisdiction Metadata for mlw_97(2020) id 327f19f1-cb99-493f-8d45-c44898b3d9ab", + "key": "327f19f1-cb99-493f-8d45-c44898b3d9ab", + "label": "mlw_97(2020) metadata", + "value": "25722" + }, + { + "description": "Jurisdiction Metadata for mlw_49(2020) id 9fa4fa3d-20cf-4042-ba5d-d50d440afedc", + "key": "9fa4fa3d-20cf-4042-ba5d-d50d440afedc", + "label": "mlw_49(2020) metadata", + "value": "25723" + }, + { + "description": "Jurisdiction Metadata for mlw_117(2020) id 9641192c-a4b9-489d-9698-8000dcb542fc", + "key": "9641192c-a4b9-489d-9698-8000dcb542fc", + "label": "mlw_117(2020) metadata", + "value": "25724" + }, + { + "description": "Jurisdiction Metadata for mlw_107(2020) id aa995fbe-cac2-4b95-b644-ba31aa14db87", + "key": "aa995fbe-cac2-4b95-b644-ba31aa14db87", + "label": "mlw_107(2020) metadata", + "value": "25725" + }, + { + "description": "Jurisdiction Metadata for mlw_98(2020) id e6d45528-c83e-4754-80d0-b2345a14813a", + "key": "e6d45528-c83e-4754-80d0-b2345a14813a", + "label": "mlw_98(2020) metadata", + "value": "25726" + }, + { + "description": "Jurisdiction Metadata for mlw_73(2020) id 38d1c892-5860-4e61-a859-1712b6bfdd7f", + "key": "38d1c892-5860-4e61-a859-1712b6bfdd7f", + "label": "mlw_73(2020) metadata", + "value": "25727" + }, + { + "description": "Jurisdiction Metadata for mlw_62(2020) id 83562b14-d722-494a-81dd-0d26c609973a", + "key": "83562b14-d722-494a-81dd-0d26c609973a", + "label": "mlw_62(2020) metadata", + "value": "25728" + }, + { + "description": "Jurisdiction Metadata for mlw_118(2020) id e00724df-2126-4777-8c11-1f801546b671", + "key": "e00724df-2126-4777-8c11-1f801546b671", + "label": "mlw_118(2020) metadata", + "value": "25729" + }, + { + "description": "Jurisdiction Metadata for mlw_7(2020) id 5c119c3b-1199-48a2-8149-0a77fe50673a", + "key": "5c119c3b-1199-48a2-8149-0a77fe50673a", + "label": "mlw_7(2020) metadata", + "value": "25730" + }, + { + "description": "Jurisdiction Metadata for mlw_77(2020) id e57da5bc-dd55-4563-94ef-b1b0b2754df6", + "key": "e57da5bc-dd55-4563-94ef-b1b0b2754df6", + "label": "mlw_77(2020) metadata", + "value": "25731" + }, + { + "description": "Jurisdiction Metadata for mlw_99(2020) id ddfdadac-03aa-49ab-b793-dac692e15b0e", + "key": "ddfdadac-03aa-49ab-b793-dac692e15b0e", + "label": "mlw_99(2020) metadata", + "value": "25732" + }, + { + "description": "Jurisdiction Metadata for mlw_29(2020) id de3b9c6e-953f-4899-8dab-b0691cc17a18", + "key": "de3b9c6e-953f-4899-8dab-b0691cc17a18", + "label": "mlw_29(2020) metadata", + "value": "25733" + }, + { + "description": "Jurisdiction Metadata for mlw_13(2020) id c175f3fd-c7ad-4326-a1e8-f266d6cf4779", + "key": "c175f3fd-c7ad-4326-a1e8-f266d6cf4779", + "label": "mlw_13(2020) metadata", + "value": "25734" + }, + { + "description": "Jurisdiction Metadata for mlw_120(2020) id af5df24d-3c17-4445-a7f5-afabb686f495", + "key": "af5df24d-3c17-4445-a7f5-afabb686f495", + "label": "mlw_120(2020) metadata", + "value": "25735" + }, + { + "description": "Jurisdiction Metadata for mlw_115(2020) id 8fb028fc-0fa9-45d2-a8fe-28370ec33381", + "key": "8fb028fc-0fa9-45d2-a8fe-28370ec33381", + "label": "mlw_115(2020) metadata", + "value": "25736" + }, + { + "description": "Jurisdiction Metadata for mlw_5(2020) id d73e847b-ab3f-4a53-9b79-87b5b9814e52", + "key": "d73e847b-ab3f-4a53-9b79-87b5b9814e52", + "label": "mlw_5(2020) metadata", + "value": "25737" + }, + { + "description": "Jurisdiction Metadata for mlw_14(2020) id 82aeb31d-e46f-4cef-b82c-5ccac4c1f9cf", + "key": "82aeb31d-e46f-4cef-b82c-5ccac4c1f9cf", + "label": "mlw_14(2020) metadata", + "value": "25738" + }, + { + "description": "Jurisdiction Metadata for mlw_81(2020) id e0ff4c29-ef2f-47e7-92cc-0a766ecf6b9d", + "key": "e0ff4c29-ef2f-47e7-92cc-0a766ecf6b9d", + "label": "mlw_81(2020) metadata", + "value": "25739" + }, + { + "description": "Jurisdiction Metadata for mlw_93(2020) id 2462fede-f27d-4e8a-9244-9c920954f44f", + "key": "2462fede-f27d-4e8a-9244-9c920954f44f", + "label": "mlw_93(2020) metadata", + "value": "25740" + }, + { + "description": "Jurisdiction Metadata for mlw_43(2020) id 77396cc5-e7eb-4ebc-a1af-f42f11ea0a5a", + "key": "77396cc5-e7eb-4ebc-a1af-f42f11ea0a5a", + "label": "mlw_43(2020) metadata", + "value": "25741" + }, + { + "description": "Jurisdiction Metadata for mlw_67(2020) id 29bda44b-f92f-4dcf-93c3-cb3d33942b11", + "key": "29bda44b-f92f-4dcf-93c3-cb3d33942b11", + "label": "mlw_67(2020) metadata", + "value": "25742" + }, + { + "description": "Jurisdiction Metadata for mlw_38(2020) id 265dc9f1-ea33-44cf-8b9a-eb90752dbb7f", + "key": "265dc9f1-ea33-44cf-8b9a-eb90752dbb7f", + "label": "mlw_38(2020) metadata", + "value": "25743" + }, + { + "description": "Jurisdiction Metadata for mlw_119(2020) id c70fa4fe-53ee-4343-a27c-0c85560ac1cc", + "key": "c70fa4fe-53ee-4343-a27c-0c85560ac1cc", + "label": "mlw_119(2020) metadata", + "value": "25744" + }, + { + "description": "Jurisdiction Metadata for mlw_68(2020) id 56b052a2-dd8e-4e63-8339-2aabe0ef57d5", + "key": "56b052a2-dd8e-4e63-8339-2aabe0ef57d5", + "label": "mlw_68(2020) metadata", + "value": "25745" + }, + { + "description": "Jurisdiction Metadata for mlw_53(2020) id 65e514e1-45a3-49e1-8bd8-3cd94e182685", + "key": "65e514e1-45a3-49e1-8bd8-3cd94e182685", + "label": "mlw_53(2020) metadata", + "value": "25746" + }, + { + "description": "Jurisdiction Metadata for mlw_85(2020) id 604d2ae4-70b4-4fc9-84b3-cf8e2fe0061d", + "key": "604d2ae4-70b4-4fc9-84b3-cf8e2fe0061d", + "label": "mlw_85(2020) metadata", + "value": "25747" + }, + { + "description": "Jurisdiction Metadata for mlw_24(2020) id a61a04b1-2b4b-4fb2-b715-9ca1c861ecc6", + "key": "a61a04b1-2b4b-4fb2-b715-9ca1c861ecc6", + "label": "mlw_24(2020) metadata", + "value": "25748" + }, + { + "description": "Jurisdiction Metadata for mlw_32(2020) id 7508ceec-860d-42d0-bb89-0da6fd473fa4", + "key": "7508ceec-860d-42d0-bb89-0da6fd473fa4", + "label": "mlw_32(2020) metadata", + "value": "25749" + }, + { + "description": "Jurisdiction Metadata for mlw_61(2020) id 01bda4aa-c39c-4e4a-87ca-5bb73b318874", + "key": "01bda4aa-c39c-4e4a-87ca-5bb73b318874", + "label": "mlw_61(2020) metadata", + "value": "25750" + }, + { + "description": "Jurisdiction Metadata for mlw_102(2020) id a5f849e7-76ff-4619-9072-060a58d4bd9c", + "key": "a5f849e7-76ff-4619-9072-060a58d4bd9c", + "label": "mlw_102(2020) metadata", + "value": "25751" + }, + { + "description": "Jurisdiction Metadata for mlw_122(2020) id f289f930-c383-4e25-9533-efa8834980ea", + "key": "f289f930-c383-4e25-9533-efa8834980ea", + "label": "mlw_122(2020) metadata", + "value": "25752" + }, + { + "description": "Jurisdiction Metadata for mlw_94(2020) id d3403268-a28b-44ae-bae1-0b5ca8af0244", + "key": "d3403268-a28b-44ae-bae1-0b5ca8af0244", + "label": "mlw_94(2020) metadata", + "value": "25753" + }, + { + "description": "Jurisdiction Metadata for mlw_57(2020) id e2f49b9b-c22d-4f6a-a79a-5045d8a29121", + "key": "e2f49b9b-c22d-4f6a-a79a-5045d8a29121", + "label": "mlw_57(2020) metadata", + "value": "25754" + }, + { + "description": "Jurisdiction Metadata for mlw_75(2020) id 4a105c40-47af-4389-9fcc-b0ac31cb393a", + "key": "4a105c40-47af-4389-9fcc-b0ac31cb393a", + "label": "mlw_75(2020) metadata", + "value": "25755" + }, + { + "description": "Jurisdiction Metadata for mlw_11(2020) id 37abf250-0d93-4cc5-bfb1-81ef06350374", + "key": "37abf250-0d93-4cc5-bfb1-81ef06350374", + "label": "mlw_11(2020) metadata", + "value": "25756" + }, + { + "description": "Jurisdiction Metadata for mlw_59(2020) id 20562e5f-54aa-458a-90d4-7588674dc8e7", + "key": "20562e5f-54aa-458a-90d4-7588674dc8e7", + "label": "mlw_59(2020) metadata", + "value": "25757" + }, + { + "description": "Jurisdiction Metadata for mlw_26(2020) id 3245d02f-2268-43a4-90c8-22289d2f5137", + "key": "3245d02f-2268-43a4-90c8-22289d2f5137", + "label": "mlw_26(2020) metadata", + "value": "25758" + }, + { + "description": "Jurisdiction Metadata for mlw_8(2020) id f7b13e4b-aa52-458b-8633-719cdf859182", + "key": "f7b13e4b-aa52-458b-8633-719cdf859182", + "label": "mlw_8(2020) metadata", + "value": "25759" + }, + { + "description": "Jurisdiction Metadata for mlw_88(2020) id 56afc1d1-0ea1-4242-9b89-8e3623b028c9", + "key": "56afc1d1-0ea1-4242-9b89-8e3623b028c9", + "label": "mlw_88(2020) metadata", + "value": "25760" + }, + { + "description": "Jurisdiction Metadata for mlw_48(2020) id b06cd34e-54a5-4d10-8fab-e79470e46712", + "key": "b06cd34e-54a5-4d10-8fab-e79470e46712", + "label": "mlw_48(2020) metadata", + "value": "25761" + }, + { + "description": "Jurisdiction Metadata for mlw_96(2020) id fbec85a0-871b-478a-b093-96b478d15e1d", + "key": "fbec85a0-871b-478a-b093-96b478d15e1d", + "label": "mlw_96(2020) metadata", + "value": "25762" + }, + { + "description": "Jurisdiction Metadata for mlw_70(2020) id a1c23d27-bec7-4c3b-a5ae-e0765edf03ca", + "key": "a1c23d27-bec7-4c3b-a5ae-e0765edf03ca", + "label": "mlw_70(2020) metadata", + "value": "25763" + }, + { + "description": "Jurisdiction Metadata for mlw_90(2020) id 67d9e79e-25bb-447e-931f-e2784e60f28b", + "key": "67d9e79e-25bb-447e-931f-e2784e60f28b", + "label": "mlw_90(2020) metadata", + "value": "25764" + }, + { + "description": "Jurisdiction Metadata for mlw_23(2020) id 3c53f458-2b73-47a3-8ac0-9715141a59a0", + "key": "3c53f458-2b73-47a3-8ac0-9715141a59a0", + "label": "mlw_23(2020) metadata", + "value": "25765" + }, + { + "description": "Jurisdiction Metadata for mlw_121(2020) id 3f2667f7-47cd-4d88-a996-4129e162ee9d", + "key": "3f2667f7-47cd-4d88-a996-4129e162ee9d", + "label": "mlw_121(2020) metadata", + "value": "25766" + }, + { + "description": "Jurisdiction Metadata for mlw_50(2020) id e661e7e9-d2d2-4d92-be95-f2dc9499b717", + "key": "e661e7e9-d2d2-4d92-be95-f2dc9499b717", + "label": "mlw_50(2020) metadata", + "value": "25767" + }, + { + "description": "Jurisdiction Metadata for mlw_84(2020) id 49c7d166-7c3c-4b2e-8b51-4941fb05e2f0", + "key": "49c7d166-7c3c-4b2e-8b51-4941fb05e2f0", + "label": "mlw_84(2020) metadata", + "value": "25768" + }, + { + "description": "Jurisdiction Metadata for Nshinda Zone id a3d6b1ec-7345-47a1-9538-7f3cead8a1ad", + "key": "a3d6b1ec-7345-47a1-9538-7f3cead8a1ad", + "label": "Nshinda Zone metadata", + "value": "25769" + }, + { + "description": "Jurisdiction Metadata for mlw_35(2020) id 6bbf12de-585c-4921-8fe4-0d30b6014e15", + "key": "6bbf12de-585c-4921-8fe4-0d30b6014e15", + "label": "mlw_35(2020) metadata", + "value": "25770" + }, + { + "description": "Jurisdiction Metadata for mlw_47(2020) id 1b028f7d-fbc7-48ce-a997-d464133d7a01", + "key": "1b028f7d-fbc7-48ce-a997-d464133d7a01", + "label": "mlw_47(2020) metadata", + "value": "25771" + }, + { + "description": "Jurisdiction Metadata for mlw_4(2020) id ded46bc8-83ba-45c3-b829-3050b2ebbef1", + "key": "ded46bc8-83ba-45c3-b829-3050b2ebbef1", + "label": "mlw_4(2020) metadata", + "value": "25772" + }, + { + "description": "Jurisdiction Metadata for mlw_27(2020) id d09dd43a-85f3-469a-94e2-6daf968ae5a3", + "key": "d09dd43a-85f3-469a-94e2-6daf968ae5a3", + "label": "mlw_27(2020) metadata", + "value": "25773" + }, + { + "description": "Jurisdiction Metadata for Kampampi zone id 9ca80078-2200-4cdf-94ca-c4ee6cb3c2ea", + "key": "9ca80078-2200-4cdf-94ca-c4ee6cb3c2ea", + "label": "Kampampi zone metadata", + "value": "25774" + }, + { + "description": "Jurisdiction Metadata for mlw_82(2020) id 92ac8b8b-e9d2-45f8-a0f4-0f0637e2501f", + "key": "92ac8b8b-e9d2-45f8-a0f4-0f0637e2501f", + "label": "mlw_82(2020) metadata", + "value": "25775" + }, + { + "description": "Jurisdiction Metadata for mlw_1(2020) id 9fe04a9e-dac3-4861-a4fe-483ec38206eb", + "key": "9fe04a9e-dac3-4861-a4fe-483ec38206eb", + "label": "mlw_1(2020) metadata", + "value": "25776" + }, + { + "description": "Jurisdiction Metadata for Kanyembo(2020) id 218d9948-336a-4937-a412-fa24ec9e53be", + "key": "218d9948-336a-4937-a412-fa24ec9e53be", + "label": "Kanyembo(2020) metadata", + "value": "25777" + }, + { + "description": "Jurisdiction Metadata for Chikumbi Zone id 56e2ffcc-4208-4dcd-8875-76d01092b4d7", + "key": "56e2ffcc-4208-4dcd-8875-76d01092b4d7", + "label": "Chikumbi Zone metadata", + "value": "25778" + }, + { + "description": "Jurisdiction Metadata for kym_46(2020) id ad574c63-af95-44ae-9453-06b078b48532", + "key": "ad574c63-af95-44ae-9453-06b078b48532", + "label": "kym_46(2020) metadata", + "value": "25779" + }, + { + "description": "Jurisdiction Metadata for kym_38(2020) id d139350d-27fb-4d99-b305-5b00f113bd77", + "key": "d139350d-27fb-4d99-b305-5b00f113bd77", + "label": "kym_38(2020) metadata", + "value": "25780" + }, + { + "description": "Jurisdiction Metadata for kym_10(2020) id 20fbbd13-014b-4a78-afe2-2bea3cec0579", + "key": "20fbbd13-014b-4a78-afe2-2bea3cec0579", + "label": "kym_10(2020) metadata", + "value": "25781" + }, + { + "description": "Jurisdiction Metadata for kym_49(2020) id a900ce8f-8f67-44c8-9339-c8ade43ecc96", + "key": "a900ce8f-8f67-44c8-9339-c8ade43ecc96", + "label": "kym_49(2020) metadata", + "value": "25782" + }, + { + "description": "Jurisdiction Metadata for kym_47(2020) id f7cd9451-b7c9-4dfe-a436-92cafb27be57", + "key": "f7cd9451-b7c9-4dfe-a436-92cafb27be57", + "label": "kym_47(2020) metadata", + "value": "25783" + }, + { + "description": "Jurisdiction Metadata for kym_35(2020) id 03a23b42-ca74-4c15-94fd-c967d6c49d0d", + "key": "03a23b42-ca74-4c15-94fd-c967d6c49d0d", + "label": "kym_35(2020) metadata", + "value": "25784" + }, + { + "description": "Jurisdiction Metadata for Kapota Zone id bff16cc3-dd3c-40e0-9535-55caf0c8f2d2", + "key": "bff16cc3-dd3c-40e0-9535-55caf0c8f2d2", + "label": "Kapota Zone metadata", + "value": "25785" + }, + { + "description": "Jurisdiction Metadata for kym_18(2020) id 91f5059c-9b6d-477d-b9a4-b7a5c00671d6", + "key": "91f5059c-9b6d-477d-b9a4-b7a5c00671d6", + "label": "kym_18(2020) metadata", + "value": "25786" + }, + { + "description": "Jurisdiction Metadata for kym_24(2020) id 6ea6fee9-5bb3-42ec-881a-65cc2e0dc328", + "key": "6ea6fee9-5bb3-42ec-881a-65cc2e0dc328", + "label": "kym_24(2020) metadata", + "value": "25787" + }, + { + "description": "Jurisdiction Metadata for kym_14(2020) id 31815e8c-f177-41f7-b1a3-abe910393923", + "key": "31815e8c-f177-41f7-b1a3-abe910393923", + "label": "kym_14(2020) metadata", + "value": "25788" + }, + { + "description": "Jurisdiction Metadata for kym_19(2020) id fc177072-ae71-4b8d-99ee-88dc9ab3d6de", + "key": "fc177072-ae71-4b8d-99ee-88dc9ab3d6de", + "label": "kym_19(2020) metadata", + "value": "25789" + }, + { + "description": "Jurisdiction Metadata for kym_31(2020) id 31faef02-4e69-4973-a4be-271bd8bf1939", + "key": "31faef02-4e69-4973-a4be-271bd8bf1939", + "label": "kym_31(2020) metadata", + "value": "25790" + }, + { + "description": "Jurisdiction Metadata for kym_21(2020) id 2f643475-6044-43c6-aa44-22a1f7a1d1aa", + "key": "2f643475-6044-43c6-aa44-22a1f7a1d1aa", + "label": "kym_21(2020) metadata", + "value": "25791" + }, + { + "description": "Jurisdiction Metadata for kym_25(2020) id b77e8489-dd3c-46d2-b2a0-5b91824e2648", + "key": "b77e8489-dd3c-46d2-b2a0-5b91824e2648", + "label": "kym_25(2020) metadata", + "value": "25792" + }, + { + "description": "Jurisdiction Metadata for kym_32(2020) id 8e259e5a-3f96-4984-a14c-4e6182ffd603", + "key": "8e259e5a-3f96-4984-a14c-4e6182ffd603", + "label": "kym_32(2020) metadata", + "value": "25793" + }, + { + "description": "Jurisdiction Metadata for kym_27(2020) id ad6f8194-455e-4bdc-acbc-d9c45827f042", + "key": "ad6f8194-455e-4bdc-acbc-d9c45827f042", + "label": "kym_27(2020) metadata", + "value": "25794" + }, + { + "description": "Jurisdiction Metadata for kym_42(2020) id ffa206a8-304f-48bd-a971-c656bd45c4b0", + "key": "ffa206a8-304f-48bd-a971-c656bd45c4b0", + "label": "kym_42(2020) metadata", + "value": "25795" + }, + { + "description": "Jurisdiction Metadata for kym_57(2020) id 9722952a-41be-499f-b663-7c82bc9ef7d0", + "key": "9722952a-41be-499f-b663-7c82bc9ef7d0", + "label": "kym_57(2020) metadata", + "value": "25796" + }, + { + "description": "Jurisdiction Metadata for kym_43(2020) id 6fb8b0d6-b987-4e51-852e-96f2902e796c", + "key": "6fb8b0d6-b987-4e51-852e-96f2902e796c", + "label": "kym_43(2020) metadata", + "value": "25797" + }, + { + "description": "Jurisdiction Metadata for kym_20(2020) id 5fc0ee64-ecfa-4ec9-9bd8-bd2210593a11", + "key": "5fc0ee64-ecfa-4ec9-9bd8-bd2210593a11", + "label": "kym_20(2020) metadata", + "value": "25798" + }, + { + "description": "Jurisdiction Metadata for kym_30(2020) id 86909ce9-dda8-4dae-83ec-d16da35da8cd", + "key": "86909ce9-dda8-4dae-83ec-d16da35da8cd", + "label": "kym_30(2020) metadata", + "value": "25799" + }, + { + "description": "Jurisdiction Metadata for kym_11(2020) id d7b32c42-359e-4490-b1be-7034cfe552ef", + "key": "d7b32c42-359e-4490-b1be-7034cfe552ef", + "label": "kym_11(2020) metadata", + "value": "25800" + }, + { + "description": "Jurisdiction Metadata for kym_50(2020) id ef85eb82-127d-4a16-89b9-f7cb21ffd294", + "key": "ef85eb82-127d-4a16-89b9-f7cb21ffd294", + "label": "kym_50(2020) metadata", + "value": "25801" + }, + { + "description": "Jurisdiction Metadata for kym_15(2020) id da3b5d38-89b8-42a5-99d1-0c931f933329", + "key": "da3b5d38-89b8-42a5-99d1-0c931f933329", + "label": "kym_15(2020) metadata", + "value": "25802" + }, + { + "description": "Jurisdiction Metadata for kym_23(2020) id 2061d680-32d2-4528-b02d-278f6592e059", + "key": "2061d680-32d2-4528-b02d-278f6592e059", + "label": "kym_23(2020) metadata", + "value": "25803" + }, + { + "description": "Jurisdiction Metadata for kym_28(2020) id 36d29557-0207-4141-b914-ade80d17c4ef", + "key": "36d29557-0207-4141-b914-ade80d17c4ef", + "label": "kym_28(2020) metadata", + "value": "25804" + }, + { + "description": "Jurisdiction Metadata for kym_55(2020) id eca3f85e-f398-46f3-99c8-58cb93a570d6", + "key": "eca3f85e-f398-46f3-99c8-58cb93a570d6", + "label": "kym_55(2020) metadata", + "value": "25805" + }, + { + "description": "Jurisdiction Metadata for kym_58(2020) id 17a9540f-aa5c-4715-a888-6b2a58ef3c87", + "key": "17a9540f-aa5c-4715-a888-6b2a58ef3c87", + "label": "kym_58(2020) metadata", + "value": "25806" + }, + { + "description": "Jurisdiction Metadata for kym_53(2020) id 6b6149ab-472b-4c80-bbb7-269d37079144", + "key": "6b6149ab-472b-4c80-bbb7-269d37079144", + "label": "kym_53(2020) metadata", + "value": "25807" + }, + { + "description": "Jurisdiction Metadata for kym_37(2020) id 696cbf44-7612-4697-bfee-2eaad024af12", + "key": "696cbf44-7612-4697-bfee-2eaad024af12", + "label": "kym_37(2020) metadata", + "value": "25808" + }, + { + "description": "Jurisdiction Metadata for kym_29(2020) id 481720e7-e324-4b8e-9c7b-8e51376d710d", + "key": "481720e7-e324-4b8e-9c7b-8e51376d710d", + "label": "kym_29(2020) metadata", + "value": "25809" + }, + { + "description": "Jurisdiction Metadata for kym_44(2020) id 658ca53d-ee95-4eb9-9ce8-43099e72e25c", + "key": "658ca53d-ee95-4eb9-9ce8-43099e72e25c", + "label": "kym_44(2020) metadata", + "value": "25810" + }, + { + "description": "Jurisdiction Metadata for kym_56(2020) id 6c8c2180-f2cf-4afc-8cb8-5ee7657623b4", + "key": "6c8c2180-f2cf-4afc-8cb8-5ee7657623b4", + "label": "kym_56(2020) metadata", + "value": "25811" + }, + { + "description": "Jurisdiction Metadata for kym_59(2020) id 5e8321f7-556f-491c-b1f7-ad503ca77a8d", + "key": "5e8321f7-556f-491c-b1f7-ad503ca77a8d", + "label": "kym_59(2020) metadata", + "value": "25812" + }, + { + "description": "Jurisdiction Metadata for kym_60(2020) id 4891c9ca-9925-4e84-b875-4dd86d5b2179", + "key": "4891c9ca-9925-4e84-b875-4dd86d5b2179", + "label": "kym_60(2020) metadata", + "value": "25813" + }, + { + "description": "Jurisdiction Metadata for kym_22(2020) id ac99f5c6-c93c-46e6-985e-a9cd5f27f0a7", + "key": "ac99f5c6-c93c-46e6-985e-a9cd5f27f0a7", + "label": "kym_22(2020) metadata", + "value": "25814" + }, + { + "description": "Jurisdiction Metadata for kym_12(2020) id a65949e5-d2ef-45d5-8890-6933b0d77c8b", + "key": "a65949e5-d2ef-45d5-8890-6933b0d77c8b", + "label": "kym_12(2020) metadata", + "value": "25815" + }, + { + "description": "Jurisdiction Metadata for kym_51(2020) id e1a8473e-b69e-45bf-b0b5-9c89793cc570", + "key": "e1a8473e-b69e-45bf-b0b5-9c89793cc570", + "label": "kym_51(2020) metadata", + "value": "25816" + }, + { + "description": "Jurisdiction Metadata for kym_36(2020) id 4c9b4dde-458f-42c6-8d24-ab053613671e", + "key": "4c9b4dde-458f-42c6-8d24-ab053613671e", + "label": "kym_36(2020) metadata", + "value": "25817" + }, + { + "description": "Jurisdiction Metadata for kym_26(2020) id b03658be-0e0c-46b5-a445-4ae2067b95ee", + "key": "b03658be-0e0c-46b5-a445-4ae2067b95ee", + "label": "kym_26(2020) metadata", + "value": "25818" + }, + { + "description": "Jurisdiction Metadata for kym_7(2020) id 9914386d-7736-4800-b70c-7347104ddc5a", + "key": "9914386d-7736-4800-b70c-7347104ddc5a", + "label": "kym_7(2020) metadata", + "value": "25819" + }, + { + "description": "Jurisdiction Metadata for kym_41(2020) id 3c3486a8-b110-4c3f-85b5-dcfa6910165c", + "key": "3c3486a8-b110-4c3f-85b5-dcfa6910165c", + "label": "kym_41(2020) metadata", + "value": "25820" + }, + { + "description": "Jurisdiction Metadata for Lunde Zone id 654713b2-f924-40ae-a113-ef35a5c97c76", + "key": "654713b2-f924-40ae-a113-ef35a5c97c76", + "label": "Lunde Zone metadata", + "value": "25821" + }, + { + "description": "Jurisdiction Metadata for kym_34(2020) id 1a48e6c0-555c-472d-b84e-be1197af5f61", + "key": "1a48e6c0-555c-472d-b84e-be1197af5f61", + "label": "kym_34(2020) metadata", + "value": "25822" + }, + { + "description": "Jurisdiction Metadata for kym_16(2020) id 8d1ab5a0-e44b-49c8-ae2e-81ba9a745602", + "key": "8d1ab5a0-e44b-49c8-ae2e-81ba9a745602", + "label": "kym_16(2020) metadata", + "value": "25823" + }, + { + "description": "Jurisdiction Metadata for kym_48(2020) id 2ce3062d-b511-4f20-b900-57ebb266814f", + "key": "2ce3062d-b511-4f20-b900-57ebb266814f", + "label": "kym_48(2020) metadata", + "value": "25824" + }, + { + "description": "Jurisdiction Metadata for kym_33(2020) id 4755e177-ee0a-4e55-a3ed-b190c6496175", + "key": "4755e177-ee0a-4e55-a3ed-b190c6496175", + "label": "kym_33(2020) metadata", + "value": "25825" + }, + { + "description": "Jurisdiction Metadata for kym_13(2020) id 7cffb031-9cc2-4c1c-beed-03f599c930a3", + "key": "7cffb031-9cc2-4c1c-beed-03f599c930a3", + "label": "kym_13(2020) metadata", + "value": "25826" + }, + { + "description": "Jurisdiction Metadata for kym_54(2020) id 014a524a-6450-4afb-9a7f-d4ff322f7fe7", + "key": "014a524a-6450-4afb-9a7f-d4ff322f7fe7", + "label": "kym_54(2020) metadata", + "value": "25827" + }, + { + "description": "Jurisdiction Metadata for kym_8(2020) id 65b12a2d-11fb-454b-8dfc-55e818e6c881", + "key": "65b12a2d-11fb-454b-8dfc-55e818e6c881", + "label": "kym_8(2020) metadata", + "value": "25828" + }, + { + "description": "Jurisdiction Metadata for kym_9(2020) id 268f47ec-6bf8-432d-82ac-9c41f70f3858", + "key": "268f47ec-6bf8-432d-82ac-9c41f70f3858", + "label": "kym_9(2020) metadata", + "value": "25829" + }, + { + "description": "Jurisdiction Metadata for kym_40(2020) id 2847f7d8-cecc-4b8f-bfbf-80f67cec6bf7", + "key": "2847f7d8-cecc-4b8f-bfbf-80f67cec6bf7", + "label": "kym_40(2020) metadata", + "value": "25830" + }, + { + "description": "Jurisdiction Metadata for kym_17(2020) id 3fc9c5a8-e5a9-4b53-9ace-3d688a1ef30e", + "key": "3fc9c5a8-e5a9-4b53-9ace-3d688a1ef30e", + "label": "kym_17(2020) metadata", + "value": "25831" + }, + { + "description": "Jurisdiction Metadata for Shanyemba Zone id 531d95f4-db48-4386-85cb-de0f571d518d", + "key": "531d95f4-db48-4386-85cb-de0f571d518d", + "label": "Shanyemba Zone metadata", + "value": "25832" + }, + { + "description": "Jurisdiction Metadata for kym_39(2020) id f63158b4-9820-4d7e-af80-90a79883772f", + "key": "f63158b4-9820-4d7e-af80-90a79883772f", + "label": "kym_39(2020) metadata", + "value": "25833" + }, + { + "description": "Jurisdiction Metadata for kym_5(2020) id ed86e650-0309-41d6-80c8-def9705939c4", + "key": "ed86e650-0309-41d6-80c8-def9705939c4", + "label": "kym_5(2020) metadata", + "value": "25834" + }, + { + "description": "Jurisdiction Metadata for Labi Zone id 854f3bd2-314e-4230-a8da-496596c5284b", + "key": "854f3bd2-314e-4230-a8da-496596c5284b", + "label": "Labi Zone metadata", + "value": "25835" + }, + { + "description": "Jurisdiction Metadata for kym_1(2020) id 89adf25b-0584-4336-9d87-b07ea6311391", + "key": "89adf25b-0584-4336-9d87-b07ea6311391", + "label": "kym_1(2020) metadata", + "value": "25836" + }, + { + "description": "Jurisdiction Metadata for Kanyembo Zone id 66edbe5b-5f1b-48dd-8678-d7cc9b746687", + "key": "66edbe5b-5f1b-48dd-8678-d7cc9b746687", + "label": "Kanyembo Zone metadata", + "value": "25837" + }, + { + "description": "Jurisdiction Metadata for kym_4(2020) id d29606e4-e69d-4bb3-8566-61bdc494c49b", + "key": "d29606e4-e69d-4bb3-8566-61bdc494c49b", + "label": "kym_4(2020) metadata", + "value": "25838" + }, + { + "description": "Jurisdiction Metadata for Lushili Zone id 38fe4c6b-7ea1-4de5-9920-9a1f6412086c", + "key": "38fe4c6b-7ea1-4de5-9920-9a1f6412086c", + "label": "Lushili Zone metadata", + "value": "25839" + }, + { + "description": "Jurisdiction Metadata for kym_45(2020) id 0f235851-3b3b-4d6a-a36e-db91592480ea", + "key": "0f235851-3b3b-4d6a-a36e-db91592480ea", + "label": "kym_45(2020) metadata", + "value": "25840" + }, + { + "description": "Jurisdiction Metadata for kym_2(2020) id 1718320c-f887-45b5-a8aa-0c369957a863", + "key": "1718320c-f887-45b5-a8aa-0c369957a863", + "label": "kym_2(2020) metadata", + "value": "25841" + }, + { + "description": "Jurisdiction Metadata for Kashita Zone id 1314496f-7e86-4754-94bb-c30c3ba09a12", + "key": "1314496f-7e86-4754-94bb-c30c3ba09a12", + "label": "Kashita Zone metadata", + "value": "25842" + }, + { + "description": "Jurisdiction Metadata for kym_3(2020) id 4c187c55-abf9-4c05-89f9-3b3afa322e4c", + "key": "4c187c55-abf9-4c05-89f9-3b3afa322e4c", + "label": "kym_3(2020) metadata", + "value": "25843" + }, + { + "description": "Jurisdiction Metadata for kym_52(2020) id d56e8e47-7a84-4c51-9a75-ce614ae6f684", + "key": "d56e8e47-7a84-4c51-9a75-ce614ae6f684", + "label": "kym_52(2020) metadata", + "value": "25844" + }, + { + "description": "Jurisdiction Metadata for Chomba Zone id 8a03529d-2afe-4098-afd5-d1460e3b4f8a", + "key": "8a03529d-2afe-4098-afd5-d1460e3b4f8a", + "label": "Chomba Zone metadata", + "value": "25845" + }, + { + "description": "Jurisdiction Metadata for kym_6(2020) id 21a14b59-6102-4f35-99dd-ec34d44ae383", + "key": "21a14b59-6102-4f35-99dd-ec34d44ae383", + "label": "kym_6(2020) metadata", + "value": "25846" + }, + { + "description": "Jurisdiction Metadata for Kashikishi(2020) id dd5ba964-d76f-4f82-a4e3-c3f822d2ae2a", + "key": "dd5ba964-d76f-4f82-a4e3-c3f822d2ae2a", + "label": "Kashikishi(2020) metadata", + "value": "25847" + }, + { + "description": "Jurisdiction Metadata for Kabuku Zone id f47ec07c-825d-4e19-9444-bf71f48d9c95", + "key": "f47ec07c-825d-4e19-9444-bf71f48d9c95", + "label": "Kabuku Zone metadata", + "value": "25848" + }, + { + "description": "Jurisdiction Metadata for ksh_44(2020) id e51d62ad-e613-4ddf-8049-c391415c8332", + "key": "e51d62ad-e613-4ddf-8049-c391415c8332", + "label": "ksh_44(2020) metadata", + "value": "25849" + }, + { + "description": "Jurisdiction Metadata for ksh_36(2020) id 9825efef-9853-4216-85a2-b525912ea10f", + "key": "9825efef-9853-4216-85a2-b525912ea10f", + "label": "ksh_36(2020) metadata", + "value": "25850" + }, + { + "description": "Jurisdiction Metadata for ksh_112(2020) id eb8977ef-e2cf-4e2b-9a1c-3da0c308c608", + "key": "eb8977ef-e2cf-4e2b-9a1c-3da0c308c608", + "label": "ksh_112(2020) metadata", + "value": "25851" + }, + { + "description": "Jurisdiction Metadata for ksh_148(2020) id 7cf41a7d-5e7a-4892-9c38-96f4b338bd38", + "key": "7cf41a7d-5e7a-4892-9c38-96f4b338bd38", + "label": "ksh_148(2020) metadata", + "value": "25852" + }, + { + "description": "Jurisdiction Metadata for ksh_130(2020) id c64aa631-2fb3-4267-8148-1592752177b5", + "key": "c64aa631-2fb3-4267-8148-1592752177b5", + "label": "ksh_130(2020) metadata", + "value": "25853" + }, + { + "description": "Jurisdiction Metadata for ksh_119(2020) id 68722efa-6619-41cc-86bc-ba763ea0b1ad", + "key": "68722efa-6619-41cc-86bc-ba763ea0b1ad", + "label": "ksh_119(2020) metadata", + "value": "25854" + }, + { + "description": "Jurisdiction Metadata for ksh_162(2020) id e12091ab-395e-4000-b711-e6901a0f9c8a", + "key": "e12091ab-395e-4000-b711-e6901a0f9c8a", + "label": "ksh_162(2020) metadata", + "value": "25855" + }, + { + "description": "Jurisdiction Metadata for ksh_22(2020) id b5306c06-f12e-4e10-a03d-2c145b8c4bc0", + "key": "b5306c06-f12e-4e10-a03d-2c145b8c4bc0", + "label": "ksh_22(2020) metadata", + "value": "25856" + }, + { + "description": "Jurisdiction Metadata for ksh_147(2020) id 8062be78-9d99-4594-b784-b9af2ae0cec9", + "key": "8062be78-9d99-4594-b784-b9af2ae0cec9", + "label": "ksh_147(2020) metadata", + "value": "25857" + }, + { + "description": "Jurisdiction Metadata for ksh_128(2020) id ad941238-f61c-448f-a97a-200cffb0c724", + "key": "ad941238-f61c-448f-a97a-200cffb0c724", + "label": "ksh_128(2020) metadata", + "value": "25858" + }, + { + "description": "Jurisdiction Metadata for ksh_87(2020) id db15cb44-344b-4938-9b13-cda398a5defd", + "key": "db15cb44-344b-4938-9b13-cda398a5defd", + "label": "ksh_87(2020) metadata", + "value": "25859" + }, + { + "description": "Jurisdiction Metadata for ksh_61(2020) id e97b2699-d1c0-4eea-b655-99cba1133b62", + "key": "e97b2699-d1c0-4eea-b655-99cba1133b62", + "label": "ksh_61(2020) metadata", + "value": "25860" + }, + { + "description": "Jurisdiction Metadata for ksh_65(2020) id a98ff117-3d33-4248-b1f0-118e708769c2", + "key": "a98ff117-3d33-4248-b1f0-118e708769c2", + "label": "ksh_65(2020) metadata", + "value": "25861" + }, + { + "description": "Jurisdiction Metadata for ksh_31(2020) id a8e77ead-94b4-4b39-8f2c-70490024f43f", + "key": "a8e77ead-94b4-4b39-8f2c-70490024f43f", + "label": "ksh_31(2020) metadata", + "value": "25862" + }, + { + "description": "Jurisdiction Metadata for ksh_85(2020) id d11b4266-7f22-4a25-a090-1f6cb19189f1", + "key": "d11b4266-7f22-4a25-a090-1f6cb19189f1", + "label": "ksh_85(2020) metadata", + "value": "25863" + }, + { + "description": "Jurisdiction Metadata for ksh_138(2020) id 6397a39a-ded4-4d7e-928b-38dd0b8a3417", + "key": "6397a39a-ded4-4d7e-928b-38dd0b8a3417", + "label": "ksh_138(2020) metadata", + "value": "25864" + }, + { + "description": "Jurisdiction Metadata for ksh_204(2020) id e407f950-1126-4980-936c-6dc91a56671e", + "key": "e407f950-1126-4980-936c-6dc91a56671e", + "label": "ksh_204(2020) metadata", + "value": "25865" + }, + { + "description": "Jurisdiction Metadata for ksh_197(2020) id 578d48ae-947f-4c8f-a030-b77f6ed8ed18", + "key": "578d48ae-947f-4c8f-a030-b77f6ed8ed18", + "label": "ksh_197(2020) metadata", + "value": "25866" + }, + { + "description": "Jurisdiction Metadata for ksh_40(2020) id d3fee227-5d26-4c7c-b5f1-28743621495e", + "key": "d3fee227-5d26-4c7c-b5f1-28743621495e", + "label": "ksh_40(2020) metadata", + "value": "25867" + }, + { + "description": "Jurisdiction Metadata for ksh_129(2020) id 5a9c5266-e00c-426d-b5e0-f05d0e46c76f", + "key": "5a9c5266-e00c-426d-b5e0-f05d0e46c76f", + "label": "ksh_129(2020) metadata", + "value": "25868" + }, + { + "description": "Jurisdiction Metadata for ksh_118(2020) id 344dac7b-5fd4-48fe-bf2c-1d1df72eaace", + "key": "344dac7b-5fd4-48fe-bf2c-1d1df72eaace", + "label": "ksh_118(2020) metadata", + "value": "25869" + }, + { + "description": "Jurisdiction Metadata for ksh_80(2020) id 638cac0b-baa3-41f8-a6f8-d14f6f41d702", + "key": "638cac0b-baa3-41f8-a6f8-d14f6f41d702", + "label": "ksh_80(2020) metadata", + "value": "25870" + }, + { + "description": "Jurisdiction Metadata for ksh_160(2020) id 57e0fd99-1f89-414e-ac66-a0e66bc11f21", + "key": "57e0fd99-1f89-414e-ac66-a0e66bc11f21", + "label": "ksh_160(2020) metadata", + "value": "25871" + }, + { + "description": "Jurisdiction Metadata for ksh_50(2020) id 72ba7490-aaa7-4585-b28f-2edea1d0a3af", + "key": "72ba7490-aaa7-4585-b28f-2edea1d0a3af", + "label": "ksh_50(2020) metadata", + "value": "25872" + }, + { + "description": "Jurisdiction Metadata for ksh_86(2020) id e975450e-fba4-4b99-8d94-d0c66dbe25ff", + "key": "e975450e-fba4-4b99-8d94-d0c66dbe25ff", + "label": "ksh_86(2020) metadata", + "value": "25873" + }, + { + "description": "Jurisdiction Metadata for ksh_100(2020) id b79b74e1-3375-4f4e-857d-478e6e4ff6b1", + "key": "b79b74e1-3375-4f4e-857d-478e6e4ff6b1", + "label": "ksh_100(2020) metadata", + "value": "25874" + }, + { + "description": "Jurisdiction Metadata for ksh_37(2020) id 5075d193-d347-4fd1-a0de-0b0f77fd50f7", + "key": "5075d193-d347-4fd1-a0de-0b0f77fd50f7", + "label": "ksh_37(2020) metadata", + "value": "25875" + }, + { + "description": "Jurisdiction Metadata for ksh_69(2020) id 7561f294-c6bc-493e-a835-2aa1ae01382c", + "key": "7561f294-c6bc-493e-a835-2aa1ae01382c", + "label": "ksh_69(2020) metadata", + "value": "25876" + }, + { + "description": "Jurisdiction Metadata for ksh_117(2020) id 9bb0a46b-1414-4120-b02d-22bd0c8499d6", + "key": "9bb0a46b-1414-4120-b02d-22bd0c8499d6", + "label": "ksh_117(2020) metadata", + "value": "25877" + }, + { + "description": "Jurisdiction Metadata for ksh_47(2020) id 92043036-7203-4b0c-acd1-b641b2bb2f0f", + "key": "92043036-7203-4b0c-acd1-b641b2bb2f0f", + "label": "ksh_47(2020) metadata", + "value": "25878" + }, + { + "description": "Jurisdiction Metadata for ksh_180(2020) id 0707c406-a431-49d3-ae24-2632dc459b9f", + "key": "0707c406-a431-49d3-ae24-2632dc459b9f", + "label": "ksh_180(2020) metadata", + "value": "25879" + }, + { + "description": "Jurisdiction Metadata for ksh_192(2020) id 6a4ccd8e-a7a8-4358-936d-ea4b8387b3f2", + "key": "6a4ccd8e-a7a8-4358-936d-ea4b8387b3f2", + "label": "ksh_192(2020) metadata", + "value": "25880" + }, + { + "description": "Jurisdiction Metadata for ksh_159(2020) id 6bd19013-2ff3-4cae-ac01-0efdbf61619a", + "key": "6bd19013-2ff3-4cae-ac01-0efdbf61619a", + "label": "ksh_159(2020) metadata", + "value": "25881" + }, + { + "description": "Jurisdiction Metadata for ksh_146(2020) id 8aa360dd-085e-4d70-b5cc-b05848e92b71", + "key": "8aa360dd-085e-4d70-b5cc-b05848e92b71", + "label": "ksh_146(2020) metadata", + "value": "25882" + }, + { + "description": "Jurisdiction Metadata for ksh_30(2020) id 7bb8460e-e431-44c2-884b-77768271a665", + "key": "7bb8460e-e431-44c2-884b-77768271a665", + "label": "ksh_30(2020) metadata", + "value": "25883" + }, + { + "description": "Jurisdiction Metadata for ksh_203(2020) id b358c41d-4be6-48aa-9f62-22b5943d4e6c", + "key": "b358c41d-4be6-48aa-9f62-22b5943d4e6c", + "label": "ksh_203(2020) metadata", + "value": "25884" + }, + { + "description": "Jurisdiction Metadata for ksh_163(2020) id de1f5d6f-2d92-4b2f-b102-9e306db3435d", + "key": "de1f5d6f-2d92-4b2f-b102-9e306db3435d", + "label": "ksh_163(2020) metadata", + "value": "25885" + }, + { + "description": "Jurisdiction Metadata for ksh_122(2020) id 9d61372b-823e-4d99-898b-07e4fd7a87e1", + "key": "9d61372b-823e-4d99-898b-07e4fd7a87e1", + "label": "ksh_122(2020) metadata", + "value": "25886" + }, + { + "description": "Jurisdiction Metadata for ksh_196(2020) id 5b260383-e4a6-42cd-a807-cb4a50b8ebd1", + "key": "5b260383-e4a6-42cd-a807-cb4a50b8ebd1", + "label": "ksh_196(2020) metadata", + "value": "25887" + }, + { + "description": "Jurisdiction Metadata for ksh_95(2020) id e9667a2a-1307-407c-afee-627033cc17be", + "key": "e9667a2a-1307-407c-afee-627033cc17be", + "label": "ksh_95(2020) metadata", + "value": "25888" + }, + { + "description": "Jurisdiction Metadata for ksh_140(2020) id 8facbdd7-d419-4048-897d-0e08106dc49b", + "key": "8facbdd7-d419-4048-897d-0e08106dc49b", + "label": "ksh_140(2020) metadata", + "value": "25889" + }, + { + "description": "Jurisdiction Metadata for ksh_161(2020) id 97f98c00-6ec7-4f3c-b0e9-36176eab19f4", + "key": "97f98c00-6ec7-4f3c-b0e9-36176eab19f4", + "label": "ksh_161(2020) metadata", + "value": "25890" + }, + { + "description": "Jurisdiction Metadata for ksh_198(2020) id 384ac465-b3f7-4590-a076-f48c0fb9cf39", + "key": "384ac465-b3f7-4590-a076-f48c0fb9cf39", + "label": "ksh_198(2020) metadata", + "value": "25891" + }, + { + "description": "Jurisdiction Metadata for ksh_54(2020) id ded88348-60dd-4bc4-bf19-6d24b6edb4fc", + "key": "ded88348-60dd-4bc4-bf19-6d24b6edb4fc", + "label": "ksh_54(2020) metadata", + "value": "25892" + }, + { + "description": "Jurisdiction Metadata for ksh_205(2020) id cf4f5640-6047-4414-9b09-9501734e421a", + "key": "cf4f5640-6047-4414-9b09-9501734e421a", + "label": "ksh_205(2020) metadata", + "value": "25893" + }, + { + "description": "Jurisdiction Metadata for ksh_191(2020) id daaf18a5-f855-4a4d-ae24-8872787d48cb", + "key": "daaf18a5-f855-4a4d-ae24-8872787d48cb", + "label": "ksh_191(2020) metadata", + "value": "25894" + }, + { + "description": "Jurisdiction Metadata for ksh_57(2020) id 7c685ced-6c14-495c-8bbb-275406fe6e8a", + "key": "7c685ced-6c14-495c-8bbb-275406fe6e8a", + "label": "ksh_57(2020) metadata", + "value": "25895" + }, + { + "description": "Jurisdiction Metadata for ksh_185(2020) id 2e7cb77b-eb6f-4e91-823b-86c6d41a998e", + "key": "2e7cb77b-eb6f-4e91-823b-86c6d41a998e", + "label": "ksh_185(2020) metadata", + "value": "25896" + }, + { + "description": "Jurisdiction Metadata for ksh_190(2020) id d9ff7268-0c0f-4474-987e-1a0953707e3e", + "key": "d9ff7268-0c0f-4474-987e-1a0953707e3e", + "label": "ksh_190(2020) metadata", + "value": "25897" + }, + { + "description": "Jurisdiction Metadata for ksh_136(2020) id 69981531-09ed-41ef-9c8f-c3b013760f6b", + "key": "69981531-09ed-41ef-9c8f-c3b013760f6b", + "label": "ksh_136(2020) metadata", + "value": "25898" + }, + { + "description": "Jurisdiction Metadata for Chandiwe Zone id 00800e86-80bf-4c84-b6a7-1d1289b3ac90", + "key": "00800e86-80bf-4c84-b6a7-1d1289b3ac90", + "label": "Chandiwe Zone metadata", + "value": "25899" + }, + { + "description": "Jurisdiction Metadata for ksh_6(2020) id b4d3fbde-3686-4472-b3c4-7e28ba455168", + "key": "b4d3fbde-3686-4472-b3c4-7e28ba455168", + "label": "ksh_6(2020) metadata", + "value": "25900" + }, + { + "description": "Jurisdiction Metadata for ksh_49(2020) id 6be2f032-ab8e-4f0d-999c-d951f7040418", + "key": "6be2f032-ab8e-4f0d-999c-d951f7040418", + "label": "ksh_49(2020) metadata", + "value": "25901" + }, + { + "description": "Jurisdiction Metadata for ksh_8(2020) id 78db3a15-249b-45ac-94fb-fa00c7c96033", + "key": "78db3a15-249b-45ac-94fb-fa00c7c96033", + "label": "ksh_8(2020) metadata", + "value": "25902" + }, + { + "description": "Jurisdiction Metadata for ksh_189(2020) id 009537b2-3722-4254-9aa6-1a0288ecfe41", + "key": "009537b2-3722-4254-9aa6-1a0288ecfe41", + "label": "ksh_189(2020) metadata", + "value": "25903" + }, + { + "description": "Jurisdiction Metadata for Kalila Nshindo Zone id 58fdeb77-cae5-407d-8245-e87a1bdac7f3", + "key": "58fdeb77-cae5-407d-8245-e87a1bdac7f3", + "label": "Kalila Nshindo Zone metadata", + "value": "25904" + }, + { + "description": "Jurisdiction Metadata for ksh_26(2020) id 732e9305-201b-4a6d-8802-f17e295f2a22", + "key": "732e9305-201b-4a6d-8802-f17e295f2a22", + "label": "ksh_26(2020) metadata", + "value": "25905" + }, + { + "description": "Jurisdiction Metadata for ksh_74(2020) id 6d1ad326-cc6b-4280-bd18-ac4b9150406d", + "key": "6d1ad326-cc6b-4280-bd18-ac4b9150406d", + "label": "ksh_74(2020) metadata", + "value": "25906" + }, + { + "description": "Jurisdiction Metadata for ksh_99(2020) id 768cebed-6979-4922-9e93-4f52702ba15b", + "key": "768cebed-6979-4922-9e93-4f52702ba15b", + "label": "ksh_99(2020) metadata", + "value": "25907" + }, + { + "description": "Jurisdiction Metadata for ksh_150(2020) id 710739ab-0fbe-4223-b250-b6d22037f37e", + "key": "710739ab-0fbe-4223-b250-b6d22037f37e", + "label": "ksh_150(2020) metadata", + "value": "25908" + }, + { + "description": "Jurisdiction Metadata for ksh_202(2020) id 1de98a1e-7f13-4b0a-b546-f4f003f98889", + "key": "1de98a1e-7f13-4b0a-b546-f4f003f98889", + "label": "ksh_202(2020) metadata", + "value": "25909" + }, + { + "description": "Jurisdiction Metadata for ksh_41(2020) id 43738d10-dfaf-4973-8036-e050eff45e93", + "key": "43738d10-dfaf-4973-8036-e050eff45e93", + "label": "ksh_41(2020) metadata", + "value": "25910" + }, + { + "description": "Jurisdiction Metadata for ksh_125(2020) id e56d450f-f5f2-4013-a534-8a78dd27fdfc", + "key": "e56d450f-f5f2-4013-a534-8a78dd27fdfc", + "label": "ksh_125(2020) metadata", + "value": "25911" + }, + { + "description": "Jurisdiction Metadata for ksh_187(2020) id 01742e32-1628-4599-8cfb-c64710cb22bd", + "key": "01742e32-1628-4599-8cfb-c64710cb22bd", + "label": "ksh_187(2020) metadata", + "value": "25912" + }, + { + "description": "Jurisdiction Metadata for ksh_170(2020) id 458977bd-2912-40a5-9457-ee8d5ace98e9", + "key": "458977bd-2912-40a5-9457-ee8d5ace98e9", + "label": "ksh_170(2020) metadata", + "value": "25913" + }, + { + "description": "Jurisdiction Metadata for ksh_89(2020) id 3e76fd6f-158c-48ce-aed6-569353c9da69", + "key": "3e76fd6f-158c-48ce-aed6-569353c9da69", + "label": "ksh_89(2020) metadata", + "value": "25914" + }, + { + "description": "Jurisdiction Metadata for ksh_172(2020) id 84ddd4fc-a540-408b-b354-494299fe6b0d", + "key": "84ddd4fc-a540-408b-b354-494299fe6b0d", + "label": "ksh_172(2020) metadata", + "value": "25915" + }, + { + "description": "Jurisdiction Metadata for ksh_154(2020) id 49ee2be9-422d-447b-9052-a4530dfa568f", + "key": "49ee2be9-422d-447b-9052-a4530dfa568f", + "label": "ksh_154(2020) metadata", + "value": "25916" + }, + { + "description": "Jurisdiction Metadata for ksh_70(2020) id e23e442b-7596-4ca0-8a94-114207ea8d7c", + "key": "e23e442b-7596-4ca0-8a94-114207ea8d7c", + "label": "ksh_70(2020) metadata", + "value": "25917" + }, + { + "description": "Jurisdiction Metadata for ksh_149(2020) id dc29770a-7e24-4f06-b470-f99521baf8b7", + "key": "dc29770a-7e24-4f06-b470-f99521baf8b7", + "label": "ksh_149(2020) metadata", + "value": "25918" + }, + { + "description": "Jurisdiction Metadata for ksh_109(2020) id 9d04840d-57f8-4522-881c-1d6070c2f589", + "key": "9d04840d-57f8-4522-881c-1d6070c2f589", + "label": "ksh_109(2020) metadata", + "value": "25919" + }, + { + "description": "Jurisdiction Metadata for ksh_171(2020) id 0e439b5c-da78-402f-95ca-7ce7acd1f12e", + "key": "0e439b5c-da78-402f-95ca-7ce7acd1f12e", + "label": "ksh_171(2020) metadata", + "value": "25920" + }, + { + "description": "Jurisdiction Metadata for ksh_142(2020) id 85d8b233-d4ba-437c-9dfc-eda9e1444a59", + "key": "85d8b233-d4ba-437c-9dfc-eda9e1444a59", + "label": "ksh_142(2020) metadata", + "value": "25921" + }, + { + "description": "Jurisdiction Metadata for ksh_152(2020) id 55a40ed1-4d6f-494e-a03a-75df54014c7d", + "key": "55a40ed1-4d6f-494e-a03a-75df54014c7d", + "label": "ksh_152(2020) metadata", + "value": "25922" + }, + { + "description": "Jurisdiction Metadata for ksh_181(2020) id cae3cda1-5a6b-41c3-a453-abdbcc48133d", + "key": "cae3cda1-5a6b-41c3-a453-abdbcc48133d", + "label": "ksh_181(2020) metadata", + "value": "25923" + }, + { + "description": "Jurisdiction Metadata for ksh_169(2020) id 9d68f157-a494-4547-ad97-f26c52c13e43", + "key": "9d68f157-a494-4547-ad97-f26c52c13e43", + "label": "ksh_169(2020) metadata", + "value": "25924" + }, + { + "description": "Jurisdiction Metadata for ksh_23(2020) id 3aaef337-03bf-44bd-92c4-d2eea53d9df6", + "key": "3aaef337-03bf-44bd-92c4-d2eea53d9df6", + "label": "ksh_23(2020) metadata", + "value": "25925" + }, + { + "description": "Jurisdiction Metadata for ksh_141(2020) id 3145afdb-3a75-4773-bd22-538fe8907fc8", + "key": "3145afdb-3a75-4773-bd22-538fe8907fc8", + "label": "ksh_141(2020) metadata", + "value": "25926" + }, + { + "description": "Jurisdiction Metadata for ksh_108(2020) id 95ddc1cd-d38e-42b1-a8fe-0db5f9728a05", + "key": "95ddc1cd-d38e-42b1-a8fe-0db5f9728a05", + "label": "ksh_108(2020) metadata", + "value": "25927" + }, + { + "description": "Jurisdiction Metadata for ksh_60(2020) id e1ec3205-ad47-40b1-84c5-0f70f44f350a", + "key": "e1ec3205-ad47-40b1-84c5-0f70f44f350a", + "label": "ksh_60(2020) metadata", + "value": "25928" + }, + { + "description": "Jurisdiction Metadata for ksh_143(2020) id 4fe71b0c-739b-42fb-8462-854f07a81408", + "key": "4fe71b0c-739b-42fb-8462-854f07a81408", + "label": "ksh_143(2020) metadata", + "value": "25929" + }, + { + "description": "Jurisdiction Metadata for ksh_88(2020) id b2a97448-0919-4651-b4df-7e4bb0db698c", + "key": "b2a97448-0919-4651-b4df-7e4bb0db698c", + "label": "ksh_88(2020) metadata", + "value": "25930" + }, + { + "description": "Jurisdiction Metadata for ksh_102(2020) id aaa13ca8-9d8a-4c39-972f-9ab1250fb8d8", + "key": "aaa13ca8-9d8a-4c39-972f-9ab1250fb8d8", + "label": "ksh_102(2020) metadata", + "value": "25931" + }, + { + "description": "Jurisdiction Metadata for ksh_55(2020) id a7d86261-640f-4834-8796-ea7042e8421f", + "key": "a7d86261-640f-4834-8796-ea7042e8421f", + "label": "ksh_55(2020) metadata", + "value": "25932" + }, + { + "description": "Jurisdiction Metadata for ksh_124(2020) id 00376af7-b7b1-49f2-aac4-2a7f53937c8e", + "key": "00376af7-b7b1-49f2-aac4-2a7f53937c8e", + "label": "ksh_124(2020) metadata", + "value": "25933" + }, + { + "description": "Jurisdiction Metadata for ksh_178(2020) id dfb2119f-92ee-41c7-a225-c5ae51db2603", + "key": "dfb2119f-92ee-41c7-a225-c5ae51db2603", + "label": "ksh_178(2020) metadata", + "value": "25934" + }, + { + "description": "Jurisdiction Metadata for ksh_51(2020) id f82400ea-22f0-41b7-959d-60b863a85edf", + "key": "f82400ea-22f0-41b7-959d-60b863a85edf", + "label": "ksh_51(2020) metadata", + "value": "25935" + }, + { + "description": "Jurisdiction Metadata for ksh_82(2020) id de3c53af-b67b-4751-a5c8-e541b63271ce", + "key": "de3c53af-b67b-4751-a5c8-e541b63271ce", + "label": "ksh_82(2020) metadata", + "value": "25936" + }, + { + "description": "Jurisdiction Metadata for ksh_63(2020) id f5f68631-cf17-44d4-a412-535a37c19460", + "key": "f5f68631-cf17-44d4-a412-535a37c19460", + "label": "ksh_63(2020) metadata", + "value": "25937" + }, + { + "description": "Jurisdiction Metadata for ksh_139(2020) id 9f7ce612-0da1-4de2-b6b9-d84a5a783afb", + "key": "9f7ce612-0da1-4de2-b6b9-d84a5a783afb", + "label": "ksh_139(2020) metadata", + "value": "25938" + }, + { + "description": "Jurisdiction Metadata for ksh_21(2020) id f110632c-c6f5-45f7-84d0-69aa01d923fb", + "key": "f110632c-c6f5-45f7-84d0-69aa01d923fb", + "label": "ksh_21(2020) metadata", + "value": "25939" + }, + { + "description": "Jurisdiction Metadata for ksh_84(2020) id 67b00793-311c-4621-bc9e-8b60df384aa4", + "key": "67b00793-311c-4621-bc9e-8b60df384aa4", + "label": "ksh_84(2020) metadata", + "value": "25940" + }, + { + "description": "Jurisdiction Metadata for ksh_176(2020) id ac633f00-d6e1-4d0a-9fcf-a3e7c968abd8", + "key": "ac633f00-d6e1-4d0a-9fcf-a3e7c968abd8", + "label": "ksh_176(2020) metadata", + "value": "25941" + }, + { + "description": "Jurisdiction Metadata for ksh_123(2020) id 34160da5-96b3-40a1-a954-6ae5013b6726", + "key": "34160da5-96b3-40a1-a954-6ae5013b6726", + "label": "ksh_123(2020) metadata", + "value": "25942" + }, + { + "description": "Jurisdiction Metadata for ksh_62(2020) id feacb726-d0dd-4c0b-b746-f63869f6f35a", + "key": "feacb726-d0dd-4c0b-b746-f63869f6f35a", + "label": "ksh_62(2020) metadata", + "value": "25943" + }, + { + "description": "Jurisdiction Metadata for ksh_59(2020) id ac34ad35-72b5-4410-8490-fb7821f7b8e8", + "key": "ac34ad35-72b5-4410-8490-fb7821f7b8e8", + "label": "ksh_59(2020) metadata", + "value": "25944" + }, + { + "description": "Jurisdiction Metadata for ksh_175(2020) id 6c1aa78f-f0ba-41d5-ac11-13c373301f7f", + "key": "6c1aa78f-f0ba-41d5-ac11-13c373301f7f", + "label": "ksh_175(2020) metadata", + "value": "25945" + }, + { + "description": "Jurisdiction Metadata for ksh_93(2020) id 23a9e8ef-8bef-42a8-98ed-087a46f320f9", + "key": "23a9e8ef-8bef-42a8-98ed-087a46f320f9", + "label": "ksh_93(2020) metadata", + "value": "25946" + }, + { + "description": "Jurisdiction Metadata for ksh_58(2020) id cb962ac3-381b-4234-abff-5a219aac7e53", + "key": "cb962ac3-381b-4234-abff-5a219aac7e53", + "label": "ksh_58(2020) metadata", + "value": "25947" + }, + { + "description": "Jurisdiction Metadata for ksh_110(2020) id 2d822e07-d498-413f-a112-da32c0fcef0b", + "key": "2d822e07-d498-413f-a112-da32c0fcef0b", + "label": "ksh_110(2020) metadata", + "value": "25948" + }, + { + "description": "Jurisdiction Metadata for ksh_77(2020) id 42e36347-d707-4bd5-be9c-2cc4e0fcbffd", + "key": "42e36347-d707-4bd5-be9c-2cc4e0fcbffd", + "label": "ksh_77(2020) metadata", + "value": "25949" + }, + { + "description": "Jurisdiction Metadata for ksh_92(2020) id 846e6ddd-280c-41da-80a9-994106d4a539", + "key": "846e6ddd-280c-41da-80a9-994106d4a539", + "label": "ksh_92(2020) metadata", + "value": "25950" + }, + { + "description": "Jurisdiction Metadata for ksh_103(2020) id 10763266-c63e-4d89-b052-9d0cb583a214", + "key": "10763266-c63e-4d89-b052-9d0cb583a214", + "label": "ksh_103(2020) metadata", + "value": "25951" + }, + { + "description": "Jurisdiction Metadata for ksh_165(2020) id 9490b48f-f0fc-48f0-8ffb-18b059b14201", + "key": "9490b48f-f0fc-48f0-8ffb-18b059b14201", + "label": "ksh_165(2020) metadata", + "value": "25952" + }, + { + "description": "Jurisdiction Metadata for ksh_97(2020) id 39b93ec5-ebb5-47a2-af9d-644f84723025", + "key": "39b93ec5-ebb5-47a2-af9d-644f84723025", + "label": "ksh_97(2020) metadata", + "value": "25953" + }, + { + "description": "Jurisdiction Metadata for ksh_71(2020) id 890dc7e0-4d1e-436c-b440-59bef9bbe5bc", + "key": "890dc7e0-4d1e-436c-b440-59bef9bbe5bc", + "label": "ksh_71(2020) metadata", + "value": "25954" + }, + { + "description": "Jurisdiction Metadata for ksh_81(2020) id 2d63c8da-a075-4fbc-9d74-bf090c54b21e", + "key": "2d63c8da-a075-4fbc-9d74-bf090c54b21e", + "label": "ksh_81(2020) metadata", + "value": "25955" + }, + { + "description": "Jurisdiction Metadata for ksh_151(2020) id 431a554f-32b5-4671-ab14-88c0fa2af26b", + "key": "431a554f-32b5-4671-ab14-88c0fa2af26b", + "label": "ksh_151(2020) metadata", + "value": "25956" + }, + { + "description": "Jurisdiction Metadata for ksh_56(2020) id 044a9ee7-f348-4424-baef-1d08b6556866", + "key": "044a9ee7-f348-4424-baef-1d08b6556866", + "label": "ksh_56(2020) metadata", + "value": "25957" + }, + { + "description": "Jurisdiction Metadata for ksh_199(2020) id 7f767a2f-7a59-4a2b-aa4a-a56121e5520c", + "key": "7f767a2f-7a59-4a2b-aa4a-a56121e5520c", + "label": "ksh_199(2020) metadata", + "value": "25958" + }, + { + "description": "Jurisdiction Metadata for ksh_179(2020) id f050d977-80d8-48b6-affa-b5cfe593349a", + "key": "f050d977-80d8-48b6-affa-b5cfe593349a", + "label": "ksh_179(2020) metadata", + "value": "25959" + }, + { + "description": "Jurisdiction Metadata for ksh_72(2020) id 2506552e-6dca-439c-b9fb-2a426650793f", + "key": "2506552e-6dca-439c-b9fb-2a426650793f", + "label": "ksh_72(2020) metadata", + "value": "25960" + }, + { + "description": "Jurisdiction Metadata for ksh_33(2020) id d9a0a417-7e7e-42fe-8532-40622acf2b14", + "key": "d9a0a417-7e7e-42fe-8532-40622acf2b14", + "label": "ksh_33(2020) metadata", + "value": "25961" + }, + { + "description": "Jurisdiction Metadata for ksh_113(2020) id 11696c3d-7ada-47e3-8052-83ad680ae623", + "key": "11696c3d-7ada-47e3-8052-83ad680ae623", + "label": "ksh_113(2020) metadata", + "value": "25962" + }, + { + "description": "Jurisdiction Metadata for ksh_194(2020) id bb0256de-58e0-4845-829c-6a50003c277b", + "key": "bb0256de-58e0-4845-829c-6a50003c277b", + "label": "ksh_194(2020) metadata", + "value": "25963" + }, + { + "description": "Jurisdiction Metadata for ksh_38(2020) id c65bdd5a-1197-48f1-b1ae-04cbbe31b249", + "key": "c65bdd5a-1197-48f1-b1ae-04cbbe31b249", + "label": "ksh_38(2020) metadata", + "value": "25964" + }, + { + "description": "Jurisdiction Metadata for ksh_153(2020) id 3ac3567e-6908-46a1-88e5-584b1eecc1d6", + "key": "3ac3567e-6908-46a1-88e5-584b1eecc1d6", + "label": "ksh_153(2020) metadata", + "value": "25965" + }, + { + "description": "Jurisdiction Metadata for ksh_67(2020) id 301f69ff-ca14-4bcd-b88a-6c4c3eb36ebb", + "key": "301f69ff-ca14-4bcd-b88a-6c4c3eb36ebb", + "label": "ksh_67(2020) metadata", + "value": "25966" + }, + { + "description": "Jurisdiction Metadata for ksh_177(2020) id b3522993-58a9-4891-8a4a-4c28b662604e", + "key": "b3522993-58a9-4891-8a4a-4c28b662604e", + "label": "ksh_177(2020) metadata", + "value": "25967" + }, + { + "description": "Jurisdiction Metadata for ksh_201(2020) id e98cb3c9-4aa6-4b6c-ab21-bd3520668ef9", + "key": "e98cb3c9-4aa6-4b6c-ab21-bd3520668ef9", + "label": "ksh_201(2020) metadata", + "value": "25968" + }, + { + "description": "Jurisdiction Metadata for ksh_173(2020) id e9cda47a-76ff-477e-b1d5-9f6517e8b244", + "key": "e9cda47a-76ff-477e-b1d5-9f6517e8b244", + "label": "ksh_173(2020) metadata", + "value": "25969" + }, + { + "description": "Jurisdiction Metadata for ksh_144(2020) id dd0bb4c7-36ff-4652-950d-65baa4a1b3d9", + "key": "dd0bb4c7-36ff-4652-950d-65baa4a1b3d9", + "label": "ksh_144(2020) metadata", + "value": "25970" + }, + { + "description": "Jurisdiction Metadata for ksh_28(2020) id c006e42c-d5c6-4f2c-a02f-e618b872176d", + "key": "c006e42c-d5c6-4f2c-a02f-e618b872176d", + "label": "ksh_28(2020) metadata", + "value": "25971" + }, + { + "description": "Jurisdiction Metadata for ksh_186(2020) id 5fcc427c-1ad8-41d6-8282-4f19b800c72c", + "key": "5fcc427c-1ad8-41d6-8282-4f19b800c72c", + "label": "ksh_186(2020) metadata", + "value": "25972" + }, + { + "description": "Jurisdiction Metadata for ksh_121(2020) id d4d4b130-c0a7-4820-bd93-07385c7e14fd", + "key": "d4d4b130-c0a7-4820-bd93-07385c7e14fd", + "label": "ksh_121(2020) metadata", + "value": "25973" + }, + { + "description": "Jurisdiction Metadata for Kasensele Zone id 61839c62-f517-4375-8a11-518bdca4764a", + "key": "61839c62-f517-4375-8a11-518bdca4764a", + "label": "Kasensele Zone metadata", + "value": "25974" + }, + { + "description": "Jurisdiction Metadata for ksh_101(2020) id dd7fb291-d364-4300-b36e-ecd50a2c0b56", + "key": "dd7fb291-d364-4300-b36e-ecd50a2c0b56", + "label": "ksh_101(2020) metadata", + "value": "25975" + }, + { + "description": "Jurisdiction Metadata for ksh_48(2020) id e4fbbdd7-1bc6-4fa2-9cda-66f5f40d1af4", + "key": "e4fbbdd7-1bc6-4fa2-9cda-66f5f40d1af4", + "label": "ksh_48(2020) metadata", + "value": "25976" + }, + { + "description": "Jurisdiction Metadata for ksh_45(2020) id 73b065fd-9b3f-4a63-a43e-5d13a9bd554a", + "key": "73b065fd-9b3f-4a63-a43e-5d13a9bd554a", + "label": "ksh_45(2020) metadata", + "value": "25977" + }, + { + "description": "Jurisdiction Metadata for ksh_182(2020) id 2c211a66-3f0f-4e4f-a9b4-84000dd56c83", + "key": "2c211a66-3f0f-4e4f-a9b4-84000dd56c83", + "label": "ksh_182(2020) metadata", + "value": "25978" + }, + { + "description": "Jurisdiction Metadata for ksh_167(2020) id d0a69405-4077-4246-85a5-ab47c2b95b65", + "key": "d0a69405-4077-4246-85a5-ab47c2b95b65", + "label": "ksh_167(2020) metadata", + "value": "25979" + }, + { + "description": "Jurisdiction Metadata for ksh_200(2020) id 2f9d2079-0955-42be-a22c-14454cbf6803", + "key": "2f9d2079-0955-42be-a22c-14454cbf6803", + "label": "ksh_200(2020) metadata", + "value": "25980" + }, + { + "description": "Jurisdiction Metadata for ksh_106(2020) id 98e06915-08c4-4b81-9adf-3684ac4d8aad", + "key": "98e06915-08c4-4b81-9adf-3684ac4d8aad", + "label": "ksh_106(2020) metadata", + "value": "25981" + }, + { + "description": "Jurisdiction Metadata for ksh_98(2020) id ace9f179-36bf-45c6-a912-4f60b21d359f", + "key": "ace9f179-36bf-45c6-a912-4f60b21d359f", + "label": "ksh_98(2020) metadata", + "value": "25982" + }, + { + "description": "Jurisdiction Metadata for ksh_75(2020) id 4a8d1e0a-9b95-4343-94c0-e15923547f3c", + "key": "4a8d1e0a-9b95-4343-94c0-e15923547f3c", + "label": "ksh_75(2020) metadata", + "value": "25983" + }, + { + "description": "Jurisdiction Metadata for ksh_73(2020) id dc67e4a5-a5bd-4900-9999-ef8deab2ebfb", + "key": "dc67e4a5-a5bd-4900-9999-ef8deab2ebfb", + "label": "ksh_73(2020) metadata", + "value": "25984" + }, + { + "description": "Jurisdiction Metadata for ksh_116(2020) id 88f7e352-cc9b-4fcc-a5b2-2a5fc5ca2bc8", + "key": "88f7e352-cc9b-4fcc-a5b2-2a5fc5ca2bc8", + "label": "ksh_116(2020) metadata", + "value": "25985" + }, + { + "description": "Jurisdiction Metadata for ksh_64(2020) id 38a55422-1046-4aea-86ee-3a8f935604de", + "key": "38a55422-1046-4aea-86ee-3a8f935604de", + "label": "ksh_64(2020) metadata", + "value": "25986" + }, + { + "description": "Jurisdiction Metadata for ksh_53(2020) id 70d12e8a-ec28-4b79-90d3-15c7602c6e66", + "key": "70d12e8a-ec28-4b79-90d3-15c7602c6e66", + "label": "ksh_53(2020) metadata", + "value": "25987" + }, + { + "description": "Jurisdiction Metadata for ksh_91(2020) id f2f5d806-4ad1-4cee-9e5b-74c5298aa41a", + "key": "f2f5d806-4ad1-4cee-9e5b-74c5298aa41a", + "label": "ksh_91(2020) metadata", + "value": "25988" + }, + { + "description": "Jurisdiction Metadata for ksh_79(2020) id 93f631fd-1142-4190-9433-15a0c26c1911", + "key": "93f631fd-1142-4190-9433-15a0c26c1911", + "label": "ksh_79(2020) metadata", + "value": "25989" + }, + { + "description": "Jurisdiction Metadata for ksh_183(2020) id 7846f6f5-aa97-4286-a05d-7ec91eeef2c7", + "key": "7846f6f5-aa97-4286-a05d-7ec91eeef2c7", + "label": "ksh_183(2020) metadata", + "value": "25990" + }, + { + "description": "Jurisdiction Metadata for ksh_24(2020) id cbfbc00e-4909-4c7a-986b-13ce408ba533", + "key": "cbfbc00e-4909-4c7a-986b-13ce408ba533", + "label": "ksh_24(2020) metadata", + "value": "25991" + }, + { + "description": "Jurisdiction Metadata for ksh_195(2020) id c7265a03-7614-4fb9-90b4-a420c59abe22", + "key": "c7265a03-7614-4fb9-90b4-a420c59abe22", + "label": "ksh_195(2020) metadata", + "value": "25992" + }, + { + "description": "Jurisdiction Metadata for ksh_193(2020) id dae968c3-a920-459e-bcaf-854d8135d08e", + "key": "dae968c3-a920-459e-bcaf-854d8135d08e", + "label": "ksh_193(2020) metadata", + "value": "25993" + }, + { + "description": "Jurisdiction Metadata for ksh_27(2020) id 32420842-869b-47a0-840d-037a99ae2e3b", + "key": "32420842-869b-47a0-840d-037a99ae2e3b", + "label": "ksh_27(2020) metadata", + "value": "25994" + }, + { + "description": "Jurisdiction Metadata for ksh_134(2020) id 5b9ab1ac-166a-459a-b0e5-8e4ad85435c1", + "key": "5b9ab1ac-166a-459a-b0e5-8e4ad85435c1", + "label": "ksh_134(2020) metadata", + "value": "25995" + }, + { + "description": "Jurisdiction Metadata for ksh_168(2020) id 29193e49-2c07-435d-b993-a4f59ed252ad", + "key": "29193e49-2c07-435d-b993-a4f59ed252ad", + "label": "ksh_168(2020) metadata", + "value": "25996" + }, + { + "description": "Jurisdiction Metadata for ksh_164(2020) id b28dfac7-d19b-492c-8c02-3bf044e73da8", + "key": "b28dfac7-d19b-492c-8c02-3bf044e73da8", + "label": "ksh_164(2020) metadata", + "value": "25997" + }, + { + "description": "Jurisdiction Metadata for ksh_156(2020) id 36f559a4-ece3-4cd0-b387-a913e61cb448", + "key": "36f559a4-ece3-4cd0-b387-a913e61cb448", + "label": "ksh_156(2020) metadata", + "value": "25998" + }, + { + "description": "Jurisdiction Metadata for ksh_115(2020) id 127e1601-2301-410b-ae6e-ccb9664613f7", + "key": "127e1601-2301-410b-ae6e-ccb9664613f7", + "label": "ksh_115(2020) metadata", + "value": "25999" + }, + { + "description": "Jurisdiction Metadata for ksh_111(2020) id 2efef2dd-dc23-46a3-86af-7c79b53cbcaa", + "key": "2efef2dd-dc23-46a3-86af-7c79b53cbcaa", + "label": "ksh_111(2020) metadata", + "value": "26000" + }, + { + "description": "Jurisdiction Metadata for ksh_135(2020) id 669f2894-7a53-411a-aab6-3a27bfff699e", + "key": "669f2894-7a53-411a-aab6-3a27bfff699e", + "label": "ksh_135(2020) metadata", + "value": "26001" + }, + { + "description": "Jurisdiction Metadata for ksh_76(2020) id 2d87af58-d39a-418a-ba9b-b14676fdb493", + "key": "2d87af58-d39a-418a-ba9b-b14676fdb493", + "label": "ksh_76(2020) metadata", + "value": "26002" + }, + { + "description": "Jurisdiction Metadata for ksh_90(2020) id 4693cff0-5188-48c3-9dcb-01c975e0b9d9", + "key": "4693cff0-5188-48c3-9dcb-01c975e0b9d9", + "label": "ksh_90(2020) metadata", + "value": "26003" + }, + { + "description": "Jurisdiction Metadata for ksh_158(2020) id c587142c-171d-4426-8c54-b5864121cf05", + "key": "c587142c-171d-4426-8c54-b5864121cf05", + "label": "ksh_158(2020) metadata", + "value": "26004" + }, + { + "description": "Jurisdiction Metadata for ksh_104(2020) id 5343969b-847e-48be-9d16-bba1a3cd2d37", + "key": "5343969b-847e-48be-9d16-bba1a3cd2d37", + "label": "ksh_104(2020) metadata", + "value": "26005" + }, + { + "description": "Jurisdiction Metadata for ksh_29(2020) id feb02de2-571d-41f0-8aaa-5c38c153b1a6", + "key": "feb02de2-571d-41f0-8aaa-5c38c153b1a6", + "label": "ksh_29(2020) metadata", + "value": "26006" + }, + { + "description": "Jurisdiction Metadata for ksh_105(2020) id 063b2844-f0fc-4fa5-828f-99157754769b", + "key": "063b2844-f0fc-4fa5-828f-99157754769b", + "label": "ksh_105(2020) metadata", + "value": "26007" + }, + { + "description": "Jurisdiction Metadata for ksh_94(2020) id 0b3d0fff-a561-4406-92d2-5b3bdbeb44b1", + "key": "0b3d0fff-a561-4406-92d2-5b3bdbeb44b1", + "label": "ksh_94(2020) metadata", + "value": "26008" + }, + { + "description": "Jurisdiction Metadata for ksh_184(2020) id 3c8f3ca8-c46a-427d-b83e-42fd68054f45", + "key": "3c8f3ca8-c46a-427d-b83e-42fd68054f45", + "label": "ksh_184(2020) metadata", + "value": "26009" + }, + { + "description": "Jurisdiction Metadata for ksh_137(2020) id 0761a51c-1c7a-45c6-87e6-bae383493b2d", + "key": "0761a51c-1c7a-45c6-87e6-bae383493b2d", + "label": "ksh_137(2020) metadata", + "value": "26010" + }, + { + "description": "Jurisdiction Metadata for ksh_43(2020) id 6d9ed5c0-a5d9-479d-a1ad-33e676dba6aa", + "key": "6d9ed5c0-a5d9-479d-a1ad-33e676dba6aa", + "label": "ksh_43(2020) metadata", + "value": "26011" + }, + { + "description": "Jurisdiction Metadata for ksh_174(2020) id 26187afe-9c4a-4508-8e51-d4228eab2b7e", + "key": "26187afe-9c4a-4508-8e51-d4228eab2b7e", + "label": "ksh_174(2020) metadata", + "value": "26012" + }, + { + "description": "Jurisdiction Metadata for ksh_188(2020) id af0b83ac-bf64-4db9-ac69-2399888a744f", + "key": "af0b83ac-bf64-4db9-ac69-2399888a744f", + "label": "ksh_188(2020) metadata", + "value": "26013" + }, + { + "description": "Jurisdiction Metadata for ksh_166(2020) id 31c5c257-fc82-4919-a91f-f9e7d1e26fd0", + "key": "31c5c257-fc82-4919-a91f-f9e7d1e26fd0", + "label": "ksh_166(2020) metadata", + "value": "26014" + }, + { + "description": "Jurisdiction Metadata for ksh_83(2020) id 63f646fd-9fee-4e0b-bf08-4eff1e6b906b", + "key": "63f646fd-9fee-4e0b-bf08-4eff1e6b906b", + "label": "ksh_83(2020) metadata", + "value": "26015" + }, + { + "description": "Jurisdiction Metadata for ksh_39(2020) id 6ac85751-b1f2-4a3a-b87d-446ee6c475d7", + "key": "6ac85751-b1f2-4a3a-b87d-446ee6c475d7", + "label": "ksh_39(2020) metadata", + "value": "26016" + }, + { + "description": "Jurisdiction Metadata for ksh_107(2020) id b347d67e-4a64-463f-a2ba-25e105c730de", + "key": "b347d67e-4a64-463f-a2ba-25e105c730de", + "label": "ksh_107(2020) metadata", + "value": "26017" + }, + { + "description": "Jurisdiction Metadata for ksh_131(2020) id a5b9abae-1990-4501-80fa-29d2e37ed0f7", + "key": "a5b9abae-1990-4501-80fa-29d2e37ed0f7", + "label": "ksh_131(2020) metadata", + "value": "26018" + }, + { + "description": "Jurisdiction Metadata for ksh_66(2020) id 18091750-0695-465a-916b-f360353eb492", + "key": "18091750-0695-465a-916b-f360353eb492", + "label": "ksh_66(2020) metadata", + "value": "26019" + }, + { + "description": "Jurisdiction Metadata for ksh_114(2020) id bdcb014f-890b-4483-9630-24b00e7fdcc6", + "key": "bdcb014f-890b-4483-9630-24b00e7fdcc6", + "label": "ksh_114(2020) metadata", + "value": "26020" + }, + { + "description": "Jurisdiction Metadata for ksh_96(2020) id 98c8fc6b-7c39-461b-a5fb-dd343bcf03b2", + "key": "98c8fc6b-7c39-461b-a5fb-dd343bcf03b2", + "label": "ksh_96(2020) metadata", + "value": "26021" + }, + { + "description": "Jurisdiction Metadata for ksh_133(2020) id 2b60af50-24d2-49d4-9617-6ae326257a1f", + "key": "2b60af50-24d2-49d4-9617-6ae326257a1f", + "label": "ksh_133(2020) metadata", + "value": "26022" + }, + { + "description": "Jurisdiction Metadata for ksh_120(2020) id b85ad335-1dc2-48c2-890b-5ce04375bb00", + "key": "b85ad335-1dc2-48c2-890b-5ce04375bb00", + "label": "ksh_120(2020) metadata", + "value": "26023" + }, + { + "description": "Jurisdiction Metadata for ksh_18(2020) id 8d3c1ddf-6e9d-4cfc-a3eb-243d799469be", + "key": "8d3c1ddf-6e9d-4cfc-a3eb-243d799469be", + "label": "ksh_18(2020) metadata", + "value": "26024" + }, + { + "description": "Jurisdiction Metadata for ksh_35(2020) id feb6fbf7-7d97-4500-b499-f29f69bcfa08", + "key": "feb6fbf7-7d97-4500-b499-f29f69bcfa08", + "label": "ksh_35(2020) metadata", + "value": "26025" + }, + { + "description": "Jurisdiction Metadata for ksh_52(2020) id 8d5e8dc9-1506-4883-b654-b954543b8cc0", + "key": "8d5e8dc9-1506-4883-b654-b954543b8cc0", + "label": "ksh_52(2020) metadata", + "value": "26026" + }, + { + "description": "Jurisdiction Metadata for ksh_132(2020) id 71e233bd-d742-4ec3-aa53-95a57f3ef049", + "key": "71e233bd-d742-4ec3-aa53-95a57f3ef049", + "label": "ksh_132(2020) metadata", + "value": "26027" + }, + { + "description": "Jurisdiction Metadata for ksh_145(2020) id f148471a-8f7a-4004-89a3-0a86685f1a00", + "key": "f148471a-8f7a-4004-89a3-0a86685f1a00", + "label": "ksh_145(2020) metadata", + "value": "26028" + }, + { + "description": "Jurisdiction Metadata for ksh_127(2020) id f89e0fee-e50f-44cd-9ea4-03c8b5a3e36b", + "key": "f89e0fee-e50f-44cd-9ea4-03c8b5a3e36b", + "label": "ksh_127(2020) metadata", + "value": "26029" + }, + { + "description": "Jurisdiction Metadata for ksh_157(2020) id b924cf58-2bc7-4cec-9da5-6f9b5329ee51", + "key": "b924cf58-2bc7-4cec-9da5-6f9b5329ee51", + "label": "ksh_157(2020) metadata", + "value": "26030" + }, + { + "description": "Jurisdiction Metadata for ksh_126(2020) id 8cb212f1-ee34-4ec8-8326-e3f3f8b123a4", + "key": "8cb212f1-ee34-4ec8-8326-e3f3f8b123a4", + "label": "ksh_126(2020) metadata", + "value": "26031" + }, + { + "description": "Jurisdiction Metadata for ksh_25(2020) id 3b8341b3-1c59-4143-8326-a35b761e28bc", + "key": "3b8341b3-1c59-4143-8326-a35b761e28bc", + "label": "ksh_25(2020) metadata", + "value": "26032" + }, + { + "description": "Jurisdiction Metadata for ksh_32(2020) id ba323089-e23d-4097-aee2-9f3197e5caef", + "key": "ba323089-e23d-4097-aee2-9f3197e5caef", + "label": "ksh_32(2020) metadata", + "value": "26033" + }, + { + "description": "Jurisdiction Metadata for ksh_46(2020) id ffa0254d-55b0-4227-b662-f88f16b9776e", + "key": "ffa0254d-55b0-4227-b662-f88f16b9776e", + "label": "ksh_46(2020) metadata", + "value": "26034" + }, + { + "description": "Jurisdiction Metadata for Mutono Zone id c20849ec-8537-49cf-b0d2-f1530c99a98b", + "key": "c20849ec-8537-49cf-b0d2-f1530c99a98b", + "label": "Mutono Zone metadata", + "value": "26035" + }, + { + "description": "Jurisdiction Metadata for ksh_9(2020) id ef5540aa-b4c2-41f9-9052-a4cf63f7f528", + "key": "ef5540aa-b4c2-41f9-9052-a4cf63f7f528", + "label": "ksh_9(2020) metadata", + "value": "26036" + }, + { + "description": "Jurisdiction Metadata for ksh_42(2020) id 853934ee-d1a6-4b69-9191-59047edbc9a8", + "key": "853934ee-d1a6-4b69-9191-59047edbc9a8", + "label": "ksh_42(2020) metadata", + "value": "26037" + }, + { + "description": "Jurisdiction Metadata for ksh_78(2020) id 45e59e15-9d30-4099-8739-150f7b893ef7", + "key": "45e59e15-9d30-4099-8739-150f7b893ef7", + "label": "ksh_78(2020) metadata", + "value": "26038" + }, + { + "description": "Jurisdiction Metadata for ksh_34(2020) id 72e1e262-5244-41a3-a23e-6bd87b5de7e7", + "key": "72e1e262-5244-41a3-a23e-6bd87b5de7e7", + "label": "ksh_34(2020) metadata", + "value": "26039" + }, + { + "description": "Jurisdiction Metadata for ksh_3(2020) id c05a67b9-75d9-4c41-842c-704146a1057f", + "key": "c05a67b9-75d9-4c41-842c-704146a1057f", + "label": "ksh_3(2020) metadata", + "value": "26040" + }, + { + "description": "Jurisdiction Metadata for Nkomba Kapepa Zone id 4ed8f536-5c08-4203-8a90-a7e13becb01d", + "key": "4ed8f536-5c08-4203-8a90-a7e13becb01d", + "label": "Nkomba Kapepa Zone metadata", + "value": "26041" + }, + { + "description": "Jurisdiction Metadata for ksh_2(2020) id 67c5e0a4-132f-457b-b573-9abf5ec95c75", + "key": "67c5e0a4-132f-457b-b573-9abf5ec95c75", + "label": "ksh_2(2020) metadata", + "value": "26042" + }, + { + "description": "Jurisdiction Metadata for Sonka Zone id 372d52e9-9409-4f34-8099-a515362db3f5", + "key": "372d52e9-9409-4f34-8099-a515362db3f5", + "label": "Sonka Zone metadata", + "value": "26043" + }, + { + "description": "Jurisdiction Metadata for ksh_7(2020) id 2db79e9d-3ab8-463e-845d-8a3b57de149f", + "key": "2db79e9d-3ab8-463e-845d-8a3b57de149f", + "label": "ksh_7(2020) metadata", + "value": "26044" + }, + { + "description": "Jurisdiction Metadata for ksh_206(2020) id ad749ae4-609e-4854-b47c-87988acf2760", + "key": "ad749ae4-609e-4854-b47c-87988acf2760", + "label": "ksh_206(2020) metadata", + "value": "26045" + }, + { + "description": "Jurisdiction Metadata for ksh_68(2020) id 9391d5a5-cc45-4461-bd2c-4e41126e921d", + "key": "9391d5a5-cc45-4461-bd2c-4e41126e921d", + "label": "ksh_68(2020) metadata", + "value": "26046" + }, + { + "description": "Jurisdiction Metadata for ksh_16(2020) id e6aba96a-5cd9-4c15-a555-15d30696c5f1", + "key": "e6aba96a-5cd9-4c15-a555-15d30696c5f1", + "label": "ksh_16(2020) metadata", + "value": "26047" + }, + { + "description": "Jurisdiction Metadata for ksh_14(2020) id f7845b16-ec0d-420b-b199-e1e0d2a6261c", + "key": "f7845b16-ec0d-420b-b199-e1e0d2a6261c", + "label": "ksh_14(2020) metadata", + "value": "26048" + }, + { + "description": "Jurisdiction Metadata for ksh_15(2020) id bb13995e-6d44-4709-8828-fd8cb9daccd0", + "key": "bb13995e-6d44-4709-8828-fd8cb9daccd0", + "label": "ksh_15(2020) metadata", + "value": "26049" + }, + { + "description": "Jurisdiction Metadata for ksh_17(2020) id 0a8b4981-3ea5-476c-bf98-61e11a368d04", + "key": "0a8b4981-3ea5-476c-bf98-61e11a368d04", + "label": "ksh_17(2020) metadata", + "value": "26050" + }, + { + "description": "Jurisdiction Metadata for ksh_19(2020) id e98eda68-3d1c-466c-8bd6-714f82b3cf35", + "key": "e98eda68-3d1c-466c-8bd6-714f82b3cf35", + "label": "ksh_19(2020) metadata", + "value": "26051" + }, + { + "description": "Jurisdiction Metadata for Daison Zone id d595ea79-5cda-4210-8774-98a8a6a41ca5", + "key": "d595ea79-5cda-4210-8774-98a8a6a41ca5", + "label": "Daison Zone metadata", + "value": "26052" + }, + { + "description": "Jurisdiction Metadata for ksh_13(2020) id 89efdbf1-d2c2-4cd0-b651-c47ae16dd274", + "key": "89efdbf1-d2c2-4cd0-b651-c47ae16dd274", + "label": "ksh_13(2020) metadata", + "value": "26053" + }, + { + "description": "Jurisdiction Metadata for ksh_4(2020) id dc8b12f9-e461-4012-ac62-4dca2dc18390", + "key": "dc8b12f9-e461-4012-ac62-4dca2dc18390", + "label": "ksh_4(2020) metadata", + "value": "26054" + }, + { + "description": "Jurisdiction Metadata for Yenga Zone id 4219cca4-9916-4da9-9cbc-505ab6b5b375", + "key": "4219cca4-9916-4da9-9cbc-505ab6b5b375", + "label": "Yenga Zone metadata", + "value": "26055" + }, + { + "description": "Jurisdiction Metadata for ksh_10(2020) id 2c93e794-8499-4a9e-a626-771fc23dc412", + "key": "2c93e794-8499-4a9e-a626-771fc23dc412", + "label": "ksh_10(2020) metadata", + "value": "26056" + }, + { + "description": "Jurisdiction Metadata for ksh_155(2020) id 16e1543c-dcd8-4c4b-9a33-e5edcb97497e", + "key": "16e1543c-dcd8-4c4b-9a33-e5edcb97497e", + "label": "ksh_155(2020) metadata", + "value": "26057" + }, + { + "description": "Jurisdiction Metadata for ksh_20(2020) id 4673840b-bfc7-4b60-a0b2-cd87bb7cedac", + "key": "4673840b-bfc7-4b60-a0b2-cd87bb7cedac", + "label": "ksh_20(2020) metadata", + "value": "26058" + }, + { + "description": "Jurisdiction Metadata for ksh_11(2020) id af3d332b-f528-4245-8b0b-6d74c3c06558", + "key": "af3d332b-f528-4245-8b0b-6d74c3c06558", + "label": "ksh_11(2020) metadata", + "value": "26059" + }, + { + "description": "Jurisdiction Metadata for ksh_5(2020) id d0106a8f-91fd-447a-b2cb-a2249228233a", + "key": "d0106a8f-91fd-447a-b2cb-a2249228233a", + "label": "ksh_5(2020) metadata", + "value": "26060" + }, + { + "description": "Jurisdiction Metadata for Mpundu Zone id 4ace14cd-effe-497f-9eac-20bd622503af", + "key": "4ace14cd-effe-497f-9eac-20bd622503af", + "label": "Mpundu Zone metadata", + "value": "26061" + }, + { + "description": "Jurisdiction Metadata for ksh_1(2020) id f3ac7a52-9242-4fa6-952d-ac3e3ca1a809", + "key": "f3ac7a52-9242-4fa6-952d-ac3e3ca1a809", + "label": "ksh_1(2020) metadata", + "value": "26062" + }, + { + "description": "Jurisdiction Metadata for ksh_12(2020) id 31b25656-df7f-4f4a-b2dc-fdc49a8bb7e6", + "key": "31b25656-df7f-4f4a-b2dc-fdc49a8bb7e6", + "label": "ksh_12(2020) metadata", + "value": "26063" + }, + { + "description": "Jurisdiction Metadata for Kefulwa(2020) id f787f122-72e1-424b-97be-4e9505844191", + "key": "f787f122-72e1-424b-97be-4e9505844191", + "label": "Kefulwa(2020) metadata", + "value": "26064" + }, + { + "description": "Jurisdiction Metadata for Felushi id c82293da-790e-4128-a1f8-1e0c48021522", + "key": "c82293da-790e-4128-a1f8-1e0c48021522", + "label": "Felushi metadata", + "value": "26065" + }, + { + "description": "Jurisdiction Metadata for Kef_102(2020) id 034bfbf9-819a-4af1-8052-07948187214b", + "key": "034bfbf9-819a-4af1-8052-07948187214b", + "label": "Kef_102(2020) metadata", + "value": "26066" + }, + { + "description": "Jurisdiction Metadata for Kef_6(2020) id cfdeac6e-d38c-4f72-80f6-81f867c8f587", + "key": "cfdeac6e-d38c-4f72-80f6-81f867c8f587", + "label": "Kef_6(2020) metadata", + "value": "26067" + }, + { + "description": "Jurisdiction Metadata for Kef_83(2020) id 966744f0-60c2-4f23-9c77-0e8a7415f8fa", + "key": "966744f0-60c2-4f23-9c77-0e8a7415f8fa", + "label": "Kef_83(2020) metadata", + "value": "26068" + }, + { + "description": "Jurisdiction Metadata for Kef_149(2020) id 56d5a940-d71a-4f3c-b9e5-a0d8bacbab4e", + "key": "56d5a940-d71a-4f3c-b9e5-a0d8bacbab4e", + "label": "Kef_149(2020) metadata", + "value": "26069" + }, + { + "description": "Jurisdiction Metadata for Kef_70(2020) id 87b24082-5965-4d98-b972-e1bcd5d18032", + "key": "87b24082-5965-4d98-b972-e1bcd5d18032", + "label": "Kef_70(2020) metadata", + "value": "26070" + }, + { + "description": "Jurisdiction Metadata for Kef_147(2020) id 4bcab0a7-7db0-4727-857d-a980c7d13615", + "key": "4bcab0a7-7db0-4727-857d-a980c7d13615", + "label": "Kef_147(2020) metadata", + "value": "26071" + }, + { + "description": "Jurisdiction Metadata for Kef_1(2020) id fd63626d-e621-46fd-b482-7265678ac4d9", + "key": "fd63626d-e621-46fd-b482-7265678ac4d9", + "label": "Kef_1(2020) metadata", + "value": "26072" + }, + { + "description": "Jurisdiction Metadata for Kef_148(2020) id e381f7b8-4d93-4f6f-a76e-af20097ea082", + "key": "e381f7b8-4d93-4f6f-a76e-af20097ea082", + "label": "Kef_148(2020) metadata", + "value": "26073" + }, + { + "description": "Jurisdiction Metadata for Kef_208(2020) id e65b52b8-d711-4805-ab6f-0d6c35384883", + "key": "e65b52b8-d711-4805-ab6f-0d6c35384883", + "label": "Kef_208(2020) metadata", + "value": "26074" + }, + { + "description": "Jurisdiction Metadata for Kaputo (Munkombwe) id da29b655-57eb-45ac-85f4-72f8dc5d24ca", + "key": "da29b655-57eb-45ac-85f4-72f8dc5d24ca", + "label": "Kaputo (Munkombwe) metadata", + "value": "26075" + }, + { + "description": "Jurisdiction Metadata for Kef_16(2020) id 11c83854-8a0d-4fb0-8495-ac074913beac", + "key": "11c83854-8a0d-4fb0-8495-ac074913beac", + "label": "Kef_16(2020) metadata", + "value": "26076" + }, + { + "description": "Jurisdiction Metadata for Kef_42(2020) id b08b0614-dd00-4548-88ff-35957694c236", + "key": "b08b0614-dd00-4548-88ff-35957694c236", + "label": "Kef_42(2020) metadata", + "value": "26077" + }, + { + "description": "Jurisdiction Metadata for Kef_26(2020) id a057171a-f38a-4831-8acc-3b7a76ee36b6", + "key": "a057171a-f38a-4831-8acc-3b7a76ee36b6", + "label": "Kef_26(2020) metadata", + "value": "26078" + }, + { + "description": "Jurisdiction Metadata for Kef_55(2020) id 44a398d4-212f-4552-89d8-c1fcdb26b3eb", + "key": "44a398d4-212f-4552-89d8-c1fcdb26b3eb", + "label": "Kef_55(2020) metadata", + "value": "26079" + }, + { + "description": "Jurisdiction Metadata for Kef_11(2020) id d490fc04-0a25-431c-af33-2d6445ea28d3", + "key": "d490fc04-0a25-431c-af33-2d6445ea28d3", + "label": "Kef_11(2020) metadata", + "value": "26080" + }, + { + "description": "Jurisdiction Metadata for Kef_118(2020) id ffe59187-50ed-44d6-b5ea-aa0350ee639d", + "key": "ffe59187-50ed-44d6-b5ea-aa0350ee639d", + "label": "Kef_118(2020) metadata", + "value": "26081" + }, + { + "description": "Jurisdiction Metadata for Kef_224(2020) id dce779b3-e7e5-4d13-b8a3-dadae68d486d", + "key": "dce779b3-e7e5-4d13-b8a3-dadae68d486d", + "label": "Kef_224(2020) metadata", + "value": "26082" + }, + { + "description": "Jurisdiction Metadata for Kef_48(2020) id 53740598-0d11-40ea-b4b6-86fa418dde08", + "key": "53740598-0d11-40ea-b4b6-86fa418dde08", + "label": "Kef_48(2020) metadata", + "value": "26083" + }, + { + "description": "Jurisdiction Metadata for Kef_60(2020) id 797d6415-b3b3-4845-ae8d-513b8a7a2a88", + "key": "797d6415-b3b3-4845-ae8d-513b8a7a2a88", + "label": "Kef_60(2020) metadata", + "value": "26084" + }, + { + "description": "Jurisdiction Metadata for Kef_130(2020) id c33ea0ca-045b-409a-abbe-9339378dbcd5", + "key": "c33ea0ca-045b-409a-abbe-9339378dbcd5", + "label": "Kef_130(2020) metadata", + "value": "26085" + }, + { + "description": "Jurisdiction Metadata for Kef_27(2020) id b3658dd2-2a49-45e1-bfdd-a4368f74adc2", + "key": "b3658dd2-2a49-45e1-bfdd-a4368f74adc2", + "label": "Kef_27(2020) metadata", + "value": "26086" + }, + { + "description": "Jurisdiction Metadata for Kef_39(2020) id a604ece7-686d-46ee-9a97-816316b62282", + "key": "a604ece7-686d-46ee-9a97-816316b62282", + "label": "Kef_39(2020) metadata", + "value": "26087" + }, + { + "description": "Jurisdiction Metadata for Kef_67(2020) id 365e8d79-04c1-485a-82f4-6685eb35c696", + "key": "365e8d79-04c1-485a-82f4-6685eb35c696", + "label": "Kef_67(2020) metadata", + "value": "26088" + }, + { + "description": "Jurisdiction Metadata for Kef_31(2020) id b228bb61-2ba1-40f7-9687-d55dbac749f2", + "key": "b228bb61-2ba1-40f7-9687-d55dbac749f2", + "label": "Kef_31(2020) metadata", + "value": "26089" + }, + { + "description": "Jurisdiction Metadata for Kef_127(2020) id debcca44-55fc-4475-9efd-21bb95013b01", + "key": "debcca44-55fc-4475-9efd-21bb95013b01", + "label": "Kef_127(2020) metadata", + "value": "26090" + }, + { + "description": "Jurisdiction Metadata for Kef_34(2020) id 4270a291-9b5e-4cf5-bcd4-b2d318d19a41", + "key": "4270a291-9b5e-4cf5-bcd4-b2d318d19a41", + "label": "Kef_34(2020) metadata", + "value": "26091" + }, + { + "description": "Jurisdiction Metadata for Kef_62(2020) id 0a4dbc36-9d8a-4982-bb77-1d8446bbec11", + "key": "0a4dbc36-9d8a-4982-bb77-1d8446bbec11", + "label": "Kef_62(2020) metadata", + "value": "26092" + }, + { + "description": "Jurisdiction Metadata for Kef_49(2020) id 9e78f5a7-98e6-465b-8008-d98b360ffb5e", + "key": "9e78f5a7-98e6-465b-8008-d98b360ffb5e", + "label": "Kef_49(2020) metadata", + "value": "26093" + }, + { + "description": "Jurisdiction Metadata for Kef_119(2020) id 8c922279-c14b-4e6d-ad63-d3d16e63e4bc", + "key": "8c922279-c14b-4e6d-ad63-d3d16e63e4bc", + "label": "Kef_119(2020) metadata", + "value": "26094" + }, + { + "description": "Jurisdiction Metadata for Kef_68(2020) id 7a1f859c-1ea6-4214-a5de-9f7dab790e8c", + "key": "7a1f859c-1ea6-4214-a5de-9f7dab790e8c", + "label": "Kef_68(2020) metadata", + "value": "26095" + }, + { + "description": "Jurisdiction Metadata for Kef_24(2020) id 5becc2fa-f075-4acd-9fba-d570bf7a8d14", + "key": "5becc2fa-f075-4acd-9fba-d570bf7a8d14", + "label": "Kef_24(2020) metadata", + "value": "26096" + }, + { + "description": "Jurisdiction Metadata for Kef_185(2020) id 5eb5a79f-534c-4d1a-876a-d04cc823f7dc", + "key": "5eb5a79f-534c-4d1a-876a-d04cc823f7dc", + "label": "Kef_185(2020) metadata", + "value": "26097" + }, + { + "description": "Jurisdiction Metadata for Kalubi id 98525cfa-4e29-4ed7-85da-f0cf31a61d8e", + "key": "98525cfa-4e29-4ed7-85da-f0cf31a61d8e", + "label": "Kalubi metadata", + "value": "26098" + }, + { + "description": "Jurisdiction Metadata for Kef_7(2020) id 45c50008-222b-4b54-84e8-b55adf6b5f2c", + "key": "45c50008-222b-4b54-84e8-b55adf6b5f2c", + "label": "Kef_7(2020) metadata", + "value": "26099" + }, + { + "description": "Jurisdiction Metadata for Kef_41(2020) id a34d0217-a216-4317-bb16-dd2d56b70bf4", + "key": "a34d0217-a216-4317-bb16-dd2d56b70bf4", + "label": "Kef_41(2020) metadata", + "value": "26100" + }, + { + "description": "Jurisdiction Metadata for Kef_66(2020) id 79a82c52-06dc-448a-adfa-c6e94c1e0148", + "key": "79a82c52-06dc-448a-adfa-c6e94c1e0148", + "label": "Kef_66(2020) metadata", + "value": "26101" + }, + { + "description": "Jurisdiction Metadata for Mukeya id fc937da0-922c-42a0-bec1-3402bfa80d51", + "key": "fc937da0-922c-42a0-bec1-3402bfa80d51", + "label": "Mukeya metadata", + "value": "26102" + }, + { + "description": "Jurisdiction Metadata for Kef_4(2020) id 93da30f9-e3de-4b4f-bc2e-c2172716f9ad", + "key": "93da30f9-e3de-4b4f-bc2e-c2172716f9ad", + "label": "Kef_4(2020) metadata", + "value": "26103" + }, + { + "description": "Jurisdiction Metadata for Kef_12(2020) id 73908ed2-86ff-4c8f-8081-5fa941bd86c6", + "key": "73908ed2-86ff-4c8f-8081-5fa941bd86c6", + "label": "Kef_12(2020) metadata", + "value": "26104" + }, + { + "description": "Jurisdiction Metadata for Kandeke id 2922593a-0042-4c82-ab8f-d9d0c70ec7cb", + "key": "2922593a-0042-4c82-ab8f-d9d0c70ec7cb", + "label": "Kandeke metadata", + "value": "26105" + }, + { + "description": "Jurisdiction Metadata for Kef_8(2020) id dedddf18-29c7-47ba-a5b0-12359c77f835", + "key": "dedddf18-29c7-47ba-a5b0-12359c77f835", + "label": "Kef_8(2020) metadata", + "value": "26106" + }, + { + "description": "Jurisdiction Metadata for Malambo id 94376ef0-fdd5-4f9c-a777-0e2e444e6549", + "key": "94376ef0-fdd5-4f9c-a777-0e2e444e6549", + "label": "Malambo metadata", + "value": "26107" + }, + { + "description": "Jurisdiction Metadata for Kef_142(2020) id 6332c9b3-c149-46ef-ae4f-23c9c8ac372e", + "key": "6332c9b3-c149-46ef-ae4f-23c9c8ac372e", + "label": "Kef_142(2020) metadata", + "value": "26108" + }, + { + "description": "Jurisdiction Metadata for Kef_9(2020) id cd7999f5-d75b-4c34-80da-e9caa234c087", + "key": "cd7999f5-d75b-4c34-80da-e9caa234c087", + "label": "Kef_9(2020) metadata", + "value": "26109" + }, + { + "description": "Jurisdiction Metadata for Chiba id 04428222-a0f3-4289-bbbd-95640602d299", + "key": "04428222-a0f3-4289-bbbd-95640602d299", + "label": "Chiba metadata", + "value": "26110" + }, + { + "description": "Jurisdiction Metadata for Kef_2(2020) id 0e199a40-8d23-48af-9c0d-95d35a539143", + "key": "0e199a40-8d23-48af-9c0d-95d35a539143", + "label": "Kef_2(2020) metadata", + "value": "26111" + }, + { + "description": "Jurisdiction Metadata for Kef_145(2020) id 11d785ce-410d-4817-ae41-0e2e7bbb8170", + "key": "11d785ce-410d-4817-ae41-0e2e7bbb8170", + "label": "Kef_145(2020) metadata", + "value": "26112" + }, + { + "description": "Jurisdiction Metadata for Kef_54(2020) id d2e60221-0b96-4a0a-9473-b5bd28bdce6e", + "key": "d2e60221-0b96-4a0a-9473-b5bd28bdce6e", + "label": "Kef_54(2020) metadata", + "value": "26113" + }, + { + "description": "Jurisdiction Metadata for Kaputo id c2c9ea6c-fef5-436a-bac5-5280f8d0b595", + "key": "c2c9ea6c-fef5-436a-bac5-5280f8d0b595", + "label": "Kaputo metadata", + "value": "26114" + }, + { + "description": "Jurisdiction Metadata for Kef_3(2020) id 3e5d8914-b355-4097-9665-e700695bcb53", + "key": "3e5d8914-b355-4097-9665-e700695bcb53", + "label": "Kef_3(2020) metadata", + "value": "26115" + }, + { + "description": "Jurisdiction Metadata for Kef_18(2020) id dd798014-fbe5-491e-a2ea-41cf1caf6228", + "key": "dd798014-fbe5-491e-a2ea-41cf1caf6228", + "label": "Kef_18(2020) metadata", + "value": "26116" + }, + { + "description": "Jurisdiction Metadata for Kalimashe id 5aa534b7-accc-4442-b3e0-3f50c8012da1", + "key": "5aa534b7-accc-4442-b3e0-3f50c8012da1", + "label": "Kalimashe metadata", + "value": "26117" + }, + { + "description": "Jurisdiction Metadata for Kef_32(2020) id 56b92c9f-b7b6-4c97-af78-24653c601ee5", + "key": "56b92c9f-b7b6-4c97-af78-24653c601ee5", + "label": "Kef_32(2020) metadata", + "value": "26118" + }, + { + "description": "Jurisdiction Metadata for Kef_19(2020) id ac719b51-f6e9-425a-aa74-a8053705650d", + "key": "ac719b51-f6e9-425a-aa74-a8053705650d", + "label": "Kef_19(2020) metadata", + "value": "26119" + }, + { + "description": "Jurisdiction Metadata for Kef_23(2020) id 12dcfb30-4f38-4241-a3c2-acae272f02cf", + "key": "12dcfb30-4f38-4241-a3c2-acae272f02cf", + "label": "Kef_23(2020) metadata", + "value": "26120" + }, + { + "description": "Jurisdiction Metadata for Kasamba id bde599f7-b817-434d-bc4f-028c814d0a58", + "key": "bde599f7-b817-434d-bc4f-028c814d0a58", + "label": "Kasamba metadata", + "value": "26121" + }, + { + "description": "Jurisdiction Metadata for Kef_211(2020) id 6f1b3dae-031d-4a0c-a915-97bca3b6b88c", + "key": "6f1b3dae-031d-4a0c-a915-97bca3b6b88c", + "label": "Kef_211(2020) metadata", + "value": "26122" + }, + { + "description": "Jurisdiction Metadata for Kef_146(2020) id 2a8e7159-dc71-4e18-9ad4-5b3a320bd383", + "key": "2a8e7159-dc71-4e18-9ad4-5b3a320bd383", + "label": "Kef_146(2020) metadata", + "value": "26123" + }, + { + "description": "Jurisdiction Metadata for Kef_51(2020) id 5a0c4f71-5dfe-4d1b-b15e-d13b1db9d2a0", + "key": "5a0c4f71-5dfe-4d1b-b15e-d13b1db9d2a0", + "label": "Kef_51(2020) metadata", + "value": "26124" + }, + { + "description": "Jurisdiction Metadata for Kef_203(2020) id 2fc29958-496d-4a45-8e43-de0238c2f79f", + "key": "2fc29958-496d-4a45-8e43-de0238c2f79f", + "label": "Kef_203(2020) metadata", + "value": "26125" + }, + { + "description": "Jurisdiction Metadata for Kef_84(2020) id 0d9e8ca2-6fd8-4216-b0be-18ca1dc143a7", + "key": "0d9e8ca2-6fd8-4216-b0be-18ca1dc143a7", + "label": "Kef_84(2020) metadata", + "value": "26126" + }, + { + "description": "Jurisdiction Metadata for Kef_106(2020) id 3cd18585-48bc-4d1d-b14b-cd3af9fa44fb", + "key": "3cd18585-48bc-4d1d-b14b-cd3af9fa44fb", + "label": "Kef_106(2020) metadata", + "value": "26127" + }, + { + "description": "Jurisdiction Metadata for Kef_85(2020) id cd5ca32c-0096-4d53-9cc7-4da863148b48", + "key": "cd5ca32c-0096-4d53-9cc7-4da863148b48", + "label": "Kef_85(2020) metadata", + "value": "26128" + }, + { + "description": "Jurisdiction Metadata for Kef_221(2020) id 19dde055-a640-4815-bb6a-8317b1846afc", + "key": "19dde055-a640-4815-bb6a-8317b1846afc", + "label": "Kef_221(2020) metadata", + "value": "26129" + }, + { + "description": "Jurisdiction Metadata for Kef_206(2020) id 2b717e56-71c6-4cf0-92ee-e9a9ef1c4e75", + "key": "2b717e56-71c6-4cf0-92ee-e9a9ef1c4e75", + "label": "Kef_206(2020) metadata", + "value": "26130" + }, + { + "description": "Jurisdiction Metadata for Kef_197(2020) id 7a1de10c-bb98-431b-9ff1-472581f201a1", + "key": "7a1de10c-bb98-431b-9ff1-472581f201a1", + "label": "Kef_197(2020) metadata", + "value": "26131" + }, + { + "description": "Jurisdiction Metadata for Kef_187(2020) id a0143ae2-84a6-48fd-bcdd-6ff89b612fb0", + "key": "a0143ae2-84a6-48fd-bcdd-6ff89b612fb0", + "label": "Kef_187(2020) metadata", + "value": "26132" + }, + { + "description": "Jurisdiction Metadata for Kef_133(2020) id 183191be-08ff-444e-9ad5-084e93529eed", + "key": "183191be-08ff-444e-9ad5-084e93529eed", + "label": "Kef_133(2020) metadata", + "value": "26133" + }, + { + "description": "Jurisdiction Metadata for Kef_126(2020) id 3c8b0057-ec2e-4271-8c55-aac7a26478aa", + "key": "3c8b0057-ec2e-4271-8c55-aac7a26478aa", + "label": "Kef_126(2020) metadata", + "value": "26134" + }, + { + "description": "Jurisdiction Metadata for Kef_156(2020) id 725ffe67-d4e7-4244-aa02-7c1237b2fa82", + "key": "725ffe67-d4e7-4244-aa02-7c1237b2fa82", + "label": "Kef_156(2020) metadata", + "value": "26135" + }, + { + "description": "Jurisdiction Metadata for Kef_166(2020) id 69f0751d-472c-487c-b46b-a13c96c34e08", + "key": "69f0751d-472c-487c-b46b-a13c96c34e08", + "label": "Kef_166(2020) metadata", + "value": "26136" + }, + { + "description": "Jurisdiction Metadata for Kef_163(2020) id 4b9d4c9d-af9b-4665-9ed4-008995c82115", + "key": "4b9d4c9d-af9b-4665-9ed4-008995c82115", + "label": "Kef_163(2020) metadata", + "value": "26137" + }, + { + "description": "Jurisdiction Metadata for Kef_151(2020) id 903587e1-0647-4653-8313-945b4596acb0", + "key": "903587e1-0647-4653-8313-945b4596acb0", + "label": "Kef_151(2020) metadata", + "value": "26138" + }, + { + "description": "Jurisdiction Metadata for Kef_128(2020) id 5838bc38-028f-41bb-ae77-239025d67a45", + "key": "5838bc38-028f-41bb-ae77-239025d67a45", + "label": "Kef_128(2020) metadata", + "value": "26139" + }, + { + "description": "Jurisdiction Metadata for Kef_129(2020) id 3b741bdf-d90a-446a-9476-76c489a809df", + "key": "3b741bdf-d90a-446a-9476-76c489a809df", + "label": "Kef_129(2020) metadata", + "value": "26140" + }, + { + "description": "Jurisdiction Metadata for Kef_93(2020) id c549ee84-fb05-49ce-b2f4-9114b5e9ee24", + "key": "c549ee84-fb05-49ce-b2f4-9114b5e9ee24", + "label": "Kef_93(2020) metadata", + "value": "26141" + }, + { + "description": "Jurisdiction Metadata for Kef_189(2020) id 86ed1c6c-8052-4122-b379-ebf1dfbe0e70", + "key": "86ed1c6c-8052-4122-b379-ebf1dfbe0e70", + "label": "Kef_189(2020) metadata", + "value": "26142" + }, + { + "description": "Jurisdiction Metadata for Kef_168(2020) id 19ab2409-28dd-459d-9cb8-401e21363b0f", + "key": "19ab2409-28dd-459d-9cb8-401e21363b0f", + "label": "Kef_168(2020) metadata", + "value": "26143" + }, + { + "description": "Jurisdiction Metadata for Kef_21(2020) id e5ddea04-f3c2-45a1-8f1e-0f66d623fc9f", + "key": "e5ddea04-f3c2-45a1-8f1e-0f66d623fc9f", + "label": "Kef_21(2020) metadata", + "value": "26144" + }, + { + "description": "Jurisdiction Metadata for Kef_172(2020) id f184af30-0c55-4768-9af9-7ea5a0f7f6ae", + "key": "f184af30-0c55-4768-9af9-7ea5a0f7f6ae", + "label": "Kef_172(2020) metadata", + "value": "26145" + }, + { + "description": "Jurisdiction Metadata for Kef_89(2020) id 9f28460c-eafe-436f-892b-f50e83a62003", + "key": "9f28460c-eafe-436f-892b-f50e83a62003", + "label": "Kef_89(2020) metadata", + "value": "26146" + }, + { + "description": "Jurisdiction Metadata for Kef_104(2020) id 12e5254f-d913-4ea6-91ea-b2215872a855", + "key": "12e5254f-d913-4ea6-91ea-b2215872a855", + "label": "Kef_104(2020) metadata", + "value": "26147" + }, + { + "description": "Jurisdiction Metadata for Kef_188(2020) id 7e134218-12f2-478d-b67b-3e4f96475cdc", + "key": "7e134218-12f2-478d-b67b-3e4f96475cdc", + "label": "Kef_188(2020) metadata", + "value": "26148" + }, + { + "description": "Jurisdiction Metadata for Kef_165(2020) id 7d6c01dc-9fea-44bc-a26a-e2fbc7d94021", + "key": "7d6c01dc-9fea-44bc-a26a-e2fbc7d94021", + "label": "Kef_165(2020) metadata", + "value": "26149" + }, + { + "description": "Jurisdiction Metadata for Kef_58(2020) id 9cea982f-66af-4c11-8a74-255ee9313a27", + "key": "9cea982f-66af-4c11-8a74-255ee9313a27", + "label": "Kef_58(2020) metadata", + "value": "26150" + }, + { + "description": "Jurisdiction Metadata for Kef_111(2020) id 4f60c03e-7c2b-41ad-b471-a1cd63f44043", + "key": "4f60c03e-7c2b-41ad-b471-a1cd63f44043", + "label": "Kef_111(2020) metadata", + "value": "26151" + }, + { + "description": "Jurisdiction Metadata for Kef_155(2020) id 7d3fc678-b44e-41d1-a068-aed58b0ef888", + "key": "7d3fc678-b44e-41d1-a068-aed58b0ef888", + "label": "Kef_155(2020) metadata", + "value": "26152" + }, + { + "description": "Jurisdiction Metadata for Kef_71(2020) id 72d3a91e-2bb3-47b9-8984-fccfd0361d71", + "key": "72d3a91e-2bb3-47b9-8984-fccfd0361d71", + "label": "Kef_71(2020) metadata", + "value": "26153" + }, + { + "description": "Jurisdiction Metadata for Kef_91(2020) id 57262cbb-e634-4bb4-8d6e-0bbc3c8c8fda", + "key": "57262cbb-e634-4bb4-8d6e-0bbc3c8c8fda", + "label": "Kef_91(2020) metadata", + "value": "26154" + }, + { + "description": "Jurisdiction Metadata for Kef_231(2020) id b9b6c1a1-4a31-4682-93e3-539dbcb8d690", + "key": "b9b6c1a1-4a31-4682-93e3-539dbcb8d690", + "label": "Kef_231(2020) metadata", + "value": "26155" + }, + { + "description": "Jurisdiction Metadata for Kef_78(2020) id f520a437-407e-49f4-9346-190371965ce4", + "key": "f520a437-407e-49f4-9346-190371965ce4", + "label": "Kef_78(2020) metadata", + "value": "26156" + }, + { + "description": "Jurisdiction Metadata for Kef_159(2020) id a7514805-6a13-4371-ac1a-0da54d3a61e7", + "key": "a7514805-6a13-4371-ac1a-0da54d3a61e7", + "label": "Kef_159(2020) metadata", + "value": "26157" + }, + { + "description": "Jurisdiction Metadata for Kef_105(2020) id 5166a456-3060-4a90-a873-b13091674785", + "key": "5166a456-3060-4a90-a873-b13091674785", + "label": "Kef_105(2020) metadata", + "value": "26158" + }, + { + "description": "Jurisdiction Metadata for Kef_138(2020) id fb2caf92-4b69-4621-920f-984cea90b5ee", + "key": "fb2caf92-4b69-4621-920f-984cea90b5ee", + "label": "Kef_138(2020) metadata", + "value": "26159" + }, + { + "description": "Jurisdiction Metadata for Kef_139(2020) id 3315046d-99e3-4a13-ab99-f0659187e8b9", + "key": "3315046d-99e3-4a13-ab99-f0659187e8b9", + "label": "Kef_139(2020) metadata", + "value": "26160" + }, + { + "description": "Jurisdiction Metadata for Kef_120(2020) id f6300f81-9c14-4d86-ba6f-6df4e5931824", + "key": "f6300f81-9c14-4d86-ba6f-6df4e5931824", + "label": "Kef_120(2020) metadata", + "value": "26161" + }, + { + "description": "Jurisdiction Metadata for Kef_38(2020) id 52b28c2a-6e2f-41ad-836c-90053aac4286", + "key": "52b28c2a-6e2f-41ad-836c-90053aac4286", + "label": "Kef_38(2020) metadata", + "value": "26162" + }, + { + "description": "Jurisdiction Metadata for Kef_47(2020) id fa229504-514c-4851-8be4-18188f3abc66", + "key": "fa229504-514c-4851-8be4-18188f3abc66", + "label": "Kef_47(2020) metadata", + "value": "26163" + }, + { + "description": "Jurisdiction Metadata for Kef_212(2020) id 34281906-7c49-4dca-9c43-2cf83a925e25", + "key": "34281906-7c49-4dca-9c43-2cf83a925e25", + "label": "Kef_212(2020) metadata", + "value": "26164" + }, + { + "description": "Jurisdiction Metadata for Kef_170(2020) id e082431d-dbc6-453d-b2b5-b6d702e84e60", + "key": "e082431d-dbc6-453d-b2b5-b6d702e84e60", + "label": "Kef_170(2020) metadata", + "value": "26165" + }, + { + "description": "Jurisdiction Metadata for Kef_63(2020) id b025d783-8ca5-4d46-9605-a7c84e2ac3c4", + "key": "b025d783-8ca5-4d46-9605-a7c84e2ac3c4", + "label": "Kef_63(2020) metadata", + "value": "26166" + }, + { + "description": "Jurisdiction Metadata for Kef_109(2020) id a8ef87c2-8212-402f-9e3b-dbd16df32a8d", + "key": "a8ef87c2-8212-402f-9e3b-dbd16df32a8d", + "label": "Kef_109(2020) metadata", + "value": "26167" + }, + { + "description": "Jurisdiction Metadata for Kef_226(2020) id f1551ec2-b25c-48b0-8c00-33f8260ab740", + "key": "f1551ec2-b25c-48b0-8c00-33f8260ab740", + "label": "Kef_226(2020) metadata", + "value": "26168" + }, + { + "description": "Jurisdiction Metadata for Kef_36(2020) id 2bb6e5dd-e9a6-4a8a-af95-674d2252779d", + "key": "2bb6e5dd-e9a6-4a8a-af95-674d2252779d", + "label": "Kef_36(2020) metadata", + "value": "26169" + }, + { + "description": "Jurisdiction Metadata for Kef_154(2020) id 01ff18e1-03b5-4abe-91a3-0228e35150fb", + "key": "01ff18e1-03b5-4abe-91a3-0228e35150fb", + "label": "Kef_154(2020) metadata", + "value": "26170" + }, + { + "description": "Jurisdiction Metadata for Kef_150(2020) id f6f849d2-5ff0-4504-ac12-822d4cc1a22d", + "key": "f6f849d2-5ff0-4504-ac12-822d4cc1a22d", + "label": "Kef_150(2020) metadata", + "value": "26171" + }, + { + "description": "Jurisdiction Metadata for Kef_186(2020) id d5cac38a-163a-4aa1-a74b-a2fc491370df", + "key": "d5cac38a-163a-4aa1-a74b-a2fc491370df", + "label": "Kef_186(2020) metadata", + "value": "26172" + }, + { + "description": "Jurisdiction Metadata for Kef_25(2020) id cfd5b182-ad40-4121-9584-a68160b6a009", + "key": "cfd5b182-ad40-4121-9584-a68160b6a009", + "label": "Kef_25(2020) metadata", + "value": "26173" + }, + { + "description": "Jurisdiction Metadata for Kef_173(2020) id 1d50ed34-3091-4ff9-8e6b-f1e73ef97d86", + "key": "1d50ed34-3091-4ff9-8e6b-f1e73ef97d86", + "label": "Kef_173(2020) metadata", + "value": "26174" + }, + { + "description": "Jurisdiction Metadata for Kef_87(2020) id cacb8c29-9f9d-4c8c-86b1-aa54d819fca5", + "key": "cacb8c29-9f9d-4c8c-86b1-aa54d819fca5", + "label": "Kef_87(2020) metadata", + "value": "26175" + }, + { + "description": "Jurisdiction Metadata for Kef_30(2020) id 84ef7a22-37ff-4673-9a40-b87e31ad5bc6", + "key": "84ef7a22-37ff-4673-9a40-b87e31ad5bc6", + "label": "Kef_30(2020) metadata", + "value": "26176" + }, + { + "description": "Jurisdiction Metadata for Kef_132(2020) id 44531daf-b098-4d15-b5d1-04b3a8f05401", + "key": "44531daf-b098-4d15-b5d1-04b3a8f05401", + "label": "Kef_132(2020) metadata", + "value": "26177" + }, + { + "description": "Jurisdiction Metadata for Kef_122(2020) id 19e1e73f-bdaf-4c2f-9e5e-c8bf87676d21", + "key": "19e1e73f-bdaf-4c2f-9e5e-c8bf87676d21", + "label": "Kef_122(2020) metadata", + "value": "26178" + }, + { + "description": "Jurisdiction Metadata for Kef_177(2020) id 6f1f4860-dbee-418e-9ee3-4bba61ff3e31", + "key": "6f1f4860-dbee-418e-9ee3-4bba61ff3e31", + "label": "Kef_177(2020) metadata", + "value": "26179" + }, + { + "description": "Jurisdiction Metadata for Kef_56(2020) id 9d291f41-4db0-4a4d-baa4-973d822a13a0", + "key": "9d291f41-4db0-4a4d-baa4-973d822a13a0", + "label": "Kef_56(2020) metadata", + "value": "26180" + }, + { + "description": "Jurisdiction Metadata for Kef_153(2020) id c850b33c-d6f8-40d7-8457-7677aaee8efc", + "key": "c850b33c-d6f8-40d7-8457-7677aaee8efc", + "label": "Kef_153(2020) metadata", + "value": "26181" + }, + { + "description": "Jurisdiction Metadata for Kef_20(2020) id b72daa27-1f2a-44c7-a2e0-9e35fb579931", + "key": "b72daa27-1f2a-44c7-a2e0-9e35fb579931", + "label": "Kef_20(2020) metadata", + "value": "26182" + }, + { + "description": "Jurisdiction Metadata for Kef_218(2020) id b058c217-9cc5-480c-80a6-c1a2f19cc24e", + "key": "b058c217-9cc5-480c-80a6-c1a2f19cc24e", + "label": "Kef_218(2020) metadata", + "value": "26183" + }, + { + "description": "Jurisdiction Metadata for Kef_64(2020) id a5270169-4551-41c4-9701-b5dcb8229f87", + "key": "a5270169-4551-41c4-9701-b5dcb8229f87", + "label": "Kef_64(2020) metadata", + "value": "26184" + }, + { + "description": "Jurisdiction Metadata for Kef_190(2020) id 3ec362fc-229b-44ab-8d3e-761541bc5f08", + "key": "3ec362fc-229b-44ab-8d3e-761541bc5f08", + "label": "Kef_190(2020) metadata", + "value": "26185" + }, + { + "description": "Jurisdiction Metadata for Kef_82(2020) id 12375d0a-7801-47ca-91d2-afb840a66887", + "key": "12375d0a-7801-47ca-91d2-afb840a66887", + "label": "Kef_82(2020) metadata", + "value": "26186" + }, + { + "description": "Jurisdiction Metadata for Kef_123(2020) id 2c65ba7b-bf25-4b4c-9b71-30e9a98f3f4c", + "key": "2c65ba7b-bf25-4b4c-9b71-30e9a98f3f4c", + "label": "Kef_123(2020) metadata", + "value": "26187" + }, + { + "description": "Jurisdiction Metadata for Kef_194(2020) id d15c6bd4-ce1f-4274-93a2-03857fff79fa", + "key": "d15c6bd4-ce1f-4274-93a2-03857fff79fa", + "label": "Kef_194(2020) metadata", + "value": "26188" + }, + { + "description": "Jurisdiction Metadata for Kef_207(2020) id fbebbdcb-993c-49a0-b66a-17d9e75e62a1", + "key": "fbebbdcb-993c-49a0-b66a-17d9e75e62a1", + "label": "Kef_207(2020) metadata", + "value": "26189" + }, + { + "description": "Jurisdiction Metadata for Kef_17(2020) id 2f1e01c0-9e47-43ea-87a5-6920f0e775b4", + "key": "2f1e01c0-9e47-43ea-87a5-6920f0e775b4", + "label": "Kef_17(2020) metadata", + "value": "26190" + }, + { + "description": "Jurisdiction Metadata for Kef_76(2020) id 14c310e8-1621-43aa-afd3-3a8596bc4e52", + "key": "14c310e8-1621-43aa-afd3-3a8596bc4e52", + "label": "Kef_76(2020) metadata", + "value": "26191" + }, + { + "description": "Jurisdiction Metadata for Kef_95(2020) id 6d7758c8-9989-4915-b5e9-3c24938c7b27", + "key": "6d7758c8-9989-4915-b5e9-3c24938c7b27", + "label": "Kef_95(2020) metadata", + "value": "26192" + }, + { + "description": "Jurisdiction Metadata for Kef_96(2020) id d5392f65-9220-4394-9ab2-2fb7c91892d7", + "key": "d5392f65-9220-4394-9ab2-2fb7c91892d7", + "label": "Kef_96(2020) metadata", + "value": "26193" + }, + { + "description": "Jurisdiction Metadata for Kef_225(2020) id 053fda0a-5b30-47dc-ab99-b32ed9cd2ce9", + "key": "053fda0a-5b30-47dc-ab99-b32ed9cd2ce9", + "label": "Kef_225(2020) metadata", + "value": "26194" + }, + { + "description": "Jurisdiction Metadata for Kef_100(2020) id dd8f58ed-f8fc-4fa8-a560-6d826ba91091", + "key": "dd8f58ed-f8fc-4fa8-a560-6d826ba91091", + "label": "Kef_100(2020) metadata", + "value": "26195" + }, + { + "description": "Jurisdiction Metadata for Kef_79(2020) id 84f2ecc9-6090-49fd-a298-308023a239c8", + "key": "84f2ecc9-6090-49fd-a298-308023a239c8", + "label": "Kef_79(2020) metadata", + "value": "26196" + }, + { + "description": "Jurisdiction Metadata for Kef_33(2020) id bb7c659a-4fb3-4d3d-8ad6-290ed39c9af9", + "key": "bb7c659a-4fb3-4d3d-8ad6-290ed39c9af9", + "label": "Kef_33(2020) metadata", + "value": "26197" + }, + { + "description": "Jurisdiction Metadata for Kef_97(2020) id a270f12d-1e90-47cc-924a-012e0b9a2979", + "key": "a270f12d-1e90-47cc-924a-012e0b9a2979", + "label": "Kef_97(2020) metadata", + "value": "26198" + }, + { + "description": "Jurisdiction Metadata for Kef_107(2020) id 8737e894-a019-4eae-ab82-becdbda1b80a", + "key": "8737e894-a019-4eae-ab82-becdbda1b80a", + "label": "Kef_107(2020) metadata", + "value": "26199" + }, + { + "description": "Jurisdiction Metadata for Kef_77(2020) id d9ce1949-3fce-46f6-9909-01be7cdbd9cc", + "key": "d9ce1949-3fce-46f6-9909-01be7cdbd9cc", + "label": "Kef_77(2020) metadata", + "value": "26200" + }, + { + "description": "Jurisdiction Metadata for Kef_215(2020) id e83214fe-2f57-4fdc-978b-14c93bd3c23b", + "key": "e83214fe-2f57-4fdc-978b-14c93bd3c23b", + "label": "Kef_215(2020) metadata", + "value": "26201" + }, + { + "description": "Jurisdiction Metadata for Kef_125(2020) id f97a7a69-f01f-4187-9c0e-dcae6255d5b0", + "key": "f97a7a69-f01f-4187-9c0e-dcae6255d5b0", + "label": "Kef_125(2020) metadata", + "value": "26202" + }, + { + "description": "Jurisdiction Metadata for Kef_223(2020) id cb61548d-91bc-48cd-93ee-c3c8ae108b6e", + "key": "cb61548d-91bc-48cd-93ee-c3c8ae108b6e", + "label": "Kef_223(2020) metadata", + "value": "26203" + }, + { + "description": "Jurisdiction Metadata for Kef_164(2020) id 06ac2321-6d5d-4868-9bdc-bc9597a70708", + "key": "06ac2321-6d5d-4868-9bdc-bc9597a70708", + "label": "Kef_164(2020) metadata", + "value": "26204" + }, + { + "description": "Jurisdiction Metadata for Kef_86(2020) id dcf84629-79d3-46da-93c4-c5a0312139d8", + "key": "dcf84629-79d3-46da-93c4-c5a0312139d8", + "label": "Kef_86(2020) metadata", + "value": "26205" + }, + { + "description": "Jurisdiction Metadata for Kef_174(2020) id 46a1ab96-127a-482b-8bdf-ff56f753fac8", + "key": "46a1ab96-127a-482b-8bdf-ff56f753fac8", + "label": "Kef_174(2020) metadata", + "value": "26206" + }, + { + "description": "Jurisdiction Metadata for Kef_131(2020) id 37850010-659e-4f42-b7ed-7296da993345", + "key": "37850010-659e-4f42-b7ed-7296da993345", + "label": "Kef_131(2020) metadata", + "value": "26207" + }, + { + "description": "Jurisdiction Metadata for Kef_92(2020) id feb9d087-cb04-4cfd-b342-ff80ae582750", + "key": "feb9d087-cb04-4cfd-b342-ff80ae582750", + "label": "Kef_92(2020) metadata", + "value": "26208" + }, + { + "description": "Jurisdiction Metadata for Kef_200(2020) id fc2b113e-4063-4a47-a432-07ad764884a9", + "key": "fc2b113e-4063-4a47-a432-07ad764884a9", + "label": "Kef_200(2020) metadata", + "value": "26209" + }, + { + "description": "Jurisdiction Metadata for Kef_44(2020) id 6a104a59-0616-45c4-a05e-e831bcc50154", + "key": "6a104a59-0616-45c4-a05e-e831bcc50154", + "label": "Kef_44(2020) metadata", + "value": "26210" + }, + { + "description": "Jurisdiction Metadata for Kef_195(2020) id ae517b35-a77b-481a-b9c6-d7a24cddef8f", + "key": "ae517b35-a77b-481a-b9c6-d7a24cddef8f", + "label": "Kef_195(2020) metadata", + "value": "26211" + }, + { + "description": "Jurisdiction Metadata for Kef_198(2020) id 649f41eb-c880-475f-b5eb-c9cae7323d13", + "key": "649f41eb-c880-475f-b5eb-c9cae7323d13", + "label": "Kef_198(2020) metadata", + "value": "26212" + }, + { + "description": "Jurisdiction Metadata for Kef_152(2020) id 65713600-887c-4af0-88d2-7edb8be0fc1c", + "key": "65713600-887c-4af0-88d2-7edb8be0fc1c", + "label": "Kef_152(2020) metadata", + "value": "26213" + }, + { + "description": "Jurisdiction Metadata for Kef_219(2020) id 8fe19761-2640-4a07-aacb-972aee7412b5", + "key": "8fe19761-2640-4a07-aacb-972aee7412b5", + "label": "Kef_219(2020) metadata", + "value": "26214" + }, + { + "description": "Jurisdiction Metadata for Kef_140(2020) id 6204c657-7881-421a-bee0-2b671506469b", + "key": "6204c657-7881-421a-bee0-2b671506469b", + "label": "Kef_140(2020) metadata", + "value": "26215" + }, + { + "description": "Jurisdiction Metadata for Kef_115(2020) id ba5498eb-c4d5-417b-8c66-6d53c8c4531b", + "key": "ba5498eb-c4d5-417b-8c66-6d53c8c4531b", + "label": "Kef_115(2020) metadata", + "value": "26216" + }, + { + "description": "Jurisdiction Metadata for Kef_59(2020) id 1bfe2ad0-7497-4bf8-9bb0-18d91b2a29f8", + "key": "1bfe2ad0-7497-4bf8-9bb0-18d91b2a29f8", + "label": "Kef_59(2020) metadata", + "value": "26217" + }, + { + "description": "Jurisdiction Metadata for Kef_43(2020) id b090ce19-a93f-4913-8e19-d992645309b3", + "key": "b090ce19-a93f-4913-8e19-d992645309b3", + "label": "Kef_43(2020) metadata", + "value": "26218" + }, + { + "description": "Jurisdiction Metadata for Kef_57(2020) id 8071118d-29bc-4c61-a80e-2531d091d637", + "key": "8071118d-29bc-4c61-a80e-2531d091d637", + "label": "Kef_57(2020) metadata", + "value": "26219" + }, + { + "description": "Jurisdiction Metadata for Kef_65(2020) id 04a3ae0b-145c-4ca8-8e71-cfeff964136e", + "key": "04a3ae0b-145c-4ca8-8e71-cfeff964136e", + "label": "Kef_65(2020) metadata", + "value": "26220" + }, + { + "description": "Jurisdiction Metadata for Kef_143(2020) id 86f8cc3a-56b1-4489-8506-84063dc8e45c", + "key": "86f8cc3a-56b1-4489-8506-84063dc8e45c", + "label": "Kef_143(2020) metadata", + "value": "26221" + }, + { + "description": "Jurisdiction Metadata for Kef_229(2020) id d3449e10-20d9-4ca5-80b0-32134e9d7fb1", + "key": "d3449e10-20d9-4ca5-80b0-32134e9d7fb1", + "label": "Kef_229(2020) metadata", + "value": "26222" + }, + { + "description": "Jurisdiction Metadata for Kef_158(2020) id d3063218-139c-43af-a440-cbc0b3e0284d", + "key": "d3063218-139c-43af-a440-cbc0b3e0284d", + "label": "Kef_158(2020) metadata", + "value": "26223" + }, + { + "description": "Jurisdiction Metadata for Kef_40(2020) id a6b83cf7-1d9a-4e72-9241-dc33a57f0fb4", + "key": "a6b83cf7-1d9a-4e72-9241-dc33a57f0fb4", + "label": "Kef_40(2020) metadata", + "value": "26224" + }, + { + "description": "Jurisdiction Metadata for Kef_217(2020) id 847f4d98-2fdf-4fa3-8ad9-d789d5d68b9c", + "key": "847f4d98-2fdf-4fa3-8ad9-d789d5d68b9c", + "label": "Kef_217(2020) metadata", + "value": "26225" + }, + { + "description": "Jurisdiction Metadata for Kef_176(2020) id 5efa6b19-3131-46b2-8c67-8ee9e86eb703", + "key": "5efa6b19-3131-46b2-8c67-8ee9e86eb703", + "label": "Kef_176(2020) metadata", + "value": "26226" + }, + { + "description": "Jurisdiction Metadata for Kef_169(2020) id 8db34c1b-596d-448e-8511-bfa4ac6bb283", + "key": "8db34c1b-596d-448e-8511-bfa4ac6bb283", + "label": "Kef_169(2020) metadata", + "value": "26227" + }, + { + "description": "Jurisdiction Metadata for Kef_161(2020) id dc736063-607a-4a97-94d1-40426e959024", + "key": "dc736063-607a-4a97-94d1-40426e959024", + "label": "Kef_161(2020) metadata", + "value": "26228" + }, + { + "description": "Jurisdiction Metadata for Kef_192(2020) id 26d36a7d-1cc8-4767-b11d-2ef346daaec9", + "key": "26d36a7d-1cc8-4767-b11d-2ef346daaec9", + "label": "Kef_192(2020) metadata", + "value": "26229" + }, + { + "description": "Jurisdiction Metadata for Kef_213(2020) id 91241062-4867-4011-88c2-b5626397c99a", + "key": "91241062-4867-4011-88c2-b5626397c99a", + "label": "Kef_213(2020) metadata", + "value": "26230" + }, + { + "description": "Jurisdiction Metadata for Kef_114(2020) id ccf617c7-d8ea-4d4c-9483-6eb7aedef8fd", + "key": "ccf617c7-d8ea-4d4c-9483-6eb7aedef8fd", + "label": "Kef_114(2020) metadata", + "value": "26231" + }, + { + "description": "Jurisdiction Metadata for Kef_90(2020) id 89eba760-121f-4fa9-9c6a-2421fc42bc89", + "key": "89eba760-121f-4fa9-9c6a-2421fc42bc89", + "label": "Kef_90(2020) metadata", + "value": "26232" + }, + { + "description": "Jurisdiction Metadata for Kef_171(2020) id a6e539ab-903c-4632-b107-5742690527d3", + "key": "a6e539ab-903c-4632-b107-5742690527d3", + "label": "Kef_171(2020) metadata", + "value": "26233" + }, + { + "description": "Jurisdiction Metadata for Kef_101(2020) id 40f3213a-54c7-4b3e-a56f-cbaf47e75f10", + "key": "40f3213a-54c7-4b3e-a56f-cbaf47e75f10", + "label": "Kef_101(2020) metadata", + "value": "26234" + }, + { + "description": "Jurisdiction Metadata for Kef_193(2020) id 567a8fa4-85ec-451c-8696-c73fa9fdaf84", + "key": "567a8fa4-85ec-451c-8696-c73fa9fdaf84", + "label": "Kef_193(2020) metadata", + "value": "26235" + }, + { + "description": "Jurisdiction Metadata for Kef_124(2020) id 34dd11fd-2d1f-4866-9c82-5f28c4aa5b18", + "key": "34dd11fd-2d1f-4866-9c82-5f28c4aa5b18", + "label": "Kef_124(2020) metadata", + "value": "26236" + }, + { + "description": "Jurisdiction Metadata for Kef_222(2020) id ad22c152-d744-4521-a047-58833f28aa45", + "key": "ad22c152-d744-4521-a047-58833f28aa45", + "label": "Kef_222(2020) metadata", + "value": "26237" + }, + { + "description": "Jurisdiction Metadata for Kef_112(2020) id 33791ff7-b572-4ea7-b0c3-0da802b293b2", + "key": "33791ff7-b572-4ea7-b0c3-0da802b293b2", + "label": "Kef_112(2020) metadata", + "value": "26238" + }, + { + "description": "Jurisdiction Metadata for Kef_121(2020) id 830da69c-d99b-460e-bfd5-cd6ba0335f10", + "key": "830da69c-d99b-460e-bfd5-cd6ba0335f10", + "label": "Kef_121(2020) metadata", + "value": "26239" + }, + { + "description": "Jurisdiction Metadata for Kef_50(2020) id 4995cb94-d1b4-4fe9-aa22-a0a0b7f22663", + "key": "4995cb94-d1b4-4fe9-aa22-a0a0b7f22663", + "label": "Kef_50(2020) metadata", + "value": "26240" + }, + { + "description": "Jurisdiction Metadata for Kef_144(2020) id cb9a6c66-e256-4c2e-a376-975a84d907c4", + "key": "cb9a6c66-e256-4c2e-a376-975a84d907c4", + "label": "Kef_144(2020) metadata", + "value": "26241" + }, + { + "description": "Jurisdiction Metadata for Kef_167(2020) id 0296e82e-ea28-4353-8160-898b8e3ed9c5", + "key": "0296e82e-ea28-4353-8160-898b8e3ed9c5", + "label": "Kef_167(2020) metadata", + "value": "26242" + }, + { + "description": "Jurisdiction Metadata for Kef_88(2020) id 409e9b0f-dc2c-49e5-bb67-dedfb2387b31", + "key": "409e9b0f-dc2c-49e5-bb67-dedfb2387b31", + "label": "Kef_88(2020) metadata", + "value": "26243" + }, + { + "description": "Jurisdiction Metadata for Kef_98(2020) id d197fc7d-1b3e-44c3-a571-8cf0989b9f8f", + "key": "d197fc7d-1b3e-44c3-a571-8cf0989b9f8f", + "label": "Kef_98(2020) metadata", + "value": "26244" + }, + { + "description": "Jurisdiction Metadata for Kef_52(2020) id 9d2b0a18-51c6-483c-b11a-fb7bcebb6cc1", + "key": "9d2b0a18-51c6-483c-b11a-fb7bcebb6cc1", + "label": "Kef_52(2020) metadata", + "value": "26245" + }, + { + "description": "Jurisdiction Metadata for Kef_230(2020) id 11198eb2-81bc-401f-827d-4c79e5f431e0", + "key": "11198eb2-81bc-401f-827d-4c79e5f431e0", + "label": "Kef_230(2020) metadata", + "value": "26246" + }, + { + "description": "Jurisdiction Metadata for Kef_136(2020) id 3d18eb42-0e62-430f-aaf4-dd0f99524133", + "key": "3d18eb42-0e62-430f-aaf4-dd0f99524133", + "label": "Kef_136(2020) metadata", + "value": "26247" + }, + { + "description": "Jurisdiction Metadata for Kef_46(2020) id 1dbb9f48-84aa-48b0-a232-d059bda48703", + "key": "1dbb9f48-84aa-48b0-a232-d059bda48703", + "label": "Kef_46(2020) metadata", + "value": "26248" + }, + { + "description": "Jurisdiction Metadata for Kef_201(2020) id 358dc154-a585-43e1-a333-65b0292a0414", + "key": "358dc154-a585-43e1-a333-65b0292a0414", + "label": "Kef_201(2020) metadata", + "value": "26249" + }, + { + "description": "Jurisdiction Metadata for Kef_160(2020) id 809be683-902d-40a0-b987-51582a00bc5c", + "key": "809be683-902d-40a0-b987-51582a00bc5c", + "label": "Kef_160(2020) metadata", + "value": "26250" + }, + { + "description": "Jurisdiction Metadata for Kef_157(2020) id 744b5ed9-7ae1-4f36-97e2-04f8a563f937", + "key": "744b5ed9-7ae1-4f36-97e2-04f8a563f937", + "label": "Kef_157(2020) metadata", + "value": "26251" + }, + { + "description": "Jurisdiction Metadata for Kef_214(2020) id 871a4470-b298-467c-9415-12056963ec80", + "key": "871a4470-b298-467c-9415-12056963ec80", + "label": "Kef_214(2020) metadata", + "value": "26252" + }, + { + "description": "Jurisdiction Metadata for Kef_191(2020) id 8ae41bf2-f1bb-4387-89c5-07de683d6425", + "key": "8ae41bf2-f1bb-4387-89c5-07de683d6425", + "label": "Kef_191(2020) metadata", + "value": "26253" + }, + { + "description": "Jurisdiction Metadata for Kef_134(2020) id 79d98bc9-c8fc-476b-8189-e42aef1b53c0", + "key": "79d98bc9-c8fc-476b-8189-e42aef1b53c0", + "label": "Kef_134(2020) metadata", + "value": "26254" + }, + { + "description": "Jurisdiction Metadata for Kef_205(2020) id 41136272-883f-49df-adcf-c5310157797e", + "key": "41136272-883f-49df-adcf-c5310157797e", + "label": "Kef_205(2020) metadata", + "value": "26255" + }, + { + "description": "Jurisdiction Metadata for Kef_220(2020) id 1156891c-f332-4423-aa3b-39c1f23924bb", + "key": "1156891c-f332-4423-aa3b-39c1f23924bb", + "label": "Kef_220(2020) metadata", + "value": "26256" + }, + { + "description": "Jurisdiction Metadata for Kef_37(2020) id f9a91931-e22d-4aea-ab6e-fe72404f658c", + "key": "f9a91931-e22d-4aea-ab6e-fe72404f658c", + "label": "Kef_37(2020) metadata", + "value": "26257" + }, + { + "description": "Jurisdiction Metadata for Kef_69(2020) id 89576bd3-7e05-46a3-bab5-3e8f292d45de", + "key": "89576bd3-7e05-46a3-bab5-3e8f292d45de", + "label": "Kef_69(2020) metadata", + "value": "26258" + }, + { + "description": "Jurisdiction Metadata for Kef_135(2020) id 44c559ef-8777-4a44-8aa4-d25713b61802", + "key": "44c559ef-8777-4a44-8aa4-d25713b61802", + "label": "Kef_135(2020) metadata", + "value": "26259" + }, + { + "description": "Jurisdiction Metadata for Kef_162(2020) id c896170e-e508-44db-8463-ececcff1e88f", + "key": "c896170e-e508-44db-8463-ececcff1e88f", + "label": "Kef_162(2020) metadata", + "value": "26260" + }, + { + "description": "Jurisdiction Metadata for Kef_108(2020) id 022eacb3-fd46-473a-a881-a2c54c6b2aed", + "key": "022eacb3-fd46-473a-a881-a2c54c6b2aed", + "label": "Kef_108(2020) metadata", + "value": "26261" + }, + { + "description": "Jurisdiction Metadata for Kef_81(2020) id c6329de8-e5fb-479c-832e-ca666c657694", + "key": "c6329de8-e5fb-479c-832e-ca666c657694", + "label": "Kef_81(2020) metadata", + "value": "26262" + }, + { + "description": "Jurisdiction Metadata for Kef_35(2020) id 534a0e85-60bc-4145-910e-23e6be5c0421", + "key": "534a0e85-60bc-4145-910e-23e6be5c0421", + "label": "Kef_35(2020) metadata", + "value": "26263" + }, + { + "description": "Jurisdiction Metadata for Kef_210(2020) id 16f86265-5fd5-437c-981c-dd1c5bd0a1ba", + "key": "16f86265-5fd5-437c-981c-dd1c5bd0a1ba", + "label": "Kef_210(2020) metadata", + "value": "26264" + }, + { + "description": "Jurisdiction Metadata for Kef_227(2020) id 8461f2b6-fa7c-4c64-b433-e98ba87cde57", + "key": "8461f2b6-fa7c-4c64-b433-e98ba87cde57", + "label": "Kef_227(2020) metadata", + "value": "26265" + }, + { + "description": "Jurisdiction Metadata for Kef_74(2020) id c5d47e85-4695-414d-85e6-650a29987434", + "key": "c5d47e85-4695-414d-85e6-650a29987434", + "label": "Kef_74(2020) metadata", + "value": "26266" + }, + { + "description": "Jurisdiction Metadata for Kef_196(2020) id 2264726a-a4b6-4a2f-8bca-f37d9c2c7f84", + "key": "2264726a-a4b6-4a2f-8bca-f37d9c2c7f84", + "label": "Kef_196(2020) metadata", + "value": "26267" + }, + { + "description": "Jurisdiction Metadata for Kef_15(2020) id 219daf09-cd6b-4b9b-a46c-072c4a2b3ca6", + "key": "219daf09-cd6b-4b9b-a46c-072c4a2b3ca6", + "label": "Kef_15(2020) metadata", + "value": "26268" + }, + { + "description": "Jurisdiction Metadata for Kef_209(2020) id 67693905-85da-4898-b8f0-9a3d9323d388", + "key": "67693905-85da-4898-b8f0-9a3d9323d388", + "label": "Kef_209(2020) metadata", + "value": "26269" + }, + { + "description": "Jurisdiction Metadata for Kef_80(2020) id 776782d8-52b4-416b-911f-8325bffd993f", + "key": "776782d8-52b4-416b-911f-8325bffd993f", + "label": "Kef_80(2020) metadata", + "value": "26270" + }, + { + "description": "Jurisdiction Metadata for Kef_75(2020) id bb3d7eb5-034a-46ae-a1de-294bb3156e2d", + "key": "bb3d7eb5-034a-46ae-a1de-294bb3156e2d", + "label": "Kef_75(2020) metadata", + "value": "26271" + }, + { + "description": "Jurisdiction Metadata for Kef_199(2020) id c6f646bb-e090-49f2-b9e4-55301d43ba95", + "key": "c6f646bb-e090-49f2-b9e4-55301d43ba95", + "label": "Kef_199(2020) metadata", + "value": "26272" + }, + { + "description": "Jurisdiction Metadata for Kef_175(2020) id 2346fcbf-1924-448d-918d-1b8aed2a4e4c", + "key": "2346fcbf-1924-448d-918d-1b8aed2a4e4c", + "label": "Kef_175(2020) metadata", + "value": "26273" + }, + { + "description": "Jurisdiction Metadata for Kef_73(2020) id f39e89a4-21a3-487b-b13a-efb0890323ab", + "key": "f39e89a4-21a3-487b-b13a-efb0890323ab", + "label": "Kef_73(2020) metadata", + "value": "26274" + }, + { + "description": "Jurisdiction Metadata for Kef_216(2020) id af710279-8ff3-4e13-bd04-76fff0136308", + "key": "af710279-8ff3-4e13-bd04-76fff0136308", + "label": "Kef_216(2020) metadata", + "value": "26275" + }, + { + "description": "Jurisdiction Metadata for Kef_178(2020) id 57d073b8-700b-47dc-a322-f3b0012aa83f", + "key": "57d073b8-700b-47dc-a322-f3b0012aa83f", + "label": "Kef_178(2020) metadata", + "value": "26276" + }, + { + "description": "Jurisdiction Metadata for Kef_110(2020) id 905536fe-6605-4de9-841a-db5774b36629", + "key": "905536fe-6605-4de9-841a-db5774b36629", + "label": "Kef_110(2020) metadata", + "value": "26277" + }, + { + "description": "Jurisdiction Metadata for Kef_94(2020) id e7a45b29-623d-46fc-bda4-c8c7a6538cc3", + "key": "e7a45b29-623d-46fc-bda4-c8c7a6538cc3", + "label": "Kef_94(2020) metadata", + "value": "26278" + }, + { + "description": "Jurisdiction Metadata for Kef_113(2020) id 89cd2d4a-8f5e-488d-8752-e57a9a4ec548", + "key": "89cd2d4a-8f5e-488d-8752-e57a9a4ec548", + "label": "Kef_113(2020) metadata", + "value": "26279" + }, + { + "description": "Jurisdiction Metadata for Kef_202(2020) id c345b830-ff0e-4d5a-8c90-bc625a30eb87", + "key": "c345b830-ff0e-4d5a-8c90-bc625a30eb87", + "label": "Kef_202(2020) metadata", + "value": "26280" + }, + { + "description": "Jurisdiction Metadata for Kef_204(2020) id 89f49e6a-8c4b-4acc-bf80-2c849abc888b", + "key": "89f49e6a-8c4b-4acc-bf80-2c849abc888b", + "label": "Kef_204(2020) metadata", + "value": "26281" + }, + { + "description": "Jurisdiction Metadata for Kanama id 4bd7ea22-2aa1-425d-af54-8a40ede0472d", + "key": "4bd7ea22-2aa1-425d-af54-8a40ede0472d", + "label": "Kanama metadata", + "value": "26282" + }, + { + "description": "Jurisdiction Metadata for Kef_5(2020) id 20ad9da2-e63d-4ed8-bc52-c50fc3e5a775", + "key": "20ad9da2-e63d-4ed8-bc52-c50fc3e5a775", + "label": "Kef_5(2020) metadata", + "value": "26283" + }, + { + "description": "Jurisdiction Metadata for Kapema id e3182417-adca-4a69-9a19-261fbbf9e172", + "key": "e3182417-adca-4a69-9a19-261fbbf9e172", + "label": "Kapema metadata", + "value": "26284" + }, + { + "description": "Jurisdiction Metadata for Kef_103(2020) id ce12a9fe-764d-457e-a45c-297ca14e896b", + "key": "ce12a9fe-764d-457e-a45c-297ca14e896b", + "label": "Kef_103(2020) metadata", + "value": "26285" + }, + { + "description": "Jurisdiction Metadata for Munkombwe id 9614c1ac-8947-48d2-bc18-43eae954cd73", + "key": "9614c1ac-8947-48d2-bc18-43eae954cd73", + "label": "Munkombwe metadata", + "value": "26286" + }, + { + "description": "Jurisdiction Metadata for Kef_14(2020) id 15162fb8-a49d-4e84-b688-28dd26624a2c", + "key": "15162fb8-a49d-4e84-b688-28dd26624a2c", + "label": "Kef_14(2020) metadata", + "value": "26287" + }, + { + "description": "Jurisdiction Metadata for Kef_117(2020) id 8deab913-9869-4f60-8067-3cc51365b08d", + "key": "8deab913-9869-4f60-8067-3cc51365b08d", + "label": "Kef_117(2020) metadata", + "value": "26288" + }, + { + "description": "Jurisdiction Metadata for Kef_141(2020) id 5960082a-f07d-4a51-84d6-c869ab74149b", + "key": "5960082a-f07d-4a51-84d6-c869ab74149b", + "label": "Kef_141(2020) metadata", + "value": "26289" + }, + { + "description": "Jurisdiction Metadata for Kef_184(2020) id b3f00c56-5d20-44be-81fe-b2942f26b10a", + "key": "b3f00c56-5d20-44be-81fe-b2942f26b10a", + "label": "Kef_184(2020) metadata", + "value": "26290" + }, + { + "description": "Jurisdiction Metadata for Kef_99(2020) id a5f7c810-cd7d-41b4-9b67-5fefedd788ee", + "key": "a5f7c810-cd7d-41b4-9b67-5fefedd788ee", + "label": "Kef_99(2020) metadata", + "value": "26291" + }, + { + "description": "Jurisdiction Metadata for Kef_116(2020) id c2c6e1fd-8256-44ba-b626-157d1fea3076", + "key": "c2c6e1fd-8256-44ba-b626-157d1fea3076", + "label": "Kef_116(2020) metadata", + "value": "26292" + }, + { + "description": "Jurisdiction Metadata for Kef_53(2020) id d8447317-af53-44a8-9e17-f6cf21bed67c", + "key": "d8447317-af53-44a8-9e17-f6cf21bed67c", + "label": "Kef_53(2020) metadata", + "value": "26293" + }, + { + "description": "Jurisdiction Metadata for Kef_29(2020) id 8e068b6d-fca4-42b5-aa50-46fb14b1aa5e", + "key": "8e068b6d-fca4-42b5-aa50-46fb14b1aa5e", + "label": "Kef_29(2020) metadata", + "value": "26294" + }, + { + "description": "Jurisdiction Metadata for Kef_183(2020) id fd904700-0457-48e3-9973-d028817bbcf4", + "key": "fd904700-0457-48e3-9973-d028817bbcf4", + "label": "Kef_183(2020) metadata", + "value": "26295" + }, + { + "description": "Jurisdiction Metadata for Kef_180(2020) id ce75a870-f6d1-41a6-8ce4-02692edf6095", + "key": "ce75a870-f6d1-41a6-8ce4-02692edf6095", + "label": "Kef_180(2020) metadata", + "value": "26296" + }, + { + "description": "Jurisdiction Metadata for Kef_137(2020) id e840b929-0beb-48b8-acc4-d823f65bfc71", + "key": "e840b929-0beb-48b8-acc4-d823f65bfc71", + "label": "Kef_137(2020) metadata", + "value": "26297" + }, + { + "description": "Jurisdiction Metadata for Kef_182(2020) id 685f2c10-d4a1-4df8-934f-4ef7cfe8cba8", + "key": "685f2c10-d4a1-4df8-934f-4ef7cfe8cba8", + "label": "Kef_182(2020) metadata", + "value": "26298" + }, + { + "description": "Jurisdiction Metadata for Kef_179(2020) id 2d90b121-24e0-4781-b715-ec2c2d01caa1", + "key": "2d90b121-24e0-4781-b715-ec2c2d01caa1", + "label": "Kef_179(2020) metadata", + "value": "26299" + }, + { + "description": "Jurisdiction Metadata for Kef_181(2020) id 51adaafd-dba7-4192-b43b-b6389e01be4e", + "key": "51adaafd-dba7-4192-b43b-b6389e01be4e", + "label": "Kef_181(2020) metadata", + "value": "26300" + }, + { + "description": "Jurisdiction Metadata for Kef_10(2020) id e1d38497-8c91-41fb-84e4-7047bf2ef5d0", + "key": "e1d38497-8c91-41fb-84e4-7047bf2ef5d0", + "label": "Kef_10(2020) metadata", + "value": "26301" + }, + { + "description": "Jurisdiction Metadata for Kef_61(2020) id 832b7ec0-9c4e-4c55-8e63-21dadcc7c129", + "key": "832b7ec0-9c4e-4c55-8e63-21dadcc7c129", + "label": "Kef_61(2020) metadata", + "value": "26302" + }, + { + "description": "Jurisdiction Metadata for Kef_28(2020) id 5400eecb-eca2-497a-8f5f-91f64ca129a0", + "key": "5400eecb-eca2-497a-8f5f-91f64ca129a0", + "label": "Kef_28(2020) metadata", + "value": "26303" + }, + { + "description": "Jurisdiction Metadata for Kef_72(2020) id 2487efe9-ffc5-4630-b614-1cd44eb6619e", + "key": "2487efe9-ffc5-4630-b614-1cd44eb6619e", + "label": "Kef_72(2020) metadata", + "value": "26304" + }, + { + "description": "Jurisdiction Metadata for Chilamba id 19789c34-9ace-4c95-9a38-1e8411dbc695", + "key": "19789c34-9ace-4c95-9a38-1e8411dbc695", + "label": "Chilamba metadata", + "value": "26305" + }, + { + "description": "Jurisdiction Metadata for Kef_228(2020) id 2dcef13f-ee24-4e1d-86ac-a83de6939dfe", + "key": "2dcef13f-ee24-4e1d-86ac-a83de6939dfe", + "label": "Kef_228(2020) metadata", + "value": "26306" + }, + { + "description": "Jurisdiction Metadata for Kef_45(2020) id 9c976640-1a96-4d5c-b8a5-3f968f5a98df", + "key": "9c976640-1a96-4d5c-b8a5-3f968f5a98df", + "label": "Kef_45(2020) metadata", + "value": "26307" + }, + { + "description": "Jurisdiction Metadata for Kef_22(2020) id 625be27e-c86e-4663-855d-216a88142022", + "key": "625be27e-c86e-4663-855d-216a88142022", + "label": "Kef_22(2020) metadata", + "value": "26308" + }, + { + "description": "Jurisdiction Metadata for Kef_13(2020) id 81d111b9-986f-45d8-8a3c-837a5baa166f", + "key": "81d111b9-986f-45d8-8a3c-837a5baa166f", + "label": "Kef_13(2020) metadata", + "value": "26309" + }, + { + "description": "Jurisdiction Metadata for Kilwa(2020) id be783669-c474-4c15-9ff2-c14c4c1c5668", + "key": "be783669-c474-4c15-9ff2-c14c4c1c5668", + "label": "Kilwa(2020) metadata", + "value": "26310" + }, + { + "description": "Jurisdiction Metadata for Nshimba Zone id d05b9d43-b439-429a-bb20-d0e37588ccd9", + "key": "d05b9d43-b439-429a-bb20-d0e37588ccd9", + "label": "Nshimba Zone metadata", + "value": "26311" + }, + { + "description": "Jurisdiction Metadata for kwa_1(2020) id a32e14d3-725d-40a9-b2cc-b62b51146592", + "key": "a32e14d3-725d-40a9-b2cc-b62b51146592", + "label": "kwa_1(2020) metadata", + "value": "26312" + }, + { + "description": "Jurisdiction Metadata for kwa_13(2020) id 4a779a6b-8851-4d55-9104-8bc112e689ef", + "key": "4a779a6b-8851-4d55-9104-8bc112e689ef", + "label": "kwa_13(2020) metadata", + "value": "26313" + }, + { + "description": "Jurisdiction Metadata for Chipuma Zone id e5df7898-78ad-4e4e-9786-43beca43b9db", + "key": "e5df7898-78ad-4e4e-9786-43beca43b9db", + "label": "Chipuma Zone metadata", + "value": "26314" + }, + { + "description": "Jurisdiction Metadata for kwa_8(2020) id 260484ee-965e-480b-ba3d-4e54c7ca6131", + "key": "260484ee-965e-480b-ba3d-4e54c7ca6131", + "label": "kwa_8(2020) metadata", + "value": "26315" + }, + { + "description": "Jurisdiction Metadata for Lukwesa Zone id 7a98f2b0-c2b8-48ea-8bc9-c25b692618f7", + "key": "7a98f2b0-c2b8-48ea-8bc9-c25b692618f7", + "label": "Lukwesa Zone metadata", + "value": "26316" + }, + { + "description": "Jurisdiction Metadata for kwa_3(2020) id 5d6ca2c3-3bd3-4d6c-9c04-25103bed64ae", + "key": "5d6ca2c3-3bd3-4d6c-9c04-25103bed64ae", + "label": "kwa_3(2020) metadata", + "value": "26317" + }, + { + "description": "Jurisdiction Metadata for Kapopolo Zone id 9f212ff5-26fd-4dc4-a39a-f1beb0cc319e", + "key": "9f212ff5-26fd-4dc4-a39a-f1beb0cc319e", + "label": "Kapopolo Zone metadata", + "value": "26318" + }, + { + "description": "Jurisdiction Metadata for kwa_9(2020) id 35b6763e-cce8-4a93-831f-f02a4dd3f9f9", + "key": "35b6763e-cce8-4a93-831f-f02a4dd3f9f9", + "label": "kwa_9(2020) metadata", + "value": "26319" + }, + { + "description": "Jurisdiction Metadata for Kasompe Zone id c87c2098-80c2-4da6-b807-dec546a725f1", + "key": "c87c2098-80c2-4da6-b807-dec546a725f1", + "label": "Kasompe Zone metadata", + "value": "26320" + }, + { + "description": "Jurisdiction Metadata for kwa_15(2020) id 78e7f56e-1b33-446c-afb8-48274d743208", + "key": "78e7f56e-1b33-446c-afb8-48274d743208", + "label": "kwa_15(2020) metadata", + "value": "26321" + }, + { + "description": "Jurisdiction Metadata for kwa_7(2020) id cc6ee92e-35e3-4b7a-b754-18853e01a3f5", + "key": "cc6ee92e-35e3-4b7a-b754-18853e01a3f5", + "label": "kwa_7(2020) metadata", + "value": "26322" + }, + { + "description": "Jurisdiction Metadata for Chisukulu Zone id b9e858e6-dbb0-4140-9afa-891faf2a8d1b", + "key": "b9e858e6-dbb0-4140-9afa-891faf2a8d1b", + "label": "Chisukulu Zone metadata", + "value": "26323" + }, + { + "description": "Jurisdiction Metadata for kwa_11(2020) id 272633ba-8380-4cb6-a9b9-5eef89bbf3b5", + "key": "272633ba-8380-4cb6-a9b9-5eef89bbf3b5", + "label": "kwa_11(2020) metadata", + "value": "26324" + }, + { + "description": "Jurisdiction Metadata for kwa_10(2020) id d7ca5c26-630f-4f85-a995-ddd1424fe66d", + "key": "d7ca5c26-630f-4f85-a995-ddd1424fe66d", + "label": "kwa_10(2020) metadata", + "value": "26325" + }, + { + "description": "Jurisdiction Metadata for kwa_18(2020) id b809df6a-ce1b-432c-8396-16eb2a7c041f", + "key": "b809df6a-ce1b-432c-8396-16eb2a7c041f", + "label": "kwa_18(2020) metadata", + "value": "26326" + }, + { + "description": "Jurisdiction Metadata for Kabake Zone id e39cb2fc-ff5c-4aea-8fd8-3247db88b707", + "key": "e39cb2fc-ff5c-4aea-8fd8-3247db88b707", + "label": "Kabake Zone metadata", + "value": "26327" + }, + { + "description": "Jurisdiction Metadata for Fyombwe Zone id 82acfe92-1083-47fd-8888-64c2b9d51df7", + "key": "82acfe92-1083-47fd-8888-64c2b9d51df7", + "label": "Fyombwe Zone metadata", + "value": "26328" + }, + { + "description": "Jurisdiction Metadata for kwa_12(2020) id 69b885bb-ca56-4915-94b6-116be58f63a9", + "key": "69b885bb-ca56-4915-94b6-116be58f63a9", + "label": "kwa_12(2020) metadata", + "value": "26329" + }, + { + "description": "Jurisdiction Metadata for kwa_16(2020) id a17e289a-8967-4776-a14c-3c5f5c831a6b", + "key": "a17e289a-8967-4776-a14c-3c5f5c831a6b", + "label": "kwa_16(2020) metadata", + "value": "26330" + }, + { + "description": "Jurisdiction Metadata for Bwaya Zone id aee7d960-f769-4c47-b39e-b732f69e6cff", + "key": "aee7d960-f769-4c47-b39e-b732f69e6cff", + "label": "Bwaya Zone metadata", + "value": "26331" + }, + { + "description": "Jurisdiction Metadata for kwa_6(2020) id c078eb27-4d30-4047-88a1-a1883b965336", + "key": "c078eb27-4d30-4047-88a1-a1883b965336", + "label": "kwa_6(2020) metadata", + "value": "26332" + }, + { + "description": "Jurisdiction Metadata for Kabake Zone id 95cb74a6-8f55-4897-84bb-4562a8a41f44", + "key": "95cb74a6-8f55-4897-84bb-4562a8a41f44", + "label": "Kabake Zone metadata", + "value": "26333" + }, + { + "description": "Jurisdiction Metadata for kwa_4(2020) id fb17f4ce-83e3-4a45-9ea7-e3a63522b126", + "key": "fb17f4ce-83e3-4a45-9ea7-e3a63522b126", + "label": "kwa_4(2020) metadata", + "value": "26334" + }, + { + "description": "Jurisdiction Metadata for kwa_5(2020) id 99279b17-347b-40f2-874e-4f7ef7cc6efa", + "key": "99279b17-347b-40f2-874e-4f7ef7cc6efa", + "label": "kwa_5(2020) metadata", + "value": "26335" + }, + { + "description": "Jurisdiction Metadata for Chisamba Zone id 7e6b615c-8a67-4fcb-a4ca-32d3a237980d", + "key": "7e6b615c-8a67-4fcb-a4ca-32d3a237980d", + "label": "Chisamba Zone metadata", + "value": "26336" + }, + { + "description": "Jurisdiction Metadata for kwa_14(2020) id 7f775991-da86-4ac0-86bd-be7538392b12", + "key": "7f775991-da86-4ac0-86bd-be7538392b12", + "label": "kwa_14(2020) metadata", + "value": "26337" + }, + { + "description": "Jurisdiction Metadata for kwa_17(2020) id 66940473-eaa0-4792-a022-5a1699cf8044", + "key": "66940473-eaa0-4792-a022-5a1699cf8044", + "label": "kwa_17(2020) metadata", + "value": "26338" + }, + { + "description": "Jurisdiction Metadata for kwa_2(2020) id 1c3b382f-0f56-4a12-b035-c52d9dfc0674", + "key": "1c3b382f-0f56-4a12-b035-c52d9dfc0674", + "label": "kwa_2(2020) metadata", + "value": "26339" + }, + { + "description": "Jurisdiction Metadata for Nchelenge(2020) id 44359bdc-d74a-4a04-9e1c-1e52e6b9102d", + "key": "44359bdc-d74a-4a04-9e1c-1e52e6b9102d", + "label": "Nchelenge(2020) metadata", + "value": "26340" + }, + { + "description": "Jurisdiction Metadata for Boma Zone id f579a1f0-054b-42f2-aee3-956cd88e0fbe", + "key": "f579a1f0-054b-42f2-aee3-956cd88e0fbe", + "label": "Boma Zone metadata", + "value": "26341" + }, + { + "description": "Jurisdiction Metadata for nch_34(2020) id a1340657-4cc0-4edb-b282-12177b18cb29", + "key": "a1340657-4cc0-4edb-b282-12177b18cb29", + "label": "nch_34(2020) metadata", + "value": "26342" + }, + { + "description": "Jurisdiction Metadata for nch_9(2020) id 6876c2fe-c7ad-4dfc-b519-dbd28d63a5ae", + "key": "6876c2fe-c7ad-4dfc-b519-dbd28d63a5ae", + "label": "nch_9(2020) metadata", + "value": "26343" + }, + { + "description": "Jurisdiction Metadata for nch_4(2020) id 4e376312-860e-4961-bd69-2761483b9eed", + "key": "4e376312-860e-4961-bd69-2761483b9eed", + "label": "nch_4(2020) metadata", + "value": "26344" + }, + { + "description": "Jurisdiction Metadata for nch_75(2020) id 97d38a30-b6bd-47ae-bcd5-12e904a28cca", + "key": "97d38a30-b6bd-47ae-bcd5-12e904a28cca", + "label": "nch_75(2020) metadata", + "value": "26345" + }, + { + "description": "Jurisdiction Metadata for Mubamba Zone id 7782c472-d432-4463-829b-35bde5a22aa2", + "key": "7782c472-d432-4463-829b-35bde5a22aa2", + "label": "Mubamba Zone metadata", + "value": "26346" + }, + { + "description": "Jurisdiction Metadata for nch_1(2020) id 33a1577e-f0d4-415a-a2f7-e8a08cfb271f", + "key": "33a1577e-f0d4-415a-a2f7-e8a08cfb271f", + "label": "nch_1(2020) metadata", + "value": "26347" + }, + { + "description": "Jurisdiction Metadata for nch_3(2020) id f48bb965-0dbc-49c1-91e3-dcd6eeb21372", + "key": "f48bb965-0dbc-49c1-91e3-dcd6eeb21372", + "label": "nch_3(2020) metadata", + "value": "26348" + }, + { + "description": "Jurisdiction Metadata for Kamfembwa Zone id e566b569-c8e1-4cf8-ac42-f7c97e4717c2", + "key": "e566b569-c8e1-4cf8-ac42-f7c97e4717c2", + "label": "Kamfembwa Zone metadata", + "value": "26349" + }, + { + "description": "Jurisdiction Metadata for nch_77(2020) id bcbc077f-edda-4157-b747-0148b1f73ea0", + "key": "bcbc077f-edda-4157-b747-0148b1f73ea0", + "label": "nch_77(2020) metadata", + "value": "26350" + }, + { + "description": "Jurisdiction Metadata for nch_8(2020) id b49137d0-95f9-4c28-b968-8103632c61ef", + "key": "b49137d0-95f9-4c28-b968-8103632c61ef", + "label": "nch_8(2020) metadata", + "value": "26351" + }, + { + "description": "Jurisdiction Metadata for nch_2(2020) id 2ec0c8ce-7d0d-4312-bd20-f7da8b32725a", + "key": "2ec0c8ce-7d0d-4312-bd20-f7da8b32725a", + "label": "nch_2(2020) metadata", + "value": "26352" + }, + { + "description": "Jurisdiction Metadata for nch_5(2020) id bb1d1658-dd54-4909-9703-7421bb0cbf9f", + "key": "bb1d1658-dd54-4909-9703-7421bb0cbf9f", + "label": "nch_5(2020) metadata", + "value": "26353" + }, + { + "description": "Jurisdiction Metadata for Chilongo Zone id 713c3b32-341f-4108-a337-dd223df5b58c", + "key": "713c3b32-341f-4108-a337-dd223df5b58c", + "label": "Chilongo Zone metadata", + "value": "26354" + }, + { + "description": "Jurisdiction Metadata for nch_29(2020) id 5c428b11-b433-4d60-b9e4-b3356be8f5b5", + "key": "5c428b11-b433-4d60-b9e4-b3356be8f5b5", + "label": "nch_29(2020) metadata", + "value": "26355" + }, + { + "description": "Jurisdiction Metadata for nch_60(2020) id d701875b-7842-4f70-af51-ba81d238e84d", + "key": "d701875b-7842-4f70-af51-ba81d238e84d", + "label": "nch_60(2020) metadata", + "value": "26356" + }, + { + "description": "Jurisdiction Metadata for nch_30(2020) id d2e942bf-303a-4490-a830-bd9160697ad5", + "key": "d2e942bf-303a-4490-a830-bd9160697ad5", + "label": "nch_30(2020) metadata", + "value": "26357" + }, + { + "description": "Jurisdiction Metadata for nch_52(2020) id a47a48a7-08ab-4c3a-8131-65278a6bfd49", + "key": "a47a48a7-08ab-4c3a-8131-65278a6bfd49", + "label": "nch_52(2020) metadata", + "value": "26358" + }, + { + "description": "Jurisdiction Metadata for nch_25(2020) id b588ca19-a17a-40a1-8886-f8dd996b500f", + "key": "b588ca19-a17a-40a1-8886-f8dd996b500f", + "label": "nch_25(2020) metadata", + "value": "26359" + }, + { + "description": "Jurisdiction Metadata for nch_76(2020) id ca7f0e26-7a2d-48cd-9971-b056a7101333", + "key": "ca7f0e26-7a2d-48cd-9971-b056a7101333", + "label": "nch_76(2020) metadata", + "value": "26360" + }, + { + "description": "Jurisdiction Metadata for nch_31(2020) id 56c596c7-22bd-47ef-946f-137deb971a63", + "key": "56c596c7-22bd-47ef-946f-137deb971a63", + "label": "nch_31(2020) metadata", + "value": "26361" + }, + { + "description": "Jurisdiction Metadata for nch_10(2020) id 7d350c60-2613-422e-a116-e7fee5009004", + "key": "7d350c60-2613-422e-a116-e7fee5009004", + "label": "nch_10(2020) metadata", + "value": "26362" + }, + { + "description": "Jurisdiction Metadata for nch_74(2020) id ee91c608-59cc-46c8-b461-c23dcb9596f8", + "key": "ee91c608-59cc-46c8-b461-c23dcb9596f8", + "label": "nch_74(2020) metadata", + "value": "26363" + }, + { + "description": "Jurisdiction Metadata for nch_71(2020) id 337f7d74-1889-4cc3-a603-65c61ae6da5e", + "key": "337f7d74-1889-4cc3-a603-65c61ae6da5e", + "label": "nch_71(2020) metadata", + "value": "26364" + }, + { + "description": "Jurisdiction Metadata for nch_66(2020) id 132df99c-ce91-41ab-9690-7b1a2e487432", + "key": "132df99c-ce91-41ab-9690-7b1a2e487432", + "label": "nch_66(2020) metadata", + "value": "26365" + }, + { + "description": "Jurisdiction Metadata for nch_35(2020) id b264ff5c-8ffa-4b93-aae7-8434f9197c5d", + "key": "b264ff5c-8ffa-4b93-aae7-8434f9197c5d", + "label": "nch_35(2020) metadata", + "value": "26366" + }, + { + "description": "Jurisdiction Metadata for nch_41(2020) id f0b0dbeb-d7b9-4e32-be63-d96562c2c040", + "key": "f0b0dbeb-d7b9-4e32-be63-d96562c2c040", + "label": "nch_41(2020) metadata", + "value": "26367" + }, + { + "description": "Jurisdiction Metadata for nch_57(2020) id f3c872a3-063f-4a0d-af10-a5bf6c5872b7", + "key": "f3c872a3-063f-4a0d-af10-a5bf6c5872b7", + "label": "nch_57(2020) metadata", + "value": "26368" + }, + { + "description": "Jurisdiction Metadata for nch_22(2020) id 515c96c9-cc6b-404d-bc16-b2cbfe8eb174", + "key": "515c96c9-cc6b-404d-bc16-b2cbfe8eb174", + "label": "nch_22(2020) metadata", + "value": "26369" + }, + { + "description": "Jurisdiction Metadata for nch_68(2020) id 719d2348-9730-42e6-8cb4-a366ee5b345e", + "key": "719d2348-9730-42e6-8cb4-a366ee5b345e", + "label": "nch_68(2020) metadata", + "value": "26370" + }, + { + "description": "Jurisdiction Metadata for nch_12(2020) id 392ab686-a448-4fe3-b746-2cffc12666b2", + "key": "392ab686-a448-4fe3-b746-2cffc12666b2", + "label": "nch_12(2020) metadata", + "value": "26371" + }, + { + "description": "Jurisdiction Metadata for nch_72(2020) id 05f928c4-bb9d-4091-9f76-ad82eab7fcf3", + "key": "05f928c4-bb9d-4091-9f76-ad82eab7fcf3", + "label": "nch_72(2020) metadata", + "value": "26372" + }, + { + "description": "Jurisdiction Metadata for nch_45(2020) id 597ba053-2913-4c59-823e-3ed15ddbe00f", + "key": "597ba053-2913-4c59-823e-3ed15ddbe00f", + "label": "nch_45(2020) metadata", + "value": "26373" + }, + { + "description": "Jurisdiction Metadata for nch_69(2020) id db5063ce-d311-4a71-9757-b903bb2db0a7", + "key": "db5063ce-d311-4a71-9757-b903bb2db0a7", + "label": "nch_69(2020) metadata", + "value": "26374" + }, + { + "description": "Jurisdiction Metadata for nch_44(2020) id f168ce98-996a-4bd1-ab10-9237303712c6", + "key": "f168ce98-996a-4bd1-ab10-9237303712c6", + "label": "nch_44(2020) metadata", + "value": "26375" + }, + { + "description": "Jurisdiction Metadata for nch_49(2020) id 5f7a00df-82ab-4f53-babe-b3188d64ff64", + "key": "5f7a00df-82ab-4f53-babe-b3188d64ff64", + "label": "nch_49(2020) metadata", + "value": "26376" + }, + { + "description": "Jurisdiction Metadata for nch_51(2020) id f6886c9b-0316-4c71-82d7-e40593b82cbb", + "key": "f6886c9b-0316-4c71-82d7-e40593b82cbb", + "label": "nch_51(2020) metadata", + "value": "26377" + }, + { + "description": "Jurisdiction Metadata for nch_11(2020) id 64c73411-f199-4244-9898-ccd35244b947", + "key": "64c73411-f199-4244-9898-ccd35244b947", + "label": "nch_11(2020) metadata", + "value": "26378" + }, + { + "description": "Jurisdiction Metadata for nch_40(2020) id 1d97db30-0733-4c3d-8877-332c8b9cefb3", + "key": "1d97db30-0733-4c3d-8877-332c8b9cefb3", + "label": "nch_40(2020) metadata", + "value": "26379" + }, + { + "description": "Jurisdiction Metadata for nch_59(2020) id a3005a12-5ee8-4d92-bd64-8c0c00c8fec0", + "key": "a3005a12-5ee8-4d92-bd64-8c0c00c8fec0", + "label": "nch_59(2020) metadata", + "value": "26380" + }, + { + "description": "Jurisdiction Metadata for nch_43(2020) id 9437bc4f-d770-41b2-a16e-360580f4a4d9", + "key": "9437bc4f-d770-41b2-a16e-360580f4a4d9", + "label": "nch_43(2020) metadata", + "value": "26381" + }, + { + "description": "Jurisdiction Metadata for nch_14(2020) id 8b36b024-dd7e-4fe0-b497-337e6a6b7a18", + "key": "8b36b024-dd7e-4fe0-b497-337e6a6b7a18", + "label": "nch_14(2020) metadata", + "value": "26382" + }, + { + "description": "Jurisdiction Metadata for nch_21(2020) id 8f282732-75ce-4066-8936-06097a525268", + "key": "8f282732-75ce-4066-8936-06097a525268", + "label": "nch_21(2020) metadata", + "value": "26383" + }, + { + "description": "Jurisdiction Metadata for nch_65(2020) id fcc84697-e9dd-41d4-b58a-44483ff0efeb", + "key": "fcc84697-e9dd-41d4-b58a-44483ff0efeb", + "label": "nch_65(2020) metadata", + "value": "26384" + }, + { + "description": "Jurisdiction Metadata for nch_7(2020) id bb8c4fc4-064c-45ca-ad46-00f7d6495fce", + "key": "bb8c4fc4-064c-45ca-ad46-00f7d6495fce", + "label": "nch_7(2020) metadata", + "value": "26385" + }, + { + "description": "Jurisdiction Metadata for nch_81(2020) id 7e276616-a9be-4238-8764-085a6b3ef110", + "key": "7e276616-a9be-4238-8764-085a6b3ef110", + "label": "nch_81(2020) metadata", + "value": "26386" + }, + { + "description": "Jurisdiction Metadata for nch_20(2020) id 9482cc01-f8d7-4e5e-b121-0319a2a5279b", + "key": "9482cc01-f8d7-4e5e-b121-0319a2a5279b", + "label": "nch_20(2020) metadata", + "value": "26387" + }, + { + "description": "Jurisdiction Metadata for nch_15(2020) id 86f370c8-e53a-451f-9c2c-3ef7ee8a9629", + "key": "86f370c8-e53a-451f-9c2c-3ef7ee8a9629", + "label": "nch_15(2020) metadata", + "value": "26388" + }, + { + "description": "Jurisdiction Metadata for nch_61(2020) id 541e3b2c-5d79-4c15-b69b-8e93630c4a15", + "key": "541e3b2c-5d79-4c15-b69b-8e93630c4a15", + "label": "nch_61(2020) metadata", + "value": "26389" + }, + { + "description": "Jurisdiction Metadata for nch_86(2020) id 5246fc13-0277-4631-80f3-102d017d611e", + "key": "5246fc13-0277-4631-80f3-102d017d611e", + "label": "nch_86(2020) metadata", + "value": "26390" + }, + { + "description": "Jurisdiction Metadata for nch_16(2020) id c323ef8f-8b4a-4743-891b-b049921370cd", + "key": "c323ef8f-8b4a-4743-891b-b049921370cd", + "label": "nch_16(2020) metadata", + "value": "26391" + }, + { + "description": "Jurisdiction Metadata for nch_13(2020) id 1edc78e6-fa15-481e-97a0-b9cce331d7a5", + "key": "1edc78e6-fa15-481e-97a0-b9cce331d7a5", + "label": "nch_13(2020) metadata", + "value": "26392" + }, + { + "description": "Jurisdiction Metadata for nch_27(2020) id 35d52313-74f9-4e68-9986-1cd50c04bf9b", + "key": "35d52313-74f9-4e68-9986-1cd50c04bf9b", + "label": "nch_27(2020) metadata", + "value": "26393" + }, + { + "description": "Jurisdiction Metadata for nch_32(2020) id 934cd2f3-0e83-4374-b456-a622886b5545", + "key": "934cd2f3-0e83-4374-b456-a622886b5545", + "label": "nch_32(2020) metadata", + "value": "26394" + }, + { + "description": "Jurisdiction Metadata for nch_63(2020) id 3977cbdf-eba6-4c36-af30-0f15dc987d2e", + "key": "3977cbdf-eba6-4c36-af30-0f15dc987d2e", + "label": "nch_63(2020) metadata", + "value": "26395" + }, + { + "description": "Jurisdiction Metadata for nch_33(2020) id 11eb37e8-c956-4ed5-9929-d96e3d193ddb", + "key": "11eb37e8-c956-4ed5-9929-d96e3d193ddb", + "label": "nch_33(2020) metadata", + "value": "26396" + }, + { + "description": "Jurisdiction Metadata for nch_82(2020) id 57c75c39-84f1-4c5b-99b2-92cabe8ae492", + "key": "57c75c39-84f1-4c5b-99b2-92cabe8ae492", + "label": "nch_82(2020) metadata", + "value": "26397" + }, + { + "description": "Jurisdiction Metadata for nch_17(2020) id 57eb5fb6-32bd-4f53-ae75-0c2c1383f510", + "key": "57eb5fb6-32bd-4f53-ae75-0c2c1383f510", + "label": "nch_17(2020) metadata", + "value": "26398" + }, + { + "description": "Jurisdiction Metadata for nch_80(2020) id cc51f41b-d058-4923-95fa-e21df37cf522", + "key": "cc51f41b-d058-4923-95fa-e21df37cf522", + "label": "nch_80(2020) metadata", + "value": "26399" + }, + { + "description": "Jurisdiction Metadata for nch_56(2020) id 80e91345-da6f-4cac-8ef4-38e3a66105f3", + "key": "80e91345-da6f-4cac-8ef4-38e3a66105f3", + "label": "nch_56(2020) metadata", + "value": "26400" + }, + { + "description": "Jurisdiction Metadata for nch_38(2020) id 0ac9f38d-1a6a-40a2-8d32-cd6b5bc3c4ca", + "key": "0ac9f38d-1a6a-40a2-8d32-cd6b5bc3c4ca", + "label": "nch_38(2020) metadata", + "value": "26401" + }, + { + "description": "Jurisdiction Metadata for nch_84(2020) id 76ea44db-ef68-456f-9a96-c1634d54f214", + "key": "76ea44db-ef68-456f-9a96-c1634d54f214", + "label": "nch_84(2020) metadata", + "value": "26402" + }, + { + "description": "Jurisdiction Metadata for nch_26(2020) id a949cf3b-286e-4cfd-9ec2-ff5b241103a0", + "key": "a949cf3b-286e-4cfd-9ec2-ff5b241103a0", + "label": "nch_26(2020) metadata", + "value": "26403" + }, + { + "description": "Jurisdiction Metadata for nch_70(2020) id b50716c6-9c8b-4eca-8316-1393abba891f", + "key": "b50716c6-9c8b-4eca-8316-1393abba891f", + "label": "nch_70(2020) metadata", + "value": "26404" + }, + { + "description": "Jurisdiction Metadata for nch_39(2020) id e3b9decd-982b-4e8b-a585-635d3c987de8", + "key": "e3b9decd-982b-4e8b-a585-635d3c987de8", + "label": "nch_39(2020) metadata", + "value": "26405" + }, + { + "description": "Jurisdiction Metadata for nch_85(2020) id e0ed129f-aefe-4aa0-8da7-49414293346a", + "key": "e0ed129f-aefe-4aa0-8da7-49414293346a", + "label": "nch_85(2020) metadata", + "value": "26406" + }, + { + "description": "Jurisdiction Metadata for nch_37(2020) id 1c901f54-0156-4c38-8c57-ec9878cd00c8", + "key": "1c901f54-0156-4c38-8c57-ec9878cd00c8", + "label": "nch_37(2020) metadata", + "value": "26407" + }, + { + "description": "Jurisdiction Metadata for nch_36(2020) id aaadf5ac-ee5c-476a-9121-cdd95da2929e", + "key": "aaadf5ac-ee5c-476a-9121-cdd95da2929e", + "label": "nch_36(2020) metadata", + "value": "26408" + }, + { + "description": "Jurisdiction Metadata for nch_62(2020) id 57a77867-e8c3-401d-bf1a-6e76d5f73c71", + "key": "57a77867-e8c3-401d-bf1a-6e76d5f73c71", + "label": "nch_62(2020) metadata", + "value": "26409" + }, + { + "description": "Jurisdiction Metadata for nch_87(2020) id 94c0ffaa-1d5a-47b0-b7d7-95fe8ca0b12a", + "key": "94c0ffaa-1d5a-47b0-b7d7-95fe8ca0b12a", + "label": "nch_87(2020) metadata", + "value": "26410" + }, + { + "description": "Jurisdiction Metadata for nch_55(2020) id 0fa2cf3a-6c1d-4bad-a998-c3d089cc0232", + "key": "0fa2cf3a-6c1d-4bad-a998-c3d089cc0232", + "label": "nch_55(2020) metadata", + "value": "26411" + }, + { + "description": "Jurisdiction Metadata for nch_73(2020) id 230e67dc-a25f-4e23-8c77-74627b6e4bca", + "key": "230e67dc-a25f-4e23-8c77-74627b6e4bca", + "label": "nch_73(2020) metadata", + "value": "26412" + }, + { + "description": "Jurisdiction Metadata for nch_24(2020) id 5665bc18-a6cc-47f3-af77-232df6cb1f62", + "key": "5665bc18-a6cc-47f3-af77-232df6cb1f62", + "label": "nch_24(2020) metadata", + "value": "26413" + }, + { + "description": "Jurisdiction Metadata for nch_47(2020) id 92af91f5-6bd2-45a6-98b0-fae15daca446", + "key": "92af91f5-6bd2-45a6-98b0-fae15daca446", + "label": "nch_47(2020) metadata", + "value": "26414" + }, + { + "description": "Jurisdiction Metadata for nch_28(2020) id 4874e19d-37ab-4162-9ee6-835ba224edd0", + "key": "4874e19d-37ab-4162-9ee6-835ba224edd0", + "label": "nch_28(2020) metadata", + "value": "26415" + }, + { + "description": "Jurisdiction Metadata for nch_23(2020) id f77ae4b2-65d4-4cc5-a6a1-5671446a4174", + "key": "f77ae4b2-65d4-4cc5-a6a1-5671446a4174", + "label": "nch_23(2020) metadata", + "value": "26416" + }, + { + "description": "Jurisdiction Metadata for nch_54(2020) id f928f665-eeaf-422e-bb23-8d51d934573c", + "key": "f928f665-eeaf-422e-bb23-8d51d934573c", + "label": "nch_54(2020) metadata", + "value": "26417" + }, + { + "description": "Jurisdiction Metadata for nch_48(2020) id c62c4bb3-61c9-43bb-9fee-25d615e5d7e1", + "key": "c62c4bb3-61c9-43bb-9fee-25d615e5d7e1", + "label": "nch_48(2020) metadata", + "value": "26418" + }, + { + "description": "Jurisdiction Metadata for nch_46(2020) id 0efbad8f-910d-4713-a32b-ba67a4399aa7", + "key": "0efbad8f-910d-4713-a32b-ba67a4399aa7", + "label": "nch_46(2020) metadata", + "value": "26419" + }, + { + "description": "Jurisdiction Metadata for nch_83(2020) id 91622bf1-696f-4c7e-b6d6-59ad33f5701c", + "key": "91622bf1-696f-4c7e-b6d6-59ad33f5701c", + "label": "nch_83(2020) metadata", + "value": "26420" + }, + { + "description": "Jurisdiction Metadata for nch_79(2020) id 190e41fd-bf4a-4189-949c-85cd9c0f84bc", + "key": "190e41fd-bf4a-4189-949c-85cd9c0f84bc", + "label": "nch_79(2020) metadata", + "value": "26421" + }, + { + "description": "Jurisdiction Metadata for nch_53(2020) id b9ae4b08-2202-4063-8f11-176368709ebf", + "key": "b9ae4b08-2202-4063-8f11-176368709ebf", + "label": "nch_53(2020) metadata", + "value": "26422" + }, + { + "description": "Jurisdiction Metadata for nch_64(2020) id 859a4d2e-0d60-4e97-9f1d-1559b9cfecfa", + "key": "859a4d2e-0d60-4e97-9f1d-1559b9cfecfa", + "label": "nch_64(2020) metadata", + "value": "26423" + }, + { + "description": "Jurisdiction Metadata for nch_58(2020) id af137575-4afc-4a8d-87f9-8482afe2952b", + "key": "af137575-4afc-4a8d-87f9-8482afe2952b", + "label": "nch_58(2020) metadata", + "value": "26424" + }, + { + "description": "Jurisdiction Metadata for nch_50(2020) id 92e0ac5b-de6e-438c-a6fb-75d67b901e72", + "key": "92e0ac5b-de6e-438c-a6fb-75d67b901e72", + "label": "nch_50(2020) metadata", + "value": "26425" + }, + { + "description": "Jurisdiction Metadata for nch_67(2020) id 24b0ac21-06dc-4982-bea0-5feb7d490958", + "key": "24b0ac21-06dc-4982-bea0-5feb7d490958", + "label": "nch_67(2020) metadata", + "value": "26426" + }, + { + "description": "Jurisdiction Metadata for nch_19(2020) id 66c9bb9e-331e-44c5-84c0-fa4bf604e7eb", + "key": "66c9bb9e-331e-44c5-84c0-fa4bf604e7eb", + "label": "nch_19(2020) metadata", + "value": "26427" + }, + { + "description": "Jurisdiction Metadata for nch_6(2020) id a3a2444b-dfc6-4fa9-b5da-0d355b35f7c8", + "key": "a3a2444b-dfc6-4fa9-b5da-0d355b35f7c8", + "label": "nch_6(2020) metadata", + "value": "26428" + }, + { + "description": "Jurisdiction Metadata for nch_78(2020) id 612e30b7-23d3-4e1f-8357-42843b080b1a", + "key": "612e30b7-23d3-4e1f-8357-42843b080b1a", + "label": "nch_78(2020) metadata", + "value": "26429" + }, + { + "description": "Jurisdiction Metadata for nch_18(2020) id 9f8a40de-c7da-4417-a6ed-7dede2bb9746", + "key": "9f8a40de-c7da-4417-a6ed-7dede2bb9746", + "label": "nch_18(2020) metadata", + "value": "26430" + }, + { + "description": "Jurisdiction Metadata for nch_42(2020) id 68dcd5c3-6726-454d-a0bd-e2b7be70cc32", + "key": "68dcd5c3-6726-454d-a0bd-e2b7be70cc32", + "label": "nch_42(2020) metadata", + "value": "26431" + }, + { + "description": "Jurisdiction Metadata for Kambwali(2020) id 00d16a60-80b0-4fc1-9c87-9bff2efad72f", + "key": "00d16a60-80b0-4fc1-9c87-9bff2efad72f", + "label": "Kambwali(2020) metadata", + "value": "26432" + }, + { + "description": "Jurisdiction Metadata for Kapaya Zone id f35e15ab-383a-49cc-b0c2-fc9d1792492c", + "key": "f35e15ab-383a-49cc-b0c2-fc9d1792492c", + "label": "Kapaya Zone metadata", + "value": "26433" + }, + { + "description": "Jurisdiction Metadata for kmb_4(2020) id a9fe67d9-d445-4682-adb5-617518f1efa2", + "key": "a9fe67d9-d445-4682-adb5-617518f1efa2", + "label": "kmb_4(2020) metadata", + "value": "26434" + }, + { + "description": "Jurisdiction Metadata for Chimbofuma Zone id fe7445dd-0ade-4388-b4d4-492335c995e3", + "key": "fe7445dd-0ade-4388-b4d4-492335c995e3", + "label": "Chimbofuma Zone metadata", + "value": "26435" + }, + { + "description": "Jurisdiction Metadata for kmb_3(2020) id 06a2b4b8-8790-4017-80a4-cf482f9b469b", + "key": "06a2b4b8-8790-4017-80a4-cf482f9b469b", + "label": "kmb_3(2020) metadata", + "value": "26436" + }, + { + "description": "Jurisdiction Metadata for Kalimbwa id 28f7289e-26b1-4188-919a-7957a16b7ede", + "key": "28f7289e-26b1-4188-919a-7957a16b7ede", + "label": "Kalimbwa metadata", + "value": "26437" + }, + { + "description": "Jurisdiction Metadata for kmb_19(2020) id 870ff69d-c566-4b24-9954-1503f0310c69", + "key": "870ff69d-c566-4b24-9954-1503f0310c69", + "label": "kmb_19(2020) metadata", + "value": "26438" + }, + { + "description": "Jurisdiction Metadata for kmb_32(2020) id 11bfacf5-c32d-4d74-a64e-d45a0aa0e4c3", + "key": "11bfacf5-c32d-4d74-a64e-d45a0aa0e4c3", + "label": "kmb_32(2020) metadata", + "value": "26439" + }, + { + "description": "Jurisdiction Metadata for kmb_48(2020) id 2402da36-b177-4688-83da-d10d0e9435a2", + "key": "2402da36-b177-4688-83da-d10d0e9435a2", + "label": "kmb_48(2020) metadata", + "value": "26440" + }, + { + "description": "Jurisdiction Metadata for kmb_33(2020) id 976612b8-8fea-4b5c-89f3-73b615cf281a", + "key": "976612b8-8fea-4b5c-89f3-73b615cf281a", + "label": "kmb_33(2020) metadata", + "value": "26441" + }, + { + "description": "Jurisdiction Metadata for kmb_39(2020) id e95108bc-e104-4be4-b52b-8bf7e132f75e", + "key": "e95108bc-e104-4be4-b52b-8bf7e132f75e", + "label": "kmb_39(2020) metadata", + "value": "26442" + }, + { + "description": "Jurisdiction Metadata for kmb_29(2020) id 2851d2db-b7d1-4a8b-8711-813727ed2754", + "key": "2851d2db-b7d1-4a8b-8711-813727ed2754", + "label": "kmb_29(2020) metadata", + "value": "26443" + }, + { + "description": "Jurisdiction Metadata for kmb_30(2020) id ca5c7c96-a052-4bfc-8262-a34b7bd8bc0a", + "key": "ca5c7c96-a052-4bfc-8262-a34b7bd8bc0a", + "label": "kmb_30(2020) metadata", + "value": "26444" + }, + { + "description": "Jurisdiction Metadata for kmb_26(2020) id 05c68781-f85b-46a8-b36a-e365019b340c", + "key": "05c68781-f85b-46a8-b36a-e365019b340c", + "label": "kmb_26(2020) metadata", + "value": "26445" + }, + { + "description": "Jurisdiction Metadata for kmb_55(2020) id 0c2079fd-6616-483c-9618-21335f27e3e4", + "key": "0c2079fd-6616-483c-9618-21335f27e3e4", + "label": "kmb_55(2020) metadata", + "value": "26446" + }, + { + "description": "Jurisdiction Metadata for kmb_31(2020) id ba3c0cba-30ca-48a9-9e4f-4f37fdbe1cbe", + "key": "ba3c0cba-30ca-48a9-9e4f-4f37fdbe1cbe", + "label": "kmb_31(2020) metadata", + "value": "26447" + }, + { + "description": "Jurisdiction Metadata for kmb_53(2020) id 1f64d240-2681-4eb2-aa27-84fe7642ed34", + "key": "1f64d240-2681-4eb2-aa27-84fe7642ed34", + "label": "kmb_53(2020) metadata", + "value": "26448" + }, + { + "description": "Jurisdiction Metadata for kmb_61(2020) id 5ac6c612-fa6b-4af6-9169-86b0912e4ed5", + "key": "5ac6c612-fa6b-4af6-9169-86b0912e4ed5", + "label": "kmb_61(2020) metadata", + "value": "26449" + }, + { + "description": "Jurisdiction Metadata for kmb_45(2020) id 06b6a184-ca81-4ded-9100-25d26369e0a2", + "key": "06b6a184-ca81-4ded-9100-25d26369e0a2", + "label": "kmb_45(2020) metadata", + "value": "26450" + }, + { + "description": "Jurisdiction Metadata for kmb_63(2020) id f0e0d169-3f65-428b-88a2-8054129d954e", + "key": "f0e0d169-3f65-428b-88a2-8054129d954e", + "label": "kmb_63(2020) metadata", + "value": "26451" + }, + { + "description": "Jurisdiction Metadata for kmb_28(2020) id 957b7278-899d-4963-97bf-38d73bf27faf", + "key": "957b7278-899d-4963-97bf-38d73bf27faf", + "label": "kmb_28(2020) metadata", + "value": "26452" + }, + { + "description": "Jurisdiction Metadata for kmb_64(2020) id 6177dd97-f602-403f-8958-e2f69c70aa83", + "key": "6177dd97-f602-403f-8958-e2f69c70aa83", + "label": "kmb_64(2020) metadata", + "value": "26453" + }, + { + "description": "Jurisdiction Metadata for kmb_36(2020) id 29906736-a383-4444-8bf2-09cb1c81cdd3", + "key": "29906736-a383-4444-8bf2-09cb1c81cdd3", + "label": "kmb_36(2020) metadata", + "value": "26454" + }, + { + "description": "Jurisdiction Metadata for kmb_51(2020) id ebbc56ae-281b-42ce-8bc5-60c109ecf266", + "key": "ebbc56ae-281b-42ce-8bc5-60c109ecf266", + "label": "kmb_51(2020) metadata", + "value": "26455" + }, + { + "description": "Jurisdiction Metadata for kmb_37(2020) id 3c800fc8-3179-455b-be00-340f2dfb5cbe", + "key": "3c800fc8-3179-455b-be00-340f2dfb5cbe", + "label": "kmb_37(2020) metadata", + "value": "26456" + }, + { + "description": "Jurisdiction Metadata for kmb_54(2020) id e2bbab1c-5a2b-4702-83cb-c1ac5d0102cb", + "key": "e2bbab1c-5a2b-4702-83cb-c1ac5d0102cb", + "label": "kmb_54(2020) metadata", + "value": "26457" + }, + { + "description": "Jurisdiction Metadata for kmb_44(2020) id 02df8e4b-2631-4e7b-9cf1-f563eddda7e7", + "key": "02df8e4b-2631-4e7b-9cf1-f563eddda7e7", + "label": "kmb_44(2020) metadata", + "value": "26458" + }, + { + "description": "Jurisdiction Metadata for kmb_46(2020) id 1abb72e9-660e-4953-9de1-5aefba7946b5", + "key": "1abb72e9-660e-4953-9de1-5aefba7946b5", + "label": "kmb_46(2020) metadata", + "value": "26459" + }, + { + "description": "Jurisdiction Metadata for kmb_49(2020) id 981fb803-cbec-4ce9-96e8-a6cbff6a2175", + "key": "981fb803-cbec-4ce9-96e8-a6cbff6a2175", + "label": "kmb_49(2020) metadata", + "value": "26460" + }, + { + "description": "Jurisdiction Metadata for kmb_15(2020) id 1bacb10f-18ca-4ae2-affc-8ccd569870c8", + "key": "1bacb10f-18ca-4ae2-affc-8ccd569870c8", + "label": "kmb_15(2020) metadata", + "value": "26461" + }, + { + "description": "Jurisdiction Metadata for kmb_68(2020) id 2553b23c-4240-4120-9981-813a279fd607", + "key": "2553b23c-4240-4120-9981-813a279fd607", + "label": "kmb_68(2020) metadata", + "value": "26462" + }, + { + "description": "Jurisdiction Metadata for kmb_43(2020) id 49572feb-375d-4619-8390-6f307a4bd906", + "key": "49572feb-375d-4619-8390-6f307a4bd906", + "label": "kmb_43(2020) metadata", + "value": "26463" + }, + { + "description": "Jurisdiction Metadata for kmb_34(2020) id 02749d65-4ca8-4ffd-94af-1e36c3304cb6", + "key": "02749d65-4ca8-4ffd-94af-1e36c3304cb6", + "label": "kmb_34(2020) metadata", + "value": "26464" + }, + { + "description": "Jurisdiction Metadata for kmb_14(2020) id fd75e721-3aab-4162-9218-d03457669066", + "key": "fd75e721-3aab-4162-9218-d03457669066", + "label": "kmb_14(2020) metadata", + "value": "26465" + }, + { + "description": "Jurisdiction Metadata for kmb_25(2020) id 0a54be3e-dc84-4143-bc80-d41edfbee029", + "key": "0a54be3e-dc84-4143-bc80-d41edfbee029", + "label": "kmb_25(2020) metadata", + "value": "26466" + }, + { + "description": "Jurisdiction Metadata for kmb_40(2020) id dd34fdd8-c894-4355-88c7-8930f51e517a", + "key": "dd34fdd8-c894-4355-88c7-8930f51e517a", + "label": "kmb_40(2020) metadata", + "value": "26467" + }, + { + "description": "Jurisdiction Metadata for kmb_50(2020) id f4ed6088-2ce8-417d-ae92-b6d78283e2e6", + "key": "f4ed6088-2ce8-417d-ae92-b6d78283e2e6", + "label": "kmb_50(2020) metadata", + "value": "26468" + }, + { + "description": "Jurisdiction Metadata for kmb_17(2020) id 88a91d4b-47fa-478c-ab2e-817a55e84065", + "key": "88a91d4b-47fa-478c-ab2e-817a55e84065", + "label": "kmb_17(2020) metadata", + "value": "26469" + }, + { + "description": "Jurisdiction Metadata for kmb_10(2020) id 4637582f-1413-45ec-a6fb-251cd3d26102", + "key": "4637582f-1413-45ec-a6fb-251cd3d26102", + "label": "kmb_10(2020) metadata", + "value": "26470" + }, + { + "description": "Jurisdiction Metadata for kmb_35(2020) id 574926fe-8c4c-4af2-9327-4263dca6ef2f", + "key": "574926fe-8c4c-4af2-9327-4263dca6ef2f", + "label": "kmb_35(2020) metadata", + "value": "26471" + }, + { + "description": "Jurisdiction Metadata for kmb_62(2020) id 0d86c858-756d-4cf8-add4-625863e6d13c", + "key": "0d86c858-756d-4cf8-add4-625863e6d13c", + "label": "kmb_62(2020) metadata", + "value": "26472" + }, + { + "description": "Jurisdiction Metadata for kmb_52(2020) id beb0f8ee-c66d-4692-8f34-03d5f4da2f56", + "key": "beb0f8ee-c66d-4692-8f34-03d5f4da2f56", + "label": "kmb_52(2020) metadata", + "value": "26473" + }, + { + "description": "Jurisdiction Metadata for kmb_47(2020) id e1640aac-c6f5-46c8-b836-145df7dee717", + "key": "e1640aac-c6f5-46c8-b836-145df7dee717", + "label": "kmb_47(2020) metadata", + "value": "26474" + }, + { + "description": "Jurisdiction Metadata for kmb_56(2020) id 2f80bd06-641e-4223-b24a-ccf5303cc3d0", + "key": "2f80bd06-641e-4223-b24a-ccf5303cc3d0", + "label": "kmb_56(2020) metadata", + "value": "26475" + }, + { + "description": "Jurisdiction Metadata for kmb_18(2020) id 74670e26-eadc-4ae5-b565-f47aee06f41e", + "key": "74670e26-eadc-4ae5-b565-f47aee06f41e", + "label": "kmb_18(2020) metadata", + "value": "26476" + }, + { + "description": "Jurisdiction Metadata for kmb_23(2020) id 1a8d18ba-791f-4de5-b4be-9b5619535d5c", + "key": "1a8d18ba-791f-4de5-b4be-9b5619535d5c", + "label": "kmb_23(2020) metadata", + "value": "26477" + }, + { + "description": "Jurisdiction Metadata for kmb_38(2020) id 7460b82f-3fe9-4150-82f6-64c06148294f", + "key": "7460b82f-3fe9-4150-82f6-64c06148294f", + "label": "kmb_38(2020) metadata", + "value": "26478" + }, + { + "description": "Jurisdiction Metadata for kmb_67(2020) id 0ef8bca0-b9cc-40c0-a06e-281be31764ee", + "key": "0ef8bca0-b9cc-40c0-a06e-281be31764ee", + "label": "kmb_67(2020) metadata", + "value": "26479" + }, + { + "description": "Jurisdiction Metadata for kmb_27(2020) id c2343d93-4ed4-417d-9e25-c525ce3596e7", + "key": "c2343d93-4ed4-417d-9e25-c525ce3596e7", + "label": "kmb_27(2020) metadata", + "value": "26480" + }, + { + "description": "Jurisdiction Metadata for kmb_65(2020) id 85fd9130-f431-4765-be5b-6cea9043eb05", + "key": "85fd9130-f431-4765-be5b-6cea9043eb05", + "label": "kmb_65(2020) metadata", + "value": "26481" + }, + { + "description": "Jurisdiction Metadata for kmb_70(2020) id 9bb13341-1c6e-45f9-8565-68a02a32892b", + "key": "9bb13341-1c6e-45f9-8565-68a02a32892b", + "label": "kmb_70(2020) metadata", + "value": "26482" + }, + { + "description": "Jurisdiction Metadata for kmb_21(2020) id b7caa0b2-4ea0-4768-961c-a53fb0c23bd2", + "key": "b7caa0b2-4ea0-4768-961c-a53fb0c23bd2", + "label": "kmb_21(2020) metadata", + "value": "26483" + }, + { + "description": "Jurisdiction Metadata for kmb_66(2020) id 962f6e11-f0c3-4182-8ba5-5815bb1003e6", + "key": "962f6e11-f0c3-4182-8ba5-5815bb1003e6", + "label": "kmb_66(2020) metadata", + "value": "26484" + }, + { + "description": "Jurisdiction Metadata for Lukanga Zone id 17e6b69a-e45b-4a98-93f2-84bc99250b56", + "key": "17e6b69a-e45b-4a98-93f2-84bc99250b56", + "label": "Lukanga Zone metadata", + "value": "26485" + }, + { + "description": "Jurisdiction Metadata for kmb_41(2020) id b4e5c328-8a6b-4bc9-877a-03b2ced35111", + "key": "b4e5c328-8a6b-4bc9-877a-03b2ced35111", + "label": "kmb_41(2020) metadata", + "value": "26486" + }, + { + "description": "Jurisdiction Metadata for kmb_24(2020) id 4bd11499-817d-4edb-9b80-8580a7c314b6", + "key": "4bd11499-817d-4edb-9b80-8580a7c314b6", + "label": "kmb_24(2020) metadata", + "value": "26487" + }, + { + "description": "Jurisdiction Metadata for kmb_1(2020) id 23da130a-255f-488c-a93d-4bdd776855e7", + "key": "23da130a-255f-488c-a93d-4bdd776855e7", + "label": "kmb_1(2020) metadata", + "value": "26488" + }, + { + "description": "Jurisdiction Metadata for kmb_9(2020) id 2104f6da-ff28-43ad-878c-a94b881ced34", + "key": "2104f6da-ff28-43ad-878c-a94b881ced34", + "label": "kmb_9(2020) metadata", + "value": "26489" + }, + { + "description": "Jurisdiction Metadata for Isokwe Zone id bb136f6b-70aa-462a-afd9-51325c6ae202", + "key": "bb136f6b-70aa-462a-afd9-51325c6ae202", + "label": "Isokwe Zone metadata", + "value": "26490" + }, + { + "description": "Jurisdiction Metadata for kmb_6(2020) id d151be38-b25c-4626-916b-4d118e19c066", + "key": "d151be38-b25c-4626-916b-4d118e19c066", + "label": "kmb_6(2020) metadata", + "value": "26491" + }, + { + "description": "Jurisdiction Metadata for kmb_60(2020) id 0902c635-b1b7-40be-84a7-100178f0a1e2", + "key": "0902c635-b1b7-40be-84a7-100178f0a1e2", + "label": "kmb_60(2020) metadata", + "value": "26492" + }, + { + "description": "Jurisdiction Metadata for kmb_20(2020) id ef29a5b6-2182-41f8-868c-492f17c7067b", + "key": "ef29a5b6-2182-41f8-868c-492f17c7067b", + "label": "kmb_20(2020) metadata", + "value": "26493" + }, + { + "description": "Jurisdiction Metadata for kmb_7(2020) id 1afe207d-38a6-43ce-8ab6-a7284f947de2", + "key": "1afe207d-38a6-43ce-8ab6-a7284f947de2", + "label": "kmb_7(2020) metadata", + "value": "26494" + }, + { + "description": "Jurisdiction Metadata for kmb_42(2020) id 0810882b-07d8-47a8-812b-36e45872b7c7", + "key": "0810882b-07d8-47a8-812b-36e45872b7c7", + "label": "kmb_42(2020) metadata", + "value": "26495" + }, + { + "description": "Jurisdiction Metadata for kmb_8(2020) id 4efa9d9b-9108-44e0-ab10-1b8b4564d186", + "key": "4efa9d9b-9108-44e0-ab10-1b8b4564d186", + "label": "kmb_8(2020) metadata", + "value": "26496" + }, + { + "description": "Jurisdiction Metadata for kmb_5(2020) id a595cf60-b856-4375-a4f0-449a5b6e82bc", + "key": "a595cf60-b856-4375-a4f0-449a5b6e82bc", + "label": "kmb_5(2020) metadata", + "value": "26497" + }, + { + "description": "Jurisdiction Metadata for Kasamba Zone id db2c1c5e-4676-4b74-97d9-db77bcd3f376", + "key": "db2c1c5e-4676-4b74-97d9-db77bcd3f376", + "label": "Kasamba Zone metadata", + "value": "26498" + }, + { + "description": "Jurisdiction Metadata for kmb_2(2020) id a3a66dce-eb7a-405a-b14c-0755db622947", + "key": "a3a66dce-eb7a-405a-b14c-0755db622947", + "label": "kmb_2(2020) metadata", + "value": "26499" + }, + { + "description": "Jurisdiction Metadata for kmb_57(2020) id e2705472-2f84-44d4-a7bb-c8a946db16fc", + "key": "e2705472-2f84-44d4-a7bb-c8a946db16fc", + "label": "kmb_57(2020) metadata", + "value": "26500" + }, + { + "description": "Jurisdiction Metadata for kmb_12(2020) id e08bc57e-9eca-4f75-805f-1ddde7bc85b1", + "key": "e08bc57e-9eca-4f75-805f-1ddde7bc85b1", + "label": "kmb_12(2020) metadata", + "value": "26501" + }, + { + "description": "Jurisdiction Metadata for kmb_22(2020) id 431b7eb1-0e22-4b07-8fa0-cfd6569e46db", + "key": "431b7eb1-0e22-4b07-8fa0-cfd6569e46db", + "label": "kmb_22(2020) metadata", + "value": "26502" + }, + { + "description": "Jurisdiction Metadata for kmb_16(2020) id 11dddbcb-ec88-4225-8f6c-000b6ed6f01c", + "key": "11dddbcb-ec88-4225-8f6c-000b6ed6f01c", + "label": "kmb_16(2020) metadata", + "value": "26503" + }, + { + "description": "Jurisdiction Metadata for kmb_13(2020) id 8dadcbea-c59b-4c50-8e21-776e29982768", + "key": "8dadcbea-c59b-4c50-8e21-776e29982768", + "label": "kmb_13(2020) metadata", + "value": "26504" + }, + { + "description": "Jurisdiction Metadata for kmb_58(2020) id c404ab50-f952-435a-89e9-5ebe49db7d99", + "key": "c404ab50-f952-435a-89e9-5ebe49db7d99", + "label": "kmb_58(2020) metadata", + "value": "26505" + }, + { + "description": "Jurisdiction Metadata for kmb_69(2020) id 94fc5d4f-fcf3-42e1-b6af-590206311469", + "key": "94fc5d4f-fcf3-42e1-b6af-590206311469", + "label": "kmb_69(2020) metadata", + "value": "26506" + }, + { + "description": "Jurisdiction Metadata for kmb_59(2020) id 0f34163c-eae7-4675-a115-c0cd9f471c3e", + "key": "0f34163c-eae7-4675-a115-c0cd9f471c3e", + "label": "kmb_59(2020) metadata", + "value": "26507" + }, + { + "description": "Jurisdiction Metadata for kmb_11(2020) id 69d22541-9281-4242-9356-49ff2bf341dd", + "key": "69d22541-9281-4242-9356-49ff2bf341dd", + "label": "kmb_11(2020) metadata", + "value": "26508" + }, + { + "description": "Jurisdiction Metadata for Chabilikila(2020) id fc5223eb-ddd5-44c7-a3b2-287e7660ea04", + "key": "fc5223eb-ddd5-44c7-a3b2-287e7660ea04", + "label": "Chabilikila(2020) metadata", + "value": "26509" + }, + { + "description": "Jurisdiction Metadata for Kashishi Zone id b671a16b-575c-41ca-acaf-2ca4c8b5ac6b", + "key": "b671a16b-575c-41ca-acaf-2ca4c8b5ac6b", + "label": "Kashishi Zone metadata", + "value": "26510" + }, + { + "description": "Jurisdiction Metadata for cbk_33(2020) id 18b5c8f2-c277-4128-90b5-0f5d27349657", + "key": "18b5c8f2-c277-4128-90b5-0f5d27349657", + "label": "cbk_33(2020) metadata", + "value": "26511" + }, + { + "description": "Jurisdiction Metadata for cbk_26(2020) id 0d658086-2ecc-4930-9b16-014ca7d49249", + "key": "0d658086-2ecc-4930-9b16-014ca7d49249", + "label": "cbk_26(2020) metadata", + "value": "26512" + }, + { + "description": "Jurisdiction Metadata for cbk_65(2020) id 02d619ca-0a4a-481a-9f36-7b4984978abf", + "key": "02d619ca-0a4a-481a-9f36-7b4984978abf", + "label": "cbk_65(2020) metadata", + "value": "26513" + }, + { + "description": "Jurisdiction Metadata for cbk_105(2020) id 91473ca1-972f-4f5d-a00a-e42868f9315a", + "key": "91473ca1-972f-4f5d-a00a-e42868f9315a", + "label": "cbk_105(2020) metadata", + "value": "26514" + }, + { + "description": "Jurisdiction Metadata for cbk_19(2020) id 4fdfb327-de80-466d-a4d7-02be960da2bd", + "key": "4fdfb327-de80-466d-a4d7-02be960da2bd", + "label": "cbk_19(2020) metadata", + "value": "26515" + }, + { + "description": "Jurisdiction Metadata for cbk_60(2020) id 22ccb3c5-c184-4d87-aee9-5b98b461bef7", + "key": "22ccb3c5-c184-4d87-aee9-5b98b461bef7", + "label": "cbk_60(2020) metadata", + "value": "26516" + }, + { + "description": "Jurisdiction Metadata for cbk_35(2020) id f9ff28b6-c632-46ce-857c-c4bae916b102", + "key": "f9ff28b6-c632-46ce-857c-c4bae916b102", + "label": "cbk_35(2020) metadata", + "value": "26517" + }, + { + "description": "Jurisdiction Metadata for cbk_86(2020) id 20b399aa-3bea-48b2-853c-a9c537c6d613", + "key": "20b399aa-3bea-48b2-853c-a9c537c6d613", + "label": "cbk_86(2020) metadata", + "value": "26518" + }, + { + "description": "Jurisdiction Metadata for cbk_48(2020) id 5bf56d5e-e96e-4a23-b02c-d1999d636e59", + "key": "5bf56d5e-e96e-4a23-b02c-d1999d636e59", + "label": "cbk_48(2020) metadata", + "value": "26519" + }, + { + "description": "Jurisdiction Metadata for Sikazwe Zone id 4b9a1310-76e4-4aa6-b232-9aef0a8590e1", + "key": "4b9a1310-76e4-4aa6-b232-9aef0a8590e1", + "label": "Sikazwe Zone metadata", + "value": "26520" + }, + { + "description": "Jurisdiction Metadata for cbk_95(2020) id 6ceb884f-4fc4-489e-a998-4932b40c829a", + "key": "6ceb884f-4fc4-489e-a998-4932b40c829a", + "label": "cbk_95(2020) metadata", + "value": "26521" + }, + { + "description": "Jurisdiction Metadata for cbk_70(2020) id 424dbe56-e4b3-400f-b8a6-34cca38d2e8f", + "key": "424dbe56-e4b3-400f-b8a6-34cca38d2e8f", + "label": "cbk_70(2020) metadata", + "value": "26522" + }, + { + "description": "Jurisdiction Metadata for cbk_93(2020) id bf0dafe8-4c5b-47f2-b99c-f6b6a2084f1a", + "key": "bf0dafe8-4c5b-47f2-b99c-f6b6a2084f1a", + "label": "cbk_93(2020) metadata", + "value": "26523" + }, + { + "description": "Jurisdiction Metadata for cbk_57(2020) id d5584ddf-fc64-4aa2-a7a5-5aeb1ac7f8e4", + "key": "d5584ddf-fc64-4aa2-a7a5-5aeb1ac7f8e4", + "label": "cbk_57(2020) metadata", + "value": "26524" + }, + { + "description": "Jurisdiction Metadata for cbk_92(2020) id d69dd328-8f14-40e2-9e55-ec6e00147339", + "key": "d69dd328-8f14-40e2-9e55-ec6e00147339", + "label": "cbk_92(2020) metadata", + "value": "26525" + }, + { + "description": "Jurisdiction Metadata for cbk_38(2020) id e0bf7368-0ba4-4eb7-bc71-528039d3db14", + "key": "e0bf7368-0ba4-4eb7-bc71-528039d3db14", + "label": "cbk_38(2020) metadata", + "value": "26526" + }, + { + "description": "Jurisdiction Metadata for cbk_9(2020) id 959cbe40-2ac6-407a-a62f-96ff2374b561", + "key": "959cbe40-2ac6-407a-a62f-96ff2374b561", + "label": "cbk_9(2020) metadata", + "value": "26527" + }, + { + "description": "Jurisdiction Metadata for cbk_53(2020) id c07240de-b5e8-4d69-9748-baa9bcf336cc", + "key": "c07240de-b5e8-4d69-9748-baa9bcf336cc", + "label": "cbk_53(2020) metadata", + "value": "26528" + }, + { + "description": "Jurisdiction Metadata for cbk_90(2020) id 8910ac4a-4289-418d-8ca9-65e11abb836d", + "key": "8910ac4a-4289-418d-8ca9-65e11abb836d", + "label": "cbk_90(2020) metadata", + "value": "26529" + }, + { + "description": "Jurisdiction Metadata for cbk_43(2020) id 651662a6-bd0d-4121-856c-d36a4dcc1212", + "key": "651662a6-bd0d-4121-856c-d36a4dcc1212", + "label": "cbk_43(2020) metadata", + "value": "26530" + }, + { + "description": "Jurisdiction Metadata for cbk_103(2020) id b2bd84c7-f21c-4f28-84a4-8d9f48d94105", + "key": "b2bd84c7-f21c-4f28-84a4-8d9f48d94105", + "label": "cbk_103(2020) metadata", + "value": "26531" + }, + { + "description": "Jurisdiction Metadata for cbk_50(2020) id 3eae824f-394d-4119-ade1-3ef0608d942d", + "key": "3eae824f-394d-4119-ade1-3ef0608d942d", + "label": "cbk_50(2020) metadata", + "value": "26532" + }, + { + "description": "Jurisdiction Metadata for cbk_40(2020) id 87e417f2-0180-4c8d-8e69-aa8ecab4ab54", + "key": "87e417f2-0180-4c8d-8e69-aa8ecab4ab54", + "label": "cbk_40(2020) metadata", + "value": "26533" + }, + { + "description": "Jurisdiction Metadata for cbk_85(2020) id 847d7bc3-7a1b-43ab-a9b1-a72d25fc172f", + "key": "847d7bc3-7a1b-43ab-a9b1-a72d25fc172f", + "label": "cbk_85(2020) metadata", + "value": "26534" + }, + { + "description": "Jurisdiction Metadata for chikutilwe Zone id 12692ecf-a6fd-477e-8c06-60deadd6f5ec", + "key": "12692ecf-a6fd-477e-8c06-60deadd6f5ec", + "label": "chikutilwe Zone metadata", + "value": "26535" + }, + { + "description": "Jurisdiction Metadata for cbk_41(2020) id cb08b396-c409-4ae2-ba33-e4a681c62f63", + "key": "cb08b396-c409-4ae2-ba33-e4a681c62f63", + "label": "cbk_41(2020) metadata", + "value": "26536" + }, + { + "description": "Jurisdiction Metadata for cbk_44(2020) id d2eac4ec-fed9-4735-bec4-0c17e2b12459", + "key": "d2eac4ec-fed9-4735-bec4-0c17e2b12459", + "label": "cbk_44(2020) metadata", + "value": "26537" + }, + { + "description": "Jurisdiction Metadata for cbk_29(2020) id 76105f44-0700-46ea-bdeb-178eb5b55c92", + "key": "76105f44-0700-46ea-bdeb-178eb5b55c92", + "label": "cbk_29(2020) metadata", + "value": "26538" + }, + { + "description": "Jurisdiction Metadata for cbk_97(2020) id 09e64cff-606a-49b6-bd8d-f4c19e45c803", + "key": "09e64cff-606a-49b6-bd8d-f4c19e45c803", + "label": "cbk_97(2020) metadata", + "value": "26539" + }, + { + "description": "Jurisdiction Metadata for cbk_20(2020) id ae9362fd-87b1-4aca-a29c-9bcbd4a07144", + "key": "ae9362fd-87b1-4aca-a29c-9bcbd4a07144", + "label": "cbk_20(2020) metadata", + "value": "26540" + }, + { + "description": "Jurisdiction Metadata for Chabilikila Zone id ca8d62fd-acec-4498-a041-03414c67efc8", + "key": "ca8d62fd-acec-4498-a041-03414c67efc8", + "label": "Chabilikila Zone metadata", + "value": "26541" + }, + { + "description": "Jurisdiction Metadata for cbk_5(2020) id 74c56c2d-b59b-49c0-89cb-c328ef409e50", + "key": "74c56c2d-b59b-49c0-89cb-c328ef409e50", + "label": "cbk_5(2020) metadata", + "value": "26542" + }, + { + "description": "Jurisdiction Metadata for MuKanso Zone id e3472ceb-55f0-4675-8568-49d4239fb94e", + "key": "e3472ceb-55f0-4675-8568-49d4239fb94e", + "label": "MuKanso Zone metadata", + "value": "26543" + }, + { + "description": "Jurisdiction Metadata for cbk_17(2020) id dde833ff-f816-49e2-9ba4-81838a5eacbf", + "key": "dde833ff-f816-49e2-9ba4-81838a5eacbf", + "label": "cbk_17(2020) metadata", + "value": "26544" + }, + { + "description": "Jurisdiction Metadata for cbk_4(2020) id a81c1446-9eba-4d33-bccb-a2eb2577376a", + "key": "a81c1446-9eba-4d33-bccb-a2eb2577376a", + "label": "cbk_4(2020) metadata", + "value": "26545" + }, + { + "description": "Jurisdiction Metadata for cbk_37(2020) id 58bda4a3-1017-4468-8d0f-60078f89d012", + "key": "58bda4a3-1017-4468-8d0f-60078f89d012", + "label": "cbk_37(2020) metadata", + "value": "26546" + }, + { + "description": "Jurisdiction Metadata for Kanwabatondo Zone id 5d423302-8850-46e4-bf4d-08df9f33f347", + "key": "5d423302-8850-46e4-bf4d-08df9f33f347", + "label": "Kanwabatondo Zone metadata", + "value": "26547" + }, + { + "description": "Jurisdiction Metadata for cbk_99(2020) id 7d3102dd-dd6a-4ebc-b0b9-334ca9489224", + "key": "7d3102dd-dd6a-4ebc-b0b9-334ca9489224", + "label": "cbk_99(2020) metadata", + "value": "26548" + }, + { + "description": "Jurisdiction Metadata for cbk_42(2020) id 6a661823-208c-4abd-b9f8-e40351a50e80", + "key": "6a661823-208c-4abd-b9f8-e40351a50e80", + "label": "cbk_42(2020) metadata", + "value": "26549" + }, + { + "description": "Jurisdiction Metadata for cbk_88(2020) id f0d2db60-fffb-4057-9873-16569882ed56", + "key": "f0d2db60-fffb-4057-9873-16569882ed56", + "label": "cbk_88(2020) metadata", + "value": "26550" + }, + { + "description": "Jurisdiction Metadata for cbk_32(2020) id d184ac9d-36ce-470d-b7cd-f0c602347f02", + "key": "d184ac9d-36ce-470d-b7cd-f0c602347f02", + "label": "cbk_32(2020) metadata", + "value": "26551" + }, + { + "description": "Jurisdiction Metadata for cbk_63(2020) id d3be8346-b0c5-4894-84d5-894be2061d9e", + "key": "d3be8346-b0c5-4894-84d5-894be2061d9e", + "label": "cbk_63(2020) metadata", + "value": "26552" + }, + { + "description": "Jurisdiction Metadata for cbk_46(2020) id 4b8b498c-51d2-433e-b1ae-fbf9796a3685", + "key": "4b8b498c-51d2-433e-b1ae-fbf9796a3685", + "label": "cbk_46(2020) metadata", + "value": "26553" + }, + { + "description": "Jurisdiction Metadata for cbk_78(2020) id e9242454-6c7e-413a-a3df-3c48ba0f3000", + "key": "e9242454-6c7e-413a-a3df-3c48ba0f3000", + "label": "cbk_78(2020) metadata", + "value": "26554" + }, + { + "description": "Jurisdiction Metadata for cbk_107(2020) id 74ed2420-1945-4ddf-b6ba-f2d8b6f42521", + "key": "74ed2420-1945-4ddf-b6ba-f2d8b6f42521", + "label": "cbk_107(2020) metadata", + "value": "26555" + }, + { + "description": "Jurisdiction Metadata for cbk_47(2020) id df199277-154c-4f17-8afe-5bd88a39d0dd", + "key": "df199277-154c-4f17-8afe-5bd88a39d0dd", + "label": "cbk_47(2020) metadata", + "value": "26556" + }, + { + "description": "Jurisdiction Metadata for cbk_81(2020) id 4e028650-9de0-4fde-a308-48380b868d2a", + "key": "4e028650-9de0-4fde-a308-48380b868d2a", + "label": "cbk_81(2020) metadata", + "value": "26557" + }, + { + "description": "Jurisdiction Metadata for cbk_24(2020) id cb5afbe2-2c8a-40f2-ae30-8c95dc1bc0e3", + "key": "cb5afbe2-2c8a-40f2-ae30-8c95dc1bc0e3", + "label": "cbk_24(2020) metadata", + "value": "26558" + }, + { + "description": "Jurisdiction Metadata for cbk_71(2020) id f2b2cc84-cfcf-4ea8-a342-c1908045d9e0", + "key": "f2b2cc84-cfcf-4ea8-a342-c1908045d9e0", + "label": "cbk_71(2020) metadata", + "value": "26559" + }, + { + "description": "Jurisdiction Metadata for cbk_45(2020) id 319f3744-77d2-4489-bdc8-666d72c3b98b", + "key": "319f3744-77d2-4489-bdc8-666d72c3b98b", + "label": "cbk_45(2020) metadata", + "value": "26560" + }, + { + "description": "Jurisdiction Metadata for cbk_74(2020) id 7827c0b4-706a-49a6-bd3f-abb18e46ef74", + "key": "7827c0b4-706a-49a6-bd3f-abb18e46ef74", + "label": "cbk_74(2020) metadata", + "value": "26561" + }, + { + "description": "Jurisdiction Metadata for cbk_52(2020) id 86d3dcf7-20fa-453e-8b6b-940e8fd505fc", + "key": "86d3dcf7-20fa-453e-8b6b-940e8fd505fc", + "label": "cbk_52(2020) metadata", + "value": "26562" + }, + { + "description": "Jurisdiction Metadata for cbk_104(2020) id 26732a17-8996-41e2-9a5d-927912121402", + "key": "26732a17-8996-41e2-9a5d-927912121402", + "label": "cbk_104(2020) metadata", + "value": "26563" + }, + { + "description": "Jurisdiction Metadata for cbk_3(2020) id c6db60c9-338a-4b96-b6d3-5c22626cbfa7", + "key": "c6db60c9-338a-4b96-b6d3-5c22626cbfa7", + "label": "cbk_3(2020) metadata", + "value": "26564" + }, + { + "description": "Jurisdiction Metadata for cbk_69(2020) id 7fbf6dab-e037-4af3-b7b2-f55017b02548", + "key": "7fbf6dab-e037-4af3-b7b2-f55017b02548", + "label": "cbk_69(2020) metadata", + "value": "26565" + }, + { + "description": "Jurisdiction Metadata for cbk_80(2020) id 32d56fb9-e351-4266-8654-429d221fdbf4", + "key": "32d56fb9-e351-4266-8654-429d221fdbf4", + "label": "cbk_80(2020) metadata", + "value": "26566" + }, + { + "description": "Jurisdiction Metadata for cbk_25(2020) id ac62e6f9-ae3d-4f62-be4e-0a41449dc281", + "key": "ac62e6f9-ae3d-4f62-be4e-0a41449dc281", + "label": "cbk_25(2020) metadata", + "value": "26567" + }, + { + "description": "Jurisdiction Metadata for cbk_68(2020) id 3e7a8a97-56bb-444f-84bb-9b24f2f23173", + "key": "3e7a8a97-56bb-444f-84bb-9b24f2f23173", + "label": "cbk_68(2020) metadata", + "value": "26568" + }, + { + "description": "Jurisdiction Metadata for cbk_91(2020) id 4bfdb8b9-8f1d-481d-8659-ccd03a6a07cb", + "key": "4bfdb8b9-8f1d-481d-8659-ccd03a6a07cb", + "label": "cbk_91(2020) metadata", + "value": "26569" + }, + { + "description": "Jurisdiction Metadata for cbk_21(2020) id 0cd8956e-5bfd-4bbf-9e89-a3394a4541c0", + "key": "0cd8956e-5bfd-4bbf-9e89-a3394a4541c0", + "label": "cbk_21(2020) metadata", + "value": "26570" + }, + { + "description": "Jurisdiction Metadata for cbk_12(2020) id fa131f94-67d6-4c36-aed9-984be5ef3301", + "key": "fa131f94-67d6-4c36-aed9-984be5ef3301", + "label": "cbk_12(2020) metadata", + "value": "26571" + }, + { + "description": "Jurisdiction Metadata for cbk_30(2020) id 2426ceea-e811-420a-a3b7-0b7d173d12d8", + "key": "2426ceea-e811-420a-a3b7-0b7d173d12d8", + "label": "cbk_30(2020) metadata", + "value": "26572" + }, + { + "description": "Jurisdiction Metadata for cbk_49(2020) id 414c14de-712b-4139-8fc7-b77a2fa7e3d8", + "key": "414c14de-712b-4139-8fc7-b77a2fa7e3d8", + "label": "cbk_49(2020) metadata", + "value": "26573" + }, + { + "description": "Jurisdiction Metadata for cbk_76(2020) id e54b9f10-83fe-4c53-bc0e-515e0780834c", + "key": "e54b9f10-83fe-4c53-bc0e-515e0780834c", + "label": "cbk_76(2020) metadata", + "value": "26574" + }, + { + "description": "Jurisdiction Metadata for cbk_39(2020) id 301e0d4f-f8da-47f9-a898-0e68306c3526", + "key": "301e0d4f-f8da-47f9-a898-0e68306c3526", + "label": "cbk_39(2020) metadata", + "value": "26575" + }, + { + "description": "Jurisdiction Metadata for cbk_14(2020) id d9a2be7f-f8b1-4f44-887b-f995b6017888", + "key": "d9a2be7f-f8b1-4f44-887b-f995b6017888", + "label": "cbk_14(2020) metadata", + "value": "26576" + }, + { + "description": "Jurisdiction Metadata for cbk_16(2020) id 0591c921-cdc4-40e1-9251-79cb68eb0716", + "key": "0591c921-cdc4-40e1-9251-79cb68eb0716", + "label": "cbk_16(2020) metadata", + "value": "26577" + }, + { + "description": "Jurisdiction Metadata for cbk_61(2020) id 10370483-b99b-4697-95a9-d1c4739ae5e7", + "key": "10370483-b99b-4697-95a9-d1c4739ae5e7", + "label": "cbk_61(2020) metadata", + "value": "26578" + }, + { + "description": "Jurisdiction Metadata for cbk_102(2020) id 4e17c1c4-2e52-4a7c-817f-bae84d1657d4", + "key": "4e17c1c4-2e52-4a7c-817f-bae84d1657d4", + "label": "cbk_102(2020) metadata", + "value": "26579" + }, + { + "description": "Jurisdiction Metadata for cbk_15(2020) id 909f6428-367a-4c9d-9db0-4434c0ee415d", + "key": "909f6428-367a-4c9d-9db0-4434c0ee415d", + "label": "cbk_15(2020) metadata", + "value": "26580" + }, + { + "description": "Jurisdiction Metadata for cbk_66(2020) id c8deda71-be46-4d91-b8ec-7853f5dbec8e", + "key": "c8deda71-be46-4d91-b8ec-7853f5dbec8e", + "label": "cbk_66(2020) metadata", + "value": "26581" + }, + { + "description": "Jurisdiction Metadata for cbk_75(2020) id fef72d8c-dbfc-42f0-9998-f67ac15737ac", + "key": "fef72d8c-dbfc-42f0-9998-f67ac15737ac", + "label": "cbk_75(2020) metadata", + "value": "26582" + }, + { + "description": "Jurisdiction Metadata for cbk_73(2020) id 7721f148-d0e1-415a-a1e7-bdcdb531733c", + "key": "7721f148-d0e1-415a-a1e7-bdcdb531733c", + "label": "cbk_73(2020) metadata", + "value": "26583" + }, + { + "description": "Jurisdiction Metadata for cbk_101(2020) id 91556ed6-89d1-4353-a0a3-df6431c0a17f", + "key": "91556ed6-89d1-4353-a0a3-df6431c0a17f", + "label": "cbk_101(2020) metadata", + "value": "26584" + }, + { + "description": "Jurisdiction Metadata for cbk_10(2020) id 98482deb-7352-406a-aae8-673d745c5563", + "key": "98482deb-7352-406a-aae8-673d745c5563", + "label": "cbk_10(2020) metadata", + "value": "26585" + }, + { + "description": "Jurisdiction Metadata for cbk_79(2020) id f36ed917-285c-46c0-813a-f1c6b343700e", + "key": "f36ed917-285c-46c0-813a-f1c6b343700e", + "label": "cbk_79(2020) metadata", + "value": "26586" + }, + { + "description": "Jurisdiction Metadata for cbk_11(2020) id 99762ee5-f781-452d-b48b-8a747d29d997", + "key": "99762ee5-f781-452d-b48b-8a747d29d997", + "label": "cbk_11(2020) metadata", + "value": "26587" + }, + { + "description": "Jurisdiction Metadata for cbk_2(2020) id 21b537cf-da23-419b-a674-8ea33b1c80d0", + "key": "21b537cf-da23-419b-a674-8ea33b1c80d0", + "label": "cbk_2(2020) metadata", + "value": "26588" + }, + { + "description": "Jurisdiction Metadata for cbk_100(2020) id 4391debd-e4f9-4170-b1d0-952195b918db", + "key": "4391debd-e4f9-4170-b1d0-952195b918db", + "label": "cbk_100(2020) metadata", + "value": "26589" + }, + { + "description": "Jurisdiction Metadata for cbk_56(2020) id 19da2265-6d2b-4486-a776-6deb5c9d6d67", + "key": "19da2265-6d2b-4486-a776-6deb5c9d6d67", + "label": "cbk_56(2020) metadata", + "value": "26590" + }, + { + "description": "Jurisdiction Metadata for cbk_77(2020) id 43960be5-a9e3-4fab-94c3-b3e98397bed0", + "key": "43960be5-a9e3-4fab-94c3-b3e98397bed0", + "label": "cbk_77(2020) metadata", + "value": "26591" + }, + { + "description": "Jurisdiction Metadata for cbk_54(2020) id 790ecf1b-6084-44e9-8af5-79087dc0ca1e", + "key": "790ecf1b-6084-44e9-8af5-79087dc0ca1e", + "label": "cbk_54(2020) metadata", + "value": "26592" + }, + { + "description": "Jurisdiction Metadata for cbk_64(2020) id 23c7b073-05ed-43bd-9a1b-55e2f7b76091", + "key": "23c7b073-05ed-43bd-9a1b-55e2f7b76091", + "label": "cbk_64(2020) metadata", + "value": "26593" + }, + { + "description": "Jurisdiction Metadata for cbk_82(2020) id cd6b2586-0b49-45db-8ca4-83a630f785e6", + "key": "cd6b2586-0b49-45db-8ca4-83a630f785e6", + "label": "cbk_82(2020) metadata", + "value": "26594" + }, + { + "description": "Jurisdiction Metadata for cbk_31(2020) id 0c9cf38b-1274-4984-aa21-86e0dbe9e48d", + "key": "0c9cf38b-1274-4984-aa21-86e0dbe9e48d", + "label": "cbk_31(2020) metadata", + "value": "26595" + }, + { + "description": "Jurisdiction Metadata for cbk_34(2020) id ccfd0011-486d-450a-a3d5-fd8a6002e85b", + "key": "ccfd0011-486d-450a-a3d5-fd8a6002e85b", + "label": "cbk_34(2020) metadata", + "value": "26596" + }, + { + "description": "Jurisdiction Metadata for cbk_67(2020) id e110f949-6a65-43d2-945f-592c031487ad", + "key": "e110f949-6a65-43d2-945f-592c031487ad", + "label": "cbk_67(2020) metadata", + "value": "26597" + }, + { + "description": "Jurisdiction Metadata for cbk_62(2020) id 36a9f848-e698-4698-a5a5-555c1eac6b5c", + "key": "36a9f848-e698-4698-a5a5-555c1eac6b5c", + "label": "cbk_62(2020) metadata", + "value": "26598" + }, + { + "description": "Jurisdiction Metadata for cbk_94(2020) id 87c7223b-8792-40d4-8faf-973deefde823", + "key": "87c7223b-8792-40d4-8faf-973deefde823", + "label": "cbk_94(2020) metadata", + "value": "26599" + }, + { + "description": "Jurisdiction Metadata for cbk_89(2020) id 98784605-7089-491d-ba76-53345b61aa5e", + "key": "98784605-7089-491d-ba76-53345b61aa5e", + "label": "cbk_89(2020) metadata", + "value": "26600" + }, + { + "description": "Jurisdiction Metadata for cbk_96(2020) id 5bafc343-86d9-4be7-b89f-10ceb1a9aa93", + "key": "5bafc343-86d9-4be7-b89f-10ceb1a9aa93", + "label": "cbk_96(2020) metadata", + "value": "26601" + }, + { + "description": "Jurisdiction Metadata for cbk_1(2020) id a2740880-e297-4d10-bc10-e74a4cb1dca5", + "key": "a2740880-e297-4d10-bc10-e74a4cb1dca5", + "label": "cbk_1(2020) metadata", + "value": "26602" + }, + { + "description": "Jurisdiction Metadata for cbk_106(2020) id 828db9a5-0ed0-40ea-b947-c08329712a0c", + "key": "828db9a5-0ed0-40ea-b947-c08329712a0c", + "label": "cbk_106(2020) metadata", + "value": "26603" + }, + { + "description": "Jurisdiction Metadata for cbk_51(2020) id 61eb4350-c651-4e96-ae35-5b07e28bd000", + "key": "61eb4350-c651-4e96-ae35-5b07e28bd000", + "label": "cbk_51(2020) metadata", + "value": "26604" + }, + { + "description": "Jurisdiction Metadata for cbk_72(2020) id fb8c567e-1527-4cfc-a928-928bd16a8ac8", + "key": "fb8c567e-1527-4cfc-a928-928bd16a8ac8", + "label": "cbk_72(2020) metadata", + "value": "26605" + }, + { + "description": "Jurisdiction Metadata for Chipulumshi Zone id 083d6f1b-e68e-45cd-8e82-4b6a9e7d3ac9", + "key": "083d6f1b-e68e-45cd-8e82-4b6a9e7d3ac9", + "label": "Chipulumshi Zone metadata", + "value": "26606" + }, + { + "description": "Jurisdiction Metadata for cbk_7(2020) id 63f6b0af-4789-4906-832f-bca64421d5d2", + "key": "63f6b0af-4789-4906-832f-bca64421d5d2", + "label": "cbk_7(2020) metadata", + "value": "26607" + }, + { + "description": "Jurisdiction Metadata for Chibwili Zone id 85fbf91a-2405-4689-a71e-7139b4af190b", + "key": "85fbf91a-2405-4689-a71e-7139b4af190b", + "label": "Chibwili Zone metadata", + "value": "26608" + }, + { + "description": "Jurisdiction Metadata for cbk_6(2020) id 66d51d27-5f1c-452c-be47-5c6a9a16ea95", + "key": "66d51d27-5f1c-452c-be47-5c6a9a16ea95", + "label": "cbk_6(2020) metadata", + "value": "26609" + }, + { + "description": "Jurisdiction Metadata for Kapololoka Zone id 398d0b3e-9972-4dfb-8292-b024929dc4b9", + "key": "398d0b3e-9972-4dfb-8292-b024929dc4b9", + "label": "Kapololoka Zone metadata", + "value": "26610" + }, + { + "description": "Jurisdiction Metadata for cbk_55(2020) id a85d218d-87de-4e51-95fd-450bd7c3210d", + "key": "a85d218d-87de-4e51-95fd-450bd7c3210d", + "label": "cbk_55(2020) metadata", + "value": "26611" + }, + { + "description": "Jurisdiction Metadata for Chungu Zone id 5470d5b9-013e-486b-a32d-1ec40a0fbf2b", + "key": "5470d5b9-013e-486b-a32d-1ec40a0fbf2b", + "label": "Chungu Zone metadata", + "value": "26612" + }, + { + "description": "Jurisdiction Metadata for cbk_87(2020) id 7126b523-85dc-44a2-9b5d-a7288bbf58b8", + "key": "7126b523-85dc-44a2-9b5d-a7288bbf58b8", + "label": "cbk_87(2020) metadata", + "value": "26613" + }, + { + "description": "Jurisdiction Metadata for cbk_28(2020) id 642e6bdf-3db9-4588-a84e-fb362d65b361", + "key": "642e6bdf-3db9-4588-a84e-fb362d65b361", + "label": "cbk_28(2020) metadata", + "value": "26614" + }, + { + "description": "Jurisdiction Metadata for cbk_18(2020) id 4c0586fb-1e77-4439-accc-7a207a69aea0", + "key": "4c0586fb-1e77-4439-accc-7a207a69aea0", + "label": "cbk_18(2020) metadata", + "value": "26615" + }, + { + "description": "Jurisdiction Metadata for cbk_84(2020) id 3b12639e-f08f-41a1-bb59-08cd972fd1d3", + "key": "3b12639e-f08f-41a1-bb59-08cd972fd1d3", + "label": "cbk_84(2020) metadata", + "value": "26616" + }, + { + "description": "Jurisdiction Metadata for cbk_59(2020) id 7da4bfb0-33f4-45f0-9d7c-4cf40f236211", + "key": "7da4bfb0-33f4-45f0-9d7c-4cf40f236211", + "label": "cbk_59(2020) metadata", + "value": "26617" + }, + { + "description": "Jurisdiction Metadata for cbk_83(2020) id 77250e91-98cb-4d78-a2e3-de507d6973a8", + "key": "77250e91-98cb-4d78-a2e3-de507d6973a8", + "label": "cbk_83(2020) metadata", + "value": "26618" + }, + { + "description": "Jurisdiction Metadata for cbk_22(2020) id 489c9cae-d059-4f01-bdfd-a946ba426422", + "key": "489c9cae-d059-4f01-bdfd-a946ba426422", + "label": "cbk_22(2020) metadata", + "value": "26619" + }, + { + "description": "Jurisdiction Metadata for cbk_27(2020) id 1ff4f0ea-9975-4e4d-a145-7304e584d735", + "key": "1ff4f0ea-9975-4e4d-a145-7304e584d735", + "label": "cbk_27(2020) metadata", + "value": "26620" + }, + { + "description": "Jurisdiction Metadata for cbk_13(2020) id 065bb56a-e58e-46c1-8d93-9ceab667123e", + "key": "065bb56a-e58e-46c1-8d93-9ceab667123e", + "label": "cbk_13(2020) metadata", + "value": "26621" + }, + { + "description": "Jurisdiction Metadata for cbk_58(2020) id 69df6fe5-c4c7-4fb3-8945-0268463c8821", + "key": "69df6fe5-c4c7-4fb3-8945-0268463c8821", + "label": "cbk_58(2020) metadata", + "value": "26622" + }, + { + "description": "Jurisdiction Metadata for cbk_98(2020) id c7267ed1-2eb0-4ad0-a61b-067304061ea9", + "key": "c7267ed1-2eb0-4ad0-a61b-067304061ea9", + "label": "cbk_98(2020) metadata", + "value": "26623" + }, + { + "description": "Jurisdiction Metadata for cbk_36(2020) id 5ff0e35c-8675-4015-9cce-0fff49c42e8b", + "key": "5ff0e35c-8675-4015-9cce-0fff49c42e8b", + "label": "cbk_36(2020) metadata", + "value": "26624" + }, + { + "description": "Jurisdiction Metadata for cbk_23(2020) id 137dc0d4-96ef-4996-8b90-779ea9ed8918", + "key": "137dc0d4-96ef-4996-8b90-779ea9ed8918", + "label": "cbk_23(2020) metadata", + "value": "26625" + }, + { + "description": "Jurisdiction Metadata for Chebele Zone id c4158059-01a0-4fd7-839d-ce30b98f47f1", + "key": "c4158059-01a0-4fd7-839d-ce30b98f47f1", + "label": "Chebele Zone metadata", + "value": "26626" + }, + { + "description": "Jurisdiction Metadata for cbk_8(2020) id e691ab21-ef44-4aa0-aa07-fd2fd052c072", + "key": "e691ab21-ef44-4aa0-aa07-fd2fd052c072", + "label": "cbk_8(2020) metadata", + "value": "26627" + }, + { + "description": "Jurisdiction Metadata for Tokatoka(2020) id c5adc183-46fa-4087-b066-a8da4f7d0550", + "key": "c5adc183-46fa-4087-b066-a8da4f7d0550", + "label": "Tokatoka(2020) metadata", + "value": "26628" + }, + { + "description": "Jurisdiction Metadata for Kasakula Zone id f61fcf2b-7bc7-4ecb-bd68-c379c0b357fc", + "key": "f61fcf2b-7bc7-4ecb-bd68-c379c0b357fc", + "label": "Kasakula Zone metadata", + "value": "26629" + }, + { + "description": "Jurisdiction Metadata for tkt_5(2020) id 99eb6799-5310-401f-a2e5-0f1fa18844be", + "key": "99eb6799-5310-401f-a2e5-0f1fa18844be", + "label": "tkt_5(2020) metadata", + "value": "26630" + }, + { + "description": "Jurisdiction Metadata for Chisambo Zone id 4e5303b2-d3e0-4450-946b-fff1d459ffc6", + "key": "4e5303b2-d3e0-4450-946b-fff1d459ffc6", + "label": "Chisambo Zone metadata", + "value": "26631" + }, + { + "description": "Jurisdiction Metadata for tkt_4(2020) id 7d9edcd1-8e55-484d-b5d2-8114c721c618", + "key": "7d9edcd1-8e55-484d-b5d2-8114c721c618", + "label": "tkt_4(2020) metadata", + "value": "26632" + }, + { + "description": "Jurisdiction Metadata for Mfunduaula Zone id b4da57d2-922f-4d63-91dd-0c737d1bc129", + "key": "b4da57d2-922f-4d63-91dd-0c737d1bc129", + "label": "Mfunduaula Zone metadata", + "value": "26633" + }, + { + "description": "Jurisdiction Metadata for tkt_2(2020) id 2702bc39-77d9-43db-b8bb-498e3d6f14d4", + "key": "2702bc39-77d9-43db-b8bb-498e3d6f14d4", + "label": "tkt_2(2020) metadata", + "value": "26634" + }, + { + "description": "Jurisdiction Metadata for Tokatoka Zone id 5d86fd64-0330-40fb-bb6b-a7c5e7d7b39d", + "key": "5d86fd64-0330-40fb-bb6b-a7c5e7d7b39d", + "label": "Tokatoka Zone metadata", + "value": "26635" + }, + { + "description": "Jurisdiction Metadata for tkt_1(2020) id acc0c267-1c3a-4d12-9359-baac3f63d1b3", + "key": "acc0c267-1c3a-4d12-9359-baac3f63d1b3", + "label": "tkt_1(2020) metadata", + "value": "26636" + }, + { + "description": "Jurisdiction Metadata for Kanaya Zone id 350a02b9-72ca-4f85-9f53-4a4f6392fd74", + "key": "350a02b9-72ca-4f85-9f53-4a4f6392fd74", + "label": "Kanaya Zone metadata", + "value": "26637" + }, + { + "description": "Jurisdiction Metadata for tkt_7(2020) id 1109d291-e2f5-4646-b7b2-352511389020", + "key": "1109d291-e2f5-4646-b7b2-352511389020", + "label": "tkt_7(2020) metadata", + "value": "26638" + }, + { + "description": "Jurisdiction Metadata for tkt_3(2020) id 1c7e1eb4-90e3-45ab-98c7-ca8d51023493", + "key": "1c7e1eb4-90e3-45ab-98c7-ca8d51023493", + "label": "tkt_3(2020) metadata", + "value": "26639" + }, + { + "description": "Jurisdiction Metadata for tkt_11(2020) id 0d06d624-59c3-46b7-b687-0b21571acbe0", + "key": "0d06d624-59c3-46b7-b687-0b21571acbe0", + "label": "tkt_11(2020) metadata", + "value": "26640" + }, + { + "description": "Jurisdiction Metadata for tkt_10(2020) id a94c15b6-b386-4684-90f3-19b7397b186a", + "key": "a94c15b6-b386-4684-90f3-19b7397b186a", + "label": "tkt_10(2020) metadata", + "value": "26641" + }, + { + "description": "Jurisdiction Metadata for tkt_6(2020) id 6f855136-5af0-4833-a670-74e53597d578", + "key": "6f855136-5af0-4833-a670-74e53597d578", + "label": "tkt_6(2020) metadata", + "value": "26642" + }, + { + "description": "Jurisdiction Metadata for tkt_9(2020) id 8aed91d4-6a45-4dcd-b24d-45d0ac970486", + "key": "8aed91d4-6a45-4dcd-b24d-45d0ac970486", + "label": "tkt_9(2020) metadata", + "value": "26643" + }, + { + "description": "Jurisdiction Metadata for tkt_8(2020) id 7bc96358-2a34-4bb3-9ed3-8a2c3724fd10", + "key": "7bc96358-2a34-4bb3-9ed3-8a2c3724fd10", + "label": "tkt_8(2020) metadata", + "value": "26644" + }, + { + "description": "Jurisdiction Metadata for Lushiba(2020) id 66093100-8d38-45ed-ba39-04fe93714273", + "key": "66093100-8d38-45ed-ba39-04fe93714273", + "label": "Lushiba(2020) metadata", + "value": "26645" + }, + { + "description": "Jurisdiction Metadata for Kabulo Zone id 698bc35c-a483-4117-b225-059c2af68d95", + "key": "698bc35c-a483-4117-b225-059c2af68d95", + "label": "Kabulo Zone metadata", + "value": "26646" + }, + { + "description": "Jurisdiction Metadata for lsh_2(2020) id fe8e3485-8915-49ad-a067-36eb93b7f2e0", + "key": "fe8e3485-8915-49ad-a067-36eb93b7f2e0", + "label": "lsh_2(2020) metadata", + "value": "26647" + }, + { + "description": "Jurisdiction Metadata for Shikapamdi id 96b036b5-71f2-4853-b5c6-dca6ab0126c0", + "key": "96b036b5-71f2-4853-b5c6-dca6ab0126c0", + "label": "Shikapamdi metadata", + "value": "26648" + }, + { + "description": "Jurisdiction Metadata for lsh_9(2020) id 29a13bfe-72e3-4c0f-ab5c-f867a93df5d1", + "key": "29a13bfe-72e3-4c0f-ab5c-f867a93df5d1", + "label": "lsh_9(2020) metadata", + "value": "26649" + }, + { + "description": "Jurisdiction Metadata for lsh_10(2020) id d623eefa-e3ea-44eb-9b52-dafdf1fe0f36", + "key": "d623eefa-e3ea-44eb-9b52-dafdf1fe0f36", + "label": "lsh_10(2020) metadata", + "value": "26650" + }, + { + "description": "Jurisdiction Metadata for lsh_8(2020) id d8b45f5a-507b-4dd8-8cf4-6bfb7230af2c", + "key": "d8b45f5a-507b-4dd8-8cf4-6bfb7230af2c", + "label": "lsh_8(2020) metadata", + "value": "26651" + }, + { + "description": "Jurisdiction Metadata for Lushiba Zone id c7c87812-0e8b-47f5-911d-0ced9ac879cb", + "key": "c7c87812-0e8b-47f5-911d-0ced9ac879cb", + "label": "Lushiba Zone metadata", + "value": "26652" + }, + { + "description": "Jurisdiction Metadata for lsh_3(2020) id b75125c0-b111-4bab-b4f9-c8b1e8980c62", + "key": "b75125c0-b111-4bab-b4f9-c8b1e8980c62", + "label": "lsh_3(2020) metadata", + "value": "26653" + }, + { + "description": "Jurisdiction Metadata for lsh_6(2020) id 5b4e3a67-6a2c-4649-8761-c68d43786a9e", + "key": "5b4e3a67-6a2c-4649-8761-c68d43786a9e", + "label": "lsh_6(2020) metadata", + "value": "26654" + }, + { + "description": "Jurisdiction Metadata for Shindoni Zone 1 id 82b0767e-b0f1-4137-bf8c-fc0dff1a9e86", + "key": "82b0767e-b0f1-4137-bf8c-fc0dff1a9e86", + "label": "Shindoni Zone 1 metadata", + "value": "26655" + }, + { + "description": "Jurisdiction Metadata for lsh_5(2020) id 4e604c83-090b-42fe-a4bf-80ae05590012", + "key": "4e604c83-090b-42fe-a4bf-80ae05590012", + "label": "lsh_5(2020) metadata", + "value": "26656" + }, + { + "description": "Jurisdiction Metadata for lsh_11(2020) id d0e8c31a-a361-42c0-89ee-f60e806e9fdd", + "key": "d0e8c31a-a361-42c0-89ee-f60e806e9fdd", + "label": "lsh_11(2020) metadata", + "value": "26657" + }, + { + "description": "Jurisdiction Metadata for Shishibeti Zone id 31c30222-f2db-44c1-8c0c-c8bfe552424e", + "key": "31c30222-f2db-44c1-8c0c-c8bfe552424e", + "label": "Shishibeti Zone metadata", + "value": "26658" + }, + { + "description": "Jurisdiction Metadata for lsh_4(2020) id 379d0260-aab2-4baf-9df6-14d6a1f8493b", + "key": "379d0260-aab2-4baf-9df6-14d6a1f8493b", + "label": "lsh_4(2020) metadata", + "value": "26659" + }, + { + "description": "Jurisdiction Metadata for lsh_7(2020) id 8de9d0ec-9ca2-4826-8bb3-bedb97ec71b3", + "key": "8de9d0ec-9ca2-4826-8bb3-bedb97ec71b3", + "label": "lsh_7(2020) metadata", + "value": "26660" + }, + { + "description": "Jurisdiction Metadata for lsh_1(2020) id d9fde01f-384a-44cc-b196-56a502382a70", + "key": "d9fde01f-384a-44cc-b196-56a502382a70", + "label": "lsh_1(2020) metadata", + "value": "26661" + }, + { + "description": "Jurisdiction Metadata for Kabalenge(2020) id e9f1bf67-4333-4285-82ac-9a06a25b17c8", + "key": "e9f1bf67-4333-4285-82ac-9a06a25b17c8", + "label": "Kabalenge(2020) metadata", + "value": "26662" + }, + { + "description": "Jurisdiction Metadata for Kasumpa Zone id a022fe10-4353-461e-836b-2cb2b1158609", + "key": "a022fe10-4353-461e-836b-2cb2b1158609", + "label": "Kasumpa Zone metadata", + "value": "26663" + }, + { + "description": "Jurisdiction Metadata for kbl_15(2020) id f2aaf67d-434c-404a-8e25-eee634d5910f", + "key": "f2aaf67d-434c-404a-8e25-eee634d5910f", + "label": "kbl_15(2020) metadata", + "value": "26664" + }, + { + "description": "Jurisdiction Metadata for kbl_53(2020) id dd03d8b7-c830-468d-a030-2c5499d69693", + "key": "dd03d8b7-c830-468d-a030-2c5499d69693", + "label": "kbl_53(2020) metadata", + "value": "26665" + }, + { + "description": "Jurisdiction Metadata for kbl_94(2020) id d27fe023-aa45-49af-9a67-7ff87ddda6a5", + "key": "d27fe023-aa45-49af-9a67-7ff87ddda6a5", + "label": "kbl_94(2020) metadata", + "value": "26666" + }, + { + "description": "Jurisdiction Metadata for kbl_1(2020) id c0b3c670-0976-478b-8fbb-e10da2e524bd", + "key": "c0b3c670-0976-478b-8fbb-e10da2e524bd", + "label": "kbl_1(2020) metadata", + "value": "26667" + }, + { + "description": "Jurisdiction Metadata for kbl_6(2020) id a7a7b628-1a03-4e52-b0b6-ad803529f87c", + "key": "a7a7b628-1a03-4e52-b0b6-ad803529f87c", + "label": "kbl_6(2020) metadata", + "value": "26668" + }, + { + "description": "Jurisdiction Metadata for kbl_90(2020) id fbcd6985-4418-4116-8a5b-7aeb308e427c", + "key": "fbcd6985-4418-4116-8a5b-7aeb308e427c", + "label": "kbl_90(2020) metadata", + "value": "26669" + }, + { + "description": "Jurisdiction Metadata for kbl_50(2020) id fc3bd106-fc32-4c8d-9787-85cb0875f81f", + "key": "fc3bd106-fc32-4c8d-9787-85cb0875f81f", + "label": "kbl_50(2020) metadata", + "value": "26670" + }, + { + "description": "Jurisdiction Metadata for kbl_55(2020) id a3bed780-4e0a-481b-a069-5375d431ffdb", + "key": "a3bed780-4e0a-481b-a069-5375d431ffdb", + "label": "kbl_55(2020) metadata", + "value": "26671" + }, + { + "description": "Jurisdiction Metadata for kbl_19(2020) id 0276b47c-4773-4052-8e0a-16d66840b5a2", + "key": "0276b47c-4773-4052-8e0a-16d66840b5a2", + "label": "kbl_19(2020) metadata", + "value": "26672" + }, + { + "description": "Jurisdiction Metadata for kbl_7(2020) id e560111e-f4f9-444e-bdc6-ac655c2c0cd1", + "key": "e560111e-f4f9-444e-bdc6-ac655c2c0cd1", + "label": "kbl_7(2020) metadata", + "value": "26673" + }, + { + "description": "Jurisdiction Metadata for Chibeka Zone id a8ae5848-52f7-4b02-b17f-1a37a77a3aa2", + "key": "a8ae5848-52f7-4b02-b17f-1a37a77a3aa2", + "label": "Chibeka Zone metadata", + "value": "26674" + }, + { + "description": "Jurisdiction Metadata for kbl_71(2020) id db94256f-e8a0-4d1c-aaf0-22100add8538", + "key": "db94256f-e8a0-4d1c-aaf0-22100add8538", + "label": "kbl_71(2020) metadata", + "value": "26675" + }, + { + "description": "Jurisdiction Metadata for kbl_35(2020) id 01409243-d160-4dfb-8060-51df560c8bdb", + "key": "01409243-d160-4dfb-8060-51df560c8bdb", + "label": "kbl_35(2020) metadata", + "value": "26676" + }, + { + "description": "Jurisdiction Metadata for Mangamu Zone id 7e278501-7335-43fa-8408-168621de1f22", + "key": "7e278501-7335-43fa-8408-168621de1f22", + "label": "Mangamu Zone metadata", + "value": "26677" + }, + { + "description": "Jurisdiction Metadata for kbl_12(2020) id 85e4f6dd-fe66-4308-afa1-6b05bfa1663d", + "key": "85e4f6dd-fe66-4308-afa1-6b05bfa1663d", + "label": "kbl_12(2020) metadata", + "value": "26678" + }, + { + "description": "Jurisdiction Metadata for kbl_2(2020) id c0186589-6002-45fb-a511-308fdaefba1f", + "key": "c0186589-6002-45fb-a511-308fdaefba1f", + "label": "kbl_2(2020) metadata", + "value": "26679" + }, + { + "description": "Jurisdiction Metadata for Chendaeka Zone id c60bfd2f-049d-4880-8045-fe4c5a31eb61", + "key": "c60bfd2f-049d-4880-8045-fe4c5a31eb61", + "label": "Chendaeka Zone metadata", + "value": "26680" + }, + { + "description": "Jurisdiction Metadata for kbl_22(2020) id aa0554b9-3ed8-4863-b639-534ee7c7ec2f", + "key": "aa0554b9-3ed8-4863-b639-534ee7c7ec2f", + "label": "kbl_22(2020) metadata", + "value": "26681" + }, + { + "description": "Jurisdiction Metadata for kbl_4(2020) id c169989a-2a54-4aeb-bc32-3ec4ee28192d", + "key": "c169989a-2a54-4aeb-bc32-3ec4ee28192d", + "label": "kbl_4(2020) metadata", + "value": "26682" + }, + { + "description": "Jurisdiction Metadata for kbl_26(2020) id 769ab213-542b-48e4-9af3-efcbb6b8836e", + "key": "769ab213-542b-48e4-9af3-efcbb6b8836e", + "label": "kbl_26(2020) metadata", + "value": "26683" + }, + { + "description": "Jurisdiction Metadata for Chama Zone id 62a460a9-21aa-4a5f-b018-477a48f5000b", + "key": "62a460a9-21aa-4a5f-b018-477a48f5000b", + "label": "Chama Zone metadata", + "value": "26684" + }, + { + "description": "Jurisdiction Metadata for kbl_23(2020) id 387f128a-153d-4f26-ba7e-7345f013ea7b", + "key": "387f128a-153d-4f26-ba7e-7345f013ea7b", + "label": "kbl_23(2020) metadata", + "value": "26685" + }, + { + "description": "Jurisdiction Metadata for kbl_36(2020) id 3c171df8-d1b3-429c-a3e4-51cc5509b4fc", + "key": "3c171df8-d1b3-429c-a3e4-51cc5509b4fc", + "label": "kbl_36(2020) metadata", + "value": "26686" + }, + { + "description": "Jurisdiction Metadata for kbl_29(2020) id 9c5997b8-b10b-4b5b-af18-b0b98374a951", + "key": "9c5997b8-b10b-4b5b-af18-b0b98374a951", + "label": "kbl_29(2020) metadata", + "value": "26687" + }, + { + "description": "Jurisdiction Metadata for kbl_54(2020) id fd9d6fd1-3fcc-452d-8125-3fba8ebe57ee", + "key": "fd9d6fd1-3fcc-452d-8125-3fba8ebe57ee", + "label": "kbl_54(2020) metadata", + "value": "26688" + }, + { + "description": "Jurisdiction Metadata for kbl_3(2020) id 1f91e77d-4691-4436-8689-fb78e2c6c6b4", + "key": "1f91e77d-4691-4436-8689-fb78e2c6c6b4", + "label": "kbl_3(2020) metadata", + "value": "26689" + }, + { + "description": "Jurisdiction Metadata for kbl_72(2020) id 8cdfdfb7-a4ea-43fd-bd0d-8a0e77bd7bcb", + "key": "8cdfdfb7-a4ea-43fd-bd0d-8a0e77bd7bcb", + "label": "kbl_72(2020) metadata", + "value": "26690" + }, + { + "description": "Jurisdiction Metadata for kbl_73(2020) id 0258ebf3-4716-4a08-bb15-2cf5c192a105", + "key": "0258ebf3-4716-4a08-bb15-2cf5c192a105", + "label": "kbl_73(2020) metadata", + "value": "26691" + }, + { + "description": "Jurisdiction Metadata for kbl_51(2020) id 7784d529-1f29-4b82-b23b-dadd8950732d", + "key": "7784d529-1f29-4b82-b23b-dadd8950732d", + "label": "kbl_51(2020) metadata", + "value": "26692" + }, + { + "description": "Jurisdiction Metadata for kbl_8(2020) id 1797bb36-fbfd-479e-93e4-c266e8f137c9", + "key": "1797bb36-fbfd-479e-93e4-c266e8f137c9", + "label": "kbl_8(2020) metadata", + "value": "26693" + }, + { + "description": "Jurisdiction Metadata for kbl_13(2020) id c0a2906e-fd40-4054-b1a0-0886701fe7ff", + "key": "c0a2906e-fd40-4054-b1a0-0886701fe7ff", + "label": "kbl_13(2020) metadata", + "value": "26694" + }, + { + "description": "Jurisdiction Metadata for Mpopo Zone id c396e797-cef3-4558-83a1-c5994315eba5", + "key": "c396e797-cef3-4558-83a1-c5994315eba5", + "label": "Mpopo Zone metadata", + "value": "26695" + }, + { + "description": "Jurisdiction Metadata for kbl_91(2020) id 5bee8a46-1acc-49af-a1b3-afccac3259dd", + "key": "5bee8a46-1acc-49af-a1b3-afccac3259dd", + "label": "kbl_91(2020) metadata", + "value": "26696" + }, + { + "description": "Jurisdiction Metadata for kbl_14(2020) id af73fa15-d729-42e5-bd3c-afb9c065fed9", + "key": "af73fa15-d729-42e5-bd3c-afb9c065fed9", + "label": "kbl_14(2020) metadata", + "value": "26697" + }, + { + "description": "Jurisdiction Metadata for kbl_49(2020) id e834e777-1ce6-4cb4-b733-f208df660da0", + "key": "e834e777-1ce6-4cb4-b733-f208df660da0", + "label": "kbl_49(2020) metadata", + "value": "26698" + }, + { + "description": "Jurisdiction Metadata for kbl_58(2020) id bf5dc5f3-fe75-4ba9-9b34-b4ca2d6844f1", + "key": "bf5dc5f3-fe75-4ba9-9b34-b4ca2d6844f1", + "label": "kbl_58(2020) metadata", + "value": "26699" + }, + { + "description": "Jurisdiction Metadata for kbl_87(2020) id c9d891a5-16ab-4b66-9c88-c5c2128ceb78", + "key": "c9d891a5-16ab-4b66-9c88-c5c2128ceb78", + "label": "kbl_87(2020) metadata", + "value": "26700" + }, + { + "description": "Jurisdiction Metadata for kbl_57(2020) id cf001901-9744-4c07-9cda-28b7e94d02cf", + "key": "cf001901-9744-4c07-9cda-28b7e94d02cf", + "label": "kbl_57(2020) metadata", + "value": "26701" + }, + { + "description": "Jurisdiction Metadata for kbl_70(2020) id 1cfa35c0-a880-4716-8855-2adcc130f9d3", + "key": "1cfa35c0-a880-4716-8855-2adcc130f9d3", + "label": "kbl_70(2020) metadata", + "value": "26702" + }, + { + "description": "Jurisdiction Metadata for kbl_69(2020) id e85e2404-51cb-4e13-8aaa-cbc22edd351d", + "key": "e85e2404-51cb-4e13-8aaa-cbc22edd351d", + "label": "kbl_69(2020) metadata", + "value": "26703" + }, + { + "description": "Jurisdiction Metadata for kbl_27(2020) id 8c00fd67-c579-4ab5-8a47-9518ac09da66", + "key": "8c00fd67-c579-4ab5-8a47-9518ac09da66", + "label": "kbl_27(2020) metadata", + "value": "26704" + }, + { + "description": "Jurisdiction Metadata for kbl_82(2020) id 309e2980-e75a-4773-8897-4739c86eed41", + "key": "309e2980-e75a-4773-8897-4739c86eed41", + "label": "kbl_82(2020) metadata", + "value": "26705" + }, + { + "description": "Jurisdiction Metadata for kbl_56(2020) id 58070148-7523-487b-bf87-eceec42d9ead", + "key": "58070148-7523-487b-bf87-eceec42d9ead", + "label": "kbl_56(2020) metadata", + "value": "26706" + }, + { + "description": "Jurisdiction Metadata for kbl_30(2020) id e82206a6-98aa-4056-a1b6-15128be21a01", + "key": "e82206a6-98aa-4056-a1b6-15128be21a01", + "label": "kbl_30(2020) metadata", + "value": "26707" + }, + { + "description": "Jurisdiction Metadata for kbl_61(2020) id 294fffed-0baa-475a-a562-e57aaff42eb4", + "key": "294fffed-0baa-475a-a562-e57aaff42eb4", + "label": "kbl_61(2020) metadata", + "value": "26708" + }, + { + "description": "Jurisdiction Metadata for kbl_66(2020) id 2c6638b2-0d2c-4f7f-aab9-dfcc260b2dbe", + "key": "2c6638b2-0d2c-4f7f-aab9-dfcc260b2dbe", + "label": "kbl_66(2020) metadata", + "value": "26709" + }, + { + "description": "Jurisdiction Metadata for kbl_43(2020) id 53ee8893-22b8-4844-ac67-216db4ec5560", + "key": "53ee8893-22b8-4844-ac67-216db4ec5560", + "label": "kbl_43(2020) metadata", + "value": "26710" + }, + { + "description": "Jurisdiction Metadata for kbl_92(2020) id 7e559fc0-ab0d-4a68-9093-d63af3a116a3", + "key": "7e559fc0-ab0d-4a68-9093-d63af3a116a3", + "label": "kbl_92(2020) metadata", + "value": "26711" + }, + { + "description": "Jurisdiction Metadata for kbl_17(2020) id 9b4a80f9-3f34-4495-b23d-c765952b314c", + "key": "9b4a80f9-3f34-4495-b23d-c765952b314c", + "label": "kbl_17(2020) metadata", + "value": "26712" + }, + { + "description": "Jurisdiction Metadata for kbl_67(2020) id 92d5b651-484d-4a08-9d6d-d48a4c38922d", + "key": "92d5b651-484d-4a08-9d6d-d48a4c38922d", + "label": "kbl_67(2020) metadata", + "value": "26713" + }, + { + "description": "Jurisdiction Metadata for kbl_41(2020) id bc4d3c7b-abb3-49be-bedb-f90a2bf3e30b", + "key": "bc4d3c7b-abb3-49be-bedb-f90a2bf3e30b", + "label": "kbl_41(2020) metadata", + "value": "26714" + }, + { + "description": "Jurisdiction Metadata for kbl_20(2020) id e3be504c-b259-4e53-aa94-4b97163ad179", + "key": "e3be504c-b259-4e53-aa94-4b97163ad179", + "label": "kbl_20(2020) metadata", + "value": "26715" + }, + { + "description": "Jurisdiction Metadata for kbl_11(2020) id f4b73c8b-372f-41e1-a16f-ef68c001bb30", + "key": "f4b73c8b-372f-41e1-a16f-ef68c001bb30", + "label": "kbl_11(2020) metadata", + "value": "26716" + }, + { + "description": "Jurisdiction Metadata for kbl_59(2020) id f15fbc3a-3adf-45b0-87d3-f9009f2cf0b3", + "key": "f15fbc3a-3adf-45b0-87d3-f9009f2cf0b3", + "label": "kbl_59(2020) metadata", + "value": "26717" + }, + { + "description": "Jurisdiction Metadata for kbl_81(2020) id e975ffc4-a779-416d-a549-bc471a26e583", + "key": "e975ffc4-a779-416d-a549-bc471a26e583", + "label": "kbl_81(2020) metadata", + "value": "26718" + }, + { + "description": "Jurisdiction Metadata for kbl_95(2020) id 10ed06f5-b9a0-48eb-9c9f-4d6ce9baa420", + "key": "10ed06f5-b9a0-48eb-9c9f-4d6ce9baa420", + "label": "kbl_95(2020) metadata", + "value": "26719" + }, + { + "description": "Jurisdiction Metadata for kbl_85(2020) id e21d4bc6-2345-4781-b319-320ecefc98bb", + "key": "e21d4bc6-2345-4781-b319-320ecefc98bb", + "label": "kbl_85(2020) metadata", + "value": "26720" + }, + { + "description": "Jurisdiction Metadata for kbl_10(2020) id 83e08c5d-99ad-4896-aaa1-348684623506", + "key": "83e08c5d-99ad-4896-aaa1-348684623506", + "label": "kbl_10(2020) metadata", + "value": "26721" + }, + { + "description": "Jurisdiction Metadata for kbl_89(2020) id 79613fc2-cc6a-4c11-93c2-fc0323a459f8", + "key": "79613fc2-cc6a-4c11-93c2-fc0323a459f8", + "label": "kbl_89(2020) metadata", + "value": "26722" + }, + { + "description": "Jurisdiction Metadata for kbl_84(2020) id 4c2b47ef-dafa-474c-9d0e-a1faac7258bf", + "key": "4c2b47ef-dafa-474c-9d0e-a1faac7258bf", + "label": "kbl_84(2020) metadata", + "value": "26723" + }, + { + "description": "Jurisdiction Metadata for kbl_44(2020) id 85f1c102-5dab-4b1c-a620-d7c73045b2b6", + "key": "85f1c102-5dab-4b1c-a620-d7c73045b2b6", + "label": "kbl_44(2020) metadata", + "value": "26724" + }, + { + "description": "Jurisdiction Metadata for kbl_62(2020) id 62df09fa-70bd-495e-9a6f-ee00d628aeb7", + "key": "62df09fa-70bd-495e-9a6f-ee00d628aeb7", + "label": "kbl_62(2020) metadata", + "value": "26725" + }, + { + "description": "Jurisdiction Metadata for kbl_45(2020) id b032370c-f2c7-4512-a5e7-a18c2943ffee", + "key": "b032370c-f2c7-4512-a5e7-a18c2943ffee", + "label": "kbl_45(2020) metadata", + "value": "26726" + }, + { + "description": "Jurisdiction Metadata for kbl_32(2020) id 2fdf2c01-b088-4cab-af86-d246a88e0149", + "key": "2fdf2c01-b088-4cab-af86-d246a88e0149", + "label": "kbl_32(2020) metadata", + "value": "26727" + }, + { + "description": "Jurisdiction Metadata for kbl_28(2020) id bfa71b80-a770-4d39-945d-1a85a983ba2c", + "key": "bfa71b80-a770-4d39-945d-1a85a983ba2c", + "label": "kbl_28(2020) metadata", + "value": "26728" + }, + { + "description": "Jurisdiction Metadata for kbl_42(2020) id 92ccb1ff-4f73-4efa-b8be-d302cc15955e", + "key": "92ccb1ff-4f73-4efa-b8be-d302cc15955e", + "label": "kbl_42(2020) metadata", + "value": "26729" + }, + { + "description": "Jurisdiction Metadata for kbl_63(2020) id 0492b442-6a9e-4491-9c12-04a9d629f10d", + "key": "0492b442-6a9e-4491-9c12-04a9d629f10d", + "label": "kbl_63(2020) metadata", + "value": "26730" + }, + { + "description": "Jurisdiction Metadata for kbl_86(2020) id d5f7a9d5-3265-4537-aa16-92fb068d3746", + "key": "d5f7a9d5-3265-4537-aa16-92fb068d3746", + "label": "kbl_86(2020) metadata", + "value": "26731" + }, + { + "description": "Jurisdiction Metadata for kbl_68(2020) id 9283b595-b76d-4839-b248-7e90f07a8937", + "key": "9283b595-b76d-4839-b248-7e90f07a8937", + "label": "kbl_68(2020) metadata", + "value": "26732" + }, + { + "description": "Jurisdiction Metadata for kbl_21(2020) id f1846380-5d48-4aef-a532-8a86ac094263", + "key": "f1846380-5d48-4aef-a532-8a86ac094263", + "label": "kbl_21(2020) metadata", + "value": "26733" + }, + { + "description": "Jurisdiction Metadata for kbl_33(2020) id c711f1f6-f1ad-4771-aee1-259efb80dbd1", + "key": "c711f1f6-f1ad-4771-aee1-259efb80dbd1", + "label": "kbl_33(2020) metadata", + "value": "26734" + }, + { + "description": "Jurisdiction Metadata for kbl_31(2020) id b2e5b578-0c7c-4963-b17b-b4fa74d93a75", + "key": "b2e5b578-0c7c-4963-b17b-b4fa74d93a75", + "label": "kbl_31(2020) metadata", + "value": "26735" + }, + { + "description": "Jurisdiction Metadata for kbl_88(2020) id b3b07f03-bd73-4620-817f-c4d8e582d350", + "key": "b3b07f03-bd73-4620-817f-c4d8e582d350", + "label": "kbl_88(2020) metadata", + "value": "26736" + }, + { + "description": "Jurisdiction Metadata for kbl_64(2020) id b277743c-be27-4ebe-8d90-17fd7ca60c12", + "key": "b277743c-be27-4ebe-8d90-17fd7ca60c12", + "label": "kbl_64(2020) metadata", + "value": "26737" + }, + { + "description": "Jurisdiction Metadata for kbl_80(2020) id d3a6211a-60c1-473a-b715-4f81c733719b", + "key": "d3a6211a-60c1-473a-b715-4f81c733719b", + "label": "kbl_80(2020) metadata", + "value": "26738" + }, + { + "description": "Jurisdiction Metadata for kbl_46(2020) id 381f648a-05c3-4a1c-accf-3eb91f17ff1d", + "key": "381f648a-05c3-4a1c-accf-3eb91f17ff1d", + "label": "kbl_46(2020) metadata", + "value": "26739" + }, + { + "description": "Jurisdiction Metadata for kbl_65(2020) id 66a97d3a-5d93-4ecb-a65e-0695ec010b4d", + "key": "66a97d3a-5d93-4ecb-a65e-0695ec010b4d", + "label": "kbl_65(2020) metadata", + "value": "26740" + }, + { + "description": "Jurisdiction Metadata for kbl_40(2020) id 1738e796-ee41-448b-8633-cf7c08b0f55d", + "key": "1738e796-ee41-448b-8633-cf7c08b0f55d", + "label": "kbl_40(2020) metadata", + "value": "26741" + }, + { + "description": "Jurisdiction Metadata for kbl_47(2020) id 2640a58c-ef01-4483-9692-80983ffa0291", + "key": "2640a58c-ef01-4483-9692-80983ffa0291", + "label": "kbl_47(2020) metadata", + "value": "26742" + }, + { + "description": "Jurisdiction Metadata for kbl_34(2020) id 720ca15f-40bc-4f16-b7d0-b08a8496de8a", + "key": "720ca15f-40bc-4f16-b7d0-b08a8496de8a", + "label": "kbl_34(2020) metadata", + "value": "26743" + }, + { + "description": "Jurisdiction Metadata for kbl_48(2020) id 8fb7c397-6a87-45fb-a364-87057e9cbddc", + "key": "8fb7c397-6a87-45fb-a364-87057e9cbddc", + "label": "kbl_48(2020) metadata", + "value": "26744" + }, + { + "description": "Jurisdiction Metadata for kbl_60(2020) id 20c02c81-92f7-4ec9-a47f-f27036ae3a3c", + "key": "20c02c81-92f7-4ec9-a47f-f27036ae3a3c", + "label": "kbl_60(2020) metadata", + "value": "26745" + }, + { + "description": "Jurisdiction Metadata for kbl_5(2020) id 21acb85c-4fa2-4642-947d-5e566bff7a47", + "key": "21acb85c-4fa2-4642-947d-5e566bff7a47", + "label": "kbl_5(2020) metadata", + "value": "26746" + }, + { + "description": "Jurisdiction Metadata for kbl_24(2020) id 7a45d60f-4fcb-4147-bef6-088c7a1852af", + "key": "7a45d60f-4fcb-4147-bef6-088c7a1852af", + "label": "kbl_24(2020) metadata", + "value": "26747" + }, + { + "description": "Jurisdiction Metadata for kbl_83(2020) id 0a27b8e7-db18-42b4-b894-5809f9738359", + "key": "0a27b8e7-db18-42b4-b894-5809f9738359", + "label": "kbl_83(2020) metadata", + "value": "26748" + }, + { + "description": "Jurisdiction Metadata for kbl_52(2020) id e01b7fa0-9bcc-4cea-949e-86c3a195306e", + "key": "e01b7fa0-9bcc-4cea-949e-86c3a195306e", + "label": "kbl_52(2020) metadata", + "value": "26749" + }, + { + "description": "Jurisdiction Metadata for Katofyo Zone id 5945ed41-8d05-434c-9fb9-39147bfee7e8", + "key": "5945ed41-8d05-434c-9fb9-39147bfee7e8", + "label": "Katofyo Zone metadata", + "value": "26750" + }, + { + "description": "Jurisdiction Metadata for kbl_93(2020) id bef75634-36e0-4433-895e-d418e257fb58", + "key": "bef75634-36e0-4433-895e-d418e257fb58", + "label": "kbl_93(2020) metadata", + "value": "26751" + }, + { + "description": "Jurisdiction Metadata for kbl_9(2020) id f98167fe-0318-4eb6-8ca2-43629f119d8a", + "key": "f98167fe-0318-4eb6-8ca2-43629f119d8a", + "label": "kbl_9(2020) metadata", + "value": "26752" + }, + { + "description": "Jurisdiction Metadata for kbl_79(2020) id abb98885-cb05-405d-aceb-a75ed272bc1c", + "key": "abb98885-cb05-405d-aceb-a75ed272bc1c", + "label": "kbl_79(2020) metadata", + "value": "26753" + }, + { + "description": "Jurisdiction Metadata for kbl_74(2020) id 3f86a691-a3a0-4027-aa83-bf07b1fe9f0b", + "key": "3f86a691-a3a0-4027-aa83-bf07b1fe9f0b", + "label": "kbl_74(2020) metadata", + "value": "26754" + }, + { + "description": "Jurisdiction Metadata for kbl_38(2020) id 18213960-642e-4759-9f98-cd717372216b", + "key": "18213960-642e-4759-9f98-cd717372216b", + "label": "kbl_38(2020) metadata", + "value": "26755" + }, + { + "description": "Jurisdiction Metadata for kbl_75(2020) id fd64e405-aa0e-460b-a508-7465a0fe62f2", + "key": "fd64e405-aa0e-460b-a508-7465a0fe62f2", + "label": "kbl_75(2020) metadata", + "value": "26756" + }, + { + "description": "Jurisdiction Metadata for kbl_25(2020) id d91678cd-1ab6-491d-b142-84dba48f2c19", + "key": "d91678cd-1ab6-491d-b142-84dba48f2c19", + "label": "kbl_25(2020) metadata", + "value": "26757" + }, + { + "description": "Jurisdiction Metadata for kbl_39(2020) id 1eb4c4e6-8c44-4a61-8832-640663b76a5c", + "key": "1eb4c4e6-8c44-4a61-8832-640663b76a5c", + "label": "kbl_39(2020) metadata", + "value": "26758" + }, + { + "description": "Jurisdiction Metadata for kbl_18(2020) id cc3a01d5-9cbe-421c-9234-f44b03057b3d", + "key": "cc3a01d5-9cbe-421c-9234-f44b03057b3d", + "label": "kbl_18(2020) metadata", + "value": "26759" + }, + { + "description": "Jurisdiction Metadata for kbl_77(2020) id f37dd10a-1bc0-425a-a548-19fc737dbfb6", + "key": "f37dd10a-1bc0-425a-a548-19fc737dbfb6", + "label": "kbl_77(2020) metadata", + "value": "26760" + }, + { + "description": "Jurisdiction Metadata for kbl_76(2020) id 9c9e9be4-cccf-4b81-99a5-9fb9adcdffcf", + "key": "9c9e9be4-cccf-4b81-99a5-9fb9adcdffcf", + "label": "kbl_76(2020) metadata", + "value": "26761" + }, + { + "description": "Jurisdiction Metadata for kbl_37(2020) id 93815c7c-dc27-4984-a666-11f8eaa45a48", + "key": "93815c7c-dc27-4984-a666-11f8eaa45a48", + "label": "kbl_37(2020) metadata", + "value": "26762" + }, + { + "description": "Jurisdiction Metadata for kbl_16(2020) id 4ccdf4fe-d45c-4548-8336-eb1f7b82db20", + "key": "4ccdf4fe-d45c-4548-8336-eb1f7b82db20", + "label": "kbl_16(2020) metadata", + "value": "26763" + }, + { + "description": "Jurisdiction Metadata for kbl_78(2020) id 8ff7da0e-88d8-4e3a-b9a9-232c6e7f2d49", + "key": "8ff7da0e-88d8-4e3a-b9a9-232c6e7f2d49", + "label": "kbl_78(2020) metadata", + "value": "26764" + }, + { + "description": "Jurisdiction Metadata for Kapambwe(2020) id 5d389c9e-1ffe-4b95-8254-5422a7007ea0", + "key": "5d389c9e-1ffe-4b95-8254-5422a7007ea0", + "label": "Kapambwe(2020) metadata", + "value": "26765" + }, + { + "description": "Jurisdiction Metadata for Zone 1 id dcaece7a-70c4-4881-b6e1-1a00302d7929", + "key": "dcaece7a-70c4-4881-b6e1-1a00302d7929", + "label": "Zone 1 metadata", + "value": "26766" + }, + { + "description": "Jurisdiction Metadata for kpb_1(2020) id e6d11c56-0119-4c4b-a2d5-e38ebcc9ae4a", + "key": "e6d11c56-0119-4c4b-a2d5-e38ebcc9ae4a", + "label": "kpb_1(2020) metadata", + "value": "26767" + }, + { + "description": "Jurisdiction Metadata for Zone 3 id 9171f593-00a4-475f-9e6f-08285024eeb5", + "key": "9171f593-00a4-475f-9e6f-08285024eeb5", + "label": "Zone 3 metadata", + "value": "26768" + }, + { + "description": "Jurisdiction Metadata for kpb_2(2020) id 17753788-e92f-4fed-a96c-cb2574f0e317", + "key": "17753788-e92f-4fed-a96c-cb2574f0e317", + "label": "kpb_2(2020) metadata", + "value": "26769" + }, + { + "description": "Jurisdiction Metadata for Zonne 2 id d7f3c66f-a422-4087-8249-4d95b9b33839", + "key": "d7f3c66f-a422-4087-8249-4d95b9b33839", + "label": "Zonne 2 metadata", + "value": "26770" + }, + { + "description": "Jurisdiction Metadata for kpb_3(2020) id fbb032f8-3a4b-4b1f-ba1b-f6de0261bb8d", + "key": "fbb032f8-3a4b-4b1f-ba1b-f6de0261bb8d", + "label": "kpb_3(2020) metadata", + "value": "26771" + }, + { + "description": "Jurisdiction Metadata for kpb_4(2020) id 88df895d-e12a-4172-903f-284368fe579f", + "key": "88df895d-e12a-4172-903f-284368fe579f", + "label": "kpb_4(2020) metadata", + "value": "26772" + }, + { + "description": "Jurisdiction Metadata for Zone 4 id f4f82a95-a2dd-45b4-9dd8-e9414eaab90d", + "key": "f4f82a95-a2dd-45b4-9dd8-e9414eaab90d", + "label": "Zone 4 metadata", + "value": "26773" + }, + { + "description": "Jurisdiction Metadata for Eastern Prov (2020) id 4669b841-5f06-47bc-ac87-4282ca21ae6a", + "key": "4669b841-5f06-47bc-ac87-4282ca21ae6a", + "label": "Eastern Prov (2020) metadata", + "value": "26774" + }, + { + "description": "Jurisdiction Metadata for Chadiza District (2020) id a31047b0-0240-4ea5-af8b-d0418a4a099a", + "key": "a31047b0-0240-4ea5-af8b-d0418a4a099a", + "label": "Chadiza District (2020) metadata", + "value": "26775" + }, + { + "description": "Jurisdiction Metadata for Chilenga(2020) id 7a898483-b2f2-4d7e-878c-64fbe7e00fe0", + "key": "7a898483-b2f2-4d7e-878c-64fbe7e00fe0", + "label": "Chilenga(2020) metadata", + "value": "26776" + }, + { + "description": "Jurisdiction Metadata for Dulira_NHC id 4cc758c2-fbe3-439c-9229-313332e1b771", + "key": "4cc758c2-fbe3-439c-9229-313332e1b771", + "label": "Dulira_NHC metadata", + "value": "26777" + }, + { + "description": "Jurisdiction Metadata for CLG_19(2020) id 45ac1f05-7235-42ea-b2ae-a382d8b6fdf5", + "key": "45ac1f05-7235-42ea-b2ae-a382d8b6fdf5", + "label": "CLG_19(2020) metadata", + "value": "26778" + }, + { + "description": "Jurisdiction Metadata for CLG_8(2020) id 69c2f104-41e2-4bbb-a54e-8652c4dcef33", + "key": "69c2f104-41e2-4bbb-a54e-8652c4dcef33", + "label": "CLG_8(2020) metadata", + "value": "26779" + }, + { + "description": "Jurisdiction Metadata for CLG_2(2020) id e56e4894-70a7-4a76-a0da-572c5c32dc2c", + "key": "e56e4894-70a7-4a76-a0da-572c5c32dc2c", + "label": "CLG_2(2020) metadata", + "value": "26780" + }, + { + "description": "Jurisdiction Metadata for CLG_6(2020) id d8234c61-2ce9-4b13-907c-1a7e378e2db4", + "key": "d8234c61-2ce9-4b13-907c-1a7e378e2db4", + "label": "CLG_6(2020) metadata", + "value": "26781" + }, + { + "description": "Jurisdiction Metadata for CLG_23(2020) id 05a24141-9b00-4a09-8fb9-ae7b51ca620c", + "key": "05a24141-9b00-4a09-8fb9-ae7b51ca620c", + "label": "CLG_23(2020) metadata", + "value": "26782" + }, + { + "description": "Jurisdiction Metadata for CLG_1(2020) id 2ffd7355-e62a-4cda-8d06-7f96c5874de3", + "key": "2ffd7355-e62a-4cda-8d06-7f96c5874de3", + "label": "CLG_1(2020) metadata", + "value": "26783" + }, + { + "description": "Jurisdiction Metadata for CLG_17(2020) id 26fbaf6b-2b01-4c35-9667-6b909bbd1615", + "key": "26fbaf6b-2b01-4c35-9667-6b909bbd1615", + "label": "CLG_17(2020) metadata", + "value": "26784" + }, + { + "description": "Jurisdiction Metadata for CLG_16(2020) id 737f2729-2ff3-4e99-b4cb-bd0102a91c49", + "key": "737f2729-2ff3-4e99-b4cb-bd0102a91c49", + "label": "CLG_16(2020) metadata", + "value": "26785" + }, + { + "description": "Jurisdiction Metadata for CLG_27(2020) id 7b852b09-efbd-4d7b-b6f0-89e63d483e39", + "key": "7b852b09-efbd-4d7b-b6f0-89e63d483e39", + "label": "CLG_27(2020) metadata", + "value": "26786" + }, + { + "description": "Jurisdiction Metadata for CLG_20(2020) id 81108223-e938-46ac-bbd4-c195d88b364c", + "key": "81108223-e938-46ac-bbd4-c195d88b364c", + "label": "CLG_20(2020) metadata", + "value": "26787" + }, + { + "description": "Jurisdiction Metadata for CLG_21(2020) id 4d41c5f1-662d-460c-8176-4766cb0069a0", + "key": "4d41c5f1-662d-460c-8176-4766cb0069a0", + "label": "CLG_21(2020) metadata", + "value": "26788" + }, + { + "description": "Jurisdiction Metadata for CLG_15(2020) id a1abe859-1d63-4b05-b27f-e088afc884e0", + "key": "a1abe859-1d63-4b05-b27f-e088afc884e0", + "label": "CLG_15(2020) metadata", + "value": "26789" + }, + { + "description": "Jurisdiction Metadata for CLG_9(2020) id 50632df3-5edb-4174-9d70-b3e7c85413ad", + "key": "50632df3-5edb-4174-9d70-b3e7c85413ad", + "label": "CLG_9(2020) metadata", + "value": "26790" + }, + { + "description": "Jurisdiction Metadata for CLG_25(2020) id d29d613b-7f90-4e3c-ad50-172b30710f83", + "key": "d29d613b-7f90-4e3c-ad50-172b30710f83", + "label": "CLG_25(2020) metadata", + "value": "26791" + }, + { + "description": "Jurisdiction Metadata for CLG_7(2020) id 63e1be76-d808-4d02-b7dc-d31a8b53332e", + "key": "63e1be76-d808-4d02-b7dc-d31a8b53332e", + "label": "CLG_7(2020) metadata", + "value": "26792" + }, + { + "description": "Jurisdiction Metadata for CLG_29(2020) id 64b86052-608c-4a9a-b688-34a520e2e386", + "key": "64b86052-608c-4a9a-b688-34a520e2e386", + "label": "CLG_29(2020) metadata", + "value": "26793" + }, + { + "description": "Jurisdiction Metadata for CLG_13(2020) id eaaefdcd-6c54-4e73-81a4-3441943f2371", + "key": "eaaefdcd-6c54-4e73-81a4-3441943f2371", + "label": "CLG_13(2020) metadata", + "value": "26794" + }, + { + "description": "Jurisdiction Metadata for CLG_18(2020) id 00f055d8-e103-47a0-b14b-88613e3d1512", + "key": "00f055d8-e103-47a0-b14b-88613e3d1512", + "label": "CLG_18(2020) metadata", + "value": "26795" + }, + { + "description": "Jurisdiction Metadata for CLG_22(2020) id 4e3ca8d3-134f-424c-bc85-c07ea317f164", + "key": "4e3ca8d3-134f-424c-bc85-c07ea317f164", + "label": "CLG_22(2020) metadata", + "value": "26796" + }, + { + "description": "Jurisdiction Metadata for CLG_12(2020) id 55aef2b6-b783-452f-8ec8-060681733f62", + "key": "55aef2b6-b783-452f-8ec8-060681733f62", + "label": "CLG_12(2020) metadata", + "value": "26797" + }, + { + "description": "Jurisdiction Metadata for CLG_11(2020) id 67d0c1c4-ab8c-4763-896d-dfb64dac956a", + "key": "67d0c1c4-ab8c-4763-896d-dfb64dac956a", + "label": "CLG_11(2020) metadata", + "value": "26798" + }, + { + "description": "Jurisdiction Metadata for CLG_28(2020) id ef8f32c1-17da-46a9-a6b1-3a549c403081", + "key": "ef8f32c1-17da-46a9-a6b1-3a549c403081", + "label": "CLG_28(2020) metadata", + "value": "26799" + }, + { + "description": "Jurisdiction Metadata for CLG_14(2020) id e4522dc1-19c7-48ce-896f-28cdf2cde166", + "key": "e4522dc1-19c7-48ce-896f-28cdf2cde166", + "label": "CLG_14(2020) metadata", + "value": "26800" + }, + { + "description": "Jurisdiction Metadata for CLG_4(2020) id c69c5156-c16c-465a-80a2-51c718f58da3", + "key": "c69c5156-c16c-465a-80a2-51c718f58da3", + "label": "CLG_4(2020) metadata", + "value": "26801" + }, + { + "description": "Jurisdiction Metadata for CLG_5(2020) id 2cbc70d9-536f-4449-89a9-701b7a50f147", + "key": "2cbc70d9-536f-4449-89a9-701b7a50f147", + "label": "CLG_5(2020) metadata", + "value": "26802" + }, + { + "description": "Jurisdiction Metadata for CLG_3(2020) id 22858416-4964-4967-a93a-41b1e7ba8d0c", + "key": "22858416-4964-4967-a93a-41b1e7ba8d0c", + "label": "CLG_3(2020) metadata", + "value": "26803" + }, + { + "description": "Jurisdiction Metadata for CLG_26(2020) id 2ea271bd-e805-4a6e-960d-34785914a5bc", + "key": "2ea271bd-e805-4a6e-960d-34785914a5bc", + "label": "CLG_26(2020) metadata", + "value": "26804" + }, + { + "description": "Jurisdiction Metadata for CLG_24(2020) id fd98d9bb-a2c0-4320-b6e1-27fc96a68444", + "key": "fd98d9bb-a2c0-4320-b6e1-27fc96a68444", + "label": "CLG_24(2020) metadata", + "value": "26805" + }, + { + "description": "Jurisdiction Metadata for CLG_10(2020) id 34770079-7e50-49b5-84a1-f6530a264e8a", + "key": "34770079-7e50-49b5-84a1-f6530a264e8a", + "label": "CLG_10(2020) metadata", + "value": "26806" + }, + { + "description": "Jurisdiction Metadata for Mtaya(2020) id 5f7e5e28-2a22-43e1-8581-71f89896e06a", + "key": "5f7e5e28-2a22-43e1-8581-71f89896e06a", + "label": "Mtaya(2020) metadata", + "value": "26807" + }, + { + "description": "Jurisdiction Metadata for Simatiza_NHC id 29488fac-125b-43b3-b777-29e298786fa5", + "key": "29488fac-125b-43b3-b777-29e298786fa5", + "label": "Simatiza_NHC metadata", + "value": "26808" + }, + { + "description": "Jurisdiction Metadata for MTY_3(2020) id 1d9cfd8e-5242-4d82-8e5c-793381e1f407", + "key": "1d9cfd8e-5242-4d82-8e5c-793381e1f407", + "label": "MTY_3(2020) metadata", + "value": "26809" + }, + { + "description": "Jurisdiction Metadata for MTY_25(2020) id 52817be6-313e-418f-b7c5-38be785270f0", + "key": "52817be6-313e-418f-b7c5-38be785270f0", + "label": "MTY_25(2020) metadata", + "value": "26810" + }, + { + "description": "Jurisdiction Metadata for MTY_40(2020) id be62487d-60a0-4311-8ba6-b712a949c42a", + "key": "be62487d-60a0-4311-8ba6-b712a949c42a", + "label": "MTY_40(2020) metadata", + "value": "26811" + }, + { + "description": "Jurisdiction Metadata for MTY_69(2020) id 3c8f705c-36ec-4e50-ba3a-6654232a6a97", + "key": "3c8f705c-36ec-4e50-ba3a-6654232a6a97", + "label": "MTY_69(2020) metadata", + "value": "26812" + }, + { + "description": "Jurisdiction Metadata for MTY_50(2020) id cb886d58-abec-4f53-883e-d88fe2878e3b", + "key": "cb886d58-abec-4f53-883e-d88fe2878e3b", + "label": "MTY_50(2020) metadata", + "value": "26813" + }, + { + "description": "Jurisdiction Metadata for MTY_64(2020) id 290008e9-a5e2-434b-b07d-ebf65a942699", + "key": "290008e9-a5e2-434b-b07d-ebf65a942699", + "label": "MTY_64(2020) metadata", + "value": "26814" + }, + { + "description": "Jurisdiction Metadata for MTY_10(2020) id 21e6dae3-dc75-4255-aef3-08393952ce07", + "key": "21e6dae3-dc75-4255-aef3-08393952ce07", + "label": "MTY_10(2020) metadata", + "value": "26815" + }, + { + "description": "Jurisdiction Metadata for MTY_5(2020) id 88a2a65c-92a0-4f67-99c8-df6ed2439a32", + "key": "88a2a65c-92a0-4f67-99c8-df6ed2439a32", + "label": "MTY_5(2020) metadata", + "value": "26816" + }, + { + "description": "Jurisdiction Metadata for MTY_21(2020) id 458e942a-fd09-4078-a21e-a65938e73f8d", + "key": "458e942a-fd09-4078-a21e-a65938e73f8d", + "label": "MTY_21(2020) metadata", + "value": "26817" + }, + { + "description": "Jurisdiction Metadata for MTY_37(2020) id 2d02f422-5af2-4c2d-a9e5-66bad965a034", + "key": "2d02f422-5af2-4c2d-a9e5-66bad965a034", + "label": "MTY_37(2020) metadata", + "value": "26818" + }, + { + "description": "Jurisdiction Metadata for MTY_28(2020) id 2833b4a7-1783-4183-98c4-95ac399f6ece", + "key": "2833b4a7-1783-4183-98c4-95ac399f6ece", + "label": "MTY_28(2020) metadata", + "value": "26819" + }, + { + "description": "Jurisdiction Metadata for MTY_67(2020) id 2a96d36f-4350-4eef-b8a7-e7e36046b8a5", + "key": "2a96d36f-4350-4eef-b8a7-e7e36046b8a5", + "label": "MTY_67(2020) metadata", + "value": "26820" + }, + { + "description": "Jurisdiction Metadata for MTY_51(2020) id 434f27a8-1242-48a3-aad3-09d14bb6c099", + "key": "434f27a8-1242-48a3-aad3-09d14bb6c099", + "label": "MTY_51(2020) metadata", + "value": "26821" + }, + { + "description": "Jurisdiction Metadata for MTY_31(2020) id a086ffa7-963e-45f1-afe4-eb3e3b4095b4", + "key": "a086ffa7-963e-45f1-afe4-eb3e3b4095b4", + "label": "MTY_31(2020) metadata", + "value": "26822" + }, + { + "description": "Jurisdiction Metadata for MTY_7(2020) id 42c94dd0-fa2f-47a4-ae6e-608482f79ddf", + "key": "42c94dd0-fa2f-47a4-ae6e-608482f79ddf", + "label": "MTY_7(2020) metadata", + "value": "26823" + }, + { + "description": "Jurisdiction Metadata for MTY_63(2020) id a00e0b93-ca38-4809-9e21-b9cb7e0e0ce2", + "key": "a00e0b93-ca38-4809-9e21-b9cb7e0e0ce2", + "label": "MTY_63(2020) metadata", + "value": "26824" + }, + { + "description": "Jurisdiction Metadata for MTY_66(2020) id 0a42146d-1743-4265-b55a-0add747d0ad7", + "key": "0a42146d-1743-4265-b55a-0add747d0ad7", + "label": "MTY_66(2020) metadata", + "value": "26825" + }, + { + "description": "Jurisdiction Metadata for MTY_45(2020) id 47612253-461f-47f1-a9ee-150d958ed89a", + "key": "47612253-461f-47f1-a9ee-150d958ed89a", + "label": "MTY_45(2020) metadata", + "value": "26826" + }, + { + "description": "Jurisdiction Metadata for MTY_42(2020) id e506dee4-bf78-4460-9f19-3aa44664cd03", + "key": "e506dee4-bf78-4460-9f19-3aa44664cd03", + "label": "MTY_42(2020) metadata", + "value": "26827" + }, + { + "description": "Jurisdiction Metadata for MTY_19(2020) id 9d54f7e6-82fb-441b-ba65-ae620145f4e8", + "key": "9d54f7e6-82fb-441b-ba65-ae620145f4e8", + "label": "MTY_19(2020) metadata", + "value": "26828" + }, + { + "description": "Jurisdiction Metadata for MTY_53(2020) id 83ef83cf-2da2-4e91-b02d-61c81fb44499", + "key": "83ef83cf-2da2-4e91-b02d-61c81fb44499", + "label": "MTY_53(2020) metadata", + "value": "26829" + }, + { + "description": "Jurisdiction Metadata for MTY_57(2020) id 2b8249f8-43ad-44a1-8151-eebb05d3f432", + "key": "2b8249f8-43ad-44a1-8151-eebb05d3f432", + "label": "MTY_57(2020) metadata", + "value": "26830" + }, + { + "description": "Jurisdiction Metadata for MTY_9(2020) id 4a4851b8-0d77-4cb6-871a-68d10e5bd73e", + "key": "4a4851b8-0d77-4cb6-871a-68d10e5bd73e", + "label": "MTY_9(2020) metadata", + "value": "26831" + }, + { + "description": "Jurisdiction Metadata for MTY_43(2020) id f81c6d2c-63aa-4009-af43-4d8aa33d074b", + "key": "f81c6d2c-63aa-4009-af43-4d8aa33d074b", + "label": "MTY_43(2020) metadata", + "value": "26832" + }, + { + "description": "Jurisdiction Metadata for MTY_70(2020) id 4e87594a-9876-4010-97f9-d851d0fd9ef4", + "key": "4e87594a-9876-4010-97f9-d851d0fd9ef4", + "label": "MTY_70(2020) metadata", + "value": "26833" + }, + { + "description": "Jurisdiction Metadata for MTY_22(2020) id 9c1df04e-31ac-4cb0-aef7-aec3c92d0dfa", + "key": "9c1df04e-31ac-4cb0-aef7-aec3c92d0dfa", + "label": "MTY_22(2020) metadata", + "value": "26834" + }, + { + "description": "Jurisdiction Metadata for MTY_65(2020) id 09961d8c-0646-45f9-8162-00ea92cb4dcf", + "key": "09961d8c-0646-45f9-8162-00ea92cb4dcf", + "label": "MTY_65(2020) metadata", + "value": "26835" + }, + { + "description": "Jurisdiction Metadata for MTY_34(2020) id a5ac9522-47ff-425b-b33a-2d2a588279af", + "key": "a5ac9522-47ff-425b-b33a-2d2a588279af", + "label": "MTY_34(2020) metadata", + "value": "26836" + }, + { + "description": "Jurisdiction Metadata for MTY_24(2020) id 37c4b8ee-ab9a-4be8-b99a-54797eee12f7", + "key": "37c4b8ee-ab9a-4be8-b99a-54797eee12f7", + "label": "MTY_24(2020) metadata", + "value": "26837" + }, + { + "description": "Jurisdiction Metadata for MTY_47(2020) id 6b5d7e96-00c8-4253-bbd7-9bfa38379058", + "key": "6b5d7e96-00c8-4253-bbd7-9bfa38379058", + "label": "MTY_47(2020) metadata", + "value": "26838" + }, + { + "description": "Jurisdiction Metadata for MTY_44(2020) id f2f683d6-c4fe-4160-a583-dca6c417e2db", + "key": "f2f683d6-c4fe-4160-a583-dca6c417e2db", + "label": "MTY_44(2020) metadata", + "value": "26839" + }, + { + "description": "Jurisdiction Metadata for MTY_68(2020) id 85702ae6-9e63-4733-8b95-6711d7b40f5a", + "key": "85702ae6-9e63-4733-8b95-6711d7b40f5a", + "label": "MTY_68(2020) metadata", + "value": "26840" + }, + { + "description": "Jurisdiction Metadata for MTY_60(2020) id ea4e3059-c8c6-46ec-bc16-21ccf38888ac", + "key": "ea4e3059-c8c6-46ec-bc16-21ccf38888ac", + "label": "MTY_60(2020) metadata", + "value": "26841" + }, + { + "description": "Jurisdiction Metadata for MTY_58(2020) id 06fbad30-ef42-413e-a3d1-d8a21366ebdb", + "key": "06fbad30-ef42-413e-a3d1-d8a21366ebdb", + "label": "MTY_58(2020) metadata", + "value": "26842" + }, + { + "description": "Jurisdiction Metadata for MTY_27(2020) id fc54346c-d728-4a37-a981-b40539f2d35d", + "key": "fc54346c-d728-4a37-a981-b40539f2d35d", + "label": "MTY_27(2020) metadata", + "value": "26843" + }, + { + "description": "Jurisdiction Metadata for MTY_17(2020) id 7c543773-0cb7-48c0-bc3f-393cd1915a81", + "key": "7c543773-0cb7-48c0-bc3f-393cd1915a81", + "label": "MTY_17(2020) metadata", + "value": "26844" + }, + { + "description": "Jurisdiction Metadata for MTY_74(2020) id 533aa910-26f3-4298-81ba-abacfa327eb8", + "key": "533aa910-26f3-4298-81ba-abacfa327eb8", + "label": "MTY_74(2020) metadata", + "value": "26845" + }, + { + "description": "Jurisdiction Metadata for MTY_71(2020) id fdbc7e04-6b0d-425f-9e33-b9958c3c947d", + "key": "fdbc7e04-6b0d-425f-9e33-b9958c3c947d", + "label": "MTY_71(2020) metadata", + "value": "26846" + }, + { + "description": "Jurisdiction Metadata for MTY_13(2020) id 9b713259-9d91-4f42-96d0-9aa1d377f58e", + "key": "9b713259-9d91-4f42-96d0-9aa1d377f58e", + "label": "MTY_13(2020) metadata", + "value": "26847" + }, + { + "description": "Jurisdiction Metadata for MTY_29(2020) id 5629a642-7637-48ef-817c-5e33b7fba0a9", + "key": "5629a642-7637-48ef-817c-5e33b7fba0a9", + "label": "MTY_29(2020) metadata", + "value": "26848" + }, + { + "description": "Jurisdiction Metadata for MTY_48(2020) id ef138743-85ee-4bdf-8c62-13a2590ec7a8", + "key": "ef138743-85ee-4bdf-8c62-13a2590ec7a8", + "label": "MTY_48(2020) metadata", + "value": "26849" + }, + { + "description": "Jurisdiction Metadata for MTY_49(2020) id 3c6fc82b-9452-4437-a374-3c308b70f5c9", + "key": "3c6fc82b-9452-4437-a374-3c308b70f5c9", + "label": "MTY_49(2020) metadata", + "value": "26850" + }, + { + "description": "Jurisdiction Metadata for MTY_36(2020) id 9b103f4f-ad97-4267-b5ed-0026fddee198", + "key": "9b103f4f-ad97-4267-b5ed-0026fddee198", + "label": "MTY_36(2020) metadata", + "value": "26851" + }, + { + "description": "Jurisdiction Metadata for MTY_55(2020) id ff54d0c0-f54e-4412-87c2-c4fc44b4f524", + "key": "ff54d0c0-f54e-4412-87c2-c4fc44b4f524", + "label": "MTY_55(2020) metadata", + "value": "26852" + }, + { + "description": "Jurisdiction Metadata for MTY_38(2020) id 58c1e164-2d41-44b6-a9eb-1a507110982c", + "key": "58c1e164-2d41-44b6-a9eb-1a507110982c", + "label": "MTY_38(2020) metadata", + "value": "26853" + }, + { + "description": "Jurisdiction Metadata for MTY_54(2020) id 1488c799-7afe-47c0-937d-4ed1ca775f7b", + "key": "1488c799-7afe-47c0-937d-4ed1ca775f7b", + "label": "MTY_54(2020) metadata", + "value": "26854" + }, + { + "description": "Jurisdiction Metadata for MTY_18(2020) id 956d9631-fc86-412d-8f96-b5634e78b818", + "key": "956d9631-fc86-412d-8f96-b5634e78b818", + "label": "MTY_18(2020) metadata", + "value": "26855" + }, + { + "description": "Jurisdiction Metadata for MTY_15(2020) id 8405aff1-840a-48f1-83e5-4a1640d85740", + "key": "8405aff1-840a-48f1-83e5-4a1640d85740", + "label": "MTY_15(2020) metadata", + "value": "26856" + }, + { + "description": "Jurisdiction Metadata for MTY_52(2020) id f0b2a83e-3cf2-4b35-935c-08d5c1056dfb", + "key": "f0b2a83e-3cf2-4b35-935c-08d5c1056dfb", + "label": "MTY_52(2020) metadata", + "value": "26857" + }, + { + "description": "Jurisdiction Metadata for MTY_56(2020) id 40fddf53-2172-45da-b5cb-658b78ed6812", + "key": "40fddf53-2172-45da-b5cb-658b78ed6812", + "label": "MTY_56(2020) metadata", + "value": "26858" + }, + { + "description": "Jurisdiction Metadata for MTY_30(2020) id dd3a3b74-f12d-4cbc-a6fd-c9252b8d4fdf", + "key": "dd3a3b74-f12d-4cbc-a6fd-c9252b8d4fdf", + "label": "MTY_30(2020) metadata", + "value": "26859" + }, + { + "description": "Jurisdiction Metadata for MTY_59(2020) id c11e7742-6362-48d1-bd06-22e901f1cf03", + "key": "c11e7742-6362-48d1-bd06-22e901f1cf03", + "label": "MTY_59(2020) metadata", + "value": "26860" + }, + { + "description": "Jurisdiction Metadata for MTY_35(2020) id 99410108-11e2-4f99-86a6-ee4f8926390d", + "key": "99410108-11e2-4f99-86a6-ee4f8926390d", + "label": "MTY_35(2020) metadata", + "value": "26861" + }, + { + "description": "Jurisdiction Metadata for MTY_23(2020) id 1f942272-b047-4ab5-9010-b5a3e4bda95e", + "key": "1f942272-b047-4ab5-9010-b5a3e4bda95e", + "label": "MTY_23(2020) metadata", + "value": "26862" + }, + { + "description": "Jurisdiction Metadata for MTY_73(2020) id 0a591a15-7411-443a-925d-12ddb0b59ef4", + "key": "0a591a15-7411-443a-925d-12ddb0b59ef4", + "label": "MTY_73(2020) metadata", + "value": "26863" + }, + { + "description": "Jurisdiction Metadata for MTY_46(2020) id 23a5e9cf-1feb-46f5-b6b6-9fb0089acb68", + "key": "23a5e9cf-1feb-46f5-b6b6-9fb0089acb68", + "label": "MTY_46(2020) metadata", + "value": "26864" + }, + { + "description": "Jurisdiction Metadata for MTY_26(2020) id 61c72689-e8d5-4a80-88b7-592b312fa8b2", + "key": "61c72689-e8d5-4a80-88b7-592b312fa8b2", + "label": "MTY_26(2020) metadata", + "value": "26865" + }, + { + "description": "Jurisdiction Metadata for MTY_16(2020) id a1e1f8e9-ad4e-48c4-9a72-7d51763358d5", + "key": "a1e1f8e9-ad4e-48c4-9a72-7d51763358d5", + "label": "MTY_16(2020) metadata", + "value": "26866" + }, + { + "description": "Jurisdiction Metadata for MTY_62(2020) id 3d4b4521-a6f7-4d39-9de8-0d1d73483515", + "key": "3d4b4521-a6f7-4d39-9de8-0d1d73483515", + "label": "MTY_62(2020) metadata", + "value": "26867" + }, + { + "description": "Jurisdiction Metadata for MTY_33(2020) id 5f96a65a-38f6-455e-9cef-defd0134ddd6", + "key": "5f96a65a-38f6-455e-9cef-defd0134ddd6", + "label": "MTY_33(2020) metadata", + "value": "26868" + }, + { + "description": "Jurisdiction Metadata for MTY_2(2020) id 1c3079ac-7379-4b44-97bb-39ed7b012cab", + "key": "1c3079ac-7379-4b44-97bb-39ed7b012cab", + "label": "MTY_2(2020) metadata", + "value": "26869" + }, + { + "description": "Jurisdiction Metadata for MTY_39(2020) id 13612c9d-e206-48e7-a214-e671900a475a", + "key": "13612c9d-e206-48e7-a214-e671900a475a", + "label": "MTY_39(2020) metadata", + "value": "26870" + }, + { + "description": "Jurisdiction Metadata for MTY_20(2020) id 8573b2a5-89fd-49cc-b5b2-781866c676c2", + "key": "8573b2a5-89fd-49cc-b5b2-781866c676c2", + "label": "MTY_20(2020) metadata", + "value": "26871" + }, + { + "description": "Jurisdiction Metadata for MTY_14(2020) id 98c3a015-61e6-49fc-89f7-4871c4146f9a", + "key": "98c3a015-61e6-49fc-89f7-4871c4146f9a", + "label": "MTY_14(2020) metadata", + "value": "26872" + }, + { + "description": "Jurisdiction Metadata for MTY_8(2020) id 537d9290-0b44-49f1-93ec-e92076f743a8", + "key": "537d9290-0b44-49f1-93ec-e92076f743a8", + "label": "MTY_8(2020) metadata", + "value": "26873" + }, + { + "description": "Jurisdiction Metadata for MTY_41(2020) id a7eb70d5-4d89-436a-a9cd-2f699b28feb8", + "key": "a7eb70d5-4d89-436a-a9cd-2f699b28feb8", + "label": "MTY_41(2020) metadata", + "value": "26874" + }, + { + "description": "Jurisdiction Metadata for MTY_72(2020) id 201100c4-9d3b-4bf2-84c4-f64bd9f5ac60", + "key": "201100c4-9d3b-4bf2-84c4-f64bd9f5ac60", + "label": "MTY_72(2020) metadata", + "value": "26875" + }, + { + "description": "Jurisdiction Metadata for MTY_4(2020) id 7da2521e-2330-40bf-8f5f-54b3fcbf2544", + "key": "7da2521e-2330-40bf-8f5f-54b3fcbf2544", + "label": "MTY_4(2020) metadata", + "value": "26876" + }, + { + "description": "Jurisdiction Metadata for MTY_12(2020) id 0e33130e-a599-4daf-b92a-3bd4f7d20682", + "key": "0e33130e-a599-4daf-b92a-3bd4f7d20682", + "label": "MTY_12(2020) metadata", + "value": "26877" + }, + { + "description": "Jurisdiction Metadata for MTY_1(2020) id 9fb660c6-966c-43b4-9d13-f2011bbab26d", + "key": "9fb660c6-966c-43b4-9d13-f2011bbab26d", + "label": "MTY_1(2020) metadata", + "value": "26878" + }, + { + "description": "Jurisdiction Metadata for MTY_6(2020) id bba866f2-48bf-4716-a875-3768bdf55c00", + "key": "bba866f2-48bf-4716-a875-3768bdf55c00", + "label": "MTY_6(2020) metadata", + "value": "26879" + }, + { + "description": "Jurisdiction Metadata for MTY_61(2020) id e2580b98-fc88-4b48-ac0c-ac30c0745820", + "key": "e2580b98-fc88-4b48-ac0c-ac30c0745820", + "label": "MTY_61(2020) metadata", + "value": "26880" + }, + { + "description": "Jurisdiction Metadata for MTY_11(2020) id f6e262ad-e2cb-4750-9c79-a6787cbb6620", + "key": "f6e262ad-e2cb-4750-9c79-a6787cbb6620", + "label": "MTY_11(2020) metadata", + "value": "26881" + }, + { + "description": "Jurisdiction Metadata for MTY_32(2020) id 4548de9f-5fa1-46db-a208-1d85f07fee6f", + "key": "4548de9f-5fa1-46db-a208-1d85f07fee6f", + "label": "MTY_32(2020) metadata", + "value": "26882" + }, + { + "description": "Jurisdiction Metadata for Madzaela(2020) id 610c2294-c5ee-43bb-85a7-2f14af70c93e", + "key": "610c2294-c5ee-43bb-85a7-2f14af70c93e", + "label": "Madzaela(2020) metadata", + "value": "26883" + }, + { + "description": "Jurisdiction Metadata for Robby_NHC id 0b2021fe-03ab-4b4d-b529-850e7a2fdca1", + "key": "0b2021fe-03ab-4b4d-b529-850e7a2fdca1", + "label": "Robby_NHC metadata", + "value": "26884" + }, + { + "description": "Jurisdiction Metadata for MDZ_88(2020) id 311c0034-bfba-408b-af88-ff65a561fdb2", + "key": "311c0034-bfba-408b-af88-ff65a561fdb2", + "label": "MDZ_88(2020) metadata", + "value": "26885" + }, + { + "description": "Jurisdiction Metadata for MDZ_96(2020) id ad20e9ff-cf3c-4648-ad53-3138ea7c03dd", + "key": "ad20e9ff-cf3c-4648-ad53-3138ea7c03dd", + "label": "MDZ_96(2020) metadata", + "value": "26886" + }, + { + "description": "Jurisdiction Metadata for MDZ_65(2020) id da5cf948-15d8-4dda-a8a4-40a444875151", + "key": "da5cf948-15d8-4dda-a8a4-40a444875151", + "label": "MDZ_65(2020) metadata", + "value": "26887" + }, + { + "description": "Jurisdiction Metadata for MDZ_63(2020) id 080637e9-0140-4c33-a87d-2da83dc8abbb", + "key": "080637e9-0140-4c33-a87d-2da83dc8abbb", + "label": "MDZ_63(2020) metadata", + "value": "26888" + }, + { + "description": "Jurisdiction Metadata for MDZ_108(2020) id 3d155150-e300-4a96-837e-f29799d6f30c", + "key": "3d155150-e300-4a96-837e-f29799d6f30c", + "label": "MDZ_108(2020) metadata", + "value": "26889" + }, + { + "description": "Jurisdiction Metadata for MDZ_41(2020) id 9ac606bc-50f4-4b3b-9ccc-26dc6290f5b6", + "key": "9ac606bc-50f4-4b3b-9ccc-26dc6290f5b6", + "label": "MDZ_41(2020) metadata", + "value": "26890" + }, + { + "description": "Jurisdiction Metadata for MDZ_16(2020) id e6c63239-2005-4d5b-b325-e2399c22e93d", + "key": "e6c63239-2005-4d5b-b325-e2399c22e93d", + "label": "MDZ_16(2020) metadata", + "value": "26891" + }, + { + "description": "Jurisdiction Metadata for MDZ_48(2020) id c897e235-2a87-4c87-8292-8c2f8c70a2cf", + "key": "c897e235-2a87-4c87-8292-8c2f8c70a2cf", + "label": "MDZ_48(2020) metadata", + "value": "26892" + }, + { + "description": "Jurisdiction Metadata for MDZ_42(2020) id 39a2e639-8756-4f77-bdf5-532dba83f931", + "key": "39a2e639-8756-4f77-bdf5-532dba83f931", + "label": "MDZ_42(2020) metadata", + "value": "26893" + }, + { + "description": "Jurisdiction Metadata for MDZ_33(2020) id 379d0640-f60b-459a-bcf0-94a90ffc6811", + "key": "379d0640-f60b-459a-bcf0-94a90ffc6811", + "label": "MDZ_33(2020) metadata", + "value": "26894" + }, + { + "description": "Jurisdiction Metadata for MDZ_71(2020) id 1d2cba97-8d81-49c2-a2ae-7c8689241cad", + "key": "1d2cba97-8d81-49c2-a2ae-7c8689241cad", + "label": "MDZ_71(2020) metadata", + "value": "26895" + }, + { + "description": "Jurisdiction Metadata for MDZ_84(2020) id faae4b63-3e30-4370-a7df-283242148e07", + "key": "faae4b63-3e30-4370-a7df-283242148e07", + "label": "MDZ_84(2020) metadata", + "value": "26896" + }, + { + "description": "Jurisdiction Metadata for MDZ_59(2020) id 5a3e0851-669f-4c49-9e6d-cf7d69b385d1", + "key": "5a3e0851-669f-4c49-9e6d-cf7d69b385d1", + "label": "MDZ_59(2020) metadata", + "value": "26897" + }, + { + "description": "Jurisdiction Metadata for MDZ_8(2020) id 55824e9a-56a6-4fba-9ea8-cc1567e94cf4", + "key": "55824e9a-56a6-4fba-9ea8-cc1567e94cf4", + "label": "MDZ_8(2020) metadata", + "value": "26898" + }, + { + "description": "Jurisdiction Metadata for MDZ_95(2020) id 83cda347-0c8d-48e2-9c42-48a366da9981", + "key": "83cda347-0c8d-48e2-9c42-48a366da9981", + "label": "MDZ_95(2020) metadata", + "value": "26899" + }, + { + "description": "Jurisdiction Metadata for MDZ_101(2020) id 9e1ea8ce-56b3-4d67-9786-2d08b174c45f", + "key": "9e1ea8ce-56b3-4d67-9786-2d08b174c45f", + "label": "MDZ_101(2020) metadata", + "value": "26900" + }, + { + "description": "Jurisdiction Metadata for MDZ_55(2020) id 05966091-bf9a-4283-9b9b-5563e2b079ce", + "key": "05966091-bf9a-4283-9b9b-5563e2b079ce", + "label": "MDZ_55(2020) metadata", + "value": "26901" + }, + { + "description": "Jurisdiction Metadata for MDZ_109(2020) id edd7ef8f-a5c0-4808-b93e-58ece1d45503", + "key": "edd7ef8f-a5c0-4808-b93e-58ece1d45503", + "label": "MDZ_109(2020) metadata", + "value": "26902" + }, + { + "description": "Jurisdiction Metadata for MDZ_5(2020) id 95876642-6dc7-4924-ae82-b0c7bbaf6185", + "key": "95876642-6dc7-4924-ae82-b0c7bbaf6185", + "label": "MDZ_5(2020) metadata", + "value": "26903" + }, + { + "description": "Jurisdiction Metadata for MDZ_76(2020) id 1a9aa50b-0fa5-4836-86f1-f643ad3b6f7e", + "key": "1a9aa50b-0fa5-4836-86f1-f643ad3b6f7e", + "label": "MDZ_76(2020) metadata", + "value": "26904" + }, + { + "description": "Jurisdiction Metadata for MDZ_72(2020) id b9aa7aa9-48cc-486a-bccb-e06a2e844097", + "key": "b9aa7aa9-48cc-486a-bccb-e06a2e844097", + "label": "MDZ_72(2020) metadata", + "value": "26905" + }, + { + "description": "Jurisdiction Metadata for MDZ_31(2020) id 3ef67edb-7933-4121-b227-416298c89939", + "key": "3ef67edb-7933-4121-b227-416298c89939", + "label": "MDZ_31(2020) metadata", + "value": "26906" + }, + { + "description": "Jurisdiction Metadata for MDZ_2(2020) id 16cdd2a2-0844-4808-a52d-4c84991510a8", + "key": "16cdd2a2-0844-4808-a52d-4c84991510a8", + "label": "MDZ_2(2020) metadata", + "value": "26907" + }, + { + "description": "Jurisdiction Metadata for MDZ_25(2020) id 7abed387-d91f-4aac-862b-f61ad6af66ad", + "key": "7abed387-d91f-4aac-862b-f61ad6af66ad", + "label": "MDZ_25(2020) metadata", + "value": "26908" + }, + { + "description": "Jurisdiction Metadata for MDZ_50(2020) id b547c5c2-be00-4b0e-b651-78b3d1c0461a", + "key": "b547c5c2-be00-4b0e-b651-78b3d1c0461a", + "label": "MDZ_50(2020) metadata", + "value": "26909" + }, + { + "description": "Jurisdiction Metadata for MDZ_20(2020) id 79f466c9-2b61-471d-9a5c-e1ff21cf41cb", + "key": "79f466c9-2b61-471d-9a5c-e1ff21cf41cb", + "label": "MDZ_20(2020) metadata", + "value": "26910" + }, + { + "description": "Jurisdiction Metadata for MDZ_21(2020) id 6d8ab228-b8c0-487d-9759-f14611d0de2c", + "key": "6d8ab228-b8c0-487d-9759-f14611d0de2c", + "label": "MDZ_21(2020) metadata", + "value": "26911" + }, + { + "description": "Jurisdiction Metadata for MDZ_102(2020) id 7eb04c27-d3ee-4610-b180-7714810e97a0", + "key": "7eb04c27-d3ee-4610-b180-7714810e97a0", + "label": "MDZ_102(2020) metadata", + "value": "26912" + }, + { + "description": "Jurisdiction Metadata for MDZ_46(2020) id a93ed444-bb14-42bc-ac91-9ea8c4e4e795", + "key": "a93ed444-bb14-42bc-ac91-9ea8c4e4e795", + "label": "MDZ_46(2020) metadata", + "value": "26913" + }, + { + "description": "Jurisdiction Metadata for MDZ_12(2020) id 56cd9c5d-3482-4cf6-8236-7995593e4ee2", + "key": "56cd9c5d-3482-4cf6-8236-7995593e4ee2", + "label": "MDZ_12(2020) metadata", + "value": "26914" + }, + { + "description": "Jurisdiction Metadata for MDZ_56(2020) id f3392e75-a29e-49fb-ae07-89044ec04e0d", + "key": "f3392e75-a29e-49fb-ae07-89044ec04e0d", + "label": "MDZ_56(2020) metadata", + "value": "26915" + }, + { + "description": "Jurisdiction Metadata for MDZ_75(2020) id b647f272-f672-4487-a865-f5e536128db4", + "key": "b647f272-f672-4487-a865-f5e536128db4", + "label": "MDZ_75(2020) metadata", + "value": "26916" + }, + { + "description": "Jurisdiction Metadata for MDZ_18(2020) id e52de79e-de28-40fb-857e-9bcdba4441e1", + "key": "e52de79e-de28-40fb-857e-9bcdba4441e1", + "label": "MDZ_18(2020) metadata", + "value": "26917" + }, + { + "description": "Jurisdiction Metadata for MDZ_3(2020) id de08a00b-7613-4586-936e-ea488e0b52fd", + "key": "de08a00b-7613-4586-936e-ea488e0b52fd", + "label": "MDZ_3(2020) metadata", + "value": "26918" + }, + { + "description": "Jurisdiction Metadata for MDZ_14(2020) id 38565ade-af3a-46f1-a090-0dc52b622456", + "key": "38565ade-af3a-46f1-a090-0dc52b622456", + "label": "MDZ_14(2020) metadata", + "value": "26919" + }, + { + "description": "Jurisdiction Metadata for MDZ_40(2020) id b861ca2e-d768-47d7-97ab-20c312156536", + "key": "b861ca2e-d768-47d7-97ab-20c312156536", + "label": "MDZ_40(2020) metadata", + "value": "26920" + }, + { + "description": "Jurisdiction Metadata for MDZ_80(2020) id eb96c8d4-4a88-40d0-8bb8-9534dfb2f6e5", + "key": "eb96c8d4-4a88-40d0-8bb8-9534dfb2f6e5", + "label": "MDZ_80(2020) metadata", + "value": "26921" + }, + { + "description": "Jurisdiction Metadata for MDZ_90(2020) id 2362ab2f-9aea-402c-b4cc-deea9f3b1c4d", + "key": "2362ab2f-9aea-402c-b4cc-deea9f3b1c4d", + "label": "MDZ_90(2020) metadata", + "value": "26922" + }, + { + "description": "Jurisdiction Metadata for MDZ_36(2020) id f48f401e-c7d6-47da-a8c0-e52ac132e80a", + "key": "f48f401e-c7d6-47da-a8c0-e52ac132e80a", + "label": "MDZ_36(2020) metadata", + "value": "26923" + }, + { + "description": "Jurisdiction Metadata for MDZ_107(2020) id 5575a953-d7fc-4b01-9c9b-260b1bb36590", + "key": "5575a953-d7fc-4b01-9c9b-260b1bb36590", + "label": "MDZ_107(2020) metadata", + "value": "26924" + }, + { + "description": "Jurisdiction Metadata for MDZ_74(2020) id 173f6212-3949-444d-bb2f-dd121c214173", + "key": "173f6212-3949-444d-bb2f-dd121c214173", + "label": "MDZ_74(2020) metadata", + "value": "26925" + }, + { + "description": "Jurisdiction Metadata for MDZ_23(2020) id 1845ea6d-d4d7-4fb7-b19e-764cefffe5cd", + "key": "1845ea6d-d4d7-4fb7-b19e-764cefffe5cd", + "label": "MDZ_23(2020) metadata", + "value": "26926" + }, + { + "description": "Jurisdiction Metadata for MDZ_38(2020) id a067c665-ff07-4bb7-bf5f-f4e10d9db987", + "key": "a067c665-ff07-4bb7-bf5f-f4e10d9db987", + "label": "MDZ_38(2020) metadata", + "value": "26927" + }, + { + "description": "Jurisdiction Metadata for MDZ_9(2020) id 2f9e7c0f-1e77-41bc-98c5-ead99e3c37b9", + "key": "2f9e7c0f-1e77-41bc-98c5-ead99e3c37b9", + "label": "MDZ_9(2020) metadata", + "value": "26928" + }, + { + "description": "Jurisdiction Metadata for MDZ_94(2020) id b8be45a9-1faf-48ec-b34e-7d3ee16faa15", + "key": "b8be45a9-1faf-48ec-b34e-7d3ee16faa15", + "label": "MDZ_94(2020) metadata", + "value": "26929" + }, + { + "description": "Jurisdiction Metadata for MDZ_15(2020) id e49b5421-68ce-4f33-b5c2-94e65c4743b2", + "key": "e49b5421-68ce-4f33-b5c2-94e65c4743b2", + "label": "MDZ_15(2020) metadata", + "value": "26930" + }, + { + "description": "Jurisdiction Metadata for MDZ_6(2020) id c5ae84ce-15b1-42c2-a254-b7812f20d57a", + "key": "c5ae84ce-15b1-42c2-a254-b7812f20d57a", + "label": "MDZ_6(2020) metadata", + "value": "26931" + }, + { + "description": "Jurisdiction Metadata for MDZ_85(2020) id 8160ecad-1e78-44ef-83cb-a651dbcbfdbf", + "key": "8160ecad-1e78-44ef-83cb-a651dbcbfdbf", + "label": "MDZ_85(2020) metadata", + "value": "26932" + }, + { + "description": "Jurisdiction Metadata for MDZ_4(2020) id 2042a733-2db4-40a9-bcfa-578ffeb11e2e", + "key": "2042a733-2db4-40a9-bcfa-578ffeb11e2e", + "label": "MDZ_4(2020) metadata", + "value": "26933" + }, + { + "description": "Jurisdiction Metadata for MDZ_73(2020) id d67bb377-cb6e-48c7-8cc9-a1908215a00c", + "key": "d67bb377-cb6e-48c7-8cc9-a1908215a00c", + "label": "MDZ_73(2020) metadata", + "value": "26934" + }, + { + "description": "Jurisdiction Metadata for MDZ_62(2020) id 654a0b42-dbbc-4453-814d-30a1459ca4c2", + "key": "654a0b42-dbbc-4453-814d-30a1459ca4c2", + "label": "MDZ_62(2020) metadata", + "value": "26935" + }, + { + "description": "Jurisdiction Metadata for MDZ_47(2020) id a3675630-ebf9-4994-b7c7-4d512fc32b42", + "key": "a3675630-ebf9-4994-b7c7-4d512fc32b42", + "label": "MDZ_47(2020) metadata", + "value": "26936" + }, + { + "description": "Jurisdiction Metadata for MDZ_43(2020) id babebc9e-255d-4dbb-8c1d-9afc4ceb226f", + "key": "babebc9e-255d-4dbb-8c1d-9afc4ceb226f", + "label": "MDZ_43(2020) metadata", + "value": "26937" + }, + { + "description": "Jurisdiction Metadata for MDZ_27(2020) id 2ea49a5a-551f-4710-a5df-c664cc636d60", + "key": "2ea49a5a-551f-4710-a5df-c664cc636d60", + "label": "MDZ_27(2020) metadata", + "value": "26938" + }, + { + "description": "Jurisdiction Metadata for MDZ_98(2020) id bc35c2fa-a2c4-45c1-ae5d-a4e09fa456ef", + "key": "bc35c2fa-a2c4-45c1-ae5d-a4e09fa456ef", + "label": "MDZ_98(2020) metadata", + "value": "26939" + }, + { + "description": "Jurisdiction Metadata for MDZ_52(2020) id ea68bb29-11c4-4b68-a4ea-833c456d73c0", + "key": "ea68bb29-11c4-4b68-a4ea-833c456d73c0", + "label": "MDZ_52(2020) metadata", + "value": "26940" + }, + { + "description": "Jurisdiction Metadata for MDZ_7(2020) id 42ac5b9d-e73c-4972-9e1c-e953f1adee5b", + "key": "42ac5b9d-e73c-4972-9e1c-e953f1adee5b", + "label": "MDZ_7(2020) metadata", + "value": "26941" + }, + { + "description": "Jurisdiction Metadata for MDZ_82(2020) id 7f4a5586-8a4d-41ba-abea-93d73b9cf276", + "key": "7f4a5586-8a4d-41ba-abea-93d73b9cf276", + "label": "MDZ_82(2020) metadata", + "value": "26942" + }, + { + "description": "Jurisdiction Metadata for MDZ_54(2020) id 17974e23-34be-4ccf-a86a-69bb10a4ffbf", + "key": "17974e23-34be-4ccf-a86a-69bb10a4ffbf", + "label": "MDZ_54(2020) metadata", + "value": "26943" + }, + { + "description": "Jurisdiction Metadata for MDZ_64(2020) id 81c454b8-dcfc-462f-952e-00e90afc9beb", + "key": "81c454b8-dcfc-462f-952e-00e90afc9beb", + "label": "MDZ_64(2020) metadata", + "value": "26944" + }, + { + "description": "Jurisdiction Metadata for MDZ_87(2020) id 54734f84-0a61-4c07-b95a-3dfa93eaa03f", + "key": "54734f84-0a61-4c07-b95a-3dfa93eaa03f", + "label": "MDZ_87(2020) metadata", + "value": "26945" + }, + { + "description": "Jurisdiction Metadata for MDZ_83(2020) id e2a4013a-2601-4c8b-a471-5131c2b50568", + "key": "e2a4013a-2601-4c8b-a471-5131c2b50568", + "label": "MDZ_83(2020) metadata", + "value": "26946" + }, + { + "description": "Jurisdiction Metadata for MDZ_58(2020) id 22b0327a-3bde-49c1-b36a-c397e3f35a97", + "key": "22b0327a-3bde-49c1-b36a-c397e3f35a97", + "label": "MDZ_58(2020) metadata", + "value": "26947" + }, + { + "description": "Jurisdiction Metadata for MDZ_13(2020) id 344efad9-39d9-44b2-bf0e-4939fba0d357", + "key": "344efad9-39d9-44b2-bf0e-4939fba0d357", + "label": "MDZ_13(2020) metadata", + "value": "26948" + }, + { + "description": "Jurisdiction Metadata for MDZ_89(2020) id 61fcd075-a9db-433b-91ac-aba7d2348eae", + "key": "61fcd075-a9db-433b-91ac-aba7d2348eae", + "label": "MDZ_89(2020) metadata", + "value": "26949" + }, + { + "description": "Jurisdiction Metadata for MDZ_17(2020) id 12c9cc2b-22a7-45bc-be14-42243337580c", + "key": "12c9cc2b-22a7-45bc-be14-42243337580c", + "label": "MDZ_17(2020) metadata", + "value": "26950" + }, + { + "description": "Jurisdiction Metadata for MDZ_45(2020) id 11ef8ef5-9cdb-49f2-9f0e-c50d15055b6f", + "key": "11ef8ef5-9cdb-49f2-9f0e-c50d15055b6f", + "label": "MDZ_45(2020) metadata", + "value": "26951" + }, + { + "description": "Jurisdiction Metadata for MDZ_91(2020) id 4cfb698b-6237-4546-84cb-6f1e6bfda297", + "key": "4cfb698b-6237-4546-84cb-6f1e6bfda297", + "label": "MDZ_91(2020) metadata", + "value": "26952" + }, + { + "description": "Jurisdiction Metadata for MDZ_1(2020) id 3451ef70-e0f1-44d0-877e-23b94287187d", + "key": "3451ef70-e0f1-44d0-877e-23b94287187d", + "label": "MDZ_1(2020) metadata", + "value": "26953" + }, + { + "description": "Jurisdiction Metadata for MDZ_105(2020) id b829d7ee-676f-46db-845c-99c46f8d1a5b", + "key": "b829d7ee-676f-46db-845c-99c46f8d1a5b", + "label": "MDZ_105(2020) metadata", + "value": "26954" + }, + { + "description": "Jurisdiction Metadata for MDZ_99(2020) id 66e11813-84e5-4a7b-b017-432ce6b58469", + "key": "66e11813-84e5-4a7b-b017-432ce6b58469", + "label": "MDZ_99(2020) metadata", + "value": "26955" + }, + { + "description": "Jurisdiction Metadata for MDZ_60(2020) id 20ea9455-41be-47e2-9dca-1c0dad336c09", + "key": "20ea9455-41be-47e2-9dca-1c0dad336c09", + "label": "MDZ_60(2020) metadata", + "value": "26956" + }, + { + "description": "Jurisdiction Metadata for MDZ_86(2020) id 1f91c7b1-1228-490c-bbf3-610e2d0ce23a", + "key": "1f91c7b1-1228-490c-bbf3-610e2d0ce23a", + "label": "MDZ_86(2020) metadata", + "value": "26957" + }, + { + "description": "Jurisdiction Metadata for MDZ_61(2020) id b33db197-06ea-4399-b095-f2804008a9d0", + "key": "b33db197-06ea-4399-b095-f2804008a9d0", + "label": "MDZ_61(2020) metadata", + "value": "26958" + }, + { + "description": "Jurisdiction Metadata for MDZ_97(2020) id aaabf13e-0ea1-4598-b3a7-4c17e8660a4d", + "key": "aaabf13e-0ea1-4598-b3a7-4c17e8660a4d", + "label": "MDZ_97(2020) metadata", + "value": "26959" + }, + { + "description": "Jurisdiction Metadata for MDZ_106(2020) id 455abd34-3b6b-4e07-acf1-0bb2c3dd3a48", + "key": "455abd34-3b6b-4e07-acf1-0bb2c3dd3a48", + "label": "MDZ_106(2020) metadata", + "value": "26960" + }, + { + "description": "Jurisdiction Metadata for MDZ_70(2020) id 569ef1a2-013d-4266-9dac-23d321919267", + "key": "569ef1a2-013d-4266-9dac-23d321919267", + "label": "MDZ_70(2020) metadata", + "value": "26961" + }, + { + "description": "Jurisdiction Metadata for MDZ_66(2020) id 0d40b874-0cee-4c61-a387-606f3034380a", + "key": "0d40b874-0cee-4c61-a387-606f3034380a", + "label": "MDZ_66(2020) metadata", + "value": "26962" + }, + { + "description": "Jurisdiction Metadata for MDZ_30(2020) id 090504de-3547-43a3-8b56-28fa8f1b168d", + "key": "090504de-3547-43a3-8b56-28fa8f1b168d", + "label": "MDZ_30(2020) metadata", + "value": "26963" + }, + { + "description": "Jurisdiction Metadata for MDZ_29(2020) id c59cfef1-67df-4218-a916-282ee9654798", + "key": "c59cfef1-67df-4218-a916-282ee9654798", + "label": "MDZ_29(2020) metadata", + "value": "26964" + }, + { + "description": "Jurisdiction Metadata for MDZ_100(2020) id a4811ddd-88fe-4837-8bf6-5aefc3a5c5a7", + "key": "a4811ddd-88fe-4837-8bf6-5aefc3a5c5a7", + "label": "MDZ_100(2020) metadata", + "value": "26965" + }, + { + "description": "Jurisdiction Metadata for MDZ_53(2020) id 1a812720-8d56-4b7e-b9aa-61760708b296", + "key": "1a812720-8d56-4b7e-b9aa-61760708b296", + "label": "MDZ_53(2020) metadata", + "value": "26966" + }, + { + "description": "Jurisdiction Metadata for MDZ_34(2020) id 5132f9b1-ea00-4bac-ab8b-8f71248c545f", + "key": "5132f9b1-ea00-4bac-ab8b-8f71248c545f", + "label": "MDZ_34(2020) metadata", + "value": "26967" + }, + { + "description": "Jurisdiction Metadata for MDZ_67(2020) id 06b21d80-2f53-4572-b39b-abbf66548887", + "key": "06b21d80-2f53-4572-b39b-abbf66548887", + "label": "MDZ_67(2020) metadata", + "value": "26968" + }, + { + "description": "Jurisdiction Metadata for MDZ_22(2020) id 28c7dde5-a299-4049-8189-5662a2377b6a", + "key": "28c7dde5-a299-4049-8189-5662a2377b6a", + "label": "MDZ_22(2020) metadata", + "value": "26969" + }, + { + "description": "Jurisdiction Metadata for MDZ_79(2020) id 9d874dcb-a762-41a1-9a68-57c48a6f0f5d", + "key": "9d874dcb-a762-41a1-9a68-57c48a6f0f5d", + "label": "MDZ_79(2020) metadata", + "value": "26970" + }, + { + "description": "Jurisdiction Metadata for MDZ_35(2020) id f689d7c9-f02e-4254-b4c1-689284c2207a", + "key": "f689d7c9-f02e-4254-b4c1-689284c2207a", + "label": "MDZ_35(2020) metadata", + "value": "26971" + }, + { + "description": "Jurisdiction Metadata for MDZ_37(2020) id c54fbdac-6b2c-402e-b987-623ad143a05b", + "key": "c54fbdac-6b2c-402e-b987-623ad143a05b", + "label": "MDZ_37(2020) metadata", + "value": "26972" + }, + { + "description": "Jurisdiction Metadata for MDZ_111(2020) id c1f46443-6bbf-45cf-89a3-bc9663b1f95d", + "key": "c1f46443-6bbf-45cf-89a3-bc9663b1f95d", + "label": "MDZ_111(2020) metadata", + "value": "26973" + }, + { + "description": "Jurisdiction Metadata for MDZ_110(2020) id f0aee417-49f8-430e-8384-f3936486bf7b", + "key": "f0aee417-49f8-430e-8384-f3936486bf7b", + "label": "MDZ_110(2020) metadata", + "value": "26974" + }, + { + "description": "Jurisdiction Metadata for MDZ_103(2020) id 1748bed6-9490-416a-833c-a8612323d6ef", + "key": "1748bed6-9490-416a-833c-a8612323d6ef", + "label": "MDZ_103(2020) metadata", + "value": "26975" + }, + { + "description": "Jurisdiction Metadata for MDZ_28(2020) id 048661de-3d39-4f7e-812f-d9dde54d0deb", + "key": "048661de-3d39-4f7e-812f-d9dde54d0deb", + "label": "MDZ_28(2020) metadata", + "value": "26976" + }, + { + "description": "Jurisdiction Metadata for MDZ_11(2020) id dd2db678-aa4a-4170-b92a-b38749739392", + "key": "dd2db678-aa4a-4170-b92a-b38749739392", + "label": "MDZ_11(2020) metadata", + "value": "26977" + }, + { + "description": "Jurisdiction Metadata for MDZ_44(2020) id b77b808b-38d6-4288-87a9-186a0074aaf1", + "key": "b77b808b-38d6-4288-87a9-186a0074aaf1", + "label": "MDZ_44(2020) metadata", + "value": "26978" + }, + { + "description": "Jurisdiction Metadata for MDZ_49(2020) id f87e8df3-29b2-4848-9900-46045688542c", + "key": "f87e8df3-29b2-4848-9900-46045688542c", + "label": "MDZ_49(2020) metadata", + "value": "26979" + }, + { + "description": "Jurisdiction Metadata for MDZ_81(2020) id 781a7fc9-dff3-4d45-85b2-43d1ae022ae7", + "key": "781a7fc9-dff3-4d45-85b2-43d1ae022ae7", + "label": "MDZ_81(2020) metadata", + "value": "26980" + }, + { + "description": "Jurisdiction Metadata for MDZ_39(2020) id 968dcd10-63b7-4476-828c-b854038eef39", + "key": "968dcd10-63b7-4476-828c-b854038eef39", + "label": "MDZ_39(2020) metadata", + "value": "26981" + }, + { + "description": "Jurisdiction Metadata for MDZ_78(2020) id 6a3fc7af-4613-4385-9e9d-1228b207b6c9", + "key": "6a3fc7af-4613-4385-9e9d-1228b207b6c9", + "label": "MDZ_78(2020) metadata", + "value": "26982" + }, + { + "description": "Jurisdiction Metadata for MDZ_92(2020) id db7bb659-fadc-4459-85e6-ba5cc02cb684", + "key": "db7bb659-fadc-4459-85e6-ba5cc02cb684", + "label": "MDZ_92(2020) metadata", + "value": "26983" + }, + { + "description": "Jurisdiction Metadata for MDZ_19(2020) id b1404075-90a4-4a18-b4ec-42589ba6e9bb", + "key": "b1404075-90a4-4a18-b4ec-42589ba6e9bb", + "label": "MDZ_19(2020) metadata", + "value": "26984" + }, + { + "description": "Jurisdiction Metadata for MDZ_69(2020) id ea4c385e-834a-40f3-bc5e-7979bdddf377", + "key": "ea4c385e-834a-40f3-bc5e-7979bdddf377", + "label": "MDZ_69(2020) metadata", + "value": "26985" + }, + { + "description": "Jurisdiction Metadata for MDZ_26(2020) id 54a2163e-fb97-4980-b8cd-0082a7b4c780", + "key": "54a2163e-fb97-4980-b8cd-0082a7b4c780", + "label": "MDZ_26(2020) metadata", + "value": "26986" + }, + { + "description": "Jurisdiction Metadata for MDZ_10(2020) id 019da98e-59fe-4cd0-a6e1-48b9706d8dd6", + "key": "019da98e-59fe-4cd0-a6e1-48b9706d8dd6", + "label": "MDZ_10(2020) metadata", + "value": "26987" + }, + { + "description": "Jurisdiction Metadata for MDZ_104(2020) id 3c4f93a9-4665-459f-af47-b01386816bc7", + "key": "3c4f93a9-4665-459f-af47-b01386816bc7", + "label": "MDZ_104(2020) metadata", + "value": "26988" + }, + { + "description": "Jurisdiction Metadata for MDZ_57(2020) id 8a129653-7a34-4448-a9b4-65b8d459a3c2", + "key": "8a129653-7a34-4448-a9b4-65b8d459a3c2", + "label": "MDZ_57(2020) metadata", + "value": "26989" + }, + { + "description": "Jurisdiction Metadata for MDZ_77(2020) id 10e5292e-e17d-48c7-90d9-ae28fb3ae24c", + "key": "10e5292e-e17d-48c7-90d9-ae28fb3ae24c", + "label": "MDZ_77(2020) metadata", + "value": "26990" + }, + { + "description": "Jurisdiction Metadata for MDZ_24(2020) id cf892f2d-761d-4c19-a5bf-da24aa86cca8", + "key": "cf892f2d-761d-4c19-a5bf-da24aa86cca8", + "label": "MDZ_24(2020) metadata", + "value": "26991" + }, + { + "description": "Jurisdiction Metadata for MDZ_68(2020) id b26124a8-09ef-4364-9d41-2326a44cdf5c", + "key": "b26124a8-09ef-4364-9d41-2326a44cdf5c", + "label": "MDZ_68(2020) metadata", + "value": "26992" + }, + { + "description": "Jurisdiction Metadata for MDZ_93(2020) id 8e830d10-7b1c-4add-97e4-249596ae5417", + "key": "8e830d10-7b1c-4add-97e4-249596ae5417", + "label": "MDZ_93(2020) metadata", + "value": "26993" + }, + { + "description": "Jurisdiction Metadata for MDZ_32(2020) id 309fae64-a6b5-4a7f-b7c6-e9d8c2ad8ff6", + "key": "309fae64-a6b5-4a7f-b7c6-e9d8c2ad8ff6", + "label": "MDZ_32(2020) metadata", + "value": "26994" + }, + { + "description": "Jurisdiction Metadata for MDZ_51(2020) id 0d3998e5-5d4d-43fc-95e4-7948cf599cea", + "key": "0d3998e5-5d4d-43fc-95e4-7948cf599cea", + "label": "MDZ_51(2020) metadata", + "value": "26995" + }, + { + "description": "Jurisdiction Metadata for Naviluli(2020) id fb370c3f-62d0-4ff1-b721-92bcc0e48820", + "key": "fb370c3f-62d0-4ff1-b721-92bcc0e48820", + "label": "Naviluli(2020) metadata", + "value": "26996" + }, + { + "description": "Jurisdiction Metadata for Chimutnde NHC id da372dbc-3d7e-4abe-a8c1-0ec97ccbec9f", + "key": "da372dbc-3d7e-4abe-a8c1-0ec97ccbec9f", + "label": "Chimutnde NHC metadata", + "value": "26997" + }, + { + "description": "Jurisdiction Metadata for NVI_28(2020) id 9cc00f20-e6e9-442d-9434-ac9aafdd0d5c", + "key": "9cc00f20-e6e9-442d-9434-ac9aafdd0d5c", + "label": "NVI_28(2020) metadata", + "value": "26998" + }, + { + "description": "Jurisdiction Metadata for NVI_32(2020) id 301a8e5b-20ec-47d3-86ca-2e2ed5099d17", + "key": "301a8e5b-20ec-47d3-86ca-2e2ed5099d17", + "label": "NVI_32(2020) metadata", + "value": "26999" + }, + { + "description": "Jurisdiction Metadata for NVI_48(2020) id b46ccc1e-e1ae-4cd0-b621-98924807c50b", + "key": "b46ccc1e-e1ae-4cd0-b621-98924807c50b", + "label": "NVI_48(2020) metadata", + "value": "27000" + }, + { + "description": "Jurisdiction Metadata for NVI_2(2020) id ff04843f-81b8-417e-833d-3d216568a7dd", + "key": "ff04843f-81b8-417e-833d-3d216568a7dd", + "label": "NVI_2(2020) metadata", + "value": "27001" + }, + { + "description": "Jurisdiction Metadata for NVI_21(2020) id 0b1533c0-99f5-4448-a4dc-ea3361958e82", + "key": "0b1533c0-99f5-4448-a4dc-ea3361958e82", + "label": "NVI_21(2020) metadata", + "value": "27002" + }, + { + "description": "Jurisdiction Metadata for NVI_11(2020) id 40bd4362-7749-4358-934e-d017b81c4ea4", + "key": "40bd4362-7749-4358-934e-d017b81c4ea4", + "label": "NVI_11(2020) metadata", + "value": "27003" + }, + { + "description": "Jurisdiction Metadata for NVI_30(2020) id 2a579050-06ed-4b71-8953-fae23ab46df4", + "key": "2a579050-06ed-4b71-8953-fae23ab46df4", + "label": "NVI_30(2020) metadata", + "value": "27004" + }, + { + "description": "Jurisdiction Metadata for NVI_40(2020) id 5c30ba5f-5791-4ed0-a17f-841669cb19d8", + "key": "5c30ba5f-5791-4ed0-a17f-841669cb19d8", + "label": "NVI_40(2020) metadata", + "value": "27005" + }, + { + "description": "Jurisdiction Metadata for NVI_45(2020) id cd369a6c-ac1d-4389-b77e-16fbd3e46e6d", + "key": "cd369a6c-ac1d-4389-b77e-16fbd3e46e6d", + "label": "NVI_45(2020) metadata", + "value": "27006" + }, + { + "description": "Jurisdiction Metadata for NVI_25(2020) id 75dcf885-6e40-4130-a346-ca3706714392", + "key": "75dcf885-6e40-4130-a346-ca3706714392", + "label": "NVI_25(2020) metadata", + "value": "27007" + }, + { + "description": "Jurisdiction Metadata for NVI_8(2020) id 76be3a6e-c4b4-4815-ae99-1a30442ca6d2", + "key": "76be3a6e-c4b4-4815-ae99-1a30442ca6d2", + "label": "NVI_8(2020) metadata", + "value": "27008" + }, + { + "description": "Jurisdiction Metadata for NVI_49(2020) id 9ae450a7-1e03-473c-8014-c420b472d453", + "key": "9ae450a7-1e03-473c-8014-c420b472d453", + "label": "NVI_49(2020) metadata", + "value": "27009" + }, + { + "description": "Jurisdiction Metadata for NVI_43(2020) id 5f3df4c8-78a5-4307-a634-5ce258bb63c4", + "key": "5f3df4c8-78a5-4307-a634-5ce258bb63c4", + "label": "NVI_43(2020) metadata", + "value": "27010" + }, + { + "description": "Jurisdiction Metadata for NVI_44(2020) id e5d60731-c01b-450b-893c-28d5b597cddf", + "key": "e5d60731-c01b-450b-893c-28d5b597cddf", + "label": "NVI_44(2020) metadata", + "value": "27011" + }, + { + "description": "Jurisdiction Metadata for NVI_7(2020) id 2bc3816e-7c2f-44a7-a13e-c9570dc71813", + "key": "2bc3816e-7c2f-44a7-a13e-c9570dc71813", + "label": "NVI_7(2020) metadata", + "value": "27012" + }, + { + "description": "Jurisdiction Metadata for NVI_18(2020) id 3a9107e9-27dd-438a-bbc7-592f16d0862e", + "key": "3a9107e9-27dd-438a-bbc7-592f16d0862e", + "label": "NVI_18(2020) metadata", + "value": "27013" + }, + { + "description": "Jurisdiction Metadata for NVI_47(2020) id 2fc2f70f-3f21-4f83-92c6-9ce9229dd03b", + "key": "2fc2f70f-3f21-4f83-92c6-9ce9229dd03b", + "label": "NVI_47(2020) metadata", + "value": "27014" + }, + { + "description": "Jurisdiction Metadata for NVI_6(2020) id 61ee8bb3-ae09-4822-b060-8e37f9982975", + "key": "61ee8bb3-ae09-4822-b060-8e37f9982975", + "label": "NVI_6(2020) metadata", + "value": "27015" + }, + { + "description": "Jurisdiction Metadata for NVI_1(2020) id 63964eec-fd2a-4657-9e14-03fc53549c49", + "key": "63964eec-fd2a-4657-9e14-03fc53549c49", + "label": "NVI_1(2020) metadata", + "value": "27016" + }, + { + "description": "Jurisdiction Metadata for NVI_23(2020) id 6cfafe50-4855-45ce-8c77-88392c9089ec", + "key": "6cfafe50-4855-45ce-8c77-88392c9089ec", + "label": "NVI_23(2020) metadata", + "value": "27017" + }, + { + "description": "Jurisdiction Metadata for NVI_14(2020) id 74f0ae3b-d77c-4b61-9957-aa6af4ddb94b", + "key": "74f0ae3b-d77c-4b61-9957-aa6af4ddb94b", + "label": "NVI_14(2020) metadata", + "value": "27018" + }, + { + "description": "Jurisdiction Metadata for NVI_35(2020) id 29b01a39-1346-4f07-8dd9-0ff052d8c938", + "key": "29b01a39-1346-4f07-8dd9-0ff052d8c938", + "label": "NVI_35(2020) metadata", + "value": "27019" + }, + { + "description": "Jurisdiction Metadata for NVI_50(2020) id 34323f33-2b7d-4b42-8b57-cf26d198d450", + "key": "34323f33-2b7d-4b42-8b57-cf26d198d450", + "label": "NVI_50(2020) metadata", + "value": "27020" + }, + { + "description": "Jurisdiction Metadata for NVI_19(2020) id a14fb6bf-391f-4df9-b920-0418b9606424", + "key": "a14fb6bf-391f-4df9-b920-0418b9606424", + "label": "NVI_19(2020) metadata", + "value": "27021" + }, + { + "description": "Jurisdiction Metadata for NVI_17(2020) id 8649461e-6653-45c8-a5b0-1b3c8a93a174", + "key": "8649461e-6653-45c8-a5b0-1b3c8a93a174", + "label": "NVI_17(2020) metadata", + "value": "27022" + }, + { + "description": "Jurisdiction Metadata for NVI_10(2020) id f2f10aaa-306c-4dc6-b670-4af887852747", + "key": "f2f10aaa-306c-4dc6-b670-4af887852747", + "label": "NVI_10(2020) metadata", + "value": "27023" + }, + { + "description": "Jurisdiction Metadata for NVI_16(2020) id 7db9734c-73fd-4a99-a0fe-d1eb8be38536", + "key": "7db9734c-73fd-4a99-a0fe-d1eb8be38536", + "label": "NVI_16(2020) metadata", + "value": "27024" + }, + { + "description": "Jurisdiction Metadata for NVI_4(2020) id ae34843b-21bb-4190-9d35-f3e9407661bd", + "key": "ae34843b-21bb-4190-9d35-f3e9407661bd", + "label": "NVI_4(2020) metadata", + "value": "27025" + }, + { + "description": "Jurisdiction Metadata for NVI_3(2020) id 8c8e6900-bdc7-4a16-8699-0bb9c1b83f98", + "key": "8c8e6900-bdc7-4a16-8699-0bb9c1b83f98", + "label": "NVI_3(2020) metadata", + "value": "27026" + }, + { + "description": "Jurisdiction Metadata for NVI_26(2020) id ba6229d1-9141-427d-a00a-23b886507a4d", + "key": "ba6229d1-9141-427d-a00a-23b886507a4d", + "label": "NVI_26(2020) metadata", + "value": "27027" + }, + { + "description": "Jurisdiction Metadata for NVI_15(2020) id a8029f0e-14b0-4f61-bbe8-c531979c82c6", + "key": "a8029f0e-14b0-4f61-bbe8-c531979c82c6", + "label": "NVI_15(2020) metadata", + "value": "27028" + }, + { + "description": "Jurisdiction Metadata for NVI_12(2020) id f0657ef2-8eac-4a11-9236-dc7ed68b0a5a", + "key": "f0657ef2-8eac-4a11-9236-dc7ed68b0a5a", + "label": "NVI_12(2020) metadata", + "value": "27029" + }, + { + "description": "Jurisdiction Metadata for NVI_46(2020) id 1d91c242-49c8-4b18-8349-49d60d845097", + "key": "1d91c242-49c8-4b18-8349-49d60d845097", + "label": "NVI_46(2020) metadata", + "value": "27030" + }, + { + "description": "Jurisdiction Metadata for NVI_36(2020) id a98d1c65-e63f-4871-9252-4a4788ed9aca", + "key": "a98d1c65-e63f-4871-9252-4a4788ed9aca", + "label": "NVI_36(2020) metadata", + "value": "27031" + }, + { + "description": "Jurisdiction Metadata for NVI_33(2020) id 7a50d98b-827a-41b1-ab69-91d16310dc46", + "key": "7a50d98b-827a-41b1-ab69-91d16310dc46", + "label": "NVI_33(2020) metadata", + "value": "27032" + }, + { + "description": "Jurisdiction Metadata for NVI_34(2020) id 9622b1b1-34fa-4bae-971e-0276f2250dfd", + "key": "9622b1b1-34fa-4bae-971e-0276f2250dfd", + "label": "NVI_34(2020) metadata", + "value": "27033" + }, + { + "description": "Jurisdiction Metadata for NVI_39(2020) id 7ad6c5f5-4b29-4063-b978-bb02e93fcbd7", + "key": "7ad6c5f5-4b29-4063-b978-bb02e93fcbd7", + "label": "NVI_39(2020) metadata", + "value": "27034" + }, + { + "description": "Jurisdiction Metadata for NVI_41(2020) id c32b9414-b831-494b-ab88-514500d27e33", + "key": "c32b9414-b831-494b-ab88-514500d27e33", + "label": "NVI_41(2020) metadata", + "value": "27035" + }, + { + "description": "Jurisdiction Metadata for NVI_5(2020) id c12f0b5b-fc5d-412c-b479-b4cc4225240c", + "key": "c12f0b5b-fc5d-412c-b479-b4cc4225240c", + "label": "NVI_5(2020) metadata", + "value": "27036" + }, + { + "description": "Jurisdiction Metadata for NVI_24(2020) id 164f48c1-6367-4260-a6c3-68d0cc81ce9c", + "key": "164f48c1-6367-4260-a6c3-68d0cc81ce9c", + "label": "NVI_24(2020) metadata", + "value": "27037" + }, + { + "description": "Jurisdiction Metadata for NVI_13(2020) id 36fa7b46-2471-460a-89eb-2ca9bea062bd", + "key": "36fa7b46-2471-460a-89eb-2ca9bea062bd", + "label": "NVI_13(2020) metadata", + "value": "27038" + }, + { + "description": "Jurisdiction Metadata for NVI_20(2020) id 9d562276-960e-484f-80fb-a5593552c68e", + "key": "9d562276-960e-484f-80fb-a5593552c68e", + "label": "NVI_20(2020) metadata", + "value": "27039" + }, + { + "description": "Jurisdiction Metadata for NVI_38(2020) id be2ab43d-3631-49f2-b880-c976585da8e5", + "key": "be2ab43d-3631-49f2-b880-c976585da8e5", + "label": "NVI_38(2020) metadata", + "value": "27040" + }, + { + "description": "Jurisdiction Metadata for NVI_22(2020) id c8946b6c-926d-4b2a-be56-be82b541e3db", + "key": "c8946b6c-926d-4b2a-be56-be82b541e3db", + "label": "NVI_22(2020) metadata", + "value": "27041" + }, + { + "description": "Jurisdiction Metadata for NVI_27(2020) id 14c3dbd5-2c20-4d23-be85-001e70a7743a", + "key": "14c3dbd5-2c20-4d23-be85-001e70a7743a", + "label": "NVI_27(2020) metadata", + "value": "27042" + }, + { + "description": "Jurisdiction Metadata for NVI_29(2020) id 60ef3b51-3ccd-4b08-8a66-7da26bcc6a66", + "key": "60ef3b51-3ccd-4b08-8a66-7da26bcc6a66", + "label": "NVI_29(2020) metadata", + "value": "27043" + }, + { + "description": "Jurisdiction Metadata for NVI_9(2020) id 76cea488-7cbc-4661-8c32-64bed21ad440", + "key": "76cea488-7cbc-4661-8c32-64bed21ad440", + "label": "NVI_9(2020) metadata", + "value": "27044" + }, + { + "description": "Jurisdiction Metadata for NVI_42(2020) id fa54b917-2009-457d-9e58-71b135e72696", + "key": "fa54b917-2009-457d-9e58-71b135e72696", + "label": "NVI_42(2020) metadata", + "value": "27045" + }, + { + "description": "Jurisdiction Metadata for NVI_31(2020) id 2cc17270-f872-42a9-9862-54fccf2b6b99", + "key": "2cc17270-f872-42a9-9862-54fccf2b6b99", + "label": "NVI_31(2020) metadata", + "value": "27046" + }, + { + "description": "Jurisdiction Metadata for NVI_37(2020) id f2cb7b68-4bad-450c-a349-bb1d5865a240", + "key": "f2cb7b68-4bad-450c-a349-bb1d5865a240", + "label": "NVI_37(2020) metadata", + "value": "27047" + }, + { + "description": "Jurisdiction Metadata for Chadiza(2020) id 33b21665-8280-4de1-99e5-5954aaefa1a0", + "key": "33b21665-8280-4de1-99e5-5954aaefa1a0", + "label": "Chadiza(2020) metadata", + "value": "27048" + }, + { + "description": "Jurisdiction Metadata for Changaya NHC id 94ff1372-a69d-4397-b3fb-45ab6525f89a", + "key": "94ff1372-a69d-4397-b3fb-45ab6525f89a", + "label": "Changaya NHC metadata", + "value": "27049" + }, + { + "description": "Jurisdiction Metadata for CDZ_34(2020) id 3f6e7cb8-b28f-44b3-9512-25177ecc794d", + "key": "3f6e7cb8-b28f-44b3-9512-25177ecc794d", + "label": "CDZ_34(2020) metadata", + "value": "27050" + }, + { + "description": "Jurisdiction Metadata for CDZ_20(2020) id 416c9219-5f9d-47a9-a3b2-a8ba7f59a462", + "key": "416c9219-5f9d-47a9-a3b2-a8ba7f59a462", + "label": "CDZ_20(2020) metadata", + "value": "27051" + }, + { + "description": "Jurisdiction Metadata for CDZ_35(2020) id 9d1f64bc-2012-4293-a1bf-f87f1405ed25", + "key": "9d1f64bc-2012-4293-a1bf-f87f1405ed25", + "label": "CDZ_35(2020) metadata", + "value": "27052" + }, + { + "description": "Jurisdiction Metadata for CDZ_36(2020) id 20777539-8310-4cb3-9e94-acfdd0f84488", + "key": "20777539-8310-4cb3-9e94-acfdd0f84488", + "label": "CDZ_36(2020) metadata", + "value": "27053" + }, + { + "description": "Jurisdiction Metadata for CDZ_39(2020) id 822c02d7-9e68-4eb1-a134-064369d4ca9d", + "key": "822c02d7-9e68-4eb1-a134-064369d4ca9d", + "label": "CDZ_39(2020) metadata", + "value": "27054" + }, + { + "description": "Jurisdiction Metadata for CDZ_48(2020) id b7219355-df14-4b1b-8684-0cf86a02147b", + "key": "b7219355-df14-4b1b-8684-0cf86a02147b", + "label": "CDZ_48(2020) metadata", + "value": "27055" + }, + { + "description": "Jurisdiction Metadata for CDZ_28(2020) id 1e71687d-8837-4dc4-8fe1-d106172f9d52", + "key": "1e71687d-8837-4dc4-8fe1-d106172f9d52", + "label": "CDZ_28(2020) metadata", + "value": "27056" + }, + { + "description": "Jurisdiction Metadata for CDZ_56(2020) id 9cb766bf-2957-4c3f-b1cc-28d8e16b8790", + "key": "9cb766bf-2957-4c3f-b1cc-28d8e16b8790", + "label": "CDZ_56(2020) metadata", + "value": "27057" + }, + { + "description": "Jurisdiction Metadata for CDZ_60(2020) id ec2f922c-03c3-47f8-bbe3-ea8ad019bf50", + "key": "ec2f922c-03c3-47f8-bbe3-ea8ad019bf50", + "label": "CDZ_60(2020) metadata", + "value": "27058" + }, + { + "description": "Jurisdiction Metadata for CDZ_46(2020) id 2cdea62b-e6e1-4c4d-9f3d-b39a90bcaf0c", + "key": "2cdea62b-e6e1-4c4d-9f3d-b39a90bcaf0c", + "label": "CDZ_46(2020) metadata", + "value": "27059" + }, + { + "description": "Jurisdiction Metadata for CDZ_69(2020) id fb5a3706-9c7c-4b61-ace5-0c906af50936", + "key": "fb5a3706-9c7c-4b61-ace5-0c906af50936", + "label": "CDZ_69(2020) metadata", + "value": "27060" + }, + { + "description": "Jurisdiction Metadata for CDZ_3(2020) id f7c54263-7c16-4ee1-b6ee-f8865cf9bd6f", + "key": "f7c54263-7c16-4ee1-b6ee-f8865cf9bd6f", + "label": "CDZ_3(2020) metadata", + "value": "27061" + }, + { + "description": "Jurisdiction Metadata for CDZ_26(2020) id 649fd5df-8525-4572-a07b-1ba15600f53e", + "key": "649fd5df-8525-4572-a07b-1ba15600f53e", + "label": "CDZ_26(2020) metadata", + "value": "27062" + }, + { + "description": "Jurisdiction Metadata for CDZ_55(2020) id 1649e71f-b441-4252-975b-208e2f5b7669", + "key": "1649e71f-b441-4252-975b-208e2f5b7669", + "label": "CDZ_55(2020) metadata", + "value": "27063" + }, + { + "description": "Jurisdiction Metadata for CDZ_7(2020) id dc4647f7-0f12-45a7-9cc8-051cdfeb4b3f", + "key": "dc4647f7-0f12-45a7-9cc8-051cdfeb4b3f", + "label": "CDZ_7(2020) metadata", + "value": "27064" + }, + { + "description": "Jurisdiction Metadata for CDZ_22(2020) id bcfc674a-4841-4112-84fd-dc727a36f4f3", + "key": "bcfc674a-4841-4112-84fd-dc727a36f4f3", + "label": "CDZ_22(2020) metadata", + "value": "27065" + }, + { + "description": "Jurisdiction Metadata for CDZ_47(2020) id e1a3405c-1988-4de7-bbb4-5495ba5d080d", + "key": "e1a3405c-1988-4de7-bbb4-5495ba5d080d", + "label": "CDZ_47(2020) metadata", + "value": "27066" + }, + { + "description": "Jurisdiction Metadata for CDZ_14(2020) id a117f528-30e7-40c4-b10c-2c22eb9b9f48", + "key": "a117f528-30e7-40c4-b10c-2c22eb9b9f48", + "label": "CDZ_14(2020) metadata", + "value": "27067" + }, + { + "description": "Jurisdiction Metadata for CDZ_40(2020) id 31f5e80b-6821-4f91-9f48-3caede1bc83d", + "key": "31f5e80b-6821-4f91-9f48-3caede1bc83d", + "label": "CDZ_40(2020) metadata", + "value": "27068" + }, + { + "description": "Jurisdiction Metadata for CDZ_23(2020) id 029762bf-04ed-4ec2-bbb6-1c001ccc6347", + "key": "029762bf-04ed-4ec2-bbb6-1c001ccc6347", + "label": "CDZ_23(2020) metadata", + "value": "27069" + }, + { + "description": "Jurisdiction Metadata for CDZ_57(2020) id 75933052-f1b1-451c-838f-33cbef8cfdc8", + "key": "75933052-f1b1-451c-838f-33cbef8cfdc8", + "label": "CDZ_57(2020) metadata", + "value": "27070" + }, + { + "description": "Jurisdiction Metadata for CDZ_17(2020) id 144aca10-35ea-4acc-a7b5-6b257726b763", + "key": "144aca10-35ea-4acc-a7b5-6b257726b763", + "label": "CDZ_17(2020) metadata", + "value": "27071" + }, + { + "description": "Jurisdiction Metadata for CDZ_64(2020) id 0efc0904-a701-4238-a372-c833665ea872", + "key": "0efc0904-a701-4238-a372-c833665ea872", + "label": "CDZ_64(2020) metadata", + "value": "27072" + }, + { + "description": "Jurisdiction Metadata for CDZ_27(2020) id a003039c-509b-4d7c-b2bc-bc2b102af92d", + "key": "a003039c-509b-4d7c-b2bc-bc2b102af92d", + "label": "CDZ_27(2020) metadata", + "value": "27073" + }, + { + "description": "Jurisdiction Metadata for CDZ_5(2020) id 6a639141-7dc3-436a-9e07-3ffdda4157b6", + "key": "6a639141-7dc3-436a-9e07-3ffdda4157b6", + "label": "CDZ_5(2020) metadata", + "value": "27074" + }, + { + "description": "Jurisdiction Metadata for CDZ_12(2020) id dc892df1-4eab-41db-9330-8ba9f103eafc", + "key": "dc892df1-4eab-41db-9330-8ba9f103eafc", + "label": "CDZ_12(2020) metadata", + "value": "27075" + }, + { + "description": "Jurisdiction Metadata for CDZ_6(2020) id e838ad16-8920-48b1-b722-2a66591b1895", + "key": "e838ad16-8920-48b1-b722-2a66591b1895", + "label": "CDZ_6(2020) metadata", + "value": "27076" + }, + { + "description": "Jurisdiction Metadata for CDZ_53(2020) id ba51b63f-846b-4534-b9c4-6bcc54de1b1e", + "key": "ba51b63f-846b-4534-b9c4-6bcc54de1b1e", + "label": "CDZ_53(2020) metadata", + "value": "27077" + }, + { + "description": "Jurisdiction Metadata for CDZ_68(2020) id ebca35e4-75f7-46d0-9eed-ba5026ac0ad4", + "key": "ebca35e4-75f7-46d0-9eed-ba5026ac0ad4", + "label": "CDZ_68(2020) metadata", + "value": "27078" + }, + { + "description": "Jurisdiction Metadata for CDZ_18(2020) id 4e2365db-2dc1-4d13-a1b4-5ee944e6645e", + "key": "4e2365db-2dc1-4d13-a1b4-5ee944e6645e", + "label": "CDZ_18(2020) metadata", + "value": "27079" + }, + { + "description": "Jurisdiction Metadata for CDZ_67(2020) id 5980463b-3c89-41d4-84b0-72eaa5d0e1cb", + "key": "5980463b-3c89-41d4-84b0-72eaa5d0e1cb", + "label": "CDZ_67(2020) metadata", + "value": "27080" + }, + { + "description": "Jurisdiction Metadata for CDZ_32(2020) id e95b2f77-8f9b-4df3-89d8-e89d80c2c278", + "key": "e95b2f77-8f9b-4df3-89d8-e89d80c2c278", + "label": "CDZ_32(2020) metadata", + "value": "27081" + }, + { + "description": "Jurisdiction Metadata for CDZ_51(2020) id 67e621f4-f71a-47cd-8993-fd94264c01b4", + "key": "67e621f4-f71a-47cd-8993-fd94264c01b4", + "label": "CDZ_51(2020) metadata", + "value": "27082" + }, + { + "description": "Jurisdiction Metadata for CDZ_61(2020) id 90c0df86-ec85-4273-82a5-bfc9e7bbe5ae", + "key": "90c0df86-ec85-4273-82a5-bfc9e7bbe5ae", + "label": "CDZ_61(2020) metadata", + "value": "27083" + }, + { + "description": "Jurisdiction Metadata for CDZ_29(2020) id ad72ea3c-ab2a-41a2-8400-acc9b720ae8e", + "key": "ad72ea3c-ab2a-41a2-8400-acc9b720ae8e", + "label": "CDZ_29(2020) metadata", + "value": "27084" + }, + { + "description": "Jurisdiction Metadata for CDZ_59(2020) id 48d44847-12dc-4e6d-adfc-5e98f1ac0340", + "key": "48d44847-12dc-4e6d-adfc-5e98f1ac0340", + "label": "CDZ_59(2020) metadata", + "value": "27085" + }, + { + "description": "Jurisdiction Metadata for CDZ_24(2020) id c317ad18-7d26-4d85-96b5-ebb2da75dde7", + "key": "c317ad18-7d26-4d85-96b5-ebb2da75dde7", + "label": "CDZ_24(2020) metadata", + "value": "27086" + }, + { + "description": "Jurisdiction Metadata for CDZ_8(2020) id 0121abf8-d2f8-4b3b-b911-cd4a4ab00718", + "key": "0121abf8-d2f8-4b3b-b911-cd4a4ab00718", + "label": "CDZ_8(2020) metadata", + "value": "27087" + }, + { + "description": "Jurisdiction Metadata for CDZ_58(2020) id 8c80bfb1-35a3-4bbe-a292-086e88a20c5e", + "key": "8c80bfb1-35a3-4bbe-a292-086e88a20c5e", + "label": "CDZ_58(2020) metadata", + "value": "27088" + }, + { + "description": "Jurisdiction Metadata for CDZ_33(2020) id 8098172a-dec4-4e25-a0ce-5b001bd63192", + "key": "8098172a-dec4-4e25-a0ce-5b001bd63192", + "label": "CDZ_33(2020) metadata", + "value": "27089" + }, + { + "description": "Jurisdiction Metadata for CDZ_43(2020) id 2d1ffb2d-d219-4bdf-ba89-5e121f52a9fd", + "key": "2d1ffb2d-d219-4bdf-ba89-5e121f52a9fd", + "label": "CDZ_43(2020) metadata", + "value": "27090" + }, + { + "description": "Jurisdiction Metadata for CDZ_44(2020) id c33a488a-8853-41cb-932c-9047d66745ab", + "key": "c33a488a-8853-41cb-932c-9047d66745ab", + "label": "CDZ_44(2020) metadata", + "value": "27091" + }, + { + "description": "Jurisdiction Metadata for CDZ_52(2020) id c3e2875b-4c1e-456c-995a-ab4eb5efc353", + "key": "c3e2875b-4c1e-456c-995a-ab4eb5efc353", + "label": "CDZ_52(2020) metadata", + "value": "27092" + }, + { + "description": "Jurisdiction Metadata for CDZ_62(2020) id 6f96fea6-74f1-4d6c-bcfd-7ef5a3ce50d0", + "key": "6f96fea6-74f1-4d6c-bcfd-7ef5a3ce50d0", + "label": "CDZ_62(2020) metadata", + "value": "27093" + }, + { + "description": "Jurisdiction Metadata for CDZ_21(2020) id 1b8f6ec9-0108-439b-8799-f78d486be1cf", + "key": "1b8f6ec9-0108-439b-8799-f78d486be1cf", + "label": "CDZ_21(2020) metadata", + "value": "27094" + }, + { + "description": "Jurisdiction Metadata for CDZ_10(2020) id 81f2e980-2be5-4588-9437-bbfb38283b0d", + "key": "81f2e980-2be5-4588-9437-bbfb38283b0d", + "label": "CDZ_10(2020) metadata", + "value": "27095" + }, + { + "description": "Jurisdiction Metadata for CDZ_65(2020) id ded8ee1b-b9dc-49bb-82ff-296739402aa3", + "key": "ded8ee1b-b9dc-49bb-82ff-296739402aa3", + "label": "CDZ_65(2020) metadata", + "value": "27096" + }, + { + "description": "Jurisdiction Metadata for CDZ_19(2020) id c3359f20-2de1-4155-addc-8d3bf0eee52f", + "key": "c3359f20-2de1-4155-addc-8d3bf0eee52f", + "label": "CDZ_19(2020) metadata", + "value": "27097" + }, + { + "description": "Jurisdiction Metadata for CDZ_4(2020) id 446d85da-0e95-47f4-aa5a-e6fe2c3a1c08", + "key": "446d85da-0e95-47f4-aa5a-e6fe2c3a1c08", + "label": "CDZ_4(2020) metadata", + "value": "27098" + }, + { + "description": "Jurisdiction Metadata for CDZ_30(2020) id aaf43835-530c-42e7-a4bb-0d2f9a6dde94", + "key": "aaf43835-530c-42e7-a4bb-0d2f9a6dde94", + "label": "CDZ_30(2020) metadata", + "value": "27099" + }, + { + "description": "Jurisdiction Metadata for CDZ_1(2020) id 7f8c6f01-8642-4920-8c42-97e594347ee0", + "key": "7f8c6f01-8642-4920-8c42-97e594347ee0", + "label": "CDZ_1(2020) metadata", + "value": "27100" + }, + { + "description": "Jurisdiction Metadata for CDZ_31(2020) id f1190bc7-f6fa-4aca-9a84-0dfaed72b660", + "key": "f1190bc7-f6fa-4aca-9a84-0dfaed72b660", + "label": "CDZ_31(2020) metadata", + "value": "27101" + }, + { + "description": "Jurisdiction Metadata for CDZ_41(2020) id eb3ece99-1624-467c-8d30-6ee53451cfa3", + "key": "eb3ece99-1624-467c-8d30-6ee53451cfa3", + "label": "CDZ_41(2020) metadata", + "value": "27102" + }, + { + "description": "Jurisdiction Metadata for CDZ_16(2020) id cd3cc04f-7fd5-4660-a50f-0709dcb874c9", + "key": "cd3cc04f-7fd5-4660-a50f-0709dcb874c9", + "label": "CDZ_16(2020) metadata", + "value": "27103" + }, + { + "description": "Jurisdiction Metadata for CDZ_15(2020) id a7f344f1-c11d-4ae6-b5bc-fdf9739d7e48", + "key": "a7f344f1-c11d-4ae6-b5bc-fdf9739d7e48", + "label": "CDZ_15(2020) metadata", + "value": "27104" + }, + { + "description": "Jurisdiction Metadata for CDZ_50(2020) id 9b1eabee-91d2-480e-ad38-bf57cd33912e", + "key": "9b1eabee-91d2-480e-ad38-bf57cd33912e", + "label": "CDZ_50(2020) metadata", + "value": "27105" + }, + { + "description": "Jurisdiction Metadata for CDZ_54(2020) id 47341bb5-593b-4451-9edf-b86de2b21bb5", + "key": "47341bb5-593b-4451-9edf-b86de2b21bb5", + "label": "CDZ_54(2020) metadata", + "value": "27106" + }, + { + "description": "Jurisdiction Metadata for CDZ_2(2020) id 4f68cfd7-66bf-4105-8655-a849ec27a63a", + "key": "4f68cfd7-66bf-4105-8655-a849ec27a63a", + "label": "CDZ_2(2020) metadata", + "value": "27107" + }, + { + "description": "Jurisdiction Metadata for CDZ_42(2020) id 938198d8-0cf0-40bb-9902-fdfc08c0b325", + "key": "938198d8-0cf0-40bb-9902-fdfc08c0b325", + "label": "CDZ_42(2020) metadata", + "value": "27108" + }, + { + "description": "Jurisdiction Metadata for CDZ_37(2020) id e2fad906-368a-4f5d-96ae-6fe11fd9036f", + "key": "e2fad906-368a-4f5d-96ae-6fe11fd9036f", + "label": "CDZ_37(2020) metadata", + "value": "27109" + }, + { + "description": "Jurisdiction Metadata for CDZ_11(2020) id 74a05587-f236-43a1-848f-b69082e0a323", + "key": "74a05587-f236-43a1-848f-b69082e0a323", + "label": "CDZ_11(2020) metadata", + "value": "27110" + }, + { + "description": "Jurisdiction Metadata for CDZ_25(2020) id c4576cb2-c87f-4963-98de-dc6b1dcd4d34", + "key": "c4576cb2-c87f-4963-98de-dc6b1dcd4d34", + "label": "CDZ_25(2020) metadata", + "value": "27111" + }, + { + "description": "Jurisdiction Metadata for CDZ_38(2020) id add3aca0-5ee1-470a-8fed-1b0c823c0632", + "key": "add3aca0-5ee1-470a-8fed-1b0c823c0632", + "label": "CDZ_38(2020) metadata", + "value": "27112" + }, + { + "description": "Jurisdiction Metadata for CDZ_49(2020) id a588822e-f365-451c-a2a7-7d84a3ffb241", + "key": "a588822e-f365-451c-a2a7-7d84a3ffb241", + "label": "CDZ_49(2020) metadata", + "value": "27113" + }, + { + "description": "Jurisdiction Metadata for CDZ_66(2020) id ab2ef18e-b92f-4f61-9e7a-4588a7ce1d0b", + "key": "ab2ef18e-b92f-4f61-9e7a-4588a7ce1d0b", + "label": "CDZ_66(2020) metadata", + "value": "27114" + }, + { + "description": "Jurisdiction Metadata for CDZ_63(2020) id dc84eda0-51aa-4603-aa03-cbea6c8e05a6", + "key": "dc84eda0-51aa-4603-aa03-cbea6c8e05a6", + "label": "CDZ_63(2020) metadata", + "value": "27115" + }, + { + "description": "Jurisdiction Metadata for CDZ_13(2020) id 81dee609-57dd-4f2a-892d-a1d01fa118b7", + "key": "81dee609-57dd-4f2a-892d-a1d01fa118b7", + "label": "CDZ_13(2020) metadata", + "value": "27116" + }, + { + "description": "Jurisdiction Metadata for CDZ_45(2020) id f94475cb-db23-4e37-a5a3-c292bd822297", + "key": "f94475cb-db23-4e37-a5a3-c292bd822297", + "label": "CDZ_45(2020) metadata", + "value": "27117" + }, + { + "description": "Jurisdiction Metadata for CDZ_9(2020) id dbc2480b-0e75-470e-8ff7-119c37e0e481", + "key": "dbc2480b-0e75-470e-8ff7-119c37e0e481", + "label": "CDZ_9(2020) metadata", + "value": "27118" + }, + { + "description": "Jurisdiction Metadata for Kapirimpika(2020) id 3ead94e9-dabc-4a66-8197-7d10cacb7751", + "key": "3ead94e9-dabc-4a66-8197-7d10cacb7751", + "label": "Kapirimpika(2020) metadata", + "value": "27119" + }, + { + "description": "Jurisdiction Metadata for Kafulukuta_NHC id 67e59ccf-6414-4b27-b7b8-4d2562f582db", + "key": "67e59ccf-6414-4b27-b7b8-4d2562f582db", + "label": "Kafulukuta_NHC metadata", + "value": "27120" + }, + { + "description": "Jurisdiction Metadata for KPR_9(2020) id de0d6ada-96eb-4ce2-9563-1747cc352b7f", + "key": "de0d6ada-96eb-4ce2-9563-1747cc352b7f", + "label": "KPR_9(2020) metadata", + "value": "27121" + }, + { + "description": "Jurisdiction Metadata for KPR_8(2020) id c683eb14-b710-462d-9900-33cd0531a129", + "key": "c683eb14-b710-462d-9900-33cd0531a129", + "label": "KPR_8(2020) metadata", + "value": "27122" + }, + { + "description": "Jurisdiction Metadata for KPR_4(2020) id 9f160ec8-80b7-43a4-a779-420bca475831", + "key": "9f160ec8-80b7-43a4-a779-420bca475831", + "label": "KPR_4(2020) metadata", + "value": "27123" + }, + { + "description": "Jurisdiction Metadata for KPR_10(2020) id 665c6259-dae8-446e-b29d-fea878a26b06", + "key": "665c6259-dae8-446e-b29d-fea878a26b06", + "label": "KPR_10(2020) metadata", + "value": "27124" + }, + { + "description": "Jurisdiction Metadata for KPR_3(2020) id 3116135f-c25b-4a0f-96e8-06bc64e13328", + "key": "3116135f-c25b-4a0f-96e8-06bc64e13328", + "label": "KPR_3(2020) metadata", + "value": "27125" + }, + { + "description": "Jurisdiction Metadata for KPR_6(2020) id a0a86c57-753c-41d1-a81f-3895c98e9701", + "key": "a0a86c57-753c-41d1-a81f-3895c98e9701", + "label": "KPR_6(2020) metadata", + "value": "27126" + }, + { + "description": "Jurisdiction Metadata for KPR_1(2020) id ef87ad93-69e8-476f-b90a-735b8f4de616", + "key": "ef87ad93-69e8-476f-b90a-735b8f4de616", + "label": "KPR_1(2020) metadata", + "value": "27127" + }, + { + "description": "Jurisdiction Metadata for KPR_5(2020) id 55f491bb-d893-4bf3-9157-ed13d91a9e77", + "key": "55f491bb-d893-4bf3-9157-ed13d91a9e77", + "label": "KPR_5(2020) metadata", + "value": "27128" + }, + { + "description": "Jurisdiction Metadata for KPR_7(2020) id f9838aca-2d99-4b3e-93a4-a0b6d289aa16", + "key": "f9838aca-2d99-4b3e-93a4-a0b6d289aa16", + "label": "KPR_7(2020) metadata", + "value": "27129" + }, + { + "description": "Jurisdiction Metadata for KPR_2(2020) id 1a3db008-5824-49e7-aa9d-ded1b702cfe5", + "key": "1a3db008-5824-49e7-aa9d-ded1b702cfe5", + "label": "KPR_2(2020) metadata", + "value": "27130" + }, + { + "description": "Jurisdiction Metadata for John(2020) id 1770f46f-ab04-440a-915d-8f2d186ff041", + "key": "1770f46f-ab04-440a-915d-8f2d186ff041", + "label": "John(2020) metadata", + "value": "27131" + }, + { + "description": "Jurisdiction Metadata for Chaingo_NHC id f75648a1-c9ce-4306-9753-79a4caf3134f", + "key": "f75648a1-c9ce-4306-9753-79a4caf3134f", + "label": "Chaingo_NHC metadata", + "value": "27132" + }, + { + "description": "Jurisdiction Metadata for JON_66(2020) id ce05261e-b4e1-42b5-ae4b-1d41a9a4aeed", + "key": "ce05261e-b4e1-42b5-ae4b-1d41a9a4aeed", + "label": "JON_66(2020) metadata", + "value": "27133" + }, + { + "description": "Jurisdiction Metadata for JON_45(2020) id 83c6e4d2-d34a-4640-a1ce-460d4e1ba692", + "key": "83c6e4d2-d34a-4640-a1ce-460d4e1ba692", + "label": "JON_45(2020) metadata", + "value": "27134" + }, + { + "description": "Jurisdiction Metadata for JON_50(2020) id e37f9a7f-a109-456e-83da-a384bdcfb677", + "key": "e37f9a7f-a109-456e-83da-a384bdcfb677", + "label": "JON_50(2020) metadata", + "value": "27135" + }, + { + "description": "Jurisdiction Metadata for JON_87(2020) id 2e6a8ea7-2886-43c8-a116-cd2fcc82bb31", + "key": "2e6a8ea7-2886-43c8-a116-cd2fcc82bb31", + "label": "JON_87(2020) metadata", + "value": "27136" + }, + { + "description": "Jurisdiction Metadata for JON_72(2020) id f2b57903-a964-4d8e-a282-0727f556ec3f", + "key": "f2b57903-a964-4d8e-a282-0727f556ec3f", + "label": "JON_72(2020) metadata", + "value": "27137" + }, + { + "description": "Jurisdiction Metadata for JON_111(2020) id 0a691aa5-8824-4075-9479-d00d647b7265", + "key": "0a691aa5-8824-4075-9479-d00d647b7265", + "label": "JON_111(2020) metadata", + "value": "27138" + }, + { + "description": "Jurisdiction Metadata for JON_80(2020) id 777bd618-48a5-4c3b-bb42-2357cede644d", + "key": "777bd618-48a5-4c3b-bb42-2357cede644d", + "label": "JON_80(2020) metadata", + "value": "27139" + }, + { + "description": "Jurisdiction Metadata for JON_101(2020) id 6ef06446-5531-430a-a638-0603faa4a9b7", + "key": "6ef06446-5531-430a-a638-0603faa4a9b7", + "label": "JON_101(2020) metadata", + "value": "27140" + }, + { + "description": "Jurisdiction Metadata for JON_91(2020) id a7a93932-740a-4d83-a74d-65aa05fe9ad4", + "key": "a7a93932-740a-4d83-a74d-65aa05fe9ad4", + "label": "JON_91(2020) metadata", + "value": "27141" + }, + { + "description": "Jurisdiction Metadata for JON_83(2020) id 0fa0d1a8-37d0-47b7-a691-0ecaa19bfaa1", + "key": "0fa0d1a8-37d0-47b7-a691-0ecaa19bfaa1", + "label": "JON_83(2020) metadata", + "value": "27142" + }, + { + "description": "Jurisdiction Metadata for JON_65(2020) id 4e0bc071-d389-4f30-ab1f-0a73bc80b3d1", + "key": "4e0bc071-d389-4f30-ab1f-0a73bc80b3d1", + "label": "JON_65(2020) metadata", + "value": "27143" + }, + { + "description": "Jurisdiction Metadata for JON_35(2020) id f06e4e20-aed2-4227-81cb-6225f7542278", + "key": "f06e4e20-aed2-4227-81cb-6225f7542278", + "label": "JON_35(2020) metadata", + "value": "27144" + }, + { + "description": "Jurisdiction Metadata for JON_19(2020) id 51a59ac8-04a2-42ae-adf9-8c3d21431cb7", + "key": "51a59ac8-04a2-42ae-adf9-8c3d21431cb7", + "label": "JON_19(2020) metadata", + "value": "27145" + }, + { + "description": "Jurisdiction Metadata for JON_109(2020) id 585a9932-42e8-4783-a580-506f8d3cd7bd", + "key": "585a9932-42e8-4783-a580-506f8d3cd7bd", + "label": "JON_109(2020) metadata", + "value": "27146" + }, + { + "description": "Jurisdiction Metadata for JON_73(2020) id 32376312-1037-4be3-b6b9-3af6eb4b14d0", + "key": "32376312-1037-4be3-b6b9-3af6eb4b14d0", + "label": "JON_73(2020) metadata", + "value": "27147" + }, + { + "description": "Jurisdiction Metadata for JON_58(2020) id e6ae3213-5435-45fd-905f-3c808b158af6", + "key": "e6ae3213-5435-45fd-905f-3c808b158af6", + "label": "JON_58(2020) metadata", + "value": "27148" + }, + { + "description": "Jurisdiction Metadata for JON_77(2020) id 3f376df7-4928-4a65-8320-c5528ede50f4", + "key": "3f376df7-4928-4a65-8320-c5528ede50f4", + "label": "JON_77(2020) metadata", + "value": "27149" + }, + { + "description": "Jurisdiction Metadata for JON_20(2020) id f2be8e4e-c21e-4bb6-81a7-f1b89c9f014c", + "key": "f2be8e4e-c21e-4bb6-81a7-f1b89c9f014c", + "label": "JON_20(2020) metadata", + "value": "27150" + }, + { + "description": "Jurisdiction Metadata for JON_49(2020) id 6dcd8f97-953f-4aee-bba6-4fc37251ffed", + "key": "6dcd8f97-953f-4aee-bba6-4fc37251ffed", + "label": "JON_49(2020) metadata", + "value": "27151" + }, + { + "description": "Jurisdiction Metadata for JON_14(2020) id a2e06fc6-cfcd-4a6f-9c8d-e3b590322f6b", + "key": "a2e06fc6-cfcd-4a6f-9c8d-e3b590322f6b", + "label": "JON_14(2020) metadata", + "value": "27152" + }, + { + "description": "Jurisdiction Metadata for JON_86(2020) id e9d006c7-5607-4f87-82bf-d6108737451b", + "key": "e9d006c7-5607-4f87-82bf-d6108737451b", + "label": "JON_86(2020) metadata", + "value": "27153" + }, + { + "description": "Jurisdiction Metadata for JON_108(2020) id 04ec1f63-fa57-48c6-9e1e-bc67b0b623e7", + "key": "04ec1f63-fa57-48c6-9e1e-bc67b0b623e7", + "label": "JON_108(2020) metadata", + "value": "27154" + }, + { + "description": "Jurisdiction Metadata for JON_32(2020) id 5965b6a8-a884-4b8f-990e-61e3cf5225c1", + "key": "5965b6a8-a884-4b8f-990e-61e3cf5225c1", + "label": "JON_32(2020) metadata", + "value": "27155" + }, + { + "description": "Jurisdiction Metadata for JON_110(2020) id 080a4d40-02f1-4456-8531-8c8482903949", + "key": "080a4d40-02f1-4456-8531-8c8482903949", + "label": "JON_110(2020) metadata", + "value": "27156" + }, + { + "description": "Jurisdiction Metadata for JON_37(2020) id e6b422e4-5cca-4cb8-9f60-918e0106e9f2", + "key": "e6b422e4-5cca-4cb8-9f60-918e0106e9f2", + "label": "JON_37(2020) metadata", + "value": "27157" + }, + { + "description": "Jurisdiction Metadata for JON_55(2020) id b644c696-2534-41f7-8be4-a68fb2bd5686", + "key": "b644c696-2534-41f7-8be4-a68fb2bd5686", + "label": "JON_55(2020) metadata", + "value": "27158" + }, + { + "description": "Jurisdiction Metadata for JON_47(2020) id 918a7177-578a-40e0-8d59-6fb5cb187373", + "key": "918a7177-578a-40e0-8d59-6fb5cb187373", + "label": "JON_47(2020) metadata", + "value": "27159" + }, + { + "description": "Jurisdiction Metadata for JON_81(2020) id 96e15fdd-f6ae-4ab9-8f4b-2096ec6f8aa4", + "key": "96e15fdd-f6ae-4ab9-8f4b-2096ec6f8aa4", + "label": "JON_81(2020) metadata", + "value": "27160" + }, + { + "description": "Jurisdiction Metadata for JON_48(2020) id 9440cc82-9e6b-49e2-a2f3-67f75a420e53", + "key": "9440cc82-9e6b-49e2-a2f3-67f75a420e53", + "label": "JON_48(2020) metadata", + "value": "27161" + }, + { + "description": "Jurisdiction Metadata for JON_29(2020) id 1b10aeef-94b1-4dc7-8108-e84582f19107", + "key": "1b10aeef-94b1-4dc7-8108-e84582f19107", + "label": "JON_29(2020) metadata", + "value": "27162" + }, + { + "description": "Jurisdiction Metadata for JON_5(2020) id b195cc0c-df87-4387-971a-40d977adf0c6", + "key": "b195cc0c-df87-4387-971a-40d977adf0c6", + "label": "JON_5(2020) metadata", + "value": "27163" + }, + { + "description": "Jurisdiction Metadata for JON_42(2020) id 38c59fa0-c5ce-4d3d-9e0c-47180d42ef10", + "key": "38c59fa0-c5ce-4d3d-9e0c-47180d42ef10", + "label": "JON_42(2020) metadata", + "value": "27164" + }, + { + "description": "Jurisdiction Metadata for JON_43(2020) id 6367e7fc-91a8-44a5-ad23-683495863385", + "key": "6367e7fc-91a8-44a5-ad23-683495863385", + "label": "JON_43(2020) metadata", + "value": "27165" + }, + { + "description": "Jurisdiction Metadata for JON_61(2020) id 9ef62979-36df-4dd8-8c82-431c4ab8179d", + "key": "9ef62979-36df-4dd8-8c82-431c4ab8179d", + "label": "JON_61(2020) metadata", + "value": "27166" + }, + { + "description": "Jurisdiction Metadata for JON_59(2020) id e34d22b1-e059-420a-be78-ec95fc08a56d", + "key": "e34d22b1-e059-420a-be78-ec95fc08a56d", + "label": "JON_59(2020) metadata", + "value": "27167" + }, + { + "description": "Jurisdiction Metadata for JON_21(2020) id 5c13dabc-162b-4f91-bdd8-2c7b2e29078d", + "key": "5c13dabc-162b-4f91-bdd8-2c7b2e29078d", + "label": "JON_21(2020) metadata", + "value": "27168" + }, + { + "description": "Jurisdiction Metadata for JON_56(2020) id 94dddc2a-621e-4a6f-b8a2-ebf2f5cde84a", + "key": "94dddc2a-621e-4a6f-b8a2-ebf2f5cde84a", + "label": "JON_56(2020) metadata", + "value": "27169" + }, + { + "description": "Jurisdiction Metadata for JON_79(2020) id 3b576c53-988c-42d8-9319-ace5c55f3f57", + "key": "3b576c53-988c-42d8-9319-ace5c55f3f57", + "label": "JON_79(2020) metadata", + "value": "27170" + }, + { + "description": "Jurisdiction Metadata for JON_76(2020) id d19bed5a-2553-4d12-82e3-05599fbbe372", + "key": "d19bed5a-2553-4d12-82e3-05599fbbe372", + "label": "JON_76(2020) metadata", + "value": "27171" + }, + { + "description": "Jurisdiction Metadata for JON_41(2020) id 458a4755-b2df-47b8-804d-2039e1bc62c8", + "key": "458a4755-b2df-47b8-804d-2039e1bc62c8", + "label": "JON_41(2020) metadata", + "value": "27172" + }, + { + "description": "Jurisdiction Metadata for JON_107(2020) id 6228b23d-e533-4921-b9e8-1c62774b4935", + "key": "6228b23d-e533-4921-b9e8-1c62774b4935", + "label": "JON_107(2020) metadata", + "value": "27173" + }, + { + "description": "Jurisdiction Metadata for JON_16(2020) id e745ab8d-0430-4aa6-a137-3940c6d32f3b", + "key": "e745ab8d-0430-4aa6-a137-3940c6d32f3b", + "label": "JON_16(2020) metadata", + "value": "27174" + }, + { + "description": "Jurisdiction Metadata for JON_63(2020) id 6a9bc53a-36d7-4b4b-97f7-289aeceda227", + "key": "6a9bc53a-36d7-4b4b-97f7-289aeceda227", + "label": "JON_63(2020) metadata", + "value": "27175" + }, + { + "description": "Jurisdiction Metadata for JON_53(2020) id 9c99d556-c1cc-4236-84bb-b225d3c18d54", + "key": "9c99d556-c1cc-4236-84bb-b225d3c18d54", + "label": "JON_53(2020) metadata", + "value": "27176" + }, + { + "description": "Jurisdiction Metadata for JON_64(2020) id a0daaf06-71f0-4a47-981b-770261e04959", + "key": "a0daaf06-71f0-4a47-981b-770261e04959", + "label": "JON_64(2020) metadata", + "value": "27177" + }, + { + "description": "Jurisdiction Metadata for JON_82(2020) id 71e68472-1bd9-4802-95cd-3d88152f3dd1", + "key": "71e68472-1bd9-4802-95cd-3d88152f3dd1", + "label": "JON_82(2020) metadata", + "value": "27178" + }, + { + "description": "Jurisdiction Metadata for JON_95(2020) id d924b4e5-10c7-43ab-b530-633deb801659", + "key": "d924b4e5-10c7-43ab-b530-633deb801659", + "label": "JON_95(2020) metadata", + "value": "27179" + }, + { + "description": "Jurisdiction Metadata for JON_106(2020) id 818b973c-549d-4c58-a950-b42f0f18b0b2", + "key": "818b973c-549d-4c58-a950-b42f0f18b0b2", + "label": "JON_106(2020) metadata", + "value": "27180" + }, + { + "description": "Jurisdiction Metadata for JON_9(2020) id e11ee702-f77e-43db-8126-bfe48927cc02", + "key": "e11ee702-f77e-43db-8126-bfe48927cc02", + "label": "JON_9(2020) metadata", + "value": "27181" + }, + { + "description": "Jurisdiction Metadata for JON_3(2020) id bfbdfb5a-4f60-4f79-abd2-f2e2b61170f8", + "key": "bfbdfb5a-4f60-4f79-abd2-f2e2b61170f8", + "label": "JON_3(2020) metadata", + "value": "27182" + }, + { + "description": "Jurisdiction Metadata for JON_54(2020) id bbf148ce-7f35-4dd7-8c32-f0005200452f", + "key": "bbf148ce-7f35-4dd7-8c32-f0005200452f", + "label": "JON_54(2020) metadata", + "value": "27183" + }, + { + "description": "Jurisdiction Metadata for JON_12(2020) id 4a10c6e0-0e5f-4f97-9cb9-68501054873e", + "key": "4a10c6e0-0e5f-4f97-9cb9-68501054873e", + "label": "JON_12(2020) metadata", + "value": "27184" + }, + { + "description": "Jurisdiction Metadata for JON_38(2020) id b9f9db25-694e-46d7-872b-b6288cc04a8e", + "key": "b9f9db25-694e-46d7-872b-b6288cc04a8e", + "label": "JON_38(2020) metadata", + "value": "27185" + }, + { + "description": "Jurisdiction Metadata for JON_92(2020) id ee6d2dab-cba1-435f-9834-79c14ee83995", + "key": "ee6d2dab-cba1-435f-9834-79c14ee83995", + "label": "JON_92(2020) metadata", + "value": "27186" + }, + { + "description": "Jurisdiction Metadata for JON_68(2020) id 7412d105-dd5f-4148-84aa-966008efcf63", + "key": "7412d105-dd5f-4148-84aa-966008efcf63", + "label": "JON_68(2020) metadata", + "value": "27187" + }, + { + "description": "Jurisdiction Metadata for JON_69(2020) id a4b4490c-e4f8-4270-b4b4-74fcd270d300", + "key": "a4b4490c-e4f8-4270-b4b4-74fcd270d300", + "label": "JON_69(2020) metadata", + "value": "27188" + }, + { + "description": "Jurisdiction Metadata for JON_93(2020) id 955bf875-c909-42b3-b478-e1c5a329e4e4", + "key": "955bf875-c909-42b3-b478-e1c5a329e4e4", + "label": "JON_93(2020) metadata", + "value": "27189" + }, + { + "description": "Jurisdiction Metadata for JON_24(2020) id b69337a7-0958-4fff-ba11-780100165757", + "key": "b69337a7-0958-4fff-ba11-780100165757", + "label": "JON_24(2020) metadata", + "value": "27190" + }, + { + "description": "Jurisdiction Metadata for JON_34(2020) id b4f3aded-f857-498d-b8f6-40859dcff531", + "key": "b4f3aded-f857-498d-b8f6-40859dcff531", + "label": "JON_34(2020) metadata", + "value": "27191" + }, + { + "description": "Jurisdiction Metadata for JON_23(2020) id 4aa4167d-4c89-41c0-9c2a-afafd9a561cc", + "key": "4aa4167d-4c89-41c0-9c2a-afafd9a561cc", + "label": "JON_23(2020) metadata", + "value": "27192" + }, + { + "description": "Jurisdiction Metadata for JON_4(2020) id afc5c9bc-40b5-4bc2-a033-a1f0c0c3e2e1", + "key": "afc5c9bc-40b5-4bc2-a033-a1f0c0c3e2e1", + "label": "JON_4(2020) metadata", + "value": "27193" + }, + { + "description": "Jurisdiction Metadata for JON_17(2020) id 2e159f21-de69-4b44-b0db-6eb7e42b98b8", + "key": "2e159f21-de69-4b44-b0db-6eb7e42b98b8", + "label": "JON_17(2020) metadata", + "value": "27194" + }, + { + "description": "Jurisdiction Metadata for JON_99(2020) id b53de949-4174-4ee5-bee8-8c6f3e8416d8", + "key": "b53de949-4174-4ee5-bee8-8c6f3e8416d8", + "label": "JON_99(2020) metadata", + "value": "27195" + }, + { + "description": "Jurisdiction Metadata for JON_105(2020) id 473dcf2b-8411-4288-9ddd-5fb7acac9fe4", + "key": "473dcf2b-8411-4288-9ddd-5fb7acac9fe4", + "label": "JON_105(2020) metadata", + "value": "27196" + }, + { + "description": "Jurisdiction Metadata for JON_26(2020) id ec7690a5-d398-427b-bed0-effc01abf01a", + "key": "ec7690a5-d398-427b-bed0-effc01abf01a", + "label": "JON_26(2020) metadata", + "value": "27197" + }, + { + "description": "Jurisdiction Metadata for JON_7(2020) id 8b4b2d91-564c-44fa-b942-60d37d90411e", + "key": "8b4b2d91-564c-44fa-b942-60d37d90411e", + "label": "JON_7(2020) metadata", + "value": "27198" + }, + { + "description": "Jurisdiction Metadata for JON_70(2020) id 54f01643-38e1-41e5-abaa-3dcd4c44940e", + "key": "54f01643-38e1-41e5-abaa-3dcd4c44940e", + "label": "JON_70(2020) metadata", + "value": "27199" + }, + { + "description": "Jurisdiction Metadata for JON_88(2020) id 42b69677-7fa1-40b8-8eb0-2511c8e0212a", + "key": "42b69677-7fa1-40b8-8eb0-2511c8e0212a", + "label": "JON_88(2020) metadata", + "value": "27200" + }, + { + "description": "Jurisdiction Metadata for JON_57(2020) id 97c57ea5-39b8-41bd-92f0-a010e6a492dc", + "key": "97c57ea5-39b8-41bd-92f0-a010e6a492dc", + "label": "JON_57(2020) metadata", + "value": "27201" + }, + { + "description": "Jurisdiction Metadata for JON_94(2020) id 7dd0cfec-2e73-4c61-ad8b-fc0b00cede38", + "key": "7dd0cfec-2e73-4c61-ad8b-fc0b00cede38", + "label": "JON_94(2020) metadata", + "value": "27202" + }, + { + "description": "Jurisdiction Metadata for JON_27(2020) id e3f2842d-6ccd-4292-b109-c89a99065c5b", + "key": "e3f2842d-6ccd-4292-b109-c89a99065c5b", + "label": "JON_27(2020) metadata", + "value": "27203" + }, + { + "description": "Jurisdiction Metadata for JON_31(2020) id 74999b18-4a4f-4829-9494-2d8f7ced841e", + "key": "74999b18-4a4f-4829-9494-2d8f7ced841e", + "label": "JON_31(2020) metadata", + "value": "27204" + }, + { + "description": "Jurisdiction Metadata for JON_44(2020) id 926a0e5b-44f2-4607-8010-4ea50f9c6b4d", + "key": "926a0e5b-44f2-4607-8010-4ea50f9c6b4d", + "label": "JON_44(2020) metadata", + "value": "27205" + }, + { + "description": "Jurisdiction Metadata for JON_89(2020) id d312e7b1-15e4-46c6-8a7f-c76be8af71a5", + "key": "d312e7b1-15e4-46c6-8a7f-c76be8af71a5", + "label": "JON_89(2020) metadata", + "value": "27206" + }, + { + "description": "Jurisdiction Metadata for JON_22(2020) id f870250a-5edc-43b1-8f14-dbab2636efcc", + "key": "f870250a-5edc-43b1-8f14-dbab2636efcc", + "label": "JON_22(2020) metadata", + "value": "27207" + }, + { + "description": "Jurisdiction Metadata for JON_98(2020) id e0b3791c-edfe-4bfd-82b0-63b17a389b4a", + "key": "e0b3791c-edfe-4bfd-82b0-63b17a389b4a", + "label": "JON_98(2020) metadata", + "value": "27208" + }, + { + "description": "Jurisdiction Metadata for JON_62(2020) id 83e7ec2b-cef0-4a54-be8c-a823f2c05a67", + "key": "83e7ec2b-cef0-4a54-be8c-a823f2c05a67", + "label": "JON_62(2020) metadata", + "value": "27209" + }, + { + "description": "Jurisdiction Metadata for JON_96(2020) id e64509a2-83f2-4e39-8363-0832386a735e", + "key": "e64509a2-83f2-4e39-8363-0832386a735e", + "label": "JON_96(2020) metadata", + "value": "27210" + }, + { + "description": "Jurisdiction Metadata for JON_46(2020) id 27f8db43-701f-4caf-91cd-91cec7533d6e", + "key": "27f8db43-701f-4caf-91cd-91cec7533d6e", + "label": "JON_46(2020) metadata", + "value": "27211" + }, + { + "description": "Jurisdiction Metadata for JON_1(2020) id d2741c73-574a-47e0-ac84-8da1c2ae48a0", + "key": "d2741c73-574a-47e0-ac84-8da1c2ae48a0", + "label": "JON_1(2020) metadata", + "value": "27212" + }, + { + "description": "Jurisdiction Metadata for JON_78(2020) id dbfe0ab9-9dab-44fb-bbf7-fc2547c52a0e", + "key": "dbfe0ab9-9dab-44fb-bbf7-fc2547c52a0e", + "label": "JON_78(2020) metadata", + "value": "27213" + }, + { + "description": "Jurisdiction Metadata for JON_75(2020) id 97ce1689-7f19-47e2-a5da-7f34da7489ec", + "key": "97ce1689-7f19-47e2-a5da-7f34da7489ec", + "label": "JON_75(2020) metadata", + "value": "27214" + }, + { + "description": "Jurisdiction Metadata for JON_33(2020) id 24731848-928e-4a69-bb80-c30a17daf0c5", + "key": "24731848-928e-4a69-bb80-c30a17daf0c5", + "label": "JON_33(2020) metadata", + "value": "27215" + }, + { + "description": "Jurisdiction Metadata for JON_11(2020) id 64a26d2a-409a-4753-b654-906a2d1a3faf", + "key": "64a26d2a-409a-4753-b654-906a2d1a3faf", + "label": "JON_11(2020) metadata", + "value": "27216" + }, + { + "description": "Jurisdiction Metadata for JON_67(2020) id 2cac3b8f-c39c-43b4-b0eb-7e743fd14478", + "key": "2cac3b8f-c39c-43b4-b0eb-7e743fd14478", + "label": "JON_67(2020) metadata", + "value": "27217" + }, + { + "description": "Jurisdiction Metadata for JON_10(2020) id a349071e-6be6-4231-8413-2f0c1f6d2b9a", + "key": "a349071e-6be6-4231-8413-2f0c1f6d2b9a", + "label": "JON_10(2020) metadata", + "value": "27218" + }, + { + "description": "Jurisdiction Metadata for JON_71(2020) id e7d582cc-9bf3-4f01-bdf6-de5e5b2c4034", + "key": "e7d582cc-9bf3-4f01-bdf6-de5e5b2c4034", + "label": "JON_71(2020) metadata", + "value": "27219" + }, + { + "description": "Jurisdiction Metadata for JON_2(2020) id b9e19a4d-aed5-45e7-b8e6-fb3b94ada38d", + "key": "b9e19a4d-aed5-45e7-b8e6-fb3b94ada38d", + "label": "JON_2(2020) metadata", + "value": "27220" + }, + { + "description": "Jurisdiction Metadata for JON_51(2020) id 8513fafe-281d-4c3f-85ee-03b38b8b2da9", + "key": "8513fafe-281d-4c3f-85ee-03b38b8b2da9", + "label": "JON_51(2020) metadata", + "value": "27221" + }, + { + "description": "Jurisdiction Metadata for JON_39(2020) id 71dd7634-0099-4dec-998d-1d407071735a", + "key": "71dd7634-0099-4dec-998d-1d407071735a", + "label": "JON_39(2020) metadata", + "value": "27222" + }, + { + "description": "Jurisdiction Metadata for JON_28(2020) id 34ce4df3-9b10-4cde-841f-632b76cfe51c", + "key": "34ce4df3-9b10-4cde-841f-632b76cfe51c", + "label": "JON_28(2020) metadata", + "value": "27223" + }, + { + "description": "Jurisdiction Metadata for JON_30(2020) id 12f78037-bb4a-4b6b-ae27-be021cdd0624", + "key": "12f78037-bb4a-4b6b-ae27-be021cdd0624", + "label": "JON_30(2020) metadata", + "value": "27224" + }, + { + "description": "Jurisdiction Metadata for JON_15(2020) id b1ce0a1c-4401-40ee-9879-c406721415c2", + "key": "b1ce0a1c-4401-40ee-9879-c406721415c2", + "label": "JON_15(2020) metadata", + "value": "27225" + }, + { + "description": "Jurisdiction Metadata for JON_84(2020) id f2a4ad57-055f-4fa7-823d-81211a623d6c", + "key": "f2a4ad57-055f-4fa7-823d-81211a623d6c", + "label": "JON_84(2020) metadata", + "value": "27226" + }, + { + "description": "Jurisdiction Metadata for JON_6(2020) id bbcb16af-29c1-4fc2-82c8-e327975bb39a", + "key": "bbcb16af-29c1-4fc2-82c8-e327975bb39a", + "label": "JON_6(2020) metadata", + "value": "27227" + }, + { + "description": "Jurisdiction Metadata for JON_60(2020) id 18ef53b2-33e1-48ea-b9ff-abfb6762ac75", + "key": "18ef53b2-33e1-48ea-b9ff-abfb6762ac75", + "label": "JON_60(2020) metadata", + "value": "27228" + }, + { + "description": "Jurisdiction Metadata for JON_74(2020) id b7858f4f-c479-49f8-8351-c0b4fa33f964", + "key": "b7858f4f-c479-49f8-8351-c0b4fa33f964", + "label": "JON_74(2020) metadata", + "value": "27229" + }, + { + "description": "Jurisdiction Metadata for JON_90(2020) id a0081e82-8fde-4e2c-91d7-0c9f5edbabc5", + "key": "a0081e82-8fde-4e2c-91d7-0c9f5edbabc5", + "label": "JON_90(2020) metadata", + "value": "27230" + }, + { + "description": "Jurisdiction Metadata for JON_52(2020) id dd359567-d699-40fc-8b8a-8c4b98716a9f", + "key": "dd359567-d699-40fc-8b8a-8c4b98716a9f", + "label": "JON_52(2020) metadata", + "value": "27231" + }, + { + "description": "Jurisdiction Metadata for JON_103(2020) id 7267944d-d8a6-4f87-ae4d-e766672aac35", + "key": "7267944d-d8a6-4f87-ae4d-e766672aac35", + "label": "JON_103(2020) metadata", + "value": "27232" + }, + { + "description": "Jurisdiction Metadata for JON_100(2020) id 377ba51a-4de1-490a-9004-eac16df48403", + "key": "377ba51a-4de1-490a-9004-eac16df48403", + "label": "JON_100(2020) metadata", + "value": "27233" + }, + { + "description": "Jurisdiction Metadata for JON_18(2020) id be4fa0f9-847d-40ac-9e84-dc369c070b62", + "key": "be4fa0f9-847d-40ac-9e84-dc369c070b62", + "label": "JON_18(2020) metadata", + "value": "27234" + }, + { + "description": "Jurisdiction Metadata for JON_8(2020) id 670dc486-8eec-4435-92c5-31aba7ee6e20", + "key": "670dc486-8eec-4435-92c5-31aba7ee6e20", + "label": "JON_8(2020) metadata", + "value": "27235" + }, + { + "description": "Jurisdiction Metadata for JON_85(2020) id 5c5b30b5-3c5e-4c6d-b203-24a9b7c47aea", + "key": "5c5b30b5-3c5e-4c6d-b203-24a9b7c47aea", + "label": "JON_85(2020) metadata", + "value": "27236" + }, + { + "description": "Jurisdiction Metadata for JON_104(2020) id f332ec11-ff65-4b7f-889c-907014e6770a", + "key": "f332ec11-ff65-4b7f-889c-907014e6770a", + "label": "JON_104(2020) metadata", + "value": "27237" + }, + { + "description": "Jurisdiction Metadata for JON_25(2020) id 907667dc-416f-49d9-b51e-2a414ec69061", + "key": "907667dc-416f-49d9-b51e-2a414ec69061", + "label": "JON_25(2020) metadata", + "value": "27238" + }, + { + "description": "Jurisdiction Metadata for JON_102(2020) id b53ec00d-e025-4b44-9a9e-5a80b6a5a957", + "key": "b53ec00d-e025-4b44-9a9e-5a80b6a5a957", + "label": "JON_102(2020) metadata", + "value": "27239" + }, + { + "description": "Jurisdiction Metadata for JON_97(2020) id 46012041-0b50-4f67-9b1b-737cfa965382", + "key": "46012041-0b50-4f67-9b1b-737cfa965382", + "label": "JON_97(2020) metadata", + "value": "27240" + }, + { + "description": "Jurisdiction Metadata for JON_36(2020) id 8d317aee-5e16-4770-be2d-9a8b890212ae", + "key": "8d317aee-5e16-4770-be2d-9a8b890212ae", + "label": "JON_36(2020) metadata", + "value": "27241" + }, + { + "description": "Jurisdiction Metadata for JON_13(2020) id a3514850-e37d-48ae-b88a-1bd44c8aab5e", + "key": "a3514850-e37d-48ae-b88a-1bd44c8aab5e", + "label": "JON_13(2020) metadata", + "value": "27242" + }, + { + "description": "Jurisdiction Metadata for JON_40(2020) id 47093142-48f1-4dac-9347-a628ea3a20ff", + "key": "47093142-48f1-4dac-9347-a628ea3a20ff", + "label": "JON_40(2020) metadata", + "value": "27243" + }, + { + "description": "Jurisdiction Metadata for Tafelansoni(2020) id b98b3c6a-6028-46aa-8b3f-a0b61909ebc8", + "key": "b98b3c6a-6028-46aa-8b3f-a0b61909ebc8", + "label": "Tafelansoni(2020) metadata", + "value": "27244" + }, + { + "description": "Jurisdiction Metadata for Namwela NHc id 03629e5f-75dc-4ee8-b73a-787ae2fc7beb", + "key": "03629e5f-75dc-4ee8-b73a-787ae2fc7beb", + "label": "Namwela NHc metadata", + "value": "27245" + }, + { + "description": "Jurisdiction Metadata for TFL_11(2020) id 972300dd-320a-4c19-800b-14b1a07767da", + "key": "972300dd-320a-4c19-800b-14b1a07767da", + "label": "TFL_11(2020) metadata", + "value": "27246" + }, + { + "description": "Jurisdiction Metadata for TFL_8(2020) id 4bed372d-789d-475a-8b06-9292b6e143e3", + "key": "4bed372d-789d-475a-8b06-9292b6e143e3", + "label": "TFL_8(2020) metadata", + "value": "27247" + }, + { + "description": "Jurisdiction Metadata for TFL_7(2020) id 6ea68da8-546f-4823-bcc6-c2dac522fa6c", + "key": "6ea68da8-546f-4823-bcc6-c2dac522fa6c", + "label": "TFL_7(2020) metadata", + "value": "27248" + }, + { + "description": "Jurisdiction Metadata for TFL_5(2020) id b8f16624-59a8-4b90-a761-c087d1651d32", + "key": "b8f16624-59a8-4b90-a761-c087d1651d32", + "label": "TFL_5(2020) metadata", + "value": "27249" + }, + { + "description": "Jurisdiction Metadata for TFL_3(2020) id bcb9b2ea-1ace-45bb-a1b3-b3ea321e95cc", + "key": "bcb9b2ea-1ace-45bb-a1b3-b3ea321e95cc", + "label": "TFL_3(2020) metadata", + "value": "27250" + }, + { + "description": "Jurisdiction Metadata for TFL_12(2020) id 74086fb8-3264-4ea1-8527-d939c6cbbeb0", + "key": "74086fb8-3264-4ea1-8527-d939c6cbbeb0", + "label": "TFL_12(2020) metadata", + "value": "27251" + }, + { + "description": "Jurisdiction Metadata for TFL_2(2020) id 172b504c-1337-4d27-acb5-0b9f4e0cfc81", + "key": "172b504c-1337-4d27-acb5-0b9f4e0cfc81", + "label": "TFL_2(2020) metadata", + "value": "27252" + }, + { + "description": "Jurisdiction Metadata for TFL_9(2020) id 6cba09a0-4028-450c-859a-1f86cb49f889", + "key": "6cba09a0-4028-450c-859a-1f86cb49f889", + "label": "TFL_9(2020) metadata", + "value": "27253" + }, + { + "description": "Jurisdiction Metadata for TFL_4(2020) id 48cd417e-d272-4ea5-b495-2f44ced83a2f", + "key": "48cd417e-d272-4ea5-b495-2f44ced83a2f", + "label": "TFL_4(2020) metadata", + "value": "27254" + }, + { + "description": "Jurisdiction Metadata for TFL_1(2020) id ee93578a-776c-4a47-8be8-a06d82123987", + "key": "ee93578a-776c-4a47-8be8-a06d82123987", + "label": "TFL_1(2020) metadata", + "value": "27255" + }, + { + "description": "Jurisdiction Metadata for TFL_15(2020) id 2d073573-74e2-4872-b206-8b7fc01b0110", + "key": "2d073573-74e2-4872-b206-8b7fc01b0110", + "label": "TFL_15(2020) metadata", + "value": "27256" + }, + { + "description": "Jurisdiction Metadata for TFL_10(2020) id 11900807-7a11-4753-8774-6fabf11bb0e4", + "key": "11900807-7a11-4753-8774-6fabf11bb0e4", + "label": "TFL_10(2020) metadata", + "value": "27257" + }, + { + "description": "Jurisdiction Metadata for TFL_13(2020) id 570d2e62-d8be-4929-a8e2-6c6001aee7d9", + "key": "570d2e62-d8be-4929-a8e2-6c6001aee7d9", + "label": "TFL_13(2020) metadata", + "value": "27258" + }, + { + "description": "Jurisdiction Metadata for TFL_16(2020) id dca841b6-004e-413c-b965-650dfb3f0f80", + "key": "dca841b6-004e-413c-b965-650dfb3f0f80", + "label": "TFL_16(2020) metadata", + "value": "27259" + }, + { + "description": "Jurisdiction Metadata for TFL_6(2020) id 0b939825-60bb-49d3-be49-58853c276e6c", + "key": "0b939825-60bb-49d3-be49-58853c276e6c", + "label": "TFL_6(2020) metadata", + "value": "27260" + }, + { + "description": "Jurisdiction Metadata for TFL_14(2020) id cf0f5735-12f7-4b8a-84c1-abc37d36a71b", + "key": "cf0f5735-12f7-4b8a-84c1-abc37d36a71b", + "label": "TFL_14(2020) metadata", + "value": "27261" + }, + { + "description": "Jurisdiction Metadata for Kabvumo(2020) id e9fc8a3a-88b7-40a9-8337-9835b03f702a", + "key": "e9fc8a3a-88b7-40a9-8337-9835b03f702a", + "label": "Kabvumo(2020) metadata", + "value": "27262" + }, + { + "description": "Jurisdiction Metadata for Mbongombe_NHC id 5c39eecc-3c22-43b9-8b1a-5ae53dbb5de1", + "key": "5c39eecc-3c22-43b9-8b1a-5ae53dbb5de1", + "label": "Mbongombe_NHC metadata", + "value": "27263" + }, + { + "description": "Jurisdiction Metadata for KBV_11(2020) id 4fb07345-4448-42d8-b7e3-18af3315f4cd", + "key": "4fb07345-4448-42d8-b7e3-18af3315f4cd", + "label": "KBV_11(2020) metadata", + "value": "27264" + }, + { + "description": "Jurisdiction Metadata for KBV_19(2020) id e58a62cc-33bd-4c41-b6c9-1fafae498010", + "key": "e58a62cc-33bd-4c41-b6c9-1fafae498010", + "label": "KBV_19(2020) metadata", + "value": "27265" + }, + { + "description": "Jurisdiction Metadata for KBV_22(2020) id 781839cc-e9c2-4e57-be43-2e64d1f28fdd", + "key": "781839cc-e9c2-4e57-be43-2e64d1f28fdd", + "label": "KBV_22(2020) metadata", + "value": "27266" + }, + { + "description": "Jurisdiction Metadata for KBV_24(2020) id 27bda7b7-74ef-45b5-a574-9f15c49deb7d", + "key": "27bda7b7-74ef-45b5-a574-9f15c49deb7d", + "label": "KBV_24(2020) metadata", + "value": "27267" + }, + { + "description": "Jurisdiction Metadata for KBV_6(2020) id 9ccf9d8a-20cc-4f36-a363-536e40b6125d", + "key": "9ccf9d8a-20cc-4f36-a363-536e40b6125d", + "label": "KBV_6(2020) metadata", + "value": "27268" + }, + { + "description": "Jurisdiction Metadata for KBV_7(2020) id 3236a662-c15f-46f2-8d72-c87f6421ff37", + "key": "3236a662-c15f-46f2-8d72-c87f6421ff37", + "label": "KBV_7(2020) metadata", + "value": "27269" + }, + { + "description": "Jurisdiction Metadata for KBV_18(2020) id 91d1e9b6-c5b0-4033-8c72-b7ef635213c2", + "key": "91d1e9b6-c5b0-4033-8c72-b7ef635213c2", + "label": "KBV_18(2020) metadata", + "value": "27270" + }, + { + "description": "Jurisdiction Metadata for KBV_8(2020) id 903f7c53-2e9f-4209-843d-5be4de50eba5", + "key": "903f7c53-2e9f-4209-843d-5be4de50eba5", + "label": "KBV_8(2020) metadata", + "value": "27271" + }, + { + "description": "Jurisdiction Metadata for KBV_2(2020) id d94c71da-8320-44f3-a290-6fd4652d7027", + "key": "d94c71da-8320-44f3-a290-6fd4652d7027", + "label": "KBV_2(2020) metadata", + "value": "27272" + }, + { + "description": "Jurisdiction Metadata for KBV_9(2020) id 2b9ca0ec-9916-422c-8263-fa5d749de8af", + "key": "2b9ca0ec-9916-422c-8263-fa5d749de8af", + "label": "KBV_9(2020) metadata", + "value": "27273" + }, + { + "description": "Jurisdiction Metadata for KBV_15(2020) id 854dbc58-f33e-41d5-81d5-e066f1808cdc", + "key": "854dbc58-f33e-41d5-81d5-e066f1808cdc", + "label": "KBV_15(2020) metadata", + "value": "27274" + }, + { + "description": "Jurisdiction Metadata for KBV_5(2020) id bbb61836-24c2-4fcc-b507-f4ed2563c070", + "key": "bbb61836-24c2-4fcc-b507-f4ed2563c070", + "label": "KBV_5(2020) metadata", + "value": "27275" + }, + { + "description": "Jurisdiction Metadata for KBV_12(2020) id cdee405c-14f5-4b9c-978b-893860b585c6", + "key": "cdee405c-14f5-4b9c-978b-893860b585c6", + "label": "KBV_12(2020) metadata", + "value": "27276" + }, + { + "description": "Jurisdiction Metadata for KBV_14(2020) id 86736564-01b2-47b6-9b45-0e5ed5daf21d", + "key": "86736564-01b2-47b6-9b45-0e5ed5daf21d", + "label": "KBV_14(2020) metadata", + "value": "27277" + }, + { + "description": "Jurisdiction Metadata for KBV_13(2020) id abec2865-3173-4d3d-971c-72757b3fe485", + "key": "abec2865-3173-4d3d-971c-72757b3fe485", + "label": "KBV_13(2020) metadata", + "value": "27278" + }, + { + "description": "Jurisdiction Metadata for KBV_20(2020) id c2d1a09f-c8ef-45fe-ac2e-43d2b3ca59ef", + "key": "c2d1a09f-c8ef-45fe-ac2e-43d2b3ca59ef", + "label": "KBV_20(2020) metadata", + "value": "27279" + }, + { + "description": "Jurisdiction Metadata for KBV_21(2020) id c6e7b2d3-60df-4b53-b5f1-5b171ffef979", + "key": "c6e7b2d3-60df-4b53-b5f1-5b171ffef979", + "label": "KBV_21(2020) metadata", + "value": "27280" + }, + { + "description": "Jurisdiction Metadata for KBV_16(2020) id b415311b-d0b5-43b2-a72e-19fd75cfa871", + "key": "b415311b-d0b5-43b2-a72e-19fd75cfa871", + "label": "KBV_16(2020) metadata", + "value": "27281" + }, + { + "description": "Jurisdiction Metadata for KBV_10(2020) id 6569d633-2dd7-4388-9543-c239728e435f", + "key": "6569d633-2dd7-4388-9543-c239728e435f", + "label": "KBV_10(2020) metadata", + "value": "27282" + }, + { + "description": "Jurisdiction Metadata for KBV_23(2020) id 8762ca5f-37c9-4a8f-8140-4dcd7d596f4f", + "key": "8762ca5f-37c9-4a8f-8140-4dcd7d596f4f", + "label": "KBV_23(2020) metadata", + "value": "27283" + }, + { + "description": "Jurisdiction Metadata for KBV_25(2020) id d1cc4604-52aa-4328-b15a-6329527ff245", + "key": "d1cc4604-52aa-4328-b15a-6329527ff245", + "label": "KBV_25(2020) metadata", + "value": "27284" + }, + { + "description": "Jurisdiction Metadata for KBV_4(2020) id e3d384ff-d464-47a9-84c8-549948911654", + "key": "e3d384ff-d464-47a9-84c8-549948911654", + "label": "KBV_4(2020) metadata", + "value": "27285" + }, + { + "description": "Jurisdiction Metadata for KBV_17(2020) id 765fcda9-a438-4716-8a18-71a9846cbc55", + "key": "765fcda9-a438-4716-8a18-71a9846cbc55", + "label": "KBV_17(2020) metadata", + "value": "27286" + }, + { + "description": "Jurisdiction Metadata for KBV_3(2020) id da19ebb7-b7b3-49b6-9588-6549220c8296", + "key": "da19ebb7-b7b3-49b6-9588-6549220c8296", + "label": "KBV_3(2020) metadata", + "value": "27287" + }, + { + "description": "Jurisdiction Metadata for KBV_1(2020) id 0a2828f7-75e6-4a0f-836e-5dd4c64c27d5", + "key": "0a2828f7-75e6-4a0f-836e-5dd4c64c27d5", + "label": "KBV_1(2020) metadata", + "value": "27288" + }, + { + "description": "Jurisdiction Metadata for Msokosela(2020) id bd89489a-b31d-42d7-a74f-e562e1def3ac", + "key": "bd89489a-b31d-42d7-a74f-e562e1def3ac", + "label": "Msokosela(2020) metadata", + "value": "27289" + }, + { + "description": "Jurisdiction Metadata for Kafele NHC id e72a80a2-25e1-4986-b6cf-668b45c78044", + "key": "e72a80a2-25e1-4986-b6cf-668b45c78044", + "label": "Kafele NHC metadata", + "value": "27290" + }, + { + "description": "Jurisdiction Metadata for MSK_5(2020) id e9a2962d-bfbf-440c-8d33-3f406bd1ff0e", + "key": "e9a2962d-bfbf-440c-8d33-3f406bd1ff0e", + "label": "MSK_5(2020) metadata", + "value": "27291" + }, + { + "description": "Jurisdiction Metadata for MSK_4(2020) id 528b058b-be8e-4b45-ba5c-cfd7b57831f5", + "key": "528b058b-be8e-4b45-ba5c-cfd7b57831f5", + "label": "MSK_4(2020) metadata", + "value": "27292" + }, + { + "description": "Jurisdiction Metadata for MSK_6(2020) id 9001aebe-3fa4-468c-959a-8bb96ba84328", + "key": "9001aebe-3fa4-468c-959a-8bb96ba84328", + "label": "MSK_6(2020) metadata", + "value": "27293" + }, + { + "description": "Jurisdiction Metadata for MSK_1(2020) id ab9ab6d8-5958-4cf8-820d-7fddfc412f30", + "key": "ab9ab6d8-5958-4cf8-820d-7fddfc412f30", + "label": "MSK_1(2020) metadata", + "value": "27294" + }, + { + "description": "Jurisdiction Metadata for MSK_8(2020) id 318d7a82-cf6e-46ef-924f-11f904899c93", + "key": "318d7a82-cf6e-46ef-924f-11f904899c93", + "label": "MSK_8(2020) metadata", + "value": "27295" + }, + { + "description": "Jurisdiction Metadata for MSK_14(2020) id 2f108e56-e8d9-45d0-9a21-c53723d32b3f", + "key": "2f108e56-e8d9-45d0-9a21-c53723d32b3f", + "label": "MSK_14(2020) metadata", + "value": "27296" + }, + { + "description": "Jurisdiction Metadata for MSK_9(2020) id 32cbd919-5fae-403d-98ae-fe971cab2580", + "key": "32cbd919-5fae-403d-98ae-fe971cab2580", + "label": "MSK_9(2020) metadata", + "value": "27297" + }, + { + "description": "Jurisdiction Metadata for MSK_7(2020) id 624c9d68-0fe0-4abe-a436-542e9b730112", + "key": "624c9d68-0fe0-4abe-a436-542e9b730112", + "label": "MSK_7(2020) metadata", + "value": "27298" + }, + { + "description": "Jurisdiction Metadata for MSK_3(2020) id 08533096-35e6-4ce8-9103-b9a5b97e7110", + "key": "08533096-35e6-4ce8-9103-b9a5b97e7110", + "label": "MSK_3(2020) metadata", + "value": "27299" + }, + { + "description": "Jurisdiction Metadata for MSK_15(2020) id d2a94f83-06ac-49b1-b8b3-2589746fc096", + "key": "d2a94f83-06ac-49b1-b8b3-2589746fc096", + "label": "MSK_15(2020) metadata", + "value": "27300" + }, + { + "description": "Jurisdiction Metadata for MSK_11(2020) id 1315b6dc-ca6f-40d2-a673-370e75efe166", + "key": "1315b6dc-ca6f-40d2-a673-370e75efe166", + "label": "MSK_11(2020) metadata", + "value": "27301" + }, + { + "description": "Jurisdiction Metadata for MSK_2(2020) id e5d533f4-2f9b-43f5-a294-7bc07ef676d1", + "key": "e5d533f4-2f9b-43f5-a294-7bc07ef676d1", + "label": "MSK_2(2020) metadata", + "value": "27302" + }, + { + "description": "Jurisdiction Metadata for MSK_13(2020) id 7dc1985b-5037-4829-a31b-98262a77e880", + "key": "7dc1985b-5037-4829-a31b-98262a77e880", + "label": "MSK_13(2020) metadata", + "value": "27303" + }, + { + "description": "Jurisdiction Metadata for MSK_10(2020) id bf637a57-4082-4ae7-a149-c453435ca302", + "key": "bf637a57-4082-4ae7-a149-c453435ca302", + "label": "MSK_10(2020) metadata", + "value": "27304" + }, + { + "description": "Jurisdiction Metadata for MSK_12(2020) id 5c93c157-7129-4ed9-9156-63814a392fe1", + "key": "5c93c157-7129-4ed9-9156-63814a392fe1", + "label": "MSK_12(2020) metadata", + "value": "27305" + }, + { + "description": "Jurisdiction Metadata for Sinalo(2020) id b7daea1a-65d3-4324-8bcb-90ab44d91fc3", + "key": "b7daea1a-65d3-4324-8bcb-90ab44d91fc3", + "label": "Sinalo(2020) metadata", + "value": "27306" + }, + { + "description": "Jurisdiction Metadata for Chikatima_NHC id 3f391d73-5591-4f5a-98b9-5f9b9fc1597f", + "key": "3f391d73-5591-4f5a-98b9-5f9b9fc1597f", + "label": "Chikatima_NHC metadata", + "value": "27307" + }, + { + "description": "Jurisdiction Metadata for SNO_13(2020) id dc0e98ec-7162-4353-8f04-85c2c55494ca", + "key": "dc0e98ec-7162-4353-8f04-85c2c55494ca", + "label": "SNO_13(2020) metadata", + "value": "27308" + }, + { + "description": "Jurisdiction Metadata for SNO_7(2020) id 5a0f85e0-6381-41cc-b356-3001d519be2e", + "key": "5a0f85e0-6381-41cc-b356-3001d519be2e", + "label": "SNO_7(2020) metadata", + "value": "27309" + }, + { + "description": "Jurisdiction Metadata for SNO_15(2020) id 0ed2b7eb-243d-49dd-89e4-b70fa15949c0", + "key": "0ed2b7eb-243d-49dd-89e4-b70fa15949c0", + "label": "SNO_15(2020) metadata", + "value": "27310" + }, + { + "description": "Jurisdiction Metadata for SNO_5(2020) id 39695490-e43f-469d-9600-9ded64886355", + "key": "39695490-e43f-469d-9600-9ded64886355", + "label": "SNO_5(2020) metadata", + "value": "27311" + }, + { + "description": "Jurisdiction Metadata for SNO_11(2020) id c0241ef0-0a80-4c16-be1e-31601e21a339", + "key": "c0241ef0-0a80-4c16-be1e-31601e21a339", + "label": "SNO_11(2020) metadata", + "value": "27312" + }, + { + "description": "Jurisdiction Metadata for SNO_14(2020) id d88f9e75-7981-461e-968a-2a6af517aba8", + "key": "d88f9e75-7981-461e-968a-2a6af517aba8", + "label": "SNO_14(2020) metadata", + "value": "27313" + }, + { + "description": "Jurisdiction Metadata for SNO_1(2020) id 9c42c0f6-dd1d-43af-a468-e029bb93b2a1", + "key": "9c42c0f6-dd1d-43af-a468-e029bb93b2a1", + "label": "SNO_1(2020) metadata", + "value": "27314" + }, + { + "description": "Jurisdiction Metadata for SNO_3(2020) id 24102c48-6fdc-4298-b07b-7c2997076cc7", + "key": "24102c48-6fdc-4298-b07b-7c2997076cc7", + "label": "SNO_3(2020) metadata", + "value": "27315" + }, + { + "description": "Jurisdiction Metadata for SNO_4(2020) id 97a83c47-5899-4605-a173-747771c7f1cc", + "key": "97a83c47-5899-4605-a173-747771c7f1cc", + "label": "SNO_4(2020) metadata", + "value": "27316" + }, + { + "description": "Jurisdiction Metadata for SNO_6(2020) id b0767442-4661-462b-89c7-6ea759c19135", + "key": "b0767442-4661-462b-89c7-6ea759c19135", + "label": "SNO_6(2020) metadata", + "value": "27317" + }, + { + "description": "Jurisdiction Metadata for SNO_9(2020) id dd9fe367-0e48-4b80-bb38-382bcf3ca3b0", + "key": "dd9fe367-0e48-4b80-bb38-382bcf3ca3b0", + "label": "SNO_9(2020) metadata", + "value": "27318" + }, + { + "description": "Jurisdiction Metadata for SNO_12(2020) id a5637f30-7dd6-4301-9887-8260056d9896", + "key": "a5637f30-7dd6-4301-9887-8260056d9896", + "label": "SNO_12(2020) metadata", + "value": "27319" + }, + { + "description": "Jurisdiction Metadata for SNO_8(2020) id 741ba316-01d2-4857-8ae5-b14d2a5f0a39", + "key": "741ba316-01d2-4857-8ae5-b14d2a5f0a39", + "label": "SNO_8(2020) metadata", + "value": "27320" + }, + { + "description": "Jurisdiction Metadata for SNO_10(2020) id 103885f9-607e-4efb-b0b9-69cb49c7471a", + "key": "103885f9-607e-4efb-b0b9-69cb49c7471a", + "label": "SNO_10(2020) metadata", + "value": "27321" + }, + { + "description": "Jurisdiction Metadata for SNO_2(2020) id 0bf709b7-0e20-489e-8299-a5e2036c5a3a", + "key": "0bf709b7-0e20-489e-8299-a5e2036c5a3a", + "label": "SNO_2(2020) metadata", + "value": "27322" + }, + { + "description": "Jurisdiction Metadata for Chanida Border(2020) id 8f3506ef-7cd2-4326-92af-143175432ac0", + "key": "8f3506ef-7cd2-4326-92af-143175432ac0", + "label": "Chanida Border(2020) metadata", + "value": "27323" + }, + { + "description": "Jurisdiction Metadata for Border_NHC id b17e5ef7-ca63-4ce5-81ad-8891580246d9", + "key": "b17e5ef7-ca63-4ce5-81ad-8891580246d9", + "label": "Border_NHC metadata", + "value": "27324" + }, + { + "description": "Jurisdiction Metadata for CNB_3(2020) id 389045c8-332f-4ce0-ad21-3a105c8a2503", + "key": "389045c8-332f-4ce0-ad21-3a105c8a2503", + "label": "CNB_3(2020) metadata", + "value": "27325" + }, + { + "description": "Jurisdiction Metadata for CNB_11(2020) id 6ad35299-f98d-4c73-864b-789f7125c7e3", + "key": "6ad35299-f98d-4c73-864b-789f7125c7e3", + "label": "CNB_11(2020) metadata", + "value": "27326" + }, + { + "description": "Jurisdiction Metadata for CNB_8(2020) id 8b13d8fb-4c06-43d0-96bd-d463ce802960", + "key": "8b13d8fb-4c06-43d0-96bd-d463ce802960", + "label": "CNB_8(2020) metadata", + "value": "27327" + }, + { + "description": "Jurisdiction Metadata for CNB_7(2020) id 053afe53-9674-4a2f-a61f-a1991400e50e", + "key": "053afe53-9674-4a2f-a61f-a1991400e50e", + "label": "CNB_7(2020) metadata", + "value": "27328" + }, + { + "description": "Jurisdiction Metadata for CNB_1(2020) id 83867020-68ca-4063-810f-094bbe87b856", + "key": "83867020-68ca-4063-810f-094bbe87b856", + "label": "CNB_1(2020) metadata", + "value": "27329" + }, + { + "description": "Jurisdiction Metadata for CNB_5(2020) id 3d5d6011-4844-42c7-acaf-0462187cbcbd", + "key": "3d5d6011-4844-42c7-acaf-0462187cbcbd", + "label": "CNB_5(2020) metadata", + "value": "27330" + }, + { + "description": "Jurisdiction Metadata for CNB_12(2020) id e282f646-1d7e-4761-bb97-3e7a7adf33fd", + "key": "e282f646-1d7e-4761-bb97-3e7a7adf33fd", + "label": "CNB_12(2020) metadata", + "value": "27331" + }, + { + "description": "Jurisdiction Metadata for CNB_2(2020) id f29fb836-4c3e-4732-9ced-55dd26e14935", + "key": "f29fb836-4c3e-4732-9ced-55dd26e14935", + "label": "CNB_2(2020) metadata", + "value": "27332" + }, + { + "description": "Jurisdiction Metadata for CNB_9(2020) id d0df0735-8665-437d-a168-c32a89404a0a", + "key": "d0df0735-8665-437d-a168-c32a89404a0a", + "label": "CNB_9(2020) metadata", + "value": "27333" + }, + { + "description": "Jurisdiction Metadata for CNB_6(2020) id 164d9cb9-5974-4de0-b9ce-44348879d814", + "key": "164d9cb9-5974-4de0-b9ce-44348879d814", + "label": "CNB_6(2020) metadata", + "value": "27334" + }, + { + "description": "Jurisdiction Metadata for CNB_14(2020) id 11320dbe-c08f-4953-b30c-880b1708065b", + "key": "11320dbe-c08f-4953-b30c-880b1708065b", + "label": "CNB_14(2020) metadata", + "value": "27335" + }, + { + "description": "Jurisdiction Metadata for CNB_13(2020) id 2cef1ace-345d-4159-8d66-08f702dda55c", + "key": "2cef1ace-345d-4159-8d66-08f702dda55c", + "label": "CNB_13(2020) metadata", + "value": "27336" + }, + { + "description": "Jurisdiction Metadata for CNB_10(2020) id e37ca9bd-0bbc-45bf-9d1b-77606cc54cbc", + "key": "e37ca9bd-0bbc-45bf-9d1b-77606cc54cbc", + "label": "CNB_10(2020) metadata", + "value": "27337" + }, + { + "description": "Jurisdiction Metadata for CNB_4(2020) id 0f683266-630e-4f61-b2a2-1d9f92abbe57", + "key": "0f683266-630e-4f61-b2a2-1d9f92abbe57", + "label": "CNB_4(2020) metadata", + "value": "27338" + }, + { + "description": "Jurisdiction Metadata for CNB_15(2020) id d91d2ef8-07f3-448c-bfa1-82a594a7eef8", + "key": "d91d2ef8-07f3-448c-bfa1-82a594a7eef8", + "label": "CNB_15(2020) metadata", + "value": "27339" + }, + { + "description": "Jurisdiction Metadata for CNB_16(2020) id 7a1c8d35-20b1-4d4a-9332-ef00b4b3f9bf", + "key": "7a1c8d35-20b1-4d4a-9332-ef00b4b3f9bf", + "label": "CNB_16(2020) metadata", + "value": "27340" + }, + { + "description": "Jurisdiction Metadata for Zemba(2020) id 3970ee33-cde8-4b39-9af9-5b120ecea0b7", + "key": "3970ee33-cde8-4b39-9af9-5b120ecea0b7", + "label": "Zemba(2020) metadata", + "value": "27341" + }, + { + "description": "Jurisdiction Metadata for Mangwe_NHC id 3403b9c7-3025-40a4-9290-ef3817483572", + "key": "3403b9c7-3025-40a4-9290-ef3817483572", + "label": "Mangwe_NHC metadata", + "value": "27342" + }, + { + "description": "Jurisdiction Metadata for ZMB_118(2020) id 24ffa05d-77ac-4529-91c9-8b829908c8f5", + "key": "24ffa05d-77ac-4529-91c9-8b829908c8f5", + "label": "ZMB_118(2020) metadata", + "value": "27343" + }, + { + "description": "Jurisdiction Metadata for ZMB_121(2020) id 71094193-df79-429a-9273-f118d43cf8a6", + "key": "71094193-df79-429a-9273-f118d43cf8a6", + "label": "ZMB_121(2020) metadata", + "value": "27344" + }, + { + "description": "Jurisdiction Metadata for ZMB_95(2020) id 08340255-f1a9-48d3-bb9b-b19010d64151", + "key": "08340255-f1a9-48d3-bb9b-b19010d64151", + "label": "ZMB_95(2020) metadata", + "value": "27345" + }, + { + "description": "Jurisdiction Metadata for ZMB_33(2020) id 9e647275-0cfd-4a60-a1e7-2cf0ea649f92", + "key": "9e647275-0cfd-4a60-a1e7-2cf0ea649f92", + "label": "ZMB_33(2020) metadata", + "value": "27346" + }, + { + "description": "Jurisdiction Metadata for ZMB_13(2020) id a5f27f65-90f0-4a4f-bab0-800519e4244d", + "key": "a5f27f65-90f0-4a4f-bab0-800519e4244d", + "label": "ZMB_13(2020) metadata", + "value": "27347" + }, + { + "description": "Jurisdiction Metadata for ZMB_27(2020) id c385c600-d06b-4c63-9604-04fff3e11e03", + "key": "c385c600-d06b-4c63-9604-04fff3e11e03", + "label": "ZMB_27(2020) metadata", + "value": "27348" + }, + { + "description": "Jurisdiction Metadata for ZMB_8(2020) id 842bddf1-606c-4cd3-a404-00ecc56a6198", + "key": "842bddf1-606c-4cd3-a404-00ecc56a6198", + "label": "ZMB_8(2020) metadata", + "value": "27349" + }, + { + "description": "Jurisdiction Metadata for ZMB_19(2020) id 284724c3-6f94-4173-b25b-bd442f5b4eb1", + "key": "284724c3-6f94-4173-b25b-bd442f5b4eb1", + "label": "ZMB_19(2020) metadata", + "value": "27350" + }, + { + "description": "Jurisdiction Metadata for ZMB_64(2020) id 7a62d1b6-610a-4483-a2d2-44c08c4f6bf6", + "key": "7a62d1b6-610a-4483-a2d2-44c08c4f6bf6", + "label": "ZMB_64(2020) metadata", + "value": "27351" + }, + { + "description": "Jurisdiction Metadata for ZMB_76(2020) id 9e85edb1-8e8b-4ddd-9a60-5be44086db39", + "key": "9e85edb1-8e8b-4ddd-9a60-5be44086db39", + "label": "ZMB_76(2020) metadata", + "value": "27352" + }, + { + "description": "Jurisdiction Metadata for ZMB_77(2020) id a7508ed1-aa77-42ac-8596-a5ebcabc2b93", + "key": "a7508ed1-aa77-42ac-8596-a5ebcabc2b93", + "label": "ZMB_77(2020) metadata", + "value": "27353" + }, + { + "description": "Jurisdiction Metadata for ZMB_50(2020) id 6d61312b-2b52-499c-99b7-136c5c993991", + "key": "6d61312b-2b52-499c-99b7-136c5c993991", + "label": "ZMB_50(2020) metadata", + "value": "27354" + }, + { + "description": "Jurisdiction Metadata for ZMB_38(2020) id 1a0033cf-fec7-49ac-8348-6b54bb7caef8", + "key": "1a0033cf-fec7-49ac-8348-6b54bb7caef8", + "label": "ZMB_38(2020) metadata", + "value": "27355" + }, + { + "description": "Jurisdiction Metadata for ZMB_45(2020) id dbf95afa-640c-41b0-989a-afcaff99fb81", + "key": "dbf95afa-640c-41b0-989a-afcaff99fb81", + "label": "ZMB_45(2020) metadata", + "value": "27356" + }, + { + "description": "Jurisdiction Metadata for ZMB_60(2020) id 45902aca-46a8-4397-a542-b2fa65c9d9b0", + "key": "45902aca-46a8-4397-a542-b2fa65c9d9b0", + "label": "ZMB_60(2020) metadata", + "value": "27357" + }, + { + "description": "Jurisdiction Metadata for ZMB_36(2020) id cb7b8045-fbc9-4723-abd0-f19801238d92", + "key": "cb7b8045-fbc9-4723-abd0-f19801238d92", + "label": "ZMB_36(2020) metadata", + "value": "27358" + }, + { + "description": "Jurisdiction Metadata for ZMB_51(2020) id 5ed9f5fa-29ef-4228-86a2-2a7ef970ecc7", + "key": "5ed9f5fa-29ef-4228-86a2-2a7ef970ecc7", + "label": "ZMB_51(2020) metadata", + "value": "27359" + }, + { + "description": "Jurisdiction Metadata for ZMB_73(2020) id 0c3bc5f1-dbeb-408b-bfd5-de21e81cb339", + "key": "0c3bc5f1-dbeb-408b-bfd5-de21e81cb339", + "label": "ZMB_73(2020) metadata", + "value": "27360" + }, + { + "description": "Jurisdiction Metadata for ZMB_93(2020) id bde488c3-54e1-4c68-8184-e6d282ae3268", + "key": "bde488c3-54e1-4c68-8184-e6d282ae3268", + "label": "ZMB_93(2020) metadata", + "value": "27361" + }, + { + "description": "Jurisdiction Metadata for ZMB_68(2020) id a24100d7-8816-4012-b27f-05e3a532a9e1", + "key": "a24100d7-8816-4012-b27f-05e3a532a9e1", + "label": "ZMB_68(2020) metadata", + "value": "27362" + }, + { + "description": "Jurisdiction Metadata for ZMB_49(2020) id 0eef5867-0361-4e94-96f3-2c79a661e42b", + "key": "0eef5867-0361-4e94-96f3-2c79a661e42b", + "label": "ZMB_49(2020) metadata", + "value": "27363" + }, + { + "description": "Jurisdiction Metadata for ZMB_52(2020) id 7ab090d0-a335-491f-9a75-fd64c45aa374", + "key": "7ab090d0-a335-491f-9a75-fd64c45aa374", + "label": "ZMB_52(2020) metadata", + "value": "27364" + }, + { + "description": "Jurisdiction Metadata for ZMB_15(2020) id d2c360ae-c866-4041-9a24-3b0120a226e5", + "key": "d2c360ae-c866-4041-9a24-3b0120a226e5", + "label": "ZMB_15(2020) metadata", + "value": "27365" + }, + { + "description": "Jurisdiction Metadata for ZMB_7(2020) id 7eaa688d-a19c-4a6f-b755-14643a51d405", + "key": "7eaa688d-a19c-4a6f-b755-14643a51d405", + "label": "ZMB_7(2020) metadata", + "value": "27366" + }, + { + "description": "Jurisdiction Metadata for ZMB_79(2020) id 55236d28-878a-4bbb-bf4b-1adf4f13315c", + "key": "55236d28-878a-4bbb-bf4b-1adf4f13315c", + "label": "ZMB_79(2020) metadata", + "value": "27367" + }, + { + "description": "Jurisdiction Metadata for ZMB_5(2020) id ef051e6f-0989-4d31-9e46-d5fe2bb2321b", + "key": "ef051e6f-0989-4d31-9e46-d5fe2bb2321b", + "label": "ZMB_5(2020) metadata", + "value": "27368" + }, + { + "description": "Jurisdiction Metadata for ZMB_105(2020) id 4ccb442c-2f3b-41a9-a2c6-441e7732c085", + "key": "4ccb442c-2f3b-41a9-a2c6-441e7732c085", + "label": "ZMB_105(2020) metadata", + "value": "27369" + }, + { + "description": "Jurisdiction Metadata for ZMB_20(2020) id ec5a3b9b-5ee9-4efd-a04c-6567ba1b0fad", + "key": "ec5a3b9b-5ee9-4efd-a04c-6567ba1b0fad", + "label": "ZMB_20(2020) metadata", + "value": "27370" + }, + { + "description": "Jurisdiction Metadata for ZMB_21(2020) id fca8bcce-880d-4307-a8a0-45d284968d53", + "key": "fca8bcce-880d-4307-a8a0-45d284968d53", + "label": "ZMB_21(2020) metadata", + "value": "27371" + }, + { + "description": "Jurisdiction Metadata for ZMB_26(2020) id e2aba9fb-6838-47fa-ad32-6d4fa5305d0e", + "key": "e2aba9fb-6838-47fa-ad32-6d4fa5305d0e", + "label": "ZMB_26(2020) metadata", + "value": "27372" + }, + { + "description": "Jurisdiction Metadata for ZMB_57(2020) id 800f6ace-f43f-47ba-815c-8e21dee26beb", + "key": "800f6ace-f43f-47ba-815c-8e21dee26beb", + "label": "ZMB_57(2020) metadata", + "value": "27373" + }, + { + "description": "Jurisdiction Metadata for ZMB_55(2020) id a503481d-ac9f-4b41-b939-7eac3094a4e0", + "key": "a503481d-ac9f-4b41-b939-7eac3094a4e0", + "label": "ZMB_55(2020) metadata", + "value": "27374" + }, + { + "description": "Jurisdiction Metadata for ZMB_89(2020) id 2a3004e7-8845-4c5a-9aba-c220040b17aa", + "key": "2a3004e7-8845-4c5a-9aba-c220040b17aa", + "label": "ZMB_89(2020) metadata", + "value": "27375" + }, + { + "description": "Jurisdiction Metadata for ZMB_81(2020) id e3792568-58f0-4064-a9df-b23c6a1a3343", + "key": "e3792568-58f0-4064-a9df-b23c6a1a3343", + "label": "ZMB_81(2020) metadata", + "value": "27376" + }, + { + "description": "Jurisdiction Metadata for ZMB_82(2020) id fbbf86f9-b87d-47f1-99b6-236cb26556c6", + "key": "fbbf86f9-b87d-47f1-99b6-236cb26556c6", + "label": "ZMB_82(2020) metadata", + "value": "27377" + }, + { + "description": "Jurisdiction Metadata for ZMB_75(2020) id 91e0ccfd-fb39-49e0-84c1-c452d0cbc88b", + "key": "91e0ccfd-fb39-49e0-84c1-c452d0cbc88b", + "label": "ZMB_75(2020) metadata", + "value": "27378" + }, + { + "description": "Jurisdiction Metadata for ZMB_25(2020) id a12239b6-3b0a-43e4-9cca-3cd86832ded2", + "key": "a12239b6-3b0a-43e4-9cca-3cd86832ded2", + "label": "ZMB_25(2020) metadata", + "value": "27379" + }, + { + "description": "Jurisdiction Metadata for ZMB_62(2020) id f390c304-7a32-4813-be03-f7042cd62a92", + "key": "f390c304-7a32-4813-be03-f7042cd62a92", + "label": "ZMB_62(2020) metadata", + "value": "27380" + }, + { + "description": "Jurisdiction Metadata for ZMB_17(2020) id b5af2c1c-2ed6-4d08-bd7d-9d4dcefb98cf", + "key": "b5af2c1c-2ed6-4d08-bd7d-9d4dcefb98cf", + "label": "ZMB_17(2020) metadata", + "value": "27381" + }, + { + "description": "Jurisdiction Metadata for ZMB_116(2020) id 4da1e56d-177c-4faa-b734-943d0be068c3", + "key": "4da1e56d-177c-4faa-b734-943d0be068c3", + "label": "ZMB_116(2020) metadata", + "value": "27382" + }, + { + "description": "Jurisdiction Metadata for ZMB_35(2020) id 3719ab83-4968-4cab-aec1-8fa76b43261e", + "key": "3719ab83-4968-4cab-aec1-8fa76b43261e", + "label": "ZMB_35(2020) metadata", + "value": "27383" + }, + { + "description": "Jurisdiction Metadata for ZMB_37(2020) id 3f9802a0-ff45-440d-b0b2-f0d2474b9fc2", + "key": "3f9802a0-ff45-440d-b0b2-f0d2474b9fc2", + "label": "ZMB_37(2020) metadata", + "value": "27384" + }, + { + "description": "Jurisdiction Metadata for ZMB_103(2020) id 0c634971-8af7-492d-b663-dea3882fd20b", + "key": "0c634971-8af7-492d-b663-dea3882fd20b", + "label": "ZMB_103(2020) metadata", + "value": "27385" + }, + { + "description": "Jurisdiction Metadata for ZMB_1(2020) id 3dff89c2-5ca7-4570-b51c-bbc7e4c07ee3", + "key": "3dff89c2-5ca7-4570-b51c-bbc7e4c07ee3", + "label": "ZMB_1(2020) metadata", + "value": "27386" + }, + { + "description": "Jurisdiction Metadata for ZMB_63(2020) id a6640d93-5811-4f00-8e1f-4681b97d9eb0", + "key": "a6640d93-5811-4f00-8e1f-4681b97d9eb0", + "label": "ZMB_63(2020) metadata", + "value": "27387" + }, + { + "description": "Jurisdiction Metadata for ZMB_80(2020) id 2c9478ad-8c02-4c0e-8780-8bfe1c6d430d", + "key": "2c9478ad-8c02-4c0e-8780-8bfe1c6d430d", + "label": "ZMB_80(2020) metadata", + "value": "27388" + }, + { + "description": "Jurisdiction Metadata for ZMB_18(2020) id e507f6ec-0080-4809-9de0-eb1eb3e2c301", + "key": "e507f6ec-0080-4809-9de0-eb1eb3e2c301", + "label": "ZMB_18(2020) metadata", + "value": "27389" + }, + { + "description": "Jurisdiction Metadata for ZMB_74(2020) id eaf6ceb8-254d-47f1-8c90-602469f4474d", + "key": "eaf6ceb8-254d-47f1-8c90-602469f4474d", + "label": "ZMB_74(2020) metadata", + "value": "27390" + }, + { + "description": "Jurisdiction Metadata for ZMB_110(2020) id e7b1d409-6fad-4a43-9eda-c20c80979e51", + "key": "e7b1d409-6fad-4a43-9eda-c20c80979e51", + "label": "ZMB_110(2020) metadata", + "value": "27391" + }, + { + "description": "Jurisdiction Metadata for ZMB_34(2020) id ee260e50-1e2a-4ecd-be98-e9ddeb1ecdc8", + "key": "ee260e50-1e2a-4ecd-be98-e9ddeb1ecdc8", + "label": "ZMB_34(2020) metadata", + "value": "27392" + }, + { + "description": "Jurisdiction Metadata for ZMB_104(2020) id 0bf03e5b-2137-4b65-9a3a-23001c09cba4", + "key": "0bf03e5b-2137-4b65-9a3a-23001c09cba4", + "label": "ZMB_104(2020) metadata", + "value": "27393" + }, + { + "description": "Jurisdiction Metadata for ZMB_42(2020) id 48f4cd87-9931-4f85-846c-2e8ea2b8efe6", + "key": "48f4cd87-9931-4f85-846c-2e8ea2b8efe6", + "label": "ZMB_42(2020) metadata", + "value": "27394" + }, + { + "description": "Jurisdiction Metadata for ZMB_87(2020) id ae04218d-ca82-4cfa-9295-cf4404717384", + "key": "ae04218d-ca82-4cfa-9295-cf4404717384", + "label": "ZMB_87(2020) metadata", + "value": "27395" + }, + { + "description": "Jurisdiction Metadata for ZMB_113(2020) id a6d18fe4-4695-4b2c-b47d-ca2d9683e771", + "key": "a6d18fe4-4695-4b2c-b47d-ca2d9683e771", + "label": "ZMB_113(2020) metadata", + "value": "27396" + }, + { + "description": "Jurisdiction Metadata for ZMB_120(2020) id 4be82327-d2e2-4b12-99d5-37aec685acc7", + "key": "4be82327-d2e2-4b12-99d5-37aec685acc7", + "label": "ZMB_120(2020) metadata", + "value": "27397" + }, + { + "description": "Jurisdiction Metadata for ZMB_2(2020) id 6a57f9fd-567b-45cf-b1b4-00d36c96bb99", + "key": "6a57f9fd-567b-45cf-b1b4-00d36c96bb99", + "label": "ZMB_2(2020) metadata", + "value": "27398" + }, + { + "description": "Jurisdiction Metadata for ZMB_108(2020) id 066cd36f-2d01-4893-9cd2-fc22ee2b7ee3", + "key": "066cd36f-2d01-4893-9cd2-fc22ee2b7ee3", + "label": "ZMB_108(2020) metadata", + "value": "27399" + }, + { + "description": "Jurisdiction Metadata for ZMB_48(2020) id a5f48bbb-0139-4bde-8852-427535b973e6", + "key": "a5f48bbb-0139-4bde-8852-427535b973e6", + "label": "ZMB_48(2020) metadata", + "value": "27400" + }, + { + "description": "Jurisdiction Metadata for ZMB_112(2020) id 4f105778-d674-47cc-b296-23346b8f0776", + "key": "4f105778-d674-47cc-b296-23346b8f0776", + "label": "ZMB_112(2020) metadata", + "value": "27401" + }, + { + "description": "Jurisdiction Metadata for ZMB_66(2020) id abbd0eb2-64ca-42ee-82c2-427a32ecb2f9", + "key": "abbd0eb2-64ca-42ee-82c2-427a32ecb2f9", + "label": "ZMB_66(2020) metadata", + "value": "27402" + }, + { + "description": "Jurisdiction Metadata for ZMB_9(2020) id 2ed57d26-1147-47a3-8d79-d24505a6336c", + "key": "2ed57d26-1147-47a3-8d79-d24505a6336c", + "label": "ZMB_9(2020) metadata", + "value": "27403" + }, + { + "description": "Jurisdiction Metadata for ZMB_102(2020) id c20a2916-453b-4eb5-aea8-9464a1aefa8f", + "key": "c20a2916-453b-4eb5-aea8-9464a1aefa8f", + "label": "ZMB_102(2020) metadata", + "value": "27404" + }, + { + "description": "Jurisdiction Metadata for ZMB_47(2020) id 1dccfb08-2077-463a-b136-75e4517b92c7", + "key": "1dccfb08-2077-463a-b136-75e4517b92c7", + "label": "ZMB_47(2020) metadata", + "value": "27405" + }, + { + "description": "Jurisdiction Metadata for ZMB_32(2020) id 94144b6a-0abf-4eff-978f-c12dc19a8569", + "key": "94144b6a-0abf-4eff-978f-c12dc19a8569", + "label": "ZMB_32(2020) metadata", + "value": "27406" + }, + { + "description": "Jurisdiction Metadata for ZMB_43(2020) id 40b9f13b-efed-4f6c-8303-e13cf794b70a", + "key": "40b9f13b-efed-4f6c-8303-e13cf794b70a", + "label": "ZMB_43(2020) metadata", + "value": "27407" + }, + { + "description": "Jurisdiction Metadata for ZMB_71(2020) id 5b623cf9-9671-4f84-a3a9-36acb7d619a7", + "key": "5b623cf9-9671-4f84-a3a9-36acb7d619a7", + "label": "ZMB_71(2020) metadata", + "value": "27408" + }, + { + "description": "Jurisdiction Metadata for ZMB_83(2020) id 6637e711-5bb0-406e-8d7d-05597a71e3fd", + "key": "6637e711-5bb0-406e-8d7d-05597a71e3fd", + "label": "ZMB_83(2020) metadata", + "value": "27409" + }, + { + "description": "Jurisdiction Metadata for ZMB_41(2020) id 278f5031-4725-4a0a-91e9-5c64ec97eeb4", + "key": "278f5031-4725-4a0a-91e9-5c64ec97eeb4", + "label": "ZMB_41(2020) metadata", + "value": "27410" + }, + { + "description": "Jurisdiction Metadata for ZMB_31(2020) id 7a2d410c-7fe5-4b35-b191-830f8379b85a", + "key": "7a2d410c-7fe5-4b35-b191-830f8379b85a", + "label": "ZMB_31(2020) metadata", + "value": "27411" + }, + { + "description": "Jurisdiction Metadata for ZMB_98(2020) id 65160c6c-2d0d-4178-82c4-2351da8574cc", + "key": "65160c6c-2d0d-4178-82c4-2351da8574cc", + "label": "ZMB_98(2020) metadata", + "value": "27412" + }, + { + "description": "Jurisdiction Metadata for ZMB_94(2020) id 05f91fe3-971d-452b-b0a7-00e89bc21215", + "key": "05f91fe3-971d-452b-b0a7-00e89bc21215", + "label": "ZMB_94(2020) metadata", + "value": "27413" + }, + { + "description": "Jurisdiction Metadata for ZMB_84(2020) id ecbce016-8eeb-4fc2-be44-7e249b43cf81", + "key": "ecbce016-8eeb-4fc2-be44-7e249b43cf81", + "label": "ZMB_84(2020) metadata", + "value": "27414" + }, + { + "description": "Jurisdiction Metadata for ZMB_23(2020) id 906c72f2-4553-4a06-8042-d1f5e7f066ac", + "key": "906c72f2-4553-4a06-8042-d1f5e7f066ac", + "label": "ZMB_23(2020) metadata", + "value": "27415" + }, + { + "description": "Jurisdiction Metadata for ZMB_58(2020) id 66e4ba8d-b832-4581-a5a5-67fc37405244", + "key": "66e4ba8d-b832-4581-a5a5-67fc37405244", + "label": "ZMB_58(2020) metadata", + "value": "27416" + }, + { + "description": "Jurisdiction Metadata for ZMB_88(2020) id 74d65cf0-61c5-445c-b4cd-2315f89def3c", + "key": "74d65cf0-61c5-445c-b4cd-2315f89def3c", + "label": "ZMB_88(2020) metadata", + "value": "27417" + }, + { + "description": "Jurisdiction Metadata for ZMB_69(2020) id 729a77d1-0981-4edd-9418-7c9100687fa2", + "key": "729a77d1-0981-4edd-9418-7c9100687fa2", + "label": "ZMB_69(2020) metadata", + "value": "27418" + }, + { + "description": "Jurisdiction Metadata for ZMB_4(2020) id 9c80d90c-86c9-487d-bcfd-1d37201cc879", + "key": "9c80d90c-86c9-487d-bcfd-1d37201cc879", + "label": "ZMB_4(2020) metadata", + "value": "27419" + }, + { + "description": "Jurisdiction Metadata for ZMB_10(2020) id 5741b1cb-4d16-426d-9860-e22247803439", + "key": "5741b1cb-4d16-426d-9860-e22247803439", + "label": "ZMB_10(2020) metadata", + "value": "27420" + }, + { + "description": "Jurisdiction Metadata for ZMB_12(2020) id 52e8a741-abd0-4033-a448-3961544a8338", + "key": "52e8a741-abd0-4033-a448-3961544a8338", + "label": "ZMB_12(2020) metadata", + "value": "27421" + }, + { + "description": "Jurisdiction Metadata for ZMB_114(2020) id 14c089b2-ff3a-494e-be5f-fa51e58cd372", + "key": "14c089b2-ff3a-494e-be5f-fa51e58cd372", + "label": "ZMB_114(2020) metadata", + "value": "27422" + }, + { + "description": "Jurisdiction Metadata for ZMB_117(2020) id 9ec022c3-17e0-484c-9ffe-ab644c2b641e", + "key": "9ec022c3-17e0-484c-9ffe-ab644c2b641e", + "label": "ZMB_117(2020) metadata", + "value": "27423" + }, + { + "description": "Jurisdiction Metadata for ZMB_115(2020) id 648cf7da-f584-494b-a04b-e13b30dfb29b", + "key": "648cf7da-f584-494b-a04b-e13b30dfb29b", + "label": "ZMB_115(2020) metadata", + "value": "27424" + }, + { + "description": "Jurisdiction Metadata for ZMB_24(2020) id 102d4005-4f75-4b15-ad29-a5194e14fd1b", + "key": "102d4005-4f75-4b15-ad29-a5194e14fd1b", + "label": "ZMB_24(2020) metadata", + "value": "27425" + }, + { + "description": "Jurisdiction Metadata for ZMB_39(2020) id d8cb0447-5764-4e2d-a7aa-6f4f94f8669f", + "key": "d8cb0447-5764-4e2d-a7aa-6f4f94f8669f", + "label": "ZMB_39(2020) metadata", + "value": "27426" + }, + { + "description": "Jurisdiction Metadata for ZMB_92(2020) id 595626db-3a2f-4633-9d10-f2933d466aa5", + "key": "595626db-3a2f-4633-9d10-f2933d466aa5", + "label": "ZMB_92(2020) metadata", + "value": "27427" + }, + { + "description": "Jurisdiction Metadata for ZMB_91(2020) id 44844bb5-c6b1-4dba-a937-6ef468059d11", + "key": "44844bb5-c6b1-4dba-a937-6ef468059d11", + "label": "ZMB_91(2020) metadata", + "value": "27428" + }, + { + "description": "Jurisdiction Metadata for ZMB_70(2020) id 1e6829db-85f5-4cba-9198-88bccf9788b9", + "key": "1e6829db-85f5-4cba-9198-88bccf9788b9", + "label": "ZMB_70(2020) metadata", + "value": "27429" + }, + { + "description": "Jurisdiction Metadata for ZMB_29(2020) id bf8c3470-ec63-4afb-a73e-ae4330d77d2a", + "key": "bf8c3470-ec63-4afb-a73e-ae4330d77d2a", + "label": "ZMB_29(2020) metadata", + "value": "27430" + }, + { + "description": "Jurisdiction Metadata for ZMB_56(2020) id 4e01fa0f-a7b2-4087-a528-be49c06e9ee3", + "key": "4e01fa0f-a7b2-4087-a528-be49c06e9ee3", + "label": "ZMB_56(2020) metadata", + "value": "27431" + }, + { + "description": "Jurisdiction Metadata for ZMB_6(2020) id 22983e55-5483-48a9-8a82-7010162c5163", + "key": "22983e55-5483-48a9-8a82-7010162c5163", + "label": "ZMB_6(2020) metadata", + "value": "27432" + }, + { + "description": "Jurisdiction Metadata for ZMB_86(2020) id 7ec3ba4f-33e0-46d6-9e45-d89fec2a9098", + "key": "7ec3ba4f-33e0-46d6-9e45-d89fec2a9098", + "label": "ZMB_86(2020) metadata", + "value": "27433" + }, + { + "description": "Jurisdiction Metadata for ZMB_72(2020) id 3a96c4c7-b3da-408f-b39f-28c462a9f05c", + "key": "3a96c4c7-b3da-408f-b39f-28c462a9f05c", + "label": "ZMB_72(2020) metadata", + "value": "27434" + }, + { + "description": "Jurisdiction Metadata for ZMB_14(2020) id 9426d44c-d782-49c7-82e1-acf8db5c188f", + "key": "9426d44c-d782-49c7-82e1-acf8db5c188f", + "label": "ZMB_14(2020) metadata", + "value": "27435" + }, + { + "description": "Jurisdiction Metadata for ZMB_53(2020) id 20fe36bc-a678-49e9-8eae-b0286a7ba4f7", + "key": "20fe36bc-a678-49e9-8eae-b0286a7ba4f7", + "label": "ZMB_53(2020) metadata", + "value": "27436" + }, + { + "description": "Jurisdiction Metadata for ZMB_122(2020) id 0a15fafe-e118-4958-a64a-4ea0af5f7edf", + "key": "0a15fafe-e118-4958-a64a-4ea0af5f7edf", + "label": "ZMB_122(2020) metadata", + "value": "27437" + }, + { + "description": "Jurisdiction Metadata for ZMB_97(2020) id 9177ae99-98fd-42cc-aa35-5b079f74ca01", + "key": "9177ae99-98fd-42cc-aa35-5b079f74ca01", + "label": "ZMB_97(2020) metadata", + "value": "27438" + }, + { + "description": "Jurisdiction Metadata for ZMB_107(2020) id 4f9dae5d-195c-44cf-b3eb-0436ea30bc16", + "key": "4f9dae5d-195c-44cf-b3eb-0436ea30bc16", + "label": "ZMB_107(2020) metadata", + "value": "27439" + }, + { + "description": "Jurisdiction Metadata for ZMB_65(2020) id bac023c4-146c-46ba-85c8-c00f677fb0f1", + "key": "bac023c4-146c-46ba-85c8-c00f677fb0f1", + "label": "ZMB_65(2020) metadata", + "value": "27440" + }, + { + "description": "Jurisdiction Metadata for ZMB_78(2020) id de113481-77dd-49d5-94a8-13576ee11d2f", + "key": "de113481-77dd-49d5-94a8-13576ee11d2f", + "label": "ZMB_78(2020) metadata", + "value": "27441" + }, + { + "description": "Jurisdiction Metadata for ZMB_123(2020) id f4a22252-6da5-40a4-bb9c-f8b6d750e51a", + "key": "f4a22252-6da5-40a4-bb9c-f8b6d750e51a", + "label": "ZMB_123(2020) metadata", + "value": "27442" + }, + { + "description": "Jurisdiction Metadata for ZMB_85(2020) id 4eb1f44f-7567-47cb-aeb3-8ad66593e6e2", + "key": "4eb1f44f-7567-47cb-aeb3-8ad66593e6e2", + "label": "ZMB_85(2020) metadata", + "value": "27443" + }, + { + "description": "Jurisdiction Metadata for ZMB_111(2020) id 03c2b4bd-24ae-4e15-b754-0a46909c7f0f", + "key": "03c2b4bd-24ae-4e15-b754-0a46909c7f0f", + "label": "ZMB_111(2020) metadata", + "value": "27444" + }, + { + "description": "Jurisdiction Metadata for ZMB_96(2020) id 73e1387b-1d96-426e-8fc4-e3c70a1358ec", + "key": "73e1387b-1d96-426e-8fc4-e3c70a1358ec", + "label": "ZMB_96(2020) metadata", + "value": "27445" + }, + { + "description": "Jurisdiction Metadata for ZMB_40(2020) id 29340723-b963-4485-86ba-1fa0b9f5ecd8", + "key": "29340723-b963-4485-86ba-1fa0b9f5ecd8", + "label": "ZMB_40(2020) metadata", + "value": "27446" + }, + { + "description": "Jurisdiction Metadata for ZMB_54(2020) id 12226db4-0cc1-4b99-87a8-833d16a7b0b8", + "key": "12226db4-0cc1-4b99-87a8-833d16a7b0b8", + "label": "ZMB_54(2020) metadata", + "value": "27447" + }, + { + "description": "Jurisdiction Metadata for ZMB_30(2020) id f769d54f-4fb6-4200-975e-4964b9f0dd00", + "key": "f769d54f-4fb6-4200-975e-4964b9f0dd00", + "label": "ZMB_30(2020) metadata", + "value": "27448" + }, + { + "description": "Jurisdiction Metadata for ZMB_90(2020) id be74f25b-b546-46d2-b3e7-1e0826b5227c", + "key": "be74f25b-b546-46d2-b3e7-1e0826b5227c", + "label": "ZMB_90(2020) metadata", + "value": "27449" + }, + { + "description": "Jurisdiction Metadata for ZMB_106(2020) id 18bbe63f-a303-4009-9b3a-b107ed07ae08", + "key": "18bbe63f-a303-4009-9b3a-b107ed07ae08", + "label": "ZMB_106(2020) metadata", + "value": "27450" + }, + { + "description": "Jurisdiction Metadata for ZMB_46(2020) id 976fdb9f-7a67-4aec-8f57-d119ec5bbc5c", + "key": "976fdb9f-7a67-4aec-8f57-d119ec5bbc5c", + "label": "ZMB_46(2020) metadata", + "value": "27451" + }, + { + "description": "Jurisdiction Metadata for ZMB_61(2020) id c56d36de-7466-4996-a809-698973dfc41f", + "key": "c56d36de-7466-4996-a809-698973dfc41f", + "label": "ZMB_61(2020) metadata", + "value": "27452" + }, + { + "description": "Jurisdiction Metadata for ZMB_44(2020) id 4ab8baac-2991-468b-bad1-6263f82d6fc5", + "key": "4ab8baac-2991-468b-bad1-6263f82d6fc5", + "label": "ZMB_44(2020) metadata", + "value": "27453" + }, + { + "description": "Jurisdiction Metadata for ZMB_119(2020) id 6144dc2c-e030-47b7-a129-02440f5ac724", + "key": "6144dc2c-e030-47b7-a129-02440f5ac724", + "label": "ZMB_119(2020) metadata", + "value": "27454" + }, + { + "description": "Jurisdiction Metadata for ZMB_11(2020) id 7f85998e-48c5-40d0-9bf0-a45d324cb360", + "key": "7f85998e-48c5-40d0-9bf0-a45d324cb360", + "label": "ZMB_11(2020) metadata", + "value": "27455" + }, + { + "description": "Jurisdiction Metadata for ZMB_101(2020) id 2b704813-94e5-4118-81e6-f338e47dd966", + "key": "2b704813-94e5-4118-81e6-f338e47dd966", + "label": "ZMB_101(2020) metadata", + "value": "27456" + }, + { + "description": "Jurisdiction Metadata for ZMB_59(2020) id 542b210a-2ffc-4831-9112-93dc2b27b1bd", + "key": "542b210a-2ffc-4831-9112-93dc2b27b1bd", + "label": "ZMB_59(2020) metadata", + "value": "27457" + }, + { + "description": "Jurisdiction Metadata for ZMB_16(2020) id 02996c44-0f3a-4a7f-96ce-874dc2635eba", + "key": "02996c44-0f3a-4a7f-96ce-874dc2635eba", + "label": "ZMB_16(2020) metadata", + "value": "27458" + }, + { + "description": "Jurisdiction Metadata for ZMB_100(2020) id 08c0a57b-f6d2-495e-ba60-44b51cc00923", + "key": "08c0a57b-f6d2-495e-ba60-44b51cc00923", + "label": "ZMB_100(2020) metadata", + "value": "27459" + }, + { + "description": "Jurisdiction Metadata for ZMB_109(2020) id e182c198-447f-4217-a37e-c785db12013d", + "key": "e182c198-447f-4217-a37e-c785db12013d", + "label": "ZMB_109(2020) metadata", + "value": "27460" + }, + { + "description": "Jurisdiction Metadata for ZMB_22(2020) id c886e084-b68a-4ff2-85f0-57b5f9dd6c54", + "key": "c886e084-b68a-4ff2-85f0-57b5f9dd6c54", + "label": "ZMB_22(2020) metadata", + "value": "27461" + }, + { + "description": "Jurisdiction Metadata for ZMB_99(2020) id 9aeebb21-bf8d-474d-9146-198b6449e025", + "key": "9aeebb21-bf8d-474d-9146-198b6449e025", + "label": "ZMB_99(2020) metadata", + "value": "27462" + }, + { + "description": "Jurisdiction Metadata for ZMB_28(2020) id fab0f55f-5925-46b1-b2c3-badff5815741", + "key": "fab0f55f-5925-46b1-b2c3-badff5815741", + "label": "ZMB_28(2020) metadata", + "value": "27463" + }, + { + "description": "Jurisdiction Metadata for ZMB_3(2020) id 6e7721e7-f69b-4623-9a7d-a9640f9ac811", + "key": "6e7721e7-f69b-4623-9a7d-a9640f9ac811", + "label": "ZMB_3(2020) metadata", + "value": "27464" + }, + { + "description": "Jurisdiction Metadata for ZMB_67(2020) id 88ec303f-64e6-41ef-b946-ba88fc762798", + "key": "88ec303f-64e6-41ef-b946-ba88fc762798", + "label": "ZMB_67(2020) metadata", + "value": "27465" + }, + { + "description": "Jurisdiction Metadata for Bwanunkha(2020) id 8d453cbf-16ef-4f81-b0df-a115d83df7a5", + "key": "8d453cbf-16ef-4f81-b0df-a115d83df7a5", + "label": "Bwanunkha(2020) metadata", + "value": "27466" + }, + { + "description": "Jurisdiction Metadata for Kapwazi_NHC id e0c3c7e7-7cc4-4888-ba1c-caf982965ba9", + "key": "e0c3c7e7-7cc4-4888-ba1c-caf982965ba9", + "label": "Kapwazi_NHC metadata", + "value": "27467" + }, + { + "description": "Jurisdiction Metadata for BNK_4(2020) id a7132216-b43c-4b26-a7b7-76336ab46007", + "key": "a7132216-b43c-4b26-a7b7-76336ab46007", + "label": "BNK_4(2020) metadata", + "value": "27468" + }, + { + "description": "Jurisdiction Metadata for BNK_53(2020) id f388e1d2-d509-4304-b660-e7953952990b", + "key": "f388e1d2-d509-4304-b660-e7953952990b", + "label": "BNK_53(2020) metadata", + "value": "27469" + }, + { + "description": "Jurisdiction Metadata for BNK_46(2020) id e187d876-753b-4fbb-bd17-891e3dc1e485", + "key": "e187d876-753b-4fbb-bd17-891e3dc1e485", + "label": "BNK_46(2020) metadata", + "value": "27470" + }, + { + "description": "Jurisdiction Metadata for BNK_16(2020) id ad7bfbb3-7eb7-4253-99b3-6f43dcc52479", + "key": "ad7bfbb3-7eb7-4253-99b3-6f43dcc52479", + "label": "BNK_16(2020) metadata", + "value": "27471" + }, + { + "description": "Jurisdiction Metadata for BNK_37(2020) id fce5922f-6d0c-48db-9933-d80e3ad118c0", + "key": "fce5922f-6d0c-48db-9933-d80e3ad118c0", + "label": "BNK_37(2020) metadata", + "value": "27472" + }, + { + "description": "Jurisdiction Metadata for BNK_26(2020) id 172ffe03-5c70-4d6e-9ee0-cfeae8bbb415", + "key": "172ffe03-5c70-4d6e-9ee0-cfeae8bbb415", + "label": "BNK_26(2020) metadata", + "value": "27473" + }, + { + "description": "Jurisdiction Metadata for BNK_28(2020) id 04053398-5a84-4385-ae12-284f6a142c0d", + "key": "04053398-5a84-4385-ae12-284f6a142c0d", + "label": "BNK_28(2020) metadata", + "value": "27474" + }, + { + "description": "Jurisdiction Metadata for BNK_52(2020) id 9b7be09a-b15c-4d6e-82b8-c1f0fb6bde34", + "key": "9b7be09a-b15c-4d6e-82b8-c1f0fb6bde34", + "label": "BNK_52(2020) metadata", + "value": "27475" + }, + { + "description": "Jurisdiction Metadata for BNK_18(2020) id 3cc39a18-a76c-4df0-975f-fa4f061845e5", + "key": "3cc39a18-a76c-4df0-975f-fa4f061845e5", + "label": "BNK_18(2020) metadata", + "value": "27476" + }, + { + "description": "Jurisdiction Metadata for BNK_12(2020) id ce695e16-47fa-4476-959d-532a20e4cccf", + "key": "ce695e16-47fa-4476-959d-532a20e4cccf", + "label": "BNK_12(2020) metadata", + "value": "27477" + }, + { + "description": "Jurisdiction Metadata for BNK_48(2020) id fcf062d1-3877-46fd-8f14-e668c57f18ac", + "key": "fcf062d1-3877-46fd-8f14-e668c57f18ac", + "label": "BNK_48(2020) metadata", + "value": "27478" + }, + { + "description": "Jurisdiction Metadata for BNK_9(2020) id 68a72b0c-bd71-40ef-b955-378b5a4d8f08", + "key": "68a72b0c-bd71-40ef-b955-378b5a4d8f08", + "label": "BNK_9(2020) metadata", + "value": "27479" + }, + { + "description": "Jurisdiction Metadata for BNK_17(2020) id 554269a4-ffea-402f-81e8-c57f8ffddbbd", + "key": "554269a4-ffea-402f-81e8-c57f8ffddbbd", + "label": "BNK_17(2020) metadata", + "value": "27480" + }, + { + "description": "Jurisdiction Metadata for BNK_57(2020) id 653044c1-7aa1-442d-b397-28b558434f86", + "key": "653044c1-7aa1-442d-b397-28b558434f86", + "label": "BNK_57(2020) metadata", + "value": "27481" + }, + { + "description": "Jurisdiction Metadata for BNK_22(2020) id ccf145ea-a1bd-4b81-8e85-67bd885d1281", + "key": "ccf145ea-a1bd-4b81-8e85-67bd885d1281", + "label": "BNK_22(2020) metadata", + "value": "27482" + }, + { + "description": "Jurisdiction Metadata for BNK_21(2020) id 8eeada74-bcde-4f23-a9de-cb2212c41812", + "key": "8eeada74-bcde-4f23-a9de-cb2212c41812", + "label": "BNK_21(2020) metadata", + "value": "27483" + }, + { + "description": "Jurisdiction Metadata for BNK_51(2020) id f85540e6-beff-4c57-b91d-ef5d456bb7a2", + "key": "f85540e6-beff-4c57-b91d-ef5d456bb7a2", + "label": "BNK_51(2020) metadata", + "value": "27484" + }, + { + "description": "Jurisdiction Metadata for BNK_31(2020) id a853a44c-cb5e-4e30-9e9e-11fb20f4f34b", + "key": "a853a44c-cb5e-4e30-9e9e-11fb20f4f34b", + "label": "BNK_31(2020) metadata", + "value": "27485" + }, + { + "description": "Jurisdiction Metadata for BNK_34(2020) id 79e18225-3881-4f52-8dc1-6f9cdaa4878f", + "key": "79e18225-3881-4f52-8dc1-6f9cdaa4878f", + "label": "BNK_34(2020) metadata", + "value": "27486" + }, + { + "description": "Jurisdiction Metadata for BNK_55(2020) id 258409c2-c532-4f22-bc3c-660db71ef68f", + "key": "258409c2-c532-4f22-bc3c-660db71ef68f", + "label": "BNK_55(2020) metadata", + "value": "27487" + }, + { + "description": "Jurisdiction Metadata for BNK_62(2020) id 4cbb7d0b-27c9-4479-a6ed-0482570e2c2f", + "key": "4cbb7d0b-27c9-4479-a6ed-0482570e2c2f", + "label": "BNK_62(2020) metadata", + "value": "27488" + }, + { + "description": "Jurisdiction Metadata for BNK_35(2020) id a6baa096-c7a2-4c6f-a03b-6113111e7447", + "key": "a6baa096-c7a2-4c6f-a03b-6113111e7447", + "label": "BNK_35(2020) metadata", + "value": "27489" + }, + { + "description": "Jurisdiction Metadata for BNK_41(2020) id 3e34809a-1e58-45bf-926e-347ba668a90a", + "key": "3e34809a-1e58-45bf-926e-347ba668a90a", + "label": "BNK_41(2020) metadata", + "value": "27490" + }, + { + "description": "Jurisdiction Metadata for BNK_29(2020) id 98fb78c4-7f8b-407b-94bf-c9c371ef5a67", + "key": "98fb78c4-7f8b-407b-94bf-c9c371ef5a67", + "label": "BNK_29(2020) metadata", + "value": "27491" + }, + { + "description": "Jurisdiction Metadata for BNK_24(2020) id 740c79d1-a8c3-4b42-b4ce-c31712490c0b", + "key": "740c79d1-a8c3-4b42-b4ce-c31712490c0b", + "label": "BNK_24(2020) metadata", + "value": "27492" + }, + { + "description": "Jurisdiction Metadata for BNK_54(2020) id 8bcb120e-ab13-414a-be84-6f3a8ae8caf8", + "key": "8bcb120e-ab13-414a-be84-6f3a8ae8caf8", + "label": "BNK_54(2020) metadata", + "value": "27493" + }, + { + "description": "Jurisdiction Metadata for BNK_50(2020) id 33b43940-8f43-4486-ad0e-07c3e9df2648", + "key": "33b43940-8f43-4486-ad0e-07c3e9df2648", + "label": "BNK_50(2020) metadata", + "value": "27494" + }, + { + "description": "Jurisdiction Metadata for BNK_30(2020) id 81093ab1-2607-4542-b7fc-beaa2a9523dc", + "key": "81093ab1-2607-4542-b7fc-beaa2a9523dc", + "label": "BNK_30(2020) metadata", + "value": "27495" + }, + { + "description": "Jurisdiction Metadata for BNK_32(2020) id e6771a50-702d-4b22-81a5-d8c7b7f30038", + "key": "e6771a50-702d-4b22-81a5-d8c7b7f30038", + "label": "BNK_32(2020) metadata", + "value": "27496" + }, + { + "description": "Jurisdiction Metadata for BNK_43(2020) id a3900aa9-4946-40a2-aab5-ca22286f1134", + "key": "a3900aa9-4946-40a2-aab5-ca22286f1134", + "label": "BNK_43(2020) metadata", + "value": "27497" + }, + { + "description": "Jurisdiction Metadata for BNK_5(2020) id 363c7005-64b0-4261-97c4-827876a43bdd", + "key": "363c7005-64b0-4261-97c4-827876a43bdd", + "label": "BNK_5(2020) metadata", + "value": "27498" + }, + { + "description": "Jurisdiction Metadata for BNK_11(2020) id 5bf8b70a-6be2-4032-ba1f-3b3877777986", + "key": "5bf8b70a-6be2-4032-ba1f-3b3877777986", + "label": "BNK_11(2020) metadata", + "value": "27499" + }, + { + "description": "Jurisdiction Metadata for BNK_58(2020) id 512af7c9-4ce6-4c69-a7fe-c07d08b8e4e9", + "key": "512af7c9-4ce6-4c69-a7fe-c07d08b8e4e9", + "label": "BNK_58(2020) metadata", + "value": "27500" + }, + { + "description": "Jurisdiction Metadata for BNK_45(2020) id 3adc9812-1ad5-4931-ad80-ec91a8817c6d", + "key": "3adc9812-1ad5-4931-ad80-ec91a8817c6d", + "label": "BNK_45(2020) metadata", + "value": "27501" + }, + { + "description": "Jurisdiction Metadata for BNK_20(2020) id 81205eaa-874c-4775-9be9-4dae91da17cb", + "key": "81205eaa-874c-4775-9be9-4dae91da17cb", + "label": "BNK_20(2020) metadata", + "value": "27502" + }, + { + "description": "Jurisdiction Metadata for BNK_59(2020) id 1bdf4b26-f32c-425a-a722-c3b4831086a5", + "key": "1bdf4b26-f32c-425a-a722-c3b4831086a5", + "label": "BNK_59(2020) metadata", + "value": "27503" + }, + { + "description": "Jurisdiction Metadata for BNK_6(2020) id dbd9a889-e3a6-4bb7-9d19-e386ec5d07d4", + "key": "dbd9a889-e3a6-4bb7-9d19-e386ec5d07d4", + "label": "BNK_6(2020) metadata", + "value": "27504" + }, + { + "description": "Jurisdiction Metadata for BNK_8(2020) id e60bb1d7-f290-41ac-85be-3a54594fe1d3", + "key": "e60bb1d7-f290-41ac-85be-3a54594fe1d3", + "label": "BNK_8(2020) metadata", + "value": "27505" + }, + { + "description": "Jurisdiction Metadata for BNK_2(2020) id 579fee54-064e-4c56-9d32-f0a895563efc", + "key": "579fee54-064e-4c56-9d32-f0a895563efc", + "label": "BNK_2(2020) metadata", + "value": "27506" + }, + { + "description": "Jurisdiction Metadata for BNK_44(2020) id 018cdfe2-6028-4e0f-bbcb-664339462ada", + "key": "018cdfe2-6028-4e0f-bbcb-664339462ada", + "label": "BNK_44(2020) metadata", + "value": "27507" + }, + { + "description": "Jurisdiction Metadata for BNK_47(2020) id 88a2b756-543d-449d-8412-9abbb3f9d358", + "key": "88a2b756-543d-449d-8412-9abbb3f9d358", + "label": "BNK_47(2020) metadata", + "value": "27508" + }, + { + "description": "Jurisdiction Metadata for BNK_60(2020) id 9d9f950e-6b8d-4a8b-a6a2-4fb722919693", + "key": "9d9f950e-6b8d-4a8b-a6a2-4fb722919693", + "label": "BNK_60(2020) metadata", + "value": "27509" + }, + { + "description": "Jurisdiction Metadata for BNK_15(2020) id d104d1c8-fef0-4af3-b9db-00f9d359d9dd", + "key": "d104d1c8-fef0-4af3-b9db-00f9d359d9dd", + "label": "BNK_15(2020) metadata", + "value": "27510" + }, + { + "description": "Jurisdiction Metadata for BNK_14(2020) id d931e373-35cf-4529-8a88-d1a761cd9fae", + "key": "d931e373-35cf-4529-8a88-d1a761cd9fae", + "label": "BNK_14(2020) metadata", + "value": "27511" + }, + { + "description": "Jurisdiction Metadata for BNK_10(2020) id 95f09ccc-7f50-4726-ab5b-2b81fb2fee29", + "key": "95f09ccc-7f50-4726-ab5b-2b81fb2fee29", + "label": "BNK_10(2020) metadata", + "value": "27512" + }, + { + "description": "Jurisdiction Metadata for BNK_3(2020) id 7ce4bc80-8b91-4f11-8a1a-a61b36d4af95", + "key": "7ce4bc80-8b91-4f11-8a1a-a61b36d4af95", + "label": "BNK_3(2020) metadata", + "value": "27513" + }, + { + "description": "Jurisdiction Metadata for BNK_42(2020) id 7f40cfc1-994e-4397-84ae-5180fefd5795", + "key": "7f40cfc1-994e-4397-84ae-5180fefd5795", + "label": "BNK_42(2020) metadata", + "value": "27514" + }, + { + "description": "Jurisdiction Metadata for BNK_19(2020) id 49a085ff-fed6-4377-8a68-f6970053a492", + "key": "49a085ff-fed6-4377-8a68-f6970053a492", + "label": "BNK_19(2020) metadata", + "value": "27515" + }, + { + "description": "Jurisdiction Metadata for BNK_13(2020) id 23de352d-b386-40ac-82b1-d41155824d5a", + "key": "23de352d-b386-40ac-82b1-d41155824d5a", + "label": "BNK_13(2020) metadata", + "value": "27516" + }, + { + "description": "Jurisdiction Metadata for BNK_7(2020) id 9e7f095b-df9e-4314-bd59-7ee7820051b9", + "key": "9e7f095b-df9e-4314-bd59-7ee7820051b9", + "label": "BNK_7(2020) metadata", + "value": "27517" + }, + { + "description": "Jurisdiction Metadata for BNK_23(2020) id 1c0f5d30-375d-447e-a100-164ea8b3e6f3", + "key": "1c0f5d30-375d-447e-a100-164ea8b3e6f3", + "label": "BNK_23(2020) metadata", + "value": "27518" + }, + { + "description": "Jurisdiction Metadata for BNK_49(2020) id dda20b5a-5739-43b3-b5c2-fa6dfdc44523", + "key": "dda20b5a-5739-43b3-b5c2-fa6dfdc44523", + "label": "BNK_49(2020) metadata", + "value": "27519" + }, + { + "description": "Jurisdiction Metadata for BNK_38(2020) id 1e46e78e-f976-47bb-89bb-675eefbb1939", + "key": "1e46e78e-f976-47bb-89bb-675eefbb1939", + "label": "BNK_38(2020) metadata", + "value": "27520" + }, + { + "description": "Jurisdiction Metadata for BNK_63(2020) id df4c54d5-54df-4b8e-afad-624c3c95e4d0", + "key": "df4c54d5-54df-4b8e-afad-624c3c95e4d0", + "label": "BNK_63(2020) metadata", + "value": "27521" + }, + { + "description": "Jurisdiction Metadata for BNK_56(2020) id db9a0473-ee58-498d-ba09-c07b28ea38e8", + "key": "db9a0473-ee58-498d-ba09-c07b28ea38e8", + "label": "BNK_56(2020) metadata", + "value": "27522" + }, + { + "description": "Jurisdiction Metadata for BNK_25(2020) id a03c37e4-18b3-40a7-9a3d-48bd97e61612", + "key": "a03c37e4-18b3-40a7-9a3d-48bd97e61612", + "label": "BNK_25(2020) metadata", + "value": "27523" + }, + { + "description": "Jurisdiction Metadata for BNK_36(2020) id edad63f9-c8a8-4edf-9499-4dca79396c66", + "key": "edad63f9-c8a8-4edf-9499-4dca79396c66", + "label": "BNK_36(2020) metadata", + "value": "27524" + }, + { + "description": "Jurisdiction Metadata for BNK_61(2020) id b6d9bea1-be1b-4243-ba05-39e862532c55", + "key": "b6d9bea1-be1b-4243-ba05-39e862532c55", + "label": "BNK_61(2020) metadata", + "value": "27525" + }, + { + "description": "Jurisdiction Metadata for BNK_27(2020) id 663d5305-4e0a-477b-95d2-5213b5747089", + "key": "663d5305-4e0a-477b-95d2-5213b5747089", + "label": "BNK_27(2020) metadata", + "value": "27526" + }, + { + "description": "Jurisdiction Metadata for BNK_40(2020) id 763afc9b-50b4-4119-a538-943036d40d24", + "key": "763afc9b-50b4-4119-a538-943036d40d24", + "label": "BNK_40(2020) metadata", + "value": "27527" + }, + { + "description": "Jurisdiction Metadata for BNK_39(2020) id cb0d3935-bf22-4347-a068-d0f5f0f3c768", + "key": "cb0d3935-bf22-4347-a068-d0f5f0f3c768", + "label": "BNK_39(2020) metadata", + "value": "27528" + }, + { + "description": "Jurisdiction Metadata for BNK_1(2020) id 1b89013b-6644-4d9b-9427-85cbb21783ff", + "key": "1b89013b-6644-4d9b-9427-85cbb21783ff", + "label": "BNK_1(2020) metadata", + "value": "27529" + }, + { + "description": "Jurisdiction Metadata for BNK_33(2020) id c965a06f-5a3f-4cc7-ad9d-4873f22edbc7", + "key": "c965a06f-5a3f-4cc7-ad9d-4873f22edbc7", + "label": "BNK_33(2020) metadata", + "value": "27530" + }, + { + "description": "Jurisdiction Metadata for Chanida(2020) id 73a7dd60-1b43-4d6d-b4a5-5ed0368b53d4", + "key": "73a7dd60-1b43-4d6d-b4a5-5ed0368b53d4", + "label": "Chanida(2020) metadata", + "value": "27531" + }, + { + "description": "Jurisdiction Metadata for Chanida_NHC id b2de60e6-17a5-4305-b267-d998f6b7bfe3", + "key": "b2de60e6-17a5-4305-b267-d998f6b7bfe3", + "label": "Chanida_NHC metadata", + "value": "27532" + }, + { + "description": "Jurisdiction Metadata for CND_1(2020) id cf78ef87-9370-4a80-8952-f69ab9f45235", + "key": "cf78ef87-9370-4a80-8952-f69ab9f45235", + "label": "CND_1(2020) metadata", + "value": "27533" + }, + { + "description": "Jurisdiction Metadata for CND_6(2020) id 2bd12880-f4bf-47e1-a855-fb57b0eca8fc", + "key": "2bd12880-f4bf-47e1-a855-fb57b0eca8fc", + "label": "CND_6(2020) metadata", + "value": "27534" + }, + { + "description": "Jurisdiction Metadata for CND_7(2020) id 20ed2289-14b5-4044-a279-909bb972199a", + "key": "20ed2289-14b5-4044-a279-909bb972199a", + "label": "CND_7(2020) metadata", + "value": "27535" + }, + { + "description": "Jurisdiction Metadata for CND_11(2020) id 4735f588-d81e-4689-8ab9-4ad66987770c", + "key": "4735f588-d81e-4689-8ab9-4ad66987770c", + "label": "CND_11(2020) metadata", + "value": "27536" + }, + { + "description": "Jurisdiction Metadata for CND_2(2020) id 5de02ad4-278e-48fe-875d-eacf98ec2be4", + "key": "5de02ad4-278e-48fe-875d-eacf98ec2be4", + "label": "CND_2(2020) metadata", + "value": "27537" + }, + { + "description": "Jurisdiction Metadata for CND_3(2020) id 682705f9-a052-41e7-a373-aa545b61dd9c", + "key": "682705f9-a052-41e7-a373-aa545b61dd9c", + "label": "CND_3(2020) metadata", + "value": "27538" + }, + { + "description": "Jurisdiction Metadata for CND_12(2020) id 7dad005f-be3f-46bd-a60f-b5bef534a2e8", + "key": "7dad005f-be3f-46bd-a60f-b5bef534a2e8", + "label": "CND_12(2020) metadata", + "value": "27539" + }, + { + "description": "Jurisdiction Metadata for CND_5(2020) id fe3a53a7-fdd1-4e49-a9e5-63ac2f266764", + "key": "fe3a53a7-fdd1-4e49-a9e5-63ac2f266764", + "label": "CND_5(2020) metadata", + "value": "27540" + }, + { + "description": "Jurisdiction Metadata for CND_8(2020) id a4eeb706-bcc6-468e-b4e6-c2c7624637ac", + "key": "a4eeb706-bcc6-468e-b4e6-c2c7624637ac", + "label": "CND_8(2020) metadata", + "value": "27541" + }, + { + "description": "Jurisdiction Metadata for CND_9(2020) id 00b279c1-ecb2-44e7-80c1-72ffe237f075", + "key": "00b279c1-ecb2-44e7-80c1-72ffe237f075", + "label": "CND_9(2020) metadata", + "value": "27542" + }, + { + "description": "Jurisdiction Metadata for CND_4(2020) id 89cc8027-a89b-4f7a-86e5-1ee07583a9af", + "key": "89cc8027-a89b-4f7a-86e5-1ee07583a9af", + "label": "CND_4(2020) metadata", + "value": "27543" + }, + { + "description": "Jurisdiction Metadata for CND_13(2020) id 305bdc54-1156-4e69-8de0-1242cf35a83c", + "key": "305bdc54-1156-4e69-8de0-1242cf35a83c", + "label": "CND_13(2020) metadata", + "value": "27544" + }, + { + "description": "Jurisdiction Metadata for CND_10(2020) id 899c93a2-7d5e-4dcc-b5e3-681ff260ac0b", + "key": "899c93a2-7d5e-4dcc-b5e3-681ff260ac0b", + "label": "CND_10(2020) metadata", + "value": "27545" + }, + { + "description": "Jurisdiction Metadata for Nsadzu(2020) id 60d07154-48cc-4a08-8c95-26a50d2ba716", + "key": "60d07154-48cc-4a08-8c95-26a50d2ba716", + "label": "Nsadzu(2020) metadata", + "value": "27546" + }, + { + "description": "Jurisdiction Metadata for Kasiya NHC id 71e178d1-2edb-415f-aa99-3a9e7c8cfe31", + "key": "71e178d1-2edb-415f-aa99-3a9e7c8cfe31", + "label": "Kasiya NHC metadata", + "value": "27547" + }, + { + "description": "Jurisdiction Metadata for NSD_20(2020) id 0fff4ac5-3b8e-4859-8f10-165b2b076baa", + "key": "0fff4ac5-3b8e-4859-8f10-165b2b076baa", + "label": "NSD_20(2020) metadata", + "value": "27548" + }, + { + "description": "Jurisdiction Metadata for NSD_16(2020) id 289476a8-34f2-49fc-9ebc-bc2a8b96d269", + "key": "289476a8-34f2-49fc-9ebc-bc2a8b96d269", + "label": "NSD_16(2020) metadata", + "value": "27549" + }, + { + "description": "Jurisdiction Metadata for NSD_12(2020) id 072e6615-69d2-4f39-bf1d-816fd3d03da2", + "key": "072e6615-69d2-4f39-bf1d-816fd3d03da2", + "label": "NSD_12(2020) metadata", + "value": "27550" + }, + { + "description": "Jurisdiction Metadata for NSD_10(2020) id 06e7384c-188f-4095-b662-d796f6b28fa8", + "key": "06e7384c-188f-4095-b662-d796f6b28fa8", + "label": "NSD_10(2020) metadata", + "value": "27551" + }, + { + "description": "Jurisdiction Metadata for NSD_37(2020) id 4062aac9-1b19-4d56-866f-52bb662d437e", + "key": "4062aac9-1b19-4d56-866f-52bb662d437e", + "label": "NSD_37(2020) metadata", + "value": "27552" + }, + { + "description": "Jurisdiction Metadata for NSD_27(2020) id 52991324-58f8-4b97-a974-35d292c9444f", + "key": "52991324-58f8-4b97-a974-35d292c9444f", + "label": "NSD_27(2020) metadata", + "value": "27553" + }, + { + "description": "Jurisdiction Metadata for NSD_26(2020) id 08cae021-e0de-4874-ad5c-c54fdb83a57e", + "key": "08cae021-e0de-4874-ad5c-c54fdb83a57e", + "label": "NSD_26(2020) metadata", + "value": "27554" + }, + { + "description": "Jurisdiction Metadata for NSD_2(2020) id ba61cb5a-3fe8-4a4e-8fcd-9886c9b33e82", + "key": "ba61cb5a-3fe8-4a4e-8fcd-9886c9b33e82", + "label": "NSD_2(2020) metadata", + "value": "27555" + }, + { + "description": "Jurisdiction Metadata for NSD_48(2020) id f19bd9bc-285d-40c7-a1e8-6bc143a4a4df", + "key": "f19bd9bc-285d-40c7-a1e8-6bc143a4a4df", + "label": "NSD_48(2020) metadata", + "value": "27556" + }, + { + "description": "Jurisdiction Metadata for NSD_36(2020) id ddb110d5-180d-43b2-99c4-7110ba5e2766", + "key": "ddb110d5-180d-43b2-99c4-7110ba5e2766", + "label": "NSD_36(2020) metadata", + "value": "27557" + }, + { + "description": "Jurisdiction Metadata for NSD_4(2020) id 2341b800-a263-4672-b6db-3cf880f964b0", + "key": "2341b800-a263-4672-b6db-3cf880f964b0", + "label": "NSD_4(2020) metadata", + "value": "27558" + }, + { + "description": "Jurisdiction Metadata for NSD_59(2020) id e67aab2e-7429-443d-a2cc-ae6e3d6c6a45", + "key": "e67aab2e-7429-443d-a2cc-ae6e3d6c6a45", + "label": "NSD_59(2020) metadata", + "value": "27559" + }, + { + "description": "Jurisdiction Metadata for NSD_24(2020) id fbd4a535-1b48-40a7-97b6-8fa562eff0f3", + "key": "fbd4a535-1b48-40a7-97b6-8fa562eff0f3", + "label": "NSD_24(2020) metadata", + "value": "27560" + }, + { + "description": "Jurisdiction Metadata for NSD_28(2020) id 4b781a76-23f2-44d6-8f77-148cd9503228", + "key": "4b781a76-23f2-44d6-8f77-148cd9503228", + "label": "NSD_28(2020) metadata", + "value": "27561" + }, + { + "description": "Jurisdiction Metadata for NSD_11(2020) id 8b175b3d-c10c-47c9-b1e4-fa5e4b2e5a0c", + "key": "8b175b3d-c10c-47c9-b1e4-fa5e4b2e5a0c", + "label": "NSD_11(2020) metadata", + "value": "27562" + }, + { + "description": "Jurisdiction Metadata for NSD_25(2020) id d38a6c2c-6882-49a2-9cc6-fca07fddf8b9", + "key": "d38a6c2c-6882-49a2-9cc6-fca07fddf8b9", + "label": "NSD_25(2020) metadata", + "value": "27563" + }, + { + "description": "Jurisdiction Metadata for NSD_61(2020) id 2539b309-ee3d-4a76-adc3-a608166c91ef", + "key": "2539b309-ee3d-4a76-adc3-a608166c91ef", + "label": "NSD_61(2020) metadata", + "value": "27564" + }, + { + "description": "Jurisdiction Metadata for NSD_6(2020) id b5549a4d-a9ff-41ff-b3b9-4f61b77aa4df", + "key": "b5549a4d-a9ff-41ff-b3b9-4f61b77aa4df", + "label": "NSD_6(2020) metadata", + "value": "27565" + }, + { + "description": "Jurisdiction Metadata for NSD_44(2020) id 0da358f8-eec1-40e0-97d9-7ef4e5d422bd", + "key": "0da358f8-eec1-40e0-97d9-7ef4e5d422bd", + "label": "NSD_44(2020) metadata", + "value": "27566" + }, + { + "description": "Jurisdiction Metadata for NSD_5(2020) id ceeefd0b-ccc8-495d-9ea8-dc85f920c50c", + "key": "ceeefd0b-ccc8-495d-9ea8-dc85f920c50c", + "label": "NSD_5(2020) metadata", + "value": "27567" + }, + { + "description": "Jurisdiction Metadata for NSD_1(2020) id db35624b-5f44-48f4-a4c6-8b69bc689783", + "key": "db35624b-5f44-48f4-a4c6-8b69bc689783", + "label": "NSD_1(2020) metadata", + "value": "27568" + }, + { + "description": "Jurisdiction Metadata for NSD_17(2020) id 642a9c18-39b4-42b2-9adf-c6f0c553b17d", + "key": "642a9c18-39b4-42b2-9adf-c6f0c553b17d", + "label": "NSD_17(2020) metadata", + "value": "27569" + }, + { + "description": "Jurisdiction Metadata for NSD_30(2020) id b8ba2b2e-cdb2-4b5c-a7f2-919b70483c46", + "key": "b8ba2b2e-cdb2-4b5c-a7f2-919b70483c46", + "label": "NSD_30(2020) metadata", + "value": "27570" + }, + { + "description": "Jurisdiction Metadata for NSD_7(2020) id eb66c034-f9a9-46a0-9fbd-25790757cac3", + "key": "eb66c034-f9a9-46a0-9fbd-25790757cac3", + "label": "NSD_7(2020) metadata", + "value": "27571" + }, + { + "description": "Jurisdiction Metadata for NSD_39(2020) id 83047616-2688-423d-b644-8d3ab76650f8", + "key": "83047616-2688-423d-b644-8d3ab76650f8", + "label": "NSD_39(2020) metadata", + "value": "27572" + }, + { + "description": "Jurisdiction Metadata for NSD_18(2020) id d03c95ff-5c73-4391-92a8-bf595bc928a5", + "key": "d03c95ff-5c73-4391-92a8-bf595bc928a5", + "label": "NSD_18(2020) metadata", + "value": "27573" + }, + { + "description": "Jurisdiction Metadata for NSD_62(2020) id c2e23851-f26a-48a4-bcd5-fb0d19b8d4ab", + "key": "c2e23851-f26a-48a4-bcd5-fb0d19b8d4ab", + "label": "NSD_62(2020) metadata", + "value": "27574" + }, + { + "description": "Jurisdiction Metadata for NSD_33(2020) id 21f6ae41-699e-444d-935f-a5ef55f686e5", + "key": "21f6ae41-699e-444d-935f-a5ef55f686e5", + "label": "NSD_33(2020) metadata", + "value": "27575" + }, + { + "description": "Jurisdiction Metadata for NSD_43(2020) id 172cd37c-e51b-4a5b-9c1f-05d40a22c333", + "key": "172cd37c-e51b-4a5b-9c1f-05d40a22c333", + "label": "NSD_43(2020) metadata", + "value": "27576" + }, + { + "description": "Jurisdiction Metadata for NSD_9(2020) id e3d40cb7-3c9a-4e1f-bb81-53b7ec22d28f", + "key": "e3d40cb7-3c9a-4e1f-bb81-53b7ec22d28f", + "label": "NSD_9(2020) metadata", + "value": "27577" + }, + { + "description": "Jurisdiction Metadata for NSD_47(2020) id 5e90b379-0f6a-4a63-b44f-5ab10092ca07", + "key": "5e90b379-0f6a-4a63-b44f-5ab10092ca07", + "label": "NSD_47(2020) metadata", + "value": "27578" + }, + { + "description": "Jurisdiction Metadata for NSD_38(2020) id 1624f675-3a93-4d8a-8448-45ad5911dec0", + "key": "1624f675-3a93-4d8a-8448-45ad5911dec0", + "label": "NSD_38(2020) metadata", + "value": "27579" + }, + { + "description": "Jurisdiction Metadata for NSD_15(2020) id 2687a750-4414-4699-90ee-c07d1e52271f", + "key": "2687a750-4414-4699-90ee-c07d1e52271f", + "label": "NSD_15(2020) metadata", + "value": "27580" + }, + { + "description": "Jurisdiction Metadata for NSD_45(2020) id 98684b89-aa33-462a-9132-266592cfa62a", + "key": "98684b89-aa33-462a-9132-266592cfa62a", + "label": "NSD_45(2020) metadata", + "value": "27581" + }, + { + "description": "Jurisdiction Metadata for NSD_54(2020) id 32ee11a4-d240-446a-8d88-dd6e718e5061", + "key": "32ee11a4-d240-446a-8d88-dd6e718e5061", + "label": "NSD_54(2020) metadata", + "value": "27582" + }, + { + "description": "Jurisdiction Metadata for NSD_22(2020) id e072ffcc-6f2c-4d8c-969b-aae9c4d60e8d", + "key": "e072ffcc-6f2c-4d8c-969b-aae9c4d60e8d", + "label": "NSD_22(2020) metadata", + "value": "27583" + }, + { + "description": "Jurisdiction Metadata for NSD_14(2020) id c437be9a-db61-4389-b9c5-6dfc81ac7f74", + "key": "c437be9a-db61-4389-b9c5-6dfc81ac7f74", + "label": "NSD_14(2020) metadata", + "value": "27584" + }, + { + "description": "Jurisdiction Metadata for NSD_13(2020) id f3f40ab9-fdec-404a-9f0a-1d3cba4420b6", + "key": "f3f40ab9-fdec-404a-9f0a-1d3cba4420b6", + "label": "NSD_13(2020) metadata", + "value": "27585" + }, + { + "description": "Jurisdiction Metadata for NSD_31(2020) id 283a165f-b391-4427-a343-84feff417a4a", + "key": "283a165f-b391-4427-a343-84feff417a4a", + "label": "NSD_31(2020) metadata", + "value": "27586" + }, + { + "description": "Jurisdiction Metadata for NSD_3(2020) id 82b79f84-f696-4125-b0b9-7c7f7cedfaec", + "key": "82b79f84-f696-4125-b0b9-7c7f7cedfaec", + "label": "NSD_3(2020) metadata", + "value": "27587" + }, + { + "description": "Jurisdiction Metadata for NSD_29(2020) id 8fbcb66f-a654-4d61-be2c-5c565c779775", + "key": "8fbcb66f-a654-4d61-be2c-5c565c779775", + "label": "NSD_29(2020) metadata", + "value": "27588" + }, + { + "description": "Jurisdiction Metadata for NSD_23(2020) id c2231e0e-1d55-491c-ba16-7511dedea67c", + "key": "c2231e0e-1d55-491c-ba16-7511dedea67c", + "label": "NSD_23(2020) metadata", + "value": "27589" + }, + { + "description": "Jurisdiction Metadata for NSD_46(2020) id 921e2f62-0685-4b49-b499-f00bf73b7fd7", + "key": "921e2f62-0685-4b49-b499-f00bf73b7fd7", + "label": "NSD_46(2020) metadata", + "value": "27590" + }, + { + "description": "Jurisdiction Metadata for NSD_60(2020) id f1d50cce-bcf2-4442-b1c8-68d282a7bd7f", + "key": "f1d50cce-bcf2-4442-b1c8-68d282a7bd7f", + "label": "NSD_60(2020) metadata", + "value": "27591" + }, + { + "description": "Jurisdiction Metadata for NSD_52(2020) id 99b381e5-aaf4-4782-9704-b12aae92ca03", + "key": "99b381e5-aaf4-4782-9704-b12aae92ca03", + "label": "NSD_52(2020) metadata", + "value": "27592" + }, + { + "description": "Jurisdiction Metadata for NSD_42(2020) id b9b944b4-053d-4225-b20e-63e29e276771", + "key": "b9b944b4-053d-4225-b20e-63e29e276771", + "label": "NSD_42(2020) metadata", + "value": "27593" + }, + { + "description": "Jurisdiction Metadata for NSD_58(2020) id 640765ad-30a3-473e-9d34-ba0bd6bff0ec", + "key": "640765ad-30a3-473e-9d34-ba0bd6bff0ec", + "label": "NSD_58(2020) metadata", + "value": "27594" + }, + { + "description": "Jurisdiction Metadata for NSD_56(2020) id 1168b29f-9122-470f-8a79-099d3664d708", + "key": "1168b29f-9122-470f-8a79-099d3664d708", + "label": "NSD_56(2020) metadata", + "value": "27595" + }, + { + "description": "Jurisdiction Metadata for NSD_8(2020) id bf274acd-a998-4990-8920-80f198e4566f", + "key": "bf274acd-a998-4990-8920-80f198e4566f", + "label": "NSD_8(2020) metadata", + "value": "27596" + }, + { + "description": "Jurisdiction Metadata for NSD_34(2020) id 6274de3d-df93-47d4-8cce-486d10a7a255", + "key": "6274de3d-df93-47d4-8cce-486d10a7a255", + "label": "NSD_34(2020) metadata", + "value": "27597" + }, + { + "description": "Jurisdiction Metadata for NSD_55(2020) id f9471999-db5d-4cde-a123-c7478d4d2efd", + "key": "f9471999-db5d-4cde-a123-c7478d4d2efd", + "label": "NSD_55(2020) metadata", + "value": "27598" + }, + { + "description": "Jurisdiction Metadata for NSD_50(2020) id 300f6566-26e5-4807-8dd6-0f98218e86c0", + "key": "300f6566-26e5-4807-8dd6-0f98218e86c0", + "label": "NSD_50(2020) metadata", + "value": "27599" + }, + { + "description": "Jurisdiction Metadata for NSD_35(2020) id 0e8a4e0b-a5c4-4214-8b58-d85809066724", + "key": "0e8a4e0b-a5c4-4214-8b58-d85809066724", + "label": "NSD_35(2020) metadata", + "value": "27600" + }, + { + "description": "Jurisdiction Metadata for NSD_53(2020) id d06a4f49-b9bc-4daf-82de-4669818e5f0e", + "key": "d06a4f49-b9bc-4daf-82de-4669818e5f0e", + "label": "NSD_53(2020) metadata", + "value": "27601" + }, + { + "description": "Jurisdiction Metadata for NSD_51(2020) id d3f12c43-eb5d-429f-a988-255a5dd7bd01", + "key": "d3f12c43-eb5d-429f-a988-255a5dd7bd01", + "label": "NSD_51(2020) metadata", + "value": "27602" + }, + { + "description": "Jurisdiction Metadata for NSD_49(2020) id adc52b39-68ad-494a-916b-4cb5f948fbdc", + "key": "adc52b39-68ad-494a-916b-4cb5f948fbdc", + "label": "NSD_49(2020) metadata", + "value": "27603" + }, + { + "description": "Jurisdiction Metadata for NSD_57(2020) id 9f1c0678-4164-4a55-9f6c-8b1d2c9ebbb9", + "key": "9f1c0678-4164-4a55-9f6c-8b1d2c9ebbb9", + "label": "NSD_57(2020) metadata", + "value": "27604" + }, + { + "description": "Jurisdiction Metadata for NSD_40(2020) id 84f20f96-3367-47ef-a4c0-e106a395f42c", + "key": "84f20f96-3367-47ef-a4c0-e106a395f42c", + "label": "NSD_40(2020) metadata", + "value": "27605" + }, + { + "description": "Jurisdiction Metadata for NSD_32(2020) id 995e6753-ba80-42e4-a40b-ce9cb61a7fe4", + "key": "995e6753-ba80-42e4-a40b-ce9cb61a7fe4", + "label": "NSD_32(2020) metadata", + "value": "27606" + }, + { + "description": "Jurisdiction Metadata for NSD_41(2020) id 0200338e-feae-4db5-b36a-62b36ad40633", + "key": "0200338e-feae-4db5-b36a-62b36ad40633", + "label": "NSD_41(2020) metadata", + "value": "27607" + }, + { + "description": "Jurisdiction Metadata for NSD_19(2020) id 07334e34-d80c-486e-9f14-3e969def207f", + "key": "07334e34-d80c-486e-9f14-3e969def207f", + "label": "NSD_19(2020) metadata", + "value": "27608" + }, + { + "description": "Jurisdiction Metadata for NSD_21(2020) id 5665ed29-c494-4e56-b16c-8e8dacced968", + "key": "5665ed29-c494-4e56-b16c-8e8dacced968", + "label": "NSD_21(2020) metadata", + "value": "27609" + }, + { + "description": "Jurisdiction Metadata for Chanjowe(2020) id 23e7054b-e657-4ffb-a11c-893e2e173f60", + "key": "23e7054b-e657-4ffb-a11c-893e2e173f60", + "label": "Chanjowe(2020) metadata", + "value": "27610" + }, + { + "description": "Jurisdiction Metadata for Kabeni_NHC id b0f1dec9-2da0-4310-9df4-a68240bcd329", + "key": "b0f1dec9-2da0-4310-9df4-a68240bcd329", + "label": "Kabeni_NHC metadata", + "value": "27611" + }, + { + "description": "Jurisdiction Metadata for CJB_3(2020) id 37d51c16-be8f-42aa-9504-34e6ba8ff7dc", + "key": "37d51c16-be8f-42aa-9504-34e6ba8ff7dc", + "label": "CJB_3(2020) metadata", + "value": "27612" + }, + { + "description": "Jurisdiction Metadata for CJB_134(2020) id 3c66358c-dc3a-48b0-ab78-28304079038e", + "key": "3c66358c-dc3a-48b0-ab78-28304079038e", + "label": "CJB_134(2020) metadata", + "value": "27613" + }, + { + "description": "Jurisdiction Metadata for CJB_2(2020) id 3b982c70-289e-4fc2-b928-34b41b5e2e40", + "key": "3b982c70-289e-4fc2-b928-34b41b5e2e40", + "label": "CJB_2(2020) metadata", + "value": "27614" + }, + { + "description": "Jurisdiction Metadata for CJB_124(2020) id c1d31278-0594-468e-8488-6f99db341c67", + "key": "c1d31278-0594-468e-8488-6f99db341c67", + "label": "CJB_124(2020) metadata", + "value": "27615" + }, + { + "description": "Jurisdiction Metadata for CJB_62(2020) id 19eb19c1-6b6a-4c8b-a031-5c9370129707", + "key": "19eb19c1-6b6a-4c8b-a031-5c9370129707", + "label": "CJB_62(2020) metadata", + "value": "27616" + }, + { + "description": "Jurisdiction Metadata for CJB_67(2020) id 6422655f-2bde-487c-adee-015659a4dc05", + "key": "6422655f-2bde-487c-adee-015659a4dc05", + "label": "CJB_67(2020) metadata", + "value": "27617" + }, + { + "description": "Jurisdiction Metadata for CJB_50(2020) id 5038fd85-fa26-4feb-8bc4-6d11252c3bba", + "key": "5038fd85-fa26-4feb-8bc4-6d11252c3bba", + "label": "CJB_50(2020) metadata", + "value": "27618" + }, + { + "description": "Jurisdiction Metadata for CJB_8(2020) id 1d242cec-8ace-4a53-a962-52e6f5212622", + "key": "1d242cec-8ace-4a53-a962-52e6f5212622", + "label": "CJB_8(2020) metadata", + "value": "27619" + }, + { + "description": "Jurisdiction Metadata for CJB_24(2020) id d77215be-faca-471b-9b63-7980f36b860e", + "key": "d77215be-faca-471b-9b63-7980f36b860e", + "label": "CJB_24(2020) metadata", + "value": "27620" + }, + { + "description": "Jurisdiction Metadata for CJB_95(2020) id f9b2aa89-2e66-45fc-9921-4fd79c4f6ca8", + "key": "f9b2aa89-2e66-45fc-9921-4fd79c4f6ca8", + "label": "CJB_95(2020) metadata", + "value": "27621" + }, + { + "description": "Jurisdiction Metadata for CJB_35(2020) id a3e7b480-9b2d-427d-a2dc-75ee1bdce3d5", + "key": "a3e7b480-9b2d-427d-a2dc-75ee1bdce3d5", + "label": "CJB_35(2020) metadata", + "value": "27622" + }, + { + "description": "Jurisdiction Metadata for CJB_78(2020) id 57145a17-8991-435d-b9ee-99ebda38802c", + "key": "57145a17-8991-435d-b9ee-99ebda38802c", + "label": "CJB_78(2020) metadata", + "value": "27623" + }, + { + "description": "Jurisdiction Metadata for CJB_26(2020) id f1cc9795-949e-4f39-b6cf-278375e8464a", + "key": "f1cc9795-949e-4f39-b6cf-278375e8464a", + "label": "CJB_26(2020) metadata", + "value": "27624" + }, + { + "description": "Jurisdiction Metadata for CJB_98(2020) id e7914aaf-a1ce-4db0-9ed8-249f1d7790a3", + "key": "e7914aaf-a1ce-4db0-9ed8-249f1d7790a3", + "label": "CJB_98(2020) metadata", + "value": "27625" + }, + { + "description": "Jurisdiction Metadata for CJB_40(2020) id 67b66a50-0bee-4526-8c45-3430e0cd69f9", + "key": "67b66a50-0bee-4526-8c45-3430e0cd69f9", + "label": "CJB_40(2020) metadata", + "value": "27626" + }, + { + "description": "Jurisdiction Metadata for CJB_105(2020) id 650da659-3b61-437c-a3cd-0506edf81170", + "key": "650da659-3b61-437c-a3cd-0506edf81170", + "label": "CJB_105(2020) metadata", + "value": "27627" + }, + { + "description": "Jurisdiction Metadata for CJB_79(2020) id 72fd0ea7-81dc-4064-9706-796f8102bb8f", + "key": "72fd0ea7-81dc-4064-9706-796f8102bb8f", + "label": "CJB_79(2020) metadata", + "value": "27628" + }, + { + "description": "Jurisdiction Metadata for CJB_83(2020) id 626c7d3d-05ad-4884-a2fd-586c95669972", + "key": "626c7d3d-05ad-4884-a2fd-586c95669972", + "label": "CJB_83(2020) metadata", + "value": "27629" + }, + { + "description": "Jurisdiction Metadata for CJB_58(2020) id 04cd07ac-d1c0-43b4-8510-b9d657c6b835", + "key": "04cd07ac-d1c0-43b4-8510-b9d657c6b835", + "label": "CJB_58(2020) metadata", + "value": "27630" + }, + { + "description": "Jurisdiction Metadata for CJB_64(2020) id 957cbc85-fc23-4d6f-9fc3-c9284f82c5a9", + "key": "957cbc85-fc23-4d6f-9fc3-c9284f82c5a9", + "label": "CJB_64(2020) metadata", + "value": "27631" + }, + { + "description": "Jurisdiction Metadata for CJB_55(2020) id 8e0c0d3e-3ba0-41aa-bba1-2ac7744068cb", + "key": "8e0c0d3e-3ba0-41aa-bba1-2ac7744068cb", + "label": "CJB_55(2020) metadata", + "value": "27632" + }, + { + "description": "Jurisdiction Metadata for CJB_71(2020) id 02d4fe66-66ff-49d6-94f3-9d871bd7f654", + "key": "02d4fe66-66ff-49d6-94f3-9d871bd7f654", + "label": "CJB_71(2020) metadata", + "value": "27633" + }, + { + "description": "Jurisdiction Metadata for CJB_51(2020) id ec761f7b-c62a-4017-941c-f8a4dcaea948", + "key": "ec761f7b-c62a-4017-941c-f8a4dcaea948", + "label": "CJB_51(2020) metadata", + "value": "27634" + }, + { + "description": "Jurisdiction Metadata for CJB_65(2020) id 32a70744-587d-41aa-baf3-b66c0fe82e8e", + "key": "32a70744-587d-41aa-baf3-b66c0fe82e8e", + "label": "CJB_65(2020) metadata", + "value": "27635" + }, + { + "description": "Jurisdiction Metadata for CJB_128(2020) id e63eb304-acea-4c72-a4c2-10b18e8b431c", + "key": "e63eb304-acea-4c72-a4c2-10b18e8b431c", + "label": "CJB_128(2020) metadata", + "value": "27636" + }, + { + "description": "Jurisdiction Metadata for CJB_96(2020) id 560c8a5e-9b5f-4d83-95c3-7a38d4398e7f", + "key": "560c8a5e-9b5f-4d83-95c3-7a38d4398e7f", + "label": "CJB_96(2020) metadata", + "value": "27637" + }, + { + "description": "Jurisdiction Metadata for CJB_101(2020) id b1dcf453-9daa-478d-ac73-918f41e806d8", + "key": "b1dcf453-9daa-478d-ac73-918f41e806d8", + "label": "CJB_101(2020) metadata", + "value": "27638" + }, + { + "description": "Jurisdiction Metadata for CJB_52(2020) id 84718755-fd76-4d46-9d06-24b59deeb410", + "key": "84718755-fd76-4d46-9d06-24b59deeb410", + "label": "CJB_52(2020) metadata", + "value": "27639" + }, + { + "description": "Jurisdiction Metadata for CJB_123(2020) id cd50c81d-95d2-40c7-9034-339fc29c4f9c", + "key": "cd50c81d-95d2-40c7-9034-339fc29c4f9c", + "label": "CJB_123(2020) metadata", + "value": "27640" + }, + { + "description": "Jurisdiction Metadata for CJB_74(2020) id 0bfb529a-edda-4401-b6d2-1328900561c3", + "key": "0bfb529a-edda-4401-b6d2-1328900561c3", + "label": "CJB_74(2020) metadata", + "value": "27641" + }, + { + "description": "Jurisdiction Metadata for CJB_1(2020) id 19c5040c-24af-4e88-a035-d3c6b9df87ac", + "key": "19c5040c-24af-4e88-a035-d3c6b9df87ac", + "label": "CJB_1(2020) metadata", + "value": "27642" + }, + { + "description": "Jurisdiction Metadata for CJB_82(2020) id 9a8e64b5-8223-4938-a424-45267090f9e5", + "key": "9a8e64b5-8223-4938-a424-45267090f9e5", + "label": "CJB_82(2020) metadata", + "value": "27643" + }, + { + "description": "Jurisdiction Metadata for CJB_133(2020) id 0ba2576c-bc26-48d0-b0d6-db4c186f15ec", + "key": "0ba2576c-bc26-48d0-b0d6-db4c186f15ec", + "label": "CJB_133(2020) metadata", + "value": "27644" + }, + { + "description": "Jurisdiction Metadata for CJB_37(2020) id 28f110a0-8ade-4570-b69f-b832cd1b4949", + "key": "28f110a0-8ade-4570-b69f-b832cd1b4949", + "label": "CJB_37(2020) metadata", + "value": "27645" + }, + { + "description": "Jurisdiction Metadata for CJB_59(2020) id f95e6c02-b36b-4994-b566-a9150b187cec", + "key": "f95e6c02-b36b-4994-b566-a9150b187cec", + "label": "CJB_59(2020) metadata", + "value": "27646" + }, + { + "description": "Jurisdiction Metadata for CJB_77(2020) id 09913934-dd6a-443e-8267-09067c53dfa5", + "key": "09913934-dd6a-443e-8267-09067c53dfa5", + "label": "CJB_77(2020) metadata", + "value": "27647" + }, + { + "description": "Jurisdiction Metadata for CJB_86(2020) id 0f26e449-6a66-41a1-81cf-a45cf1c2ecab", + "key": "0f26e449-6a66-41a1-81cf-a45cf1c2ecab", + "label": "CJB_86(2020) metadata", + "value": "27648" + }, + { + "description": "Jurisdiction Metadata for CJB_113(2020) id 74b23307-c0f2-4993-a7b9-48c52074f017", + "key": "74b23307-c0f2-4993-a7b9-48c52074f017", + "label": "CJB_113(2020) metadata", + "value": "27649" + }, + { + "description": "Jurisdiction Metadata for CJB_29(2020) id 3f670037-7156-4da8-992d-0c581874e79f", + "key": "3f670037-7156-4da8-992d-0c581874e79f", + "label": "CJB_29(2020) metadata", + "value": "27650" + }, + { + "description": "Jurisdiction Metadata for CJB_49(2020) id 4f1e33a4-7e2a-4ade-81e2-6ae50ee3517f", + "key": "4f1e33a4-7e2a-4ade-81e2-6ae50ee3517f", + "label": "CJB_49(2020) metadata", + "value": "27651" + }, + { + "description": "Jurisdiction Metadata for CJB_122(2020) id cb8967f4-61e9-4eaf-8ee3-a450763b1d28", + "key": "cb8967f4-61e9-4eaf-8ee3-a450763b1d28", + "label": "CJB_122(2020) metadata", + "value": "27652" + }, + { + "description": "Jurisdiction Metadata for CJB_94(2020) id 05d64406-04fc-4981-89fc-5d8be9267909", + "key": "05d64406-04fc-4981-89fc-5d8be9267909", + "label": "CJB_94(2020) metadata", + "value": "27653" + }, + { + "description": "Jurisdiction Metadata for CJB_127(2020) id 6669c2ff-b77c-48b1-aab3-aa2437d4cc5f", + "key": "6669c2ff-b77c-48b1-aab3-aa2437d4cc5f", + "label": "CJB_127(2020) metadata", + "value": "27654" + }, + { + "description": "Jurisdiction Metadata for CJB_136(2020) id 05640863-407b-446d-92dc-976ce6662b95", + "key": "05640863-407b-446d-92dc-976ce6662b95", + "label": "CJB_136(2020) metadata", + "value": "27655" + }, + { + "description": "Jurisdiction Metadata for CJB_87(2020) id 9211aff4-6496-4290-8724-0c88d19a7e99", + "key": "9211aff4-6496-4290-8724-0c88d19a7e99", + "label": "CJB_87(2020) metadata", + "value": "27656" + }, + { + "description": "Jurisdiction Metadata for CJB_81(2020) id 15ad582e-d13f-4116-b705-a927cdb45d60", + "key": "15ad582e-d13f-4116-b705-a927cdb45d60", + "label": "CJB_81(2020) metadata", + "value": "27657" + }, + { + "description": "Jurisdiction Metadata for CJB_14(2020) id 10478df1-60ad-4bf4-bbd6-c740cc19b250", + "key": "10478df1-60ad-4bf4-bbd6-c740cc19b250", + "label": "CJB_14(2020) metadata", + "value": "27658" + }, + { + "description": "Jurisdiction Metadata for CJB_38(2020) id a44bde9a-1ede-4b3f-86be-766b125c366b", + "key": "a44bde9a-1ede-4b3f-86be-766b125c366b", + "label": "CJB_38(2020) metadata", + "value": "27659" + }, + { + "description": "Jurisdiction Metadata for CJB_12(2020) id 9a62add8-0bec-4e6f-b017-2b709c9ea4a6", + "key": "9a62add8-0bec-4e6f-b017-2b709c9ea4a6", + "label": "CJB_12(2020) metadata", + "value": "27660" + }, + { + "description": "Jurisdiction Metadata for CJB_19(2020) id bc7cb0c8-8f4b-4e48-b903-8f205057b1e8", + "key": "bc7cb0c8-8f4b-4e48-b903-8f205057b1e8", + "label": "CJB_19(2020) metadata", + "value": "27661" + }, + { + "description": "Jurisdiction Metadata for CJB_109(2020) id ab7f5996-c146-4492-9b30-b1a8087150c9", + "key": "ab7f5996-c146-4492-9b30-b1a8087150c9", + "label": "CJB_109(2020) metadata", + "value": "27662" + }, + { + "description": "Jurisdiction Metadata for CJB_93(2020) id 2cba8875-05d1-4eb6-9c6b-fff013b8738a", + "key": "2cba8875-05d1-4eb6-9c6b-fff013b8738a", + "label": "CJB_93(2020) metadata", + "value": "27663" + }, + { + "description": "Jurisdiction Metadata for CJB_103(2020) id e295cbf7-fd46-4e3c-a2b3-bfd7609872c1", + "key": "e295cbf7-fd46-4e3c-a2b3-bfd7609872c1", + "label": "CJB_103(2020) metadata", + "value": "27664" + }, + { + "description": "Jurisdiction Metadata for CJB_88(2020) id f70c07fe-7f4f-4c76-82a9-02b32f57c749", + "key": "f70c07fe-7f4f-4c76-82a9-02b32f57c749", + "label": "CJB_88(2020) metadata", + "value": "27665" + }, + { + "description": "Jurisdiction Metadata for CJB_106(2020) id 4aaf096c-9652-440c-8ad0-72df38175e0b", + "key": "4aaf096c-9652-440c-8ad0-72df38175e0b", + "label": "CJB_106(2020) metadata", + "value": "27666" + }, + { + "description": "Jurisdiction Metadata for CJB_121(2020) id 7558a8f2-04df-4683-902b-3fcbbcecac19", + "key": "7558a8f2-04df-4683-902b-3fcbbcecac19", + "label": "CJB_121(2020) metadata", + "value": "27667" + }, + { + "description": "Jurisdiction Metadata for CJB_97(2020) id edb322d7-fad6-480e-9e3e-3360642cf9c8", + "key": "edb322d7-fad6-480e-9e3e-3360642cf9c8", + "label": "CJB_97(2020) metadata", + "value": "27668" + }, + { + "description": "Jurisdiction Metadata for CJB_11(2020) id baa5cb80-5c5b-4ca0-8fb9-cc2551b46768", + "key": "baa5cb80-5c5b-4ca0-8fb9-cc2551b46768", + "label": "CJB_11(2020) metadata", + "value": "27669" + }, + { + "description": "Jurisdiction Metadata for CJB_110(2020) id 7b2a5679-1370-484a-b29b-97585ff82632", + "key": "7b2a5679-1370-484a-b29b-97585ff82632", + "label": "CJB_110(2020) metadata", + "value": "27670" + }, + { + "description": "Jurisdiction Metadata for CJB_16(2020) id 25e66c81-d0fb-424a-9c07-bca7e6f71b0c", + "key": "25e66c81-d0fb-424a-9c07-bca7e6f71b0c", + "label": "CJB_16(2020) metadata", + "value": "27671" + }, + { + "description": "Jurisdiction Metadata for CJB_15(2020) id bb205b67-d8dc-4222-8907-e9a2f4e95ce6", + "key": "bb205b67-d8dc-4222-8907-e9a2f4e95ce6", + "label": "CJB_15(2020) metadata", + "value": "27672" + }, + { + "description": "Jurisdiction Metadata for CJB_126(2020) id da2b8cd6-b28d-4607-b759-417f0d066385", + "key": "da2b8cd6-b28d-4607-b759-417f0d066385", + "label": "CJB_126(2020) metadata", + "value": "27673" + }, + { + "description": "Jurisdiction Metadata for CJB_132(2020) id b6ca05f7-1cf5-4898-b757-2716753d5e49", + "key": "b6ca05f7-1cf5-4898-b757-2716753d5e49", + "label": "CJB_132(2020) metadata", + "value": "27674" + }, + { + "description": "Jurisdiction Metadata for CJB_85(2020) id 3e2e4f6f-2b4d-498c-979e-491c40a624db", + "key": "3e2e4f6f-2b4d-498c-979e-491c40a624db", + "label": "CJB_85(2020) metadata", + "value": "27675" + }, + { + "description": "Jurisdiction Metadata for CJB_7(2020) id 149802eb-7da2-401b-b068-5288d36fc545", + "key": "149802eb-7da2-401b-b068-5288d36fc545", + "label": "CJB_7(2020) metadata", + "value": "27676" + }, + { + "description": "Jurisdiction Metadata for CJB_99(2020) id 35f63280-39f7-4286-b581-816a0ae5abc0", + "key": "35f63280-39f7-4286-b581-816a0ae5abc0", + "label": "CJB_99(2020) metadata", + "value": "27677" + }, + { + "description": "Jurisdiction Metadata for CJB_92(2020) id 06a48c35-3486-494f-8ef9-0383858e85d6", + "key": "06a48c35-3486-494f-8ef9-0383858e85d6", + "label": "CJB_92(2020) metadata", + "value": "27678" + }, + { + "description": "Jurisdiction Metadata for CJB_30(2020) id 79127321-42a2-47f4-a265-6e8db4795fb4", + "key": "79127321-42a2-47f4-a265-6e8db4795fb4", + "label": "CJB_30(2020) metadata", + "value": "27679" + }, + { + "description": "Jurisdiction Metadata for CJB_61(2020) id 96bc45ae-e637-4413-9605-9c076de27ca1", + "key": "96bc45ae-e637-4413-9605-9c076de27ca1", + "label": "CJB_61(2020) metadata", + "value": "27680" + }, + { + "description": "Jurisdiction Metadata for CJB_68(2020) id ad759296-82ed-46b9-b52d-968052554609", + "key": "ad759296-82ed-46b9-b52d-968052554609", + "label": "CJB_68(2020) metadata", + "value": "27681" + }, + { + "description": "Jurisdiction Metadata for CJB_114(2020) id 98c7e4e5-5afd-4e9f-8db1-b82f26be4afa", + "key": "98c7e4e5-5afd-4e9f-8db1-b82f26be4afa", + "label": "CJB_114(2020) metadata", + "value": "27682" + }, + { + "description": "Jurisdiction Metadata for CJB_31(2020) id 66070c91-66c3-426f-84a2-5da78de91171", + "key": "66070c91-66c3-426f-84a2-5da78de91171", + "label": "CJB_31(2020) metadata", + "value": "27683" + }, + { + "description": "Jurisdiction Metadata for CJB_41(2020) id 5a6c13c9-40c9-42f6-82ba-7f2bb074b618", + "key": "5a6c13c9-40c9-42f6-82ba-7f2bb074b618", + "label": "CJB_41(2020) metadata", + "value": "27684" + }, + { + "description": "Jurisdiction Metadata for CJB_115(2020) id 2293ec2b-6b1b-42e2-8c19-99ab9b577885", + "key": "2293ec2b-6b1b-42e2-8c19-99ab9b577885", + "label": "CJB_115(2020) metadata", + "value": "27685" + }, + { + "description": "Jurisdiction Metadata for CJB_63(2020) id cc493052-ca81-43fe-bd8f-0a001ae3ac94", + "key": "cc493052-ca81-43fe-bd8f-0a001ae3ac94", + "label": "CJB_63(2020) metadata", + "value": "27686" + }, + { + "description": "Jurisdiction Metadata for CJB_73(2020) id b8444eab-a208-4b2f-b661-f08cf51eb2ec", + "key": "b8444eab-a208-4b2f-b661-f08cf51eb2ec", + "label": "CJB_73(2020) metadata", + "value": "27687" + }, + { + "description": "Jurisdiction Metadata for CJB_34(2020) id c9b98c0e-3c28-401a-9a58-c30d91924b20", + "key": "c9b98c0e-3c28-401a-9a58-c30d91924b20", + "label": "CJB_34(2020) metadata", + "value": "27688" + }, + { + "description": "Jurisdiction Metadata for CJB_112(2020) id 645ff091-b137-43c0-9efe-764513215aa5", + "key": "645ff091-b137-43c0-9efe-764513215aa5", + "label": "CJB_112(2020) metadata", + "value": "27689" + }, + { + "description": "Jurisdiction Metadata for CJB_5(2020) id 6bbbb710-9c7d-4754-aa7e-2f39bd22ee1e", + "key": "6bbbb710-9c7d-4754-aa7e-2f39bd22ee1e", + "label": "CJB_5(2020) metadata", + "value": "27690" + }, + { + "description": "Jurisdiction Metadata for CJB_60(2020) id 2e50c778-f5d7-4bb8-9ff2-b6bcffe147b6", + "key": "2e50c778-f5d7-4bb8-9ff2-b6bcffe147b6", + "label": "CJB_60(2020) metadata", + "value": "27691" + }, + { + "description": "Jurisdiction Metadata for CJB_90(2020) id 852a3a1b-afd9-4469-816c-2c0b787c8b0f", + "key": "852a3a1b-afd9-4469-816c-2c0b787c8b0f", + "label": "CJB_90(2020) metadata", + "value": "27692" + }, + { + "description": "Jurisdiction Metadata for CJB_39(2020) id 028861f0-6e1c-4549-ac0b-a790fedd7bc7", + "key": "028861f0-6e1c-4549-ac0b-a790fedd7bc7", + "label": "CJB_39(2020) metadata", + "value": "27693" + }, + { + "description": "Jurisdiction Metadata for CJB_54(2020) id 36800aa3-a8f2-4930-90e5-0f1bf049039d", + "key": "36800aa3-a8f2-4930-90e5-0f1bf049039d", + "label": "CJB_54(2020) metadata", + "value": "27694" + }, + { + "description": "Jurisdiction Metadata for CJB_22(2020) id 535f3328-1317-48ce-b69d-9f52ffb4fa51", + "key": "535f3328-1317-48ce-b69d-9f52ffb4fa51", + "label": "CJB_22(2020) metadata", + "value": "27695" + }, + { + "description": "Jurisdiction Metadata for CJB_4(2020) id 72b7bce5-ada7-40c2-a758-5fae7a5acf15", + "key": "72b7bce5-ada7-40c2-a758-5fae7a5acf15", + "label": "CJB_4(2020) metadata", + "value": "27696" + }, + { + "description": "Jurisdiction Metadata for CJB_100(2020) id 5732404a-59e7-4e81-b3cd-3b43cd5ae859", + "key": "5732404a-59e7-4e81-b3cd-3b43cd5ae859", + "label": "CJB_100(2020) metadata", + "value": "27697" + }, + { + "description": "Jurisdiction Metadata for CJB_70(2020) id b2db6aec-e921-47c9-bb9c-d0826de3108e", + "key": "b2db6aec-e921-47c9-bb9c-d0826de3108e", + "label": "CJB_70(2020) metadata", + "value": "27698" + }, + { + "description": "Jurisdiction Metadata for CJB_28(2020) id c949a31b-fc86-4e27-b1d3-89cb6c6a7fb8", + "key": "c949a31b-fc86-4e27-b1d3-89cb6c6a7fb8", + "label": "CJB_28(2020) metadata", + "value": "27699" + }, + { + "description": "Jurisdiction Metadata for CJB_27(2020) id ff03787f-b4a2-4bcf-b8b1-d0ac0662b9dc", + "key": "ff03787f-b4a2-4bcf-b8b1-d0ac0662b9dc", + "label": "CJB_27(2020) metadata", + "value": "27700" + }, + { + "description": "Jurisdiction Metadata for CJB_130(2020) id 78c179a4-d012-4fbe-afc7-a05f8f8b9b5a", + "key": "78c179a4-d012-4fbe-afc7-a05f8f8b9b5a", + "label": "CJB_130(2020) metadata", + "value": "27701" + }, + { + "description": "Jurisdiction Metadata for CJB_116(2020) id 35b90764-d991-4db0-bfba-2f966b72fe02", + "key": "35b90764-d991-4db0-bfba-2f966b72fe02", + "label": "CJB_116(2020) metadata", + "value": "27702" + }, + { + "description": "Jurisdiction Metadata for CJB_18(2020) id b2bb28e2-78e1-4ee4-9f42-01c62f47acb3", + "key": "b2bb28e2-78e1-4ee4-9f42-01c62f47acb3", + "label": "CJB_18(2020) metadata", + "value": "27703" + }, + { + "description": "Jurisdiction Metadata for CJB_108(2020) id cdd81004-0083-4fe0-9330-d0521810056c", + "key": "cdd81004-0083-4fe0-9330-d0521810056c", + "label": "CJB_108(2020) metadata", + "value": "27704" + }, + { + "description": "Jurisdiction Metadata for CJB_125(2020) id c009f8a0-4cc0-4ddc-802b-ae5b0acf5a14", + "key": "c009f8a0-4cc0-4ddc-802b-ae5b0acf5a14", + "label": "CJB_125(2020) metadata", + "value": "27705" + }, + { + "description": "Jurisdiction Metadata for CJB_57(2020) id 7699107b-46fd-493a-a579-85ce6023d732", + "key": "7699107b-46fd-493a-a579-85ce6023d732", + "label": "CJB_57(2020) metadata", + "value": "27706" + }, + { + "description": "Jurisdiction Metadata for CJB_10(2020) id 2499b375-4dee-4fef-9756-bee1b134aa26", + "key": "2499b375-4dee-4fef-9756-bee1b134aa26", + "label": "CJB_10(2020) metadata", + "value": "27707" + }, + { + "description": "Jurisdiction Metadata for CJB_66(2020) id 59e18148-3b9c-44b6-a3ac-b1bf27c6f62b", + "key": "59e18148-3b9c-44b6-a3ac-b1bf27c6f62b", + "label": "CJB_66(2020) metadata", + "value": "27708" + }, + { + "description": "Jurisdiction Metadata for CJB_72(2020) id fdb2282a-104e-4191-8443-85674b927fd5", + "key": "fdb2282a-104e-4191-8443-85674b927fd5", + "label": "CJB_72(2020) metadata", + "value": "27709" + }, + { + "description": "Jurisdiction Metadata for CJB_80(2020) id 36202680-9aa0-4e4b-96ec-9fa77c9fb516", + "key": "36202680-9aa0-4e4b-96ec-9fa77c9fb516", + "label": "CJB_80(2020) metadata", + "value": "27710" + }, + { + "description": "Jurisdiction Metadata for CJB_53(2020) id bec35a1f-5534-4cf8-ab1f-24ba1663f93e", + "key": "bec35a1f-5534-4cf8-ab1f-24ba1663f93e", + "label": "CJB_53(2020) metadata", + "value": "27711" + }, + { + "description": "Jurisdiction Metadata for CJB_119(2020) id ef771367-2e9e-4a2d-996e-a55db058c3e3", + "key": "ef771367-2e9e-4a2d-996e-a55db058c3e3", + "label": "CJB_119(2020) metadata", + "value": "27712" + }, + { + "description": "Jurisdiction Metadata for CJB_33(2020) id 72268b7e-5b6b-48af-8104-72a2cd44d314", + "key": "72268b7e-5b6b-48af-8104-72a2cd44d314", + "label": "CJB_33(2020) metadata", + "value": "27713" + }, + { + "description": "Jurisdiction Metadata for CJB_120(2020) id 5eebb783-c8a7-4d69-b6a7-0b6bfba3af3c", + "key": "5eebb783-c8a7-4d69-b6a7-0b6bfba3af3c", + "label": "CJB_120(2020) metadata", + "value": "27714" + }, + { + "description": "Jurisdiction Metadata for CJB_102(2020) id 152d8752-161c-429c-9821-270317025485", + "key": "152d8752-161c-429c-9821-270317025485", + "label": "CJB_102(2020) metadata", + "value": "27715" + }, + { + "description": "Jurisdiction Metadata for CJB_25(2020) id 02e2a311-e8ae-49d0-8c57-22267bf562cd", + "key": "02e2a311-e8ae-49d0-8c57-22267bf562cd", + "label": "CJB_25(2020) metadata", + "value": "27716" + }, + { + "description": "Jurisdiction Metadata for CJB_46(2020) id 39a084ed-db37-400a-acee-147d59615c2c", + "key": "39a084ed-db37-400a-acee-147d59615c2c", + "label": "CJB_46(2020) metadata", + "value": "27717" + }, + { + "description": "Jurisdiction Metadata for CJB_21(2020) id 426cdb0e-25ad-4624-bb53-d3703e79e45b", + "key": "426cdb0e-25ad-4624-bb53-d3703e79e45b", + "label": "CJB_21(2020) metadata", + "value": "27718" + }, + { + "description": "Jurisdiction Metadata for CJB_118(2020) id a52fc7b4-066f-4650-86cd-a452770140de", + "key": "a52fc7b4-066f-4650-86cd-a452770140de", + "label": "CJB_118(2020) metadata", + "value": "27719" + }, + { + "description": "Jurisdiction Metadata for CJB_9(2020) id 037040ec-c4e0-4054-83d3-b7001b601410", + "key": "037040ec-c4e0-4054-83d3-b7001b601410", + "label": "CJB_9(2020) metadata", + "value": "27720" + }, + { + "description": "Jurisdiction Metadata for CJB_44(2020) id d26f89fd-c636-44a0-8dae-56dfd9d180ee", + "key": "d26f89fd-c636-44a0-8dae-56dfd9d180ee", + "label": "CJB_44(2020) metadata", + "value": "27721" + }, + { + "description": "Jurisdiction Metadata for CJB_89(2020) id 767d4b6b-2c30-4975-b03b-647bf846363c", + "key": "767d4b6b-2c30-4975-b03b-647bf846363c", + "label": "CJB_89(2020) metadata", + "value": "27722" + }, + { + "description": "Jurisdiction Metadata for CJB_47(2020) id d87de073-098b-4c61-81d3-cb6eb1e1287e", + "key": "d87de073-098b-4c61-81d3-cb6eb1e1287e", + "label": "CJB_47(2020) metadata", + "value": "27723" + }, + { + "description": "Jurisdiction Metadata for CJB_42(2020) id b26c6bd3-0e1a-4086-a8b5-49a081b176d6", + "key": "b26c6bd3-0e1a-4086-a8b5-49a081b176d6", + "label": "CJB_42(2020) metadata", + "value": "27724" + }, + { + "description": "Jurisdiction Metadata for CJB_56(2020) id 7f8a9979-8670-4bfe-abd7-0694293dded6", + "key": "7f8a9979-8670-4bfe-abd7-0694293dded6", + "label": "CJB_56(2020) metadata", + "value": "27725" + }, + { + "description": "Jurisdiction Metadata for CJB_91(2020) id a2201c63-9fb9-463e-b82c-2229fcd1da7d", + "key": "a2201c63-9fb9-463e-b82c-2229fcd1da7d", + "label": "CJB_91(2020) metadata", + "value": "27726" + }, + { + "description": "Jurisdiction Metadata for CJB_135(2020) id 95f2ca8a-394e-41ee-a34a-a55c479cb67e", + "key": "95f2ca8a-394e-41ee-a34a-a55c479cb67e", + "label": "CJB_135(2020) metadata", + "value": "27727" + }, + { + "description": "Jurisdiction Metadata for CJB_45(2020) id 9bbd4e54-55d4-4a37-aae0-66a6a05ede36", + "key": "9bbd4e54-55d4-4a37-aae0-66a6a05ede36", + "label": "CJB_45(2020) metadata", + "value": "27728" + }, + { + "description": "Jurisdiction Metadata for CJB_23(2020) id d67e4f66-d55d-42af-94e4-b24d26a9ad86", + "key": "d67e4f66-d55d-42af-94e4-b24d26a9ad86", + "label": "CJB_23(2020) metadata", + "value": "27729" + }, + { + "description": "Jurisdiction Metadata for CJB_131(2020) id 74eea27a-1cb3-43c1-b1b0-52baf354bd09", + "key": "74eea27a-1cb3-43c1-b1b0-52baf354bd09", + "label": "CJB_131(2020) metadata", + "value": "27730" + }, + { + "description": "Jurisdiction Metadata for CJB_117(2020) id 96c2edca-9a03-498a-8264-856b482c3841", + "key": "96c2edca-9a03-498a-8264-856b482c3841", + "label": "CJB_117(2020) metadata", + "value": "27731" + }, + { + "description": "Jurisdiction Metadata for CJB_107(2020) id b1e0ecf3-8d1a-44e3-b4fd-2dbfdc5c57c5", + "key": "b1e0ecf3-8d1a-44e3-b4fd-2dbfdc5c57c5", + "label": "CJB_107(2020) metadata", + "value": "27732" + }, + { + "description": "Jurisdiction Metadata for CJB_17(2020) id 117a1374-3496-4292-aecd-92316e0c8d5a", + "key": "117a1374-3496-4292-aecd-92316e0c8d5a", + "label": "CJB_17(2020) metadata", + "value": "27733" + }, + { + "description": "Jurisdiction Metadata for CJB_43(2020) id 2f6e50d7-285d-4744-b1a6-c7be800d235f", + "key": "2f6e50d7-285d-4744-b1a6-c7be800d235f", + "label": "CJB_43(2020) metadata", + "value": "27734" + }, + { + "description": "Jurisdiction Metadata for CJB_13(2020) id 89bc70ac-3bea-4c0c-b9e6-6d7d4c64a8fb", + "key": "89bc70ac-3bea-4c0c-b9e6-6d7d4c64a8fb", + "label": "CJB_13(2020) metadata", + "value": "27735" + }, + { + "description": "Jurisdiction Metadata for CJB_84(2020) id 11b67bc4-3935-46e6-b8ff-56d9f70a484f", + "key": "11b67bc4-3935-46e6-b8ff-56d9f70a484f", + "label": "CJB_84(2020) metadata", + "value": "27736" + }, + { + "description": "Jurisdiction Metadata for CJB_75(2020) id 75cc2e59-0803-41ae-a65c-5660539f89a5", + "key": "75cc2e59-0803-41ae-a65c-5660539f89a5", + "label": "CJB_75(2020) metadata", + "value": "27737" + }, + { + "description": "Jurisdiction Metadata for CJB_104(2020) id b96d0684-8e40-4056-a45b-6210a3197de5", + "key": "b96d0684-8e40-4056-a45b-6210a3197de5", + "label": "CJB_104(2020) metadata", + "value": "27738" + }, + { + "description": "Jurisdiction Metadata for CJB_48(2020) id 5aac8e73-3e56-4a9f-9f2b-6a6157037d53", + "key": "5aac8e73-3e56-4a9f-9f2b-6a6157037d53", + "label": "CJB_48(2020) metadata", + "value": "27739" + }, + { + "description": "Jurisdiction Metadata for CJB_111(2020) id d00505de-fe91-4d2f-a39e-6e00e3121bac", + "key": "d00505de-fe91-4d2f-a39e-6e00e3121bac", + "label": "CJB_111(2020) metadata", + "value": "27740" + }, + { + "description": "Jurisdiction Metadata for CJB_32(2020) id 65c754de-2b08-4993-ba94-d96b84e2581b", + "key": "65c754de-2b08-4993-ba94-d96b84e2581b", + "label": "CJB_32(2020) metadata", + "value": "27741" + }, + { + "description": "Jurisdiction Metadata for CJB_76(2020) id 71a4e101-e619-45dc-ae44-f7fb9b852c4e", + "key": "71a4e101-e619-45dc-ae44-f7fb9b852c4e", + "label": "CJB_76(2020) metadata", + "value": "27742" + }, + { + "description": "Jurisdiction Metadata for CJB_129(2020) id 7bd46e02-6e8d-46e7-b0b1-5b057b276f9b", + "key": "7bd46e02-6e8d-46e7-b0b1-5b057b276f9b", + "label": "CJB_129(2020) metadata", + "value": "27743" + }, + { + "description": "Jurisdiction Metadata for CJB_69(2020) id e19005d6-c742-44a6-8770-2935555b4007", + "key": "e19005d6-c742-44a6-8770-2935555b4007", + "label": "CJB_69(2020) metadata", + "value": "27744" + }, + { + "description": "Jurisdiction Metadata for CJB_6(2020) id 875d1c8f-fa2b-42d6-b51c-4119aa3a5f69", + "key": "875d1c8f-fa2b-42d6-b51c-4119aa3a5f69", + "label": "CJB_6(2020) metadata", + "value": "27745" + }, + { + "description": "Jurisdiction Metadata for CJB_36(2020) id 28c7bfe1-5887-480a-9968-7a56d92fbe72", + "key": "28c7bfe1-5887-480a-9968-7a56d92fbe72", + "label": "CJB_36(2020) metadata", + "value": "27746" + }, + { + "description": "Jurisdiction Metadata for CJB_20(2020) id 141fcb3b-0e03-4d82-922f-5b1193c9650b", + "key": "141fcb3b-0e03-4d82-922f-5b1193c9650b", + "label": "CJB_20(2020) metadata", + "value": "27747" + }, + { + "description": "Jurisdiction Metadata for Chamandala(2020) id 55c7dce3-ed65-45ba-a59a-e20b074df846", + "key": "55c7dce3-ed65-45ba-a59a-e20b074df846", + "label": "Chamandala(2020) metadata", + "value": "27748" + }, + { + "description": "Jurisdiction Metadata for Njoka NHC id 81b26c51-d810-4e4f-9a9c-c18f87db5656", + "key": "81b26c51-d810-4e4f-9a9c-c18f87db5656", + "label": "Njoka NHC metadata", + "value": "27749" + }, + { + "description": "Jurisdiction Metadata for CDZ_81(2020) id dfcf011a-c7f4-478e-9ae0-18addf7fa0f2", + "key": "dfcf011a-c7f4-478e-9ae0-18addf7fa0f2", + "label": "CDZ_81(2020) metadata", + "value": "27750" + }, + { + "description": "Jurisdiction Metadata for CDZ_79(2020) id 9b3957ec-ecbf-4594-b719-193911dc7a04", + "key": "9b3957ec-ecbf-4594-b719-193911dc7a04", + "label": "CDZ_79(2020) metadata", + "value": "27751" + }, + { + "description": "Jurisdiction Metadata for CDZ_71(2020) id 93184b85-e237-4b50-97a0-f66a02d1c5b7", + "key": "93184b85-e237-4b50-97a0-f66a02d1c5b7", + "label": "CDZ_71(2020) metadata", + "value": "27752" + }, + { + "description": "Jurisdiction Metadata for CDZ_78(2020) id 0c8b16ff-3d02-4b69-82b9-d228622d718e", + "key": "0c8b16ff-3d02-4b69-82b9-d228622d718e", + "label": "CDZ_78(2020) metadata", + "value": "27753" + }, + { + "description": "Jurisdiction Metadata for CDZ_80(2020) id 172cb39d-e856-467e-9a7e-9e61a14d5f64", + "key": "172cb39d-e856-467e-9a7e-9e61a14d5f64", + "label": "CDZ_80(2020) metadata", + "value": "27754" + }, + { + "description": "Jurisdiction Metadata for CDZ_77(2020) id 2e78534f-0fbd-4668-8609-a5c053a1be6e", + "key": "2e78534f-0fbd-4668-8609-a5c053a1be6e", + "label": "CDZ_77(2020) metadata", + "value": "27755" + }, + { + "description": "Jurisdiction Metadata for CDZ_73(2020) id f48b5fd1-8eec-4cca-b474-f27cf6b6746b", + "key": "f48b5fd1-8eec-4cca-b474-f27cf6b6746b", + "label": "CDZ_73(2020) metadata", + "value": "27756" + }, + { + "description": "Jurisdiction Metadata for CDZ_72(2020) id 284e3323-9823-49ae-a063-8def71d71cb9", + "key": "284e3323-9823-49ae-a063-8def71d71cb9", + "label": "CDZ_72(2020) metadata", + "value": "27757" + }, + { + "description": "Jurisdiction Metadata for CDZ_70(2020) id 651968d3-7793-4a40-b2fc-a9b9084523d6", + "key": "651968d3-7793-4a40-b2fc-a9b9084523d6", + "label": "CDZ_70(2020) metadata", + "value": "27758" + }, + { + "description": "Jurisdiction Metadata for CDZ_75(2020) id 6c3634df-7149-4760-ab46-260671174de2", + "key": "6c3634df-7149-4760-ab46-260671174de2", + "label": "CDZ_75(2020) metadata", + "value": "27759" + }, + { + "description": "Jurisdiction Metadata for CDZ_76(2020) id e9469297-75af-4c1f-b2f4-ca30c93e79d8", + "key": "e9469297-75af-4c1f-b2f4-ca30c93e79d8", + "label": "CDZ_76(2020) metadata", + "value": "27760" + }, + { + "description": "Jurisdiction Metadata for CDZ_74(2020) id c0b2c6b8-f75b-4076-b0de-bc05a7e9c112", + "key": "c0b2c6b8-f75b-4076-b0de-bc05a7e9c112", + "label": "CDZ_74(2020) metadata", + "value": "27761" + }, + { + "description": "Jurisdiction Metadata for Miti(2020) id dc8452e4-60b7-4b3e-a31f-6409dfd961e3", + "key": "dc8452e4-60b7-4b3e-a31f-6409dfd961e3", + "label": "Miti(2020) metadata", + "value": "27762" + }, + { + "description": "Jurisdiction Metadata for Kamupandani_NHC id 37e41ade-b662-44c8-bf2f-aedca2c82d29", + "key": "37e41ade-b662-44c8-bf2f-aedca2c82d29", + "label": "Kamupandani_NHC metadata", + "value": "27763" + }, + { + "description": "Jurisdiction Metadata for MTI_112(2020) id f1f14aaa-5bb9-400f-8d2f-6023d21fa882", + "key": "f1f14aaa-5bb9-400f-8d2f-6023d21fa882", + "label": "MTI_112(2020) metadata", + "value": "27764" + }, + { + "description": "Jurisdiction Metadata for MTI_111(2020) id b69efe21-3d6f-4055-b1f0-3ba8b0de6d7b", + "key": "b69efe21-3d6f-4055-b1f0-3ba8b0de6d7b", + "label": "MTI_111(2020) metadata", + "value": "27765" + }, + { + "description": "Jurisdiction Metadata for MTI_16(2020) id 6dedfc44-3683-4849-96fb-9fa0e0c21671", + "key": "6dedfc44-3683-4849-96fb-9fa0e0c21671", + "label": "MTI_16(2020) metadata", + "value": "27766" + }, + { + "description": "Jurisdiction Metadata for MTI_109(2020) id 9dde2aef-cc3e-4bc2-8c0d-58e1a96dcca5", + "key": "9dde2aef-cc3e-4bc2-8c0d-58e1a96dcca5", + "label": "MTI_109(2020) metadata", + "value": "27767" + }, + { + "description": "Jurisdiction Metadata for MTI_12(2020) id b417e9b1-ef86-41d7-915f-cc32b186304e", + "key": "b417e9b1-ef86-41d7-915f-cc32b186304e", + "label": "MTI_12(2020) metadata", + "value": "27768" + }, + { + "description": "Jurisdiction Metadata for MTI_86(2020) id d7a83e3c-6fbd-4fe3-b2b5-627d9d7fccff", + "key": "d7a83e3c-6fbd-4fe3-b2b5-627d9d7fccff", + "label": "MTI_86(2020) metadata", + "value": "27769" + }, + { + "description": "Jurisdiction Metadata for MTI_58(2020) id 7116a5d5-b9d7-4c93-a176-b82a5fb1f209", + "key": "7116a5d5-b9d7-4c93-a176-b82a5fb1f209", + "label": "MTI_58(2020) metadata", + "value": "27770" + }, + { + "description": "Jurisdiction Metadata for MTI_25(2020) id a4d2a97a-cfcc-44b4-a0b4-0e1b3d245b09", + "key": "a4d2a97a-cfcc-44b4-a0b4-0e1b3d245b09", + "label": "MTI_25(2020) metadata", + "value": "27771" + }, + { + "description": "Jurisdiction Metadata for MTI_46(2020) id aef2c881-06cd-4e6e-9bda-468e48d846be", + "key": "aef2c881-06cd-4e6e-9bda-468e48d846be", + "label": "MTI_46(2020) metadata", + "value": "27772" + }, + { + "description": "Jurisdiction Metadata for MTI_20(2020) id 9ca5f4bd-f7dc-45f3-94d9-3cca52347a8f", + "key": "9ca5f4bd-f7dc-45f3-94d9-3cca52347a8f", + "label": "MTI_20(2020) metadata", + "value": "27773" + }, + { + "description": "Jurisdiction Metadata for MTI_14(2020) id c624172d-148b-49f9-aa09-9d77aad8d331", + "key": "c624172d-148b-49f9-aa09-9d77aad8d331", + "label": "MTI_14(2020) metadata", + "value": "27774" + }, + { + "description": "Jurisdiction Metadata for MTI_6(2020) id fcdc33cd-6fe7-4194-9fa6-f90213742caa", + "key": "fcdc33cd-6fe7-4194-9fa6-f90213742caa", + "label": "MTI_6(2020) metadata", + "value": "27775" + }, + { + "description": "Jurisdiction Metadata for MTI_79(2020) id 0a4e75f4-2ba7-460b-b98c-9ff13bc925c2", + "key": "0a4e75f4-2ba7-460b-b98c-9ff13bc925c2", + "label": "MTI_79(2020) metadata", + "value": "27776" + }, + { + "description": "Jurisdiction Metadata for MTI_28(2020) id b3956fd6-8c37-4154-8091-62fbbf56d400", + "key": "b3956fd6-8c37-4154-8091-62fbbf56d400", + "label": "MTI_28(2020) metadata", + "value": "27777" + }, + { + "description": "Jurisdiction Metadata for MTI_64(2020) id cb78a60d-40b0-4a40-bd80-80da6c08915c", + "key": "cb78a60d-40b0-4a40-bd80-80da6c08915c", + "label": "MTI_64(2020) metadata", + "value": "27778" + }, + { + "description": "Jurisdiction Metadata for MTI_68(2020) id 560ea6a1-2a05-4fcb-bc34-848d2b4b9a5c", + "key": "560ea6a1-2a05-4fcb-bc34-848d2b4b9a5c", + "label": "MTI_68(2020) metadata", + "value": "27779" + }, + { + "description": "Jurisdiction Metadata for MTI_62(2020) id 90a66149-660d-46fa-a2cd-c95334a21c9f", + "key": "90a66149-660d-46fa-a2cd-c95334a21c9f", + "label": "MTI_62(2020) metadata", + "value": "27780" + }, + { + "description": "Jurisdiction Metadata for MTI_34(2020) id c836ed39-68af-4f87-8066-698d65e8d236", + "key": "c836ed39-68af-4f87-8066-698d65e8d236", + "label": "MTI_34(2020) metadata", + "value": "27781" + }, + { + "description": "Jurisdiction Metadata for MTI_57(2020) id 4dfefa1d-d9e9-4039-87d5-841e3fcfa71b", + "key": "4dfefa1d-d9e9-4039-87d5-841e3fcfa71b", + "label": "MTI_57(2020) metadata", + "value": "27782" + }, + { + "description": "Jurisdiction Metadata for MTI_91(2020) id 87649f82-0b7b-410d-a192-6132378b0e54", + "key": "87649f82-0b7b-410d-a192-6132378b0e54", + "label": "MTI_91(2020) metadata", + "value": "27783" + }, + { + "description": "Jurisdiction Metadata for MTI_80(2020) id e373df12-7352-4298-af4d-5d4acc792ee4", + "key": "e373df12-7352-4298-af4d-5d4acc792ee4", + "label": "MTI_80(2020) metadata", + "value": "27784" + }, + { + "description": "Jurisdiction Metadata for MTI_100(2020) id 27227c88-a14e-4322-9d82-ef13c98f0f8d", + "key": "27227c88-a14e-4322-9d82-ef13c98f0f8d", + "label": "MTI_100(2020) metadata", + "value": "27785" + }, + { + "description": "Jurisdiction Metadata for MTI_63(2020) id f4e0e380-791a-45be-b7be-05618dedda21", + "key": "f4e0e380-791a-45be-b7be-05618dedda21", + "label": "MTI_63(2020) metadata", + "value": "27786" + }, + { + "description": "Jurisdiction Metadata for MTI_74(2020) id 10818640-6029-4391-9d92-a7f823d4f08b", + "key": "10818640-6029-4391-9d92-a7f823d4f08b", + "label": "MTI_74(2020) metadata", + "value": "27787" + }, + { + "description": "Jurisdiction Metadata for MTI_29(2020) id 78c8c98c-4c2c-444f-9d16-5b40a450b6d3", + "key": "78c8c98c-4c2c-444f-9d16-5b40a450b6d3", + "label": "MTI_29(2020) metadata", + "value": "27788" + }, + { + "description": "Jurisdiction Metadata for MTI_85(2020) id e73ef898-9a0b-4384-a498-03ba4e662ae5", + "key": "e73ef898-9a0b-4384-a498-03ba4e662ae5", + "label": "MTI_85(2020) metadata", + "value": "27789" + }, + { + "description": "Jurisdiction Metadata for MTI_70(2020) id 8b99cf9b-989f-4804-aa3a-aab2a038e638", + "key": "8b99cf9b-989f-4804-aa3a-aab2a038e638", + "label": "MTI_70(2020) metadata", + "value": "27790" + }, + { + "description": "Jurisdiction Metadata for MTI_84(2020) id 5394cfac-cda5-4f9e-9d16-fd10fc43b36f", + "key": "5394cfac-cda5-4f9e-9d16-fd10fc43b36f", + "label": "MTI_84(2020) metadata", + "value": "27791" + }, + { + "description": "Jurisdiction Metadata for MTI_5(2020) id 74acf175-9106-445d-aaa7-b8e16661dfc4", + "key": "74acf175-9106-445d-aaa7-b8e16661dfc4", + "label": "MTI_5(2020) metadata", + "value": "27792" + }, + { + "description": "Jurisdiction Metadata for MTI_113(2020) id 298e0e2a-4cd7-4026-a344-33641f525bc1", + "key": "298e0e2a-4cd7-4026-a344-33641f525bc1", + "label": "MTI_113(2020) metadata", + "value": "27793" + }, + { + "description": "Jurisdiction Metadata for MTI_2(2020) id 1718ee0a-098f-4f72-93b0-11148e8a5b33", + "key": "1718ee0a-098f-4f72-93b0-11148e8a5b33", + "label": "MTI_2(2020) metadata", + "value": "27794" + }, + { + "description": "Jurisdiction Metadata for MTI_73(2020) id bcbcb544-d25d-4d20-9f11-651794a4004c", + "key": "bcbcb544-d25d-4d20-9f11-651794a4004c", + "label": "MTI_73(2020) metadata", + "value": "27795" + }, + { + "description": "Jurisdiction Metadata for MTI_106(2020) id e23f834a-e1ac-4e67-8508-08355fb32cf2", + "key": "e23f834a-e1ac-4e67-8508-08355fb32cf2", + "label": "MTI_106(2020) metadata", + "value": "27796" + }, + { + "description": "Jurisdiction Metadata for MTI_90(2020) id d1be741e-7c7e-494b-80f4-159c5f5d30c2", + "key": "d1be741e-7c7e-494b-80f4-159c5f5d30c2", + "label": "MTI_90(2020) metadata", + "value": "27797" + }, + { + "description": "Jurisdiction Metadata for MTI_10(2020) id 29261053-43d2-4d3d-a97e-6c768d86d440", + "key": "29261053-43d2-4d3d-a97e-6c768d86d440", + "label": "MTI_10(2020) metadata", + "value": "27798" + }, + { + "description": "Jurisdiction Metadata for MTI_123(2020) id f9ebd90f-6de2-46f0-85fe-6f3aaa61f12d", + "key": "f9ebd90f-6de2-46f0-85fe-6f3aaa61f12d", + "label": "MTI_123(2020) metadata", + "value": "27799" + }, + { + "description": "Jurisdiction Metadata for MTI_45(2020) id 034bfb9a-de7a-4ac1-84ce-f6dab99aa979", + "key": "034bfb9a-de7a-4ac1-84ce-f6dab99aa979", + "label": "MTI_45(2020) metadata", + "value": "27800" + }, + { + "description": "Jurisdiction Metadata for MTI_47(2020) id 0d541eb6-c7a3-46df-8c40-c81d707ef4f3", + "key": "0d541eb6-c7a3-46df-8c40-c81d707ef4f3", + "label": "MTI_47(2020) metadata", + "value": "27801" + }, + { + "description": "Jurisdiction Metadata for MTI_126(2020) id 4405751e-9ea3-4e1e-9f5b-7813c7be1b93", + "key": "4405751e-9ea3-4e1e-9f5b-7813c7be1b93", + "label": "MTI_126(2020) metadata", + "value": "27802" + }, + { + "description": "Jurisdiction Metadata for MTI_19(2020) id efecee0c-c674-4faa-996b-45f0fff3341f", + "key": "efecee0c-c674-4faa-996b-45f0fff3341f", + "label": "MTI_19(2020) metadata", + "value": "27803" + }, + { + "description": "Jurisdiction Metadata for MTI_128(2020) id dd884bfa-dbeb-4cab-a7eb-eaf3e499dea3", + "key": "dd884bfa-dbeb-4cab-a7eb-eaf3e499dea3", + "label": "MTI_128(2020) metadata", + "value": "27804" + }, + { + "description": "Jurisdiction Metadata for MTI_105(2020) id 104d5b74-ecd7-4bd6-b927-540af26c41e0", + "key": "104d5b74-ecd7-4bd6-b927-540af26c41e0", + "label": "MTI_105(2020) metadata", + "value": "27805" + }, + { + "description": "Jurisdiction Metadata for MTI_114(2020) id 5d8a796f-bd94-44b4-86e8-e698f2a4528d", + "key": "5d8a796f-bd94-44b4-86e8-e698f2a4528d", + "label": "MTI_114(2020) metadata", + "value": "27806" + }, + { + "description": "Jurisdiction Metadata for MTI_15(2020) id 29888e76-8c83-4a70-9b3c-9b37299635cd", + "key": "29888e76-8c83-4a70-9b3c-9b37299635cd", + "label": "MTI_15(2020) metadata", + "value": "27807" + }, + { + "description": "Jurisdiction Metadata for MTI_97(2020) id e4b7c1bc-82cc-46cc-8959-c3311486ca15", + "key": "e4b7c1bc-82cc-46cc-8959-c3311486ca15", + "label": "MTI_97(2020) metadata", + "value": "27808" + }, + { + "description": "Jurisdiction Metadata for MTI_72(2020) id 565a7c64-b588-467a-a97f-e4b0132dd6b4", + "key": "565a7c64-b588-467a-a97f-e4b0132dd6b4", + "label": "MTI_72(2020) metadata", + "value": "27809" + }, + { + "description": "Jurisdiction Metadata for MTI_101(2020) id 567052d8-1a99-4eae-af98-e38bb0367670", + "key": "567052d8-1a99-4eae-af98-e38bb0367670", + "label": "MTI_101(2020) metadata", + "value": "27810" + }, + { + "description": "Jurisdiction Metadata for MTI_122(2020) id cdf44e58-5fbc-491a-904e-bc9622b95dec", + "key": "cdf44e58-5fbc-491a-904e-bc9622b95dec", + "label": "MTI_122(2020) metadata", + "value": "27811" + }, + { + "description": "Jurisdiction Metadata for MTI_61(2020) id 3d3bae71-4d68-458b-a01d-bdc25615313c", + "key": "3d3bae71-4d68-458b-a01d-bdc25615313c", + "label": "MTI_61(2020) metadata", + "value": "27812" + }, + { + "description": "Jurisdiction Metadata for MTI_44(2020) id a7abb4e7-92c9-45f4-802e-f9aad477e8e8", + "key": "a7abb4e7-92c9-45f4-802e-f9aad477e8e8", + "label": "MTI_44(2020) metadata", + "value": "27813" + }, + { + "description": "Jurisdiction Metadata for MTI_65(2020) id 5552c8c9-586b-445d-8cb9-72c13ebc89ef", + "key": "5552c8c9-586b-445d-8cb9-72c13ebc89ef", + "label": "MTI_65(2020) metadata", + "value": "27814" + }, + { + "description": "Jurisdiction Metadata for MTI_21(2020) id 42255575-6963-4471-8bed-a8d258bbac39", + "key": "42255575-6963-4471-8bed-a8d258bbac39", + "label": "MTI_21(2020) metadata", + "value": "27815" + }, + { + "description": "Jurisdiction Metadata for MTI_32(2020) id 6ca3d981-64ca-41b5-9005-69607e2b119d", + "key": "6ca3d981-64ca-41b5-9005-69607e2b119d", + "label": "MTI_32(2020) metadata", + "value": "27816" + }, + { + "description": "Jurisdiction Metadata for MTI_36(2020) id 1334723b-1662-436a-afd8-c476042447af", + "key": "1334723b-1662-436a-afd8-c476042447af", + "label": "MTI_36(2020) metadata", + "value": "27817" + }, + { + "description": "Jurisdiction Metadata for MTI_30(2020) id d7a72ec5-0b0c-417d-b21c-570031e840e8", + "key": "d7a72ec5-0b0c-417d-b21c-570031e840e8", + "label": "MTI_30(2020) metadata", + "value": "27818" + }, + { + "description": "Jurisdiction Metadata for MTI_56(2020) id 8c81dbd5-d19e-4d24-bd2d-b42a1cf4f821", + "key": "8c81dbd5-d19e-4d24-bd2d-b42a1cf4f821", + "label": "MTI_56(2020) metadata", + "value": "27819" + }, + { + "description": "Jurisdiction Metadata for MTI_9(2020) id a849d099-dace-4a80-a4e7-182081e7f469", + "key": "a849d099-dace-4a80-a4e7-182081e7f469", + "label": "MTI_9(2020) metadata", + "value": "27820" + }, + { + "description": "Jurisdiction Metadata for MTI_55(2020) id d81cfa54-5b8f-4d8c-b6cf-676839eb0ad6", + "key": "d81cfa54-5b8f-4d8c-b6cf-676839eb0ad6", + "label": "MTI_55(2020) metadata", + "value": "27821" + }, + { + "description": "Jurisdiction Metadata for MTI_38(2020) id c022e54d-6545-4a2b-8e35-3099c7be38e3", + "key": "c022e54d-6545-4a2b-8e35-3099c7be38e3", + "label": "MTI_38(2020) metadata", + "value": "27822" + }, + { + "description": "Jurisdiction Metadata for MTI_119(2020) id 0b046a14-26de-4813-a5e1-8460135f829c", + "key": "0b046a14-26de-4813-a5e1-8460135f829c", + "label": "MTI_119(2020) metadata", + "value": "27823" + }, + { + "description": "Jurisdiction Metadata for MTI_33(2020) id f653d2e2-d152-4514-b520-9f40f0dcca36", + "key": "f653d2e2-d152-4514-b520-9f40f0dcca36", + "label": "MTI_33(2020) metadata", + "value": "27824" + }, + { + "description": "Jurisdiction Metadata for MTI_71(2020) id 7bf137b6-db22-40bd-8df1-c6114d1ef2f6", + "key": "7bf137b6-db22-40bd-8df1-c6114d1ef2f6", + "label": "MTI_71(2020) metadata", + "value": "27825" + }, + { + "description": "Jurisdiction Metadata for MTI_7(2020) id eac964e5-1596-498b-908a-7e35c9acf52e", + "key": "eac964e5-1596-498b-908a-7e35c9acf52e", + "label": "MTI_7(2020) metadata", + "value": "27826" + }, + { + "description": "Jurisdiction Metadata for MTI_39(2020) id e31a3409-f037-476d-a4f9-26091c2883ef", + "key": "e31a3409-f037-476d-a4f9-26091c2883ef", + "label": "MTI_39(2020) metadata", + "value": "27827" + }, + { + "description": "Jurisdiction Metadata for MTI_43(2020) id 84ccba87-c7a6-4abe-b81e-7828177a007c", + "key": "84ccba87-c7a6-4abe-b81e-7828177a007c", + "label": "MTI_43(2020) metadata", + "value": "27828" + }, + { + "description": "Jurisdiction Metadata for MTI_18(2020) id b86ff9c7-70a2-41aa-8e0b-589b1e2496aa", + "key": "b86ff9c7-70a2-41aa-8e0b-589b1e2496aa", + "label": "MTI_18(2020) metadata", + "value": "27829" + }, + { + "description": "Jurisdiction Metadata for MTI_37(2020) id c2dae009-06b4-48b3-97de-087b5f06961d", + "key": "c2dae009-06b4-48b3-97de-087b5f06961d", + "label": "MTI_37(2020) metadata", + "value": "27830" + }, + { + "description": "Jurisdiction Metadata for MTI_99(2020) id 494683ae-f7a3-4f37-a83a-edea1ed21aa1", + "key": "494683ae-f7a3-4f37-a83a-edea1ed21aa1", + "label": "MTI_99(2020) metadata", + "value": "27831" + }, + { + "description": "Jurisdiction Metadata for MTI_82(2020) id 2c99cd14-d2b1-45fe-90ea-846b8d3db51f", + "key": "2c99cd14-d2b1-45fe-90ea-846b8d3db51f", + "label": "MTI_82(2020) metadata", + "value": "27832" + }, + { + "description": "Jurisdiction Metadata for MTI_89(2020) id f505f0af-5ef6-4497-86f8-5efcc08063f4", + "key": "f505f0af-5ef6-4497-86f8-5efcc08063f4", + "label": "MTI_89(2020) metadata", + "value": "27833" + }, + { + "description": "Jurisdiction Metadata for MTI_24(2020) id d44fda06-fade-4190-b8a4-b713c660683c", + "key": "d44fda06-fade-4190-b8a4-b713c660683c", + "label": "MTI_24(2020) metadata", + "value": "27834" + }, + { + "description": "Jurisdiction Metadata for MTI_60(2020) id 6b1845df-2e57-4cff-89fd-65005b516d28", + "key": "6b1845df-2e57-4cff-89fd-65005b516d28", + "label": "MTI_60(2020) metadata", + "value": "27835" + }, + { + "description": "Jurisdiction Metadata for MTI_108(2020) id 70799517-d18d-4a3d-9294-81c5b4bf38a9", + "key": "70799517-d18d-4a3d-9294-81c5b4bf38a9", + "label": "MTI_108(2020) metadata", + "value": "27836" + }, + { + "description": "Jurisdiction Metadata for MTI_102(2020) id e68d7cb1-bf31-486f-9406-4f41c968750c", + "key": "e68d7cb1-bf31-486f-9406-4f41c968750c", + "label": "MTI_102(2020) metadata", + "value": "27837" + }, + { + "description": "Jurisdiction Metadata for MTI_59(2020) id 41dbb4ec-e08d-455d-a247-bb70d7baa120", + "key": "41dbb4ec-e08d-455d-a247-bb70d7baa120", + "label": "MTI_59(2020) metadata", + "value": "27838" + }, + { + "description": "Jurisdiction Metadata for MTI_96(2020) id 3b00e171-94df-4def-ad27-fa44031f8b41", + "key": "3b00e171-94df-4def-ad27-fa44031f8b41", + "label": "MTI_96(2020) metadata", + "value": "27839" + }, + { + "description": "Jurisdiction Metadata for MTI_26(2020) id 3c909213-7ef5-41ae-aeb4-2258779e093e", + "key": "3c909213-7ef5-41ae-aeb4-2258779e093e", + "label": "MTI_26(2020) metadata", + "value": "27840" + }, + { + "description": "Jurisdiction Metadata for MTI_81(2020) id 4d57c175-57e7-43b0-b6e9-31035ac40241", + "key": "4d57c175-57e7-43b0-b6e9-31035ac40241", + "label": "MTI_81(2020) metadata", + "value": "27841" + }, + { + "description": "Jurisdiction Metadata for MTI_116(2020) id 2b054371-6bda-4d7e-90fd-10d2df245698", + "key": "2b054371-6bda-4d7e-90fd-10d2df245698", + "label": "MTI_116(2020) metadata", + "value": "27842" + }, + { + "description": "Jurisdiction Metadata for MTI_95(2020) id 1fe4cb00-706c-4a1b-b2ea-11052132f879", + "key": "1fe4cb00-706c-4a1b-b2ea-11052132f879", + "label": "MTI_95(2020) metadata", + "value": "27843" + }, + { + "description": "Jurisdiction Metadata for MTI_54(2020) id 0b8c714f-68a9-4e8d-b5ea-3a06c25d9ca0", + "key": "0b8c714f-68a9-4e8d-b5ea-3a06c25d9ca0", + "label": "MTI_54(2020) metadata", + "value": "27844" + }, + { + "description": "Jurisdiction Metadata for MTI_42(2020) id 5ca5c770-af83-4620-a1c7-af6d7216b64c", + "key": "5ca5c770-af83-4620-a1c7-af6d7216b64c", + "label": "MTI_42(2020) metadata", + "value": "27845" + }, + { + "description": "Jurisdiction Metadata for MTI_52(2020) id 3da8c19c-c349-4f67-803b-fc731f64ab22", + "key": "3da8c19c-c349-4f67-803b-fc731f64ab22", + "label": "MTI_52(2020) metadata", + "value": "27846" + }, + { + "description": "Jurisdiction Metadata for MTI_124(2020) id 6483bc6d-525c-45f6-a098-11dc29905246", + "key": "6483bc6d-525c-45f6-a098-11dc29905246", + "label": "MTI_124(2020) metadata", + "value": "27847" + }, + { + "description": "Jurisdiction Metadata for MTI_127(2020) id 9cd6d56e-9846-4ff2-8dce-791f40d1314e", + "key": "9cd6d56e-9846-4ff2-8dce-791f40d1314e", + "label": "MTI_127(2020) metadata", + "value": "27848" + }, + { + "description": "Jurisdiction Metadata for MTI_48(2020) id 0b815459-7528-46ca-b961-fcaf39593990", + "key": "0b815459-7528-46ca-b961-fcaf39593990", + "label": "MTI_48(2020) metadata", + "value": "27849" + }, + { + "description": "Jurisdiction Metadata for MTI_129(2020) id 00fb39a6-22c8-43f3-9370-62b8b0e734b4", + "key": "00fb39a6-22c8-43f3-9370-62b8b0e734b4", + "label": "MTI_129(2020) metadata", + "value": "27850" + }, + { + "description": "Jurisdiction Metadata for MTI_83(2020) id d172f9ce-fa65-4e83-97ec-2f888ff974de", + "key": "d172f9ce-fa65-4e83-97ec-2f888ff974de", + "label": "MTI_83(2020) metadata", + "value": "27851" + }, + { + "description": "Jurisdiction Metadata for MTI_22(2020) id 0e521aac-8b6d-4174-b1fe-ef07cdec63bd", + "key": "0e521aac-8b6d-4174-b1fe-ef07cdec63bd", + "label": "MTI_22(2020) metadata", + "value": "27852" + }, + { + "description": "Jurisdiction Metadata for MTI_11(2020) id 55bbeba6-089f-4e0e-b174-84dd73cfa720", + "key": "55bbeba6-089f-4e0e-b174-84dd73cfa720", + "label": "MTI_11(2020) metadata", + "value": "27853" + }, + { + "description": "Jurisdiction Metadata for MTI_103(2020) id d8ebece0-e54b-43cf-8214-dc327f625525", + "key": "d8ebece0-e54b-43cf-8214-dc327f625525", + "label": "MTI_103(2020) metadata", + "value": "27854" + }, + { + "description": "Jurisdiction Metadata for MTI_117(2020) id cd3eb687-a899-4a2d-950a-78de269ba661", + "key": "cd3eb687-a899-4a2d-950a-78de269ba661", + "label": "MTI_117(2020) metadata", + "value": "27855" + }, + { + "description": "Jurisdiction Metadata for MTI_69(2020) id a75a46c2-41fd-43dd-ac52-e03f1c71766e", + "key": "a75a46c2-41fd-43dd-ac52-e03f1c71766e", + "label": "MTI_69(2020) metadata", + "value": "27856" + }, + { + "description": "Jurisdiction Metadata for MTI_40(2020) id a74e926b-d1a9-49bb-92ad-aef9b5c46e73", + "key": "a74e926b-d1a9-49bb-92ad-aef9b5c46e73", + "label": "MTI_40(2020) metadata", + "value": "27857" + }, + { + "description": "Jurisdiction Metadata for MTI_75(2020) id ef2c18e6-0f7a-4913-b9ca-d257e02b19de", + "key": "ef2c18e6-0f7a-4913-b9ca-d257e02b19de", + "label": "MTI_75(2020) metadata", + "value": "27858" + }, + { + "description": "Jurisdiction Metadata for MTI_125(2020) id 3de8ed5c-e4fd-4bf8-a293-94f1ba23eb3b", + "key": "3de8ed5c-e4fd-4bf8-a293-94f1ba23eb3b", + "label": "MTI_125(2020) metadata", + "value": "27859" + }, + { + "description": "Jurisdiction Metadata for MTI_50(2020) id c7ac7e0f-84a5-4486-92da-e3b0326cc691", + "key": "c7ac7e0f-84a5-4486-92da-e3b0326cc691", + "label": "MTI_50(2020) metadata", + "value": "27860" + }, + { + "description": "Jurisdiction Metadata for MTI_120(2020) id 7aafdacc-b6c0-40b7-8abe-f2a2fa2db216", + "key": "7aafdacc-b6c0-40b7-8abe-f2a2fa2db216", + "label": "MTI_120(2020) metadata", + "value": "27861" + }, + { + "description": "Jurisdiction Metadata for MTI_98(2020) id 83e1fa29-f89b-4c79-887f-771047757785", + "key": "83e1fa29-f89b-4c79-887f-771047757785", + "label": "MTI_98(2020) metadata", + "value": "27862" + }, + { + "description": "Jurisdiction Metadata for MTI_41(2020) id f4402c30-180b-4059-bd29-f621b372aae6", + "key": "f4402c30-180b-4059-bd29-f621b372aae6", + "label": "MTI_41(2020) metadata", + "value": "27863" + }, + { + "description": "Jurisdiction Metadata for MTI_67(2020) id 80b29083-1b14-4dab-b4d9-7e53eb95fcc9", + "key": "80b29083-1b14-4dab-b4d9-7e53eb95fcc9", + "label": "MTI_67(2020) metadata", + "value": "27864" + }, + { + "description": "Jurisdiction Metadata for MTI_77(2020) id 6c36b6eb-c4b1-4f77-a467-3d65b21fe31a", + "key": "6c36b6eb-c4b1-4f77-a467-3d65b21fe31a", + "label": "MTI_77(2020) metadata", + "value": "27865" + }, + { + "description": "Jurisdiction Metadata for MTI_1(2020) id 2fefe1ef-5bd4-4105-9052-c132e1dcf4c3", + "key": "2fefe1ef-5bd4-4105-9052-c132e1dcf4c3", + "label": "MTI_1(2020) metadata", + "value": "27866" + }, + { + "description": "Jurisdiction Metadata for MTI_8(2020) id de794ec6-23c1-4ae5-b0f3-69fa994bce09", + "key": "de794ec6-23c1-4ae5-b0f3-69fa994bce09", + "label": "MTI_8(2020) metadata", + "value": "27867" + }, + { + "description": "Jurisdiction Metadata for MTI_94(2020) id 62a7a9ab-4275-457c-81b9-9574dc9b42f3", + "key": "62a7a9ab-4275-457c-81b9-9574dc9b42f3", + "label": "MTI_94(2020) metadata", + "value": "27868" + }, + { + "description": "Jurisdiction Metadata for MTI_93(2020) id 8a6ab35d-0431-47ea-a30e-56ae5150c95d", + "key": "8a6ab35d-0431-47ea-a30e-56ae5150c95d", + "label": "MTI_93(2020) metadata", + "value": "27869" + }, + { + "description": "Jurisdiction Metadata for MTI_4(2020) id 664f66a7-da1f-43f3-b9e0-5d290b8218de", + "key": "664f66a7-da1f-43f3-b9e0-5d290b8218de", + "label": "MTI_4(2020) metadata", + "value": "27870" + }, + { + "description": "Jurisdiction Metadata for MTI_87(2020) id 040147e2-1421-4af4-bac6-7114fc984b87", + "key": "040147e2-1421-4af4-bac6-7114fc984b87", + "label": "MTI_87(2020) metadata", + "value": "27871" + }, + { + "description": "Jurisdiction Metadata for MTI_92(2020) id 7161f7fe-d384-4d80-8637-92f906e12322", + "key": "7161f7fe-d384-4d80-8637-92f906e12322", + "label": "MTI_92(2020) metadata", + "value": "27872" + }, + { + "description": "Jurisdiction Metadata for MTI_110(2020) id 2ec687a1-c54b-4c1e-a2d8-4a1f9fe37b18", + "key": "2ec687a1-c54b-4c1e-a2d8-4a1f9fe37b18", + "label": "MTI_110(2020) metadata", + "value": "27873" + }, + { + "description": "Jurisdiction Metadata for MTI_23(2020) id ed2733f0-c796-43d3-95d6-848764cbd039", + "key": "ed2733f0-c796-43d3-95d6-848764cbd039", + "label": "MTI_23(2020) metadata", + "value": "27874" + }, + { + "description": "Jurisdiction Metadata for MTI_107(2020) id 3378de68-f693-464f-9419-9ba46e0b53e2", + "key": "3378de68-f693-464f-9419-9ba46e0b53e2", + "label": "MTI_107(2020) metadata", + "value": "27875" + }, + { + "description": "Jurisdiction Metadata for MTI_78(2020) id 9fab0976-da46-417e-b10e-bd3073dd1cd8", + "key": "9fab0976-da46-417e-b10e-bd3073dd1cd8", + "label": "MTI_78(2020) metadata", + "value": "27876" + }, + { + "description": "Jurisdiction Metadata for MTI_121(2020) id ea698fee-95d7-4ddf-9ba8-7c06d0f8807b", + "key": "ea698fee-95d7-4ddf-9ba8-7c06d0f8807b", + "label": "MTI_121(2020) metadata", + "value": "27877" + }, + { + "description": "Jurisdiction Metadata for MTI_3(2020) id 3107eff6-ba55-49c7-92c6-2bfbc3229885", + "key": "3107eff6-ba55-49c7-92c6-2bfbc3229885", + "label": "MTI_3(2020) metadata", + "value": "27878" + }, + { + "description": "Jurisdiction Metadata for MTI_53(2020) id 5025d85d-fe0b-4645-9da7-e574e9b62929", + "key": "5025d85d-fe0b-4645-9da7-e574e9b62929", + "label": "MTI_53(2020) metadata", + "value": "27879" + }, + { + "description": "Jurisdiction Metadata for MTI_51(2020) id d330e0ec-0b18-4d1a-944b-ba1d58d86218", + "key": "d330e0ec-0b18-4d1a-944b-ba1d58d86218", + "label": "MTI_51(2020) metadata", + "value": "27880" + }, + { + "description": "Jurisdiction Metadata for MTI_115(2020) id a7f1e2fa-15b9-43f3-918f-f3c1bbf2e18b", + "key": "a7f1e2fa-15b9-43f3-918f-f3c1bbf2e18b", + "label": "MTI_115(2020) metadata", + "value": "27881" + }, + { + "description": "Jurisdiction Metadata for MTI_76(2020) id e636ddcb-4fbc-463c-b1b4-0d01c4478fd8", + "key": "e636ddcb-4fbc-463c-b1b4-0d01c4478fd8", + "label": "MTI_76(2020) metadata", + "value": "27882" + }, + { + "description": "Jurisdiction Metadata for MTI_35(2020) id 65d6819b-9931-4d7f-aaa1-35f92af46a9a", + "key": "65d6819b-9931-4d7f-aaa1-35f92af46a9a", + "label": "MTI_35(2020) metadata", + "value": "27883" + }, + { + "description": "Jurisdiction Metadata for MTI_118(2020) id a4593489-542f-42ac-84f7-5ca9f7d15992", + "key": "a4593489-542f-42ac-84f7-5ca9f7d15992", + "label": "MTI_118(2020) metadata", + "value": "27884" + }, + { + "description": "Jurisdiction Metadata for MTI_66(2020) id 98ed95ff-763a-44b1-81a1-4d8fcdc66c5f", + "key": "98ed95ff-763a-44b1-81a1-4d8fcdc66c5f", + "label": "MTI_66(2020) metadata", + "value": "27885" + }, + { + "description": "Jurisdiction Metadata for MTI_17(2020) id 03a9bc82-f282-4ba0-9c60-ae742beed632", + "key": "03a9bc82-f282-4ba0-9c60-ae742beed632", + "label": "MTI_17(2020) metadata", + "value": "27886" + }, + { + "description": "Jurisdiction Metadata for MTI_27(2020) id 9628bf4e-0f26-4874-a2a6-aaae79085de6", + "key": "9628bf4e-0f26-4874-a2a6-aaae79085de6", + "label": "MTI_27(2020) metadata", + "value": "27887" + }, + { + "description": "Jurisdiction Metadata for MTI_88(2020) id 6ac9df7a-f093-4277-af0b-9b8de917c29f", + "key": "6ac9df7a-f093-4277-af0b-9b8de917c29f", + "label": "MTI_88(2020) metadata", + "value": "27888" + }, + { + "description": "Jurisdiction Metadata for MTI_31(2020) id 5194bfdb-68e4-473d-9f71-f206c5bad2b5", + "key": "5194bfdb-68e4-473d-9f71-f206c5bad2b5", + "label": "MTI_31(2020) metadata", + "value": "27889" + }, + { + "description": "Jurisdiction Metadata for MTI_49(2020) id f2a6bac5-b3f6-4efe-9bbc-98f8d0dca9bc", + "key": "f2a6bac5-b3f6-4efe-9bbc-98f8d0dca9bc", + "label": "MTI_49(2020) metadata", + "value": "27890" + }, + { + "description": "Jurisdiction Metadata for MTI_104(2020) id ebd74b15-d247-4106-826c-74db4e5e0afb", + "key": "ebd74b15-d247-4106-826c-74db4e5e0afb", + "label": "MTI_104(2020) metadata", + "value": "27891" + }, + { + "description": "Jurisdiction Metadata for MTI_13(2020) id 3fa8f9d7-4117-4af5-93db-e28de89cacf6", + "key": "3fa8f9d7-4117-4af5-93db-e28de89cacf6", + "label": "MTI_13(2020) metadata", + "value": "27892" + }, + { + "description": "Jurisdiction Metadata for Zingalume(2020) id dddaff26-42a1-4531-86ef-e56aad1692da", + "key": "dddaff26-42a1-4531-86ef-e56aad1692da", + "label": "Zingalume(2020) metadata", + "value": "27893" + }, + { + "description": "Jurisdiction Metadata for Mpima NHC id a4876acd-86d9-48f3-8b10-ae81b8530414", + "key": "a4876acd-86d9-48f3-8b10-ae81b8530414", + "label": "Mpima NHC metadata", + "value": "27894" + }, + { + "description": "Jurisdiction Metadata for ZGL_2(2020) id dd01946d-642b-47ee-b185-ba9fe0ebef1b", + "key": "dd01946d-642b-47ee-b185-ba9fe0ebef1b", + "label": "ZGL_2(2020) metadata", + "value": "27895" + }, + { + "description": "Jurisdiction Metadata for ZGL_5(2020) id 251535db-2637-4b57-a1d3-e96567591a4a", + "key": "251535db-2637-4b57-a1d3-e96567591a4a", + "label": "ZGL_5(2020) metadata", + "value": "27896" + }, + { + "description": "Jurisdiction Metadata for ZGL_1(2020) id 0a3ae56b-fdb0-427a-8760-c8867b2b9a99", + "key": "0a3ae56b-fdb0-427a-8760-c8867b2b9a99", + "label": "ZGL_1(2020) metadata", + "value": "27897" + }, + { + "description": "Jurisdiction Metadata for ZGL_12(2020) id 4e9cfb5e-4932-4d15-8090-73b5e87db7a0", + "key": "4e9cfb5e-4932-4d15-8090-73b5e87db7a0", + "label": "ZGL_12(2020) metadata", + "value": "27898" + }, + { + "description": "Jurisdiction Metadata for ZGL_3(2020) id 6420a35e-3b4c-40f8-83a6-6775d8ed67eb", + "key": "6420a35e-3b4c-40f8-83a6-6775d8ed67eb", + "label": "ZGL_3(2020) metadata", + "value": "27899" + }, + { + "description": "Jurisdiction Metadata for ZGL_18(2020) id 03e802cc-7f90-4a16-9447-04933dcb5c68", + "key": "03e802cc-7f90-4a16-9447-04933dcb5c68", + "label": "ZGL_18(2020) metadata", + "value": "27900" + }, + { + "description": "Jurisdiction Metadata for ZGL_7(2020) id 5527c7db-f23e-466d-a64e-9a7c211c10e8", + "key": "5527c7db-f23e-466d-a64e-9a7c211c10e8", + "label": "ZGL_7(2020) metadata", + "value": "27901" + }, + { + "description": "Jurisdiction Metadata for ZGL_14(2020) id da62b483-f074-407b-be74-3cc30f309a78", + "key": "da62b483-f074-407b-be74-3cc30f309a78", + "label": "ZGL_14(2020) metadata", + "value": "27902" + }, + { + "description": "Jurisdiction Metadata for ZGL_9(2020) id e8547803-8683-4c8b-b669-51cde0b4cbe2", + "key": "e8547803-8683-4c8b-b669-51cde0b4cbe2", + "label": "ZGL_9(2020) metadata", + "value": "27903" + }, + { + "description": "Jurisdiction Metadata for ZGL_19(2020) id 75578211-17d2-446d-a469-96582f75838c", + "key": "75578211-17d2-446d-a469-96582f75838c", + "label": "ZGL_19(2020) metadata", + "value": "27904" + }, + { + "description": "Jurisdiction Metadata for ZGL_8(2020) id 96983624-ef66-4625-96d7-0d4b677e4361", + "key": "96983624-ef66-4625-96d7-0d4b677e4361", + "label": "ZGL_8(2020) metadata", + "value": "27905" + }, + { + "description": "Jurisdiction Metadata for ZGL_17(2020) id be469428-6477-4fd6-bcc4-bac5d2aaff10", + "key": "be469428-6477-4fd6-bcc4-bac5d2aaff10", + "label": "ZGL_17(2020) metadata", + "value": "27906" + }, + { + "description": "Jurisdiction Metadata for ZGL_6(2020) id 81fbb7f7-152b-446a-98dd-c3956b4099fa", + "key": "81fbb7f7-152b-446a-98dd-c3956b4099fa", + "label": "ZGL_6(2020) metadata", + "value": "27907" + }, + { + "description": "Jurisdiction Metadata for ZGL_11(2020) id 78553040-b8a5-4517-ba40-e9103d806d43", + "key": "78553040-b8a5-4517-ba40-e9103d806d43", + "label": "ZGL_11(2020) metadata", + "value": "27908" + }, + { + "description": "Jurisdiction Metadata for ZGL_10(2020) id 0951e31e-1ddb-4514-8ce9-be2698a344c1", + "key": "0951e31e-1ddb-4514-8ce9-be2698a344c1", + "label": "ZGL_10(2020) metadata", + "value": "27909" + }, + { + "description": "Jurisdiction Metadata for ZGL_4(2020) id 5040dfb0-75f9-403c-8f12-f81de1069180", + "key": "5040dfb0-75f9-403c-8f12-f81de1069180", + "label": "ZGL_4(2020) metadata", + "value": "27910" + }, + { + "description": "Jurisdiction Metadata for ZGL_13(2020) id 1031f274-5b7f-4c60-b674-1cc049e2a49b", + "key": "1031f274-5b7f-4c60-b674-1cc049e2a49b", + "label": "ZGL_13(2020) metadata", + "value": "27911" + }, + { + "description": "Jurisdiction Metadata for ZGL_15(2020) id 60fefab4-31fc-40fb-a3f3-ca3a6b4b9466", + "key": "60fefab4-31fc-40fb-a3f3-ca3a6b4b9466", + "label": "ZGL_15(2020) metadata", + "value": "27912" + }, + { + "description": "Jurisdiction Metadata for ZGL_16(2020) id 06d8727d-062c-4dee-81fe-a210f79804a9", + "key": "06d8727d-062c-4dee-81fe-a210f79804a9", + "label": "ZGL_16(2020) metadata", + "value": "27913" + }, + { + "description": "Jurisdiction Metadata for Mkumbuzi(2020) id 7714f567-1050-4d7f-9401-a245d151d6f5", + "key": "7714f567-1050-4d7f-9401-a245d151d6f5", + "label": "Mkumbuzi(2020) metadata", + "value": "27914" + }, + { + "description": "Jurisdiction Metadata for Mukumbuzi_NHC id c0be6085-05af-41db-bcb1-eeaeedb5aae0", + "key": "c0be6085-05af-41db-bcb1-eeaeedb5aae0", + "label": "Mukumbuzi_NHC metadata", + "value": "27915" + }, + { + "description": "Jurisdiction Metadata for MKB_42(2020) id 14b401d4-f29b-4f59-97e4-2b87f2bfad1c", + "key": "14b401d4-f29b-4f59-97e4-2b87f2bfad1c", + "label": "MKB_42(2020) metadata", + "value": "27916" + }, + { + "description": "Jurisdiction Metadata for MKB_50(2020) id 48249673-52e0-4cfc-a1d9-fc9590f56ecf", + "key": "48249673-52e0-4cfc-a1d9-fc9590f56ecf", + "label": "MKB_50(2020) metadata", + "value": "27917" + }, + { + "description": "Jurisdiction Metadata for MKB_51(2020) id 0e58b01b-d682-473e-b5b0-7ab76ed14781", + "key": "0e58b01b-d682-473e-b5b0-7ab76ed14781", + "label": "MKB_51(2020) metadata", + "value": "27918" + }, + { + "description": "Jurisdiction Metadata for MKB_8(2020) id 021edd5a-8534-49f2-9271-baf51d5d4bae", + "key": "021edd5a-8534-49f2-9271-baf51d5d4bae", + "label": "MKB_8(2020) metadata", + "value": "27919" + }, + { + "description": "Jurisdiction Metadata for MKB_30(2020) id 510c7faa-1acb-4672-8845-8f91254502a5", + "key": "510c7faa-1acb-4672-8845-8f91254502a5", + "label": "MKB_30(2020) metadata", + "value": "27920" + }, + { + "description": "Jurisdiction Metadata for MKB_16(2020) id 92315d6b-a17a-4e23-95b5-456e58fc859c", + "key": "92315d6b-a17a-4e23-95b5-456e58fc859c", + "label": "MKB_16(2020) metadata", + "value": "27921" + }, + { + "description": "Jurisdiction Metadata for MKB_31(2020) id c003a560-d212-4d2b-bb5a-a62bdea36fed", + "key": "c003a560-d212-4d2b-bb5a-a62bdea36fed", + "label": "MKB_31(2020) metadata", + "value": "27922" + }, + { + "description": "Jurisdiction Metadata for MKB_2(2020) id 1bf5f0b8-72bb-4d99-9996-c044b1c1304e", + "key": "1bf5f0b8-72bb-4d99-9996-c044b1c1304e", + "label": "MKB_2(2020) metadata", + "value": "27923" + }, + { + "description": "Jurisdiction Metadata for MKB_56(2020) id 25e38597-9595-47b9-8d32-e13d2d336967", + "key": "25e38597-9595-47b9-8d32-e13d2d336967", + "label": "MKB_56(2020) metadata", + "value": "27924" + }, + { + "description": "Jurisdiction Metadata for MKB_47(2020) id 7cf3354a-a8b4-4ffd-bd2a-f0a7c3a685a3", + "key": "7cf3354a-a8b4-4ffd-bd2a-f0a7c3a685a3", + "label": "MKB_47(2020) metadata", + "value": "27925" + }, + { + "description": "Jurisdiction Metadata for MKB_22(2020) id 66bc9463-9a2e-42cb-893e-3651c9075782", + "key": "66bc9463-9a2e-42cb-893e-3651c9075782", + "label": "MKB_22(2020) metadata", + "value": "27926" + }, + { + "description": "Jurisdiction Metadata for MKB_3(2020) id ffd72b4a-a16a-4412-918f-346c9a72e2a3", + "key": "ffd72b4a-a16a-4412-918f-346c9a72e2a3", + "label": "MKB_3(2020) metadata", + "value": "27927" + }, + { + "description": "Jurisdiction Metadata for MKB_27(2020) id df91b37a-e865-407d-9e1b-8697f336ca3e", + "key": "df91b37a-e865-407d-9e1b-8697f336ca3e", + "label": "MKB_27(2020) metadata", + "value": "27928" + }, + { + "description": "Jurisdiction Metadata for MKB_49(2020) id 3be25594-b8b6-4c60-ab8c-c43db8cdc8da", + "key": "3be25594-b8b6-4c60-ab8c-c43db8cdc8da", + "label": "MKB_49(2020) metadata", + "value": "27929" + }, + { + "description": "Jurisdiction Metadata for MKB_1(2020) id cfe71f26-b1bd-4480-91c5-2dcd4c612f35", + "key": "cfe71f26-b1bd-4480-91c5-2dcd4c612f35", + "label": "MKB_1(2020) metadata", + "value": "27930" + }, + { + "description": "Jurisdiction Metadata for MKB_45(2020) id 74e8ac73-a976-4d1a-b7a9-1510baec7107", + "key": "74e8ac73-a976-4d1a-b7a9-1510baec7107", + "label": "MKB_45(2020) metadata", + "value": "27931" + }, + { + "description": "Jurisdiction Metadata for MKB_28(2020) id 639c8ce6-9925-46e8-a4c4-ca090fafa54b", + "key": "639c8ce6-9925-46e8-a4c4-ca090fafa54b", + "label": "MKB_28(2020) metadata", + "value": "27932" + }, + { + "description": "Jurisdiction Metadata for MKB_11(2020) id 820d257a-c837-42cb-aa24-3246e4ff3ef1", + "key": "820d257a-c837-42cb-aa24-3246e4ff3ef1", + "label": "MKB_11(2020) metadata", + "value": "27933" + }, + { + "description": "Jurisdiction Metadata for MKB_55(2020) id b0ad55c0-e1c8-4321-9e12-9634351a3efa", + "key": "b0ad55c0-e1c8-4321-9e12-9634351a3efa", + "label": "MKB_55(2020) metadata", + "value": "27934" + }, + { + "description": "Jurisdiction Metadata for MKB_36(2020) id 6807f3b4-10fb-4e9b-8007-7ca32579c423", + "key": "6807f3b4-10fb-4e9b-8007-7ca32579c423", + "label": "MKB_36(2020) metadata", + "value": "27935" + }, + { + "description": "Jurisdiction Metadata for MKB_53(2020) id 7b66a5f4-7552-469b-9a9b-d401d698f523", + "key": "7b66a5f4-7552-469b-9a9b-d401d698f523", + "label": "MKB_53(2020) metadata", + "value": "27936" + }, + { + "description": "Jurisdiction Metadata for MKB_24(2020) id c9c9315c-983b-4b57-ba31-b5cb958aaa45", + "key": "c9c9315c-983b-4b57-ba31-b5cb958aaa45", + "label": "MKB_24(2020) metadata", + "value": "27937" + }, + { + "description": "Jurisdiction Metadata for MKB_39(2020) id dcd7aa8f-c2bc-4793-8007-388173f74807", + "key": "dcd7aa8f-c2bc-4793-8007-388173f74807", + "label": "MKB_39(2020) metadata", + "value": "27938" + }, + { + "description": "Jurisdiction Metadata for MKB_33(2020) id c1cb546e-a48b-4b5d-b49a-0e3b2f2eb6d5", + "key": "c1cb546e-a48b-4b5d-b49a-0e3b2f2eb6d5", + "label": "MKB_33(2020) metadata", + "value": "27939" + }, + { + "description": "Jurisdiction Metadata for MKB_40(2020) id 1cea670f-ef79-42bf-9dde-1c7a8c82b094", + "key": "1cea670f-ef79-42bf-9dde-1c7a8c82b094", + "label": "MKB_40(2020) metadata", + "value": "27940" + }, + { + "description": "Jurisdiction Metadata for MKB_57(2020) id 2a120001-1592-4a94-9454-8e37937a6159", + "key": "2a120001-1592-4a94-9454-8e37937a6159", + "label": "MKB_57(2020) metadata", + "value": "27941" + }, + { + "description": "Jurisdiction Metadata for MKB_17(2020) id bbdbda81-ae2c-41ca-bfa3-388cc7ff87ee", + "key": "bbdbda81-ae2c-41ca-bfa3-388cc7ff87ee", + "label": "MKB_17(2020) metadata", + "value": "27942" + }, + { + "description": "Jurisdiction Metadata for MKB_18(2020) id 7db4d43d-7a33-484c-abd1-f49929bc40f4", + "key": "7db4d43d-7a33-484c-abd1-f49929bc40f4", + "label": "MKB_18(2020) metadata", + "value": "27943" + }, + { + "description": "Jurisdiction Metadata for MKB_25(2020) id 3fb5dd04-6b71-46c6-b340-d33dc05d512c", + "key": "3fb5dd04-6b71-46c6-b340-d33dc05d512c", + "label": "MKB_25(2020) metadata", + "value": "27944" + }, + { + "description": "Jurisdiction Metadata for MKB_20(2020) id 05243590-f2b0-47ea-8b51-e4558a861c0b", + "key": "05243590-f2b0-47ea-8b51-e4558a861c0b", + "label": "MKB_20(2020) metadata", + "value": "27945" + }, + { + "description": "Jurisdiction Metadata for MKB_34(2020) id 858a74bb-16cb-4a2c-88ba-61c7a3f1f047", + "key": "858a74bb-16cb-4a2c-88ba-61c7a3f1f047", + "label": "MKB_34(2020) metadata", + "value": "27946" + }, + { + "description": "Jurisdiction Metadata for MKB_7(2020) id c3db8f82-da83-4ef6-9423-20e9673629ba", + "key": "c3db8f82-da83-4ef6-9423-20e9673629ba", + "label": "MKB_7(2020) metadata", + "value": "27947" + }, + { + "description": "Jurisdiction Metadata for MKB_44(2020) id 29a09db8-6b1f-4e4d-ad46-e9a4ac2a7303", + "key": "29a09db8-6b1f-4e4d-ad46-e9a4ac2a7303", + "label": "MKB_44(2020) metadata", + "value": "27948" + }, + { + "description": "Jurisdiction Metadata for MKB_21(2020) id 32e7ff3e-ef14-4ed0-9b68-5877da138243", + "key": "32e7ff3e-ef14-4ed0-9b68-5877da138243", + "label": "MKB_21(2020) metadata", + "value": "27949" + }, + { + "description": "Jurisdiction Metadata for MKB_14(2020) id ca04ba5d-a099-447c-819b-b334963a8591", + "key": "ca04ba5d-a099-447c-819b-b334963a8591", + "label": "MKB_14(2020) metadata", + "value": "27950" + }, + { + "description": "Jurisdiction Metadata for MKB_54(2020) id 90add713-b385-4654-880b-3419ed1908aa", + "key": "90add713-b385-4654-880b-3419ed1908aa", + "label": "MKB_54(2020) metadata", + "value": "27951" + }, + { + "description": "Jurisdiction Metadata for MKB_41(2020) id bc7e2ef6-615c-43bc-afd6-9e11886cc32c", + "key": "bc7e2ef6-615c-43bc-afd6-9e11886cc32c", + "label": "MKB_41(2020) metadata", + "value": "27952" + }, + { + "description": "Jurisdiction Metadata for MKB_43(2020) id 8984b873-04f6-4e19-b4a8-6560b62ee492", + "key": "8984b873-04f6-4e19-b4a8-6560b62ee492", + "label": "MKB_43(2020) metadata", + "value": "27953" + }, + { + "description": "Jurisdiction Metadata for MKB_5(2020) id 9e7e80f6-38f8-40ab-aa70-9c923b15bafb", + "key": "9e7e80f6-38f8-40ab-aa70-9c923b15bafb", + "label": "MKB_5(2020) metadata", + "value": "27954" + }, + { + "description": "Jurisdiction Metadata for MKB_37(2020) id e890e2fd-7142-4dc0-9562-a41bedacb647", + "key": "e890e2fd-7142-4dc0-9562-a41bedacb647", + "label": "MKB_37(2020) metadata", + "value": "27955" + }, + { + "description": "Jurisdiction Metadata for MKB_15(2020) id 1795e47a-aa8a-48cf-bece-68eaf13f5ce7", + "key": "1795e47a-aa8a-48cf-bece-68eaf13f5ce7", + "label": "MKB_15(2020) metadata", + "value": "27956" + }, + { + "description": "Jurisdiction Metadata for MKB_48(2020) id 451ffa94-f845-4bdd-8a17-9187811fff8b", + "key": "451ffa94-f845-4bdd-8a17-9187811fff8b", + "label": "MKB_48(2020) metadata", + "value": "27957" + }, + { + "description": "Jurisdiction Metadata for MKB_32(2020) id aa908b39-2b5a-433a-9554-6bd1ca699664", + "key": "aa908b39-2b5a-433a-9554-6bd1ca699664", + "label": "MKB_32(2020) metadata", + "value": "27958" + }, + { + "description": "Jurisdiction Metadata for MKB_52(2020) id b743f1f1-1ed8-4072-a6c4-26f8b24ed011", + "key": "b743f1f1-1ed8-4072-a6c4-26f8b24ed011", + "label": "MKB_52(2020) metadata", + "value": "27959" + }, + { + "description": "Jurisdiction Metadata for MKB_19(2020) id 0b20c04e-6759-46a3-b3e7-c352461eaa10", + "key": "0b20c04e-6759-46a3-b3e7-c352461eaa10", + "label": "MKB_19(2020) metadata", + "value": "27960" + }, + { + "description": "Jurisdiction Metadata for MKB_13(2020) id 7ef180da-fe57-4f92-a1c2-b345e75d71e9", + "key": "7ef180da-fe57-4f92-a1c2-b345e75d71e9", + "label": "MKB_13(2020) metadata", + "value": "27961" + }, + { + "description": "Jurisdiction Metadata for MKB_46(2020) id 8f9f053f-b0b1-4d65-9c3f-25e9fedd7e4d", + "key": "8f9f053f-b0b1-4d65-9c3f-25e9fedd7e4d", + "label": "MKB_46(2020) metadata", + "value": "27962" + }, + { + "description": "Jurisdiction Metadata for MKB_29(2020) id 83a8c716-a1ec-4b82-ad08-1a10d1c26944", + "key": "83a8c716-a1ec-4b82-ad08-1a10d1c26944", + "label": "MKB_29(2020) metadata", + "value": "27963" + }, + { + "description": "Jurisdiction Metadata for MKB_26(2020) id 64aa44f2-e734-4bf0-921f-0896907548a9", + "key": "64aa44f2-e734-4bf0-921f-0896907548a9", + "label": "MKB_26(2020) metadata", + "value": "27964" + }, + { + "description": "Jurisdiction Metadata for MKB_9(2020) id 3bb5c8ca-5b34-4845-af99-796dc2828599", + "key": "3bb5c8ca-5b34-4845-af99-796dc2828599", + "label": "MKB_9(2020) metadata", + "value": "27965" + }, + { + "description": "Jurisdiction Metadata for MKB_38(2020) id d17e34e2-d586-4027-ac00-3157eb9eea09", + "key": "d17e34e2-d586-4027-ac00-3157eb9eea09", + "label": "MKB_38(2020) metadata", + "value": "27966" + }, + { + "description": "Jurisdiction Metadata for MKB_6(2020) id 6a4029f4-b09f-418c-86e3-505f86a3e180", + "key": "6a4029f4-b09f-418c-86e3-505f86a3e180", + "label": "MKB_6(2020) metadata", + "value": "27967" + }, + { + "description": "Jurisdiction Metadata for MKB_10(2020) id 9b9d4b7b-f4d4-4e3b-b04e-47a1d9fc9d38", + "key": "9b9d4b7b-f4d4-4e3b-b04e-47a1d9fc9d38", + "label": "MKB_10(2020) metadata", + "value": "27968" + }, + { + "description": "Jurisdiction Metadata for MKB_35(2020) id 02c2c854-a9c9-4277-96be-db4459decb2a", + "key": "02c2c854-a9c9-4277-96be-db4459decb2a", + "label": "MKB_35(2020) metadata", + "value": "27969" + }, + { + "description": "Jurisdiction Metadata for MKB_12(2020) id 7b2b61dd-0629-451b-92c8-14b998004cb2", + "key": "7b2b61dd-0629-451b-92c8-14b998004cb2", + "label": "MKB_12(2020) metadata", + "value": "27970" + }, + { + "description": "Jurisdiction Metadata for MKB_23(2020) id 98deb1c2-68be-4626-b2b9-17ce638c569b", + "key": "98deb1c2-68be-4626-b2b9-17ce638c569b", + "label": "MKB_23(2020) metadata", + "value": "27971" + }, + { + "description": "Jurisdiction Metadata for MKB_4(2020) id d6a210e1-933e-4cc8-ad72-9f6f7fc0971d", + "key": "d6a210e1-933e-4cc8-ad72-9f6f7fc0971d", + "label": "MKB_4(2020) metadata", + "value": "27972" } + ], + "teamId": "", + "type": "SettingConfiguration" +} diff --git a/src/test/resources/test-applicationContext-opensrp.xml b/src/test/resources/test-applicationContext-opensrp.xml index b9be90b34..e2faf3158 100644 --- a/src/test/resources/test-applicationContext-opensrp.xml +++ b/src/test/resources/test-applicationContext-opensrp.xml @@ -1,43 +1,44 @@ - - - + + - + - + - + - - - - - - - - - - - - - + + + + + + + + + + + + + - + - + diff --git a/src/test/resources/test-persistence-postgres.xml b/src/test/resources/test-persistence-postgres.xml index acf979810..1780c36b2 100644 --- a/src/test/resources/test-persistence-postgres.xml +++ b/src/test/resources/test-persistence-postgres.xml @@ -1,42 +1,42 @@ - - - - - - - + + + + + + - - - + + + - - - - + + + + - - - - - + + + + + - - - + + + - - - + + +